emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: emacs-orgmode@gnu.org
Subject: save-excursion fails to restore point
Date: Tue, 9 Jun 2009 13:56:52 -0700	[thread overview]
Message-ID: <20524da70906091356x1f0dc7e4h249e2d92f93b9977@mail.gmail.com> (raw)

Here is a minimal test case:

(save-excursion
  (outline-up-heading 1 'invisible-ok)
  (org-sort-entries-or-items nil ?a))

What happens is that point stays on the parent headline.

What I expect is for save-excursion to save point no
differently from just saving point and doing goto-char.

Also:

When I change a todo state and then sort entries manually
using my sort function, everything works.  But when I do so
from org-after-todo-state-change-hook, point gets placed on
the parent headline.  Point gets changed right after the
save-excursion in org-todo (3rd paren from last).

Reproducible?

RMS in the reply to
http://www.archivum.info/bug-gnu-emacs@gnu.org/2006-01/msg00053.html
seems to say that it is inevitable.

Is there a way for org to work around this?

If not, it is a warning to the wise.

-- 
Myalgic encephalomyelitis denialism is causing death and severe suffering,
worse than MS.  Conflicts of interest are destroying research.  /You/ can
get the disease at any time permanently.  Do science and justice matter to
you?  http://www.meactionuk.org.uk/What_Is_ME_What_Is_CFS.htm

             reply	other threads:[~2009-06-09 20:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-09 20:56 Samuel Wales [this message]
2009-06-10  7:03 ` save-excursion fails to restore point Carsten Dominik
2009-06-10 16:11   ` Samuel Wales

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=20524da70906091356x1f0dc7e4h249e2d92f93b9977@mail.gmail.com \
    --to=samologist@gmail.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).