From 124a2a6eaa2a8d96405168693f9c8e8afc51b10a Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 28 Aug 2025 08:49:51 +1000 Subject: [emacs] misc fixes --- emacs/.emacs.d/lisp/my/my-editing.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'emacs/.emacs.d/lisp/my/my-editing.el') 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] ") -- cgit v1.2.3