Mercurial > emacs
annotate lisp/options.el @ 22293:0544aa57ff27
(cperl-style-alist): New variable, since `c-mode'
is no longer loaded.
- (Somebody who uses the styles should check that they work OK!)
- (a lot of work is needed, especially with new
`cperl-fix-line-spacing').
Old value of style is memorized when choosing a new style, may be
restored from the same menu.
(cperl-perldoc, cperl-pod-to-manpage): New commands; thanks to
Anthony Foiani <afoiani@uswest.com> and Nick Roberts
<Nick.Roberts@src.bae.co.uk>.
(`Perl doc', `Regexp'): New submenus (latter to allow short displays).
(cperl-clobber-lisp-bindings): New cfg variable.
(cperl-find-pods-heres): $a->y() is not y///.
(cperl-after-block-p): Add save-excursion.
(cperl-init-faces): Was failing.
Init faces when loading `ps-print'.
(cperl-toggle-autohelp): New command.
(cperl-electric-paren): `while SPACE LESS' was buggy.
(cperl-init-faces): `-text' in `[-text => 1]' was not highlighted.
(cperl-after-block-p): was FALSE after `sub f {}'.
(cperl-electric-keyword): `foreachmy', `formy' expanded too,
Expands `=pod-directive'.
(cperl-linefeed): behaves reasonable in POD-directive lines.
(cperl-message-electric-keyword): new cfg variable.
(cperl-electric-keyword): print a message, governed by
`cperl-message-electric-keyword'.
(cperl-electric-paren): Typing `}' was not checking for being
block or not.
(cperl-beautify-regexp-piece): Did not know about lookbehind;
finding *which* level to work with was not intuitive.
(cperl-beautify-levels): New command.
(cperl-electric-keyword): Allow here-docs contain `=head1'
and friends for keyword expansion.
Fix for broken `font-lock-unfontify-region-function'. Should
preserve `syntax-table' properties even with `lazy-lock'.
(cperl-indent-region-fix-else): New command.
(cperl-fix-line-spacing): New command.
(cperl-invert-if-unless): New command (C-c C-t and in Menu).
(cperl-hints): mention 20.2's goods/bads.
(cperl-extra-newline-before-brace-multiline): Started to use it.
(cperl-break-one-line-blocks-when-indent): New cfg variable.
(cperl-fix-hanging-brace-when-indent): New cfg variable.
(cperl-merge-trailing-else): New cfg variable.
Workaround for another `font-lock's `syntax-table' text-property bug.
`zerop' could be applied to nil.
At last, may work with `font-lock' without setting `cperl-font-lock'.
(cperl-indent-region-fix-constructs): Renamed from
`cperl-indent-region-fix-constructs'.
(cperl-fix-line-spacing): could be triggered inside strings, would not
know what to do with BLOCKs of map/printf/etc.
(cperl-merge-trailing-else): Handle `continue' too.
(cperl-fix-line-spacing): Likewise.
(cperl-calculate-indent): Knows about map/printf/etc before {BLOCK};
treat after-comma lines as continuation lines.
(cperl-mode): `continue' made electric.
(cperl-electric-keyword): Electric `do' inserts `do/while'.
(cperl-fontify-syntaxically): New function.
(cperl-syntaxify-by-font-lock): New cfg variable.
Make syntaxification to be autoredone via `font-lock',
switched on by `cperl-syntaxify-by-font-lock', off by default so far.
Remove some commented out chunks.
(cperl-set-style-back): Old value of style is memorized when
choosing a new style, may be restored from the same menu.
Mode-documentation added to micro-docs.
(cperl-praise): updated.
(cperl-toggle-construct-fix): New command. Added on C-c C-w and menu.
(auto-fill-mode): added on C-c C-f and menu.
(cperl-style-alist): `PerlStyle' style added.
(cperl-find-pods-heres): Message for termination of scan corrected.
(cperl-speed): New variable with hints.
(cperl-electric-else): Make backspace electric after
expansion of `else/continue' too.
Fixed customization to honor cperl-hairy.
Created customization groups.
All the compile-time warnings fixed.
(cperl-syntaxify-by-font-lock): Interaction with `font-lock-hot-pass'
fixed.
(cperl-after-block-and-statement-beg): It is BLOCK if we reach lim
when backup sexp.
(cperl-after-block-p, cperl-after-expr-p): Likewise.
(cperl-indent-region): Make a marker for END - text added/removed.
(cperl-style-alist): Include `cperl-merge-trailing-else'
where the value is clear.
(cperl-styles-entries): Likewise.
(cperl-tips, cperl-problems): Improvements to docs.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 30 May 1998 15:43:16 +0000 |
parents | 11218164bc54 |
children | d4276a9b567e |
rev | line source |
---|---|
659
505130d1ddf8
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
1 ;;; options.el --- edit Options command for Emacs. |
505130d1ddf8
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
2 |
845 | 3 ;; Copyright (C) 1985 Free Software Foundation, Inc. |
4 | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
659
diff
changeset
|
5 ;; Maintainer: FSF |
228 | 6 |
7 ;; This file is part of GNU Emacs. | |
8 | |
9 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
10 ;; it under the terms of the GNU General Public License as published by | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
659
diff
changeset
|
11 ;; the Free Software Foundation; either version 2, or (at your option) |
228 | 12 ;; any later version. |
13 | |
14 ;; GNU Emacs is distributed in the hope that it will be useful, | |
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 ;; GNU General Public License for more details. | |
18 | |
19 ;; You should have received a copy of the GNU General Public License | |
14169 | 20 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
21 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
22 ;; Boston, MA 02111-1307, USA. | |
228 | 23 |
2308
f287613dfc28
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
24 ;;; Commentary: |
f287613dfc28
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
25 |
f287613dfc28
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
26 ;; This code provides functions to list and edit the values of all global |
f287613dfc28
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
27 ;; option variables known to loaded Emacs Lisp code. There are two entry |
f287613dfc28
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
28 ;; points, `list-options' and `edit' options'. The latter enters a major |
f287613dfc28
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
29 ;; mode specifically for editing option values. Do `M-x describe-mode' in |
f287613dfc28
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
30 ;; that context for more details. |
f287613dfc28
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
31 |
18383 | 32 ;; The customization buffer feature is intended to make this obsolete. |
33 | |
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
659
diff
changeset
|
34 ;;; Code: |
228 | 35 |
258 | 36 ;;;###autoload |
228 | 37 (defun list-options () |
38 "Display a list of Emacs user options, with values and documentation." | |
39 (interactive) | |
40 (save-excursion | |
41 (set-buffer (get-buffer-create "*List Options*")) | |
42 (Edit-options-mode)) | |
43 (with-output-to-temp-buffer "*List Options*" | |
44 (let (vars) | |
45 (mapatoms (function (lambda (sym) | |
46 (if (user-variable-p sym) | |
47 (setq vars (cons sym vars)))))) | |
48 (setq vars (sort vars 'string-lessp)) | |
49 (while vars | |
50 (let ((sym (car vars))) | |
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")) | |
11027
21761da820cd
(edit-options): Make the buffer read-only.
Richard M. Stallman <rms@gnu.org>
parents:
10887
diff
changeset
|
59 (setq vars (cdr vars))))) |
21761da820cd
(edit-options): Make the buffer read-only.
Richard M. Stallman <rms@gnu.org>
parents:
10887
diff
changeset
|
60 (save-excursion |
21761da820cd
(edit-options): Make the buffer read-only.
Richard M. Stallman <rms@gnu.org>
parents:
10887
diff
changeset
|
61 (set-buffer "*List Options*") |
21761da820cd
(edit-options): Make the buffer read-only.
Richard M. Stallman <rms@gnu.org>
parents:
10887
diff
changeset
|
62 (setq buffer-read-only t))) |
228 | 63 |
258 | 64 ;;;###autoload |
228 | 65 (defun edit-options () |
66 "Edit a list of Emacs user option values. | |
67 Selects a buffer containing such a list, | |
68 in which there are commands to set the option values. | |
69 Type \\[describe-mode] in that buffer for a list of commands." | |
70 (interactive) | |
71 (list-options) | |
72 (pop-to-buffer "*List Options*")) | |
73 | |
74 (defvar Edit-options-mode-map | |
75 (let ((map (make-keymap))) | |
76 (define-key map "s" 'Edit-options-set) | |
77 (define-key map "x" 'Edit-options-toggle) | |
78 (define-key map "1" 'Edit-options-t) | |
79 (define-key map "0" 'Edit-options-nil) | |
80 (define-key map "p" 'backward-paragraph) | |
81 (define-key map " " 'forward-paragraph) | |
82 (define-key map "n" 'forward-paragraph) | |
83 map) | |
84 "") | |
85 | |
86 ;; Edit Options mode is suitable only for specially formatted data. | |
87 (put 'Edit-options-mode 'mode-class 'special) | |
88 | |
89 (defun Edit-options-mode () | |
233 | 90 "\\<Edit-options-mode-map>\ |
91 Major mode for editing Emacs user option settings. | |
228 | 92 Special commands are: |
233 | 93 \\[Edit-options-set] -- set variable point points at. New value read using minibuffer. |
94 \\[Edit-options-toggle] -- toggle variable, t -> nil, nil -> t. | |
95 \\[Edit-options-t] -- set variable to t. | |
96 \\[Edit-options-nil] -- set variable to nil. | |
228 | 97 Changed values made by these commands take effect immediately. |
98 | |
99 Each variable description is a paragraph. | |
233 | 100 For convenience, the characters \\[backward-paragraph] and \\[forward-paragraph] move back and forward by paragraphs." |
228 | 101 (kill-all-local-variables) |
102 (set-syntax-table emacs-lisp-mode-syntax-table) | |
103 (use-local-map Edit-options-mode-map) | |
104 (make-local-variable 'paragraph-separate) | |
105 (setq paragraph-separate "[^\^@-\^?]") | |
106 (make-local-variable 'paragraph-start) | |
10887
b808c61b7ee1
(Edit-options-mode): Remove ^ from paragraph-start.
Boris Goldowsky <boris@gnu.org>
parents:
2308
diff
changeset
|
107 (setq paragraph-start "\t") |
228 | 108 (setq truncate-lines t) |
109 (setq major-mode 'Edit-options-mode) | |
110 (setq mode-name "Options") | |
111 (run-hooks 'Edit-options-mode-hook)) | |
112 | |
113 (defun Edit-options-set () (interactive) | |
114 (Edit-options-modify | |
115 '(lambda (var) (eval-minibuffer (concat "New " (symbol-name var) ": "))))) | |
116 | |
117 (defun Edit-options-toggle () (interactive) | |
118 (Edit-options-modify '(lambda (var) (not (symbol-value var))))) | |
119 | |
120 (defun Edit-options-t () (interactive) | |
121 (Edit-options-modify '(lambda (var) t))) | |
122 | |
123 (defun Edit-options-nil () (interactive) | |
124 (Edit-options-modify '(lambda (var) nil))) | |
125 | |
126 (defun Edit-options-modify (modfun) | |
127 (save-excursion | |
11027
21761da820cd
(edit-options): Make the buffer read-only.
Richard M. Stallman <rms@gnu.org>
parents:
10887
diff
changeset
|
128 (let ((buffer-read-only nil) var pos) |
228 | 129 (re-search-backward "^;; \\|\\`") |
130 (forward-char 3) | |
131 (setq pos (point)) | |
132 (save-restriction | |
133 (narrow-to-region pos (progn (end-of-line) (1- (point)))) | |
134 (goto-char pos) | |
135 (setq var (read (current-buffer)))) | |
136 (goto-char pos) | |
137 (forward-line 1) | |
138 (forward-char 1) | |
139 (save-excursion | |
140 (set var (funcall modfun var))) | |
141 (kill-sexp 1) | |
142 (prin1 (symbol-value var) (current-buffer))))) | |
143 | |
18383 | 144 (provide 'options) |
145 | |
659
505130d1ddf8
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
258
diff
changeset
|
146 ;;; options.el ends here |