aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1997-04-15 20:33:18 +0000
committerRichard M. Stallman1997-04-15 20:33:18 +0000
commit20606f3dac9c264bc6f96d1a39e47c3ef14aecfb (patch)
tree995bd9ee3ed4b44cf505e34536fcdc731c62447c /lisp
parentc02f273d17c49e273c7f3432549d38063a75b5a0 (diff)
downloademacs-20606f3dac9c264bc6f96d1a39e47c3ef14aecfb.tar.gz
emacs-20606f3dac9c264bc6f96d1a39e47c3ef14aecfb.zip
Add defgroup; use defcustom for user vars.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/saveplace.el33
1 files changed, 25 insertions, 8 deletions
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index 95a7eb550f1..d3ad772b8a6 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -40,6 +40,11 @@
40;; this is what I was using during testing: 40;; this is what I was using during testing:
41;; (define-key ctl-x-map "p" 'toggle-save-place) 41;; (define-key ctl-x-map "p" 'toggle-save-place)
42 42
43(defgroup save-place nil
44 "Automatically save place in files."
45 :group 'data)
46
47
43(defvar save-place-alist nil 48(defvar save-place-alist nil
44 "Alist of saved places to go back to when revisiting files. 49 "Alist of saved places to go back to when revisiting files.
45Each element looks like (FILENAME . POSITION); 50Each element looks like (FILENAME . POSITION);
@@ -47,7 +52,7 @@ visiting file FILENAME goes automatically to position POSITION
47rather than the beginning of the buffer. 52rather than the beginning of the buffer.
48This alist is saved between Emacs sessions.") 53This alist is saved between Emacs sessions.")
49 54
50(defvar save-place nil 55(defcustom save-place nil
51 "*Non-nil means automatically save place in each file. 56 "*Non-nil means automatically save place in each file.
52This means when you visit a file, point goes to the last place 57This means when you visit a file, point goes to the last place
53where it was when you previously visited the same file. 58where it was when you previously visited the same file.
@@ -56,25 +61,37 @@ This variable is automatically buffer-local.
56If you wish your place in any file to always be automatically saved, 61If you wish your place in any file to always be automatically saved,
57simply put this in your `~/.emacs' file: 62simply put this in your `~/.emacs' file:
58 63
59\(setq-default save-place t\)") 64\(setq-default save-place t\)"
65 :type 'boolean
66 :group 'save-place)
60 67
61(make-variable-buffer-local 'save-place) 68(make-variable-buffer-local 'save-place)
62 69
63(defvar save-place-file (convert-standard-filename "~/.emacs-places") 70(defcustom save-place-file (convert-standard-filename "~/.emacs-places")
64 "*Name of the file that records `save-place-alist' value.") 71 "*Name of the file that records `save-place-alist' value."
72 :type 'file
73 :group 'save-place)
65 74
66(defvar save-place-version-control 'nospecial 75(defcustom save-place-version-control 'nospecial
67 "*Controls whether to make numbered backups of master save-place file. 76 "*Controls whether to make numbered backups of master save-place file.
68It can have four values: t, nil, `never', and `nospecial'. The first 77It can have four values: t, nil, `never', and `nospecial'. The first
69three have the same meaning that they do for the variable 78three have the same meaning that they do for the variable
70`version-control', and the final value `nospecial' means just use the 79`version-control', and the final value `nospecial' means just use the
71value of `version-control'.") 80value of `version-control'."
81 :type '(radio (const :tag "Unconditionally" t)
82 (const :tag "For VC Files" nil)
83 (const never)
84 (const :tag "Use value of version-control" nospecial))
85 :group 'save-place)
72 86
73(defvar save-place-loaded nil 87(defvar save-place-loaded nil
74 "Non-nil means that the `save-place-file' has been loaded.") 88 "Non-nil means that the `save-place-file' has been loaded.")
75 89
76(defvar save-place-limit nil 90(defcustom save-place-limit nil
77 "Maximum number of entries to retain in the list; nil means no limit.") 91 "Maximum number of entries to retain in the list; nil means no limit."
92 :type '(choice (integer :tag "Entries" :value 1)
93 (const :tag "No Limit" nil))
94 :group 'save-place)
78 95
79(defun toggle-save-place (&optional parg) 96(defun toggle-save-place (&optional parg)
80 "Toggle whether to save your place in this file between sessions. 97 "Toggle whether to save your place in this file between sessions.