[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] emacs-25 040e0d6: Fix 'toggle-save-place'
From: |
Eli Zaretskii |
Subject: |
Re: [Emacs-diffs] emacs-25 040e0d6: Fix 'toggle-save-place' |
Date: |
Thu, 25 Feb 2016 19:34:58 +0200 |
> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Thu, 25 Feb 2016 12:05:06 -0500
>
> > It makes no sense not to autoload it, because then there's no way for
> > users to turn save-place in a single buffer. Previously, users needed
> > to load saveplace.el to have the feature, so an autoload was not
> > needed.
>
> But that still works "as well as before"
> (i.e. as long as they (require 'saveplace)).
Except that I just told them in NEWS not to...
> > I have nothing against having a local mode, but I don't have time to
> > work on this now, so patches are very welcome.
>
> I think I have something better, but I think some of the changes are too
> late for 25.1, so I suggest we install the patch below (which against
> forces users to use (require 'saveplace) before calling
> toggle-save-place, like before: it's not ideal, but it's not
> a regression).
Fine with me, thanks.
> -;;;###autoload
I'd like to keep the autoload, otherwise there's an asymmetry: the
global mode is autoloaded, the local one isn't.
> (defun toggle-save-place (&optional parg) ;FIXME: save-place-local-mode!
> "Toggle whether to save your place in this file between sessions.
> If this mode is enabled, point is recorded when you kill the buffer
> @@ -167,17 +166,21 @@ toggle-save-place
> (> (prefix-numeric-value parg) 0)
> (not save-place)))
> (cond
> - (save-place
> + (save-place-mode
Shouldn't we also replace save-place above this fragment?
> + ;; FIXME: We should remove the hooks, but only in case this was the
> last
> + ;; buffer using save-place-local-mode. Is it worth the trouble, tho?
No, I don't think it's worth the trouble. Chances are, the user will
promptly enable the mode in some other buffer.