7

I would like to save the last position of point in the buffer I am visiting, so to have point still there when I go back to that file.

I understand I can use saveplace for this, so I added this snippet in my configuration:

(use-package saveplace ; Save point position in files
  :init (progn
          (setq-default save-place t)
          (toggle-save-place-globally)))

Yet I am not getting the desired behavior: point is still place at the beginning of the buffer.

I am using Emacs 25.0.50.1 (45c92dd), but the same thing is happening with emacs -Q.

11

I am using Emacs 25.0.50.8 and I noticed the behavior of the save-place variable has been changed:

This variable is obsolete since 25.1; use `save-place-mode' instead.

You can type C-h v save-place to read its full documentation.

Below is my config:

(use-package saveplace
  :init (save-place-mode))
  • 3
    There's not much use in :defer t, since calling save-place-mode in :init will trigger loading immediately anyway. – npostavs May 26 '15 at 15:18
  • @npostavs You are right. I forgot that requiring already loaded feature has no effect. I'll update my answer. Thanks for the tip. – xuchunyang May 26 '15 at 16:07
  • Is there a list somewhere of things I need to update after upgrading to Emacs 25 so that other things like this don't break? – incandescentman Jul 26 '16 at 17:48
  • 1
    @incandescentman Yes, just read the Emacs NEWS via C-h n (view-emacs-news), you can also pass a prefix argument to limit it to one specific version such as 25.1. – xuchunyang Jul 26 '16 at 19:16
  • 1
    @GrantBowman Looks like you don't use use-package, thus all you need is (save-place-mode). – xuchunyang Dec 1 '17 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.