diff options
author | Miles Bader <miles@gnu.org> | 2008-02-24 10:09:07 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2008-02-24 10:09:07 +0000 |
commit | b03f96dc5a6651d1dc84b81b2a15cad6908b9809 (patch) | |
tree | 699d727fdfb007a12a07d1e1f2e172617cc159ef /lisp | |
parent | 52bec650ae314402c242ce700bb09be42ef8ae55 (diff) | |
parent | 20ca5ee4f7d897d79416a6fdd084db1eabb392b0 (diff) | |
download | emacs-b03f96dc5a6651d1dc84b81b2a15cad6908b9809.tar.gz |
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1074
Diffstat (limited to 'lisp')
46 files changed, 1284 insertions, 577 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index eeb112c79e1..742f2593a62 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,186 @@ +2008-02-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * dired.el (dired-mark-prompt): Don't count/display the t element. + Reported by Carsten Blaauw <it-media.blaauw@daimler.com>. + +2008-02-24 Dan Nicolaescu <dann@ics.uci.edu> + + * progmodes/verilog-mode.el (eval-when-compile): Don't define + add-submenu. + (verilog-xemacs-menu): Add :keys for C-M-a, C-M-e and C-M-h. + Remove. Move contents to the only use ... + (verilog-menu): ... here. + (verilog-statement-menu): Remove. Move contents to the only use ... + (verilog-stmt-menu): ... here. + (verilog-mark-defun): Simply call mark-defun for emacs. + (occur-pos-list): Declare for byte compiler. + (mode-popup-menu): Don't defvar. + (verilog-add-statement-menu): Remove. + (verilog-mode-hook): Don't add verilog-add-statement-menu. + (verilog-mode): Call easy-menu-add and set mode-popup-menu for + XEmacs. + +2008-02-24 Michael McNamara <mac@mail.brushroad.com> + + * progmodes/verilog-mode.el (verilog-xemacs-menu): Remove XEmacs + conditional. + (verilog-font-grouping-keywords-face): Make the begin..end + keywords standout more than other verilog keywords. + (verilog-type-font-keywords): Move the begin..end out of this list + to facilitate making them to (potentially) stand out more. + (verilog-backward-token): Fix indent of bare always{_*}?, initial, + function & task blocks. + (verilog-behavioral-block-beg-re): Fix indent of bare always{_*}?, + initial, function & task blocks. + (verilog-forward-sexp): Handle the new "disable fork" statement of + IEEE-1800 Verilog. + (verilog-beg-block-re-ordered): Handle the new "disable fork" + statement of IEEE-1800 Verilog. + (verilog-calc-1): Handle the new "disable fork" statement of + IEEE-1800 Verilog. + (verilog-disable-fork-re): Add const to help handle the new + "disable fork" statement of IEEE-1800 Verilog. + (verilog-declaration-core-re): Add port directions by themselves, + with no qualification, as base item of a declaration. + (verilog-pretty-declarations): Add new flag to ask it to refrain + from printing to the message buffer. + (verilog-pretty-expr): Add a QUIET flag to ask it to refrain from + printing to the message buffer. Improve handling of the many + types of expression line up. + (verilog-just-one-space): Remove printing of an empty message. + (verilog-get-lineup-indent): Rework to support the better handling + of expression lineup for verilog-pretty-expr. + (verilog-auto-wire): Pass the quiet flag to verilog-pretty-expr. + +2008-02-24 Alan Mackenzie <acm@muc.de> + + * progmodes/cc-mode.el (c-extend-region-for-CPP): Bug fix from + yesterday's commit. + +2008-02-24 Nick Roberts <nickrob@snap.net.nz> + + * progmodes/gdb-ui.el (gdb-mouse-set-clear-breakpoint): Fall back + to mouse-set-point in buffers that aren't associated with files. + + * progmodes/gud.el: Rename menu item to "Show GUD tooltips". + +2008-02-24 Alan Mackenzie <acm@muc.de> + + Set of changes so that "obtrusive" syntactic elements in a + C/C++/ObjC preprocessor line (e.g. an unbalanced string quote or + unmatched paren) don't interact syntactically with stuff outside + the CPP line. + + * progmodes/cc-awk.el (c-awk-beyond-logical-line, c-awk-old-ByLL): + Replace c-awk-end-of-logical-line and c-awk-old-EoLL to solve an + off-by-one bug. + (c-awk-record-region-clear-NL): Replaces c-awk-before-change, with + a bit of refactoring. + (c-awk-extend-and-syntax-tablify-region): Takes some of the + functionality of c-awk-advise-fl-for-awk-region, which has been + refactored away. + + * progmodes/cc-defs.el (c-clear-char-property-with-value-function) + (c-clear-char-property-with-value): New function and macro which + remove text-properties `equal' to a supplied value. + + * progmodes/cc-engine.el: Comment about text properties amended. + + * progmodes/cc-fonts.el (c-cpp-matchers): Make it put regexp + parens around "error\\|warning". + + * progmodes/cc-langs.el (c-get-state-before-change-function) + (c-before-font-lock-function, c-anchored-cpp-prefix): + New language variables. + (c-cpp-message-directives): Handle "#warning" in C, C++ and ObjC. + + * progmodes/cc-mode.el (c-basic-common-init): C and ObjC now use + syntax-table text properties. + (c-common-init): Call language specific before/after-change + functions at mode initialisation. + (c-new-BEG, c-new-END, c-old-BOM, c-old-EOM): New variables. + (c-extend-region-for-CPP, c-neutralize-CPP-line) + (c-neutralize-syntax-in-CPP): New functions. + (c-before-change, c-after-change): Call the new language specific + change functions defined in cc-langs.el. + (c-advise-fl-for-region): New macro. + (awk-mode): Remove AWK specific stuff which has been refactored + into language independent stuff. + +2008-02-24 Nick Roberts <nickrob@snap.net.nz> + + * progmodes/gdb-ui.el (gdba): Recreate as an alias for gdb. + (gdb): (Re)set gdb-flush-pending-output to nil here... + (gdb-init-1): ...instead of here (before gdb-prompt). + +2008-02-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * progmodes/ada-mode.el (ada-font-lock-syntactic-keywords): + Recognize ''' just like any other char-constant. + +2008-02-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * vc-hooks.el (vc-find-root): Remove initial loop because it's not + careful enough. Detect the uid-change all within the main loop. + +2008-02-24 Stefan Monnier <monnier@pastel.home> + + * textmodes/sgml-mode.el (sgml-mode): Fix comment syntax. + +2008-02-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * hilit-chg.el (highlight-save-buffer-state): New macro. + (highlight-save-buffer-state, hilit-chg-set-face-on-change) + (hilit-chg-clear): Use it to preserve the modified-p flag. + (highlight-changes-rotate-faces): Don't mess with the undo-list. + +2008-02-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * font-lock.el (font-lock-set-defaults): Unset previously set variables + when needed. + +2008-02-24 ,AF(Bvar Arnfj,Av(Br,Ap(B Bjarmason <avar@cpan.org> (tiny change) + + * net/rcirc.el (rcirc-url-regexp): Replace definition by copying + from gnus-button-url-regexp. + +2008-02-24 Eli Zaretskii <eliz@gnu.org> + + * progmodes/compile.el (compilation-next-error): Doc fix. + (compilation-find-file): Doc fix. + +2008-02-24 Glenn Morris <rgm@gnu.org> + + * net/net-utils.el (ipconfig-program, ipconfig-program-options): + Add obsolete aliases to the old names. + +2008-02-24 Richard Stallman <rms@gnu.org> + + * net/net-utils.el (ifconfig): Rename from ipconfig. + (ipconfig): Alias to ifconfig. + (ifconfig-program): Rename from ipconfig-program. + (ifconfig-program-options): Rename from ipconfig-program-options. + +2008-02-24 Michael McNamara <mac@mail.brushroad.com> + + * progmodes/verilog-mode.el (verilog-declaration-core-re): + Add port directions by themselves, with no qualification, as base + item of a declaration. + (verilog-pretty-declarations): Add new flag that inhibits printing + to the message buffer. + (verilog-pretty-expr): Add new flag that inhibits printing to the + message buffer. Improve handling of the many types of expression + line up. + (verilog-just-one-space): Don't print an empty message. + (verilog-get-lineup-indent): Rework to support the better handling + of expression lineup for verilog-pretty-expr. + (verilog-auto-wire): Pass the quiet flag to verilog-pretty-expr. + (verilog-mode-version, verilog-mode-release-date): Update. + +2008-02-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * subr.el (cancel-change-group): Don't move point. + 2008-02-23 Markus Triska <markus.triska@gmx.at> * linum.el (linum-after-config): Update all visible windows. diff --git a/lisp/ChangeLog.12 b/lisp/ChangeLog.12 index aab55a53678..e7666973521 100644 --- a/lisp/ChangeLog.12 +++ b/lisp/ChangeLog.12 @@ -2386,7 +2386,7 @@ 2007-01-26 Vinicius Jose Latorre <viniciusjl@ig.com.br> - * ps-print.ps: Fix background height. + * ps-print.el: Fix background height. (ps-print-version): New version 6.7.2. 2007-01-26 Eli Zaretskii <eliz@gnu.org> @@ -6104,7 +6104,7 @@ * emulation/viper.el: Bump up version/date of update to reflect the substantial changes done in August 2006. - * emulation/viper-cmd (viper-next-line-at-bol): Make sure button-at, + * emulation/viper-cmd.el (viper-next-line-at-bol): Make sure button-at, push-button are defined. * ediff-util.el (ediff-add-to-history): New function. @@ -18114,7 +18114,7 @@ 2005-11-15 Michael Kifer <kifer@cs.stonybrook.edu> - * emulation/viper-utils.el (viper-non-word-characters-reformed-vi): + * emulation/viper-util.el (viper-non-word-characters-reformed-vi): Quote `-' in string. * emulation/viper.el (viper-emacs-state-mode-list): Ensure that @@ -20772,7 +20772,7 @@ 2005-10-05 Michael Kifer <kifer@cs.stonybrook.edu> - * ediff-merge.el (ediff-merge-region-is-non-clash): New defsubst. + * ediff-merg.el (ediff-merge-region-is-non-clash): New defsubst. (ediff-merge-region-is-non-clash-to-skip): Previously called ediff-merge-region-is-non-clash. @@ -21424,7 +21424,7 @@ * emulation/viper-macs.el (ex-map): Better messages. - * emulation/viper-utils.el (viper-beginning-of-field): New function. + * emulation/viper-util.el (viper-beginning-of-field): New function. * emulation/viper.el: Replace make-variable-buffer-local with viper-make-variable-buffer-local everywhere, to avoid warnings. @@ -26999,7 +26999,7 @@ 2005-05-29 Richard M. Stallman <rms@gnu.org> - * textmoddes/flyspell.el (flyspell-version): Function deleted. + * textmodes/flyspell.el (flyspell-version): Function deleted. (flyspell-auto-correct-previous-hook): Doc fix. * jit-lock.el (jit-lock-function, jit-lock-after-change): @@ -30044,7 +30044,7 @@ 2005-04-04 Jay Belanger <belanger@truman.edu> - * calc.el (calc-language-alist): Add tags to customization type. + * calc/calc.el (calc-language-alist): Add tags to customization type. 2005-04-03 Luc Teirlinck <teirllm@auburn.edu> diff --git a/lisp/custom.el b/lisp/custom.el index c45ba22c507..70430cb0c3c 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -900,7 +900,7 @@ in SYMBOL's list property `theme-value' \(using `custom-push-theme')." (memq (get symbol 'custom-autoload) '(nil noset))) ;; This symbol needs to be autoloaded, even just for a `set'. (custom-load-symbol symbol)))) - + ;; Move minor modes and variables with explicit requires to the end. (setq args (sort args diff --git a/lisp/dired.el b/lisp/dired.el index 7e959b89a20..09695bfa7cd 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2550,8 +2550,10 @@ non-empty directories is allowed." (if (= 1 count) "" "s")) (defun dired-mark-prompt (arg files) - ;; Return a string for use in a prompt, either the current file - ;; name, or the marker and a count of marked files. + "Return a string for use in a prompt, either the current file +name, or the marker and a count of marked files." + ;; distinguish-one-marked can cause the first element to be just t. + (if (eq (car files) t) (setq files (cdr files))) (let ((count (length files))) (if (= count 1) (car files) diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 5dfdd04c9c2..33a3f06d4e6 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -221,7 +221,7 @@ In interpreted code, this is entirely equivalent to `progn'." ;; verbose t, nil byte-compile-verbose ;; optimize t, nil, source, byte byte-compile-optimize ;; warnings list of warnings byte-compile-warnings -;; Legal elements: (callargs redefine free-vars unresolved) +;; Valid elements: (callargs redefine free-vars unresolved) ;; file-format emacs18, emacs19 byte-compile-compatibility ;; ;; For example, this might appear at the top of a source file: diff --git a/lisp/emacs-lisp/cl-specs.el b/lisp/emacs-lisp/cl-specs.el index d2d55204ef2..dc8ebef69d5 100644 --- a/lisp/emacs-lisp/cl-specs.el +++ b/lisp/emacs-lisp/cl-specs.el @@ -323,7 +323,7 @@ ;; Below is a complete spec for loop, in several parts that correspond ;; to the syntax given in CLtL2. The specs do more than specify where ;; the forms are; it also specifies, as much as Edebug allows, all the -;; syntactically legal loop clauses. The disadvantage of this +;; syntactically valid loop clauses. The disadvantage of this ;; completeness is rigidity, but the "for ... being" clause allows ;; arbitrary extensions of the form: [symbolp &rest &or symbolp form]. diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 24d3284f08f..1f883487ea7 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -1496,7 +1496,7 @@ expressions; a `progn' form will be returned enclosing these forms." (cond ((symbolp head) (cond - ((null head) nil) ; () is legal. + ((null head) nil) ; () is valid. ((eq head 'interactive-p) ;; Special case: replace (interactive-p) with variable (setq edebug-def-interactive 'check-it) @@ -2076,7 +2076,7 @@ expressions; a `progn' form will be returned enclosing these forms." ;; doesn't handle (a . ,b). The straightforward fix: ;; (backquote-form . [&or nil backquote-form]) ;; uses up too much stack space. - ;; Note that `(foo . ,@bar) is not legal, so we don't need to handle it. + ;; Note that `(foo . ,@bar) is not valid, so we don't need to handle it. (backquote-form [&rest [¬ ","] backquote-form] . [&or nil backquote-form]) ;; If you use dotted forms in backquotes, replace the previous line diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 1a0b49676ae..fc230ddbe0e 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -2,6 +2,12 @@ * erc.el (erc-notice-face): Fix this face for Emacs 21 users. +2008-02-05 Juanma Barranquero <lekktu@gmail.com> + + * erc.el (erc-valid-nick-regexp): + * erc-button.el (erc-button-syntax-table): + * erc-match.el (erc-match-syntax-table): Replace `legal' with `valid'. + 2008-02-04 Jeremy Maitin-Shepard <jbms@cmu.edu> * erc.el (erc-cmd-QUERY): Bind the value of `erc-auto-query' to diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 7e45c6cd4ea..a1e072ca191 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -239,7 +239,7 @@ PAR is a number of a regexp grouping whose text will be passed to (modify-syntax-entry ?\\ "w" table) table) "Syntax table used when buttonizing messages. -This syntax table should make all the legal nick characters word +This syntax table should make all the valid nick characters word constituents.") (defvar erc-button-keys-added nil diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index a98b1d92f4a..3e525588e66 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -256,7 +256,7 @@ current-nick, keyword, pal, dangerous-host, fool" (modify-syntax-entry ?\\ "w" table) table) "Syntax table used when highlighting messages. -This syntax table should make all the legal nick characters word +This syntax table should make all the valid nick characters word constituents.") ;; Faces: diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 6cbf5f0b7a0..a085336f9a1 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -2428,7 +2428,7 @@ If STRING is nil, the function does nothing." (setq list (cdr list)))))) (defvar erc-valid-nick-regexp "[]a-zA-Z^[;\\`_{}|][]^[;\\`_{}|a-zA-Z0-9-]*" - "Regexp which matches all legal characters in a IRC nickname.") + "Regexp which matches all valid characters in a IRC nickname.") (defun erc-is-valid-nick-p (nick) "Check if NICK is a valid IRC nickname." diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index 8f5bffb4664..2e52d744678 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el @@ -35,7 +35,7 @@ ;; ;; $ALSO-VAR ;; -;; "-" is a legal part of a variable name. +;; "-" is a valid part of a variable name. ;; ;; $<MYVAR>-TOO ;; diff --git a/lisp/ffap.el b/lisp/ffap.el index 2c750d8f612..078de992ab4 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -426,7 +426,7 @@ Returned values: ;; (ffap-machine-p "mathcs" 5678 nil 'ping) ;; (ffap-machine-p "foo.bonk" nil nil 'ping) ;; (ffap-machine-p "foo.bonk.com" nil nil 'ping) - (if (or (string-match "[^-[:alnum:].]" host) ; Illegal chars (?) + (if (or (string-match "[^-[:alnum:].]" host) ; Invalid chars (?) (not (string-match "[^0-9]" host))) ; 1: a number? 2: quick reject nil (let* ((domain diff --git a/lisp/follow.el b/lisp/follow.el index 1096239e820..16e5309f2ac 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -302,7 +302,7 @@ ;; above for an example of how to bind the keys the way you like. ;; ;; Please note that the keymap is defined the first time this file is -;; loaded. Also note that the only legal way to manipulate the +;; loaded. Also note that the only valid way to manipulate the ;; keymap is to use `define-key'. Don't change it using `setq' or ;; similar! diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 2f2659a6e1c..7d607b3a52d 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1785,13 +1785,16 @@ Sets various variables using `font-lock-defaults' (or, if nil, using (cdr-safe (assq major-mode font-lock-removed-keywords-alist)))) (set (make-local-variable 'font-lock-defaults) defaults) ;; Syntactic fontification? - (when (nth 1 defaults) - (set (make-local-variable 'font-lock-keywords-only) t)) + (if (nth 1 defaults) + (set (make-local-variable 'font-lock-keywords-only) t) + (kill-local-variable 'font-lock-keywords-only)) ;; Case fold during regexp fontification? - (when (nth 2 defaults) - (set (make-local-variable 'font-lock-keywords-case-fold-search) t)) + (if (nth 2 defaults) + (set (make-local-variable 'font-lock-keywords-case-fold-search) t) + (kill-local-variable 'font-lock-keywords-case-fold-search)) ;; Syntax table for regexp and syntactic fontification? - (when (nth 3 defaults) + (if (null (nth 3 defaults)) + (kill-local-variable 'font-lock-syntax-table) (set (make-local-variable 'font-lock-syntax-table) (copy-syntax-table (syntax-table))) (dolist (selem (nth 3 defaults)) @@ -1802,9 +1805,10 @@ Sets various variables using `font-lock-defaults' (or, if nil, using (mapcar 'identity (car selem)))) (modify-syntax-entry char syntax font-lock-syntax-table))))) ;; Syntax function for syntactic fontification? - (when (nth 4 defaults) + (if (nth 4 defaults) (set (make-local-variable 'font-lock-beginning-of-syntax-function) - (nth 4 defaults))) + (nth 4 defaults)) + (kill-local-variable 'font-lock-beginning-of-syntax-function)) ;; Variable alist? (dolist (x (nthcdr 5 defaults)) (set (make-local-variable (car x)) (cdr x))) diff --git a/lisp/gnus/deuglify.el b/lisp/gnus/deuglify.el index 03c2bcf1fbf..85f508cbc87 100644 --- a/lisp/gnus/deuglify.el +++ b/lisp/gnus/deuglify.el @@ -68,7 +68,7 @@ ;; > verb. This sentence no verb. This sentence no verb. This ;; > sentence no verb. ;; -;; Unwrapping "You forgot in all your sentences." would be illegal as +;; Unwrapping "You forgot in all your sentences." would be invalid as ;; this part wasn't intended to be cited text. ;; `gnus-article-outlook-unwrap-lines' will only unwrap lines if the resulting ;; citation line will be of a certain maximum length. You can control diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el index f75c694175d..73d6c4b91d8 100644 --- a/lisp/hilit-chg.el +++ b/lisp/hilit-chg.el @@ -515,12 +515,28 @@ the text properties of type `hilit-chg'." (delete-overlay ov)))))) (hilit-chg-display-changes beg end))) +;; Inspired by font-lock. Something like this should be moved to subr.el. +(defmacro highlight-save-buffer-state (&rest body) + "Bind variables according to VARLIST and eval BODY restoring buffer state." + (declare (indent 0) (debug t)) + (let ((modified (make-symbol "modified"))) + `(let* ((,modified (buffer-modified-p)) + (inhibit-modification-hooks t) + deactivate-mark + ;; So we don't check the file's mtime. + buffer-file-name + buffer-file-truename) + (progn + ,@body) + (unless ,modified + (restore-buffer-modified-p nil))))) + ;;;###autoload (defun highlight-changes-remove-highlight (beg end) "Remove the change face from the region between BEG and END. This allows you to manually remove highlighting from uninteresting changes." (interactive "r") - (let ((after-change-functions nil)) + (highlight-save-buffer-state (remove-text-properties beg end '(hilit-chg nil)) (hilit-chg-fixup beg end))) @@ -543,38 +559,39 @@ This allows you to manually remove highlighting from uninteresting changes." (if undo-in-progress (if (eq highlight-changes-mode 'active) (hilit-chg-fixup beg end)) - (if (and (= beg end) (> leng-before 0)) - ;; deletion - (progn - ;; The eolp and bolp tests are a kludge! But they prevent - ;; rather nasty looking displays when deleting text at the end - ;; of line, such as normal corrections as one is typing and - ;; immediately makes a correction, and when deleting first - ;; character of a line. -;;; (if (= leng-before 1) -;;; (if (eolp) -;;; (setq beg-decr 0 end-incr 0) -;;; (if (bolp) -;;; (setq beg-decr 0)))) -;;; (setq beg (max (- beg beg-decr) (point-min))) - (setq end (min (+ end end-incr) (point-max))) - (setq type 'hilit-chg-delete)) - ;; Not a deletion. - ;; Most of the time the following is not necessary, but - ;; if the current text was marked as a deletion then - ;; the old overlay is still in effect, so if we add some - ;; text then remove the deletion marking, but set it to + (highlight-save-buffer-state + (if (and (= beg end) (> leng-before 0)) + ;; deletion + (progn + ;; The eolp and bolp tests are a kludge! But they prevent + ;; rather nasty looking displays when deleting text at the end + ;; of line, such as normal corrections as one is typing and + ;; immediately makes a correction, and when deleting first + ;; character of a line. + ;; (if (= leng-before 1) + ;; (if (eolp) + ;; (setq beg-decr 0 end-incr 0) + ;; (if (bolp) + ;; (setq beg-decr 0)))) + ;; (setq beg (max (- beg beg-decr) (point-min))) + (setq end (min (+ end end-incr) (point-max))) + (setq type 'hilit-chg-delete)) + ;; Not a deletion. + ;; Most of the time the following is not necessary, but + ;; if the current text was marked as a deletion then + ;; the old overlay is still in effect, so if we add some + ;; text then remove the deletion marking, but set it to ;; changed otherwise its highlighting disappears. (if (eq (get-text-property end 'hilit-chg) 'hilit-chg-delete) (progn (remove-text-properties end (+ end 1) '(hilit-chg nil)) (put-text-property end (+ end 1) 'hilit-chg 'hilit-chg) (if (eq highlight-changes-mode 'active) - (hilit-chg-fixup beg (+ end 1)))))) - (unless no-property-change - (put-text-property beg end 'hilit-chg type)) - (if (or (eq highlight-changes-mode 'active) no-property-change) - (hilit-chg-make-ov type beg end)))))) + (hilit-chg-fixup beg (+ end 1)))))) + (unless no-property-change + (put-text-property beg end 'hilit-chg type)) + (if (or (eq highlight-changes-mode 'active) no-property-change) + (hilit-chg-make-ov type beg end))))))) (defun hilit-chg-set (value) "Turn on Highlight Changes mode for this buffer." @@ -602,12 +619,11 @@ This removes all saved change information." (message "Cannot remove highlighting from read-only mode buffer %s" (buffer-name)) (remove-hook 'after-change-functions 'hilit-chg-set-face-on-change t) - (let ((after-change-functions nil)) + (highlight-save-buffer-state (hilit-chg-hide-changes) (hilit-chg-map-changes - '(lambda (prop start stop) - (remove-text-properties start stop '(hilit-chg nil)))) - ) + (lambda (prop start stop) + (remove-text-properties start stop '(hilit-chg nil))))) (setq highlight-changes-mode nil) (force-mode-line-update) ;; If we type: C-u -1 M-x highlight-changes-mode @@ -798,11 +814,12 @@ this, eval the following in the buffer to be saved: ;; of the current buffer due to the rotation. We do this by inserting (in ;; `buffer-undo-list') entries restoring buffer-modified-p to nil before ;; and after the entry for the rotation. - (unless modified - ;; Install the "before" entry. - (setq buffer-undo-list - (cons '(apply restore-buffer-modified-p nil) - buffer-undo-list))) + ;; FIXME: this is no good: we need to test the `modified' state at the + ;; time of the undo, not at the time of the "do", otherwise the undo + ;; may erroneously clear the modified flag. --Stef + ;; (unless modified + ;; ;; Install the "before" entry. + ;; (push '(apply restore-buffer-modified-p nil) buffer-undo-list)) (unwind-protect (progn ;; ensure hilit-chg-list is made and up to date @@ -815,10 +832,8 @@ this, eval the following in the buffer to be saved: (if (eq highlight-changes-mode 'active) (hilit-chg-display-changes))) (unless modified - ;; Install the "after" entry. - (setq buffer-undo-list - (cons '(apply restore-buffer-modified-p nil) - buffer-undo-list)) + ;; Install the "after" entry. FIXME: See above. + ;; (push '(apply restore-buffer-modified-p nil) buffer-undo-list) (restore-buffer-modified-p nil))))) ;; This always returns nil so it is safe to use in write-file-functions diff --git a/lisp/isearch.el b/lisp/isearch.el index 2ede11399af..44f4ad1eed4 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1486,7 +1486,7 @@ to the barrier." ;; removes all bracket-sets and groups that might be in the way, as ;; well as partial \{\} constructs that the code below leaves behind. ;; Also skip over postfix operators -- though horrid, - ;; 'ab?\{5,6\}+\{1,2\}*' is perfectly legal. + ;; 'ab?\{5,6\}+\{1,2\}*' is perfectly valid. (while (and previous (or (isearch-error-state frame) (let* ((string (isearch-string-state frame)) diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 1b04c01219b..77cba1e0015 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -1890,6 +1890,18 @@ Major mode for editing BibTeX style files. ;;;*** +;;;### (autoloads (bibtex-style-mode) "bibtex-style" "textmodes/bibtex-style.el" +;;;;;; (18310 14604)) +;;; Generated autoloads from textmodes/bibtex-style.el + (add-to-list 'auto-mode-alist '("\\.bst\\'" . bibtex-style-mode)) + +(autoload (quote bibtex-style-mode) "bibtex-style" "\ +Major mode for editing BibTeX style files. + +\(fn)" t nil) + +;;;*** + ;;;### (autoloads (binhex-decode-region binhex-decode-region-external ;;;;;; binhex-decode-region-internal) "binhex" "mail/binhex.el" ;;;;;; (18335 54537)) @@ -12196,6 +12208,8 @@ session. \(fn COMMAND-LINE)" t nil) +(defalias (quote gdba) (quote gdb)) + (defvar gdb-enable-debug nil "\ Non-nil means record the process input and output in `gdb-debug-log'.") @@ -30680,6 +30694,201 @@ Key bindings specific to `verilog-mode-map' are: ;;;*** +;;;### (autoloads (vera-mode) "vera-mode" "progmodes/vera-mode.el" +;;;;;; (18310 14601)) +;;; Generated autoloads from progmodes/vera-mode.el + (add-to-list 'auto-mode-alist '("\\.vr[hi]?\\'" . vera-mode)) + +(autoload (quote vera-mode) "vera-mode" "\ +Major mode for editing Vera code. + +Usage: +------ + + INDENTATION: Typing `TAB' at the beginning of a line indents the line. + The amount of indentation is specified by option `vera-basic-offset'. + Indentation can be done for an entire region (`M-C-\\') or buffer (menu). + `TAB' always indents the line if option `vera-intelligent-tab' is nil. + + WORD/COMMAND COMPLETION: Typing `TAB' after a (not completed) word looks + for a word in the buffer or a Vera keyword that starts alike, inserts it + and adjusts case. Re-typing `TAB' toggles through alternative word + completions. + + Typing `TAB' after a non-word character inserts a tabulator stop (if not + at the beginning of a line). `M-TAB' always inserts a tabulator stop. + + COMMENTS: `C-c C-c' comments out a region if not commented out, and + uncomments a region if already commented out. + + HIGHLIGHTING (fontification): Vera keywords, predefined types and + constants, function names, declaration names, directives, as well as + comments and strings are highlighted using different colors. + + VERA VERSION: OpenVera 1.4 and Vera version 6.2.8. + + +Maintenance: +------------ + +To submit a bug report, use the corresponding menu entry within Vera Mode. +Add a description of the problem and include a reproducible test case. + +Feel free to send questions and enhancement requests to <reto@gnu.org>. + +Official distribution is at +<http://www.iis.ee.ethz.ch/~zimmi/emacs/vera-mode.html>. + + + The Vera Mode Maintainer + Reto Zimmermann <reto@gnu.org> + +Key bindings: +------------- + +\\{vera-mode-map} + +\(fn)" t nil) + +;;;*** + +;;;### (autoloads (verilog-mode) "verilog-mode" "progmodes/verilog-mode.el" +;;;;;; (18363 3872)) +;;; Generated autoloads from progmodes/verilog-mode.el + +(autoload (quote verilog-mode) "verilog-mode" "\ +Major mode for editing Verilog code. +\\<verilog-mode-map> +See \\[describe-function] verilog-auto (\\[verilog-auto]) for details on how +AUTOs can improve coding efficiency. + +Use \\[verilog-faq] for a pointer to frequently asked questions. + +NEWLINE, TAB indents for Verilog code. +Delete converts tabs to spaces as it moves back. + +Supports highlighting. + +Turning on Verilog mode calls the value of the variable `verilog-mode-hook' +with no args, if that value is non-nil. + +Variables controlling indentation/edit style: + + variable `verilog-indent-level' (default 3) + Indentation of Verilog statements with respect to containing block. + `verilog-indent-level-module' (default 3) + Absolute indentation of Module level Verilog statements. + Set to 0 to get initial and always statements lined up + on the left side of your screen. + `verilog-indent-level-declaration' (default 3) + Indentation of declarations with respect to containing block. + Set to 0 to get them list right under containing block. + `verilog-indent-level-behavioral' (default 3) + Indentation of first begin in a task or function block + Set to 0 to get such code to lined up underneath the task or + function keyword. + `verilog-indent-level-directive' (default 1) + Indentation of `ifdef/`endif blocks. + `verilog-cexp-indent' (default 1) + Indentation of Verilog statements broken across lines i.e.: + if (a) + begin + `verilog-case-indent' (default 2) + Indentation for case statements. + `verilog-auto-newline' (default nil) + Non-nil means automatically newline after semicolons and the punctuation + mark after an end. + `verilog-auto-indent-on-newline' (default t) + Non-nil means automatically indent line after newline. + `verilog-tab-always-indent' (default t) + Non-nil means TAB in Verilog mode should always reindent the current line, + regardless of where in the line point is when the TAB command is used. + `verilog-indent-begin-after-if' (default t) + Non-nil means to indent begin statements following a preceding + if, else, while, for and repeat statements, if any. Otherwise, + the begin is lined up with the preceding token. If t, you get: + if (a) + begin // amount of indent based on `verilog-cexp-indent' + otherwise you get: + if (a) + begin + `verilog-auto-endcomments' (default t) + Non-nil means a comment /* ... */ is set after the ends which ends + cases, tasks, functions and modules. + The type and name of the object will be set between the braces. + `verilog-minimum-comment-distance' (default 10) + Minimum distance (in lines) between begin and end required before a comment + will be inserted. Setting this variable to zero results in every + end acquiring a comment; the default avoids too many redundant + comments in tight quarters. + `verilog-auto-lineup' (default `(all)) + List of contexts where auto lineup of code should be done. + +Variables controlling other actions: + + `verilog-linter' (default surelint) + Unix program to call to run the lint checker. This is the default + command for \\[compile-command] and \\[verilog-auto-save-compile]. + +See \\[customize] for the complete list of variables. + +AUTO expansion functions are, in part: + + \\[verilog-auto] Expand AUTO statements. + \\[verilog-delete-auto] Remove the AUTOs. + \\[verilog-inject-auto] Insert AUTOs for the first time. + +Some other functions are: + + \\[verilog-complete-word] Complete word with appropriate possibilities. + \\[verilog-mark-defun] Mark function. + \\[verilog-beg-of-defun] Move to beginning of current function. + \\[verilog-end-of-defun] Move to end of current function. + \\[verilog-label-be] Label matching begin ... end, fork ... join, etc statements. + + \\[verilog-comment-region] Put marked area in a comment. + \\[verilog-uncomment-region] Uncomment an area commented with \\[verilog-comment-region]. + \\[verilog-insert-block] Insert begin ... end;. + \\[verilog-star-comment] Insert /* ... */. + + \\[verilog-sk-always] Insert a always @(AS) begin .. end block. + \\[verilog-sk-begin] Insert a begin .. end block. + \\[verilog-sk-case] Insert a case block, prompting for details. + \\[verilog-sk-for] Insert a for (...) begin .. end block, prompting for details. + \\[verilog-sk-generate] Insert a generate .. endgenerate block. + \\[verilog-sk-header] Insert a nice header block at the top of file. + \\[verilog-sk-initial] Insert an initial begin .. end block. + \\[verilog-sk-fork] Insert a fork begin .. end .. join block. + \\[verilog-sk-module] Insert a module .. (/*AUTOARG*/);.. endmodule block. + \\[verilog-sk-primitive] Insert a primitive .. (.. );.. endprimitive block. + \\[verilog-sk-repeat] Insert a repeat (..) begin .. end block. + \\[verilog-sk-specify] Insert a specify .. endspecify block. + \\[verilog-sk-task] Insert a task .. begin .. end endtask block. + \\[verilog-sk-while] Insert a while (...) begin .. end block, prompting for details. + \\[verilog-sk-casex] Insert a casex (...) item: begin.. end endcase block, prompting for details. + \\[verilog-sk-casez] Insert a casez (...) item: begin.. end endcase block, prompting for details. + \\[verilog-sk-if] Insert an if (..) begin .. end block. + \\[verilog-sk-else-if] Insert an else if (..) begin .. end block. + \\[verilog-sk-comment] Insert a comment block. + \\[verilog-sk-assign] Insert an assign .. = ..; statement. + \\[verilog-sk-function] Insert a function .. begin .. end endfunction block. + \\[verilog-sk-input] Insert an input declaration, prompting for details. + \\[verilog-sk-output] Insert an output declaration, prompting for details. + \\[verilog-sk-state-machine] Insert a state machine definition, prompting for details. + \\[verilog-sk-inout] Insert an inout declaration, prompting for details. + \\[verilog-sk-wire] Insert a wire declaration, prompting for details. + \\[verilog-sk-reg] Insert a register declaration, prompting for details. + \\[verilog-sk-define-signal] Define signal under point as a register at the top of the module. + +All key bindings can be seen in a Verilog-buffer with \\[describe-bindings]. +Key bindings specific to `verilog-mode-map' are: + +\\{verilog-mode-map} + +\(fn)" t nil) + +;;;*** + ;;;### (autoloads (vhdl-mode) "vhdl-mode" "progmodes/vhdl-mode.el" ;;;;;; (18335 54543)) ;;; Generated autoloads from progmodes/vhdl-mode.el @@ -31760,6 +31969,11 @@ and off otherwise. ;;;;;; global-whitespace-toggle-options whitespace-toggle-options ;;;;;; whitespace-mode) "whitespace" "whitespace.el" (18340 43875)) ;;; Generated autoloads from whitespace.el +(put 'whitespace-check-buffer-leading 'safe-local-variable 'booleanp) +(put 'whitespace-check-buffer-trailing 'safe-local-variable 'booleanp) +(put 'whitespace-check-buffer-indent 'safe-local-variable 'booleanp) +(put 'whitespace-check-buffer-spacetab 'safe-local-variable 'booleanp) +(put 'whitespace-check-buffer-ateol 'safe-local-variable 'booleanp) (autoload 'whitespace-mode "whitespace" "\ Toggle whitespace minor mode visualization (\"ws\" on modeline). @@ -31956,7 +32170,7 @@ See `whitespace-chars' and `whitespace-style' for documentation. See also `whitespace-cleanup' and `whitespace-cleanup-region' for cleaning up these problems. -\(fn)" t nil) +\(fn)" nil nil) ;;;*** diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el index 77ab434155a..c423a7fb82f 100644 --- a/lisp/mail/mail-extr.el +++ b/lisp/mail/mail-extr.el @@ -850,7 +850,7 @@ consing a string.)" (setq char ?\() ; HAVE I NO SHAME?? ) ;; record the position of various interesting chars, determine - ;; legality later. + ;; validity later. ((setq record-pos-symbol (cdr (assq char '((?< . <-pos) (?> . >-pos) (?@ . @-pos) @@ -862,9 +862,9 @@ consing a string.)" ((eq char ?.) (forward-char 1)) ((memq char '( - ;; comment terminator illegal + ;; comment terminator invalid ?\) - ;; domain literal terminator illegal + ;; domain literal terminator invalid ?\] ;; \ allowed only within quoted strings, ;; domain literals, and comments diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 462f9384387..1ec3039b68c 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -77,6 +77,22 @@ * mh-mime.el (mh-mml-forward-message): Forward messages as inline attatchments (closes SF #1378993). +2008-02-06 Richard Stallman <rms@gnu.org> + + * mh-seq.el (mh-make-seq, mh-seq-name): Use defsubst. + + * mh-acros.el (mh-do-in-gnu-emacs, mh-do-in-xemacs) + (with-mh-folder-updating, mh-in-show-buffer) + (mh-iterate-on-messages-in-region, mh-iterate-on-range): + (mh-do-at-event-location): Add debug decls. + (mh-seq-msgs): Use defsubst. + +2008-02-05 Juanma Barranquero <lekktu@gmail.com> + + * mh-e.el (mh-scan-format-file-check, mh-adaptive-cmd-note-flag-check): + * mh-xface.el (mh-x-image-url-cache-canonicalize): + Replace `legal' with `valid'. + 2007-08-19 Jeffrey C Honig <jch@honig.net> * mh-e.el (mh-invisible-header-fields-internal): We want to show diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el index 21fe19bb885..bfc5fa283de 100644 --- a/lisp/mh-e/mh-acros.el +++ b/lisp/mh-e/mh-acros.el @@ -65,12 +65,14 @@ loads \"cl\" appropriately." ;;;###mh-autoload (defmacro mh-do-in-gnu-emacs (&rest body) "Execute BODY if in GNU Emacs." + (declare (debug t)) (unless (featurep 'xemacs) `(progn ,@body))) (put 'mh-do-in-gnu-emacs 'lisp-indent-hook 'defun) ;;;###mh-autoload (defmacro mh-do-in-xemacs (&rest body) "Execute BODY if in XEmacs." + (declare (debug t)) (when (featurep 'xemacs) `(progn ,@body))) (put 'mh-do-in-xemacs 'lisp-indent-hook 'defun) @@ -178,6 +180,7 @@ Execute BODY, which can modify the folder buffer without having to worry about file locking or the read-only flag, and return its result. If SAVE-MODIFICATION-FLAG is non-nil, the buffer's modification flag is unchanged, otherwise it is cleared." + (declare (debug t)) (setq save-modification-flag (car save-modification-flag)) ; CL style `(prog1 (let ((mh-folder-updating-mod-flag (buffer-modified-p)) @@ -196,6 +199,7 @@ is unchanged, otherwise it is cleared." "Format is (mh-in-show-buffer (SHOW-BUFFER) &body BODY). Display buffer SHOW-BUFFER in other window and execute BODY in it. Stronger than `save-excursion', weaker than `save-window-excursion'." + (declare (debug t)) (setq show-buffer (car show-buffer)) ; CL style `(let ((mh-in-show-buffer-saved-window (selected-window))) (switch-to-buffer-other-window ,show-buffer) @@ -212,6 +216,7 @@ Stronger than `save-excursion', weaker than `save-window-excursion'." After BODY has been executed return to original window. The modification flag of the buffer in the event window is preserved." + (declare (debug t)) (let ((event-window (make-symbol "event-window")) (event-position (make-symbol "event-position")) (original-window (make-symbol "original-window")) @@ -245,9 +250,9 @@ preserved." ;;; Sequences and Ranges ;;;###mh-autoload -(defmacro mh-seq-msgs (sequence) +(defsubst mh-seq-msgs (sequence) "Extract messages from the given SEQUENCE." - (list 'cdr sequence)) + (cdr sequence)) ;;;###mh-autoload (defmacro mh-iterate-on-messages-in-region (var begin end &rest body) @@ -257,6 +262,7 @@ VAR is bound to the message on the current line as we loop starting from BEGIN till END. In each step BODY is executed. If VAR is nil then the loop is executed without any binding." + (declare (debug (symbolp body))) (unless (symbolp var) (error "Can not bind the non-symbol %s" var)) (let ((binding-needed-flag var)) @@ -282,6 +288,7 @@ a string. In each iteration, BODY is executed. The parameter RANGE is usually created with `mh-interactive-range' in order to provide a uniform interface to MH-E functions." + (declare (debug (symbolp body))) (unless (symbolp var) (error "Can not bind the non-symbol %s" var)) (let ((binding-needed-flag var) diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index bed7b51960c..2ac7d08a31f 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -1982,7 +1982,7 @@ you would use \"(mh-set-cmd-note 4)\"." :package-version '(MH-E . "7.0")) (defun mh-scan-format-file-check (symbol value) - "Check if desired setting is legal. + "Check if desired setting is valid. Throw an error if user tries to set `mh-scan-format-file' to anything but t when `mh-adaptive-cmd-note-flag' is on. Otherwise, set SYMBOL to VALUE." @@ -2021,7 +2021,7 @@ Emacs start with 0)." :package-version '(MH-E . "6.0")) (defun mh-adaptive-cmd-note-flag-check (symbol value) - "Check if desired setting is legal. + "Check if desired setting is valid. Throw an error if user tries to turn on `mh-adaptive-cmd-note-flag' when `mh-scan-format-file' isn't t. Otherwise, set SYMBOL to VALUE." diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el index 87c59cd8136..fd64d8a6902 100644 --- a/lisp/mh-e/mh-seq.el +++ b/lisp/mh-e/mh-seq.el @@ -53,13 +53,13 @@ ;;; Macros -(defmacro mh-make-seq (name msgs) +(defsubst mh-make-seq (name msgs) "Create sequence NAME with the given MSGS." - (list 'cons name msgs)) + (cons name msgs)) -(defmacro mh-seq-name (sequence) +(defsubst mh-seq-name (sequence) "Extract sequence name from the given SEQUENCE." - (list 'car sequence)) + (car sequence)) diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el index 92038de52ae..2cf1b146911 100644 --- a/lisp/mh-e/mh-xface.el +++ b/lisp/mh-e/mh-xface.el @@ -360,8 +360,8 @@ This is only done if `mh-x-image-cache-directory' is nil." "Canonicalize URL. Replace the ?/ character with a ?! character and append .png. Also replaces special characters with `mh-url-hexify-string' -since not all characters, such as :, are legal within Windows -filenames. In addition, replaces * with %2a. See URL +since not all characters, such as :, are valid within Windows +filenames. In addition, replaces * with %2a. See URL `http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/iitemnamelimits/GetValidCharacters.asp'." (format "%s/%s.png" mh-x-image-cache-directory (mh-replace-regexp-in-string diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index ec138ca5d70..92f2253626f 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -297,7 +297,7 @@ ;; you would type: ;; C-x C-f /anonymous@ymir.claremont.edu:CSV/POLICY/RULES.MEM ;; -;; A legal VMS filename is of the form: FILE.TYPE;## +;; A valid VMS filename is of the form: FILE.TYPE;## ;; where FILE can be up to 39 characters ;; TYPE can be up to 39 characters ;; ## is a version number (an integer between 1 and 32,767) diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el index ea3161b3d97..c01da4fd50b 100644 --- a/lisp/net/net-utils.el +++ b/lisp/net/net-utils.el @@ -93,7 +93,7 @@ These options can be used to limit how many ICMP packets are emitted." :group 'net-utils :type '(repeat string)) -(defcustom ipconfig-program +(defcustom ifconfig-program (if (eq system-type 'windows-nt) "ipconfig" "ifconfig") @@ -101,11 +101,13 @@ These options can be used to limit how many ICMP packets are emitted." :group 'net-utils :type 'string) -(defcustom ipconfig-program-options +(define-obsolete-variable-alias 'ipconfig-program 'ifconfig-program "22.2") + +(defcustom ifconfig-program-options (list (if (eq system-type 'windows-nt) "/all" "-a")) - "Options for ipconfig-program." + "Options for `ifconfig-program'." :group 'net-utils :type '(repeat string)) @@ -121,6 +123,9 @@ These options can be used to limit how many ICMP packets are emitted." :type '(repeat string) :version "23.1") +(define-obsolete-variable-alias 'ipconfig-program-options + 'ifconfig-program-options "22.2") + (defcustom netstat-program "netstat" "Program to print network statistics." :group 'net-utils @@ -364,18 +369,18 @@ If your system's ping continues until interrupted, you can try setting options))) ;;;###autoload -(defun ipconfig () - "Run ipconfig program." +(defun ifconfig () + "Run ifconfig program." (interactive) (net-utils-run-program - "Ipconfig" - (concat "** Ipconfig ** " ipconfig-program " ** ") - ipconfig-program - ipconfig-program-options)) + "Ifconfig" + (concat "** Ifconfig ** " ifconfig-program " ** ") + ifconfig-program + ifconfig-program-options)) -;; This is the normal name on most Unixes. +;; Windows uses this name. ;;;###autoload -(defalias 'ifconfig 'ipconfig) +(defalias 'ipconfig 'ifconfig) ;;;###autoload (defun iwconfig () diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 4a41ed96f74..eda3f1aeaee 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -2137,23 +2137,24 @@ keywords when no KEYWORD is given." string)) (defvar rcirc-url-regexp - (rx-to-string - `(and word-boundary - (or (and - (or (and (or "http" "https" "ftp" "file" "gopher" "news" - "telnet" "wais" "mailto") - "://") - "www.") - (1+ (char "-a-zA-Z0-9_.")) - (1+ (char "-a-zA-Z0-9_")) - (optional ":" (1+ (char "0-9")))) - (and (1+ (char "-a-zA-Z0-9_.")) - (or ".com" ".net" ".org") - word-boundary)) - (optional - (and "/" - (1+ (char "-a-zA-Z0-9_='!?#$\@~`%&*+|\\/:;.,{}[]()")) - (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]()"))))) + (concat + "\\b\\(\\(www\\.\\|\\(s?https?\\|ftp\\|file\\|gopher\\|" + "nntp\\|news\\|telnet\\|wais\\|mailto\\|info\\):\\)" + "\\(//[-a-z0-9_.]+:[0-9]*\\)?" + (if (string-match "[[:digit:]]" "1") ;; Support POSIX? + (let ((chars "-a-z0-9_=#$@~%&*+\\/[:word:]") + (punct "!?:;.,")) + (concat + "\\(?:" + ;; Match paired parentheses, e.g. in Wikipedia URLs: + "[" chars punct "]+" "(" "[" chars punct "]+" "[" chars "]*)" "[" chars "]" + "\\|" + "[" chars punct "]+" "[" chars "]" + "\\)")) + (concat ;; XEmacs 21.4 doesn't support POSIX. + "\\([-a-z0-9_=!?#$@~%&*+\\/:;.,]\\|\\w\\)+" + "\\([-a-z0-9_=#$@~%&*+\\/]\\|\\w\\)")) + "\\)") "Regexp matching URLs. Set to nil to disable URL features in rcirc.") (defun rcirc-browse-url (&optional arg) diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index 39e66b049c0..256493f30bd 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el @@ -5180,12 +5180,9 @@ Return nil if no body was found." (defconst ada-font-lock-syntactic-keywords ;; Mark single quotes as having string quote syntax in 'c' instances. - ;; As a special case, ''' will not be highlighted, but if we do not - ;; set this special case, then the rest of the buffer is highlighted as - ;; a string - ;; This sets the properties of the characters, so that ada-in-string-p - ;; correctly handles '"' too... - '(("[^a-zA-Z0-9)]\\('\\)[^'\n]\\('\\)" (1 (7 . ?')) (2 (7 . ?'))) + ;; We used to explicitly avoid ''' as a special case for fear the buffer + ;; be highlighted as a string, but it seems this fear is unfounded. + '(("[^a-zA-Z0-9)]\\('\\)[^\n]\\('\\)" (1 (7 . ?')) (2 (7 . ?'))) ("^[ \t]*\\(#\\(if\\|else\\|elsif\\|end\\)\\)" (1 (11 . ?\n))))) (defvar ada-font-lock-keywords diff --git a/lisp/progmodes/cc-awk.el b/lisp/progmodes/cc-awk.el index b361585422a..8833f279dde 100644 --- a/lisp/progmodes/cc-awk.el +++ b/lisp/progmodes/cc-awk.el @@ -53,6 +53,8 @@ ;; Silence the byte compiler. (cc-bytecomp-defvar font-lock-mode) ; Checked with boundp before use. +(cc-bytecomp-defvar c-new-BEG) +(cc-bytecomp-defvar c-new-END) ;; Some functions in cc-engine that are used below. There's a cyclic ;; dependency so it can't be required here. (Perhaps some functions @@ -213,7 +215,7 @@ "\\([{}@` \t]\\|\\+\\+\\|--\\|\\\\.\\)") ;; 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 +;; escaped character. Or one of the (invalid) characters @ or `. But NOT an ;; end of line (even if escaped). (defconst c-awk-neutrals*-re (concat "\\(" c-awk-neutral-re "\\)*")) @@ -624,22 +626,25 @@ (forward-line -1)) (point)) -(defun c-awk-end-of-logical-line (&optional pos) -;; Go forward to the end of the (apparent) current logical line (or the end of -;; the line containing POS), returning the buffer position of that point. I.e., -;; go to the end of the next line which doesn't have an escaped EOL. +(defun c-awk-beyond-logical-line (&optional pos) +;; Return the position just beyond the (apparent) current logical line, or the +;; one containing POS. This is usually the beginning of the next line which +;; doesn't follow an escaped EOL. At EOB, this will be EOB. +;; +;; Point is unchanged. ;; ;; This is guaranteed to be "safe" for syntactic analysis, i.e. outwith any ;; comment, string or regexp. IT MAY WELL BE that this function should not be ;; executed on a narrowed buffer. -;; -;; This function might do hidden buffer changes. - (if pos (goto-char pos)) - (end-of-line) - (while (and (< (point) (point-max)) - (eq (char-before) ?\\)) - (end-of-line 2)) - (point)) + (save-excursion + (if pos (goto-char pos)) + (end-of-line) + (while (and (< (point) (point-max)) + (eq (char-before) ?\\)) + (end-of-line 2)) + (if (< (point) (point-max)) + (1+ (point)) + (point)))) ;; ACM, 2002/02/15: The idea of the next function is to put the "Error font" ;; on strings/regexps which are missing their closing delimiter. @@ -712,7 +717,7 @@ ;; ;; The result is what ANCHOR-STATE-/DIV (see above) is where point is left. ;; - ;; This function might do hidden buffer changes. + ;; This function does hidden buffer changes. (let ((/point (point))) (goto-char anchor) ;; Analyse the line to find out what the / is. @@ -780,55 +785,38 @@ (c-awk-syntax-tablify-/ anchor anchor-state-/div)))) nil)) - ;; ACM, 2002/07/21: Thoughts: We need an AWK Mode after-change function to set ;; the syntax-table properties even when font-lock isn't enabled, for the ;; subsequent use of movement functions, etc. However, it seems that if font ;; lock _is_ enabled, we can always leave it to do the job. -(defvar c-awk-old-EOLL 0) -(make-variable-buffer-local 'c-awk-old-EOLL) -;; End of logical line following the region which is about to be changed. Set -;; in c-awk-before-change and used in c-awk-after-change. +(defvar c-awk-old-ByLL 0) +(make-variable-buffer-local 'c-awk-old-Byll) +;; Just beyond logical line following the region which is about to be changed. +;; Set in c-awk-record-region-clear-NL and used in c-awk-after-change. -(defun c-awk-before-change (beg end) +(defun c-awk-record-region-clear-NL (beg end) ;; This function is called exclusively from the before-change-functions hook. ;; It does two things: Finds the end of the (logical) line on which END lies, -;; and clears c-awk-NL-prop text properties from this point onwards. +;; and clears c-awk-NL-prop text properties from this point onwards. BEG is +;; ignored. ;; -;; This function might do hidden buffer changes. - (save-restriction - (save-excursion - (setq c-awk-old-EOLL (c-awk-end-of-logical-line end)) - (c-save-buffer-state nil - (c-awk-clear-NL-props end (point-max)))))) +;; On entry, the buffer will have been widened and match-data will have been +;; saved; point is undefined on both entry and exit; the return value is +;; ignored. +;; +;; This function does hidden buffer changes. + (c-save-buffer-state () + (setq c-awk-old-ByLL (c-awk-beyond-logical-line end)) + (c-save-buffer-state nil + (c-awk-clear-NL-props end (point-max))))) (defun c-awk-end-of-change-region (beg end old-len) ;; Find the end of the region which needs to be font-locked after a change. ;; This is the end of the logical line on which the change happened, either ;; as it was before the change, or as it is now, whichever is later. ;; N.B. point is left undefined. - ;; - ;; This function might do hidden buffer changes. - (max (+ (- c-awk-old-EOLL old-len) (- end beg)) - (c-awk-end-of-logical-line end))) - -(defun c-awk-after-change (beg end old-len) -;; This function is called exclusively as an after-change function in -;; AWK Mode. It ensures that the syntax-table properties get set in the -;; changed region. However, if font-lock is enabled, this function does -;; nothing, since an enabled font-lock after-change function will always do -;; this. -;; -;; This function might do hidden buffer changes. - (unless (and (boundp 'font-lock-mode) font-lock-mode) - (save-restriction - (save-excursion - (save-match-data - (setq end (c-awk-end-of-change-region beg end old-len)) - (c-awk-beginning-of-logical-line beg) - (c-save-buffer-state nil ; So that read-only status isn't affected. - ; (e.g. when first loading the buffer) - (c-awk-set-syntax-table-properties end))))))) + (max (+ (- c-awk-old-ByLL old-len) (- end beg)) + (c-awk-beyond-logical-line end))) ;; ACM 2002/5/25. When font-locking is invoked by a buffer change, the region ;; specified by the font-lock after-change function must be expanded to @@ -836,22 +824,28 @@ ;; do this in practice is to use the beginning/end-of-logical-line functions. ;; Don't overlook the possibility of the buffer change being the "recapturing" ;; of a previously escaped newline. -(defmacro c-awk-advise-fl-for-awk-region (function) - `(defadvice ,function (before get-awk-region activate) -;; When font-locking an AWK Mode buffer, make sure that any string/regexp is -;; completely font-locked. - (when (eq major-mode 'awk-mode) - (save-excursion - (ad-set-arg 1 (c-awk-end-of-change-region - (ad-get-arg 0) ; beg - (ad-get-arg 1) ; end - (ad-get-arg 2))) ; old-len - (ad-set-arg 0 (c-awk-beginning-of-logical-line (ad-get-arg 0))))))) - -(c-awk-advise-fl-for-awk-region font-lock-after-change-function) -(c-awk-advise-fl-for-awk-region jit-lock-after-change) -(c-awk-advise-fl-for-awk-region lazy-lock-defer-rest-after-change) -(c-awk-advise-fl-for-awk-region lazy-lock-defer-line-after-change) + +;; ACM 2008-02-05: +(defun c-awk-extend-and-syntax-tablify-region (beg end old-len) + ;; Expand the region (BEG END) as needed to (c-new-BEG c-new-END) then put + ;; `syntax-table' properties on this region. + ;; + ;; This function is called from an after-change function, BEG END and + ;; OLD-LEN being the standard parameters. + ;; + ;; Point is undefined both before and after this function call, the buffer + ;; has been widened, and match-data saved. The return value is ignored. + ;; + ;; It prepares the buffer for font + ;; locking, hence must get called before `font-lock-after-change-function'. + ;; + ;; This function is the AWK value of `c-before-font-lock-function'. + ;; It does hidden buffer changes. + (c-save-buffer-state () + (setq c-new-END (c-awk-end-of-change-region beg end old-len)) + (setq c-new-BEG (c-awk-beginning-of-logical-line beg)) + (goto-char c-new-BEG) + (c-awk-set-syntax-table-properties c-new-END))) ;; Awk regexps written with help from Peter Galbraith ;; <galbraith@mixing.qc.dfo.ca>. diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index 2d4cc982714..dadd741f0fc 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -721,7 +721,7 @@ be after it." ((bobp) (setq pos (point-min))) ((not pos) (let ((distance (skip-chars-backward "^{"))) - ;; unbalanced parenthesis, while illegal C code, + ;; unbalanced parenthesis, while invalid C code, ;; shouldn't cause an infloop! See unbal.c (when (zerop distance) ;; Punt! @@ -1028,6 +1028,39 @@ MODE is either a mode symbol or a list of mode symbols." ;; Emacs. `(remove-text-properties ,from ,to '(,property nil)))) +(defun c-clear-char-property-with-value-function (from to property value) + "Remove all text-properties PROPERTY from the region (FROM, TO) +which have the value VALUE, as tested by `equal'. These +properties are assumed to be over individual characters, having +been put there by c-put-char-property. POINT remains unchanged." + (let ((place from) end-place) + (while ; loop round occurrances of (PROPERTY VALUE) + (progn + (while ; loop round changes in PROPERTY till we find VALUE + (and + (< place to) + (not (equal (get-text-property place property) value))) + (setq place (next-single-property-change place property nil to))) + (< place to)) + (setq end-place (next-single-property-change place property nil to)) + (put-text-property place end-place property nil) + ;; Do we have to do anything with stickiness here? + (setq place end-place)))) + +(defmacro c-clear-char-property-with-value (from to property value) + "Remove all text-properties PROPERTY from the region [FROM, TO) +which have the value VALUE, as tested by `equal'. These +properties are assumed to be over individual characters, having +been put there by c-put-char-property. POINT remains unchanged." + (if c-use-extents + ;; XEmacs + `(let ((-property- ,property)) + (map-extents (lambda (ext val) + (if (equal (extent-property ext -property-) val) + (delete-extent ext))) + nil ,from ,to ,value nil -property-)) + ;; Gnu Emacs + `(c-clear-char-property-with-value-function ,from ,to ,property ,value))) ;; Macros to put overlays (Emacs) or extents (XEmacs) on buffer text. ;; For our purposes, these are characterized by being possible to diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 48bbcaf18cf..6ccd41a164c 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -81,8 +81,9 @@ ;; assume that these text properties are used as described here. ;; ;; 'syntax-table -;; Used to modify the syntax of some characters. Currently used to -;; mark the "<" and ">" of angle bracket parens with paren syntax. +;; Used to modify the syntax of some characters. It is used to +;; mark the "<" and ">" of angle bracket parens with paren syntax, and +;; to "hide" obtrusive characters in preprocessor lines. ;; ;; This property is used on single characters and is therefore ;; always treated as front and rear nonsticky (or start and end open diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el index 69774b6ce9c..60045a0adec 100644 --- a/lisp/progmodes/cc-fonts.el +++ b/lisp/progmodes/cc-fonts.el @@ -394,14 +394,14 @@ stuff. Used on level 1 and higher." `(;; The stuff after #error and #warning is a message, so ;; fontify it as a string. ,@(when (c-lang-const c-cpp-message-directives) - (let* ((re (c-make-keywords-re nil + (let* ((re (c-make-keywords-re 'appendable ; nil (c-lang-const c-cpp-message-directives))) (re-depth (regexp-opt-depth re))) `((,(concat noncontinued-line-end (c-lang-const c-opt-cpp-prefix) re "\\s +\\(.*\\)$") - ,(+ ncle-depth re-depth 1) font-lock-string-face)))) + ,(+ ncle-depth re-depth 1) font-lock-string-face t)))) ;; Fontify filenames in #include <...> as strings. ,@(when (c-lang-const c-cpp-include-directives) diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 54725c0fd88..c2a3c68e2c4 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el @@ -414,6 +414,49 @@ the new syntax, as accepted by `modify-syntax-entry'." classifies symbol constituents like '_' and '$' as word constituents, so that all identifiers are recognized as words.") +(c-lang-defconst c-get-state-before-change-function + "If non-nil, a function called from c-before-change-hook. +Typically it will record enough state to allow +`c-before-font-lock-function' to extend the region to fontify, +and may do such things as removing text-properties which must be +recalculated. + +It takes 2 parameters, the BEG and END supplied to every +before-change function; on entry, the buffer will have been +widened and match-data will have been saved; point is undefined +on both entry and exit; the return value is ignored. + +When the mode is initialized, this function is called with +parameters \(point-min) and \(point-max)." + t nil + (c c++ objc) 'c-extend-region-for-CPP + awk 'c-awk-record-region-clear-NL) +(c-lang-defvar c-get-state-before-change-function + (c-lang-const c-get-state-before-change-function)) + +(c-lang-defconst c-before-font-lock-function + "If non-nil, a function called just before font locking. +Typically it will extend the region about to be fontified \(see +below) and will set `syntax-table' text properties on the region. + +It takes 3 parameters, the BEG, END, and OLD-LEN supplied to +every after-change function; point is undefined on both entry and +exit; on entry, the buffer will have been widened and match-data +will have been saved; the return value is ignored. + +The function may extend the region to be fontified by setting the +buffer local variables c-old-BEG and c-old-LEN. + +The function is called even when font locking is disabled. + +When the mode is initialized, this function is called with +parameters \(point-min), \(point-max) and <buffer size>." + t nil + (c c++ objc) 'c-neutralize-syntax-in-CPP + awk 'c-awk-extend-and-syntax-tablify-region) +(c-lang-defvar c-before-font-lock-function + (c-lang-const c-before-font-lock-function)) + ;;; Lexer-level syntax (identifiers, tokens etc). @@ -645,6 +688,13 @@ Assumed to not contain any submatches or \\| operators." (java awk) nil) (c-lang-defvar c-opt-cpp-prefix (c-lang-const c-opt-cpp-prefix)) +(c-lang-defconst c-anchored-cpp-prefix + "Regexp matching the prefix of a cpp directive anchored to BOL, +in the languages that have a macro preprocessor." + t (if (c-lang-const c-opt-cpp-prefix) + (concat "^" (c-lang-const c-opt-cpp-prefix)))) +(c-lang-defvar c-anchored-cpp-prefix (c-lang-const c-anchored-cpp-prefix)) + (c-lang-defconst c-opt-cpp-start "Regexp matching the prefix of a cpp directive including the directive name, or nil in languages without preprocessor support. The first @@ -662,7 +712,7 @@ submatch surrounds the directive name." string message." t (if (c-lang-const c-opt-cpp-prefix) '("error")) - pike '("error" "warning")) + (c c++ objc pike) '("error" "warning")) (c-lang-defconst c-cpp-include-directives "List of cpp directives (without the prefix) that are followed by a @@ -700,7 +750,7 @@ definition, or nil if the language doesn't have any." (c-lang-const c-opt-cpp-macro-define-id)) (c-lang-defconst c-cpp-expr-directives - "List if cpp directives (without the prefix) that are followed by an + "List of cpp directives (without the prefix) that are followed by an expression." t (if (c-lang-const c-opt-cpp-prefix) '("if" "elif"))) diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 09ca49fe447..607ee54e30f 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -467,117 +467,6 @@ preferably use the `c-mode-menu' language constant directly." (defvar c-maybe-stale-found-type nil) (make-variable-buffer-local 'c-maybe-stale-found-type) -(defun c-before-change (beg end) - ;; Function to be put on `before-change-function'. Currently - ;; (2007-02) it is used only to remove stale entries from the - ;; `c-found-types' cache, and to record entries which a - ;; `c-after-change' function might confirm as stale. - ;; - ;; Note that this function must be FAST rather than accurate. Note - ;; also that it only has any effect when font locking is enabled. - ;; We exploit this by checking for font-lock-*-face instead of doing - ;; rigourous syntactic analysis. - - ;; If either change boundary is wholly inside an identifier, delete - ;; it/them from the cache. Don't worry about being inside a string - ;; or a comment - "wrongly" removing a symbol from `c-found-types' - ;; isn't critical. - (setq c-maybe-stale-found-type nil) - (save-restriction - (save-match-data - (widen) - (save-excursion - ;; Are we inserting/deleting stuff in the middle of an identifier? - (c-unfind-enclosing-token beg) - (c-unfind-enclosing-token end) - ;; Are we coalescing two tokens together, e.g. "fo o" -> "foo"? - (when (< beg end) - (c-unfind-coalesced-tokens beg end)) - ;; Are we (potentially) disrupting the syntactic context which - ;; makes a type a type? E.g. by inserting stuff after "foo" in - ;; "foo bar;", or before "foo" in "typedef foo *bar;"? - ;; - ;; We search for appropriate c-type properties "near" the change. - ;; First, find an appropriate boundary for this property search. - (let (lim - type type-pos - marked-id term-pos - (end1 - (or (and (eq (get-text-property end 'face) 'font-lock-comment-face) - (previous-single-property-change end 'face)) - end))) - (when (>= end1 beg) ; Don't hassle about changes entirely in comments. - ;; Find a limit for the search for a `c-type' property - (while - (and (/= (skip-chars-backward "^;{}") 0) - (> (point) (point-min)) - (memq (c-get-char-property (1- (point)) 'face) - '(font-lock-comment-face font-lock-string-face)))) - (setq lim (max (point-min) (1- (point)))) - - ;; Look for the latest `c-type' property before end1 - (when (and (> end1 (point-min)) - (setq type-pos - (if (get-text-property (1- end1) 'c-type) - end1 - (previous-single-property-change end1 'c-type nil lim)))) - (setq type (get-text-property (max (1- type-pos) lim) 'c-type)) - - (when (memq type '(c-decl-id-start c-decl-type-start)) - ;; Get the identifier, if any, that the property is on. - (goto-char (1- type-pos)) - (setq marked-id - (when (looking-at "\\(\\sw\\|\\s_\\)") - (c-beginning-of-current-token) - (buffer-substring-no-properties (point) type-pos))) - - (goto-char end1) - (skip-chars-forward "^;{}") ; FIXME!!! loop for comment, maybe - (setq lim (point)) - (setq term-pos - (or (next-single-property-change end 'c-type nil lim) lim)) - (setq c-maybe-stale-found-type - (list type marked-id - type-pos term-pos - (buffer-substring-no-properties type-pos term-pos) - (buffer-substring-no-properties beg end))))))))))) - -(defun c-after-change (beg end old-len) - ;; Function put on `after-change-functions' to adjust various caches - ;; etc. Prefer speed to finesse here, since there will be an order - ;; of magnitude more calls to this function than any of the - ;; functions that use the caches. - ;; - ;; Note that care must be taken so that this is called before any - ;; font-lock callbacks since we might get calls to functions using - ;; these caches from inside them, and we must thus be sure that this - ;; has already been executed. - - (c-save-buffer-state () - ;; When `combine-after-change-calls' is used we might get calls - ;; with regions outside the current narrowing. This has been - ;; observed in Emacs 20.7. - (save-restriction - (save-match-data ; c-recognize-<>-arglists changes match-data - (widen) - - (when (> end (point-max)) - ;; Some emacsen might return positions past the end. This has been - ;; observed in Emacs 20.7 when rereading a buffer changed on disk - ;; (haven't been able to minimize it, but Emacs 21.3 appears to - ;; work). - (setq end (point-max)) - (when (> beg end) - (setq beg end))) - - (c-trim-found-types beg end old-len) ; maybe we don't need all of these. - (c-invalidate-sws-region-after beg end) - (c-invalidate-state-cache beg) - (c-invalidate-find-decl-cache beg) - - (when c-recognize-<>-arglists - (c-after-change-check-<>-operators beg end)))))) - (defun c-basic-common-init (mode default-style) "Do the necessary initialization for the syntax handling routines and the line breaking/filling code. Intended to be used by other @@ -625,7 +514,8 @@ that requires a literal mode spec at compile time." (setq fill-paragraph-function 'c-fill-paragraph) (when (or c-recognize-<>-arglists - (c-major-mode-is 'awk-mode)) + (c-major-mode-is 'awk-mode) + (c-major-mode-is '(c-mode c++-mode objc-mode))) ;; We'll use the syntax-table text property to change the syntax ;; of some chars for this language, so do the necessary setup for ;; that. @@ -712,34 +602,6 @@ that requires a literal mode spec at compile time." (make-local-hook 'after-change-functions) (add-hook 'after-change-functions 'c-after-change nil t)) -(defun c-after-font-lock-init () - ;; Put on `font-lock-mode-hook'. - (remove-hook 'after-change-functions 'c-after-change t) - (add-hook 'after-change-functions 'c-after-change nil t)) - -(defun c-font-lock-init () - "Set up the font-lock variables for using the font-lock support in CC Mode. -This does not load the font-lock package. Use after -`c-basic-common-init' and after cc-fonts has been loaded." - - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults - `(,(if (c-major-mode-is 'awk-mode) - ;; awk-mode currently has only one font lock level. - 'awk-font-lock-keywords - (mapcar 'c-mode-symbol - '("font-lock-keywords" "font-lock-keywords-1" - "font-lock-keywords-2" "font-lock-keywords-3"))) - nil nil - ,c-identifier-syntax-modifications - c-beginning-of-syntax - (font-lock-lines-before . 1) - (font-lock-mark-block-function - . c-mark-function))) - - (make-local-hook 'font-lock-mode-hook) - (add-hook 'font-lock-mode-hook 'c-after-font-lock-init nil t)) - (defun c-setup-doc-comment-style () "Initialize the variables that depend on the value of `c-doc-comment-style'." (when (and (featurep 'font-lock) @@ -769,6 +631,16 @@ compatible with old code; callers should always specify it." ;; Only initialize font locking if we aren't called from an old package. (c-font-lock-init)) + ;; Starting a mode is a sort of "change". So call the change functions... + (save-restriction + (widen) + (save-excursion + (if c-get-state-before-change-function + (funcall c-get-state-before-change-function (point-min) (point-max))) + (if c-before-font-lock-function + (funcall c-before-font-lock-function (point-min) (point-max) + (- (point-max) (point-min)))))) + (make-local-variable 'outline-regexp) (make-local-variable 'outline-level) (setq outline-regexp "[^#\n\^M]" @@ -878,6 +750,280 @@ Note that the style variables are always made local to the buffer." `(progn ,@(mapcar (lambda (hook) `(run-hooks ,hook)) hooks)))) +;;; Change hooks, linking with Font Lock. + +;; Buffer local variables defining the region to be fontified by a font lock +;; after-change function. They are set in c-after-change to +;; after-change-function's BEG and END, and may be modified by a +;; `c-before-font-lock-function'. +(defvar c-new-BEG 0) +(make-variable-buffer-local 'c-new-BEG) +(defvar c-new-END 0) +(make-variable-buffer-local 'c-new-END) + +;; Buffer local variables recording Beginning/End-of-Macro position before a +;; change, when a macro straddles, respectively, the BEG or END (or both) of +;; the change region. Otherwise these have the values BEG/END. +(defvar c-old-BOM 0) +(make-variable-buffer-local 'c-old-BOM) +(defvar c-old-EOM 0) +(make-variable-buffer-local 'c-old-EOM) + +(defun c-extend-region-for-CPP (beg end) + ;; Set c-old-BOM or c-old-EOM respectively to BEG, END, each extended to the + ;; beginning/end of any preprocessor construct they may be in. + ;; + ;; Point is undefined both before and after this function call; the buffer + ;; has already been widened, and match-data saved. The return value is + ;; meaningless. + ;; + ;; This function is the C/C++/ObjC value of + ;; `c-get-state-before-change-function' and is called exclusively as a + ;; before change function. + (goto-char beg) + (c-beginning-of-macro) + (setq c-old-BOM (point)) + + (goto-char end) + (if (c-beginning-of-macro) + (c-end-of-macro)) + (setq c-old-EOM (point))) + +(defun c-neutralize-CPP-line (beg end) + ;; BEG and END bound a preprocessor line. Put a "punctuation" syntax-table + ;; property on syntactically obtrusive characters, ones which would interact + ;; syntactically with stuff outside the CPP line. + ;; + ;; These are unmatched string delimiters, or unmatched + ;; parens/brackets/braces. An unclosed comment is regarded as valid, NOT + ;; obtrusive. + (let (s) + (while + (progn + (setq s (parse-partial-sexp beg end -1)) + (cond + ((< (nth 0 s) 0) ; found an unmated ),},] + (c-put-char-property (1- (point)) 'syntax-table '(1)) + t) + ((nth 3 s) ; In a string + (c-put-char-property (nth 8 s) 'syntax-table '(1)) + t) + ((> (nth 0 s) 0) ; In a (,{,[ + (c-put-char-property (nth 1 s) 'syntax-table '(1)) + t) + (t nil)))))) + +(defun c-neutralize-syntax-in-CPP (begg endd old-len) + ;; "Neutralize" every preprocessor line wholly or partially in the changed + ;; region. "Restore" lines which were CPP lines before the change and are + ;; no longer so; these can be located from the Buffer local variables + ;; c-old-[EB]OM. + ;; + ;; That is, set syntax-table properties on characters that would otherwise + ;; interact syntactically with those outside the CPP line(s). + ;; + ;; This function is called from an after-change function, BEGG ENDD and + ;; OLD-LEN being the standard parameters. It prepares the buffer for font + ;; locking, hence must get called before `font-lock-after-change-function'. + ;; + ;; Point is undefined both before and after this function call, the buffer + ;; has been widened, and match-data saved. The return value is ignored. + ;; + ;; This function is the C/C++/ObjC value of `c-before-font-lock-function'. + ;; + ;; This function might do invisible changes. + (c-save-buffer-state (limits mbeg beg end) + ;; First calculate the region, possibly to be extended. + (setq beg (min begg c-old-BOM)) + (goto-char endd) + (when (c-beginning-of-macro) + (c-end-of-macro)) + (setq end (max (+ (- c-old-EOM old-len) (- endd begg)) + (point))) + ;; Clear all old punctuation properties + (c-clear-char-property-with-value beg end 'syntax-table '(1)) + + (goto-char beg) + ;; If we're inside a string/comment, go to its end. + (if (setq limits (c-literal-limits)) + (goto-char (cdr limits))) + + (while (and (< (point) end) + (search-forward-regexp c-anchored-cpp-prefix end t)) + (when (c-beginning-of-macro) ; Guard against being in a string/comment. + (setq mbeg (point)) + (c-end-of-macro) ; Do we need to go forward 1 char here? No! + (c-neutralize-CPP-line mbeg (point))) + (forward-char)))) ; We might still be in a comment - this is OK. + +(defun c-before-change (beg end) + ;; Function to be put on `before-change-function'. Primarily, this calls + ;; the language dependent `c-get-state-before-change-function'. It is + ;; otherwise used only to remove stale entries from the `c-found-types' + ;; cache, and to record entries which a `c-after-change' function might + ;; confirm as stale. + ;; + ;; Note that this function must be FAST rather than accurate. Note + ;; also that it only has any effect when font locking is enabled. + ;; We exploit this by checking for font-lock-*-face instead of doing + ;; rigourous syntactic analysis. + + ;; If either change boundary is wholly inside an identifier, delete + ;; it/them from the cache. Don't worry about being inside a string + ;; or a comment - "wrongly" removing a symbol from `c-found-types' + ;; isn't critical. + (setq c-maybe-stale-found-type nil) + (save-restriction + (save-match-data + (widen) + (save-excursion + ;; Are we inserting/deleting stuff in the middle of an identifier? + (c-unfind-enclosing-token beg) + (c-unfind-enclosing-token end) + ;; Are we coalescing two tokens together, e.g. "fo o" -> "foo"? + (when (< beg end) + (c-unfind-coalesced-tokens beg end)) + ;; Are we (potentially) disrupting the syntactic context which + ;; makes a type a type? E.g. by inserting stuff after "foo" in + ;; "foo bar;", or before "foo" in "typedef foo *bar;"? + ;; + ;; We search for appropriate c-type properties "near" the change. + ;; First, find an appropriate boundary for this property search. + (let (lim + type type-pos + marked-id term-pos + (end1 + (or (and (eq (get-text-property end 'face) 'font-lock-comment-face) + (previous-single-property-change end 'face)) + end))) + (when (>= end1 beg) ; Don't hassle about changes entirely in comments. + ;; Find a limit for the search for a `c-type' property + (while + (and (/= (skip-chars-backward "^;{}") 0) + (> (point) (point-min)) + (memq (c-get-char-property (1- (point)) 'face) + '(font-lock-comment-face font-lock-string-face)))) + (setq lim (max (point-min) (1- (point)))) + + ;; Look for the latest `c-type' property before end1 + (when (and (> end1 (point-min)) + (setq type-pos + (if (get-text-property (1- end1) 'c-type) + end1 + (previous-single-property-change end1 'c-type nil lim)))) + (setq type (get-text-property (max (1- type-pos) lim) 'c-type)) + + (when (memq type '(c-decl-id-start c-decl-type-start)) + ;; Get the identifier, if any, that the property is on. + (goto-char (1- type-pos)) + (setq marked-id + (when (looking-at "\\(\\sw\\|\\s_\\)") + (c-beginning-of-current-token) + (buffer-substring-no-properties (point) type-pos))) + + (goto-char end1) + (skip-chars-forward "^;{}") ; FIXME!!! loop for comment, maybe + (setq lim (point)) + (setq term-pos + (or (next-single-property-change end 'c-type nil lim) lim)) + (setq c-maybe-stale-found-type + (list type marked-id + type-pos term-pos + (buffer-substring-no-properties type-pos term-pos) + (buffer-substring-no-properties beg end))))))) + + (setq c-new-BEG beg + c-new-END end) + (if c-get-state-before-change-function + (funcall c-get-state-before-change-function beg end)) + )))) + +(defun c-after-change (beg end old-len) + ;; Function put on `after-change-functions' to adjust various caches + ;; etc. Prefer speed to finesse here, since there will be an order + ;; of magnitude more calls to this function than any of the + ;; functions that use the caches. + ;; + ;; Note that care must be taken so that this is called before any + ;; font-lock callbacks since we might get calls to functions using + ;; these caches from inside them, and we must thus be sure that this + ;; has already been executed. + ;; + ;; This calls the language variable c-before-font-lock-function, if non nil. + ;; This typically sets `syntax-table' properties. + + (c-save-buffer-state () + ;; When `combine-after-change-calls' is used we might get calls + ;; with regions outside the current narrowing. This has been + ;; observed in Emacs 20.7. + (save-restriction + (save-match-data ; c-recognize-<>-arglists changes match-data + (widen) + + (when (> end (point-max)) + ;; Some emacsen might return positions past the end. This has been + ;; observed in Emacs 20.7 when rereading a buffer changed on disk + ;; (haven't been able to minimize it, but Emacs 21.3 appears to + ;; work). + (setq end (point-max)) + (when (> beg end) + (setq beg end))) + + (c-trim-found-types beg end old-len) ; maybe we don't need all of these. + (c-invalidate-sws-region-after beg end) + (c-invalidate-state-cache beg) + (c-invalidate-find-decl-cache beg) + + (when c-recognize-<>-arglists + (c-after-change-check-<>-operators beg end)) + + (if c-before-font-lock-function + (save-excursion + (funcall c-before-font-lock-function beg end old-len))))))) + +(defun c-after-font-lock-init () + ;; Put on `font-lock-mode-hook'. + (remove-hook 'after-change-functions 'c-after-change t) + (add-hook 'after-change-functions 'c-after-change nil t)) + +(defun c-font-lock-init () + "Set up the font-lock variables for using the font-lock support in CC Mode. +This does not load the font-lock package. Use after +`c-basic-common-init' and after cc-fonts has been loaded." + + (make-local-variable 'font-lock-defaults) + (setq font-lock-defaults + `(,(if (c-major-mode-is 'awk-mode) + ;; awk-mode currently has only one font lock level. + 'awk-font-lock-keywords + (mapcar 'c-mode-symbol + '("font-lock-keywords" "font-lock-keywords-1" + "font-lock-keywords-2" "font-lock-keywords-3"))) + nil nil + ,c-identifier-syntax-modifications + c-beginning-of-syntax + (font-lock-lines-before . 1) + (font-lock-mark-block-function + . c-mark-function))) + + (make-local-hook 'font-lock-mode-hook) + (add-hook 'font-lock-mode-hook 'c-after-font-lock-init nil t)) + +(defmacro c-advise-fl-for-region (function) + `(defadvice ,function (before get-awk-region activate) +;; When font-locking an AWK Mode buffer, make sure that any string/regexp is +;; completely font-locked. + (when (eq major-mode 'awk-mode) + (save-excursion + (ad-set-arg 1 c-new-END) ; end + (ad-set-arg 0 c-new-BEG))))) ; beg + +(c-advise-fl-for-region font-lock-after-change-function) +(c-advise-fl-for-region jit-lock-after-change) +(c-advise-fl-for-region lazy-lock-defer-rest-after-change) +(c-advise-fl-for-region lazy-lock-defer-line-after-change) + + ;; Support for C ;;;###autoload @@ -1339,21 +1485,7 @@ Key bindings: (use-local-map awk-mode-map) (c-init-language-vars-for 'awk-mode) (c-common-init 'awk-mode) - ;; The rest of CC Mode does not (yet) use `font-lock-syntactic-keywords', - ;; so it's not set by `c-font-lock-init'. - (make-local-variable 'font-lock-syntactic-keywords) - (setq font-lock-syntactic-keywords - '((c-awk-set-syntax-table-properties - 0 (0) ; Everything on this line is a dummy. - nil t))) (c-awk-unstick-NL-prop) - (add-hook 'before-change-functions 'c-awk-before-change nil t) - (add-hook 'after-change-functions 'c-awk-after-change nil t) - (c-save-buffer-state nil - (save-restriction - (widen) - (c-awk-clear-NL-props (point-min) (point-max)) - (c-awk-after-change (point-min) (point-max) 0))) ; Set syntax-table props. ;; Prevent Xemacs's buffer-syntactic-context being used. See the comment ;; in cc-engine.el, just before (defun c-fast-in-literal ... diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 26596e42ae8..de61feb39d3 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -423,7 +423,7 @@ STYLE using `c-set-style' if the optional SET-P flag is non-nil." (defun c-read-offset (langelem) ;; read new offset value for LANGELEM from minibuffer. return a - ;; legal value only + ;; valid value only (let* ((oldoff (cdr-safe (or (assq langelem c-offsets-alist) (assq langelem (get 'c-offsets-alist 'c-stylevar-fallback))))) @@ -555,7 +555,7 @@ variables." "[ \t\f]*\\\\?$") (setq c-sentence-end-with-esc-eol (concat "\\(\\(" (c-default-value-sentence-end) "\\)" - ;; N.B.: "$" would be illegal when not enclosed like "\\($\\)". + ;; N.B.: "$" would be invalid when not enclosed like "\\($\\)". "\\|" "[.?!][]\"')}]* ?\\\\\\($\\)[ \t\n]*" "\\)"))) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 65391251e25..e68441547b6 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1629,9 +1629,13 @@ Just inserts the text, but uses `insert-before-markers'." (defun compilation-next-error (n &optional different-file pt) "Move point to the next error in the compilation buffer. +This function does NOT find the source line like \\[next-error]. Prefix arg N says how many error messages to move forwards (or backwards, if negative). -Does NOT find the source line like \\[next-error]." +Optional arg DIFFERENT-FILE, if non-nil, means find next error for a +file that is different from the current one. +Optional arg PT, if non-nil, specifies the value of point to start +looking for the next message." (interactive "p") (or (compilation-buffer-p (current-buffer)) (error "Not in a compilation buffer")) @@ -1943,13 +1947,17 @@ and overlay is highlighted between MK and END-MK." (defun compilation-find-file (marker filename directory &rest formats) "Find a buffer for file FILENAME. +If FILENAME is not found at all, ask the user where to find it. +Pop up the buffer containing MARKER and scroll to MARKER if we ask +the user where to find the file. Search the directories in `compilation-search-path'. A nil in `compilation-search-path' means to try the \"current\" directory, which is passed in DIRECTORY. If DIRECTORY is relative, it is combined with `default-directory'. If DIRECTORY is nil, that means use `default-directory'. -If FILENAME is not found at all, ask the user where to find it. -Pop up the buffer containing MARKER and scroll to MARKER if we ask the user." +FORMATS, if given, is a list of formats to reformat FILENAME when +looking for it: for each element FMT in FORMATS, this function +attempts to find a file whose name is produced by (format FMT FILENAME)." (or formats (setq formats '("%s"))) (let ((dirs compilation-search-path) (spec-dir (if directory diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 6bdf79d16e7..8352c4eef60 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1247,7 +1247,7 @@ versions of Emacs." ["Contract groups" cperl-contract-levels cperl-use-syntax-table-text-property] "----" - ["Find next interpolated" cperl-next-interpolated-REx + ["Find next interpolated" cperl-next-interpolated-REx (next-single-property-change (point-min) 'REx-interpolated)] ["Find next interpolated (no //o)" cperl-next-interpolated-REx-0 @@ -2846,7 +2846,7 @@ Will not look before LIM." (skip-chars-backward " \t") (looking-at "[ \t]*[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:"))) (get-text-property (point) 'first-format-line))) - + ;; Look at previous line that's at column 0 ;; to determine whether we are in top-level decls ;; or function's arg decls. Set basic-indent accordingly. @@ -3080,7 +3080,7 @@ and closing parentheses and brackets." ((eq 'toplevel (elt i 0)) ;; [toplevel start char-after state immed-after-block] (+ (save-excursion ; To beg-of-defun, or end of last sexp (goto-char (elt i 1)) ; start = Good place to start parsing - (- (current-indentation) ; + (- (current-indentation) ; (if (elt i 4) cperl-indent-level 0))) ; immed-after-block (if (eq (elt i 2) ?{) cperl-continued-brace-offset 0) ; char-after ;; Look at previous line that's at column 0 @@ -3900,7 +3900,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', ;;; XXX What to do: foo <<bar ??? ;;; XXX Need to support print {a} <<B ??? (forward-sexp -1) - (save-match-data + (save-match-data ; $foo << b; $f .= <<B; ; ($f+1) << b; a($f) . <<B; ; foo 1, <<B; $x{a} <<b; @@ -3932,7 +3932,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', qtag (regexp-quote tag)) (cond (cperl-pod-here-fontify ;; Highlight the starting delimiter - (cperl-postpone-fontification + (cperl-postpone-fontification b1 e1 'face my-cperl-delimiters-face) (cperl-put-do-not-fontify b1 e1 t))) (forward-line) @@ -4292,7 +4292,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', ;;;m^a[\^b]c^ + m.a[^b]\.c.; (save-excursion (goto-char (1+ b)) - ;; First + ;; First (cperl-look-at-leading-count is-x-REx e) (setq hairy-RE (concat @@ -4453,7 +4453,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', ;; This is not pretty: the 5.8.7 logic: ;; \0numx -> octal (up to total 3 dig) ;; \DIGIT -> backref unless \0 - ;; \DIGITs -> backref if legal + ;; \DIGITs -> backref if valid ;; otherwise up to 3 -> octal ;; Do not try to distinguish, we guess ((or (and (memq qtag (append "01234567" nil)) @@ -4461,7 +4461,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', "\\=[01234567]?[01234567]?" (1- e) 'to-end)) (and (memq qtag (append "89" nil)) - (re-search-forward + (re-search-forward "\\=[0123456789]*" (1- e) 'to-end)) (and (eq qtag ?x) (re-search-forward @@ -4499,7 +4499,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face', ;; in m]]: m][\\\]\]] produces [\\]] ;;; POSIX? [:word:] [:^word:] only inside [] ;;; "\\=\\(\\\\.\\|[^][\\\\]\\|\\[:\\^?\sw+:]\\|\\[[^:]\\)*]") - (while + (while (and argument (re-search-forward (if (eq (char-after b) ?\] ) @@ -5816,7 +5816,7 @@ indentation and initial hashes. Behaves usually outside of comment." "," cperl-maybe-white-and-comment-rex "\\([$@%*]\\([a-zA-Z0-9_:]+\\|[^a-zA-Z0-9_]\\)\\)") - ;; Bug in font-lock: limit is used not only to limit + ;; Bug in font-lock: limit is used not only to limit ;; searches, but to set the "extend window for ;; facification" property. Thus we need to minimize. ,(if cperl-font-lock-multiline @@ -6785,7 +6785,7 @@ construct. DONE-TO and STATEPOS indicate changes to internal caches maintained by CPerl." (interactive "P") (or arg - (setq arg (if (eq cperl-syntaxify-by-font-lock + (setq arg (if (eq cperl-syntaxify-by-font-lock (if backtrace 'backtrace 'message)) 0 1))) (setq arg (if (> arg 0) (if backtrace 'backtrace 'message) t)) (setq cperl-syntaxify-by-font-lock arg) @@ -8246,7 +8246,7 @@ We suppose that the regexp is scanned already." (defun cperl-invert-if-unless-modifiers () "Change `B if A;' into `if (A) {B}' etc if possible. \(Unfinished.)" - (interactive) ; + (interactive) ; (let (A B pre-B post-B pre-if post-if pre-A post-A if-string (w-rex "\\<\\(if\\|unless\\|while\\|until\\|for\\|foreach\\)\\>")) (and (= (char-syntax (preceding-char)) ?w) diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 71d850a8b8c..b701b472ce9 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -326,6 +326,10 @@ session." (setq gud-filter-pending-text nil) (run-hooks 'gdb-mode-hook)) +;; Keep as an alias for compatibility with Emacs 22.1. +;;;###autoload +(defalias 'gdba 'gdb) + (defcustom gdb-debug-log-max 128 "Maximum size of `gdb-debug-log'. If nil, size is unlimited." :group 'gud @@ -1981,15 +1985,17 @@ static char *magick[] = { (interactive "e") (mouse-minibuffer-check event) (let ((posn (event-end event))) - (if (numberp (posn-point posn)) - (with-selected-window (posn-window posn) - (save-excursion - (goto-char (posn-point posn)) - (if (or (posn-object posn) - (eq (car (fringe-bitmaps-at-pos (posn-point posn))) - 'breakpoint)) - (gud-remove nil) - (gud-break nil))))))) + (if (buffer-file-name) + (if (numberp (posn-point posn)) + (with-selected-window (posn-window posn) + (save-excursion + (goto-char (posn-point posn)) + (if (or (posn-object posn) + (eq (car (fringe-bitmaps-at-pos (posn-point posn))) + 'breakpoint)) + (gud-remove nil) + (gud-break nil))))) + (posn-set-point posn)))) (defun gdb-mouse-toggle-breakpoint-margin (event) "Enable/disable breakpoint in left margin with mouse click." diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index a03580297d2..a2e4be4b8be 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -145,7 +145,7 @@ Used to grey out relevant toolbar icons.") (easy-mmode-defmap gud-menu-map '(([help] "Info" . gud-goto-info) - ([tooltips] menu-item "Toggle GUD tooltips" gud-tooltip-mode + ([tooltips] menu-item "Show GUD tooltips" gud-tooltip-mode :enable (and (not emacs-basic-display) (display-graphic-p) (fboundp 'x-show-tip)) diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index 61985a00efa..e863a8cfcb0 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el @@ -33,7 +33,7 @@ ;; for instance, at <URL:http://www.sil.org/sgml/related.html#dsssl>.] ;; All these Lisp-ish modes vary basically in details of the language ;; syntax they highlight/indent/index, but dsssl-mode uses "^;;;" as -;; the page-delimiter since ^L isn't normally a legal SGML character. +;; the page-delimiter since ^L isn't normally a valid SGML character. ;; ;; For interacting with a Scheme interpreter See also `run-scheme' in ;; the `cmuscheme' package and also the implementation-specific diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 0351dd3f297..fd9b3d30d59 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -115,9 +115,9 @@ ;;; Code: ;; This variable will always hold the version number of the mode -(defconst verilog-mode-version "383" +(defconst verilog-mode-version "399" "Version of this Verilog mode.") -(defconst verilog-mode-release-date "2008-01-07-GNU" +(defconst verilog-mode-release-date "2008-02-19-GNU" "Release date of this Verilog mode.") (defconst verilog-mode-release-emacs t "If non-nil, this version of Verilog mode was released with Emacs itself.") @@ -161,13 +161,6 @@ (defmacro store-match-data (&rest args) nil)) (error nil)) (condition-case nil - (if (boundp 'current-menubar) - nil ;; great - (progn - (defmacro add-submenu (&rest args) nil)) - ) - (error nil)) - (condition-case nil (if (fboundp 'char-before) nil ;; great (defmacro char-before (&rest body) @@ -957,7 +950,8 @@ If set will become buffer local.") "Keymap used in Verilog mode.") ;; menus -(defvar verilog-xemacs-menu +(easy-menu-define + verilog-menu verilog-mode-map "Menu for Verilog mode" `("Verilog" ("Choose Compilation Action" ["None" @@ -992,15 +986,12 @@ If set will become buffer local.") :selected (equal verilog-tool `verilog-compiler)] ) ("Move" - ,(if (featurep 'xemacs) - (progn - ["Beginning of function" verilog-beg-of-defun t] - ["End of function" verilog-end-of-defun t] - ["Mark function" verilog-mark-defun t]) - ["Beginning of function" beginning-of-defun t] - ["End of function" end-of-defun t] - ["Mark function" mark-defun t]) - + ["Beginning of function" verilog-beg-of-defun + :keys "C-M-a"] + ["End of function" verilog-end-of-defun + :keys "C-M-e"] + ["Mark function" verilog-mark-defun + :keys "C-M-h"] ["Goto function/module" verilog-goto-defun t] ["Move to beginning of block" electric-verilog-backward-sexp t] ["Move to end of block" electric-verilog-forward-sexp t] @@ -1057,11 +1048,10 @@ If set will become buffer local.") ["Submit bug report" verilog-submit-bug-report t] ["Version and FAQ" verilog-faq t] ["Customize Verilog Mode..." verilog-customize t] - ["Customize Verilog Fonts & Colors" verilog-font-customize t] - ) - "Emacs menu for Verilog mode." - ) -(defvar verilog-statement-menu + ["Customize Verilog Fonts & Colors" verilog-font-customize t])) + +(easy-menu-define + verilog-stmt-menu verilog-mode-map "Menu for statement templates in Verilog." '("Statements" ["Header" verilog-sk-header t] ["Comment" verilog-sk-comment t] @@ -1092,14 +1082,7 @@ If set will become buffer local.") ["Repeat" verilog-sk-repeat t] ["Case" verilog-sk-case t] ["Casex" verilog-sk-casex t] - ["Casez" verilog-sk-casez t] - ) - "Menu for statement templates in Verilog.") - -(easy-menu-define verilog-menu verilog-mode-map "Menu for Verilog mode" - verilog-xemacs-menu) -(easy-menu-define verilog-stmt-menu verilog-mode-map "Menu for statement templates in Verilog." - verilog-statement-menu) + ["Casez" verilog-sk-casez t])) (defvar verilog-mode-abbrev-table nil "Abbrev table in use in Verilog-mode buffers.") @@ -1451,19 +1434,18 @@ find the errors." (defconst verilog-beg-block-re-ordered ( concat "\\<" "\\(begin\\)" ;1 - "\\|\\(randcase\\|\\(unique\\s-+\\|priority\\s-+\\)?case[xz]?\\)" ; 2 -;; "\\|\\(randcase\\|case[xz]?\\)" ; 2 - "\\|\\(fork\\)" ;3 - "\\|\\(class\\)" ;4 - "\\|\\(table\\)" ;5 - "\\|\\(specify\\)" ;6 - "\\|\\(function\\)" ;7 - "\\|\\(task\\)" ;8 - "\\|\\(generate\\)" ;9 - "\\|\\(covergroup\\)" ;10 - "\\|\\(property\\)" ;11 - "\\|\\(\\(rand\\)?sequence\\)" ;12 - "\\|\\(clocking\\)" ;13 + "\\|\\(randcase\\|\\(unique\\s-+\\|priority\\s-+\\)?case[xz]?\\)" ; 2,3 + "\\|\\(\\(disable\\s-+\\)?fork\\)" ;4 + "\\|\\(class\\)" ;5 + "\\|\\(table\\)" ;6 + "\\|\\(specify\\)" ;7 + "\\|\\(function\\)" ;8 + "\\|\\(task\\)" ;9 + "\\|\\(generate\\)" ;10 + "\\|\\(covergroup\\)" ;11 + "\\|\\(property\\)" ;12 + "\\|\\(\\(rand\\)?sequence\\)" ;13 + "\\|\\(clocking\\)" ;14 "\\>")) (defconst verilog-end-block-ordered-rry @@ -1526,6 +1508,8 @@ find the errors." (eval-when-compile (verilog-regexp-words `( + ;; port direction (by themselves) + "inout" "input" "output" ;; integer_atom_type "byte" "shortint" "int" "longint" "integer" "time" ;; integer_vector_type @@ -1572,8 +1556,8 @@ find the errors." (concat verilog-defun-re "\\|" verilog-end-defun-re)) (defconst verilog-behavioral-block-beg-re - (concat "\\(\\<initial\\>\\|\\<final\\>\\|\\<always\\>\\|\\<always_comb\\>\\|\\<always_ff\\>\\|" - "\\<always_latch\\>\\|\\<function\\>\\|\\<task\\>\\)")) + (eval-when-compile (verilog-regexp-words `("initial" "final" "always" "always_comb" "always_latch" "always_ff" + "function" "task")))) (defconst verilog-indent-re (eval-when-compile @@ -1638,6 +1622,7 @@ find the errors." `( "endmodule" "endprimitive" "endinterface" "endpackage" "endprogram" "endclass" )))) +(defconst verilog-disable-fork-re "disable\\s-+fork") (defconst verilog-extended-case-re "\\(unique\\s-+\\|priority\\s-+\\)?case[xz]?") (defconst verilog-extended-complete-re (concat "\\(\\<extern\\s-+\\|\\<virtual\\s-+\\|\\<protected\\s-+\\)*\\(\\<function\\>\\|\\<task\\>\\)" @@ -1813,6 +1798,20 @@ See also `verilog-font-lock-extra-types'.") "Font lock mode face used to highlight AMS keywords." :group 'font-lock-highlighting-faces) +(defvar verilog-font-grouping-keywords-face + 'verilog-font-lock-grouping-keywords-face + "Font to use for Verilog Grouping Keywords (such as begin..end).") +(defface verilog-font-lock-grouping-keywords-face + '((((class color) + (background light)) + (:foreground "red4" :bold t )) + (((class color) + (background dark)) + (:foreground "red4" :bold t )) + (t (:italic t))) + "Font lock mode face used to highlight verilog grouping keywords." + :group 'font-lock-highlighting-faces) + (let* ((verilog-type-font-keywords (eval-when-compile (verilog-regexp-opt @@ -1877,8 +1876,8 @@ See also `verilog-font-lock-extra-types'.") (eval-when-compile (verilog-regexp-opt '( - "assign" "begin" "case" "casex" "casez" "randcase" "deassign" - "default" "disable" "else" "end" "endcase" "endfunction" + "assign" "case" "casex" "casez" "randcase" "deassign" + "default" "disable" "else" "endcase" "endfunction" "endgenerate" "endinterface" "endmodule" "endprimitive" "endspecify" "endtable" "endtask" "final" "for" "force" "return" "break" "continue" "forever" "fork" "function" "generate" "if" "iff" "initial" @@ -1887,7 +1886,12 @@ See also `verilog-font-lock-extra-types'.") "always_latch" "posedge" "primitive" "priority" "release" "repeat" "specify" "table" "task" "unique" "wait" "while" "class" "program" "endclass" "endprogram" - ) nil )))) + ) nil ))) + + (verilog-font-grouping-keywords + (eval-when-compile + (verilog-regexp-opt + '( "begin" "end" ) nil )))) (setq verilog-font-lock-keywords (list @@ -1897,7 +1901,9 @@ See also `verilog-font-lock-extra-types'.") "\\$[a-zA-Z][a-zA-Z0-9_\\$]*" "\\)\\>") ;; Fontify all types - (cons (concat "\\<\\(" verilog-type-font-keywords "\\)\\>") + (cons (concat "\\(\\<" verilog-font-grouping-keywords "\\)\\>") + 'verilog-font-lock-ams-face) + (cons (concat "\\<\\(" verilog-type-font-keywords "\\)\\>") 'font-lock-type-face) ;; Fontify IEEE-P1800 keywords appropriately (if verilog-highlight-p1800-keywords @@ -2064,49 +2070,64 @@ Use filename, if current buffer being edited shorten to just buffer name." (cond ((verilog-skip-forward-comment-or-string) (verilog-forward-syntactic-ws)) - ((looking-at verilog-beg-block-re-ordered);; begin|case|fork|class|table|specify|function|task|generate|covergroup|property|sequence|clocking + ((looking-at verilog-beg-block-re-ordered) ;; begin|(case)|xx|(fork)|class|table|specify|function|task|generate|covergroup|property|sequence|clocking (cond ((match-end 1) ; end ;; Search forward for matching begin (setq reg "\\(\\<begin\\>\\)\\|\\(\\<end\\>\\)" )) ((match-end 2) ; endcase ;; Search forward for matching case - (setq reg "\\(\\<randcase\\>\\|\\(\\<unique\\>\\s-+\\|\\<priority\\>\\s-+\\)?\\<case[xz]?\\>[^:]\\)\\|\\(\\<endcase\\>\\)" )) - ((match-end 3) ; join - ;; Search forward for matching fork - (setq reg "\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|_none\\)?\\>\\)" )) - ((match-end 4) ; endclass + (setq reg "\\(\\<randcase\\>\\|\\(\\<unique\\>\\s-+\\|\\<priority\\>\\s-+\\)?\\<case[xz]?\\>[^:]\\)\\|\\(\\<endcase\\>\\)" ) + (setq md 3) ;; ender is third item in regexp + ) + ((match-end 4) ; join + ;; might be "disable fork" + (if (or + (looking-at verilog-disable-fork-re) + (and (looking-at "fork") + (progn + (forward-word -1) + (looking-at verilog-disable-fork-re)))) + (progn + (goto-char (match-end 0)) + (forward-word) + (setq reg nil)) + (progn + ;; Search forward for matching fork + (setq reg "\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|_none\\)?\\>\\)" )))) + ((match-end 5) ; endclass ;; Search forward for matching class (setq reg "\\(\\<class\\>\\)\\|\\(\\<endclass\\>\\)" )) - ((match-end 5) ; endtable + ((match-end 6) ; endtable ;; Search forward for matching table (setq reg "\\(\\<table\\>\\)\\|\\(\\<endtable\\>\\)" )) - ((match-end 6) ; endspecify + ((match-end 7) ; endspecify ;; Search forward for matching specify (setq reg "\\(\\<specify\\>\\)\\|\\(\\<endspecify\\>\\)" )) - ((match-end 7) ; endfunction + ((match-end 8) ; endfunction ;; Search forward for matching function (setq reg "\\(\\<function\\>\\)\\|\\(\\<endfunction\\>\\)" )) - ((match-end 8) ; endtask + ((match-end 9) ; endtask ;; Search forward for matching task (setq reg "\\(\\<task\\>\\)\\|\\(\\<endtask\\>\\)" )) - ((match-end 9) ; endgenerate + ((match-end 10) ; endgenerate ;; Search forward for matching generate (setq reg "\\(\\<generate\\>\\)\\|\\(\\<endgenerate\\>\\)" )) - ((match-end 10) ; endgroup + ((match-end 11) ; endgroup ;; Search forward for matching covergroup (setq reg "\\(\\<covergroup\\>\\)\\|\\(\\<endgroup\\>\\)" )) - ((match-end 11) ; endproperty + ((match-end 12) ; endproperty ;; Search forward for matching property (setq reg "\\(\\<property\\>\\)\\|\\(\\<endproperty\\>\\)" )) - ((match-end 12) ; endsequence + ((match-end 13) ; endsequence ;; Search forward for matching sequence (setq reg "\\(\\<\\(rand\\)?sequence\\>\\)\\|\\(\\<endsequence\\>\\)" ) (setq md 3)) ; 3 to get to endsequence in the reg above - ((match-end 13) ; endclocking + ((match-end 14) ; endclocking ;; Search forward for matching clocking (setq reg "\\(\\<clocking\\>\\)\\|\\(\\<endclocking\\>\\)" ))) - (if (forward-word 1) + (if (and reg + (forward-word 1)) (catch 'skip (let ((nest 1)) (while (verilog-re-search-forward reg nil 'move) @@ -2343,11 +2364,9 @@ Key bindings specific to `verilog-mode-map' are: ;; Setting up menus (when (featurep 'xemacs) - (when (and current-menubar - (not (assoc "Verilog" current-menubar))) - ;; (set-buffer-menubar (copy-sequence current-menubar)) - (add-submenu nil verilog-xemacs-menu) - (add-submenu nil verilog-stmt-menu))) + (easy-menu-add verilog-stmt-menu) + (easy-menu-add verilog-menu) + (setq mode-popup-menu (cons "Verilog Mode" verilog-stmt-menu))) ;; Stuff for GNU emacs (set (make-local-variable 'font-lock-defaults) @@ -2641,13 +2660,15 @@ following code fragment: "Mark the current Verilog function (or procedure). This puts the mark at the end, and point at the beginning." (interactive) - (when (featurep 'xemacs) - (push-mark (point)) - (verilog-end-of-defun) - (push-mark (point)) - (verilog-beg-of-defun) - (if (fboundp 'zmacs-activate-region) - (zmacs-activate-region)))) + (if (featurep 'xemacs) + (progn + (push-mark (point)) + (verilog-end-of-defun) + (push-mark (point)) + (verilog-beg-of-defun) + (if (fboundp 'zmacs-activate-region) + (zmacs-activate-region))) + (mark-defun))) (defun verilog-comment-region (start end) ; checkdoc-params: (start end) @@ -3932,6 +3953,16 @@ Return a list of two elements: (INDENT-TYPE INDENT-LEVEL)." (throw 'nesting 'case) (goto-char here))) (throw 'nesting 'case)) + + ((match-end 4) ; *sigh* could be "disable fork" + (let ((here (point))) + (verilog-beg-of-statement) + (if (looking-at verilog-disable-fork-re) + t ; is disable fork, this is a normal statement + (progn ; or is fork, starts a new block + (goto-char here) + (throw 'nesting 'block))))) + ;; need to consider typedef struct here... ((looking-at "\\<class\\|struct\\|function\\|task\\|property\\>") @@ -4167,6 +4198,8 @@ Set point to where line starts." (cond ((looking-at "\\<else\\>") t) + ((looking-at verilog-behavioral-block-beg-re) + t) ((looking-at verilog-indent-re) nil) (t @@ -4682,7 +4715,7 @@ ARG is ignored, for `comment-indent-function' compatibility." ;; -(defun verilog-pretty-declarations () +(defun verilog-pretty-declarations (&optional quiet) "Line up declarations around point." (interactive) (save-excursion @@ -4726,7 +4759,8 @@ ARG is ignored, for `comment-indent-function' compatibility." (current-column)))) (goto-char end) (goto-char start) - (if (> (- end start) 100) + (if (and (not quiet) + (> (- end start) 100)) (message "Lining up declarations..(please stand by)")) ;; Get the beginning of line indent first (while (progn (setq e (marker-position edpos)) @@ -4751,7 +4785,7 @@ ARG is ignored, for `comment-indent-function' compatibility." (setq r (- e (point))) (> r 0)) (setq e (point)) - (message "%d" r) + (unless quiet (message "%d" r)) (cond ((or (and verilog-indent-declaration-macros (looking-at verilog-declaration-re-1-macro)) @@ -4776,90 +4810,98 @@ ARG is ignored, for `comment-indent-function' compatibility." (verilog-forward-ws&directives) (forward-line -1))) (forward-line 1)) - (message ""))))) + (unless quiet (message "")))))) -(defun verilog-pretty-expr (&optional myre) +(defun verilog-pretty-expr (&optional quiet myre) "Line up expressions around point, or optional regexp MYRE." (interactive "sRegular Expression: ((<|:)?=) ") (save-excursion (if (or (eq myre nil) (string-equal myre "")) (setq myre "\\(<\\|:\\)?=")) -; (setq myre (concat "\\(^[^;" myre "]*\\)\\([" myre "]\\)")) - (setq myre (concat "\\(^[^;#:?=]*\\)\\([" myre "]\\)")) - (beginning-of-line) - (if (and (not (looking-at (concat "^\\s-*" verilog-complete-reg))) - (looking-at myre)) - (let* ((here (point)) - (e) (r) - (start - (progn - (beginning-of-line) - (setq e (point)) - (verilog-backward-syntactic-ws) - (beginning-of-line) - (while (and (not (looking-at (concat "^\\s-*" verilog-complete-reg))) - (looking-at myre) - (not (bobp))) + (setq myre (concat "\\(^[^;#:<=>]*\\)\\(" myre "\\)")) + (let ((rexp(concat "^\\s-*" verilog-complete-reg))) + (beginning-of-line) + (if (and (not (looking-at rexp )) + (looking-at myre)) + (let* ((here (point)) + (e) (r) + (start + (progn + (beginning-of-line) (setq e (point)) (verilog-backward-syntactic-ws) (beginning-of-line) - ) ;Ack, need to grok `define - e)) - (end - (progn - (goto-char here) - (end-of-line) - (setq e (point)) ;Might be on last line - (verilog-forward-syntactic-ws) - (beginning-of-line) - (while (and (not (looking-at - (concat "^\\s-*" verilog-complete-reg))) - (looking-at myre)) + (while (and (not (looking-at rexp )) + (looking-at myre) + (not (bobp)) + ) + (setq e (point)) + (verilog-backward-syntactic-ws) + (beginning-of-line) + ) ;Ack, need to grok `define + e)) + (end + (progn + (goto-char here) (end-of-line) - (setq e (point)) + (setq e (point)) ;Might be on last line (verilog-forward-syntactic-ws) - (beginning-of-line)) - e)) - (edpos (set-marker (make-marker) end)) - (ind)) - (goto-char start) - (verilog-do-indent (verilog-calculate-indent)) - (if (> (- end start) 100) - (message "Lining up expressions..(please stand by)")) - - ;; Set indent to minimum throughout region - (while (< (point) (marker-position edpos)) - (beginning-of-line) - (verilog-just-one-space myre) - (end-of-line) - (verilog-forward-syntactic-ws)) - - ;; Now find biggest prefix - (setq ind (verilog-get-lineup-indent-2 myre start edpos)) - - ;; Now indent each line. - (goto-char start) - (while (progn (setq e (marker-position edpos)) - (setq r (- e (point))) - (> r 0)) - (setq e (point)) - (message "%d" r) - (cond - ((looking-at myre) - (goto-char (match-end 1)) - (if (eq (char-after) ?=) - (indent-to (1+ ind)) ; line up the = of the <= with surrounding = - (indent-to ind))) - ((verilog-continued-line-1 start) - (goto-char e) - (indent-line-to ind)) - (t ; Must be comment or white space - (goto-char e) - (verilog-forward-ws&directives) - (forward-line -1))) - (forward-line 1)) - (message ""))))) + (beginning-of-line) + (while (and (not (looking-at rexp )) + (looking-at myre)) + (end-of-line) + (setq e (point)) + (verilog-forward-syntactic-ws) + (beginning-of-line) + ) + e)) + (edpos (set-marker (make-marker) end)) + (ind) + ) + (goto-char start) + (verilog-do-indent (verilog-calculate-indent)) + (if (and (not quiet) + (> (- end start) 100)) + (message "Lining up expressions..(please stand by)")) + + ;; Set indent to minimum throughout region + (while (< (point) (marker-position edpos)) + (beginning-of-line) + (verilog-just-one-space myre) + (end-of-line) + (verilog-forward-syntactic-ws) + ) + + ;; Now find biggest prefix + (setq ind (verilog-get-lineup-indent-2 myre start edpos)) + + ;; Now indent each line. + (goto-char start) + (while (progn (setq e (marker-position edpos)) + (setq r (- e (point))) + (> r 0)) + (setq e (point)) + (if (not quiet) (message "%d" r)) + (cond + ((looking-at myre) + (goto-char (match-end 1)) + (if (not (verilog-parenthesis-depth)) ;; ignore parenthsized exprs + (if (eq (char-after) ?=) + (indent-to (1+ ind)) ; line up the = of the <= with surrounding = + (indent-to ind) + ))) + ((verilog-continued-line-1 start) + (goto-char e) + (indent-line-to ind)) + (t ; Must be comment or white space + (goto-char e) + (verilog-forward-ws&directives) + (forward-line -1)) + ) + (forward-line 1)) + (unless quiet (message "")) + ))))) (defun verilog-just-one-space (myre) "Remove extra spaces around regular expression MYRE." @@ -4873,8 +4915,8 @@ ARG is ignored, for `comment-indent-function' compatibility." (if (looking-at "\\s-") (just-one-space)) (goto-char p1) (forward-char -1) - (if (looking-at "\\s-") (just-one-space))))) - (message "")) + (if (looking-at "\\s-") (just-one-space)) + )))) (defun verilog-indent-declaration (baseind) "Indent current lines as declaration. @@ -4975,13 +5017,15 @@ Region is defined by B and EDPOS." ;; Get rightmost position (while (progn (setq e (marker-position edpos)) (< (point) e)) - (if (verilog-re-search-forward myre e 'move) + (if (and (verilog-re-search-forward myre e 'move) + (not (verilog-parenthesis-depth))) ;; skip parenthsized exprs (progn - (goto-char (match-end 0)) + (goto-char (match-beginning 2)) (verilog-backward-syntactic-ws) (if (> (current-column) ind) (setq ind (current-column))) - (goto-char (match-end 0))))) + (goto-char (match-end 0))) + )) (if (> ind 0) (1+ ind) ;; No lineup-string found @@ -5455,9 +5499,7 @@ If search fails, other files are checked based on (verilog-goto-defun-file label)))) ;; Eliminate compile warning -(eval-when-compile - (if (not (boundp 'occur-pos-list)) - (defvar occur-pos-list nil "Backward compatibility occur positions."))) +(defvar occur-pos-list) (defun verilog-showscopes () "List all scopes in this module." @@ -8499,7 +8541,7 @@ Typing \\[verilog-auto] will make this into: (when nil ;; Too slow on huge modules, plus makes everyone's module change (beginning-of-line) (setq pnt (point)) - (verilog-pretty-declarations) + (verilog-pretty-declarations quiet) (goto-char pnt) (verilog-pretty-expr "//")))))) @@ -9814,23 +9856,6 @@ and the case items." > ("case selector: " str ": begin" \n > "next_" verilog-sk-state " = " _ ";" \n > (- verilog-indent-level-behavioral) "end" \n ) resume: > (- verilog-case-indent) "endcase" (progn (electric-verilog-terminate-line) nil) > (- verilog-indent-level-behavioral) "end" (progn (electric-verilog-terminate-line) nil)) - -;; Eliminate compile warning -(eval-when-compile - (if (not (boundp 'mode-popup-menu)) - (defvar mode-popup-menu nil "Compatibility with XEmacs."))) - -;; ---- add menu 'Statements' in Verilog mode (MH) -(defun verilog-add-statement-menu () - "Add the menu 'Statements' to the menu bar in Verilog mode." - (if (featurep 'xemacs) - (progn - (easy-menu-add verilog-stmt-menu) - (easy-menu-add verilog-menu) - (setq mode-popup-menu (cons "Verilog Mode" verilog-stmt-menu))))) - -(add-hook 'verilog-mode-hook 'verilog-add-statement-menu) - ;; diff --git a/lisp/subr.el b/lisp/subr.el index 6980bf69959..679aeed876f 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1944,24 +1944,25 @@ This finishes the change group by reverting all of its changes." (with-current-buffer (car elt) (setq elt (cdr elt)) (let ((old-car - (if (consp elt) (car elt))) - (old-cdr - (if (consp elt) (cdr elt)))) - ;; Temporarily truncate the undo log at ELT. - (when (consp elt) - (setcar elt nil) (setcdr elt nil)) - (unless (eq last-command 'undo) (undo-start)) - ;; Make sure there's no confusion. - (when (and (consp elt) (not (eq elt (last pending-undo-list)))) - (error "Undoing to some unrelated state")) - ;; Undo it all. - (while (listp pending-undo-list) (undo-more 1)) - ;; Reset the modified cons cell ELT to its original content. - (when (consp elt) - (setcar elt old-car) - (setcdr elt old-cdr)) - ;; Revert the undo info to what it was when we grabbed the state. - (setq buffer-undo-list elt))))) + (if (consp elt) (car elt))) + (old-cdr + (if (consp elt) (cdr elt)))) + ;; Temporarily truncate the undo log at ELT. + (when (consp elt) + (setcar elt nil) (setcdr elt nil)) + (unless (eq last-command 'undo) (undo-start)) + ;; Make sure there's no confusion. + (when (and (consp elt) (not (eq elt (last pending-undo-list)))) + (error "Undoing to some unrelated state")) + ;; Undo it all. + (save-excursion + (while (listp pending-undo-list) (undo-more 1))) + ;; Reset the modified cons cell ELT to its original content. + (when (consp elt) + (setcar elt old-car) + (setcdr elt old-cdr)) + ;; Revert the undo info to what it was when we grabbed the state. + (setq buffer-undo-list elt))))) ;;;; Display-related functions. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 796a6a6d7e1..7b69249c9b9 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -3730,7 +3730,7 @@ Both should not be used to define a buffer-local dictionary." ;; any character other than a space. Not rigorous enough. (while (re-search-forward " *\\([^ ]+\\)" end t) (setq string (match-string-no-properties 1)) - ;; This can fail when string contains a word with illegal chars. + ;; This can fail when string contains a word with invalid chars. ;; Error handling needs to be added between ispell and emacs. (if (and (< 1 (length string)) (equal 0 (string-match ispell-casechars string))) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 7897fbaa9df..b3d238bccfc 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -465,8 +465,12 @@ Do \\[describe-key] on the following bindings to discover what they do. sgml-transformation-function)) ;; This will allow existing comments within declarations to be ;; recognized. - (set (make-local-variable 'comment-start-skip) "\\(?:<!\\)?--[ \t]*") - (set (make-local-variable 'comment-end-skip) "[ \t]*--\\([ \t\n]*>\\)?") + ;; I can't find a clear description of SGML/XML comments, but it seems that + ;; the only reliable ones are <!-- ... --> although it's not clear what + ;; "..." can contain. It used to accept -- ... -- as well, but that was + ;; apparently a mistake. + (set (make-local-variable 'comment-start-skip) "<!--[ \t]*") + (set (make-local-variable 'comment-end-skip) "[ \t]*--[ \t\n]*>") ;; This definition has an HTML leaning but probably fits well for other modes. (setq imenu-generic-expression `((nil diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 4f26a2e7e79..b177061d50a 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -333,12 +333,13 @@ Optional arg INVERT non-nil reverses the sense of the check; the root is the last directory for which WITNESS *is* found." ;; Represent /home/luser/foo as ~/foo so that we don't try to look for ;; witnesses in /home or in /. - (while (not (file-directory-p file)) - (setq file (file-name-directory (directory-file-name file)))) (setq file (abbreviate-file-name file)) (let ((root nil) (prev-file file) - (user (nth 2 (file-attributes file))) + ;; `user' is not initialized outside the loop because + ;; `file' may not exist, so we may have to walk up part of the + ;; hierarchy before we find the "initial UID". + (user nil) try) (while (not (or root (null file) @@ -347,7 +348,9 @@ the root is the last directory for which WITNESS *is* found." ;; to another user. This should save us from looking in ;; things like /net and /afs. This assumes that all the ;; files inside a project belong to the same user. - (not (equal user (nth 2 (file-attributes file)))) + (let ((prev-user user)) + (setq user (nth 2 (file-attributes file))) + (and prev-user (not (equal user prev-user)))) (string-match vc-ignore-dir-regexp file))) (setq try (file-exists-p (expand-file-name witness file))) (cond ((and invert (not try)) (setq root prev-file)) |