all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: 13122@debbugs.gnu.org
Subject: bug#13122: save-excursion not saving point
Date: Sat, 27 Apr 2019 09:57:24 +0300	[thread overview]
Message-ID: <83imv0vstn.fsf@gnu.org> (raw)
In-Reply-To: <87mukciluz.fsf@calancha-pc.dy.bbexcite.jp> (message from Tino Calancha on Sat, 27 Apr 2019 04:53:56 +0900)

> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Sat, 27 Apr 2019 04:53:56 +0900
> 
> ;; Following expression should eval as non-nil
> (let ((pos 3))
>   (with-temp-buffer
>     (insert "abcdef")
>     (goto-char pos)
>     (save-excursion (transpose-chars 2))
>     (= pos (point))))
> => nil

Why did you think it should evaluate to non-nil?  The ELisp manual has
a warning near the end of description of save-excursion; I think it's
relevant to this use case.






  reply	other threads:[~2019-04-27  6:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-08  6:20 bug#13122: save-excursion not saving point Jyothis V
2012-12-08 11:21 ` martin rudalics
2012-12-21  5:43   ` Chong Yidong
2013-01-07 12:32 ` bug#13122: sort-regexp-fields also seems to not save point Alexander Kjeldaas
2019-04-26 19:53 ` bug#13122: save-excursion not saving point Tino Calancha
2019-04-27  6:57   ` Eli Zaretskii [this message]
2019-04-27  7:44     ` Tino Calancha
2019-04-27  9:59       ` Andreas Schwab
2019-05-04  8:39         ` Tino Calancha

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

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

  git send-email \
    --in-reply-to=83imv0vstn.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=13122@debbugs.gnu.org \
    --cc=tino.calancha@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.