all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andy Sawyer <andy.sawyer@gmail.com>
To: 16673@debbugs.gnu.org
Subject: bug#16673: [saveplace] toggle-save-place doesn't toggle-save-place
Date: Thu, 6 Feb 2014 18:57:57 +0000	[thread overview]
Message-ID: <CADLo3np_9m4FiVJPh5Q953f0UG0UhJSuTw24qWz7qzyWAxRSWA@mail.gmail.com> (raw)

Hi all,
  I noticed a while back that toggle-save-place doesn't actually toggle
save-place. Whilst I mostly run Aquamacs these days, the bug
exists in the existing codebase.

 In particular, in a buffer where save-place is nil, it is unconditionally
turned on. I submitted a path for this to the Aquamacs maintainer, and
include it here for your attention.

(I also took the opportunity to use prefix-numeric-value on the
argument, so it plays nice with C-u).

Regards,
 Andy

$ git diff saveplace.el
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index 91da103..0325475 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -156,12 +156,12 @@ file:
   (if (not (or buffer-file-name (and (derived-mode-p 'dired-mode)
      dired-directory)))
       (message "Buffer `%s' not visiting a file or directory" (buffer-name))
-    (if (and save-place (or (not parg) (<= parg 0)))
- (progn
-  (message "No place will be saved in this file")
-  (setq save-place nil))
-      (message "Place will be saved")
-      (setq save-place t))))
+    (setq save-place (if parg
+                         (> (prefix-numeric-value parg) 0)
+                       (not save-place)))
+    (message (if save-place
+                 "Place will be saved"
+               "No place will be saved in this file"))))





             reply	other threads:[~2014-02-06 18:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 18:57 Andy Sawyer [this message]
2014-02-28  6:44 ` bug#16673: [saveplace] toggle-save-place doesn't toggle-save-place Glenn Morris

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=CADLo3np_9m4FiVJPh5Q953f0UG0UhJSuTw24qWz7qzyWAxRSWA@mail.gmail.com \
    --to=andy.sawyer@gmail.com \
    --cc=16673@debbugs.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 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.