X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/3a87e7efbc7e021c68b08dddb52523144027ebef..41a1f4fa1d4585563360c989c27501cb4fee255e:/el/dot-emacs.el?ds=sidebyside diff --git a/el/dot-emacs.el b/el/dot-emacs.el index a3bc6f3..b30a963 100644 --- a/el/dot-emacs.el +++ b/el/dot-emacs.el @@ -908,7 +908,7 @@ in REST." (erase-buffer) (shell-command "date +%Y-%m-%d" t) (goto-char (mark)) - (delete-backward-char 1) + (delete-char -1) (buffer-string)) (kill-buffer buffer)))))) @@ -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