1

Saveplace is a nice tool to remember where I have left of in a file. But for Org files it causes me problems when I quit emacs in the middle of a heading.

My current try to deactivate it in org-files is to use a hook and set 'save-place to nil.

  (require 'saveplace)
  (setq save-place-file (concat user-emacs-directory "saveplace.el") )
  (setq-default save-place t)

  (defun max/org-mode-hook ()
    (setq save-place nil)
    (flyspell-mode))
  (add-hook 'org-mode-hook 'max/org-mode-hook)

This works most of the time but for a strange reason it is sometimes still activated in org-mode and I start at the last position instead of line 1 when I open an org file. I'm not sure how to produce this reliable.

Any tips how I can make the deactivation of saveplace reliable in org-mode?

  • 2
    How about customizing the variable save-place-ignore-files-regexp: Regexp matching files for which no position should be recorded. Useful for temporary file such as commit message files that are automatically created by the VCS. If set to nil, this feature is disabled, i.e., the position is recorded for all files. The default value is: "\\(?:COMMIT_EDITMSG\\|hg-editor-[[:alnum:]]+\\.txt\\|svn-commit\\.tmp\\|bzr_log\\.[[:alnum:]]+\\)$" – lawlist Jan 28 '15 at 17:47

Your Answer

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

Browse other questions tagged or ask your own question.