emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: zhaoyiyu <zhyznd@163.com>
To: emacs-orgmode@gnu.org
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	[thread overview]
Message-ID: <401a5562-eb2a-8338-b391-95af34a117f7@163.com> (raw)



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	other threads:[~2023-08-27  5:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-27  5:12 zhaoyiyu [this message]
2023-08-27  8:26 ` [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/)] Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=401a5562-eb2a-8338-b391-95af34a117f7@163.com \
    --to=zhyznd@163.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).