GNU bug report logs - #20712
25.0.50; save-place-mode doesn't work for new files

Previous Next

Package: emacs;

Reported by: Tassilo Horn <tsdh <at> gnu.org>

Date: Mon, 1 Jun 2015 19:54:02 UTC

Severity: normal

Found in version 25.0.50

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Tassilo Horn <tsdh <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 20712 <at> debbugs.gnu.org
Subject: bug#20712: 25.0.50; save-place-mode doesn't work for new files
Date: Wed, 17 Jun 2015 15:54:34 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Putting (save-place-mode) in ~/.emacs doesn't have the desired effects
>> for new files, i.e., files which have no entry in `save-place-alist' /
>> `save-place-file' yet.
>>
>> Recipe:
>>   1. emacs -Q --eval '(save-place-mode)' test.txt
>>   2. Add\nsome\ntext.
>>   3. save and quit emacs
>>   4. emacs -Q --eval '(save-place-mode)' test.txt
>>
>> Expected: point is on the dot in "text."
>> Actual: point is at 0
> [...]
>> introduced with the commit 9c3e1e4e5bc230c4b4fd6649b6afb5d4792592c2.
>
> Oh, indeed, I see the problem: despite the ":global t" argument,
> define-minor-mode sets the var with `setq' rather than with
> `setq-default', so the make-variable-buffer-local causes this code to
> only set the var buffer-locally.
>
> I think define-minor-mode should use setq-default instead.
>
> Can you try the patch below (after which you need to re-compile
> saveplace.el)?

Yes, then it works again.  What a relief! :-)

Bye,
Tassilo




This bug report was last modified 10 years and 27 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.