emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] SPACE jumps to tag in header line after hidden emphasis marker


From: Jens Schmidt
Subject: Re: [BUG] SPACE jumps to tag in header line after hidden emphasis marker [9.7-pre (release_9.6.7-562-g5b6268 @ /home/jschmidt/work/org-mode/lisp/)]
Date: Tue, 18 Jul 2023 22:53:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

[Resent with correct identity to make this visible on the list as well - sorry for the hassle.]

On 2023-07-18  10:13, Ihor Radchenko wrote:

Confirmed.

Thanks for caring about this so quickly ...

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64696

... and for the discussion with Eli & co. Which I did not try to follow TBH.

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=3e3b873d3

Well, I have one not-so-minor nit here: With that commit you cannot insert text *before* some text having hidden emphasis without breaking the emphasis. More concretely (in an empty org-mode buffer):

 t           ;; org-self-insert-command
 e           ;; org-self-insert-command
 s           ;; org-self-insert-command
 t           ;; org-self-insert-command
 SPC         ;; org-self-insert-command
 =           ;; org-self-insert-command
 t           ;; org-self-insert-command
 e           ;; org-self-insert-command
 s           ;; org-self-insert-command
 t           ;; org-self-insert-command
 =           ;; org-self-insert-command
 SPC         ;; org-self-insert-command
 t           ;; org-self-insert-command
 e           ;; org-self-insert-command
 s           ;; org-self-insert-command
 t           ;; org-self-insert-command
 C-<left>    ;; left-word
 C-<left>    ;; left-word
 SPC         ;; org-self-insert-command

The last SPC breaks the emphasis around the middle "test", which it did not previously. Previously, the SPC would just move the whole emphasized word one space to the right. Which I somehow got used to, and probably many others as well.

OTOH, to fix my bug, only the first of the new `org-rear-nonsticky-at' calls is actually needed. So probably we could have something like the following to get my bug fixed without any changes in behavior (diff on top of main, that is, in addition to your commit):

diff --git a/lisp/org.el b/lisp/org.el
index 0d8b5386c..71f482f64 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5153,8 +5153,7 @@ stacked delimiters is N. Escaping delimiters is not possible." ;; 8b691a7f-6b62-d573-e5a8-80fac3dc9bc6@vodafonemail.de">https://orgmode.org/list/8b691a7f-6b62-d573-e5a8-80fac3dc9bc6@vodafonemail.de
                 (org-rear-nonsticky-at (match-beginning 5))
                (add-text-properties (match-beginning 3) (match-end 3)
-                                    '(invisible t))
-                (org-rear-nonsticky-at (match-end 3)))
+                                    '(invisible t)))
              (throw :exit t))))))))

 (defun org-emphasize (&optional char)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]