comparison lisp/prim/options.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents b82b59fe008d
children b9518feda344
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of 15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ;; General Public License for more details. 17 ;; General Public License for more details.
18 18
19 ;; You should have received a copy of the GNU General Public License 19 ;; You should have received a copy of the GNU General Public License
20 ;; along with XEmacs; see the file COPYING. If not, write to the Free 20 ;; along with XEmacs; see the file COPYING. If not, write to the
21 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 21 ;; Free Software Foundation, 59 Temple Place - Suite 330,
22 ;; 02111-1307, USA. 22 ;; Boston, MA 02111-1307, USA.
23 23
24 ;;; Synched up with: FSF 19.34. 24 ;;; Synched up with: FSF 19.30.
25 25
26 ;;; Commentary: 26 ;;; Commentary:
27 27
28 ;; This code provides functions to list and edit the values of all global 28 ;; This code provides functions to list and edit the values of all global
29 ;; option variables known to loaded Emacs Lisp code. There are two entry 29 ;; option variables known to loaded Emacs Lisp code. There are two entry
40 (save-excursion 40 (save-excursion
41 (set-buffer (get-buffer-create "*List Options*")) 41 (set-buffer (get-buffer-create "*List Options*"))
42 (Edit-options-mode)) 42 (Edit-options-mode))
43 (with-output-to-temp-buffer "*List Options*" 43 (with-output-to-temp-buffer "*List Options*"
44 (let (vars) 44 (let (vars)
45 (mapatoms #'(lambda (sym) ; XEmacs 45 (mapatoms #'(lambda (sym)
46 (if (user-variable-p sym) 46 (if (user-variable-p sym)
47 (setq vars (cons sym vars))))) 47 (setq vars (cons sym vars)))))
48 (setq vars (sort vars 'string-lessp)) 48 (setq vars (sort vars 'string-lessp))
49 (while vars 49 (while vars
50 (let ((sym (car vars))) 50 (let ((sym (car vars)))
51 (princ ";; ") 51 (princ ";; ")
52 (prin1 sym) 52 (prin1 sym)
53 (princ ":\n\t") 53 (princ ":\n\t")
54 (if (boundp sym) ; XEmacs 54 (if (boundp sym)
55 (prin1 (symbol-value sym)) 55 (prin1 (symbol-value sym))
56 (princ "#<unbound>")) 56 (princ "#<unbound>"))
57 (terpri) 57 (terpri)
58 (princ (substitute-command-keys 58 (princ (substitute-command-keys
59 (documentation-property sym 'variable-documentation))) 59 (documentation-property sym 'variable-documentation)))
107 (setq paragraph-separate "[^\^@-\^?]") 107 (setq paragraph-separate "[^\^@-\^?]")
108 (make-local-variable 'paragraph-start) 108 (make-local-variable 'paragraph-start)
109 (setq paragraph-start "\t") 109 (setq paragraph-start "\t")
110 (setq truncate-lines t) 110 (setq truncate-lines t)
111 (setq major-mode 'Edit-options-mode) 111 (setq major-mode 'Edit-options-mode)
112 (setq mode-name (gettext "Options")) ; XEmacs 112 (setq mode-name (gettext "Options"))
113 (run-hooks 'Edit-options-mode-hook)) 113 (run-hooks 'Edit-options-mode-hook))
114 114
115 (defun Edit-options-set () (interactive) 115 (defun Edit-options-set () (interactive)
116 (Edit-options-modify 116 (Edit-options-modify
117 '(lambda (var) (eval-minibuffer (concat "New " (symbol-name var) ": "))))) 117 '(lambda (var) (eval-minibuffer (format "New %s:" (symbol-name var))))))
118 118
119 (defun Edit-options-toggle () (interactive) 119 (defun Edit-options-toggle () (interactive)
120 (Edit-options-modify '(lambda (var) (not (symbol-value var))))) 120 (Edit-options-modify '(lambda (var) (not (symbol-value var)))))
121 121
122 (defun Edit-options-t () (interactive) 122 (defun Edit-options-t () (interactive)
130 (let ((buffer-read-only nil) var pos) 130 (let ((buffer-read-only nil) var pos)
131 (re-search-backward "^;; \\|\\`") 131 (re-search-backward "^;; \\|\\`")
132 (forward-char 3) 132 (forward-char 3)
133 (setq pos (point)) 133 (setq pos (point))
134 (save-restriction 134 (save-restriction
135 (narrow-to-region pos (progn (end-of-line) (1- (point)))) 135 (narrow-to-region pos (progn (end-of-line) (1- (point))))
136 (goto-char pos) 136 (goto-char pos)
137 (setq var (read (current-buffer)))) 137 (setq var (read (current-buffer))))
138 (goto-char pos) 138 (goto-char pos)
139 (forward-line 1) 139 (forward-line 1)
140 (forward-char 1) 140 (forward-char 1)
141 (save-excursion 141 (save-excursion
142 (set var (funcall modfun var))) 142 (set var (funcall modfun var)))
143 (kill-sexp 1) 143 (kill-sexp 1)
144 (prin1 (symbol-value var) (current-buffer))))) 144 (prin1 (symbol-value var) (current-buffer)))))
145 145
146 ;;; options.el ends here 146 ;;; options.el ends here