From 41a1f4fa1d4585563360c989c27501cb4fee255e Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Fri, 13 Sep 2019 17:09:34 +0100 Subject: [PATCH 1/1] el/dot-emacs.el (comint-...): Lift out into utilities. They didn't really have much to do with Lisp. --- el/dot-emacs.el | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/el/dot-emacs.el b/el/dot-emacs.el index 0f4d086..b30a963 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -979,6 +979,21 @@ tramp, which seems to get itself into a twist." (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 @@ that character only to be normal punctuation.") (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 -- 2.11.0