aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/lisp/my/my-editing.el
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2025-08-28 08:49:51 +1000
committerYuchen Pei <id@ypei.org>2025-08-28 08:49:51 +1000
commit124a2a6eaa2a8d96405168693f9c8e8afc51b10a (patch)
tree3cdfc91d93c5aec48acf6a0a31d4dc9fe30013a9 /emacs/.emacs.d/lisp/my/my-editing.el
parent4ec9311b65f343ceb9efd6709908a6e5ee44b6d7 (diff)
[emacs] misc fixes
Diffstat (limited to 'emacs/.emacs.d/lisp/my/my-editing.el')
-rw-r--r--emacs/.emacs.d/lisp/my/my-editing.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-editing.el b/emacs/.emacs.d/lisp/my/my-editing.el
index e6499ff..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))))
@@ -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]
")