aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog495
-rw-r--r--lisp/ChangeLog.82
-rw-r--r--lisp/ChangeLog.94
-rw-r--r--lisp/allout.el13
-rw-r--r--lisp/ansi-color.el4
-rw-r--r--lisp/arc-mode.el83
-rw-r--r--lisp/bindings.el3
-rw-r--r--lisp/bookmark.el3
-rw-r--r--lisp/bs.el2
-rw-r--r--lisp/buff-menu.el6
-rw-r--r--lisp/calendar/cal-tex.el2
-rw-r--r--lisp/calendar/cal-x.el12
-rw-r--r--lisp/calendar/calendar.el21
-rw-r--r--lisp/calendar/diary-lib.el8
-rw-r--r--lisp/calendar/icalendar.el8
-rw-r--r--lisp/comint.el8
-rw-r--r--lisp/cus-edit.el9
-rw-r--r--lisp/cus-start.el1
-rw-r--r--lisp/custom.el3
-rw-r--r--lisp/desktop.el3
-rw-r--r--lisp/dired-x.el17
-rw-r--r--lisp/dired.el7
-rw-r--r--lisp/doc-view.el129
-rw-r--r--lisp/emacs-lisp/byte-run.el4
-rw-r--r--lisp/emacs-lisp/bytecomp.el2
-rw-r--r--lisp/emacs-lisp/cl-extra.el1
-rw-r--r--lisp/emacs-lisp/cl-lib.el1
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el6
-rw-r--r--lisp/emacs-lisp/cl-macs.el1
-rw-r--r--lisp/emacs-lisp/cl-seq.el1
-rw-r--r--lisp/emacs-lisp/cl.el2
-rw-r--r--lisp/emacs-lisp/derived.el2
-rw-r--r--lisp/emacs-lisp/ert-x.el22
-rw-r--r--lisp/emacs-lisp/ert.el22
-rw-r--r--lisp/emacs-lisp/gv.el13
-rw-r--r--lisp/emacs-lisp/package-x.el10
-rw-r--r--lisp/emacs-lisp/package.el10
-rw-r--r--lisp/emacs-lisp/pcase.el14
-rw-r--r--lisp/emacs-lisp/tabulated-list.el6
-rw-r--r--lisp/emacs-lisp/testcover.el24
-rw-r--r--lisp/emacs-lisp/timer.el5
-rw-r--r--lisp/emacs-lock.el2
-rw-r--r--lisp/epa.el2
-rw-r--r--lisp/epg.el8
-rw-r--r--lisp/erc/ChangeLog4
-rw-r--r--lisp/erc/erc.el4
-rw-r--r--lisp/eshell/em-term.el5
-rw-r--r--lisp/eshell/esh-cmd.el7
-rw-r--r--lisp/eshell/esh-util.el4
-rw-r--r--lisp/eshell/eshell.el6
-rw-r--r--lisp/faces.el1
-rw-r--r--lisp/files.el2
-rw-r--r--lisp/font-lock.el4
-rw-r--r--lisp/generic-x.el6
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/ChangeLog.22
-rw-r--r--lisp/gnus/gnus-art.el11
-rw-r--r--lisp/help-fns.el15
-rw-r--r--lisp/help-macro.el1
-rw-r--r--lisp/help.el70
-rw-r--r--lisp/hippie-exp.el10
-rw-r--r--lisp/htmlfontify.el2
-rw-r--r--lisp/ibuf-ext.el14
-rw-r--r--lisp/ibuffer.el4
-rw-r--r--lisp/ido.el10
-rw-r--r--lisp/image-mode.el18
-rw-r--r--lisp/image.el2
-rw-r--r--lisp/imenu.el9
-rw-r--r--lisp/international/latin1-disp.el4
-rw-r--r--lisp/international/mule-cmds.el2
-rw-r--r--lisp/international/mule-diag.el2
-rw-r--r--lisp/international/mule-util.el36
-rw-r--r--lisp/international/mule.el16
-rw-r--r--lisp/international/uni-bidi.el2
-rw-r--r--lisp/international/uni-category.el2
-rw-r--r--lisp/international/uni-name.elbin162303 -> 162318 bytes
-rw-r--r--lisp/international/uni-numeric.elbin4592 -> 4609 bytes
-rw-r--r--lisp/iswitchb.el54
-rw-r--r--lisp/json.el8
-rw-r--r--lisp/linum.el5
-rw-r--r--lisp/mail/emacsbug.el7
-rw-r--r--lisp/mail/mailalias.el2
-rw-r--r--lisp/mail/sendmail.el4
-rw-r--r--lisp/mail/supercite.el22
-rw-r--r--lisp/mh-e/ChangeLog.12
-rw-r--r--lisp/minibuf-eldef.el55
-rw-r--r--lisp/minibuffer.el2
-rw-r--r--lisp/mouse.el6
-rw-r--r--lisp/net/newst-backend.el2
-rw-r--r--lisp/net/newst-treeview.el2
-rw-r--r--lisp/net/snmp-mode.el4
-rw-r--r--lisp/org/ob-fortran.el18
-rw-r--r--lisp/password-cache.el3
-rw-r--r--lisp/pcomplete.el5
-rw-r--r--lisp/proced.el296
-rw-r--r--lisp/profiler.el665
-rw-r--r--lisp/progmodes/ada-mode.el4
-rw-r--r--lisp/progmodes/compile.el24
-rw-r--r--lisp/progmodes/cwarn.el8
-rw-r--r--lisp/progmodes/idlwave.el10
-rw-r--r--lisp/progmodes/inf-lisp.el13
-rw-r--r--lisp/progmodes/prolog.el2
-rw-r--r--lisp/progmodes/ps-mode.el4
-rw-r--r--lisp/progmodes/python.el156
-rw-r--r--lisp/progmodes/ruby-mode.el4
-rw-r--r--lisp/progmodes/sh-script.el3
-rw-r--r--lisp/progmodes/tcl.el4
-rw-r--r--lisp/progmodes/vera-mode.el6
-rw-r--r--lisp/progmodes/verilog-mode.el704
-rw-r--r--lisp/progmodes/vhdl-mode.el1
-rw-r--r--lisp/progmodes/which-func.el4
-rw-r--r--lisp/replace.el46
-rw-r--r--lisp/savehist.el2
-rw-r--r--lisp/server.el25
-rw-r--r--lisp/simple.el5
-rw-r--r--lisp/startup.el5
-rw-r--r--lisp/subr.el29
-rw-r--r--lisp/term.el8
-rw-r--r--lisp/textmodes/bibtex.el32
-rw-r--r--lisp/textmodes/reftex-cite.el5
-rw-r--r--lisp/textmodes/reftex-index.el4
-rw-r--r--lisp/textmodes/reftex-sel.el8
-rw-r--r--lisp/textmodes/reftex.el4
-rw-r--r--lisp/textmodes/rst.el7
-rw-r--r--lisp/textmodes/sgml-mode.el5
-rw-r--r--lisp/textmodes/tex-mode.el4
-rw-r--r--lisp/textmodes/text-mode.el23
-rw-r--r--lisp/tutorial.el15
-rw-r--r--lisp/type-break.el147
-rw-r--r--lisp/url/ChangeLog19
-rw-r--r--lisp/url/url-handlers.el31
-rw-r--r--lisp/url/url-parse.el2
-rw-r--r--lisp/url/url-util.el8
-rw-r--r--lisp/vc/ediff-init.el4
-rw-r--r--lisp/vc/ediff-util.el4
-rw-r--r--lisp/vc/ediff-wind.el4
-rw-r--r--lisp/vc/emerge.el12
-rw-r--r--lisp/vc/log-edit.el28
-rw-r--r--lisp/vc/pcvs-defs.el14
-rw-r--r--lisp/vc/pcvs-info.el4
-rw-r--r--lisp/vc/pcvs.el25
-rw-r--r--lisp/vc/vc-bzr.el14
-rw-r--r--lisp/vc/vc-hooks.el23
-rw-r--r--lisp/vc/vc-rcs.el3
-rw-r--r--lisp/vc/vc-sccs.el12
-rw-r--r--lisp/vc/vc.el54
-rw-r--r--lisp/view.el2
-rw-r--r--lisp/window.el396
-rw-r--r--lisp/winner.el82
149 files changed, 3123 insertions, 1382 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 351b6ea6cb8..255b8924784 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,484 @@
12012-09-30 Juanma Barranquero <lekktu@gmail.com>
2
3 * ido.el (ido-max-directory-size): Default to nil; the current
4 default is small for POSIX systems, and impractical on Windows 7
5 now that lstat returns directory sizes for NTFS.
6
72012-09-30 Martin Rudalics <rudalics@gmx.at>
8
9 In buffer display functions handle window-height/window-width
10 alist entries. Suggested by Juri Linkov as fix for Bug#1806.
11 * window.el (window--display-buffer): New argument ALIST. Obey
12 window-height and window-width alist entries.
13 (window--try-to-split-window): New argument ALIST. Bind
14 window-combination-limit to t when the window's size shall be
15 changed and window-combination-limit equals `window-size'.
16 (display-buffer-in-atom-window)
17 (display-buffer-in-major-side-window)
18 (display-buffer-in-side-window, display-buffer-same-window)
19 (display-buffer-reuse-window, display-buffer-pop-up-frame)
20 (display-buffer-pop-up-window, display-buffer-below-selected)
21 (display-buffer-at-bottom, display-buffer-in-previous-window)
22 (display-buffer-use-some-window): Adjust all callers of
23 window--display-buffer and window--try-to-split-window.
24 (fit-frame-to-buffer): New option.
25 (fit-window-to-buffer): Can resize frames if fit-frame-to-buffer
26 is non-nil.
27 (display-buffer-in-major-side-window): Evaluate window-height /
28 window-width alist entries.
29
30 * help.el (temp-buffer-resize-frames)
31 (temp-buffer-resize-regexps): Remove options.
32 (temp-buffer-resize-mode): Adjust doc-string.
33 (resize-temp-buffer-window): Don't consult
34 temp-buffer-resize-regexps. Use fit-frame-to-buffer instead of
35 temp-buffer-resize-frames.
36
37 * dired.el (dired-mark-pop-up): Call
38 display-buffer-below-selected with a fit-window-to-buffer alist
39 entry.
40
412012-09-30 Chong Yidong <cyd@gnu.org>
42
43 * server.el (server-host): Document the security implications.
44 (server-auth-key): Doc fix.
45
46 * startup.el (initial-buffer-choice): Doc fix.
47
48 * minibuffer.el (minibuffer-local-filename-syntax): Doc fix.
49
50 * simple.el (delete-trailing-whitespace): Avoid an unnecessary
51 restriction change.
52
53 * bindings.el (goto-map): Bind M-g TAB to move-to-column.
54
55 * help-fns.el (help-fns--obsolete): Fix last change.
56
572012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
58
59 * winner.el (winner-mode-map): Obey winner-dont-bind-my-keys here.
60 (minor-mode-map-alist): Remove redundant code.
61
62 * vc/pcvs.el (cvs-cleanup-collection): Keep entries that are currently
63 visited in a buffer.
64 (cvs-insert-visited-file): New function.
65 (find-file-hook): Use it.
66
67 * vc/pcvs-info.el (cvs-fileinfo-pp): Don't use non-existent faces.
68
69 * vc/log-edit.el (log-edit-font-lock-keywords): Ignore case to
70 chose face.
71 (log-edit-empty-buffer-p): Don't require a space after a header.
72
73 * vc/ediff-util.el (ediff-diff-at-point): Don't assume point-min==1.
74
75 * tutorial.el (help-with-tutorial): Use minibuffer-with-setup-hook.
76
77 * textmodes/text-mode.el (paragraph-indent-minor-mode): Make it
78 a proper minor-mode.
79
80 * textmodes/tex-mode.el (tex-mode-map): Don't bind paren keys.
81
822012-09-29 Glenn Morris <rgm@gnu.org>
83
84 * winner.el (winner-mode): Remove variable (let define-minor-mode
85 handle it).
86 (winner-dont-bind-my-keys, winner-boring-buffers, winner-mode-hook):
87 Doc fixes.
88 (winner-mode-leave-hook): Rename to winner-mode-off-hook.
89 (winner-mode): Use define-minor-mode.
90
91 * vc/vc-sccs.el (vc-sccs-registered): Use the progn trick to get
92 the full definition in loaddefs, rather than duplicating it.
93
94 * help-macro.el (three-step-help): No need to autoload defcustom.
95
96 * progmodes/inf-lisp.el (inferior-lisp-filter-regexp)
97 (inferior-lisp-program, inferior-lisp-load-command)
98 (inferior-lisp-prompt, inferior-lisp-mode-hook):
99 No need to autoload defcustoms.
100
101 * hippie-exp.el (hippie-expand-try-functions-list)
102 (hippie-expand-verbose, hippie-expand-dabbrev-skip-space)
103 (hippie-expand-dabbrev-as-symbol, hippie-expand-no-restriction)
104 (hippie-expand-max-buffers, hippie-expand-ignore-buffers)
105 (hippie-expand-only-buffers): No need to autoload defcustoms.
106 * progmodes/vhdl-mode.el (vhdl-line-expand):
107 Explicitly load hippie-exp, so it does not get autoloaded
108 while hippie-expand-try-functions-list is let-bound.
109
1102012-09-28 Glenn Morris <rgm@gnu.org>
111
112 * emacs-lisp/cl.el (flet): Fix case of obsolescence message.
113
114 * emacs-lisp/bytecomp.el (byte-compile-cl-file-p):
115 Only "cl.el" counts as cl these days.
116
1172012-09-28 Juri Linkov <juri@jurta.org>
118
119 Display archive errors in the echo area instead of inserting
120 to the file buffer.
121
122 * arc-mode.el (archive-extract-by-stdout): Change arg STDERR-FILE
123 to STDERR-TEST that can be a regexp matching a successful output.
124 Create a temporary file and redirect stderr to it. Search for
125 STDERR-TEST in the stderr output and display it in the echo area
126 if no match is found.
127 (archive-extract-by-file): New function like
128 `archive-extract-by-stdout' but extracting archives to files
129 and looking for successful matches in stdout. Function body is
130 mostly copied from `archive-rar-extract'.
131 (archive-rar-extract): Use `archive-extract-by-file'.
132 (archive-7z-extract): Use `archive-extract-by-stdout'. (Bug#10347)
133
1342012-09-28 Leo Liu <sdl.web@gmail.com>
135
136 * pcomplete.el (pcomplete-show-completions): Use
137 minibuffer-message to make pcomplete usable in minibuffer.
138
139 * ido.el (ido-set-matches-1): Fix 2012-09-11 change.
140
1412012-09-28 Stefan Monnier <monnier@iro.umontreal.ca>
142
143 * type-break.el: Use lexical-binding.
144 (type-break-mode): Use define-minor-mode.
145
146 * emacs-lisp/pcase.el (pcase--mark-used): New.
147 (pcase--u1): Use it (bug#12512).
148
149 * custom.el (load-theme): Set buffer-file-name so the load is recorded
150 in load-history with the right file name.
151
1522012-09-28 Tassilo Horn <tsdh@gnu.org>
153
154 * doc-view.el (doc-view-current-cache-doc-pdf): New function.
155 (doc-view-doc->txt, doc-view-convert-current-doc): Use it.
156 (doc-view-get-bounding-box): Make bounding box slicing work for
157 ODF and DVI documents.
158
1592012-09-28 Glenn Morris <rgm@gnu.org>
160
161 * type-break.el (type-break-mode, type-break-interval)
162 (type-break-good-rest-interval, type-break-keystroke-threshold):
163 No need to autoload.
164 (type-break-good-rest-interval, type-break-keystroke-threshold):
165 Add :set-after.
166
1672012-09-28 Chong Yidong <cyd@gnu.org>
168
169 * progmodes/verilog-mode.el (verilog-auto-inst-interfaced-ports):
170 Add :version tag.
171
1722012-09-27 Stefan Monnier <monnier@iro.umontreal.ca>
173
174 * json.el (json-encode-char): Codes 127-160 aren't "ASCII printable".
175
1762012-09-27 Glenn Morris <rgm@gnu.org>
177
178 * faces.el (x-display-name): Declare (for without-x builds).
179
180 * linum.el (linum-format): Don't autoload it. Improve :type.
181
182 * progmodes/tcl.el: Don't require outline when compiling.
183 (outline-regexp, outline-level): Declare.
184 * textmodes/sgml-mode.el: Don't require outline when compiling.
185 (outline-regexp, outline-heading-end-regexp, outline-level): Declare.
186
187 * term.el (term-ansi-reset):
188 Try setting term-ansi-face-already-done to nil. (Bug#11785)
189
190 * vc/vc.el (vc-next-action): Only gripe about committing read-only
191 files for RCS and SCCS. (Bug#9781)
192
1932012-09-27 Chong Yidong <cyd@gnu.org>
194
195 * progmodes/verilog-mode.el (verilog-mode-release-emacs): Fix last
196 change; value should be t.
197
1982012-09-27 Stefan Monnier <monnier@iro.umontreal.ca>
199
200 * image-mode.el: Use lexical-binding.
201 (image-mode-winprops): Use t to stand for the window of
202 a buffer that's not displayed.
203 * doc-view.el (doc-view-new-window-function): Handle the new
204 t in winprops.
205 (doc-view-enlarge): Make it a real nop if the size is not changed.
206 (doc-view-display): Handle the case where the buffer is not (yet?)
207 displayed in any window.
208 (doc-view-saved-settings): New var.
209 (doc-view-mode): Use it.
210 (doc-view-fallback-mode): Set it.
211
212 * minibuf-eldef.el: Make it possible to replace (default ...) with [...].
213 Set lexical-binding.
214 (minibuffer-eldef-shorten-default): New var.
215 (minibuffer-default-in-prompt-regexps): Use it for new default.
216 (minibuf-eldef-setup-minibuffer): Add replacement functionality.
217
2182012-09-26 Juanma Barranquero <lekktu@gmail.com>
219
220 * international/uni-bidi.el:
221 * international/uni-category.el:
222 * international/uni-name.el:
223 * international/uni-numeric.el: Regenerate.
224
2252012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
226 Stefan Monnier <monnier@iro.umontreal.ca>
227
228 * profiler.el: New file.
229
2302012-09-26 Stefan Monnier <monnier@iro.umontreal.ca>
231
232 * emacs-lisp/testcover.el (testcover-after): Add gv-expander.
233 (testcover-reinstrument): Simplify with CSE.
234
2352012-09-26 Juanma Barranquero <lekktu@gmail.com>
236
237 * window.el (temp-buffer-window-setup): Fix typo in docstring.
238
2392012-09-25 Wilson Snyder <wsnyder@wsnyder.org>
240
241 * verilog-mode.el (verilog-auto-ascii-enum, verilog-auto-inout)
242 (verilog-auto-input, verilog-auto-insert-lisp)
243 (verilog-auto-output, verilog-auto-output-every, verilog-auto-reg)
244 (verilog-auto-reg-input, verilog-auto-tieoff, verilog-auto-undef)
245 (verilog-auto-unused, verilog-auto-wire)
246 (verilog-forward-or-insert-line): Fix AUTOs with no trailing
247 newline. Reported by Andrew Jones.
248 (verilog-auto-inst) Support expanding $clog2 in AUTOINST.
249 Reported by Brad Dobbie.
250 (verilog-batch-delete-trailing-whitespace):
251 Create verilog-batch-delete-trailing-whitespace.
252 Reported by Brad Dobbie.
253 (verilog-auto-inout-param): Support AUTOINOUTPARAM for copying
254 parameters from another module. Reported by Dan Katz.
255 (verilog-auto, verilog-auto-assign-modport)
256 (verilog-auto-inout-modport): Add AUTOASSIGNMODPORT and
257 AUTOINOUTMODPORT for UVM interface module shell generation.
258 Reported by Brad Dobbie.
259 (verilog-auto-inst-interfaced-ports): Make default nil, as more
260 standard behavior.
261 (verilog-auto): Fix AUTO parameters with parenthesis arguments.
262 Reported by Matt Martin.
263
2642012-09-25 Martin Rudalics <rudalics@gmx.at>
265
266 * window.el (window--resize-child-windows): When resizing child
267 windows proportionally, process them in reverse order to
268 preserve the "when splitting a window the new one gets the odd
269 line" behavior.
270 (window--resize-root-window-vertically): When resizing the
271 minibuffer window try to affect only windows at the bottom of the
272 frame. (Bug#12419)
273
2742012-09-25 Chong Yidong <cyd@gnu.org>
275
276 * subr.el (declare): Doc fix.
277
278 * help-fns.el (help-fns--obsolete): Handle macros properly.
279
2802012-09-25 Chong Yidong <cyd@gnu.org>
281
282 * bookmark.el (bookmark-jump-noselect): Use a declare form to mark
283 this function obsolete.
284
285 * calendar/cal-x.el (calendar-two-frame-setup)
286 (calendar-only-one-frame-setup, calendar-one-frame-setup):
287 * calendar/calendar.el (american-calendar, european-calendar)
288 (calendar-for-loop):
289 * comint.el (comint-dynamic-simple-complete)
290 (comint-dynamic-complete-as-filename, comint-unquote-filename):
291 * desktop.el (desktop-load-default):
292 * dired-x.el (dired-omit-here-always)
293 (dired-hack-local-variables, dired-default-directory):
294 * emacs-lisp/derived.el (derived-mode-class):
295 * emacs-lisp/timer.el (timer-set-time-with-usecs):
296 * emacs-lock.el (toggle-emacs-lock):
297 * epa.el (epa-display-verify-result):
298 * epg.el (epg-sign-keys, epg-start-sign-keys)
299 (epg-passphrase-callback-function):
300 * eshell/esh-util.el (eshell-for):
301 * eshell/eshell.el (eshell-remove-from-window-buffer-names)
302 (eshell-add-to-window-buffer-names):
303 * files.el (locate-file-completion):
304 * imenu.el (imenu-example--create-c-index)
305 (imenu-example--create-lisp-index)
306 (imenu-example--lisp-extract-index-name)
307 (imenu-example--name-and-position):
308 * international/mule-cmds.el (princ-list):
309 * international/mule-diag.el (decode-codepage-char):
310 * international/mule-util.el (detect-coding-with-priority):
311 * iswitchb.el (iswitchb-read-buffer):
312 * mail/mailalias.el (mail-complete):
313 * mail/sendmail.el (mail-sent-via):
314 * mouse.el (mouse-popup-menubar-stuff, mouse-popup-menubar)
315 (mouse-major-mode-menu):
316 * password-cache.el (password-read-and-add):
317 * pcomplete.el (pcomplete-parse-comint-arguments):
318 * progmodes/sh-script.el (sh-maybe-here-document):
319 * replace.el (query-replace-regexp-eval):
320 * savehist.el (savehist-load):
321 * simple.el (choose-completion-delete-max-match):
322 * term.el (term-dynamic-simple-complete):
323 * vc/ediff-init.el (ediff-check-version):
324 * vc/ediff-wind.el (ediff-choose-window-setup-function-automatically):
325 * vc/vc.el (vc-diff-switches-list):
326 * view.el (view-return-to-alist-update): Likewise.
327
328 * subr.el (eval-next-after-load, makehash, insert-string)
329 (assoc-ignore-representation, assoc-ignore-case): Use declare to
330 mark obsolete.
331 (mode-line-inverse-video): Variable deleted.
332
333 * international/mule-util.el (string-to-sequence): Remove.
334
335 * calendar/calendar.el (calendar-version):
336 * calendar/icalendar.el (icalendar-extract-ical-from-buffer)
337 (icalendar-convert-diary-to-ical):
338 * cus-edit.el (custom-mode):
339 * ansi-color.el (ansi-color-unfontify-region):
340 * international/latin1-disp.el (latin1-char-displayable-p):
341 * progmodes/cwarn.el (turn-on-cwarn-mode):
342 * progmodes/which-func.el (which-func-update-1):
343 Use define-obsolete-function-alias.
344
345 * net/newst-backend.el (newsticker-cache-filename):
346 * net/newst-treeview.el (newsticker-groups-filename):
347 Fix incorrect obsolescence declaration.
348
349 * allout.el (allout-passphrase-hint-string): Likewise.
350 (allout-init): Use a declare form to mark obsolete.
351
352 * emacs-lisp/byte-run.el (make-obsolete): Doc fix; emphasize that
353 this applies to functions.
354
355 * iswitchb.el (iswitchb-read-buffer): Move code of
356 iswitchb-define-mode-map here, and delete that obsolete function.
357
358 * net/snmp-mode.el (snmp-font-lock-keywords-3): Don't use obsolete
359 font-lock-reference-face.
360
3612012-09-25 Glenn Morris <rgm@gnu.org>
362
363 * buff-menu.el (Buffer-menu-name-width, Buffer-menu-size-width):
364 Doc fixes.
365
366 * eshell/em-term.el (eshell-term-name):
367 Default to term-term-name. (Bug#12485)
368
3692012-09-24 Fabián Ezequiel Gallina <fgallina@cuca>
370
371 * progmodes/python.el (python-shell-send-buffer): Better handling
372 of "if __name__ == '__main__':" conditionals when sending the buffer.
373
3742012-09-24 Glenn Morris <rgm@gnu.org>
375
376 * eshell/esh-cmd.el (eshell-find-alias-function):
377 Tighten up file-name regexp. (Bug#12499)
378
3792012-09-24 Fabián Ezequiel Gallina <fgallina@cuca>
380
381 Enhancements for triple-quote string syntax.
382 * progmodes/python.el (python-quote-syntax): Remove.
383 (python-syntax-propertize-function): New value.
384 (python-syntax-count-quotes, python-syntax-stringify):
385 New functions.
386
3872012-09-24 Chong Yidong <cyd@gnu.org>
388
389 * mail/supercite.el (sc-version): Remove obsolete function.
390 (sc-describe): Don't mark as obsolete, since it is bound.
391 (sc-submit-bug-report): Remove.
392
393 * vc/log-edit.el (cvs-changelog-full-paragraphs)
394 (cvs-commit-buffer-require-final-newline): Remove.
395 (log-edit-require-final-newline)
396 (log-edit-changelog-full-paragraphs): Default to t.
397
398 * vc/pcvs-defs.el (cvs-diff-buffer-name, cvs-diff-ignore-marks)
399 * vc/vc-hooks.el (vc-ignore-vc-files, vc-master-templates)
400 * vc/vc.el (vc-checkout-carefully): Likewise.
401
402 * vc/emerge.el (emerge-mode): Make it an obsolete alias.
403 (emerge-version): Remove.
404
405 * progmodes/compile.el (compile-internal): Remove.
406 (compilation-parse-errors-function): Fix typo.
407
408 * international/mule.el (set-char-table-default): Remove.
409 (set-coding-priority, make-coding-system, generic-char-p)
410 (charset-list, charset-bytes, charset-id): Use declare to mark
411 functions as obsolete.
412
413 * vc/pcvs-defs.el (cvs-buffer-name-alist)
414 (cvs-invert-ignore-marks): Remove references to obsolete vars.
415 * vc/vc-hooks.el (vc-default-registered): Don't use
416 vc-master-templates.
417
418 * font-lock.el (font-lock-reference-face):
419 Use define-obsolete-variable-alias.
420
421 * generic-x.el (rul-generic-mode): Use font-lock-constant-face.
422 * calendar/calendar.el (calendar-font-lock-keywords):
423 * calendar/diary-lib.el (diary-font-lock-keywords)
424 (diary-fancy-font-lock-keywords):
425 * textmodes/reftex-sel.el (reftex-insert-docstruct):
426 * textmodes/reftex-index.el (reftex-insert-index):
427 * textmodes/reftex-cite.el (reftex-format-bib-entry):
428 * progmodes/ruby-mode.el (ruby-font-lock-keywords):
429 * progmodes/ps-mode.el (ps-mode-font-lock-keywords-1):
430 * progmodes/prolog.el (prolog-font-lock-keywords):
431 * progmodes/idlwave.el (idlwave-idl-keywords):
432 * progmodes/ada-mode.el (ada-font-lock-keywords):
433 * net/snmp-mode.el (snmp-font-lock-keywords-3): Likewise.
434
4352012-09-24 Glenn Morris <rgm@gnu.org>
436
437 * mail/emacsbug.el (report-emacs-bug): Include `lsb_release -d'.
438
4392012-09-23 Fabián Ezequiel Gallina <fgallina@cuca>
440
441 * progmodes/python.el (python-indent-line): More consistent cursor
442 movement behavior.
443
4442012-09-23 Stefan Merten <smerten@oekonux.de>
445
446 * textmodes/rst.el: Fix compiler warning.
447
4482012-09-23 Roland Winkler <winkler@gnu.org>
449
450 * textmodes/bibtex.el (bibtex-autokey-transcriptions):
451 Transcribe also LaTeX hyphenation.
452 (bibtex-reformat): Bug fix. Do not quote twice the elements of
453 bibtex-reformat-previous-options.
454
4552012-09-23 Roland Winkler <winkler@gnu.org>
456
457 * proced.el (proced-renice-command): New variable.
458 (proced-marked-processes): New function.
459 (proced-with-processes-buffer): New macro.
460 (proced-send-signal): Use them.
461 (proced-renice): New command bound to r.
462
4632012-09-23 Roland Winkler <winkler@gnu.org>
464
465 * ibuf-ext.el (ibuffer-switch-to-saved-filter-groups): If list
466 ibuffer-saved-filter-groups has one element, shortcut the call of
467 completing-read. (Bug#12331)
468
4692012-09-23 Chong Yidong <cyd@gnu.org>
470
471 * bindings.el (mode-line-toggle-read-only):
472 * bs.el (bs-toggle-readonly):
473 * buff-menu.el (Buffer-menu-toggle-read-only):
474 * dired.el (dired-toggle-read-only):
475 * ibuffer.el (ibuffer-do-toggle-read-only): Use read-only-mode.
476
4772012-09-23 Chong Yidong <cyd@gnu.org>
478
479 * image.el (image-type-available-p): Adapt to init-image-library
480 argument changes.
481
12012-09-22 Juri Linkov <juri@jurta.org> 4822012-09-22 Juri Linkov <juri@jurta.org>
2 483
3 * dired.el (dired-mode-map): Add [remap read-only-mode] for 484 * dired.el (dired-mode-map): Add [remap read-only-mode] for
@@ -45,7 +526,7 @@
45 526
462012-09-22 Stefan Merten <smerten@oekonux.de> 5272012-09-22 Stefan Merten <smerten@oekonux.de>
47 528
48 * rst.el: Revamp section title faces. 529 * textmodes/rst.el: Revamp section title faces.
49 (rst-official-version) 530 (rst-official-version)
50 (rst-package-emacs-version-alist): Sync with official version 531 (rst-package-emacs-version-alist): Sync with official version
51 V1.4.0. 532 V1.4.0.
@@ -120,15 +601,15 @@
120 601
1212012-09-20 Stefan Merten <smerten@oekonux.de> 6022012-09-20 Stefan Merten <smerten@oekonux.de>
122 603
123 * rst.el: Integrate support for `imenu' and `which-function'. 604 * textmodes/rst.el: Integrate support for `imenu' and `which-function'.
124 Fixes feature request bug#11711. 605 Fixes feature request bug#11711.
125 (rst-mode): Create `imenu-create-index-function'. 606 (rst-mode): Create `imenu-create-index-function'.
126 (rst-get-stripped-line): Delete after refactoring. 607 (rst-get-stripped-line): Delete after refactoring.
127 (rst-section-tree, rst-section-tree-rec) 608 (rst-section-tree, rst-section-tree-rec)
128 (rst-section-tree-point): Refactor and document properly. 609 (rst-section-tree-point): Refactor and document properly.
129 (rst-imenu-find-adornments-for-position) 610 (rst-imenu-find-adornments-for-position)
130 (rst-imenu-convert-cell, rst-imenu-create-index): New 611 (rst-imenu-convert-cell, rst-imenu-create-index):
131 function. 612 New function.
132 613
1332012-09-20 Stefan Monnier <monnier@iro.umontreal.ca> 6142012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
134 615
@@ -260,7 +741,7 @@
260 741
2612012-09-17 Stefan Merten <smerten@oekonux.de> 7422012-09-17 Stefan Merten <smerten@oekonux.de>
262 743
263 * rst.el: Add support for `testcover'. 744 * textmodes/rst.el: Add support for `testcover'.
264 (rst-defcustom-testcover, rst-testcover-add-compose) 745 (rst-defcustom-testcover, rst-testcover-add-compose)
265 (rst-testcover-add-1value): New functions. 746 (rst-testcover-add-1value): New functions.
266 (rst-portable-mark-active-p): Replace by `use-region-p'. 747 (rst-portable-mark-active-p): Replace by `use-region-p'.
@@ -2096,7 +2577,7 @@
2096 2577
20972012-07-30 Stefan Merten <smerten@oekonux.de> 25782012-07-30 Stefan Merten <smerten@oekonux.de>
2098 2579
2099 * rst.el: Silence `checkdoc-ispell'. 2580 * textmodes/rst.el: Silence `checkdoc-ispell'.
2100 (rst-cvs-header, rst-svn-rev, rst-svn-timestamp) 2581 (rst-cvs-header, rst-svn-rev, rst-svn-timestamp)
2101 (rst-official-version, rst-official-cvs-rev) 2582 (rst-official-version, rst-official-cvs-rev)
2102 (rst-package-emacs-version-alist): Update to upstream V1.3.1. 2583 (rst-package-emacs-version-alist): Update to upstream V1.3.1.
@@ -9488,7 +9969,7 @@
9488 Declare as obsolete. 9969 Declare as obsolete.
9489 (ns-get-pasteboard, ns-paste-secondary): 9970 (ns-get-pasteboard, ns-paste-secondary):
9490 Use ns-get-selection-internal. 9971 Use ns-get-selection-internal.
9491 (ns-set-pasteboard, ns-copy-including-secondary): 9972 (ns-set-pasteboard, ns-copy-including-secondary):
9492 Use ns-store-selection-internal. 9973 Use ns-store-selection-internal.
9493 9974
94942011-12-17 Chong Yidong <cyd@gnu.org> 99752011-12-17 Chong Yidong <cyd@gnu.org>
diff --git a/lisp/ChangeLog.8 b/lisp/ChangeLog.8
index 0380fb117db..db5c2f84511 100644
--- a/lisp/ChangeLog.8
+++ b/lisp/ChangeLog.8
@@ -2372,7 +2372,7 @@
2372 (sh-mode-map): Added new bindings. 2372 (sh-mode-map): Added new bindings.
2373 (sh-mode): Updated mode doc-string for new commands, added 2373 (sh-mode): Updated mode doc-string for new commands, added
2374 make-local-variable calls, initialize mode-specific variables. 2374 make-local-variable calls, initialize mode-specific variables.
2375 (sh-indent-line): Renamed to sh-basic-indent-line; sh-indent-line 2375 (sh-indent-line): Renamed to sh-basic-indent-line; sh-indent-line
2376 is now a different function. 2376 is now a different function.
2377 (sh-header-marker): Changed docstring. 2377 (sh-header-marker): Changed docstring.
2378 (sh-set-shell): Initialize mode-specific variables. 2378 (sh-set-shell): Initialize mode-specific variables.
diff --git a/lisp/ChangeLog.9 b/lisp/ChangeLog.9
index 5c01f872994..5c71fb860ec 100644
--- a/lisp/ChangeLog.9
+++ b/lisp/ChangeLog.9
@@ -569,7 +569,7 @@
569 Don't bind mouse events or tab/backtab. 569 Don't bind mouse events or tab/backtab.
570 (help-function, help-variable, help-face, help-coding-system) 570 (help-function, help-variable, help-face, help-coding-system)
571 (help-input-method, help-character-set, help-back, help-info) 571 (help-input-method, help-character-set, help-back, help-info)
572 (help-customize-variable, help-function-def, help-variable-def): 572 (help-customize-variable, help-function-def, help-variable-def):
573 New button types. 573 New button types.
574 (help-button-action): New function. 574 (help-button-action): New function.
575 (describe-function-1): Pass help button-types to 575 (describe-function-1): Pass help button-types to
@@ -20671,7 +20671,7 @@
20671 * term/tty-colors.el (tty-defined-color-alist): Renamed from 20671 * term/tty-colors.el (tty-defined-color-alist): Renamed from
20672 tty-color-alist. 20672 tty-color-alist.
20673 (tty-color-alist, tty-modify-color-alist): New functions. 20673 (tty-color-alist, tty-modify-color-alist): New functions.
20674 (tty-color-define, tty-color-clear, tty-color-approximate) 20674 (tty-color-define, tty-color-clear, tty-color-approximate)
20675 (tty-color-translate, tty-color-by-index, tty-color-desc): Accept an 20675 (tty-color-translate, tty-color-by-index, tty-color-desc): Accept an
20676 optional parameter FRAME. 20676 optional parameter FRAME.
20677 20677
diff --git a/lisp/allout.el b/lisp/allout.el
index acf0b7d75b6..04de853ebe0 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -1522,8 +1522,8 @@ The verifier string is retained as an Emacs file variable, as well as in
1522the Emacs buffer state, if file variable adjustments are enabled. See 1522the Emacs buffer state, if file variable adjustments are enabled. See
1523`allout-enable-file-variable-adjustment' for details about that.") 1523`allout-enable-file-variable-adjustment' for details about that.")
1524(make-variable-buffer-local 'allout-passphrase-verifier-string) 1524(make-variable-buffer-local 'allout-passphrase-verifier-string)
1525(make-obsolete 'allout-passphrase-verifier-string 1525(make-obsolete-variable 'allout-passphrase-verifier-string
1526 'allout-passphrase-verifier-string "23.3") 1526 'allout-passphrase-verifier-string "23.3")
1527;;;###autoload 1527;;;###autoload
1528(put 'allout-passphrase-verifier-string 'safe-local-variable 'stringp) 1528(put 'allout-passphrase-verifier-string 'safe-local-variable 'stringp)
1529;;;_ = allout-passphrase-hint-string 1529;;;_ = allout-passphrase-hint-string
@@ -1538,8 +1538,8 @@ state, if file variable adjustments are enabled. See
1538`allout-enable-file-variable-adjustment' for details about that.") 1538`allout-enable-file-variable-adjustment' for details about that.")
1539(make-variable-buffer-local 'allout-passphrase-hint-string) 1539(make-variable-buffer-local 'allout-passphrase-hint-string)
1540(setq-default allout-passphrase-hint-string "") 1540(setq-default allout-passphrase-hint-string "")
1541(make-obsolete 'allout-passphrase-hint-string 1541(make-obsolete-variable 'allout-passphrase-hint-string
1542 'allout-passphrase-hint-string "23.3") 1542 'allout-passphrase-hint-string "23.3")
1543;;;###autoload 1543;;;###autoload
1544(put 'allout-passphrase-hint-string 'safe-local-variable 'stringp) 1544(put 'allout-passphrase-hint-string 'safe-local-variable 'stringp)
1545;;;_ = allout-after-save-decrypt 1545;;;_ = allout-after-save-decrypt
@@ -1688,11 +1688,10 @@ from what it did before, for backwards compatibility.
1688 1688
1689MODE is the activation mode - see `allout-auto-activation' for 1689MODE is the activation mode - see `allout-auto-activation' for
1690valid values." 1690valid values."
1691 1691 (declare (obsolete allout-auto-activation "23.3"))
1692 (custom-set-variables (list 'allout-auto-activation (format "%s" mode))) 1692 (custom-set-variables (list 'allout-auto-activation (format "%s" mode)))
1693 (format "%s" mode)) 1693 (format "%s" mode))
1694(make-obsolete 'allout-init 1694
1695 "customize 'allout-auto-activation' instead." "23.3")
1696;;;_ > allout-setup-menubar () 1695;;;_ > allout-setup-menubar ()
1697(defun allout-setup-menubar () 1696(defun allout-setup-menubar ()
1698 "Populate the current buffer's menubar with `allout-mode' stuff." 1697 "Populate the current buffer's menubar with `allout-mode' stuff."
diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el
index 8305aaf1199..047b4b944b9 100644
--- a/lisp/ansi-color.el
+++ b/lisp/ansi-color.el
@@ -230,8 +230,8 @@ This is a good function to put in `comint-output-filter-functions'."
230 (t 230 (t
231 (ansi-color-apply-on-region start-marker end-marker))))) 231 (ansi-color-apply-on-region start-marker end-marker)))))
232 232
233(defalias 'ansi-color-unfontify-region 'font-lock-default-unfontify-region) 233(define-obsolete-function-alias 'ansi-color-unfontify-region
234(make-obsolete 'ansi-color-unfontify-region "not needed any more" "24.1") 234 'font-lock-default-unfontify-region "24.1")
235 235
236;; Working with strings 236;; Working with strings
237(defvar ansi-color-context nil 237(defvar ansi-color-context nil
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index c776a3f8b5c..a97a052dc08 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -1117,13 +1117,54 @@ using `make-temp-file', and the generated name is returned."
1117 (archive-delete-local tmpfile) 1117 (archive-delete-local tmpfile)
1118 success)) 1118 success))
1119 1119
1120(defun archive-extract-by-stdout (archive name command &optional stderr-file) 1120(defun archive-extract-by-stdout (archive name command &optional stderr-test)
1121 (apply 'call-process 1121 (let ((stderr-file (make-temp-file "arc-stderr")))
1122 (car command) 1122 (unwind-protect
1123 nil 1123 (prog1
1124 (if stderr-file (list t stderr-file) t) 1124 (apply 'call-process
1125 nil 1125 (car command)
1126 (append (cdr command) (list archive name)))) 1126 nil
1127 (if stderr-file (list t stderr-file) t)
1128 nil
1129 (append (cdr command) (list archive name)))
1130 (with-temp-buffer
1131 (insert-file-contents stderr-file)
1132 (goto-char (point-min))
1133 (when (if (stringp stderr-test)
1134 (not (re-search-forward stderr-test nil t))
1135 (> (buffer-size) 0))
1136 (message "%s" (buffer-string)))))
1137 (if (file-exists-p stderr-file)
1138 (delete-file stderr-file)))))
1139
1140(defun archive-extract-by-file (archive name command &optional stdout-test)
1141 (let ((dest (make-temp-file "arc-dir" 'dir))
1142 (stdout-file (make-temp-file "arc-stdout")))
1143 (unwind-protect
1144 (prog1
1145 (apply 'call-process
1146 (car command)
1147 nil
1148 `(:file ,stdout-file)
1149 nil
1150 (append (cdr command) (list archive name dest)))
1151 (with-temp-buffer
1152 (insert-file-contents stdout-file)
1153 (goto-char (point-min))
1154 (when (if (stringp stdout-test)
1155 (not (re-search-forward stdout-test nil t))
1156 (> (buffer-size) 0))
1157 (message "%s" (buffer-string))))
1158 (if (file-exists-p (expand-file-name name dest))
1159 (insert-file-contents-literally (expand-file-name name dest))))
1160 (if (file-exists-p stdout-file)
1161 (delete-file stdout-file))
1162 (if (file-exists-p (expand-file-name name dest))
1163 (delete-file (expand-file-name name dest)))
1164 (while (file-name-directory name)
1165 (setq name (directory-file-name (file-name-directory name)))
1166 (delete-directory (expand-file-name name dest)))
1167 (delete-directory dest))))
1127 1168
1128(defun archive-extract-other-window () 1169(defun archive-extract-other-window ()
1129 "In archive mode, find this member in another window." 1170 "In archive mode, find this member in another window."
@@ -2006,17 +2047,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
2006 ;; The code below assumes the name is relative and may do undesirable 2047 ;; The code below assumes the name is relative and may do undesirable
2007 ;; things otherwise. 2048 ;; things otherwise.
2008 (error "Can't extract files with non-relative names") 2049 (error "Can't extract files with non-relative names")
2009 (let ((dest (make-temp-file "arc-rar" 'dir))) 2050 (archive-extract-by-file archive name '("unrar-free" "--extract") "All OK")))
2010 (unwind-protect
2011 (progn
2012 (call-process "unrar-free" nil nil nil
2013 "--extract" archive name dest)
2014 (insert-file-contents-literally (expand-file-name name dest)))
2015 (delete-file (expand-file-name name dest))
2016 (while (file-name-directory name)
2017 (setq name (directory-file-name (file-name-directory name)))
2018 (delete-directory (expand-file-name name dest)))
2019 (delete-directory dest)))))
2020 2051
2021;;; Section: Rar self-extracting .exe archives. 2052;;; Section: Rar self-extracting .exe archives.
2022 2053
@@ -2099,17 +2130,11 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
2099 (apply 'vector files)))) 2130 (apply 'vector files))))
2100 2131
2101(defun archive-7z-extract (archive name) 2132(defun archive-7z-extract (archive name)
2102 (let ((tmpfile (make-temp-file "7z-stderr"))) 2133 ;; 7z doesn't provide a `quiet' option to suppress non-essential
2103 ;; 7z doesn't provide a `quiet' option to suppress non-essential 2134 ;; stderr messages. So redirect stderr to a temp file and display it
2104 ;; stderr messages. So redirect stderr to a temp file and display it 2135 ;; in the echo area when it contains no message indicating success.
2105 ;; in the echo area when it contains error messages. 2136 (archive-extract-by-stdout
2106 (prog1 (archive-extract-by-stdout 2137 archive name archive-7z-extract "Everything is Ok"))
2107 archive name archive-7z-extract tmpfile)
2108 (with-temp-buffer
2109 (insert-file-contents tmpfile)
2110 (unless (search-forward "Everything is Ok" nil t)
2111 (message "%s" (buffer-string)))
2112 (delete-file tmpfile)))))
2113 2138
2114(defun archive-7z-write-file-member (archive descr) 2139(defun archive-7z-write-file-member (archive descr)
2115 (archive-*-write-file-member 2140 (archive-*-write-file-member
diff --git a/lisp/bindings.el b/lisp/bindings.el
index c20a7f30eea..b4f9d29fe52 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -40,7 +40,7 @@ corresponding to the mode line clicked."
40 (interactive "e") 40 (interactive "e")
41 (save-selected-window 41 (save-selected-window
42 (select-window (posn-window (event-start event))) 42 (select-window (posn-window (event-start event)))
43 (call-interactively 'toggle-read-only))) 43 (read-only-mode 'toggle)))
44 44
45(defun mode-line-toggle-modified (event) 45(defun mode-line-toggle-modified (event)
46 "Toggle the buffer-modified flag from the mode-line." 46 "Toggle the buffer-modified flag from the mode-line."
@@ -898,6 +898,7 @@ if `inhibit-field-text-motion' is non-nil."
898(define-key goto-map "\M-n" 'next-error) 898(define-key goto-map "\M-n" 'next-error)
899(define-key goto-map "p" 'previous-error) 899(define-key goto-map "p" 'previous-error)
900(define-key goto-map "\M-p" 'previous-error) 900(define-key goto-map "\M-p" 'previous-error)
901(define-key goto-map "\t" 'move-to-column)
901 902
902(defvar search-map (make-sparse-keymap) 903(defvar search-map (make-sparse-keymap)
903 "Keymap for search related commands.") 904 "Keymap for search related commands.")
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 31bbc13acf9..26ba1dec00f 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1048,12 +1048,11 @@ The return value has the form (BUFFER . POINT).
1048 1048
1049Note: this function is deprecated and is present for Emacs 22 1049Note: this function is deprecated and is present for Emacs 22
1050compatibility only." 1050compatibility only."
1051 (declare (obsolete bookmark-handle-bookmark "23.1"))
1051 (save-excursion 1052 (save-excursion
1052 (bookmark-handle-bookmark bookmark) 1053 (bookmark-handle-bookmark bookmark)
1053 (cons (current-buffer) (point)))) 1054 (cons (current-buffer) (point))))
1054 1055
1055(make-obsolete 'bookmark-jump-noselect 'bookmark-handle-bookmark "23.1")
1056
1057(defun bookmark-handle-bookmark (bookmark-name-or-record) 1056(defun bookmark-handle-bookmark (bookmark-name-or-record)
1058 "Call BOOKMARK-NAME-OR-RECORD's handler or `bookmark-default-handler' 1057 "Call BOOKMARK-NAME-OR-RECORD's handler or `bookmark-default-handler'
1059if it has none. This changes current buffer and point and returns nil, 1058if it has none. This changes current buffer and point and returns nil,
diff --git a/lisp/bs.el b/lisp/bs.el
index 09aefee416e..a84c951acfe 100644
--- a/lisp/bs.el
+++ b/lisp/bs.el
@@ -962,7 +962,7 @@ Default is `bs--current-sort-function'."
962Uses function `toggle-read-only'." 962Uses function `toggle-read-only'."
963 (interactive) 963 (interactive)
964 (with-current-buffer (bs--current-buffer) 964 (with-current-buffer (bs--current-buffer)
965 (call-interactively 'toggle-read-only)) 965 (read-only-mode 'toggle))
966 (bs--update-current-line)) 966 (bs--update-current-line))
967 967
968(defun bs-clear-modified () 968(defun bs-clear-modified ()
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index 589b6ebc47a..6ab6e548ab5 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -64,13 +64,13 @@ minus `Buffer-menu-size-width'. This use is deprecated."
64 "24.3") 64 "24.3")
65 65
66(defcustom Buffer-menu-name-width 19 66(defcustom Buffer-menu-name-width 19
67 "Width of buffer size column in the Buffer Menu." 67 "Width of buffer name column in the Buffer Menu."
68 :type 'number 68 :type 'number
69 :group 'Buffer-menu 69 :group 'Buffer-menu
70 :version "24.3") 70 :version "24.3")
71 71
72(defcustom Buffer-menu-size-width 7 72(defcustom Buffer-menu-size-width 7
73 "Width of buffer name column in the Buffer Menu." 73 "Width of buffer size column in the Buffer Menu."
74 :type 'number 74 :type 'number
75 :group 'Buffer-menu 75 :group 'Buffer-menu
76 :version "24.3") 76 :version "24.3")
@@ -520,7 +520,7 @@ This behaves like invoking \\[toggle-read-only] in that buffer."
520 (interactive) 520 (interactive)
521 (let ((read-only 521 (let ((read-only
522 (with-current-buffer (Buffer-menu-buffer t) 522 (with-current-buffer (Buffer-menu-buffer t)
523 (call-interactively 'toggle-read-only) 523 (read-only-mode 'toggle)
524 buffer-read-only))) 524 buffer-read-only)))
525 (tabulated-list-set-col 1 (if read-only "%" " ") t))) 525 (tabulated-list-set-col 1 (if read-only "%" " ") t)))
526 526
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el
index 9c01ab40c0c..325ac3e8146 100644
--- a/lisp/calendar/cal-tex.el
+++ b/lisp/calendar/cal-tex.el
@@ -1097,7 +1097,7 @@ shown are hard-coded to 8-12, 13-17."
1097 (cal-tex-longday "leftday" "2.75in")) 1097 (cal-tex-longday "leftday" "2.75in"))
1098 (cal-tex-b-document) 1098 (cal-tex-b-document)
1099 (cal-tex-cmd "\\pagestyle" "empty") 1099 (cal-tex-cmd "\\pagestyle" "empty")
1100 ;; Let's assume this is something to with twopage documents. 1100 ;; Let's assume this is something to do with twopage documents.
1101 ;; It has the downside that we start with a blank page. 1101 ;; It has the downside that we start with a blank page.
1102 ;; It doesn't make obvious sense when oddside and evenside margins 1102 ;; It doesn't make obvious sense when oddside and evenside margins
1103 ;; are the same (non-filofax), but consider the left and right 1103 ;; are the same (non-filofax), but consider the left and right
diff --git a/lisp/calendar/cal-x.el b/lisp/calendar/cal-x.el
index 0f2d43b2237..6fba7fb7423 100644
--- a/lisp/calendar/cal-x.el
+++ b/lisp/calendar/cal-x.el
@@ -155,29 +155,23 @@ If PROMPT is non-nil, prompt for the month and year to use."
155(defun calendar-one-frame-setup (&optional prompt) 155(defun calendar-one-frame-setup (&optional prompt)
156 "Display calendar and diary in a single dedicated frame. 156 "Display calendar and diary in a single dedicated frame.
157See `calendar-frame-setup' for more information." 157See `calendar-frame-setup' for more information."
158 (declare (obsolete calendar-frame-setup "23.1"))
158 (calendar-frame-setup 'one-frame prompt)) 159 (calendar-frame-setup 'one-frame prompt))
159 160
160(make-obsolete 'calendar-one-frame-setup 'calendar-frame-setup "23.1")
161
162
163;;;###cal-autoload 161;;;###cal-autoload
164(defun calendar-only-one-frame-setup (&optional prompt) 162(defun calendar-only-one-frame-setup (&optional prompt)
165 "Display calendar in a dedicated frame. 163 "Display calendar in a dedicated frame.
166See `calendar-frame-setup' for more information." 164See `calendar-frame-setup' for more information."
165 (declare (obsolete calendar-frame-setup "23.1"))
167 (calendar-frame-setup 'calendar-only prompt)) 166 (calendar-frame-setup 'calendar-only prompt))
168 167
169(make-obsolete 'calendar-only-one-frame-setup 'calendar-frame-setup "23.1")
170
171
172;;;###cal-autoload 168;;;###cal-autoload
173(defun calendar-two-frame-setup (&optional prompt) 169(defun calendar-two-frame-setup (&optional prompt)
174 "Display calendar and diary in separate, dedicated frames. 170 "Display calendar and diary in separate, dedicated frames.
175See `calendar-frame-setup' for more information." 171See `calendar-frame-setup' for more information."
172 (declare (obsolete calendar-frame-setup "23.1"))
176 (calendar-frame-setup 'two-frames prompt)) 173 (calendar-frame-setup 'two-frames prompt))
177 174
178(make-obsolete 'calendar-two-frame-setup 'calendar-frame-setup "23.1")
179
180
181;; Undocumented and probably useless. 175;; Undocumented and probably useless.
182(defvar cal-x-load-hook nil 176(defvar cal-x-load-hook nil
183 "Hook run on loading of the `cal-x' package.") 177 "Hook run on loading of the `cal-x' package.")
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 93ef440541e..6f8311f4c55 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1001,18 +1001,16 @@ The valid styles are described in the documentation of `calendar-date-style'."
1001 1001
1002(defun european-calendar () 1002(defun european-calendar ()
1003 "Set the interpretation and display of dates to the European style." 1003 "Set the interpretation and display of dates to the European style."
1004 (declare (obsolete calendar-set-date-style "23.1"))
1004 (interactive) 1005 (interactive)
1005 (calendar-set-date-style 'european)) 1006 (calendar-set-date-style 'european))
1006 1007
1007(make-obsolete 'european-calendar 'calendar-set-date-style "23.1")
1008
1009(defun american-calendar () 1008(defun american-calendar ()
1010 "Set the interpretation and display of dates to the American style." 1009 "Set the interpretation and display of dates to the American style."
1010 (declare (obsolete calendar-set-date-style "23.1"))
1011 (interactive) 1011 (interactive)
1012 (calendar-set-date-style 'american)) 1012 (calendar-set-date-style 'american))
1013 1013
1014(make-obsolete 'american-calendar 'calendar-set-date-style "23.1")
1015
1016(define-obsolete-variable-alias 'holidays-in-diary-buffer 1014(define-obsolete-variable-alias 'holidays-in-diary-buffer
1017 'diary-show-holidays-flag "23.1") 1015 'diary-show-holidays-flag "23.1")
1018 1016
@@ -1148,14 +1146,13 @@ MON defaults to `displayed-month'. YR defaults to `displayed-year'."
1148 "Execute a for loop. 1146 "Execute a for loop.
1149Evaluate BODY with VAR bound to successive integers from INIT to FINAL, 1147Evaluate BODY with VAR bound to successive integers from INIT to FINAL,
1150inclusive. The standard macro `dotimes' is preferable in most cases." 1148inclusive. The standard macro `dotimes' is preferable in most cases."
1151 (declare (debug (symbolp "from" form "to" form "do" body)) 1149 (declare (obsolete "use `dotimes' or `while' instead." "23.1")
1150 (debug (symbolp "from" form "to" form "do" body))
1152 (indent defun)) 1151 (indent defun))
1153 `(let ((,var (1- ,init))) 1152 `(let ((,var (1- ,init)))
1154 (while (>= ,final (setq ,var (1+ ,var))) 1153 (while (>= ,final (setq ,var (1+ ,var)))
1155 ,@body))) 1154 ,@body)))
1156 1155
1157(make-obsolete 'calendar-for-loop "use `dotimes' or `while' instead." "23.1")
1158
1159(defmacro calendar-sum (index initial condition expression) 1156(defmacro calendar-sum (index initial condition expression)
1160 "For INDEX = INITIAL, +1, ... (as long as CONDITION holds), sum EXPRESSION." 1157 "For INDEX = INITIAL, +1, ... (as long as CONDITION holds), sum EXPRESSION."
1161 (declare (debug (symbolp form form form))) 1158 (declare (debug (symbolp form form form)))
@@ -2298,7 +2295,7 @@ Negative years are interpreted as years BC; -1 being 1 BC, and so on."
2298 ;; First two chars of each day are used in the calendar. 2295 ;; First two chars of each day are used in the calendar.
2299 (,(regexp-opt (mapcar (lambda (x) (substring x 0 calendar-day-header-width)) 2296 (,(regexp-opt (mapcar (lambda (x) (substring x 0 calendar-day-header-width))
2300 calendar-day-name-array)) 2297 calendar-day-name-array))
2301 . font-lock-reference-face)) 2298 . font-lock-constant-face))
2302 "Default keywords to highlight in Calendar mode.") 2299 "Default keywords to highlight in Calendar mode.")
2303 2300
2304(defun calendar-day-name (date &optional abbrev absolute) 2301(defun calendar-day-name (date &optional abbrev absolute)
@@ -2655,13 +2652,7 @@ If called by a mouse-event, pops up a menu with the result."
2655 "---") 2652 "---")
2656 (calendar-string-spread (list str) ?- width))))) 2653 (calendar-string-spread (list str) ?- width)))))
2657 2654
2658(defun calendar-version () 2655(define-obsolete-function-alias 'calendar-version 'emacs-version "23.1")
2659 "Display the Calendar version."
2660 (interactive)
2661 (message "GNU Emacs %s" emacs-version))
2662
2663(make-obsolete 'calendar-version 'emacs-version "23.1")
2664
2665 2656
2666(run-hooks 'calendar-load-hook) 2657(run-hooks 'calendar-load-hook)
2667 2658
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 4bce8ec0927..27c6f76581c 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -2400,10 +2400,10 @@ return a font-lock pattern matching array of MONTHS and marking SYMBOL."
2400 (cons 2400 (cons
2401 (format "^%s?\\(%s\\)" (regexp-quote diary-nonmarking-symbol) 2401 (format "^%s?\\(%s\\)" (regexp-quote diary-nonmarking-symbol)
2402 (regexp-quote diary-sexp-entry-symbol)) 2402 (regexp-quote diary-sexp-entry-symbol))
2403 '(1 font-lock-reference-face)) 2403 '(1 font-lock-constant-face))
2404 (cons 2404 (cons
2405 (format "^%s" (regexp-quote diary-nonmarking-symbol)) 2405 (format "^%s" (regexp-quote diary-nonmarking-symbol))
2406 'font-lock-reference-face) 2406 'font-lock-constant-face)
2407 (cons 2407 (cons
2408 (format "^%s?%s" (regexp-quote diary-nonmarking-symbol) 2408 (format "^%s?%s" (regexp-quote diary-nonmarking-symbol)
2409 (regexp-opt (mapcar 'regexp-quote 2409 (regexp-opt (mapcar 'regexp-quote
@@ -2411,7 +2411,7 @@ return a font-lock pattern matching array of MONTHS and marking SYMBOL."
2411 diary-islamic-entry-symbol 2411 diary-islamic-entry-symbol
2412 diary-bahai-entry-symbol)) 2412 diary-bahai-entry-symbol))
2413 t)) 2413 t))
2414 '(1 font-lock-reference-face)) 2414 '(1 font-lock-constant-face))
2415 '(diary-font-lock-sexps . font-lock-keyword-face) 2415 '(diary-font-lock-sexps . font-lock-keyword-face)
2416 ;; Don't need to worry about space around "-" because the first 2416 ;; Don't need to worry about space around "-" because the first
2417 ;; match takes care of that. It does mean the "-" itself may or 2417 ;; match takes care of that. It does mean the "-" itself may or
@@ -2482,7 +2482,7 @@ This depends on the calendar date style."
2482(defvar diary-fancy-font-lock-keywords 2482(defvar diary-fancy-font-lock-keywords
2483 `((diary-fancy-date-matcher . diary-face) 2483 `((diary-fancy-date-matcher . diary-face)
2484 ("^.*\\([aA]nniversary\\|[bB]irthday\\).*$" . 'diary-anniversary) 2484 ("^.*\\([aA]nniversary\\|[bB]irthday\\).*$" . 'diary-anniversary)
2485 ("^.*Yahrzeit.*$" . font-lock-reference-face) 2485 ("^.*Yahrzeit.*$" . font-lock-constant-face)
2486 ("^\\(Erev \\)?Rosh Hodesh.*" . font-lock-function-name-face) 2486 ("^\\(Erev \\)?Rosh Hodesh.*" . font-lock-function-name-face)
2487 ("^Day.*omer.*$" . font-lock-builtin-face) 2487 ("^Day.*omer.*$" . font-lock-builtin-face)
2488 ("^Parashat.*$" . font-lock-comment-face) 2488 ("^Parashat.*$" . font-lock-comment-face)
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index 7326aa530ad..39b83d4c831 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -931,8 +931,8 @@ Finto iCalendar file: ")
931 (set-buffer (find-file diary-filename)) 931 (set-buffer (find-file diary-filename))
932 (icalendar-export-region (point-min) (point-max) ical-filename))) 932 (icalendar-export-region (point-min) (point-max) ical-filename)))
933 933
934(defalias 'icalendar-convert-diary-to-ical 'icalendar-export-file) 934(define-obsolete-function-alias 'icalendar-convert-diary-to-ical
935(make-obsolete 'icalendar-convert-diary-to-ical 'icalendar-export-file "22.1") 935 'icalendar-export-file "22.1")
936 936
937(defvar icalendar--uid-count 0 937(defvar icalendar--uid-count 0
938 "Auxiliary counter for creating unique ids.") 938 "Auxiliary counter for creating unique ids.")
@@ -1881,8 +1881,8 @@ buffer `*icalendar-errors*'."
1881 ;; return nil, i.e. import did not work 1881 ;; return nil, i.e. import did not work
1882 nil))) 1882 nil)))
1883 1883
1884(defalias 'icalendar-extract-ical-from-buffer 'icalendar-import-buffer) 1884(define-obsolete-function-alias 'icalendar-extract-ical-from-buffer
1885(make-obsolete 'icalendar-extract-ical-from-buffer 'icalendar-import-buffer "22.1") 1885 'icalendar-import-buffer "22.1")
1886 1886
1887(defun icalendar--format-ical-event (event) 1887(defun icalendar--format-ical-event (event)
1888 "Create a string representation of an iCalendar EVENT." 1888 "Create a string representation of an iCalendar EVENT."
diff --git a/lisp/comint.el b/lisp/comint.el
index 994d81a375a..fea9cecfa03 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -3069,11 +3069,11 @@ Magic characters are those in `comint-file-name-quote-list'."
3069 3069
3070(defun comint-unquote-filename (filename) 3070(defun comint-unquote-filename (filename)
3071 "Return FILENAME with quoted characters unquoted." 3071 "Return FILENAME with quoted characters unquoted."
3072 (declare (obsolete nil "24.3"))
3072 (if (null comint-file-name-quote-list) 3073 (if (null comint-file-name-quote-list)
3073 filename 3074 filename
3074 (save-match-data 3075 (save-match-data
3075 (replace-regexp-in-string "\\\\\\(.\\)" "\\1" filename t)))) 3076 (replace-regexp-in-string "\\\\\\(.\\)" "\\1" filename t))))
3076(make-obsolete 'comint-unquote-filename nil "24.3")
3077 3077
3078(defun comint--requote-argument (upos qstr) 3078(defun comint--requote-argument (upos qstr)
3079 ;; See `completion-table-with-quoting'. 3079 ;; See `completion-table-with-quoting'.
@@ -3170,10 +3170,9 @@ See `completion-table-with-quoting' and `comint-unquote-function'.")
3170(defun comint-dynamic-complete-as-filename () 3170(defun comint-dynamic-complete-as-filename ()
3171 "Dynamically complete at point as a filename. 3171 "Dynamically complete at point as a filename.
3172See `comint-dynamic-complete-filename'. Returns t if successful." 3172See `comint-dynamic-complete-filename'. Returns t if successful."
3173 (declare (obsolete comint-filename-completion "24.1"))
3173 (let ((data (comint--complete-file-name-data))) 3174 (let ((data (comint--complete-file-name-data)))
3174 (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data)))) 3175 (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data))))
3175(make-obsolete 'comint-dynamic-complete-as-filename
3176 'comint-filename-completion "24.1")
3177 3176
3178(defun comint-replace-by-expanded-filename () 3177(defun comint-replace-by-expanded-filename ()
3179 "Dynamically expand and complete the filename at point. 3178 "Dynamically expand and complete the filename at point.
@@ -3204,6 +3203,7 @@ Return `partial' if completed as far as possible.
3204Return `listed' if a completion listing was shown. 3203Return `listed' if a completion listing was shown.
3205 3204
3206See also `comint-dynamic-complete-filename'." 3205See also `comint-dynamic-complete-filename'."
3206 (declare (obsolete completion-in-region "24.1"))
3207 (let* ((completion-ignore-case (memq system-type '(ms-dos windows-nt cygwin))) 3207 (let* ((completion-ignore-case (memq system-type '(ms-dos windows-nt cygwin)))
3208 (minibuffer-p (window-minibuffer-p (selected-window))) 3208 (minibuffer-p (window-minibuffer-p (selected-window)))
3209 (suffix (cond ((not comint-completion-addsuffix) "") 3209 (suffix (cond ((not comint-completion-addsuffix) "")
@@ -3246,8 +3246,6 @@ See also `comint-dynamic-complete-filename'."
3246 (unless minibuffer-p 3246 (unless minibuffer-p
3247 (message "Partially completed")) 3247 (message "Partially completed"))
3248 'partial))))))) 3248 'partial)))))))
3249(make-obsolete 'comint-dynamic-simple-complete 'completion-in-region "24.1")
3250
3251 3249
3252(defun comint-dynamic-list-filename-completions () 3250(defun comint-dynamic-list-filename-completions ()
3253 "Display a list of possible completions for the filename at point." 3251 "Display a list of possible completions for the filename at point."
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 2e6f2b14625..8e06b16bd12 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -2228,9 +2228,9 @@ and `face'."
2228 (setq widget nil))))) 2228 (setq widget nil)))))
2229 (widget-setup)) 2229 (widget-setup))
2230 2230
2231(make-obsolete 'custom-show "this widget type is no longer supported." "24.1")
2232(defun custom-show (widget value) 2231(defun custom-show (widget value)
2233 "Non-nil if WIDGET should be shown with VALUE by default." 2232 "Non-nil if WIDGET should be shown with VALUE by default."
2233 (declare (obsolete "this widget type is no longer supported." "24.1"))
2234 (let ((show (widget-get widget :custom-show))) 2234 (let ((show (widget-get widget :custom-show)))
2235 (if (functionp show) 2235 (if (functionp show)
2236 (funcall show widget value) 2236 (funcall show widget value)
@@ -4823,12 +4823,7 @@ if that value is non-nil."
4823 4823
4824(put 'Custom-mode 'mode-class 'special) 4824(put 'Custom-mode 'mode-class 'special)
4825 4825
4826;; backward-compatibility 4826(define-obsolete-function-alias 'custom-mode 'Custom-mode "23.1")
4827(defun custom-mode ()
4828 "Non-interactive variant of `Custom-mode'."
4829 (Custom-mode))
4830(make-obsolete 'custom-mode 'Custom-mode "23.1")
4831(put 'custom-mode 'mode-class 'special)
4832 4827
4833(add-to-list 'debug-ignored-errors "^Invalid face:? ") 4828(add-to-list 'debug-ignored-errors "^Invalid face:? ")
4834 4829
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index a91a479b054..28c1d3e3026 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -443,7 +443,6 @@ since it could result in memory overflow and make Emacs crash."
443 (hscroll-step windows number "22.1") 443 (hscroll-step windows number "22.1")
444 (truncate-partial-width-windows display boolean "23.1") 444 (truncate-partial-width-windows display boolean "23.1")
445 (make-cursor-line-fully-visible windows boolean) 445 (make-cursor-line-fully-visible windows boolean)
446 (mode-line-inverse-video mode-line boolean)
447 (mode-line-in-non-selected-windows mode-line boolean "22.1") 446 (mode-line-in-non-selected-windows mode-line boolean "22.1")
448 (line-number-display-limit display 447 (line-number-display-limit display
449 (choice integer 448 (choice integer
diff --git a/lisp/custom.el b/lisp/custom.el
index dfc8e631152..dc810e3c97d 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1193,7 +1193,8 @@ Return t if THEME was successfully loaded, nil otherwise."
1193 (expand-file-name "themes/" data-directory))) 1193 (expand-file-name "themes/" data-directory)))
1194 (member hash custom-safe-themes) 1194 (member hash custom-safe-themes)
1195 (custom-theme-load-confirm hash)) 1195 (custom-theme-load-confirm hash))
1196 (let ((custom--inhibit-theme-enable t)) 1196 (let ((custom--inhibit-theme-enable t)
1197 (buffer-file-name fn)) ;For load-history.
1197 (eval-buffer)) 1198 (eval-buffer))
1198 ;; Optimization: if the theme changes the `default' face, put that 1199 ;; Optimization: if the theme changes the `default' face, put that
1199 ;; entry first. This avoids some `frame-set-background-mode' rigmarole 1200 ;; entry first. This avoids some `frame-set-background-mode' rigmarole
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 75deb58b4d8..c8023bb43ed 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1045,11 +1045,10 @@ Using it may cause conflicts. Use it anyway? " owner)))))
1045(defun desktop-load-default () 1045(defun desktop-load-default ()
1046 "Load the `default' start-up library manually. 1046 "Load the `default' start-up library manually.
1047Also inhibit further loading of it." 1047Also inhibit further loading of it."
1048 (declare (obsolete desktop-save-mode "22.1"))
1048 (unless inhibit-default-init ; safety check 1049 (unless inhibit-default-init ; safety check
1049 (load "default" t t) 1050 (load "default" t t)
1050 (setq inhibit-default-init t))) 1051 (setq inhibit-default-init t)))
1051(make-obsolete 'desktop-load-default
1052 'desktop-save-mode "22.1")
1053 1052
1054;; ---------------------------------------------------------------------------- 1053;; ----------------------------------------------------------------------------
1055;;;###autoload 1054;;;###autoload
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index f176cf7dbe0..1237eef86cf 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -723,15 +723,13 @@ determine a default directory.")
723(defun dired-default-directory () 723(defun dired-default-directory ()
724 "Return the `dired-default-directory-alist' entry for the current major-mode. 724 "Return the `dired-default-directory-alist' entry for the current major-mode.
725If none, return `default-directory'." 725If none, return `default-directory'."
726 ;; It looks like this was intended to be something of a "general"
727 ;; feature, but it only ever seems to have been used in
728 ;; dired-smart-shell-command, and doesn't seem worth keeping around.
729 (declare (obsolete nil "24.1"))
726 (or (eval (cdr (assq major-mode dired-default-directory-alist))) 730 (or (eval (cdr (assq major-mode dired-default-directory-alist)))
727 default-directory)) 731 default-directory))
728 732
729;; It looks like this was intended to be something of a "general" feature,
730;; but it only ever seems to have been used in dired-smart-shell-command,
731;; and does not seem worth keeping around (?).
732(make-obsolete 'dired-default-directory
733 "this feature is due to be removed." "24.1")
734
735(defun dired-smart-shell-command (command &optional output-buffer error-buffer) 733(defun dired-smart-shell-command (command &optional output-buffer error-buffer)
736 "Like function `shell-command', but in the current Virtual Dired directory." 734 "Like function `shell-command', but in the current Virtual Dired directory."
737 (interactive 735 (interactive
@@ -782,6 +780,7 @@ See also `dired-enable-local-variables'."
782 780
783(defun dired-hack-local-variables () 781(defun dired-hack-local-variables ()
784 "Evaluate local variables in `dired-local-variables-file' for dired buffer." 782 "Evaluate local variables in `dired-local-variables-file' for dired buffer."
783 (declare (obsolete hack-dir-local-variables-non-file-buffer "24.1"))
785 (and (stringp dired-local-variables-file) 784 (and (stringp dired-local-variables-file)
786 (file-exists-p dired-local-variables-file) 785 (file-exists-p dired-local-variables-file)
787 (let ((opoint (point-max)) 786 (let ((opoint (point-max))
@@ -803,14 +802,12 @@ See also `dired-enable-local-variables'."
803 ;; Make sure that the mode line shows the proper information. 802 ;; Make sure that the mode line shows the proper information.
804 (dired-sort-set-mode-line)))) 803 (dired-sort-set-mode-line))))
805 804
806(make-obsolete 'dired-hack-local-variables
807 'hack-dir-local-variables-non-file-buffer "24.1")
808
809;; Does not seem worth a dedicated command. 805;; Does not seem worth a dedicated command.
810;; See the more general features in files-x.el. 806;; See the more general features in files-x.el.
811(defun dired-omit-here-always () 807(defun dired-omit-here-always ()
812 "Create `dir-locals-file' setting `dired-omit-mode' to t in `dired-mode'. 808 "Create `dir-locals-file' setting `dired-omit-mode' to t in `dired-mode'.
813If in a Dired buffer, reverts it." 809If in a Dired buffer, reverts it."
810 (declare (obsolete add-dir-local-variable "24.1"))
814 (interactive) 811 (interactive)
815 (if (file-exists-p dired-local-variables-file) 812 (if (file-exists-p dired-local-variables-file)
816 (error "Old-style dired-local-variables-file `./%s' found; 813 (error "Old-style dired-local-variables-file `./%s' found;
@@ -830,8 +827,6 @@ replace it with a dir-locals-file `./%s'"
830 (dired-extra-startup) 827 (dired-extra-startup)
831 (dired-revert)))) 828 (dired-revert))))
832 829
833(make-obsolete 'dired-omit-here-always 'add-dir-local-variable "24.1")
834
835 830
836;;; GUESS SHELL COMMAND. 831;;; GUESS SHELL COMMAND.
837 832
diff --git a/lisp/dired.el b/lisp/dired.el
index 6defd6c4877..8cb3902161a 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1964,7 +1964,7 @@ Otherwise, call `toggle-read-only'."
1964 (interactive) 1964 (interactive)
1965 (if (derived-mode-p 'dired-mode) 1965 (if (derived-mode-p 'dired-mode)
1966 (wdired-change-to-wdired-mode) 1966 (wdired-change-to-wdired-mode)
1967 (call-interactively 'toggle-read-only))) 1967 (read-only-mode 'toggle)))
1968 1968
1969(defun dired-next-line (arg) 1969(defun dired-next-line (arg)
1970 "Move down lines then position at filename. 1970 "Move down lines then position at filename.
@@ -2997,7 +2997,8 @@ argument or confirmation)."
2997 (let ((split-height-threshold 0)) 2997 (let ((split-height-threshold 0))
2998 (with-temp-buffer-window 2998 (with-temp-buffer-window
2999 buffer 2999 buffer
3000 (cons 'display-buffer-below-selected nil) 3000 (cons 'display-buffer-below-selected
3001 '((window-height . fit-window-to-buffer)))
3001 #'(lambda (window _value) 3002 #'(lambda (window _value)
3002 (with-selected-window window 3003 (with-selected-window window
3003 (unwind-protect 3004 (unwind-protect
@@ -4268,7 +4269,7 @@ instead.
4268;;;*** 4269;;;***
4269 4270
4270;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump) 4271;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump)
4271;;;;;; "dired-x" "dired-x.el" "d2461aa6efb8c1d7de8f245728ab448e") 4272;;;;;; "dired-x" "dired-x.el" "a4e6844421c2c5e6fde90e959fbcc26f")
4272;;; Generated autoloads from dired-x.el 4273;;; Generated autoloads from dired-x.el
4273 4274
4274(autoload 'dired-jump "dired-x" "\ 4275(autoload 'dired-jump "dired-x" "\
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 158d447a1d4..f8975a57b7b 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -255,20 +255,23 @@ of the page moves to the previous page."
255;;;; Internal Variables 255;;;; Internal Variables
256 256
257(defun doc-view-new-window-function (winprops) 257(defun doc-view-new-window-function (winprops)
258 ;; (message "New window %s for buf %s" (car winprops) (current-buffer))
259 (cl-assert (or (eq t (car winprops))
260 (eq (window-buffer (car winprops)) (current-buffer))))
258 (let ((ol (image-mode-window-get 'overlay winprops))) 261 (let ((ol (image-mode-window-get 'overlay winprops)))
259 (when (and ol (not (overlay-buffer ol)))
260 ;; I've seen `ol' be a dead overlay. I do not yet know how this
261 ;; happened, so maybe the bug is elsewhere, but in the mean time,
262 ;; this seems like a safe approach.
263 (setq ol nil))
264 (if ol 262 (if ol
265 (progn 263 (progn
266 (cl-assert (eq (overlay-buffer ol) (current-buffer))) 264 (setq ol (copy-overlay ol))
267 (setq ol (copy-overlay ol))) 265 ;; `ol' might actually be dead.
268 (cl-assert (not (get-char-property (point-min) 'display))) 266 (move-overlay ol (point-min) (point-max)))
269 (setq ol (make-overlay (point-min) (point-max) nil t)) 267 (setq ol (make-overlay (point-min) (point-max) nil t))
270 (overlay-put ol 'doc-view t)) 268 (overlay-put ol 'doc-view t))
271 (overlay-put ol 'window (car winprops)) 269 (overlay-put ol 'window (car winprops))
270 (unless (windowp (car winprops))
271 ;; It's a pseudo entry. Let's make sure it's not displayed (the
272 ;; `window' property is only effective if its value is a window).
273 (cl-assert (eq t (car winprops)))
274 (delete-overlay ol))
272 (image-mode-window-put 'overlay ol winprops))) 275 (image-mode-window-put 'overlay ol winprops)))
273 276
274(defvar doc-view-current-files nil 277(defvar doc-view-current-files nil
@@ -560,7 +563,8 @@ at the top edge of the page moves to the previous page."
560 "Kill the current converter process(es)." 563 "Kill the current converter process(es)."
561 (interactive) 564 (interactive)
562 (while (consp doc-view-current-converter-processes) 565 (while (consp doc-view-current-converter-processes)
563 (ignore-errors ;; Maybe it's dead already? 566 (ignore-errors ;; Some entries might not be processes, and maybe
567 ;; some are dead already?
564 (kill-process (pop doc-view-current-converter-processes)))) 568 (kill-process (pop doc-view-current-converter-processes))))
565 (when doc-view-current-timer 569 (when doc-view-current-timer
566 (cancel-timer doc-view-current-timer) 570 (cancel-timer doc-view-current-timer)
@@ -663,19 +667,21 @@ OpenDocument format)."
663(defvar doc-view-shrink-factor 1.125) 667(defvar doc-view-shrink-factor 1.125)
664 668
665(defun doc-view-enlarge (factor) 669(defun doc-view-enlarge (factor)
666 "Enlarge the document." 670 "Enlarge the document by FACTOR."
667 (interactive (list doc-view-shrink-factor)) 671 (interactive (list doc-view-shrink-factor))
668 (if (eq (plist-get (cdr (doc-view-current-image)) :type) 672 (if (eq (plist-get (cdr (doc-view-current-image)) :type)
669 'imagemagick) 673 'imagemagick)
670 ;; ImageMagick supports on-the-fly-rescaling 674 ;; ImageMagick supports on-the-fly-rescaling.
671 (progn 675 (let ((new (ceiling (* factor doc-view-image-width))))
672 (set (make-local-variable 'doc-view-image-width) 676 (unless (equal new doc-view-image-width)
673 (ceiling (* factor doc-view-image-width))) 677 (set (make-local-variable 'doc-view-image-width) new)
674 (doc-view-insert-image (plist-get (cdr (doc-view-current-image)) :file) 678 (doc-view-insert-image
675 :width doc-view-image-width)) 679 (plist-get (cdr (doc-view-current-image)) :file)
676 (set (make-local-variable 'doc-view-resolution) 680 :width doc-view-image-width)))
677 (ceiling (* factor doc-view-resolution))) 681 (let ((new (ceiling (* factor doc-view-resolution))))
678 (doc-view-reconvert-doc))) 682 (unless (equal new doc-view-resolution)
683 (set (make-local-variable 'doc-view-resolution) new)
684 (doc-view-reconvert-doc)))))
679 685
680(defun doc-view-shrink (factor) 686(defun doc-view-shrink (factor)
681 "Shrink the document." 687 "Shrink the document."
@@ -743,12 +749,14 @@ min {(window-width / image-width), (window-height / image-height)} times."
743 (img-height (cdr (image-display-size 749 (img-height (cdr (image-display-size
744 (image-get-display-property) t)))) 750 (image-get-display-property) t))))
745 (doc-view-enlarge (min (/ (float win-width) (float img-width)) 751 (doc-view-enlarge (min (/ (float win-width) (float img-width))
746 (/ (float (- win-height 1)) (float img-height))))) 752 (/ (float (- win-height 1))
753 (float img-height)))))
747 ;; If slice is set 754 ;; If slice is set
748 (let* ((slice-width (nth 2 slice)) 755 (let* ((slice-width (nth 2 slice))
749 (slice-height (nth 3 slice)) 756 (slice-height (nth 3 slice))
750 (scale-factor (min (/ (float win-width) (float slice-width)) 757 (scale-factor (min (/ (float win-width) (float slice-width))
751 (/ (float (- win-height 1)) (float slice-height)))) 758 (/ (float (- win-height 1))
759 (float slice-height))))
752 (new-slice (mapcar (lambda (x) (ceiling (* scale-factor x))) slice))) 760 (new-slice (mapcar (lambda (x) (ceiling (* scale-factor x))) slice)))
753 (doc-view-enlarge scale-factor) 761 (doc-view-enlarge scale-factor)
754 (setf (doc-view-current-slice) new-slice) 762 (setf (doc-view-current-slice) new-slice)
@@ -762,6 +770,7 @@ Should be invoked when the cached images aren't up-to-date."
762 ;; Clear the old cached files 770 ;; Clear the old cached files
763 (when (file-exists-p (doc-view-current-cache-dir)) 771 (when (file-exists-p (doc-view-current-cache-dir))
764 (delete-directory (doc-view-current-cache-dir) 'recursive)) 772 (delete-directory (doc-view-current-cache-dir) 'recursive))
773 (kill-local-variable 'doc-view-last-page-number)
765 (doc-view-initiate-display)) 774 (doc-view-initiate-display))
766 775
767(defun doc-view-sentinel (proc event) 776(defun doc-view-sentinel (proc event)
@@ -895,6 +904,11 @@ Start by converting PAGES, and then the rest."
895 (list "-raw" pdf txt) 904 (list "-raw" pdf txt)
896 callback)) 905 callback))
897 906
907(defun doc-view-current-cache-doc-pdf ()
908 "Return the name of the doc.pdf in the current cache dir.
909 This file exists only if the current document isn't a PDF or PS file already."
910 (expand-file-name "doc.pdf" (doc-view-current-cache-dir)))
911
898(defun doc-view-doc->txt (txt callback) 912(defun doc-view-doc->txt (txt callback)
899 "Convert the current document to text and call CALLBACK when done." 913 "Convert the current document to text and call CALLBACK when done."
900 (make-directory (doc-view-current-cache-dir) t) 914 (make-directory (doc-view-current-cache-dir) t)
@@ -905,22 +919,17 @@ Start by converting PAGES, and then the rest."
905 (`ps 919 (`ps
906 ;; Doc is a PS, so convert it to PDF (which will be converted to 920 ;; Doc is a PS, so convert it to PDF (which will be converted to
907 ;; TXT thereafter). 921 ;; TXT thereafter).
908 (let ((pdf (expand-file-name "doc.pdf" 922 (let ((pdf (doc-view-current-cache-doc-pdf)))
909 (doc-view-current-cache-dir))))
910 (doc-view-ps->pdf doc-view-buffer-file-name pdf 923 (doc-view-ps->pdf doc-view-buffer-file-name pdf
911 (lambda () (doc-view-pdf->txt pdf txt callback))))) 924 (lambda () (doc-view-pdf->txt pdf txt callback)))))
912 (`dvi 925 (`dvi
913 ;; Doc is a DVI. This means that a doc.pdf already exists in its 926 ;; Doc is a DVI. This means that a doc.pdf already exists in its
914 ;; cache subdirectory. 927 ;; cache subdirectory.
915 (doc-view-pdf->txt (expand-file-name "doc.pdf" 928 (doc-view-pdf->txt (doc-view-current-cache-doc-pdf) txt callback))
916 (doc-view-current-cache-dir))
917 txt callback))
918 (`odf 929 (`odf
919 ;; Doc is some ODF (or MS Office) doc. This means that a doc.pdf 930 ;; Doc is some ODF (or MS Office) doc. This means that a doc.pdf
920 ;; already exists in its cache subdirectory. 931 ;; already exists in its cache subdirectory.
921 (doc-view-pdf->txt (expand-file-name "doc.pdf" 932 (doc-view-pdf->txt (doc-view-current-cache-doc-pdf) txt callback))
922 (doc-view-current-cache-dir))
923 txt callback))
924 (_ (error "DocView doesn't know what to do")))) 933 (_ (error "DocView doesn't know what to do"))))
925 934
926(defun doc-view-ps->pdf (ps pdf callback) 935(defun doc-view-ps->pdf (ps pdf callback)
@@ -960,13 +969,13 @@ Those files are saved in the directory given by the function
960 (`dvi 969 (`dvi
961 ;; DVI files have to be converted to PDF before Ghostscript can process 970 ;; DVI files have to be converted to PDF before Ghostscript can process
962 ;; it. 971 ;; it.
963 (let ((pdf (expand-file-name "doc.pdf" doc-view-current-cache-dir))) 972 (let ((pdf (doc-view-current-cache-doc-pdf)))
964 (doc-view-dvi->pdf doc-view-buffer-file-name pdf 973 (doc-view-dvi->pdf doc-view-buffer-file-name pdf
965 (lambda () (doc-view-pdf/ps->png pdf png-file))))) 974 (lambda () (doc-view-pdf/ps->png pdf png-file)))))
966 (`odf 975 (`odf
967 ;; ODF files have to be converted to PDF before Ghostscript can 976 ;; ODF files have to be converted to PDF before Ghostscript can
968 ;; process it. 977 ;; process it.
969 (let ((pdf (expand-file-name "doc.pdf" doc-view-current-cache-dir)) 978 (let ((pdf (doc-view-current-cache-doc-pdf))
970 (opdf (expand-file-name (concat (file-name-base doc-view-buffer-file-name) 979 (opdf (expand-file-name (concat (file-name-base doc-view-buffer-file-name)
971 ".pdf") 980 ".pdf")
972 doc-view-current-cache-dir)) 981 doc-view-current-cache-dir))
@@ -1033,12 +1042,15 @@ dragging it to its bottom-right corner. See also
1033(defun doc-view-get-bounding-box () 1042(defun doc-view-get-bounding-box ()
1034 "Get the BoundingBox information of the current page." 1043 "Get the BoundingBox information of the current page."
1035 (let* ((page (doc-view-current-page)) 1044 (let* ((page (doc-view-current-page))
1045 (doc (let ((cache-doc (doc-view-current-cache-doc-pdf)))
1046 (if (file-exists-p cache-doc)
1047 cache-doc
1048 doc-view-buffer-file-name)))
1036 (o (shell-command-to-string 1049 (o (shell-command-to-string
1037 (concat doc-view-ghostscript-program 1050 (concat doc-view-ghostscript-program
1038 " -dSAFER -dBATCH -dNOPAUSE -q -sDEVICE=bbox " 1051 " -dSAFER -dBATCH -dNOPAUSE -q -sDEVICE=bbox "
1039 (format "-dFirstPage=%s -dLastPage=%s %s" 1052 (format "-dFirstPage=%s -dLastPage=%s %s"
1040 page page 1053 page page doc)))))
1041 doc-view-buffer-file-name)))))
1042 (save-match-data 1054 (save-match-data
1043 (when (string-match (concat "%%BoundingBox: " 1055 (when (string-match (concat "%%BoundingBox: "
1044 "\\([[:digit:]]+\\) \\([[:digit:]]+\\) " 1056 "\\([[:digit:]]+\\) \\([[:digit:]]+\\) "
@@ -1169,24 +1181,23 @@ Predicate for sorting `doc-view-current-files'."
1169If FORCE is non-nil, start viewing even if the document does not 1181If FORCE is non-nil, start viewing even if the document does not
1170have the page we want to view." 1182have the page we want to view."
1171 (with-current-buffer buffer 1183 (with-current-buffer buffer
1172 (let ((prev-pages doc-view-current-files) 1184 (let ((prev-pages doc-view-current-files))
1173 (windows (get-buffer-window-list buffer nil t)))
1174 (setq doc-view-current-files 1185 (setq doc-view-current-files
1175 (sort (directory-files (doc-view-current-cache-dir) t 1186 (sort (directory-files (doc-view-current-cache-dir) t
1176 "page-[0-9]+\\.png" t) 1187 "page-[0-9]+\\.png" t)
1177 'doc-view-sort)) 1188 'doc-view-sort))
1178 (unless windows 1189 (dolist (win (or (get-buffer-window-list buffer nil t)
1179 (switch-to-buffer buffer) 1190 (list t)))
1180 (setq windows (get-buffer-window-list buffer nil t)))
1181 (dolist (win windows)
1182 (let* ((page (doc-view-current-page win)) 1191 (let* ((page (doc-view-current-page win))
1183 (pagefile (expand-file-name (format "page-%d.png" page) 1192 (pagefile (expand-file-name (format "page-%d.png" page)
1184 (doc-view-current-cache-dir)))) 1193 (doc-view-current-cache-dir))))
1185 (when (or force 1194 (when (or force
1186 (and (not (member pagefile prev-pages)) 1195 (and (not (member pagefile prev-pages))
1187 (member pagefile doc-view-current-files))) 1196 (member pagefile doc-view-current-files)))
1188 (with-selected-window win 1197 (if (windowp win)
1189 (cl-assert (eq (current-buffer) buffer) t) 1198 (with-selected-window win
1199 (cl-assert (eq (current-buffer) buffer) t)
1200 (doc-view-goto-page page))
1190 (doc-view-goto-page page)))))))) 1201 (doc-view-goto-page page))))))))
1191 1202
1192(defun doc-view-buffer-message () 1203(defun doc-view-buffer-message ()
@@ -1231,6 +1242,10 @@ For now these keys are useful:
1231 1242
1232;;;;; Toggle between editing and viewing 1243;;;;; Toggle between editing and viewing
1233 1244
1245(defvar-local doc-view-saved-settings nil
1246 "Doc-view settings saved while in some other mode.")
1247(put 'doc-view-saved-settings 'permanent-local t)
1248
1234(defun doc-view-toggle-display () 1249(defun doc-view-toggle-display ()
1235 "Toggle between editing a document as text or viewing it." 1250 "Toggle between editing a document as text or viewing it."
1236 (interactive) 1251 (interactive)
@@ -1483,13 +1498,16 @@ toggle between displaying the document or editing it as text.
1483 ;; returns nil for tar members. 1498 ;; returns nil for tar members.
1484 (doc-view-fallback-mode) 1499 (doc-view-fallback-mode)
1485 1500
1486 (let* ((prev-major-mode (if (eq major-mode 'doc-view-mode) 1501 (let* ((prev-major-mode (if (derived-mode-p 'doc-view-mode)
1487 doc-view-previous-major-mode 1502 doc-view-previous-major-mode
1488 (when (not (memq major-mode 1503 (unless (eq major-mode 'fundamental-mode)
1489 '(doc-view-mode fundamental-mode)))
1490 major-mode)))) 1504 major-mode))))
1491 (kill-all-local-variables) 1505 (kill-all-local-variables)
1492 (set (make-local-variable 'doc-view-previous-major-mode) prev-major-mode)) 1506 (set (make-local-variable 'doc-view-previous-major-mode)
1507 prev-major-mode))
1508
1509 (dolist (var doc-view-saved-settings)
1510 (set (make-local-variable (car var)) (cdr var)))
1493 1511
1494 ;; Figure out the document type. 1512 ;; Figure out the document type.
1495 (unless doc-view-doc-type 1513 (unless doc-view-doc-type
@@ -1563,13 +1581,20 @@ toggle between displaying the document or editing it as text.
1563 1581
1564(defun doc-view-fallback-mode () 1582(defun doc-view-fallback-mode ()
1565 "Fallback to the previous or next best major mode." 1583 "Fallback to the previous or next best major mode."
1566 (if doc-view-previous-major-mode 1584 (let ((vars (if (derived-mode-p 'doc-view-mode)
1567 (funcall doc-view-previous-major-mode) 1585 (mapcar (lambda (var) (cons var (symbol-value var)))
1568 (let ((auto-mode-alist (rassq-delete-all 1586 '(doc-view-resolution
1569 'doc-view-mode-maybe 1587 image-mode-winprops-alist)))))
1570 (rassq-delete-all 'doc-view-mode 1588 (if doc-view-previous-major-mode
1571 (copy-alist auto-mode-alist))))) 1589 (funcall doc-view-previous-major-mode)
1572 (normal-mode)))) 1590 (let ((auto-mode-alist
1591 (rassq-delete-all
1592 'doc-view-mode-maybe
1593 (rassq-delete-all 'doc-view-mode
1594 (copy-alist auto-mode-alist)))))
1595 (normal-mode)))
1596 (when vars
1597 (setq-local doc-view-saved-settings vars))))
1573 1598
1574;;;###autoload 1599;;;###autoload
1575(defun doc-view-mode-maybe () 1600(defun doc-view-mode-maybe ()
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 93e890a20c9..d740574f1e4 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -253,7 +253,9 @@ convention was modified."
253 advertised-signature-table)) 253 advertised-signature-table))
254 254
255(defun make-obsolete (obsolete-name current-name &optional when) 255(defun make-obsolete (obsolete-name current-name &optional when)
256 "Make the byte-compiler warn that OBSOLETE-NAME is obsolete. 256 "Make the byte-compiler warn that function OBSOLETE-NAME is obsolete.
257OBSOLETE-NAME should be a function name or macro name (a symbol).
258
257The warning will say that CURRENT-NAME should be used instead. 259The warning will say that CURRENT-NAME should be used instead.
258If CURRENT-NAME is a string, that is the `use instead' message 260If CURRENT-NAME is a string, that is the `use instead' message
259\(it should end with a period, and not start with a capital). 261\(it should end with a period, and not start with a capital).
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 7a229750178..d49e56bd2ba 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -846,7 +846,7 @@ CONST2 may be evaluated multiple times."
846(defun byte-compile-cl-file-p (file) 846(defun byte-compile-cl-file-p (file)
847 "Return non-nil if FILE is one of the CL files." 847 "Return non-nil if FILE is one of the CL files."
848 (and (stringp file) 848 (and (stringp file)
849 (string-match "^cl\\>" (file-name-nondirectory file)))) 849 (string-match "^cl\\.el" (file-name-nondirectory file))))
850 850
851(defun byte-compile-eval (form) 851(defun byte-compile-eval (form)
852 "Eval FORM and mark the functions defined therein. 852 "Eval FORM and mark the functions defined therein.
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index ea5e1cf9beb..913ebf2015f 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -689,7 +689,6 @@ PROPLIST is a list of the sort returned by `symbol-plist'.
689 689
690;; Local variables: 690;; Local variables:
691;; byte-compile-dynamic: t 691;; byte-compile-dynamic: t
692;; byte-compile-warnings: (not cl-functions)
693;; generated-autoload-file: "cl-loaddefs.el" 692;; generated-autoload-file: "cl-loaddefs.el"
694;; End: 693;; End:
695 694
diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el
index 5749ff91b40..2eda628e262 100644
--- a/lisp/emacs-lisp/cl-lib.el
+++ b/lisp/emacs-lisp/cl-lib.el
@@ -745,7 +745,6 @@ If ALIST is non-nil, the new pairs are prepended to it."
745 745
746;; Local variables: 746;; Local variables:
747;; byte-compile-dynamic: t 747;; byte-compile-dynamic: t
748;; byte-compile-warnings: (not cl-functions)
749;; End: 748;; End:
750 749
751;;; cl-lib.el ends here 750;;; cl-lib.el ends here
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index c12e8ccacb1..922c9856208 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -11,7 +11,7 @@
11;;;;;; cl--map-overlays cl--map-intervals cl--map-keymap-recursively 11;;;;;; cl--map-overlays cl--map-intervals cl--map-keymap-recursively
12;;;;;; cl-notevery cl-notany cl-every cl-some cl-mapcon cl-mapcan 12;;;;;; cl-notevery cl-notany cl-every cl-some cl-mapcon cl-mapcan
13;;;;;; cl-mapl cl-maplist cl-map cl--mapcar-many cl-equalp cl-coerce) 13;;;;;; cl-mapl cl-maplist cl-map cl--mapcar-many cl-equalp cl-coerce)
14;;;;;; "cl-extra" "cl-extra.el" "535a24c1cff55a16e3d51219498a7858") 14;;;;;; "cl-extra" "cl-extra.el" "1572ae52fa4fbd9c4bf89b49a068a865")
15;;; Generated autoloads from cl-extra.el 15;;; Generated autoloads from cl-extra.el
16 16
17(autoload 'cl-coerce "cl-extra" "\ 17(autoload 'cl-coerce "cl-extra" "\
@@ -260,7 +260,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value.
260;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when 260;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when
261;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp 261;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp
262;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) 262;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*)
263;;;;;; "cl-macs" "cl-macs.el" "6d0676869af66e5b5a671f95ee069461") 263;;;;;; "cl-macs" "cl-macs.el" "da92f58f688ff6fb4d0098eb0f3acf0b")
264;;; Generated autoloads from cl-macs.el 264;;; Generated autoloads from cl-macs.el
265 265
266(autoload 'cl--compiler-macro-list* "cl-macs" "\ 266(autoload 'cl--compiler-macro-list* "cl-macs" "\
@@ -748,7 +748,7 @@ surrounded by (cl-block NAME ...).
748;;;;;; cl-nsubstitute-if cl-nsubstitute cl-substitute-if-not cl-substitute-if 748;;;;;; cl-nsubstitute-if cl-nsubstitute cl-substitute-if-not cl-substitute-if
749;;;;;; cl-substitute cl-delete-duplicates cl-remove-duplicates cl-delete-if-not 749;;;;;; cl-substitute cl-delete-duplicates cl-remove-duplicates cl-delete-if-not
750;;;;;; cl-delete-if cl-delete cl-remove-if-not cl-remove-if cl-remove 750;;;;;; cl-delete-if cl-delete cl-remove-if-not cl-remove-if cl-remove
751;;;;;; cl-replace cl-fill cl-reduce) "cl-seq" "cl-seq.el" "b444601641dcbd14a23ca5182bc80ffa") 751;;;;;; cl-replace cl-fill cl-reduce) "cl-seq" "cl-seq.el" "4c1e1191e82dc8d5449a5ec4d59efc10")
752;;; Generated autoloads from cl-seq.el 752;;; Generated autoloads from cl-seq.el
753 753
754(autoload 'cl-reduce "cl-seq" "\ 754(autoload 'cl-reduce "cl-seq" "\
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 16ac14f8fe9..56e698bec0a 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2686,7 +2686,6 @@ surrounded by (cl-block NAME ...).
2686 2686
2687;; Local variables: 2687;; Local variables:
2688;; byte-compile-dynamic: t 2688;; byte-compile-dynamic: t
2689;; byte-compile-warnings: (not cl-functions)
2690;; generated-autoload-file: "cl-loaddefs.el" 2689;; generated-autoload-file: "cl-loaddefs.el"
2691;; End: 2690;; End:
2692 2691
diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el
index b55f1df5ba5..1fa562e328a 100644
--- a/lisp/emacs-lisp/cl-seq.el
+++ b/lisp/emacs-lisp/cl-seq.el
@@ -1010,7 +1010,6 @@ Atoms are compared by `eql'; cons cells are compared recursively.
1010 1010
1011;; Local variables: 1011;; Local variables:
1012;; byte-compile-dynamic: t 1012;; byte-compile-dynamic: t
1013;; byte-compile-warnings: (not cl-functions)
1014;; generated-autoload-file: "cl-loaddefs.el" 1013;; generated-autoload-file: "cl-loaddefs.el"
1015;; End: 1014;; End:
1016 1015
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el
index ae0852d6c87..34beed0d9ef 100644
--- a/lisp/emacs-lisp/cl.el
+++ b/lisp/emacs-lisp/cl.el
@@ -452,7 +452,7 @@ definitions, or lack thereof).
452 452
453\(fn ((FUNC ARGLIST BODY...) ...) FORM...)" 453\(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
454 (declare (indent 1) (debug cl-flet) 454 (declare (indent 1) (debug cl-flet)
455 (obsolete "Use either `cl-flet' or `cl-letf'." "24.3")) 455 (obsolete "use either `cl-flet' or `cl-letf'." "24.3"))
456 `(letf ,(mapcar 456 `(letf ,(mapcar
457 (lambda (x) 457 (lambda (x)
458 (if (or (and (fboundp (car x)) 458 (if (or (and (fboundp (car x))
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index ea72e9492f0..8c8d37b2194 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -276,10 +276,10 @@ A mode's class is the first ancestor which is NOT a derived mode.
276Use the `derived-mode-parent' property of the symbol to trace backwards. 276Use the `derived-mode-parent' property of the symbol to trace backwards.
277Since major-modes might all derive from `fundamental-mode', this function 277Since major-modes might all derive from `fundamental-mode', this function
278is not very useful." 278is not very useful."
279 (declare (obsolete derived-mode-p "22.1"))
279 (while (get mode 'derived-mode-parent) 280 (while (get mode 'derived-mode-parent)
280 (setq mode (get mode 'derived-mode-parent))) 281 (setq mode (get mode 'derived-mode-parent)))
281 mode) 282 mode)
282(make-obsolete 'derived-mode-class 'derived-mode-p "22.1")
283 283
284 284
285;;; PRIVATE 285;;; PRIVATE
diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el
index a7916354c91..c3b8e5e10d4 100644
--- a/lisp/emacs-lisp/ert-x.el
+++ b/lisp/emacs-lisp/ert-x.el
@@ -7,18 +7,18 @@
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
10;; This program is free software: you can redistribute it and/or 10;; GNU Emacs is free software: you can redistribute it and/or modify
11;; modify it under the terms of the GNU General Public License as 11;; it under the terms of the GNU General Public License as published by
12;; published by the Free Software Foundation, either version 3 of the 12;; the Free Software Foundation, either version 3 of the License, or
13;; License, or (at your option) any later version. 13;; (at your option) any later version.
14;; 14
15;; This program is distributed in the hope that it will be useful, but 15;; GNU Emacs is distributed in the hope that it will be useful,
16;; WITHOUT ANY WARRANTY; without even the implied warranty of 16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; General Public License for more details. 18;; GNU General Public License for more details.
19;; 19
20;; You should have received a copy of the GNU General Public License 20;; You should have received a copy of the GNU General Public License
21;; along with this program. If not, see `http://www.gnu.org/licenses/'. 21;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 22
23;;; Commentary: 23;;; Commentary:
24 24
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index ad5e20cb8a4..ff00be7a237 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -7,18 +7,18 @@
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
10;; This program is free software: you can redistribute it and/or 10;; GNU Emacs is free software: you can redistribute it and/or modify
11;; modify it under the terms of the GNU General Public License as 11;; it under the terms of the GNU General Public License as published by
12;; published by the Free Software Foundation, either version 3 of the 12;; the Free Software Foundation, either version 3 of the License, or
13;; License, or (at your option) any later version. 13;; (at your option) any later version.
14;; 14
15;; This program is distributed in the hope that it will be useful, but 15;; GNU Emacs is distributed in the hope that it will be useful,
16;; WITHOUT ANY WARRANTY; without even the implied warranty of 16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; General Public License for more details. 18;; GNU General Public License for more details.
19;; 19
20;; You should have received a copy of the GNU General Public License 20;; You should have received a copy of the GNU General Public License
21;; along with this program. If not, see `http://www.gnu.org/licenses/'. 21;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 22
23;;; Commentary: 23;;; Commentary:
24 24
diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el
index 4caa0a73866..7858c183e4b 100644
--- a/lisp/emacs-lisp/gv.el
+++ b/lisp/emacs-lisp/gv.el
@@ -1,22 +1,25 @@
1;;; gv.el --- Generalized variables -*- lexical-binding: t -*- 1;;; gv.el --- generalized variables -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 2012 Free Software Foundation, Inc. 3;; Copyright (C) 2012 Free Software Foundation, Inc.
4 4
5;; Author: Stefan Monnier <monnier@iro.umontreal.ca> 5;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
6;; Keywords: extensions 6;; Keywords: extensions
7;; Package: emacs
7 8
8;; This program is free software; you can redistribute it and/or modify 9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software: you can redistribute it and/or modify
9;; it under the terms of the GNU General Public License as published by 12;; it under the terms of the GNU General Public License as published by
10;; the Free Software Foundation, either version 3 of the License, or 13;; the Free Software Foundation, either version 3 of the License, or
11;; (at your option) any later version. 14;; (at your option) any later version.
12 15
13;; This program is distributed in the hope that it will be useful, 16;; GNU Emacs is distributed in the hope that it will be useful,
14;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;; GNU General Public License for more details. 19;; GNU General Public License for more details.
17 20
18;; You should have received a copy of the GNU General Public License 21;; You should have received a copy of the GNU General Public License
19;; along with this program. If not, see <http://www.gnu.org/licenses/>. 22;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
20 23
21;;; Commentary: 24;;; Commentary:
22 25
@@ -266,7 +269,7 @@ The return value is the last VAL in the list.
266;;;###autoload 269;;;###autoload
267(put 'gv-place 'edebug-form-spec 'edebug-match-form) 270(put 'gv-place 'edebug-form-spec 'edebug-match-form)
268;; CL did the equivalent of: 271;; CL did the equivalent of:
269;;(gv-define-expand edebug-after (lambda (before index place) place)) 272;;(gv-define-macroexpand edebug-after (lambda (before index place) place))
270 273
271(put 'edebug-after 'gv-expander 274(put 'edebug-after 'gv-expander
272 (lambda (do before index place) 275 (lambda (do before index place)
diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el
index 761d27a2e28..0b6fd277ae2 100644
--- a/lisp/emacs-lisp/package-x.el
+++ b/lisp/emacs-lisp/package-x.el
@@ -10,10 +10,10 @@
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
12 12
13;; GNU Emacs is free software; you can redistribute it and/or modify 13;; GNU Emacs is free software: you can redistribute it and/or modify
14;; it under the terms of the GNU General Public License as published by 14;; it under the terms of the GNU General Public License as published by
15;; the Free Software Foundation; either version 3, or (at your option) 15;; the Free Software Foundation, either version 3 of the License, or
16;; any later version. 16;; (at your option) any later version.
17 17
18;; GNU Emacs is distributed in the hope that it will be useful, 18;; GNU Emacs is distributed in the hope that it will be useful,
19;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,9 +21,7 @@
21;; GNU General Public License for more details. 21;; GNU General Public License for more details.
22 22
23;; You should have received a copy of the GNU General Public License 23;; You should have received a copy of the GNU General Public License
24;; along with GNU Emacs; see the file COPYING. If not, write to the 24;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
26;; Boston, MA 02110-1301, USA.
27 25
28;;; Commentary: 26;;; Commentary:
29 27
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index b01cdbc7b8e..28d166271fb 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -9,10 +9,10 @@
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
12;; GNU Emacs is free software; you can redistribute it and/or modify 12;; GNU Emacs is free software: you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by 13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation; either version 3, or (at your option) 14;; the Free Software Foundation, either version 3 of the License, or
15;; any later version. 15;; (at your option) any later version.
16 16
17;; GNU Emacs is distributed in the hope that it will be useful, 17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of 18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,9 +20,7 @@
20;; GNU General Public License for more details. 20;; GNU General Public License for more details.
21 21
22;; You should have received a copy of the GNU General Public License 22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs; see the file COPYING. If not, write to the 23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25;; Boston, MA 02110-1301, USA.
26 24
27;;; Change Log: 25;;; Change Log:
28 26
diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 09e47b69b91..1312fc3731d 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -517,6 +517,10 @@ MATCH is the pattern that needs to be matched, of the form:
517(defun pcase--self-quoting-p (upat) 517(defun pcase--self-quoting-p (upat)
518 (or (keywordp upat) (numberp upat) (stringp upat))) 518 (or (keywordp upat) (numberp upat) (stringp upat)))
519 519
520(defsubst pcase--mark-used (sym)
521 ;; Exceptionally, `sym' may be a constant expression rather than a symbol.
522 (if (symbolp sym) (put sym 'pcase-used t)))
523
520;; It's very tempting to use `pcase' below, tho obviously, it'd create 524;; It's very tempting to use `pcase' below, tho obviously, it'd create
521;; bootstrapping problems. 525;; bootstrapping problems.
522(defun pcase--u1 (matches code vars rest) 526(defun pcase--u1 (matches code vars rest)
@@ -581,7 +585,7 @@ Otherwise, it defers to REST which is a list of branches of the form
581 ((memq upat '(t _)) (pcase--u1 matches code vars rest)) 585 ((memq upat '(t _)) (pcase--u1 matches code vars rest))
582 ((eq upat 'pcase--dontcare) :pcase--dontcare) 586 ((eq upat 'pcase--dontcare) :pcase--dontcare)
583 ((memq (car-safe upat) '(guard pred)) 587 ((memq (car-safe upat) '(guard pred))
584 (if (eq (car upat) 'pred) (put sym 'pcase-used t)) 588 (if (eq (car upat) 'pred) (pcase--mark-used sym))
585 (let* ((splitrest 589 (let* ((splitrest
586 (pcase--split-rest 590 (pcase--split-rest
587 sym (lambda (pat) (pcase--split-pred upat pat)) rest)) 591 sym (lambda (pat) (pcase--split-pred upat pat)) rest))
@@ -614,10 +618,10 @@ Otherwise, it defers to REST which is a list of branches of the form
614 (pcase--u1 matches code vars then-rest) 618 (pcase--u1 matches code vars then-rest)
615 (pcase--u else-rest)))) 619 (pcase--u else-rest))))
616 ((pcase--self-quoting-p upat) 620 ((pcase--self-quoting-p upat)
617 (put sym 'pcase-used t) 621 (pcase--mark-used sym)
618 (pcase--q1 sym upat matches code vars rest)) 622 (pcase--q1 sym upat matches code vars rest))
619 ((symbolp upat) 623 ((symbolp upat)
620 (put sym 'pcase-used t) 624 (pcase--mark-used sym)
621 (if (not (assq upat vars)) 625 (if (not (assq upat vars))
622 (pcase--u1 matches code (cons (cons upat sym) vars) rest) 626 (pcase--u1 matches code (cons (cons upat sym) vars) rest)
623 ;; Non-linear pattern. Turn it into an `eq' test. 627 ;; Non-linear pattern. Turn it into an `eq' test.
@@ -640,7 +644,7 @@ Otherwise, it defers to REST which is a list of branches of the form
640 (pcase--u1 (cons `(match ,sym . ,(nth 1 upat)) matches) 644 (pcase--u1 (cons `(match ,sym . ,(nth 1 upat)) matches)
641 code vars rest))) 645 code vars rest)))
642 ((eq (car-safe upat) '\`) 646 ((eq (car-safe upat) '\`)
643 (put sym 'pcase-used t) 647 (pcase--mark-used sym)
644 (pcase--q1 sym (cadr upat) matches code vars rest)) 648 (pcase--q1 sym (cadr upat) matches code vars rest))
645 ((eq (car-safe upat) 'or) 649 ((eq (car-safe upat) 'or)
646 (let ((all (> (length (cdr upat)) 1)) 650 (let ((all (> (length (cdr upat)) 1))
@@ -662,7 +666,7 @@ Otherwise, it defers to REST which is a list of branches of the form
662 sym (lambda (pat) (pcase--split-member elems pat)) rest)) 666 sym (lambda (pat) (pcase--split-member elems pat)) rest))
663 (then-rest (car splitrest)) 667 (then-rest (car splitrest))
664 (else-rest (cdr splitrest))) 668 (else-rest (cdr splitrest)))
665 (put sym 'pcase-used t) 669 (pcase--mark-used sym)
666 (pcase--if `(,(if memq-fine #'memq #'member) ,sym ',elems) 670 (pcase--if `(,(if memq-fine #'memq #'member) ,sym ',elems)
667 (pcase--u1 matches code vars then-rest) 671 (pcase--u1 matches code vars then-rest)
668 (pcase--u else-rest))) 672 (pcase--u else-rest)))
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index a56a7619ea9..8aa722521eb 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -7,10 +7,10 @@
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
10;; GNU Emacs is free software; you can redistribute it and/or modify 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 11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation; either version 3, or (at your option) 12;; the Free Software Foundation, either version 3 of the License, or
13;; any later version. 13;; (at your option) any later version.
14 14
15;; GNU Emacs is distributed in the hope that it will be useful, 15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of 16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el
index 3999529f7ac..5fdc8c55a85 100644
--- a/lisp/emacs-lisp/testcover.el
+++ b/lisp/emacs-lisp/testcover.el
@@ -270,9 +270,9 @@ value, 'maybe if either is acceptable."
270 (setq id (nth 2 form)) 270 (setq id (nth 2 form))
271 (setcdr form (nthcdr 2 form)) 271 (setcdr form (nthcdr 2 form))
272 (setq val (testcover-reinstrument (nth 2 form))) 272 (setq val (testcover-reinstrument (nth 2 form)))
273 (if (eq val t) 273 (setcar form (if (eq val t)
274 (setcar form 'testcover-1value) 274 'testcover-1value
275 (setcar form 'testcover-after)) 275 'testcover-after))
276 (when val 276 (when val
277 ;;1-valued or potentially 1-valued 277 ;;1-valued or potentially 1-valued
278 (aset testcover-vector id '1value)) 278 (aset testcover-vector id '1value))
@@ -359,9 +359,9 @@ value, 'maybe if either is acceptable."
359 ,(nth 3 (cadr form)))) 359 ,(nth 3 (cadr form))))
360 t) 360 t)
361 (t 361 (t
362 (if (eq (car (cadr form)) 'edebug-after) 362 (setq id (car (if (eq (car (cadr form)) 'edebug-after)
363 (setq id (car (nth 3 (cadr form)))) 363 (nth 3 (cadr form))
364 (setq id (car (cadr form)))) 364 (cadr form))))
365 (let ((testcover-1value-functions 365 (let ((testcover-1value-functions
366 (cons id testcover-1value-functions))) 366 (cons id testcover-1value-functions)))
367 (testcover-reinstrument (cadr form)))))) 367 (testcover-reinstrument (cadr form))))))
@@ -379,9 +379,9 @@ value, 'maybe if either is acceptable."
379 ,(nth 3 (cadr form)))) 379 ,(nth 3 (cadr form))))
380 'maybe) 380 'maybe)
381 (t 381 (t
382 (if (eq (car (cadr form)) 'edebug-after) 382 (setq id (car (if (eq (car (cadr form)) 'edebug-after)
383 (setq id (car (nth 3 (cadr form)))) 383 (nth 3 (cadr form))
384 (setq id (car (cadr form)))) 384 (cadr form))))
385 (let ((testcover-noreturn-functions 385 (let ((testcover-noreturn-functions
386 (cons id testcover-noreturn-functions))) 386 (cons id testcover-noreturn-functions)))
387 (testcover-reinstrument (cadr form)))))) 387 (testcover-reinstrument (cadr form))))))
@@ -447,6 +447,12 @@ binding `testcover-vector' to the code-coverage vector for TESTCOVER-SYM
447(defun testcover-after (idx val) 447(defun testcover-after (idx val)
448 "Internal function for coverage testing. Returns VAL after installing it in 448 "Internal function for coverage testing. Returns VAL after installing it in
449`testcover-vector' at offset IDX." 449`testcover-vector' at offset IDX."
450 (declare (gv-expander (lambda (do)
451 (gv-letplace (getter setter) val
452 (funcall do getter
453 (lambda (store)
454 `(progn (testcover-after ,idx ,getter)
455 ,(funcall setter store))))))))
450 (cond 456 (cond
451 ((eq (aref testcover-vector idx) 'unknown) 457 ((eq (aref testcover-vector idx) 'unknown)
452 (aset testcover-vector idx val)) 458 (aset testcover-vector idx val))
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index bcd582a6f88..494d8a87e0e 100644
--- a/lisp/emacs-lisp/timer.el
+++ b/lisp/emacs-lisp/timer.el
@@ -146,14 +146,13 @@ TIME must be in the internal format returned by, e.g., `current-time'.
146The microsecond count from TIME is ignored, and USECS is used instead. 146The microsecond count from TIME is ignored, and USECS is used instead.
147If optional fourth argument DELTA is a positive number, make the timer 147If optional fourth argument DELTA is a positive number, make the timer
148fire repeatedly that many seconds apart." 148fire repeatedly that many seconds apart."
149 (declare (obsolete "use `timer-set-time' and `timer-inc-time' instead."
150 "22.1"))
149 (setf (timer--time timer) time) 151 (setf (timer--time timer) time)
150 (setf (timer--usecs timer) usecs) 152 (setf (timer--usecs timer) usecs)
151 (setf (timer--psecs timer) 0) 153 (setf (timer--psecs timer) 0)
152 (setf (timer--repeat-delay timer) (and (numberp delta) (> delta 0) delta)) 154 (setf (timer--repeat-delay timer) (and (numberp delta) (> delta 0) delta))
153 timer) 155 timer)
154(make-obsolete 'timer-set-time-with-usecs
155 "use `timer-set-time' and `timer-inc-time' instead."
156 "22.1")
157 156
158(defun timer-set-function (timer function &optional args) 157(defun timer-set-function (timer function &optional args)
159 "Make TIMER call FUNCTION with optional ARGS when triggering." 158 "Make TIMER call FUNCTION with optional ARGS when triggering."
diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el
index 5343d499efb..b20ec13fa81 100644
--- a/lisp/emacs-lock.el
+++ b/lisp/emacs-lock.el
@@ -249,9 +249,9 @@ Other values are interpreted as usual."
249 249
250(defun toggle-emacs-lock () 250(defun toggle-emacs-lock ()
251 "Toggle `emacs-lock-from-exiting' for the current buffer." 251 "Toggle `emacs-lock-from-exiting' for the current buffer."
252 (declare (obsolete emacs-lock-mode "24.1"))
252 (interactive) 253 (interactive)
253 (call-interactively 'emacs-lock-mode)) 254 (call-interactively 'emacs-lock-mode))
254(make-obsolete 'toggle-emacs-lock 'emacs-lock-mode "24.1")
255 255
256(provide 'emacs-lock) 256(provide 'emacs-lock)
257 257
diff --git a/lisp/epa.el b/lisp/epa.el
index b796f5fa77c..ecc27c4d299 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -585,8 +585,8 @@ If SECRET is non-nil, list secret keys instead of public keys."
585 (message "%s" info))) 585 (message "%s" info)))
586 586
587(defun epa-display-verify-result (verify-result) 587(defun epa-display-verify-result (verify-result)
588 (declare (obsolete epa-display-info "23.1"))
588 (epa-display-info (epg-verify-result-to-string verify-result))) 589 (epa-display-info (epg-verify-result-to-string verify-result)))
589(make-obsolete 'epa-display-verify-result 'epa-display-info "23.1")
590 590
591(defun epa-passphrase-callback-function (context key-id handback) 591(defun epa-passphrase-callback-function (context key-id handback)
592 (if (eq key-id 'SYM) 592 (if (eq key-id 'SYM)
diff --git a/lisp/epg.el b/lisp/epg.el
index 6529afb2d3c..b0e01bc3721 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -1779,6 +1779,7 @@ This function is for internal use only."
1779 (epg-context-set-result-for context 'import-status nil))) 1779 (epg-context-set-result-for context 'import-status nil)))
1780 1780
1781(defun epg-passphrase-callback-function (context key-id _handback) 1781(defun epg-passphrase-callback-function (context key-id _handback)
1782 (declare (obsolete epa-passphrase-callback-function "23.1"))
1782 (if (eq key-id 'SYM) 1783 (if (eq key-id 'SYM)
1783 (read-passwd "Passphrase for symmetric encryption: " 1784 (read-passwd "Passphrase for symmetric encryption: "
1784 (eq (epg-context-operation context) 'encrypt)) 1785 (eq (epg-context-operation context) 'encrypt))
@@ -1790,9 +1791,6 @@ This function is for internal use only."
1790 (format "Passphrase for %s %s: " key-id (cdr entry)) 1791 (format "Passphrase for %s %s: " key-id (cdr entry))
1791 (format "Passphrase for %s: " key-id))))))) 1792 (format "Passphrase for %s: " key-id)))))))
1792 1793
1793(make-obsolete 'epg-passphrase-callback-function
1794 'epa-passphrase-callback-function "23.1")
1795
1796(defun epg--list-keys-1 (context name mode) 1794(defun epg--list-keys-1 (context name mode)
1797 (let ((args (append (if epg-gpg-home-directory 1795 (let ((args (append (if epg-gpg-home-directory
1798 (list "--homedir" epg-gpg-home-directory)) 1796 (list "--homedir" epg-gpg-home-directory))
@@ -2562,6 +2560,7 @@ If you use this function, you will need to wait for the completion of
2562`epg-reset' to clear a temporary output file. 2560`epg-reset' to clear a temporary output file.
2563If you are unsure, use synchronous version of this function 2561If you are unsure, use synchronous version of this function
2564`epg-sign-keys' instead." 2562`epg-sign-keys' instead."
2563 (declare (obsolete nil "23.1"))
2565 (epg-context-set-operation context 'sign-keys) 2564 (epg-context-set-operation context 'sign-keys)
2566 (epg-context-set-result context nil) 2565 (epg-context-set-result context nil)
2567 (epg--start context (cons (if local 2566 (epg--start context (cons (if local
@@ -2572,10 +2571,10 @@ If you are unsure, use synchronous version of this function
2572 (epg-sub-key-id 2571 (epg-sub-key-id
2573 (car (epg-key-sub-key-list key)))) 2572 (car (epg-key-sub-key-list key))))
2574 keys)))) 2573 keys))))
2575(make-obsolete 'epg-start-sign-keys "do not use." "23.1")
2576 2574
2577(defun epg-sign-keys (context keys &optional local) 2575(defun epg-sign-keys (context keys &optional local)
2578 "Sign KEYS from the key ring." 2576 "Sign KEYS from the key ring."
2577 (declare (obsolete nil "23.1"))
2579 (unwind-protect 2578 (unwind-protect
2580 (progn 2579 (progn
2581 (epg-start-sign-keys context keys local) 2580 (epg-start-sign-keys context keys local)
@@ -2586,7 +2585,6 @@ If you are unsure, use synchronous version of this function
2586 (list "Sign keys failed" 2585 (list "Sign keys failed"
2587 (epg-errors-to-string errors)))))) 2586 (epg-errors-to-string errors))))))
2588 (epg-reset context))) 2587 (epg-reset context)))
2589(make-obsolete 'epg-sign-keys "do not use." "23.1")
2590 2588
2591(defun epg-start-generate-key (context parameters) 2589(defun epg-start-generate-key (context parameters)
2592 "Initiate a key generation. 2590 "Initiate a key generation.
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 674a6c97eec..348765036ea 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,7 @@
12012-09-25 Chong Yidong <cyd@gnu.org>
2
3 * erc.el (erc-send-command): Use define-obsolete-function-alias.
4
12012-09-17 Chong Yidong <cyd@gnu.org> 52012-09-17 Chong Yidong <cyd@gnu.org>
2 6
3 * erc-page.el (erc-page-function): 7 * erc-page.el (erc-page-function):
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index feef75940f3..7feadc50aca 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -139,8 +139,8 @@
139 (message (concat "ERC: The function `defvaralias' is not bound. See the " 139 (message (concat "ERC: The function `defvaralias' is not bound. See the "
140 "NEWS file for variable name changes since ERC 5.0.4."))) 140 "NEWS file for variable name changes since ERC 5.0.4.")))
141 141
142(defalias 'erc-send-command 'erc-server-send) 142(define-obsolete-function-alias 'erc-send-command
143(erc-make-obsolete 'erc-send-command 'erc-server-send "ERC 5.1") 143 'erc-server-send "ERC 5.1")
144 144
145;; tunable connection and authentication parameters 145;; tunable connection and authentication parameters
146 146
diff --git a/lisp/eshell/em-term.el b/lisp/eshell/em-term.el
index 37fa939cc10..ef59f6d1d35 100644
--- a/lisp/eshell/em-term.el
+++ b/lisp/eshell/em-term.el
@@ -63,10 +63,13 @@ which commands are considered visual in nature."
63 :type '(repeat string) 63 :type '(repeat string)
64 :group 'eshell-term) 64 :group 'eshell-term)
65 65
66(defcustom eshell-term-name "eterm" 66;; If you change this from term-term-name, you need to ensure that the
67;; value you choose exists in the system's terminfo database. (Bug#12485)
68(defcustom eshell-term-name term-term-name
67 "Name to use for the TERM variable when running visual commands. 69 "Name to use for the TERM variable when running visual commands.
68See `term-term-name' in term.el for more information on how this is 70See `term-term-name' in term.el for more information on how this is
69used." 71used."
72 :version "24.3" ; eterm -> term-term-name = eterm-color
70 :type 'string 73 :type 'string
71 :group 'eshell-term) 74 :group 'eshell-term)
72 75
diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 515a23f81d7..5a10721387b 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -1216,11 +1216,12 @@ COMMAND may result in an alias being executed, or a plain command."
1216 (let* ((sym (intern-soft (concat "eshell/" name))) 1216 (let* ((sym (intern-soft (concat "eshell/" name)))
1217 (file (symbol-file sym 'defun))) 1217 (file (symbol-file sym 'defun)))
1218 ;; If the function exists, but is defined in an eshell module 1218 ;; If the function exists, but is defined in an eshell module
1219 ;; that's not currently enabled, don't report it as found 1219 ;; that's not currently enabled, don't report it as found.
1220 (if (and file 1220 (if (and file
1221 (string-match "\\(em\\|esh\\)-\\(.*\\)\\(\\.el\\)?\\'" file)) 1221 (setq file (file-name-base file))
1222 (string-match "\\`\\(em\\|esh\\)-\\([[:alnum:]]+\\)\\'" file))
1222 (let ((module-sym 1223 (let ((module-sym
1223 (intern (file-name-base (concat "eshell-" (match-string 2 file)))))) 1224 (intern (concat "eshell-" (match-string 2 file)))))
1224 (if (and (functionp sym) 1225 (if (and (functionp sym)
1225 (or (null module-sym) 1226 (or (null module-sym)
1226 (eshell-using-module module-sym) 1227 (eshell-using-module module-sym)
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index fa0336232f9..01df5fced62 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -275,6 +275,7 @@ Prepend remote identification of `default-directory', if any."
275 275
276(defmacro eshell-for (for-var for-list &rest forms) 276(defmacro eshell-for (for-var for-list &rest forms)
277 "Iterate through a list." 277 "Iterate through a list."
278 (declare (obsolete dolist "24.1"))
278 (declare (indent 2)) 279 (declare (indent 2))
279 `(let ((list-iter ,for-list)) 280 `(let ((list-iter ,for-list))
280 (while list-iter 281 (while list-iter
@@ -282,9 +283,6 @@ Prepend remote identification of `default-directory', if any."
282 ,@forms) 283 ,@forms)
283 (setq list-iter (cdr list-iter))))) 284 (setq list-iter (cdr list-iter)))))
284 285
285
286(make-obsolete 'eshell-for 'dolist "24.1")
287
288(defun eshell-flatten-list (args) 286(defun eshell-flatten-list (args)
289 "Flatten any lists within ARGS, so that there are no sublists." 287 "Flatten any lists within ARGS, so that there are no sublists."
290 (let ((new-list (list t))) 288 (let ((new-list (list t)))
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el
index c663de3f40d..a9a854221a4 100644
--- a/lisp/eshell/eshell.el
+++ b/lisp/eshell/eshell.el
@@ -243,16 +243,14 @@ shells such as bash, zsh, rc, 4dos."
243 243
244(defun eshell-add-to-window-buffer-names () 244(defun eshell-add-to-window-buffer-names ()
245 "Add `eshell-buffer-name' to `same-window-buffer-names'." 245 "Add `eshell-buffer-name' to `same-window-buffer-names'."
246 (declare (obsolete nil "24.3"))
246 (add-to-list 'same-window-buffer-names eshell-buffer-name)) 247 (add-to-list 'same-window-buffer-names eshell-buffer-name))
247(make-obsolete 'eshell-add-to-window-buffer-names
248 "no longer needed." "24.3")
249 248
250(defun eshell-remove-from-window-buffer-names () 249(defun eshell-remove-from-window-buffer-names ()
251 "Remove `eshell-buffer-name' from `same-window-buffer-names'." 250 "Remove `eshell-buffer-name' from `same-window-buffer-names'."
251 (declare (obsolete nil "24.3"))
252 (setq same-window-buffer-names 252 (setq same-window-buffer-names
253 (delete eshell-buffer-name same-window-buffer-names))) 253 (delete eshell-buffer-name same-window-buffer-names)))
254(make-obsolete 'eshell-remove-from-window-buffer-names
255 "no longer needed." "24.3")
256 254
257(defcustom eshell-load-hook nil 255(defcustom eshell-load-hook nil
258 "A hook run once Eshell has been loaded." 256 "A hook run once Eshell has been loaded."
diff --git a/lisp/faces.el b/lisp/faces.el
index 6a477e172e1..3ee859305a5 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1867,6 +1867,7 @@ Return nil if it has no specified face."
1867;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 1867;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1868 1868
1869(declare-function x-parse-geometry "frame.c" (string)) 1869(declare-function x-parse-geometry "frame.c" (string))
1870(defvar x-display-name)
1870 1871
1871(defun x-handle-named-frame-geometry (parameters) 1872(defun x-handle-named-frame-geometry (parameters)
1872 "Add geometry parameters for a named frame to parameter list PARAMETERS. 1873 "Add geometry parameters for a named frame to parameter list PARAMETERS.
diff --git a/lisp/files.el b/lisp/files.el
index 66c526266e6..76a13f6cefd 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -821,10 +821,10 @@ one or more of those symbols."
821(defun locate-file-completion (string path-and-suffixes action) 821(defun locate-file-completion (string path-and-suffixes action)
822 "Do completion for file names passed to `locate-file'. 822 "Do completion for file names passed to `locate-file'.
823PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)." 823PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)."
824 (declare (obsolete locate-file-completion-table "23.1"))
824 (locate-file-completion-table (car path-and-suffixes) 825 (locate-file-completion-table (car path-and-suffixes)
825 (cdr path-and-suffixes) 826 (cdr path-and-suffixes)
826 string nil action)) 827 string nil action))
827(make-obsolete 'locate-file-completion 'locate-file-completion-table "23.1")
828 828
829(defvar locate-dominating-stop-dir-regexp 829(defvar locate-dominating-stop-dir-regexp
830 (purecopy "\\`\\(?:[\\/][\\/][^\\/]+[\\/]\\|/\\(?:net\\|afs\\|\\.\\.\\.\\)/\\)\\'") 830 (purecopy "\\`\\(?:[\\/][\\/][^\\/]+[\\/]\\|/\\(?:net\\|afs\\|\\.\\.\\.\\)/\\)\\'")
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 6404af7703a..78760c015ff 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -340,8 +340,8 @@ This can be an \"!\" or the \"n\" in \"ifndef\".")
340(defvar font-lock-preprocessor-face 'font-lock-preprocessor-face 340(defvar font-lock-preprocessor-face 'font-lock-preprocessor-face
341 "Face name to use for preprocessor directives.") 341 "Face name to use for preprocessor directives.")
342 342
343(defvar font-lock-reference-face 'font-lock-constant-face) 343(define-obsolete-variable-alias
344(make-obsolete-variable 'font-lock-reference-face 'font-lock-constant-face "20.3") 344 'font-lock-reference-face 'font-lock-constant-face "20.3")
345 345
346;; Fontification variables: 346;; Fontification variables:
347 347
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index a97c5649c95..ce1599b9010 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -1531,15 +1531,15 @@ like an INI file. You can add this hook to `find-file-hook'."
1531 '("#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)" 1531 '("#[ \t]*include[ \t]+\\(<[^>\"\n]+>\\)"
1532 1 font-lock-string-face) 1532 1 font-lock-string-face)
1533 '("#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?" 1533 '("#[ \t]*\\(\\sw+\\)\\>[ \t]*\\(\\sw+\\)?"
1534 (1 font-lock-reference-face) 1534 (1 font-lock-constant-face)
1535 (2 font-lock-variable-name-face nil t)) 1535 (2 font-lock-variable-name-face nil t))
1536 ;; indirect string constants 1536 ;; indirect string constants
1537 '("\\(@[A-Za-z][A-Za-z0-9_]+\\)" 1 font-lock-builtin-face) 1537 '("\\(@[A-Za-z][A-Za-z0-9_]+\\)" 1 font-lock-builtin-face)
1538 ;; gotos 1538 ;; gotos
1539 '("[ \t]*\\(\\sw+:\\)" 1 font-lock-reference-face) 1539 '("[ \t]*\\(\\sw+:\\)" 1 font-lock-constant-face)
1540 '("\\<\\(goto\\)\\>[ \t]*\\(\\sw+\\)?" 1540 '("\\<\\(goto\\)\\>[ \t]*\\(\\sw+\\)?"
1541 (1 font-lock-keyword-face) 1541 (1 font-lock-keyword-face)
1542 (2 font-lock-reference-face nil t)) 1542 (2 font-lock-constant-face nil t))
1543 ;; system variables 1543 ;; system variables
1544 (generic-make-keywords-list 1544 (generic-make-keywords-list
1545 installshield-system-variables-list 1545 installshield-system-variables-list
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 45f23a6d99c..983d09e2589 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12012-09-25 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-art.el (gnus-article-browse-delete-temp-files): Never ask again
4 a user about whether to delete temp files if once a user answered as n.
5
12012-09-17 Richard Stallman <rms@gnu.org> 62012-09-17 Richard Stallman <rms@gnu.org>
2 7
3 * message.el (message-in-body-p): Don't set mark or modify buffer. 8 * message.el (message-in-body-p): Don't set mark or modify buffer.
diff --git a/lisp/gnus/ChangeLog.2 b/lisp/gnus/ChangeLog.2
index 5a3612c4d1c..e75506956bb 100644
--- a/lisp/gnus/ChangeLog.2
+++ b/lisp/gnus/ChangeLog.2
@@ -11974,7 +11974,7 @@
11974 11974
119752001-12-18 01:00:00 ShengHuo ZHU <zsh@cs.rochester.edu> 119752001-12-18 01:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
11976 11976
11977 * ChangeLog, ChangeLog.1, nnwfm.el, gnus-smiley.el: 11977 * ChangeLog, ChangeLog.1, nnwfm.el, gnus-smiley.el:
11978 * gnus-cite.el, gnus-delay.el, gnus-spec.el, message.el: 11978 * gnus-cite.el, gnus-delay.el, gnus-spec.el, message.el:
11979 * mml1991.el, nnultimate.el: Add `coding'. 11979 * mml1991.el, nnultimate.el: Add `coding'.
11980 11980
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 7dcbd61316f..6c827e070cb 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -2760,11 +2760,12 @@ summary buffer."
2760 (or how (setq how gnus-article-browse-delete-temp)) 2760 (or how (setq how gnus-article-browse-delete-temp))
2761 (if (eq how 'ask) 2761 (if (eq how 'ask)
2762 (let ((files (length gnus-article-browse-html-temp-list))) 2762 (let ((files (length gnus-article-browse-html-temp-list)))
2763 (gnus-y-or-n-p 2763 (or (gnus-y-or-n-p
2764 (if (= files 1) 2764 (if (= files 1)
2765 "Delete the temporary HTML file? " 2765 "Delete the temporary HTML file? "
2766 (format "Delete all %s temporary HTML files? " 2766 (format "Delete all %s temporary HTML files? "
2767 files)))) 2767 files)))
2768 (setq gnus-article-browse-html-temp-list nil)))
2768 how))) 2769 how)))
2769 (dolist (file gnus-article-browse-html-temp-list) 2770 (dolist (file gnus-article-browse-html-temp-list)
2770 (cond ((file-directory-p file) 2771 (cond ((file-directory-p file)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index fa0484ff4e5..ef482f8f0e9 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -488,13 +488,16 @@ suitable file is found, return nil."
488 (insert "'.\n")))) 488 (insert "'.\n"))))
489 489
490(defun help-fns--obsolete (function) 490(defun help-fns--obsolete (function)
491 (let* ((obsolete (and 491 ;; Ignore lambda constructs, keyboard macros, etc.
492 ;; `function' might be a lambda construct. 492 (let* ((obsolete (and (symbolp function)
493 (symbolp function) 493 (get function 'byte-obsolete-info)))
494 (get function 'byte-obsolete-info)))
495 (use (car obsolete))) 494 (use (car obsolete)))
496 (when obsolete 495 (when obsolete
497 (insert "\nThis function is obsolete") 496 (insert "\nThis "
497 (if (eq (car-safe (symbol-function function)) 'macro)
498 "macro"
499 "function")
500 " is obsolete")
498 (when (nth 2 obsolete) 501 (when (nth 2 obsolete)
499 (insert (format " since %s" (nth 2 obsolete)))) 502 (insert (format " since %s" (nth 2 obsolete))))
500 (insert (cond ((stringp use) (concat ";\n" use)) 503 (insert (cond ((stringp use) (concat ";\n" use))
@@ -611,7 +614,7 @@ FILE is the file where FUNCTION was probably defined."
611 (fill-region-as-paragraph (save-excursion (goto-char pt1) (forward-line 0) (point)) 614 (fill-region-as-paragraph (save-excursion (goto-char pt1) (forward-line 0) (point))
612 (point))) 615 (point)))
613 (terpri)(terpri) 616 (terpri)(terpri)
614 617
615 (let* ((doc-raw (condition-case err 618 (let* ((doc-raw (condition-case err
616 (documentation function t) 619 (documentation function t)
617 (error (format "No Doc! %S" err)))) 620 (error (format "No Doc! %S" err))))
diff --git a/lisp/help-macro.el b/lisp/help-macro.el
index 112c72778bc..0600484b6df 100644
--- a/lisp/help-macro.el
+++ b/lisp/help-macro.el
@@ -69,7 +69,6 @@
69 69
70(require 'backquote) 70(require 'backquote)
71 71
72;;;###autoload
73(defcustom three-step-help nil 72(defcustom three-step-help nil
74 "Non-nil means give more info about Help command in three steps. 73 "Non-nil means give more info about Help command in three steps.
75The three steps are simple prompt, prompt with all options, and 74The three steps are simple prompt, prompt with all options, and
diff --git a/lisp/help.el b/lisp/help.el
index 707c8e3c84f..0df9c607f69 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -981,26 +981,6 @@ function is called, the window to be resized is selected."
981 :group 'help 981 :group 'help
982 :version "24.2") 982 :version "24.2")
983 983
984(defcustom temp-buffer-resize-frames nil
985 "Non-nil means `temp-buffer-resize-mode' can resize frames.
986A frame can be resized if and only if its root window is a live
987window. The height of the root window is subject to the values of
988`temp-buffer-max-height' and `window-min-height'."
989 :type 'boolean
990 :version "24.2"
991 :group 'help)
992
993(defcustom temp-buffer-resize-regexps nil
994 "List of regexps that inhibit Temp Buffer Resize mode.
995Any window of a buffer whose name matches one of these regular
996expressions is left alone by Temp Buffer Resize mode."
997 :type '(repeat
998 :tag "Buffer"
999 :value ""
1000 (regexp :format "%v"))
1001 :version "24.3"
1002 :group 'help)
1003
1004(define-minor-mode temp-buffer-resize-mode 984(define-minor-mode temp-buffer-resize-mode
1005 "Toggle auto-resizing temporary buffer windows (Temp Buffer Resize Mode). 985 "Toggle auto-resizing temporary buffer windows (Temp Buffer Resize Mode).
1006With a prefix argument ARG, enable Temp Buffer Resize mode if ARG 986With a prefix argument ARG, enable Temp Buffer Resize mode if ARG
@@ -1014,9 +994,8 @@ fit the buffer's contents, but never more than
1014 994
1015A window is resized only if it has been specially created for the 995A window is resized only if it has been specially created for the
1016buffer. Windows that have shown another buffer before are not 996buffer. Windows that have shown another buffer before are not
1017resized. A window showing a buffer whose name matches any of the 997resized. A frame is resized only if `fit-frame-to-buffer' is
1018expressions in `temp-buffer-resize-regexps' is not resized. A 998non-nil.
1019frame is resized only if `temp-buffer-resize-frames' is non-nil.
1020 999
1021This mode is used by `help', `apropos' and `completion' buffers, 1000This mode is used by `help', `apropos' and `completion' buffers,
1022and some others." 1001and some others."
@@ -1034,33 +1013,28 @@ WINDOW can be any live window and defaults to the selected one.
1034Do not make WINDOW higher than `temp-buffer-max-height' nor 1013Do not make WINDOW higher than `temp-buffer-max-height' nor
1035smaller than `window-min-height'. Do nothing if WINDOW is not 1014smaller than `window-min-height'. Do nothing if WINDOW is not
1036vertically combined or some of its contents are scrolled out of 1015vertically combined or some of its contents are scrolled out of
1037view. Do nothing if the name of WINDOW's buffer matches an 1016view."
1038expression in `temp-buffer-resize-regexps'."
1039 (setq window (window-normalize-window window t)) 1017 (setq window (window-normalize-window window t))
1040 (let ((buffer-name (buffer-name (window-buffer window)))) 1018 (let ((buffer-name (buffer-name (window-buffer window))))
1041 (unless (catch 'found 1019 (let ((height (if (functionp temp-buffer-max-height)
1042 (dolist (regexp temp-buffer-resize-regexps) 1020 (with-selected-window window
1043 (when (string-match regexp buffer-name) 1021 (funcall temp-buffer-max-height (window-buffer)))
1044 (throw 'found t)))) 1022 temp-buffer-max-height))
1045 (let ((height (if (functionp temp-buffer-max-height) 1023 (quit-cadr (cadr (window-parameter window 'quit-restore))))
1046 (with-selected-window window 1024 (cond
1047 (funcall temp-buffer-max-height (window-buffer))) 1025 ;; Don't resize WINDOW if it showed another buffer before.
1048 temp-buffer-max-height)) 1026 ((and (eq quit-cadr 'window)
1049 (quit-cadr (cadr (window-parameter window 'quit-restore)))) 1027 (pos-visible-in-window-p (point-min) window)
1050 (cond 1028 (window-combined-p window))
1051 ;; Don't resize WINDOW if it showed another buffer before. 1029 (fit-window-to-buffer window height))
1052 ((and (eq quit-cadr 'window) 1030 ((and fit-frame-to-buffer
1053 (pos-visible-in-window-p (point-min) window) 1031 (eq quit-cadr 'frame)
1054 (window-combined-p window)) 1032 (eq window (frame-root-window window)))
1055 (fit-window-to-buffer window height)) 1033 (let ((frame (window-frame window)))
1056 ((and temp-buffer-resize-frames 1034 (fit-frame-to-buffer
1057 (eq quit-cadr 'frame) 1035 frame (+ (frame-height frame)
1058 (eq window (frame-root-window window))) 1036 (- (window-total-size window))
1059 (let ((frame (window-frame window))) 1037 height))))))))
1060 (fit-frame-to-buffer
1061 frame (+ (frame-height frame)
1062 (- (window-total-size window))
1063 height)))))))))
1064 1038
1065;;; Help windows. 1039;;; Help windows.
1066(defcustom help-window-select 'other 1040(defcustom help-window-select 'other
diff --git a/lisp/hippie-exp.el b/lisp/hippie-exp.el
index f787319fb0c..2f0a6e3af59 100644
--- a/lisp/hippie-exp.el
+++ b/lisp/hippie-exp.el
@@ -199,7 +199,6 @@
199 199
200(defvar he-search-window ()) 200(defvar he-search-window ())
201 201
202;;;###autoload
203(defcustom hippie-expand-try-functions-list 202(defcustom hippie-expand-try-functions-list
204 '(try-complete-file-name-partially 203 '(try-complete-file-name-partially
205 try-complete-file-name 204 try-complete-file-name
@@ -217,31 +216,26 @@ or insert functions in this list."
217 :type '(repeat function) 216 :type '(repeat function)
218 :group 'hippie-expand) 217 :group 'hippie-expand)
219 218
220;;;###autoload
221(defcustom hippie-expand-verbose t 219(defcustom hippie-expand-verbose t
222 "Non-nil makes `hippie-expand' output which function it is trying." 220 "Non-nil makes `hippie-expand' output which function it is trying."
223 :type 'boolean 221 :type 'boolean
224 :group 'hippie-expand) 222 :group 'hippie-expand)
225 223
226;;;###autoload
227(defcustom hippie-expand-dabbrev-skip-space nil 224(defcustom hippie-expand-dabbrev-skip-space nil
228 "Non-nil means tolerate trailing spaces in the abbreviation to expand." 225 "Non-nil means tolerate trailing spaces in the abbreviation to expand."
229 :group 'hippie-expand 226 :group 'hippie-expand
230 :type 'boolean) 227 :type 'boolean)
231 228
232;;;###autoload
233(defcustom hippie-expand-dabbrev-as-symbol t 229(defcustom hippie-expand-dabbrev-as-symbol t
234 "Non-nil means expand as symbols, i.e. syntax `_' is considered a letter." 230 "Non-nil means expand as symbols, i.e. syntax `_' is considered a letter."
235 :group 'hippie-expand 231 :group 'hippie-expand
236 :type 'boolean) 232 :type 'boolean)
237 233
238;;;###autoload
239(defcustom hippie-expand-no-restriction t 234(defcustom hippie-expand-no-restriction t
240 "Non-nil means that narrowed buffers are widened during search." 235 "Non-nil means that narrowed buffers are widened during search."
241 :group 'hippie-expand 236 :group 'hippie-expand
242 :type 'boolean) 237 :type 'boolean)
243 238
244;;;###autoload
245(defcustom hippie-expand-max-buffers () 239(defcustom hippie-expand-max-buffers ()
246 "The maximum number of buffers (apart from the current) searched. 240 "The maximum number of buffers (apart from the current) searched.
247If nil, all buffers are searched." 241If nil, all buffers are searched."
@@ -249,15 +243,13 @@ If nil, all buffers are searched."
249 integer) 243 integer)
250 :group 'hippie-expand) 244 :group 'hippie-expand)
251 245
252;;;###autoload 246(defcustom hippie-expand-ignore-buffers '("^ \\*.*\\*$" dired-mode)
253(defcustom hippie-expand-ignore-buffers (list (purecopy "^ \\*.*\\*$") 'dired-mode)
254 "A list specifying which buffers not to search (if not current). 247 "A list specifying which buffers not to search (if not current).
255Can contain both regexps matching buffer names (as strings) and major modes 248Can contain both regexps matching buffer names (as strings) and major modes
256\(as atoms)" 249\(as atoms)"
257 :type '(repeat (choice regexp (symbol :tag "Major Mode"))) 250 :type '(repeat (choice regexp (symbol :tag "Major Mode")))
258 :group 'hippie-expand) 251 :group 'hippie-expand)
259 252
260;;;###autoload
261(defcustom hippie-expand-only-buffers () 253(defcustom hippie-expand-only-buffers ()
262 "A list specifying the only buffers to search (in addition to current). 254 "A list specifying the only buffers to search (in addition to current).
263Can contain both regexps matching buffer names (as strings) and major modes 255Can contain both regexps matching buffer names (as strings) and major modes
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index fbf7a672ff6..b0bc5b6b3b3 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -1052,8 +1052,6 @@ haven't encountered them yet. Returns a `hfy-style-assoc'."
1052 (hfy-face-attr-for-class fn hfy-display-class)) 1052 (hfy-face-attr-for-class fn hfy-display-class))
1053 ((and (symbolp fn) 1053 ((and (symbolp fn)
1054 (facep (symbol-value fn))) 1054 (facep (symbol-value fn)))
1055 ;; Obsolete faces like `font-lock-reference-face' are defined as
1056 ;; aliases for another face.
1057 (hfy-face-attr-for-class (symbol-value fn) hfy-display-class)) 1055 (hfy-face-attr-for-class (symbol-value fn) hfy-display-class))
1058 (t nil))) 1056 (t nil)))
1059 1057
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 97df90a65af..ee5bd0f357a 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -755,10 +755,16 @@ They are removed from `ibuffer-saved-filter-groups'."
755The value from `ibuffer-saved-filter-groups' is used." 755The value from `ibuffer-saved-filter-groups' is used."
756 (interactive 756 (interactive
757 (list 757 (list
758 (if (null ibuffer-saved-filter-groups) 758 (cond ((null ibuffer-saved-filter-groups)
759 (error "No saved filters") 759 (error "No saved filters"))
760 (completing-read "Switch to saved filter group: " 760 ;; `ibuffer-saved-filter-groups' is a user variable that defaults
761 ibuffer-saved-filter-groups nil t)))) 761 ;; to nil. We assume that with one element in this list the user
762 ;; knows what she wants. See bug#12331.
763 ((null (cdr ibuffer-saved-filter-groups))
764 (caar ibuffer-saved-filter-groups))
765 (t
766 (completing-read "Switch to saved filter group: "
767 ibuffer-saved-filter-groups nil t)))))
762 (setq ibuffer-filter-groups (cdr (assoc name ibuffer-saved-filter-groups)) 768 (setq ibuffer-filter-groups (cdr (assoc name ibuffer-saved-filter-groups))
763 ibuffer-hidden-filter-groups nil) 769 ibuffer-hidden-filter-groups nil)
764 (ibuffer-update nil t)) 770 (ibuffer-update nil t))
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 77461469044..c9dcff41618 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -1283,7 +1283,7 @@ With optional ARG, make read-only only if ARG is not negative."
1283 (:opstring "toggled read only status in" 1283 (:opstring "toggled read only status in"
1284 :interactive "P" 1284 :interactive "P"
1285 :modifier-p t) 1285 :modifier-p t)
1286 (call-interactively 'toggle-read-only)) 1286 (read-only-mode 'toggle))
1287 1287
1288(define-ibuffer-op ibuffer-do-delete () 1288(define-ibuffer-op ibuffer-do-delete ()
1289 "Kill marked buffers as with `kill-this-buffer'." 1289 "Kill marked buffers as with `kill-this-buffer'."
@@ -2641,7 +2641,7 @@ will be inserted before the group at point."
2641;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group 2641;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group
2642;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group 2642;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group
2643;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode 2643;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode
2644;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "c255d1ebe80ccabd8385f40bdd0b5451") 2644;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "f03bae226325c7320d41ddb78896665a")
2645;;; Generated autoloads from ibuf-ext.el 2645;;; Generated autoloads from ibuf-ext.el
2646 2646
2647(autoload 'ibuffer-auto-mode "ibuf-ext" "\ 2647(autoload 'ibuffer-auto-mode "ibuf-ext" "\
diff --git a/lisp/ido.el b/lisp/ido.el
index d48e7ba858b..94818fe57b0 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -714,7 +714,7 @@ See also `ido-dir-file-cache' and `ido-save-directory-list-file'."
714 :type 'integer 714 :type 'integer
715 :group 'ido) 715 :group 'ido)
716 716
717(defcustom ido-max-directory-size 30000 717(defcustom ido-max-directory-size nil
718 "Maximum size (in bytes) for directories to use ido completion. 718 "Maximum size (in bytes) for directories to use ido completion.
719If you enter a directory with a size larger than this size, ido will 719If you enter a directory with a size larger than this size, ido will
720not provide the normal completion. To show the completions, use C-a." 720not provide the normal completion. To show the completions, use C-a."
@@ -3701,14 +3701,14 @@ This is to make them appear as if they were \"virtual buffers\"."
3701 (rexq (concat rex0 (if slash ".*/" ""))) 3701 (rexq (concat rex0 (if slash ".*/" "")))
3702 (re (if ido-enable-prefix (concat "\\`" rexq) rexq)) 3702 (re (if ido-enable-prefix (concat "\\`" rexq) rexq))
3703 (full-re (and do-full 3703 (full-re (and do-full
3704 (and (eq ido-cur-item 'buffer) 3704 (not (and (eq ido-cur-item 'buffer)
3705 (not ido-buffer-disable-smart-matches)) 3705 ido-buffer-disable-smart-matches))
3706 (not ido-enable-regexp) 3706 (not ido-enable-regexp)
3707 (not (string-match "\$\\'" rex0)) 3707 (not (string-match "\$\\'" rex0))
3708 (concat "\\`" rex0 (if slash "/" "") "\\'"))) 3708 (concat "\\`" rex0 (if slash "/" "") "\\'")))
3709 (suffix-re (and do-full slash 3709 (suffix-re (and do-full slash
3710 (and (eq ido-cur-item 'buffer) 3710 (not (and (eq ido-cur-item 'buffer)
3711 (not ido-buffer-disable-smart-matches)) 3711 ido-buffer-disable-smart-matches))
3712 (not ido-enable-regexp) 3712 (not ido-enable-regexp)
3713 (not (string-match "\$\\'" rex0)) 3713 (not (string-match "\$\\'" rex0))
3714 (concat rex0 "/\\'"))) 3714 (concat rex0 "/\\'")))
diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index fabc12c0219..4ac62fbb6fc 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -1,4 +1,4 @@
1;;; image-mode.el --- support for visiting image files 1;;; image-mode.el --- support for visiting image files -*- lexical-binding: t -*-
2;; 2;;
3;; Copyright (C) 2005-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2005-2012 Free Software Foundation, Inc.
4;; 4;;
@@ -31,6 +31,11 @@
31;; resulting buffer file is saved to another name it will correctly save 31;; resulting buffer file is saved to another name it will correctly save
32;; the image data to the new file. 32;; the image data to the new file.
33 33
34;; Todo:
35
36;; Consolidate with doc-view to make them work on directories of images or on
37;; image files containing various "pages".
38
34;;; Code: 39;;; Code:
35 40
36(require 'image) 41(require 'image)
@@ -38,8 +43,7 @@
38 43
39;;; Image mode window-info management. 44;;; Image mode window-info management.
40 45
41(defvar image-mode-winprops-alist t) 46(defvar-local image-mode-winprops-alist t)
42(make-variable-buffer-local 'image-mode-winprops-alist)
43 47
44(defvar image-mode-new-window-functions nil 48(defvar image-mode-new-window-functions nil
45 "Special hook run when image data is requested in a new window. 49 "Special hook run when image data is requested in a new window.
@@ -47,9 +51,13 @@ It is called with one argument, the initial WINPROPS.")
47 51
48(defun image-mode-winprops (&optional window cleanup) 52(defun image-mode-winprops (&optional window cleanup)
49 "Return winprops of WINDOW. 53 "Return winprops of WINDOW.
50A winprops object has the shape (WINDOW . ALIST)." 54A winprops object has the shape (WINDOW . ALIST).
55WINDOW defaults to `selected-window' if it displays the current buffer, and
56otherwise it defaults to t, used for times when the buffer is not displayed."
51 (cond ((null window) 57 (cond ((null window)
52 (setq window (selected-window))) 58 (setq window
59 (if (eq (current-buffer) (window-buffer)) (selected-window) t)))
60 ((eq window t))
53 ((not (windowp window)) 61 ((not (windowp window))
54 (error "Not a window: %s" window))) 62 (error "Not a window: %s" window)))
55 (when cleanup 63 (when cleanup
diff --git a/lisp/image.el b/lisp/image.el
index 99c0a74a512..72dc654757a 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -346,7 +346,7 @@ Optional DATA-P non-nil means SOURCE is a string containing image data."
346 "Return non-nil if image type TYPE is available. 346 "Return non-nil if image type TYPE is available.
347Image types are symbols like `xbm' or `jpeg'." 347Image types are symbols like `xbm' or `jpeg'."
348 (and (fboundp 'init-image-library) 348 (and (fboundp 'init-image-library)
349 (init-image-library type dynamic-library-alist))) 349 (init-image-library type)))
350 350
351 351
352;;;###autoload 352;;;###autoload
diff --git a/lisp/imenu.el b/lisp/imenu.el
index c2a80d69675..47a2f1e3b40 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -326,6 +326,7 @@ PREVPOS is the variable in which we store the last position displayed."
326(defun imenu-example--name-and-position () 326(defun imenu-example--name-and-position ()
327 "Return the current/previous sexp and its (beginning) location. 327 "Return the current/previous sexp and its (beginning) location.
328Don't move point." 328Don't move point."
329 (declare (obsolete "use your own function instead." "23.2"))
329 (save-excursion 330 (save-excursion
330 (forward-sexp -1) 331 (forward-sexp -1)
331 ;; [ydi] modified for imenu-use-markers 332 ;; [ydi] modified for imenu-use-markers
@@ -333,8 +334,6 @@ Don't move point."
333 (end (progn (forward-sexp) (point)))) 334 (end (progn (forward-sexp) (point))))
334 (cons (buffer-substring beg end) 335 (cons (buffer-substring beg end)
335 beg)))) 336 beg))))
336(make-obsolete 'imenu-example--name-and-position
337 "use your own function instead." "23.2")
338 337
339;;; 338;;;
340;;; Lisp 339;;; Lisp
@@ -343,6 +342,7 @@ Don't move point."
343(defun imenu-example--lisp-extract-index-name () 342(defun imenu-example--lisp-extract-index-name ()
344 ;; Example of a candidate for `imenu-extract-index-name-function'. 343 ;; Example of a candidate for `imenu-extract-index-name-function'.
345 ;; This will generate a flat index of definitions in a lisp file. 344 ;; This will generate a flat index of definitions in a lisp file.
345 (declare (obsolete nil "23.2"))
346 (save-match-data 346 (save-match-data
347 (and (looking-at "(def") 347 (and (looking-at "(def")
348 (condition-case nil 348 (condition-case nil
@@ -353,11 +353,11 @@ Don't move point."
353 (end (progn (forward-sexp -1) (point)))) 353 (end (progn (forward-sexp -1) (point))))
354 (buffer-substring beg end))) 354 (buffer-substring beg end)))
355 (error nil))))) 355 (error nil)))))
356(make-obsolete 'imenu-example--lisp-extract-index-name "your own" "23.2")
357 356
358(defun imenu-example--create-lisp-index () 357(defun imenu-example--create-lisp-index ()
359 ;; Example of a candidate for `imenu-create-index-function'. 358 ;; Example of a candidate for `imenu-create-index-function'.
360 ;; It will generate a nested index of definitions. 359 ;; It will generate a nested index of definitions.
360 (declare (obsolete nil "23.2"))
361 (let ((index-alist '()) 361 (let ((index-alist '())
362 (index-var-alist '()) 362 (index-var-alist '())
363 (index-type-alist '()) 363 (index-type-alist '())
@@ -401,7 +401,6 @@ Don't move point."
401 (push (cons "Syntax-unknown" index-unknown-alist) 401 (push (cons "Syntax-unknown" index-unknown-alist)
402 index-alist)) 402 index-alist))
403 index-alist)) 403 index-alist))
404(make-obsolete 'imenu-example--create-lisp-index "your own" "23.2")
405 404
406;; Regular expression to find C functions 405;; Regular expression to find C functions
407(defvar imenu-example--function-name-regexp-c 406(defvar imenu-example--function-name-regexp-c
@@ -414,6 +413,7 @@ Don't move point."
414 )) 413 ))
415 414
416(defun imenu-example--create-c-index (&optional regexp) 415(defun imenu-example--create-c-index (&optional regexp)
416 (declare (obsolete nil "23.2"))
417 (let ((index-alist '()) 417 (let ((index-alist '())
418 char) 418 char)
419 (goto-char (point-min)) 419 (goto-char (point-min))
@@ -430,7 +430,6 @@ Don't move point."
430 (if (not (eq char ?\;)) 430 (if (not (eq char ?\;))
431 (push (imenu-example--name-and-position) index-alist)))) 431 (push (imenu-example--name-and-position) index-alist))))
432 (nreverse index-alist))) 432 (nreverse index-alist)))
433(make-obsolete 'imenu-example--create-c-index "your own" "23.2")
434 433
435;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 434;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
436;;; 435;;;
diff --git a/lisp/international/latin1-disp.el b/lisp/international/latin1-disp.el
index 964f01c982c..5041f45ba97 100644
--- a/lisp/international/latin1-disp.el
+++ b/lisp/international/latin1-disp.el
@@ -202,8 +202,8 @@ character set: `latin-2', `hebrew' etc."
202 (and char (char-displayable-p char)))) 202 (and char (char-displayable-p char))))
203 203
204;; Backwards compatibility. 204;; Backwards compatibility.
205(defalias 'latin1-char-displayable-p 'char-displayable-p) 205(define-obsolete-function-alias 'latin1-char-displayable-p
206(make-obsolete 'latin1-char-displayable-p 'char-displayable-p "22.1") 206 'char-displayable-p "22.1")
207 207
208(defun latin1-display-setup (set &optional force) 208(defun latin1-display-setup (set &optional force)
209 "Set up Latin-1 display for characters in the given SET. 209 "Set up Latin-1 display for characters in the given SET.
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 2fc9759972e..a32c69a691e 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2058,9 +2058,9 @@ See `set-language-info-alist' for use in programs."
2058 2058
2059(defun princ-list (&rest args) 2059(defun princ-list (&rest args)
2060 "Print all arguments with `princ', then print \"\\n\"." 2060 "Print all arguments with `princ', then print \"\\n\"."
2061 (declare (obsolete "use mapc and princ instead." "23.3"))
2061 (mapc #'princ args) 2062 (mapc #'princ args)
2062 (princ "\n")) 2063 (princ "\n"))
2063(make-obsolete 'princ-list "use mapc and princ instead" "23.3")
2064 2064
2065(put 'describe-specified-language-support 'apropos-inhibit t) 2065(put 'describe-specified-language-support 'apropos-inhibit t)
2066 2066
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index bd7257bbc0f..43af785cc2f 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -208,8 +208,8 @@ Character sets for defining other charsets, or for backward compatibility
208 "Decode a character that has code CODE in CODEPAGE. 208 "Decode a character that has code CODE in CODEPAGE.
209Return a decoded character string. Each CODEPAGE corresponds to a 209Return a decoded character string. Each CODEPAGE corresponds to a
210coding system cpCODEPAGE." 210coding system cpCODEPAGE."
211 (declare (obsolete decode-char "23.1"))
211 (decode-char (intern (format "cp%d" codepage)) code)) 212 (decode-char (intern (format "cp%d" codepage)) code))
212(make-obsolete 'decode-codepage-char 'decode-char "23.1")
213 213
214;; A variable to hold charset input history. 214;; A variable to hold charset input history.
215(defvar charset-history nil) 215(defvar charset-history nil)
diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el
index 7b152a47727..3dc0b54421a 100644
--- a/lisp/international/mule-util.el
+++ b/lisp/international/mule-util.el
@@ -34,39 +34,6 @@
34;;; characters. 34;;; characters.
35 35
36;;;###autoload 36;;;###autoload
37(defun string-to-sequence (string type)
38 "Convert STRING to a sequence of TYPE which contains characters in STRING.
39TYPE should be `list' or `vector'."
40;;; (let ((len (length string))
41;;; (i 0)
42;;; val)
43 (cond ((eq type 'list)
44 ;; Applicable post-Emacs 20.2 and asymptotically ~10 times
45 ;; faster than the code below:
46 (append string nil))
47;;; (setq val (make-list len 0))
48;;; (let ((l val))
49;;; (while (< i len)
50;;; (setcar l (aref string i))
51;;; (setq l (cdr l) i (1+ i))))))
52 ((eq type 'vector)
53 ;; As above.
54 (vconcat string))
55;;; (setq val (make-vector len 0))
56;;; (while (< i len)
57;;; (aset val i (aref string i))
58;;; (setq i (1+ i))))
59 (t
60 (error "Invalid type: %s" type)))
61;;; val)
62)
63
64;;;###autoload
65(make-obsolete 'string-to-sequence
66 "use `string-to-list' or `string-to-vector'."
67 "22.1")
68
69;;;###autoload
70(defsubst string-to-list (string) 37(defsubst string-to-list (string)
71 "Return a list of characters in STRING." 38 "Return a list of characters in STRING."
72 (append string nil)) 39 (append string nil))
@@ -330,10 +297,9 @@ operations such as `find-coding-systems-region'."
330 "Detect a coding system of the text between FROM and TO with PRIORITY-LIST. 297 "Detect a coding system of the text between FROM and TO with PRIORITY-LIST.
331PRIORITY-LIST is an alist of coding categories vs the corresponding 298PRIORITY-LIST is an alist of coding categories vs the corresponding
332coding systems ordered by priority." 299coding systems ordered by priority."
300 (declare (obsolete with-coding-priority "23.1"))
333 `(with-coding-priority (mapcar #'cdr ,priority-list) 301 `(with-coding-priority (mapcar #'cdr ,priority-list)
334 (detect-coding-region ,from ,to))) 302 (detect-coding-region ,from ,to)))
335(make-obsolete 'detect-coding-with-priority
336 "use `with-coding-priority' and `detect-coding-region'." "23.1")
337 303
338;;;###autoload 304;;;###autoload
339(defun detect-coding-with-language-environment (from to lang-env) 305(defun detect-coding-with-language-environment (from to lang-env)
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 4d567a6e9d8..e6e3f045a9e 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -409,13 +409,13 @@ PLIST (property list) may contain any type of information a user
409 409
410(defun charset-id (charset) 410(defun charset-id (charset)
411 "Always return 0. This is provided for backward compatibility." 411 "Always return 0. This is provided for backward compatibility."
412 (declare (obsolete nil "23.1"))
412 0) 413 0)
413(make-obsolete 'charset-id "do not use it." "23.1")
414 414
415(defmacro charset-bytes (charset) 415(defmacro charset-bytes (charset)
416 "Always return 0. This is provided for backward compatibility." 416 "Always return 0. This is provided for backward compatibility."
417 (declare (obsolete nil "23.1"))
417 0) 418 0)
418(make-obsolete 'charset-bytes "do not use it." "23.1")
419 419
420(defun get-charset-property (charset propname) 420(defun get-charset-property (charset propname)
421 "Return the value of CHARSET's PROPNAME property. 421 "Return the value of CHARSET's PROPNAME property.
@@ -464,8 +464,8 @@ Return -1 if charset isn't an ISO 2022 one."
464 464
465(defun charset-list () 465(defun charset-list ()
466 "Return list of all charsets ever defined." 466 "Return list of all charsets ever defined."
467 (declare (obsolete charset-list "23.1"))
467 charset-list) 468 charset-list)
468(make-obsolete 'charset-list "use variable `charset-list'." "23.1")
469 469
470 470
471;;; CHARACTER 471;;; CHARACTER
@@ -473,8 +473,8 @@ Return -1 if charset isn't an ISO 2022 one."
473 473
474(defun generic-char-p (char) 474(defun generic-char-p (char)
475 "Always return nil. This is provided for backward compatibility." 475 "Always return nil. This is provided for backward compatibility."
476 (declare (obsolete nil "23.1"))
476 nil) 477 nil)
477(make-obsolete 'generic-char-p "generic characters no longer exist." "23.1")
478 478
479(defun make-char-internal (charset-id &optional code1 code2) 479(defun make-char-internal (charset-id &optional code1 code2)
480 (let ((charset (aref emacs-mule-charset-table charset-id))) 480 (let ((charset (aref emacs-mule-charset-table charset-id)))
@@ -1012,6 +1012,7 @@ Value is a list of transformed arguments."
1012 eol-type) 1012 eol-type)
1013 "Define a new coding system CODING-SYSTEM (symbol). 1013 "Define a new coding system CODING-SYSTEM (symbol).
1014This function is provided for backward compatibility." 1014This function is provided for backward compatibility."
1015 (declare (obsolete define-coding-system "23.1"))
1015 ;; For compatibility with XEmacs, we check the type of TYPE. If it 1016 ;; For compatibility with XEmacs, we check the type of TYPE. If it
1016 ;; is a symbol, perhaps, this function is called with XEmacs-style 1017 ;; is a symbol, perhaps, this function is called with XEmacs-style
1017 ;; arguments. Here, try to transform that kind of arguments to 1018 ;; arguments. Here, try to transform that kind of arguments to
@@ -1104,8 +1105,6 @@ This function is provided for backward compatibility."
1104 1105
1105 (apply 'define-coding-system coding-system doc-string properties)) 1106 (apply 'define-coding-system coding-system doc-string properties))
1106 1107
1107(make-obsolete 'make-coding-system 'define-coding-system "23.1")
1108
1109(defun merge-coding-systems (first second) 1108(defun merge-coding-systems (first second)
1110 "Fill in any unspecified aspects of coding system FIRST from SECOND. 1109 "Fill in any unspecified aspects of coding system FIRST from SECOND.
1111Return the resulting coding system." 1110Return the resulting coding system."
@@ -1449,9 +1448,9 @@ This setting is effective for the next communication only."
1449ARG is a list of coding categories ordered by priority. 1448ARG is a list of coding categories ordered by priority.
1450 1449
1451This function is provided for backward compatibility." 1450This function is provided for backward compatibility."
1451 (declare (obsolete set-coding-system-priority "23.1"))
1452 (apply 'set-coding-system-priority 1452 (apply 'set-coding-system-priority
1453 (mapcar #'(lambda (x) (symbol-value x)) arg))) 1453 (mapcar #'(lambda (x) (symbol-value x)) arg)))
1454(make-obsolete 'set-coding-priority 'set-coding-system-priority "23.1")
1455 1454
1456;;; X selections 1455;;; X selections
1457 1456
@@ -2356,9 +2355,6 @@ Analogous to `define-translation-table', but updates
2356(setq ignore-relative-composition 2355(setq ignore-relative-composition
2357 (make-char-table 'ignore-relative-composition)) 2356 (make-char-table 'ignore-relative-composition))
2358 2357
2359(make-obsolete 'set-char-table-default
2360 "generic characters no longer exist." "23.1")
2361
2362;;; Built-in auto-coding-functions: 2358;;; Built-in auto-coding-functions:
2363 2359
2364(defun sgml-xml-auto-coding-function (size) 2360(defun sgml-xml-auto-coding-function (size)
diff --git a/lisp/international/uni-bidi.el b/lisp/international/uni-bidi.el
index 0dfabdd65da..ba1bd436b23 100644
--- a/lisp/international/uni-bidi.el
+++ b/lisp/international/uni-bidi.el
@@ -5,7 +5,7 @@
5(define-char-code-property 'bidi-class #^[1 nil char-code-property-table 5(define-char-code-property 'bidi-class #^[1 nil char-code-property-table
6#^^[3 0 5 5 5 5 5 5 5 5 5 17 6 17 18 6 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 17 18 19 19 14 14 14 19 19 19 19 19 13 15 13 15 15 3 3 3 3 3 3 3 3 3 3 15 19 19 19 19 19 19 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 19 19 19 19 19 19 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 19 19 19 19 5] #^^[1 0 #^^[2 0 6#^^[3 0 5 5 5 5 5 5 5 5 5 17 6 17 18 6 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 17 18 19 19 14 14 14 19 19 19 19 19 13 15 13 15 15 3 3 3 3 3 3 3 3 3 3 15 19 19 19 19 19 19 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 19 19 19 19 19 19 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 19 19 19 19 5] #^^[1 0 #^^[2 0
7#^^[3 0 5 5 5 5 5 5 5 5 5 17 6 17 18 6 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 17 18 19 19 14 14 14 19 19 19 19 19 13 15 13 15 15 3 3 3 3 3 3 3 3 3 3 15 19 19 19 19 19 19 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 19 19 19 19 19 19 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 19 19 19 19 5] "…š„„ƒ…—Ÿˆ" 1 1 1 "¹‡ŽŽ…‰‘" "ð„ˆ" "„î‰" 1 "ƒ‡ö" 1 "Š„­¸" "…‹°•Šƒ" "Ö‡†„І" "Žž›³" "¦‹Ž«‰„†" "–„‰ƒ…«ƒ¤" " ‹·›" "ƒ·„ˆ„ƒ‡Šœ" "º„„ˆ”އ„" "¹„„ƒƒžƒŠ" "¹„…„”Ž" "º„ˆˆ‹œ" "½Œ¥†…" "¾ƒ…ƒ„‡‹”‡" "¼”œ" "Á„ˆ”œ" "ʇƒ©" "±‡„‡ˆ±" "±†‹†²" "˜›„³Ž" "……‹¤‰¹"] #^^[2 4096 "­„†™„ƒ„‹" "†â" 1 1 1 1 "݃ " "Šæ" "ÿ" 1 1 1 1 "šã" "’ƒƒžŒ" "´‡ˆ‹‡’І" "‹ƒñ" "©Ö" " ƒ„‰†ƒ„ƒº" "Þ¢" "—½‡ˆ†Š" 1 "„°……¨‰Œ" " „ºƒƒŽ" "¬ˆÈ" "Ѓ‡„†‹" 1 "À§•„" 1 1 1 "½ƒ‹ƒƒƒ"] #^^[2 8192 "‹ƒ˜ 7#^^[3 0 5 5 5 5 5 5 5 5 5 17 6 17 18 6 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 17 18 19 19 14 14 14 19 19 19 19 19 13 15 13 15 15 3 3 3 3 3 3 3 3 3 3 15 19 19 19 19 19 19 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 19 19 19 19 19 19 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 19 19 19 19 5] "…š„„ƒ…—Ÿˆ" 1 1 1 "¹‡ŽŽ…‰‘" "ð„ˆ" "„î‰" 1 "ƒ‡ö" 1 "Š„­¸" "…‹°•Šƒ" "Ö‡†„І" "Žž›³" "¦‹Ž«‰„†" "–„‰ƒ…«ƒ¤" " ‹·›" "ƒ·„ˆ„ƒ‡Šœ" "º„„ˆ”އ„" "¹„„ƒƒžƒŠ" "¹„…„”Ž" "º„ˆˆ‹œ" "½Œ¥†…" "¾ƒ…ƒ„‡‹”‡" "¼”œ" "Á„ˆ”œ" "ʇƒ©" "±‡„‡ˆ±" "±†‹†²" "˜›„³Ž" "……‹¤‰¹"] #^^[2 4096 "­„†™„ƒ„‹" "†â" 1 1 1 1 "݃ " "Šæ" "ÿ" 1 1 1 1 "šã" "’ƒƒžŒ" "´‡ˆ‹‡’І" "‹ƒñ" "©Ö" " ƒ„‰†ƒ„ƒº" "Þ¢" "—½‡ˆ†Š" 1 "„°……¨‰Œ" " „ºƒƒŽ" "¬ˆÈ" "Ѓ‡„†‹" 1 "À§•„" 1 1 1 "½ƒ‹ƒƒƒ"] #^^[2 8192 "‹ƒ˜
8 …š……†ƒ† ƒ" "Š ƒ‘š–¡" "„Šƒ…†„‹„……„ " "‰†ð" "’ ì" 19 "¶Å…" "•ÞŒ" "§™‹• " "ˆ”Ζ" 19 19 19 "¬Ó" "ÿ" 19 1 1 19 19 19 19 "ÍƒŠ¦" 1 1 "冄ƒ‡‡" "ÿ" "à " "¼Ä" "šÙŒ" 19 "ÖšŒ„"] #^^[2 12288 "„ƒ™‰„……ƒÀ" "™ƒÚ„" 1 "À¤œ" "±œƒ" "±Œ„°" "÷„…" "ÞŸ" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 16384 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "ÀÀ" 1 1 1 1] 1 1 1 1 #^^[2 36864 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 …š……†ƒ† ƒ" "Š ƒ‘›•¡" "„Šƒ…†„‹„……„ " "‰†ð" "’ ì" 19 "¶Å…" "•ÞŒ" "§™‹• " "ˆ”Ζ" 19 19 19 "¬Ó" "ÿ" 19 1 1 19 19 19 19 "ÍƒŠ¦" 1 1 "冄ƒ‡‡" "ÿ" "à " "¼Ä" "šÙŒ" 19 "ÖšŒ„"] #^^[2 12288 "„ƒ™‰„……ƒÀ" "™ƒÚ„" 1 "À¤œ" "±œƒ" "±Œ„°" "÷„…" "ÞŸ" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 16384 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "ÀÀ" 1 1 1 1] 1 1 1 1 #^^[2 36864 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
9#^^[3 40832 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]] #^^[2 40960 1 1 1 1 1 1 1 1 1 "·¹" 1 1 "ƒß„Š" "ŸÐŽ" "¢Þ" "ˆ÷" "ƒ„™„Œº„ˆ" "Ä›’Ž" "¦ˆ™‹®" "ƒ°„Ã" "©†Œˆ³" "°ƒ…ªˆ‰" 1 "å„’" 1 1 1 1 1 1 1 1] 1 1 #^^[2 53248 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 #^^[2 61440 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "Š ¦°" 7 7 7 "¾À" "ý" "Š†‡‰ ‰ ƒ„" "ÿ" "ƒ…  Š†š†š‹š" "àƒ‡Š…"]] #^^[1 65536 #^^[2 65536 1 1 "¾À" "‹…Œá" 1 1 1 1 1 1 1 1 1 1 1 1 2 2 "Ÿà" 2 "ƒ…„¨ƒ„À" 2 "¹‡À" 2 2 2 2 2 "àŸ" 2 2 2] #^^[2 69632 "¶‹”š" "±„Å" "ƒ¤…ˆË" "´‰Á" 1 1 1 1 1 1 1 1 1 "«†È" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 73728 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 77824 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 #^^[2 90112 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "„í"] 1 1 1 1 #^^[2 110592 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 #^^[2 118784 1 1 "烉ˆ…" "ƒ‡ž„Ò" "ƒº" 1 "ש" 1 1 1 1 1 1 "Û¤" "•¹°" "‰¹Š²" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 122880 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 "„›Š„†„ƒ„‡„„" "Š‘…ƒ…‘´Ž" 2 2] #^^[2 126976 "¬„Ð" "”ŒŽ " "‹ß”" 1 1 1 "¡†Æƒ" "”Œ¥…•‘" "¿¾" "ø„ƒ" "¾„Œ˜˜" "û…" "Á„‹°" "ƺ" "ôŒ" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]] #^^[1 131072 1 1 1 1 1 1 1 1 1 1 #^^[2 172032 1 1 1 1 1 1 1 1 1 1 1 1 1 9#^^[3 40832 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]] #^^[2 40960 1 1 1 1 1 1 1 1 1 "·¹" 1 1 "ƒß„Š" "ŸÐŽ" "¢Þ" "ˆ÷" "ƒ„™„Œº„ˆ" "Ä›’Ž" "¦ˆ™‹®" "ƒ°„Ã" "©†Œˆ³" "°ƒ…ªˆ‰" 1 "å„’" 1 1 1 1 1 1 1 1] 1 1 #^^[2 53248 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 #^^[2 61440 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "Š ¦°" 7 7 7 "¾À" "ý" "Š†‡‰ ‰ ƒ„" "ÿ" "ƒ…  Š†š†š‹š" "àƒ‡Š…"]] #^^[1 65536 #^^[2 65536 1 1 "¾À" "‹…Œá" 1 1 1 1 1 1 1 1 1 1 1 1 2 2 "Ÿà" 2 "ƒ…„¨ƒ„À" 2 "¹‡À" 2 2 2 2 2 "àŸ" 2 2 2] #^^[2 69632 "¶‹”š" "±„Å" "ƒ¤…ˆË" "´‰Á" 1 1 1 1 1 1 1 1 1 "«†È" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 73728 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 77824 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 #^^[2 90112 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 "„í"] 1 1 1 1 #^^[2 110592 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 #^^[2 118784 1 1 "烉ˆ…" "ƒ‡ž„Ò" "ƒº" 1 "ש" 1 1 1 1 1 1 "Û¤" "•¹°" "‰¹Š²" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 122880 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 "„›Š„†„ƒ„‡„„" "Š‘…ƒ…‘´Ž" 2 2] #^^[2 126976 "¬„Ð" "”ŒŽ " "‹ß”" 1 1 1 "¡†Æƒ" "”Œ¥…•‘" "¿¾" "ø„ƒ" "¾„Œ˜˜" "û…" "Á„‹°" "ƺ" "ôŒ" 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]] #^^[1 131072 1 1 1 1 1 1 1 1 1 1 #^^[2 172032 1 1 1 1 1 1 1 1 1 1 1 1 1
10#^^[3 173696 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 176128 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10#^^[3 173696 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] #^^[2 176128 1 1 1 1 1 1 1 1 1 1 1 1 1 1
11#^^[3 177920 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1 11#^^[3 177920 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1] 1
diff --git a/lisp/international/uni-category.el b/lisp/international/uni-category.el
index f0ccde477cc..75ebc04c98f 100644
--- a/lisp/international/uni-category.el
+++ b/lisp/international/uni-category.el
@@ -5,7 +5,7 @@
5(define-char-code-property 'general-category #^[30 nil char-code-property-table 5(define-char-code-property 'general-category #^[30 nil char-code-property-table
6#^^[3 0 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 23 18 18 18 20 18 18 18 14 15 18 19 18 13 18 18 9 9 9 9 9 9 9 9 9 9 18 18 19 19 19 18 18 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 14 18 15 21 12 21 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 14 19 15 19 26] #^^[1 0 #^^[2 0 6#^^[3 0 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 23 18 18 18 20 18 18 18 14 15 18 19 18 13 18 18 9 9 9 9 9 9 9 9 9 9 18 18 19 19 19 18 18 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 14 18 15 21 12 21 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 14 19 15 19 26] #^^[1 0 #^^[2 0
7#^^[3 0 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 23 18 18 18 20 18 18 18 14 15 18 19 18 13 18 18 9 9 9 9 9 9 9 9 9 9 18 18 19 19 19 18 18 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 14 18 15 21 12 21 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 14 19 15 19 26] " „   ƒ—‡˜ˆ" "" "ƒ„ƒƒƒƒ„ƒ" "‡„±" "”›’„ŒŽ…‡‘" "ðƒ" "„ƒ‘‰£ƒƒ…ƒ" "°°" "…" "‰¦†Ÿ" "ˆ „­ ˆ›…ƒ‹" "…ƒ‹ Š• Š„" "Ô‡†„ Šƒ" "Žž›³" "¦‹Ž Š¡‰ƒ…" "–„‰ƒ…™ƒ¡" " ‹·›" "ƒ¶ƒˆ„‡Š І‡" "ˆ–‡ƒ„ƒ„ˆ„ƒ Š †„" "†„–‡ƒ„ƒƒ‡„‡ ŠƒŠ" "‰ƒ–‡…ƒ… ŠŽ" "ˆ–‡…„ˆ„ƒ Š †ˆ" "†ƒƒ„ƒƒƒƒƒŒ„ƒƒƒ†Ž Š ƒ†…" "ƒˆƒ—Š…ƒƒ„ƒ„‡† Šˆ ‡" "ˆƒ—Š……‡‡ Š" "ˆƒ©ƒ„ƒƒˆˆ Š †ƒ†" "’ƒ˜‰‡ƒ„ƒƒˆ’‹" "°‡„†ˆ Ф" "†„‡ƒ„†…† Š„ " "ƒƒ† Š Šˆ¤„Ž" "……‹¤ˆ†…„¥"] #^^[2 4096 "«„† І†„ƒƒ‡ƒ„‹" "† Šƒ¦…«ƒ" 5 5 "É„‡„ " "‰„¡„‡„¨" "‘„É ”ƒ" "Š†Õ‹" " ÿ" 5 5 5 "í‘" "šƒËƒ 7#^^[3 0 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 26 23 18 18 18 20 18 18 18 14 15 18 19 18 13 18 18 9 9 9 9 9 9 9 9 9 9 18 18 19 19 19 18 18 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 14 18 15 21 12 21 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 14 19 15 19 26] " „   ƒ—‡˜ˆ" "" "ƒ„ƒƒƒƒ„ƒ" "‡„±" "”›’„ŒŽ…‡‘" "ðƒ" "„ƒ‘‰£ƒƒ…ƒ" "°°" "…" "‰¦†Ÿ" "ˆ „­ ˆ›…ƒ‹" "…ƒ‹ Š• Š„" "Ô‡†„ Šƒ" "Žž›³" "¦‹Ž Š¡‰ƒ…" "–„‰ƒ…™ƒ¡" " ‹·›" "ƒ¶ƒˆ„‡Š І‡" "ˆ–‡ƒ„ƒ„ˆ„ƒ Š †„" "†„–‡ƒ„ƒƒ‡„‡ ŠƒŠ" "‰ƒ–‡…ƒ… ŠŽ" "ˆ–‡…„ˆ„ƒ Š †ˆ" "†ƒƒ„ƒƒƒƒƒŒ„ƒƒƒ†Ž Š ƒ†…" "ƒˆƒ—Š…ƒƒ„ƒ„‡† Šˆ ‡" "ˆƒ—Š……‡‡ Š" "ˆƒ©ƒ„ƒƒˆˆ Š †ƒ†" "’ƒ˜‰‡ƒ„ƒƒˆ’‹" "°‡„†ˆ Ф" "†„‡ƒ„†…† Š„ " "ƒƒ† Š Šˆ¤„Ž" "……‹¤ˆ†…„¥"] #^^[2 4096 "«„† І†„ƒƒ‡ƒ„‹" "† Šƒ¦…«ƒ" 5 5 "É„‡„ " "‰„¡„‡„¨" "‘„É ”ƒ" "Š†Õ‹" " ÿ" 5 5 5 "í‘" "šƒËƒ
8ƒ" "„ƒ‹’ƒ‰’ŒƒŒ" "´‡ˆ‹ƒƒ І І" "† „ƒ І£´ˆ" "©…ÆŠ" "ƒƒ„ƒ„†ƒ„ƒ Šž…‹" "¬„‘‡† Š ƒ¢" "—ƒµ‡ˆ†Š" " І І‡†Ò" "„¯……‡„ ЇЉ‰ƒ" "ž„ Ьƒƒˆ„" "¤ˆˆƒ… Šƒƒ Šž†" "Àˆˆƒ‡„„‰" "¬¿‡" "›¥§•„" "" "‰" "ˆˆ††ˆˆˆˆ††ˆˆˆŽ" "ˆˆˆˆˆˆ…„ƒƒ„ƒ„„ƒˆ…ƒƒ„"] #^^[2 8192 "‹… †ˆ…‰„ ƒ‹ Š……†  †ƒ" " Šƒƒš–„ƒŒ" "„ƒƒ…†„„„…„  8ƒ" "„ƒ‹’ƒ‰’ŒƒŒ" "´‡ˆ‹ƒƒ І І" "† „ƒ І£´ˆ" "©…ÆŠ" "ƒƒ„ƒ„†ƒ„ƒ Šž…‹" "¬„‘‡† Š ƒ¢" "—ƒµ‡ˆ†Š" " І І‡†Ò" "„¯……‡„ ЇЉ‰ƒ" "ž„ Ьƒƒˆ„" "¤ˆˆƒ… Šƒƒ Šž†" "Àˆˆƒ‡„„‰" "¬¿‡" "›¥§•„" "" "‰" "ˆˆ††ˆˆˆˆ††ˆˆˆŽ" "ˆˆˆˆˆˆ…„ƒƒ„ƒ„„ƒˆ…ƒƒ„"] #^^[2 8192 "‹… †ˆ…‰„ ƒ‹ Š……†  †ƒ" " Šƒƒ›•„ƒŒ" "„ƒƒ…†„„„…„ 
9 " " 9 " "
10ƒ 10ƒ
11„ †……„‡ŸŸŒ" 19 19 "ˆ„”‡Ñƒ" "›™¨†’Œ" "§™‹•  " " œÎ –" 22 "·‰¶ˆ" "ï" 22 "ç Š" " ”¬…Ÿ" 22 22 19 "ƒ¿ " 19 19 "°•†ƒŠ¦" 30 "¯¯ƒ„†" "†ƒ…„ " "¦…¸‡Ž" "—‰‡‡‡‡‡‡‡‡ " "ƒ‰  …Š Ä" "šÙŒ" 22 "ÖšŒ„"] #^^[2 12288 "ƒ 11„ †……„‡ŸŸŒ" 19 19 "ˆ„”‡Ñƒ" "›™¨†’Œ" "§™‹•  " " œÎ –" 22 "·‰¶ˆ" "ï" 22 "ç Š" " ”¬…Ÿ" 22 22 19 "ƒ¿ " 19 19 "°•†ƒŠ¦" 30 "¯¯ƒ„†" "†ƒ…„ " "¦…¸‡Ž" "—‰‡‡‡‡‡‡‡‡ " "ƒ‰  …Š Ä" "šÙŒ" 22 "ÖšŒ„"] #^^[2 12288 "ƒ
diff --git a/lisp/international/uni-name.el b/lisp/international/uni-name.el
index 458957ef366..cf37db39b48 100644
--- a/lisp/international/uni-name.el
+++ b/lisp/international/uni-name.el
Binary files differ
diff --git a/lisp/international/uni-numeric.el b/lisp/international/uni-numeric.el
index 9f0d3079259..7c0be5b438a 100644
--- a/lisp/international/uni-numeric.el
+++ b/lisp/international/uni-numeric.el
Binary files differ
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el
index 624c3500939..13ab41cf83a 100644
--- a/lisp/iswitchb.el
+++ b/lisp/iswitchb.el
@@ -527,33 +527,6 @@ selected.")
527 527
528;;; FUNCTIONS 528;;; FUNCTIONS
529 529
530;;; ISWITCHB KEYMAP
531(defun iswitchb-define-mode-map ()
532 "Set up the keymap for `iswitchb-buffer'."
533 (interactive)
534 (let (map)
535 ;; generated every time so that it can inherit new functions.
536 ;;(or iswitchb-mode-map
537
538 (setq map (copy-keymap minibuffer-local-map))
539 (define-key map "?" 'iswitchb-completion-help)
540 (define-key map "\C-s" 'iswitchb-next-match)
541 (define-key map "\C-r" 'iswitchb-prev-match)
542 (define-key map "\t" 'iswitchb-complete)
543 (define-key map "\C-j" 'iswitchb-select-buffer-text)
544 (define-key map "\C-t" 'iswitchb-toggle-regexp)
545 (define-key map "\C-x\C-f" 'iswitchb-find-file)
546 (define-key map "\C-n" 'iswitchb-toggle-ignore)
547 (define-key map "\C-c" 'iswitchb-toggle-case)
548 (define-key map "\C-k" 'iswitchb-kill-buffer)
549 (define-key map "\C-m" 'iswitchb-exit-minibuffer)
550 (setq iswitchb-mode-map map)
551 (run-hooks 'iswitchb-define-mode-map-hook)))
552
553(make-obsolete 'iswitchb-define-mode-map
554 "use M-x iswitchb-mode or customize the variable `iswitchb-mode'."
555 "21.1")
556
557;;; MAIN FUNCTION 530;;; MAIN FUNCTION
558(defun iswitchb () 531(defun iswitchb ()
559 "Switch to buffer matching a substring. 532 "Switch to buffer matching a substring.
@@ -619,14 +592,25 @@ If START is a string, the selection process is started with that
619string. 592string.
620If MATCHES-SET is non-nil, the buflist is not updated before 593If MATCHES-SET is non-nil, the buflist is not updated before
621the selection process begins. Used by isearchb.el." 594the selection process begins. Used by isearchb.el."
622 (let 595 ;; The map is generated every time so that it can inherit new
623 ( 596 ;; functions.
624 buf-sel 597 (let ((map (copy-keymap minibuffer-local-map))
625 iswitchb-final-text 598 buf-sel iswitchb-final-text map
626 (icomplete-mode nil) ;; prevent icomplete starting up 599 icomplete-mode) ; prevent icomplete starting up
627 ) 600 (define-key map "?" 'iswitchb-completion-help)
628 601 (define-key map "\C-s" 'iswitchb-next-match)
629 (iswitchb-define-mode-map) 602 (define-key map "\C-r" 'iswitchb-prev-match)
603 (define-key map "\t" 'iswitchb-complete)
604 (define-key map "\C-j" 'iswitchb-select-buffer-text)
605 (define-key map "\C-t" 'iswitchb-toggle-regexp)
606 (define-key map "\C-x\C-f" 'iswitchb-find-file)
607 (define-key map "\C-n" 'iswitchb-toggle-ignore)
608 (define-key map "\C-c" 'iswitchb-toggle-case)
609 (define-key map "\C-k" 'iswitchb-kill-buffer)
610 (define-key map "\C-m" 'iswitchb-exit-minibuffer)
611 (setq iswitchb-mode-map map)
612 (run-hooks 'iswitchb-define-mode-map-hook)
613
630 (setq iswitchb-exit nil) 614 (setq iswitchb-exit nil)
631 (setq iswitchb-default 615 (setq iswitchb-default
632 (if (bufferp default) 616 (if (bufferp default)
diff --git a/lisp/json.el b/lisp/json.el
index f1ee3a52032..8167bfe93f2 100644
--- a/lisp/json.el
+++ b/lisp/json.el
@@ -311,13 +311,13 @@ representation will be parsed correctly."
311 (setq char (json-encode-char0 char 'ucs)) 311 (setq char (json-encode-char0 char 'ucs))
312 (let ((control-char (car (rassoc char json-special-chars)))) 312 (let ((control-char (car (rassoc char json-special-chars))))
313 (cond 313 (cond
314 ;; Special JSON character (\n, \r, etc.) 314 ;; Special JSON character (\n, \r, etc.).
315 (control-char 315 (control-char
316 (format "\\%c" control-char)) 316 (format "\\%c" control-char))
317 ;; ASCIIish printable character 317 ;; ASCIIish printable character.
318 ((and (> char 31) (< char 161)) 318 ((and (> char 31) (< char 127))
319 (format "%c" char)) 319 (format "%c" char))
320 ;; Fallback: UCS code point in \uNNNN form 320 ;; Fallback: UCS code point in \uNNNN form.
321 (t 321 (t
322 (format "\\u%04x" char))))) 322 (format "\\u%04x" char)))))
323 323
diff --git a/lisp/linum.el b/lisp/linum.el
index 162dc19f437..3c278dbbf3b 100644
--- a/lisp/linum.el
+++ b/lisp/linum.el
@@ -44,7 +44,6 @@
44 "Show line numbers in the left margin." 44 "Show line numbers in the left margin."
45 :group 'convenience) 45 :group 'convenience)
46 46
47;;;###autoload
48(defcustom linum-format 'dynamic 47(defcustom linum-format 'dynamic
49 "Format used to display line numbers. 48 "Format used to display line numbers.
50Either a format string like \"%7d\", `dynamic' to adapt the width 49Either a format string like \"%7d\", `dynamic' to adapt the width
@@ -52,7 +51,9 @@ as needed, or a function that is called with a line number as its
52argument and should evaluate to a string to be shown on that line. 51argument and should evaluate to a string to be shown on that line.
53See also `linum-before-numbering-hook'." 52See also `linum-before-numbering-hook'."
54 :group 'linum 53 :group 'linum
55 :type 'sexp) 54 :type '(choice (string :tag "Format string")
55 (const :tag "Dynamic width" dynamic)
56 (function :tag "Function")))
56 57
57(defface linum 58(defface linum
58 '((t :inherit (shadow default))) 59 '((t :inherit (shadow default)))
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index ca9bc6b8676..0066847e995 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -248,6 +248,13 @@ usually do not have translators for other languages.\n\n")))
248 "', version " 248 "', version "
249 (mapconcat 'number-to-string (x-server-version) ".") "\n") 249 (mapconcat 'number-to-string (x-server-version) ".") "\n")
250 (error t))) 250 (error t)))
251 (let ((lsb (with-temp-buffer
252 (if (eq 0 (ignore-errors
253 (call-process "lsb_release" nil '(t nil)
254 nil "-d")))
255 (buffer-string)))))
256 (if (stringp lsb)
257 (insert "System " lsb "\n")))
251 (when (and system-configuration-options 258 (when (and system-configuration-options
252 (not (equal system-configuration-options ""))) 259 (not (equal system-configuration-options "")))
253 (insert "Configured using:\n `configure " 260 (insert "Configured using:\n `configure "
diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el
index 0b55fe42e42..c7943fe40c8 100644
--- a/lisp/mail/mailalias.el
+++ b/lisp/mail/mailalias.el
@@ -427,6 +427,7 @@ For use on `completion-at-point-functions'."
427 "Perform completion on header field or word preceding point. 427 "Perform completion on header field or word preceding point.
428Completable headers are according to `mail-complete-alist'. If none matches 428Completable headers are according to `mail-complete-alist'. If none matches
429current header, calls `mail-complete-function' and passes prefix ARG if any." 429current header, calls `mail-complete-function' and passes prefix ARG if any."
430 (declare (obsolete mail-completion-at-point-function "24.1"))
430 (interactive "P") 431 (interactive "P")
431 ;; Read the defaults first, if we have not done so. 432 ;; Read the defaults first, if we have not done so.
432 (sendmail-sync-aliases) 433 (sendmail-sync-aliases)
@@ -439,7 +440,6 @@ current header, calls `mail-complete-function' and passes prefix ARG if any."
439 (if data 440 (if data
440 (apply #'completion-in-region data) 441 (apply #'completion-in-region data)
441 (funcall mail-complete-function arg)))) 442 (funcall mail-complete-function arg))))
442(make-obsolete 'mail-complete 'mail-completion-at-point-function "24.1")
443 443
444(defun mail-completion-expand (table) 444(defun mail-completion-expand (table)
445 "Build new completion table that expands aliases. 445 "Build new completion table that expands aliases.
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index b75841489c9..331754fb1b5 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1414,6 +1414,7 @@ just append to the file, in Babyl format if necessary."
1414 1414
1415(defun mail-sent-via () 1415(defun mail-sent-via ()
1416 "Make a Sent-via header line from each To or CC header line." 1416 "Make a Sent-via header line from each To or CC header line."
1417 (declare (obsolete "nobody can remember what it is for." "24.1"))
1417 (interactive) 1418 (interactive)
1418 (save-excursion 1419 (save-excursion
1419 ;; put a marker at the end of the header 1420 ;; put a marker at the end of the header
@@ -1433,9 +1434,6 @@ just append to the file, in Babyl format if necessary."
1433 (point))))) 1434 (point)))))
1434 ;; Insert a copy, with altered header field name. 1435 ;; Insert a copy, with altered header field name.
1435 (insert-before-markers "Sent-via:" to-line)))))) 1436 (insert-before-markers "Sent-via:" to-line))))))
1436
1437(make-obsolete 'mail-sent-via "nobody can remember what it is for." "24.1")
1438
1439 1437
1440(defun mail-to () 1438(defun mail-to ()
1441 "Move point to end of To field, creating it if necessary." 1439 "Move point to end of To field, creating it if necessary."
diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el
index d10b073eb12..99e5df82bef 100644
--- a/lisp/mail/supercite.el
+++ b/lisp/mail/supercite.el
@@ -506,8 +506,6 @@ string."
506;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 506;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
507;; end user configuration variables 507;; end user configuration variables
508 508
509(define-obsolete-variable-alias 'sc-version 'emacs-version "23.1")
510
511(defvar sc-mail-info nil 509(defvar sc-mail-info nil
512 "Alist of mail header information gleaned from reply buffer.") 510 "Alist of mail header information gleaned from reply buffer.")
513(defvar sc-attributions nil 511(defvar sc-attributions nil
@@ -559,10 +557,8 @@ string."
559 (define-key map "r" 'sc-recite-region) 557 (define-key map "r" 'sc-recite-region)
560 (define-key map "\C-p" 'sc-raw-mode-toggle) 558 (define-key map "\C-p" 'sc-raw-mode-toggle)
561 (define-key map "u" 'sc-uncite-region) 559 (define-key map "u" 'sc-uncite-region)
562 (define-key map "v" 'sc-version)
563 (define-key map "w" 'sc-insert-reference) 560 (define-key map "w" 'sc-insert-reference)
564 (define-key map "\C-t" sc-T-keymap) 561 (define-key map "\C-t" sc-T-keymap)
565 (define-key map "\C-b" 'sc-submit-bug-report)
566 (define-key map "?" 'sc-describe) 562 (define-key map "?" 'sc-describe)
567 map) 563 map)
568 "Keymap for Supercite quasi-mode.") 564 "Keymap for Supercite quasi-mode.")
@@ -1969,29 +1965,11 @@ cited."
1969 (insert (sc-mail-field "sc-citation")) 1965 (insert (sc-mail-field "sc-citation"))
1970 (error "Line is already cited")))) 1966 (error "Line is already cited"))))
1971 1967
1972;; The argument logic here is crazy.
1973(defun sc-version (message)
1974 "Return the current Supercite version.
1975If MESSAGE is non-nil (interactively, with no prefix argument),
1976echoes the version in the minibuffer. Otherwise, inserts the
1977version at point."
1978 (interactive (list (not current-prefix-arg)))
1979 (let ((verstr (format "Using Supercite.el %s" emacs-version)))
1980 (if message
1981 (message verstr)
1982 (insert "`sc-version' says: " verstr))))
1983
1984(make-obsolete 'sc-version 'emacs-version "23.1")
1985
1986(defun sc-describe () 1968(defun sc-describe ()
1987 "Read the Supercite info node." 1969 "Read the Supercite info node."
1988 (interactive) 1970 (interactive)
1989 (info "(SC)top")) 1971 (info "(SC)top"))
1990 1972
1991(make-obsolete 'sc-describe "read the SC manual using `info'." "23.1")
1992
1993(define-obsolete-function-alias 'sc-submit-bug-report 'report-emacs-bug "23.1")
1994
1995 1973
1996;; useful stuff 1974;; useful stuff
1997(provide 'supercite) 1975(provide 'supercite)
diff --git a/lisp/mh-e/ChangeLog.1 b/lisp/mh-e/ChangeLog.1
index 15b7380b737..eb60392c32c 100644
--- a/lisp/mh-e/ChangeLog.1
+++ b/lisp/mh-e/ChangeLog.1
@@ -10930,7 +10930,7 @@
10930 10930
10931 * mh-utils.el (mh-prompt-for-folder): Exit with error if no folder 10931 * mh-utils.el (mh-prompt-for-folder): Exit with error if no folder
10932 specified, otherwise mh-refile-msg may try to create a folder with 10932 specified, otherwise mh-refile-msg may try to create a folder with
10933 empty name, and this creates problems; even mh-undo can't handle 10933 empty name, and this creates problems; even mh-undo can't handle
10934 it (Closes SF #476824). 10934 it (Closes SF #476824).
10935 10935
10936 * mh-comp.el (mh-letter-tool-bar-map): Info button needed to 10936 * mh-comp.el (mh-letter-tool-bar-map): Info button needed to
diff --git a/lisp/minibuf-eldef.el b/lisp/minibuf-eldef.el
index 4387fc625c6..92d5ec821b0 100644
--- a/lisp/minibuf-eldef.el
+++ b/lisp/minibuf-eldef.el
@@ -1,4 +1,4 @@
1;;; minibuf-eldef.el --- Only show defaults in prompts when applicable 1;;; minibuf-eldef.el --- Only show defaults in prompts when applicable -*- lexical-binding: t -*-
2;; 2;;
3;; Copyright (C) 2000-2012 Free Software Foundation, Inc. 3;; Copyright (C) 2000-2012 Free Software Foundation, Inc.
4;; 4;;
@@ -33,16 +33,22 @@
33 33
34;;; Code: 34;;; Code:
35 35
36(defvar minibuffer-eldef-shorten-default nil
37 "If non-nil, shorten \"(default ...)\" to \"[...]\" in minibuffer prompts.")
38
36(defvar minibuffer-default-in-prompt-regexps 39(defvar minibuffer-default-in-prompt-regexps
37 '(("\\( (default\\>.*)\\):? \\'" . 1) ("\\( \\[.*\\]\\):? *\\'" . 1)) 40 `(("\\( (default\\(?: is\\)? \\(.*\\))\\):? \\'"
41 1 ,(if minibuffer-eldef-shorten-default " [\\2]"))
42 ("\\( \\[.*\\]\\):? *\\'" 1))
38 "A list of regexps matching the parts of minibuffer prompts showing defaults. 43 "A list of regexps matching the parts of minibuffer prompts showing defaults.
39When `minibuffer-electric-default-mode' is active, these regexps are 44When `minibuffer-electric-default-mode' is active, these regexps are
40used to identify the portions of prompts to elide. 45used to identify the portions of prompts to elide.
41 46
42Each entry is either a string, which should be a regexp matching the 47Each entry is of the form (REGEXP MATCH-NUM &optional REWRITE),
43default portion of the prompt, or a cons cell, who's car is a regexp 48where REGEXP should match the default part of the prompt,
44matching the default part of the prompt, and who's cdr indicates the 49MATCH-NUM is the subgroup that matched the actual default indicator,
45regexp subexpression that matched.") 50and REWRITE, if present, is a string to pass to `replace-match' that
51should be displayed in its place.")
46 52
47 53
48;;; Internal variables 54;;; Internal variables
@@ -79,21 +85,42 @@ The prompt and initial input should already have been inserted."
79 (inhibit-point-motion-hooks t)) 85 (inhibit-point-motion-hooks t))
80 (save-excursion 86 (save-excursion
81 (save-restriction 87 (save-restriction
82 ;; Narrow to only the prompt 88 ;; Narrow to only the prompt.
83 (goto-char (point-min)) 89 (goto-char (point-min))
84 (narrow-to-region (point) (minibuffer-prompt-end)) 90 (narrow-to-region (point) (minibuffer-prompt-end))
85 ;; See the prompt contains a default input indicator 91 ;; See if the prompt contains a default input indicator.
86 (while regexps 92 (while regexps
87 (setq match (pop regexps)) 93 (setq match (pop regexps))
88 (if (re-search-forward (if (stringp match) match (car match)) nil t) 94 (cond
89 (setq regexps nil) 95 ((not (re-search-forward (if (stringp match) match (car match))
90 (setq match nil))))) 96 nil t))
97 ;; No match yet, try the next rule.
98 (setq match nil))
99 ((and (consp (cdr-safe match)) (nth 2 match))
100 ;; Matched a replacement rule.
101 (let* ((inhibit-read-only t)
102 (buffer-undo-list t)
103 (submatch (nth 1 match))
104 (replacement (nth 2 match))
105 (props (text-properties-at (match-beginning submatch))))
106 (replace-match replacement nil nil nil submatch)
107 (set-text-properties (match-beginning submatch)
108 (match-end submatch)
109 props)
110 ;; Replacement done, now keep trying with subsequent rules.
111 (setq match nil)
112 (goto-char (point-min))))
113 ;; Matched a non-replacement (i.e. electric hide) rule, no need to
114 ;; keep trying.
115 (t (setq regexps nil))))))
91 (if (not match) 116 (if (not match)
92 ;; Nope, so just make sure our post-command-hook isn't left around. 117 ;; No match for electric hiding, so just make sure our
118 ;; post-command-hook isn't left around.
93 (remove-hook 'post-command-hook #'minibuf-eldef-update-minibuffer t) 119 (remove-hook 'post-command-hook #'minibuf-eldef-update-minibuffer t)
94 ;; Yup; set things up so we can frob the prompt as the state of 120 ;; Yup; set things up so we can frob the prompt as the state of
95 ;; the input string changes. 121 ;; the input string changes.
96 (setq match (if (consp match) (cdr match) 0)) 122 (setq match (if (consp match) (cdr match) 0))
123 (setq match (if (consp match) (car match) match))
97 (setq minibuf-eldef-overlay 124 (setq minibuf-eldef-overlay
98 (make-overlay (match-beginning match) (match-end match))) 125 (make-overlay (match-beginning match) (match-end match)))
99 (setq minibuf-eldef-showing-default-in-prompt t) 126 (setq minibuf-eldef-showing-default-in-prompt t)
@@ -124,10 +151,6 @@ been set up by `minibuf-eldef-setup-minibuffer'."
124 (overlay-put minibuf-eldef-overlay 'intangible t))))) 151 (overlay-put minibuf-eldef-overlay 'intangible t)))))
125 152
126 153
127;;; Note this definition must be at the end of the file, because
128;;; `define-minor-mode' actually calls the mode-function if the
129;;; associated variable is non-nil, which requires that all needed
130;;; functions be already defined. [This is arguably a bug in d-m-m]
131;;;###autoload 154;;;###autoload
132(define-minor-mode minibuffer-electric-default-mode 155(define-minor-mode minibuffer-electric-default-mode
133 "Toggle Minibuffer Electric Default mode. 156 "Toggle Minibuffer Electric Default mode.
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 27c53744d54..cf990019abc 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2332,7 +2332,7 @@ and `read-file-name-function'."
2332 (modify-syntax-entry c "." table)) 2332 (modify-syntax-entry c "." table))
2333 '(?/ ?: ?\\)) 2333 '(?/ ?: ?\\))
2334 table) 2334 table)
2335 "Syntax table to be used in minibuffer for reading file name.") 2335 "Syntax table used when reading a file name in the minibuffer.")
2336 2336
2337;; minibuffer-completing-file-name is a variable used internally in minibuf.c 2337;; minibuffer-completing-file-name is a variable used internally in minibuf.c
2338;; to determine whether to use minibuffer-local-filename-completion-map or 2338;; to determine whether to use minibuffer-local-filename-completion-map or
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 4ea84288f69..74bb97b3086 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -284,23 +284,24 @@ not it is actually displayed."
284(defun mouse-major-mode-menu (event &optional prefix) 284(defun mouse-major-mode-menu (event &optional prefix)
285 "Pop up a mode-specific menu of mouse commands. 285 "Pop up a mode-specific menu of mouse commands.
286Default to the Edit menu if the major mode doesn't define a menu." 286Default to the Edit menu if the major mode doesn't define a menu."
287 (declare (obsolete mouse-menu-major-mode-map "23.1"))
287 (interactive "@e\nP") 288 (interactive "@e\nP")
288 (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) 289 (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
289 (popup-menu (mouse-menu-major-mode-map) event prefix)) 290 (popup-menu (mouse-menu-major-mode-map) event prefix))
290(make-obsolete 'mouse-major-mode-menu 'mouse-menu-major-mode-map "23.1")
291 291
292(defun mouse-popup-menubar (event prefix) 292(defun mouse-popup-menubar (event prefix)
293 "Pop up a menu equivalent to the menu bar for keyboard EVENT with PREFIX. 293 "Pop up a menu equivalent to the menu bar for keyboard EVENT with PREFIX.
294The contents are the items that would be in the menu bar whether or 294The contents are the items that would be in the menu bar whether or
295not it is actually displayed." 295not it is actually displayed."
296 (declare (obsolete mouse-menu-bar-map "23.1"))
296 (interactive "@e \nP") 297 (interactive "@e \nP")
297 (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) 298 (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
298 (popup-menu (mouse-menu-bar-map) (unless (integerp event) event) prefix)) 299 (popup-menu (mouse-menu-bar-map) (unless (integerp event) event) prefix))
299(make-obsolete 'mouse-popup-menubar 'mouse-menu-bar-map "23.1")
300 300
301(defun mouse-popup-menubar-stuff (event prefix) 301(defun mouse-popup-menubar-stuff (event prefix)
302 "Popup a menu like either `mouse-major-mode-menu' or `mouse-popup-menubar'. 302 "Popup a menu like either `mouse-major-mode-menu' or `mouse-popup-menubar'.
303Use the former if the menu bar is showing, otherwise the latter." 303Use the former if the menu bar is showing, otherwise the latter."
304 (declare (obsolete nil "23.1"))
304 (interactive "@e\nP") 305 (interactive "@e\nP")
305 (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) 306 (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
306 (popup-menu 307 (popup-menu
@@ -308,7 +309,6 @@ Use the former if the menu bar is showing, otherwise the latter."
308 (mouse-menu-bar-map) 309 (mouse-menu-bar-map)
309 (mouse-menu-major-mode-map)) 310 (mouse-menu-major-mode-map))
310 event prefix)) 311 event prefix))
311(make-obsolete 'mouse-popup-menubar-stuff nil "23.1")
312 312
313;; Commands that operate on windows. 313;; Commands that operate on windows.
314 314
diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el
index c78249ced0f..bc6fd38f713 100644
--- a/lisp/net/newst-backend.el
+++ b/lisp/net/newst-backend.el
@@ -421,7 +421,7 @@ headline after it has been retrieved for the first time."
421 "Name of the newsticker cache file." 421 "Name of the newsticker cache file."
422 :type 'string 422 :type 'string
423 :group 'newsticker-miscellaneous) 423 :group 'newsticker-miscellaneous)
424(make-obsolete 'newsticker-cache-filename 'newsticker-dir "23.1") 424(make-obsolete-variable 'newsticker-cache-filename 'newsticker-dir "23.1")
425 425
426(defcustom newsticker-dir 426(defcustom newsticker-dir
427 (locate-user-emacs-file "newsticker/" ".newsticker/") 427 (locate-user-emacs-file "newsticker/" ".newsticker/")
diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el
index b44f1f9c86d..fc356a303e2 100644
--- a/lisp/net/newst-treeview.el
+++ b/lisp/net/newst-treeview.el
@@ -128,7 +128,7 @@ Example: (\"Topmost group\" \"feed1\" (\"subgroup1\" \"feed 2\")
128 "Name of the newsticker groups settings file." 128 "Name of the newsticker groups settings file."
129 :type 'string 129 :type 'string
130 :group 'newsticker-treeview) 130 :group 'newsticker-treeview)
131(make-obsolete 'newsticker-groups-filename 'newsticker-dir "23.1") 131(make-obsolete-variable 'newsticker-groups-filename 'newsticker-dir "23.1")
132 132
133;; ====================================================================== 133;; ======================================================================
134;;; internal variables 134;;; internal variables
diff --git a/lisp/net/snmp-mode.el b/lisp/net/snmp-mode.el
index c155d53b6d0..217f9dc8b30 100644
--- a/lisp/net/snmp-mode.el
+++ b/lisp/net/snmp-mode.el
@@ -175,9 +175,9 @@ This is used during Tempo template completion."
175(defvar snmp-font-lock-keywords-3 175(defvar snmp-font-lock-keywords-3
176 (append 176 (append
177 '(("\\([^\n]+\\)[ \t]+::=[ \t]+\\(SEQUENCE\\)[ \t]+{" 177 '(("\\([^\n]+\\)[ \t]+::=[ \t]+\\(SEQUENCE\\)[ \t]+{"
178 (1 font-lock-reference-face) (2 font-lock-keyword-face)) 178 (1 font-lock-constant-face) (2 font-lock-keyword-face))
179 ("::=[ \t]*{[ \t]*\\([a-z0-9].*[ \t]+\\)?\\([0-9]+\\)[ \t]*}" 179 ("::=[ \t]*{[ \t]*\\([a-z0-9].*[ \t]+\\)?\\([0-9]+\\)[ \t]*}"
180 (1 font-lock-reference-face nil t) (2 font-lock-variable-name-face))) 180 (1 font-lock-constant-face nil t) (2 font-lock-variable-name-face)))
181 snmp-font-lock-keywords-2) 181 snmp-font-lock-keywords-2)
182 "Gaudy SNMP MIB mode expression highlighting.") 182 "Gaudy SNMP MIB mode expression highlighting.")
183 183
diff --git a/lisp/org/ob-fortran.el b/lisp/org/ob-fortran.el
index 491dde3e070..fe38edbce1e 100644
--- a/lisp/org/ob-fortran.el
+++ b/lisp/org/ob-fortran.el
@@ -7,20 +7,20 @@
7;; Keywords: literate programming, reproducible research, fortran 7;; Keywords: literate programming, reproducible research, fortran
8;; Homepage: http://orgmode.org 8;; Homepage: http://orgmode.org
9 9
10;; This program is free software; you can redistribute it and/or modify 10;; This file is part of GNU Emacs.
11
12;; 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 13;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation; either version 3, or (at your option) 14;; the Free Software Foundation, either version 3 of the License, or
13;; any later version. 15;; (at your option) any later version.
14;; 16
15;; This program is distributed in the hope that it will be useful, 17;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of 18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details. 20;; GNU General Public License for more details.
19;; 21
20;; You should have received a copy of the GNU General Public License 22;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING. If not, write to the 23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA.
24 24
25;;; Commentary: 25;;; Commentary:
26 26
diff --git a/lisp/password-cache.el b/lisp/password-cache.el
index 9f5c18f3415..83815a6a270 100644
--- a/lisp/password-cache.el
+++ b/lisp/password-cache.el
@@ -102,13 +102,12 @@ Warning: the password is cached without checking that it is
102correct. It is better to check the password before caching. If 102correct. It is better to check the password before caching. If
103you must use this function, take care to check passwords and 103you must use this function, take care to check passwords and
104remove incorrect ones from the cache." 104remove incorrect ones from the cache."
105 (declare (obsolete password-read "23.1"))
105 (let ((password (password-read prompt key))) 106 (let ((password (password-read prompt key)))
106 (when (and password key) 107 (when (and password key)
107 (password-cache-add key password)) 108 (password-cache-add key password))
108 password)) 109 password))
109 110
110(make-obsolete 'password-read-and-add 'password-read "23.1")
111
112(defun password-cache-remove (key) 111(defun password-cache-remove (key)
113 "Remove password indexed by KEY from password cache. 112 "Remove password indexed by KEY from password cache.
114This is typically run by a timer setup from `password-cache-add', 113This is typically run by a timer setup from `password-cache-add',
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index 3f120961486..9e55976a8bd 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -724,6 +724,7 @@ this is `comint-dynamic-complete-functions'."
724 724
725(defun pcomplete-parse-comint-arguments () 725(defun pcomplete-parse-comint-arguments ()
726 "Parse whitespace separated arguments in the current region." 726 "Parse whitespace separated arguments in the current region."
727 (declare (obsolete comint-parse-pcomplete-arguments "24.1"))
727 (let ((begin (save-excursion (comint-bol nil) (point))) 728 (let ((begin (save-excursion (comint-bol nil) (point)))
728 (end (point)) 729 (end (point))
729 begins args) 730 begins args)
@@ -743,8 +744,6 @@ this is `comint-dynamic-complete-functions'."
743 (push (buffer-substring-no-properties (car begins) (point)) 744 (push (buffer-substring-no-properties (car begins) (point))
744 args)) 745 args))
745 (cons (nreverse args) (nreverse begins))))) 746 (cons (nreverse args) (nreverse begins)))))
746(make-obsolete 'pcomplete-parse-comint-arguments
747 'comint-parse-pcomplete-arguments "24.1")
748 747
749(defun pcomplete-parse-arguments (&optional expand-p) 748(defun pcomplete-parse-arguments (&optional expand-p)
750 "Parse the command line arguments. Most completions need this info." 749 "Parse the command line arguments. Most completions need this info."
@@ -1090,7 +1089,7 @@ Typing SPC flushes the help buffer."
1090 (setq pcomplete-last-window-config (current-window-configuration))) 1089 (setq pcomplete-last-window-config (current-window-configuration)))
1091 (with-output-to-temp-buffer "*Completions*" 1090 (with-output-to-temp-buffer "*Completions*"
1092 (display-completion-list completions)) 1091 (display-completion-list completions))
1093 (message "Hit space to flush") 1092 (minibuffer-message "Hit space to flush")
1094 (let (event) 1093 (let (event)
1095 (prog1 1094 (prog1
1096 (catch 'done 1095 (catch 'done
diff --git a/lisp/proced.el b/lisp/proced.el
index d98bf7d2c5b..be6cae2ef08 100644
--- a/lisp/proced.el
+++ b/lisp/proced.el
@@ -28,8 +28,11 @@
28;; listed. See `proced-mode' for getting started. 28;; listed. See `proced-mode' for getting started.
29;; 29;;
30;; To do: 30;; To do:
31;; - interactive temporary customizability of flags in `proced-grammar-alist' 31;; - Interactive temporary customizability of flags in `proced-grammar-alist'
32;; - allow "sudo kill PID", "renice PID" 32;; - Allow "sudo kill PID", "sudo renice PID"
33;; `proced-send-signal' operates on multiple processes one by one.
34;; With "sudo" we want to execute one "kill" or "renice" command
35;; for all marked processes. Is there a `sudo-call-process'?
33;; 36;;
34;; Thoughts and Ideas 37;; Thoughts and Ideas
35;; - Currently, `process-attributes' returns the list of 38;; - Currently, `process-attributes' returns the list of
@@ -62,6 +65,11 @@ the external command (usually \"kill\")."
62 :type '(choice (function :tag "function") 65 :type '(choice (function :tag "function")
63 (string :tag "command"))) 66 (string :tag "command")))
64 67
68(defcustom proced-renice-command "renice"
69 "Name of renice command."
70 :group 'proced
71 :type '(string :tag "command"))
72
65(defcustom proced-signal-list 73(defcustom proced-signal-list
66 '( ;; signals supported on all POSIX compliant systems 74 '( ;; signals supported on all POSIX compliant systems
67 ("HUP" . " (1. Hangup)") 75 ("HUP" . " (1. Hangup)")
@@ -491,6 +499,7 @@ Important: the match ends just after the marker.")
491 (define-key km "o" 'proced-omit-processes) 499 (define-key km "o" 'proced-omit-processes)
492 (define-key km "x" 'proced-send-signal) ; Dired compatibility 500 (define-key km "x" 'proced-send-signal) ; Dired compatibility
493 (define-key km "k" 'proced-send-signal) ; kill processes 501 (define-key km "k" 'proced-send-signal) ; kill processes
502 (define-key km "r" 'proced-renice) ; renice processes
494 ;; misc 503 ;; misc
495 (define-key km "h" 'describe-mode) 504 (define-key km "h" 'describe-mode)
496 (define-key km "?" 'proced-help) 505 (define-key km "?" 'proced-help)
@@ -561,8 +570,11 @@ Important: the match ends just after the marker.")
561 :style toggle 570 :style toggle
562 :selected (eval proced-auto-update-flag) 571 :selected (eval proced-auto-update-flag)
563 :help "Auto Update of Proced Buffer"] 572 :help "Auto Update of Proced Buffer"]
573 "--"
564 ["Send signal" proced-send-signal 574 ["Send signal" proced-send-signal
565 :help "Send Signal to Marked Processes"])) 575 :help "Send Signal to Marked Processes"]
576 ["Renice" proced-renice
577 :help "Renice Marked Processes"]))
566 578
567;; helper functions 579;; helper functions
568(defun proced-marker-regexp () 580(defun proced-marker-regexp ()
@@ -1686,14 +1698,11 @@ After updating a displayed Proced buffer run the normal hook
1686Preserves point and marks." 1698Preserves point and marks."
1687 (proced-update t)) 1699 (proced-update t))
1688 1700
1689(defun proced-send-signal (&optional signal) 1701(defun proced-marked-processes ()
1690 "Send a SIGNAL to the marked processes. 1702 "Return marked processes as alist of PIDs.
1691If no process is marked, operate on current process. 1703If no process is marked return alist with the PID of the process point is on.
1692SIGNAL may be a string (HUP, INT, TERM, etc.) or a number. 1704The cdrs of the alist are the text strings displayed by Proced for these
1693If SIGNAL is nil display marked processes and query interactively for SIGNAL. 1705processes. They are used for error messages."
1694After sending the signal, this command runs the normal hook
1695`proced-after-send-signal-hook'."
1696 (interactive)
1697 (let ((regexp (proced-marker-regexp)) 1706 (let ((regexp (proced-marker-regexp))
1698 process-alist) 1707 process-alist)
1699 ;; collect marked processes 1708 ;; collect marked processes
@@ -1706,102 +1715,183 @@ After sending the signal, this command runs the normal hook
1706 (+ 2 (line-beginning-position)) 1715 (+ 2 (line-beginning-position))
1707 (line-end-position))) 1716 (line-end-position)))
1708 process-alist))) 1717 process-alist)))
1709 (setq process-alist 1718 (if process-alist
1710 (if process-alist 1719 (nreverse process-alist)
1711 (nreverse process-alist) 1720 ;; take current process
1712 ;; take current process 1721 (let ((pid (proced-pid-at-point)))
1713 (list (cons (proced-pid-at-point) 1722 (if pid
1723 (list (cons pid
1714 (buffer-substring-no-properties 1724 (buffer-substring-no-properties
1715 (+ 2 (line-beginning-position)) 1725 (+ 2 (line-beginning-position))
1716 (line-end-position)))))) 1726 (line-end-position)))))))))
1727
1728(defmacro proced-with-processes-buffer (process-alist &rest body)
1729 "Execute the forms in BODY in a temporary buffer displaying PROCESS-ALIST.
1730PROCESS-ALIST is an alist of process PIDs as in `proced-process-alist'.
1731The value returned is the value of the last form in BODY."
1732 (declare (indent 1) (debug t))
1733 ;; Use leading space in buffer name to make this buffer ephemeral
1734 `(let ((bufname " *Marked Processes*")
1735 (header-line (substring-no-properties proced-header-line)))
1736 (with-current-buffer (get-buffer-create bufname)
1737 (setq truncate-lines t
1738 proced-header-line header-line ; inherit header line
1739 header-line-format '(:eval (proced-header-line)))
1740 (add-hook 'post-command-hook 'force-mode-line-update nil t)
1741 (let ((inhibit-read-only t))
1742 (erase-buffer)
1743 (buffer-disable-undo)
1744 (setq buffer-read-only t)
1745 (dolist (process ,process-alist)
1746 (insert " " (cdr process) "\n"))
1747 (delete-char -1)
1748 (goto-char (point-min)))
1749 (save-window-excursion
1750 ;; Analogous to `dired-pop-to-buffer'
1751 ;; Don't split window horizontally. (Bug#1806)
1752 (let (split-width-threshold)
1753 (pop-to-buffer (current-buffer)))
1754 (fit-window-to-buffer (get-buffer-window) nil 1)
1755 ,@body))))
1756
1757(defun proced-send-signal (&optional signal process-alist)
1758 "Send a SIGNAL to processes in PROCESS-ALIST.
1759PROCESS-ALIST is an alist as returned by `proced-marked-processes'.
1760Interactively, PROCESS-ALIST contains the marked processes.
1761If no process is marked, it contains the process point is on,
1762SIGNAL may be a string (HUP, INT, TERM, etc.) or a number.
1763After sending SIGNAL to all processes in PROCESS-ALIST, this command
1764runs the normal hook `proced-after-send-signal-hook'.
1765
1766For backward compatibility SIGNAL and PROCESS-ALIST may be nil.
1767Then PROCESS-ALIST contains the marked processes or the process point is on
1768and SIGNAL is queried interactively. This noninteractive usage is still
1769supported but discouraged. It will be removed in a future version of Emacs."
1770 (interactive
1771 (let* ((process-alist (proced-marked-processes))
1772 (pnum (if (= 1 (length process-alist))
1773 "1 process"
1774 (format "%d processes" (length process-alist))))
1775 (completion-ignore-case t)
1776 (completion-extra-properties
1777 '(:annotation-function
1778 (lambda (s) (cdr (assoc s proced-signal-list))))))
1779 (proced-with-processes-buffer process-alist
1780 (list (completing-read (concat "Send signal [" pnum
1781 "] (default TERM): ")
1782 proced-signal-list
1783 nil nil nil nil "TERM")
1784 process-alist))))
1785
1786 (unless (and signal process-alist)
1787 ;; Discouraged usge (supported for backward compatibility):
1788 ;; The new calling sequence separates more cleanly between the parts
1789 ;; of the code required for interactive and noninteractive calls so that
1790 ;; the command can be used more flexibly in noninteractive ways, too.
1791 (unless (get 'proced-send-signal 'proced-outdated)
1792 (put 'proced-send-signal 'proced-outdated t)
1793 (message "Outdated usage of `proced-send-signal'")
1794 (sit-for 2))
1795 (setq process-alist (proced-marked-processes))
1717 (unless signal 1796 (unless signal
1718 ;; Display marked processes (code taken from `dired-mark-pop-up'). 1797 (let ((pnum (if (= 1 (length process-alist))
1719 (let ((bufname " *Marked Processes*") ; use leading space in buffer name 1798 "1 process"
1720 ; to make this buffer ephemeral 1799 (format "%d processes" (length process-alist))))
1721 (header-line (substring-no-properties proced-header-line))) 1800 (completion-ignore-case t)
1722 (with-current-buffer (get-buffer-create bufname) 1801 (completion-extra-properties
1723 (setq truncate-lines t 1802 '(:annotation-function
1724 proced-header-line header-line ; inherit header line 1803 (lambda (s) (cdr (assoc s proced-signal-list))))))
1725 header-line-format '(:eval (proced-header-line))) 1804 (proced-with-processes-buffer process-alist
1726 (add-hook 'post-command-hook 'force-mode-line-update nil t) 1805 (setq signal (completing-read (concat "Send signal [" pnum
1727 (let ((inhibit-read-only t)) 1806 "] (default TERM): ")
1728 (erase-buffer) 1807 proced-signal-list
1729 (buffer-disable-undo) 1808 nil nil nil nil "TERM"))))))
1730 (setq buffer-read-only t) 1809
1731 (dolist (process process-alist) 1810 (let (failures)
1732 (insert " " (cdr process) "\n")) 1811 ;; Why not always use `signal-process'? See
1733 (delete-char -1) 1812 ;; http://lists.gnu.org/archive/html/emacs-devel/2008-03/msg02955.html
1734 (goto-char (point-min))) 1813 (if (functionp proced-signal-function)
1735 (save-window-excursion 1814 ;; use built-in `signal-process'
1736 ;; Analogous to `dired-pop-to-buffer' 1815 (let ((signal (if (stringp signal)
1737 ;; Don't split window horizontally. (Bug#1806) 1816 (if (string-match "\\`[0-9]+\\'" signal)
1738 (let (split-width-threshold) 1817 (string-to-number signal)
1739 (pop-to-buffer (current-buffer))) 1818 (make-symbol signal))
1740 (fit-window-to-buffer (get-buffer-window) nil 1) 1819 signal))) ; number
1741 (let* ((completion-ignore-case t)
1742 (pnum (if (= 1 (length process-alist))
1743 "1 process"
1744 (format "%d processes" (length process-alist))))
1745 (completion-extra-properties
1746 '(:annotation-function
1747 (lambda (s) (cdr (assoc s proced-signal-list))))))
1748 (setq signal
1749 (completing-read (concat "Send signal [" pnum
1750 "] (default TERM): ")
1751 proced-signal-list
1752 nil nil nil nil "TERM")))))))
1753 ;; send signal
1754 (let ((count 0)
1755 failures)
1756 ;; Why not always use `signal-process'? See
1757 ;; http://lists.gnu.org/archive/html/emacs-devel/2008-03/msg02955.html
1758 (if (functionp proced-signal-function)
1759 ;; use built-in `signal-process'
1760 (let ((signal (if (stringp signal)
1761 (if (string-match "\\`[0-9]+\\'" signal)
1762 (string-to-number signal)
1763 (make-symbol signal))
1764 signal))) ; number
1765 (dolist (process process-alist)
1766 (condition-case err
1767 (if (zerop (funcall
1768 proced-signal-function (car process) signal))
1769 (setq count (1+ count))
1770 (proced-log "%s\n" (cdr process))
1771 (push (cdr process) failures))
1772 (error ; catch errors from failed signals
1773 (proced-log "%s\n" err)
1774 (proced-log "%s\n" (cdr process))
1775 (push (cdr process) failures)))))
1776 ;; use external system call
1777 (let ((signal (concat "-" (if (numberp signal)
1778 (number-to-string signal) signal))))
1779 (dolist (process process-alist) 1820 (dolist (process process-alist)
1780 (with-temp-buffer 1821 (condition-case err
1781 (condition-case nil 1822 (unless (zerop (funcall
1782 (if (zerop (call-process 1823 proced-signal-function (car process) signal))
1783 proced-signal-function nil t nil 1824 (proced-log "%s\n" (cdr process))
1784 signal (number-to-string (car process)))) 1825 (push (cdr process) failures))
1785 (setq count (1+ count)) 1826 (error ; catch errors from failed signals
1786 (proced-log (current-buffer)) 1827 (proced-log "%s\n" err)
1787 (proced-log "%s\n" (cdr process)) 1828 (proced-log "%s\n" (cdr process))
1788 (push (cdr process) failures)) 1829 (push (cdr process) failures)))))
1789 (error ; catch errors from failed signals 1830 ;; use external system call
1790 (proced-log (current-buffer)) 1831 (let ((signal (format "-%s" signal)))
1791 (proced-log "%s\n" (cdr process)) 1832 (dolist (process process-alist)
1792 (push (cdr process) failures))))))) 1833 (with-temp-buffer
1793 (if failures 1834 (condition-case nil
1794 ;; Proced error message are not always very precise. 1835 (unless (zerop (call-process
1795 ;; Can we issue a useful one-line summary in the 1836 proced-signal-function nil t nil
1796 ;; message area (using FAILURES) if only one signal failed? 1837 signal (number-to-string (car process))))
1797 (proced-log-summary 1838 (proced-log (current-buffer))
1798 signal 1839 (proced-log "%s\n" (cdr process))
1799 (format "%d of %d signal%s failed" 1840 (push (cdr process) failures))
1800 (length failures) (length process-alist) 1841 (error ; catch errors from failed signals
1801 (if (= 1 (length process-alist)) "" "s"))) 1842 (proced-log (current-buffer))
1802 (proced-success-message "Sent signal to" count))) 1843 (proced-log "%s\n" (cdr process))
1803 ;; final clean-up 1844 (push (cdr process) failures)))))))
1804 (run-hooks 'proced-after-send-signal-hook))) 1845 (if failures
1846 ;; Proced error message are not always very precise.
1847 ;; Can we issue a useful one-line summary in the
1848 ;; message area (using FAILURES) if only one signal failed?
1849 (proced-log-summary
1850 (format "Signal %s" signal)
1851 (format "%d of %d signal%s failed"
1852 (length failures) (length process-alist)
1853 (if (= 1 (length process-alist)) "" "s")))
1854 (proced-success-message "Sent signal to" (length process-alist))))
1855 ;; final clean-up
1856 (run-hooks 'proced-after-send-signal-hook))
1857
1858(defun proced-renice (priority process-alist)
1859 "Renice the processes in PROCESS-ALIST to PRIORITY.
1860PROCESS-ALIST is an alist as returned by `proced-marked-processes'.
1861Interactively, PROCESS-ALIST contains the marked processes.
1862If no process is marked, it contains the process point is on,
1863After renicing all processes in PROCESS-ALIST, this command runs
1864the normal hook `proced-after-send-signal-hook'."
1865 (interactive
1866 (let ((process-alist (proced-marked-processes)))
1867 (proced-with-processes-buffer process-alist
1868 (list (read-number "New priority: ")
1869 process-alist))))
1870 (if (numberp priority)
1871 (setq priority (number-to-string priority)))
1872 (let (failures)
1873 (dolist (process process-alist)
1874 (with-temp-buffer
1875 (condition-case nil
1876 (unless (zerop (call-process
1877 proced-renice-command nil t nil
1878 priority (number-to-string (car process))))
1879 (proced-log (current-buffer))
1880 (proced-log "%s\n" (cdr process))
1881 (push (cdr process) failures))
1882 (error ; catch errors from failed renice
1883 (proced-log (current-buffer))
1884 (proced-log "%s\n" (cdr process))
1885 (push (cdr process) failures)))))
1886 (if failures
1887 (proced-log-summary
1888 (format "Renice %s" priority)
1889 (format "%d of %d renice%s failed"
1890 (length failures) (length process-alist)
1891 (if (= 1 (length process-alist)) "" "s")))
1892 (proced-success-message "Reniced" (length process-alist))))
1893 ;; final clean-up
1894 (run-hooks 'proced-after-send-signal-hook))
1805 1895
1806;; similar to `dired-why' 1896;; similar to `dired-why'
1807(defun proced-why () 1897(defun proced-why ()
diff --git a/lisp/profiler.el b/lisp/profiler.el
new file mode 100644
index 00000000000..5fc74573262
--- /dev/null
+++ b/lisp/profiler.el
@@ -0,0 +1,665 @@
1;;; profiler.el --- UI and helper functions for Emacs's native profiler -*- lexical-binding: t -*-
2
3;; Copyright (C) 2012 Free Software Foundation, Inc.
4
5;; Author: Tomohiro Matsuyama <tomo@cx4a.org>
6;; Keywords: lisp
7
8;; This program is free software; you can redistribute it and/or modify
9;; it under the terms of the GNU General Public License as published by
10;; the Free Software Foundation, either version 3 of the License, or
11;; (at your option) any later version.
12
13;; This program is distributed in the hope that it will be useful,
14;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;; GNU General Public License for more details.
17
18;; You should have received a copy of the GNU General Public License
19;; along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21;;; Commentary:
22
23;;
24
25;;; Code:
26
27(eval-when-compile
28 (require 'cl-lib))
29
30(defgroup profiler nil
31 "Emacs profiler."
32 :group 'lisp
33 :prefix "profiler-")
34
35(defcustom profiler-sample-interval 1
36 "Default sample interval in millisecond."
37 :type 'integer
38 :group 'profiler)
39
40;;; Utilities
41
42(defun profiler-ensure-string (object)
43 (cond ((stringp object)
44 object)
45 ((symbolp object)
46 (symbol-name object))
47 ((numberp object)
48 (number-to-string object))
49 (t
50 (format "%s" object))))
51
52(defun profiler-format (fmt &rest args)
53 (cl-loop for (width align subfmt) in fmt
54 for arg in args
55 for str = (cond
56 ((consp subfmt)
57 (apply 'profiler-format subfmt arg))
58 ((stringp subfmt)
59 (format subfmt arg))
60 ((and (symbolp subfmt)
61 (fboundp subfmt))
62 (funcall subfmt arg))
63 (t
64 (profiler-ensure-string arg)))
65 for len = (length str)
66 if (< width len)
67 collect (substring str 0 width) into frags
68 else
69 collect
70 (let ((padding (make-string (- width len) ?\s)))
71 (cl-ecase align
72 (left (concat str padding))
73 (right (concat padding str))))
74 into frags
75 finally return (apply #'concat frags)))
76
77(defun profiler-format-percent (number divisor)
78 (concat (number-to-string (/ (* number 100) divisor)) "%"))
79
80(defun profiler-format-nbytes (nbytes)
81 "Format NBYTES in humarn readable string."
82 (if (and (integerp nbytes) (> nbytes 0))
83 (cl-loop with i = (% (1+ (floor (log10 nbytes))) 3)
84 for c in (append (number-to-string nbytes) nil)
85 if (= i 0)
86 collect ?, into s
87 and do (setq i 3)
88 collect c into s
89 do (cl-decf i)
90 finally return
91 (apply 'string (if (eq (car s) ?,) (cdr s) s)))
92 (profiler-ensure-string nbytes)))
93
94
95;;; Entries
96
97(defun profiler-entry-format (entry)
98 "Format ENTRY in human readable string. ENTRY would be a
99function name of a function itself."
100 (cond ((memq (car-safe entry) '(closure lambda))
101 (format "#<lambda 0x%x>" (sxhash entry)))
102 ((byte-code-function-p entry)
103 (format "#<compiled 0x%x>" (sxhash entry)))
104 ((or (subrp entry) (symbolp entry) (stringp entry))
105 (format "%s" entry))
106 (t
107 (format "#<unknown 0x%x>" (sxhash entry)))))
108
109;;; Log data structure
110
111;; The C code returns the log in the form of a hash-table where the keys are
112;; vectors (of size profiler-max-stack-depth, holding truncated
113;; backtraces, where the first element is the top of the stack) and
114;; the values are integers (which count how many times this backtrace
115;; has been seen, multiplied by a "weight factor" which is either the
116;; sample-interval or the memory being allocated).
117;; We extend it by adding a few other entries to the hash-table, most notably:
118;; - Key `type' has a value indicating the kind of log (`memory' or `cpu').
119;; - Key `timestamp' has a value giving the time when the log was obtained.
120;; - Key `diff-p' indicates if this log represents a diff between two logs.
121
122(defun profiler-log-timestamp (log) (gethash 'timestamp log))
123(defun profiler-log-type (log) (gethash 'type log))
124(defun profiler-log-diff-p (log) (gethash 'diff-p log))
125
126(defun profiler-log-diff (log1 log2)
127 "Compare LOG1 with LOG2 and return a diff log. Both logs must
128be same type."
129 (unless (eq (profiler-log-type log1)
130 (profiler-log-type log2))
131 (error "Can't compare different type of logs"))
132 (let ((newlog (make-hash-table :test 'equal)))
133 ;; Make a copy of `log1' into `newlog'.
134 (maphash (lambda (backtrace count) (puthash backtrace count newlog))
135 log1)
136 (puthash 'diff-p t newlog)
137 (maphash (lambda (backtrace count)
138 (when (vectorp backtrace)
139 (puthash backtrace (- (gethash backtrace log1 0) count)
140 newlog)))
141 log2)
142 newlog))
143
144(defun profiler-log-fixup-entry (entry)
145 (if (symbolp entry)
146 entry
147 (profiler-entry-format entry)))
148
149(defun profiler-log-fixup-backtrace (backtrace)
150 (mapcar 'profiler-log-fixup-entry backtrace))
151
152(defun profiler-log-fixup (log)
153 "Fixup LOG so that the log could be serialized into file."
154 (let ((newlog (make-hash-table :test 'equal)))
155 (maphash (lambda (backtrace count)
156 (puthash (if (not (vectorp backtrace))
157 backtrace
158 (profiler-log-fixup-backtrace backtrace))
159 count newlog))
160 log)
161 newlog))
162
163(defun profiler-log-write-file (log filename &optional confirm)
164 "Write LOG into FILENAME."
165 (with-temp-buffer
166 (let (print-level print-length)
167 (print (profiler-log-fixup log) (current-buffer)))
168 (write-file filename confirm)))
169
170(defun profiler-log-read-file (filename)
171 "Read log from FILENAME."
172 (with-temp-buffer
173 (insert-file-contents filename)
174 (goto-char (point-min))
175 (read (current-buffer))))
176
177
178;;; Calltree data structure
179
180(cl-defstruct (profiler-calltree (:constructor profiler-make-calltree))
181 entry
182 (count 0) (count-percent "")
183 parent children)
184
185(defun profiler-calltree-leaf-p (tree)
186 (null (profiler-calltree-children tree)))
187
188(defun profiler-calltree-count< (a b)
189 (cond ((eq (profiler-calltree-entry a) t) t)
190 ((eq (profiler-calltree-entry b) t) nil)
191 (t (< (profiler-calltree-count a)
192 (profiler-calltree-count b)))))
193
194(defun profiler-calltree-count> (a b)
195 (not (profiler-calltree-count< a b)))
196
197(defun profiler-calltree-depth (tree)
198 (let ((parent (profiler-calltree-parent tree)))
199 (if (null parent)
200 0
201 (1+ (profiler-calltree-depth parent)))))
202
203(defun profiler-calltree-find (tree entry)
204 "Return a child tree of ENTRY under TREE."
205 ;; OPTIMIZED
206 (let (result (children (profiler-calltree-children tree)))
207 ;; FIXME: Use `assoc'.
208 (while (and children (null result))
209 (let ((child (car children)))
210 (when (equal (profiler-calltree-entry child) entry)
211 (setq result child))
212 (setq children (cdr children))))
213 result))
214
215(defun profiler-calltree-walk (calltree function)
216 (funcall function calltree)
217 (dolist (child (profiler-calltree-children calltree))
218 (profiler-calltree-walk child function)))
219
220(defun profiler-calltree-build-1 (tree log &optional reverse)
221 ;; FIXME: Do a better job of reconstructing a complete call-tree
222 ;; when the backtraces have been truncated. Ideally, we should be
223 ;; able to reduce profiler-max-stack-depth to 3 or 4 and still
224 ;; get a meaningful call-tree.
225 (maphash
226 (lambda (backtrace count)
227 (when (vectorp backtrace)
228 (let ((node tree)
229 (max (length backtrace)))
230 (dotimes (i max)
231 (let ((entry (aref backtrace (if reverse i (- max i 1)))))
232 (when entry
233 (let ((child (profiler-calltree-find node entry)))
234 (unless child
235 (setq child (profiler-make-calltree
236 :entry entry :parent node))
237 (push child (profiler-calltree-children node)))
238 (cl-incf (profiler-calltree-count child) count)
239 (setq node child))))))))
240 log))
241
242(defun profiler-calltree-compute-percentages (tree)
243 (let ((total-count 0))
244 ;; FIXME: the memory profiler's total wraps around all too easily!
245 (dolist (child (profiler-calltree-children tree))
246 (cl-incf total-count (profiler-calltree-count child)))
247 (unless (zerop total-count)
248 (profiler-calltree-walk
249 tree (lambda (node)
250 (setf (profiler-calltree-count-percent node)
251 (profiler-format-percent (profiler-calltree-count node)
252 total-count)))))))
253
254(cl-defun profiler-calltree-build (log &key reverse)
255 (let ((tree (profiler-make-calltree)))
256 (profiler-calltree-build-1 tree log reverse)
257 (profiler-calltree-compute-percentages tree)
258 tree))
259
260(defun profiler-calltree-sort (tree predicate)
261 (let ((children (profiler-calltree-children tree)))
262 (setf (profiler-calltree-children tree) (sort children predicate))
263 (dolist (child (profiler-calltree-children tree))
264 (profiler-calltree-sort child predicate))))
265
266
267;;; Report rendering
268
269(defcustom profiler-report-closed-mark "+"
270 "An indicator of closed calltrees."
271 :type 'string
272 :group 'profiler)
273
274(defcustom profiler-report-open-mark "-"
275 "An indicator of open calltrees."
276 :type 'string
277 :group 'profiler)
278
279(defcustom profiler-report-leaf-mark " "
280 "An indicator of calltree leaves."
281 :type 'string
282 :group 'profiler)
283
284(defvar profiler-report-sample-line-format
285 '((60 left)
286 (14 right ((9 right)
287 (5 right)))))
288
289(defvar profiler-report-memory-line-format
290 '((55 left)
291 (19 right ((14 right profiler-format-nbytes)
292 (5 right)))))
293
294(defvar-local profiler-report-log nil
295 "The current profiler log.")
296
297(defvar-local profiler-report-reversed nil
298 "True if calltree is rendered in bottom-up. Do not touch this
299variable directly.")
300
301(defvar-local profiler-report-order nil
302 "The value can be `ascending' or `descending'. Do not touch
303this variable directly.")
304
305(defun profiler-report-make-entry-part (entry)
306 (let ((string (cond
307 ((eq entry t)
308 "Others")
309 ((and (symbolp entry)
310 (fboundp entry))
311 (propertize (symbol-name entry)
312 'face 'link
313 'mouse-face 'highlight
314 'help-echo "mouse-2 or RET jumps to definition"))
315 (t
316 (profiler-entry-format entry)))))
317 (propertize string 'profiler-entry entry)))
318
319(defun profiler-report-make-name-part (tree)
320 (let* ((entry (profiler-calltree-entry tree))
321 (depth (profiler-calltree-depth tree))
322 (indent (make-string (* (1- depth) 2) ?\s))
323 (mark (if (profiler-calltree-leaf-p tree)
324 profiler-report-leaf-mark
325 profiler-report-closed-mark))
326 (entry (profiler-report-make-entry-part entry)))
327 (format "%s%s %s" indent mark entry)))
328
329(defun profiler-report-header-line-format (fmt &rest args)
330 (let* ((header (apply 'profiler-format fmt args))
331 (escaped (replace-regexp-in-string "%" "%%" header)))
332 (concat " " escaped)))
333
334(defun profiler-report-line-format (tree)
335 (let ((diff-p (profiler-log-diff-p profiler-report-log))
336 (name-part (profiler-report-make-name-part tree))
337 (count (profiler-calltree-count tree))
338 (count-percent (profiler-calltree-count-percent tree)))
339 (profiler-format (cl-ecase (profiler-log-type profiler-report-log)
340 (cpu profiler-report-sample-line-format)
341 (memory profiler-report-memory-line-format))
342 name-part
343 (if diff-p
344 (list (if (> count 0)
345 (format "+%s" count)
346 count)
347 "")
348 (list count count-percent)))))
349
350(defun profiler-report-insert-calltree (tree)
351 (let ((line (profiler-report-line-format tree)))
352 (insert (propertize (concat line "\n") 'calltree tree))))
353
354(defun profiler-report-insert-calltree-children (tree)
355 (mapc 'profiler-report-insert-calltree
356 (profiler-calltree-children tree)))
357
358
359;;; Report mode
360
361(defvar profiler-report-mode-map
362 (let ((map (make-sparse-keymap)))
363 ;; FIXME: Add menu.
364 (define-key map "n" 'profiler-report-next-entry)
365 (define-key map "p" 'profiler-report-previous-entry)
366 ;; I find it annoying more than helpful to not be able to navigate
367 ;; normally with the cursor keys. --Stef
368 ;; (define-key map [down] 'profiler-report-next-entry)
369 ;; (define-key map [up] 'profiler-report-previous-entry)
370 (define-key map "\r" 'profiler-report-toggle-entry)
371 (define-key map "\t" 'profiler-report-toggle-entry)
372 (define-key map "i" 'profiler-report-toggle-entry)
373 (define-key map "f" 'profiler-report-find-entry)
374 (define-key map "j" 'profiler-report-find-entry)
375 (define-key map [mouse-2] 'profiler-report-find-entry)
376 (define-key map "d" 'profiler-report-describe-entry)
377 (define-key map "C" 'profiler-report-render-calltree)
378 (define-key map "B" 'profiler-report-render-reversed-calltree)
379 (define-key map "A" 'profiler-report-ascending-sort)
380 (define-key map "D" 'profiler-report-descending-sort)
381 (define-key map "=" 'profiler-report-compare-log)
382 (define-key map (kbd "C-x C-w") 'profiler-report-write-log)
383 (define-key map "q" 'quit-window)
384 map))
385
386(defun profiler-report-make-buffer-name (log)
387 (format "*%s-Profiler-Report %s*"
388 (cl-ecase (profiler-log-type log) (cpu 'CPU) (memory 'Memory))
389 (format-time-string "%Y-%m-%d %T" (profiler-log-timestamp log))))
390
391(defun profiler-report-setup-buffer (log)
392 "Make a buffer for LOG and return it."
393 (let* ((buf-name (profiler-report-make-buffer-name log))
394 (buffer (get-buffer-create buf-name)))
395 (with-current-buffer buffer
396 (profiler-report-mode)
397 (setq profiler-report-log log
398 profiler-report-reversed nil
399 profiler-report-order 'descending))
400 buffer))
401
402(define-derived-mode profiler-report-mode special-mode "Profiler-Report"
403 "Profiler Report Mode."
404 (setq buffer-read-only t
405 buffer-undo-list t
406 truncate-lines t))
407
408
409;;; Report commands
410
411(defun profiler-report-calltree-at-point ()
412 (get-text-property (point) 'calltree))
413
414(defun profiler-report-move-to-entry ()
415 (let ((point (next-single-property-change (line-beginning-position)
416 'profiler-entry)))
417 (if point
418 (goto-char point)
419 (back-to-indentation))))
420
421(defun profiler-report-next-entry ()
422 "Move cursor to next entry."
423 (interactive)
424 (forward-line)
425 (profiler-report-move-to-entry))
426
427(defun profiler-report-previous-entry ()
428 "Move cursor to previous entry."
429 (interactive)
430 (forward-line -1)
431 (profiler-report-move-to-entry))
432
433(defun profiler-report-expand-entry ()
434 "Expand entry at point."
435 (interactive)
436 (save-excursion
437 (beginning-of-line)
438 (when (search-forward (concat profiler-report-closed-mark " ")
439 (line-end-position) t)
440 (let ((tree (profiler-report-calltree-at-point)))
441 (when tree
442 (let ((inhibit-read-only t))
443 (replace-match (concat profiler-report-open-mark " "))
444 (forward-line)
445 (profiler-report-insert-calltree-children tree)
446 t))))))
447
448(defun profiler-report-collapse-entry ()
449 "Collpase entry at point."
450 (interactive)
451 (save-excursion
452 (beginning-of-line)
453 (when (search-forward (concat profiler-report-open-mark " ")
454 (line-end-position) t)
455 (let* ((tree (profiler-report-calltree-at-point))
456 (depth (profiler-calltree-depth tree))
457 (start (line-beginning-position 2))
458 d)
459 (when tree
460 (let ((inhibit-read-only t))
461 (replace-match (concat profiler-report-closed-mark " "))
462 (while (and (eq (forward-line) 0)
463 (let ((child (get-text-property (point) 'calltree)))
464 (and child
465 (numberp (setq d (profiler-calltree-depth child)))))
466 (> d depth)))
467 (delete-region start (line-beginning-position)))))
468 t)))
469
470(defun profiler-report-toggle-entry ()
471 "Expand entry at point if the tree is collapsed,
472otherwise collapse."
473 (interactive)
474 (or (profiler-report-expand-entry)
475 (profiler-report-collapse-entry)))
476
477(defun profiler-report-find-entry (&optional event)
478 "Find entry at point."
479 (interactive (list last-nonmenu-event))
480 (if event (posn-set-point (event-end event)))
481 (let ((tree (profiler-report-calltree-at-point)))
482 (when tree
483 (let ((entry (profiler-calltree-entry tree)))
484 (find-function entry)))))
485
486(defun profiler-report-describe-entry ()
487 "Describe entry at point."
488 (interactive)
489 (let ((tree (profiler-report-calltree-at-point)))
490 (when tree
491 (let ((entry (profiler-calltree-entry tree)))
492 (require 'help-fns)
493 (describe-function entry)))))
494
495(cl-defun profiler-report-render-calltree-1
496 (log &key reverse (order 'descending))
497 (let ((calltree (profiler-calltree-build profiler-report-log
498 :reverse reverse)))
499 (setq header-line-format
500 (cl-ecase (profiler-log-type log)
501 (cpu
502 (profiler-report-header-line-format
503 profiler-report-sample-line-format
504 "Function" (list "Time (ms)" "%")))
505 (memory
506 (profiler-report-header-line-format
507 profiler-report-memory-line-format
508 "Function" (list "Bytes" "%")))))
509 (let ((predicate (cl-ecase order
510 (ascending #'profiler-calltree-count<)
511 (descending #'profiler-calltree-count>))))
512 (profiler-calltree-sort calltree predicate))
513 (let ((inhibit-read-only t))
514 (erase-buffer)
515 (profiler-report-insert-calltree-children calltree)
516 (goto-char (point-min))
517 (profiler-report-move-to-entry))))
518
519(defun profiler-report-rerender-calltree ()
520 (profiler-report-render-calltree-1 profiler-report-log
521 :reverse profiler-report-reversed
522 :order profiler-report-order))
523
524(defun profiler-report-render-calltree ()
525 "Render calltree view."
526 (interactive)
527 (setq profiler-report-reversed nil)
528 (profiler-report-rerender-calltree))
529
530(defun profiler-report-render-reversed-calltree ()
531 "Render reversed calltree view."
532 (interactive)
533 (setq profiler-report-reversed t)
534 (profiler-report-rerender-calltree))
535
536(defun profiler-report-ascending-sort ()
537 "Sort calltree view in ascending order."
538 (interactive)
539 (setq profiler-report-order 'ascending)
540 (profiler-report-rerender-calltree))
541
542(defun profiler-report-descending-sort ()
543 "Sort calltree view in descending order."
544 (interactive)
545 (setq profiler-report-order 'descending)
546 (profiler-report-rerender-calltree))
547
548(defun profiler-report-log (log)
549 (let ((buffer (profiler-report-setup-buffer log)))
550 (with-current-buffer buffer
551 (profiler-report-render-calltree))
552 (pop-to-buffer buffer)))
553
554(defun profiler-report-compare-log (buffer)
555 "Compare the current profiler log with another."
556 (interactive (list (read-buffer "Compare to: ")))
557 (let* ((log1 (with-current-buffer buffer profiler-report-log))
558 (log2 profiler-report-log)
559 (diff-log (profiler-log-diff log1 log2)))
560 (profiler-report-log diff-log)))
561
562(defun profiler-report-write-log (filename &optional confirm)
563 "Write the current profiler log into FILENAME."
564 (interactive
565 (list (read-file-name "Write log: " default-directory)
566 (not current-prefix-arg)))
567 (profiler-log-write-file profiler-report-log
568 filename
569 confirm))
570
571
572;;; Profiler commands
573
574;;;###autoload
575(defun profiler-start (mode)
576 "Start/restart profilers.
577MODE can be one of `cpu', `mem', or `cpu+mem'.
578If MODE is `cpu' or `cpu+mem', time-based profiler will be started.
579Also, if MODE is `mem' or `cpu+mem', then memory profiler will be started."
580 (interactive
581 (list (if (not (fboundp 'profiler-cpu-start)) 'mem
582 (intern (completing-read "Mode (default cpu): "
583 '("cpu" "mem" "cpu+mem")
584 nil t nil nil "cpu")))))
585 (cl-ecase mode
586 (cpu
587 (profiler-cpu-start profiler-sample-interval)
588 (message "CPU profiler started"))
589 (mem
590 (profiler-memory-start)
591 (message "Memory profiler started"))
592 (cpu+mem
593 (profiler-cpu-start profiler-sample-interval)
594 (profiler-memory-start)
595 (message "CPU and memory profiler started"))))
596
597(defun profiler-stop ()
598 "Stop started profilers. Profiler logs will be kept."
599 (interactive)
600 (let ((cpu (if (fboundp 'profiler-cpu-stop) (profiler-cpu-stop)))
601 (mem (profiler-memory-stop)))
602 (message "%s profiler stopped"
603 (cond ((and mem cpu) "CPU and memory")
604 (mem "Memory")
605 (cpu "CPU")
606 (t "No")))))
607
608(defun profiler-reset ()
609 "Reset profiler log."
610 (interactive)
611 (when (fboundp 'profiler-cpu-log)
612 (ignore (profiler-cpu-log)))
613 (ignore (profiler-memory-log))
614 t)
615
616(defun profiler--report-cpu ()
617 (let ((log (if (fboundp 'profiler-cpu-log) (profiler-cpu-log))))
618 (when log
619 (puthash 'type 'cpu log)
620 (puthash 'timestamp (current-time) log)
621 (profiler-report-log log))))
622
623(defun profiler--report-memory ()
624 (let ((log (profiler-memory-log)))
625 (when log
626 (puthash 'type 'memory log)
627 (puthash 'timestamp (current-time) log)
628 (profiler-report-log log))))
629
630(defun profiler-report ()
631 "Report profiling results."
632 (interactive)
633 (profiler--report-cpu)
634 (profiler--report-memory))
635
636;;;###autoload
637(defun profiler-find-log (filename)
638 "Read a profiler log from FILENAME and report it."
639 (interactive
640 (list (read-file-name "Find log: " default-directory)))
641 (profiler-report-log (profiler-log-read-file filename)))
642
643
644;;; Profiling helpers
645
646;; (cl-defmacro with-sample-profiling ((&key interval) &rest body)
647;; `(unwind-protect
648;; (progn
649;; (ignore (profiler-cpu-log))
650;; (profiler-cpu-start ,interval)
651;; ,@body)
652;; (profiler-cpu-stop)
653;; (profiler--report-cpu)))
654
655;; (defmacro with-memory-profiling (&rest body)
656;; `(unwind-protect
657;; (progn
658;; (ignore (profiler-memory-log))
659;; (profiler-memory-start)
660;; ,@body)
661;; (profiler-memory-stop)
662;; (profiler--report-memory)))
663
664(provide 'profiler)
665;;; profiler.el ends here
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el
index 1825098a55e..745320b6eb2 100644
--- a/lisp/progmodes/ada-mode.el
+++ b/lisp/progmodes/ada-mode.el
@@ -5218,11 +5218,11 @@ Return nil if no body was found."
5218 ;; correctly highlight a with_clause that spans multiple lines. 5218 ;; correctly highlight a with_clause that spans multiple lines.
5219 (list (concat "\\<\\(goto\\|raise\\|use\\|with\\)" 5219 (list (concat "\\<\\(goto\\|raise\\|use\\|with\\)"
5220 "[ \t]+\\([a-zA-Z0-9_., \t]+\\)\\W") 5220 "[ \t]+\\([a-zA-Z0-9_., \t]+\\)\\W")
5221 '(1 font-lock-keyword-face) '(2 font-lock-reference-face nil t)) 5221 '(1 font-lock-keyword-face) '(2 font-lock-constant-face nil t))
5222 5222
5223 ;; 5223 ;;
5224 ;; Goto tags. 5224 ;; Goto tags.
5225 '("<<\\(\\sw+\\)>>" 1 font-lock-reference-face) 5225 '("<<\\(\\sw+\\)>>" 1 font-lock-constant-face)
5226 5226
5227 ;; Highlight based-numbers (R. Reagan <robin-reply@reagans.org>) 5227 ;; Highlight based-numbers (R. Reagan <robin-reply@reagans.org>)
5228 (list "\\([0-9]+#[0-9a-fA-F_]+#\\)" '(1 font-lock-constant-face t)) 5228 (list "\\([0-9]+#[0-9a-fA-F_]+#\\)" '(1 font-lock-constant-face t))
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 95b8758ba80..09fba380f15 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -748,12 +748,10 @@ Faces `compilation-error-face', `compilation-warning-face',
748(defvar compilation-leave-directory-face 'font-lock-builtin-face 748(defvar compilation-leave-directory-face 'font-lock-builtin-face
749 "Face name to use for leaving directory messages.") 749 "Face name to use for leaving directory messages.")
750 750
751
752
753;; Used for compatibility with the old compile.el. 751;; Used for compatibility with the old compile.el.
754(defvar compilation-parse-errors-function nil) 752(defvar compilation-parse-errors-function nil)
755(make-obsolete 'compilation-parse-errors-function 753(make-obsolete-variable 'compilation-parse-errors-function
756 'compilation-error-regexp-alist "24.1") 754 'compilation-error-regexp-alist "24.1")
757 755
758(defcustom compilation-auto-jump-to-first-error nil 756(defcustom compilation-auto-jump-to-first-error nil
759 "If non-nil, automatically jump to the first error during compilation." 757 "If non-nil, automatically jump to the first error during compilation."
@@ -1499,24 +1497,6 @@ Otherwise, construct a buffer name from NAME-OF-MODE."
1499 (t 1497 (t
1500 (concat "*" (downcase name-of-mode) "*")))) 1498 (concat "*" (downcase name-of-mode) "*"))))
1501 1499
1502;; This is a rough emulation of the old hack, until the transition to new
1503;; compile is complete.
1504(defun compile-internal (command error-message
1505 &optional _name-of-mode parser
1506 error-regexp-alist name-function
1507 _enter-regexp-alist _leave-regexp-alist
1508 file-regexp-alist _nomessage-regexp-alist
1509 _no-async highlight-regexp _local-map)
1510 (if parser
1511 (error "Compile now works very differently, see `compilation-error-regexp-alist'"))
1512 (let ((compilation-error-regexp-alist
1513 (append file-regexp-alist (or error-regexp-alist
1514 compilation-error-regexp-alist)))
1515 (compilation-error (replace-regexp-in-string "^No more \\(.+\\)s\\.?"
1516 "\\1" error-message)))
1517 (compilation-start command nil name-function highlight-regexp)))
1518(make-obsolete 'compile-internal 'compilation-start "22.1")
1519
1520(defcustom compilation-always-kill nil 1500(defcustom compilation-always-kill nil
1521 "If t, always kill a running compilation process before starting a new one. 1501 "If t, always kill a running compilation process before starting a new one.
1522If nil, ask to kill it." 1502If nil, ask to kill it."
diff --git a/lisp/progmodes/cwarn.el b/lisp/progmodes/cwarn.el
index 9ea71ad36f5..becbcb7a3de 100644
--- a/lisp/progmodes/cwarn.el
+++ b/lisp/progmodes/cwarn.el
@@ -191,13 +191,7 @@ if ARG is omitted or nil."
191 (if font-lock-mode (font-lock-fontify-buffer))) 191 (if font-lock-mode (font-lock-fontify-buffer)))
192 192
193;;;###autoload 193;;;###autoload
194(defun turn-on-cwarn-mode () 194(define-obsolete-function-alias 'turn-on-cwarn-mode 'cwarn-mode "24.1")
195 "Turn on CWarn mode.
196
197This function is designed to be added to hooks, for example:
198 (add-hook 'c-mode-hook 'turn-on-cwarn-mode)"
199 (cwarn-mode 1))
200(make-obsolete 'turn-on-cwarn-mode 'cwarn-mode "24.1")
201 195
202;;}}} 196;;}}}
203;;{{{ Help functions 197;;{{{ Help functions
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index 9b634328fa7..e58fb2b3eab 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -1151,7 +1151,7 @@ As a user, you should not set this to t.")
1151 (common-blocks 1151 (common-blocks
1152 '("\\<\\(common\\)\\>[ \t]*\\(\\sw+\\)?[ \t]*,?" 1152 '("\\<\\(common\\)\\>[ \t]*\\(\\sw+\\)?[ \t]*,?"
1153 (1 font-lock-keyword-face) ; "common" 1153 (1 font-lock-keyword-face) ; "common"
1154 (2 font-lock-reference-face nil t) ; block name 1154 (2 font-lock-constant-face nil t) ; block name
1155 ("[ \t]*\\(\\sw+\\)[ ,]*" 1155 ("[ \t]*\\(\\sw+\\)[ ,]*"
1156 ;; Start with point after block name and comma 1156 ;; Start with point after block name and comma
1157 (goto-char (match-end 0)) ; needed for XEmacs, could be nil 1157 (goto-char (match-end 0)) ; needed for XEmacs, could be nil
@@ -1169,20 +1169,20 @@ As a user, you should not set this to t.")
1169 1169
1170 ;; Labels 1170 ;; Labels
1171 (label 1171 (label
1172 '("^[ \t]*\\([a-zA-Z]\\sw*:\\)" (1 font-lock-reference-face))) 1172 '("^[ \t]*\\([a-zA-Z]\\sw*:\\)" (1 font-lock-constant-face)))
1173 1173
1174 ;; The goto statement and its label 1174 ;; The goto statement and its label
1175 (goto 1175 (goto
1176 '("\\(goto\\)[ \t]*,[ \t]*\\([a-zA-Z]\\sw*\\)" 1176 '("\\(goto\\)[ \t]*,[ \t]*\\([a-zA-Z]\\sw*\\)"
1177 (1 font-lock-keyword-face) 1177 (1 font-lock-keyword-face)
1178 (2 font-lock-reference-face))) 1178 (2 font-lock-constant-face)))
1179 1179
1180 ;; Tags in structure definitions. Note that this definition 1180 ;; Tags in structure definitions. Note that this definition
1181 ;; actually collides with labels, so we have to use the same 1181 ;; actually collides with labels, so we have to use the same
1182 ;; face. It also matches named subscript ranges, 1182 ;; face. It also matches named subscript ranges,
1183 ;; e.g. vec{bottom:top]. No good way around this. 1183 ;; e.g. vec{bottom:top]. No good way around this.
1184 (structtag 1184 (structtag
1185 '("\\<\\([a-zA-Z][a-zA-Z0-9_]*:\\)[^:]" (1 font-lock-reference-face))) 1185 '("\\<\\([a-zA-Z][a-zA-Z0-9_]*:\\)[^:]" (1 font-lock-constant-face)))
1186 1186
1187 ;; Structure names 1187 ;; Structure names
1188 (structname 1188 (structname
@@ -1195,7 +1195,7 @@ As a user, you should not set this to t.")
1195 ;; fontification. Slow, use it only in fancy fontification. 1195 ;; fontification. Slow, use it only in fancy fontification.
1196 (keyword-parameters 1196 (keyword-parameters
1197 '("\\(,\\|[a-zA-Z0-9_](\\)[ \t]*\\(\\$[ \t]*\\(;.*\\)?\n\\([ \t]*\\(;.*\\)?\n\\)*[ \t]*\\)?\\(/[a-zA-Z_]\\sw*\\|[a-zA-Z_]\\sw*[ \t]*=\\)" 1197 '("\\(,\\|[a-zA-Z0-9_](\\)[ \t]*\\(\\$[ \t]*\\(;.*\\)?\n\\([ \t]*\\(;.*\\)?\n\\)*[ \t]*\\)?\\(/[a-zA-Z_]\\sw*\\|[a-zA-Z_]\\sw*[ \t]*=\\)"
1198 (6 font-lock-reference-face))) 1198 (6 font-lock-constant-face)))
1199 1199
1200 ;; System variables start with a bang. 1200 ;; System variables start with a bang.
1201 (system-variables 1201 (system-variables
diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el
index 401970b2ce8..f2578c14066 100644
--- a/lisp/progmodes/inf-lisp.el
+++ b/lisp/progmodes/inf-lisp.el
@@ -69,9 +69,8 @@
69 :group 'lisp 69 :group 'lisp
70 :version "22.1") 70 :version "22.1")
71 71
72;;;###autoload
73(defcustom inferior-lisp-filter-regexp 72(defcustom inferior-lisp-filter-regexp
74 (purecopy "\\`\\s *\\(:\\(\\w\\|\\s_\\)\\)?\\s *\\'") 73 "\\`\\s *\\(:\\(\\w\\|\\s_\\)\\)?\\s *\\'"
75 "What not to save on inferior Lisp's input history. 74 "What not to save on inferior Lisp's input history.
76Input matching this regexp is not saved on the input history in Inferior Lisp 75Input matching this regexp is not saved on the input history in Inferior Lisp
77mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword 76mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword
@@ -137,14 +136,12 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword
137 (define-key inferior-lisp-mode-map "\C-cv" 136 (define-key inferior-lisp-mode-map "\C-cv"
138 'lisp-show-variable-documentation)) 137 'lisp-show-variable-documentation))
139 138
140;;;###autoload 139(defcustom inferior-lisp-program "lisp"
141(defcustom inferior-lisp-program (purecopy "lisp")
142 "Program name for invoking an inferior Lisp in Inferior Lisp mode." 140 "Program name for invoking an inferior Lisp in Inferior Lisp mode."
143 :type 'string 141 :type 'string
144 :group 'inferior-lisp) 142 :group 'inferior-lisp)
145 143
146;;;###autoload 144(defcustom inferior-lisp-load-command "(load \"%s\")\n"
147(defcustom inferior-lisp-load-command (purecopy "(load \"%s\")\n")
148 "Format-string for building a Lisp expression to load a file. 145 "Format-string for building a Lisp expression to load a file.
149This format string should use `%s' to substitute a file name 146This format string should use `%s' to substitute a file name
150and should result in a Lisp expression that will command the inferior Lisp 147and should result in a Lisp expression that will command the inferior Lisp
@@ -155,8 +152,7 @@ but it works only in Common Lisp."
155 :type 'string 152 :type 'string
156 :group 'inferior-lisp) 153 :group 'inferior-lisp)
157 154
158;;;###autoload 155(defcustom inferior-lisp-prompt "^[^> \n]*>+:? *"
159(defcustom inferior-lisp-prompt (purecopy "^[^> \n]*>+:? *")
160 "Regexp to recognize prompts in the Inferior Lisp mode. 156 "Regexp to recognize prompts in the Inferior Lisp mode.
161Defaults to \"^[^> \\n]*>+:? *\", which works pretty good for Lucid, kcl, 157Defaults to \"^[^> \\n]*>+:? *\", which works pretty good for Lucid, kcl,
162and franz. This variable is used to initialize `comint-prompt-regexp' in the 158and franz. This variable is used to initialize `comint-prompt-regexp' in the
@@ -207,7 +203,6 @@ one process, this does the right thing. If you run multiple
207processes, you can change `inferior-lisp-buffer' to another process 203processes, you can change `inferior-lisp-buffer' to another process
208buffer with \\[set-variable].") 204buffer with \\[set-variable].")
209 205
210;;;###autoload
211(defvar inferior-lisp-mode-hook '() 206(defvar inferior-lisp-mode-hook '()
212 "Hook for customizing Inferior Lisp mode.") 207 "Hook for customizing Inferior Lisp mode.")
213 208
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 33d43cb3d5a..99df94d3805 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -2110,7 +2110,7 @@ Argument BOUND is a buffer position limiting searching."
2110 (if (eq prolog-system 'mercury) 2110 (if (eq prolog-system 'mercury)
2111 (list 2111 (list
2112 (prolog-make-keywords-regexp prolog-mode-specificators-i t) 2112 (prolog-make-keywords-regexp prolog-mode-specificators-i t)
2113 0 'font-lock-reference-face))) 2113 0 'font-lock-constant-face)))
2114 (directives 2114 (directives
2115 (if (eq prolog-system 'mercury) 2115 (if (eq prolog-system 'mercury)
2116 (list 2116 (list
diff --git a/lisp/progmodes/ps-mode.el b/lisp/progmodes/ps-mode.el
index bf52eff8f9a..a8fc11f71c0 100644
--- a/lisp/progmodes/ps-mode.el
+++ b/lisp/progmodes/ps-mode.el
@@ -213,9 +213,9 @@ If nil, use `temporary-file-directory'."
213;; - 8bit characters (warning face) 213;; - 8bit characters (warning face)
214;; Multiline strings are not supported. Strings with nested brackets are. 214;; Multiline strings are not supported. Strings with nested brackets are.
215(defconst ps-mode-font-lock-keywords-1 215(defconst ps-mode-font-lock-keywords-1
216 '(("\\`%!PS.*" . font-lock-reference-face) 216 '(("\\`%!PS.*" . font-lock-constant-face)
217 ("^%%BoundingBox:[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]*$" 217 ("^%%BoundingBox:[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]+-?[0-9]+[ \t]*$"
218 . font-lock-reference-face) 218 . font-lock-constant-face)
219 (ps-mode-match-string-or-comment 219 (ps-mode-match-string-or-comment
220 (1 font-lock-comment-face nil t) 220 (1 font-lock-comment-face nil t)
221 (2 font-lock-string-face nil t)) 221 (2 font-lock-string-face nil t))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index ffc6c1ac885..e99e6bda4b8 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -497,52 +497,68 @@ The type returned can be `comment', `string' or `paren'."
497 (1 font-lock-variable-name-face nil nil)))) 497 (1 font-lock-variable-name-face nil nil))))
498 498
499(defconst python-syntax-propertize-function 499(defconst python-syntax-propertize-function
500 ;; Make outer chars of matching triple-quote sequences into generic
501 ;; string delimiters. Fixme: Is there a better way?
502 ;; First avoid a sequence preceded by an odd number of backslashes.
503 (syntax-propertize-rules 500 (syntax-propertize-rules
504 (;; ¡Backrefs don't work in syntax-propertize-rules! 501 ((rx
505 (concat "\\(?:\\([RUru]\\)[Rr]?\\|^\\|[^\\]\\(?:\\\\.\\)*\\)" ;Prefix. 502 ;; Match even number of backslashes.
506 "\\(?:\\('\\)'\\('\\)\\|\\(?2:\"\\)\"\\(?3:\"\\)\\)") 503 (or (not (any ?\\ ?\' ?\")) point) (* ?\\ ?\\)
507 (3 (ignore (python-quote-syntax)))))) 504 ;; Match single or triple quotes of any kind.
508 505 (group (or "\"" "\"\"\"" "'" "'''")))
509(defun python-quote-syntax () 506 (1 (ignore (python-syntax-stringify))))
510 "Put `syntax-table' property correctly on triple quote. 507 ((rx
511Used for syntactic keywords. N is the match number (1, 2 or 3)." 508 ;; Match odd number of backslashes.
512 ;; Given a triple quote, we have to check the context to know 509 (or (not (any ?\\)) point) ?\\ (* ?\\ ?\\)
513 ;; whether this is an opening or closing triple or whether it's 510 ;; Followed by even number of equal quotes.
514 ;; quoted anyhow, and should be ignored. (For that we need to do 511 (group (or "\"\"" "\"\"\"\"" "''" "''''")))
515 ;; the same job as `syntax-ppss' to be correct and it seems to be OK 512 (1 (ignore (python-syntax-stringify))))))
516 ;; to use it here despite initial worries.) We also have to sort 513
517 ;; out a possible prefix -- well, we don't _have_ to, but I think it 514(defsubst python-syntax-count-quotes (quote-char &optional point limit)
518 ;; should be treated as part of the string. 515 "Count number of quotes around point (max is 3).
519 516QUOTE-CHAR is the quote char to count. Optional argument POINT is
520 ;; Test cases: 517the point where scan starts (defaults to current point) and LIMIT
521 ;; ur"""ar""" x='"' # """ 518is used to limit the scan."
522 ;; x = ''' """ ' a 519 (let ((i 0))
523 ;; ''' 520 (while (and (< i 3)
524 ;; x '"""' x """ \"""" x 521 (or (not limit) (< (+ point i) limit))
525 (save-excursion 522 (eq (char-after (+ point i)) quote-char))
526 (goto-char (match-beginning 0)) 523 (incf i))
527 (let ((syntax (save-match-data (syntax-ppss)))) 524 i))
528 (cond 525
529 ((eq t (nth 3 syntax)) ; after unclosed fence 526(defun python-syntax-stringify ()
530 ;; Consider property for the last char if in a fenced string. 527 "Put `syntax-table' property correctly on single/triple quotes."
531 (goto-char (nth 8 syntax)) ; fence position 528 (let* ((num-quotes
532 (skip-chars-forward "uUrR") ; skip any prefix 529 (let ((n (length (match-string-no-properties 1))))
533 ;; Is it a matching sequence? 530 ;; This corrects the quote count when matching odd number
534 (if (eq (char-after) (char-after (match-beginning 2))) 531 ;; of backslashes followed by even number of quotes.
535 (put-text-property (match-beginning 3) (match-end 3) 532 (or (and (= 1 (logand n 1)) n) (1- n))))
536 'syntax-table (string-to-syntax "|")))) 533 (ppss (prog2
537 ((match-end 1) 534 (backward-char num-quotes)
538 ;; Consider property for initial char, accounting for prefixes. 535 (syntax-ppss)
539 (put-text-property (match-beginning 1) (match-end 1) 536 (forward-char num-quotes)))
540 'syntax-table (string-to-syntax "|"))) 537 (string-start (and (not (nth 4 ppss)) (nth 8 ppss)))
541 (t 538 (quote-starting-pos (- (point) num-quotes))
542 ;; Consider property for initial char, accounting for prefixes. 539 (quote-ending-pos (point))
543 (put-text-property (match-beginning 2) (match-end 2) 540 (num-closing-quotes
544 'syntax-table (string-to-syntax "|")))) 541 (and string-start
545 ))) 542 (python-syntax-count-quotes
543 (char-before) string-start quote-starting-pos))))
544 (cond ((and string-start (= num-closing-quotes 0))
545 ;; This set of quotes doesn't match the string starting
546 ;; kind. Do nothing.
547 nil)
548 ((not string-start)
549 ;; This set of quotes delimit the start of a string.
550 (put-text-property quote-starting-pos (1+ quote-starting-pos)
551 'syntax-table (string-to-syntax "|")))
552 ((= num-quotes num-closing-quotes)
553 ;; This set of quotes delimit the end of a string.
554 (put-text-property (1- quote-ending-pos) quote-ending-pos
555 'syntax-table (string-to-syntax "|")))
556 ((> num-quotes num-closing-quotes)
557 ;; This may only happen whenever a triple quote is closing
558 ;; a single quoted string. Add string delimiter syntax to
559 ;; all three quotes.
560 (put-text-property quote-starting-pos quote-ending-pos
561 'syntax-table (string-to-syntax "|"))))))
546 562
547(defvar python-mode-syntax-table 563(defvar python-mode-syntax-table
548 (let ((table (make-syntax-table))) 564 (let ((table (make-syntax-table)))
@@ -897,16 +913,27 @@ possible indentation levels and saves it in the variable
897`python-indent-levels'. Afterwards it sets the variable 913`python-indent-levels'. Afterwards it sets the variable
898`python-indent-current-level' correctly so offset is equal 914`python-indent-current-level' correctly so offset is equal
899to (`nth' `python-indent-current-level' `python-indent-levels')" 915to (`nth' `python-indent-current-level' `python-indent-levels')"
900 (if (or (and (eq this-command 'indent-for-tab-command) 916 (or
901 (eq last-command this-command)) 917 (and (or (and (eq this-command 'indent-for-tab-command)
902 force-toggle) 918 (eq last-command this-command))
903 (if (not (equal python-indent-levels '(0))) 919 force-toggle)
904 (python-indent-toggle-levels) 920 (not (equal python-indent-levels '(0)))
905 (python-indent-calculate-levels)) 921 (or (python-indent-toggle-levels) t))
906 (python-indent-calculate-levels)) 922 (python-indent-calculate-levels))
907 (beginning-of-line) 923 (let* ((starting-pos (point-marker))
908 (delete-horizontal-space) 924 (indent-ending-position
909 (indent-to (nth python-indent-current-level python-indent-levels)) 925 (+ (line-beginning-position) (current-indentation)))
926 (follow-indentation-p
927 (or (bolp)
928 (and (<= (line-beginning-position) starting-pos)
929 (>= indent-ending-position starting-pos))))
930 (next-indent (nth python-indent-current-level python-indent-levels)))
931 (unless (= next-indent (current-indentation))
932 (beginning-of-line)
933 (delete-horizontal-space)
934 (indent-to next-indent)
935 (goto-char starting-pos))
936 (and follow-indentation-p (back-to-indentation)))
910 (python-info-closing-block-message)) 937 (python-info-closing-block-message))
911 938
912(defun python-indent-line-function () 939(defun python-indent-line-function ()
@@ -1892,19 +1919,18 @@ Returns the output. See `python-shell-send-string-no-output'."
1892 1919
1893(defun python-shell-send-buffer (&optional arg) 1920(defun python-shell-send-buffer (&optional arg)
1894 "Send the entire buffer to inferior Python process. 1921 "Send the entire buffer to inferior Python process.
1895 1922With prefix ARG allow execution of code inside blocks delimited
1896With prefix ARG include lines surrounded by \"if __name__ == '__main__':\"" 1923by \"if __name__== '__main__':\""
1897 (interactive "P") 1924 (interactive "P")
1898 (save-restriction 1925 (save-restriction
1899 (widen) 1926 (widen)
1900 (python-shell-send-region 1927 (let ((str (buffer-substring (point-min) (point-max))))
1901 (point-min) 1928 (and
1902 (or (and 1929 (not arg)
1903 (not arg) 1930 (setq str (replace-regexp-in-string
1904 (save-excursion 1931 (python-rx if-name-main)
1905 (re-search-forward (python-rx if-name-main) nil t)) 1932 "if __name__ == '__main__ ':" str)))
1906 (match-beginning 0)) 1933 (python-shell-send-string str))))
1907 (point-max)))))
1908 1934
1909(defun python-shell-send-defun (arg) 1935(defun python-shell-send-defun (arg)
1910 "Send the current defun to inferior Python process. 1936 "Send the current defun to inferior Python process.
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 0f02e81cbad..84cf7308d75 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1567,7 +1567,7 @@ See `font-lock-syntax-table'.")
1567 2 font-lock-variable-name-face) 1567 2 font-lock-variable-name-face)
1568 ;; symbols 1568 ;; symbols
1569 '("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" 1569 '("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)"
1570 2 font-lock-reference-face) 1570 2 font-lock-constant-face)
1571 ;; variables 1571 ;; variables
1572 '("\\(\\$\\([^a-zA-Z0-9 \n]\\|[0-9]\\)\\)\\W" 1572 '("\\(\\$\\([^a-zA-Z0-9 \n]\\|[0-9]\\)\\)\\W"
1573 1 font-lock-variable-name-face) 1573 1 font-lock-variable-name-face)
@@ -1576,7 +1576,7 @@ See `font-lock-syntax-table'.")
1576 ;; constants 1576 ;; constants
1577 '("\\(^\\|[^_]\\)\\b\\([A-Z]+\\(\\w\\|_\\)*\\)" 1577 '("\\(^\\|[^_]\\)\\b\\([A-Z]+\\(\\w\\|_\\)*\\)"
1578 2 font-lock-type-face) 1578 2 font-lock-type-face)
1579 '("\\(^\\s *\\|[\[\{\(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+\\):[^:]" 2 font-lock-reference-face) 1579 '("\\(^\\s *\\|[\[\{\(,]\\s *\\|\\sw\\s +\\)\\(\\(\\sw\\|_\\)+\\):[^:]" 2 font-lock-constant-face)
1580 ;; expression expansion 1580 ;; expression expansion
1581 '(ruby-match-expression-expansion 1581 '(ruby-match-expression-expansion
1582 0 font-lock-variable-name-face t) 1582 0 font-lock-variable-name-face t)
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index b4d550bcee0..e94919ee2a9 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -4079,11 +4079,10 @@ option followed by a colon `:' if the option accepts an argument."
4079(defun sh-maybe-here-document (arg) 4079(defun sh-maybe-here-document (arg)
4080 "Insert self. Without prefix, following unquoted `<' inserts here document. 4080 "Insert self. Without prefix, following unquoted `<' inserts here document.
4081The document is bounded by `sh-here-document-word'." 4081The document is bounded by `sh-here-document-word'."
4082 (declare (obsolete sh-electric-here-document-mode "24.3"))
4082 (interactive "*P") 4083 (interactive "*P")
4083 (self-insert-command (prefix-numeric-value arg)) 4084 (self-insert-command (prefix-numeric-value arg))
4084 (or arg (sh--maybe-here-document))) 4085 (or arg (sh--maybe-here-document)))
4085(make-obsolete 'sh--maybe-here-document
4086 'sh-electric-here-document-mode "24.3")
4087 4086
4088(defun sh--maybe-here-document () 4087(defun sh--maybe-here-document ()
4089 (or (not (looking-back "[^<]<<")) 4088 (or (not (looking-back "[^<]<<"))
diff --git a/lisp/progmodes/tcl.el b/lisp/progmodes/tcl.el
index f1ab01fd07f..c82566ca5b6 100644
--- a/lisp/progmodes/tcl.el
+++ b/lisp/progmodes/tcl.el
@@ -104,7 +104,6 @@
104 104
105(eval-when-compile 105(eval-when-compile
106 (require 'imenu) 106 (require 'imenu)
107 (require 'outline)
108 (require 'dabbrev) 107 (require 'dabbrev)
109 (require 'add-log)) 108 (require 'add-log))
110 109
@@ -544,6 +543,9 @@ Uses variables `tcl-proc-regexp' and `tcl-keyword-list'."
544;; The mode itself. 543;; The mode itself.
545;; 544;;
546 545
546(defvar outline-regexp)
547(defvar outline-level)
548
547;;;###autoload 549;;;###autoload
548(define-derived-mode tcl-mode prog-mode "Tcl" 550(define-derived-mode tcl-mode prog-mode "Tcl"
549 "Major mode for editing Tcl code. 551 "Major mode for editing Tcl code.
diff --git a/lisp/progmodes/vera-mode.el b/lisp/progmodes/vera-mode.el
index 31f2fc1fe31..a2f71ff2ab8 100644
--- a/lisp/progmodes/vera-mode.el
+++ b/lisp/progmodes/vera-mode.el
@@ -587,12 +587,6 @@ Key bindings:
587;;; Font locking 587;;; Font locking
588;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 588;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
589 589
590;; XEmacs compatibility
591(when (featurep 'xemacs)
592 (require 'font-lock)
593 (copy-face 'font-lock-reference-face 'font-lock-constant-face)
594 (copy-face 'font-lock-preprocessor-face 'font-lock-builtin-face))
595
596(defun vera-font-lock-match-item (limit) 590(defun vera-font-lock-match-item (limit)
597 "Match, and move over, any declaration item after point. 591 "Match, and move over, any declaration item after point.
598Adapted from `font-lock-match-c-style-declaration-item-and-skip-to-next'." 592Adapted from `font-lock-match-c-style-declaration-item-and-skip-to-next'."
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index 835d548c19f..86ffdf535a0 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -123,9 +123,9 @@
123;;; Code: 123;;; Code:
124 124
125;; This variable will always hold the version number of the mode 125;; This variable will always hold the version number of the mode
126(defconst verilog-mode-version "800" 126(defconst verilog-mode-version (substring "$$Revision: 820 $$" 12 -3)
127 "Version of this Verilog mode.") 127 "Version of this Verilog mode.")
128(defconst verilog-mode-release-date "2012-04-23-GNU" 128(defconst verilog-mode-release-date (substring "$$Date: 2012-09-17 20:43:10 -0400 (Mon, 17 Sep 2012) $$" 8 -3)
129 "Release date of this Verilog mode.") 129 "Release date of this Verilog mode.")
130(defconst verilog-mode-release-emacs t 130(defconst verilog-mode-release-emacs t
131 "If non-nil, this version of Verilog mode was released with Emacs itself.") 131 "If non-nil, this version of Verilog mode was released with Emacs itself.")
@@ -1127,10 +1127,11 @@ won't merge conflict."
1127 :type 'integer) 1127 :type 'integer)
1128(put 'verilog-auto-inst-column 'safe-local-variable 'integerp) 1128(put 'verilog-auto-inst-column 'safe-local-variable 'integerp)
1129 1129
1130(defcustom verilog-auto-inst-interfaced-ports t 1130(defcustom verilog-auto-inst-interfaced-ports nil
1131 "Non-nil means include interfaced ports in AUTOINST expansions." 1131 "Non-nil means include interfaced ports in AUTOINST expansions."
1132 :group 'verilog-mode-auto 1132 :group 'verilog-mode-auto
1133 :type 'boolean) 1133 :type 'boolean
1134 :version "24.3")
1134(put 'verilog-auto-inst-interfaced-ports 'safe-local-variable 'verilog-booleanp) 1135(put 'verilog-auto-inst-interfaced-ports 'safe-local-variable 'verilog-booleanp)
1135 1136
1136(defcustom verilog-auto-input-ignore-regexp nil 1137(defcustom verilog-auto-input-ignore-regexp nil
@@ -1431,12 +1432,18 @@ If set will become buffer local.")
1431 :help "Help on AUTOARG - declaring module port list"] 1432 :help "Help on AUTOARG - declaring module port list"]
1432 ["AUTOASCIIENUM" (describe-function 'verilog-auto-ascii-enum) 1433 ["AUTOASCIIENUM" (describe-function 'verilog-auto-ascii-enum)
1433 :help "Help on AUTOASCIIENUM - creating ASCII for enumerations"] 1434 :help "Help on AUTOASCIIENUM - creating ASCII for enumerations"]
1435 ["AUTOASSIGNMODPORT" (describe-function 'verilog-auto-assign-modport)
1436 :help "Help on AUTOASSIGNMODPORT - creating assignments to/from modports"]
1434 ["AUTOINOUTCOMP" (describe-function 'verilog-auto-inout-comp) 1437 ["AUTOINOUTCOMP" (describe-function 'verilog-auto-inout-comp)
1435 :help "Help on AUTOINOUTCOMP - copying complemented i/o from another file"] 1438 :help "Help on AUTOINOUTCOMP - copying complemented i/o from another file"]
1436 ["AUTOINOUTIN" (describe-function 'verilog-auto-inout-in) 1439 ["AUTOINOUTIN" (describe-function 'verilog-auto-inout-in)
1437 :help "Help on AUTOINOUTCOMP - copying i/o from another file as all inputs"] 1440 :help "Help on AUTOINOUTIN - copying i/o from another file as all inputs"]
1441 ["AUTOINOUTMODPORT" (describe-function 'verilog-auto-inout-modport)
1442 :help "Help on AUTOINOUTMODPORT - copying i/o from an interface modport"]
1438 ["AUTOINOUTMODULE" (describe-function 'verilog-auto-inout-module) 1443 ["AUTOINOUTMODULE" (describe-function 'verilog-auto-inout-module)
1439 :help "Help on AUTOINOUTMODULE - copying i/o from another file"] 1444 :help "Help on AUTOINOUTMODULE - copying i/o from another file"]
1445 ["AUTOINOUTPARAM" (describe-function 'verilog-auto-inout-param)
1446 :help "Help on AUTOINOUTPARAM - copying parameters from another file"]
1440 ["AUTOINSERTLISP" (describe-function 'verilog-auto-insert-lisp) 1447 ["AUTOINSERTLISP" (describe-function 'verilog-auto-insert-lisp)
1441 :help "Help on AUTOINSERTLISP - insert text from a lisp function"] 1448 :help "Help on AUTOINSERTLISP - insert text from a lisp function"]
1442 ["AUTOINOUT" (describe-function 'verilog-auto-inout) 1449 ["AUTOINOUT" (describe-function 'verilog-auto-inout)
@@ -1706,12 +1713,19 @@ This speeds up complicated regexp matches."
1706;;(verilog-re-search-backward-substr "-end" "get-end-of" nil t) ;;-end (test bait) 1713;;(verilog-re-search-backward-substr "-end" "get-end-of" nil t) ;;-end (test bait)
1707 1714
1708(defun verilog-delete-trailing-whitespace () 1715(defun verilog-delete-trailing-whitespace ()
1709 "Delete trailing spaces or tabs, but not newlines nor linefeeds." 1716 "Delete trailing spaces or tabs, but not newlines nor linefeeds.
1717Also add missing final newline.
1718
1719To call this from the command line, see \\[verilog-batch-diff-auto].
1720
1721To call on \\[verilog-auto], set `verilog-auto-delete-trailing-whitespace'."
1710 ;; Similar to `delete-trailing-whitespace' but that's not present in XEmacs 1722 ;; Similar to `delete-trailing-whitespace' but that's not present in XEmacs
1711 (save-excursion 1723 (save-excursion
1712 (goto-char (point-min)) 1724 (goto-char (point-min))
1713 (while (re-search-forward "[ \t]+$" nil t) ;; Not syntactic WS as no formfeed 1725 (while (re-search-forward "[ \t]+$" nil t) ;; Not syntactic WS as no formfeed
1714 (replace-match "" nil nil)))) 1726 (replace-match "" nil nil))
1727 (goto-char (point-max))
1728 (unless (bolp) (insert "\n"))))
1715 1729
1716(defvar compile-command) 1730(defvar compile-command)
1717 1731
@@ -5128,6 +5142,15 @@ with \\[verilog-delete-auto] on all command-line files, and saves the buffers."
5128 (error "Use verilog-batch-delete-auto only with --batch")) ;; Otherwise we'd mess up buffer modes 5142 (error "Use verilog-batch-delete-auto only with --batch")) ;; Otherwise we'd mess up buffer modes
5129 (verilog-batch-execute-func `verilog-delete-auto)) 5143 (verilog-batch-execute-func `verilog-delete-auto))
5130 5144
5145(defun verilog-batch-delete-trailing-whitespace ()
5146 "For use with --batch, perform whitespace deletion as a stand-alone tool.
5147This sets up the appropriate Verilog mode environment, removes
5148whitespace with \\[verilog-delete-trailing-whitespace] on all
5149command-line files, and saves the buffers."
5150 (unless noninteractive
5151 (error "Use verilog-batch-delete-trailing-whitepace only with --batch")) ;; Otherwise we'd mess up buffer modes
5152 (verilog-batch-execute-func `verilog-delete-trailing-whitespace))
5153
5131(defun verilog-batch-diff-auto () 5154(defun verilog-batch-diff-auto ()
5132 "For use with --batch, perform automatic differences as a stand-alone tool. 5155 "For use with --batch, perform automatic differences as a stand-alone tool.
5133This sets up the appropriate Verilog mode environment, expand automatics 5156This sets up the appropriate Verilog mode environment, expand automatics
@@ -7479,6 +7502,19 @@ See also `verilog-sk-header' for an alternative format."
7479(defsubst verilog-alw-get-uses-delayed (sigs) 7502(defsubst verilog-alw-get-uses-delayed (sigs)
7480 (aref sigs 0)) 7503 (aref sigs 0))
7481 7504
7505(defsubst verilog-modport-new (name clockings decls)
7506 (list name clockings decls))
7507(defsubst verilog-modport-name (sig)
7508 (car sig))
7509(defsubst verilog-modport-clockings (sig)
7510 (nth 1 sig)) ;; Returns list of names
7511(defsubst verilog-modport-clockings-add (sig val)
7512 (setcar (nthcdr 1 sig) (cons val (nth 1 sig))))
7513(defsubst verilog-modport-decls (sig)
7514 (nth 2 sig)) ;; Returns verilog-decls-* structure
7515(defsubst verilog-modport-decls-set (sig val)
7516 (setcar (nthcdr 2 sig) val))
7517
7482(defsubst verilog-modi-new (name fob pt type) 7518(defsubst verilog-modi-new (name fob pt type)
7483 (vector name fob pt type)) 7519 (vector name fob pt type))
7484(defsubst verilog-modi-name (modi) 7520(defsubst verilog-modi-name (modi)
@@ -7496,8 +7532,15 @@ See also `verilog-sk-header' for an alternative format."
7496 7532
7497;; Signal reading for given module 7533;; Signal reading for given module
7498;; Note these all take modi's - as returned from verilog-modi-current 7534;; Note these all take modi's - as returned from verilog-modi-current
7499(defsubst verilog-decls-new (out inout in vars unuseds assigns consts gparams interfaces) 7535(defsubst verilog-decls-new (out inout in vars modports assigns consts gparams interfaces)
7500 (vector out inout in vars unuseds assigns consts gparams interfaces)) 7536 (vector out inout in vars modports assigns consts gparams interfaces))
7537(defsubst verilog-decls-append (a b)
7538 (cond ((not a) b) ((not b) a)
7539 (t (vector (append (aref a 0) (aref b 0)) (append (aref a 1) (aref b 1))
7540 (append (aref a 2) (aref b 2)) (append (aref a 3) (aref b 3))
7541 (append (aref a 4) (aref b 4)) (append (aref a 5) (aref b 5))
7542 (append (aref a 6) (aref b 6)) (append (aref a 7) (aref b 7))
7543 (append (aref a 8) (aref b 8))))))
7501(defsubst verilog-decls-get-outputs (decls) 7544(defsubst verilog-decls-get-outputs (decls)
7502 (aref decls 0)) 7545 (aref decls 0))
7503(defsubst verilog-decls-get-inouts (decls) 7546(defsubst verilog-decls-get-inouts (decls)
@@ -7506,8 +7549,8 @@ See also `verilog-sk-header' for an alternative format."
7506 (aref decls 2)) 7549 (aref decls 2))
7507(defsubst verilog-decls-get-vars (decls) 7550(defsubst verilog-decls-get-vars (decls)
7508 (aref decls 3)) 7551 (aref decls 3))
7509;;(defsubst verilog-decls-get-unused (decls) 7552(defsubst verilog-decls-get-modports (decls) ;; Also for clocking blocks; contains another verilog-decls struct
7510;; (aref decls 4)) 7553 (aref decls 4)) ;; Returns verilog-modport* structure
7511(defsubst verilog-decls-get-assigns (decls) 7554(defsubst verilog-decls-get-assigns (decls)
7512 (aref decls 5)) 7555 (aref decls 5))
7513(defsubst verilog-decls-get-consts (decls) 7556(defsubst verilog-decls-get-consts (decls)
@@ -7517,6 +7560,7 @@ See also `verilog-sk-header' for an alternative format."
7517(defsubst verilog-decls-get-interfaces (decls) 7560(defsubst verilog-decls-get-interfaces (decls)
7518 (aref decls 8)) 7561 (aref decls 8))
7519 7562
7563
7520(defsubst verilog-subdecls-new (out inout in intf intfd) 7564(defsubst verilog-subdecls-new (out inout in intf intfd)
7521 (vector out inout in intf intfd)) 7565 (vector out inout in intf intfd))
7522(defsubst verilog-subdecls-get-outputs (subdecls) 7566(defsubst verilog-subdecls-get-outputs (subdecls)
@@ -7535,6 +7579,36 @@ See also `verilog-sk-header' for an alternative format."
7535 (mapcar (lambda (name) (verilog-sig-new name nil nil nil nil nil nil nil nil)) 7579 (mapcar (lambda (name) (verilog-sig-new name nil nil nil nil nil nil nil nil))
7536 signame-list)) 7580 signame-list))
7537 7581
7582(defun verilog-signals-in (in-list not-list)
7583 "Return list of signals in IN-LIST that are also in NOT-LIST.
7584Also remove any duplicates in IN-LIST.
7585Signals must be in standard (base vector) form."
7586 ;; This function is hot, so implemented as O(1)
7587 (cond ((eval-when-compile (fboundp 'make-hash-table))
7588 (let ((ht (make-hash-table :test 'equal :rehash-size 4.0))
7589 (ht-not (make-hash-table :test 'equal :rehash-size 4.0))
7590 out-list)
7591 (while not-list
7592 (puthash (car (car not-list)) t ht-not)
7593 (setq not-list (cdr not-list)))
7594 (while in-list
7595 (when (and (gethash (verilog-sig-name (car in-list)) ht-not)
7596 (not (gethash (verilog-sig-name (car in-list)) ht)))
7597 (setq out-list (cons (car in-list) out-list))
7598 (puthash (verilog-sig-name (car in-list)) t ht))
7599 (setq in-list (cdr in-list)))
7600 (nreverse out-list)))
7601 ;; Slower Fallback if no hash tables (pre Emacs 21.1/XEmacs 21.4)
7602 (t
7603 (let (out-list)
7604 (while in-list
7605 (if (and (assoc (verilog-sig-name (car in-list)) not-list)
7606 (not (assoc (verilog-sig-name (car in-list)) out-list)))
7607 (setq out-list (cons (car in-list) out-list)))
7608 (setq in-list (cdr in-list)))
7609 (nreverse out-list)))))
7610;;(verilog-signals-in '(("A" "") ("B" "") ("DEL" "[2:3]")) '(("DEL" "") ("C" "")))
7611
7538(defun verilog-signals-not-in (in-list not-list) 7612(defun verilog-signals-not-in (in-list not-list)
7539 "Return list of signals in IN-LIST that aren't also in NOT-LIST. 7613 "Return list of signals in IN-LIST that aren't also in NOT-LIST.
7540Also remove any duplicates in IN-LIST. 7614Also remove any duplicates in IN-LIST.
@@ -7556,8 +7630,8 @@ Signals must be in standard (base vector) form."
7556 (t 7630 (t
7557 (let (out-list) 7631 (let (out-list)
7558 (while in-list 7632 (while in-list
7559 (if (not (or (assoc (verilog-sig-name (car in-list)) not-list) 7633 (if (and (not (assoc (verilog-sig-name (car in-list)) not-list))
7560 (assoc (verilog-sig-name (car in-list)) out-list))) 7634 (not (assoc (verilog-sig-name (car in-list)) out-list)))
7561 (setq out-list (cons (car in-list) out-list))) 7635 (setq out-list (cons (car in-list) out-list)))
7562 (setq in-list (cdr in-list))) 7636 (setq in-list (cdr in-list)))
7563 (nreverse out-list))))) 7637 (nreverse out-list)))))
@@ -7702,30 +7776,35 @@ Tieoff value uses `verilog-active-low-regexp' and
7702;; Dumping 7776;; Dumping
7703;; 7777;;
7704 7778
7705(defun verilog-decls-princ (decls) 7779(defun verilog-decls-princ (decls &optional header prefix)
7706 "For debug, dump the `verilog-read-decls' structure DECLS." 7780 "For debug, dump the `verilog-read-decls' structure DECLS."
7707 (verilog-signals-princ (verilog-decls-get-outputs decls) 7781 (when decls
7708 "Outputs:\n" " ") 7782 (if header (princ header))
7709 (verilog-signals-princ (verilog-decls-get-inouts decls) 7783 (setq prefix (or prefix ""))
7710 "Inout:\n" " ") 7784 (verilog-signals-princ (verilog-decls-get-outputs decls)
7711 (verilog-signals-princ (verilog-decls-get-inputs decls) 7785 (concat prefix "Outputs:\n") (concat prefix " "))
7712 "Inputs:\n" " ") 7786 (verilog-signals-princ (verilog-decls-get-inouts decls)
7713 (verilog-signals-princ (verilog-decls-get-vars decls) 7787 (concat prefix "Inout:\n") (concat prefix " "))
7714 "Vars:\n" " ") 7788 (verilog-signals-princ (verilog-decls-get-inputs decls)
7715 (verilog-signals-princ (verilog-decls-get-assigns decls) 7789 (concat prefix "Inputs:\n") (concat prefix " "))
7716 "Assigns:\n" " ") 7790 (verilog-signals-princ (verilog-decls-get-vars decls)
7717 (verilog-signals-princ (verilog-decls-get-consts decls) 7791 (concat prefix "Vars:\n") (concat prefix " "))
7718 "Consts:\n" " ") 7792 (verilog-signals-princ (verilog-decls-get-assigns decls)
7719 (verilog-signals-princ (verilog-decls-get-gparams decls) 7793 (concat prefix "Assigns:\n") (concat prefix " "))
7720 "Gparams:\n" " ") 7794 (verilog-signals-princ (verilog-decls-get-consts decls)
7721 (verilog-signals-princ (verilog-decls-get-interfaces decls) 7795 (concat prefix "Consts:\n") (concat prefix " "))
7722 "Interfaces:\n" " ") 7796 (verilog-signals-princ (verilog-decls-get-gparams decls)
7723 (princ "\n")) 7797 (concat prefix "Gparams:\n") (concat prefix " "))
7798 (verilog-signals-princ (verilog-decls-get-interfaces decls)
7799 (concat prefix "Interfaces:\n") (concat prefix " "))
7800 (verilog-modport-princ (verilog-decls-get-modports decls)
7801 (concat prefix "Modports:\n") (concat prefix " "))
7802 (princ "\n")))
7724 7803
7725(defun verilog-signals-princ (signals &optional header prefix) 7804(defun verilog-signals-princ (signals &optional header prefix)
7726 "For debug, dump internal SIGNALS structures, with HEADER and PREFIX." 7805 "For debug, dump internal SIGNALS structures, with HEADER and PREFIX."
7727 (when signals 7806 (when signals
7728 (princ header) 7807 (if header (princ header))
7729 (while signals 7808 (while signals
7730 (let ((sig (car signals))) 7809 (let ((sig (car signals)))
7731 (setq signals (cdr signals)) 7810 (setq signals (cdr signals))
@@ -7741,6 +7820,21 @@ Tieoff value uses `verilog-active-low-regexp' and
7741 (princ " modp=") (princ (verilog-sig-modport sig)) 7820 (princ " modp=") (princ (verilog-sig-modport sig))
7742 (princ "\n"))))) 7821 (princ "\n")))))
7743 7822
7823(defun verilog-modport-princ (modports &optional header prefix)
7824 "For debug, dump internal MODPORT structures, with HEADER and PREFIX."
7825 (when modports
7826 (if header (princ header))
7827 (while modports
7828 (let ((sig (car modports)))
7829 (setq modports (cdr modports))
7830 (princ prefix)
7831 (princ "\"") (princ (verilog-modport-name sig)) (princ "\"")
7832 (princ " clockings=") (princ (verilog-modport-clockings sig))
7833 (princ "\n")
7834 (verilog-decls-princ (verilog-modport-decls sig)
7835 (concat prefix " syms:\n")
7836 (concat prefix " "))))))
7837
7744;; 7838;;
7745;; Port/Wire/Etc Reading 7839;; Port/Wire/Etc Reading
7746;; 7840;;
@@ -7851,11 +7945,12 @@ Optional NUM-PARAM and MAX-PARAM check for a specific number of parameters."
7851Return an array of [outputs inouts inputs wire reg assign const]." 7945Return an array of [outputs inouts inputs wire reg assign const]."
7852 (let ((end-mod-point (or (verilog-get-end-of-defun t) (point-max))) 7946 (let ((end-mod-point (or (verilog-get-end-of-defun t) (point-max)))
7853 (functask 0) (paren 0) (sig-paren 0) (v2kargs-ok t) 7947 (functask 0) (paren 0) (sig-paren 0) (v2kargs-ok t)
7854 in-modport ptype ign-prop 7948 in-modport in-clocking ptype ign-prop
7855 sigs-in sigs-out sigs-inout sigs-var sigs-assign sigs-const 7949 sigs-in sigs-out sigs-inout sigs-var sigs-assign sigs-const
7856 sigs-gparam sigs-intf 7950 sigs-gparam sigs-intf sigs-modports
7857 vec expect-signal keywd newsig rvalue enum io signed typedefed multidim 7951 vec expect-signal keywd newsig rvalue enum io signed typedefed multidim
7858 modport) 7952 modport
7953 varstack tmp)
7859 (save-excursion 7954 (save-excursion
7860 (verilog-beg-of-defun-quick) 7955 (verilog-beg-of-defun-quick)
7861 (setq sigs-const (verilog-read-auto-constants (point) end-mod-point)) 7956 (setq sigs-const (verilog-read-auto-constants (point) end-mod-point))
@@ -7881,6 +7976,17 @@ Return an array of [outputs inouts inputs wire reg assign const]."
7881 (or (re-search-forward "[^\\]\"" nil t) ;; don't forward-char first, since we look for a non backslash first 7976 (or (re-search-forward "[^\\]\"" nil t) ;; don't forward-char first, since we look for a non backslash first
7882 (error "%s: Unmatched quotes, at char %d" (verilog-point-text) (point)))) 7977 (error "%s: Unmatched quotes, at char %d" (verilog-point-text) (point))))
7883 ((eq ?\; (following-char)) 7978 ((eq ?\; (following-char))
7979 (when (and in-modport (not (eq in-modport t))) ;; end of a modport declaration
7980 (verilog-modport-decls-set
7981 in-modport
7982 (verilog-decls-new sigs-out sigs-inout sigs-in
7983 nil nil nil nil nil nil))
7984 ;; Pop from varstack to restore state to pre-clocking
7985 (setq tmp (car varstack)
7986 varstack (cdr varstack)
7987 sigs-out (aref tmp 0)
7988 sigs-inout (aref tmp 1)
7989 sigs-in (aref tmp 2)))
7884 (setq vec nil io nil expect-signal nil newsig nil paren 0 rvalue nil 7990 (setq vec nil io nil expect-signal nil newsig nil paren 0 rvalue nil
7885 v2kargs-ok nil in-modport nil ign-prop nil) 7991 v2kargs-ok nil in-modport nil ign-prop nil)
7886 (forward-char 1)) 7992 (forward-char 1))
@@ -7974,15 +8080,17 @@ Return an array of [outputs inouts inputs wire reg assign const]."
7974 (setq signed keywd)) 8080 (setq signed keywd))
7975 ((member keywd '("assert" "assume" "cover" "expect" "restrict")) 8081 ((member keywd '("assert" "assume" "cover" "expect" "restrict"))
7976 (setq ign-prop t)) 8082 (setq ign-prop t))
7977 ((member keywd '("class" "clocking" "covergroup" "function" 8083 ((member keywd '("class" "covergroup" "function"
7978 "property" "randsequence" "sequence" "task")) 8084 "property" "randsequence" "sequence" "task"))
7979 (unless ign-prop 8085 (unless ign-prop
7980 (setq functask (1+ functask)))) 8086 (setq functask (1+ functask))))
7981 ((member keywd '("endclass" "endclocking" "endgroup" "endfunction" 8087 ((member keywd '("endclass" "endgroup" "endfunction"
7982 "endproperty" "endsequence" "endtask")) 8088 "endproperty" "endsequence" "endtask"))
7983 (setq functask (1- functask))) 8089 (setq functask (1- functask)))
7984 ((equal keywd "modport") 8090 ((equal keywd "modport")
7985 (setq in-modport t)) 8091 (setq in-modport t))
8092 ((equal keywd "clocking")
8093 (setq in-clocking t))
7986 ((equal keywd "type") 8094 ((equal keywd "type")
7987 (setq ptype t)) 8095 (setq ptype t))
7988 ;; Ifdef? Ignore name of define 8096 ;; Ifdef? Ignore name of define
@@ -8008,11 +8116,47 @@ Return an array of [outputs inouts inputs wire reg assign const]."
8008 (goto-char (match-end 0)) 8116 (goto-char (match-end 0))
8009 (when (not rvalue) 8117 (when (not rvalue)
8010 (setq expect-signal nil))) 8118 (setq expect-signal nil)))
8119 ;; "modport <keywd>"
8120 ((and (eq in-modport t)
8121 (not (member keywd verilog-keywords)))
8122 (setq in-modport (verilog-modport-new keywd nil nil))
8123 (setq sigs-modports (cons in-modport sigs-modports))
8124 ;; Push old sig values to stack and point to new signal list
8125 (setq varstack (cons (vector sigs-out sigs-inout sigs-in)
8126 varstack))
8127 (setq sigs-in nil sigs-inout nil sigs-out nil))
8128 ;; "modport x (clocking <keywd>)"
8129 ((and in-modport in-clocking)
8130 (verilog-modport-clockings-add in-modport keywd)
8131 (setq in-clocking nil))
8132 ;; endclocking
8133 ((and in-clocking
8134 (equal keywd "endclocking"))
8135 (unless (eq in-clocking t)
8136 (verilog-modport-decls-set
8137 in-clocking
8138 (verilog-decls-new sigs-out sigs-inout sigs-in
8139 nil nil nil nil nil nil))
8140 ;; Pop from varstack to restore state to pre-clocking
8141 (setq tmp (car varstack)
8142 varstack (cdr varstack)
8143 sigs-out (aref tmp 0)
8144 sigs-inout (aref tmp 1)
8145 sigs-in (aref tmp 2)))
8146 (setq in-clocking nil))
8147 ;; "clocking <keywd>"
8148 ((and (eq in-clocking t)
8149 (not (member keywd verilog-keywords)))
8150 (setq in-clocking (verilog-modport-new keywd nil nil))
8151 (setq sigs-modports (cons in-clocking sigs-modports))
8152 ;; Push old sig values to stack and point to new signal list
8153 (setq varstack (cons (vector sigs-out sigs-inout sigs-in)
8154 varstack))
8155 (setq sigs-in nil sigs-inout nil sigs-out nil))
8011 ;; New signal, maybe? 8156 ;; New signal, maybe?
8012 ((and expect-signal 8157 ((and expect-signal
8013 (not rvalue) 8158 (not rvalue)
8014 (eq functask 0) 8159 (eq functask 0)
8015 (not in-modport)
8016 (not (member keywd verilog-keywords))) 8160 (not (member keywd verilog-keywords)))
8017 ;; Add new signal to expect-signal's variable 8161 ;; Add new signal to expect-signal's variable
8018 (setq newsig (verilog-sig-new keywd vec nil nil enum signed typedefed multidim modport)) 8162 (setq newsig (verilog-sig-new keywd vec nil nil enum signed typedefed multidim modport))
@@ -8022,15 +8166,17 @@ Return an array of [outputs inouts inputs wire reg assign const]."
8022 (forward-char 1))) 8166 (forward-char 1)))
8023 (skip-syntax-forward " ")) 8167 (skip-syntax-forward " "))
8024 ;; Return arguments 8168 ;; Return arguments
8025 (verilog-decls-new (nreverse sigs-out) 8169 (setq tmp (verilog-decls-new (nreverse sigs-out)
8026 (nreverse sigs-inout) 8170 (nreverse sigs-inout)
8027 (nreverse sigs-in) 8171 (nreverse sigs-in)
8028 (nreverse sigs-var) 8172 (nreverse sigs-var)
8029 nil 8173 (nreverse sigs-modports)
8030 (nreverse sigs-assign) 8174 (nreverse sigs-assign)
8031 (nreverse sigs-const) 8175 (nreverse sigs-const)
8032 (nreverse sigs-gparam) 8176 (nreverse sigs-gparam)
8033 (nreverse sigs-intf))))) 8177 (nreverse sigs-intf)))
8178 ;;(if dbg (verilog-decls-princ tmp))
8179 tmp)))
8034 8180
8035(defvar verilog-read-sub-decls-in-interfaced nil 8181(defvar verilog-read-sub-decls-in-interfaced nil
8036 "For `verilog-read-sub-decls', process next signal as under interfaced block.") 8182 "For `verilog-read-sub-decls', process next signal as under interfaced block.")
@@ -9352,12 +9498,12 @@ Return modi if successful, else print message unless IGNORE-ERROR is true."
9352 ;;(message "verilog-modi-lookup: HIT %S" modi) 9498 ;;(message "verilog-modi-lookup: HIT %S" modi)
9353 modi) 9499 modi)
9354 ;; Miss 9500 ;; Miss
9355 (t (let* ((realmod (verilog-symbol-detick module t)) 9501 (t (let* ((realname (verilog-symbol-detick module t))
9356 (orig-filenames (verilog-module-filenames realmod current)) 9502 (orig-filenames (verilog-module-filenames realname current))
9357 (filenames orig-filenames) 9503 (filenames orig-filenames)
9358 mif) 9504 mif)
9359 (while (and filenames (not mif)) 9505 (while (and filenames (not mif))
9360 (if (not (setq mif (verilog-module-inside-filename-p realmod (car filenames)))) 9506 (if (not (setq mif (verilog-module-inside-filename-p realname (car filenames))))
9361 (setq filenames (cdr filenames)))) 9507 (setq filenames (cdr filenames))))
9362 ;; mif has correct form to become later elements of modi 9508 ;; mif has correct form to become later elements of modi
9363 (cond (mif (setq modi mif)) 9509 (cond (mif (setq modi mif))
@@ -9365,8 +9511,8 @@ Return modi if successful, else print message unless IGNORE-ERROR is true."
9365 (or ignore-error 9511 (or ignore-error
9366 (error (concat (verilog-point-text) 9512 (error (concat (verilog-point-text)
9367 ": Can't locate " module " module definition" 9513 ": Can't locate " module " module definition"
9368 (if (not (equal module realmod)) 9514 (if (not (equal module realname))
9369 (concat " (Expanded macro to " realmod ")") 9515 (concat " (Expanded macro to " realname ")")
9370 "") 9516 "")
9371 "\n Check the verilog-library-directories variable." 9517 "\n Check the verilog-library-directories variable."
9372 "\n I looked in (if not listed, doesn't exist):\n\t" 9518 "\n I looked in (if not listed, doesn't exist):\n\t"
@@ -9465,6 +9611,45 @@ and invalidating the cache."
9465 (progn ,@body))) 9611 (progn ,@body)))
9466 9612
9467 9613
9614(defun verilog-modi-modport-lookup-one (modi name &optional ignore-error)
9615 "Given a MODI, return the declarations related to the given modport NAME."
9616 ;; Recursive routine - see below
9617 (let* ((realname (verilog-symbol-detick name t))
9618 (modport (assoc name (verilog-decls-get-modports (verilog-modi-get-decls modi)))))
9619 (or modport ignore-error
9620 (error (concat (verilog-point-text)
9621 ": Can't locate " name " modport definition"
9622 (if (not (equal name realname))
9623 (concat " (Expanded macro to " realname ")")
9624 ""))))
9625 (let* ((decls (verilog-modport-decls modport))
9626 (clks (verilog-modport-clockings modport)))
9627 ;; Now expand any clocking's
9628 (while clks
9629 (setq decls (verilog-decls-append
9630 decls
9631 (verilog-modi-modport-lookup-one modi (car clks) ignore-error)))
9632 (setq clks (cdr clks)))
9633 decls)))
9634
9635(defun verilog-modi-modport-lookup (modi name-re &optional ignore-error)
9636 "Given a MODI, return the declarations related to the given modport NAME-RE.
9637If the modport points to any clocking blocks, expand the signals to include
9638those clocking block's signals."
9639 ;; Recursive routine - see below
9640 (let* ((mod-decls (verilog-modi-get-decls modi))
9641 (clks (verilog-decls-get-modports mod-decls))
9642 (name-re (concat "^" name-re "$"))
9643 (decls (verilog-decls-new nil nil nil nil nil nil nil nil nil)))
9644 ;; Pull in all modports
9645 (while clks
9646 (when (string-match name-re (verilog-modport-name (car clks)))
9647 (setq decls (verilog-decls-append
9648 decls
9649 (verilog-modi-modport-lookup-one modi (verilog-modport-name (car clks)) ignore-error))))
9650 (setq clks (cdr clks)))
9651 decls))
9652
9468(defun verilog-signals-matching-enum (in-list enum) 9653(defun verilog-signals-matching-enum (in-list enum)
9469 "Return all signals in IN-LIST matching the given ENUM." 9654 "Return all signals in IN-LIST matching the given ENUM."
9470 (let (out-list) 9655 (let (out-list)
@@ -9544,6 +9729,13 @@ if non-nil."
9544 (verilog-decls-get-inouts decls) 9729 (verilog-decls-get-inouts decls)
9545 (verilog-decls-get-inputs decls))) 9730 (verilog-decls-get-inputs decls)))
9546 9731
9732(defun verilog-decls-get-iovars (decls)
9733 (append
9734 (verilog-decls-get-vars decls)
9735 (verilog-decls-get-outputs decls)
9736 (verilog-decls-get-inouts decls)
9737 (verilog-decls-get-inputs decls)))
9738
9547(defsubst verilog-modi-cache-add-outputs (modi sig-list) 9739(defsubst verilog-modi-cache-add-outputs (modi sig-list)
9548 (verilog-modi-cache-add modi 'verilog-read-decls 0 sig-list)) 9740 (verilog-modi-cache-add modi 'verilog-read-decls 0 sig-list))
9549(defsubst verilog-modi-cache-add-inouts (modi sig-list) 9741(defsubst verilog-modi-cache-add-inouts (modi sig-list)
@@ -9552,6 +9744,8 @@ if non-nil."
9552 (verilog-modi-cache-add modi 'verilog-read-decls 2 sig-list)) 9744 (verilog-modi-cache-add modi 'verilog-read-decls 2 sig-list))
9553(defsubst verilog-modi-cache-add-vars (modi sig-list) 9745(defsubst verilog-modi-cache-add-vars (modi sig-list)
9554 (verilog-modi-cache-add modi 'verilog-read-decls 3 sig-list)) 9746 (verilog-modi-cache-add modi 'verilog-read-decls 3 sig-list))
9747(defsubst verilog-modi-cache-add-gparams (modi sig-list)
9748 (verilog-modi-cache-add modi 'verilog-read-decls 7 sig-list))
9555 9749
9556 9750
9557;; 9751;;
@@ -9608,6 +9802,8 @@ When MODI is non-null, also add to modi-cache, for tracking."
9608 (when verilog-auto-declare-nettype 9802 (when verilog-auto-declare-nettype
9609 (verilog-modi-cache-add-vars modi sigs))) 9803 (verilog-modi-cache-add-vars modi sigs)))
9610 ((equal direction "interface")) 9804 ((equal direction "interface"))
9805 ((equal direction "parameter")
9806 (verilog-modi-cache-add-gparams modi sigs))
9611 (t 9807 (t
9612 (error "Unsupported verilog-insert-definition direction: %s" direction)))) 9808 (error "Unsupported verilog-insert-definition direction: %s" direction))))
9613 (or dont-sort 9809 (or dont-sort
@@ -9654,6 +9850,11 @@ Presumes that any newlines end a list element."
9654 stuff (cdr stuff))))) 9850 stuff (cdr stuff)))))
9655;;(let ((indent-pt 10)) (verilog-insert-indent "hello\n" "addon" "there\n")) 9851;;(let ((indent-pt 10)) (verilog-insert-indent "hello\n" "addon" "there\n"))
9656 9852
9853(defun verilog-forward-or-insert-line ()
9854 "Move forward a line, unless at EOB, then insert a newline."
9855 (if (eobp) (insert "\n")
9856 (forward-line)))
9857
9657(defun verilog-repair-open-comma () 9858(defun verilog-repair-open-comma ()
9658 "Insert comma if previous argument is other than an open parenthesis or endif." 9859 "Insert comma if previous argument is other than an open parenthesis or endif."
9659 ;; We can't just search backward for ) as it might be inside another expression. 9860 ;; We can't just search backward for ) as it might be inside another expression.
@@ -9741,6 +9942,17 @@ This repairs those mis-inserted by an AUTOARG."
9741 "\\([])}:*+-]\\)") 9942 "\\([])}:*+-]\\)")
9742 out) 9943 out)
9743 (setq out (replace-match "\\1\\2\\3" nil nil out))) 9944 (setq out (replace-match "\\1\\2\\3" nil nil out)))
9945 (while (string-match
9946 (concat "\\([[({:*+-]\\)" ; - must be last
9947 "\\$clog2\\s *(\\<\\([0-9]+\\))"
9948 "\\([])}:*+-]\\)")
9949 out)
9950 (setq out (replace-match
9951 (concat
9952 (match-string 1 out)
9953 (int-to-string (verilog-clog2 (string-to-number (match-string 2 out))))
9954 (match-string 3 out))
9955 nil nil out)))
9744 ;; For precedence do * before +/- 9956 ;; For precedence do * before +/-
9745 (while (string-match 9957 (while (string-match
9746 (concat "\\([[({:*+-]\\)" 9958 (concat "\\([[({:*+-]\\)"
@@ -9777,6 +9989,7 @@ This repairs those mis-inserted by an AUTOARG."
9777 post) 9989 post)
9778 nil nil out)) ))) 9990 nil nil out)) )))
9779 out))) 9991 out)))
9992
9780;;(verilog-simplify-range-expression "[1:3]") ;; 1 9993;;(verilog-simplify-range-expression "[1:3]") ;; 1
9781;;(verilog-simplify-range-expression "[(1):3]") ;; 1 9994;;(verilog-simplify-range-expression "[(1):3]") ;; 1
9782;;(verilog-simplify-range-expression "[(((16)+1)+1+(1+1))]") ;;20 9995;;(verilog-simplify-range-expression "[(((16)+1)+1+(1+1))]") ;;20
@@ -9785,6 +9998,14 @@ This repairs those mis-inserted by an AUTOARG."
9785;;(verilog-simplify-range-expression "[(FOO*4+1-1)]") ;; FOO*4+0 9998;;(verilog-simplify-range-expression "[(FOO*4+1-1)]") ;; FOO*4+0
9786;;(verilog-simplify-range-expression "[(func(BAR))]") ;; func(BAR) 9999;;(verilog-simplify-range-expression "[(func(BAR))]") ;; func(BAR)
9787;;(verilog-simplify-range-expression "[FOO-1+1-1+1]") ;; FOO-0 10000;;(verilog-simplify-range-expression "[FOO-1+1-1+1]") ;; FOO-0
10001;;(verilog-simplify-range-expression "[$clog2(2)]") ;; 1
10002;;(verilog-simplify-range-expression "[$clog2(7)]") ;; 3
10003
10004(defun verilog-clog2 (value)
10005 "Compute $clog2 - ceiling log2 of VALUE."
10006 (if (< value 1)
10007 0
10008 (ceiling (/ (log value) (log 2)))))
9788 10009
9789(defun verilog-typedef-name-p (variable-name) 10010(defun verilog-typedef-name-p (variable-name)
9790 "Return true if the VARIABLE-NAME is a type definition." 10011 "Return true if the VARIABLE-NAME is a type definition."
@@ -10348,6 +10569,86 @@ Avoid declaring ports manually, as it makes code harder to maintain."
10348 (insert "\n")) 10569 (insert "\n"))
10349 (indent-to verilog-indent-level-declaration)))) 10570 (indent-to verilog-indent-level-declaration))))
10350 10571
10572(defun verilog-auto-assign-modport ()
10573 "Expand AUTOASSIGNMODPORT statements, as part of \\[verilog-auto].
10574Take input/output/inout statements from the specified interface
10575and modport and use to build assignments into the modport, for
10576making verification modules that connect to UVM interfaces.
10577
10578 The first parameter is the name of an interface.
10579
10580 The second parameter is a regexp of modports to read from in
10581 that interface.
10582
10583 The third parameter is the instance name to use to dot reference into.
10584
10585 The optional fourth parameter is a regular expression, and only
10586 signals matching the regular expression will be included.
10587
10588Limitations:
10589
10590 Interface names must be resolvable to filenames. See `verilog-auto-inst'.
10591
10592 Inouts are not supported, as assignments must be unidirectional.
10593
10594 If a signal is part of the interface header and in both a
10595 modport and the interface itself, it will not be listed. (As
10596 this would result in a syntax error when the connections are
10597 made.)
10598
10599See the example in `verilog-auto-inout-modport'."
10600 (save-excursion
10601 (let* ((params (verilog-read-auto-params 3 4))
10602 (submod (nth 0 params))
10603 (modport-re (nth 1 params))
10604 (inst-name (nth 2 params))
10605 (regexp (nth 3 params))
10606 direction-re submodi) ;; direction argument not supported until requested
10607 ;; Lookup position, etc of co-module
10608 ;; Note this may raise an error
10609 (when (setq submodi (verilog-modi-lookup submod t))
10610 (let* ((indent-pt (current-indentation))
10611 (modi (verilog-modi-current))
10612 (submoddecls (verilog-modi-get-decls submodi))
10613 (submodportdecls (verilog-modi-modport-lookup submodi modport-re))
10614 (sig-list-i (verilog-signals-in ;; Decls doesn't have data types, must resolve
10615 (verilog-decls-get-vars submoddecls)
10616 (verilog-signals-not-in
10617 (verilog-decls-get-inputs submodportdecls)
10618 (verilog-decls-get-ports submoddecls))))
10619 (sig-list-o (verilog-signals-in ;; Decls doesn't have data types, must resolve
10620 (verilog-decls-get-vars submoddecls)
10621 (verilog-signals-not-in
10622 (verilog-decls-get-outputs submodportdecls)
10623 (verilog-decls-get-ports submoddecls)))))
10624 (forward-line 1)
10625 (setq sig-list-i (verilog-signals-edit-wire-reg
10626 (verilog-signals-matching-dir-re
10627 (verilog-signals-matching-regexp sig-list-i regexp)
10628 "input" direction-re))
10629 sig-list-o (verilog-signals-edit-wire-reg
10630 (verilog-signals-matching-dir-re
10631 (verilog-signals-matching-regexp sig-list-o regexp)
10632 "output" direction-re)))
10633 (setq sig-list-i (sort (copy-alist sig-list-i) `verilog-signals-sort-compare))
10634 (setq sig-list-o (sort (copy-alist sig-list-o) `verilog-signals-sort-compare))
10635 (when (or sig-list-i sig-list-o)
10636 (verilog-insert-indent "// Beginning of automatic assignments from modport\n")
10637 ;; Don't sort them so an upper AUTOINST will match the main module
10638 (let ((sigs sig-list-o))
10639 (while sigs
10640 (verilog-insert-indent "assign " (verilog-sig-name (car sigs))
10641 " = " inst-name
10642 "." (verilog-sig-name (car sigs)) ";\n")
10643 (setq sigs (cdr sigs))))
10644 (let ((sigs sig-list-i))
10645 (while sigs
10646 (verilog-insert-indent "assign " inst-name
10647 "." (verilog-sig-name (car sigs))
10648 " = " (verilog-sig-name (car sigs)) ";\n")
10649 (setq sigs (cdr sigs))))
10650 (verilog-insert-indent "// End of automatics\n")))))))
10651
10351(defun verilog-auto-inst-port-map (port-st) 10652(defun verilog-auto-inst-port-map (port-st)
10352 nil) 10653 nil)
10353 10654
@@ -11067,8 +11368,8 @@ Typing \\[verilog-auto] will make this into:
11067 (verilog-subdecls-get-interfaced modsubdecls) 11368 (verilog-subdecls-get-interfaced modsubdecls)
11068 (verilog-subdecls-get-outputs modsubdecls) 11369 (verilog-subdecls-get-outputs modsubdecls)
11069 (verilog-subdecls-get-inouts modsubdecls))))) 11370 (verilog-subdecls-get-inouts modsubdecls)))))
11070 (forward-line 1)
11071 (when sig-list 11371 (when sig-list
11372 (verilog-forward-or-insert-line)
11072 (verilog-insert-indent "// Beginning of automatic regs (for this module's undeclared outputs)\n") 11373 (verilog-insert-indent "// Beginning of automatic regs (for this module's undeclared outputs)\n")
11073 (verilog-insert-definition modi sig-list "reg" indent-pt nil) 11374 (verilog-insert-definition modi sig-list "reg" indent-pt nil)
11074 (verilog-insert-indent "// End of automatics\n"))))) 11375 (verilog-insert-indent "// End of automatics\n")))))
@@ -11122,8 +11423,8 @@ Typing \\[verilog-auto] will make this into:
11122 (verilog-subdecls-get-inouts modsubdecls)) 11423 (verilog-subdecls-get-inouts modsubdecls))
11123 (append (verilog-decls-get-signals moddecls) 11424 (append (verilog-decls-get-signals moddecls)
11124 (verilog-decls-get-assigns moddecls)))))) 11425 (verilog-decls-get-assigns moddecls))))))
11125 (forward-line 1)
11126 (when sig-list 11426 (when sig-list
11427 (verilog-forward-or-insert-line)
11127 (verilog-insert-indent "// Beginning of automatic reg inputs (for undeclared instantiated-module inputs)\n") 11428 (verilog-insert-indent "// Beginning of automatic reg inputs (for undeclared instantiated-module inputs)\n")
11128 (verilog-insert-definition modi sig-list "reg" indent-pt nil) 11429 (verilog-insert-definition modi sig-list "reg" indent-pt nil)
11129 (verilog-insert-indent "// End of automatics\n"))))) 11430 (verilog-insert-indent "// End of automatics\n")))))
@@ -11210,8 +11511,8 @@ Typing \\[verilog-auto] will make this into:
11210 (append (verilog-subdecls-get-outputs modsubdecls) 11511 (append (verilog-subdecls-get-outputs modsubdecls)
11211 (verilog-subdecls-get-inouts modsubdecls)) 11512 (verilog-subdecls-get-inouts modsubdecls))
11212 (verilog-decls-get-signals moddecls))))) 11513 (verilog-decls-get-signals moddecls)))))
11213 (forward-line 1)
11214 (when sig-list 11514 (when sig-list
11515 (verilog-forward-or-insert-line)
11215 (verilog-insert-indent "// Beginning of automatic wires (for undeclared instantiated-module outputs)\n") 11516 (verilog-insert-indent "// Beginning of automatic wires (for undeclared instantiated-module outputs)\n")
11216 (verilog-insert-definition modi sig-list "wire" indent-pt nil) 11517 (verilog-insert-definition modi sig-list "wire" indent-pt nil)
11217 (verilog-insert-indent "// End of automatics\n") 11518 (verilog-insert-indent "// End of automatics\n")
@@ -11221,7 +11522,7 @@ Typing \\[verilog-auto] will make this into:
11221 ;; syntax-ppss which is broken when change hooks are disabled. 11522 ;; syntax-ppss which is broken when change hooks are disabled.
11222 )))) 11523 ))))
11223 11524
11224(defun verilog-auto-output (&optional with-params) 11525(defun verilog-auto-output ()
11225 "Expand AUTOOUTPUT statements, as part of \\[verilog-auto]. 11526 "Expand AUTOOUTPUT statements, as part of \\[verilog-auto].
11226Make output statements for any output signal from an /*AUTOINST*/ that 11527Make output statements for any output signal from an /*AUTOINST*/ that
11227isn't an input to another AUTOINST. This is useful for modules which 11528isn't an input to another AUTOINST. This is useful for modules which
@@ -11273,8 +11574,8 @@ same expansion will result from only extracting outputs starting with ov:
11273 (save-excursion 11574 (save-excursion
11274 ;; Point must be at insertion point. 11575 ;; Point must be at insertion point.
11275 (let* ((indent-pt (current-indentation)) 11576 (let* ((indent-pt (current-indentation))
11276 (regexp (and with-params 11577 (params (verilog-read-auto-params 0 1))
11277 (nth 0 (verilog-read-auto-params 1)))) 11578 (regexp (nth 0 params))
11278 (v2k (verilog-in-paren-quick)) 11579 (v2k (verilog-in-paren-quick))
11279 (modi (verilog-modi-current)) 11580 (modi (verilog-modi-current))
11280 (moddecls (verilog-modi-get-decls modi)) 11581 (moddecls (verilog-modi-get-decls modi))
@@ -11290,7 +11591,7 @@ same expansion will result from only extracting outputs starting with ov:
11290 sig-list regexp))) 11591 sig-list regexp)))
11291 (setq sig-list (verilog-signals-not-matching-regexp 11592 (setq sig-list (verilog-signals-not-matching-regexp
11292 sig-list verilog-auto-output-ignore-regexp)) 11593 sig-list verilog-auto-output-ignore-regexp))
11293 (forward-line 1) 11594 (verilog-forward-or-insert-line)
11294 (when v2k (verilog-repair-open-comma)) 11595 (when v2k (verilog-repair-open-comma))
11295 (when sig-list 11596 (when sig-list
11296 (verilog-insert-indent "// Beginning of automatic outputs (from unused autoinst outputs)\n") 11597 (verilog-insert-indent "// Beginning of automatic outputs (from unused autoinst outputs)\n")
@@ -11340,7 +11641,7 @@ Typing \\[verilog-auto] will make this into:
11340 (verilog-signals-not-in 11641 (verilog-signals-not-in
11341 (verilog-decls-get-signals moddecls) 11642 (verilog-decls-get-signals moddecls)
11342 (verilog-decls-get-ports moddecls))))) 11643 (verilog-decls-get-ports moddecls)))))
11343 (forward-line 1) 11644 (verilog-forward-or-insert-line)
11344 (when v2k (verilog-repair-open-comma)) 11645 (when v2k (verilog-repair-open-comma))
11345 (when sig-list 11646 (when sig-list
11346 (verilog-insert-indent "// Beginning of automatic outputs (every signal)\n") 11647 (verilog-insert-indent "// Beginning of automatic outputs (every signal)\n")
@@ -11348,7 +11649,7 @@ Typing \\[verilog-auto] will make this into:
11348 (verilog-insert-indent "// End of automatics\n")) 11649 (verilog-insert-indent "// End of automatics\n"))
11349 (when v2k (verilog-repair-close-comma))))) 11650 (when v2k (verilog-repair-close-comma)))))
11350 11651
11351(defun verilog-auto-input (&optional with-params) 11652(defun verilog-auto-input ()
11352 "Expand AUTOINPUT statements, as part of \\[verilog-auto]. 11653 "Expand AUTOINPUT statements, as part of \\[verilog-auto].
11353Make input statements for any input signal into an /*AUTOINST*/ that 11654Make input statements for any input signal into an /*AUTOINST*/ that
11354isn't declared elsewhere inside the module. This is useful for modules which 11655isn't declared elsewhere inside the module. This is useful for modules which
@@ -11399,8 +11700,8 @@ same expansion will result from only extracting inputs starting with i:
11399 /*AUTOINPUT(\"^i\")*/" 11700 /*AUTOINPUT(\"^i\")*/"
11400 (save-excursion 11701 (save-excursion
11401 (let* ((indent-pt (current-indentation)) 11702 (let* ((indent-pt (current-indentation))
11402 (regexp (and with-params 11703 (params (verilog-read-auto-params 0 1))
11403 (nth 0 (verilog-read-auto-params 1)))) 11704 (regexp (nth 0 params))
11404 (v2k (verilog-in-paren-quick)) 11705 (v2k (verilog-in-paren-quick))
11405 (modi (verilog-modi-current)) 11706 (modi (verilog-modi-current))
11406 (moddecls (verilog-modi-get-decls modi)) 11707 (moddecls (verilog-modi-get-decls modi))
@@ -11420,7 +11721,7 @@ same expansion will result from only extracting inputs starting with i:
11420 sig-list regexp))) 11721 sig-list regexp)))
11421 (setq sig-list (verilog-signals-not-matching-regexp 11722 (setq sig-list (verilog-signals-not-matching-regexp
11422 sig-list verilog-auto-input-ignore-regexp)) 11723 sig-list verilog-auto-input-ignore-regexp))
11423 (forward-line 1) 11724 (verilog-forward-or-insert-line)
11424 (when v2k (verilog-repair-open-comma)) 11725 (when v2k (verilog-repair-open-comma))
11425 (when sig-list 11726 (when sig-list
11426 (verilog-insert-indent "// Beginning of automatic inputs (from unused autoinst inputs)\n") 11727 (verilog-insert-indent "// Beginning of automatic inputs (from unused autoinst inputs)\n")
@@ -11428,7 +11729,7 @@ same expansion will result from only extracting inputs starting with i:
11428 (verilog-insert-indent "// End of automatics\n")) 11729 (verilog-insert-indent "// End of automatics\n"))
11429 (when v2k (verilog-repair-close-comma))))) 11730 (when v2k (verilog-repair-close-comma)))))
11430 11731
11431(defun verilog-auto-inout (&optional with-params) 11732(defun verilog-auto-inout ()
11432 "Expand AUTOINOUT statements, as part of \\[verilog-auto]. 11733 "Expand AUTOINOUT statements, as part of \\[verilog-auto].
11433Make inout statements for any inout signal in an /*AUTOINST*/ that 11734Make inout statements for any inout signal in an /*AUTOINST*/ that
11434isn't declared elsewhere inside the module. 11735isn't declared elsewhere inside the module.
@@ -11479,8 +11780,8 @@ same expansion will result from only extracting inouts starting with i:
11479 (save-excursion 11780 (save-excursion
11480 ;; Point must be at insertion point. 11781 ;; Point must be at insertion point.
11481 (let* ((indent-pt (current-indentation)) 11782 (let* ((indent-pt (current-indentation))
11482 (regexp (and with-params 11783 (params (verilog-read-auto-params 0 1))
11483 (nth 0 (verilog-read-auto-params 1)))) 11784 (regexp (nth 0 params))
11484 (v2k (verilog-in-paren-quick)) 11785 (v2k (verilog-in-paren-quick))
11485 (modi (verilog-modi-current)) 11786 (modi (verilog-modi-current))
11486 (moddecls (verilog-modi-get-decls modi)) 11787 (moddecls (verilog-modi-get-decls modi))
@@ -11497,7 +11798,7 @@ same expansion will result from only extracting inouts starting with i:
11497 sig-list regexp))) 11798 sig-list regexp)))
11498 (setq sig-list (verilog-signals-not-matching-regexp 11799 (setq sig-list (verilog-signals-not-matching-regexp
11499 sig-list verilog-auto-inout-ignore-regexp)) 11800 sig-list verilog-auto-inout-ignore-regexp))
11500 (forward-line 1) 11801 (verilog-forward-or-insert-line)
11501 (when v2k (verilog-repair-open-comma)) 11802 (when v2k (verilog-repair-open-comma))
11502 (when sig-list 11803 (when sig-list
11503 (verilog-insert-indent "// Beginning of automatic inouts (from unused autoinst inouts)\n") 11804 (verilog-insert-indent "// Beginning of automatic inouts (from unused autoinst inouts)\n")
@@ -11739,6 +12040,225 @@ same expansion will result from only extracting signals starting with i:
11739 /*AUTOINOUTCOMP(\"ExampMain\",\"^i\")*/" 12040 /*AUTOINOUTCOMP(\"ExampMain\",\"^i\")*/"
11740 (verilog-auto-inout-module nil t)) 12041 (verilog-auto-inout-module nil t))
11741 12042
12043(defun verilog-auto-inout-param ()
12044 "Expand AUTOINOUTPARAM statements, as part of \\[verilog-auto].
12045Take input/output/inout statements from the specified module and insert
12046into the current module. This is useful for making null templates and
12047shell modules which need to have identical I/O with another module.
12048Any I/O which are already defined in this module will not be redefined.
12049For the complement of this function, see `verilog-auto-inout-comp',
12050and to make monitors with all inputs, see `verilog-auto-inout-in'.
12051
12052Limitations:
12053 If placed inside the parenthesis of a module declaration, it creates
12054 Verilog 2001 style, else uses Verilog 1995 style.
12055
12056 Concatenation and outputting partial buses is not supported.
12057
12058 Module names must be resolvable to filenames. See `verilog-auto-inst'.
12059
12060 Signals are not inserted in the same order as in the original module,
12061 though they will appear to be in the same order to an AUTOINST
12062 instantiating either module.
12063
12064 Signals declared as \"output reg\" or \"output wire\" etc will
12065 lose the wire/reg declaration so that shell modules may
12066 generate those outputs differently. However, \"output logic\"
12067 is propagated.
12068
12069An example:
12070
12071 module ExampShell (/*AUTOARG*/);
12072 /*AUTOINOUTMODULE(\"ExampMain\")*/
12073 endmodule
12074
12075 module ExampMain (i,o,io);
12076 input i;
12077 output o;
12078 inout io;
12079 endmodule
12080
12081Typing \\[verilog-auto] will make this into:
12082
12083 module ExampShell (/*AUTOARG*/i,o,io);
12084 /*AUTOINOUTMODULE(\"ExampMain\")*/
12085 // Beginning of automatic in/out/inouts (from specific module)
12086 output o;
12087 inout io;
12088 input i;
12089 // End of automatics
12090 endmodule
12091
12092You may also provide an optional regular expression, in which case only
12093signals matching the regular expression will be included. For example the
12094same expansion will result from only extracting signals starting with i:
12095
12096 /*AUTOINOUTMODULE(\"ExampMain\",\"^i\")*/
12097
12098You may also provide an optional second regular expression, in
12099which case only signals which have that pin direction and data
12100type will be included. This matches against everything before
12101the signal name in the declaration, for example against
12102\"input\" (single bit), \"output logic\" (direction and type) or
12103\"output [1:0]\" (direction and implicit type). You also
12104probably want to skip spaces in your regexp.
12105
12106For example, the below will result in matching the output \"o\"
12107against the previous example's module:
12108
12109 /*AUTOINOUTMODULE(\"ExampMain\",\"\",\"^output.*\")*/
12110
12111You may also provide an optional third regular expression, in
12112which case any parameter names that match the given regexp will
12113be included. Including parameters is off by default. To include
12114all signals and parameters, use:
12115
12116 /*AUTOINOUTMODULE(\"ExampMain\",\".*\",\".*\",\".*\")*/"
12117 (save-excursion
12118 (let* ((params (verilog-read-auto-params 1 2))
12119 (submod (nth 0 params))
12120 (regexp (nth 1 params))
12121 submodi)
12122 ;; Lookup position, etc of co-module
12123 ;; Note this may raise an error
12124 (when (setq submodi (verilog-modi-lookup submod t))
12125 (let* ((indent-pt (current-indentation))
12126 (v2k (verilog-in-paren-quick))
12127 (modi (verilog-modi-current))
12128 (moddecls (verilog-modi-get-decls modi))
12129 (submoddecls (verilog-modi-get-decls submodi))
12130 (sig-list-p (verilog-signals-not-in
12131 (verilog-decls-get-gparams submoddecls)
12132 (append (verilog-decls-get-gparams moddecls)))))
12133 (forward-line 1)
12134 (setq sig-list-p (verilog-signals-matching-regexp sig-list-p regexp))
12135 (when v2k (verilog-repair-open-comma))
12136 (when sig-list-p
12137 (verilog-insert-indent "// Beginning of automatic parameters (from specific module)\n")
12138 ;; Don't sort them so an upper AUTOINST will match the main module
12139 (verilog-insert-definition modi sig-list-p "parameter" indent-pt v2k t)
12140 (verilog-insert-indent "// End of automatics\n"))
12141 (when v2k (verilog-repair-close-comma)))))))
12142
12143(defun verilog-auto-inout-modport ()
12144 "Expand AUTOINOUTMODPORT statements, as part of \\[verilog-auto].
12145Take input/output/inout statements from the specified interface
12146and modport and insert into the current module. This is useful
12147for making verification modules that connect to UVM interfaces.
12148
12149 The first parameter is the name of an interface.
12150
12151 The second parameter is a regexp of modports to read from in
12152 that interface.
12153
12154 The optional third parameter is a regular expression, and only
12155 signals matching the regular expression will be included.
12156
12157Limitations:
12158 If placed inside the parenthesis of a module declaration, it creates
12159 Verilog 2001 style, else uses Verilog 1995 style.
12160
12161 Interface names must be resolvable to filenames. See `verilog-auto-inst'.
12162
12163As with other autos, any inputs/outputs declared in the module
12164will suppress the AUTO from redeclarating an inputs/outputs by
12165the same name.
12166
12167An example:
12168
12169 interface ExampIf
12170 ( input logic clk );
12171 logic req_val;
12172 logic [7:0] req_dat;
12173 clocking mon_clkblk @(posedge clk);
12174 input req_val;
12175 input req_dat;
12176 endclocking
12177 modport mp(clocking mon_clkblk);
12178 endinterface
12179
12180 module ExampMain
12181 ( input clk,
12182 /*AUTOINOUTMODPORT(\"ExampIf\" \"mp\")*/
12183 // Beginning of automatic in/out/inouts (from modport)
12184 input [7:0] req_dat,
12185 input req_val
12186 // End of automatics
12187 );
12188 /*AUTOASSIGNMODPORT(\"ExampIf\" \"mp\")*/
12189 endmodule
12190
12191Typing \\[verilog-auto] will make this into:
12192
12193 ...
12194 module ExampMain
12195 ( input clk,
12196 /*AUTOINOUTMODPORT(\"ExampIf\" \"mp\")*/
12197 // Beginning of automatic in/out/inouts (from modport)
12198 input req_dat,
12199 input req_val
12200 // End of automatics
12201 );
12202
12203If the modport is part of a UVM monitor/driver class, this
12204creates a wrapper module that may be used to instantiate the
12205driver/monitor using AUTOINST in the testbench."
12206 (save-excursion
12207 (let* ((params (verilog-read-auto-params 2 3))
12208 (submod (nth 0 params))
12209 (modport-re (nth 1 params))
12210 (regexp (nth 2 params))
12211 direction-re submodi) ;; direction argument not supported until requested
12212 ;; Lookup position, etc of co-module
12213 ;; Note this may raise an error
12214 (when (setq submodi (verilog-modi-lookup submod t))
12215 (let* ((indent-pt (current-indentation))
12216 (v2k (verilog-in-paren-quick))
12217 (modi (verilog-modi-current))
12218 (moddecls (verilog-modi-get-decls modi))
12219 (submoddecls (verilog-modi-get-decls submodi))
12220 (submodportdecls (verilog-modi-modport-lookup submodi modport-re))
12221 (sig-list-i (verilog-signals-in ;; Decls doesn't have data types, must resolve
12222 (verilog-decls-get-vars submoddecls)
12223 (verilog-signals-not-in
12224 (verilog-decls-get-inputs submodportdecls)
12225 (append (verilog-decls-get-ports submoddecls)
12226 (verilog-decls-get-ports moddecls)))))
12227 (sig-list-o (verilog-signals-in ;; Decls doesn't have data types, must resolve
12228 (verilog-decls-get-vars submoddecls)
12229 (verilog-signals-not-in
12230 (verilog-decls-get-outputs submodportdecls)
12231 (append (verilog-decls-get-ports submoddecls)
12232 (verilog-decls-get-ports moddecls)))))
12233 (sig-list-io (verilog-signals-in ;; Decls doesn't have data types, must resolve
12234 (verilog-decls-get-vars submoddecls)
12235 (verilog-signals-not-in
12236 (verilog-decls-get-inouts submodportdecls)
12237 (append (verilog-decls-get-ports submoddecls)
12238 (verilog-decls-get-ports moddecls))))))
12239 (forward-line 1)
12240 (setq sig-list-i (verilog-signals-edit-wire-reg
12241 (verilog-signals-matching-dir-re
12242 (verilog-signals-matching-regexp sig-list-i regexp)
12243 "input" direction-re))
12244 sig-list-o (verilog-signals-edit-wire-reg
12245 (verilog-signals-matching-dir-re
12246 (verilog-signals-matching-regexp sig-list-o regexp)
12247 "output" direction-re))
12248 sig-list-io (verilog-signals-edit-wire-reg
12249 (verilog-signals-matching-dir-re
12250 (verilog-signals-matching-regexp sig-list-io regexp)
12251 "inout" direction-re)))
12252 (when v2k (verilog-repair-open-comma))
12253 (when (or sig-list-i sig-list-o sig-list-io)
12254 (verilog-insert-indent "// Beginning of automatic in/out/inouts (from modport)\n")
12255 ;; Don't sort them so an upper AUTOINST will match the main module
12256 (verilog-insert-definition modi sig-list-o "output" indent-pt v2k t)
12257 (verilog-insert-definition modi sig-list-io "inout" indent-pt v2k t)
12258 (verilog-insert-definition modi sig-list-i "input" indent-pt v2k t)
12259 (verilog-insert-indent "// End of automatics\n"))
12260 (when v2k (verilog-repair-close-comma)))))))
12261
11742(defun verilog-auto-insert-lisp () 12262(defun verilog-auto-insert-lisp ()
11743 "Expand AUTOINSERTLISP statements, as part of \\[verilog-auto]. 12263 "Expand AUTOINSERTLISP statements, as part of \\[verilog-auto].
11744The Lisp code provided is called, and the Lisp code calls 12264The Lisp code provided is called, and the Lisp code calls
@@ -11789,7 +12309,7 @@ text:
11789 (backward-sexp 1) ;; Inside comment 12309 (backward-sexp 1) ;; Inside comment
11790 (point))) ;; Beginning paren 12310 (point))) ;; Beginning paren
11791 (cmd (buffer-substring-no-properties cmd-beg-pt cmd-end-pt))) 12311 (cmd (buffer-substring-no-properties cmd-beg-pt cmd-end-pt)))
11792 (forward-line 1) 12312 (verilog-forward-or-insert-line)
11793 ;; Some commands don't move point (like insert-file) so we always 12313 ;; Some commands don't move point (like insert-file) so we always
11794 ;; add the begin/end comments, then delete it if not needed 12314 ;; add the begin/end comments, then delete it if not needed
11795 (verilog-insert-indent "// Beginning of automatic insert lisp\n") 12315 (verilog-insert-indent "// Beginning of automatic insert lisp\n")
@@ -12042,6 +12562,7 @@ value's width is generated.
12042An example of making a stub for another module: 12562An example of making a stub for another module:
12043 12563
12044 module ExampStub (/*AUTOINST*/); 12564 module ExampStub (/*AUTOINST*/);
12565 /*AUTOINOUTPARAM(\"Foo\")*/
12045 /*AUTOINOUTMODULE(\"Foo\")*/ 12566 /*AUTOINOUTMODULE(\"Foo\")*/
12046 /*AUTOTIEOFF*/ 12567 /*AUTOTIEOFF*/
12047 // verilator lint_off UNUSED 12568 // verilator lint_off UNUSED
@@ -12054,6 +12575,7 @@ An example of making a stub for another module:
12054Typing \\[verilog-auto] will make this into: 12575Typing \\[verilog-auto] will make this into:
12055 12576
12056 module ExampStub (/*AUTOINST*/...); 12577 module ExampStub (/*AUTOINST*/...);
12578 /*AUTOINOUTPARAM(\"Foo\")*/
12057 /*AUTOINOUTMODULE(\"Foo\")*/ 12579 /*AUTOINOUTMODULE(\"Foo\")*/
12058 // Beginning of autotieoff 12580 // Beginning of autotieoff
12059 output [2:0] foo; 12581 output [2:0] foo;
@@ -12084,7 +12606,7 @@ Typing \\[verilog-auto] will make this into:
12084 (setq sig-list (verilog-signals-not-matching-regexp 12606 (setq sig-list (verilog-signals-not-matching-regexp
12085 sig-list verilog-auto-tieoff-ignore-regexp)) 12607 sig-list verilog-auto-tieoff-ignore-regexp))
12086 (when sig-list 12608 (when sig-list
12087 (forward-line 1) 12609 (verilog-forward-or-insert-line)
12088 (verilog-insert-indent "// Beginning of automatic tieoffs (for this module's unterminated outputs)\n") 12610 (verilog-insert-indent "// Beginning of automatic tieoffs (for this module's unterminated outputs)\n")
12089 (setq sig-list (sort (copy-alist sig-list) `verilog-signals-sort-compare)) 12611 (setq sig-list (sort (copy-alist sig-list) `verilog-signals-sort-compare))
12090 (verilog-modi-cache-add-vars modi sig-list) ; Before we trash list 12612 (verilog-modi-cache-add-vars modi sig-list) ; Before we trash list
@@ -12161,7 +12683,7 @@ defines the regular expression will be undefed."
12161 ;; Insert 12683 ;; Insert
12162 (setq defs (sort defs 'string<)) 12684 (setq defs (sort defs 'string<))
12163 (when defs 12685 (when defs
12164 (forward-line 1) 12686 (verilog-forward-or-insert-line)
12165 (verilog-insert-indent "// Beginning of automatic undefs\n") 12687 (verilog-insert-indent "// Beginning of automatic undefs\n")
12166 (while defs 12688 (while defs
12167 (verilog-insert-indent "`undef " (car defs) "\n") 12689 (verilog-insert-indent "`undef " (car defs) "\n")
@@ -12198,6 +12720,7 @@ You can add signals you do not want included in AUTOUNUSED with
12198An example of making a stub for another module: 12720An example of making a stub for another module:
12199 12721
12200 module ExampStub (/*AUTOINST*/); 12722 module ExampStub (/*AUTOINST*/);
12723 /*AUTOINOUTPARAM(\"Examp\")*/
12201 /*AUTOINOUTMODULE(\"Examp\")*/ 12724 /*AUTOINOUTMODULE(\"Examp\")*/
12202 /*AUTOTIEOFF*/ 12725 /*AUTOTIEOFF*/
12203 // verilator lint_off UNUSED 12726 // verilator lint_off UNUSED
@@ -12236,7 +12759,7 @@ Typing \\[verilog-auto] will make this into:
12236 (setq sig-list (verilog-signals-not-matching-regexp 12759 (setq sig-list (verilog-signals-not-matching-regexp
12237 sig-list verilog-auto-unused-ignore-regexp)) 12760 sig-list verilog-auto-unused-ignore-regexp))
12238 (when sig-list 12761 (when sig-list
12239 (forward-line 1) 12762 (verilog-forward-or-insert-line)
12240 (verilog-insert-indent "// Beginning of automatic unused inputs\n") 12763 (verilog-insert-indent "// Beginning of automatic unused inputs\n")
12241 (setq sig-list (sort (copy-alist sig-list) `verilog-signals-sort-compare)) 12764 (setq sig-list (sort (copy-alist sig-list) `verilog-signals-sort-compare))
12242 (while sig-list 12765 (while sig-list
@@ -12335,10 +12858,7 @@ Typing \\[verilog-auto] will make this into:
12335 ;; 12858 ;;
12336 (sig-list-consts (append (verilog-decls-get-consts moddecls) 12859 (sig-list-consts (append (verilog-decls-get-consts moddecls)
12337 (verilog-decls-get-gparams moddecls))) 12860 (verilog-decls-get-gparams moddecls)))
12338 (sig-list-all (append (verilog-decls-get-vars moddecls) 12861 (sig-list-all (verilog-decls-get-iovars moddecls))
12339 (verilog-decls-get-outputs moddecls)
12340 (verilog-decls-get-inouts moddecls)
12341 (verilog-decls-get-inputs moddecls)))
12342 ;; 12862 ;;
12343 (undecode-sig (or (assoc undecode-name sig-list-all) 12863 (undecode-sig (or (assoc undecode-name sig-list-all)
12344 (error "%s: Signal %s not found in design" (verilog-point-text) undecode-name))) 12864 (error "%s: Signal %s not found in design" (verilog-point-text) undecode-name)))
@@ -12371,7 +12891,7 @@ Typing \\[verilog-auto] will make this into:
12371 elim-regexp))) 12891 elim-regexp)))
12372 tmp-sigs (cdr tmp-sigs)))) 12892 tmp-sigs (cdr tmp-sigs))))
12373 ;; 12893 ;;
12374 (forward-line 1) 12894 (verilog-forward-or-insert-line)
12375 (verilog-insert-indent "// Beginning of automatic ASCII enum decoding\n") 12895 (verilog-insert-indent "// Beginning of automatic ASCII enum decoding\n")
12376 (let ((decode-sig-list (list (list ascii-name (format "[%d:0]" (- (* ascii-chars 8) 1)) 12896 (let ((decode-sig-list (list (list ascii-name (format "[%d:0]" (- (* ascii-chars 8) 1))
12377 (concat "Decode of " undecode-name) nil nil)))) 12897 (concat "Decode of " undecode-name) nil nil))))
@@ -12506,9 +13026,12 @@ Or check if AUTOs have the same expansion
12506Using \\[describe-function], see also: 13026Using \\[describe-function], see also:
12507 `verilog-auto-arg' for AUTOARG module instantiations 13027 `verilog-auto-arg' for AUTOARG module instantiations
12508 `verilog-auto-ascii-enum' for AUTOASCIIENUM enumeration decoding 13028 `verilog-auto-ascii-enum' for AUTOASCIIENUM enumeration decoding
13029 `verilog-auto-assign-modport' for AUTOASSIGNMODPORT assignment to/from modport
12509 `verilog-auto-inout-comp' for AUTOINOUTCOMP copy complemented i/o 13030 `verilog-auto-inout-comp' for AUTOINOUTCOMP copy complemented i/o
12510 `verilog-auto-inout-in' for AUTOINOUTIN inputs for all i/o 13031 `verilog-auto-inout-in' for AUTOINOUTIN inputs for all i/o
13032 `verilog-auto-inout-modport' for AUTOINOUTMODPORT i/o from an interface modport
12511 `verilog-auto-inout-module' for AUTOINOUTMODULE copying i/o from elsewhere 13033 `verilog-auto-inout-module' for AUTOINOUTMODULE copying i/o from elsewhere
13034 `verilog-auto-inout-param' for AUTOINOUTPARAM copying params from elsewhere
12512 `verilog-auto-inout' for AUTOINOUT making hierarchy inouts 13035 `verilog-auto-inout' for AUTOINOUT making hierarchy inouts
12513 `verilog-auto-input' for AUTOINPUT making hierarchy inputs 13036 `verilog-auto-input' for AUTOINPUT making hierarchy inputs
12514 `verilog-auto-insert-lisp' for AUTOINSERTLISP insert code from lisp function 13037 `verilog-auto-insert-lisp' for AUTOINSERTLISP insert code from lisp function
@@ -12598,27 +13121,24 @@ Wilson Snyder (wsnyder@wsnyder.org)."
12598 (verilog-auto-re-search-do "/\\*\\(AUTOSENSE\\|AS\\)\\*/" 'verilog-auto-sense) 13121 (verilog-auto-re-search-do "/\\*\\(AUTOSENSE\\|AS\\)\\*/" 'verilog-auto-sense)
12599 (verilog-auto-re-search-do "/\\*AUTORESET\\*/" 'verilog-auto-reset) 13122 (verilog-auto-re-search-do "/\\*AUTORESET\\*/" 'verilog-auto-reset)
12600 ;; Must be done before autoin/out as creates a reg 13123 ;; Must be done before autoin/out as creates a reg
12601 (verilog-auto-re-search-do "/\\*AUTOASCIIENUM([^)]*)\\*/" 'verilog-auto-ascii-enum) 13124 (verilog-auto-re-search-do "/\\*AUTOASCIIENUM(.*?)\\*/" 'verilog-auto-ascii-enum)
12602 ;; 13125 ;;
12603 ;; first in/outs from other files 13126 ;; first in/outs from other files
12604 (verilog-auto-re-search-do "/\\*AUTOINOUTMODULE([^)]*)\\*/" 'verilog-auto-inout-module) 13127 (verilog-auto-re-search-do "/\\*AUTOINOUTMODPORT(.*?)\\*/" 'verilog-auto-inout-modport)
12605 (verilog-auto-re-search-do "/\\*AUTOINOUTCOMP([^)]*)\\*/" 'verilog-auto-inout-comp) 13128 (verilog-auto-re-search-do "/\\*AUTOINOUTMODULE(.*?)\\*/" 'verilog-auto-inout-module)
12606 (verilog-auto-re-search-do "/\\*AUTOINOUTIN([^)]*)\\*/" 'verilog-auto-inout-in) 13129 (verilog-auto-re-search-do "/\\*AUTOINOUTCOMP(.*?)\\*/" 'verilog-auto-inout-comp)
13130 (verilog-auto-re-search-do "/\\*AUTOINOUTIN(.*?)\\*/" 'verilog-auto-inout-in)
13131 (verilog-auto-re-search-do "/\\*AUTOINOUTPARAM(.*?)\\*/" 'verilog-auto-inout-param)
12607 ;; next in/outs which need previous sucked inputs first 13132 ;; next in/outs which need previous sucked inputs first
12608 (verilog-auto-re-search-do "/\\*AUTOOUTPUT\\((\"[^\"]*\")\\)\\*/" 13133 (verilog-auto-re-search-do "/\\*AUTOOUTPUT\\((.*?)\\)?\\*/" 'verilog-auto-output)
12609 (lambda () (verilog-auto-output t))) 13134 (verilog-auto-re-search-do "/\\*AUTOINPUT\\((.*?)\\)?\\*/" 'verilog-auto-input)
12610 (verilog-auto-re-search-do "/\\*AUTOOUTPUT\\*/" 'verilog-auto-output) 13135 (verilog-auto-re-search-do "/\\*AUTOINOUT\\((.*?)\\)?\\*/" 'verilog-auto-inout)
12611 (verilog-auto-re-search-do "/\\*AUTOINPUT\\((\"[^\"]*\")\\)\\*/"
12612 (lambda () (verilog-auto-input t)))
12613 (verilog-auto-re-search-do "/\\*AUTOINPUT\\*/" 'verilog-auto-input)
12614 (verilog-auto-re-search-do "/\\*AUTOINOUT\\((\"[^\"]*\")\\)\\*/"
12615 (lambda () (verilog-auto-inout t)))
12616 (verilog-auto-re-search-do "/\\*AUTOINOUT\\*/" 'verilog-auto-inout)
12617 ;; Then tie off those in/outs 13136 ;; Then tie off those in/outs
12618 (verilog-auto-re-search-do "/\\*AUTOTIEOFF\\*/" 'verilog-auto-tieoff) 13137 (verilog-auto-re-search-do "/\\*AUTOTIEOFF\\*/" 'verilog-auto-tieoff)
12619 ;; These can be anywhere after AUTOINSERTLISP 13138 ;; These can be anywhere after AUTOINSERTLISP
12620 (verilog-auto-re-search-do "/\\*AUTOUNDEF\\((\"[^\"]*\")\\)?\\*/" 'verilog-auto-undef) 13139 (verilog-auto-re-search-do "/\\*AUTOUNDEF\\((.*?)\\)?\\*/" 'verilog-auto-undef)
12621 ;; Wires/regs must be after inputs/outputs 13140 ;; Wires/regs must be after inputs/outputs
13141 (verilog-auto-re-search-do "/\\*AUTOASSIGNMODPORT(.*?)\\*/" 'verilog-auto-assign-modport)
12622 (verilog-auto-re-search-do "/\\*AUTOLOGIC\\*/" 'verilog-auto-logic) 13142 (verilog-auto-re-search-do "/\\*AUTOLOGIC\\*/" 'verilog-auto-logic)
12623 (verilog-auto-re-search-do "/\\*AUTOWIRE\\*/" 'verilog-auto-wire) 13143 (verilog-auto-re-search-do "/\\*AUTOWIRE\\*/" 'verilog-auto-wire)
12624 (verilog-auto-re-search-do "/\\*AUTOREG\\*/" 'verilog-auto-reg) 13144 (verilog-auto-re-search-do "/\\*AUTOREG\\*/" 'verilog-auto-reg)
@@ -12696,7 +13216,7 @@ Wilson Snyder (wsnyder@wsnyder.org)."
12696;; 13216;;
12697;; Place the templates into Verilog Mode. They may be inserted under any key. 13217;; Place the templates into Verilog Mode. They may be inserted under any key.
12698;; C-c C-t will be the default. If you use templates a lot, you 13218;; C-c C-t will be the default. If you use templates a lot, you
12699;; may want to consider moving the binding to another key in your .emacs 13219;; may want to consider moving the binding to another key in your init
12700;; file. 13220;; file.
12701;; 13221;;
12702;; Note \C-c and letter are reserved for users 13222;; Note \C-c and letter are reserved for users
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 0ca3439dd60..52757b9eede 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -12522,6 +12522,7 @@ options vhdl-upper-case-{keywords,types,attributes,enum-values}."
12522(defun vhdl-line-expand (&optional prefix-arg) 12522(defun vhdl-line-expand (&optional prefix-arg)
12523 "Hippie-expand current line." 12523 "Hippie-expand current line."
12524 (interactive "P") 12524 (interactive "P")
12525 (require 'hippie-exp)
12525 (let ((case-fold-search t) (case-replace nil) 12526 (let ((case-fold-search t) (case-replace nil)
12526 (hippie-expand-try-functions-list 12527 (hippie-expand-try-functions-list
12527 '(try-expand-line try-expand-line-all-buffers))) 12528 '(try-expand-line try-expand-line-all-buffers)))
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index 02340425dfa..4819149bdf6 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -234,9 +234,7 @@ It creates the Imenu index for the buffer, if necessary."
234 (error "Error in which-func-update: %S" info)))))) 234 (error "Error in which-func-update: %S" info))))))
235 235
236;;;###autoload 236;;;###autoload
237(defun which-func-mode (&optional arg) 237(define-obsolete-function-alias 'which-func-mode 'which-function-mode "24.1")
238 (which-function-mode arg))
239(make-obsolete 'which-func-mode 'which-function-mode "24.1")
240 238
241(defvar which-func-update-timer nil) 239(defvar which-func-update-timer nil)
242 240
diff --git a/lisp/replace.el b/lisp/replace.el
index f192574a7e2..82edb0037fb 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -378,35 +378,33 @@ regexp in `search-whitespace-regexp'.
378Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace 378Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace
379only matches that are surrounded by word boundaries. 379only matches that are surrounded by word boundaries.
380Fourth and fifth arg START and END specify the region to operate on." 380Fourth and fifth arg START and END specify the region to operate on."
381 (declare (obsolete "use the `\\,' feature of `query-replace-regexp'
382for interactive calls, and `search-forward-regexp'/`replace-match'
383for Lisp calls." "22.1"))
381 (interactive 384 (interactive
382 (progn 385 (progn
383 (barf-if-buffer-read-only) 386 (barf-if-buffer-read-only)
384 (let* ((from 387 (let* ((from
385 ;; Let-bind the history var to disable the "foo -> bar" default. 388 ;; Let-bind the history var to disable the "foo -> bar"
386 ;; Maybe we shouldn't disable this default, but for now I'll 389 ;; default. Maybe we shouldn't disable this default, but
387 ;; leave it off. --Stef 390 ;; for now I'll leave it off. --Stef
388 (let ((query-replace-to-history-variable nil)) 391 (let ((query-replace-to-history-variable nil))
389 (query-replace-read-from "Query replace regexp" t))) 392 (query-replace-read-from "Query replace regexp" t)))
390 (to (list (read-from-minibuffer 393 (to (list (read-from-minibuffer
391 (format "Query replace regexp %s with eval: " 394 (format "Query replace regexp %s with eval: "
392 (query-replace-descr from)) 395 (query-replace-descr from))
393 nil nil t query-replace-to-history-variable from t)))) 396 nil nil t query-replace-to-history-variable from t))))
394 ;; We make TO a list because replace-match-string-symbols requires one, 397 ;; We make TO a list because replace-match-string-symbols requires one,
395 ;; and the user might enter a single token. 398 ;; and the user might enter a single token.
396 (replace-match-string-symbols to) 399 (replace-match-string-symbols to)
397 (list from (car to) current-prefix-arg 400 (list from (car to) current-prefix-arg
398 (if (and transient-mark-mode mark-active) 401 (if (and transient-mark-mode mark-active)
399 (region-beginning)) 402 (region-beginning))
400 (if (and transient-mark-mode mark-active) 403 (if (and transient-mark-mode mark-active)
401 (region-end)))))) 404 (region-end))))))
402 (perform-replace regexp (cons 'replace-eval-replacement to-expr) 405 (perform-replace regexp (cons 'replace-eval-replacement to-expr)
403 t 'literal delimited nil nil start end)) 406 t 'literal delimited nil nil start end))
404 407
405(make-obsolete 'query-replace-regexp-eval
406 "for interactive use, use the special `\\,' feature of
407`query-replace-regexp' instead. Non-interactively, a loop
408using `search-forward-regexp' and `replace-match' is preferred." "22.1")
409
410(defun map-query-replace-regexp (regexp to-strings &optional n start end) 408(defun map-query-replace-regexp (regexp to-strings &optional n start end)
411 "Replace some matches for REGEXP with various strings, in rotation. 409 "Replace some matches for REGEXP with various strings, in rotation.
412The second argument TO-STRINGS contains the replacement strings, separated 410The second argument TO-STRINGS contains the replacement strings, separated
diff --git a/lisp/savehist.el b/lisp/savehist.el
index 215314d7053..cca958ff0a1 100644
--- a/lisp/savehist.el
+++ b/lisp/savehist.el
@@ -209,6 +209,7 @@ histories, which is probably undesirable."
209If `savehist-file' is in the old format that doesn't record 209If `savehist-file' is in the old format that doesn't record
210the value of `savehist-minibuffer-history-variables', that 210the value of `savehist-minibuffer-history-variables', that
211value is deducted from the contents of the file." 211value is deducted from the contents of the file."
212 (declare (obsolete savehist-mode "22.1"))
212 (savehist-mode 1) 213 (savehist-mode 1)
213 ;; Old versions of savehist distributed with XEmacs didn't save 214 ;; Old versions of savehist distributed with XEmacs didn't save
214 ;; savehist-minibuffer-history-variables. If that variable is nil 215 ;; savehist-minibuffer-history-variables. If that variable is nil
@@ -225,7 +226,6 @@ value is deducted from the contents of the file."
225 ;; Collect VAR, i.e. (nth form 1). 226 ;; Collect VAR, i.e. (nth form 1).
226 (push (nth 1 form) vars)) 227 (push (nth 1 form) vars))
227 vars))))) 228 vars)))))
228(make-obsolete 'savehist-load 'savehist-mode "22.1")
229 229
230(defun savehist-install () 230(defun savehist-install ()
231 "Hook savehist into Emacs. 231 "Hook savehist into Emacs.
diff --git a/lisp/server.el b/lisp/server.el
index 4fd55bcf6d1..73c253a87a6 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -101,7 +101,12 @@
101 101
102(defcustom server-host nil 102(defcustom server-host nil
103 "The name or IP address to use as host address of the server process. 103 "The name or IP address to use as host address of the server process.
104If set, the server accepts remote connections; otherwise it is local." 104If set, the server accepts remote connections; otherwise it is local.
105
106DO NOT give this a non-nil value unless you know what you are
107doing! On unsecured networks, accepting remote connections is
108very dangerous, because server-client communication (including
109session authentication) is not encrypted."
105 :group 'server 110 :group 'server
106 :type '(choice 111 :type '(choice
107 (string :tag "Name or IP address") 112 (string :tag "Name or IP address")
@@ -140,12 +145,12 @@ directory residing in a NTFS partition instead."
140 145
141(defcustom server-auth-key nil 146(defcustom server-auth-key nil
142 "Server authentication key. 147 "Server authentication key.
148This is only used if `server-use-tcp' is non-nil.
143 149
144Normally, the authentication key is randomly generated when the 150Normally, the authentication key is randomly generated when the
145server starts, which guarantees some level of security. It is 151server starts. It is recommended to leave it that way. Using a
146recommended to leave it that way. Using a long-lived shared key 152long-lived shared key will decrease security (especially since
147will decrease security (especially since the key is transmitted as 153the key is transmitted as plain-text).
148plain text).
149 154
150In some situations however, it can be difficult to share randomly 155In some situations however, it can be difficult to share randomly
151generated passwords with remote hosts (eg. no shared directory), 156generated passwords with remote hosts (eg. no shared directory),
@@ -153,11 +158,13 @@ so you can set the key with this variable and then copy the
153server file to the remote host (with possible changes to IP 158server file to the remote host (with possible changes to IP
154address and/or port if that applies). 159address and/or port if that applies).
155 160
156The key must consist of 64 ASCII printable characters except for 161Note that the usual security risks of using the server over
157space (this means characters from ! to ~; or from code 33 to 126). 162remote TCP, arising from the fact that client-server
163communications are unencrypted, still apply.
158 164
159You can use \\[server-generate-key] to get a random authentication 165The key must consist of 64 ASCII printable characters except for
160key." 166space (this means characters from ! to ~; or from code 33 to
167126). You can use \\[server-generate-key] to get a random key."
161 :group 'server 168 :group 'server
162 :type '(choice 169 :type '(choice
163 (const :tag "Random" nil) 170 (const :tag "Random" nil)
diff --git a/lisp/simple.el b/lisp/simple.el
index e1b8f37e46c..616a4d7b1ea 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -606,7 +606,7 @@ buffer if the variable `delete-trailing-lines' is non-nil."
606 (when (and (not end) 606 (when (and (not end)
607 delete-trailing-lines 607 delete-trailing-lines
608 ;; Really the end of buffer. 608 ;; Really the end of buffer.
609 (save-restriction (widen) (eobp)) 609 (= (point-max) (1+ (buffer-size)))
610 (<= (skip-chars-backward "\n") -2)) 610 (<= (skip-chars-backward "\n") -2))
611 (delete-region (1+ (point)) end-marker)) 611 (delete-region (1+ (point)) end-marker))
612 (set-marker end-marker nil)))) 612 (set-marker end-marker nil))))
@@ -6380,9 +6380,8 @@ With prefix argument N, move N items (negative N means move backward)."
6380 (point)))) 6380 (point))))
6381 6381
6382(defun choose-completion-delete-max-match (string) 6382(defun choose-completion-delete-max-match (string)
6383 (declare (obsolete choose-completion-guess-base-position "23.2"))
6383 (delete-region (choose-completion-guess-base-position string) (point))) 6384 (delete-region (choose-completion-guess-base-position string) (point)))
6384(make-obsolete 'choose-completion-delete-max-match
6385 'choose-completion-guess-base-position "23.2")
6386 6385
6387(defvar choose-completion-string-functions nil 6386(defvar choose-completion-string-functions nil
6388 "Functions that may override the normal insertion of a completion choice. 6387 "Functions that may override the normal insertion of a completion choice.
diff --git a/lisp/startup.el b/lisp/startup.el
index 243c9621752..6658e16683b 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -43,7 +43,10 @@
43If the value is nil and `inhibit-startup-screen' is nil, show the 43If the value is nil and `inhibit-startup-screen' is nil, show the
44startup screen. If the value is a string, visit the specified file 44startup screen. If the value is a string, visit the specified file
45or directory using `find-file'. If t, open the `*scratch*' 45or directory using `find-file'. If t, open the `*scratch*'
46buffer." 46buffer.
47
48A string value also causes emacsclient to open the specified file
49or directory when no target file is specified."
47 :type '(choice 50 :type '(choice
48 (const :tag "Startup screen" nil) 51 (const :tag "Startup screen" nil)
49 (directory :tag "Directory" :value "~/") 52 (directory :tag "Directory" :value "~/")
diff --git a/lisp/subr.el b/lisp/subr.el
index b9b8e627672..8dfe78d8c75 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -271,9 +271,14 @@ the return value (nil if RESULT is omitted).
271 ,@(cdr (cdr spec)))))) 271 ,@(cdr (cdr spec))))))
272 272
273(defmacro declare (&rest _specs) 273(defmacro declare (&rest _specs)
274 "Do not evaluate any arguments and return nil. 274 "Do not evaluate any arguments, and return nil.
275Treated as a declaration when used at the right place in a 275If a `declare' form appears as the first form in the body of a
276`defmacro' form. \(See Info anchor `(elisp)Definition of declare'.)" 276`defun' or `defmacro' form, SPECS specifies various additional
277information about the function or macro; these go into effect
278during the evaluation of the `defun' or `defmacro' form.
279
280The possible values of SPECS are specified by
281`defun-declarations-alist' and `macro-declarations-alist'."
277 ;; FIXME: edebug spec should pay attention to defun-declarations-alist. 282 ;; FIXME: edebug spec should pay attention to defun-declarations-alist.
278 nil) 283 nil)
279)) 284))
@@ -461,18 +466,18 @@ If TEST is omitted or nil, `equal' is used."
461 (setq tail (cdr tail))) 466 (setq tail (cdr tail)))
462 value)) 467 value))
463 468
464(make-obsolete 'assoc-ignore-case 'assoc-string "22.1")
465(defun assoc-ignore-case (key alist) 469(defun assoc-ignore-case (key alist)
466 "Like `assoc', but ignores differences in case and text representation. 470 "Like `assoc', but ignores differences in case and text representation.
467KEY must be a string. Upper-case and lower-case letters are treated as equal. 471KEY must be a string. Upper-case and lower-case letters are treated as equal.
468Unibyte strings are converted to multibyte for comparison." 472Unibyte strings are converted to multibyte for comparison."
473 (declare (obsolete assoc-string "22.1"))
469 (assoc-string key alist t)) 474 (assoc-string key alist t))
470 475
471(make-obsolete 'assoc-ignore-representation 'assoc-string "22.1")
472(defun assoc-ignore-representation (key alist) 476(defun assoc-ignore-representation (key alist)
473 "Like `assoc', but ignores differences in text representation. 477 "Like `assoc', but ignores differences in text representation.
474KEY must be a string. 478KEY must be a string.
475Unibyte strings are converted to multibyte for comparison." 479Unibyte strings are converted to multibyte for comparison."
480 (declare (obsolete assoc-string "22.1"))
476 (assoc-string key alist nil)) 481 (assoc-string key alist nil))
477 482
478(defun member-ignore-case (elt list) 483(defun member-ignore-case (elt list)
@@ -1179,12 +1184,13 @@ be a list of the form returned by `event-start' and `event-end'."
1179 "Mocklisp-compatibility insert function. 1184 "Mocklisp-compatibility insert function.
1180Like the function `insert' except that any argument that is a number 1185Like the function `insert' except that any argument that is a number
1181is converted into a string by expressing it in decimal." 1186is converted into a string by expressing it in decimal."
1187 (declare (obsolete insert "22.1"))
1182 (dolist (el args) 1188 (dolist (el args)
1183 (insert (if (integerp el) (number-to-string el) el)))) 1189 (insert (if (integerp el) (number-to-string el) el))))
1184(make-obsolete 'insert-string 'insert "22.1")
1185 1190
1186(defun makehash (&optional test) (make-hash-table :test (or test 'eql))) 1191(defun makehash (&optional test)
1187(make-obsolete 'makehash 'make-hash-table "22.1") 1192 (declare (obsolete make-hash-table "22.1"))
1193 (make-hash-table :test (or test 'eql)))
1188 1194
1189;; These are used by VM and some old programs 1195;; These are used by VM and some old programs
1190(defalias 'focus-frame 'ignore "") 1196(defalias 'focus-frame 'ignore "")
@@ -1250,11 +1256,6 @@ is converted into a string by expressing it in decimal."
1250(make-obsolete 'process-filter-multibyte-p nil "23.1") 1256(make-obsolete 'process-filter-multibyte-p nil "23.1")
1251(make-obsolete 'set-process-filter-multibyte nil "23.1") 1257(make-obsolete 'set-process-filter-multibyte nil "23.1")
1252 1258
1253(make-obsolete-variable
1254 'mode-line-inverse-video
1255 "use the appropriate faces instead."
1256 "21.1")
1257
1258;; Lisp manual only updated in 22.1. 1259;; Lisp manual only updated in 22.1.
1259(define-obsolete-variable-alias 'executing-macro 'executing-kbd-macro 1260(define-obsolete-variable-alias 'executing-macro 'executing-kbd-macro
1260 "before 19.34") 1261 "before 19.34")
@@ -1911,8 +1912,8 @@ This function is called directly from the C code."
1911 "Read the following input sexp, and run it whenever FILE is loaded. 1912 "Read the following input sexp, and run it whenever FILE is loaded.
1912This makes or adds to an entry on `after-load-alist'. 1913This makes or adds to an entry on `after-load-alist'.
1913FILE should be the name of a library, with no directory name." 1914FILE should be the name of a library, with no directory name."
1915 (declare (obsolete eval-after-load "23.2"))
1914 (eval-after-load file (read))) 1916 (eval-after-load file (read)))
1915(make-obsolete 'eval-next-after-load `eval-after-load "23.2")
1916 1917
1917(defun display-delayed-warnings () 1918(defun display-delayed-warnings ()
1918 "Display delayed warnings from `delayed-warnings-list'. 1919 "Display delayed warnings from `delayed-warnings-list'.
diff --git a/lisp/term.el b/lisp/term.el
index d5f35006357..7567bd38f5a 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -994,7 +994,10 @@ is buffer-local."
994 (setq term-ansi-current-reverse nil) 994 (setq term-ansi-current-reverse nil)
995 (setq term-ansi-current-color 0) 995 (setq term-ansi-current-color 0)
996 (setq term-ansi-current-invisible nil) 996 (setq term-ansi-current-invisible nil)
997 (setq term-ansi-face-already-done t) 997 ;; Stefan thought this should be t, but could not remember why.
998 ;; Setting it to t seems to cause bug#11785. Setting it to nil
999 ;; again to see if there are other consequences...
1000 (setq term-ansi-face-already-done nil)
998 (setq term-ansi-current-bg-color 0)) 1001 (setq term-ansi-current-bg-color 0))
999 1002
1000(define-derived-mode term-mode fundamental-mode "Term" 1003(define-derived-mode term-mode fundamental-mode "Term"
@@ -4048,6 +4051,7 @@ Returns `partial' if completed as far as possible with the completion matches.
4048Returns `listed' if a completion listing was shown. 4051Returns `listed' if a completion listing was shown.
4049 4052
4050See also `term-dynamic-complete-filename'." 4053See also `term-dynamic-complete-filename'."
4054 (declare (obsolete completion-in-region "23.2"))
4051 (let* ((completion-ignore-case nil) 4055 (let* ((completion-ignore-case nil)
4052 (candidates (mapcar (function (lambda (x) (list x))) candidates)) 4056 (candidates (mapcar (function (lambda (x) (list x))) candidates))
4053 (completions (all-completions stub candidates))) 4057 (completions (all-completions stub candidates)))
@@ -4081,8 +4085,6 @@ See also `term-dynamic-complete-filename'."
4081 (t 4085 (t
4082 (message "Partially completed") 4086 (message "Partially completed")
4083 'partial))))))) 4087 'partial)))))))
4084(make-obsolete 'term-dynamic-simple-complete 'completion-in-region "23.2")
4085
4086 4088
4087(defun term-dynamic-list-filename-completions () 4089(defun term-dynamic-list-filename-completions ()
4088 "List in help buffer possible completions of the filename at point." 4090 "List in help buffer possible completions of the filename at point."
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 31656918fad..e0d93b68056 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -1002,6 +1002,7 @@ See `bibtex-generate-autokey' for details."
1002 ("\\\\`\\|\\\\'\\|\\\\\\^\\|\\\\~\\|\\\\=\\|\\\\\\.\\|\\\\u\\|\\\\v\\|\\\\H\\|\\\\t\\|\\\\c\\|\\\\d\\|\\\\b" . "") 1002 ("\\\\`\\|\\\\'\\|\\\\\\^\\|\\\\~\\|\\\\=\\|\\\\\\.\\|\\\\u\\|\\\\v\\|\\\\H\\|\\\\t\\|\\\\c\\|\\\\d\\|\\\\b" . "")
1003 ;; braces, quotes, concatenation. 1003 ;; braces, quotes, concatenation.
1004 ("[`'\"{}#]" . "") 1004 ("[`'\"{}#]" . "")
1005 ("\\\\-" . "") ; \- ->
1005 ;; spaces 1006 ;; spaces
1006 ("\\\\?[ \t\n]+\\|~" . " ")) 1007 ("\\\\?[ \t\n]+\\|~" . " "))
1007 "Alist of (OLD-REGEXP . NEW-STRING) pairs. 1008 "Alist of (OLD-REGEXP . NEW-STRING) pairs.
@@ -4893,21 +4894,22 @@ If mark is active reformat entries in region, if not in whole buffer."
4893 (if use-previous-options 4894 (if use-previous-options
4894 bibtex-reformat-previous-options 4895 bibtex-reformat-previous-options
4895 (setq bibtex-reformat-previous-options 4896 (setq bibtex-reformat-previous-options
4896 (mapcar (lambda (option) 4897 (delq nil
4897 (if (y-or-n-p (car option)) (cdr option))) 4898 (mapcar (lambda (option)
4898 `(("Realign entries (recommended)? " . 'realign) 4899 (if (y-or-n-p (car option)) (cdr option)))
4899 ("Remove empty optional and alternative fields? " . 'opts-or-alts) 4900 `(("Realign entries (recommended)? " . realign)
4900 ("Remove delimiters around pure numerical fields? " . 'numerical-fields) 4901 ("Remove empty optional and alternative fields? " . opts-or-alts)
4901 (,(concat (if bibtex-comma-after-last-field "Insert" "Remove") 4902 ("Remove delimiters around pure numerical fields? " . numerical-fields)
4902 " comma at end of entry? ") . 'last-comma) 4903 (,(concat (if bibtex-comma-after-last-field "Insert" "Remove")
4903 ("Replace double page dashes by single ones? " . 'page-dashes) 4904 " comma at end of entry? ") . last-comma)
4904 ("Delete whitespace at the beginning and end of fields? " . 'whitespace) 4905 ("Replace double page dashes by single ones? " . page-dashes)
4905 ("Inherit booktitle? " . 'inherit-booktitle) 4906 ("Delete whitespace at the beginning and end of fields? " . whitespace)
4906 ("Force delimiters? " . 'delimiters) 4907 ("Inherit booktitle? " . inherit-booktitle)
4907 ("Unify case of entry types and field names? " . 'unify-case) 4908 ("Force delimiters? " . delimiters)
4908 ("Enclose parts of field entries by braces? " . 'braces) 4909 ("Unify case of entry types and field names? " . unify-case)
4909 ("Replace parts of field entries by string constants? " . 'strings) 4910 ("Enclose parts of field entries by braces? " . braces)
4910 ("Sort fields? " . 'sort-fields)))))) 4911 ("Replace parts of field entries by string constants? " . strings)
4912 ("Sort fields? " . sort-fields)))))))
4911 ;; Do not include required-fields because `bibtex-reformat' 4913 ;; Do not include required-fields because `bibtex-reformat'
4912 ;; cannot handle the error messages of `bibtex-format-entry'. 4914 ;; cannot handle the error messages of `bibtex-format-entry'.
4913 ;; Use `bibtex-validate' to check for required fields. 4915 ;; Use `bibtex-validate' to check for required fields.
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index 31001c78e54..229d12b2906 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -542,10 +542,7 @@
542 (t "")))) 542 (t ""))))
543 (setq authors (reftex-truncate authors 30 t t)) 543 (setq authors (reftex-truncate authors 30 t t))
544 (when (reftex-use-fonts) 544 (when (reftex-use-fonts)
545 (put-text-property 0 (length key) 'face 545 (put-text-property 0 (length key) 'face reftex-label-face
546 (reftex-verified-face reftex-label-face
547 'font-lock-constant-face
548 'font-lock-reference-face)
549 key) 546 key)
550 (put-text-property 0 (length authors) 'face reftex-bib-author-face 547 (put-text-property 0 (length authors) 'face reftex-bib-author-face
551 authors) 548 authors)
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index 2d395fe3df2..1d15dfbed7e 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -585,9 +585,7 @@ SPC=view TAB=goto RET=goto+hide [e]dit [q]uit [r]escan [f]ollow [?]Help
585 (if (memq reftex-highlight-selection '(mouse both)) 585 (if (memq reftex-highlight-selection '(mouse both))
586 reftex-mouse-selected-face 586 reftex-mouse-selected-face
587 nil)) 587 nil))
588 (index-face (reftex-verified-face reftex-label-face 588 (index-face reftex-label-face)
589 'font-lock-constant-face
590 'font-lock-reference-face))
591 sublist cell from to first-char) 589 sublist cell from to first-char)
592 590
593 ;; Make the sublist and sort it 591 ;; Make the sublist and sort it
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el
index 627dfba0071..1a400436311 100644
--- a/lisp/textmodes/reftex-sel.el
+++ b/lisp/textmodes/reftex-sel.el
@@ -245,12 +245,8 @@ During a selection process, these are the local bindings.
245 (if (memq reftex-highlight-selection '(mouse both)) 245 (if (memq reftex-highlight-selection '(mouse both))
246 reftex-mouse-selected-face 246 reftex-mouse-selected-face
247 nil)) 247 nil))
248 (label-face (reftex-verified-face reftex-label-face 248 (label-face reftex-label-face)
249 'font-lock-constant-face 249 (index-face reftex-index-face)
250 'font-lock-reference-face))
251 (index-face (reftex-verified-face reftex-index-face
252 'font-lock-constant-face
253 'font-lock-reference-face))
254 all cell text label typekey note comment master-dir-re 250 all cell text label typekey note comment master-dir-re
255 prev-inserted offset from to index-tag docstruct-symbol) 251 prev-inserted offset from to index-tag docstruct-symbol)
256 252
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 8584c496a97..8318dc0d5f3 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -2311,9 +2311,7 @@ IGNORE-WORDS List of words which should be removed from the string."
2311 ;; Return the first valid face in FACES, or nil if none is valid. 2311 ;; Return the first valid face in FACES, or nil if none is valid.
2312 ;; Also, when finding a nil element in FACES, return nil. This 2312 ;; Also, when finding a nil element in FACES, return nil. This
2313 ;; function is just a safety net to catch name changes of builtin 2313 ;; function is just a safety net to catch name changes of builtin
2314 ;; fonts. Currently it is only used for reftex-label-face, which has 2314 ;; fonts. Currently it is only used for reftex-label-face.
2315 ;; as default font-lock-reference-face, which was recently renamed
2316 ;; to font-lock-constant-face.
2317 (let (face) 2315 (let (face)
2318 (catch 'exit 2316 (catch 'exit
2319 (while (setq face (pop faces)) 2317 (while (setq face (pop faces))
diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el
index eeafe586c27..869da63064a 100644
--- a/lisp/textmodes/rst.el
+++ b/lisp/textmodes/rst.el
@@ -118,7 +118,8 @@
118;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 118;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
119;; Support for `testcover' 119;; Support for `testcover'
120 120
121(when (boundp 'testcover-1value-functions) 121(when (and (boundp 'testcover-1value-functions)
122 (boundp 'testcover-compose-functions))
122 ;; Below `lambda' is used in a loop with varying parameters and is thus not 123 ;; Below `lambda' is used in a loop with varying parameters and is thus not
123 ;; 1valued. 124 ;; 1valued.
124 (setq testcover-1value-functions 125 (setq testcover-1value-functions
@@ -217,7 +218,7 @@ and before TAIL-RE and DELIM-RE in VAR or DEFAULT for no match."
217;; Use CVSHeader to really get information from CVS and not other version 218;; Use CVSHeader to really get information from CVS and not other version
218;; control systems. 219;; control systems.
219(defconst rst-cvs-header 220(defconst rst-cvs-header
220 "$CVSHeader: sm/rst_el/rst.el,v 1.327.2.1 2012-09-22 09:06:56 stefan Exp $") 221 "$CVSHeader: sm/rst_el/rst.el,v 1.327.2.2 2012-09-23 14:44:25 stefan Exp $")
221(defconst rst-cvs-rev 222(defconst rst-cvs-rev
222 (rst-extract-version "\\$" "CVSHeader: \\S + " "[0-9]+\\(?:\\.[0-9]+\\)+" 223 (rst-extract-version "\\$" "CVSHeader: \\S + " "[0-9]+\\(?:\\.[0-9]+\\)+"
223 " .*" rst-cvs-header "0.0") 224 " .*" rst-cvs-header "0.0")
@@ -246,7 +247,7 @@ SVN revision is the upstream (docutils) revision.")
246 "Official version of the package.") 247 "Official version of the package.")
247(defconst rst-official-cvs-rev 248(defconst rst-official-cvs-rev
248 (rst-extract-version "[%$]" "Revision: " "[0-9]+\\(?:\\.[0-9]+\\)+" " " 249 (rst-extract-version "[%$]" "Revision: " "[0-9]+\\(?:\\.[0-9]+\\)+" " "
249 "$Revision: 1.327.2.1 $") 250 "$Revision: 1.327.2.2 $")
250 "CVS revision of this file in the official version.") 251 "CVS revision of this file in the official version.")
251 252
252(defconst rst-version 253(defconst rst-version
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 67d7f8c01f9..46c65b25b37 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -34,7 +34,6 @@
34 34
35(eval-when-compile 35(eval-when-compile
36 (require 'skeleton) 36 (require 'skeleton)
37 (require 'outline)
38 (require 'cl-lib)) 37 (require 'cl-lib))
39 38
40(defgroup sgml nil 39(defgroup sgml nil
@@ -1938,6 +1937,10 @@ This takes effect when first loading the library.")
1938 ("wbr" . "Enable <br> within <nobr>")) 1937 ("wbr" . "Enable <br> within <nobr>"))
1939 "Value of `sgml-tag-help' for HTML mode.") 1938 "Value of `sgml-tag-help' for HTML mode.")
1940 1939
1940(defvar outline-regexp)
1941(defvar outline-heading-end-regexp)
1942(defvar outline-level)
1943
1941 1944
1942;;;###autoload 1945;;;###autoload
1943(define-derived-mode html-mode sgml-mode '(sgml-xml-mode "XHTML" "HTML") 1946(define-derived-mode html-mode sgml-mode '(sgml-xml-mode "XHTML" "HTML")
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 620a1da633e..a324daa9283 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -860,10 +860,6 @@ START is the position of the \\ and DELIM is the delimiter char."
860 (set-keymap-parent map text-mode-map) 860 (set-keymap-parent map text-mode-map)
861 (tex-define-common-keys map) 861 (tex-define-common-keys map)
862 (define-key map "\"" 'tex-insert-quote) 862 (define-key map "\"" 'tex-insert-quote)
863 (define-key map "(" 'skeleton-pair-insert-maybe)
864 (define-key map "{" 'skeleton-pair-insert-maybe)
865 (define-key map "[" 'skeleton-pair-insert-maybe)
866 (define-key map "$" 'skeleton-pair-insert-maybe)
867 (define-key map "\n" 'tex-terminate-paragraph) 863 (define-key map "\n" 'tex-terminate-paragraph)
868 (define-key map "\M-\r" 'latex-insert-item) 864 (define-key map "\M-\r" 'latex-insert-item)
869 (define-key map "\C-c}" 'up-list) 865 (define-key map "\C-c}" 'up-list)
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el
index 30e5390a3e1..301f69f45be 100644
--- a/lisp/textmodes/text-mode.el
+++ b/lisp/textmodes/text-mode.el
@@ -80,18 +80,29 @@ Turning on Paragraph-Indent Text mode runs the normal hooks
80 :abbrev-table nil :syntax-table nil 80 :abbrev-table nil :syntax-table nil
81 (paragraph-indent-minor-mode)) 81 (paragraph-indent-minor-mode))
82 82
83(defun paragraph-indent-minor-mode () 83(define-minor-mode paragraph-indent-minor-mode
84 "Minor mode for editing text, with leading spaces starting a paragraph. 84 "Minor mode for editing text, with leading spaces starting a paragraph.
85In this mode, you do not need blank lines between paragraphs when the 85In this mode, you do not need blank lines between paragraphs when the
86first line of the following paragraph starts with whitespace, as with 86first line of the following paragraph starts with whitespace, as with
87`paragraph-indent-text-mode'. 87`paragraph-indent-text-mode'.
88Turning on Paragraph-Indent minor mode runs the normal hook 88Turning on Paragraph-Indent minor mode runs the normal hook
89`paragraph-indent-text-mode-hook'." 89`paragraph-indent-text-mode-hook'."
90 (interactive) 90 :initial-value nil
91 (set (make-local-variable 'paragraph-start) 91 ;; Change the definition of a paragraph start.
92 (concat "[ \t\n\f]\\|" paragraph-start)) 92 (let ((ps-re "[ \t\n\f]\\|"))
93 (set (make-local-variable 'indent-line-function) 'indent-to-left-margin) 93 (if (eq t (compare-strings ps-re nil nil
94 (run-hooks 'paragraph-indent-text-mode-hook)) 94 paragraph-start nil (length ps-re)))
95 (if (not paragraph-indent-minor-mode)
96 (set (make-local-variable 'paragraph-start)
97 (substring paragraph-start (length ps-re))))
98 (if paragraph-indent-minor-mode
99 (set (make-local-variable 'paragraph-start)
100 (concat ps-re paragraph-start)))))
101 ;; Change the indentation function.
102 (if paragraph-indent-minor-mode
103 (set (make-local-variable 'indent-line-function) 'indent-to-left-margin)
104 (if (eq indent-line-function 'indent-to-left-margin)
105 (set (make-local-variable 'indent-line-function) 'indent-region))))
95 106
96(defalias 'indented-text-mode 'text-mode) 107(defalias 'indented-text-mode 'text-mode)
97 108
diff --git a/lisp/tutorial.el b/lisp/tutorial.el
index 64879e5cfd5..6f76068ea9d 100644
--- a/lisp/tutorial.el
+++ b/lisp/tutorial.el
@@ -765,14 +765,13 @@ Run the Viper tutorial? "))
765 (funcall 'viper-tutorial 0)) 765 (funcall 'viper-tutorial 0))
766 (message "Tutorial aborted by user")) 766 (message "Tutorial aborted by user"))
767 (message prompt1))) 767 (message prompt1)))
768 (let* ((lang (if arg 768 (let* ((lang (cond
769 (let ((minibuffer-setup-hook minibuffer-setup-hook)) 769 (arg
770 (add-hook 'minibuffer-setup-hook 770 (minibuffer-with-setup-hook #'minibuffer-completion-help
771 'minibuffer-completion-help) 771 (read-language-name 'tutorial "Language: " "English")))
772 (read-language-name 'tutorial "Language: " "English")) 772 ((get-language-info current-language-environment 'tutorial)
773 (if (get-language-info current-language-environment 'tutorial) 773 current-language-environment)
774 current-language-environment 774 (t "English")))
775 "English")))
776 (filename (get-language-info lang 'tutorial)) 775 (filename (get-language-info lang 'tutorial))
777 (tut-buf-name filename) 776 (tut-buf-name filename)
778 (old-tut-buf (get-buffer tut-buf-name)) 777 (old-tut-buf (get-buffer tut-buf-name))
diff --git a/lisp/type-break.el b/lisp/type-break.el
index 8a95508d939..949b3b720a0 100644
--- a/lisp/type-break.el
+++ b/lisp/type-break.el
@@ -1,4 +1,4 @@
1;;; type-break.el --- encourage rests from typing at appropriate intervals 1;;; type-break.el --- encourage rests from typing at appropriate intervals -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1994-1995, 1997, 2000-2012 Free Software Foundation, Inc. 3;; Copyright (C) 1994-1995, 1997, 2000-2012 Free Software Foundation, Inc.
4 4
@@ -69,26 +69,11 @@
69 :prefix "type-break" 69 :prefix "type-break"
70 :group 'keyboard) 70 :group 'keyboard)
71 71
72;;;###autoload
73(defcustom type-break-mode nil
74 "Toggle typing break mode.
75See the docstring for the `type-break-mode' command for more information.
76Setting this variable directly does not take effect;
77use either \\[customize] or the function `type-break-mode'."
78 :set (lambda (_symbol value)
79 (type-break-mode (if value 1 -1)))
80 :initialize 'custom-initialize-default
81 :type 'boolean
82 :group 'type-break
83 :require 'type-break)
84
85;;;###autoload
86(defcustom type-break-interval (* 60 60) 72(defcustom type-break-interval (* 60 60)
87 "Number of seconds between scheduled typing breaks." 73 "Number of seconds between scheduled typing breaks."
88 :type 'integer 74 :type 'integer
89 :group 'type-break) 75 :group 'type-break)
90 76
91;;;###autoload
92(defcustom type-break-good-rest-interval (/ type-break-interval 6) 77(defcustom type-break-good-rest-interval (/ type-break-interval 6)
93 "Number of seconds of idle time considered to be an adequate typing rest. 78 "Number of seconds of idle time considered to be an adequate typing rest.
94 79
@@ -98,10 +83,10 @@ rest from typing, then the next typing break is simply rescheduled for later.
98 83
99If a break is interrupted before this much time elapses, the user will be 84If a break is interrupted before this much time elapses, the user will be
100asked whether or not really to interrupt the break." 85asked whether or not really to interrupt the break."
86 :set-after '(type-break-interval)
101 :type 'integer 87 :type 'integer
102 :group 'type-break) 88 :group 'type-break)
103 89
104;;;###autoload
105(defcustom type-break-good-break-interval nil 90(defcustom type-break-good-break-interval nil
106 "Number of seconds considered to be an adequate explicit typing rest. 91 "Number of seconds considered to be an adequate explicit typing rest.
107 92
@@ -112,7 +97,6 @@ break interruptions when `type-break-good-rest-interval' is nil."
112 :type 'integer 97 :type 'integer
113 :group 'type-break) 98 :group 'type-break)
114 99
115;;;###autoload
116(defcustom type-break-keystroke-threshold 100(defcustom type-break-keystroke-threshold
117 ;; Assuming typing speed is 35wpm (on the average, do you really 101 ;; Assuming typing speed is 35wpm (on the average, do you really
118 ;; type more than that in a minute? I spend a lot of time reading mail 102 ;; type more than that in a minute? I spend a lot of time reading mail
@@ -147,6 +131,7 @@ keystroke even though they really require multiple keys to generate them.
147 131
148The command `type-break-guesstimate-keystroke-threshold' can be used to 132The command `type-break-guesstimate-keystroke-threshold' can be used to
149guess a reasonably good pair of values for this variable." 133guess a reasonably good pair of values for this variable."
134 :set-after '(type-break-interval)
150 :type 'sexp 135 :type 'sexp
151 :group 'type-break) 136 :group 'type-break)
152 137
@@ -288,7 +273,7 @@ It will be either \"seconds\" or \"keystrokes\".")
288 273
289 274
290;;;###autoload 275;;;###autoload
291(defun type-break-mode (&optional prefix) 276(define-minor-mode type-break-mode
292 "Enable or disable typing-break mode. 277 "Enable or disable typing-break mode.
293This is a minor mode, but it is global to all buffers by default. 278This is a minor mode, but it is global to all buffers by default.
294 279
@@ -361,74 +346,61 @@ Finally, a file (named `type-break-file-name') is used to store information
361across Emacs sessions. This provides recovery of the break status between 346across Emacs sessions. This provides recovery of the break status between
362sessions and after a crash. Manual changes to the file may result in 347sessions and after a crash. Manual changes to the file may result in
363problems." 348problems."
364 (interactive "P") 349 :lighter type-break-mode-line-format
365 (type-break-check-post-command-hook) 350 :global t
366 351
367 (let ((already-enabled type-break-mode)) 352 (type-break-check-post-command-hook)
368 (setq type-break-mode (>= (prefix-numeric-value prefix) 0))
369 353
370 (cond 354 (cond
371 ((and already-enabled type-break-mode) 355 ;; ((and already-enabled type-break-mode)
372 (and (called-interactively-p 'interactive) 356 ;; (and (called-interactively-p 'interactive)
373 (message "Type Break mode is already enabled"))) 357 ;; (message "Type Break mode is already enabled")))
374 (type-break-mode 358 (type-break-mode
375 (when type-break-file-name 359 (when type-break-file-name
376 (with-current-buffer (find-file-noselect type-break-file-name 'nowarn) 360 (with-current-buffer (find-file-noselect type-break-file-name 'nowarn)
377 (setq buffer-save-without-query t))) 361 (setq buffer-save-without-query t)))
378 362
379 (or global-mode-string 363 (or global-mode-string (setq global-mode-string '(""))) ;FIXME: Why?
380 (setq global-mode-string '(""))) 364 (type-break-keystroke-reset)
381 (or (assq 'type-break-mode-line-message-mode 365 (type-break-mode-line-countdown-or-break nil)
382 minor-mode-alist) 366
383 (setq minor-mode-alist 367 (setq type-break-time-last-break
384 (cons type-break-mode-line-format 368 (or (type-break-get-previous-time)
385 minor-mode-alist))) 369 (current-time)))
386 (type-break-keystroke-reset) 370
387 (type-break-mode-line-countdown-or-break nil) 371 ;; Schedule according to break time from session file.
388 372 (type-break-schedule
389 (setq type-break-time-last-break 373 (let (diff)
390 (or (type-break-get-previous-time) 374 (if (and type-break-time-last-break
391 (current-time))) 375 (< (setq diff (type-break-time-difference
392 376 type-break-time-last-break
393 ;; schedule according to break time from session file 377 (current-time)))
394 (type-break-schedule 378 type-break-interval))
395 (let (diff) 379 ;; Use the file's value.
396 (if (and type-break-time-last-break 380 (progn
397 (< (setq diff (type-break-time-difference 381 (setq type-break-keystroke-count
398 type-break-time-last-break 382 (type-break-get-previous-count))
399 (current-time))) 383 ;; File the time, in case it was read from the auto-save file.
400 type-break-interval)) 384 (type-break-file-time type-break-interval-start)
401 ;; use the file's value 385 (setq type-break-interval-start type-break-time-last-break)
402 (progn 386 (- type-break-interval diff))
403 (setq type-break-keystroke-count 387 ;; Schedule from now.
404 (type-break-get-previous-count)) 388 (setq type-break-interval-start (current-time))
405 ;; file the time, in case it was read from the auto-save file 389 (type-break-file-time type-break-interval-start)
406 (type-break-file-time type-break-interval-start) 390 type-break-interval))
407 (setq type-break-interval-start type-break-time-last-break) 391 type-break-interval-start
408 (- type-break-interval diff)) 392 type-break-interval))
409 ;; schedule from now 393 (t
410 (setq type-break-interval-start (current-time)) 394 (type-break-keystroke-reset)
411 (type-break-file-time type-break-interval-start) 395 (type-break-mode-line-countdown-or-break nil)
412 type-break-interval)) 396 (type-break-cancel-schedule)
413 type-break-interval-start 397 (do-auto-save)
414 type-break-interval) 398 (when type-break-file-name
415 399 (with-current-buffer (find-file-noselect type-break-file-name
416 (and (called-interactively-p 'interactive) 400 'nowarn)
417 (message "Type Break mode is enabled and set"))) 401 (set-buffer-modified-p nil)
418 (t 402 (unlock-buffer)
419 (type-break-keystroke-reset) 403 (kill-this-buffer))))))
420 (type-break-mode-line-countdown-or-break nil)
421 (type-break-cancel-schedule)
422 (do-auto-save)
423 (when type-break-file-name
424 (with-current-buffer (find-file-noselect type-break-file-name
425 'nowarn)
426 (set-buffer-modified-p nil)
427 (unlock-buffer)
428 (kill-this-buffer)))
429 (and (called-interactively-p 'interactive)
430 (message "Type Break mode is disabled")))))
431 type-break-mode)
432 404
433(define-minor-mode type-break-mode-line-message-mode 405(define-minor-mode type-break-mode-line-message-mode
434 "Toggle warnings about typing breaks in the mode line. 406 "Toggle warnings about typing breaks in the mode line.
@@ -997,10 +969,11 @@ FRAC should be the inverse of the fractional value; for example, a value of
997;; "low" bits and format the time incorrectly. 969;; "low" bits and format the time incorrectly.
998(defun type-break-time-sum (&rest tmlist) 970(defun type-break-time-sum (&rest tmlist)
999 (let ((sum '(0 0 0))) 971 (let ((sum '(0 0 0)))
1000 (dolist (tem tmlist sum) 972 (dolist (tem tmlist)
1001 (setq sum (time-add sum (if (integerp tem) 973 (setq sum (time-add sum (if (integerp tem)
1002 (list (floor tem 65536) (mod tem 65536)) 974 (list (floor tem 65536) (mod tem 65536))
1003 tem)))))) 975 tem))))
976 sum))
1004 977
1005(defun type-break-time-stamp (&optional when) 978(defun type-break-time-stamp (&optional when)
1006 (if (fboundp 'format-time-string) 979 (if (fboundp 'format-time-string)
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index a72f12ccb9b..a00d748a4a4 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,22 @@
12012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * url-handlers.el (url-file-handler): Don't assume any url-FOO function
4 is a good handler for FOO.
5 (url-copy-file, url-file-local-copy, url-insert-file-contents)
6 (url-file-name-completion, url-file-name-all-completions)
7 (url-handlers-create-wrapper): Explicitly register as handler.
8
92012-09-29 Bastien Guerry <bzg@gnu.org>
10
11 * url-util.el (url-insert-entities-in-string)
12 (url-build-query-string): Fix docstrings.
13
142012-09-25 Chong Yidong <cyd@gnu.org>
15
16 * url-parse.el (url-recreate-url-attributes):
17 * url-util.el (url-generate-unique-filename): Use declare to mark
18 obsolete.
19
12012-08-14 Stefan Monnier <monnier@iro.umontreal.ca> 202012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
2 21
3 * url-http.el (url-http-parse-headers): Re-enable file-name-handlers 22 * url-http.el (url-http-parse-headers): Re-enable file-name-handlers
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el
index f731f614d13..796980afbd5 100644
--- a/lisp/url/url-handlers.el
+++ b/lisp/url/url-handlers.el
@@ -137,11 +137,13 @@ like URLs \(Gnus is particularly bad at this\)."
137 "Function called from the `file-name-handler-alist' routines. 137 "Function called from the `file-name-handler-alist' routines.
138OPERATION is what needs to be done (`file-exists-p', etc). ARGS are 138OPERATION is what needs to be done (`file-exists-p', etc). ARGS are
139the arguments that would have been passed to OPERATION." 139the arguments that would have been passed to OPERATION."
140 (let ((fn (or (get operation 'url-file-handlers) 140 (let ((fn (get operation 'url-file-handlers))
141 (intern-soft (format "url-%s" operation))))
142 (val nil) 141 (val nil)
143 (hooked nil)) 142 (hooked nil))
144 (if (and fn (fboundp fn)) 143 (if (and (not fn) (intern-soft (format "url-%s" operation))
144 (fboundp (intern-soft (format "url-%s" operation))))
145 (error "Missing URL handler mapping for %s" operation))
146 (if fn
145 (setq hooked t 147 (setq hooked t
146 val (save-match-data (apply fn args))) 148 val (save-match-data (apply fn args)))
147 (setq hooked nil 149 (setq hooked nil
@@ -249,6 +251,7 @@ A prefix arg makes KEEP-TIME non-nil."
249 (mm-save-part-to-file handle newname) 251 (mm-save-part-to-file handle newname)
250 (kill-buffer buffer) 252 (kill-buffer buffer)
251 (mm-destroy-parts handle))) 253 (mm-destroy-parts handle)))
254(put 'copy-file 'url-file-handlers 'url-copy-file)
252 255
253;;;###autoload 256;;;###autoload
254(defun url-file-local-copy (url &rest ignored) 257(defun url-file-local-copy (url &rest ignored)
@@ -258,6 +261,7 @@ accessible."
258 (let ((filename (make-temp-file "url"))) 261 (let ((filename (make-temp-file "url")))
259 (url-copy-file url filename 'ok-if-already-exists) 262 (url-copy-file url filename 'ok-if-already-exists)
260 filename)) 263 filename))
264(put 'file-local-copy 'url-file-handlers 'url-file-local-copy)
261 265
262(defun url-insert (buffer &optional beg end) 266(defun url-insert (buffer &optional beg end)
263 "Insert the body of a URL object. 267 "Insert the body of a URL object.
@@ -300,22 +304,29 @@ They count bytes from the beginning of the body."
300 ;; usual heuristic/rules that we apply to files. 304 ;; usual heuristic/rules that we apply to files.
301 (decode-coding-inserted-region start (point) url visit beg end replace)) 305 (decode-coding-inserted-region start (point) url visit beg end replace))
302 (list url (car size-and-charset)))))) 306 (list url (car size-and-charset))))))
307(put 'insert-file-contents 'url-file-handlers 'url-insert-file-contents)
303 308
304(defun url-file-name-completion (url directory &optional predicate) 309(defun url-file-name-completion (url directory &optional predicate)
305 (error "Unimplemented")) 310 (error "Unimplemented"))
311(put 'file-name-completion 'url-file-handlers 'url-file-name-completion)
306 312
307(defun url-file-name-all-completions (file directory) 313(defun url-file-name-all-completions (file directory)
308 (error "Unimplemented")) 314 (error "Unimplemented"))
315(put 'file-name-all-completions
316 'url-file-handlers 'url-file-name-all-completions)
309 317
310;; All other handlers map onto their respective backends. 318;; All other handlers map onto their respective backends.
311(defmacro url-handlers-create-wrapper (method args) 319(defmacro url-handlers-create-wrapper (method args)
312 `(defun ,(intern (format "url-%s" method)) ,args 320 `(progn
313 ,(format "URL file-name-handler wrapper for `%s' call.\n---\n%s" method 321 (defun ,(intern (format "url-%s" method)) ,args
314 (or (documentation method t) "No original documentation.")) 322 ,(format "URL file-name-handler wrapper for `%s' call.\n---\n%s" method
315 (setq url (url-generic-parse-url url)) 323 (or (documentation method t) "No original documentation."))
316 (when (url-type url) 324 (setq url (url-generic-parse-url url))
317 (funcall (url-scheme-get-property (url-type url) (quote ,method)) 325 (when (url-type url)
318 ,@(remove '&rest (remove '&optional args)))))) 326 (funcall (url-scheme-get-property (url-type url) (quote ,method))
327 ,@(remove '&rest (remove '&optional args)))))
328 (unless (get ',method 'url-file-handlers)
329 (put ',method 'url-file-handlers ',(intern (format "url-%s" method))))))
319 330
320(url-handlers-create-wrapper file-exists-p (url)) 331(url-handlers-create-wrapper file-exists-p (url))
321(url-handlers-create-wrapper file-attributes (url &optional id-format)) 332(url-handlers-create-wrapper file-attributes (url &optional id-format))
diff --git a/lisp/url/url-parse.el b/lisp/url/url-parse.el
index 4007d1f35b3..cb61a021251 100644
--- a/lisp/url/url-parse.el
+++ b/lisp/url/url-parse.el
@@ -98,6 +98,7 @@ If the specified port number is the default, return nil."
98 98
99(defun url-recreate-url-attributes (urlobj) 99(defun url-recreate-url-attributes (urlobj)
100 "Recreate the attributes of an URL string from the parsed URLOBJ." 100 "Recreate the attributes of an URL string from the parsed URLOBJ."
101 (declare (obsolete nil "24.3"))
101 (when (url-attributes urlobj) 102 (when (url-attributes urlobj)
102 (concat ";" 103 (concat ";"
103 (mapconcat (lambda (x) 104 (mapconcat (lambda (x)
@@ -105,7 +106,6 @@ If the specified port number is the default, return nil."
105 (concat (car x) "=" (cdr x)) 106 (concat (car x) "=" (cdr x))
106 (car x))) 107 (car x)))
107 (url-attributes urlobj) ";")))) 108 (url-attributes urlobj) ";"))))
108(make-obsolete 'url-recreate-url-attributes nil "24.3")
109 109
110;;;###autoload 110;;;###autoload
111(defun url-generic-parse-url (url) 111(defun url-generic-parse-url (url)
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index f654830e387..038b7fcf7fe 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -132,8 +132,8 @@ If a list, it is a list of the types of messages to be logged."
132(defun url-insert-entities-in-string (string) 132(defun url-insert-entities-in-string (string)
133 "Convert HTML markup-start characters to entity references in STRING. 133 "Convert HTML markup-start characters to entity references in STRING.
134Also replaces the \" character, so that the result may be safely used as 134Also replaces the \" character, so that the result may be safely used as
135 an attribute value in a tag. Returns a new string with the result of the 135an attribute value in a tag. Returns a new string with the result of the
136 conversion. Replaces these characters as follows: 136conversion. Replaces these characters as follows:
137 & ==> &amp; 137 & ==> &amp;
138 < ==> &lt; 138 < ==> &lt;
139 > ==> &gt; 139 > ==> &gt;
@@ -294,7 +294,7 @@ Given a QUERY in the form:
294 (key2 val2) 294 (key2 val2)
295 (key3 val1 val2) 295 (key3 val1 val2)
296 (key4) 296 (key4)
297 (key5 "")) 297 (key5 \"\"))
298 298
299\(This is the same format as produced by `url-parse-query-string') 299\(This is the same format as produced by `url-parse-query-string')
300 300
@@ -593,6 +593,7 @@ Has a preference for looking backward when not directly on a symbol."
593 593
594(defun url-generate-unique-filename (&optional fmt) 594(defun url-generate-unique-filename (&optional fmt)
595 "Generate a unique filename in `url-temporary-directory'." 595 "Generate a unique filename in `url-temporary-directory'."
596 (declare (obsolete make-temp-file "23.1"))
596 ;; This variable is obsolete, but so is this function. 597 ;; This variable is obsolete, but so is this function.
597 (let ((tempdir (with-no-warnings url-temporary-directory))) 598 (let ((tempdir (with-no-warnings url-temporary-directory)))
598 (if (not fmt) 599 (if (not fmt)
@@ -614,7 +615,6 @@ Has a preference for looking backward when not directly on a symbol."
614 (setq x (1+ x) 615 (setq x (1+ x)
615 fname (format fmt (concat base (int-to-string x))))) 616 fname (format fmt (concat base (int-to-string x)))))
616 (expand-file-name fname tempdir))))) 617 (expand-file-name fname tempdir)))))
617(make-obsolete 'url-generate-unique-filename 'make-temp-file "23.1")
618 618
619(defun url-extract-mime-headers () 619(defun url-extract-mime-headers ()
620 "Set `url-current-mime-headers' in current buffer." 620 "Set `url-current-mime-headers' in current buffer."
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el
index 674688df1c2..2c41ce8c457 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -753,6 +753,7 @@ to temp files in buffer jobs and when Ediff needs to find fine differences."
753 "Check the current version against MAJOR and MINOR version numbers. 753 "Check the current version against MAJOR and MINOR version numbers.
754The comparison uses operator OP, which may be any of: =, >, >=, <, <=. 754The comparison uses operator OP, which may be any of: =, >, >=, <, <=.
755TYPE-OF-EMACS is either 'xemacs or 'emacs." 755TYPE-OF-EMACS is either 'xemacs or 'emacs."
756 (declare (obsolete version< "23.1"))
756 (and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs)) 757 (and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs))
757 ((eq type-of-emacs 'emacs) (featurep 'emacs)) 758 ((eq type-of-emacs 'emacs) (featurep 'emacs))
758 (t)) 759 (t))
@@ -767,9 +768,6 @@ TYPE-OF-EMACS is either 'xemacs or 'emacs."
767 (t 768 (t
768 (error "%S: Invalid op in ediff-check-version" op))))) 769 (error "%S: Invalid op in ediff-check-version" op)))))
769 770
770;; ediff-check-version seems to be totally unused anyway.
771(make-obsolete 'ediff-check-version 'version< "23.1")
772
773(defun ediff-color-display-p () 771(defun ediff-color-display-p ()
774 (condition-case nil 772 (condition-case nil
775 (if (featurep 'xemacs) 773 (if (featurep 'xemacs)
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index 78a2163f653..86293ade580 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -1907,8 +1907,8 @@ in the specified buffer."
1907 1907
1908 (cond ((eq which-diff 'after) (1+ diff-no)) 1908 (cond ((eq which-diff 'after) (1+ diff-no))
1909 ((eq which-diff 'before) diff-no) 1909 ((eq which-diff 'before) diff-no)
1910 ((< (abs (count-lines pos (max 1 prev-end))) 1910 ((< (abs (count-lines pos (max (point-min) prev-end)))
1911 (abs (count-lines pos (max 1 beg)))) 1911 (abs (count-lines pos (max (point-min) beg))))
1912 diff-no) ; choose prev difference 1912 diff-no) ; choose prev difference
1913 (t 1913 (t
1914 (1+ diff-no))) ; choose next difference 1914 (1+ diff-no))) ; choose next difference
diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el
index eee3f40fd96..d7118ad7970 100644
--- a/lisp/vc/ediff-wind.el
+++ b/lisp/vc/ediff-wind.el
@@ -63,13 +63,11 @@
63 63
64;; Determine which window setup function to use based on current window system. 64;; Determine which window setup function to use based on current window system.
65(defun ediff-choose-window-setup-function-automatically () 65(defun ediff-choose-window-setup-function-automatically ()
66 (declare (obsolete ediff-setup-windows-default "24.3"))
66 (if (ediff-window-display-p) 67 (if (ediff-window-display-p)
67 'ediff-setup-windows-multiframe 68 'ediff-setup-windows-multiframe
68 'ediff-setup-windows-plain)) 69 'ediff-setup-windows-plain))
69 70
70(make-obsolete 'ediff-choose-window-setup-function-automatically
71 'ediff-setup-windows-default "24.3")
72
73(defcustom ediff-window-setup-function 'ediff-setup-windows-default 71(defcustom ediff-window-setup-function 'ediff-setup-windows-default
74 "Function called to set up windows. 72 "Function called to set up windows.
75Ediff provides a choice of three functions: 73Ediff provides a choice of three functions:
diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el
index f6942bc538d..0a1bd044125 100644
--- a/lisp/vc/emerge.el
+++ b/lisp/vc/emerge.el
@@ -76,18 +76,6 @@ Commands:
76Commands must be prefixed by \\<emerge-fast-keymap>\\[emerge-basic-keymap] in `edit' mode, 76Commands must be prefixed by \\<emerge-fast-keymap>\\[emerge-basic-keymap] in `edit' mode,
77but can be invoked directly in `fast' mode.") 77but can be invoked directly in `fast' mode.")
78 78
79(define-obsolete-variable-alias 'emerge-version 'emacs-version "23.2")
80
81(defun emerge-version ()
82 "Return string describing the version of Emerge.
83When called interactively, displays the version."
84 (interactive)
85 (if (called-interactively-p 'interactive)
86 (message "Emerge version %s" emacs-version)
87 emacs-version))
88
89(make-obsolete 'emerge-version 'emacs-version "23.2")
90
91;;; Emerge configuration variables 79;;; Emerge configuration variables
92 80
93(defgroup emerge nil 81(defgroup emerge nil
diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el
index 7ee000a8aea..932abb9818c 100644
--- a/lisp/vc/log-edit.el
+++ b/lisp/vc/log-edit.el
@@ -104,13 +104,7 @@ If 'changed, only request confirmation if the list of files has
104 :group 'log-edit 104 :group 'log-edit
105 :type 'boolean) 105 :type 'boolean)
106 106
107(defvar cvs-commit-buffer-require-final-newline t) 107(defcustom log-edit-require-final-newline t
108(make-obsolete-variable 'cvs-commit-buffer-require-final-newline
109 'log-edit-require-final-newline
110 "21.1")
111
112(defcustom log-edit-require-final-newline
113 cvs-commit-buffer-require-final-newline
114 "Enforce a newline at the end of commit log messages. 108 "Enforce a newline at the end of commit log messages.
115Enforce it silently if t, query if non-nil and don't do anything if nil." 109Enforce it silently if t, query if non-nil and don't do anything if nil."
116 :group 'log-edit 110 :group 'log-edit
@@ -154,12 +148,7 @@ can be obtained from `log-edit-files'."
154 :group 'log-edit 148 :group 'log-edit
155 :version "24.1") 149 :version "24.1")
156 150
157(defvar cvs-changelog-full-paragraphs t) 151(defvar log-edit-changelog-full-paragraphs t
158(make-obsolete-variable 'cvs-changelog-full-paragraphs
159 'log-edit-changelog-full-paragraphs
160 "21.1")
161
162(defvar log-edit-changelog-full-paragraphs cvs-changelog-full-paragraphs
163 "If non-nil, include full ChangeLog paragraphs in the log. 152 "If non-nil, include full ChangeLog paragraphs in the log.
164This may be set in the ``local variables'' section of a ChangeLog, to 153This may be set in the ``local variables'' section of a ChangeLog, to
165indicate the policy for that ChangeLog. 154indicate the policy for that ChangeLog.
@@ -354,14 +343,17 @@ automatically."
354 `((log-edit-match-to-eoh 343 `((log-edit-match-to-eoh
355 (,(concat "^\\(\\([[:alpha:]]+\\):\\)" log-edit-header-contents-regexp) 344 (,(concat "^\\(\\([[:alpha:]]+\\):\\)" log-edit-header-contents-regexp)
356 (progn (goto-char (match-beginning 0)) (match-end 0)) nil 345 (progn (goto-char (match-beginning 0)) (match-end 0)) nil
357 (1 (if (assoc (match-string 2) log-edit-headers-alist) 346 (1 (if (assoc-string (match-string 2) log-edit-headers-alist t)
358 'log-edit-header 347 'log-edit-header
359 'log-edit-unknown-header) 348 'log-edit-unknown-header)
360 nil lax) 349 nil lax)
361 ;; From `log-edit-header-contents-regexp': 350 ;; From `log-edit-header-contents-regexp':
362 (3 (or (cdr (assoc (match-string 2) log-edit-headers-alist)) 351 (3 (or (cdr (assoc-string (match-string 2) log-edit-headers-alist t))
363 'log-edit-header) 352 'log-edit-header)
364 nil lax))))) 353 nil lax))
354 ("^\n"
355 (progn (goto-char (match-end 0)) (1+ (match-end 0))) nil
356 (0 '(:height 0.1 :inverse-video t))))))
365 357
366(defvar log-edit-font-lock-gnu-style nil 358(defvar log-edit-font-lock-gnu-style nil
367 "If non-nil, highlight common failures to follow the GNU coding standards.") 359 "If non-nil, highlight common failures to follow the GNU coding standards.")
@@ -585,7 +577,7 @@ If you want to abort the commit, simply delete the buffer."
585 (or (= (point-min) (point-max)) 577 (or (= (point-min) (point-max))
586 (save-excursion 578 (save-excursion
587 (goto-char (point-min)) 579 (goto-char (point-min))
588 (while (and (looking-at "^\\([a-zA-Z]+: \\)?$") 580 (while (and (looking-at "^\\([a-zA-Z]+: ?\\)?$")
589 (zerop (forward-line 1)))) 581 (zerop (forward-line 1))))
590 (eobp)))) 582 (eobp))))
591 583
@@ -818,7 +810,7 @@ where LOGBUFFER is the name of the ChangeLog buffer, and each
818 change-log-default-name) 810 change-log-default-name)
819 ;; `find-change-log' uses `change-log-default-name' if set 811 ;; `find-change-log' uses `change-log-default-name' if set
820 ;; and sets it before exiting, so we need to work around 812 ;; and sets it before exiting, so we need to work around
821 ;; that memoizing which is undesired here 813 ;; that memoizing which is undesired here.
822 (setq change-log-default-name nil) 814 (setq change-log-default-name nil)
823 (find-change-log))))) 815 (find-change-log)))))
824 (with-current-buffer (find-file-noselect changelog-file-name) 816 (with-current-buffer (find-file-noselect changelog-file-name)
diff --git a/lisp/vc/pcvs-defs.el b/lisp/vc/pcvs-defs.el
index fc65d62c67d..b3c1f8c1343 100644
--- a/lisp/vc/pcvs-defs.el
+++ b/lisp/vc/pcvs-defs.el
@@ -133,14 +133,9 @@ current line. See also `cvs-invert-ignore-marks'"
133 :group 'pcl-cvs 133 :group 'pcl-cvs
134 :type '(boolean)) 134 :type '(boolean))
135 135
136(defvar cvs-diff-ignore-marks t)
137(make-obsolete-variable 'cvs-diff-ignore-marks
138 'cvs-invert-ignore-marks
139 "21.1")
140
141(defcustom cvs-invert-ignore-marks 136(defcustom cvs-invert-ignore-marks
142 (let ((l ())) 137 (let ((l ()))
143 (unless (equal cvs-diff-ignore-marks cvs-default-ignore-marks) 138 (unless (equal cvs-default-ignore-marks t)
144 (push "diff" l)) 139 (push "diff" l))
145 (when (and cvs-force-dir-tag (not cvs-default-ignore-marks)) 140 (when (and cvs-force-dir-tag (not cvs-default-ignore-marks))
146 (push "tag" l)) 141 (push "tag" l))
@@ -171,11 +166,6 @@ If set to nil, `cvs-mode-add' will always prompt for a message."
171 :type '(choice (const :tag "Prompt" nil) 166 :type '(choice (const :tag "Prompt" nil)
172 (string))) 167 (string)))
173 168
174(defvar cvs-diff-buffer-name "*cvs-diff*")
175(make-obsolete-variable 'cvs-diff-buffer-name
176 'cvs-buffer-name-alist
177 "21.1")
178
179(defcustom cvs-find-file-and-jump nil 169(defcustom cvs-find-file-and-jump nil
180 "Jump to the modified area when finding a file. 170 "Jump to the modified area when finding a file.
181If non-nil, `cvs-mode-find-file' will place the cursor at the beginning of 171If non-nil, `cvs-mode-find-file' will place the cursor at the beginning of
@@ -185,7 +175,7 @@ have no effect."
185 :type '(boolean)) 175 :type '(boolean))
186 176
187(defcustom cvs-buffer-name-alist 177(defcustom cvs-buffer-name-alist
188 '(("diff" cvs-diff-buffer-name diff-mode) 178 '(("diff" "*cvs-diff*" diff-mode)
189 ("status" "*cvs-info*" cvs-status-mode) 179 ("status" "*cvs-info*" cvs-status-mode)
190 ("tree" "*cvs-info*" cvs-status-mode) 180 ("tree" "*cvs-info*" cvs-status-mode)
191 ("message" "*cvs-commit*" nil log-edit) 181 ("message" "*cvs-commit*" nil log-edit)
diff --git a/lisp/vc/pcvs-info.el b/lisp/vc/pcvs-info.el
index 36572640cfc..e863096d587 100644
--- a/lisp/vc/pcvs-info.el
+++ b/lisp/vc/pcvs-info.el
@@ -124,7 +124,7 @@ to confuse some users sometimes."
124(define-obsolete-face-alias 'cvs-marked-face 'cvs-marked "22.1") 124(define-obsolete-face-alias 'cvs-marked-face 'cvs-marked "22.1")
125 125
126(defface cvs-msg 126(defface cvs-msg
127 '((t (:slant italic))) 127 '((t :slant italic))
128 "PCL-CVS face used to highlight CVS messages." 128 "PCL-CVS face used to highlight CVS messages."
129 :group 'pcl-cvs) 129 :group 'pcl-cvs)
130(define-obsolete-face-alias 'cvs-msg-face 'cvs-msg "22.1") 130(define-obsolete-face-alias 'cvs-msg-face 'cvs-msg "22.1")
@@ -358,7 +358,7 @@ For use by the cookie package."
358 ;;(MOD-CONFLICT "Not Removed") 358 ;;(MOD-CONFLICT "Not Removed")
359 (`DEAD "") 359 (`DEAD "")
360 (_ (capitalize (symbol-name type))))) 360 (_ (capitalize (symbol-name type)))))
361 (face (let ((sym (intern 361 (face (let ((sym (intern-soft
362 (concat "cvs-fi-" 362 (concat "cvs-fi-"
363 (downcase (symbol-name type)) 363 (downcase (symbol-name type))
364 "-face")))) 364 "-face"))))
diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el
index 659151a31e9..4bc3eaf8c2c 100644
--- a/lisp/vc/pcvs.el
+++ b/lisp/vc/pcvs.el
@@ -60,8 +60,6 @@
60;; - rework the displaying of error messages. 60;; - rework the displaying of error messages.
61;; - allow to flush messages only 61;; - allow to flush messages only
62;; - allow to protect files like ChangeLog from flushing 62;; - allow to protect files like ChangeLog from flushing
63;; - automatically cvs-mode-insert files from find-file-hook
64;; (and don't flush them as long as they are visited)
65;; - query the user for cvs-get-marked (for some cmds or if nothing's selected) 63;; - query the user for cvs-get-marked (for some cmds or if nothing's selected)
66;; - don't return the first (resp last) FI if the cursor is before 64;; - don't return the first (resp last) FI if the cursor is before
67;; (resp after) it. 65;; (resp after) it.
@@ -877,7 +875,10 @@ RM-MSGS if non-nil means remove messages."
877 ;; remove entries 875 ;; remove entries
878 (`DEAD nil) 876 (`DEAD nil)
879 ;; handled also? 877 ;; handled also?
880 (`UP-TO-DATE (not rm-handled)) 878 (`UP-TO-DATE
879 (if (find-buffer-visiting (cvs-fileinfo->full-name fi))
880 t
881 (not rm-handled)))
881 ;; keep the rest 882 ;; keep the rest
882 (_ (not (run-hook-with-args-until-success 883 (_ (not (run-hook-with-args-until-success
883 'cvs-cleanup-functions fi)))))) 884 'cvs-cleanup-functions fi))))))
@@ -1617,7 +1618,8 @@ With prefix argument, prompt for cvs flags."
1617(defun-cvs-mode (cvs-mode-diff . DOUBLE) (flags) 1618(defun-cvs-mode (cvs-mode-diff . DOUBLE) (flags)
1618 "Diff the selected files against the repository. 1619 "Diff the selected files against the repository.
1619This command compares the files in your working area against the 1620This command compares the files in your working area against the
1620revision which they are based upon." 1621revision which they are based upon.
1622See also `cvs-diff-ignore-marks'."
1621 (interactive 1623 (interactive
1622 (list (cvs-add-branch-prefix 1624 (list (cvs-add-branch-prefix
1623 (cvs-add-secondary-branch-prefix 1625 (cvs-add-secondary-branch-prefix
@@ -2435,6 +2437,21 @@ The exact behavior is determined also by `cvs-dired-use-hook'."
2435 2437
2436(add-hook 'after-save-hook 'cvs-mark-buffer-changed) 2438(add-hook 'after-save-hook 'cvs-mark-buffer-changed)
2437 2439
2440(defun cvs-insert-visited-file ()
2441 (let* ((file (expand-file-name buffer-file-name))
2442 (version (and (fboundp 'vc-backend)
2443 (eq (vc-backend file) 'CVS)
2444 (vc-working-revision file))))
2445 (when version
2446 (save-current-buffer
2447 (dolist (cvs-buf (buffer-list))
2448 (set-buffer cvs-buf)
2449 ;; look for a corresponding pcl-cvs buffer
2450 (when (and (eq major-mode 'cvs-mode)
2451 (string-prefix-p default-directory file))
2452 (cvs-insert-file file)))))))
2453
2454(add-hook 'find-file-hook 'cvs-insert-visited-file 'append)
2438 2455
2439(provide 'pcvs) 2456(provide 'pcvs)
2440 2457
diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el
index 1eb33776f6a..74a61548d8b 100644
--- a/lisp/vc/vc-bzr.el
+++ b/lisp/vc/vc-bzr.el
@@ -150,12 +150,6 @@ Use the current Bzr root directory as the ROOT argument to
150(defconst vc-bzr-admin-branchconf 150(defconst vc-bzr-admin-branchconf
151 (concat vc-bzr-admin-dirname "/branch/branch.conf")) 151 (concat vc-bzr-admin-dirname "/branch/branch.conf"))
152 152
153;;;###autoload (defun vc-bzr-registered (file)
154;;;###autoload (if (vc-find-root file vc-bzr-admin-checkout-format-file)
155;;;###autoload (progn
156;;;###autoload (load "vc-bzr")
157;;;###autoload (vc-bzr-registered file))))
158
159(defun vc-bzr-root (file) 153(defun vc-bzr-root (file)
160 "Return the root directory of the bzr repository containing FILE." 154 "Return the root directory of the bzr repository containing FILE."
161 ;; Cache technique copied from vc-arch.el. 155 ;; Cache technique copied from vc-arch.el.
@@ -291,6 +285,14 @@ in the repository root directory of FILE."
291 (message "Falling back on \"slow\" status detection (%S)" err) 285 (message "Falling back on \"slow\" status detection (%S)" err)
292 (vc-bzr-state file)))))) 286 (vc-bzr-state file))))))
293 287
288;; This is a cheap approximation that is autoloaded. If it finds a
289;; possible match it loads this file and runs the real function.
290;; It requires vc-bzr-admin-checkout-format-file to be autoloaded too.
291;;;###autoload (defun vc-bzr-registered (file)
292;;;###autoload (if (vc-find-root file vc-bzr-admin-checkout-format-file)
293;;;###autoload (progn
294;;;###autoload (load "vc-bzr")
295;;;###autoload (vc-bzr-registered file))))
294 296
295(defun vc-bzr-registered (file) 297(defun vc-bzr-registered (file)
296 "Return non-nil if FILE is registered with bzr." 298 "Return non-nil if FILE is registered with bzr."
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index 54c33769267..cac3eb559a1 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -34,18 +34,6 @@
34 34
35;; Customization Variables (the rest is in vc.el) 35;; Customization Variables (the rest is in vc.el)
36 36
37(defvar vc-ignore-vc-files nil)
38(make-obsolete-variable 'vc-ignore-vc-files
39 "set `vc-handled-backends' to nil to disable VC."
40 "21.1")
41
42(defvar vc-master-templates ())
43(make-obsolete-variable 'vc-master-templates
44 "to define master templates for a given BACKEND, use
45vc-BACKEND-master-templates. To enable or disable VC for a given
46BACKEND, use `vc-handled-backends'."
47 "21.1")
48
49(defcustom vc-ignore-dir-regexp 37(defcustom vc-ignore-dir-regexp
50 ;; Stop SMB, automounter, AFS, and DFS host lookups. 38 ;; Stop SMB, automounter, AFS, and DFS host lookups.
51 locate-dominating-stop-dir-regexp 39 locate-dominating-stop-dir-regexp
@@ -586,16 +574,7 @@ If FILE is not registered, this function always returns nil."
586 "Check if FILE is registered in BACKEND using vc-BACKEND-master-templates." 574 "Check if FILE is registered in BACKEND using vc-BACKEND-master-templates."
587 (let ((sym (vc-make-backend-sym backend 'master-templates))) 575 (let ((sym (vc-make-backend-sym backend 'master-templates)))
588 (unless (get backend 'vc-templates-grabbed) 576 (unless (get backend 'vc-templates-grabbed)
589 (put backend 'vc-templates-grabbed t) 577 (put backend 'vc-templates-grabbed t))
590 (set sym (append (delq nil
591 (mapcar
592 (lambda (template)
593 (and (consp template)
594 (eq (cdr template) backend)
595 (car template)))
596 (with-no-warnings
597 vc-master-templates)))
598 (symbol-value sym))))
599 (let ((result (vc-check-master-templates file (symbol-value sym)))) 578 (let ((result (vc-check-master-templates file (symbol-value sym))))
600 (if (stringp result) 579 (if (stringp result)
601 (vc-file-setprop file 'vc-name result) 580 (vc-file-setprop file 'vc-name result)
diff --git a/lisp/vc/vc-rcs.el b/lisp/vc/vc-rcs.el
index ecd7b826437..baaf0c3a926 100644
--- a/lisp/vc/vc-rcs.el
+++ b/lisp/vc/vc-rcs.el
@@ -89,6 +89,9 @@ to use --brief and sets this variable to remember whether it worked."
89 :type '(choice (const :tag "Work out" nil) (const yes) (const no)) 89 :type '(choice (const :tag "Work out" nil) (const yes) (const no))
90 :group 'vc-rcs) 90 :group 'vc-rcs)
91 91
92;; This needs to be autoloaded because vc-rcs-registered uses it (via
93;; vc-default-registered), and vc-hooks needs to be able to check
94;; for a registered backend without loading every backend.
92;;;###autoload 95;;;###autoload
93(defcustom vc-rcs-master-templates 96(defcustom vc-rcs-master-templates
94 (purecopy '("%sRCS/%s,v" "%s%s,v" "%sRCS/%s")) 97 (purecopy '("%sRCS/%s,v" "%s%s,v" "%sRCS/%s"))
diff --git a/lisp/vc/vc-sccs.el b/lisp/vc/vc-sccs.el
index a34222f7236..c4f6fd10bdb 100644
--- a/lisp/vc/vc-sccs.el
+++ b/lisp/vc/vc-sccs.el
@@ -74,6 +74,9 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
74 :version "24.1" ; no longer consult the obsolete vc-header-alist 74 :version "24.1" ; no longer consult the obsolete vc-header-alist
75 :group 'vc-sccs) 75 :group 'vc-sccs)
76 76
77;; This needs to be autoloaded because vc-sccs-registered uses it (via
78;; vc-default-registered), and vc-hooks needs to be able to check
79;; for a registered backend without loading every backend.
77;;;###autoload 80;;;###autoload
78(defcustom vc-sccs-master-templates 81(defcustom vc-sccs-master-templates
79 (purecopy '("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir)) 82 (purecopy '("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir))
@@ -106,11 +109,10 @@ For a description of possible values, see `vc-check-master-templates'."
106 109
107;; The autoload cookie below places vc-sccs-registered directly into 110;; The autoload cookie below places vc-sccs-registered directly into
108;; loaddefs.el, so that vc-sccs.el does not need to be loaded for 111;; loaddefs.el, so that vc-sccs.el does not need to be loaded for
109;; every file that is visited. The definition is repeated below 112;; every file that is visited.
110;; so that Help and etags can find it. 113;;;###autoload
111 114(progn
112;;;###autoload (defun vc-sccs-registered(f) (vc-default-registered 'SCCS f)) 115(defun vc-sccs-registered (f) (vc-default-registered 'SCCS f)))
113(defun vc-sccs-registered (f) (vc-default-registered 'SCCS f))
114 116
115(defun vc-sccs-state (file) 117(defun vc-sccs-state (file)
116 "SCCS-specific function to compute the version control state." 118 "SCCS-specific function to compute the version control state."
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 47800bd4aac..2da721b41d8 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -808,16 +808,6 @@ is sensitive to blank lines."
808 (string :tag "Comment End"))) 808 (string :tag "Comment End")))
809 :group 'vc) 809 :group 'vc)
810 810
811(defcustom vc-checkout-carefully (= (user-uid) 0)
812 "Non-nil means be extra-careful in checkout.
813Verify that the file really is not locked
814and that its contents match what the repository version says."
815 :type 'boolean
816 :group 'vc)
817(make-obsolete-variable 'vc-checkout-carefully
818 "the corresponding checks are always done now."
819 "21.1")
820
821 811
822;; Variables users don't need to see 812;; Variables users don't need to see
823 813
@@ -1115,24 +1105,27 @@ For old-style locking-based version control systems, like RCS:
1115 ;; Files have local changes 1105 ;; Files have local changes
1116 ((vc-compatible-state state 'edited) 1106 ((vc-compatible-state state 'edited)
1117 (let ((ready-for-commit files)) 1107 (let ((ready-for-commit files))
1118 ;; If files are edited but read-only, give user a chance to correct. 1108 ;; CVS, SVN and bzr don't care about read-only (bug#9781).
1119 (dolist (file files) 1109 ;; RCS does, SCCS might (someone should check...).
1120 ;; If committing a mix of removed and edited files, the 1110 (when (memq backend '(RCS SCCS))
1121 ;; fileset has state = 'edited. Rather than checking the 1111 ;; If files are edited but read-only, give user a chance to correct.
1122 ;; state of each individual file in the fileset, it seems 1112 (dolist (file files)
1123 ;; simplest to just check if the file exists. Bug#9781. 1113 ;; If committing a mix of removed and edited files, the
1124 (when (and (file-exists-p file) (not (file-writable-p file))) 1114 ;; fileset has state = 'edited. Rather than checking the
1125 ;; Make the file+buffer read-write. 1115 ;; state of each individual file in the fileset, it seems
1126 (unless (y-or-n-p (format "%s is edited but read-only; make it writable and continue? " file)) 1116 ;; simplest to just check if the file exists. Bug#9781.
1127 (error "Aborted")) 1117 (when (and (file-exists-p file) (not (file-writable-p file)))
1128 ;; Maybe we somehow lost permissions on the directory. 1118 ;; Make the file+buffer read-write.
1129 (condition-case nil 1119 (unless (y-or-n-p (format "%s is edited but read-only; make it writable and continue? " file))
1130 (set-file-modes file (logior (file-modes file) 128)) 1120 (error "Aborted"))
1131 (error (error "Unable to make file writable"))) 1121 ;; Maybe we somehow lost permissions on the directory.
1132 (let ((visited (get-file-buffer file))) 1122 (condition-case nil
1133 (when visited 1123 (set-file-modes file (logior (file-modes file) 128))
1134 (with-current-buffer visited 1124 (error (error "Unable to make file writable")))
1135 (read-only-mode -1)))))) 1125 (let ((visited (get-file-buffer file)))
1126 (when visited
1127 (with-current-buffer visited
1128 (read-only-mode -1)))))))
1136 ;; Allow user to revert files with no changes 1129 ;; Allow user to revert files with no changes
1137 (save-excursion 1130 (save-excursion
1138 (dolist (file files) 1131 (dolist (file files)
@@ -1516,8 +1509,9 @@ to override the value of `vc-diff-switches' and `diff-switches'."
1516 (when (listp switches) switches)))) 1509 (when (listp switches) switches))))
1517 1510
1518;; Old def for compatibility with Emacs-21.[123]. 1511;; Old def for compatibility with Emacs-21.[123].
1519(defmacro vc-diff-switches-list (backend) `(vc-switches ',backend 'diff)) 1512(defmacro vc-diff-switches-list (backend)
1520(make-obsolete 'vc-diff-switches-list 'vc-switches "22.1") 1513 (declare (obsolete vc-switches "22.1"))
1514 `(vc-switches ',backend 'diff))
1521 1515
1522(defun vc-diff-finish (buffer messages) 1516(defun vc-diff-finish (buffer messages)
1523 ;; The empty sync output case has already been handled, so the only 1517 ;; The empty sync output case has already been handled, so the only
diff --git a/lisp/view.el b/lisp/view.el
index 41cb9752288..7ed42bf7ddc 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -513,6 +513,7 @@ that can be added see the RETURN-TO-ALIST argument of the
513function `view-mode-exit'. If `view-return-to-alist' contains an 513function `view-mode-exit'. If `view-return-to-alist' contains an
514entry for the selected window, purge that entry from 514entry for the selected window, purge that entry from
515`view-return-to-alist' before adding ITEM." 515`view-return-to-alist' before adding ITEM."
516 (declare (obsolete "this function has no effect." "24.1"))
516 (with-current-buffer buffer 517 (with-current-buffer buffer
517 (when view-return-to-alist 518 (when view-return-to-alist
518 (let* ((list view-return-to-alist) 519 (let* ((list view-return-to-alist)
@@ -535,7 +536,6 @@ entry for the selected window, purge that entry from
535 (when item 536 (when item
536 (setq view-return-to-alist 537 (setq view-return-to-alist
537 (cons item view-return-to-alist))))) 538 (cons item view-return-to-alist)))))
538(make-obsolete 'view-return-to-alist-update "this function has no effect." "24.1")
539 539
540;;;###autoload 540;;;###autoload
541(defun view-mode-enter (&optional quit-restore exit-action) 541(defun view-mode-enter (&optional quit-restore exit-action)
diff --git a/lisp/window.el b/lisp/window.el
index 87817fb8773..811b1781b4c 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -84,7 +84,7 @@ This hook is run by `with-temp-buffer-window' with the buffer
84displayed and current and its window selected.") 84displayed and current and its window selected.")
85 85
86(defun temp-buffer-window-setup (buffer-or-name) 86(defun temp-buffer-window-setup (buffer-or-name)
87 "Set up temporary buffer specified by BUFFER-OR-NAME 87 "Set up temporary buffer specified by BUFFER-OR-NAME.
88Return the buffer." 88Return the buffer."
89 (let ((old-dir default-directory) 89 (let ((old-dir default-directory)
90 (buffer (get-buffer-create buffer-or-name))) 90 (buffer (get-buffer-create buffer-or-name)))
@@ -508,7 +508,7 @@ failed."
508 (window-make-atom (window-parent window)) 508 (window-make-atom (window-parent window))
509 ;; Display BUFFER in NEW and return NEW. 509 ;; Display BUFFER in NEW and return NEW.
510 (window--display-buffer 510 (window--display-buffer
511 buffer new 'window display-buffer-mark-dedicated)))) 511 buffer new 'window alist display-buffer-mark-dedicated))))
512 512
513(defun window--atom-check-1 (window) 513(defun window--atom-check-1 (window)
514 "Subroutine of `window--atom-check'." 514 "Subroutine of `window--atom-check'."
@@ -677,12 +677,6 @@ The new window automatically becomes the \"major\" side window on
677SIDE. Return the new window, nil if its creation window failed." 677SIDE. Return the new window, nil if its creation window failed."
678 (let* ((root (frame-root-window)) 678 (let* ((root (frame-root-window))
679 (left-or-right (memq side '(left right))) 679 (left-or-right (memq side '(left right)))
680 (size (or (assq 'size alist)
681 (/ (window-total-size (frame-root-window) left-or-right)
682 ;; By default use a fourth of the size of the
683 ;; frame's root window. This has to be made
684 ;; customizable via ALIST.
685 4)))
686 (major (window--major-side-window side)) 680 (major (window--major-side-window side))
687 (selected-window (selected-window)) 681 (selected-window (selected-window))
688 (on-side (cond 682 (on-side (cond
@@ -694,7 +688,7 @@ SIDE. Return the new window, nil if its creation window failed."
694 ;; parent window unless needed. 688 ;; parent window unless needed.
695 (window-combination-resize 'side) 689 (window-combination-resize 'side)
696 (window-combination-limit nil) 690 (window-combination-limit nil)
697 (new (split-window major (- size) on-side)) 691 (new (split-window major nil on-side))
698 fun) 692 fun)
699 (when new 693 (when new
700 ;; Initialize `window-side' parameter of new window to SIDE. 694 ;; Initialize `window-side' parameter of new window to SIDE.
@@ -705,8 +699,22 @@ SIDE. Return the new window, nil if its creation window failed."
705 ;; the new window is deleted, a side window on the opposite side 699 ;; the new window is deleted, a side window on the opposite side
706 ;; does not get resized. 700 ;; does not get resized.
707 (set-window-parameter new 'delete-window 'delete-side-window) 701 (set-window-parameter new 'delete-window 'delete-side-window)
702 ;; Auto-adjust height/width of new window unless a size has been
703 ;; explicitly requested.
704 (unless (if left-or-right
705 (cdr (assq 'window-width alist))
706 (cdr (assq 'window-height alist)))
707 (setq alist
708 (cons
709 (cons
710 (if left-or-right 'window-width 'window-height)
711 (/ (window-total-size (frame-root-window) left-or-right)
712 ;; By default use a fourth of the size of the
713 ;; frame's root window.
714 4))
715 alist)))
708 ;; Install BUFFER in new window and return NEW. 716 ;; Install BUFFER in new window and return NEW.
709 (window--display-buffer buffer new 'window 'side)))) 717 (window--display-buffer buffer new 'window alist 'side))))
710 718
711(defun delete-side-window (window) 719(defun delete-side-window (window)
712 "Delete side window WINDOW." 720 "Delete side window WINDOW."
@@ -814,7 +822,7 @@ following symbols can be used:
814 ;; ALIST (or, better, avoided in the "other" functions). 822 ;; ALIST (or, better, avoided in the "other" functions).
815 (or (and this-window 823 (or (and this-window
816 ;; Reuse `this-window'. 824 ;; Reuse `this-window'.
817 (window--display-buffer buffer this-window 'reuse 'side)) 825 (window--display-buffer buffer this-window 'reuse alist 'side))
818 (and (or (not max-slots) (< slots max-slots)) 826 (and (or (not max-slots) (< slots max-slots))
819 (or (and next-window 827 (or (and next-window
820 ;; Make new window before `next-window'. 828 ;; Make new window before `next-window'.
@@ -839,13 +847,14 @@ following symbols can be used:
839 window 'delete-window 'delete-side-window) 847 window 'delete-window 'delete-side-window)
840 window))) 848 window)))
841 (set-window-parameter window 'window-slot slot) 849 (set-window-parameter window 'window-slot slot)
842 (window--display-buffer buffer window 'window 'side)) 850 (window--display-buffer buffer window 'window alist 'side))
843 (and best-window 851 (and best-window
844 ;; Reuse `best-window'. 852 ;; Reuse `best-window'.
845 (progn 853 (progn
846 ;; Give best-window the new slot value. 854 ;; Give best-window the new slot value.
847 (set-window-parameter best-window 'window-slot slot) 855 (set-window-parameter best-window 'window-slot slot)
848 (window--display-buffer buffer best-window 'reuse 'side))))))))) 856 (window--display-buffer
857 buffer best-window 'reuse alist 'side)))))))))
849 858
850(defun window--side-check (&optional frame) 859(defun window--side-check (&optional frame)
851 "Check the side window configuration of FRAME. 860 "Check the side window configuration of FRAME.
@@ -903,7 +912,7 @@ of all windows on FRAME to nil."
903 (if right (throw 'reset t) (setq right t))) 912 (if right (throw 'reset t) (setq right t)))
904 ((eq side 'bottom) 913 ((eq side 'bottom)
905 (if bottom (throw 'reset t) (setq bottom t))) 914 (if bottom (throw 'reset t) (setq bottom t)))
906 (t 915 (t
907 (throw 'reset t)))) 916 (throw 'reset t))))
908 frame t)) 917 frame t))
909 ;; If there's a side window, there must be at least one 918 ;; If there's a side window, there must be at least one
@@ -2079,9 +2088,9 @@ preferably only resize windows adjacent to EDGE.
2079Return the symbol `normalized' if new normal sizes have been 2088Return the symbol `normalized' if new normal sizes have been
2080already set by this routine." 2089already set by this routine."
2081 (let* ((first (window-child parent)) 2090 (let* ((first (window-child parent))
2082 (sub first) 2091 (last (window-last-child parent))
2083 (parent-total (+ (window-total-size parent horizontal) delta)) 2092 (parent-total (+ (window-total-size parent horizontal) delta))
2084 best-window best-value) 2093 sub best-window best-value)
2085 2094
2086 (if (and edge (memq trail '(before after)) 2095 (if (and edge (memq trail '(before after))
2087 (progn 2096 (progn
@@ -2125,7 +2134,7 @@ already set by this routine."
2125 ;; normal sizes have been already set. 2134 ;; normal sizes have been already set.
2126 'normalized) 2135 'normalized)
2127 ;; Resize all windows proportionally. 2136 ;; Resize all windows proportionally.
2128 (setq sub first) 2137 (setq sub last)
2129 (while sub 2138 (while sub
2130 (cond 2139 (cond
2131 ((or (window--resize-child-windows-skip-p sub) 2140 ((or (window--resize-child-windows-skip-p sub)
@@ -2154,14 +2163,14 @@ already set by this routine."
2154 parent-total) 2163 parent-total)
2155 (window-normal-size sub horizontal))))) 2164 (window-normal-size sub horizontal)))))
2156 2165
2157 (setq sub (window-right sub))) 2166 (setq sub (window-left sub)))
2158 2167
2159 (cond 2168 (cond
2160 ((< delta 0) 2169 ((< delta 0)
2161 ;; Shrink windows by delta. 2170 ;; Shrink windows by delta.
2162 (setq best-window t) 2171 (setq best-window t)
2163 (while (and best-window (not (zerop delta))) 2172 (while (and best-window (not (zerop delta)))
2164 (setq sub first) 2173 (setq sub last)
2165 (setq best-window nil) 2174 (setq best-window nil)
2166 (setq best-value most-negative-fixnum) 2175 (setq best-value most-negative-fixnum)
2167 (while sub 2176 (while sub
@@ -2171,7 +2180,7 @@ already set by this routine."
2171 (setq best-window sub) 2180 (setq best-window sub)
2172 (setq best-value (cdr (window-new-normal sub)))) 2181 (setq best-value (cdr (window-new-normal sub))))
2173 2182
2174 (setq sub (window-right sub))) 2183 (setq sub (window-left sub)))
2175 2184
2176 (when best-window 2185 (when best-window
2177 (setq delta (1+ delta))) 2186 (setq delta (1+ delta)))
@@ -2188,7 +2197,7 @@ already set by this routine."
2188 ;; Enlarge windows by delta. 2197 ;; Enlarge windows by delta.
2189 (setq best-window t) 2198 (setq best-window t)
2190 (while (and best-window (not (zerop delta))) 2199 (while (and best-window (not (zerop delta)))
2191 (setq sub first) 2200 (setq sub last)
2192 (setq best-window nil) 2201 (setq best-window nil)
2193 (setq best-value most-positive-fixnum) 2202 (setq best-value most-positive-fixnum)
2194 (while sub 2203 (while sub
@@ -2197,7 +2206,7 @@ already set by this routine."
2197 (setq best-window sub) 2206 (setq best-window sub)
2198 (setq best-value (window-new-normal sub))) 2207 (setq best-value (window-new-normal sub)))
2199 2208
2200 (setq sub (window-right sub))) 2209 (setq sub (window-left sub)))
2201 2210
2202 (when best-window 2211 (when best-window
2203 (setq delta (1- delta))) 2212 (setq delta (1- delta)))
@@ -2209,7 +2218,7 @@ already set by this routine."
2209 (window-normal-size best-window horizontal)))))) 2218 (window-normal-size best-window horizontal))))))
2210 2219
2211 (when best-window 2220 (when best-window
2212 (setq sub first) 2221 (setq sub last)
2213 (while sub 2222 (while sub
2214 (when (or (consp (window-new-normal sub)) 2223 (when (or (consp (window-new-normal sub))
2215 (numberp (window-new-normal sub))) 2224 (numberp (window-new-normal sub)))
@@ -2227,7 +2236,7 @@ already set by this routine."
2227 ;; recursively even if it's size does not change. 2236 ;; recursively even if it's size does not change.
2228 (window--resize-this-window 2237 (window--resize-this-window
2229 sub delta horizontal ignore nil trail edge)))) 2238 sub delta horizontal ignore nil trail edge))))
2230 (setq sub (window-right sub))))))) 2239 (setq sub (window-left sub)))))))
2231 2240
2232(defun window--resize-siblings (window delta &optional horizontal ignore trail edge) 2241(defun window--resize-siblings (window delta &optional horizontal ignore trail edge)
2233 "Resize other windows when WINDOW is resized vertically by DELTA lines. 2242 "Resize other windows when WINDOW is resized vertically by DELTA lines.
@@ -2406,27 +2415,33 @@ Return the number of lines that were recovered.
2406This function is only called by the minibuffer window resizing 2415This function is only called by the minibuffer window resizing
2407routines. It resizes windows proportionally and never deletes 2416routines. It resizes windows proportionally and never deletes
2408any windows." 2417any windows."
2409 (when (numberp delta) 2418 (let ((frame (window-frame window))
2410 (let (ignore) 2419 ignore)
2411 (cond 2420 (cond
2412 ((< delta 0) 2421 ((not (numberp delta))
2413 (setq delta (window-sizable window delta))) 2422 (setq delta 0))
2414 ((> delta 0) 2423 ((zerop delta))
2415 (unless (window-sizable window delta) 2424 ((< delta 0)
2416 (setq ignore t)))) 2425 (setq delta (window-sizable window delta))
2417 2426 (window--resize-reset frame)
2418 (window--resize-reset (window-frame window)) 2427 ;; When shrinking the root window, emulate an edge drag in order
2419 ;; Ideally, we would resize just the last window in a combination 2428 ;; to not resize other windows if we can avoid it (Bug#12419).
2420 ;; but that's not feasible for the following reason: If we grow 2429 (window--resize-this-window
2421 ;; the minibuffer window and the last window cannot be shrunk any 2430 window delta nil ignore t 'before
2422 ;; more, we shrink another window instead. But if we then shrink 2431 (+ (window-top-line window) (window-total-size window)))
2423 ;; the minibuffer window again, the last window might get enlarged 2432 ;; Don't record new normal sizes to make sure that shrinking back
2424 ;; and the state after shrinking is not the state before growing. 2433 ;; proportionally works as intended.
2425 ;; So, in practice, we'd need a history variable to record how to 2434 (walk-window-tree
2426 ;; proceed. But I'm not sure how such a variable could work with 2435 (lambda (window) (set-window-new-normal window 'ignore)) frame t))
2427 ;; repeated minibuffer window growing steps. 2436 ((> delta 0)
2428 (window--resize-this-window window delta nil ignore t) 2437 (window--resize-reset frame)
2429 delta))) 2438 (unless (window-sizable window delta)
2439 (setq ignore t))
2440 ;; When growing the root window, resize proportionally. This
2441 ;; should give windows back their original sizes (hopefully).
2442 (window--resize-this-window window delta nil ignore t)))
2443 ;; Return the possibly adjusted DELTA.
2444 delta))
2430 2445
2431(defun adjust-window-trailing-edge (window delta &optional horizontal) 2446(defun adjust-window-trailing-edge (window delta &optional horizontal)
2432 "Move WINDOW's bottom edge by DELTA lines. 2447 "Move WINDOW's bottom edge by DELTA lines.
@@ -5071,7 +5086,7 @@ split."
5071 (with-selected-window window 5086 (with-selected-window window
5072 (split-window-below)))))))) 5087 (split-window-below))))))))
5073 5088
5074(defun window--try-to-split-window (window) 5089(defun window--try-to-split-window (window &optional alist)
5075 "Try to split WINDOW. 5090 "Try to split WINDOW.
5076Return value returned by `split-window-preferred-function' if it 5091Return value returned by `split-window-preferred-function' if it
5077represents a live window, nil otherwise." 5092represents a live window, nil otherwise."
@@ -5079,9 +5094,14 @@ represents a live window, nil otherwise."
5079 (not (frame-parameter (window-frame window) 'unsplittable)) 5094 (not (frame-parameter (window-frame window) 'unsplittable))
5080 (let* ((window-combination-limit 5095 (let* ((window-combination-limit
5081 ;; When `window-combination-limit' equals 5096 ;; When `window-combination-limit' equals
5082 ;; `display-buffer' bind it to t so resizing steals 5097 ;; `display-buffer' or equals `resize-window' and a
5083 ;; space preferably from the window that was split. 5098 ;; `window-height' or `window-width' alist entry are
5084 (if (eq window-combination-limit 'display-buffer) 5099 ;; present, bind it to t so resizing steals space
5100 ;; preferably from the window that was split.
5101 (if (or (eq window-combination-limit 'display-buffer)
5102 (and (eq window-combination-limit 'window-size)
5103 (or (cdr (assq 'window-height alist))
5104 (cdr (assq 'window-width alist)))))
5085 t 5105 t
5086 window-combination-limit)) 5106 window-combination-limit))
5087 (new-window 5107 (new-window
@@ -5138,7 +5158,7 @@ is higher than WINDOW."
5138 (/ (- (window-total-height window) (window-total-height)) 2)) 5158 (/ (- (window-total-height window) (window-total-height)) 2))
5139 (error nil)))) 5159 (error nil))))
5140 5160
5141(defun window--display-buffer (buffer window type &optional dedicated) 5161(defun window--display-buffer (buffer window type &optional alist dedicated)
5142 "Display BUFFER in WINDOW and make its frame visible. 5162 "Display BUFFER in WINDOW and make its frame visible.
5143TYPE must be one of the symbols `reuse', `window' or `frame' and 5163TYPE must be one of the symbols `reuse', `window' or `frame' and
5144is passed unaltered to `display-buffer-record-window'. Set 5164is passed unaltered to `display-buffer-record-window'. Set
@@ -5153,6 +5173,58 @@ BUFFER and WINDOW are live."
5153 (set-window-dedicated-p window dedicated)) 5173 (set-window-dedicated-p window dedicated))
5154 (when (memq type '(window frame)) 5174 (when (memq type '(window frame))
5155 (set-window-prev-buffers window nil))) 5175 (set-window-prev-buffers window nil)))
5176 (let ((parameter (window-parameter window 'quit-restore))
5177 (height (cdr (assq 'window-height alist)))
5178 (width (cdr (assq 'window-width alist))))
5179 (when (or (memq type '(window frame))
5180 (and (eq (car parameter) 'same)
5181 (memq (nth 1 parameter) '(window frame))))
5182 ;; Adjust height of new window or frame.
5183 (cond
5184 ((not height))
5185 ((numberp height)
5186 (let* ((new-height
5187 (if (integerp height)
5188 height
5189 (round
5190 (* (window-total-size (frame-root-window window))
5191 height))))
5192 (delta (- new-height (window-total-size window))))
5193 (cond
5194 ((and (window--resizable-p window delta nil 'safe)
5195 (window-combined-p window))
5196 (window-resize window delta nil 'safe))
5197 ((or (eq type 'frame)
5198 (and (eq (car parameter) 'same)
5199 (eq (nth 1 parameter) 'frame)))
5200 (set-frame-height
5201 (window-frame window)
5202 (+ (frame-height (window-frame window)) delta))))))
5203 ((functionp height)
5204 (ignore-errors (funcall height window))))
5205 ;; Adjust width of a window or frame.
5206 (cond
5207 ((not width))
5208 ((numberp width)
5209 (let* ((new-width
5210 (if (integerp width)
5211 width
5212 (round
5213 (* (window-total-size (frame-root-window window) t)
5214 width))))
5215 (delta (- new-width (window-total-size window t))))
5216 (cond
5217 ((and (window--resizable-p window delta t 'safe)
5218 (window-combined-p window t))
5219 (window-resize window delta t 'safe))
5220 ((or (eq type 'frame)
5221 (and (eq (car parameter) 'same)
5222 (eq (nth 1 parameter) 'frame)))
5223 (set-frame-width
5224 (window-frame window)
5225 (+ (frame-width (window-frame window)) delta))))))
5226 ((functionp width)
5227 (ignore-errors (funcall width window))))))
5156 window)) 5228 window))
5157 5229
5158(defun window--maybe-raise-frame (frame) 5230(defun window--maybe-raise-frame (frame)
@@ -5394,7 +5466,7 @@ selected window."
5394 (unless (or (cdr (assq 'inhibit-same-window alist)) 5466 (unless (or (cdr (assq 'inhibit-same-window alist))
5395 (window-minibuffer-p) 5467 (window-minibuffer-p)
5396 (window-dedicated-p)) 5468 (window-dedicated-p))
5397 (window--display-buffer buffer (selected-window) 'reuse))) 5469 (window--display-buffer buffer (selected-window) 'reuse alist)))
5398 5470
5399(defun display-buffer--maybe-same-window (buffer alist) 5471(defun display-buffer--maybe-same-window (buffer alist)
5400 "Conditionally display BUFFER in the selected window. 5472 "Conditionally display BUFFER in the selected window.
@@ -5442,7 +5514,7 @@ that frame."
5442 (get-buffer-window-list buffer 'nomini 5514 (get-buffer-window-list buffer 'nomini
5443 frames)))))) 5515 frames))))))
5444 (when (window-live-p window) 5516 (when (window-live-p window)
5445 (prog1 (window--display-buffer buffer window 'reuse) 5517 (prog1 (window--display-buffer buffer window 'reuse alist)
5446 (unless (cdr (assq 'inhibit-switch-frame alist)) 5518 (unless (cdr (assq 'inhibit-switch-frame alist))
5447 (window--maybe-raise-frame (window-frame window))))))) 5519 (window--maybe-raise-frame (window-frame window)))))))
5448 5520
@@ -5479,8 +5551,8 @@ new frame."
5479 (when (and fun 5551 (when (and fun
5480 (setq frame (funcall fun)) 5552 (setq frame (funcall fun))
5481 (setq window (frame-selected-window frame))) 5553 (setq window (frame-selected-window frame)))
5482 (prog1 (window--display-buffer buffer window 5554 (prog1 (window--display-buffer
5483 'frame display-buffer-mark-dedicated) 5555 buffer window 'frame alist display-buffer-mark-dedicated)
5484 (unless (cdr (assq 'inhibit-switch-frame alist)) 5556 (unless (cdr (assq 'inhibit-switch-frame alist))
5485 (window--maybe-raise-frame frame)))))) 5557 (window--maybe-raise-frame frame))))))
5486 5558
@@ -5505,11 +5577,11 @@ raising the frame."
5505 (not (frame-parameter frame 'unsplittable)))) 5577 (not (frame-parameter frame 'unsplittable))))
5506 ;; Attempt to split largest or least recently used window. 5578 ;; Attempt to split largest or least recently used window.
5507 (setq window (or (window--try-to-split-window 5579 (setq window (or (window--try-to-split-window
5508 (get-largest-window frame t)) 5580 (get-largest-window frame t) alist)
5509 (window--try-to-split-window 5581 (window--try-to-split-window
5510 (get-lru-window frame t))))) 5582 (get-lru-window frame t) alist))))
5511 (prog1 (window--display-buffer buffer window 5583 (prog1 (window--display-buffer
5512 'window display-buffer-mark-dedicated) 5584 buffer window 'window alist display-buffer-mark-dedicated)
5513 (unless (cdr (assq 'inhibit-switch-frame alist)) 5585 (unless (cdr (assq 'inhibit-switch-frame alist))
5514 (window--maybe-raise-frame (window-frame window))))))) 5586 (window--maybe-raise-frame (window-frame window)))))))
5515 5587
@@ -5528,21 +5600,21 @@ again with `display-buffer-pop-up-window'."
5528 (and pop-up-windows 5600 (and pop-up-windows
5529 (display-buffer-pop-up-window buffer alist)))) 5601 (display-buffer-pop-up-window buffer alist))))
5530 5602
5531(defun display-buffer-below-selected (buffer _alist) 5603(defun display-buffer-below-selected (buffer alist)
5532 "Try displaying BUFFER in a window below the selected window. 5604 "Try displaying BUFFER in a window below the selected window.
5533This either splits the selected window or reuses the window below 5605This either splits the selected window or reuses the window below
5534the selected one." 5606the selected one."
5535 (let (window) 5607 (let (window)
5536 (or (and (not (frame-parameter nil 'unsplittable)) 5608 (or (and (not (frame-parameter nil 'unsplittable))
5537 (setq window (window--try-to-split-window (selected-window))) 5609 (setq window (window--try-to-split-window (selected-window) alist))
5538 (window--display-buffer 5610 (window--display-buffer
5539 buffer window 'window display-buffer-mark-dedicated)) 5611 buffer window 'window alist display-buffer-mark-dedicated))
5540 (and (setq window (window-in-direction 'below)) 5612 (and (setq window (window-in-direction 'below))
5541 (not (window-dedicated-p window)) 5613 (not (window-dedicated-p window))
5542 (window--display-buffer 5614 (window--display-buffer
5543 buffer window 'reuse display-buffer-mark-dedicated))))) 5615 buffer window 'reuse alist display-buffer-mark-dedicated)))))
5544 5616
5545(defun display-buffer-at-bottom (buffer _alist) 5617(defun display-buffer-at-bottom (buffer alist)
5546 "Try displaying BUFFER in a window at the botom of the selected frame. 5618 "Try displaying BUFFER in a window at the botom of the selected frame.
5547This either splits the window at the bottom of the frame or the 5619This either splits the window at the bottom of the frame or the
5548frame's root window, or reuses an existing window at the bottom 5620frame's root window, or reuses an existing window at the bottom
@@ -5550,20 +5622,20 @@ of the selected frame."
5550 (let (bottom-window window) 5622 (let (bottom-window window)
5551 (walk-window-tree (lambda (window) (setq bottom-window window))) 5623 (walk-window-tree (lambda (window) (setq bottom-window window)))
5552 (or (and (not (frame-parameter nil 'unsplittable)) 5624 (or (and (not (frame-parameter nil 'unsplittable))
5553 (setq window (window--try-to-split-window bottom-window)) 5625 (setq window (window--try-to-split-window bottom-window alist))
5554 (window--display-buffer 5626 (window--display-buffer
5555 buffer window 'window display-buffer-mark-dedicated)) 5627 buffer window 'window alist display-buffer-mark-dedicated))
5556 (and (not (frame-parameter nil 'unsplittable)) 5628 (and (not (frame-parameter nil 'unsplittable))
5557 (setq window 5629 (setq window
5558 (condition-case nil 5630 (condition-case nil
5559 (split-window (frame-root-window)) 5631 (split-window (frame-root-window))
5560 (error nil))) 5632 (error nil)))
5561 (window--display-buffer 5633 (window--display-buffer
5562 buffer window 'window display-buffer-mark-dedicated)) 5634 buffer window 'window alist display-buffer-mark-dedicated))
5563 (and (setq window bottom-window) 5635 (and (setq window bottom-window)
5564 (not (window-dedicated-p window)) 5636 (not (window-dedicated-p window))
5565 (window--display-buffer 5637 (window--display-buffer
5566 buffer window 'reuse display-buffer-mark-dedicated))))) 5638 buffer window 'reuse alist display-buffer-mark-dedicated)))))
5567 5639
5568(defun display-buffer-in-previous-window (buffer alist) 5640(defun display-buffer-in-previous-window (buffer alist)
5569 "Display BUFFER in a window previously showing it. 5641 "Display BUFFER in a window previously showing it.
@@ -5619,7 +5691,7 @@ above, even if that window never showed BUFFER before."
5619 (setq best-window window))) 5691 (setq best-window window)))
5620 ;; Return best or second best window found. 5692 ;; Return best or second best window found.
5621 (when (setq window (or best-window second-best-window)) 5693 (when (setq window (or best-window second-best-window))
5622 (window--display-buffer buffer window 'reuse)))) 5694 (window--display-buffer buffer window 'reuse alist))))
5623 5695
5624(defun display-buffer-use-some-window (buffer alist) 5696(defun display-buffer-use-some-window (buffer alist)
5625 "Display BUFFER in an existing window. 5697 "Display BUFFER in an existing window.
@@ -5647,7 +5719,7 @@ that frame."
5647 (get-largest-window 0 not-this-window)))) 5719 (get-largest-window 0 not-this-window))))
5648 (when (window-live-p window) 5720 (when (window-live-p window)
5649 (prog1 5721 (prog1
5650 (window--display-buffer buffer window 'reuse) 5722 (window--display-buffer buffer window 'reuse alist)
5651 (window--even-window-heights window) 5723 (window--even-window-heights window)
5652 (unless (cdr (assq 'inhibit-switch-frame alist)) 5724 (unless (cdr (assq 'inhibit-switch-frame alist))
5653 (window--maybe-raise-frame (window-frame window))))))) 5725 (window--maybe-raise-frame (window-frame window)))))))
@@ -5917,6 +5989,97 @@ WINDOW must be a live window and defaults to the selected one."
5917 window)))) 5989 window))))
5918 5990
5919;;; Resizing buffers to fit their contents exactly. 5991;;; Resizing buffers to fit their contents exactly.
5992(defcustom fit-frame-to-buffer nil
5993 "Non-nil means `fit-window-to-buffer' can resize frames.
5994A frame can be resized if and only if its root window is a live
5995window. The height of the root window is subject to the values
5996of `fit-frame-to-buffer-max-height' and `window-min-height'."
5997 :type 'boolean
5998 :version "24.2"
5999 :group 'help)
6000
6001(defcustom fit-frame-to-buffer-bottom-margin 4
6002 "Bottom margin for `fit-frame-to-buffer'.
6003This is the number of lines `fit-frame-to-buffer' leaves free at the
6004bottom of the display in order to not obscure the system task bar."
6005 :type 'integer
6006 :version "24.2"
6007 :group 'windows)
6008
6009(defun fit-frame-to-buffer (&optional frame max-height min-height)
6010 "Adjust height of FRAME to display its buffer's contents exactly.
6011FRAME can be any live frame and defaults to the selected one.
6012
6013Optional argument MAX-HEIGHT specifies the maximum height of
6014FRAME and defaults to the height of the display below the current
6015top line of FRAME minus FIT-FRAME-TO-BUFFER-BOTTOM-MARGIN.
6016Optional argument MIN-HEIGHT specifies the minimum height of
6017FRAME."
6018 (interactive)
6019 (setq frame (window-normalize-frame frame))
6020 (let* ((root (frame-root-window frame))
6021 (frame-min-height
6022 (+ (- (frame-height frame) (window-total-size root))
6023 window-min-height))
6024 (frame-top (frame-parameter frame 'top))
6025 (top (if (consp frame-top)
6026 (funcall (car frame-top) (cadr frame-top))
6027 frame-top))
6028 (frame-max-height
6029 (- (/ (- (x-display-pixel-height frame) top)
6030 (frame-char-height frame))
6031 fit-frame-to-buffer-bottom-margin))
6032 (compensate 0)
6033 delta)
6034 (when (and (window-live-p root) (not (window-size-fixed-p root)))
6035 (with-selected-window root
6036 (cond
6037 ((not max-height)
6038 (setq max-height frame-max-height))
6039 ((numberp max-height)
6040 (setq max-height (min max-height frame-max-height)))
6041 (t
6042 (error "%s is an invalid maximum height" max-height)))
6043 (cond
6044 ((not min-height)
6045 (setq min-height frame-min-height))
6046 ((numberp min-height)
6047 (setq min-height (min min-height frame-min-height)))
6048 (t
6049 (error "%s is an invalid minimum height" min-height)))
6050 ;; When tool-bar-mode is enabled and we have just created a new
6051 ;; frame, reserve lines for toolbar resizing. This is needed
6052 ;; because for reasons unknown to me Emacs (1) reserves one line
6053 ;; for the toolbar when making the initial frame and toolbars
6054 ;; are enabled, and (2) later adds the remaining lines needed.
6055 ;; Our code runs IN BETWEEN (1) and (2). YMMV when you're on a
6056 ;; system that behaves differently.
6057 (let ((quit-restore (window-parameter root 'quit-restore))
6058 (lines (tool-bar-lines-needed frame)))
6059 (when (and quit-restore (eq (car quit-restore) 'frame)
6060 (not (zerop lines)))
6061 (setq compensate (1- lines))))
6062 (message "%s" compensate)
6063 (setq delta
6064 ;; Always count a final newline - we don't do any
6065 ;; post-processing, so let's play safe.
6066 (+ (count-screen-lines nil nil t)
6067 (- (window-body-size))
6068 compensate)))
6069 ;; Move away from final newline.
6070 (when (and (eobp) (bolp) (not (bobp)))
6071 (set-window-point root (line-beginning-position 0)))
6072 (set-window-start root (point-min))
6073 (set-window-vscroll root 0)
6074 (condition-case nil
6075 (set-frame-height
6076 frame
6077 (min (max (+ (frame-height frame) delta)
6078 min-height)
6079 max-height))
6080 (error (setq delta nil))))
6081 delta))
6082
5920(defun fit-window-to-buffer (&optional window max-height min-height) 6083(defun fit-window-to-buffer (&optional window max-height min-height)
5921 "Adjust height of WINDOW to display its buffer's contents exactly. 6084 "Adjust height of WINDOW to display its buffer's contents exactly.
5922WINDOW must be a live window and defaults to the selected one. 6085WINDOW must be a live window and defaults to the selected one.
@@ -5937,9 +6100,12 @@ _all_ lines of its buffer you might not see the first lines when
5937WINDOW was scrolled." 6100WINDOW was scrolled."
5938 (interactive) 6101 (interactive)
5939 (setq window (window-normalize-window window t)) 6102 (setq window (window-normalize-window window t))
5940 ;; Can't resize a full height or fixed-size window. 6103 (cond
5941 (unless (or (window-size-fixed-p window) 6104 ((window-size-fixed-p window))
5942 (window-full-height-p window)) 6105 ((window-full-height-p window)
6106 (when fit-frame-to-buffer
6107 (fit-frame-to-buffer (window-frame window))))
6108 (t
5943 (with-selected-window window 6109 (with-selected-window window
5944 (let* ((height (window-total-size)) 6110 (let* ((height (window-total-size))
5945 (min-height 6111 (min-height
@@ -5955,7 +6121,7 @@ WINDOW was scrolled."
5955 ;; Can't get larger than height of frame. 6121 ;; Can't get larger than height of frame.
5956 (min max-height 6122 (min max-height
5957 (window-total-size (frame-root-window window))) 6123 (window-total-size (frame-root-window window)))
5958 ;, Don't delete other windows. 6124 ;; Don't delete other windows.
5959 (+ height (window-max-delta nil nil window)))) 6125 (+ height (window-max-delta nil nil window))))
5960 ;; Make `desired-height' the height necessary to show 6126 ;; Make `desired-height' the height necessary to show
5961 ;; all of WINDOW's buffer, constrained by MIN-HEIGHT 6127 ;; all of WINDOW's buffer, constrained by MIN-HEIGHT
@@ -6018,89 +6184,7 @@ WINDOW was scrolled."
6018 (window-resize window 1 nil window) 6184 (window-resize window 1 nil window)
6019 (setq desired-height (1+ desired-height))))) 6185 (setq desired-height (1+ desired-height)))))
6020 (error (setq delta nil))) 6186 (error (setq delta nil)))
6021 delta)))) 6187 delta)))))
6022
6023(defcustom fit-frame-to-buffer-bottom-margin 4
6024 "Bottom margin for `fit-frame-to-buffer'.
6025This is the number of lines `fit-frame-to-buffer' leaves free at the
6026bottom of the display in order to not obscure the system task bar."
6027 :type 'integer
6028 :version "24.2"
6029 :group 'windows)
6030
6031(defun fit-frame-to-buffer (&optional frame max-height min-height)
6032 "Adjust height of FRAME to display its buffer's contents exactly.
6033FRAME can be any live frame and defaults to the selected one.
6034
6035Optional argument MAX-HEIGHT specifies the maximum height of
6036FRAME and defaults to the height of the display below the current
6037top line of FRAME minus FIT-FRAME-TO-BUFFER-BOTTOM-MARGIN.
6038Optional argument MIN-HEIGHT specifies the minimum height of
6039FRAME."
6040 (interactive)
6041 (setq frame (window-normalize-frame frame))
6042 (let* ((root (frame-root-window frame))
6043 (frame-min-height
6044 (+ (- (frame-height frame) (window-total-size root))
6045 window-min-height))
6046 (frame-top (frame-parameter frame 'top))
6047 (top (if (consp frame-top)
6048 (funcall (car frame-top) (cadr frame-top))
6049 frame-top))
6050 (frame-max-height
6051 (- (/ (- (x-display-pixel-height frame) top)
6052 (frame-char-height frame))
6053 fit-frame-to-buffer-bottom-margin))
6054 (compensate 0)
6055 delta)
6056 (when (and (window-live-p root) (not (window-size-fixed-p root)))
6057 (with-selected-window root
6058 (cond
6059 ((not max-height)
6060 (setq max-height frame-max-height))
6061 ((numberp max-height)
6062 (setq max-height (min max-height frame-max-height)))
6063 (t
6064 (error "%s is an invalid maximum height" max-height)))
6065 (cond
6066 ((not min-height)
6067 (setq min-height frame-min-height))
6068 ((numberp min-height)
6069 (setq min-height (min min-height frame-min-height)))
6070 (t
6071 (error "%s is an invalid minimum height" min-height)))
6072 ;; When tool-bar-mode is enabled and we have just created a new
6073 ;; frame, reserve lines for toolbar resizing. This is needed
6074 ;; because for reasons unknown to me Emacs (1) reserves one line
6075 ;; for the toolbar when making the initial frame and toolbars
6076 ;; are enabled, and (2) later adds the remaining lines needed.
6077 ;; Our code runs IN BETWEEN (1) and (2). YMMV when you're on a
6078 ;; system that behaves differently.
6079 (let ((quit-restore (window-parameter root 'quit-restore))
6080 (lines (tool-bar-lines-needed frame)))
6081 (when (and quit-restore (eq (car quit-restore) 'frame)
6082 (not (zerop lines)))
6083 (setq compensate (1- lines))))
6084 (message "%s" compensate)
6085 (setq delta
6086 ;; Always count a final newline - we don't do any
6087 ;; post-processing, so let's play safe.
6088 (+ (count-screen-lines nil nil t)
6089 (- (window-body-size))
6090 compensate)))
6091 ;; Move away from final newline.
6092 (when (and (eobp) (bolp) (not (bobp)))
6093 (set-window-point root (line-beginning-position 0)))
6094 (set-window-start root (point-min))
6095 (set-window-vscroll root 0)
6096 (condition-case nil
6097 (set-frame-height
6098 frame
6099 (min (max (+ (frame-height frame) delta)
6100 min-height)
6101 max-height))
6102 (error (setq delta nil))))
6103 delta))
6104 6188
6105(defun window-safely-shrinkable-p (&optional window) 6189(defun window-safely-shrinkable-p (&optional window)
6106 "Return t if WINDOW can be shrunk without shrinking other windows. 6190 "Return t if WINDOW can be shrunk without shrinking other windows.
diff --git a/lisp/winner.el b/lisp/winner.el
index d808a54a10e..65b3d30a80c 100644
--- a/lisp/winner.el
+++ b/lisp/winner.el
@@ -63,19 +63,8 @@
63 "Restoring window configurations." 63 "Restoring window configurations."
64 :group 'windows) 64 :group 'windows)
65 65
66;;;###autoload
67(defcustom winner-mode nil
68 "Toggle Winner mode.
69Setting this variable directly does not take effect;
70use either \\[customize] or the function `winner-mode'."
71 :set #'(lambda (symbol value) (funcall symbol (or value 0)))
72 :initialize 'custom-initialize-default
73 :type 'boolean
74 :group 'winner
75 :require 'winner)
76
77(defcustom winner-dont-bind-my-keys nil 66(defcustom winner-dont-bind-my-keys nil
78 "If non-nil: Do not use `winner-mode-map' in Winner mode." 67 "Non-nil means do not bind keys in Winner mode."
79 :type 'boolean 68 :type 'boolean
80 :group 'winner) 69 :group 'winner)
81 70
@@ -85,15 +74,13 @@ use either \\[customize] or the function `winner-mode'."
85 :group 'winner) 74 :group 'winner)
86 75
87(defcustom winner-boring-buffers '("*Completions*") 76(defcustom winner-boring-buffers '("*Completions*")
88 "`winner-undo' will not restore windows displaying any of these buffers. 77 "List of buffer names whose windows `winner-undo' will not restore.
89You may want to include buffer names such as *Help*, *Apropos*, 78You may want to include buffer names such as *Help*, *Apropos*,
90*Buffer List*, *info* and *Compile-Log*." 79*Buffer List*, *info* and *Compile-Log*."
91 :type '(repeat string) 80 :type '(repeat string)
92 :group 'winner) 81 :group 'winner)
93 82
94 83
95
96
97 84
98;;;; Saving old configurations (internal variables and subroutines) 85;;;; Saving old configurations (internal variables and subroutines)
99 86
@@ -337,19 +324,23 @@ You may want to include buffer names such as *Help*, *Apropos*,
337;;;; Winner mode (a minor mode) 324;;;; Winner mode (a minor mode)
338 325
339(defcustom winner-mode-hook nil 326(defcustom winner-mode-hook nil
340 "Functions to run whenever Winner mode is turned on." 327 "Functions to run whenever Winner mode is turned on or off."
341 :type 'hook 328 :type 'hook
342 :group 'winner) 329 :group 'winner)
343 330
344(defcustom winner-mode-leave-hook nil 331(define-obsolete-variable-alias 'winner-mode-leave-hook
332 'winner-mode-off-hook "24.3")
333
334(defcustom winner-mode-off-hook nil
345 "Functions to run whenever Winner mode is turned off." 335 "Functions to run whenever Winner mode is turned off."
346 :type 'hook 336 :type 'hook
347 :group 'winner) 337 :group 'winner)
348 338
349(defvar winner-mode-map 339(defvar winner-mode-map
350 (let ((map (make-sparse-keymap))) 340 (let ((map (make-sparse-keymap)))
351 (define-key map [(control c) left] 'winner-undo) 341 (unless winner-dont-bind-my-keys
352 (define-key map [(control c) right] 'winner-redo) 342 (define-key map [(control c) left] 'winner-undo)
343 (define-key map [(control c) right] 'winner-redo))
353 map) 344 map)
354 "Keymap for Winner mode.") 345 "Keymap for Winner mode.")
355 346
@@ -364,37 +355,21 @@ You may want to include buffer names such as *Help*, *Apropos*,
364 355
365 356
366;;;###autoload 357;;;###autoload
367(defun winner-mode (&optional arg) 358(define-minor-mode winner-mode nil :global t ; let d-m-m make the doc
368 "Toggle Winner mode. 359 (if winner-mode
369With arg, turn Winner mode on if and only if arg is positive." 360 (progn
370 (interactive "P") 361 (if (winner-hook-installed-p)
371 (let ((on-p (if arg (> (prefix-numeric-value arg) 0) 362 (progn
372 (not winner-mode)))) 363 (add-hook 'window-configuration-change-hook 'winner-change-fun)
373 (cond 364 (add-hook 'post-command-hook 'winner-save-old-configurations))
374 ;; Turn mode on 365 (add-hook 'post-command-hook 'winner-save-conditionally))
375 (on-p 366 (add-hook 'minibuffer-setup-hook 'winner-save-unconditionally)
376 (setq winner-mode t) 367 (setq winner-modified-list (frame-list))
377 (cond 368 (winner-save-old-configurations))
378 ((winner-hook-installed-p) 369 (remove-hook 'window-configuration-change-hook 'winner-change-fun)
379 (add-hook 'window-configuration-change-hook 'winner-change-fun) 370 (remove-hook 'post-command-hook 'winner-save-old-configurations)
380 (add-hook 'post-command-hook 'winner-save-old-configurations)) 371 (remove-hook 'post-command-hook 'winner-save-conditionally)
381 (t (add-hook 'post-command-hook 'winner-save-conditionally))) 372 (remove-hook 'minibuffer-setup-hook 'winner-save-unconditionally)))
382 (add-hook 'minibuffer-setup-hook 'winner-save-unconditionally)
383 (setq winner-modified-list (frame-list))
384 (winner-save-old-configurations)
385 (run-hooks 'winner-mode-hook)
386 (when (called-interactively-p 'interactive)
387 (message "Winner mode enabled")))
388 ;; Turn mode off
389 (winner-mode
390 (setq winner-mode nil)
391 (remove-hook 'window-configuration-change-hook 'winner-change-fun)
392 (remove-hook 'post-command-hook 'winner-save-old-configurations)
393 (remove-hook 'post-command-hook 'winner-save-conditionally)
394 (remove-hook 'minibuffer-setup-hook 'winner-save-unconditionally)
395 (run-hooks 'winner-mode-leave-hook)
396 (when (called-interactively-p 'interactive)
397 (message "Winner mode disabled"))))))
398 373
399;; Inspired by undo (simple.el) 374;; Inspired by undo (simple.el)
400 375
@@ -461,12 +436,5 @@ In other words, \"undo\" changes in window configuration."
461 (message "Winner undid undo"))) 436 (message "Winner undid undo")))
462 (t (error "Previous command was not a `winner-undo'")))) 437 (t (error "Previous command was not a `winner-undo'"))))
463 438
464;;; To be evaluated when the package is loaded:
465
466(unless (or (assq 'winner-mode minor-mode-map-alist)
467 winner-dont-bind-my-keys)
468 (push (cons 'winner-mode winner-mode-map)
469 minor-mode-map-alist))
470
471(provide 'winner) 439(provide 'winner)
472;;; winner.el ends here 440;;; winner.el ends here