Browse files

saveplace.el : Fix toggle-save-place

(toggle-save-place 0) now correctly handles the case where save-place
is already nil.

Use prefix-numeric-value to place nicely with C-u / C-- etc
  • Loading branch information...
1 parent e7ee0d5 commit 3be78ea0384d81f7a9545cac404a9b3be2fa8ceb @PureAbstract PureAbstract committed Nov 5, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 lisp/saveplace.el
@@ -145,12 +145,12 @@ To save places automatically in all files, put this in your `.emacs' file:
(interactive "P")
(if (not buffer-file-name)
(message "Buffer `%s' not visiting a file" (buffer-name))
- (if (and save-place (or (not parg) (<= parg 0)))
- (progn
- (message "No place will be saved in this file")
- (setq save-place nil))
- (message "Place will be saved")
- (setq save-place t))))
+ (setq save-place (if parg
+ (> (prefix-numeric-value parg) 0)
+ (not save-place)))
+ (message (if save-place
+ "Place will be saved"
+ "No place will be saved in this file"))))
(defun save-place-to-alist ()
;; put filename and point in a cons box and then cons that onto the

0 comments on commit 3be78ea

Please sign in to comment.