[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#20712: 25.0.50; save-place-mode doesn't work for new files
From: |
Tassilo Horn |
Subject: |
bug#20712: 25.0.50; save-place-mode doesn't work for new files |
Date: |
Wed, 17 Jun 2015 15:54:34 +0200 |
User-agent: |
Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) |
Stefan Monnier <monnier@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