aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/obsolete/options.el140
2 files changed, 5 insertions, 140 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 49b755b5511..1264cc64ead 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -283,6 +283,10 @@ To restore the old behavior, use
283*** New connection method "owncloud", which allows to access OwnCloud 283*** New connection method "owncloud", which allows to access OwnCloud
284or NextCloud hosted files and directories. 284or NextCloud hosted files and directories.
285 285
286---
287** The options.el library has been removed.
288It was obsolete since Emacs 22.1, replaced by customize.
289
286 290
287* New Modes and Packages in Emacs 27.1 291* New Modes and Packages in Emacs 27.1
288 292
@@ -317,6 +321,7 @@ as new-style, bind the new variable 'force-new-style-backquotes' to t.
317integer, Emacs now signals an error if the number is too large for the 321integer, Emacs now signals an error if the number is too large for the
318implementation to format (Bug#30408). 322implementation to format (Bug#30408).
319 323
324---
320** Some functions and variables obsolete since Emacs 22 have been removed: 325** Some functions and variables obsolete since Emacs 22 have been removed:
321archive-mouse-extract, assoc-ignore-case, assoc-ignore-representation, 326archive-mouse-extract, assoc-ignore-case, assoc-ignore-representation,
322backward-text-line, blink-cursor, bookmark-exit-hooks, 327backward-text-line, blink-cursor, bookmark-exit-hooks,
diff --git a/lisp/obsolete/options.el b/lisp/obsolete/options.el
deleted file mode 100644
index 41637a6ecf3..00000000000
--- a/lisp/obsolete/options.el
+++ /dev/null
@@ -1,140 +0,0 @@
1;;; options.el --- edit Options command for Emacs
2
3;; Copyright (C) 1985, 2001-2018 Free Software Foundation, Inc.
4
5;; Maintainer: emacs-devel@gnu.org
6;; Obsolete-since: 22.1
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software: you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation, either version 3 of the License, or
13;; (at your option) any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
22
23;;; Commentary:
24
25;; This code provides functions to list and edit the values of all global
26;; option variables known to loaded Emacs Lisp code. There are two entry
27;; points, `list-options' and `edit' options'. The latter enters a major
28;; mode specifically for editing option values. Do `M-x describe-mode' in
29;; that context for more details.
30
31;; The customization buffer feature is intended to make this obsolete.
32
33;;; Code:
34
35;;;###autoload
36(defun list-options ()
37 "Display a list of Emacs user options, with values and documentation.
38It is now better to use Customize instead."
39 (interactive)
40 (with-output-to-temp-buffer "*List Options*"
41 (let (vars)
42 (princ "This facility is obsolete; we recommend using M-x customize instead.")
43
44 (mapatoms (function (lambda (sym)
45 (if (custom-variable-p sym)
46 (setq vars (cons sym vars))))))
47 (setq vars (sort vars 'string-lessp))
48 (while vars
49 (let ((sym (car vars)))
50 (when (boundp sym)
51 (princ ";; ")
52 (prin1 sym)
53 (princ ":\n\t")
54 (prin1 (symbol-value sym))
55 (terpri)
56 (princ (substitute-command-keys
57 (documentation-property sym 'variable-documentation)))
58 (princ "\n;;\n"))
59 (setq vars (cdr vars))))
60 (with-current-buffer "*List Options*"
61 (Edit-options-mode)
62 (setq buffer-read-only t)))))
63
64;;;###autoload
65(defun edit-options ()
66 "Edit a list of Emacs user option values.
67Selects a buffer containing such a list,
68in which there are commands to set the option values.
69Type \\[describe-mode] in that buffer for a list of commands.
70
71The Custom feature is intended to make this obsolete."
72 (interactive)
73 (list-options)
74 (pop-to-buffer "*List Options*"))
75
76(defvar Edit-options-mode-map
77 (let ((map (make-keymap)))
78 (define-key map "s" 'Edit-options-set)
79 (define-key map "x" 'Edit-options-toggle)
80 (define-key map "1" 'Edit-options-t)
81 (define-key map "0" 'Edit-options-nil)
82 (define-key map "p" 'backward-paragraph)
83 (define-key map " " 'forward-paragraph)
84 (define-key map "n" 'forward-paragraph)
85 map)
86 "")
87
88;; Edit Options mode is suitable only for specially formatted data.
89(put 'Edit-options-mode 'mode-class 'special)
90
91(define-derived-mode Edit-options-mode emacs-lisp-mode "Options"
92 "\\<Edit-options-mode-map>\
93Major mode for editing Emacs user option settings.
94Special commands are:
95\\[Edit-options-set] -- set variable point points at. New value read using minibuffer.
96\\[Edit-options-toggle] -- toggle variable, t -> nil, nil -> t.
97\\[Edit-options-t] -- set variable to t.
98\\[Edit-options-nil] -- set variable to nil.
99Changed values made by these commands take effect immediately.
100
101Each variable description is a paragraph.
102For convenience, the characters \\[backward-paragraph] and \\[forward-paragraph] move back and forward by paragraphs."
103 (setq-local paragraph-separate "[^\^@-\^?]")
104 (setq-local paragraph-start "\t")
105 (setq-local truncate-lines t))
106
107(defun Edit-options-set () (interactive)
108 (Edit-options-modify
109 (lambda (var) (eval-minibuffer (concat "New " (symbol-name var) ": ")))))
110
111(defun Edit-options-toggle () (interactive)
112 (Edit-options-modify (lambda (var) (not (symbol-value var)))))
113
114(defun Edit-options-t () (interactive)
115 (Edit-options-modify (lambda (var) t)))
116
117(defun Edit-options-nil () (interactive)
118 (Edit-options-modify (lambda (var) nil)))
119
120(defun Edit-options-modify (modfun)
121 (save-excursion
122 (let ((buffer-read-only nil) var pos)
123 (re-search-backward "^;; \\|\\`")
124 (forward-char 3)
125 (setq pos (point))
126 (save-restriction
127 (narrow-to-region pos (progn (end-of-line) (1- (point))))
128 (goto-char pos)
129 (setq var (read (current-buffer))))
130 (goto-char pos)
131 (forward-line 1)
132 (forward-char 1)
133 (save-excursion
134 (set var (funcall modfun var)))
135 (kill-sexp 1)
136 (prin1 (symbol-value var) (current-buffer)))))
137
138(provide 'options)
139
140;;; options.el ends here