emacs-orgmode
[Top][All Lists]
Advanced

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

[BUG] org-up-heading-safe behaves different in v9.7 [9.7 (9.7-??-d6f3aed


From: zhaoyiyu
Subject: [BUG] org-up-heading-safe behaves different in v9.7 [9.7 (9.7-??-d6f3aed @ /home/zhaoyiyu/.config/emacs/.local/straight/build-28.1/org/)]
Date: Sun, 27 Aug 2023 13:12:23 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0



Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See

https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------

When I track down a issue about org-journal, with org v9.7
I noticed that when execute
(org-up-heading-safe)
it's different with org v9.6, which would caused the org-journal issue.
In detail as follows org file. After execution the cursor position will
change to


File Header                 <-- v9.7, return nil and cursor here
* heading lv 1             <-- v9.6, return nil and cursor here
some contents and your prev cursor is here I


Personaly, I write a advice to fix the issue


(defun myfunc/org-up-heading-safe ()
(let* ((heading (org-element-lineage
(org-element-at-point)
'(headline inlinetask) 'with-self))
(parent (org-element-parent heading))
(ret (and parent
(org-element-property :level parent)
(<= (point-min) (org-element-begin parent)))))
(if ret
(goto-char (org-element-begin parent))
(when heading
(goto-char (org-element-begin heading))))
ret))
(advice-add 'org-up-heading-safe :override #'myfunc/org-up-heading-safe)

However, Since I didn't get the purpose for the org v9.7 changes, I
submit this issue here.


Emacs : GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0)
of 2022-05-31
Package: Org mode version 9.7 (9.7-??-d6f3aed @ /home/zhaoyiyu/.config/emacs/.local/straight/build-28.1/org/)




reply via email to

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