summaryrefslogtreecommitdiff
path: root/lisp/saveplace.el
diff options
context:
space:
mode:
authorStefan Kangas <stefankangas@gmail.com>2020-08-08 01:20:01 +0200
committerStefan Kangas <stefankangas@gmail.com>2020-08-08 01:40:38 +0200
commitcdbbc2081ed2da3a641926e76341ed413fb5b9f9 (patch)
tree9cb3d8b9db6ee8ede4b4c9bf7f3f27495368967b /lisp/saveplace.el
parent67ffffa66654236ded2cf121cb3139b07d2ac5c8 (diff)
downloademacs-cdbbc2081ed2da3a641926e76341ed413fb5b9f9.tar.gz
Use lexical-binding in saveplace.el and add tests
* lisp/saveplace.el: Use lexical-binding. (save-place-to-alist): Doc fix. * test/lisp/saveplace-tests.el: * test/lisp/saveplace-resources/saveplace: New files.
Diffstat (limited to 'lisp/saveplace.el')
-rw-r--r--lisp/saveplace.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index 46738ab03dc..d420bfb4e9f 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -1,4 +1,4 @@
-;;; saveplace.el --- automatically save place in files
+;;; saveplace.el --- automatically save place in files -*- lexical-binding:t -*-
;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
@@ -42,7 +42,6 @@
"Automatically save place in files."
:group 'data)
-
(defvar save-place-alist nil
"Alist of saved places to go back to when revisiting files.
Each element looks like (FILENAME . POSITION);
@@ -175,10 +174,11 @@ file:
(declare-function dired-get-filename "dired" (&optional localp no-error-if-not-filep))
(defun save-place-to-alist ()
- ;; put filename and point in a cons box and then cons that onto the
- ;; front of the save-place-alist, if save-place-mode is non-nil.
- ;; Otherwise, just delete that file from the alist.
- ;; first check to make sure alist has been loaded in from the master
+ "Add current buffer filename and position to `save-place-alist'.
+Put filename and point in a cons box and then cons that onto the
+front of the `save-place-alist', if `save-place-mode' is non-nil.
+Otherwise, just delete that file from the alist."
+ ;; First check to make sure alist has been loaded in from the master
;; file. If not, do so, then feel free to modify the alist. It
;; will be saved again when Emacs is killed.
(or save-place-loaded (load-save-place-alist-from-file))