diff options
Diffstat (limited to 'emacs/.emacs.d/lisp/my/my-editing.el')
| -rw-r--r-- | emacs/.emacs.d/lisp/my/my-editing.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-editing.el b/emacs/.emacs.d/lisp/my/my-editing.el index 13d80f8..8ce68dd 100644 --- a/emacs/.emacs.d/lisp/my/my-editing.el +++ b/emacs/.emacs.d/lisp/my/my-editing.el @@ -189,7 +189,10 @@ by passing optional prefix ARG (\\[universal-argument])." (beginning-of-line) (newline) (forward-line -1) - (indent-according-to-mode)) + ;; `indent-according-to-mode' causes cursor to jump to the + ;; beginning of an org src block + (unless (and (derived-mode-p 'org-mode) (org-in-src-block-p)) + (indent-according-to-mode))) (forward-line -1) (my-new-line-below)))) @@ -528,7 +531,7 @@ With an prefix-arg, copy the file name relative to project root." (interactive) (let ((old-max (point-max)) (old-point (point))) - (comment-kill (or n 1)) + (when comment-start (comment-kill (or n 1))) (when (= old-max (point-max)) (goto-char old-point) (kill-sexp n)))) @@ -547,7 +550,7 @@ With an prefix-arg, copy the file name relative to project root." (defun my-elide-region (b e) (interactive "r") (let ((message-elide-ellipsis - (if (> 1 (count-lines b (min (1+ e) (point-max)))) + (if (> (count-lines b (min (1+ e) (point-max))) 1) (concat comment-start " [... %l lines elided] ") |
