diff options
author | Miles Bader <miles@gnu.org> | 2005-05-26 05:42:19 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2005-05-26 05:42:19 +0000 |
commit | d2eeec7fb90dc54c4b08e85f452a23317c0ee65d (patch) | |
tree | cd13677b902ee91ff96c5f43ca30ae2aba828312 /lisp | |
parent | 5611ba87dd81c98d2cc00a4d01e19db3d26cf9d5 (diff) | |
parent | c0e9b2d0ec9cb343733243371efecf77722b067f (diff) | |
download | emacs-d2eeec7fb90dc54c4b08e85f452a23317c0ee65d.tar.gz |
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-55
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 320-323)
- Update from CVS
Diffstat (limited to 'lisp')
60 files changed, 1519 insertions, 654 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aaaf1be4fa8..d1e6655232c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,333 @@ +2005-05-26 Nick Roberts <nickrob@snap.net.nz> + + * log-edit.el (log-edit-changelog-entries): Distinguish between + filenames like xfns.c and fns.c. + Coded by Stefan Monnier <monnier@iro.umontreal.ca>. + +2005-05-25 Luc Teirlinck <teirllm@auburn.edu> + + * buff-menu.el (Buffer-menu-revert-function): Improve handling of + point after reverting. + (Buffer-menu-make-sort-button): Handle the case where + `Buffer-menu-use-header-line' is nil. + +2005-05-25 Thien-Thi Nguyen <ttn@gnu.org> + + * vms-patch.el (vms-magic-right-square-brace, vms-magic-colon): + New funcs. In minibuffer-local-completion-map bind `]', `/' + and `:' to them. + +2005-05-25 Stefan Monnier <monnier@iro.umontreal.ca> + + * startup.el (normal-top-level): Allow modification of load-path while + we're iterating over it. + +2005-05-25 Juanma Barranquero <lekktu@gmail.com> + + * thumbs.el (thumbs-thumbsdir-max-size, thumbs-temp-file) + (thumbs-cleanup-thumbsdir, thumbs-call-convert) + (thumbs-resize-interactive, thumbs-insert-image) + (thumbs-insert-thumb, thumbs-dired-show-marked) + (thumbs-find-image-at-point, thumbs-delete-images) + (thumbs-rename-images, thumbs-next-image, thumbs-dired-setroot) + (thumbs-increment-image-size, thumbs-decrement-image-size): + Fix typos in docstrings. + +2005-05-24 Andre Spiegel <spiegel@gnu.org> + + * progmodes/cperl-mode.el (cperl-vc-header-alist): Obsoleted. + (cperl-vc-rcs-header, cperl-vc-sccs-header): New user options. + (cperl-mode): Use them. + +2005-05-24 Juanma Barranquero <lekktu@gmail.com> + + * window.el (quit-window, shrink-window-if-larger-than-buffer): + Doc fixes. + +2005-05-24 Nick Roberts <nickrob@snap.net.nz> + + * progmodes/gdb-ui.el (gdb-inferior-io-mode-map): + Bind C-d to gdb-inferior-io-eof. + + * dired.el (dired-dnd-popup-notice): Use message-box. + +2005-05-23 Masatake YAMATO <jet@gyve.org> + + * bindings.el (mode-line-major-mode-keymap): + Bind [mode-line down-mouse-1] to `mouse-major-mode-menu'. + + * faces.el (mode-line-highlight): New face. + + * ruler-mode.el (ruler-mode-ruler): Use mode-line-highlight + as mouse-face. + + * bindings.el (top-level, help-echo, mode-line-modified) + (mode-line-mule-info, mode-line-eol-desc): Use mode-line-highlight + as mouse-face. + +2005-05-23 Juanma Barranquero <lekktu@gmail.com> + + * progmodes/cc-engine.el (c-guess-basic-syntax): + Remove spurious call to `zerop'. + + * emacs-lisp/cl.el (acons, pairlis): Add docstring. + +2005-05-23 Martin Stjernholm <bug-cc-mode@gnu.org> + + CC Mode update to 5.30.10: + + * cc-fonts.el (c-font-lock-declarators): Fixed bug where the point + could go past the limit in decoration level 2, thereby causing + errors during interactive fontification. + + * cc-mode.el (c-make-inherited-keymap): Fixed cc-bytecomp bug when + the file is evaluated interactively. + + * cc-engine.el (c-guess-basic-syntax): Handle operator + declarations somewhat better in C++. + + * cc-styles.el, cc-mode.el (c-run-mode-hooks): New helper macro to + make use of `run-mode-hooks' which has been added in Emacs 21.1. + (c-mode, c++-mode, objc-mode, java-mode, idl-mode, pike-mode) + (awk-mode): Use it. + (make-local-hook): Suppress warning about obsoleteness. + + * cc-engine.el, cc-align.el, cc-cmds.el + (c-append-backslashes-forward, c-delete-backslashes-forward) + (c-find-decl-spots, c-semi&comma-no-newlines-before-nonblanks): + Compensate for return value from `forward-line' when it has moved + but not to a different line due to eob. + + * cc-engine.el (c-guess-basic-syntax): Fixed anchoring in + `objc-method-intro' and `objc-method-args-cont'. + +2005-05-23 Alan Mackenzie <bug-cc-mode@gnu.org> + + CC Mode update to 5.30.10: + + * cc-mode.el, cc-engine.el, cc-align.el: Change the FSF's address + in the copyright statement. Incidentally, change "along with GNU + Emacs" to "along with this program" where it occurs. + + * cc-mode.el: Add a fourth parameter `t' to the awk-mode autoload, + so that it is interactive, hence can be found by M-x awk-mode + whilst cc-mode is yet to be loaded. Reported by Glenn Morris + <gmorris+emacs@ast.cam.ac.uk>. + + * cc-awk.el: Add character classes (e.g. "[:alpha:]") into AWK + Mode's regexps. + +2005-05-23 Kevin Ryde <user42@zip.com.au> + + * cc-align.el (c-lineup-argcont): Ignore conses for {} pairs from + c-parse-state, to avoid a lisp error (on bad code). + +2005-05-23 Lute Kamstra <lute@gnu.org> + + * subr.el (font-lock-defaults): Remove defvar as it's already + defined in font-core.el. + + * font-lock.el (font-lock-beginning-of-syntax-function): Fix + docstring. + +2005-05-23 Nick Roberts <nickrob@snap.net.nz> + + * progmodes/gdb-ui.el (gdb-info-locals-handler): Make regexps + more general and work when GDB variable "print pretty" is on, + as with Emacs, for example. + +2005-05-22 Luc Teirlinck <teirllm@auburn.edu> + + * font-core.el: Update comment. + + * emacs-lisp/easy-mmode.el (define-global-minor-mode): Use + `after-change-major-mode-hook' instead of `find-file-hook'. + + * buff-menu.el (Buffer-menu-mode): Use `run-mode-hooks'. + +2005-05-22 Eli Zaretskii <eliz@gnu.org> + + * simple.el (yank, yank-pop): Mention `yank-excluded-properties' + and `yank-handler' in the doc strings. + +2005-05-22 Stefan Monnier <monnier@iro.umontreal.ca> + + * emacs-lisp/cl.el (eql): Remove. It's a builtin already. + +2005-05-22 Richard M. Stallman <rms@gnu.org> + + * help.el (describe-key): Move print-help-return-message call + out of conditional. + + * progmodes/etags.el (list-tags): Use with-no-warnings. + + * mail/smtpmail.el (smtpmail-open-stream): Use with-no-warnings. + (smtpmail-send-queued-mail): Avoid beginning-of-buffer. + (starttls-extra-args, starttls-extra-arguments): Add defvars. + + * mail/mailalias.el (mail-get-names): Avoid beginning-of-buffer. + + * language/viet-util.el (viet-viscii-nonascii-translation-table): + Add defvar. + + * emulation/viper-ex.el (viper-ex-work-buf, viper-ex-print-buf): + Use defvar, not defconst. + + * hexl.el (hexl-follow-line): Use with-no-warnings. + + * emulation/tpu-extras.el: Use write-file-functions instead of + write-file-hooks. + + * dired.el (dired-font-lock-keywords): Fontify files with junk + extensions even if marked by -F. + +2005-05-22 Juanma Barranquero <lekktu@gmail.com> + + * emacs-lisp/cl.el (pushnew, cl-macroexpand, floatp-safe, plusp) + (minusp, oddp, evenp, mapcar*, list*, copy-list, adjoin, subst): + * emacs-lisp/cl-extra.el (coerce, map, maplist, cl-mapc, mapl) + (mapcan, mapcon, some, every, notany, notevery, signum, isqrt) + (concatenate, list-length, get*, getf, cl-remprop): + * emacs-lisp/cl-macs.el (function*, case, ecase, typecase) + (etypecase, progv, lexical-let, lexical-let*) + (multiple-value-bind, multiple-value-setq, shiftf): + Improve argument/docstring consistency. + + * subr.el (focus-frame, unfocus-frame): + Revert deletion on 2005-05-01. + +2005-05-22 Andre Spiegel <spiegel@gnu.org> + + * vc-cvs.el (vc-cvs-checkout-model): Handle the case where FILE + doesn't exist. + + * vc.el (vc-trunk-p): Add autoload cookie. The function is used + in vc-rcs.el when vc-mistrust-permissions is t, which is not the + default. + +2005-05-22 Nick Roberts <nickrob@snap.net.nz> + + * emacs-lisp/bytecomp.el: Remove make-obsolete-variable for + already deleted variables: auto-fill-hook, blink-paren-hook, + lisp-indent-hook, inhibit-local-variables, unread-command-event + suspend-hooks, comment-indent-hook, meta-flag, + before-change-function, after-change-function, + font-lock-doc-string-face. + +2005-05-21 Luc Teirlinck <teirllm@auburn.edu> + + * emacs-lisp/derived.el (define-derived-mode): Doc fix. + +2005-05-21 Eli Zaretskii <eliz@gnu.org> + + * mail/rmail.el (rmail-reply): Filter the list in reply-to through + rmail-dont-reply-to. + +2005-05-21 Frederik Fouvry <fouvry@CoLi.Uni-SB.DE> + + * mail/sendmail.el (mail-send): Use [[:space:]] instead of a + literal blank when splitting new-header-values. + +2005-05-21 Matt Hodges <MPHodges@member.fsf.org> + + * calendar/cal-menu.el (cal-menu-update): Add separator as a + string so that tmm doesn't create a completion entry for it. + + * textmodes/table.el (table-disable-menu): Ditto. + +2005-05-21 Richard M. Stallman <rms@gnu.org> + + * progmodes/idlwave.el (idlwave-doc-header): Use insert-file-contents. + + * progmodes/flymake.el (flymake-makehash): Use with-no-warnings. + + * net/rcompile.el (remote-compile): Use compilation-start. + + * tmm.el (tmm-shortcut): Avoid using beginning-of-buffer. + +2005-05-21 Daniel Pfeiffer <occitan@esperanto.org> + + * files.el (auto-mode-alist): Check GNUmakefile before makefile. + Default to makefile-bsdmake-mode on BSD systems. + + * imenu.el (imenu-generic-expression, imenu--generic-function'): + REGEXP may also be a search function now. The part of doc-string + for describing the structure was 95% identical to that of + `imenu--generic-function'. Unify it there. + + * progmodes/make-mode.el (makefile-imenu-generic-expression): + Use function to find dependencies, because regexp alone is so complex, + it easily goes into an endless loop. + (makefile-makepp-mode): Also add submenu for Perl functions + defined in the makefile. + (makefile-bsdmake-mode): Special imenu-generic-expression no + longer needed, due to function call. + (makefile-match-dependency): Take BOUND into account when checking + if we're through. + +2005-05-20 Jay Belanger <belanger@truman.edu> + + * calc/calc-units.el (calc-invalidate-units-table): + Use inhibit-read-only. + (math-build-units-table-buffer): Use view-mode. + +2005-05-20 David Kastrup <dak@gnu.org> + + * emacs-lisp/easymenu.el (easy-menu-add): Correct docstring since + easy-menu-add is not a nop on Emacs; and clarify when to call it. + +2005-05-20 Lute Kamstra <lute@gnu.org> + + * diff-mode.el (diff-header-face, diff-file-header-face) + (diff-index-face, diff-hunk-header-face, diff-removed-face) + (diff-added-face, diff-changed-face, diff-function-face) + (diff-context-face, diff-nonexistent-face): Put them in the + diff-mode customization group. + +2005-05-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * progmodes/vhdl-mode.el (vhdl-font-lock-match-item): Simplify regexp. + + * progmodes/sh-script.el (sh-mode, sh-get-word): Minor regexp fixes. + + * font-lock.el (lisp-font-lock-keywords-2): Don't error. + Minor regexp-optimization. + +2005-05-20 Carsten Dominik <dominik@science.uva.nl> + + * textmodes/org.el (org-agenda-toggle-time-grid): New command. + (org-agenda-use-time-grid, org-agenda-time-grid): New options. + (org-agenda-add-time-grid-maybe): New function. + (org-agenda): Call `org-agenda-add-time-grid-maybe'. + (org-table-create): `dotimes' instead of `mapcar'. + (org-xor): Simplify implementation. + (org-agenda): `inhibit-redisplay' turned on. + (org-agenda-change-all-lines): Use `org-format-agenda-item' to get + a consistent line after a state change. + (org-agenda-remove-times-when-in-prefix): New option. + (org-prefix-has-time): New variable. + (org-parse-time-string): Optional argument NODEFAULT. + (org-format-agenda-item): Parse items for time-of-day + specifications and move these into the prefix if possible. + (org-agenda-priority): Get current heading, not previous heading + during agenda remote editing. + 2005-05-20 Juanma Barranquero <lekktu@gmail.com> + * emacs-lisp/cl-seq.el (reduce, fill, replace, remove*) + (remove-if, remove-if-not, delete*, delete-if, delete-if-not) + (remove-duplicates, delete-duplicates, substitute) + (substitute-if, substitute-if-not, nsubstitute, nsubstitute-if) + (nsubstitute-if-not, find, find-if, find-if-not, position) + (position-if, position-if-not, count, count-if, count-if-not) + (mismatch, search, sort*, stable-sort, merge, member*) + (member-if, member-if-not, assoc*, assoc-if, assoc-if-not) + (rassoc*, rassoc-if, rassoc-if-not, union, nunion) + (intersection, nintersection, set-difference, nset-difference) + (set-exclusive-or, nset-exclusive-or, subsetp, subst-if) + (subst-if-not, nsubst, nsubst-if, nsubst-if-not, sublis) + (nsublis, tree-equal): Improve argument/docstring consistency. + * subr.el (send-string, send-region): Remove obsolescence declaration. (window-dot, set-window-dot, read-input, show-buffer) @@ -68,6 +396,7 @@ (left-fringe-p): Function deleted. * buff-menu.el (Buffer-menu-buffer-face): In group Buffer-menu. + (list-buffers-noselect): Set `font-lock-face' property, not `face'. * dired-aux.el (dired-copy-file-recursive): Handle symlinks in recursive copy. @@ -89,7 +418,7 @@ 2005-05-19 Carsten Dominik <dominik@science.uva.nl> - * textmodes/reftex.el (reftex-isearch-minor-mode): Moved the + * textmodes/reftex.el (reftex-isearch-minor-mode): Move the definition of this variable from reftex-global.el to reftex.el, because it is needed in the menu. @@ -112,8 +441,8 @@ (makefile-add-this-line-macro): Simplify and integrate into `makefile-pickup-macros. (makefile-pickup-filenames-as-targets): Simplify. - (makefile-previous-dependency, makefile-match-dependency): Don't - stumble over `::'. + (makefile-previous-dependency, makefile-match-dependency): + Don't stumble over `::'. 2005-05-19 Nick Roberts <nickrob@snap.net.nz> @@ -127,8 +456,8 @@ * help-fns.el (describe-variable): Remove hyperlinks in a variable's value as these are quite frequently inappropriate. - * follow.el (follow-submit-feedback, follow-mode): Remove - references to post-command-idle-hook. + * follow.el (follow-submit-feedback, follow-mode): + Remove references to post-command-idle-hook. 2005-05-18 Daniel Pfeiffer <occitan@esperanto.org> @@ -138,8 +467,8 @@ 2005-05-18 Jay Belanger <belanger@truman.edu> - * calc/calc-help.el (calc-s-prefix-help): Add - `calc-copy-special-constant' to help string. + * calc/calc-help.el (calc-s-prefix-help): + Add `calc-copy-special-constant' to help string. 2005-05-18 Luc Teirlinck <teirllm@auburn.edu> @@ -152,8 +481,8 @@ 2005-05-18 Carsten Dominik <dominik@science.uva.nl> - * textmodes/reftex-vars.el (reftex-cite-format-builtin): Support - for jurabib. + * textmodes/reftex-vars.el (reftex-cite-format-builtin): + Support for jurabib. * textmodes/reftex.el (featurep): Define aliases for overlay commands, for XEmacs compatibility, and use these aliases in @@ -164,8 +493,8 @@ (reftex-access-search-path): Use `reftex-uniquify' instead of `reftex-uniq' - * textmodes/reftex-sel.el (reftex-select-unmark): Overlay - `before-string' property modification enables for Emacs as well. + * textmodes/reftex-sel.el (reftex-select-unmark): + Overlay `before-string' property modification enables for Emacs as well. (reftex-select-item): Use `reftex-delete-overlay'. (reftex-select-mark): Use `reftex-make-overlay' and `reftex-overlay-put'. @@ -200,8 +529,7 @@ * progmodes/prolog.el (inferior-prolog-mode): Doc fix. (prolog-consult-region): Replace `send-string' by - `process-send-string'; replace `send-region' by - `process-send-region'. + `process-send-string'; replace `send-region' by `process-send-region'. * progmodes/delphi.el (delphi-log-msg): Replace `set-window-dot' by `set-window-point'. @@ -232,8 +560,8 @@ loop. It should also be more efficient, because first it only searches for `:', instead of applying the very complex regexp. (makefile-mode): Cancel `font-lock-support-mode', because blocks - to be fontified in one piece can be too long for JIT. Makefiles - are never *that* big. + to be fontified in one piece can be too long for JIT. + Makefiles are never *that* big. 2005-05-17 Reiner Steib <Reiner.Steib@gmx.de> @@ -259,8 +587,8 @@ 2005-05-16 Daniel Pfeiffer <occitan@esperanto.org> - * font-lock.el (lisp-font-lock-keywords-1): Set - `font-lock-negation-char-face' for [^...] char group. + * font-lock.el (lisp-font-lock-keywords-1): + Set `font-lock-negation-char-face' for [^...] char group. (lisp-font-lock-keywords-2): Highlight regexp's \\( \\| \\). * progmodes/make-mode.el (makefile-dependency-regex): Turn it into @@ -274,11 +602,10 @@ might be the same one to be skipped by the initial [^$], leading to an overlooked variable use. (makefile-make-font-lock-keywords): Remove two parameters, which - are now variables that some of the modes set locally. Handle - dependency and rule action matching through functions, because + are now variables that some of the modes set locally. + Handle dependency and rule action matching through functions, because regexps alone match too often. Dependency matching now comes - last, so it can check, whether a colon already matched something - else. + last, so it can check, whether a colon already matched something else. (makefile-mode): Inform that font-lock improves makefile parsing capabilities. (makefile-match-dependency, makefile-match-action): New functions. @@ -363,8 +690,8 @@ (reftex-bib-sort-year-reverse, reftex-format-citation): * textmodes/reftex-parse.el (reftex-init-section-numbers) (reftex-section-number): - * textmodes/texinfmt.el (texinfo-paragraphindent): Replace - `string-to-int' by `string-to-number'. + * textmodes/texinfmt.el (texinfo-paragraphindent): + Replace `string-to-int' by `string-to-number'. * international/latexenc.el: Add page marker to force the "Local Variables:" string out of the last page. @@ -472,23 +799,22 @@ (tramp-pre-connection): Add parameter CHUNKSIZE. Make local variable `tramp-chunksize'. Change callees. (tramp-open-connection-setup-interactive-shell): Check remote host - for buggy `send-process-string' implementation. Set - `tramp-chunksize' if found. Reported by Michael Kifer + for buggy `send-process-string' implementation. + Set `tramp-chunksize' if found. Reported by Michael Kifer <kifer@cs.sunysb.edu> (and a lot of other people all the years). (tramp-handle-shell-command): `insert-buffer' cannot be used because the contents of the Tramp buffer is changed before insertion (`expand-file' and alike). Reported by Fr,Ai(Bd,Ai(Bric Bothamy <frederic.bothamy@free.fr>. (tramp-set-auto-save): Actions should be done for Tramp file name - handler only. Ange-FTP has its own auto-save mechanism. Reported - by Richard G. Bielawski <Richard.G.Bielawski@wellsfargo.com>. + handler only. Ange-FTP has its own auto-save mechanism. + Reported by Richard G. Bielawski <Richard.G.Bielawski@wellsfargo.com>. (tramp-set-auto-save-file-modes): Set file modes of `buffer-auto-save-file-name' to ?\600 as fallback solution. Reported by Ferenc Wagner <wferi@tba.elte.hu>. (tramp-bug): Remove obsolete variable. (tramp-append-tramp-buffers): Rewrite partly. More suitable check - for presence of `mml-mode'. Make it running for older Emacsen as - well. + for presence of `mml-mode'. Make it running for older Emacsen as well. 2005-05-14 John Paul Wallington <jpw@pobox.com> @@ -540,15 +866,14 @@ 2005-05-13 Matt Hodges <MPHodges@member.fsf.org> - * tmm.el (tmm-get-keymap): Include only active menus and menu - items. + * tmm.el (tmm-get-keymap): Include only active menus and menu items. * emacs-lisp/easymenu.el (easy-menu-define): Doc fixes. 2005-05-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> * dired.el (dired-mode): make-variable-buffer-local => - make-local-variable + make-local-variable. 2005-05-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> @@ -9592,7 +9917,7 @@ (Info-build-toc): Don't check for special Info file names. Set main-file to nil if Info-find-file returns a symbol. -2004-10-05 Emilio C. Lopes <eclig@gmx.net>: +2004-10-05 Emilio C. Lopes <eclig@gmx.net> * calendar/calendar.el (calendar-goto-iso-week): Add autoload. (calendar-mode-map): Add binding for `calendar-goto-iso-week'. diff --git a/lisp/bindings.el b/lisp/bindings.el index b47cab84e49..38572cd5bd1 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -165,7 +165,8 @@ corresponding to the mode line clicked." (eval-when-compile (let ((map (make-sparse-keymap))) (define-key map [mode-line mouse-3] 'mode-line-change-eol) - map)))) + map)) + 'mouse-face 'mode-line-highlight)) (push (cons eol (cons mnemonic desc)) mode-line-eol-desc-cache) desc))) @@ -177,7 +178,8 @@ corresponding to the mode line clicked." "Input method: " current-input-method ". mouse-2: disable, mouse-3: describe") - local-map ,mode-line-input-method-map)) + local-map ,mode-line-input-method-map + mouse-face mode-line-highlight)) ,(propertize "%z" 'help-echo @@ -191,6 +193,7 @@ corresponding to the mode line clicked." " buffer; mouse-3: describe coding system") (concat "Unibyte " (symbol-name buffer-file-coding-system) " buffer"))))) + 'mouse-face 'mode-line-highlight 'local-map mode-line-coding-system-map) (:eval (mode-line-eol-desc))) "Mode-line control for displaying information of multilingual environment. @@ -235,7 +238,8 @@ Normally nil in most modes, since there is no process to display.") "Not r"))))) 'local-map (purecopy (make-mode-line-mouse-map 'mouse-3 - #'mode-line-toggle-read-only))) + #'mode-line-toggle-read-only)) + 'mouse-face 'mode-line-highlight) (propertize "%1+" 'help-echo (purecopy (lambda (window object point) @@ -246,7 +250,8 @@ Normally nil in most modes, since there is no process to display.") "M" "Not m"))))) 'local-map (purecopy (make-mode-line-mouse-map - 'mouse-3 #'mode-line-toggle-modified)))) + 'mouse-3 #'mode-line-toggle-modified)) + 'mouse-face 'mode-line-highlight)) "Mode-line control for displaying whether current buffer is modified.") (make-variable-buffer-local 'mode-line-modified) @@ -262,6 +267,7 @@ buffer size, the line number and the column number.") (defvar mode-line-major-mode-keymap (let ((map (make-sparse-keymap))) + (define-key map [mode-line down-mouse-1] 'mouse-major-mode-menu) (define-key map [mode-line mouse-2] 'describe-mode) (define-key map [mode-line down-mouse-3] 'mode-line-mode-menu-1) map) "\ @@ -303,13 +309,16 @@ Keymap to display on minor modes.") (list (propertize "%[(" 'help-echo help-echo) `(:propertize ("" mode-name) - help-echo "mouse-2: help for current major mode" + help-echo "mouse-1: major-mode-menu mouse-2: help for current major mode" + mouse-face mode-line-highlight local-map ,mode-line-major-mode-keymap) '("" mode-line-process) `(:propertize ("" minor-mode-alist) + mouse-face mode-line-highlight help-echo "mouse-2: help for minor modes, mouse-3: minor mode menu" local-map ,mode-line-minor-mode-keymap) (propertize "%n" 'help-echo "mouse-2: widen" + 'mouse-face 'mode-line-highlight 'local-map (make-mode-line-mouse-map 'mouse-2 #'mode-line-widen)) (propertize ")%]--" 'help-echo help-echo))) @@ -465,6 +474,7 @@ text properties for face, help-echo, and local-map to it." 'face 'Buffer-menu-buffer-face 'help-echo (purecopy "mouse-1: previous buffer, mouse-3: next buffer") + 'mouse-face 'mode-line-highlight 'local-map mode-line-buffer-identification-keymap))) (setq-default mode-line-buffer-identification diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index a968d14a0a9..7e9115a79dc 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el @@ -1,7 +1,7 @@ ;;; buff-menu.el --- buffer menu main function and support functions -*- coding:utf-8 -*- ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 2000, 2001, 2002, 2003, -;; 2004 Free Software Foundation, Inc. +;; 2004, 2005 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: convenience @@ -190,7 +190,7 @@ Letters do not insert themselves; instead, they are commands. #'(lambda (&optional noconfirm) 'fast)) (setq truncate-lines t) (setq buffer-read-only t) - (run-hooks 'buffer-menu-mode-hook)) + (run-mode-hooks 'buffer-menu-mode-hook)) ;; This function exists so we can make the doc string of Buffer-menu-mode ;; look nice. @@ -203,17 +203,21 @@ Letters do not insert themselves; instead, they are commands. (or (eq buffer-undo-list t) (setq buffer-undo-list nil)) ;; We can not use save-excursion here. The buffer gets erased. - (let ((ocol (current-column)) + (let ((opoint (point)) + (eobp (eobp)) + (ocol (current-column)) (oline (progn (move-to-column 4) (get-text-property (point) 'buffer))) (prop (point-min)) ;; do not make undo records for the reversion. (buffer-undo-list t)) (list-buffers-noselect Buffer-menu-files-only) - (while (setq prop (next-single-property-change prop 'buffer)) - (when (eq (get-text-property prop 'buffer) oline) - (goto-char prop) - (move-to-column ocol))))) + (if oline + (while (setq prop (next-single-property-change prop 'buffer)) + (when (eq (get-text-property prop 'buffer) oline) + (goto-char prop) + (move-to-column ocol))) + (goto-char (if eobp (point-max) opoint))))) (defun Buffer-menu-toggle-files-only (arg) "Toggle whether the current buffer-menu displays only file buffers. @@ -633,15 +637,29 @@ For more information, see the function `buffer-menu'." (if (equal column Buffer-menu-sort-column) (setq column nil)) (propertize name 'help-echo (if column - (concat "mouse-2: sort by " (downcase name)) - "mouse-2: sort by visited order") + (if Buffer-menu-use-header-line + (concat "mouse-2: sort by " (downcase name)) + (concat "mouse-2, RET: sort by " + (downcase name))) + (if Buffer-menu-use-header-line + "mouse-2: sort by visited order" + "mouse-2, RET: sort by visited order")) 'mouse-face 'highlight 'keymap (let ((map (make-sparse-keymap))) - (define-key map [header-line mouse-2] - `(lambda (e) - (interactive "e") - (save-window-excursion + (if Buffer-menu-use-header-line + (define-key map [header-line mouse-2] + `(lambda (e) + (interactive "e") + (save-window-excursion + (if e (mouse-select-window e)) + (Buffer-menu-sort ,column)))) + (define-key map [mouse-2] + `(lambda (e) + (interactive "e") (if e (mouse-select-window e)) + (Buffer-menu-sort ,column))) + (define-key map "\C-m" + `(lambda () (interactive) (Buffer-menu-sort ,column)))) map))) diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index 6c694bc5ba8..0983b807fde 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -555,7 +555,7 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).") (save-excursion (goto-char (point-min)) (if (looking-at "Calculator Units Table") - (let ((buffer-read-only nil)) + (let ((inhibit-read-only t)) (insert "(Obsolete) ")))))))) (defun calc-get-unit-definition (uname) @@ -1310,65 +1310,65 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).") (save-excursion (message "Formatting units table...") (set-buffer buf) - (setq buffer-read-only nil) - (erase-buffer) - (insert "Calculator Units Table:\n\n") - (insert "Unit Type Definition Description\n\n") - (while uptr - (setq u (car uptr) - name (nth 2 u)) - (when (eq (car u) 'm) - (setq std t)) - (setq shadowed (and std (assq (car u) math-additional-units))) - (when (and name - (> (length name) 1) - (eq (aref name 0) ?\*)) - (unless (eq uptr math-units-table) - (insert "\n")) - (setq name (substring name 1))) - (insert " ") - (and shadowed (insert "(")) - (insert (symbol-name (car u))) - (and shadowed (insert ")")) - (if (nth 3 u) - (progn - (indent-to 10) - (insert (symbol-name (nth 3 u)))) - (or std - (progn - (indent-to 10) - (insert "U")))) - (indent-to 14) - (and shadowed (insert "(")) - (if (nth 1 u) - (insert (math-format-value (nth 1 u) 80)) - (insert (symbol-name (car u)))) - (and shadowed (insert ")")) - (indent-to 41) - (insert " ") - (when name - (insert name)) - (if shadowed - (insert " (redefined above)") - (unless (nth 1 u) - (insert " (base unit)"))) - (insert "\n") - (setq uptr (cdr uptr))) - (insert "\n\nUnit Prefix Table:\n\n") - (setq uptr math-unit-prefixes) - (while uptr - (setq u (car uptr)) - (insert " " (char-to-string (car u))) - (if (equal (nth 1 u) (nth 1 (nth 1 uptr))) - (insert " " (char-to-string (car (car (setq uptr (cdr uptr))))) - " ") - (insert " ")) - (insert "10^" (int-to-string (nth 2 (nth 1 u)))) - (indent-to 15) - (insert " " (nth 2 u) "\n") - (while (eq (car (car (setq uptr (cdr uptr)))) 0))) - (insert "\n") - (setq buffer-read-only t) + (let ((inhibit-read-only t)) + (erase-buffer) + (insert "Calculator Units Table:\n\n") + (insert "Unit Type Definition Description\n\n") + (while uptr + (setq u (car uptr) + name (nth 2 u)) + (when (eq (car u) 'm) + (setq std t)) + (setq shadowed (and std (assq (car u) math-additional-units))) + (when (and name + (> (length name) 1) + (eq (aref name 0) ?\*)) + (unless (eq uptr math-units-table) + (insert "\n")) + (setq name (substring name 1))) + (insert " ") + (and shadowed (insert "(")) + (insert (symbol-name (car u))) + (and shadowed (insert ")")) + (if (nth 3 u) + (progn + (indent-to 10) + (insert (symbol-name (nth 3 u)))) + (or std + (progn + (indent-to 10) + (insert "U")))) + (indent-to 14) + (and shadowed (insert "(")) + (if (nth 1 u) + (insert (math-format-value (nth 1 u) 80)) + (insert (symbol-name (car u)))) + (and shadowed (insert ")")) + (indent-to 41) + (insert " ") + (when name + (insert name)) + (if shadowed + (insert " (redefined above)") + (unless (nth 1 u) + (insert " (base unit)"))) + (insert "\n") + (setq uptr (cdr uptr))) + (insert "\n\nUnit Prefix Table:\n\n") + (setq uptr math-unit-prefixes) + (while uptr + (setq u (car uptr)) + (insert " " (char-to-string (car u))) + (if (equal (nth 1 u) (nth 1 (nth 1 uptr))) + (insert " " (char-to-string (car (car (setq uptr (cdr uptr))))) + " ") + (insert " ")) + (insert "10^" (int-to-string (nth 2 (nth 1 u)))) + (indent-to 15) + (insert " " (nth 2 u) "\n") + (while (eq (car (car (setq uptr (cdr uptr)))) 0))) + (insert "\n")) + (view-mode) (message "Formatting units table...done")) (setq math-units-table-buffer-valid t) (let ((oldbuf (current-buffer))) diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el index 408de3826d4..6ace81fcb0e 100644 --- a/lisp/calendar/cal-menu.el +++ b/lisp/calendar/cal-menu.el @@ -221,7 +221,7 @@ not available." l))) (setq l (cons ["Mark Holidays" mark-calendar-holidays t] (cons ["Unmark Calendar" calendar-unmark t] - (cons ["--" '("--") t] l)))) + (cons "--" l)))) (define-key calendar-mode-map [menu-bar Holidays] (cons "Holidays" (easy-menu-create-menu "Holidays" (nreverse l)))) (define-key calendar-mode-map [menu-bar Holidays separator] diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index c16738f6570..aabd09e98ee 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -185,7 +185,8 @@ when editing big diffs)." (((class color) (background dark)) :foreground "green" :weight bold) (t :weight bold)) - "`diff-mode' face inherited by hunk and index header faces.") + "`diff-mode' face inherited by hunk and index header faces." + :group 'diff-mode) (defvar diff-header-face 'diff-header-face) (defface diff-file-header-face @@ -198,27 +199,32 @@ when editing big diffs)." (((class color) (background dark)) :foreground "cyan" :weight bold) (t :weight bold)) ; :height 1.3 - "`diff-mode' face used to highlight file header lines.") + "`diff-mode' face used to highlight file header lines." + :group 'diff-mode) (defvar diff-file-header-face 'diff-file-header-face) (defface diff-index-face '((t :inherit diff-file-header-face)) - "`diff-mode' face used to highlight index header lines.") + "`diff-mode' face used to highlight index header lines." + :group 'diff-mode) (defvar diff-index-face 'diff-index-face) (defface diff-hunk-header-face '((t :inherit diff-header-face)) - "`diff-mode' face used to highlight hunk header lines.") + "`diff-mode' face used to highlight hunk header lines." + :group 'diff-mode) (defvar diff-hunk-header-face 'diff-hunk-header-face) (defface diff-removed-face '((t :inherit diff-changed-face)) - "`diff-mode' face used to highlight removed lines.") + "`diff-mode' face used to highlight removed lines." + :group 'diff-mode) (defvar diff-removed-face 'diff-removed-face) (defface diff-added-face '((t :inherit diff-changed-face)) - "`diff-mode' face used to highlight added lines.") + "`diff-mode' face used to highlight added lines." + :group 'diff-mode) (defvar diff-added-face 'diff-added-face) (defface diff-changed-face @@ -226,12 +232,14 @@ when editing big diffs)." :foreground "magenta" :weight bold :slant italic) (((type tty pc) (class color) (background dark)) :foreground "yellow" :weight bold :slant italic)) - "`diff-mode' face used to highlight changed lines.") + "`diff-mode' face used to highlight changed lines." + :group 'diff-mode) (defvar diff-changed-face 'diff-changed-face) (defface diff-function-face '((t :inherit diff-context-face)) - "`diff-mode' face used to highlight function names produced by \"diff -p\".") + "`diff-mode' face used to highlight function names produced by \"diff -p\"." + :group 'diff-mode) (defvar diff-function-face 'diff-function-face) (defface diff-context-face @@ -239,12 +247,14 @@ when editing big diffs)." :foreground "grey50") (((class color) (background dark)) :foreground "grey70")) - "`diff-mode' face used to highlight context and other side-information.") + "`diff-mode' face used to highlight context and other side-information." + :group 'diff-mode) (defvar diff-context-face 'diff-context-face) (defface diff-nonexistent-face '((t :inherit diff-file-header-face)) - "`diff-mode' face used to highlight nonexistent files in recursive diffs.") + "`diff-mode' face used to highlight nonexistent files in recursive diffs." + :group 'diff-mode) (defvar diff-nonexistent-face 'diff-nonexistent-face) (defconst diff-yank-handler '(diff-yank-function)) diff --git a/lisp/dired.el b/lisp/dired.el index 43f05dcf881..b0d86297e71 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -418,7 +418,24 @@ Subexpression 2 must end right before the \\n or \\r.") ;; It is quicker to first find just an extension, then go back to the ;; start of that file name. So we do this complex MATCH-ANCHORED form. (list (concat "\\(" (regexp-opt completion-ignored-extensions) "\\|#\\)$") - '(".+" (dired-move-to-filename) nil (0 dired-ignored-face))))) + '(".+" (dired-move-to-filename) nil (0 dired-ignored-face)))) + ;; + ;; Files suffixed with `completion-ignored-extensions' + ;; plus a character put in by -F. + '(eval . + (list (concat "\\(" (regexp-opt completion-ignored-extensions) + "\\|#\\)[*=|]$") + '(".+" (progn + (end-of-line) + ;; If the last character is not part of the filename, + ;; move back to the start of the filename + ;; so it can be fontified. + ;; Otherwise, leave point at the end of the line; + ;; that way, nothing is fontified. + (unless (get-text-property (1- (point)) 'mouse-face) + (dired-move-to-filename))) + nil (0 dired-ignored-face)))) +) "Additional expressions to highlight in Dired mode.") ;;; Macros must be defined before they are used, for the byte compiler. @@ -3163,10 +3180,8 @@ Anything else means ask for each directory." :group 'dired) (defun dired-dnd-popup-notice () - (x-popup-dialog - t - '("Recursive copies not enabled.\nSee variable dired-recursive-copies." - ("Ok" . nil)))) + (message-box + "Recursive copies not enabled.\nSee variable dired-recursive-copies.")) (defun dired-dnd-do-ask-action (uri) diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index f1798d941bf..aab4efab9f8 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -4057,27 +4057,6 @@ For example, invoke `emacs -batch -f batch-byte-recompile-directory .'." (setq command-line-args-left (cdr command-line-args-left))) (kill-emacs 0)) - -(make-obsolete-variable 'auto-fill-hook 'auto-fill-function "before 19.15") -(make-obsolete-variable 'blink-paren-hook 'blink-paren-function "before 19.15") -(make-obsolete-variable 'lisp-indent-hook 'lisp-indent-function "before 19.15") -(make-obsolete-variable 'inhibit-local-variables - "use enable-local-variables (with the reversed sense)." - "before 19.15") -(make-obsolete-variable 'unread-command-event - "use unread-command-events; which is a list of events rather than a single event." - "before 19.15") -(make-obsolete-variable 'suspend-hooks 'suspend-hook "before 19.15") -(make-obsolete-variable 'comment-indent-hook 'comment-indent-function "before 19.15") -(make-obsolete-variable 'meta-flag "use the set-input-mode function instead." "before 19.34") -(make-obsolete-variable 'before-change-function - "use before-change-functions; which is a list of functions rather than a single function." - "before 19.34") -(make-obsolete-variable 'after-change-function - "use after-change-functions; which is a list of functions rather than a single function." - "before 19.34") -(make-obsolete-variable 'font-lock-doc-string-face 'font-lock-string-face "before 19.34") - (provide 'byte-compile) (provide 'bytecomp) diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 727e45b1289..4efa87d5937 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -46,7 +46,8 @@ (defun coerce (x type) "Coerce OBJECT to type TYPE. -TYPE is a Common Lisp type specifier." +TYPE is a Common Lisp type specifier. +\n(fn OBJECT TYPE)" (cond ((eq type 'list) (if (listp x) x (append x nil))) ((eq type 'vector) (if (vectorp x) x (vconcat x))) ((eq type 'string) (if (stringp x) x (concat x))) @@ -120,16 +121,17 @@ strings case-insensitively." (nreverse cl-res)))) (defun map (cl-type cl-func cl-seq &rest cl-rest) - "Map a function across one or more sequences, returning a sequence. -TYPE is the sequence type to return, FUNC is the function, and SEQS -are the argument sequences." + "Map a FUNCTION across one or more SEQUENCEs, returning a sequence. +TYPE is the sequence type to return. +\n(fn TYPE FUNCTION SEQUENCE...)" (let ((cl-res (apply 'mapcar* cl-func cl-seq cl-rest))) (and cl-type (coerce cl-res cl-type)))) (defun maplist (cl-func cl-list &rest cl-rest) - "Map FUNC to each sublist of LIST or LISTS. + "Map FUNCTION to each sublist of LIST or LISTs. Like `mapcar', except applies to lists and their cdr's rather than to -the elements themselves." +the elements themselves. +\n(fn FUNCTION LIST...)" (if cl-rest (let ((cl-res nil) (cl-args (cons cl-list (copy-sequence cl-rest))) @@ -146,14 +148,16 @@ the elements themselves." (nreverse cl-res)))) (defun cl-mapc (cl-func cl-seq &rest cl-rest) - "Like `mapcar', but does not accumulate values returned by the function." + "Like `mapcar', but does not accumulate values returned by the function. +\n(fn FUNCTION SEQUENCE...)" (if cl-rest (progn (apply 'map nil cl-func cl-seq cl-rest) cl-seq) (mapc cl-func cl-seq))) (defun mapl (cl-func cl-list &rest cl-rest) - "Like `maplist', but does not accumulate values returned by the function." + "Like `maplist', but does not accumulate values returned by the function. +\n(fn FUNCTION LIST...)" (if cl-rest (apply 'maplist cl-func cl-list cl-rest) (let ((cl-p cl-list)) @@ -161,16 +165,19 @@ the elements themselves." cl-list) (defun mapcan (cl-func cl-seq &rest cl-rest) - "Like `mapcar', but nconc's together the values returned by the function." + "Like `mapcar', but nconc's together the values returned by the function. +\n(fn FUNCTION SEQUENCE...)" (apply 'nconc (apply 'mapcar* cl-func cl-seq cl-rest))) (defun mapcon (cl-func cl-list &rest cl-rest) - "Like `maplist', but nconc's together the values returned by the function." + "Like `maplist', but nconc's together the values returned by the function. +\n(fn FUNCTION LIST...)" (apply 'nconc (apply 'maplist cl-func cl-list cl-rest))) (defun some (cl-pred cl-seq &rest cl-rest) "Return true if PREDICATE is true of any element of SEQ or SEQs. -If so, return the true (non-nil) value returned by PREDICATE." +If so, return the true (non-nil) value returned by PREDICATE. +\n(fn PREDICATE SEQ...)" (if (or cl-rest (nlistp cl-seq)) (catch 'cl-some (apply 'map nil @@ -183,7 +190,8 @@ If so, return the true (non-nil) value returned by PREDICATE." cl-x))) (defun every (cl-pred cl-seq &rest cl-rest) - "Return true if PREDICATE is true of every element of SEQ or SEQs." + "Return true if PREDICATE is true of every element of SEQ or SEQs. +\n(fn PREDICATE SEQ...)" (if (or cl-rest (nlistp cl-seq)) (catch 'cl-every (apply 'map nil @@ -195,11 +203,13 @@ If so, return the true (non-nil) value returned by PREDICATE." (null cl-seq))) (defun notany (cl-pred cl-seq &rest cl-rest) - "Return true if PREDICATE is false of every element of SEQ or SEQs." + "Return true if PREDICATE is false of every element of SEQ or SEQs. +\n(fn PREDICATE SEQ...)" (not (apply 'some cl-pred cl-seq cl-rest))) (defun notevery (cl-pred cl-seq &rest cl-rest) - "Return true if PREDICATE is false of some element of SEQ or SEQs." + "Return true if PREDICATE is false of some element of SEQ or SEQs. +\n(fn PREDICATE SEQ...)" (not (apply 'every cl-pred cl-seq cl-rest))) ;;; Support for `loop'. @@ -332,16 +342,16 @@ If so, return the true (non-nil) value returned by PREDICATE." (setq a (* (/ a (gcd a b)) b)))) a))) -(defun isqrt (a) +(defun isqrt (x) "Return the integer square root of the argument." - (if (and (integerp a) (> a 0)) - (let ((g (cond ((<= a 100) 10) ((<= a 10000) 100) - ((<= a 1000000) 1000) (t a))) + (if (and (integerp x) (> x 0)) + (let ((g (cond ((<= x 100) 10) ((<= x 10000) 100) + ((<= x 1000000) 1000) (t x))) g2) - (while (< (setq g2 (/ (+ g (/ a g)) 2)) g) + (while (< (setq g2 (/ (+ g (/ x g)) 2)) g) (setq g g2)) g) - (if (eq a 0) 0 (signal 'arith-error nil)))) + (if (eq x 0) 0 (signal 'arith-error nil)))) (defun floor* (x &optional y) "Return a list of the floor of X and the fractional part of X. @@ -388,9 +398,9 @@ With two arguments, return rounding and remainder of their quotient." "The remainder of X divided by Y, with the same sign as X." (nth 1 (truncate* x y))) -(defun signum (a) - "Return 1 if A is positive, -1 if negative, 0 if zero." - (cond ((> a 0) 1) ((< a 0) -1) (t 0))) +(defun signum (x) + "Return 1 if X is positive, -1 if negative, 0 if zero." + (cond ((> x 0) 1) ((< x 0) -1) (t 0))) ;; Random numbers. @@ -514,7 +524,8 @@ If START or END is negative, it counts from the end." res)))))) (defun concatenate (type &rest seqs) - "Concatenate, into a sequence of type TYPE, the argument SEQUENCES." + "Concatenate, into a sequence of type TYPE, the argument SEQUENCEs. +\n(fn TYPE SEQUENCE...)" (cond ((eq type 'vector) (apply 'vconcat seqs)) ((eq type 'string) (apply 'concat seqs)) ((eq type 'list) (apply 'append (append seqs '(nil)))) @@ -532,7 +543,7 @@ If START or END is negative, it counts from the end." (nconc (nreverse x) y)) (defun list-length (x) - "Return the length of a list. Return nil if list is circular." + "Return the length of list X. Return nil if list is circular." (let ((n 0) (fast x) (slow x)) (while (and (cdr fast) (not (and (eq fast slow) (> n 0)))) (setq n (+ n 2) fast (cdr (cdr fast)) slow (cdr slow))) @@ -550,7 +561,8 @@ If START or END is negative, it counts from the end." ;;; Property lists. (defun get* (sym tag &optional def) ; See compiler macro in cl-macs.el - "Return the value of SYMBOL's PROPNAME property, or DEFAULT if none." + "Return the value of SYMBOL's PROPNAME property, or DEFAULT if none. +\n(fn SYMBOL PROPNAME &optional DEFAULT)" (or (get sym tag) (and def (let ((plist (symbol-plist sym))) @@ -560,7 +572,8 @@ If START or END is negative, it counts from the end." (defun getf (plist tag &optional def) "Search PROPLIST for property PROPNAME; return its value or DEFAULT. -PROPLIST is a list of the sort returned by `symbol-plist'." +PROPLIST is a list of the sort returned by `symbol-plist'. +\n(fn PROPLIST PROPNAME &optional DEFAULT)" (setplist '--cl-getf-symbol-- plist) (or (get '--cl-getf-symbol-- tag) ;; Originally we called get* here, @@ -582,7 +595,8 @@ PROPLIST is a list of the sort returned by `symbol-plist'." (and (cdr p) (progn (setcdr p (cdr (cdr (cdr p)))) t)))) (defun cl-remprop (sym tag) - "Remove from SYMBOL's plist the property PROP and its value." + "Remove from SYMBOL's plist the property PROPNAME and its value. +\n(fn SYMBOL PROPNAME)" (let ((plist (symbol-plist sym))) (if (and plist (eq tag (car plist))) (progn (setplist sym (cdr (cdr plist))) t) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 8bc195bdae8..1be2f9171a6 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -207,8 +207,8 @@ and BODY is implicitly surrounded by (block NAME ...). (defmacro function* (func) "Introduce a function. -Like normal `function', except that if argument is a lambda form, its -ARGLIST allows full Common Lisp conventions." +Like normal `function', except that if argument is a lambda form, +its argument list allows full Common Lisp conventions." (if (eq (car-safe func) 'lambda) (let* ((res (cl-transform-lambda (cdr func) 'cl-none)) (form (list 'function (cons 'lambda (cdr res))))) @@ -488,13 +488,14 @@ The result of the body appears to the compiler as a quoted constant." ;;; Conditional control structures. (defmacro case (expr &rest clauses) - "Eval EXPR and choose from CLAUSES on that value. + "Eval EXPR and choose among clauses on that value. Each clause looks like (KEYLIST BODY...). EXPR is evaluated and compared against each key in each KEYLIST; the corresponding BODY is evaluated. If no clause succeeds, case returns nil. A single atom may be used in place of a KEYLIST of one atom. A KEYLIST of t or `otherwise' is allowed only in the final clause, and matches if no other keys match. -Key values are compared by `eql'." +Key values are compared by `eql'. +\n(fn EXPR (KEYLIST BODY...)...)" (let* ((temp (if (cl-simple-expr-p expr 3) expr (make-symbol "--cl-var--"))) (head-list nil) (body (cons @@ -522,15 +523,17 @@ Key values are compared by `eql'." (defmacro ecase (expr &rest clauses) "Like `case', but error if no case fits. -`otherwise'-clauses are not allowed." +`otherwise'-clauses are not allowed. +\n(fn EXPR (KEYLIST BODY...)...)" (list* 'case expr (append clauses '((ecase-error-flag))))) (defmacro typecase (expr &rest clauses) - "Evals EXPR, chooses from CLAUSES on that value. + "Evals EXPR, chooses among clauses on that value. Each clause looks like (TYPE BODY...). EXPR is evaluated and, if it satisfies TYPE, the corresponding BODY is evaluated. If no clause succeeds, typecase returns nil. A TYPE of t or `otherwise' is allowed only in the -final clause, and matches if no other keys match." +final clause, and matches if no other keys match. +\n(fn EXPR (TYPE BODY...)...)" (let* ((temp (if (cl-simple-expr-p expr 3) expr (make-symbol "--cl-var--"))) (type-list nil) (body (cons @@ -552,7 +555,8 @@ final clause, and matches if no other keys match." (defmacro etypecase (expr &rest clauses) "Like `typecase', but error if no case fits. -`otherwise'-clauses are not allowed." +`otherwise'-clauses are not allowed. +\n(fn EXPR (TYPE BODY...)...)" (list* 'typecase expr (append clauses '((ecase-error-flag))))) @@ -1273,7 +1277,7 @@ before assigning any symbols SYM to the corresponding values. (defmacro progv (symbols values &rest body) "Bind SYMBOLS to VALUES dynamically in BODY. The forms SYMBOLS and VALUES are evaluated, and must evaluate to lists. -Each SYMBOL in the first list is bound to the corresponding VALUE in the +Each symbol in the first list is bound to the corresponding value in the second list (or made unbound if VALUES is shorter than SYMBOLS); then the BODY forms are executed and their result is returned. This is much like a `let' form, except that the list of symbols can be computed at run-time." @@ -1284,7 +1288,7 @@ a `let' form, except that the list of symbols can be computed at run-time." ;;; This should really have some way to shadow 'byte-compile properties, etc. (defmacro flet (bindings &rest body) - "Make temporary function defns. + "Make temporary function definitions. This is an analogue of `let' that operates on the function cell of FUNC rather than its value cell. The FORMs are evaluated with the specified function definitions in place, then the definitions are undone (the FUNCs @@ -1311,7 +1315,7 @@ go back to their previous definitions, or lack thereof). body)) (defmacro labels (bindings &rest body) - "Make temporary func bindings. + "Make temporary function bindings. This is like `flet', except the bindings are lexical instead of dynamic. Unlike `flet', this macro is fully compliant with the Common Lisp standard. @@ -1369,7 +1373,8 @@ by EXPANSION, and (setq NAME ...) will act like (setf EXPANSION ...). (defmacro lexical-let (bindings &rest body) "Like `let', but lexically scoped. The main visible difference is that lambdas inside BODY will create -lexical closures as in Common Lisp." +lexical closures as in Common Lisp. +\n(fn VARLIST BODY)" (let* ((cl-closure-vars cl-closure-vars) (vars (mapcar (function (lambda (x) @@ -1411,7 +1416,8 @@ lexical closures as in Common Lisp." (defmacro lexical-let* (bindings &rest body) "Like `let*', but lexically scoped. The main visible difference is that lambdas inside BODY will create -lexical closures as in Common Lisp." +lexical closures as in Common Lisp. +\n(fn VARLIST BODY)" (if (null bindings) (cons 'progn body) (setq bindings (reverse bindings)) (while bindings @@ -1435,7 +1441,7 @@ is analogous to the Common Lisp `multiple-value-bind' macro, using lists to simulate true multiple return values. For compatibility, (values A B C) is a synonym for (list A B C). -\(fn (SYM SYM...) FORM BODY)" +\(fn (SYM...) FORM BODY)" (let ((temp (make-symbol "--cl-var--")) (n -1)) (list* 'let* (cons (list temp form) (mapcar (function @@ -1451,7 +1457,7 @@ each of the symbols SYM in turn. This is analogous to the Common Lisp `multiple-value-setq' macro, using lists to simulate true multiple return values. For compatibility, (values A B C) is a synonym for (list A B C). -\(fn (SYM SYM...) FORM)" +\(fn (SYM...) FORM)" (cond ((null vars) (list 'progn form nil)) ((null (cdr vars)) (list 'setq (car vars) (list 'car form))) (t @@ -1967,7 +1973,7 @@ The form returns true if TAG was found and removed, nil otherwise." Example: (shiftf A B C) sets A to B, B to C, and returns the old A. Each PLACE may be a symbol, or any generalized variable allowed by `setf'. -\(fn PLACE PLACE... VAL)" +\(fn PLACE... VAL)" (cond ((null args) place) ((symbolp place) `(prog1 ,place (setq ,place (shiftf ,@args)))) diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el index cb202700a00..35403df1d0b 100644 --- a/lisp/emacs-lisp/cl-seq.el +++ b/lisp/emacs-lisp/cl-seq.el @@ -125,8 +125,9 @@ (defun reduce (cl-func cl-seq &rest cl-keys) - "Reduce two-argument FUNCTION across SEQUENCE. -Keywords supported: :start :end :from-end :initial-value :key" + "Reduce two-argument FUNCTION across SEQ. +\nKeywords supported: :start :end :from-end :initial-value :key +\n(fn FUNCTION SEQ [KEYWORD VALUE]...)" (cl-parsing-keywords (:from-end (:start 0) :end :initial-value :key) () (or (listp cl-seq) (setq cl-seq (append cl-seq nil))) (setq cl-seq (subseq cl-seq cl-start cl-end)) @@ -145,7 +146,8 @@ Keywords supported: :start :end :from-end :initial-value :key" (defun fill (seq item &rest cl-keys) "Fill the elements of SEQ with ITEM. -Keywords supported: :start :end" +\nKeywords supported: :start :end +\n(fn SEQ ITEM [KEYWORD VALUE]...)" (cl-parsing-keywords ((:start 0) :end) () (if (listp seq) (let ((p (nthcdr cl-start seq)) @@ -164,7 +166,8 @@ Keywords supported: :start :end" (defun replace (cl-seq1 cl-seq2 &rest cl-keys) "Replace the elements of SEQ1 with the elements of SEQ2. SEQ1 is destructively modified, then returned. -Keywords supported: :start1 :end1 :start2 :end2" +\nKeywords supported: :start1 :end1 :start2 :end2 +\n(fn SEQ1 SEQ2 [KEYWORD VALUE]...)" (cl-parsing-keywords ((:start1 0) :end1 (:start2 0) :end2) () (if (and (eq cl-seq1 cl-seq2) (<= cl-start2 cl-start1)) (or (= cl-start1 cl-start2) @@ -206,7 +209,8 @@ Keywords supported: :start1 :end1 :start2 :end2" "Remove all occurrences of ITEM in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary to avoid corrupting the original SEQ. -Keywords supported: :test :test-not :key :count :start :end :from-end" +\nKeywords supported: :test :test-not :key :count :start :end :from-end +\n(fn ITEM SEQ [KEYWORD VALUE]...)" (cl-parsing-keywords (:test :test-not :key :if :if-not :count :from-end (:start 0) :end) () (if (<= (or cl-count (setq cl-count 8000000)) 0) @@ -250,20 +254,23 @@ Keywords supported: :test :test-not :key :count :start :end :from-end" "Remove all items satisfying PREDICATE in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary to avoid corrupting the original SEQ. -Keywords supported: :key :count :start :end :from-end" +\nKeywords supported: :key :count :start :end :from-end +\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'remove* nil cl-list :if cl-pred cl-keys)) (defun remove-if-not (cl-pred cl-list &rest cl-keys) "Remove all items not satisfying PREDICATE in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary to avoid corrupting the original SEQ. -Keywords supported: :key :count :start :end :from-end" +\nKeywords supported: :key :count :start :end :from-end +\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'remove* nil cl-list :if-not cl-pred cl-keys)) (defun delete* (cl-item cl-seq &rest cl-keys) "Remove all occurrences of ITEM in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. -Keywords supported: :test :test-not :key :count :start :end :from-end" +\nKeywords supported: :test :test-not :key :count :start :end :from-end +\n(fn ITEM SEQ [KEYWORD VALUE]...)" (cl-parsing-keywords (:test :test-not :key :if :if-not :count :from-end (:start 0) :end) () (if (<= (or cl-count (setq cl-count 8000000)) 0) @@ -305,23 +312,27 @@ Keywords supported: :test :test-not :key :count :start :end :from-end" (defun delete-if (cl-pred cl-list &rest cl-keys) "Remove all items satisfying PREDICATE in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. -Keywords supported: :key :count :start :end :from-end" +\nKeywords supported: :key :count :start :end :from-end +\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'delete* nil cl-list :if cl-pred cl-keys)) (defun delete-if-not (cl-pred cl-list &rest cl-keys) "Remove all items not satisfying PREDICATE in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. -Keywords supported: :key :count :start :end :from-end" +\nKeywords supported: :key :count :start :end :from-end +\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'delete* nil cl-list :if-not cl-pred cl-keys)) (defun remove-duplicates (cl-seq &rest cl-keys) "Return a copy of SEQ with all duplicate elements removed. -Keywords supported: :test :test-not :key :start :end :from-end" +\nKeywords supported: :test :test-not :key :start :end :from-end +\n(fn SEQ [KEYWORD VALUE]...)" (cl-delete-duplicates cl-seq cl-keys t)) (defun delete-duplicates (cl-seq &rest cl-keys) "Remove all duplicate elements from SEQ (destructively). -Keywords supported: :test :test-not :key :start :end :from-end" +\nKeywords supported: :test :test-not :key :start :end :from-end +\n(fn SEQ [KEYWORD VALUE]...)" (cl-delete-duplicates cl-seq cl-keys nil)) (defun cl-delete-duplicates (cl-seq cl-keys cl-copy) @@ -368,7 +379,8 @@ Keywords supported: :test :test-not :key :start :end :from-end" "Substitute NEW for OLD in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary to avoid corrupting the original SEQ. -Keywords supported: :test :test-not :key :count :start :end :from-end" +\nKeywords supported: :test :test-not :key :count :start :end :from-end +\n(fn NEW OLD SEQ [KEYWORD VALUE]...)" (cl-parsing-keywords (:test :test-not :key :if :if-not :count (:start 0) :end :from-end) () (if (or (eq cl-old cl-new) @@ -388,20 +400,23 @@ Keywords supported: :test :test-not :key :count :start :end :from-end" "Substitute NEW for all items satisfying PREDICATE in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary to avoid corrupting the original SEQ. -Keywords supported: :key :count :start :end :from-end" +\nKeywords supported: :key :count :start :end :from-end +\n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'substitute cl-new nil cl-list :if cl-pred cl-keys)) (defun substitute-if-not (cl-new cl-pred cl-list &rest cl-keys) "Substitute NEW for all items not satisfying PREDICATE in SEQ. This is a non-destructive function; it makes a copy of SEQ if necessary to avoid corrupting the original SEQ. -Keywords supported: :key :count :start :end :from-end" +\nKeywords supported: :key :count :start :end :from-end +\n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'substitute cl-new nil cl-list :if-not cl-pred cl-keys)) (defun nsubstitute (cl-new cl-old cl-seq &rest cl-keys) "Substitute NEW for OLD in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. -Keywords supported: :test :test-not :key :count :start :end :from-end" +\nKeywords supported: :test :test-not :key :count :start :end :from-end +\n(fn NEW OLD SEQ [KEYWORD VALUE]...)" (cl-parsing-keywords (:test :test-not :key :if :if-not :count (:start 0) :end :from-end) () (or (eq cl-old cl-new) (<= (or cl-count (setq cl-count 8000000)) 0) @@ -433,38 +448,44 @@ Keywords supported: :test :test-not :key :count :start :end :from-end" (defun nsubstitute-if (cl-new cl-pred cl-list &rest cl-keys) "Substitute NEW for all items satisfying PREDICATE in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. -Keywords supported: :key :count :start :end :from-end" +\nKeywords supported: :key :count :start :end :from-end +\n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'nsubstitute cl-new nil cl-list :if cl-pred cl-keys)) (defun nsubstitute-if-not (cl-new cl-pred cl-list &rest cl-keys) "Substitute NEW for all items not satisfying PREDICATE in SEQ. This is a destructive function; it reuses the storage of SEQ whenever possible. -Keywords supported: :key :count :start :end :from-end" +\nKeywords supported: :key :count :start :end :from-end +\n(fn NEW PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'nsubstitute cl-new nil cl-list :if-not cl-pred cl-keys)) (defun find (cl-item cl-seq &rest cl-keys) - "Find the first occurrence of ITEM in LIST. + "Find the first occurrence of ITEM in SEQ. Return the matching ITEM, or nil if not found. -Keywords supported: :test :test-not :key :start :end :from-end" +\nKeywords supported: :test :test-not :key :start :end :from-end +\n(fn ITEM SEQ [KEYWORD VALUE]...)" (let ((cl-pos (apply 'position cl-item cl-seq cl-keys))) (and cl-pos (elt cl-seq cl-pos)))) (defun find-if (cl-pred cl-list &rest cl-keys) - "Find the first item satisfying PREDICATE in LIST. -Return the matching ITEM, or nil if not found. -Keywords supported: :key :start :end :from-end" + "Find the first item satisfying PREDICATE in SEQ. +Return the matching item, or nil if not found. +\nKeywords supported: :key :start :end :from-end +\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'find nil cl-list :if cl-pred cl-keys)) (defun find-if-not (cl-pred cl-list &rest cl-keys) - "Find the first item not satisfying PREDICATE in LIST. -Return the matching ITEM, or nil if not found. -Keywords supported: :key :start :end :from-end" + "Find the first item not satisfying PREDICATE in SEQ. +Return the matching item, or nil if not found. +\nKeywords supported: :key :start :end :from-end +\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'find nil cl-list :if-not cl-pred cl-keys)) (defun position (cl-item cl-seq &rest cl-keys) - "Find the first occurrence of ITEM in LIST. + "Find the first occurrence of ITEM in SEQ. Return the index of the matching item, or nil if not found. -Keywords supported: :test :test-not :key :start :end :from-end" +\nKeywords supported: :test :test-not :key :start :end :from-end +\n(fn ITEM SEQ [KEYWORD VALUE]...)" (cl-parsing-keywords (:test :test-not :key :if :if-not (:start 0) :end :from-end) () (cl-position cl-item cl-seq cl-start cl-end cl-from-end))) @@ -491,20 +512,23 @@ Keywords supported: :test :test-not :key :start :end :from-end" (and (< cl-start cl-end) cl-start)))) (defun position-if (cl-pred cl-list &rest cl-keys) - "Find the first item satisfying PREDICATE in LIST. + "Find the first item satisfying PREDICATE in SEQ. Return the index of the matching item, or nil if not found. -Keywords supported: :key :start :end :from-end" +\nKeywords supported: :key :start :end :from-end +\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'position nil cl-list :if cl-pred cl-keys)) (defun position-if-not (cl-pred cl-list &rest cl-keys) - "Find the first item not satisfying PREDICATE in LIST. + "Find the first item not satisfying PREDICATE in SEQ. Return the index of the matching item, or nil if not found. -Keywords supported: :key :start :end :from-end" +\nKeywords supported: :key :start :end :from-end +\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'position nil cl-list :if-not cl-pred cl-keys)) (defun count (cl-item cl-seq &rest cl-keys) - "Count the number of occurrences of ITEM in LIST. -Keywords supported: :test :test-not :key :start :end" + "Count the number of occurrences of ITEM in SEQ. +\nKeywords supported: :test :test-not :key :start :end +\n(fn ITEM SEQ [KEYWORD VALUE]...)" (cl-parsing-keywords (:test :test-not :key :if :if-not (:start 0) :end) () (let ((cl-count 0) cl-x) (or cl-end (setq cl-end (length cl-seq))) @@ -516,20 +540,23 @@ Keywords supported: :test :test-not :key :start :end" cl-count))) (defun count-if (cl-pred cl-list &rest cl-keys) - "Count the number of items satisfying PREDICATE in LIST. -Keywords supported: :key :start :end" + "Count the number of items satisfying PREDICATE in SEQ. +\nKeywords supported: :key :start :end +\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'count nil cl-list :if cl-pred cl-keys)) (defun count-if-not (cl-pred cl-list &rest cl-keys) - "Count the number of items not satisfying PREDICATE in LIST. -Keywords supported: :key :start :end" + "Count the number of items not satisfying PREDICATE in SEQ. +\nKeywords supported: :key :start :end +\n(fn PREDICATE SEQ [KEYWORD VALUE]...)" (apply 'count nil cl-list :if-not cl-pred cl-keys)) (defun mismatch (cl-seq1 cl-seq2 &rest cl-keys) "Compare SEQ1 with SEQ2, return index of first mismatching element. Return nil if the sequences match. If one sequence is a prefix of the other, the return value indicates the end of the shorter sequence. -Keywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end" +\nKeywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end +\n(fn SEQ1 SEQ2 [KEYWORD VALUE]...)" (cl-parsing-keywords (:test :test-not :key :from-end (:start1 0) :end1 (:start2 0) :end2) () (or cl-end1 (setq cl-end1 (length cl-seq1))) @@ -558,7 +585,8 @@ Keywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end" "Search for SEQ1 as a subsequence of SEQ2. Return the index of the leftmost element of the first match found; return nil if there are no matches. -Keywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end" +\nKeywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end +\n(fn SEQ1 SEQ2 [KEYWORD VALUE]...)" (cl-parsing-keywords (:test :test-not :key :from-end (:start1 0) :end1 (:start2 0) :end2) () (or cl-end1 (setq cl-end1 (length cl-seq1))) @@ -580,9 +608,10 @@ Keywords supported: :test :test-not :key :start1 :end1 :start2 :end2 :from-end" (and (< cl-start2 cl-end2) cl-pos))))) (defun sort* (cl-seq cl-pred &rest cl-keys) - "Sort the argument SEQUENCE according to PREDICATE. -This is a destructive function; it reuses the storage of SEQUENCE if possible. -Keywords supported: :key" + "Sort the argument SEQ according to PREDICATE. +This is a destructive function; it reuses the storage of SEQ if possible. +\nKeywords supported: :key +\n(fn SEQ PREDICATE [KEYWORD VALUE]...)" (if (nlistp cl-seq) (replace cl-seq (apply 'sort* (append cl-seq nil) cl-pred cl-keys)) (cl-parsing-keywords (:key) () @@ -593,16 +622,18 @@ Keywords supported: :key" (funcall cl-key cl-y))))))))) (defun stable-sort (cl-seq cl-pred &rest cl-keys) - "Sort the argument SEQUENCE stably according to PREDICATE. -This is a destructive function; it reuses the storage of SEQUENCE if possible. -Keywords supported: :key" + "Sort the argument SEQ stably according to PREDICATE. +This is a destructive function; it reuses the storage of SEQ if possible. +\nKeywords supported: :key +\n(fn SEQ PREDICATE [KEYWORD VALUE]...)" (apply 'sort* cl-seq cl-pred cl-keys)) (defun merge (cl-type cl-seq1 cl-seq2 cl-pred &rest cl-keys) "Destructively merge the two sequences to produce a new sequence. -TYPE is the sequence type to return, SEQ1 and SEQ2 are the two -argument sequences, and PRED is a `less-than' predicate on the elements. -Keywords supported: :key" +TYPE is the sequence type to return, SEQ1 and SEQ2 are the two argument +sequences, and PREDICATE is a `less-than' predicate on the elements. +\nKeywords supported: :key +\n(fn TYPE SEQ1 SEQ2 PREDICATE [KEYWORD VALUE]...)" (or (listp cl-seq1) (setq cl-seq1 (append cl-seq1 nil))) (or (listp cl-seq2) (setq cl-seq2 (append cl-seq2 nil))) (cl-parsing-keywords (:key) () @@ -618,7 +649,8 @@ Keywords supported: :key" (defun member* (cl-item cl-list &rest cl-keys) "Find the first occurrence of ITEM in LIST. Return the sublist of LIST whose car is ITEM. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn ITEM LIST [KEYWORD VALUE]...)" (if cl-keys (cl-parsing-keywords (:test :test-not :key :if :if-not) () (while (and cl-list (not (cl-check-test cl-item (car cl-list)))) @@ -631,13 +663,15 @@ Keywords supported: :test :test-not :key" (defun member-if (cl-pred cl-list &rest cl-keys) "Find the first item satisfying PREDICATE in LIST. Return the sublist of LIST whose car matches. -Keywords supported: :key" +\nKeywords supported: :key +\n(fn PREDICATE LIST [KEYWORD VALUE]...)" (apply 'member* nil cl-list :if cl-pred cl-keys)) (defun member-if-not (cl-pred cl-list &rest cl-keys) "Find the first item not satisfying PREDICATE in LIST. Return the sublist of LIST whose car matches. -Keywords supported: :key" +\nKeywords supported: :key +\n(fn PREDICATE LIST [KEYWORD VALUE]...)" (apply 'member* nil cl-list :if-not cl-pred cl-keys)) (defun cl-adjoin (cl-item cl-list &rest cl-keys) @@ -649,7 +683,8 @@ Keywords supported: :key" ;;; See compiler macro in cl-macs.el (defun assoc* (cl-item cl-alist &rest cl-keys) "Find the first item whose car matches ITEM in LIST. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn ITEM LIST [KEYWORD VALUE]...)" (if cl-keys (cl-parsing-keywords (:test :test-not :key :if :if-not) () (while (and cl-alist @@ -663,17 +698,20 @@ Keywords supported: :test :test-not :key" (defun assoc-if (cl-pred cl-list &rest cl-keys) "Find the first item whose car satisfies PREDICATE in LIST. -Keywords supported: :key" +\nKeywords supported: :key +\n(fn PREDICATE LIST [KEYWORD VALUE]...)" (apply 'assoc* nil cl-list :if cl-pred cl-keys)) (defun assoc-if-not (cl-pred cl-list &rest cl-keys) "Find the first item whose car does not satisfy PREDICATE in LIST. -Keywords supported: :key" +\nKeywords supported: :key +\n(fn PREDICATE LIST [KEYWORD VALUE]...)" (apply 'assoc* nil cl-list :if-not cl-pred cl-keys)) (defun rassoc* (cl-item cl-alist &rest cl-keys) "Find the first item whose cdr matches ITEM in LIST. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn ITEM LIST [KEYWORD VALUE]...)" (if (or cl-keys (numberp cl-item)) (cl-parsing-keywords (:test :test-not :key :if :if-not) () (while (and cl-alist @@ -685,12 +723,14 @@ Keywords supported: :test :test-not :key" (defun rassoc-if (cl-pred cl-list &rest cl-keys) "Find the first item whose cdr satisfies PREDICATE in LIST. -Keywords supported: :key" +\nKeywords supported: :key +\n(fn PREDICATE LIST [KEYWORD VALUE]...)" (apply 'rassoc* nil cl-list :if cl-pred cl-keys)) (defun rassoc-if-not (cl-pred cl-list &rest cl-keys) "Find the first item whose cdr does not satisfy PREDICATE in LIST. -Keywords supported: :key" +\nKeywords supported: :key +\n(fn PREDICATE LIST [KEYWORD VALUE]...)" (apply 'rassoc* nil cl-list :if-not cl-pred cl-keys)) (defun union (cl-list1 cl-list2 &rest cl-keys) @@ -698,7 +738,8 @@ Keywords supported: :key" The result list contains all items that appear in either LIST1 or LIST2. This is a non-destructive function; it makes a copy of the data if necessary to avoid corrupting the original LIST1 and LIST2. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" (cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) ((equal cl-list1 cl-list2) cl-list1) (t @@ -717,7 +758,8 @@ Keywords supported: :test :test-not :key" The result list contains all items that appear in either LIST1 or LIST2. This is a destructive function; it reuses the storage of LIST1 and LIST2 whenever possible. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" (cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) (t (apply 'union cl-list1 cl-list2 cl-keys)))) @@ -726,7 +768,8 @@ Keywords supported: :test :test-not :key" The result list contains all items that appear in both LIST1 and LIST2. This is a non-destructive function; it makes a copy of the data if necessary to avoid corrupting the original LIST1 and LIST2. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" (and cl-list1 cl-list2 (if (equal cl-list1 cl-list2) cl-list1 (cl-parsing-keywords (:key) (:test :test-not) @@ -747,7 +790,8 @@ Keywords supported: :test :test-not :key" The result list contains all items that appear in both LIST1 and LIST2. This is a destructive function; it reuses the storage of LIST1 and LIST2 whenever possible. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" (and cl-list1 cl-list2 (apply 'intersection cl-list1 cl-list2 cl-keys))) (defun set-difference (cl-list1 cl-list2 &rest cl-keys) @@ -755,7 +799,8 @@ Keywords supported: :test :test-not :key" The result list contains all items that appear in LIST1 but not LIST2. This is a non-destructive function; it makes a copy of the data if necessary to avoid corrupting the original LIST1 and LIST2. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" (if (or (null cl-list1) (null cl-list2)) cl-list1 (cl-parsing-keywords (:key) (:test :test-not) (let ((cl-res nil)) @@ -773,7 +818,8 @@ Keywords supported: :test :test-not :key" The result list contains all items that appear in LIST1 but not LIST2. This is a destructive function; it reuses the storage of LIST1 and LIST2 whenever possible. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" (if (or (null cl-list1) (null cl-list2)) cl-list1 (apply 'set-difference cl-list1 cl-list2 cl-keys))) @@ -782,7 +828,8 @@ Keywords supported: :test :test-not :key" The result list contains all items that appear in exactly one of LIST1, LIST2. This is a non-destructive function; it makes a copy of the data if necessary to avoid corrupting the original LIST1 and LIST2. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" (cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) ((equal cl-list1 cl-list2) nil) (t (append (apply 'set-difference cl-list1 cl-list2 cl-keys) @@ -793,7 +840,8 @@ Keywords supported: :test :test-not :key" The result list contains all items that appear in exactly one of LIST1, LIST2. This is a destructive function; it reuses the storage of LIST1 and LIST2 whenever possible. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" (cond ((null cl-list1) cl-list2) ((null cl-list2) cl-list1) ((equal cl-list1 cl-list2) nil) (t (nconc (apply 'nset-difference cl-list1 cl-list2 cl-keys) @@ -802,7 +850,8 @@ Keywords supported: :test :test-not :key" (defun subsetp (cl-list1 cl-list2 &rest cl-keys) "Return true if LIST1 is a subset of LIST2. I.e., if every element of LIST1 also appears in LIST2. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn LIST1 LIST2 [KEYWORD VALUE]...)" (cond ((null cl-list1) t) ((null cl-list2) nil) ((equal cl-list1 cl-list2) t) (t (cl-parsing-keywords (:key) (:test :test-not) @@ -815,38 +864,44 @@ Keywords supported: :test :test-not :key" (defun subst-if (cl-new cl-pred cl-tree &rest cl-keys) "Substitute NEW for elements matching PREDICATE in TREE (non-destructively). Return a copy of TREE with all matching elements replaced by NEW. -Keywords supported: :key" +\nKeywords supported: :key +\n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" (apply 'sublis (list (cons nil cl-new)) cl-tree :if cl-pred cl-keys)) (defun subst-if-not (cl-new cl-pred cl-tree &rest cl-keys) "Substitute NEW for elts not matching PREDICATE in TREE (non-destructively). Return a copy of TREE with all non-matching elements replaced by NEW. -Keywords supported: :key" +\nKeywords supported: :key +\n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" (apply 'sublis (list (cons nil cl-new)) cl-tree :if-not cl-pred cl-keys)) (defun nsubst (cl-new cl-old cl-tree &rest cl-keys) "Substitute NEW for OLD everywhere in TREE (destructively). Any element of TREE which is `eql' to OLD is changed to NEW (via a call to `setcar'). -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn NEW OLD TREE [KEYWORD VALUE]...)" (apply 'nsublis (list (cons cl-old cl-new)) cl-tree cl-keys)) (defun nsubst-if (cl-new cl-pred cl-tree &rest cl-keys) "Substitute NEW for elements matching PREDICATE in TREE (destructively). Any element of TREE which matches is changed to NEW (via a call to `setcar'). -Keywords supported: :key" +\nKeywords supported: :key +\n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" (apply 'nsublis (list (cons nil cl-new)) cl-tree :if cl-pred cl-keys)) (defun nsubst-if-not (cl-new cl-pred cl-tree &rest cl-keys) "Substitute NEW for elements not matching PREDICATE in TREE (destructively). Any element of TREE which matches is changed to NEW (via a call to `setcar'). -Keywords supported: :key" +\nKeywords supported: :key +\n(fn NEW PREDICATE TREE [KEYWORD VALUE]...)" (apply 'nsublis (list (cons nil cl-new)) cl-tree :if-not cl-pred cl-keys)) (defun sublis (cl-alist cl-tree &rest cl-keys) "Perform substitutions indicated by ALIST in TREE (non-destructively). Return a copy of TREE with all matching elements replaced. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn ALIST TREE [KEYWORD VALUE]...)" (cl-parsing-keywords (:test :test-not :key :if :if-not) () (cl-sublis-rec cl-tree))) @@ -867,7 +922,8 @@ Keywords supported: :test :test-not :key" (defun nsublis (cl-alist cl-tree &rest cl-keys) "Perform substitutions indicated by ALIST in TREE (destructively). Any matching element of TREE is changed via a call to `setcar'. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn ALIST TREE [KEYWORD VALUE]...)" (cl-parsing-keywords (:test :test-not :key :if :if-not) () (let ((cl-hold (list cl-tree))) (cl-nsublis-rec cl-hold) @@ -888,9 +944,10 @@ Keywords supported: :test :test-not :key" (setq cl-tree (cdr cl-tree)))))) (defun tree-equal (cl-x cl-y &rest cl-keys) - "Return t if trees X and Y have `eql' leaves. + "Return t if trees TREE1 and TREE2 have `eql' leaves. Atoms are compared by `eql'; cons cells are compared recursively. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn TREE1 TREE2 [KEYWORD VALUE]...)" (cl-parsing-keywords (:test :test-not :key) () (cl-tree-equal-rec cl-x cl-y))) diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index 11835629bd7..e7f736cfd72 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -112,16 +112,6 @@ a future Emacs interpreter will be able to use it.") (defun cl-cannot-unload () (error "Cannot unload the feature `cl'")) -;;; Predicates. - -(defun eql (a b) ; See compiler macro in cl-macs.el - "Return t if the two args are the same Lisp object. -Floating-point numbers of equal value are `eql', but they may not be `eq'." - (if (numberp a) - (equal a b) - (eq a b))) - - ;;; Generalized variables. These macros are defined here so that they ;;; can safely be used in .emacs files. @@ -162,7 +152,8 @@ be a symbol, or any generalized variable allowed by `setf'." "(pushnew X PLACE): insert X at the head of the list if not already there. Like (push X PLACE), except that the list is unmodified if X is `eql' to an element already on the list. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn X PLACE [KEYWORD VALUE]...)" (if (symbolp place) (list 'setq place (list* 'adjoin x place keys)) (list* 'callf2 'adjoin x place keys))) @@ -256,7 +247,8 @@ Otherwise, the macro is expanded and the expansion is considered in place of FORM. When a non-macro-call results, it is returned. The second optional arg ENVIRONMENT specifies an environment of macro -definitions to shadow the loaded ones for use in file byte-compilation." +definitions to shadow the loaded ones for use in file byte-compilation. +\n(fn FORM &optional ENVIRONMENT)" (let ((cl-macro-environment cl-env)) (while (progn (setq cl-macro (funcall cl-old-macroexpand cl-macro cl-env)) (and (symbolp cl-macro) @@ -300,27 +292,27 @@ definitions to shadow the loaded ones for use in file byte-compilation." ;;; Numbers. -(defun floatp-safe (x) +(defun floatp-safe (object) "Return t if OBJECT is a floating point number. On Emacs versions that lack floating-point support, this function always returns nil." - (and (numberp x) (not (integerp x)))) + (and (numberp object) (not (integerp object)))) -(defun plusp (x) +(defun plusp (number) "Return t if NUMBER is positive." - (> x 0)) + (> number 0)) -(defun minusp (x) +(defun minusp (number) "Return t if NUMBER is negative." - (< x 0)) + (< number 0)) -(defun oddp (x) +(defun oddp (integer) "Return t if INTEGER is odd." - (eq (logand x 1) 1)) + (eq (logand integer 1) 1)) -(defun evenp (x) +(defun evenp (integer) "Return t if INTEGER is even." - (eq (logand x 1) 0)) + (eq (logand integer 1) 0)) (defvar *random-state* (vector 'cl-random-state-tag -1 30 (cl-random-time))) @@ -344,7 +336,8 @@ always returns nil." If there are several SEQs, FUNCTION is called with that many arguments, and mapping stops as soon as the shortest list runs out. With just one SEQ, this is like `mapcar'. With several, it is like the Common Lisp -`mapcar' function extended to arbitrary sequence types." +`mapcar' function extended to arbitrary sequence types. +\n(fn FUNCTION SEQ...)" (if cl-rest (if (or (cdr cl-rest) (nlistp cl-x) (nlistp (car cl-rest))) (cl-mapcar-many cl-func (cons cl-x cl-rest)) @@ -503,9 +496,10 @@ SEQ, this is like `mapcar'. With several, it is like the Common Lisp ;; x)) (defun list* (arg &rest rest) ; See compiler macro in cl-macs.el - "Return a new list with specified args as elements, consed to last arg. + "Return a new list with specified ARGs as elements, consed to last ARG. Thus, `(list* A B C D)' is equivalent to `(nconc (list A B C) D)', or to -`(cons A (cons B (cons C D)))'." +`(cons A (cons B (cons C D)))'. +\n(fn ARG...)" (cond ((not rest) arg) ((not (cdr rest)) (cons arg (car rest))) (t (let* ((n (length rest)) @@ -522,8 +516,8 @@ Thus, `(list* A B C D)' is equivalent to `(nconc (list A B C) D)', or to (nreverse res))) (defun copy-list (list) - "Return a copy of a list, which may be a dotted list. -The elements of the list are not copied, just the list structure itself." + "Return a copy of LIST, which may be a dotted list. +The elements of LIST are not copied, just the list structure itself." (if (consp list) (let ((res nil)) (while (consp list) (push (pop list) res)) @@ -544,7 +538,8 @@ The elements of the list are not copied, just the list structure itself." (defun adjoin (cl-item cl-list &rest cl-keys) ; See compiler macro in cl-macs "Return ITEM consed onto the front of LIST only if it's not already there. Otherwise, return LIST unmodified. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn ITEM LIST [KEYWORD VALUE]...)" (cond ((or (equal cl-keys '(:test eq)) (and (null cl-keys) (not (numberp cl-item)))) (if (memq cl-item cl-list) cl-list (cons cl-item cl-list))) @@ -555,7 +550,8 @@ Keywords supported: :test :test-not :key" (defun subst (cl-new cl-old cl-tree &rest cl-keys) "Substitute NEW for OLD everywhere in TREE (non-destructively). Return a copy of TREE with all elements `eql' to OLD replaced by NEW. -Keywords supported: :test :test-not :key" +\nKeywords supported: :test :test-not :key +\n(fn NEW OLD TREE [KEYWORD VALUE]...)" (if (or cl-keys (and (numberp cl-old) (not (integerp cl-old)))) (apply 'sublis (list (cons cl-old cl-new)) cl-tree cl-keys) (cl-do-subst cl-new cl-old cl-tree))) @@ -569,8 +565,17 @@ Keywords supported: :test :test-not :key" cl-tree (cons a d)))) (t cl-tree))) -(defun acons (a b c) (cons (cons a b) c)) -(defun pairlis (a b &optional c) (nconc (mapcar* 'cons a b) c)) +(defun acons (key value alist) + "Add KEY and VALUE to ALIST. +Return a new list with (cons KEY VALUE) as car and ALIST as cdr." + (cons (cons key value) alist)) + +(defun pairlis (keys values &optional alist) + "Make an alist from KEYS and VALUES. +Return a new alist composed by associating KEYS to corresponding VALUES; +the process stops as soon as KEYS or VALUES run out. +If ALIST is non-nil, the new pairs are prepended to it." + (nconc (mapcar* 'cons keys values) alist)) ;;; Miscellaneous. @@ -699,5 +704,5 @@ Keywords supported: :test :test-not :key" (run-hooks 'cl-load-hook) -;;; arch-tag: 5f07fa74-f153-4524-9303-21f5be125851 +;; arch-tag: 5f07fa74-f153-4524-9303-21f5be125851 ;;; cl.el ends here diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index c00028ad218..5ba9c094355 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el @@ -132,6 +132,7 @@ BODY can start with a bunch of keyword arguments. The following keyword arguments are currently understood: :group GROUP Declare the customization group that corresponds to this mode. + The command `customize-mode' uses this. :syntax-table TABLE Use TABLE instead of the default. A nil value means to simply use the same syntax-table as the parent. diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 0892af1bb35..188dc172e07 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -172,7 +172,7 @@ For example, you could write (setq group `(:group ',(intern (replace-regexp-in-string "-mode\\'" "" mode-name))))) - + `(progn ;; Define the variable to enable or disable the mode. ,(if (not globalp) @@ -306,9 +306,9 @@ in which `%s' turns it on." ;; Setup hook to handle future mode changes and new buffers. (if ,global-mode (progn - (add-hook 'find-file-hook ',buffers) + (add-hook 'after-change-major-mode-hook ',buffers) (add-hook 'change-major-mode-hook ',cmmh)) - (remove-hook 'find-file-hook ',buffers) + (remove-hook 'after-change-major-mode-hook ',buffers) (remove-hook 'change-major-mode-hook ',cmmh)) ;; Go through existing buffers. diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index c9f1769ae14..b3160c9b752 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -471,11 +471,15 @@ Contrary to XEmacs, this is a nop on Emacs since menus are automatically (defun easy-menu-add (menu &optional map) "Add the menu to the menubar. -This is a nop on Emacs since menus are automatically activated when the -corresponding keymap is activated. On XEmacs this is needed to actually -add the menu to the current menubar. -Maybe precalculate equivalent key bindings. -Do it only if `easy-menu-precalculate-equivalent-keybindings' is on." +On Emacs, menus are already automatically activated when the +corresponding keymap is activated. On XEmacs this is needed to +actually add the menu to the current menubar. + +This also precalculates equivalent key bindings when +`easy-menu-precalculate-equivalent-keybindings' is on. + +You should call this once the menu and keybindings are set up +completely and menu filter functions can be expected to work." (when easy-menu-precalculate-equivalent-keybindings (if (and (symbolp menu) (not (keymapp menu)) (boundp menu)) (setq menu (symbol-value menu))) diff --git a/lisp/emulation/tpu-extras.el b/lisp/emulation/tpu-extras.el index 9c417dd3a40..427ef19bccd 100644 --- a/lisp/emulation/tpu-extras.el +++ b/lisp/emulation/tpu-extras.el @@ -144,9 +144,9 @@ the previous line when starting from a line beginning." "Eliminate whitespace at ends of lines, if the cursor is free." (if (and (buffer-modified-p) tpu-cursor-free) (tpu-trim-line-ends))) -(or (memq 'tpu-write-file-hook write-file-hooks) - (setq write-file-hooks - (cons 'tpu-write-file-hook write-file-hooks))) +(or (memq 'tpu-write-file-hook write-file-functions) + (setq write-file-functions + (cons 'tpu-write-file-hook write-file-functions))) ;;; Utility routines for implementing scroll margins diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index 7e8a5cbeb99..c29e0e26ba5 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el @@ -67,10 +67,10 @@ ;;; Variables (defconst viper-ex-work-buf-name " *ex-working-space*") -(defconst viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) +(defvar viper-ex-work-buf (get-buffer-create viper-ex-work-buf-name)) (defconst viper-ex-tmp-buf-name " *ex-tmp*") (defconst viper-ex-print-buf-name " *ex-print*") -(defconst viper-ex-print-buf (get-buffer-create viper-ex-print-buf-name)) +(defvar viper-ex-print-buf (get-buffer-create viper-ex-print-buf-name)) ;;; ex-commands... diff --git a/lisp/faces.el b/lisp/faces.el index f4522c8a155..5f19ba7a880 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1844,9 +1844,22 @@ created." :group 'modeline :group 'basic-faces) +(defface mode-line-highlight + '((((class color) (min-colors 88) (background light)) + :background "RoyalBlue4" :foreground "white") + (((class color) (min-colors 88) (background dark)) + :background "light sky blue" :foreground "black") + (t + :inverse-video t)) + "Basic mode line face for highlighting." + :version "22.1" + :group 'modeline + :group 'basic-faces) + ;; Make `modeline' an alias for `mode-line', for compatibility. (put 'modeline 'face-alias 'mode-line) (put 'modeline-inactive 'face-alias 'mode-line-inactive) +(put 'modeline-higilight 'face-alias 'mode-line-highlight) (defface header-line '((default diff --git a/lisp/files.el b/lisp/files.el index d519f041152..4602b4e1efa 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1744,7 +1744,7 @@ in that case, this function acts as if `enable-local-variables' were t." (mapc (lambda (elt) (cons (purecopy (car elt)) (cdr elt))) - '(;; do this first, so that .html.pl is Polish html, not Perl + `(;; do this first, so that .html.pl is Polish html, not Perl ("\\.s?html?\\(\\.[a-zA-Z_]+\\)?\\'" . html-mode) ("\\.te?xt\\'" . text-mode) ("\\.[tT]e[xX]\\'" . tex-mode) @@ -1762,9 +1762,12 @@ in that case, this function acts as if `enable-local-variables' were t." ("\\.ad[abs]\\'" . ada-mode) ("\\.ad[bs].dg\\'" . ada-mode) ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode) - ("\\.mk\\'" . makefile-gmake-mode) ; Might be any make, give Gnu the host advantage - ("[Mm]akefile\\'" . makefile-mode) ("GNUmakefile\\'" . makefile-gmake-mode) + ,@(if (memq system-type '(berkeley-unix next-mach darwin)) + '(("\\.mk\\'" . makefile-bsdmake-mode) + ("[Mm]akefile\\'" . makefile-bsdmake-mode)) + '(("\\.mk\\'" . makefile-gmake-mode) ; Might be any make, give Gnu the host advantage + ("[Mm]akefile\\'" . makefile-mode))) ("Makeppfile\\'" . makefile-makepp-mode) ("\\.am\\'" . makefile-automake-mode) ;; Less common extensions come here diff --git a/lisp/font-core.el b/lisp/font-core.el index a077ce756c0..056c1b3515b 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el @@ -231,24 +231,20 @@ this function onto `change-major-mode-hook'." ;; hook is run, the major mode is in the process of being changed and we do not ;; know what the final major mode will be. So, `font-lock-change-major-mode' ;; only (a) notes the name of the current buffer, and (b) adds our function -;; `turn-on-font-lock-if-enabled' to the hook variables `find-file-hook' and -;; `post-command-hook' (for buffers that are not visiting files). By the time +;; `turn-on-font-lock-if-enabled' to the hook variables +;; `after-change-major-mode-hook' and `post-command-hook' (for modes +;; that do not yet run `after-change-major-mode-hook'). By the time ;; the functions on the first of these hooks to be run are run, the new major ;; mode is assumed to be in place. This way we get a Font Lock function run ;; when a major mode is turned on, without knowing major modes or their hooks. ;; -;; Naturally this requires that (a) major modes run `kill-all-local-variables', -;; as they are supposed to do, and (b) the major mode is in place after the -;; file is visited or the command that ran `kill-all-local-variables' has -;; finished, whichever the sooner. Arguably, any major mode that does not -;; follow the convension (a) is broken, and I can't think of any reason why (b) -;; would not be met (except `gnudoit' on non-files). However, it is not clean. -;; -;; Probably the cleanest solution is to have each major mode function run some -;; hook, e.g., `major-mode-hook', but maybe implementing that change is -;; impractical. I am personally against making `setq' a macro or be advised, -;; or have a special function such as `set-major-mode', but maybe someone can -;; come up with another solution? +;; Naturally this requires that major modes run `kill-all-local-variables' +;; and `after-change-major-mode-hook', as they are supposed to. For modes +;; that do not run `after-change-major-mode-hook' yet, `post-command-hook' +;; takes care of things if the mode is set directly or indirectly by +;; an interactive command; however, problems can occur if the mode is +;; set by a timer or process: in that case, proper handling of Font Lock mode +;; may be delayed until the next interactive command. ;; User interface. ;; diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 5065553121d..8ef14191a0a 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -563,11 +563,11 @@ is not in a string or comment and not within any bracket-pairs (or else, a place such that any bracket-pairs outside it can be ignored for Emacs syntax analysis and fontification). -If this is nil, the beginning of the buffer is used, which is -always correct but tends to be slow. -This is normally set via `font-lock-defaults'. -This variable is semi-obsolete; we recommend setting -`syntax-begin-function' instead.") +If this is nil, Font Lock uses `syntax-begin-function' to move back +outside of any comment, string, or sexp. This variable is semi-obsolete; +we recommend setting `syntax-begin-function' instead. + +This is normally set via `font-lock-defaults'.") (defvar font-lock-mark-block-function nil "*Non-nil means use this function to mark a block of text. @@ -2054,19 +2054,22 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." ("\\<:\\sw+\\>" 0 font-lock-builtin-face) ;; ELisp and CLisp `&' keywords as types. ("\\&\\sw+\\>" . font-lock-type-face) - ;; Make regexp grouping constructs bold, so they stand out, but only in strings. + ;; Make regexp grouping constructs bold, so they stand out, but only + ;; in strings. ((lambda (bound) - (if (re-search-forward "\\([\\][\\]\\)\\([(|)]\\)\\(\\?:\\)?" bound) + (if (re-search-forward "\\(\\\\\\\\\\)\\([(|)]\\)\\(\\?:\\)?" bound t) (let ((face (get-text-property (1- (point)) 'face))) (if (listp face) (memq 'font-lock-string-face face) (eq 'font-lock-string-face face))))) - (1 font-lock-comment-face prepend) ; Should we introduce a lowlight face for this? - ; Ideally that would retain the color, dimmed 50%. + ;; Should we introduce a lowlight face for this? + ;; Ideally that would retain the color, dimmed. + (1 font-lock-comment-face prepend) (2 'bold prepend) (3 font-lock-type-face prepend t)) - ;; Underline innermost grouping, so that you can more easily see what belongs together. - ;; 2005-05-12: Font-lock can go into an unbreakable endless loop on this -- something's broken. + ;; Underline innermost grouping, so that you can more easily see what + ;; belongs together. 2005-05-12: Font-lock can go into an + ;; unbreakable endless loop on this -- something's broken. ;;("[\\][\\][(]\\(?:\\?:\\)?\\(\\(?:[^\\\"]+\\|[\\]\\(?:[^\\]\\|[\\][^(]\\)\\)+?\\)[\\][\\][)]" ;;1 'underline prepend) ;;; This is too general -- rms. diff --git a/lisp/help.el b/lisp/help.el index 76fc43d63ef..3323c329c97 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -698,8 +698,8 @@ the last key hit are used." (princ " runs the command ") (prin1 defn) (princ "\n which is ") - (describe-function-1 defn)))) - (print-help-return-message)))))))) + (describe-function-1 defn))))) + (print-help-return-message))))))) (defun describe-mode (&optional buffer) diff --git a/lisp/hexl.el b/lisp/hexl.el index 35674e1d10a..db6edfa48c1 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el @@ -926,10 +926,11 @@ Customize the variable `hexl-follow-ascii' to disable this feature." "Activate `hl-line-mode'" (require 'frame) (require 'hl-line) - (set (make-local-variable 'hl-line-range-function) - 'hexl-highlight-line-range) - (set (make-local-variable 'hl-line-face) - 'highlight) + (with-no-warnings + (set (make-local-variable 'hl-line-range-function) + 'hexl-highlight-line-range) + (set (make-local-variable 'hl-line-face) + 'highlight)) (hl-line-mode 1)) (defun hexl-highlight-line-range () diff --git a/lisp/imenu.el b/lisp/imenu.el index 92e00282ea0..0ebdbc4b5f3 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -192,32 +192,9 @@ with name concatenation." (defvar imenu-generic-expression nil "The regex pattern to use for creating a buffer index. -If non-nil this pattern is passed to `imenu--generic-function' -to create a buffer index. - -The value should be an alist with elements that look like this: - (MENU-TITLE REGEXP INDEX) -or like this: - (MENU-TITLE REGEXP INDEX FUNCTION ARGUMENTS...) -with zero or more ARGUMENTS. The former format creates a simple element in -the index alist when it matches; the latter creates a special element -of the form (NAME POSITION-MARKER FUNCTION ARGUMENTS...) -with FUNCTION and ARGUMENTS copied from `imenu-generic-expression'. - -MENU-TITLE is a string used as the title for the submenu or nil if the -entries are not nested. - -REGEXP is a regexp that should match a construct in the buffer that is -to be displayed in the menu; i.e., function or variable definitions, -etc. It contains a substring which is the name to appear in the -menu. See the info section on Regexps for more information. - -INDEX points to the substring in REGEXP that contains the name (of the -function, variable or type) that is to appear in the menu. - -The variable `imenu-case-fold-search' determines whether or not the -regexp matches are case sensitive, and `imenu-syntax-alist' can be -used to alter the syntax table for the search. +If non-nil this pattern is passed to `imenu--generic-function' to +create a buffer index. Look there for the documentation of this +pattern's structure. For example, see the value of `fortran-imenu-generic-expression' used by `fortran-mode' with `imenu-syntax-alist' set locally to give the @@ -750,21 +727,33 @@ for modes which use `imenu--generic-function'. If it is not set, but "Return an index of the current buffer as an alist. PATTERNS is an alist with elements that look like this: - (MENU-TITLE REGEXP INDEX). + (MENU-TITLE REGEXP INDEX) or like this: (MENU-TITLE REGEXP INDEX FUNCTION ARGUMENTS...) -with zero or more ARGUMENTS. - -MENU-TITLE is a string used as the title for the submenu or nil if the -entries are not nested. +with zero or more ARGUMENTS. The former format creates a simple +element in the index alist when it matches; the latter creates a +special element of the form (NAME POSITION-MARKER FUNCTION +ARGUMENTS...) with FUNCTION and ARGUMENTS copied from +`imenu-generic-expression'. + +MENU-TITLE is a string used as the title for the submenu or nil +if the entries are not nested. + +REGEXP is a regexp that should match a construct in the buffer +that is to be displayed in the menu; i.e., function or variable +definitions, etc. It contains a substring which is the name to +appear in the menu. See the info section on Regexps for more +information. REGEXP may also be a function, called without +arguments. It is expected to search backwards. It shall return +true and set `match-data' iff it finds another element. + +INDEX points to the substring in REGEXP that contains the +name (of the function, variable or type) that is to appear in the +menu. -REGEXP is a regexp that should match a construct in the buffer that is -to be displayed in the menu; i.e., function or variable definitions, -etc. It contains a substring which is the name to appear in the -menu. See the info section on Regexps for more information. - -INDEX points to the substring in REGEXP that contains the name (of the -function, variable or type) that is to appear in the menu. +The variable `imenu-case-fold-search' determines whether or not the +regexp matches are case sensitive, and `imenu-syntax-alist' can be +used to alter the syntax table for the search. See `lisp-imenu-generic-expression' for an example of PATTERNS. @@ -811,7 +800,9 @@ depending on PATTERNS." start beg) ;; Go backwards for convenience of adding items in order. (goto-char (point-max)) - (while (and (re-search-backward regexp nil t) + (while (and (if (functionp regexp) + (funcall regexp) + (re-search-backward regexp nil t)) ;; Exit the loop if we get an empty match, ;; because it means a bad regexp was specified. (not (= (match-beginning 0) (match-end 0)))) diff --git a/lisp/language/viet-util.el b/lisp/language/viet-util.el index c854238b6a4..0b552a61fe5 100644 --- a/lisp/language/viet-util.el +++ b/lisp/language/viet-util.el @@ -41,6 +41,8 @@ ;;; Code: +(defvar viet-viscii-nonascii-translation-table) + ;;;###autoload (defun viet-encode-viscii-char (char) "Return VISCII character code of CHAR if appropriate." diff --git a/lisp/log-edit.el b/lisp/log-edit.el index 1fa48b65aee..09116e0584f 100644 --- a/lisp/log-edit.el +++ b/lisp/log-edit.el @@ -607,8 +607,12 @@ where LOGBUFFER is the name of the ChangeLog buffer, and each (search-forward pattern nil t)))) (setq pattern (file-name-nondirectory file))) + (setq pattern (concat "\\(^\\|[^[:alnum:]]\\)" + pattern + "\\($\\|[^[:alnum:]]\\)")) + (let (texts) - (while (search-forward pattern nil t) + (while (re-search-forward pattern nil t) (let ((entry (log-edit-changelog-entry))) (push entry texts) (goto-char (elt entry 1)))) @@ -646,5 +650,5 @@ Sort REGIONS front-to-back first." (provide 'log-edit) -;;; arch-tag: 8089b39c-983b-4e83-93cd-ed0a64c7fdcc +;; arch-tag: 8089b39c-983b-4e83-93cd-ed0a64c7fdcc ;;; log-edit.el ends here diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el index 88f166707c3..d4c5c2c3261 100644 --- a/lisp/mail/mailalias.el +++ b/lisp/mail/mailalias.el @@ -435,7 +435,7 @@ PATTERN is the string we want to complete." (if mail-passwd-command (call-process shell-file-name nil t nil shell-command-switch mail-passwd-command)) - (beginning-of-buffer) + (goto-char (point-min)) (setq mail-local-names nil) (while (not (eobp)) ;;Recognize lines like diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 858eeff40bf..3fa8b3df3cd 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -3444,7 +3444,11 @@ use \\[mail-yank-original] to yank the original message into it." ;; I don't know whether there are other mailers that still ;; need the names to be stripped. ;;; (mail-strip-quoted-names reply-to) - reply-to + ;; Remove unwanted names from reply-to, since Mail-Followup-To + ;; header causes all the names in it to wind up in reply-to, not + ;; in cc. But if what's left is an empty list, use the original. + (let* ((reply-to-list (rmail-dont-reply-to reply-to))) + (if (string= reply-to-list "") reply-to reply-to-list)) subject (rmail-make-in-reply-to-field from date message-id) (if just-sender diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 5667aa85ff1..73f99263da2 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -810,7 +810,8 @@ the user from the mailer." '(lambda (e) (unless (member e l) (push e l))) - (split-string new-header-values ", +" t)) + (split-string new-header-values + ",[[:space:]]+" t)) (mapconcat 'identity l ", ")) "\n")) ;; Add Mail-Reply-To if none yet diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 3cf17f8968d..931e1417a2d 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -396,7 +396,7 @@ This is relative to `smtpmail-queue-dir'.") ;;; mail, send it, etc... (let ((file-msg "")) (insert-file-contents smtpmail-queue-index) - (beginning-of-buffer) + (goto-char (point-min)) (while (not (eobp)) (setq file-msg (buffer-substring (point) (line-end-position))) (load file-msg) @@ -465,11 +465,14 @@ This is relative to `smtpmail-queue-dir'.") (push el2 result))) (nreverse result))) +(defvar starttls-extra-args) +(defvar starttls-extra-arguments) + (defun smtpmail-open-stream (process-buffer host port) (let ((cred (smtpmail-find-credentials smtpmail-starttls-credentials host port))) (if (null (and cred (condition-case () - (progn + (with-no-warnings (require 'starttls) (call-process (if starttls-use-gnutls starttls-gnutls-program diff --git a/lisp/net/rcompile.el b/lisp/net/rcompile.el index c9078ac2d76..6928b2f4943 100644 --- a/lisp/net/rcompile.el +++ b/lisp/net/rcompile.el @@ -168,7 +168,7 @@ See \\[compile]." compile-command))) (setq remote-compile-host host) (save-some-buffers nil nil) - (compile-internal compile-command "No more errors") + (compilation-start compile-command) ;; Set comint-file-name-prefix in the compilation buffer so ;; compilation-parse-errors will find referenced files by ange-ftp. (with-current-buffer compilation-last-buffer diff --git a/lisp/progmodes/cc-align.el b/lisp/progmodes/cc-align.el index c5dd091f291..139bfc8aa5a 100644 --- a/lisp/progmodes/cc-align.el +++ b/lisp/progmodes/cc-align.el @@ -24,9 +24,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -175,7 +175,8 @@ Works with: arglist-cont, arglist-cont-nonempty." (let ((open-paren (elt c-syntactic-element 2)) (paren-state (c-parse-state))) (while (not (eq (car paren-state) open-paren)) - (goto-char (car paren-state)) + (unless (consp (car paren-state)) ;; ignore matched braces + (goto-char (car paren-state))) (setq paren-state (cdr paren-state))))) (let ((start (point)) c) @@ -1171,6 +1172,7 @@ Otherwise, no determination is made." ;;(/= (point-max) ;; (save-excursion (skip-syntax-forward " ") (point)) (zerop (forward-line 1)) + (bolp) ; forward-line has funny behavior at eob. (not (looking-at "^[ \t]*$"))) 'stop nil))) diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index dbcfa9d991e..419803a7ada 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el @@ -2,7 +2,7 @@ ;; Copyright (C) 1988,94,96,2000,01,02,03 Free Software Foundation, Inc. -;; Author: Alan Mackenzie (originally based on awk-mode.el) +;; Author: Alan Mackenzie <acm@muc.de> (originally based on awk-mode.el) ;; Maintainer: FSF ;; Keywords: AWK, cc-mode, unix, languages @@ -526,13 +526,22 @@ ;; Matches any AWK regexp character which doesn't require special analysis. (defconst c-awk-escaped-newlines*-re "\\(\\\\[\n\r]\\)*") ;; Matches a (possibly empty) sequence of escaped newlines. + +;; NOTE: In what follows, "[asdf]" in a regexp will be called a "character +;; list", and "[:alpha:]" inside a character list will be known as a +;; "character class". These terms for these things vary between regexp +;; descriptions . (defconst c-awk-regexp-char-class-re + "\\[:[a-z]+:\\]") + ;; Matches a character class spec (e.g. [:alpha:]). +(defconst c-awk-regexp-char-list-re (concat "\\[" c-awk-escaped-newlines*-re "^?" c-awk-escaped-newlines*-re "]?" - "\\(" c-awk-esc-pair-re "\\|" "[^]\n\r]" "\\)*" "\\(]\\|$\\)")) -;; Matches a regexp char class, up to (but not including) EOL if the ] is + "\\(" c-awk-esc-pair-re "\\|" c-awk-regexp-char-class-re + "\\|" "[^]\n\r]" "\\)*" "\\(]\\|$\\)")) +;; Matches a regexp char list, up to (but not including) EOL if the ] is ;; missing. (defconst c-awk-regexp-innards-re - (concat "\\(" c-awk-esc-pair-re "\\|" c-awk-regexp-char-class-re + (concat "\\(" c-awk-esc-pair-re "\\|" c-awk-regexp-char-list-re "\\|" c-awk-regexp-normal-re "\\)*")) ;; Matches the inside of an AWK regexp (i.e. without the enclosing /s) (defconst c-awk-regexp-without-end-re @@ -549,7 +558,7 @@ ;; A "neutral" char(pair). Doesn't change the "state" of a subsequent /. ;; This is space/tab, braces, an auto-increment/decrement operator or an ;; escaped character. Or one of the (illegal) characters @ or `. But NOT an -;; end of line (even if escpaed). +;; end of line (even if escaped). (defconst c-awk-neutrals*-re (concat "\\(" c-awk-neutral-re "\\)*")) ;; A (possibly empty) string of neutral characters (or character pairs). diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 806fbade693..7be8e370f07 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -2441,7 +2441,8 @@ command to conveniently insert and align the necessary backslashes." (delete-region (point) end) (indent-to column 1))) - (= (forward-line 1) 0)))) + (zerop (forward-line 1))) + (bolp))) ; forward-line has funny behavior at eob. ;; Make sure there are backslashes with at least one space in ;; front of them. @@ -2466,7 +2467,8 @@ command to conveniently insert and align the necessary backslashes." (insert ?\\) (insert ?\ ?\\))) - (= (forward-line 1) 0))))))) + (zerop (forward-line 1))) + (bolp)))))) ; forward-line has funny behavior at eob. (defun c-delete-backslashes-forward (to-mark point-pos) ;; This function does not do any hidden buffer changes. @@ -2481,7 +2483,8 @@ command to conveniently insert and align the necessary backslashes." (skip-chars-backward " \t" (if (>= (point) point-pos) point-pos)) (point)))) - (= (forward-line 1) 0))))) + (zerop (forward-line 1))) + (bolp)))) ; forward-line has funny behavior at eob. diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 64f3a72f56f..d9caca90666 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -104,7 +104,7 @@ ;;; Variables also used at compile time. -(defconst c-version "5.30.9" +(defconst c-version "5.30.10" "CC Mode version number.") (defconst c-version-sym (intern c-version)) diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 0a4cb6c8cd6..e9ed474e792 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -24,9 +24,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -3198,6 +3198,7 @@ This function does not do any hidden buffer changes." ;; when font-lock refontifies the current line only. (when (save-excursion (and (= (forward-line 1) 0) + (bolp) ; forward-line has funny behavior at eob. (or (< (c-point 'eol) cfd-limit) (progn (backward-char) (not (eq (char-before) ?\\)))))) @@ -4551,7 +4552,7 @@ brace." ;; operator token preceded by "operator". (save-excursion (and (c-safe (c-backward-sexp) t) - (looking-at "operator\\([^_]\\|$\\)"))) + (looking-at "operator\\>\\([^_]\\|$\\)"))) (and (eq (char-before) ?<) (c-with-syntax-table c++-template-syntax-table (if (c-safe (goto-char (c-up-list-forward (point)))) @@ -6104,7 +6105,12 @@ This function does not do any hidden buffer changes." ;; Note: We use the fact that lim is always after any ;; preceding brace sexp. (while (and (zerop (c-backward-token-2 1 t lim)) - (not (looking-at "[;<,=]")))) + (or (not (looking-at "[;<,=]")) + (and c-overloadable-operators-regexp + (looking-at c-overloadable-operators-regexp) + (save-excursion + (c-backward-token-2 1 nil lim) + (looking-at "operator\\>[^_]")))))) (or (memq (char-after) '(?, ?=)) (and (c-major-mode-is 'c++-mode) (zerop (c-backward-token-2 1 nil lim)) @@ -6237,7 +6243,15 @@ This function does not do any hidden buffer changes." ;; CASE 5I: ObjC method definition. ((and c-opt-method-key (looking-at c-opt-method-key)) - (c-beginning-of-statement-1 lim) + (c-beginning-of-statement-1 nil t) + (if (= (point) indent-point) + ;; Handle the case when it's the first (non-comment) + ;; thing in the buffer. Can't look for a 'same return + ;; value from cbos1 since ObjC directives currently + ;; aren't recognized fully, so that we get 'same + ;; instead of 'previous if it moved over a preceding + ;; directive. + (goto-char (point-min))) (c-add-syntax 'objc-method-intro (c-point 'boi))) ;; CASE 5P: AWK pattern or function or continuation ;; thereof. @@ -6316,11 +6330,13 @@ This function does not do any hidden buffer changes." ;; CASE 5K: we are at an ObjC method definition ;; continuation line. ((and c-opt-method-key - (progn + (save-excursion + (goto-char indent-point) (c-beginning-of-statement-1 lim) (beginning-of-line) - (looking-at c-opt-method-key))) - (c-add-syntax 'objc-method-args-cont (point))) + (when (looking-at c-opt-method-key) + (setq placeholder (point))))) + (c-add-syntax 'objc-method-args-cont placeholder)) ;; CASE 5L: we are at the first argument of a template ;; arglist that begins on the previous line. ((eq (char-before) ?<) diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 26c0bdaf60f..29946dc4682 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -875,7 +875,7 @@ casts and declarations are fontified. Used on level 2 and higher." ;; with array initializers. Otherwise stop at braces ;; to avoid going past full function and class blocks. (and (if (and (eq got-init ?=) - (= (c-forward-token-2) 0) + (= (c-forward-token-2 1 nil limit) 0) (looking-at "{")) (c-safe (c-forward-sexp) t) t) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 6a36f89c8d3..94d58c66061 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -1186,7 +1186,7 @@ will be handled." (c-lang-defvar c-brace-list-key (c-lang-const c-brace-list-key)) (c-lang-defconst c-other-block-decl-kwds - "Keywords where the following block (if any) contain another + "Keywords where the following block (if any) contains another declaration level that should not be considered a class. If any of these also are on `c-type-list-kwds', `c-ref-list-kwds', diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index eaa798217cf..0f17a003ef4 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -24,9 +24,9 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -91,10 +91,12 @@ (cc-require 'cc-align) (cc-require 'cc-menus) -;; SILENCE the compiler. +;; Silence the compiler. (cc-bytecomp-defvar comment-line-break-function) ; (X)Emacs 20+ (cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs 20+ (cc-bytecomp-defun set-keymap-parents) ; XEmacs +(cc-bytecomp-defun run-mode-hooks) ; Emacs 21.1+ +(cc-bytecomp-obsolete-fun make-local-hook) ; Marked obsolete in Emacs 21.1. ;; We set these variables during mode init, yet we don't require ;; font-lock. @@ -201,12 +203,15 @@ control). See \"cc-mode.el\" for more info." (defun c-make-inherited-keymap () (let ((map (make-sparse-keymap))) + ;; Necessary to use `cc-bytecomp-fboundp' below since this + ;; function is called from top-level forms that are evaluated + ;; while cc-bytecomp is active when one does M-x eval-buffer. (cond ;; XEmacs - ((fboundp 'set-keymap-parents) + ((cc-bytecomp-fboundp 'set-keymap-parents) (set-keymap-parents map c-mode-base-map)) ;; Emacs - ((fboundp 'set-keymap-parent) + ((cc-bytecomp-fboundp 'set-keymap-parent) (set-keymap-parent map c-mode-base-map)) ;; incompatible (t (error "CC Mode is incompatible with this version of Emacs"))) @@ -587,6 +592,13 @@ Note that the style variables are always made local to the buffer." (add-hook 'hack-local-variables-hook 'c-postprocess-file-styles) +(defmacro c-run-mode-hooks (&rest hooks) + ;; Emacs 21.1 has introduced a system with delayed mode hooks that + ;; require the use of the new function `run-mode-hooks'. + (if (cc-bytecomp-fboundp 'run-mode-hooks) + `(run-mode-hooks ,@hooks) + `(progn ,@(mapcar (lambda (hook) `(run-hooks ,hook)) hooks)))) + ;; Support for C @@ -667,7 +679,7 @@ Key bindings: (c-common-init 'c-mode) (easy-menu-add c-c-menu) (cc-imenu-init cc-imenu-c-generic-expression) - (run-mode-hooks 'c-mode-common-hook 'c-mode-hook) + (c-run-mode-hooks 'c-mode-common-hook 'c-mode-hook) (c-update-modeline)) @@ -730,7 +742,7 @@ Key bindings: (c-common-init 'c++-mode) (easy-menu-add c-c++-menu) (cc-imenu-init cc-imenu-c++-generic-expression) - (run-mode-hooks 'c-mode-common-hook 'c++-mode-hook) + (c-run-mode-hooks 'c-mode-common-hook 'c++-mode-hook) (c-update-modeline)) @@ -794,7 +806,7 @@ Key bindings: (c-common-init 'objc-mode) (easy-menu-add c-objc-menu) (cc-imenu-init nil 'cc-imenu-objc-function) - (run-mode-hooks 'c-mode-common-hook 'objc-mode-hook) + (c-run-mode-hooks 'c-mode-common-hook 'objc-mode-hook) (c-update-modeline)) @@ -864,7 +876,7 @@ Key bindings: (c-common-init 'java-mode) (easy-menu-add c-java-menu) (cc-imenu-init cc-imenu-java-generic-expression) - (run-mode-hooks 'c-mode-common-hook 'java-mode-hook) + (c-run-mode-hooks 'c-mode-common-hook 'java-mode-hook) (c-update-modeline)) @@ -922,7 +934,7 @@ Key bindings: (c-common-init 'idl-mode) (easy-menu-add c-idl-menu) ;;(cc-imenu-init cc-imenu-idl-generic-expression) ;TODO - (run-mode-hooks 'c-mode-common-hook 'idl-mode-hook) + (c-run-mode-hooks 'c-mode-common-hook 'idl-mode-hook) (c-update-modeline)) @@ -984,7 +996,7 @@ Key bindings: (c-common-init 'pike-mode) (easy-menu-add c-pike-menu) ;;(cc-imenu-init cc-imenu-pike-generic-expression) ;TODO - (run-mode-hooks 'c-mode-common-hook 'pike-mode-hook) + (c-run-mode-hooks 'c-mode-common-hook 'pike-mode-hook) (c-update-modeline)) @@ -1076,7 +1088,7 @@ Key bindings: ;; in cc-engine.el, just before (defun c-fast-in-literal ... (defalias 'c-in-literal 'c-slow-in-literal) - (run-mode-hooks 'c-mode-common-hook 'awk-mode-hook) + (c-run-mode-hooks 'c-mode-common-hook 'awk-mode-hook) (c-update-modeline)) ) ;; closes the (if (not (memq 'syntax-properties c-emacs-features)) diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 1a26e54bf06..14f988feb03 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -48,6 +48,7 @@ ;; Silence the compiler. (cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs +(cc-bytecomp-obsolete-fun make-local-hook) ; Marked obsolete in Emacs 21.1. (defvar c-style-alist diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 436bc04d044..4abd8123e6a 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -342,10 +342,19 @@ Affects: `cperl-font-lock', `cperl-electric-lbrace-space', :type 'integer :group 'cperl-indentation-details) -(defcustom cperl-vc-header-alist '((SCCS "($sccs) = ('%W\%' =~ /(\\d+(\\.\\d+)+)/) ;") - (RCS "($rcs) = (' $Id\$ ' =~ /(\\d+(\\.\\d+)+)/) ;")) - "*What to use as `vc-header-alist' in CPerl." - :type '(repeat (list symbol string)) +(defvar cperl-vc-header-alist nil) +(make-obsolete-variable + 'cperl-vc-header-alist + "use cperl-vc-rcs-header or cperl-vc-sccs-header instead.") + +(defcustom cperl-vc-sccs-header '("($sccs) = ('%W\%' =~ /(\\d+(\\.\\d+)+)/) ;") + "*Special version of `vc-sccs-header' that is used in CPerl mode buffers." + :type '(repeat string) + :group 'cperl) + +(defcustom cperl-vc-rcs-header '("($rcs) = (' $Id\$ ' =~ /(\\d+(\\.\\d+)+)/) ;") + "*Special version of `vc-rcs-header' that is used in CPerl mode buffers." + :type '(repeat string) :group 'cperl) (defcustom cperl-clobber-mode-lists @@ -1485,8 +1494,10 @@ or as help on variables `cperl-tips', `cperl-problems', (function cperl-imenu--create-perl-index)) (make-local-variable 'imenu-sort-function) (setq imenu-sort-function nil) - (make-local-variable 'vc-header-alist) - (set 'vc-header-alist cperl-vc-header-alist) ; Avoid warning + (make-local-variable 'vc-rcs-header) + (set 'vc-rcs-header cperl-vc-rcs-header) + (make-local-variable 'vc-sccs-header) + (set 'vc-sccs-header cperl-vc-sccs-header) (make-local-variable 'font-lock-defaults) (setq font-lock-defaults (cond diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 32ede0e1474..b119b03f0bf 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1858,7 +1858,8 @@ directory specification." (error "File %s not in current tags tables" file))))) (with-current-buffer "*Tags List*" (require 'apropos) - (apropos-mode) + (with-no-warnings + (apropos-mode)) (setq buffer-read-only t))) ;;;###autoload diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 5463ee3ffa9..28a6aae2435 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -47,7 +47,8 @@ (defsubst flymake-makehash (&optional test) (if (fboundp 'make-hash-table) (if test (make-hash-table :test test) (make-hash-table)) - (makehash test))) + (with-no-warnings + (makehash test)))) (defalias 'flymake-float-time (if (fboundp 'float-time) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index ba0266de574..1a26b64beca 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -698,6 +698,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'." (define-key map "\C-c\C-z" 'gdb-inferior-io-stop) (define-key map "\C-c\C-\\" 'gdb-inferior-io-quit) (define-key map "\C-c\C-d" 'gdb-inferior-io-eof) + (define-key map "\C-d" 'gdb-inferior-io-eof) map)) (define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O" @@ -953,7 +954,7 @@ function is used to change the focus of GUD tooltips to #define directives." (setq gdb-active-process nil) (gdb-stopping ignored)) - + (defun gdb-frame-begin (ignored) (let ((sink gdb-output-sink)) (cond @@ -1303,7 +1304,8 @@ static char *magick[] = { (looking-at "\\(\\S-+\\):\\([0-9]+\\)") (let ((line (match-string 2)) (buffer-read-only nil) (file (match-string 1))) - (add-text-properties (point-at-bol) (point-at-eol) + (add-text-properties (line-beginning-position) + (line-end-position) '(mouse-face highlight help-echo "mouse-2, RET: visit breakpoint")) (unless (file-exists-p file) @@ -1504,13 +1506,13 @@ static char *magick[] = { (let ((buffer-read-only nil)) (goto-char (point-min)) (while (< (point) (point-max)) - (add-text-properties (point-at-bol) (point-at-eol) + (add-text-properties (line-beginning-position) (line-end-position) '(mouse-face highlight help-echo "mouse-2, RET: Select frame")) (beginning-of-line) (when (and (looking-at "^#\\([0-9]+\\)") (equal (match-string 1) gdb-current-stack-level)) - (put-text-property (point-at-bol) (point-at-eol) + (put-text-property (line-beginning-position) (line-end-position) 'face '(:inverse-video t))) (forward-line 1)))))) @@ -1588,7 +1590,7 @@ static char *magick[] = { (let ((buffer-read-only nil)) (goto-char (point-min)) (while (< (point) (point-max)) - (add-text-properties (point-at-bol) (point-at-eol) + (add-text-properties (line-beginning-position) (line-end-position) '(mouse-face highlight help-echo "mouse-2, RET: select thread")) (forward-line 1))))) @@ -1974,14 +1976,14 @@ corresponding to the mode line clicked." (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer))) (with-current-buffer buf (goto-char (point-min)) - (while (re-search-forward "^ .*\n" nil t) + (while (re-search-forward "^[ }].*\n" nil t) (replace-match "" nil nil)) (goto-char (point-min)) - (while (re-search-forward "{[-0-9, {}\]*\n" nil t) - (replace-match "(array);\n" nil nil)) + (while (re-search-forward "{\\(.*=.*\n\\|\n\\)" nil t) + (replace-match "(structure);\n" nil nil)) (goto-char (point-min)) - (while (re-search-forward "{.*=.*\n" nil t) - (replace-match "(structure);\n" nil nil)))) + (while (re-search-forward "\\s-*{.*\n" nil t) + (replace-match " (array);\n" nil nil)))) (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) (and buf (with-current-buffer buf (let ((p (point)) @@ -2316,8 +2318,8 @@ BUFFER nil or omitted means use the current buffer." (delete-overlay overlay)))) (defun gdb-put-breakpoint-icon (enabled bptno) - (let ((start (progn (beginning-of-line) (- (point) 1))) - (end (progn (end-of-line) (+ (point) 1))) + (let ((start (- (line-beginning-position) 1)) + (end (+ (line-end-position) 1)) (putstring (if enabled "B" "b"))) (add-text-properties 0 1 '(help-echo "mouse-1: set/clear bkpt, mouse-3: enable/disable bkpt") diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index 35e4b68c9b8..a118b0055a9 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -3548,7 +3548,7 @@ is non-nil." (let ((pos (point))) (if idlwave-file-header (cond ((car idlwave-file-header) - (insert-file (car idlwave-file-header))) + (insert-file-contents (car idlwave-file-header))) ((stringp (car (cdr idlwave-file-header))) (insert (car (cdr idlwave-file-header)))))) (goto-char pos))) diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 86002768757..05c3ac50787 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -484,7 +484,7 @@ not be enclosed in { } or ( )." ("\\\\\n" 0 "."))) (defvar makefile-imenu-generic-expression - `(("Dependencies" ,makefile-dependency-regex 1) + `(("Dependencies" makefile-previous-dependency 1) ("Macro Assignment" ,makefile-macroassign-regex 1)) "Imenu generic expression for Makefile mode. See `imenu-generic-expression'.") @@ -854,7 +854,10 @@ Makefile mode can be configured by modifying the following variables: "^\t[ \t]*\\(\\(?:\\(?:noecho\\|ignore[-_]error\\|[-@]+\\)[ \t]*\\)*\\)\\(\\(&\\S +\\)?\\(?:.+\\\\\n\\)*.+\\)") (setq font-lock-defaults - `(makefile-makepp-font-lock-keywords ,@(cdr font-lock-defaults)))) + `(makefile-makepp-font-lock-keywords ,@(cdr font-lock-defaults)) + imenu-generic-expression + `(("Functions" "^[ \t]*\\(?:make\\)?sub[ \t]+\\([A-Za-z0-9_]+\\)" 1) + ,@imenu-generic-expression))) ;;;###autoload (define-derived-mode makefile-bsdmake-mode makefile-mode "BSDmakefile" @@ -866,10 +869,7 @@ Makefile mode can be configured by modifying the following variables: (set (make-local-variable 'makefile-rule-action-regex) "^\t[ \t]*\\([-+@]*\\)[ \t]*\\(\\(?:.+\\\\\n\\)*.+\\)") (setq font-lock-defaults - `(makefile-bsdmake-font-lock-keywords ,@(cdr font-lock-defaults)) - imenu-generic-expression - `(("Dependencies" ,makefile-dependency-regex 1) - ,@(cdr imenu-generic-expression)))) + `(makefile-bsdmake-font-lock-keywords ,@(cdr font-lock-defaults)))) @@ -1682,7 +1682,7 @@ matched in a rule action." (catch 'found (let ((pt (point))) (while (progn (skip-chars-forward makefile-dependency-skip bound) - (not (eobp))) + (< (point) (or bound (point-max)))) (forward-char) (or (eq (char-after) ?=) (get-text-property (1- (point)) 'face) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 0173c419b5d..87915933862 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1389,7 +1389,7 @@ with your script for an edit-interpret-debug cycle." (cond ((looking-at "#![ \t]?\\([^ \t\n]*/bin/env[ \t]\\)?\\([^ \t\n]+\\)") (match-string 2)) ((and buffer-file-name - (string-match "\\.m?spec$" buffer-file-name)) + (string-match "\\.m?spec\\'" buffer-file-name)) "rpm"))))) (sh-set-shell (or interpreter sh-shell-file) nil nil)) (run-hooks 'sh-mode-hook)) @@ -2290,7 +2290,7 @@ we go to the end of the previous line and do not check for continuations." (if (looking-at "[\"'`]") (sh-safe-forward-sexp) ;; (> (skip-chars-forward "^ \t\n\"'`") 0) - (> (skip-chars-forward "-_a-zA-Z\$0-9") 0) + (> (skip-chars-forward "-_a-zA-Z$0-9") 0) )) (buffer-substring start (point)) )) diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 12f04895f98..f840ef356d9 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el @@ -12364,8 +12364,8 @@ File statistics: \"%s\"\n\ (save-match-data (goto-char (match-end 1)) ;; move to next item - (if (looking-at "\\(\\s-*,\\)") - (goto-char (match-end 1)) + (if (looking-at "\\s-*,") + (goto-char (match-end 0)) (end-of-line) t)))) (error t))) @@ -12736,7 +12736,7 @@ This does background highlighting of translate-off regions.") '(font-lock-syntactic-keywords . vhdl-font-lock-syntactic-keywords))) (when (fboundp 'font-lock-unset-defaults) (font-lock-unset-defaults)) ; not implemented in XEmacs - (font-lock-set-defaults) + (font-lock-set-defaults) ;What for? --Stef (font-lock-mode nil) (font-lock-mode t)) diff --git a/lisp/ruler-mode.el b/lisp/ruler-mode.el index e4e52bbd746..b0f1dcf6e03 100644 --- a/lisp/ruler-mode.el +++ b/lisp/ruler-mode.el @@ -696,6 +696,9 @@ Optional argument PROPS specifies other text properties to apply." (put-text-property i (1+ i) 'face 'ruler-mode-goal-column-face ruler) + (put-text-property + i (1+ i) 'mouse-face 'mode-line-highlight + ruler) (put-text-property i (1+ i) 'help-echo ruler-mode-goal-column-help-echo ruler)) @@ -705,6 +708,9 @@ Optional argument PROPS specifies other text properties to apply." (put-text-property i (1+ i) 'face 'ruler-mode-comment-column-face ruler) + (put-text-property + i (1+ i) 'mouse-face 'mode-line-highlight + ruler) (put-text-property i (1+ i) 'help-echo ruler-mode-comment-column-help-echo ruler)) @@ -714,6 +720,9 @@ Optional argument PROPS specifies other text properties to apply." (put-text-property i (1+ i) 'face 'ruler-mode-fill-column-face ruler) + (put-text-property + i (1+ i) 'mouse-face 'mode-line-highlight + ruler) (put-text-property i (1+ i) 'help-echo ruler-mode-fill-column-help-echo ruler)) diff --git a/lisp/simple.el b/lisp/simple.el index b8c5e20b750..240896b5eef 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2568,7 +2568,11 @@ With argument N, insert the Nth previous kill. If N is negative, this is a more recent kill. The sequence of kills wraps around, so that after the oldest one -comes the newest one." +comes the newest one. + +When this command inserts killed text into the buffer, it honors +`yank-excluded-properties' and `yank-handler' as described in the +doc string for `insert-for-yank-1', which see." (interactive "*p") (if (not (eq last-command 'yank)) (error "Previous command was not a yank")) @@ -2600,6 +2604,11 @@ killed OR yanked. Put point at end, and set mark at beginning. With just \\[universal-argument] as argument, same but put point at beginning (and mark at end). With argument N, reinsert the Nth most recently killed stretch of killed text. + +When this command inserts killed text into the buffer, it honors +`yank-excluded-properties' and `yank-handler' as described in the +doc string for `insert-for-yank-1', which see. + See also the command \\[yank-pop]." (interactive "*P") (setq yank-window-start (window-start)) diff --git a/lisp/startup.el b/lisp/startup.el index 96213f2924e..bfe455600ae 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -368,11 +368,17 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." ;; of that dir into load-path, ;; Look for a leim-list.el file too. Loading it will register ;; available input methods. - (dolist (dir load-path) - (let ((default-directory dir)) - (load (expand-file-name "subdirs.el") t t t)) - (let ((default-directory dir)) - (load (expand-file-name "leim-list.el") t t t))) + (let ((tail load-path) dir) + (while tail + (setq dir (car tail)) + (let ((default-directory dir)) + (load (expand-file-name "subdirs.el") t t t)) + (let ((default-directory dir)) + (load (expand-file-name "leim-list.el") t t t)) + ;; We don't use a dolist loop and we put this "setq-cdr" command at + ;; the end, because the subdirs.el files may add elements to the end + ;; of load-path and we want to take it into account. + (setq tail (cdr tail)))) (unless (eq system-type 'vax-vms) ;; If the PWD environment variable isn't accurate, delete it. (let ((pwd (getenv "PWD"))) diff --git a/lisp/subr.el b/lisp/subr.el index d91642c5cbe..f284c18ce5e 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -784,6 +784,12 @@ is converted into a string by expressing it in decimal." baud-rate) (make-obsolete 'baud-rate "use the `baud-rate' variable instead." "before 19.15") +;; These are used by VM and some old programs +(defalias 'focus-frame 'ignore "") +(make-obsolete 'focus-frame "it does nothing." "22.1") +(defalias 'unfocus-frame 'ignore "") +(make-obsolete 'unfocus-frame "it does nothing." "22.1") + ;;;; Obsolescence declarations for variables, and aliases. @@ -1452,10 +1458,6 @@ BEG and END default respectively to the beginning and end of buffer." ;;;; Miscellanea. -;; A number of major modes set this locally. -;; Give it a global value to avoid compiler warnings. -(defvar font-lock-defaults nil) - (defvar suspend-hook nil "Normal hook run by `suspend-emacs', before suspending.") diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el index 1b3585d56a9..bd81f97138c 100644 --- a/lisp/textmodes/org.el +++ b/lisp/textmodes/org.el @@ -5,7 +5,7 @@ ;; Author: Carsten Dominik <dominik at science dot uva dot nl> ;; Keywords: outlines, hypermedia, calendar ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ -;; Version: 3.08 +;; Version: 3.09 ;; ;; This file is part of GNU Emacs. ;; @@ -31,27 +31,30 @@ ;; project planning with a fast and effective plain-text system. ;; ;; Org-mode develops organizational tasks around a NOTES file that contains -;; information about projects as plain text. Org-mode is implemented on -;; top of outline-mode - ideal to keep the content of large files well -;; structured. It supports ToDo items, deadlines and time stamps, which -;; magically appear in the diary listing of the Emacs calendar. Tables are -;; easily created with a built-in table editor. Plain text URL-like links -;; connect to websites, emails (VM,RMAIL,WANDERLUST), Usenet messages (Gnus), -;; BBDB entries, and any files related to the projects. For printing and -;; sharing of notes, an Org-mode file (or a part of it) can be exported as -;; a structured ASCII file, or as HTML. +;; information about projects as plain text. Org-mode is implemented on top +;; of outline-mode - ideal to keep the content of large files well structured. +;; It supports ToDo items, deadlines and time stamps, which can be extracted +;; to create a daily/weekly agenda that also integrates the diary of the Emacs +;; calendar. Tables are easily created with a built-in table editor. Plain +;; text URL-like links connect to websites, emails (VM, RMAIL, WANDERLUST), +;; Usenet messages (Gnus), BBDB entries, and any files related to the +;; projects. For printing and sharing of notes, an Org-mode file (or a part +;; of it) can be exported as a structured ASCII file, or as HTML. ;; ;; Installation ;; ------------ -;; The instruction below assume that you have downloaded Org-mode from the -;; web. If Org-mode is part of the Emacs distribution or an XEmacs package, -;; you only need to add to .emacs the last three lines of Lisp code listed -;; below, i.e. the `auto-mode-alist' modification and the global key bindings. +;; If Org-mode is part of the Emacs distribution or an XEmacs package, you +;; only need to copy the following lines to your .emacs file. The last two +;; lines define *global* keys for the commands `org-store-link' and +;; `org-agenda' - please choose suitable keys yourself. ;; -;; Byte-compile org.el and put it on your load path. Then copy the -;; following lines into .emacs. The last two lines define *global* -;; keys for the commands `org-store-link' and `org-agenda' - please -;; choose suitable keys yourself. +;; (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) +;; (define-key global-map "\C-cl" 'org-store-link) +;; (define-key global-map "\C-ca" 'org-agenda) +;; +;; If you have downloaded Org-mode from the Web, you must byte-compile +;; org.el and put it on your load path. In addition to the Emacs Lisp +;; lines above, you also need to add the following lines to .emacs: ;; ;; (autoload 'org-mode "org" "Org mode" t) ;; (autoload 'org-diary "org" "Diary entries from Org mode") @@ -59,12 +62,9 @@ ;; (autoload 'org-store-link "org" "Store a link to the current location" t) ;; (autoload 'orgtbl-mode "org" "Org tables as a minor mode" t) ;; (autoload 'turn-on-orgtbl "org" "Org tables as a minor mode") -;; (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) -;; (define-key global-map "\C-cl" 'org-store-link) -;; (define-key global-map "\C-ca" 'org-agenda) ;; -;; This will put all files with extension ".org" into Org-mode. As an -;; alternative, make the first line of a file look like this: +;; This setup will put all files with extension ".org" into Org-mode. As +;; an alternative, make the first line of a file look like this: ;; ;; MY PROJECTS -*- mode: org; -*- ;; @@ -73,12 +73,18 @@ ;; ;; Documentation ;; ------------- -;; The documentation of Org-mode can be found in the TeXInfo file. -;; The distribution also contains a PDF version of it. At the homepage -;; of Org-mode, you can read the same text online as HTML. +;; The documentation of Org-mode can be found in the TeXInfo file. The +;; distribution also contains a PDF version of it. At the homepage of +;; Org-mode, you can read the same text online as HTML. There is also an +;; excellent reference card made by Philip Rooke. ;; ;; Changes: ;; ------- +;; Version 3.09 +;; - Time-of-day specifications in agenda are extracted and placed +;; into the prefix. Timed entries can be placed into a time grid for +;; day. +;; ;; Version 3.08 ;; - "|" no longer allowed as part of a link, to allow links in tables. ;; - The prefix of items in the agenda buffer can be configured. @@ -136,7 +142,7 @@ ;; warnings about upcoming deadlines/overdue scheduled items. ;; That functionality is now limited to the (multifile) agenda. ;; - When reading a date, the calendar can be manipulated with keys. -;; - Link support for RMAIL and Wanderlust (from planner.el, untested) +;; - Link support for RMAIL and Wanderlust (from planner.el, untested). ;; - Minor bug fixes and documentation improvements. ;;; Code: @@ -148,16 +154,15 @@ ;;; Customization variables -(defvar org-version "3.08" +(defvar org-version "3.09" "The version number of the file org.el.") (defun org-version () (interactive) (message "Org-mode version %s" org-version)) -;; The following two constants are for compatibility with different -;; Emacs versions (Emacs versus XEmacs) and with different versions of -;; outline.el. All the compatibility code in org.el is based on these two -;; constants. +;; The following two constants are for compatibility with different Emacs +;; versions (Emacs versus XEmacs) and with different versions of outline.el. +;; The compatibility code in org.el is based on these two constants. (defconst org-xemacs-p (featurep 'xemacs) "Are we running xemacs?") (defconst org-noutline-p (featurep 'noutline) @@ -570,7 +575,7 @@ the grouped in categories, don't sort the categories, but keep them in the sequence given in `org-agenda-files'. Within each category sort by priority. -Leaving out the `category-keep' would mean that items will be sorted across +Leaving out `category-keep' would mean that items will be sorted across categories by priority." :group 'org-agenda :type '(repeat @@ -583,7 +588,7 @@ categories by priority." (const priority-up) (const priority-down)))) -(defcustom org-agenda-prefix-format " %-12:c% s" +(defcustom org-agenda-prefix-format " %-12:c%?-12t% s" "Format specification for the prefix of items in the agenda buffer. This format works similar to a printf format, with the following meaning: @@ -593,22 +598,39 @@ This format works similar to a printf format, with the following meaning: format HH:MM %s Scheduling/Deadline information, a short string -In addition to the normal printf field modifiers like field width and -padding instructions, in this format you can also add an additional -punctuation or whitespace character just before the final format letter. -This character will be appended to the field value if the value is not -empty. For example, the format \"%-12:c\" leads to \"Diary: \" if -the category is \"Diary\". If the category were be empty, no additional -colon would be interted. - -Including `%t' in the format string leads to a double time specification -because the headline/diary item will contain the time specification as -well. However, using `%t' in the format will result in a canonical 24 -hour time specification at a consistent position in the prefix, while the -time specification in the headline/diary item may be at any position and in -various formats. -Example: - (setq org-agenda-prefix-format \" %-12:c% t% s\")" +All specifiers work basically like the standard `%s' of printf, but may +contain two additional characters: A question mark just after the `%' and +a whitespace/punctuation character just before the final letter. + +If the first character after `%' is a question mark, the entire field +will only be included if the corresponding value applies to the +current entry. This is useful for fields which should have fixed +width when present, but zero width when absent. For example, +\"%?-12t\" will result in a 12 character time field if a time of the +day is specified, but will completely disappear in entries which do +not contain a time. + +If there is punctuation or whitespace character just before the final +format letter, this character will be appended to the field value if +the value is not empty. For example, the format \"%-12:c\" leads to +\"Diary: \" if the category is \"Diary\". If the category were be +empty, no additional colon would be interted. + +The default value of this option is \" %-12:c%?-12t% s\", meaning: +- Indent the line with two space characters +- Give the category in a 12 chars wide field, padded with whitespace on + the right (because of `-'). Append a colon if there is a category + (because of `:'). +- If there is a time-of-day, put it into a 12 chars wide field. If no + time, don't put in an empty field, just skip it (because of '?'). +- Finally, put the scheduling information and append a whitespace. + +As another example, if you don't want the time-of-day of entries in +the prefix, you could use: + + (setq org-agenda-prefix-format \" %-11:c% s\") + +See also the variable `org-agenda-remove-times-when-in-prefix'." :type 'string :group 'org-agenda) @@ -618,13 +640,64 @@ Example: :group 'org-agenda) (defvar org-prefix-format-compiled nil - "The compiled version of `org-???-prefix-format'.") + "The compiled version of the most recently used prefix format. +Depending on which command was used last, this may be the compiled version +of `org-agenda-prefix-format' or `org-timeline-prefix-format'.") + +(defcustom org-agenda-use-time-grid t + "Non-nil means, show a time grid in the agenda schedule. +A time grid is a set of lines for specific times (like every two hours between +8:00 and 20:00. The items scheduled for a day at specific times are +sorted in between these lines. +For deails about when the grid will be shown, and what it will look like, see +the variable `org-agenda-time-grid'." + :group 'org-agenda + :type 'boolean) + +(defcustom org-agenda-time-grid + '((daily today require-timed) + "----------------" + (800 1000 1200 1400 1600 1800 2000)) + + "FIXME: document" + :group 'org-agenda + :type + '(list + (set :greedy t :tag "Grid Display Options" + (const :tag "Show grid in single day agenda display" daily) + (const :tag "Show grid in weekly agenda display" weekly) + (const :tag "Always show grid for today" today) + (const :tag "Show grid only if any timed entries are present" + require-timed) + (const :tag "Skip grid times already present in an entry" + remove-match)) + (string :tag "Grid String") + (repeat :tag "Grid Times" (integer :tag "Time")))) + +(defcustom org-agenda-remove-times-when-in-prefix t + "Non-nil means, remove duplicate time specifications in agenda items. +When the format `org-agenda-prefix-format' contains a `%t' specifier, a +time-of-day specification in a headline or diary entry is extracted and +placed into the prefix. If this option is non-nil, the original specification +\(a timestamp or -range, or just a plain time(range) specification like +11:30-4pm) will be removed for agenda display. This makes the agenda less +cluttered. +The option can be t or nil. It may also be the symbol `beg', indicating +that the time should only be removed what it is located at the beginning of +the headline/diary entry." + :group 'org-agenda + :type '(choice + (const :tag "Always" t) + (const :tag "Never" nil) + (const :tag "When at beginning of entry" beg))) (defcustom org-sort-agenda-notime-is-late t "Non-nil means, items without time are considered late. This is only relevant for sorting. When t, items which have no explicit time like 15:30 will be considered as 24:01, i.e. later than any items which -do have a time. When nil, the default time is before 0:00." +do have a time. When nil, the default time is before 0:00. You can use this +option to decide if the schedule for today should come before or after timeless +agenda entries." :group 'org-agenda :type 'boolean) @@ -1370,6 +1443,14 @@ When this is non-nil, the headline after the keyword is set to the "Face used for tables." :group 'org-faces) +(defface org-time-grid-face ;; font-lock-variable-name-face + '((((type tty) (class color)) (:foreground "yellow" :weight light)) + (((class color) (background light)) (:foreground "DarkGoldenrod")) + (((class color) (background dark)) (:foreground "LightGoldenrod")) + (t (:bold t :italic t))) + "Face used for level 2 headlines." + :group 'org-faces) + (defvar org-level-faces '( org-level-1-face @@ -1496,7 +1577,7 @@ The following commands are available: (save-excursion (goto-char (point-min)) (insert " -*- mode: org -*-\n\n"))) - (run-hooks 'org-mode-hook) ;FIXME: Should be run-mode-hooks. + (run-hooks 'org-mode-hook) (unless org-inhibit-startup (if org-startup-with-deadline-check (call-interactively 'org-check-deadlines) @@ -1565,7 +1646,7 @@ The following commands are available: (save-excursion (org-back-to-heading t) (- (match-end 0) (match-beginning 0)))) - + (defvar org-font-lock-keywords nil) (defun org-set-font-lock-defaults () @@ -2844,13 +2925,17 @@ days in order to avoid rounding problems." (defun org-time-string-to-time (s) (apply 'encode-time (org-parse-time-string s))) -(defun org-parse-time-string (s) +(defun org-parse-time-string (s &optional nodefault) "Parse the standard Org-mode time string. -This should be a lot faster than the normal `parse-time-string'." +This should be a lot faster than the normal `parse-time-string'. +If time is not given, defaults to 0:00. However, with optional NODEFAULT, +hour and minute fields will be nil if not given." (if (string-match org-ts-regexp1 s) (list 0 - (string-to-number (or (match-string 8 s) "0")) - (string-to-number (or (match-string 7 s) "0")) + (if (or (match-beginning 8) (not nodefault)) + (string-to-number (or (match-string 8 s) "0"))) + (if (or (match-beginning 7) (not nodefault)) + (string-to-number (or (match-string 7 s) "0"))) (string-to-number (match-string 4 s)) (string-to-number (match-string 3 s)) (string-to-number (match-string 2 s)) @@ -3056,6 +3141,7 @@ The following commands are available: (define-key org-agenda-mode-map "f" 'org-agenda-follow-mode) (define-key org-agenda-mode-map "d" 'org-agenda-toggle-diary) +(define-key org-agenda-mode-map "g" 'org-agenda-toggle-time-grid) (define-key org-agenda-mode-map "r" 'org-agenda-redo) (define-key org-agenda-mode-map "q" 'org-agenda-quit) (define-key org-agenda-mode-map "x" 'org-agenda-exit) @@ -3115,7 +3201,7 @@ The following commands are available: ["Decrease Priority" org-agenda-priority-down t] ["Show Priority" org-agenda-show-priority t]) "--" - ["Rebuild" org-agenda-redo t] + ["Rebuild buffer" org-agenda-redo t] ["Goto Today" org-agenda-goto-today t] ["Next Dates" org-agenda-later (local-variable-p 'starting-day)] ["Previous Dates" org-agenda-earlier (local-variable-p 'starting-day)] @@ -3124,6 +3210,8 @@ The following commands are available: (local-variable-p 'starting-day)] ["Include Diary" org-agenda-toggle-diary :style toggle :selected org-agenda-include-diary :active t] + ["Use Time Grid" org-agenda-toggle-time-grid + :style toggle :selected org-agenda-use-time-grid :active t] "--" ["New Diary Entry" org-agenda-diary-entry t] ("Calendar Commands" @@ -3294,11 +3382,13 @@ NDAYS defaults to `org-agenda-ndays'." (d (- nt n1))) (- sd (+ (if (< d 0) 7 0) d))))) (day-numbers (list start)) - s e rtn rtnall file date d start-pos end-pos) + (inhibit-redisplay t) + s e rtn rtnall file date d start-pos end-pos todayp nd) (setq org-agenda-redo-command (list 'org-agenda include-all start-day ndays)) ;; Make the list of days - (setq ndays (or ndays org-agenda-ndays)) + (setq ndays (or ndays org-agenda-ndays) + nd ndays) (while (> ndays 1) (push (1+ (car day-numbers)) day-numbers) (setq ndays (1- ndays))) @@ -3324,11 +3414,15 @@ NDAYS defaults to `org-agenda-ndays'." rtn (org-agenda-get-day-entries file date :todo)) (setq rtnall (append rtnall rtn)))) - (if rtnall (insert (org-finalize-agenda-entries rtnall) "\n"))) + (when rtnall + (insert "ALL CURRENTLY OPEN TODO ITEMS:\n") + (add-text-properties (point-min) (1- (point)) + (list 'face 'org-link-face)) + (insert (org-finalize-agenda-entries rtnall) "\n"))) (while (setq d (pop day-numbers)) (setq date (calendar-gregorian-from-absolute d) s (point)) - (if (or (= d today) + (if (or (setq todayp (= d today)) (and (not start-pos) (= d sd))) (setq start-pos (point)) (if (and start-pos (not end-pos)) @@ -3347,14 +3441,18 @@ NDAYS defaults to `org-agenda-ndays'." (setq rtnall (append rtnall rtn)))) (if (or rtnall org-agenda-show-all-dates) (progn - (insert (format "%-9s %2d %-9s %4d\n" + (insert (format "%-9s %2d %s %4d\n" (calendar-day-name date) (extract-calendar-day date) (calendar-month-name (extract-calendar-month date)) (extract-calendar-year date))) (put-text-property s (1- (point)) 'face 'org-link-face) - (if rtnall (insert (org-finalize-agenda-entries rtnall) "\n")) + (if rtnall (insert + (org-finalize-agenda-entries ;; FIXME: condition needed + (org-agenda-add-time-grid-maybe + rtnall nd todayp)) + "\n")) (put-text-property s (1- (point)) 'day d)))) (goto-char (point-min)) (setq buffer-read-only t) @@ -3502,6 +3600,15 @@ With prefix ARG, go back that many times `org-agenda-ndays'." (message "Diary inclusion turned %s" (if org-agenda-include-diary "on" "off"))) +(defun org-agenda-toggle-time-grid () + "Toggle follow mode in an agenda buffer." + (interactive) + (setq org-agenda-use-time-grid (not org-agenda-use-time-grid)) + (org-agenda-redo) + (org-agenda-set-mode-name) + (message "Time-grid turned %s" + (if org-agenda-use-time-grid "on" "off"))) + (defun org-agenda-set-mode-name () "Set the mode name to indicate all the small mode settings." (setq mode-name @@ -3509,7 +3616,8 @@ With prefix ARG, go back that many times `org-agenda-ndays'." (if (equal org-agenda-ndays 1) " Day" "") (if (equal org-agenda-ndays 7) " Week" "") (if org-agenda-follow-mode " Follow" "") - (if org-agenda-include-diary " Diary" ""))) + (if org-agenda-include-diary " Diary" "") + (if org-agenda-use-time-grid " Grid" ""))) (force-mode-line-update)) (defun org-agenda-post-command-hook () @@ -3524,7 +3632,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'." "Get the (Emacs Calendar) diary entries for DATE." (let* ((fancy-diary-buffer "*temporary-fancy-diary-buffer*") (diary-display-hook '(fancy-diary-display)) - (list-diary-entries-hook + (list-diary-entries-hook (cons 'org-diary-default-entry list-diary-entries-hook)) entries (org-disable-diary t)) @@ -3551,7 +3659,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'." (setq entries (mapcar (lambda (x) - (setq x (org-format-agenda-item "" x "Diary")) + (setq x (org-format-agenda-item "" x "Diary" 'time)) ;; Extend the text properties to the beginning of the line (add-text-properties 0 (length x) @@ -3764,7 +3872,7 @@ the documentation of `org-diary'." arg results rtn) (if (not buffer) ;; If file does not exist, make sure an error message ends up in diary - (format "ORG-AGENDA-ERROR: No such org-file %s" file) + (list (format "ORG-AGENDA-ERROR: No such org-file %s" file)) (with-current-buffer buffer (unless (eq major-mode 'org-mode) (error "Agenda file %s is not in `org-mode'" file)) @@ -3796,8 +3904,8 @@ the documentation of `org-diary'." ((and (eq arg :deadline) (equal date (calendar-current-date))) (setq rtn (org-agenda-get-deadlines)) - (setq results (append results rtn)))))))))) - results)) + (setq results (append results rtn)))))))) + results)))) (defun org-entry-is-done-p () "Is the current entry marked DONE?" @@ -3876,7 +3984,7 @@ the documentation of `org-diary'." (list 0 0 0 (nth 1 date) (car date) (nth 2 date)))) 0 11))) marker hdmarker deadlinep scheduledp donep tmp priority - ee txt) + ee txt timestr) (goto-char (point-min)) (while (re-search-forward regexp nil t) (if (not (save-match-data (org-at-date-range-p))) @@ -3886,9 +3994,13 @@ the documentation of `org-diary'." (- (match-beginning 0) org-ds-keyword-length)) (match-beginning 0)) + timestr (buffer-substring (match-beginning 0) (point-at-eol)) deadlinep (string-match org-deadline-regexp tmp) scheduledp (string-match org-scheduled-regexp tmp) donep (org-entry-is-done-p)) + (if (string-match ">" timestr) + ;; substring should only run to end of time stamp + (setq timestr (substring timestr 0 (match-end 0)))) (save-excursion (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t) (progn @@ -3899,7 +4011,7 @@ the documentation of `org-diary'." (format "%s%s" (if deadlinep "Deadline: " "") (if scheduledp "Scheduled: " "")) - (match-string 1)))) + (match-string 1) nil timestr))) (setq txt org-agenda-no-heading-message)) (setq priority (org-get-priority txt)) (add-text-properties @@ -4044,10 +4156,11 @@ the documentation of `org-diary'." (abbreviate-file-name (buffer-file-name))))) (regexp org-tr-regexp) (d0 (calendar-absolute-from-gregorian date)) - marker hdmarker ee txt d1 d2 s1 s2) + marker hdmarker ee txt d1 d2 s1 s2 timestr) (goto-char (point-min)) (while (re-search-forward regexp nil t) - (setq s1 (match-string 1) + (setq timestr (match-string 0) + s1 (match-string 1) s2 (match-string 2) d1 (time-to-days (org-time-string-to-time s1)) d2 (time-to-days (org-time-string-to-time s2))) @@ -4062,9 +4175,9 @@ the documentation of `org-diary'." (goto-char (match-end 1)) (looking-at "\\*+[ \t]*\\([^\r\n]+\\)") (setq txt (org-format-agenda-item - (format "(%d/%d): " + (format (if (= d1 d2) "" "(%d/%d): ") (1+ (- d0 d1)) (1+ (- d2 d1))) - (match-string 1)))) + (match-string 1) nil (if (= d0 d1) timestr)))) (setq txt org-agenda-no-heading-message)) (add-text-properties 0 (length txt) (append (list 'org-marker marker @@ -4077,66 +4190,187 @@ the documentation of `org-diary'." ;; Sort the entries by expiration date. (nreverse ee))) -(defun org-format-agenda-item (prefix txt &optional category) + + +(defconst org-plain-time-of-day-regexp + (concat + "\\(\\<[012]?[0-9]" + "\\(\\(:\\([0-5][0-9]\\([AaPp][Mm]\\)?\\)\\)\\|\\([AaPp][Mm]\\)\\)\\>\\)" + "\\(--?" + "\\(\\<[012]?[0-9]" + "\\(\\(:\\([0-5][0-9]\\([AaPp][Mm]\\)?\\)\\)\\|\\([AaPp][Mm]\\)\\)\\>\\)" + "\\)?") + "Regular expression to match a plain time or time range. +Examples: 11:45 or 8am-13:15 or 2:45-2:45pm. After a match, the following +groups carry important information: +0 the full match +1 the first time, range or not +8 the second time, if it is a range.") + +(defconst org-stamp-time-of-day-regexp + (concat + "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} +[a-zA-Z]+ +\\)" + "\\([012][0-9]:[0-5][0-9]\\)>" + "\\(--?" + "<\\1\\([012][0-9]:[0-5][0-9]\\)>\\)?") + "Regular expression to match a timestamp time or time range. +After a match, the following groups carry important information: +0 the full match +1 date plus weekday, for backreferencing to make sure both times on same day +2 the first time, range or not +4 the second time, if it is a range.") + +(defvar org-prefix-has-time nil + "A flag, set by `org-compile-prefix-format'. +The flag is set if the currently compiled format contains a `%t'.") + +(defun org-format-agenda-item (extra txt &optional category dotime noprefix) "Format TXT to be inserted into the agenda buffer. -In particular, this indents the line and adds a category." - (let* ((category (or category - org-category - (file-name-sans-extension - (file-name-nondirectory (buffer-file-name))))) - (extra prefix) - (time-of-day (org-get-time-of-day txt)) - (t1 (if time-of-day (concat "0" (int-to-string time-of-day)) "0000")) - (time (if time-of-day - (concat (substring t1 -4 -2) - ":" (substring t1 -2)) - "")) - rtn) - (if (symbolp category) (setq category (symbol-name category))) - (setq rtn (concat (eval org-prefix-format-compiled) txt)) - (add-text-properties - 0 (length rtn) (list 'category (downcase category) - 'prefix-length (- (length rtn) (length txt)) - 'time-of-day time-of-day) - rtn) - rtn)) - +In particular, it adds the prefix and corresponding text properties. EXTRA +must be a string and replaces the `%s' specifier in the prefix format. +CATEGORY (string, symbol or nil) may be used to overule the default +category taken from local variable or file name. It will replace the `%c' +specifier in the format. DOTIME, when non-nil, indicates that a +time-of-day should be extracted from TXT for sorting of this entry, and for +the `%t' specifier in the format. When DOTIME is a string, this string is +searched for a time before TXT is. NOPREFIX is a flag and indicates that +only the correctly processes TXT should be returned - this is used by +`org-agenda-change-all-lines'." + (save-match-data + ;; Diary entries sometimes have extra whitespace at the beginning + (if (string-match "^ +" txt) (setq txt (replace-match "" nil nil txt))) + (let* ((category (or category + org-category + (if (buffer-file-name) + (file-name-sans-extension + (file-name-nondirectory (buffer-file-name))) + ""))) + time ;; needed for the eval of the prefix format + (ts (if dotime (concat (if (stringp dotime) dotime "") txt))) + (time-of-day (and dotime (org-get-time-of-day ts))) + stamp plain s0 s1 s2 rtn) + (when (and dotime time-of-day org-prefix-has-time) + ;; Extract starting and ending time and move them to prefix + (when (or (setq stamp (string-match org-stamp-time-of-day-regexp ts)) + (setq plain (string-match org-plain-time-of-day-regexp ts))) + (setq s0 (match-string 0 ts) + s1 (match-string (if plain 1 2) ts) + s2 (match-string (if plain 8 4) ts)) + + ;; If the times are in TXT (not in DOTIMES), and the prefix will list + ;; them, we might want to remove them there to avoid duplication. + ;; The user can turn this off with a variable. + (if (and org-agenda-remove-times-when-in-prefix (or stamp plain) + (string-match (concat (regexp-quote s0) " *") txt) + (if (eq org-agenda-remove-times-when-in-prefix 'beg) + (= (match-beginning 0) 0) + t)) + (setq txt (replace-match "" nil nil txt)))) + ;; Normalize the time(s) to 24 hour + (if s1 (setq s1 (org-get-time-of-day s1 'string))) + (if s2 (setq s2 (org-get-time-of-day s2 'string)))) + + ;; Create the final string + (if noprefix + (setq rtn txt) + ;; Prepare the variables needed in the eval of the compiled format + (setq time (cond (s2 (concat s1 "-" s2)) + (s1 (concat s1 "......")) + (t "")) + extra (or extra "") + category (if (symbolp category) (symbol-name category) category)) + ;; Evaluate the compiled format + (setq rtn (concat (eval org-prefix-format-compiled) txt))) + + ;; And finally add the text properties + (add-text-properties + 0 (length rtn) (list 'category (downcase category) + 'prefix-length (- (length rtn) (length txt)) + 'time-of-day time-of-day + 'dotime dotime) + rtn) + rtn))) + +(defun org-agenda-add-time-grid-maybe (list ndays todayp) + (catch 'exit + (cond ((not org-agenda-use-time-grid) (throw 'exit list)) + ((and todayp (member 'today (car org-agenda-time-grid)))) + ((and (= ndays 1) (member 'daily (car org-agenda-time-grid)))) + ((member 'weekly (car org-agenda-time-grid))) + (t (throw 'exit list))) + (let* ((have (delq nil (mapcar + (lambda (x) (get-text-property 1 'time-of-day x)) + list))) + (string (nth 1 org-agenda-time-grid)) + (gridtimes (nth 2 org-agenda-time-grid)) + (req (car org-agenda-time-grid)) + (remove (member 'remove-match req)) + new time) + (if (and (member 'require-timed req) (not have)) + ;; don't show empty grid + (throw 'exit list)) + (while (setq time (pop gridtimes)) + (unless (and remove (member time have)) + (setq time (int-to-string time)) + (push (org-format-agenda-item + nil string "" ;; FIXME: put a category? + (concat (substring time 0 -2) ":" (substring time -2))) + new) + (put-text-property + 1 (length (car new)) 'face 'org-time-grid-face (car new)))) + (if (member 'time-up org-agenda-sorting-strategy) + (append new list) + (append list new))))) + (defun org-compile-prefix-format (format) "Compile the prefix format into a Lisp form that can be evaluated. The resulting form is returned and stored in the variable `org-prefix-format-compiled'." - (let ((start 0) varform vars (s format) c) - (while (string-match "%\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([cts]\\)" + (setq org-prefix-has-time nil) + (let ((start 0) varform vars var (s format) c f opt) + (while (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([cts]\\)" s start) - (setq var (cdr (assoc (match-string 3 s) + (setq var (cdr (assoc (match-string 4 s) '(("c" . category) ("t" . time) ("s" . extra)))) - c (match-string 2 s) + c (or (match-string 3 s) "") + opt (match-beginning 1) start (1+ (match-beginning 0))) - (if (= (length c) 1) - (setq varform `(if (equal "" ,var) "" (concat ,var ,c))) - (setq varform var)) - (setq s (replace-match "%\\1s" t nil s)) + (if (equal var 'time) (setq org-prefix-has-time t)) + (setq f (concat "%" (match-string 2 s) "s")) + (if opt + (setq varform + `(if (equal "" ,var) + "" + (format ,f (if (equal "" ,var) "" (concat ,var ,c))))) + (setq varform `(format ,f (if (equal ,var "") "" (concat ,var ,c))))) + (setq s (replace-match "%s" t nil s)) (push varform vars)) (setq vars (nreverse vars)) (setq org-prefix-format-compiled `(format ,s ,@vars)))) -(defun org-get-time-of-day (s) +(defun org-get-time-of-day (s &optional string) "Check string S for a time of day. If found, return it as a military time number between 0 and 2400. -If not found, return nil." +If not found, return nil. +The optional STRING argument forces conversion into a 5 character wide string +HH:MM." (save-match-data - (when (or - (string-match - "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\>" s) - (string-match - "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\([AaPp][Mm]\\)\\>" s)) - (+ (* 100 (+ (string-to-number (match-string 1 s)) - (if (and (match-beginning 4) - (equal (downcase (match-string 4 s)) "pm")) - 12 0))) - (if (match-beginning 3) - (string-to-number (match-string 3 s)) - 0))))) + (when + (or + (string-match + "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)\\([AaPp][Mm]\\)?\\> *" s) + (string-match + "\\<\\([012]?[0-9]\\)\\(:\\([0-5][0-9]\\)\\)?\\([AaPp][Mm]\\)\\> *" s)) + (let* ((t0 (+ (* 100 + (+ (string-to-number (match-string 1 s)) + (if (and (match-beginning 4) + (equal (downcase (match-string 4 s)) "pm")) + 12 0))) + (if (match-beginning 3) + (string-to-number (match-string 3 s)) + 0))) + (t1 (concat " " (int-to-string t0)))) + (if string (concat (substring t1 -4 -2) ":" (substring t1 -2)) t0))))) (defun org-finalize-agenda-entries (list) "Sort and concatenate the agenda items." @@ -4295,23 +4529,30 @@ the same tree node, and the headline of the tree node in the Org-mode file." (defun org-agenda-change-all-lines (newhead hdmarker &optional fixface) "Change all lines in the agenda buffer which match hdmarker. -The new content of the line will be NEWHEAD. HDMARKER is checked with -`equal' against all `org-hd-marker' text properties in the file." - (let* (props m pl undone-face done-face) +The new content of the line will be NEWHEAD (as modified by +`org-format-agenda-item'). HDMARKER is checked with +`equal' against all `org-hd-marker' text properties in the file. +If FIXFACE is non-nil, the face of each item is modified acording to +the new TODO state." + (let* (props m pl undone-face done-face finish new dotime) +; (setq newhead (org-format-agenda-item "x" newhead "x" nil 'noprefix)) (save-excursion (goto-char (point-max)) (beginning-of-line 1) - (while (not (bobp)) + (while (not finish) + (setq finish (bobp)) (when (and (setq m (get-text-property (point) 'org-hd-marker)) (equal m hdmarker)) (setq props (text-properties-at (point)) + dotime (get-text-property (point) 'dotime) + new (org-format-agenda-item "x" newhead "x" dotime 'noprefix) pl (get-text-property (point) 'prefix-length) undone-face (get-text-property (point) 'undone-face) done-face (get-text-property (point) 'done-face)) (move-to-column pl) (if (looking-at ".*") (progn - (replace-match newhead t t) + (replace-match new t t) (beginning-of-line 1) (add-text-properties (point-at-bol) (point-at-eol) props) (if fixface @@ -4355,6 +4596,7 @@ the same tree node, and the headline of the tree node in the Org-mode file." (and (outline-next-heading) (org-flag-heading nil))) ; show the next heading (funcall 'org-priority force-direction) + (end-of-line 1) (setq newhead (org-get-heading))) (org-agenda-change-all-lines newhead hdmarker) (beginning-of-line 1))) @@ -4519,7 +4761,7 @@ This is a command that has to be installed in `calendar-mode-map'." "ISO: " (calendar-iso-date-string date) "\n" "Day of Yr: " (calendar-day-of-year-string date) "\n" "Julian: " (calendar-julian-date-string date) "\n" - "Astronomic: " (calendar-astro-date-string date) + "Astron. JD: " (calendar-astro-date-string date) " (Julian date number at noon UTC)\n" "Hebrew: " (calendar-hebrew-date-string date) " (until sunset)\n" "Islamic: " (calendar-islamic-date-string date) " (until sunset)\n" @@ -4865,10 +5107,11 @@ For file links, arg negates `org-line-numbers-in-file-links'." ((fboundp 'gnus-group-name) (gnus-group-name)) (t "???")))) - (setq link (concat (if (org-xor arg org-usenet-links-prefer-google) - "http://groups.google.com/groups?group=" - "gnus:") - group)))) + (setq link (concat + (if (org-xor arg org-usenet-links-prefer-google) + "http://groups.google.com/groups?group=" + "gnus:") + group)))) ((memq major-mode '(gnus-summary-mode gnus-article-mode)) (and (eq major-mode 'gnus-article-mode) (gnus-article-show-summary)) @@ -4919,9 +5162,7 @@ For file links, arg negates `org-line-numbers-in-file-links'." (defun org-xor (a b) "Exclusive or." - ;; (if a (not b) b) - (or (and a (not b)) - (and b (not a)))) + (if a (not b) b)) (defun org-get-header (header) "Find a header field in the current buffer." @@ -5217,7 +5458,8 @@ SIZE is a string Columns x Rows like for example \"3x2\"." (point-at-bol) (point))) (beginning-of-line 1) (newline)) - (mapcar (lambda (x) (insert line)) (make-list rows t)) + ;; (mapcar (lambda (x) (insert line)) (make-list rows t)) + (dotimes (i rows) (insert line)) (goto-char pos) (if (> rows 1) ;; Insert a hline after the first row. @@ -5285,8 +5527,7 @@ Such a file can be imported into a spreadsheet program like Excel." (unless (or (not (file-exists-p file)) (y-or-n-p (format "Overwrite file %s? " file))) (error "Abort")) - (save-excursion - (find-file file) + (with-current-buffer (find-file-noselect file) (setq buf (current-buffer)) (erase-buffer) (fundamental-mode) @@ -5406,12 +5647,18 @@ This is being used to correctly align a single field after TAB or RET.") (setq rfmt (concat rfmt "\n") hfmt (concat (substring hfmt 0 -1) "|\n")) ;; Produce the new table - (while lines - (setq l (pop lines)) - (if l - (setq new (concat new (apply 'format rfmt - (append (pop fields) emptystrings)))) - (setq new (concat new hfmt)))) + ;;(while lines + ;; (setq l (pop lines)) + ;; (if l + ;; (setq new (concat new (apply 'format rfmt + ;; (append (pop fields) emptystrings)))) + ;; (setq new (concat new hfmt)))) + (setq new (mapconcat + (lambda (l) + (if l (apply 'format rfmt + (append (pop fields) emptystrings)) + hfmt)) + lines "")) ;; Replace the old one (delete-region beg end) (move-marker end nil) @@ -8480,9 +8727,7 @@ to a visible line beginning. This makes the function of C-a more intuitive." (get-char-property (point) 'invisible)) (save-excursion (skip-chars-backward "^\r\n") - (if (bobp) - nil - (equal (char-before) ?\r))))) + (equal (char-before) ?\r)))) (defun org-back-to-heading (&optional invisible-ok) "Move to previous heading line, or beg of this line if it's a heading. diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 118ca3bb3fa..430a196166f 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -1272,7 +1272,7 @@ This is always set to nil at the entry to `table-with-cache-buffer' before execu (if (featurep 'xemacs) (progn (easy-menu-add-item nil '("Tools") table-global-menu-map)) - (easy-menu-add-item (current-global-map) '("menu-bar" "tools") '("--")) + (easy-menu-add-item (current-global-map) '("menu-bar" "tools") "--") (easy-menu-add-item (current-global-map) '("menu-bar" "tools") table-global-menu-map))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/lisp/thumbs.el b/lisp/thumbs.el index fd3cb13de98..1657c4b01a9 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el @@ -83,7 +83,7 @@ (defcustom thumbs-thumbsdir-max-size 50000000 "Max size for thumbnails directory. -When it reach that size (in bytes), a warning is send." +When it reachs that size (in bytes), a warning is sent." :type 'string :group 'thumbs) @@ -142,7 +142,7 @@ see some of your images." ;; Initialize some variable, for later use. (defvar thumbs-temp-file (concat thumbs-temp-dir thumbs-temp-prefix) - "Temporary filesname for images.") + "Temporary filename for images.") (defvar thumbs-current-tmp-filename nil @@ -188,8 +188,8 @@ The name is made by appending a number to PREFIX, default \"Thumbs\"." (defun thumbs-cleanup-thumbsdir () "Clean the thumbnails directory. -If the total size of all files in 'thumbs-thumbsdir' is bigger than -'thumbs-thumbsdir-max-size', files are deleted until the max size is +If the total size of all files in `thumbs-thumbsdir' is bigger than +`thumbs-thumbsdir-max-size', files are deleted until the max size is reached." (let* ((filesL (sort @@ -217,11 +217,11 @@ reached." FILEIN is the input file, FILEOUT is the output file, ACTION is the command to send to convert. -Optional argument are: +Optional arguments are: ARG any arguments to the ACTION command, -OUTPUT-FORMAT is the file format to output, default is jpeg +OUTPUT-FORMAT is the file format to output (default is jpeg), ACTION-PREFIX is the symbol to place before the ACTION command - (default to '-' but can sometime be '+')." + (defaults to '-' but can sometimes be '+')." (let ((command (format "%s %s%s %s \"%s\" \"%s:%s\"" thumbs-conversion-program (or action-prefix "-") @@ -241,7 +241,7 @@ ACTION-PREFIX is the symbol to place before the ACTION command (round (- n (/ (* d n) 100)))) (defun thumbs-increment-image-size (s) - "Increment S (a cons of width x heigh)." + "Increment S (a cons of width x height)." (cons (thumbs-increment-image-size-element (car s) thumbs-image-resizing-step) @@ -249,7 +249,7 @@ ACTION-PREFIX is the symbol to place before the ACTION command thumbs-image-resizing-step))) (defun thumbs-decrement-image-size (s) - "Decrement S (a cons of width x heigh)." + "Decrement S (a cons of width x height)." (cons (thumbs-decrement-image-size-element (car s) thumbs-image-resizing-step) @@ -349,7 +349,7 @@ Or, alternatively, a SIZE may be specified." "Insert image IMG at point. TYPE and RELIEF will be used in constructing the image; see `image' in the emacs-lisp manual for further documentation. -if MARKED is non-nil, the image is marked." +If MARKED is non-nil, the image is marked." (let ((i `(image :type ,type :file ,img :relief ,relief @@ -361,7 +361,7 @@ if MARKED is non-nil, the image is marked." (defun thumbs-insert-thumb (img &optional marked) "Insert the thumbnail for IMG at point. -if MARKED is non-nil, the image is marked" +If MARKED is non-nil, the image is marked." (thumbs-insert-image (thumbs-make-thumb img) 'jpeg thumbs-relief marked) (put-text-property (1- (point)) (point) @@ -403,7 +403,7 @@ and SAME-WINDOW to show thumbs in the same window." ;;;###autoload (defun thumbs-dired-show-marked () - "In Dired, make a thumbs buffer with all marked files." + "In dired, make a thumbs buffer with all marked files." (interactive) (thumbs-show-thumbs-list (dired-get-marked-files) nil t)) @@ -435,7 +435,7 @@ and SAME-WINDOW to show thumbs in the same window." (defun thumbs-find-image-at-point (&optional img otherwin) "Display image IMG for thumbnail at point. -use another window it OTHERWIN is t." +Use another window if OTHERWIN is t." (interactive) (let* ((i (or img (thumbs-current-image)))) (thumbs-find-image i (point) otherwin))) @@ -499,7 +499,7 @@ Open another window." (nreverse list)))) (defun thumbs-delete-images () - "Delete the image at point (and it's thumbnail) (or marked files if any)." + "Delete the image at point (and its thumbnail) (or marked files if any)." (interactive) (let ((files (or thumbs-markedL (list (thumbs-current-image))))) (if (yes-or-no-p (format "Really delete %d files? " (length files))) @@ -520,7 +520,7 @@ Open another window." (delq x thumbs-markedL))))))))) (defun thumbs-rename-images (newfile) - "Rename the image at point (and it's thumbnail) (or marked files if any)." + "Rename the image at point (and its thumbnail) (or marked files if any)." (interactive "FRename to file or directory: ") (let ((files (or thumbs-markedL (list (thumbs-current-image)))) failures) @@ -574,7 +574,7 @@ Open another window." thumbs-current-image-filename i)))) (defun thumbs-next-image () - "Show next image." + "Show the next image." (interactive) (let* ((i (1+ thumbs-image-num)) (list (thumbs-file-alist)) @@ -782,7 +782,7 @@ ACTION and ARG should be a valid convert command." ;;;###autoload (defun thumbs-dired-setroot () - "In dired, Call the setroot program on the image at point." + "In dired, call the setroot program on the image at point." (interactive) (thumbs-call-setroot-command (dired-get-filename))) diff --git a/lisp/tmm.el b/lisp/tmm.el index 3e0a8e95701..168dbdd14dc 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -362,7 +362,7 @@ Stores a list of all the shortcuts in the free variable `tmm-short-cuts'." (if (memq c tmm-short-cuts) (if (equal (buffer-name) "*Completions*") (progn - (beginning-of-buffer) + (goto-char (point-min)) (re-search-forward (concat "\\(^\\|[ \t]\\)" (char-to-string c) tmm-mid-prompt)) (choose-completion)) diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el index 1136ce565a8..e4e9f0b0137 100644 --- a/lisp/vc-cvs.el +++ b/lisp/vc-cvs.el @@ -236,16 +236,19 @@ See also variable `vc-cvs-sticky-date-format-string'." (defun vc-cvs-checkout-model (file) "CVS-specific version of `vc-checkout-model'." - (if (or (getenv "CVSREAD") - ;; If the file is not writable (despite CVSREAD being - ;; undefined), this is probably because the file is being - ;; "watched" by other developers. - ;; (If vc-mistrust-permissions was t, we actually shouldn't - ;; trust this, but there is no other way to learn this from CVS - ;; at the moment (version 1.9).) - (string-match "r-..-..-." (nth 8 (file-attributes file)))) + (if (getenv "CVSREAD") 'announce - 'implicit)) + (let ((attrib (file-attributes file))) + (if (and attrib ;; don't check further if FILE doesn't exist + ;; If the file is not writable (despite CVSREAD being + ;; undefined), this is probably because the file is being + ;; "watched" by other developers. + ;; (If vc-mistrust-permissions was t, we actually shouldn't + ;; trust this, but there is no other way to learn this from CVS + ;; at the moment (version 1.9).) + (string-match "r-..-..-." (nth 8 attrib))) + 'announce + 'implicit)))) (defun vc-cvs-mode-line-string (file) "Return string for placement into the modeline for FILE. diff --git a/lisp/vc.el b/lisp/vc.el index c5929f1da8b..24fae514ea5 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -46,7 +46,8 @@ ;; This mode is fully documented in the Emacs user's manual. ;; -;; Supported version-control systems presently include SCCS, RCS, and CVS. +;; Supported version-control systems presently include CVS, RCS, GNU Arch, +;; Subversion, Meta-CVS, and SCCS (or its free replacement, CSSC). ;; ;; Some features will not work with old RCS versions. Where ;; appropriate, VC finds out which version you have, and allows or @@ -68,7 +69,7 @@ ;; ;; The vc code maintains some internal state in order to reduce expensive ;; version-control operations to a minimum. Some names are only computed -;; once. If you perform version control operations with RCS/SCCS/CVS while +;; once. If you perform version control operations with the backend while ;; vc's back is turned, or move/rename master files while vc is running, ;; vc may get seriously confused. Don't do these things! ;; @@ -737,6 +738,7 @@ in their implementation of vc-BACKEND-diff.") ;; functions that operate on RCS revision numbers. This code should ;; also be moved into the backends. It stays for now, however, since ;; it is used in code below. +;;;###autoload (defun vc-trunk-p (rev) "Return t if REV is a revision on the trunk." (not (eq nil (string-match "\\`[0-9]+\\.[0-9]+\\'" rev)))) diff --git a/lisp/vms-patch.el b/lisp/vms-patch.el index 60033dc7f20..d8d44d9d752 100644 --- a/lisp/vms-patch.el +++ b/lisp/vms-patch.el @@ -193,5 +193,72 @@ following bindings are established. All other Emacs commands are still available." t) +;;; +;;; Filename handling in the minibuffer +;;; +(defun vms-magic-right-square-brace () + "\ +Insert a right square brace, but do other things first depending on context. +During filename completion, when point is at the end of the line and the +character before is not a right square brace, do one of three things before +inserting the brace: + - If there are already two left square braces preceding, do nothing special. + - If there is a previous right-square-brace, convert it to dot. + - If the character before is dot, delete it. +Additionally, if the preceding chars are right-square-brace followed by +either \"-\" or \"..\", strip one level of directory hierarchy." + (interactive) + (when (and minibuffer-completing-file-name + (= (point) (point-max)) + (not (= 93 (char-before)))) + (cond + ;; Avoid clobbering: user:[one.path][another.path + ((search-backward "[" (field-beginning) t 2)) + ((search-backward "]" (field-beginning) t) + (delete-char 1) + (insert ".") + (goto-char (point-max))) + ((= ?. (char-before)) + (delete-char -1))) + (goto-char (point-max)) + (let ((specs '(".." "-")) + (pmax (point-max))) + (while specs + (let* ((up (car specs)) + (len (length up)) + (cut (- (point) len))) + (when (and (< (1+ len) pmax) + (= ?. (char-before cut)) + (string= up (buffer-substring cut (point)))) + (delete-char (- (1+ len))) + (while (not (let ((c (char-before))) + (or (= ?. c) (= 91 c)))) + (delete-char -1)) + (when (= ?. (char-before)) (delete-char -1)) + (setq specs nil))) + (setq specs (cdr specs))))) + (insert "]")) + +(defun vms-magic-colon () + "\ +Insert a colon, but do other things first depending on context. +During filename completion, when point is at the end of the line +and the line contains a right square brace, remove all characters +from the beginning of the line up to and including such brace. +This enables one to type a new filespec without having to delete +the old one." + (interactive) + (when (and minibuffer-completing-file-name + (= (point) (point-max)) + (search-backward "]" (field-beginning) t)) + (delete-region (field-beginning) (1+ (point))) + (goto-char (point-max))) + (insert ":")) + +(let ((m minibuffer-local-completion-map)) + (define-key m "]" 'vms-magic-right-square-brace) + (define-key m "/" 'vms-magic-right-square-brace) + (define-key m ":" 'vms-magic-colon)) + ;;; arch-tag: c178494e-2c37-4d02-99b7-e47e615656cf ;;; vms-patch.el ends here diff --git a/lisp/window.el b/lisp/window.el index 8c46addf444..c797111f111 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -543,8 +543,7 @@ Do not shrink to less than `window-min-height' lines. Do nothing if the buffer contains more lines than the present window height, or if some of the window's contents are scrolled out of view, or if shrinking this window would also shrink another window. -or if the window is the only window of its frame. -Return non-nil if the window was shrunk." +or if the window is the only window of its frame." (interactive) (when (null window) (setq window (selected-window))) @@ -583,7 +582,7 @@ Return non-nil if the window was shrunk." (defun quit-window (&optional kill window) "Quit the current buffer. Bury it, and maybe delete the selected frame. -\(The frame is deleted if it is contains a dedicated window for the buffer.) +\(The frame is deleted if it contains a dedicated window for the buffer.) With a prefix argument, kill the buffer instead. Noninteractively, if KILL is non-nil, then kill the current buffer, |