chiark / gitweb /
el/dot-emacs.el (comint-...): Lift out into utilities.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 13 Sep 2019 16:09:34 +0000 (17:09 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 13 Sep 2019 16:09:48 +0000 (17:09 +0100)
They didn't really have much to do with Lisp.

el/dot-emacs.el

index 0f4d086ce9beed0a4c2e9d6b504a7a3717736a10..b30a963ab8e2c984343bd1ba61f2639fba8023ea 100644 (file)
@@ -979,6 +979,21 @@ (defun mdw-auto-revert ()
   (let ((auto-revert-check-vc-info t))
     (auto-revert-buffers)))
 
+(defun comint-send-and-indent ()
+  (interactive)
+  (comint-send-input)
+  (and mdw-auto-indent
+       (indent-for-tab-command)))
+
+(defadvice comint-line-beginning-position
+    (around mdw-calculate-it-properly () activate compile)
+  "Calculate the actual line start for multi-line input."
+  (if (or comint-use-prompt-regexp
+         (eq (field-at-pos (point)) 'output))
+      ad-do-it
+    (setq ad-return-value
+         (constrain-to-field (line-beginning-position) (point)))))
+
 ;;;--------------------------------------------------------------------------
 ;;; Dired hacking.
 
@@ -3955,21 +3970,6 @@ (defun mdw-fontify-lispy ()
              (list "\\(\\s.\\|\\s(\\|\\s)\\|\\s\\\\|\\s/\\)"
                    '(0 mdw-punct-face)))))
 
-(defun comint-send-and-indent ()
-  (interactive)
-  (comint-send-input)
-  (and mdw-auto-indent
-       (indent-for-tab-command)))
-
-(defadvice comint-line-beginning-position
-    (around mdw-calculate-it-properly () activate compile)
-  "Calculate the actual line start for multi-line input."
-  (if (or comint-use-prompt-regexp
-         (eq (field-at-pos (point)) 'output))
-      ad-do-it
-    (setq ad-return-value
-         (constrain-to-field (line-beginning-position) (point)))))
-
 (defun mdw-setup-m4 ()
 
   ;; Inexplicably, Emacs doesn't match braces in m4 mode.  This is very