Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 102097. ------------------------------------------------------------ revno: 102097 author: Lars Magne Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2010-10-25 05:43:08 +0000 message: gnus-sum.el (gnus-summary-select-article): Fix type error in checking the original article buffer. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-10-24 22:32:38 +0000 +++ lisp/gnus/ChangeLog 2010-10-25 05:43:08 +0000 @@ -1,3 +1,8 @@ +2010-10-25 Lars Magne Ingebrigtsen + + * gnus-sum.el (gnus-summary-select-article): Fix type error in checking + the original article buffer. + 2010-10-24 Lars Magne Ingebrigtsen * nnimap.el (nnimap-request-head): New function. === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-10-24 09:55:56 +0000 +++ lisp/gnus/gnus-sum.el 2010-10-25 05:43:08 +0000 @@ -7593,7 +7593,7 @@ (not (eq article (cdr gnus-article-current))) (not (equal (car gnus-article-current) gnus-newsgroup-name)) - (not (buffer-name gnus-original-article-buffer)))) + (not (get-buffer gnus-original-article-buffer)))) (and (not gnus-single-article-buffer) (or (null gnus-current-article) (not (eq gnus-current-article article)))) ------------------------------------------------------------ revno: 102096 committer: Glenn Morris branch nick: trunk timestamp: Sun 2010-10-24 22:39:21 -0700 message: Simplifications for lisp/term/common-win.el * lisp/term/common-win.el (x-handle-switch): Simplify with pop. Optionally handle numeric switches. (x-handle-numeric-switch): Just call x-handle-switch. (x-handle-initial-switch, x-handle-xrm-switch, x-handle-geometry) (x-handle-name-switch, x-handle-display, x-handle-args): Simplify with pop. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-25 00:48:26 +0000 +++ lisp/ChangeLog 2010-10-25 05:39:21 +0000 @@ -1,5 +1,12 @@ 2010-10-25 Glenn Morris + * term/common-win.el (x-handle-switch): Simplify with pop. + Optionally handle numeric switches. + (x-handle-numeric-switch): Just call x-handle-switch. + (x-handle-initial-switch, x-handle-xrm-switch, x-handle-geometry) + (x-handle-name-switch, x-handle-display, x-handle-args): + Simplify with pop. + * term/ns-win.el: Do not require easymenu. (menu-bar-edit-menu) : : Move adjustments to menu-bar.el. === modified file 'lisp/term/common-win.el' --- lisp/term/common-win.el 2010-10-24 22:04:45 +0000 +++ lisp/term/common-win.el 2010-10-25 05:39:21 +0000 @@ -103,48 +103,28 @@ (defvar x-command-line-resources nil) ;; Handler for switches of the form "-switch value" or "-switch". -(defun x-handle-switch (switch) +(defun x-handle-switch (switch &optional numeric) (let ((aelt (assoc switch command-line-x-option-alist))) (if aelt - (let ((param (nth 3 aelt)) - (value (nth 4 aelt))) - (if value - (setq default-frame-alist - (cons (cons param value) - default-frame-alist)) - (setq default-frame-alist - (cons (cons param - (car x-invocation-args)) - default-frame-alist) - x-invocation-args (cdr x-invocation-args))))))) + (setq default-frame-alist + (cons (cons (nth 3 aelt) + (if numeric + (string-to-number (pop x-invocation-args)) + (or (nth 4 aelt) (pop x-invocation-args)))) + default-frame-alist))))) ;; Handler for switches of the form "-switch n" (defun x-handle-numeric-switch (switch) - (let ((aelt (assoc switch command-line-x-option-alist))) - (if aelt - (let ((param (nth 3 aelt))) - (setq default-frame-alist - (cons (cons param - (string-to-number (car x-invocation-args))) - default-frame-alist) - x-invocation-args - (cdr x-invocation-args)))))) + (x-handle-switch switch t)) ;; Handle options that apply to initial frame only (defun x-handle-initial-switch (switch) (let ((aelt (assoc switch command-line-x-option-alist))) (if aelt - (let ((param (nth 3 aelt)) - (value (nth 4 aelt))) - (if value - (setq initial-frame-alist - (cons (cons param value) - initial-frame-alist)) - (setq initial-frame-alist - (cons (cons param - (car x-invocation-args)) - initial-frame-alist) - x-invocation-args (cdr x-invocation-args))))))) + (setq initial-frame-alist + (cons (cons (nth 3 aelt) + (or (nth 4 aelt) (pop x-invocation-args))) + initial-frame-alist))))) ;; Make -iconic apply only to the initial frame! (defun x-handle-iconic (switch) @@ -157,15 +137,14 @@ (error "%s: missing argument to `%s' option" (invocation-name) switch)) (setq x-command-line-resources (if (null x-command-line-resources) - (car x-invocation-args) - (concat x-command-line-resources "\n" (car x-invocation-args)))) - (setq x-invocation-args (cdr x-invocation-args))) + (pop x-invocation-args) + (concat x-command-line-resources "\n" (pop x-invocation-args))))) (declare-function x-parse-geometry "frame.c" (string)) ;; Handle the geometry option (defun x-handle-geometry (switch) - (let* ((geo (x-parse-geometry (car x-invocation-args))) + (let* ((geo (x-parse-geometry (pop x-invocation-args))) (left (assq 'left geo)) (top (assq 'top geo)) (height (assq 'height geo)) @@ -186,8 +165,7 @@ (append initial-frame-alist '((user-position . t)) (if left (list left)) - (if top (list top))))) - (setq x-invocation-args (cdr x-invocation-args)))) + (if top (list top))))))) (defvar x-resource-name) @@ -197,9 +175,8 @@ (defun x-handle-name-switch (switch) (or (consp x-invocation-args) (error "%s: missing argument to `%s' option" (invocation-name) switch)) - (setq x-resource-name (car x-invocation-args) - x-invocation-args (cdr x-invocation-args)) - (setq initial-frame-alist (cons (cons 'name x-resource-name) + (setq x-resource-name (pop x-invocation-args) + initial-frame-alist (cons (cons 'name x-resource-name) initial-frame-alist))) (defvar x-display-name nil @@ -209,8 +186,7 @@ (defun x-handle-display (switch) "Handle -display DISPLAY option." - (setq x-display-name (car x-invocation-args) - x-invocation-args (cdr x-invocation-args)) + (setq x-display-name (pop x-invocation-args)) ;; Make subshell programs see the same DISPLAY value Emacs really uses. ;; Note that this isn't completely correct, since Emacs can use ;; multiple displays. However, there is no way to tell an already @@ -229,10 +205,9 @@ args nil) (while (and x-invocation-args (not (equal (car x-invocation-args) "--"))) - (let* ((this-switch (car x-invocation-args)) + (let* ((this-switch (pop x-invocation-args)) (orig-this-switch this-switch) completion argval aelt handler) - (setq x-invocation-args (cdr x-invocation-args)) ;; Check for long options with attached arguments ;; and separate out the attached option argument into argval. (if (string-match "^--[^=]*=" this-switch) ------------------------------------------------------------ revno: 102095 committer: Daiki Ueno branch nick: trunk timestamp: Mon 2010-10-25 12:06:35 +0900 message: Add alternative key bindings for epa-mail commands. * epa.texi (Mail-mode integration): Add alternative key bindings for epa-mail commands; escape comma. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-10-25 00:04:44 +0000 +++ doc/misc/ChangeLog 2010-10-25 03:06:35 +0000 @@ -1,3 +1,8 @@ +2010-10-25 Daiki Ueno + + * epa.texi (Mail-mode integration): Add alternative key bindings + for epa-mail commands; escape comma. + 2010-10-24 Jay Belanger * calc.texi: Use emacsver.texi to determine Emacs version. === modified file 'doc/misc/epa.texi' --- doc/misc/epa.texi 2010-10-12 01:49:05 +0000 +++ doc/misc/epa.texi 2010-10-25 03:06:35 +0000 @@ -313,7 +313,7 @@ NOTE: Inline PGP is not recommended and you should consider to use PGP/MIME. See @uref{http://josefsson.org/inline-openpgp-considered-harmful.html, -Inline PGP in E-mail is bad, Mm'kay?}. +Inline PGP in E-mail is bad@comma{} Mm'kay?}. @noindent Once @code{epa-mail-mode} is enabled, the following keys are assigned. @@ -321,22 +321,26 @@ interface. Try @kbd{M-x customize-variable epa-global-mail-mode}. @table @kbd -@item C-c C-e d +@item C-c C-e C-d and C-c C-e d +@kindex @kbd{C-c C-e C-d} @kindex @kbd{C-c C-e d} @findex epa-mail-decrypt Decrypt OpenPGP armors in the current buffer. -@item C-c C-e v +@item C-c C-e C-v and C-c C-e v +@kindex @kbd{C-c C-e C-v} @kindex @kbd{C-c C-e v} @findex epa-mail-verify Verify OpenPGP cleartext signed messages in the current buffer. -@item C-c C-e s +@item C-c C-e C-s and C-c C-e s +@kindex @kbd{C-c C-e C-s} @kindex @kbd{C-c C-e s} @findex epa-mail-sign Compose a signed message from the current buffer. -@item C-c C-e e +@item C-c C-e C-e and C-c C-e e +@kindex @kbd{C-c C-e C-e} @kindex @kbd{C-c C-e e} @findex epa-mail-encrypt Compose an encrypted message from the current buffer. ------------------------------------------------------------ revno: 102094 committer: Glenn Morris branch nick: trunk timestamp: Sun 2010-10-24 17:48:26 -0700 message: Move ns-win.el's rather wacky menu adjustments to menu-bar.el. * lisp/term/ns-win.el: Do not require easymenu. (menu-bar-edit-menu) : : Move adjustments to menu-bar.el. * lisp/menu-bar.el (menu-bar-edit-menu) : : Move ns-win's adjustments here. * lisp/loadup.el [ns]: Do not load easymenu. * src/Makefile.in (SOME_MACHINE_LISP): Remove easymenu.elc. * lib-src/makefile.w32-in (OTHER_PLATFORM_SUPPORT): Remove easymenu.elc. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2010-10-23 02:46:06 +0000 +++ lib-src/ChangeLog 2010-10-25 00:48:26 +0000 @@ -1,3 +1,7 @@ +2010-10-25 Glenn Morris + + * makefile.w32-in (OTHER_PLATFORM_SUPPORT): Remove easymenu.elc. + 2010-10-23 Glenn Morris * digest-doc.c, sorted-doc.c: Remove files. === modified file 'lib-src/makefile.w32-in' --- lib-src/makefile.w32-in 2010-10-23 02:46:06 +0000 +++ lib-src/makefile.w32-in 2010-10-25 00:48:26 +0000 @@ -189,7 +189,6 @@ $(lispsource)term/pc-win.elc \ $(lispsource)x-dnd.elc \ $(lispsource)term/x-win.elc \ - $(lispsource)emacs-lisp/easymenu.elc \ $(lispsource)term/ns-win.elc === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 23:40:55 +0000 +++ lisp/ChangeLog 2010-10-25 00:48:26 +0000 @@ -1,7 +1,16 @@ +2010-10-25 Glenn Morris + + * term/ns-win.el: Do not require easymenu. + (menu-bar-edit-menu) : + : Move adjustments to menu-bar.el. + * menu-bar.el (menu-bar-edit-menu) : + : Move ns-win's adjustments here. + * loadup.el [ns]: Do not load easymenu. + 2010-10-24 Chong Yidong * image.el (image-checkbox-checked, image-checkbox-unchecked): - Deleted (Bug#7222). + Delete (Bug#7222). * startup.el (fancy-startup-tail): Instead of using inline images, refer to image files from etc/. === modified file 'lisp/loadup.el' --- lisp/loadup.el 2010-10-22 04:03:55 +0000 +++ lisp/loadup.el 2010-10-25 00:48:26 +0000 @@ -233,9 +233,7 @@ (load "ls-lisp") (load "disp-table"))) ; needed to setup ibm-pc char set, see internal.el (if (featurep 'ns) - (progn - (load "emacs-lisp/easymenu") ;; for platform-related menu adjustments - (load "term/ns-win"))) + (load "term/ns-win")) (if (fboundp 'x-create-frame) ;; Do it after loading term/foo-win.el since the value of the ;; mouse-wheel-*-event vars depends on those files being loaded or not. === modified file 'lisp/menu-bar.el' --- lisp/menu-bar.el 2010-09-21 07:31:01 +0000 +++ lisp/menu-bar.el 2010-10-25 00:48:26 +0000 @@ -361,6 +361,11 @@ (define-key menu-bar-edit-menu [props] `(menu-item ,(purecopy "Text Properties") facemenu-menu)) +;; ns-win.el said: Add spell for platorm consistency. +(if (featurep 'ns) + (define-key menu-bar-edit-menu [spell] + `(menu-item ,(purecopy "Spell") ispell-menu-map))) + (define-key menu-bar-edit-menu [fill] `(menu-item ,(purecopy "Fill") fill-region :enable (and mark-active (not buffer-read-only)) @@ -453,30 +458,46 @@ ,(purecopy "Delete the text in region between mark and current position"))) (defvar yank-menu (cons (purecopy "Select Yank") nil)) (fset 'yank-menu (cons 'keymap yank-menu)) -(define-key menu-bar-edit-menu [paste-from-menu] - `(menu-item ,(purecopy "Paste from Kill Menu") yank-menu +;; The ns differences here seem silly. +(define-key menu-bar-edit-menu (if (featurep 'ns) [select-paste] + [paste-from-menu]) + ;; ns-win.el said: Change text to be more consistent with + ;; surrounding menu items `paste', etc." + `(menu-item ,(purecopy (if (featurep 'ns) "Select and Paste" + "Paste from Kill Menu")) yank-menu :enable (and (cdr yank-menu) (not buffer-read-only)) :help ,(purecopy "Choose a string from the kill ring and paste it"))) (define-key menu-bar-edit-menu [paste] `(menu-item ,(purecopy "Paste") yank :enable (and (or - ;; Emacs compiled --without-x doesn't have - ;; x-selection-exists-p. + ;; Emacs compiled --without-x (or --with-ns) + ;; doesn't have x-selection-exists-p. (and (fboundp 'x-selection-exists-p) (x-selection-exists-p 'CLIPBOARD)) - kill-ring) + (if (featurep 'ns) ; like paste-from-menu + (cdr yank-menu) + kill-ring)) (not buffer-read-only)) :help ,(purecopy "Paste (yank) text most recently cut/copied"))) (define-key menu-bar-edit-menu [copy] - `(menu-item ,(purecopy "Copy") menu-bar-kill-ring-save - :enable mark-active - :help ,(purecopy "Copy text in region between mark and current position") - :keys ,(purecopy "\\[kill-ring-save]"))) + ;; ns-win.el said: Substitute a Copy function that works better + ;; under X (for GNUstep). + `(menu-item ,(purecopy "Copy") ,(if (featurep 'ns) + 'ns-copy-including-secondary + 'menu-bar-kill-ring-save) + :enable mark-active + :help ,(purecopy "Copy text in region between mark and current position") + :keys ,(purecopy (if (featurep 'ns) + "\\[ns-copy-including-secondary]" + "\\[kill-ring-save]")))) (define-key menu-bar-edit-menu [cut] `(menu-item ,(purecopy "Cut") kill-region :enable (and mark-active (not buffer-read-only)) :help ,(purecopy "Cut (kill) text in region between mark and current position"))) +;; ns-win.el said: Separate undo from cut/paste section. +(if (featurep 'ns) + (define-key menu-bar-edit-menu [separator-undo] `(,(purecopy "--")))) (define-key menu-bar-edit-menu [undo] `(menu-item ,(purecopy "Undo") undo :enable (and (not buffer-read-only) @@ -486,7 +507,6 @@ (consp buffer-undo-list))) :help ,(purecopy "Undo last operation"))) - (defun menu-bar-kill-ring-save (beg end) (interactive "r") (if (mouse-region-match) @@ -2082,5 +2102,4 @@ (provide 'menu-bar) -;; arch-tag: 6e6a3c22-4ec4-4d3d-8190-583f8ef94ced ;;; menu-bar.el ends here === modified file 'lisp/term/ns-win.el' --- lisp/term/ns-win.el 2010-10-24 22:04:45 +0000 +++ lisp/term/ns-win.el 2010-10-25 00:48:26 +0000 @@ -52,13 +52,9 @@ (require 'frame) (require 'mouse) (require 'faces) -(require 'easymenu) (require 'menu-bar) (require 'fontset) -;; Not needed? -;;(require 'ispell) - (defgroup ns nil "GNUstep/Mac OS X specific features." :group 'environment) @@ -441,38 +437,6 @@ (define-key menu-bar-help-menu [info-panel] '("About Emacs..." . ns-do-emacs-info-panel))) -;;;; Edit menu: Modify slightly - -;; Substitute a Copy function that works better under X (for GNUstep). -(easy-menu-remove-item global-map '("menu-bar" "edit") 'copy) -(define-key-after menu-bar-edit-menu [copy] - '(menu-item "Copy" ns-copy-including-secondary - :enable mark-active - :help "Copy text in region between mark and current position") - 'cut) - -;; Change to same precondition as select-and-paste, as we don't have -;; `x-selection-exists-p'. -(easy-menu-remove-item global-map '("menu-bar" "edit") 'paste) -(define-key-after menu-bar-edit-menu [paste] - '(menu-item "Paste" yank - :enable (and (cdr yank-menu) (not buffer-read-only)) - :help "Paste (yank) text most recently cut/copied") - 'copy) - -;; Change text to be more consistent with surrounding menu items `paste', etc. -(easy-menu-remove-item global-map '("menu-bar" "edit") 'paste-from-menu) -(define-key-after menu-bar-edit-menu [select-paste] - '(menu-item "Select and Paste" yank-menu - :enable (and (cdr yank-menu) (not buffer-read-only)) - :help "Choose a string from the kill ring and paste it") - 'paste) - -;; Separate undo from cut/paste section, add spell for platform consistency. -(define-key-after menu-bar-edit-menu [separator-undo] '("--") 'undo) -(define-key-after menu-bar-edit-menu [spell] '("Spell" . ispell-menu-map) 'fill) - - ;;;; Services (declare-function ns-perform-service "nsfns.m" (service send)) === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-24 22:45:10 +0000 +++ src/ChangeLog 2010-10-25 00:48:26 +0000 @@ -1,3 +1,7 @@ +2010-10-25 Glenn Morris + + * Makefile.in (SOME_MACHINE_LISP): Remove easymenu.elc. + 2010-10-24 Glenn Morris * w32fns.c (Fx_synchronize, Fx_change_window_property) === modified file 'src/Makefile.in' --- src/Makefile.in 2010-10-22 03:37:20 +0000 +++ src/Makefile.in 2010-10-25 00:48:26 +0000 @@ -590,8 +590,7 @@ ../lisp/term/common-win.elc \ ../lisp/term/x-win.elc \ ../lisp/term/pc-win.elc ../lisp/term/internal.elc \ - ../lisp/term/ns-win.elc ../lisp/term/w32-win.elc \ - ../lisp/emacs-lisp/easymenu.elc + ../lisp/term/ns-win.elc ../lisp/term/w32-win.elc ## Construct full set of libraries to be linked. ## Note that SunOS needs -lm to come before -lc; otherwise, you get ------------------------------------------------------------ revno: 102093 committer: Juanma Barranquero branch nick: trunk timestamp: Mon 2010-10-25 02:04:44 +0200 message: Fix some ChangeLog entries. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2010-10-24 21:36:09 +0000 +++ doc/lispref/ChangeLog 2010-10-25 00:04:44 +0000 @@ -1,4 +1,4 @@ -2010-10-22 Eli Zaretskii +2010-10-24 Eli Zaretskii * display.texi (Window Systems): Deprecate use of window-system as a predicate. === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-10-24 22:37:44 +0000 +++ doc/misc/ChangeLog 2010-10-25 00:04:44 +0000 @@ -2,7 +2,7 @@ * calc.texi: Use emacsver.texi to determine Emacs version. -2010-10-22 Juanma Barranquero +2010-10-24 Juanma Barranquero * gnus.texi (Group Parameters, Buttons): Fix typos. === modified file 'etc/ChangeLog' --- etc/ChangeLog 2010-10-24 23:40:55 +0000 +++ etc/ChangeLog 2010-10-25 00:04:44 +0000 @@ -3,11 +3,11 @@ * images/checked.xpm: * images/unchecked.xpm: New images. -2010-10-20 Richard Stallman +2010-10-24 Richard Stallman * DISTRIB: Update donation section. -2010-10-20 Glenn Morris +2010-10-24 Glenn Morris * DISTRIB: Small updates. === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2010-10-24 21:36:09 +0000 +++ lisp/erc/ChangeLog 2010-10-25 00:04:44 +0000 @@ -1,4 +1,4 @@ -2010-10-23 Julien Danjou +2010-10-24 Julien Danjou * erc-backend.el (erc-server-JOIN): Set the correct target list on join. === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2010-10-24 21:36:09 +0000 +++ lisp/org/ChangeLog 2010-10-25 00:04:44 +0000 @@ -1,8 +1,3 @@ -2010-10-12 Juanma Barranquero - - * org-agenda.el (org-prefix-category-length) - (org-prefix-category-max-length): Fix typos in docstrings. - 2010-09-25 Juanma Barranquero * org.el (org-refile-targets): ------------------------------------------------------------ revno: 102092 committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-10-24 19:40:55 -0400 message: Avoid inline image variables for checkboxes (Bug#7222). * etc/images/checked.xpm: * etc/images/unchecked.xpm: New images. * image.el (image-checkbox-checked, image-checkbox-unchecked): Deleted (Bug#7222). * startup.el (fancy-startup-tail): Instead of using inline images, refer to image files from etc/. * wid-edit.el (checkbox): Likewise. (widget-image-find): Center image specs. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2010-10-24 21:36:09 +0000 +++ etc/ChangeLog 2010-10-24 23:40:55 +0000 @@ -1,3 +1,8 @@ +2010-10-24 Chong Yidong + + * images/checked.xpm: + * images/unchecked.xpm: New images. + 2010-10-20 Richard Stallman * DISTRIB: Update donation section. === added file 'etc/images/checked.xpm' --- etc/images/checked.xpm 1970-01-01 00:00:00 +0000 +++ etc/images/checked.xpm 2010-10-24 23:40:55 +0000 @@ -0,0 +1,20 @@ +/* XPM */ +static char * checked_xpm[] = { +"12 12 5 1", +" c None", +". c gray20", +"+ c white", +"@ c gray70", +"# c black", +"............", +"............", +"..@@@@@@##+.", +"..@@@@@@##+.", +"..#@@@@##@+.", +"..##@@@##@+.", +"..###@##@@+.", +"..@#####@@+.", +"..@@###@@@+.", +"..@++##++++.", +".@+++++++++.", +"............"}; === added file 'etc/images/unchecked.xpm' --- etc/images/unchecked.xpm 1970-01-01 00:00:00 +0000 +++ etc/images/unchecked.xpm 2010-10-24 23:40:55 +0000 @@ -0,0 +1,20 @@ +/* XPM */ +static char * unchecked_xpm[] = { +"12 12 5 1", +" c None", +". c gray20", +"+ c white", +"@ c gray70", +"# c black", +"............", +"............", +"..@@@@@@@@+.", +"..@@@@@@@@+.", +"..@@@@@@@@+.", +"..@@@@@@@@+.", +"..@@@@@@@@+.", +"..@@@@@@@@+.", +"..@@@@@@@@+.", +"..@++++++++.", +".@+++++++++.", +"............"}; === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 22:07:06 +0000 +++ lisp/ChangeLog 2010-10-24 23:40:55 +0000 @@ -1,3 +1,14 @@ +2010-10-24 Chong Yidong + + * image.el (image-checkbox-checked, image-checkbox-unchecked): + Deleted (Bug#7222). + + * startup.el (fancy-startup-tail): Instead of using inline images, + refer to image files from etc/. + + * wid-edit.el (checkbox): Likewise. + (widget-image-find): Center image specs. + 2010-10-24 Glenn Morris * term/ns-win.el (x-select-text): Doc fix. === modified file 'lisp/image.el' --- lisp/image.el 2010-10-13 14:50:06 +0000 +++ lisp/image.el 2010-10-24 23:40:55 +0000 @@ -723,21 +723,6 @@ (cons (concat "\\." extension "\\'") 'imagemagick) image-type-file-name-regexps))))) - -;;; Inline stock images - -(defvar image-checkbox-checked - (create-image "\300\300\141\143\067\076\034\030" - 'xbm t :width 8 :height 8 :background "grey75" - :foreground "black" :relief -2 :ascent 'center) - "Image of a checked checkbox.") - -(defvar image-checkbox-unchecked - (create-image (make-string 8 0) - 'xbm t :width 8 :height 8 :background "grey75" - :foreground "black" :relief -2 :ascent 'center) - "Image of an unchecked checkbox.") - (provide 'image) ;; arch-tag: 8e76a07b-eb48-4f3e-a7a0-1a7ba9f096b3 === modified file 'lisp/startup.el' --- lisp/startup.el 2010-10-11 04:49:59 +0000 +++ lisp/startup.el 2010-10-24 23:40:55 +0000 @@ -1563,21 +1563,26 @@ (kill-buffer "*GNU Emacs*"))) " ") (when (or user-init-file custom-file) - (insert-button - " " - :on-glyph image-checkbox-checked - :off-glyph image-checkbox-unchecked - 'checked nil 'display image-checkbox-unchecked 'follow-link t - 'action (lambda (button) - (if (overlay-get button 'checked) - (progn (overlay-put button 'checked nil) - (overlay-put button 'display - (overlay-get button :off-glyph)) - (setq startup-screen-inhibit-startup-screen nil)) - (overlay-put button 'checked t) - (overlay-put button 'display - (overlay-get button :on-glyph)) - (setq startup-screen-inhibit-startup-screen t)))) + (let ((checked (create-image "checked.xpm" + nil nil :ascent 'center)) + (unchecked (create-image "unchecked.xpm" + nil nil :ascent 'center))) + (insert-button + " " + :on-glyph checked + :off-glyph unchecked + 'checked nil 'display unchecked 'follow-link t + 'action (lambda (button) + (if (overlay-get button 'checked) + (progn (overlay-put button 'checked nil) + (overlay-put button 'display + (overlay-get button :off-glyph)) + (setq startup-screen-inhibit-startup-screen + nil)) + (overlay-put button 'checked t) + (overlay-put button 'display + (overlay-get button :on-glyph)) + (setq startup-screen-inhibit-startup-screen t))))) (fancy-splash-insert :face '(variable-pitch (:height 0.9)) " Never show it again."))))) === modified file 'lisp/wid-edit.el' --- lisp/wid-edit.el 2010-10-11 04:49:59 +0000 +++ lisp/wid-edit.el 2010-10-24 23:40:55 +0000 @@ -638,7 +638,8 @@ specs) (dolist (elt widget-image-conversion) (dolist (ext (cdr elt)) - (push (list :type (car elt) :file (concat image ext)) specs))) + (push (list :type (car elt) :file (concat image ext) + :ascent 'center) specs))) (find-image (nreverse specs)))) (t ;; Oh well. @@ -2195,9 +2196,9 @@ ;; We could probably do the same job as the images using single ;; space characters in a boxed face with a stretch specification to ;; make them square. - :on-glyph image-checkbox-checked + :on-glyph "checked" :off "[ ]" - :off-glyph image-checkbox-unchecked + :off-glyph "unchecked" :help-echo "Toggle this item." :action 'widget-checkbox-action) ------------------------------------------------------------ revno: 102091 committer: Glenn Morris branch nick: trunk timestamp: Sun 2010-10-24 15:45:10 -0700 message: Sync docs of some W32 and X C functions. * src/w32fns.c (Fx_synchronize, Fx_change_window_property) (Fx_window_property, Fx_file_dialog): * src/xfns.c (Fx_synchronize, Fx_change_window_property) (Fx_window_property, Fx_file_dialog): Sync docs between w32 and X. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-24 21:37:38 +0000 +++ src/ChangeLog 2010-10-24 22:45:10 +0000 @@ -1,3 +1,10 @@ +2010-10-24 Glenn Morris + + * w32fns.c (Fx_synchronize, Fx_change_window_property) + (Fx_window_property, Fx_file_dialog): + * xfns.c (Fx_synchronize, Fx_change_window_property) + (Fx_window_property, Fx_file_dialog): Sync docs between w32 and X. + 2010-10-24 Chong Yidong * xterm.c (x_connection_closed): Kill Emacs unconditionally. === modified file 'src/w32fns.c' --- src/w32fns.c 2010-10-14 14:32:27 +0000 +++ src/w32fns.c 2010-10-24 22:45:10 +0000 @@ -1,7 +1,8 @@ /* Graphical user interface functions for the Microsoft W32 API. - Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 - Free Software Foundation, Inc. + +Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -4974,7 +4975,17 @@ } DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0, - doc: /* This is a noop on W32 systems. */) + doc: /* If ON is non-nil, report X errors as soon as the erring request is made. +This function only has an effect on X Windows. With MS Windows, it is +defined but does nothing. + +If ON is nil, allow buffering of requests. +Turning on synchronization prohibits the Xlib routines from buffering +requests and seriously degrades performance, but makes debugging much +easier. +The optional second argument TERMINAL specifies which display to act on. +TERMINAL should be a terminal object, a frame or a display name (a string). +If TERMINAL is omitted or nil, that stands for the selected frame's display. */) (Lisp_Object on, Lisp_Object display) { return Qnil; @@ -4989,11 +5000,12 @@ DEFUN ("x-change-window-property", Fx_change_window_property, Sx_change_window_property, 2, 6, 0, doc: /* Change window property PROP to VALUE on the X window of FRAME. -VALUE may be a string or a list of conses, numbers and/or strings. -If an element in the list is a string, it is converted to -an Atom and the value of the Atom is used. If an element is a cons, -it is converted to a 32 bit number where the car is the 16 top bits and the -cdr is the lower 16 bits. +PROP must be a string. VALUE may be a string or a list of conses, +numbers and/or strings. If an element in the list is a string, it is +converted to an atom and the value of the Atom is used. If an element +is a cons, it is converted to a 32 bit number where the car is the 16 +top bits and the cdr is the lower 16 bits. + FRAME nil or omitted means use the selected frame. If TYPE is given and non-nil, it is the name of the type of VALUE. If TYPE is not given or nil, the type is STRING. @@ -5001,9 +5013,7 @@ It must be one of 8, 16 or 32. If VALUE is a string or FORMAT is nil or not given, FORMAT defaults to 8. If OUTER_P is non-nil, the property is changed for the outer X window of -FRAME. Default is to change on the edit X window. - -Value is VALUE. */) +FRAME. Default is to change on the edit X window. */) (Lisp_Object prop, Lisp_Object value, Lisp_Object frame, Lisp_Object type, Lisp_Object format, Lisp_Object outer_p) { #if 0 /* TODO : port window properties to W32 */ @@ -5057,9 +5067,20 @@ DEFUN ("x-window-property", Fx_window_property, Sx_window_property, 1, 2, 0, doc: /* Value is the value of window property PROP on FRAME. -If FRAME is nil or omitted, use the selected frame. Value is nil -if FRAME hasn't a property with name PROP or if PROP has no string -value. */) +If FRAME is nil or omitted, use the selected frame. + +On MS Windows, this function only accepts the PROP and FRAME arguments. + +On X Windows, the following optional arguments are also accepted: +If TYPE is nil or omitted, get the property as a string. +Otherwise TYPE is the name of the atom that denotes the type expected. +If SOURCE is non-nil, get the property on that window instead of from +FRAME. The number 0 denotes the root window. +If DELETE_P is non-nil, delete the property after retreiving it. +If VECTOR_RET_P is non-nil, don't return a string but a vector of values. + +Value is nil if FRAME hasn't a property with name PROP or if PROP has +no value of TYPE (always string in the MS Windows case). */) (Lisp_Object prop, Lisp_Object frame) { #if 0 /* TODO : port window properties to W32 */ @@ -5948,10 +5969,13 @@ DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0, doc: /* Read file name, prompting with PROMPT in directory DIR. -Use a file selection dialog. -Select DEFAULT-FILENAME in the dialog's file selection box, if -specified. Ensure that file exists if MUSTMATCH is non-nil. -If ONLY-DIR-P is non-nil, the user can only select directories. */) +Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file +selection box, if specified. If MUSTMATCH is non-nil, the returned file +or directory must exist. + +This function is only defined on MS Windows, and X Windows with the +Motif or Gtk toolkits. With the Motif toolkit, ONLY-DIR-P is ignored. +Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */) (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p) { struct frame *f = SELECTED_FRAME (); === modified file 'src/xfns.c' --- src/xfns.c 2010-10-22 05:49:47 +0000 +++ src/xfns.c 2010-10-24 22:45:10 +0000 @@ -1,7 +1,8 @@ /* Functions for the X window system. - Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 - Free Software Foundation, Inc. + +Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -4181,6 +4182,9 @@ DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0, doc: /* If ON is non-nil, report X errors as soon as the erring request is made. +This function only has an effect on X Windows. With MS Windows, it is +defined but does nothing. + If ON is nil, allow buffering of requests. Turning on synchronization prohibits the Xlib routines from buffering requests and seriously degrades performance, but makes debugging much @@ -4215,12 +4219,12 @@ DEFUN ("x-change-window-property", Fx_change_window_property, Sx_change_window_property, 2, 6, 0, doc: /* Change window property PROP to VALUE on the X window of FRAME. -PROP must be a string. -VALUE may be a string or a list of conses, numbers and/or strings. -If an element in the list is a string, it is converted to -an Atom and the value of the Atom is used. If an element is a cons, -it is converted to a 32 bit number where the car is the 16 top bits and the -cdr is the lower 16 bits. +PROP must be a string. VALUE may be a string or a list of conses, +numbers and/or strings. If an element in the list is a string, it is +converted to an atom and the value of the atom is used. If an element +is a cons, it is converted to a 32 bit number where the car is the 16 +top bits and the cdr is the lower 16 bits. + FRAME nil or omitted means use the selected frame. If TYPE is given and non-nil, it is the name of the type of VALUE. If TYPE is not given or nil, the type is STRING. @@ -4228,9 +4232,7 @@ It must be one of 8, 16 or 32. If VALUE is a string or FORMAT is nil or not given, FORMAT defaults to 8. If OUTER_P is non-nil, the property is changed for the outer X window of -FRAME. Default is to change on the edit X window. - -Value is VALUE. */) +FRAME. Default is to change on the edit X window. */) (Lisp_Object prop, Lisp_Object value, Lisp_Object frame, Lisp_Object type, Lisp_Object format, Lisp_Object outer_p) { struct frame *f = check_x_frame (frame); @@ -4331,15 +4333,19 @@ 1, 6, 0, doc: /* Value is the value of window property PROP on FRAME. If FRAME is nil or omitted, use the selected frame. -If TYPE is nil or omitted, get the property as a string. Otherwise TYPE -is the name of the Atom that denotes the type expected. + +On MS Windows, this function only accepts the PROP and FRAME arguments. + +On X Windows, the following optional arguments are also accepted: +If TYPE is nil or omitted, get the property as a string. +Otherwise TYPE is the name of the atom that denotes the type expected. If SOURCE is non-nil, get the property on that window instead of from FRAME. The number 0 denotes the root window. If DELETE_P is non-nil, delete the property after retreiving it. If VECTOR_RET_P is non-nil, don't return a string but a vector of values. Value is nil if FRAME hasn't a property with name PROP or if PROP has -no value of TYPE. */) +no value of TYPE (always string in the MS Windows case). */) (Lisp_Object prop, Lisp_Object frame, Lisp_Object type, Lisp_Object source, Lisp_Object delete_p, Lisp_Object vector_ret_p) { struct frame *f = check_x_frame (frame); @@ -5342,7 +5348,11 @@ doc: /* Read file name, prompting with PROMPT in directory DIR. Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file selection box, if specified. If MUSTMATCH is non-nil, the returned file -or directory must exist. ONLY-DIR-P is ignored." */) +or directory must exist. + +This function is only defined on MS Windows, and X Windows with the +Motif or Gtk toolkits. With the Motif toolkit, ONLY-DIR-P is ignored. +Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */) (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p) { int result; @@ -5511,8 +5521,11 @@ doc: /* Read file name, prompting with PROMPT in directory DIR. Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file selection box, if specified. If MUSTMATCH is non-nil, the returned file -or directory must exist. If ONLY-DIR-P is non-nil, the user can only select -directories. */) +or directory must exist. + +This function is only defined on MS Windows, and X Windows with the +Motif or Gtk toolkits. With the Motif toolkit, ONLY-DIR-P is ignored. +Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */) (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p) { FRAME_PTR f = SELECTED_FRAME (); @@ -6016,5 +6029,3 @@ #endif /* HAVE_X_WINDOWS */ -/* arch-tag: 55040d02-5485-4d58-8b22-95a7a05f3288 - (do not change this comment) */ ------------------------------------------------------------ revno: 102090 committer: Jay Belanger branch nick: trunk timestamp: Sun 2010-10-24 17:37:44 -0500 message: calc.texi: Use emacsver.texi to determine Emacs version. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-10-24 21:36:09 +0000 +++ doc/misc/ChangeLog 2010-10-24 22:37:44 +0000 @@ -1,3 +1,7 @@ +2010-10-24 Jay Belanger + + * calc.texi: Use emacsver.texi to determine Emacs version. + 2010-10-22 Juanma Barranquero * gnus.texi (Group Parameters, Buttons): Fix typos. === modified file 'doc/misc/calc.texi' --- doc/misc/calc.texi 2010-08-09 02:30:10 +0000 +++ doc/misc/calc.texi 2010-10-24 22:37:44 +0000 @@ -7,6 +7,8 @@ @setchapternewpage odd @comment %**end of header (This is for running Texinfo on a region.) +@include ../emacs/emacsver.texi + @c The following macros are used for conditional output for single lines. @c @texline foo @c `foo' will appear only in TeX output @@ -88,7 +90,8 @@ This file documents Calc, the GNU Emacs calculator. @end ifinfo @ifnotinfo -This file documents Calc, the GNU Emacs calculator, included with GNU Emacs 23.1. +This file documents Calc, the GNU Emacs calculator, included with +GNU Emacs @value{EMACSVER}. @end ifnotinfo Copyright @copyright{} 1990, 1991, 2001, 2002, 2003, 2004, ------------------------------------------------------------ revno: 102089 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2010-10-24 22:32:38 +0000 message: Merge changes made in Gnus trunk. message.el (message-default-headers): Fix type. nnimap.el (nnimap-request-head, nnimap-request-move-article): Make internal nnimap moving slightly faster. nnimap.el (nnimap-transform-headers): Don't bug out on bodiless articles. nnimap.el (nnimap-send-command): Have no outstanding messages if the IMAP server doesn't support streaming. nnimap.el (nnimap-transform-headers): Fold {quoted} strings more sloppily. diff: === modified file 'doc/misc/message.texi' --- doc/misc/message.texi 2010-10-21 22:12:01 +0000 +++ doc/misc/message.texi 2010-10-24 22:32:38 +0000 @@ -1450,8 +1450,10 @@ @item message-default-headers @vindex message-default-headers -This string is inserted at the end of the headers in all message -buffers. If set to a function, the returned results is inserted. +Header lines to be inserted in outgoing messages before you edit the +message, so you can edit or delete their lines. If set to a string, it +is directly inserted. If set to a function, it is called and its +result is inserted. @item message-subject-re-regexp @vindex message-subject-re-regexp === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-10-24 09:55:56 +0000 +++ lisp/gnus/ChangeLog 2010-10-24 22:32:38 +0000 @@ -1,5 +1,19 @@ 2010-10-24 Lars Magne Ingebrigtsen + * nnimap.el (nnimap-request-head): New function. + (nnimap-request-move-article): Try to be slighly faster by not + requesting the entire message when moving. + (nnimap-transform-headers): Don't bug out on bodiless articles. + (nnimap-send-command): Have no outstanding messages if the IMAP server + doesn't support streaming. + (nnimap-transform-headers): Fold {quoted} strings more sloppily. + +2010-10-24 Julien Danjou + + * message.el (message-default-headers): Fix type. + +2010-10-24 Lars Magne Ingebrigtsen + * gnus-html.el (gnus-html-prefetch-images): Decode entities before prefetching images. === modified file 'lisp/gnus/gnus-int.el' --- lisp/gnus/gnus-int.el 2010-10-14 22:39:54 +0000 +++ lisp/gnus/gnus-int.el 2010-10-24 22:32:38 +0000 @@ -655,7 +655,8 @@ (result (funcall (gnus-get-function gnus-command-method 'request-move-article) article (gnus-group-real-name group) - (nth 1 gnus-command-method) accept-function last move-is-internal))) + (nth 1 gnus-command-method) accept-function + last move-is-internal))) (when (and result gnus-agent (gnus-agent-method-p gnus-command-method)) (gnus-agent-unfetch-articles group (list article))) === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2010-10-21 22:12:01 +0000 +++ lisp/gnus/message.el 2010-10-24 22:32:38 +0000 @@ -1139,14 +1139,17 @@ :error "All header lines must be newline terminated") (defcustom message-default-headers "" - "A string containing header lines to be inserted in outgoing messages. -It is inserted before you edit the message, so you can edit or -delete these lines. If set to a function, it is called and its -result is inserted." + "Header lines to be inserted in outgoing messages. +This can be set to a string containing or a function returning +header lines to be inserted before you edit the message, so you +can edit or delete these lines. If set to a function, it is +called and its result is inserted." :version "23.2" :group 'message-headers :link '(custom-manual "(message)Message Headers") - :type 'message-header-lines) + :type '(choice + (message-header-lines :tag "String") + (function :tag "Function"))) (defcustom message-default-mail-headers ;; Ease the transition from mail-mode to message-mode. See bugs#4431, 5555. === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2010-10-21 01:23:34 +0000 +++ lisp/gnus/nnimap.el 2010-10-24 22:32:38 +0000 @@ -136,6 +136,16 @@ (defun nnimap-buffer () (nnimap-find-process-buffer nntp-server-buffer)) +(defun nnimap-header-parameters () + (format "(UID RFC822.SIZE BODYSTRUCTURE %s)" + (format + (if (nnimap-ver4-p) + "BODY.PEEK[HEADER.FIELDS %s]" + "RFC822.HEADER.LINES %s") + (append '(Subject From Date Message-Id + References In-Reply-To Xref) + nnmail-extra-headers)))) + (deffoo nnimap-retrieve-headers (articles &optional group server fetch-old) (with-current-buffer nntp-server-buffer (erase-buffer) @@ -146,14 +156,7 @@ (nnimap-send-command "UID FETCH %s %s" (nnimap-article-ranges (gnus-compress-sequence articles)) - (format "(UID RFC822.SIZE BODYSTRUCTURE %s)" - (format - (if (nnimap-ver4-p) - "BODY.PEEK[HEADER.FIELDS %s]" - "RFC822.HEADER.LINES %s") - (append '(Subject From Date Message-Id - References In-Reply-To Xref) - nnmail-extra-headers)))) + (nnimap-header-parameters)) t) (nnimap-transform-headers)) (insert-buffer-substring @@ -171,7 +174,7 @@ (return))) (setq article (match-string 1)) ;; Unfold quoted {number} strings. - (while (re-search-forward "[^]] {\\([0-9]+\\)}\r\n" + (while (re-search-forward "[^]][ (]{\\([0-9]+\\)}\r\n" (1+ (line-end-position)) t) (setq size (string-to-number (match-string 1))) (delete-region (+ (match-beginning 0) 2) (point)) @@ -200,7 +203,8 @@ (insert (format "Chars: %s\n" size))) (when lines (insert (format "Lines: %s\n" lines))) - (re-search-forward "^\r$") + (unless (re-search-forward "^\r$" nil t) + (goto-char (point-max))) (delete-region (line-beginning-position) (line-end-position)) (insert ".") (forward-line 1))))) @@ -490,12 +494,28 @@ (nnheader-ms-strip-cr) (cons group article))))))))) -(defun nnimap-get-whole-article (article) +(deffoo nnimap-request-head (article &optional group server to-buffer) + (when (nnimap-possibly-change-group group server) + (with-current-buffer (nnimap-buffer) + (when (stringp article) + (setq article (nnimap-find-article-by-message-id group article))) + (nnimap-get-whole-article + article (format "UID FETCH %%d %s" + (nnimap-header-parameters))) + (let ((buffer (current-buffer))) + (with-current-buffer (or to-buffer nntp-server-buffer) + (erase-buffer) + (insert-buffer-substring buffer) + (nnheader-ms-strip-cr) + (cons group article)))))) + +(defun nnimap-get-whole-article (article &optional command) (let ((result (nnimap-command - (if (nnimap-ver4-p) - "UID FETCH %d BODY.PEEK[]" - "UID FETCH %d RFC822.PEEK") + (or command + (if (nnimap-ver4-p) + "UID FETCH %d BODY.PEEK[]" + "UID FETCH %d RFC822.PEEK")) article))) ;; Check that we really got an article. (goto-char (point-min)) @@ -715,7 +735,10 @@ &optional last internal-move-group) (with-temp-buffer (mm-disable-multibyte) - (when (nnimap-request-article article group server (current-buffer)) + (when (funcall (if internal-move-group + 'nnimap-request-head + 'nnimap-request-article) + article group server (current-buffer)) ;; If the move is internal (on the same server), just do it the easy ;; way. (let ((message-id (message-field-value "message-id"))) @@ -1025,12 +1048,7 @@ (utf7-encode group t)) (nnimap-send-command "UID FETCH %d:* FLAGS" start) start group command) - sequences))) - ;; Some servers apparently can't have many outstanding - ;; commands, so throttle them. - (when (and (not nnimap-streaming) - (car sequences)) - (nnimap-wait-for-response (caar sequences)))) + sequences)))) sequences)))) (deffoo nnimap-finish-retrieve-group-infos (server infos sequences) @@ -1408,6 +1426,10 @@ (if (nnimap-newlinep nnimap-object) "" "\r")))) + ;; Some servers apparently can't have many outstanding + ;; commands, so throttle them. + (unless nnimap-streaming + (nnimap-wait-for-response nnimap-sequence)) nnimap-sequence) (defun nnimap-log-command (command) ------------------------------------------------------------ revno: 102088 committer: Glenn Morris branch nick: trunk timestamp: Sun 2010-10-24 15:07:06 -0700 message: ChangeLog fix. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 22:04:45 +0000 +++ lisp/ChangeLog 2010-10-24 22:07:06 +0000 @@ -10,7 +10,7 @@ (x-setup-function-keys, xw-defined-colors): Merge x- and w32- definitions here. -2010-10-24 "T.V. Raman" +2010-10-24 T.V. Raman (tiny change) * net/mairix.el (mairix-searches-mode-map): * mail/mspools.el (mspools-mode-map): Fix 2010-10-10 change. ------------------------------------------------------------ revno: 102087 committer: Glenn Morris branch nick: trunk timestamp: Sun 2010-10-24 15:04:45 -0700 message: Move some more shared x-, w32- things to common-win. * term/ns-win.el (x-select-text): Doc fix. * w32-fns.el (x-alternatives-map, x-setup-function-keys) (x-select-text): Move to term/common-win. * term/w32-win.el (xw-defined-colors): Move to common-win. * term/x-win.el (xw-defined-colors, x-alternatives-map) (x-setup-function-keys, x-select-text): Move to common-win. * term/common-win.el (x-select-text, x-alternatives-map) (x-setup-function-keys, xw-defined-colors): Merge x- and w32- definitions here. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 21:44:53 +0000 +++ lisp/ChangeLog 2010-10-24 22:04:45 +0000 @@ -1,3 +1,15 @@ +2010-10-24 Glenn Morris + + * term/ns-win.el (x-select-text): Doc fix. + * w32-fns.el (x-alternatives-map, x-setup-function-keys) + (x-select-text): Move to term/common-win. + * term/w32-win.el (xw-defined-colors): Move to common-win. + * term/x-win.el (xw-defined-colors, x-alternatives-map) + (x-setup-function-keys, x-select-text): Move to common-win. + * term/common-win.el (x-select-text, x-alternatives-map) + (x-setup-function-keys, xw-defined-colors): Merge x- and w32- + definitions here. + 2010-10-24 "T.V. Raman" * net/mairix.el (mairix-searches-mode-map): @@ -159,14 +171,13 @@ (set-cursor-color, set-mouse-color, set-border-color): Use read-color. -2010-10-24 Leo +2010-10-24 Leo * eshell/em-unix.el (eshell-remove-entries): Use the TRASH argument of delete-file and delete-directory (Bug#7011). 2010-10-24 Chong Yidong - * emacs-lisp/package.el (package-menu-mode-map): Inherit from button-buffer-map. === modified file 'lisp/term/common-win.el' --- lisp/term/common-win.el 2010-10-24 01:57:21 +0000 +++ lisp/term/common-win.el 2010-10-24 22:04:45 +0000 @@ -37,6 +37,67 @@ ;; The GNU/Linux version changed in 24.1, the MS-Windows version did not. :version "24.1") +(defvar x-last-selected-text) ; w32-fns.el +(declare-function w32-set-clipboard-data "w32select.c" + (string &optional ignored)) + +(defun x-select-text (text) + "Select TEXT, a string, according to the window system. + +On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the +clipboard. If `x-select-enable-primary' is non-nil, put TEXT in +the primary selection. + +On MS-Windows, make TEXT the current selection. If +`x-select-enable-clipboard' is non-nil, copy the text to the +clipboard as well. + +On Nextstep, put TEXT in the pasteboard." + (if (eq system-type 'windows-nt) + (progn + (if x-select-enable-clipboard + (w32-set-clipboard-data text)) + (setq x-last-selected-text text)) + ;; With multi-tty, this function may be called from a tty frame. + (when (eq (framep (selected-frame)) 'x) + (when x-select-enable-primary + (x-set-selection 'PRIMARY text) + (setq x-last-selected-text-primary text)) + (when x-select-enable-clipboard + (x-set-selection 'CLIPBOARD text) + (setq x-last-selected-text-clipboard text))))) + +;;;; Function keys + +(defvar x-alternatives-map + (let ((map (make-sparse-keymap))) + ;; Map certain keypad keys into ASCII characters that people usually expect. + (define-key map [M-backspace] [?\M-\d]) + (define-key map [M-delete] [?\M-\d]) + (define-key map [M-tab] [?\M-\t]) + (define-key map [M-linefeed] [?\M-\n]) + (define-key map [M-clear] [?\M-\C-l]) + (define-key map [M-return] [?\M-\C-m]) + (define-key map [M-escape] [?\M-\e]) + (define-key map [iso-lefttab] [backtab]) + (define-key map [S-iso-lefttab] [backtab]) + (and (eq system-type 'windows-nt) + (define-key map [S-tab] [backtab])) + map) + "Keymap of possible alternative meanings for some keys.") + +(defun x-setup-function-keys (frame) + "Set up `function-key-map' on the graphical frame FRAME." + ;; Don't do this twice on the same display, or it would break + ;; normal-erase-is-backspace-mode. + (unless (terminal-parameter frame 'x-setup-function-keys) + ;; Map certain keypad keys into ASCII characters that people usually expect. + (with-selected-frame frame + (let ((map (copy-keymap x-alternatives-map))) + (set-keymap-parent map (keymap-parent local-function-key-map)) + (set-keymap-parent local-function-key-map map))) + (set-terminal-parameter frame 'x-setup-function-keys t))) + (defvar x-invocation-args) (defvar x-command-line-resources nil) @@ -382,4 +443,17 @@ For Nextstep, this is a list of non-PANTONE colors returned by the operating system.") +(defvar w32-color-map) + +(defun xw-defined-colors (&optional frame) + "Internal function called by `defined-colors', which see." + (or frame (setq frame (selected-frame))) + (let (defined-colors) + (dolist (this-color (if (eq system-type 'windows-nt) + (or (mapcar 'car w32-color-map) x-colors) + x-colors)) + (and (color-supported-p this-color frame t) + (setq defined-colors (cons this-color defined-colors)))) + defined-colors)) + ;;; common-win.el ends here === modified file 'lisp/term/ns-win.el' --- lisp/term/ns-win.el 2010-10-23 20:43:59 +0000 +++ lisp/term/ns-win.el 2010-10-24 22:04:45 +0000 @@ -1028,7 +1028,7 @@ clipboard. If `x-select-enable-primary' is non-nil, put TEXT in the primary selection. -On Windows, make TEXT the current selection. If +On MS-Windows, make TEXT the current selection. If `x-select-enable-clipboard' is non-nil, copy the text to the clipboard as well. === modified file 'lisp/term/w32-win.el' --- lisp/term/w32-win.el 2010-10-13 14:50:06 +0000 +++ lisp/term/w32-win.el 2010-10-24 22:04:45 +0000 @@ -148,18 +148,8 @@ (global-set-key [language-change] 'ignore) (defvar x-resource-name) -(defvar x-colors) -(defun xw-defined-colors (&optional frame) - "Internal function called by `defined-colors', which see." - (or frame (setq frame (selected-frame))) - (let ((defined-colors nil)) - (dolist (this-color (or (mapcar 'car w32-color-map) x-colors)) - (and (color-supported-p this-color frame t) - (setq defined-colors (cons this-color defined-colors)))) - defined-colors)) - ;;;; Function keys ;;; make f10 activate the real menubar rather than the mini-buffer menu @@ -316,5 +306,4 @@ (provide 'w32-win) -;; arch-tag: 69fb1701-28c2-4890-b351-3d1fe4b4f166 ;;; w32-win.el ends here === modified file 'lisp/term/x-win.el' --- lisp/term/x-win.el 2010-10-24 01:57:21 +0000 +++ lisp/term/x-win.el 2010-10-24 22:04:45 +0000 @@ -1,7 +1,7 @@ ;;; x-win.el --- parse relevant switches and set up for X -*-coding: iso-2022-7bit;-*- ;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, -;; 2008, 2009, 2010 Free Software Foundation, Inc. +;; 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: FSF ;; Keywords: terminals, i18n @@ -252,50 +252,6 @@ (defconst x-pointer-invisible 255) -(defvar x-colors) - -(defun xw-defined-colors (&optional frame) - "Internal function called by `defined-colors', which see." - (or frame (setq frame (selected-frame))) - (let ((all-colors x-colors) - (this-color nil) - (defined-colors nil)) - (while all-colors - (setq this-color (car all-colors) - all-colors (cdr all-colors)) - (and (color-supported-p this-color frame t) - (setq defined-colors (cons this-color defined-colors)))) - defined-colors)) - -;;;; Function keys - -(defvar x-alternatives-map - (let ((map (make-sparse-keymap))) - ;; Map certain keypad keys into ASCII characters that people usually expect. - (define-key map [M-backspace] [?\M-\d]) - (define-key map [M-delete] [?\M-\d]) - (define-key map [M-tab] [?\M-\t]) - (define-key map [M-linefeed] [?\M-\n]) - (define-key map [M-clear] [?\M-\C-l]) - (define-key map [M-return] [?\M-\C-m]) - (define-key map [M-escape] [?\M-\e]) - (define-key map [iso-lefttab] [backtab]) - (define-key map [S-iso-lefttab] [backtab]) - map) - "Keymap of possible alternative meanings for some keys.") - -(defun x-setup-function-keys (frame) - "Set up `function-key-map' on the graphical frame FRAME." - ;; Don't do this twice on the same display, or it would break - ;; normal-erase-is-backspace-mode. - (unless (terminal-parameter frame 'x-setup-function-keys) - ;; Map certain keypad keys into ASCII characters that people usually expect. - (with-selected-frame frame - (let ((map (copy-keymap x-alternatives-map))) - (set-keymap-parent map (keymap-parent local-function-key-map)) - (set-keymap-parent local-function-key-map map))) - (set-terminal-parameter frame 'x-setup-function-keys t))) - ;;;; Keysyms (defun vendor-specific-keysyms (vendor) @@ -1212,27 +1168,6 @@ :group 'killing :version "24.1") -(defun x-select-text (text) - "Select TEXT, a string, according to the window system. - -On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the -clipboard. If `x-select-enable-primary' is non-nil, put TEXT in -the primary selection. - -On Windows, make TEXT the current selection. If -`x-select-enable-clipboard' is non-nil, copy the text to the -clipboard as well. - -On Nextstep, put TEXT in the pasteboard." - ;; With multi-tty, this function may be called from a tty frame. - (when (eq (framep (selected-frame)) 'x) - (when x-select-enable-primary - (x-set-selection 'PRIMARY text) - (setq x-last-selected-text-primary text)) - (when x-select-enable-clipboard - (x-set-selection 'CLIPBOARD text) - (setq x-last-selected-text-clipboard text)))) - (defvar x-select-request-type nil "*Data type request for X selection. The value is one of the following data types, a list of them, or nil: === modified file 'lisp/w32-fns.el' --- lisp/w32-fns.el 2010-09-02 10:17:02 +0000 +++ lisp/w32-fns.el 2010-10-24 22:04:45 +0000 @@ -32,34 +32,6 @@ ;;;; Function keys -(defvar x-alternatives-map - (let ((map (make-sparse-keymap))) - ;; Map certain keypad keys into ASCII characters that people usually expect. - (define-key map [M-backspace] [?\M-\d]) - (define-key map [M-delete] [?\M-\d]) - (define-key map [M-tab] [?\M-\t]) - (define-key map [M-linefeed] [?\M-\n]) - (define-key map [M-clear] [?\M-\C-l]) - (define-key map [M-return] [?\M-\C-m]) - (define-key map [M-escape] [?\M-\e]) - (define-key map [iso-lefttab] [backtab]) - (define-key map [S-iso-lefttab] [backtab]) - (define-key map [S-tab] [backtab]) - map) - "Keymap of possible alternative meanings for some keys.") - -(defun x-setup-function-keys (frame) - "Set up `function-key-map' on the graphical frame FRAME." - ;; Don't do this twice on the same display, or it would break - ;; normal-erase-is-backspace-mode. - (unless (terminal-parameter frame 'x-setup-function-keys) - ;; Map certain keypad keys into ASCII characters that people usually expect. - (with-selected-frame frame - (let ((map (copy-keymap x-alternatives-map))) - (set-keymap-parent map (keymap-parent local-function-key-map)) - (set-keymap-parent local-function-key-map map))) - (set-terminal-parameter frame 'x-setup-function-keys t))) - (declare-function set-message-beep "w32console.c") (declare-function w32-get-clipboard-data "w32select.c") (declare-function w32-get-locale-info "w32proc.c") @@ -432,22 +404,6 @@ ;; from x-selection-value. (defvar x-last-selected-text nil) -(defun x-select-text (text) - "Select TEXT, a string, according to the window system. - -On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the -clipboard. If `x-select-enable-primary' is non-nil, put TEXT in -the primary selection. - -On Windows, make TEXT the current selection. If -`x-select-enable-clipboard' is non-nil, copy the text to the -clipboard as well. - -On Nextstep, put TEXT in the pasteboard." - (if x-select-enable-clipboard - (w32-set-clipboard-data text)) - (setq x-last-selected-text text)) - (defun x-get-selection-value () "Return the value of the current selection. Consult the selection. Treat empty strings as if they were unset." @@ -503,5 +459,4 @@ (delete-matching-lines "^$\\|^;") (save-buffers-kill-emacs t)) -;; arch-tag: c49b48cc-0f4f-454f-a274-c2dc34815e14 ;;; w32-fns.el ends here ------------------------------------------------------------ revno: 102086 author: T.V. Raman committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-10-24 17:44:53 -0400 message: Fix 2010-10-10 keymap fixes. * net/mairix.el (mairix-searches-mode-map): * mail/mspools.el (mspools-mode-map): Fix 2010-10-10 change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 21:36:09 +0000 +++ lisp/ChangeLog 2010-10-24 21:44:53 +0000 @@ -1,3 +1,8 @@ +2010-10-24 "T.V. Raman" + + * net/mairix.el (mairix-searches-mode-map): + * mail/mspools.el (mspools-mode-map): Fix 2010-10-10 change. + 2010-10-24 Michael McNamara * verilog-mode.el (verilog-directive-re): Make this variable === modified file 'lisp/mail/mspools.el' --- lisp/mail/mspools.el 2010-10-10 23:12:30 +0000 +++ lisp/mail/mspools.el 2010-10-24 21:44:53 +0000 @@ -181,7 +181,8 @@ (define-key map "q" 'mspools-quit) (define-key map "n" 'next-line) (define-key map "p" 'previous-line) - (define-key map "g" 'revert-buffer)) + (define-key map "g" 'revert-buffer) + map) "Keymap for the *spools* buffer.") ;;; Code === modified file 'lisp/net/mairix.el' --- lisp/net/mairix.el 2010-10-10 23:12:30 +0000 +++ lisp/net/mairix.el 2010-10-24 21:44:53 +0000 @@ -748,7 +748,7 @@ (define-key map [(e)] 'mairix-select-edit) (define-key map [(d)] 'mairix-select-delete) (define-key map [(s)] 'mairix-select-save) - (setq mairix-searches-mode-map map)) + map) "'mairix-searches-mode' keymap.") (defvar mairix-searches-mode-font-lock-keywords) ------------------------------------------------------------ revno: 102085 [merge] committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-10-24 17:37:38 -0400 message: Merge changes from emacs-23 branch. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2010-10-23 02:46:06 +0000 +++ doc/lispref/ChangeLog 2010-10-24 21:36:09 +0000 @@ -1,3 +1,8 @@ +2010-10-22 Eli Zaretskii + + * display.texi (Window Systems): Deprecate use of window-system as + a predicate. + 2010-10-23 Glenn Morris * help.texi (Documentation Basics): Remove mentions of digest-doc and === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2010-10-15 10:49:07 +0000 +++ doc/lispref/display.texi 2010-10-24 21:36:09 +0000 @@ -5928,6 +5928,14 @@ one documented for the variable @code{window-system} above. @end defun + Do @emph{not} use @code{window-system} and +@code{initial-window-system} as predicates or boolean flag variables, +if you want to write code that works differently on text terminals and +graphic displays. That is because @code{window-system} is not a good +indicator of Emacs capabilities on a given display type. Instead, use +@code{display-graphic-p} or any of the other @code{display-*-p} +predicates described in @ref{Display Feature Testing}. + @defvar window-setup-hook This variable is a normal hook which Emacs runs after handling the initialization files. Emacs runs this hook after it has completed === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-10-23 00:01:49 +0000 +++ doc/misc/ChangeLog 2010-10-24 21:36:09 +0000 @@ -1,3 +1,7 @@ +2010-10-22 Juanma Barranquero + + * gnus.texi (Group Parameters, Buttons): Fix typos. + 2010-10-22 Tassilo Horn * gnus.texi (Subscription Commands): Mention that you can also === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2010-10-23 00:01:49 +0000 +++ doc/misc/gnus.texi 2010-10-24 21:36:09 +0000 @@ -3091,8 +3091,8 @@ Top, sieve, Emacs Sieve}. @item (agent parameters) -If the agent has been enabled, you can set any of the its parameters -to control the behavior of the agent in individual groups. See Agent +If the agent has been enabled, you can set any of its parameters to +control the behavior of the agent in individual groups. See Agent Parameters in @ref{Category Syntax}. Most users will choose to set agent parameters in either an agent category or group topic to minimize the configuration effort. === modified file 'etc/ChangeLog' --- etc/ChangeLog 2010-10-19 19:20:33 +0000 +++ etc/ChangeLog 2010-10-24 21:36:09 +0000 @@ -1,3 +1,11 @@ +2010-10-20 Richard Stallman + + * DISTRIB: Update donation section. + +2010-10-20 Glenn Morris + + * DISTRIB: Small updates. + 2010-10-19 Julien Danjou * tutorials/TUTORIAL: Don't mention mode-line end dashes. === modified file 'etc/DISTRIB' --- etc/DISTRIB 2010-01-13 08:35:10 +0000 +++ etc/DISTRIB 2010-10-20 04:03:16 +0000 @@ -1,12 +1,9 @@ -*- text -*- -For an order form for all Emacs and FSF distributions deliverable from -the USA, see http://www.gnu.org/order/order.html. - - GNU Emacs availability information, October 2000 + GNU Emacs availability information Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1995, - 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 - Free Software Foundation, Inc. + 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010 Free Software Foundation, Inc. See the end of the file for license conditions. @@ -29,31 +26,17 @@ (including modified versions) has the freedom to redistribute and change it. -If you do not know anyone to get a copy of GNU Emacs from, you can -order a cd-rom from the Free Software Foundation. We distribute -several Emacs versions. We also distribute nicely typeset copies of -the Emacs user manual, Emacs Lisp Reference Manual, the Emacs -reference card, etc. See http://www.gnu.org/order/order.html. - -If you have Internet access, you can copy the latest Emacs -distribution from hosts, such as ftp.gnu.org. There are several ways -to do this; see http://www.gnu.org/software/software.html for more -information. +For information on how to get GNU software, see +http://www.gnu.org/software/software.html. Printed copies of GNU +manuals, including the Emacs manual, are available from the FSF's +online store at http://shop.fsf.org. Emacs has been run on GNU/Linux, FreeBSD, NetBSD, OpenBSD, and on many Unix systems, on a variety of types of cpu, as well as on MSDOS, -Windows and MacOS. It also formerly worked on VMS and on Apollo -computers, though with some deficiencies that reflect problems in -these operating systems. See the file `MACHINES' in this directory -(see above) for a full list of machines that GNU Emacs has been tested +Windows and MacOS. See the file `etc/MACHINES' in the Emacs +distribution for a full list of machines that GNU Emacs has been tested on, with machine-specific installation notes and warnings. -Note that there is significant variation between Unix systems -supposedly running the same version of Unix; it is possible that what -works in GNU Emacs for me does not work on your system due to such an -incompatibility. Since I must avoid reading Unix source code, I -cannot even guess what such problems may exist. - GNU Emacs is distributed with no warranty (see the General Public License for full details, in the file `COPYING' in this directory (see above)), and neither I nor the Free Software Foundation promises any @@ -62,14 +45,13 @@ See http://www.gnu.org/help/gethelp.html. However, we plan to continue to improve GNU Emacs and keep it -reliable, so please send me any complaints and suggestions you have. -I will probably fix anything that I consider a malfunction. I may -make improvements that are suggested, but I may choose not to. +reliable, so please send us any complaints and suggestions you have. +We will probably fix anything that we consider a malfunction. We may +make improvements that are suggested, but we may choose not to. -If you are on the Internet, report bugs to bug-gnu-emacs@gnu.org. You -can use the Emacs command M-x report-bug RET to mail a bug report. -Please read the Bugs section of the Emacs manual before reporting -bugs. +If you are on the Internet, report bugs to bug-gnu-emacs@gnu.org. +You can use the Emacs command M-x report-bug RET to mail a bug report. +Please read the Bugs section of the Emacs manual before reporting bugs. General questions about the GNU Project can be asked of gnu@gnu.org. @@ -80,12 +62,14 @@ if you estimate what it would cost to distribute some commercial product and divide it by five, that is a good amount. -If you like GNU Emacs, please express your satisfaction with a -donation: send me or the Foundation what you feel Emacs has been worth -to you. If you are glad that I developed GNU Emacs and distribute it -as free software, rather than following the obstructive and antisocial -practices typical of software developers, reward me. If you would -like the Foundation to develop more free software, contribute. +If you like GNU Emacs, please express your satisfaction with a donation: +send me (please email me about how) or the Foundation +(https://my.fsf.org/donate) what you feel Emacs has been worth to you. +If you are glad that I developed GNU Emacs and distribute it as free +software, rather than following the obstructive and antisocial +practices of proprietary software, you can reward me. If you would +like the Foundation to do more to forward the cause of free software, +you can contribute. Your donations will help to support the development of additional GNU software. GNU/Linux systems (variants of GNU, based on the kernel === modified file 'etc/NEWS.1-17' --- etc/NEWS.1-17 2010-06-15 11:41:21 +0000 +++ etc/NEWS.1-17 2010-10-22 23:38:34 +0000 @@ -235,7 +235,7 @@ * Nroff mode and TeX mode. -The are two new major modes for editing nroff input and TeX input. +There are two new major modes for editing nroff input and TeX input. See the Emacs manual for full information. * New C indentation style variable `c-brace-imaginary-offset'. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 18:43:31 +0000 +++ lisp/ChangeLog 2010-10-24 21:36:09 +0000 @@ -1,3 +1,144 @@ +2010-10-24 Michael McNamara + + * verilog-mode.el (verilog-directive-re): Make this variable + auto-built for efficiency of execution and updating. + (verilog-extended-complete-re): Support 'pure' fucntion & task + declarations (these have no bodies). + (verilog-beg-of-statement): general cleanup to enable support of + 'pure' fucntion & task declarations (these have no bodies). These + efforts together fix Verilog bug210 from veripool; which was also + noticed by Steve Pearlmutter. + (verilog-directive-re, verilog-directive-begin, verilog-indent-re) + (verilog-directive-nest-re, verilog-set-auto-endcomments): Support + `elsif. Reported by Shankar Giri. + (verilog-forward-ws&directives, verilog-in-attribute-p): Fixes for + attribute handling for lining up declarations and assignments. + (verilog-beg-of-statement-1): Fix issue where continued declaration + is indented differently if it is after a begin..end clock. + (verilog-in-attribute-p, verilog-skip-backward-comments) + (verilog-skip-forward-comment-p): Support proper treatment of + attributes by indent code. Reported by Jeff Steele. + (verilog-in-directive-p): Fix comment to correctly describe + function. + (verilog-backward-up-list, verilog-in-struct-region-p) + (verilog-backward-token, verilog-in-struct-p) + (verilog-in-coverage-p, verilog-do-indent) + (verilog-pretty-declarations): Use verilog-backward-up-list as + wrapper around backward-up-list inorder to properly skip comments. + Reported by David Rogoff. + (verilog-property-re, verilog-endcomment-reason-re) + (verilog-beg-of-statement, verilog-set-auto-endcomments) + (verilog-calc-1 ): Fix for assert a; else b; indentation (new form + of if). Reported by Max Bjurling and + (verilog-calc-1): Fix for clocking block in modport + declaration. Reported by Brian Hunter. + +2010-10-24 Wilson Snyder + + * verilog-mode.el (verilog-auto-inst, verilog-gate-ios) + (verilog-gate-keywords, verilog-read-sub-decls) + (verilog-read-sub-decls-gate, verilog-read-sub-decls-gate-ios) + (verilog-read-sub-decls-line, verilog-read-sub-decls-sig): Support + AUTOINST for gate primitives, bug284. Reported by Mark Johnson. + (verilog-read-decls): Fix spaces in V2K module parameters causing + mis-identification as interfaces, bug287. + (verilog-read-decls): Fix not treating "parameter string" as a + parameter in AUTOINSTPARAM. + (verilog-read-always-signals-recurse, verilog-read-decls): Fix not + treating `elsif similar to `endif inside AUTOSENSE. + (verilog-do-indent): Implement correct automatic or static task or + function end comment highlight. Reported by Steve Pearlmutter. + (verilog-font-lock-keywords-2): Fix highlighting of single + character pins, bug264. Reported by Michael Laajanen. + (verilog-auto-inst, verilog-read-decls, verilog-read-sub-decls) + (verilog-read-sub-decls-in-interfaced, verilog-read-sub-decls-sig) + (verilog-subdecls-get-interfaced, verilog-subdecls-new): Support + interfaces with AUTOINST, bug270. Reported by Luis Gutierrez. + (verilog-pretty-expr): Fix interactive arguments, bug272. Reported + by Mark Johnson. + (verilog-auto-tieoff, verilog-auto-tieoff-ignore-regexp): Add + 'verilog-auto-tieoff-ignore-regexp' for AUTOTIEOFF, + bug269. Suggested by Gary Delp. + (verilog-mode-map, verilog-preprocess, verilog-preprocess-history) + (verilog-preprocessor, verilog-set-compile-command): Create + verilog-preprocess and verilog-preprocessor to show preprocessed + output. + (verilog-get-beg-of-line, verilog-get-end-of-line) + (verilog-modi-file-or-buffer, verilog-modi-name) + (verilog-modi-point, verilog-within-string): Move defmacro's + before first use to avoid warning. Reported by Steve Pearlmutter. + (verilog-colorize-buffer, verilog-colorize-include-files-buffer) + (verilog-colorize-region, verilog-highlight-buffer) + (verilog-highlight-includes, verilog-highlight-modules) + (verilog-highlight-region, verilog-mode): Rename colorize to + highlight to match other packages. Disable module highlighting, + as received speed complaints, reenable for experimentation only + using new verilog-highlight-modules. + (verilog-read-decls): Fix regexp stack overflow in very large + AUTO_TEMPLATEs, bug250. + (verilog-auto, verilog-delete-auto, verilog-save-buffer-state) + (verilog-scan): Create verilog-save-buffer-state to standardize + making insignificant changes that shouldn't call hooks. + (verilog-save-no-change-functions, verilog-save-scan-cache) + (verilog-scan, verilog-scan-cache-ok-p, verilog-scan-region): + Create verilog-save-no-change-functions to wrap verilog-scan + preservation, and fix to work with nested preserved calls. + (verilog-auto-inst, verilog-auto-inst-dot-name): Support .name + port syntax for AUTOWIRE, and with new verilog-auto-inst-dot-name + generate .name with AUTOINST, bug245. Suggested by David Rogoff. + (verilog-submit-bug-report): Update variable list to be complete. + (verilog-auto, verilog-colorize-region): Fix AUTO expansion + breaking on-the-fly font-locking. + (verilog-colorize-buffer, verilog-colorize-include-files) + (verilog-colorize-include-files-buffer, verilog-colorize-region) + (verilog-load-file-at-mouse, verilog-load-file-at-point) + (verilog-mode, verilog-read-inst-module-matcher): With point on a + AUTOINST cell instance name, middle mouse button now finds-file on + it. Suggested by Brad Dobbie. + (verilog-alw-get-temps, verilog-auto-reset) + (verilog-auto-sense-sigs, verilog-read-always-signals) + (verilog-read-always-signals-recurse): Fix loop indexes being + AUTORESET. AUTORESET now assumes any variables in the + initialization section of a for() should be ignored. Reported by + Dan Dever. + (verilog-error-font-lock-keywords) + (verilog-error-regexp-emacs-alist) + (verilog-error-regexp-xemacs-alist): Fix error detection of + Cadence HAL, reported by David Asher. Repair drift between the + three similar error variables. + (verilog-modi-lookup, verilog-modi-lookup-cache) + (verilog-modi-lookup-last-current, verilog-modi-lookup-last-mod) + (verilog-modi-lookup-last-modi, verilog-modi-lookup-last-tick): + Fix slow verilog-auto expansion on very large files. + (verilog-read-sub-decls-expr, verilog-read-sub-decls-line): Fix + AUTOOUTPUT treating "1*2" as a signal name in submodule connection + "{1*2{...". Broke in last revision. + (verilog-read-sub-decls-expr): Fix AUTOOUTPUT not detecting + submodule connections with replications "{#{a},#{b}}". + +2010-10-24 Juanma Barranquero + + * progmodes/dcl-mode.el (dcl-electric-reindent-regexps): + Fix typo in docstring. + +2010-10-24 Kenichi Handa + + * face-remap.el (text-scale-adjust): Call read-event with a proper + prompt. + +2010-10-24 Chong Yidong + + * emacs-lisp/unsafep.el: Don't mark functions that display + messages as safe. Suggested by Johan BockgÃ¥rd. + +2010-10-24 Stefan Monnier + + * emacs-lisp/regexp-opt.el (regexp-opt-group, regexp-opt-charset): + Turn comments into docstrings. + + * minibuffer.el (completion--replace): Move point where it belongs + when there's a common suffix (bug#7215). + 2010-10-24 Chong Yidong Merge read-color and facemenu-read-color (Bug#7242). === modified file 'lisp/ChangeLog.12' --- lisp/ChangeLog.12 2010-10-14 14:32:27 +0000 +++ lisp/ChangeLog.12 2010-10-24 21:36:09 +0000 @@ -12997,8 +12997,8 @@ 2006-02-13 Mathias Dahl - * tumme.el: Remove history section. If someone needs the it, it - can always be found in CVS. + * tumme.el: Remove history section. If someone needs it, it can + always be found in CVS. 2006-02-12 Mathias Dahl === modified file 'lisp/ChangeLog.9' --- lisp/ChangeLog.9 2010-10-14 14:32:27 +0000 +++ lisp/ChangeLog.9 2010-10-24 21:36:09 +0000 @@ -1034,8 +1034,8 @@ 2001-09-18 Eli Zaretskii * dired.el (dired-move-to-filename-regexp): Allow one digit in the - numeric month value, and allow the Kanji character after the it to - be missing (happens with ls-lisp's output on Japanese versions of + numeric month value, and allow the Kanji character after it to be + missing (happens with ls-lisp's output on Japanese versions of MS-Windows). 2001-09-18 Miles Bader === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2010-10-14 14:32:27 +0000 +++ lisp/erc/ChangeLog 2010-10-24 21:36:09 +0000 @@ -1,3 +1,10 @@ +2010-10-23 Julien Danjou + + * erc-backend.el (erc-server-JOIN): Set the correct target list on join. + + * erc-backend.el (erc-process-sentinel): Check that buffer is alive + before setting it as current buffer. + 2010-10-14 Juanma Barranquero * erc-xdcc.el (erc-xdcc-help-text): Fix typo in docstring. === modified file 'lisp/erc/erc-backend.el' --- lisp/erc/erc-backend.el 2010-08-08 22:13:53 +0000 +++ lisp/erc/erc-backend.el 2010-10-24 21:36:09 +0000 @@ -653,30 +653,31 @@ (defun erc-process-sentinel (cproc event) "Sentinel function for ERC process." - (with-current-buffer (process-buffer cproc) - (erc-log (format - "SENTINEL: proc: %S status: %S event: %S (quitting: %S)" - cproc (process-status cproc) event erc-server-quitting)) - (if (string-match "^open" event) - ;; newly opened connection (no wait) - (erc-login) - ;; assume event is 'failed - (let ((buf (process-buffer cproc))) - (erc-with-all-buffers-of-server cproc nil - (setq erc-server-connected nil)) - (when erc-server-ping-handler - (progn (erc-cancel-timer erc-server-ping-handler) - (setq erc-server-ping-handler nil))) - (run-hook-with-args 'erc-disconnected-hook - (erc-current-nick) (system-name) "") - ;; Remove the prompt - (goto-char (or (marker-position erc-input-marker) (point-max))) - (forward-line 0) - (erc-remove-text-properties-region (point) (point-max)) - (delete-region (point) (point-max)) - ;; Decide what to do with the buffer - ;; Restart if disconnected - (erc-process-sentinel-1 event buf))))) + (let ((buf (process-buffer cproc))) + (when (buffer-live-p buf) + (with-current-buffer buf + (erc-log (format + "SENTINEL: proc: %S status: %S event: %S (quitting: %S)" + cproc (process-status cproc) event erc-server-quitting)) + (if (string-match "^open" event) + ;; newly opened connection (no wait) + (erc-login) + ;; assume event is 'failed + (erc-with-all-buffers-of-server cproc nil + (setq erc-server-connected nil)) + (when erc-server-ping-handler + (progn (erc-cancel-timer erc-server-ping-handler) + (setq erc-server-ping-handler nil))) + (run-hook-with-args 'erc-disconnected-hook + (erc-current-nick) (system-name) "") + ;; Remove the prompt + (goto-char (or (marker-position erc-input-marker) (point-max))) + (forward-line 0) + (erc-remove-text-properties-region (point) (point-max)) + (delete-region (point) (point-max)) + ;; Decide what to do with the buffer + ;; Restart if disconnected + (erc-process-sentinel-1 event buf)))))) ;;;; Sending messages @@ -1195,7 +1196,7 @@ (setq buffer (erc-open erc-session-server erc-session-port nick erc-session-user-full-name nil nil - erc-default-recipients chnl + (list chnl) chnl erc-server-process)) (when buffer (set-buffer buffer) === modified file 'lisp/face-remap.el' --- lisp/face-remap.el 2010-03-14 21:15:02 +0000 +++ lisp/face-remap.el 2010-10-24 21:36:09 +0000 @@ -312,7 +312,7 @@ (when step (text-scale-increase step) (setq inc 1 first nil) - (setq ev (read-event)))) + (setq ev (read-event "+,-,0 for further adjustment: ")))) (push ev unread-command-events))) === modified file 'lisp/gnus/ChangeLog.2' --- lisp/gnus/ChangeLog.2 2010-10-14 14:32:27 +0000 +++ lisp/gnus/ChangeLog.2 2010-10-24 21:36:09 +0000 @@ -3828,8 +3828,7 @@ that Gnus will render it as html if the user wants that. Implemented the ability to save nnrss-group-alist so that any new - feeds the you subscribe to will be found the next time you start - up. + feeds you subscribe to will be found the next time you start up. Implemented support for RSS 2.0 elements (author, pubDate). === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2010-10-14 14:32:27 +0000 +++ lisp/org/ChangeLog 2010-10-24 21:36:09 +0000 @@ -1,3 +1,8 @@ +2010-10-12 Juanma Barranquero + + * org-agenda.el (org-prefix-category-length) + (org-prefix-category-max-length): Fix typos in docstrings. + 2010-09-25 Juanma Barranquero * org.el (org-refile-targets): @@ -7798,7 +7803,7 @@ 2008-10-26 James TD Smith - * org.el (org-add-log-setup): Only skip drawers if the are + * org.el (org-add-log-setup): Only skip drawers if they are immediately after the scheduling keywords. * org-clock.el (org-clock-in-switch-to-state): Allow this to be a === modified file 'lisp/progmodes/dcl-mode.el' --- lisp/progmodes/dcl-mode.el 2010-05-25 02:11:08 +0000 +++ lisp/progmodes/dcl-mode.el 2010-10-24 21:36:09 +0000 @@ -409,7 +409,7 @@ is defined as dcl-electric-character. E.g.: if this list contains `endif', the key `f' is defined as -dcl-electric-character and the you have just typed the `f' in +dcl-electric-character and you have just typed the `f' in `endif', the line will be reindented." :type '(repeat regexp) :group 'dcl) === modified file 'lisp/progmodes/verilog-mode.el' --- lisp/progmodes/verilog-mode.el 2010-06-01 02:34:49 +0000 +++ lisp/progmodes/verilog-mode.el 2010-10-24 21:36:09 +0000 @@ -3,12 +3,12 @@ ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. -;; Author: Michael McNamara (mac@verilog.com) -;; http://www.verilog.com +;; Author: Michael McNamara (mac@verilog.com), +;; Wilson Snyder (wsnyder@wsnyder.org) +;; Please see our web sites: +;; http://www.verilog.com +;; http://www.veripool.org ;; -;; AUTO features, signal, modsig; by: Wilson Snyder -;; (wsnyder@wsnyder.org) -;; http://www.veripool.org ;; Keywords: languages ;; Yoni Rabkin contacted the maintainer of this @@ -81,15 +81,21 @@ ; (autoload 'verilog-mode "verilog-mode" "Verilog mode" t ) ; (add-to-list 'auto-mode-alist '("\\.[ds]?vh?\\'" . verilog-mode)) +;; Be sure to examine at the help for verilog-auto, and the other +;; verilog-auto-* functions for some major coding time savers. +;; ;; If you want to customize Verilog mode to fit your needs better, -;; you may add these lines (the values of the variables presented +;; you may add the below lines (the values of the variables presented ;; here are the defaults). Note also that if you use an Emacs that ;; supports custom, it's probably better to use the custom menu to -;; edit these. -;; -;; Be sure to examine at the help for verilog-auto, and the other -;; verilog-auto-* functions for some major coding time savers. -;; +;; edit these. If working as a member of a large team these settings +;; should be common across all users (in a site-start file), or set +;; in Local Variables in every file. Otherwise, different people's +;; AUTO expansion may result different whitespace changes. +;; +; ;; Enable syntax highlighting of **all** languages +; (global-font-lock-mode t) +; ; ;; User customization for Verilog mode ; (setq verilog-indent-level 3 ; verilog-indent-level-module 3 @@ -118,9 +124,9 @@ ;;; Code: ;; This variable will always hold the version number of the mode -(defconst verilog-mode-version "565" +(defconst verilog-mode-version "647" "Version of this Verilog mode.") -(defconst verilog-mode-release-date "2010-03-01-GNU" +(defconst verilog-mode-release-date "2010-10-20-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.") @@ -213,7 +219,14 @@ ;; We have an intermediate custom-library, hack around it! (defmacro customize-group (var &rest args) `(customize ,var)) - )) + ) + + (unless (boundp 'inhibit-point-motion-hooks) + (defvar inhibit-point-motion-hooks nil)) + (unless (boundp 'deactivate-mark) + (defvar deactivate-mark nil)) + ) + ;; ;; OK, do this stuff if we are NOT XEmacs: (unless (featurep 'xemacs) (unless (fboundp 'region-active-p) @@ -260,10 +273,21 @@ ;; Emacs. (defalias 'verilog-regexp-opt 'regexp-opt))) +(eval-and-compile + ;; Both xemacs and emacs + (condition-case nil + (unless (fboundp 'buffer-chars-modified-tick) ;; Emacs 22 added + (defmacro buffer-chars-modified-tick () (buffer-modified-tick))) + (error nil))) + (eval-when-compile (defun verilog-regexp-words (a) "Call 'regexp-opt' with word delimiters for the words A." (concat "\\<" (verilog-regexp-opt a t) "\\>"))) +(defun verilog-regexp-words (a) + "Call 'regexp-opt' with word delimiters for the words A." + ;; The FAQ references this function, so user LISP sometimes calls it + (concat "\\<" (verilog-regexp-opt a t) "\\>")) (defun verilog-easy-menu-filter (menu) "Filter `easy-menu-define' MENU to support new features." @@ -338,6 +362,9 @@ "Customize AUTO actions when expanding Verilog source text." :group 'verilog-mode) +(defvar verilog-debug nil + "If set, enable debug messages for `verilog-mode' internals.") + (defcustom verilog-linter "echo 'No verilog-linter set, see \"M-x describe-variable verilog-linter\"'" "*Unix program and arguments to call to run a lint checker on Verilog source. @@ -378,11 +405,27 @@ :group 'verilog-mode-actions) ;; We don't mark it safe, as it's used as a shell command +(defcustom verilog-preprocessor + ;; Very few tools give preprocessed output, so we'll default to Verilog-Perl + "vppreproc __FLAGS__ __FILE__" + "*Program and arguments to use to preprocess Verilog source. +This is invoked with `verilog-preprocess', and depending on the +`verilog-set-compile-command', may also be invoked when you type +\\[compile]. When the compile completes, \\[next-error] will +take you to the next lint error." + :type 'string + :group 'verilog-mode-actions) +;; We don't mark it safe, as it's used as a shell command + +(defvar verilog-preprocess-history nil + "History for `verilog-preprocess'.") + (defvar verilog-tool 'verilog-linter "Which tool to use for building compiler-command. -Either nil, `verilog-linter, `verilog-coverage, `verilog-simulator, or -`verilog-compiler. Alternatively use the \"Choose Compilation Action\" -menu. See `verilog-set-compile-command' for more information.") +Either nil, `verilog-linter, `verilog-compiler, +`verilog-coverage, `verilog-preprocessor, or `verilog-simulator. +Alternatively use the \"Choose Compilation Action\" menu. See +`verilog-set-compile-command' for more information.") (defcustom verilog-highlight-translate-off nil "*Non-nil means background-highlight code excluded from translation. @@ -572,6 +615,23 @@ :type 'boolean) (put 'verilog-highlight-grouping-keywords 'safe-local-variable 'verilog-booleanp) +(defcustom verilog-highlight-modules nil + "*True means highlight module statements for `verilog-load-file-at-point'. +When true, mousing over module names will allow jumping to the +module definition. If false, this is not supported. Setting +this is experimental, and may lead to bad performance." + :group 'verilog-mode-indent + :type 'boolean) +(put 'verilog-highlight-modules 'safe-local-variable 'verilog-booleanp) + +(defcustom verilog-highlight-includes t + "*True means highlight module statements for `verilog-load-file-at-point'. +When true, mousing over include file names will allow jumping to the +file referenced. If false, this is not supported." + :group 'verilog-mode-indent + :type 'boolean) +(put 'verilog-highlight-includes 'safe-local-variable 'verilog-booleanp) + (defcustom verilog-auto-endcomments t "*True means insert a comment /* ... */ after 'end's. The name of the function or case will be set between the braces." @@ -640,9 +700,7 @@ ;;; Compile support (require 'compile) (defvar verilog-error-regexp-added nil) -; List of regexps for Verilog compilers, like verilint. See compilation-error-regexp-alist -; for the formatting. -; Here is the version for Emacs 22: + (defvar verilog-error-regexp-emacs-alist '( (verilog-xl-1 @@ -650,7 +708,7 @@ (verilog-xl-2 "([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\(line[ \t]+\\)?\\([0-9]+\\):.*$" 1 3) (verilog-IES - ".*\\*[WE],[0-9A-Z]+ (\\([^ \t,]+\\),\\([0-9]+\\)" 1 2) + ".*\\*[WE],[0-9A-Z]+\\(\[[0-9A-Z_,]+\]\\)? (\\([^ \t,]+\\),\\([0-9]+\\)" 2 3) (verilog-surefire-1 "[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 1 2) (verilog-surefire-2 @@ -672,87 +730,64 @@ (verilog-verilator "%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 4) (verilog-leda - "In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\): -.* -.* -.* -\\(Warning\\|Error\\|Failure\\)" 1 2) - )) -;; And the version for XEmacs: + "^In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\(Warning\\|Error\\|Failure\\)[^\n]*" 1 2) + ) + "List of regexps for Verilog compilers. +See `compilation-error-regexp-alist' for the formatting. For Emacs 22+.") + (defvar verilog-error-regexp-xemacs-alist - '(verilog - ("[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 1 2) - ("\\(WARNING\\|ERROR\\|INFO\\)[^:]*: \\([^,]+\\),\\s-+\\(line \\)?\\([0-9]+\\):" 2 4 ) - ("\ -\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\ -:\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 2 5) -; xsim -; Error! in file /homes/mac/Axis/Xsim/test.v at line 13 [OBJ_NOT_DECLARED] - ("\\(Error\\|Warning\\).*in file (\\([^ \t]+\\) at line *\\([0-9]+\\))" 2 3) -; vcs - ("\\(Error\\|Warning\\):[^(]*(\\([^ \t]+\\) line *\\([0-9]+\\))" 2 3) - ("Warning:.*(port.*(\\([^ \t]+\\) line \\([0-9]+\\))" 1 2) - ("\\(Error\\|Warning\\):[\n.]*\\([^ \t]+\\) *\\([0-9]+\\):" 2 3) - ("syntax error:.*\n\\([^ \t]+\\) *\\([0-9]+\\):" 1 2) -; Verilator - ("%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 4) -; verilog-xl - ("\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 3) - ("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\([0-9]+\\):.*$" 1 2) ; vxl - ("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+line[ \t]+\\([0-9]+\\):.*$" 1 2) -; nc-verilog - (".*\\*[WE],[0-9A-Z]+ (\\([^ \t,]+\\),\\([0-9]+\\)|" 1 2) -; Leda - ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 1 2) - ) - ) + ;; Emacs form is '((v-tool "re" 1 2) ...) + ;; XEmacs form is '(verilog ("re" 1 2) ...) + ;; So we can just map from Emacs to Xemacs + (cons 'verilog (mapcar 'cdr verilog-error-regexp-emacs-alist)) + "List of regexps for Verilog compilers. +See `compilation-error-regexp-alist-alist' for the formatting. For XEmacs.") (defvar verilog-error-font-lock-keywords '( + ;; verilog-xl-1 + ("\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 bold t) + ("\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 bold t) + ;; verilog-xl-2 + ("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\(line[ \t]+\\)?\\([0-9]+\\):.*$" 1 bold t) + ("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\(line[ \t]+\\)?\\([0-9]+\\):.*$" 3 bold t) + ;; verilog-IES (nc-verilog) + (".*\\*[WE],[0-9A-Z]+\\(\[[0-9A-Z_,]+\]\\)? (\\([^ \t,]+\\),\\([0-9]+\\)|" 2 bold t) + (".*\\*[WE],[0-9A-Z]+\\(\[[0-9A-Z_,]+\]\\)? (\\([^ \t,]+\\),\\([0-9]+\\)|" 3 bold t) + ;; verilog-surefire-1 ("[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 1 bold t) ("[^\n]*\\[\\([^:]+\\):\\([0-9]+\\)\\]" 2 bold t) - + ;; verilog-surefire-2 ("\\(WARNING\\|ERROR\\|INFO\\): \\([^,]+\\), line \\([0-9]+\\):" 2 bold t) ("\\(WARNING\\|ERROR\\|INFO\\): \\([^,]+\\), line \\([0-9]+\\):" 3 bold t) - - ("\ -\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\ -:\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 bold t) - ("\ -\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\ -:\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 bold t) - + ;; verilog-verbose + ("\ +\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\ +:\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 bold t) + ("\ +\\([a-zA-Z]?:?[^:( \t\n]+\\)[:(][ \t]*\\([0-9]+\\)\\([) \t]\\|\ +:\\([^0-9\n]\\|\\([0-9]+:\\)\\)\\)" 1 bold t) + ;; verilog-vcs-1 ("\\(Error\\|Warning\\):[^(]*(\\([^ \t]+\\) line *\\([0-9]+\\))" 2 bold t) ("\\(Error\\|Warning\\):[^(]*(\\([^ \t]+\\) line *\\([0-9]+\\))" 3 bold t) - - ("%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 bold t) - ("%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 4 bold t) - - ("Warning:.*(port.*(\\([^ \t]+\\) line \\([0-9]+\\))" 1 bold t) - ("Warning:.*(port.*(\\([^ \t]+\\) line \\([0-9]+\\))" 1 bold t) - + ;; verilog-vcs-2 + ("Warning:.*(port.*(\\([^ \t]+\\) line \\([0-9]+\\))" 1 bold t) + ("Warning:.*(port.*(\\([^ \t]+\\) line \\([0-9]+\\))" 1 bold t) + ;; verilog-vcs-3 ("\\(Error\\|Warning\\):[\n.]*\\([^ \t]+\\) *\\([0-9]+\\):" 2 bold t) ("\\(Error\\|Warning\\):[\n.]*\\([^ \t]+\\) *\\([0-9]+\\):" 3 bold t) - + ;; verilog-vcs-4 ("syntax error:.*\n\\([^ \t]+\\) *\\([0-9]+\\):" 1 bold t) ("syntax error:.*\n\\([^ \t]+\\) *\\([0-9]+\\):" 2 bold t) - ; vxl - ("\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 bold t) - ("\\(Error\\|Warning\\)!.*\n?.*\"\\([^\"]+\\)\", \\([0-9]+\\)" 2 bold t) - - ("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\([0-9]+\\):.*$" 1 bold t) - ("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+\\([0-9]+\\):.*$" 2 bold t) - - ("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+line[ \t]+\\([0-9]+\\):.*$" 1 bold t) - ("([WE][0-9A-Z]+)[ \t]+\\([^ \t\n,]+\\)[, \t]+line[ \t]+\\([0-9]+\\):.*$" 2 bold t) - ; nc-verilog - (".*[WE],[0-9A-Z]+ (\\([^ \t,]+\\),\\([0-9]+\\)|" 1 bold t) - (".*[WE],[0-9A-Z]+ (\\([^ \t,]+\\),\\([0-9]+\\)|" 2 bold t) - ; Leda - ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 1 bold t) - ("In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\[\\(Warning\\|Error\\|Failure\\)\\][^\n]*" 2 bold t) + ;; verilog-verilator + (".*%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 3 bold t) + (".*%?\\(Error\\|Warning\\)\\(-[^:]+\\|\\):[\n ]*\\([^ \t:]+\\):\\([0-9]+\\):" 4 bold t) + ;; verilog-leda + ("^In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\(Warning\\|Error\\|Failure\\)[^\n]*" 1 bold t) + ("^In file \\([^ \t]+\\)[ \t]+line[ \t]+\\([0-9]+\\):\n[^\n]*\n[^\n]*\n\\(Warning\\|Error\\|Failure\\)[^\n]*" 2 bold t) ) - "*Keywords to also highlight in Verilog *compilation* buffers.") + "*Keywords to also highlight in Verilog *compilation* buffers. +Only used in XEmacs; GNU Emacs uses `verilog-error-regexp-emacs-alist'.") (defcustom verilog-library-flags '("") "*List of standard Verilog arguments to use for /*AUTOINST*/. @@ -888,6 +923,16 @@ :type 'boolean) (put 'verilog-auto-arg-sort 'safe-local-variable 'verilog-booleanp) +(defcustom verilog-auto-inst-dot-name nil + "*If true, when creating ports with AUTOINST, use .name syntax. +This will use \".port\" instead of \".port(port)\" when possible. +This is only legal in SystemVerilog files, and will confuse older +simulators. Setting `verilog-auto-inst-vector' to nil may also +be desirable to increase how often .name will be used." + :group 'verilog-mode-auto + :type 'boolean) +(put 'verilog-auto-inst-dot-name 'safe-local-variable 'verilog-booleanp) + (defcustom verilog-auto-inst-param-value nil "*If set, AUTOINST will replace parameters with the parameter value. If nil, leave parameters as symbolic names. @@ -899,7 +944,7 @@ For example, imagine a submodule uses parameters to declare the size of its inputs. This is then used by a upper module: - module InstModule (o,i) + module InstModule (o,i); parameter WIDTH; input [WIDTH-1:0] i; endmodule @@ -971,6 +1016,13 @@ :type 'string) (put 'verilog-auto-output-ignore-regexp 'safe-local-variable 'stringp) +(defcustom verilog-auto-tieoff-ignore-regexp nil + "*If set, when creating AUTOTIEOFF list, ignore signals matching this regexp. +See the \\[verilog-faq] for examples on using this." + :group 'verilog-mode-auto + :type 'string) +(put 'verilog-auto-tieoff-ignore-regexp 'safe-local-variable 'stringp) + (defcustom verilog-auto-unused-ignore-regexp nil "*If set, when creating AUTOUNUSED list, ignore signals matching this regexp. See the \\[verilog-faq] for examples on using this." @@ -1080,6 +1132,7 @@ (define-key map "\C-c\C-k" 'verilog-delete-auto) (define-key map "\C-c\C-a" 'verilog-auto) (define-key map "\C-c\C-s" 'verilog-auto-save-compile) + (define-key map "\C-c\C-p" 'verilog-preprocess) (define-key map "\C-c\C-z" 'verilog-inject-auto) (define-key map "\C-c\C-e" 'verilog-expand-vector) (define-key map "\C-c\C-h" 'verilog-header) @@ -1127,6 +1180,13 @@ :style radio :selected (equal verilog-tool `verilog-compiler) :help "When invoking compilation, compile Verilog source"] + ["Preprocessor" + (progn + (setq verilog-tool 'verilog-preprocessor) + (verilog-set-compile-command)) + :style radio + :selected (equal verilog-tool `verilog-preprocessor) + :help "When invoking compilation, preprocess Verilog source, see also `verilog-preprocess'"] ) ("Move" ["Beginning of function" verilog-beg-of-defun @@ -1318,6 +1378,20 @@ ;; Macros ;; +(defsubst verilog-get-beg-of-line (&optional arg) + (save-excursion + (beginning-of-line arg) + (point))) + +(defsubst verilog-get-end-of-line (&optional arg) + (save-excursion + (end-of-line arg) + (point))) + +(defsubst verilog-within-string () + (save-excursion + (nth 3 (parse-partial-sexp (verilog-get-beg-of-line) (point))))) + (defsubst verilog-string-replace-matches (from-string to-string fixedcase literal string) "Replace occurrences of FROM-STRING with TO-STRING. FIXEDCASE and LITERAL as in `replace-match`. STRING is what to replace. @@ -1394,19 +1468,45 @@ (setq pt (match-end 0)))) pt)) -(defsubst verilog-get-beg-of-line (&optional arg) - (save-excursion - (beginning-of-line arg) - (point))) - -(defsubst verilog-get-end-of-line (&optional arg) - (save-excursion - (end-of-line arg) - (point))) - -(defsubst verilog-within-string () - (save-excursion - (nth 3 (parse-partial-sexp (verilog-get-beg-of-line) (point))))) +(defsubst verilog-re-search-forward-substr (substr regexp bound noerror) + "Like `re-search-forward', but first search for SUBSTR constant. +Then searched for the normal REGEXP (which contains SUBSTR), with given +BOUND and NOERROR. The REGEXP must fit within a single line. +This speeds up complicated regexp matches." + ;; Problem with overlap: search-forward BAR then FOOBARBAZ won't match. + ;; thus require matches to be on one line, and use beginning-of-line. + (let (done) + (while (and (not done) + (search-forward substr bound noerror)) + (save-excursion + (beginning-of-line) + (setq done (re-search-forward regexp (verilog-get-end-of-line) noerror))) + (unless (and (<= (match-beginning 0) (point)) + (>= (match-end 0) (point))) + (setq done nil))) + (when done (goto-char done)) + done)) +;;(verilog-re-search-forward-substr "-end" "get-end-of" nil t) ;;-end (test bait) + +(defsubst verilog-re-search-backward-substr (substr regexp bound noerror) + "Like `re-search-backward', but first search for SUBSTR constant. +Then searched for the normal REGEXP (which contains SUBSTR), with given +BOUND and NOERROR. The REGEXP must fit within a single line. +This speeds up complicated regexp matches." + ;; Problem with overlap: search-backward BAR then FOOBARBAZ won't match. + ;; thus require matches to be on one line, and use beginning-of-line. + (let (done) + (while (and (not done) + (search-backward substr bound noerror)) + (save-excursion + (end-of-line) + (setq done (re-search-backward regexp (verilog-get-beg-of-line) noerror))) + (unless (and (<= (match-beginning 0) (point)) + (>= (match-end 0) (point))) + (setq done nil))) + (when done (goto-char done)) + done)) +;;(verilog-re-search-backward-substr "-end" "get-end-of" nil t) ;;-end (test bait) (defvar compile-command) @@ -1418,10 +1518,11 @@ program that executes when you type \\[compile] or \\[verilog-auto-save-compile]. -By default `verilog-tool' uses a Makefile if one exists in the current -directory. If not, it is set to the `verilog-linter', `verilog-coverage', -`verilog-simulator', or `verilog-compiler' variables, as selected with the -Verilog -> \"Choose Compilation Action\" menu. +By default `verilog-tool' uses a Makefile if one exists in the +current directory. If not, it is set to the `verilog-linter', +`verilog-compiler', `verilog-coverage', `verilog-preprocessor', +or `verilog-simulator' variables, as selected with the Verilog -> +\"Choose Compilation Action\" menu. You should set `verilog-tool' or the other variables to the path and arguments for your Verilog simulator. For example: @@ -1433,8 +1534,12 @@ value of `verilog-tool'; in the later, the path to the current buffer is substituted for the %s. -Where __FILE__ appears in the string, the `buffer-file-name' of the -current buffer, without the directory portion, will be substituted." +Where __FLAGS__ appears in the string `verilog-current-flags' +will be substituted. + +Where __FILE__ appears in the string, the variable +`buffer-file-name' of the current buffer, without the directory +portion, will be substituted." (interactive) (cond ((or (file-exists-p "makefile") ;If there is a makefile, use it @@ -1451,18 +1556,29 @@ "")))) (verilog-modify-compile-command)) +(defun verilog-expand-command (command) + "Replace meta-information in COMMAND and return it. +Where __FLAGS__ appears in the string `verilog-current-flags' +will be substituted. Where __FILE__ appears in the string, the +current buffer's file-name, without the directory portion, will +be substituted." + (setq command (verilog-string-replace-matches + ;; Note \\b only works if under verilog syntax table + "\\b__FLAGS__\\b" (verilog-current-flags) + t t command)) + (setq command (verilog-string-replace-matches + "\\b__FILE__\\b" (file-name-nondirectory + (or (buffer-file-name) "")) + t t command)) + command) + (defun verilog-modify-compile-command () - "Replace meta-information in `compile-command'. -Where __FILE__ appears in the string, the current buffer's file-name, -without the directory portion, will be substituted." + "Update `compile-command' using `verilog-expand-command'." (when (and (stringp compile-command) - (string-match "\\b__FILE__\\b" compile-command)) + (string-match "\\b\\(__FLAGS__\\|__FILE__\\)\\b" compile-command)) (make-local-variable 'compile-command) - (setq compile-command - (verilog-string-replace-matches - "\\b__FILE__\\b" (file-name-nondirectory (buffer-file-name)) - t t compile-command)))) + (setq compile-command (verilog-expand-command compile-command)))) (if (featurep 'xemacs) ;; Following code only gets called from compilation-mode-hook on XEmacs to add error handling. @@ -1511,11 +1627,13 @@ (if (featurep 'emacs) (add-hook 'compilation-mode-hook 'verilog-error-regexp-add-emacs)) (defconst verilog-directive-re - ;; "`case" "`default" "`define" "`define" "`else" "`endfor" "`endif" - ;; "`endprotect" "`endswitch" "`endwhile" "`for" "`format" "`if" "`ifdef" - ;; "`ifndef" "`include" "`let" "`protect" "`switch" "`timescale" - ;; "`time_scale" "`undef" "`while" - "\\<`\\(case\\|def\\(ault\\|ine\\(\\)?\\)\\|e\\(lse\\|nd\\(for\\|if\\|protect\\|switch\\|while\\)\\)\\|for\\(mat\\)?\\|i\\(f\\(def\\|ndef\\)?\\|nclude\\)\\|let\\|protect\\|switch\\|time\\(_scale\\|scale\\)\\|undef\\|while\\)\\>") + (eval-when-compile + (verilog-regexp-words + '( + "`case" "`default" "`define" "`else" "`elsif" "`endfor" "`endif" + "`endprotect" "`endswitch" "`endwhile" "`for" "`format" "`if" "`ifdef" + "`ifndef" "`include" "`let" "`protect" "`switch" "`timescale" + "`time_scale" "`undef" "`while" )))) (defconst verilog-directive-re-1 (concat "[ \t]*" verilog-directive-re)) @@ -1524,7 +1642,7 @@ "\\<`\\(for\\|i\\(f\\|fdef\\|fndef\\)\\|switch\\|while\\)\\>") (defconst verilog-directive-middle - "\\<`\\(else\\|default\\|case\\)\\>") + "\\<`\\(else\\|elsif\\|default\\|case\\)\\>") (defconst verilog-directive-end "`\\(endfor\\|endif\\|endswitch\\|endwhile\\)\\>") @@ -1703,6 +1821,11 @@ ;; b : (defconst verilog-label-re (concat verilog-symbol-re "\\s-*:\\s-*")) +(defconst verilog-property-re + (concat "\\(" verilog-label-re "\\)?" + "\\(\\(assert\\|assume\\|cover\\)\\>\\s-+\\\\)\\|\\(assert\\)")) + ;; "\\(assert\\|assume\\|cover\\)\\s-+property\\>" + (defconst verilog-no-indent-begin-re "\\<\\(if\\|else\\|while\\|for\\|repeat\\|always\\|always_comb\\|always_ff\\|always_latch\\)\\>") @@ -1837,6 +1960,8 @@ "\\(\\\\)\\|" ; 7 "\\(\\\\(\[ \t\]*@\\)?\\)\\|" "\\(\\\\)\\|" + verilog-property-re "\\|" + "\\(\\(" verilog-label-re "\\)?\\\\)\\|" "\\(\\\\)\\|" "\\(\\\\)\\|" "\\(\\\\)\\|" @@ -2051,7 +2176,7 @@ "`case" "`default" "`define" "`undef" - "`if" "`ifdef" "`ifndef" "`else" "`endif" + "`if" "`ifdef" "`ifndef" "`else" "`elsif" "`endif" "`while" "`endwhile" "`for" "`endfor" "`format" @@ -2120,7 +2245,7 @@ (defconst verilog-fork-wait-re "fork\\s-+wait\\>") (defconst verilog-extended-case-re "\\(unique\\s-+\\|priority\\s-+\\)?case[xz]?") (defconst verilog-extended-complete-re - (concat "\\(\\\\|\\\\)" + (concat "\\(\\\\s-+\\)?virtual\\s-+\\|\\\\|\\\\)" "\\|\\(\\\\s-+\\)*\\(\\\\|\\\\|\\\\)" "\\|\\(\\\\s-+\\)?\"DPI-C\"\\s-+\\(function\\>\\|task\\>\\)" "\\|" verilog-extended-case-re )) @@ -2468,7 +2593,7 @@ '("\\(@\\)\\|\\(#\\s-*\\(\\(\[0-9_.\]+\\('s?[hdxbo][0-9a-fA-F_xz]*\\)?\\)\\|\\(([^()]+)\\|\\sw+\\)\\)\\)" 0 font-lock-type-face append) ;; Fontify instantiation names - '("\\([A-Za-z][A-Za-z0-9_]+\\)\\s-*(" 1 font-lock-function-name-face) + '("\\([A-Za-z][A-Za-z0-9_]*\\)\\s-*(" 1 font-lock-function-name-face) ))) (setq verilog-font-lock-keywords-3 @@ -2480,22 +2605,145 @@ (0 'verilog-font-lock-translate-off-face prepend)) ))))) +;; +;; Buffer state preservation + +(defmacro verilog-save-buffer-state (&rest body) + "Execute BODY forms, saving state around insignificant change. +Changes in text properties like `face' or `syntax-table' are +considered insignificant. This macro allows text properties to +be changed, even in a read-only buffer. + +A change is considered significant if it affects the buffer text +in any way that isn't completely restored again. Any +user-visible changes to the buffer must not be within a +`verilog-save-buffer-state'." + ;; From c-save-buffer-state + `(let* ((modified (buffer-modified-p)) + (buffer-undo-list t) + (inhibit-read-only t) + (inhibit-point-motion-hooks t) + before-change-functions + after-change-functions + deactivate-mark + buffer-file-name ; Prevent primitives checking + buffer-file-truename) ; for file modification + (unwind-protect + (progn ,@body) + (and (not modified) + (buffer-modified-p) + (set-buffer-modified-p nil))))) + +(defmacro verilog-save-no-change-functions (&rest body) + "Execute BODY forms, disabling all change hooks in BODY. +For insigificant changes, see instead `verilog-save-buffer-state'." + `(let* ((inhibit-point-motion-hooks t) + before-change-functions + after-change-functions) + (progn ,@body))) + +;; +;; Comment detection and caching + +(defvar verilog-scan-cache-preserving nil + "If set, the specified buffer's comment properties are static. +Buffer changes will be ignored. See `verilog-inside-comment-p' +and `verilog-scan'.") + +(defvar verilog-scan-cache-tick nil + "Modification tick at which `verilog-scan' was last completed.") +(make-variable-buffer-local 'verilog-scan-cache-tick) + +(defun verilog-scan-cache-ok-p () + "Return t iff the scan cache is up to date." + (or (and verilog-scan-cache-preserving + (eq verilog-scan-cache-preserving (current-buffer)) + verilog-scan-cache-tick) + (equal verilog-scan-cache-tick (buffer-chars-modified-tick)))) + +(defmacro verilog-save-scan-cache (&rest body) + "Execute the BODY forms, allowing scan cache preservation within BODY. +This requires that insertions must use `verilog-insert'." + ;; If the buffer is out of date, trash it, as we'll not check later the tick + ;; Note this must work properly if there's multiple layers of calls + ;; to verilog-save-scan-cache even with differing ticks. + `(progn + (unless (verilog-scan-cache-ok-p) ;; Must be before let + (setq verilog-scan-cache-tick nil)) + (let* ((verilog-scan-cache-preserving (current-buffer))) + (progn ,@body)))) + +(defun verilog-scan-region (beg end) + "Parse comments between BEG and END for `verilog-inside-comment-p'. +This creates v-cmt properties where comments are in force." + ;; Why properties and not overlays? Overlays have much slower non O(1) + ;; lookup times. + ;; This function is warm - called on every verilog-insert + (save-excursion + (save-match-data + (verilog-save-buffer-state + (let (pt) + (goto-char beg) + (while (< (point) end) + (cond ((looking-at "//") + (setq pt (point)) + (or (search-forward "\n" end t) + (goto-char end)) + ;; "1+": The leading // or /* itself isn't considered as + ;; being "inside" the comment, so that a (search-backward) + ;; that lands at the start of the // won't mis-indicate + ;; it's inside a comment + (put-text-property (1+ pt) (point) 'v-cmt t)) + ((looking-at "/\\*") + (setq pt (point)) + (or (search-forward "*/" end t) + ;; No error - let later code indicate it so we can + ;; use inside functions on-the-fly + ;;(error "%s: Unmatched /* */, at char %d" + ;; (verilog-point-text) (point)) + (goto-char end)) + (put-text-property (1+ pt) (point) 'v-cmt t)) + (t + (forward-char 1) + (if (re-search-forward "/[/*]" end t) + (backward-char 2) + (goto-char end)))))))))) + +(defun verilog-scan () + "Parse the buffer, marking all comments with properties. +Also assumes any text inserted since `verilog-scan-cache-tick' +either is ok to parse as a non-comment, or `verilog-insert' was used." + (unless (verilog-scan-cache-ok-p) + (save-excursion + (verilog-save-buffer-state + (when verilog-debug + (message "Scanning %s cache=%s cachetick=%S tick=%S" (current-buffer) + verilog-scan-cache-preserving verilog-scan-cache-tick + (buffer-chars-modified-tick))) + (remove-text-properties (point-min) (point-max) '(v-cmt nil)) + (verilog-scan-region (point-min) (point-max)) + (setq verilog-scan-cache-tick (buffer-chars-modified-tick)) + (when verilog-debug (message "Scaning... done")))))) (defun verilog-inside-comment-p () - "Check if point inside a nested comment." - (save-excursion - (let ((st-point (point)) hitbeg) - (or (search-backward "//" (verilog-get-beg-of-line) t) - (if (progn - ;; This is for tricky case //*, we keep searching if /* - ;; is proceeded by // on same line. - (while - (and (setq hitbeg (search-backward "/*" nil t)) - (progn - (forward-char 1) - (search-backward "//" (verilog-get-beg-of-line) t)))) - hitbeg) - (not (search-forward "*/" st-point t))))))) + "Check if point inside a comment. +This may require a slow pre-parse of the buffer with `verilog-scan' +to establish comment properties on all text." + ;; This function is very hot + (verilog-scan) + (get-text-property (point) 'v-cmt)) + +(defun verilog-insert (&rest stuff) + "Insert STUFF arguments, tracking comments for `verilog-inside-comment-p'. +Any insert that includes a comment must have the entire commente +inserted using a single call to `verilog-insert'." + (let ((pt (point))) + (while stuff + (insert (car stuff)) + (setq stuff (cdr stuff))) + (verilog-scan-region pt (point)))) + +;; More searching (defun verilog-declaration-end () (search-forward ";")) @@ -2917,15 +3165,16 @@ nil 'verilog-beg-of-defun))) ;;------------------------------------------------------------ - ;; now hook in 'verilog-colorize-include-files (eldo-mode.el&spice-mode.el) + ;; now hook in 'verilog-highlight-include-files (eldo-mode.el&spice-mode.el) ;; all buffer local: - (when (featurep 'xemacs) - (make-local-hook 'font-lock-mode-hook) - (make-local-hook 'font-lock-after-fontify-buffer-hook); doesn't exist in Emacs - (make-local-hook 'after-change-functions)) - (add-hook 'font-lock-mode-hook 'verilog-colorize-include-files-buffer t t) - (add-hook 'font-lock-after-fontify-buffer-hook 'verilog-colorize-include-files-buffer t t) ; not in Emacs - (add-hook 'after-change-functions 'verilog-colorize-include-files t t) + (unless noninteractive ;; Else can't see the result, and change hooks are slow + (when (featurep 'xemacs) + (make-local-hook 'font-lock-mode-hook) + (make-local-hook 'font-lock-after-fontify-buffer-hook); doesn't exist in Emacs + (make-local-hook 'after-change-functions)) + (add-hook 'font-lock-mode-hook 'verilog-highlight-buffer t t) + (add-hook 'font-lock-after-fontify-buffer-hook 'verilog-highlight-buffer t t) ; not in Emacs + (add-hook 'after-change-functions 'verilog-highlight-region t t)) ;; Tell imenu how to handle Verilog. (make-local-variable 'imenu-generic-expression) @@ -3355,34 +3604,53 @@ (interactive) ;; Move back token by token until we see the end ;; of some ealier line. - (while - ;; If the current point does not begin a new - ;; statement, as in the character ahead of us is a ';', or SOF - ;; or the string after us unambiguously starts a statement, - ;; or the token before us unambiguously ends a statement, - ;; then move back a token and test again. - (not (or - (bolp) - (= (preceding-char) ?\;) - (looking-at "\\w+\\W*:\\W*\\(coverpoint\\|cross\\|constraint\\)") - (not (or - (looking-at "\\<") - (forward-word -1))) - (and - (looking-at verilog-complete-reg) - (not (save-excursion - (verilog-backward-token) - (looking-at verilog-extended-complete-re)))) - (looking-at verilog-basic-complete-re) - (save-excursion - (verilog-backward-token) - (or - (looking-at verilog-end-block-re) - (looking-at verilog-preprocessor-re))))) + (let (h) + (while + ;; If the current point does not begin a new + ;; statement, as in the character ahead of us is a ';', or SOF + ;; or the string after us unambiguously starts a statement, + ;; or the token before us unambiguously ends a statement, + ;; then move back a token and test again. + (not (or + ;; stop if beginning of buffer + (bolp) + ;; stop if we find a ; + (= (preceding-char) ?\;) + ;; stop if we see a named coverpoint + (looking-at "\\w+\\W*:\\W*\\(coverpoint\\|cross\\|constraint\\)") + ;; keep going if we are in the middle of a word + (not (or (looking-at "\\<") (forward-word -1))) + ;; stop if we see an assertion (perhaps labled) + (and + (looking-at "\\(\\<\\(assert\\|assume\\|cover\\)\\>\\s-+\\\\)\\|\\(\\\\)") + (progn + (setq h (point)) + (save-excursion + (verilog-backward-token) + (if (looking-at verilog-label-re) + (setq h (point)))) + (goto-char h))) + ;; stop if we see a complete reg, perhaps an extended one + (and + (looking-at verilog-complete-reg) + (let* ((p (point))) + (while (and (looking-at verilog-extended-complete-re) + (progn (setq p (point)) + (verilog-backward-token) + (/= p (point))))) + (goto-char p))) + ;; stop if we see a complete reg (previous found extended ones) + (looking-at verilog-basic-complete-re) + ;; stop if previous token is an ender + (save-excursion + (verilog-backward-token) + (or + (looking-at verilog-end-block-re) + (looking-at verilog-preprocessor-re))))) ;; end of test (verilog-backward-syntactic-ws) (verilog-backward-token)) - ;; Now point is where the previous line ended. - (verilog-forward-syntactic-ws)) + ;; Now point is where the previous line ended. + (verilog-forward-syntactic-ws))) (defun verilog-beg-of-statement-1 () "Move backward to beginning of statement." @@ -3395,7 +3663,10 @@ (setq pt (point)) (verilog-backward-syntactic-ws) (if (or (bolp) - (= (preceding-char) ?\;)) + (= (preceding-char) ?\;) + (save-excursion + (verilog-backward-token) + (looking-at verilog-ends-re))) (progn (goto-char pt) (throw 'done t)) @@ -3494,6 +3765,14 @@ (t (throw 'found (= nest 0))))))) nil))) +(defun verilog-backward-up-list (arg) + "Like backward-up-list, but deal with comments." + (let (saved-psic parse-sexp-ignore-comments) + (setq parse-sexp-ignore-comments 1) + (backward-up-list arg) + (setq parse-sexp-ignore-comments saved-psic) + )) + (defun verilog-in-struct-region-p () "Return true if in a struct region. More specifically, in a list after a struct|union keyword." @@ -3502,7 +3781,7 @@ (let* ((state (verilog-syntax-ppss)) (depth (nth 0 state))) (if depth - (progn (backward-up-list depth) + (progn (verilog-backward-up-list depth) (verilog-beg-of-statement) (looking-at "\\?\\s-*\\")))))) @@ -3628,7 +3907,8 @@ "\\(`endif\\>\\)\\|" "\\(`if\\>\\)\\|" "\\(`ifdef\\>\\)\\|" - "\\(`ifndef\\>\\)")) + "\\(`ifndef\\>\\)\\|" + "\\(`elsif\\>\\)")) (defun verilog-set-auto-endcomments (indent-str kill-existing-comment) "Add ending comment with given INDENT-STR. With KILL-EXISTING-COMMENT, remove what was there before. @@ -3668,7 +3948,12 @@ ((match-end 4) ; `ifdef (setq nest (1- nest))) ((match-end 5) ; `ifndef - (setq nest (1- nest))))) + (setq nest (1- nest))) + ((match-end 6) ; `elsif + (if (= nest 1) + (progn + (setq else "!") + (setq nest 0)))))) (if (match-end 0) (setq m (buffer-substring @@ -3685,7 +3970,7 @@ (if (> (count-lines (point) b) verilog-minimum-comment-distance) (insert (concat " // " else m " " (buffer-substring b e)))) (progn - (insert " // unmatched `else or `endif") + (insert " // unmatched `else, `elsif or `endif") (ding 't))))) (; Comment close case/class/function/task/module and named block @@ -3764,8 +4049,8 @@ (cond (; (eq here (progn - (verilog-backward-token) - (verilog-beg-of-statement-1) + ;; (verilog-backward-token) + (verilog-beg-of-statement) (point))) (setq err nil) (setq str "")) @@ -3789,7 +4074,7 @@ (;- else (match-end 2) (let ((nest 0) - ( reg "\\(\\\\)\\|\\(\\\\)\\|\\(\\\\)")) + ( reg "\\(\\\\)\\|\\(\\\\)\\|\\(\\\\)\\|\\(assert\\)")) (catch 'skip (while (verilog-re-search-backward reg nil 'move) (cond @@ -3805,13 +4090,21 @@ (setq err nil) (setq str (verilog-get-expr)) (setq str (concat " // else: !if" str )) + (throw 'skip 1)))) + ((match-end 4) + (if (= 0 nest) + (progn + (goto-char (match-end 0)) + (setq there (point)) + (setq err nil) + (setq str (verilog-get-expr)) + (setq str (concat " // else: !assert " str )) (throw 'skip 1))))))))) - (;- end else (match-end 3) (goto-char there) (let ((nest 0) - (reg "\\(\\\\)\\|\\(\\\\)\\|\\(\\\\)")) + (reg "\\(\\\\)\\|\\(\\\\)\\|\\(\\\\)\\|\\(assert\\)")) (catch 'skip (while (verilog-re-search-backward reg nil 'move) (cond @@ -3827,7 +4120,17 @@ (setq err nil) (setq str (verilog-get-expr)) (setq str (concat " // else: !if" str )) + (throw 'skip 1)))) + ((match-end 4) + (if (= 0 nest) + (progn + (goto-char (match-end 0)) + (setq there (point)) + (setq err nil) + (setq str (verilog-get-expr)) + (setq str (concat " // else: !assert " str )) (throw 'skip 1))))))))) + (; always_comb, always_ff, always_latch (or (match-end 4) (match-end 5) (match-end 6)) (goto-char (match-end 0)) @@ -3960,6 +4263,10 @@ (setq b (progn (skip-chars-forward "^ \t") (verilog-forward-ws&directives) + (if (looking-at "static\\|automatic") + (progn + (goto-char (match-end 0)) + (verilog-forward-ws&directives))) (if (and name-re (verilog-re-search-forward name-re nil 'move)) (progn (goto-char (match-beginning 0)) @@ -4243,6 +4550,28 @@ (save-buffer) (compile compile-command)) +(defun verilog-preprocess (&optional command filename) + "Preprocess the buffer, similar to `compile', but leave output in Verilog-Mode. +Takes optional COMMAND or defaults to `verilog-preprocessor', and +FILENAME or defaults to `buffer-file-name`." + (interactive + (list + (let ((default (verilog-expand-command verilog-preprocessor))) + (set (make-local-variable `verilog-preprocessor) + (read-from-minibuffer "Run Preprocessor (like this): " + default nil nil + 'verilog-preprocess-history default))))) + (unless command (setq command (verilog-expand-command verilog-preprocessor))) + (let* ((dir (file-name-directory (or filename buffer-file-name))) + (file (file-name-nondirectory (or filename buffer-file-name))) + (cmd (concat "cd " dir "; " command " " file))) + (with-output-to-temp-buffer "*Verilog-Preprocessed*" + (save-excursion + (set-buffer "*Verilog-Preprocessed*") + (insert (concat "// " cmd "\n")) + (shell-command cmd "*Verilog-Preprocessed*") + (verilog-mode) + (font-lock-mode))))) ;; @@ -4385,7 +4714,7 @@ ;; if we have a directive, done. (if (save-excursion (beginning-of-line) (and (looking-at verilog-directive-re-1) - (not (or (looking-at "[ \t]*`ovm_") + (not (or (looking-at "[ \t]*`ovm_") (looking-at "[ \t]*`vmm_"))))) (throw 'nesting 'directive)) ;; indent structs as if there were module level @@ -4449,8 +4778,7 @@ ((match-end 3) ; assert block (setq elsec (1- elsec)) (verilog-beg-of-statement) ;; doesn't get to beginning - (if (looking-at (concat "\\(" verilog-label-re "\\)?" - "\\(assert\\|assume\\|cover\\)\\s-+property\\>")) + (if (looking-at verilog-property-re) (throw 'nesting 'statement) ; We don't need an endproperty for these (throw 'nesting 'block) ;We still need a endproperty )) @@ -4584,6 +4912,13 @@ (goto-char here) (throw 'nesting 'block))))) + ((match-end 27) ; *sigh* might be a clocking declaration + (let ((here (point))) + (if (verilog-in-paren) + t ; 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 "\\") @@ -4607,8 +4942,7 @@ ; but ; property ID () ... needs end_property (verilog-beg-of-statement) - (if (looking-at (concat "\\(" verilog-label-re "\\)?" - "\\(assert\\|assume\\|cover\\)\\s-+property\\>")) + (if (looking-at verilog-property-re) (throw 'continue 'statement) ; We don't need an endproperty for these (throw 'nesting 'block) ;We still need a endproperty )) @@ -4857,7 +5191,7 @@ (= (preceding-char) ?\)) (progn (backward-char) - (backward-up-list 1) + (verilog-backward-up-list 1) (verilog-backward-syntactic-ws) (let ((back (point))) (forward-word -1) @@ -4981,14 +5315,19 @@ (let ((state (save-excursion (verilog-syntax-ppss)))) (cond ((nth 7 state) ;; in // comment - (verilog-re-search-forward "//" nil 'move)) + (end-of-line) + (forward-char 1) + (skip-chars-forward " \t\n\f") + ) ((nth 4 state) ;; in /* */ comment - (verilog-re-search-forward "/\*" nil 'move)))) + (verilog-re-search-forward "\*\/\\s-*" nil 'move)))) (narrow-to-region (point) bound) (while (/= here (point)) (setq here (point) jump nil) (forward-comment (buffer-size)) + (and (looking-at "\\s-*(\\*.*\\*)\\s-*") ;; Attribute + (goto-char (match-end 0))) (save-excursion (beginning-of-line) (if (looking-at verilog-directive-re-1) @@ -5020,6 +5359,12 @@ (let ((state (save-excursion (verilog-syntax-ppss)))) (or (nth 3 state) (nth 4 state) (nth 7 state)))) ; Inside string or comment) +(defun verilog-in-attribute-p () + "Return true if point is in an attribute (* [] attribute *)." + (save-excursion + (verilog-re-search-backward "\\((\\*\\)\\|\\(\\*)\\)" nil 'move) + (numberp (match-beginning 1)))) + (defun verilog-in-escaped-name-p () "Return true if in an escaped name." (save-excursion @@ -5029,7 +5374,7 @@ t nil))) (defun verilog-in-directive-p () - "Return true if in a star or // comment." + "Return true if in a directive." (save-excursion (beginning-of-line) (looking-at verilog-directive-re-1))) @@ -5045,7 +5390,7 @@ (save-excursion (if (verilog-in-paren) (progn - (backward-up-list 1) + (verilog-backward-up-list 1) (verilog-at-struct-p) ) nil))) @@ -5056,7 +5401,7 @@ (save-excursion (if (verilog-in-paren) (progn - (backward-up-list 1) + (verilog-backward-up-list 1) (verilog-at-constraint-p) ) nil))) @@ -5147,30 +5492,70 @@ (search-backward "/*") (skip-chars-backward " \t\n\f") t) - ((if (and (not (bobp)) - (= (char-before) ?\/) - (= (char-before (1- (point))) ?\*)) - (goto-char (- (point) 2)) - (/= (skip-chars-backward " \t\n\f") 0))))))))) + ((and (not (bobp)) + (= (char-before) ?\/) + (= (char-before (1- (point))) ?\*)) + (goto-char (- (point) 2)) + t) ;; Let nth 4 state handle the rest + ((and (not (bobp)) + (= (char-before) ?\)) + (= (char-before (1- (point))) ?\*)) + (goto-char (- (point) 2)) + (if (search-backward "(*" nil t) + (progn + (skip-chars-backward " \t\n\f") + t) + (progn + (goto-char (+ (point) 2)) + nil))) + (t + (/= (skip-chars-backward " \t\n\f") 0)))))))) (defun verilog-skip-forward-comment-p () "If in comment, move to end and return true." - (let (state) - (progn - (setq state (save-excursion (verilog-syntax-ppss))) - (cond - ((nth 3 state) ;Inside string - t) - ((nth 7 state) ;Inside // comment - (end-of-line) - (forward-char 1) - t) - ((nth 4 state) ;Inside any comment - (search-forward "*/") - (skip-chars-forward " \t\n\f") - t) - (t - (skip-chars-forward " \t\n\f")))))) + (let* (h + (state (save-excursion (verilog-syntax-ppss))) + (skip (cond + ((nth 3 state) ;Inside string + t) + ((nth 7 state) ;Inside // comment + (end-of-line) + (forward-char 1) + t) + ((nth 4 state) ;Inside /* comment + (search-forward "*/") + t) + ((verilog-in-attribute-p) ;Inside (* attribute + (search-forward "*)" nil t) + t) + (t nil)))) + (skip-chars-forward " \t\n\f") + (while + (cond + ((looking-at "\\/\\*") + (progn + (setq h (point)) + (goto-char (match-end 0)) + (if (search-forward "*/" nil t) + (progn + (skip-chars-forward " \t\n\f") + (setq skip 't)) + (progn + (goto-char h) + nil)))) + ((looking-at "(\\*") + (progn + (setq h (point)) + (goto-char (match-end 0)) + (if (search-forward "*)" nil t) + (progn + (skip-chars-forward " \t\n\f") + (setq skip 't)) + (progn + (goto-char h) + nil)))) + (t nil))) + skip)) (defun verilog-indent-line-relative () "Cheap version of indent line. @@ -5237,7 +5622,7 @@ ((= (following-char) ?\[) (progn (forward-char 1) - (backward-up-list -1) + (verilog-backward-up-list -1) (skip-chars-forward " \t")))) (current-column)) (progn @@ -5262,13 +5647,24 @@ (; handle inside parenthetical expressions (eq type 'cparenexp) - (let ((val (save-excursion - (backward-up-list 1) - (forward-char 1) - (skip-chars-forward " \t") - (current-column)))) - (indent-line-to val) - )) + (let* ( here + (val (save-excursion + (verilog-backward-up-list 1) + (forward-char 1) + (if verilog-indent-lists + (skip-chars-forward " \t") + (verilog-forward-syntactic-ws)) + (setq here (point)) + (current-column))) + + (decl (save-excursion + (goto-char here) + (verilog-forward-syntactic-ws) + (setq here (point)) + (looking-at verilog-declaration-re)))) + (indent-line-to val) + (if decl + (verilog-pretty-declarations)))) (;-- Handle the ends (or @@ -5419,16 +5815,16 @@ (if (progn ; (verilog-beg-of-statement-1) (beginning-of-line) - (verilog-forward-syntactic-ws) + (verilog-forward-syntactic-ws) (and (not (verilog-in-directive-p)) ;; could have `define input foo (looking-at verilog-declaration-re))) (progn - (if (verilog-parenthesis-depth) - ;; in an argument list or parameter block - (setq el (backward-up-list -1) + (if (verilog-parenthesis-depth) + ;; in an argument list or parameter block + (setq el (verilog-backward-up-list -1) start (progn (goto-char e) - (backward-up-list 1) + (verilog-backward-up-list 1) (forward-line) ;; ignore ( input foo, (verilog-re-search-forward verilog-declaration-re el 'move) (goto-char (match-beginning 0)) @@ -5437,19 +5833,19 @@ startpos (set-marker (make-marker) start) end (progn (goto-char start) - (backward-up-list -1) + (verilog-backward-up-list -1) (forward-char -1) (verilog-backward-syntactic-ws) (point)) endpos (set-marker (make-marker) end) base-ind (progn (goto-char start) - (verilog-do-indent (verilog-calculate-indent)) - (verilog-forward-ws&directives) - (current-column)) + (forward-char 1) + (skip-chars-forward " \t") + (current-column)) ) ;; in a declaration block (not in argument list) - (setq + (setq start (progn (verilog-beg-of-statement-1) (while (and (looking-at verilog-declaration-re) @@ -5468,7 +5864,6 @@ (setq e (point)) ;Might be on last line (verilog-forward-syntactic-ws) (while (looking-at verilog-declaration-re) - ;;(beginning-of-line) (verilog-end-of-statement) (setq e (point)) (verilog-forward-syntactic-ws)) @@ -5488,7 +5883,7 @@ (while (progn (setq e (marker-position endpos)) (< (point) e)) (cond - ((save-excursion (skip-chars-backward " \t") + ((save-excursion (skip-chars-backward " \t") (bolp)) (verilog-forward-ws&directives) (indent-line-to base-ind) @@ -5509,7 +5904,7 @@ (> r 0)) (setq e (point)) (unless quiet (message "%d" r)) - (verilog-indent-line) + ;;(verilog-do-indent (verilog-calculate-indent))) (verilog-forward-ws&directives) (cond ((or (and verilog-indent-declaration-macros @@ -5543,12 +5938,12 @@ (defun verilog-pretty-expr (&optional quiet myre) "Line up expressions around point, optionally QUIET with regexp MYRE." - (interactive "sRegular Expression: ((<|:)?=) ") + (interactive "i\nsRegular Expression: ((<|:)?=) ") (save-excursion (if (or (eq myre nil) (string-equal myre "")) (setq myre "\\(<\\|:\\)?=")) - ;; want to match the first <= | := | = + ;; want to match the first <= | := | = (setq myre (concat "\\(^.*?\\)\\(" myre "\\)")) (let ((rexp(concat "^\\s-*" verilog-complete-reg))) (beginning-of-line) @@ -5873,6 +6268,39 @@ Variables and function names defined within the Verilog program will be completed at runtime and should not be added to this list.") +(defvar verilog-gate-ios + ;; All these have an implied {"input"...} at the end + '(("and" "output") + ("buf" "output") + ("bufif0" "output") + ("bufif1" "output") + ("cmos" "output") + ("nand" "output") + ("nmos" "output") + ("nor" "output") + ("not" "output") + ("notif0" "output") + ("notif1" "output") + ("or" "output") + ("pmos" "output") + ("pulldown" "output") + ("pullup" "output") + ("rcmos" "output") + ("rnmos" "output") + ("rpmos" "output") + ("rtran" "inout" "inout") + ("rtranif0" "inout" "inout") + ("rtranif1" "inout" "inout") + ("tran" "inout" "inout") + ("tranif0" "inout" "inout") + ("tranif1" "inout" "inout") + ("xnor" "output") + ("xor" "output")) + "*Map of direction for each positional argument to each gate primitive.") + +(defvar verilog-gate-keywords (mapcar `car verilog-gate-ios) + "*Keywords for gate primitives.") + (defun verilog-string-diff (str1 str2) "Return index of first letter where STR1 and STR2 differs." (catch 'done @@ -6203,7 +6631,7 @@ (verilog-completion-response)))) (defun verilog-goto-defun () - "Move to specified Verilog module/task/function. + "Move to specified Verilog module/interface/task/function. The default is a name found in the buffer around point. If search fails, other files are checked based on `verilog-library-flags'." @@ -6447,6 +6875,8 @@ ;; ;; Elements of a signal list +(defsubst verilog-sig-new (name bits comment mem enum signed type multidim modport) + (list name bits comment mem enum signed type multidim modport)) (defsubst verilog-sig-name (sig) (car sig)) (defsubst verilog-sig-bits (sig) @@ -6475,37 +6905,96 @@ (defsubst verilog-sig-width (sig) (verilog-make-width-expression (verilog-sig-bits sig))) +(defsubst verilog-alw-new (outputs temps inputs delayed) + (list outputs temps inputs delayed)) +(defsubst verilog-alw-get-outputs (sigs) + (nth 0 sigs)) +(defsubst verilog-alw-get-temps (sigs) + (nth 1 sigs)) (defsubst verilog-alw-get-inputs (sigs) (nth 2 sigs)) -(defsubst verilog-alw-get-outputs (sigs) - (nth 0 sigs)) (defsubst verilog-alw-get-uses-delayed (sigs) (nth 3 sigs)) +(defsubst verilog-modi-new (name fob pt type) + (vector name fob pt type)) +(defsubst verilog-modi-name (modi) + (aref modi 0)) +(defsubst verilog-modi-file-or-buffer (modi) + (aref modi 1)) +(defsubst verilog-modi-get-point (modi) + (aref modi 2)) +(defsubst verilog-modi-get-type (modi) ;; "module" or "interface" + (aref modi 3)) +(defsubst verilog-modi-get-decls (modi) + (verilog-modi-cache-results modi 'verilog-read-decls)) +(defsubst verilog-modi-get-sub-decls (modi) + (verilog-modi-cache-results modi 'verilog-read-sub-decls)) + +;; Signal reading for given module +;; Note these all take modi's - as returned from verilog-modi-current +(defsubst verilog-decls-new (out inout in wires regs assigns consts gparams interfaces) + (vector out inout in wires regs assigns consts gparams interfaces)) +(defsubst verilog-decls-get-outputs (decls) + (aref decls 0)) +(defsubst verilog-decls-get-inouts (decls) + (aref decls 1)) +(defsubst verilog-decls-get-inputs (decls) + (aref decls 2)) +(defsubst verilog-decls-get-wires (decls) + (aref decls 3)) +(defsubst verilog-decls-get-regs (decls) + (aref decls 4)) +(defsubst verilog-decls-get-assigns (decls) + (aref decls 5)) +(defsubst verilog-decls-get-consts (decls) + (aref decls 6)) +(defsubst verilog-decls-get-gparams (decls) + (aref decls 7)) +(defsubst verilog-decls-get-interfaces (decls) + (aref decls 8)) + +(defsubst verilog-subdecls-new (out inout in intf intfd) + (vector out inout in intf intfd)) +(defsubst verilog-subdecls-get-outputs (subdecls) + (aref subdecls 0)) +(defsubst verilog-subdecls-get-inouts (subdecls) + (aref subdecls 1)) +(defsubst verilog-subdecls-get-inputs (subdecls) + (aref subdecls 2)) +(defsubst verilog-subdecls-get-interfaces (subdecls) + (aref subdecls 3)) +(defsubst verilog-subdecls-get-interfaced (subdecls) + (aref subdecls 4)) + (defun verilog-signals-not-in (in-list not-list) "Return list of signals in IN-LIST that aren't also in NOT-LIST. Also remove any duplicates in IN-LIST. Signals must be in standard (base vector) form." - (let (out-list) - (while in-list - (if (not (or (assoc (car (car in-list)) not-list) - (assoc (car (car in-list)) out-list))) - (setq out-list (cons (car in-list) out-list))) - (setq in-list (cdr in-list))) - (nreverse out-list))) + ;; This function is hot, so implemented as O(1) + (cond ((eval-when-compile (fboundp 'make-hash-table)) + (let ((ht (make-hash-table :test 'equal :rehash-size 4.0)) + out-list) + (while not-list + (puthash (car (car not-list)) t ht) + (setq not-list (cdr not-list))) + (while in-list + (when (not (gethash (car (car in-list)) ht)) + (setq out-list (cons (car in-list) out-list)) + (puthash (car (car in-list)) t ht)) + (setq in-list (cdr in-list))) + (nreverse out-list))) + ;; Slower Fallback if no hash tables (pre Emacs 21.1/XEmacs 21.4) + (t + (let (out-list) + (while in-list + (if (not (or (assoc (car (car in-list)) not-list) + (assoc (car (car in-list)) out-list))) + (setq out-list (cons (car in-list) out-list))) + (setq in-list (cdr in-list))) + (nreverse out-list))))) ;;(verilog-signals-not-in '(("A" "") ("B" "") ("DEL" "[2:3]")) '(("DEL" "") ("EXT" ""))) -(defun verilog-signals-in (in-list other-list) - "Return list of signals in IN-LIST that are also in OTHER-LIST. -Signals must be in standard (base vector) form." - (let (out-list) - (while in-list - (if (assoc (car (car in-list)) other-list) - (setq out-list (cons (car in-list) out-list))) - (setq in-list (cdr in-list))) - (nreverse out-list))) -;;(verilog-signals-in '(("A" "") ("B" "") ("DEL" "[2:3]")) '(("DEL" "") ("EXT" ""))) - (defun verilog-signals-memory (in-list) "Return list of signals in IN-LIST that are memoried (multidimensional)." (let (out-list) @@ -6599,15 +7088,15 @@ ;; Note sig may also be nil for the last signal in the list (t (setq out-list - (cons - (list sv-name + (cons (verilog-sig-new + sv-name (or sv-busstring (if sv-highbit (concat "[" (int-to-string sv-highbit) ":" (int-to-string sv-lowbit) "]"))) (concat sv-comment combo buswarn) sv-memory sv-enum sv-signed sv-type sv-multidim sv-modport) - out-list) + out-list) sv-name nil)))) ;; out-list)) @@ -6645,20 +7134,26 @@ (verilog-re-search-backward-quick "\\(\\b[a-zA-Z0-9`_\$]\\|\\]\\)" nil nil)) (skip-chars-backward "a-zA-Z0-9`_$")) +(defun verilog-read-inst-module-matcher () + "Set match data 0 with module_name when point is inside instantiation." + (verilog-read-inst-backward-name) + ;; Skip over instantiation name + (verilog-re-search-backward-quick "\\(\\b[a-zA-Z0-9`_\$]\\|)\\)" nil nil) ; ) isn't word boundary + ;; Check for parameterized instantiations + (when (looking-at ")") + (verilog-backward-open-paren) + (verilog-re-search-backward-quick "\\b[a-zA-Z0-9`_\$]" nil nil)) + (skip-chars-backward "a-zA-Z0-9'_$") + (looking-at "[a-zA-Z0-9`_\$]+") + ;; Important: don't use match string, this must work with Emacs 19 font-lock on + (buffer-substring-no-properties (match-beginning 0) (match-end 0)) + ;; Caller assumes match-beginning/match-end is still set + ) + (defun verilog-read-inst-module () "Return module_name when point is inside instantiation." (save-excursion - (verilog-read-inst-backward-name) - ;; Skip over instantiation name - (verilog-re-search-backward-quick "\\(\\b[a-zA-Z0-9`_\$]\\|)\\)" nil nil) ; ) isn't word boundary - ;; Check for parameterized instantiations - (when (looking-at ")") - (verilog-backward-open-paren) - (verilog-re-search-backward-quick "\\b[a-zA-Z0-9`_\$]" nil nil)) - (skip-chars-backward "a-zA-Z0-9'_$") - (looking-at "[a-zA-Z0-9`_\$]+") - ;; Important: don't use match string, this must work with Emacs 19 font-lock on - (buffer-substring-no-properties (match-beginning 0) (match-end 0)))) + (verilog-read-inst-module-matcher))) (defun verilog-read-inst-name () "Return instance_name when point is inside instantiation." @@ -6730,6 +7225,7 @@ Return a array of [outputs inouts inputs wire reg assign const]." (let ((end-mod-point (or (verilog-get-end-of-defun t) (point-max))) (functask 0) (paren 0) (sig-paren 0) (v2kargs-ok t) + in-modport sigs-in sigs-out sigs-inout sigs-wire sigs-reg sigs-assign sigs-const sigs-gparam sigs-intf vec expect-signal keywd newsig rvalue enum io signed typedefed multidim @@ -6738,7 +7234,7 @@ (verilog-beg-of-defun) (setq sigs-const (verilog-read-auto-constants (point) end-mod-point)) (while (< (point) end-mod-point) - ;;(if dbg (setq dbg (cons (format "Pt %s Vec %s Kwd'%s'\n" (point) vec keywd) dbg))) + ;;(if dbg (setq dbg (concat dbg (format "Pt %s Vec %s C%c Kwd'%s'\n" (point) vec (following-char) keywd)))) (cond ((looking-at "//") (if (looking-at "[^\n]*synopsys\\s +enum\\s +\\([a-zA-Z0-9_]+\\)") @@ -6746,7 +7242,7 @@ (search-forward "\n")) ((looking-at "/\\*") (forward-char 2) - (if (looking-at "[^*]*synopsys\\s +enum\\s +\\([a-zA-Z0-9_]+\\)") + (if (looking-at "[^\n]*synopsys\\s +enum\\s +\\([a-zA-Z0-9_]+\\)") (setq enum (match-string 1))) (or (search-forward "*/") (error "%s: Unmatched /* */, at char %d" (verilog-point-text) (point)))) @@ -6760,7 +7256,7 @@ (error "%s: Unmatched quotes, at char %d" (verilog-point-text) (point)))) ((eq ?\; (following-char)) (setq vec nil io nil expect-signal nil newsig nil paren 0 rvalue nil - v2kargs-ok nil) + v2kargs-ok nil in-modport nil) (forward-char 1)) ((eq ?= (following-char)) (setq rvalue t newsig nil) @@ -6818,7 +7314,9 @@ expect-signal 'sigs-wire modport nil))) ((member keywd '("reg" "trireg" "byte" "shortint" "int" "longint" "integer" "time" - "bit" "logic")) + "bit" "logic" + "shortreal" "real" "realtime" + "string" "event" "chandle")) (unless io (setq vec nil enum nil rvalue nil signed nil typedefed nil multidim nil sig-paren paren expect-signal 'sigs-reg modport nil))) ((equal keywd "assign") @@ -6836,8 +7334,10 @@ ((member keywd '("endclass" "endclocking" "endgroup" "endfunction" "endproperty" "endsequence" "endtask")) (setq functask (1- functask))) + ((equal keywd "modport") + (setq in-modport t)) ;; Ifdef? Ignore name of define - ((member keywd '("`ifdef" "`ifndef")) + ((member keywd '("`ifdef" "`ifndef" "`elsif")) (setq rvalue t)) ;; Type? ((verilog-typedef-name-p keywd) @@ -6846,32 +7346,45 @@ ;; Skip over parsing modport, and take the interface name as the type ((and v2kargs-ok (eq paren 1) - (looking-at "\\s-*\\(\\.\\(\\s-*[a-zA-Z0-9`_$]+\\)\\|\\)\\s-*[a-zA-Z0-9`_$]+")) + (not rvalue) + (looking-at "\\s-*\\(\\.\\(\\s-*[a-zA-Z`_$][a-zA-Z0-9`_$]*\\)\\|\\)\\s-*[a-zA-Z`_$][a-zA-Z0-9`_$]*")) (when (match-end 2) (goto-char (match-end 2))) (setq vec nil enum nil rvalue nil newsig nil signed nil typedefed keywd multidim nil sig-paren paren expect-signal 'sigs-intf io t modport (match-string 2))) + ;; Ignore dotted LHS assignments: "assign foo.bar = z;" + ((looking-at "\\s-*\\.") + (goto-char (match-end 0)) + (when (not rvalue) + (setq expect-signal nil))) ;; New signal, maybe? ((and expect-signal + (not rvalue) (eq functask 0) - (not rvalue) + (not in-modport) (not (member keywd verilog-keywords))) ;; Add new signal to expect-signal's variable - (setq newsig (list keywd vec nil nil enum signed typedefed multidim modport)) + (setq newsig (verilog-sig-new keywd vec nil nil enum signed typedefed multidim modport)) (set expect-signal (cons newsig (symbol-value expect-signal)))))) (t (forward-char 1))) (skip-syntax-forward " ")) ;; Return arguments - (vector (nreverse sigs-out) - (nreverse sigs-inout) - (nreverse sigs-in) - (nreverse sigs-wire) - (nreverse sigs-reg) - (nreverse sigs-assign) - (nreverse sigs-const) - (nreverse sigs-gparam) - (nreverse sigs-intf))))) + (verilog-decls-new (nreverse sigs-out) + (nreverse sigs-inout) + (nreverse sigs-in) + (nreverse sigs-wire) + (nreverse sigs-reg) + (nreverse sigs-assign) + (nreverse sigs-const) + (nreverse sigs-gparam) + (nreverse sigs-intf))))) + +(defvar verilog-read-sub-decls-in-interfaced nil + "For `verilog-read-sub-decls', process next signal as under interfaced block.") + +(defvar verilog-read-sub-decls-gate-ios nil + "For `verilog-read-sub-decls', gate IO pins remaining, nil if non-primitive.") (eval-when-compile ;; Prevent compile warnings; these are let's, not globals @@ -6880,82 +7393,77 @@ (defvar sigs-in) (defvar sigs-inout) (defvar sigs-out) - (defvar sigs-intf)) - - -(defsubst verilog-modi-get-decls (modi) - (verilog-modi-cache-results modi 'verilog-read-decls)) - -(defsubst verilog-modi-get-sub-decls (modi) - (verilog-modi-cache-results modi 'verilog-read-sub-decls)) - - -;; Signal reading for given module -;; Note these all take modi's - as returned from the -;; verilog-modi-current function. -(defsubst verilog-decls-get-outputs (decls) - (aref decls 0)) -(defsubst verilog-decls-get-inouts (decls) - (aref decls 1)) -(defsubst verilog-decls-get-inputs (decls) - (aref decls 2)) -(defsubst verilog-decls-get-wires (decls) - (aref decls 3)) -(defsubst verilog-decls-get-regs (decls) - (aref decls 4)) -(defsubst verilog-decls-get-assigns (decls) - (aref decls 5)) -(defsubst verilog-decls-get-consts (decls) - (aref decls 6)) -(defsubst verilog-decls-get-gparams (decls) - (aref decls 7)) -(defsubst verilog-decls-get-interfaces (decls) - (aref decls 8)) -(defsubst verilog-subdecls-get-outputs (subdecls) - (aref subdecls 0)) -(defsubst verilog-subdecls-get-inouts (subdecls) - (aref subdecls 1)) -(defsubst verilog-subdecls-get-inputs (subdecls) - (aref subdecls 2)) -(defsubst verilog-subdecls-get-interfaces (subdecls) - (aref subdecls 3)) - + (defvar sigs-intf) + (defvar sigs-intfd)) (defun verilog-read-sub-decls-sig (submoddecls comment port sig vec multidim) "For `verilog-read-sub-decls-line', add a signal." - (let (portdata) + ;; sig eq t to indicate .name syntax + ;;(message "vrsds: %s(%S)" port sig) + (let ((dotname (eq sig t)) + portdata) (when sig (setq port (verilog-symbol-detick-denumber port)) - (setq sig (verilog-symbol-detick-denumber sig)) - (if sig (setq sig (verilog-string-replace-matches "^\\s-*[---+~!|&]+\\s-*" "" nil nil sig))) + (setq sig (if dotname port (verilog-symbol-detick-denumber sig))) (if vec (setq vec (verilog-symbol-detick-denumber vec))) (if multidim (setq multidim (mapcar `verilog-symbol-detick-denumber multidim))) (unless (or (not sig) (equal sig "")) ;; Ignore .foo(1'b1) assignments - (cond ((setq portdata (assoc port (verilog-decls-get-inouts submoddecls))) - (setq sigs-inout (cons (list sig vec (concat "To/From " comment) nil nil - (verilog-sig-signed portdata) - (verilog-sig-type portdata) - multidim) - sigs-inout))) - ((setq portdata (assoc port (verilog-decls-get-outputs submoddecls))) - (setq sigs-out (cons (list sig vec (concat "From " comment) nil nil - (verilog-sig-signed portdata) - (verilog-sig-type portdata) - multidim) - sigs-out))) - ((setq portdata (assoc port (verilog-decls-get-inputs submoddecls))) - (setq sigs-in (cons (list sig vec (concat "To " comment) nil nil - (verilog-sig-signed portdata) - (verilog-sig-type portdata) - multidim) - sigs-in))) + (cond ((or (setq portdata (assoc port (verilog-decls-get-inouts submoddecls))) + (equal "inout" verilog-read-sub-decls-gate-ios)) + (setq sigs-inout + (cons (verilog-sig-new + sig + (if dotname (verilog-sig-bits portdata) vec) + (concat "To/From " comment) nil nil + (verilog-sig-signed portdata) + (verilog-sig-type portdata) + multidim nil) + sigs-inout))) + ((or (setq portdata (assoc port (verilog-decls-get-outputs submoddecls))) + (equal "output" verilog-read-sub-decls-gate-ios)) + (setq sigs-out + (cons (verilog-sig-new + sig + (if dotname (verilog-sig-bits portdata) vec) + (concat "From " comment) nil nil + (verilog-sig-signed portdata) + (verilog-sig-type portdata) + multidim nil) + sigs-out))) + ((or (setq portdata (assoc port (verilog-decls-get-inputs submoddecls))) + (equal "input" verilog-read-sub-decls-gate-ios)) + (setq sigs-in + (cons (verilog-sig-new + sig + (if dotname (verilog-sig-bits portdata) vec) + (concat "To " comment) nil nil + (verilog-sig-signed portdata) + (verilog-sig-type portdata) + multidim nil) + sigs-in))) ((setq portdata (assoc port (verilog-decls-get-interfaces submoddecls))) - (setq sigs-intf (cons (list sig vec (concat "To/From " comment) nil nil - (verilog-sig-signed portdata) - (verilog-sig-type portdata) - multidim) - sigs-intf))) + (setq sigs-intf + (cons (verilog-sig-new + sig + (if dotname (verilog-sig-bits portdata) vec) + (concat "To/From " comment) nil nil + (verilog-sig-signed portdata) + (verilog-sig-type portdata) + multidim nil) + sigs-intf))) + ((setq portdata (and verilog-read-sub-decls-in-interfaced + (or (assoc port (verilog-decls-get-regs submoddecls)) + (assoc port (verilog-decls-get-wires submoddecls))))) + (setq sigs-intfd + (cons (verilog-sig-new + sig + (if dotname (verilog-sig-bits portdata) vec) + (concat "To/From " comment) nil nil + (verilog-sig-signed portdata) + (verilog-sig-type portdata) + multidim nil) + sigs-intf))) ;; (t -- warning pin isn't defined.) ; Leave for lint tool ))))) @@ -6969,21 +7477,25 @@ ;; (cond ;; {..., a, b} requires us to recurse on a,b - ((string-match "^\\s-*{\\([^{}]*\\)}\\s-*$" expr) + ;; To support {#{},{#{a,b}} we'll just split everything on [{},] + ((string-match "^\\s-*{\\(.*\\)}\\s-*$" expr) (unless verilog-auto-ignore-concat - (let ((mlst (split-string (match-string 1 expr) ",")) + (let ((mlst (split-string (match-string 1 expr) "[{},]")) mstr) (while (setq mstr (pop mlst)) (verilog-read-sub-decls-expr submoddecls comment port mstr))))) (t (let (sig vec multidim) + ;; Remove leading reduction operators, etc + (setq expr (verilog-string-replace-matches "^\\s-*[---+~!|&]+\\s-*" "" nil nil expr)) + ;;(message "vrsde-ptop: '%s'" expr) (cond ;; Find \signal. Final space is part of escaped signal name ((string-match "^\\s-*\\(\\\\[^ \t\n\f]+\\s-\\)" expr) ;;(message "vrsde-s: '%s'" (match-string 1 expr)) (setq sig (match-string 1 expr) expr (substring expr (match-end 0)))) ;; Find signal - ((string-match "^\\s-*\\([^[({).\\]+\\)" expr) + ((string-match "^\\s-*\\([a-zA-Z_][a-zA-Z_0-9]*\\)" expr) ;;(message "vrsde-s: '%s'" (match-string 1 expr)) (setq sig (verilog-string-remove-spaces (match-string 1 expr)) expr (substring expr (match-end 0))))) @@ -6999,8 +7511,8 @@ (verilog-read-sub-decls-sig submoddecls comment port sig vec multidim)))))) (defun verilog-read-sub-decls-line (submoddecls comment) - "For `verilog-read-sub-decls', read lines of port defs until none match anymore. -Return the list of signals found, using submodi to look up each port." + "For `verilog-read-sub-decls', read lines of port defs until none match. +Inserts the list of signals found, using submodi to look up each port." (let (done port) (save-excursion (forward-line 1) @@ -7009,9 +7521,23 @@ (cond ((looking-at "\\s-*\\.\\s-*\\([a-zA-Z0-9`_$]*\\)\\s-*(\\s-*") (setq port (match-string 1)) (goto-char (match-end 0))) + ;; .\escaped ( ((looking-at "\\s-*\\.\\s-*\\(\\\\[^ \t\n\f]*\\)\\s-*(\\s-*") (setq port (concat (match-string 1) " ")) ;; escaped id's need trailing space (goto-char (match-end 0))) + ;; .name + ((looking-at "\\s-*\\.\\s-*\\([a-zA-Z0-9`_$]*\\)\\s-*[,)/]") + (verilog-read-sub-decls-sig + submoddecls comment (match-string 1) t ; sig==t for .name + nil nil) ; vec multidim + (setq port nil)) + ;; .\escaped_name + ((looking-at "\\s-*\\.\\s-*\\(\\\\[^ \t\n\f]*\\)\\s-*[,)/]") + (verilog-read-sub-decls-sig + submoddecls comment (concat (match-string 1) " ") t ; sig==t for .name + nil nil) ; vec multidim + (setq port nil)) + ;; random ((looking-at "\\s-*\\.[^(]*(") (setq port nil) ;; skip this line (goto-char (match-end 0))) @@ -7021,13 +7547,13 @@ ;; We intentionally ignore (non-escaped) signals with .s in them ;; this prevents AUTOWIRE etc from noticing hierarchical sigs. (when port - (cond ((looking-at "\\([^[({).\\]*\\)\\s-*)") + (cond ((looking-at "\\([a-zA-Z_][a-zA-Z_0-9]*\\)\\s-*)") (verilog-read-sub-decls-sig submoddecls comment port (verilog-string-remove-spaces (match-string 1)) ; sig nil nil)) ; vec multidim ;; - ((looking-at "\\([^[({).\\]*\\)\\s-*\\(\\[[^]]+\\]\\)\\s-*)") + ((looking-at "\\([a-zA-Z_][a-zA-Z_0-9]*\\)\\s-*\\(\\[[^]]+\\]\\)\\s-*)") (verilog-read-sub-decls-sig submoddecls comment port (verilog-string-remove-spaces (match-string 1)) ; sig @@ -7043,6 +7569,35 @@ ;; (forward-line 1))))) +(defun verilog-read-sub-decls-gate (submoddecls comment submod end-inst-point) + "For `verilog-read-sub-decls', read lines of UDP gate decl until none match. +Inserts the list of signals found." + (save-excursion + (let ((iolist (cdr (assoc submod verilog-gate-ios)))) + (while (< (point) end-inst-point) + ;; Get primitive's signal name, as will never have port, and no trailing ) + (cond ((looking-at "//") + (search-forward "\n")) + ((looking-at "/\\*") + (or (search-forward "*/") + (error "%s: Unmatched /* */, at char %d" (verilog-point-text) (point)))) + ((looking-at "(\\*") + (or (looking-at "(\\*\\s-*)") ; It's a "always @ (*)" + (search-forward "*)") + (error "%s: Unmatched (* *), at char %d" (verilog-point-text) (point)))) + ;; On pins, parse and advance to next pin + ;; Looking at pin, but *not* an // Output comment, or ) to end the inst + ((looking-at "\\s-*[a-zA-Z0-9`_$({}\\\\][^,]*") + (goto-char (match-end 0)) + (setq verilog-read-sub-decls-gate-ios (or (car iolist) "input") + iolist (cdr iolist)) + (verilog-read-sub-decls-expr + submoddecls comment "primitive_port" + (match-string 0))) + (t + (forward-char 1) + (skip-syntax-forward " "))))))) + (defun verilog-read-sub-decls () "Internally parse signals going to modules under this module. Return a array of [ outputs inouts inputs ] signals for modules that are @@ -7065,7 +7620,7 @@ (let ((end-mod-point (verilog-get-end-of-defun t)) st-point end-inst-point ;; below 3 modified by verilog-read-sub-decls-line - sigs-out sigs-inout sigs-in sigs-intf) + sigs-out sigs-inout sigs-in sigs-intf sigs-intfd) (verilog-beg-of-defun) (while (verilog-re-search-forward "\\(/\\*AUTOINST\\*/\\|\\.\\*\\)" end-mod-point t) (save-excursion @@ -7074,33 +7629,53 @@ ;; Attempt to snarf a comment (let* ((submod (verilog-read-inst-module)) (inst (verilog-read-inst-name)) + (subprim (member submod verilog-gate-keywords)) (comment (concat inst " of " submod ".v")) submodi submoddecls) - (when (setq submodi (verilog-modi-lookup submod t)) - (setq submoddecls (verilog-modi-get-decls submodi)) - ;; This could have used a list created by verilog-auto-inst - ;; However I want it to be runnable even on user's manually added signals + (cond + (subprim + (setq submodi `primitive + submoddecls (verilog-decls-new nil nil nil nil nil nil nil nil nil) + comment (concat inst " of " submod)) (verilog-backward-open-paren) (setq end-inst-point (save-excursion (forward-sexp 1) (point)) st-point (point)) - (while (re-search-forward "\\s *(?\\s *// Interfaces" end-inst-point t) - (verilog-read-sub-decls-line submoddecls comment)) ;; Modifies sigs-out - (goto-char st-point) - (while (re-search-forward "\\s *(?\\s *// Outputs" end-inst-point t) - (verilog-read-sub-decls-line submoddecls comment)) ;; Modifies sigs-out - (goto-char st-point) - (while (re-search-forward "\\s *(?\\s *// Inouts" end-inst-point t) - (verilog-read-sub-decls-line submoddecls comment)) ;; Modifies sigs-inout - (goto-char st-point) - (while (re-search-forward "\\s *(?\\s *// Inputs" end-inst-point t) - (verilog-read-sub-decls-line submoddecls comment)) ;; Modifies sigs-in - ))))) + (forward-char 1) + (verilog-read-sub-decls-gate submoddecls comment submod end-inst-point)) + ;; Non-primitive + (t + (when (setq submodi (verilog-modi-lookup submod t)) + (setq submoddecls (verilog-modi-get-decls submodi) + verilog-read-sub-decls-gate-ios nil) + (verilog-backward-open-paren) + (setq end-inst-point (save-excursion (forward-sexp 1) (point)) + st-point (point)) + ;; This could have used a list created by verilog-auto-inst + ;; However I want it to be runnable even on user's manually added signals + (let ((verilog-read-sub-decls-in-interfaced t)) + (while (re-search-forward "\\s *(?\\s *// Interfaced" end-inst-point t) + (verilog-read-sub-decls-line submoddecls comment))) ;; Modifies sigs-ifd + (goto-char st-point) + (while (re-search-forward "\\s *(?\\s *// Interfaces" end-inst-point t) + (verilog-read-sub-decls-line submoddecls comment)) ;; Modifies sigs-out + (goto-char st-point) + (while (re-search-forward "\\s *(?\\s *// Outputs" end-inst-point t) + (verilog-read-sub-decls-line submoddecls comment)) ;; Modifies sigs-out + (goto-char st-point) + (while (re-search-forward "\\s *(?\\s *// Inouts" end-inst-point t) + (verilog-read-sub-decls-line submoddecls comment)) ;; Modifies sigs-inout + (goto-char st-point) + (while (re-search-forward "\\s *(?\\s *// Inputs" end-inst-point t) + (verilog-read-sub-decls-line submoddecls comment)) ;; Modifies sigs-in + ))))))) ;; Combine duplicate bits ;;(setq rr (vector sigs-out sigs-inout sigs-in)) - (vector (verilog-signals-combine-bus (nreverse sigs-out)) - (verilog-signals-combine-bus (nreverse sigs-inout)) - (verilog-signals-combine-bus (nreverse sigs-in)) - (verilog-signals-combine-bus (nreverse sigs-intf)))))) + (verilog-subdecls-new + (verilog-signals-combine-bus (nreverse sigs-out)) + (verilog-signals-combine-bus (nreverse sigs-inout)) + (verilog-signals-combine-bus (nreverse sigs-in)) + (verilog-signals-combine-bus (nreverse sigs-intf)) + (verilog-signals-combine-bus (nreverse sigs-intfd)))))) (defun verilog-read-inst-pins () "Return an array of [ pins ] for the current instantiation at point. @@ -7148,16 +7723,27 @@ (setq sig-list (cons (list (match-string 1) nil nil) sig-list)))) sig-list))) +(defvar verilog-cache-has-lisp nil "True if any AUTO_LISP in buffer.") +(make-variable-buffer-local 'verilog-cache-has-lisp) + +(defun verilog-read-auto-lisp-present () + "Set `verilog-cache-has-lisp' if any AUTO_LISP in this buffer." + (save-excursion + (setq verilog-cache-has-lisp (re-search-forward "\\" nil t) + (verilog-re-search-forward-quick "\\<\\(module\\|interface\\)\\>" nil t) + (setq type (match-string-no-properties 0)) (verilog-re-search-forward-quick "[(;]" nil t)) (if (equal module (verilog-read-module-name)) - (setq pt (point)))) - pt))))) + (setq modi (verilog-modi-new module filename (point) type)))) + modi))))) (defun verilog-is-number (symbol) "Return true if SYMBOL is number-like." @@ -7953,7 +8569,6 @@ "Cache of ((Module Function) Buf-Tick Buf-Modtime Func-Returns)... For speeding up verilog-modi-get-* commands. Buffer-local.") - (make-variable-buffer-local 'verilog-modi-cache-list) (defvar verilog-modi-cache-preserve-tick nil @@ -7962,47 +8577,80 @@ (defvar verilog-modi-cache-preserve-buffer nil "Modification tick after which the cache is still considered valid. Use `verilog-preserve-modi-cache' to set it.") +(defvar verilog-modi-cache-current-enable nil + "If true, allow caching `verilog-modi-current', set by let().") +(defvar verilog-modi-cache-current nil + "Currently active `verilog-modi-current', if any, set by let().") +(defvar verilog-modi-cache-current-max nil + "Current endmodule point for `verilog-modi-cache-current', if any.") (defun verilog-modi-current () + "Return the modi structure for the module currently at point, possibly cached." + (cond ((and verilog-modi-cache-current + (>= (point) (verilog-modi-get-point verilog-modi-cache-current)) + (<= (point) verilog-modi-cache-current-max)) + ;; Slow assertion, for debugging the cache: + ;;(or (equal verilog-modi-cache-current (verilog-modi-current-get)) (debug)) + verilog-modi-cache-current) + (verilog-modi-cache-current-enable + (setq verilog-modi-cache-current (verilog-modi-current-get) + verilog-modi-cache-current-max + ;; The cache expires when we pass "endmodule" as then the + ;; current modi may change to the next module + ;; This relies on the AUTOs generally inserting, not deleting text + (save-excursion + (verilog-re-search-forward-quick verilog-end-defun-re nil nil))) + verilog-modi-cache-current) + (t + (verilog-modi-current-get)))) + +(defun verilog-modi-current-get () "Return the modi structure for the module currently at point." - (let* (name pt) + (let* (name type pt) ;; read current module's name (save-excursion (verilog-re-search-backward-quick verilog-defun-re nil nil) + (setq type (match-string-no-properties 0)) (verilog-re-search-forward-quick "(" nil nil) (setq name (verilog-read-module-name)) (setq pt (point))) - ;; return - (vector name (or (buffer-file-name) (current-buffer)) pt))) + ;; return modi - note this vector built two places + (verilog-modi-new name (or (buffer-file-name) (current-buffer)) pt type))) -(defvar verilog-modi-lookup-last-mod nil "Cache of last module looked up.") -(defvar verilog-modi-lookup-last-modi nil "Cache of last modi returned.") -(defvar verilog-modi-lookup-last-current nil "Cache of last `current-buffer' looked up.") -(defvar verilog-modi-lookup-last-tick nil "Cache of last `buffer-modified-tick' looked up.") +(defvar verilog-modi-lookup-cache nil "Hash of (modulename modi).") +(make-variable-buffer-local 'verilog-modi-lookup-cache) +(defvar verilog-modi-lookup-last-current nil "Cache of `current-buffer' at last lookup.") +(defvar verilog-modi-lookup-last-tick nil "Cache of `buffer-chars-modified-tick' at last lookup.") (defun verilog-modi-lookup (module allow-cache &optional ignore-error) "Find the file and point at which MODULE is defined. If ALLOW-CACHE is set, check and remember cache of previous lookups. Return modi if successful, else print message unless IGNORE-ERROR is true." - (let* ((current (or (buffer-file-name) (current-buffer)))) - (cond ((and verilog-modi-lookup-last-modi + (let* ((current (or (buffer-file-name) (current-buffer))) + modi) + ;; Check cache + ;;(message "verilog-modi-lookup: %s" module) + (cond ((and verilog-modi-lookup-cache verilog-cache-enabled allow-cache - (equal verilog-modi-lookup-last-mod module) + (setq modi (gethash module verilog-modi-lookup-cache)) (equal verilog-modi-lookup-last-current current) - (equal verilog-modi-lookup-last-tick (buffer-modified-tick))) - ;; ok as is - ) + ;; Iff hit is in current buffer, then tick must match + (or (equal verilog-modi-lookup-last-tick (buffer-chars-modified-tick)) + (not (equal current (verilog-modi-file-or-buffer modi))))) + ;;(message "verilog-modi-lookup: HIT %S" modi) + modi) + ;; Miss (t (let* ((realmod (verilog-symbol-detick module t)) (orig-filenames (verilog-module-filenames realmod current)) (filenames orig-filenames) - pt) - (while (and filenames (not pt)) - (if (not (setq pt (verilog-module-inside-filename-p realmod (car filenames)))) + mif) + (while (and filenames (not mif)) + (if (not (setq mif (verilog-module-inside-filename-p realmod (car filenames)))) (setq filenames (cdr filenames)))) - (cond (pt (setq verilog-modi-lookup-last-modi - (vector realmod (car filenames) pt))) - (t (setq verilog-modi-lookup-last-modi nil) + ;; mif has correct form to become later elements of modi + (cond (mif (setq modi mif)) + (t (setq modi nil) (or ignore-error (error (concat (verilog-point-text) ": Can't locate " module " module definition" @@ -8012,17 +8660,14 @@ "\n Check the verilog-library-directories variable." "\n I looked in (if not listed, doesn't exist):\n\t" (mapconcat 'concat orig-filenames "\n\t")))))) - (setq verilog-modi-lookup-last-mod module - verilog-modi-lookup-last-current current - verilog-modi-lookup-last-tick (buffer-modified-tick))))) - verilog-modi-lookup-last-modi)) - -(defsubst verilog-modi-name (modi) - (aref modi 0)) -(defsubst verilog-modi-file-or-buffer (modi) - (aref modi 1)) -(defsubst verilog-modi-point (modi) - (aref modi 2)) + (when (eval-when-compile (fboundp 'make-hash-table)) + (unless verilog-modi-lookup-cache + (setq verilog-modi-lookup-cache + (make-hash-table :test 'equal :rehash-size 4.0))) + (puthash module modi verilog-modi-lookup-cache)) + (setq verilog-modi-lookup-last-current current + verilog-modi-lookup-last-tick (buffer-chars-modified-tick))))) + modi)) (defun verilog-modi-filename (modi) "Filename of MODI, or name of buffer if it's never been saved." @@ -8039,7 +8684,7 @@ (find-file-noselect (verilog-modi-file-or-buffer modi)))) (or (equal major-mode `verilog-mode) ;; Put into Verilog mode to get syntax (verilog-mode)) - (goto-char (verilog-modi-point modi))) + (goto-char (verilog-modi-get-point modi))) (defun verilog-goto-defun-file (module) "Move point to the file at which a given MODULE is defined." @@ -8059,7 +8704,7 @@ verilog-modi-cache-list)) ;; Destroy caching when incorrect; Modified or file changed (not (and verilog-cache-enabled - (or (equal (buffer-modified-tick) (nth 1 fass)) + (or (equal (buffer-chars-modified-tick) (nth 1 fass)) (and verilog-modi-cache-preserve-tick (<= verilog-modi-cache-preserve-tick (nth 1 fass)) (equal verilog-modi-cache-preserve-buffer (current-buffer)))) @@ -8082,7 +8727,7 @@ ;; Cache for next time (setq verilog-modi-cache-list (cons (list (list modi function) - (buffer-modified-tick) + (buffer-chars-modified-tick) (visited-file-modtime) func-returns) verilog-modi-cache-list)) @@ -8108,7 +8753,7 @@ modsig-cache-add-* function, else the results of later calls may be incorrect. Without this, changes are assumed to be adding/removing signals and invalidating the cache." - `(let ((verilog-modi-cache-preserve-tick (buffer-modified-tick)) + `(let ((verilog-modi-cache-preserve-tick (buffer-chars-modified-tick)) (verilog-modi-cache-preserve-buffer (current-buffer))) (progn ,@body))) @@ -8254,7 +8899,7 @@ (equal "" (verilog-sig-comment sig))) (insert "\n") (indent-to (max 48 (+ indent-pt 40))) - (insert (concat "// " (verilog-sig-comment sig) "\n"))) + (verilog-insert "// " (verilog-sig-comment sig) "\n")) (setq sigs (cdr sigs))))) (eval-when-compile @@ -8268,7 +8913,7 @@ (while stuff (if need-indent (indent-to indent-pt)) (setq need-indent nil) - (insert (car stuff)) + (verilog-insert (car stuff)) (setq need-indent (string-match "\n$" (car stuff)) stuff (cdr stuff))))) ;;(let ((indent-pt 10)) (verilog-insert-indent "hello\n" "addon" "there\n")) @@ -8500,42 +9145,44 @@ (save-excursion (if (buffer-file-name) (find-file-noselect (buffer-file-name))) ;; To check we have latest version - ;; Allow user to customize - (run-hooks 'verilog-before-delete-auto-hook) - - ;; Remove those that have multi-line insertions, possibly with parameters - (verilog-auto-re-search-do - (concat "/\\*" - (eval-when-compile - (verilog-regexp-words - `("AUTOASCIIENUM" "AUTOCONCATCOMMENT" "AUTODEFINEVALUE" - "AUTOINOUT" "AUTOINOUTCOMP" "AUTOINOUTMODULE" - "AUTOINPUT" "AUTOINSERTLISP" "AUTOOUTPUT" "AUTOOUTPUTEVERY" - "AUTOREG" "AUTOREGINPUT" "AUTORESET" "AUTOTIEOFF" - "AUTOUNUSED" "AUTOWIRE"))) - ;; Optional parens or quoted parameter or .* for (((...))) - "\\(\\|([^)]*)\\|(\"[^\"]*\")\\).*?" - "\\*/") - 'verilog-delete-autos-lined) - ;; Remove those that are in parenthesis - (verilog-auto-re-search-do - (concat "/\\*" - (eval-when-compile - (verilog-regexp-words - `("AS" "AUTOARG" "AUTOCONCATWIDTH" "AUTOINST" "AUTOINSTPARAM" - "AUTOSENSE"))) - "\\*/") - 'verilog-delete-to-paren) - ;; Do .* instantiations, but avoid removing any user pins by looking for our magic comments - (verilog-auto-re-search-do "\\.\\*" - 'verilog-delete-auto-star-all) - ;; Remove template comments ... anywhere in case was pasted after AUTOINST removed - (goto-char (point-min)) - (while (re-search-forward "\\s-*// \\(Templated\\|Implicit \\.\\*\\)[ \tLT0-9]*$" nil t) - (replace-match "")) - - ;; Final customize - (run-hooks 'verilog-delete-auto-hook))) + (verilog-save-no-change-functions + (verilog-save-scan-cache + ;; Allow user to customize + (run-hooks 'verilog-before-delete-auto-hook) + + ;; Remove those that have multi-line insertions, possibly with parameters + (verilog-auto-re-search-do + (concat "/\\*" + (eval-when-compile + (verilog-regexp-words + `("AUTOASCIIENUM" "AUTOCONCATCOMMENT" "AUTODEFINEVALUE" + "AUTOINOUT" "AUTOINOUTCOMP" "AUTOINOUTMODULE" + "AUTOINPUT" "AUTOINSERTLISP" "AUTOOUTPUT" "AUTOOUTPUTEVERY" + "AUTOREG" "AUTOREGINPUT" "AUTORESET" "AUTOTIEOFF" + "AUTOUNUSED" "AUTOWIRE"))) + ;; Optional parens or quoted parameter or .* for (((...))) + "\\(\\|([^)]*)\\|(\"[^\"]*\")\\).*?" + "\\*/") + 'verilog-delete-autos-lined) + ;; Remove those that are in parenthesis + (verilog-auto-re-search-do + (concat "/\\*" + (eval-when-compile + (verilog-regexp-words + `("AS" "AUTOARG" "AUTOCONCATWIDTH" "AUTOINST" "AUTOINSTPARAM" + "AUTOSENSE"))) + "\\*/") + 'verilog-delete-to-paren) + ;; Do .* instantiations, but avoid removing any user pins by looking for our magic comments + (verilog-auto-re-search-do "\\.\\*" + 'verilog-delete-auto-star-all) + ;; Remove template comments ... anywhere in case was pasted after AUTOINST removed + (goto-char (point-min)) + (while (re-search-forward "\\s-*// \\(Templated\\|Implicit \\.\\*\\)[ \tLT0-9]*$" nil t) + (replace-match "")) + + ;; Final customize + (run-hooks 'verilog-delete-auto-hook))))) ;; ;; Auto inject @@ -8600,7 +9247,7 @@ (verilog-backward-syntactic-ws) (backward-char 1) ; Moves to paren that closes argdecl's (when (looking-at ")") - (insert "/*AUTOARG*/"))))))) + (verilog-insert "/*AUTOARG*/"))))))) (defun verilog-inject-sense () "Inject AUTOSENSE into new code. See `verilog-inject-auto'." @@ -8622,7 +9269,7 @@ (when (not (or (verilog-signals-not-in pre-sigs got-sigs) ; Both are equal? (verilog-signals-not-in got-sigs pre-sigs))) (delete-region start-pt (point)) - (insert "/*AS*/"))))))) + (verilog-insert "/*AS*/"))))))) (defun verilog-inject-inst () "Inject AUTOINST into new code. See `verilog-inject-auto'." @@ -8656,9 +9303,8 @@ ;; Not verilog-re-search, as we don't want to strip comments (while (re-search-backward "[ \t\n\f]+" (- (point) 1) t) (delete-region (match-beginning 0) (match-end 0))) - (insert "\n") - (indent-to indent-pt) - (insert "/*AUTOINST*/"))))))))) + (verilog-insert "\n") + (verilog-insert-indent "/*AUTOINST*/"))))))))) ;; ;; Auto save @@ -8675,14 +9321,14 @@ ((eq verilog-auto-save-policy 'force) (verilog-auto)) ((not (buffer-modified-p))) - ((eq verilog-auto-update-tick (buffer-modified-tick))) ; up-to-date + ((eq verilog-auto-update-tick (buffer-chars-modified-tick))) ; up-to-date ((eq verilog-auto-save-policy 'detect) (verilog-auto)) (t (when (yes-or-no-p "AUTO statements not recomputed, do it now? ") (verilog-auto)) ;; Don't ask again if didn't update - (set (make-local-variable 'verilog-auto-update-tick) (buffer-modified-tick)))) + (set (make-local-variable 'verilog-auto-update-tick) (buffer-chars-modified-tick)))) (when (not verilog-auto-star-save) (verilog-delete-auto-star-implicit)) nil) ;; Always return nil -- we don't write the file ourselves @@ -8828,7 +9474,7 @@ (vl-name (verilog-sig-name port-st)) (vl-width (verilog-sig-width port-st)) (vl-modport (verilog-sig-modport port-st)) - (vl-mbits (if (verilog-sig-multidim port-st) + (vl-mbits (if (verilog-sig-multidim port-st) (verilog-sig-multidim-string port-st) "")) (vl-bits (if (or verilog-auto-inst-vector (not (assoc port vector-skip-list)) @@ -8892,19 +9538,23 @@ ;; Insert it (indent-to indent-pt) (insert "." port) - (indent-to verilog-auto-inst-column) - (insert "(" tpl-net "),") + (unless (and verilog-auto-inst-dot-name + (equal port tpl-net)) + (indent-to verilog-auto-inst-column) + (insert "(" tpl-net ")")) + (insert ",") (cond (tpl-ass (indent-to (+ (if (< verilog-auto-inst-column 48) 24 16) verilog-auto-inst-column)) - (insert " // Templated") - (when verilog-auto-inst-template-numbers - (insert " T" (int-to-string (nth 2 tpl-ass)) - " L" (int-to-string (nth 3 tpl-ass))))) + (if verilog-auto-inst-template-numbers + (verilog-insert " // Templated" + " T" (int-to-string (nth 2 tpl-ass)) + " L" (int-to-string (nth 3 tpl-ass))) + (verilog-insert " // Templated"))) (for-star (indent-to (+ (if (< verilog-auto-inst-column 48) 24 16) verilog-auto-inst-column)) - (insert " // Implicit .\*"))) ;For some reason the . or * must be escaped... + (verilog-insert " // Implicit .\*"))) ;For some reason the . or * must be escaped... (insert "\n"))) ;;(verilog-auto-inst-port (list "foo" "[5:0]") 10 (list (list "foo" "a@\"(% (+ @ 1) 4)\"a")) "3") ;;(x "incom[@\"(+ (* 8 @) 7)\":@\"(* 8 @)\"]") @@ -8944,8 +9594,9 @@ (defun verilog-auto-inst () "Expand AUTOINST statements, as part of \\[verilog-auto]. -Replace the pin connections to an instantiation with ones -automatically derived from the module header of the instantiated netlist. +Replace the pin connections to an instantiation or interface +declaration with ones automatically derived from the module or +interface header of the instantiated item. If `verilog-auto-star-expand' is set, also expand SystemVerilog .* ports, and delete them before saving unless `verilog-auto-star-save' is set. @@ -8965,12 +9616,18 @@ SystemVerilog multidimensional input/output has only experimental support. + SystemVerilog .name syntax is used if `verilog-auto-inst-dot-name' is set. + Parameters referenced by the instantiation will remain symbolic, unless `verilog-auto-inst-param-value' is set. + Gate primitives (and/or) may have AUTOINST for the purpose of + AUTOWIRE declarations, etc. Gates are the only case when + position based connections are passed. + For example, first take the submodule InstModule.v: - module InstModule (o,i) + module InstModule (o,i); output [31:0] o; input i; wire [31:0] o = {32{i}}; @@ -8978,7 +9635,7 @@ This is then used in a upper level module: - module ExampInst (o,i) + module ExampInst (o,i); output o; input i; InstModule instName @@ -8987,7 +9644,7 @@ Typing \\[verilog-auto] will make this into: - module ExampInst (o,i) + module ExampInst (o,i); output o; input i; InstModule instName @@ -9238,7 +9895,8 @@ ;; Lookup position, etc of submodule ;; Note this may raise an error - (when (setq submodi (verilog-modi-lookup submod t)) + (when (and (not (member submod verilog-gate-keywords)) + (setq submodi (verilog-modi-lookup submod t))) (setq submoddecls (verilog-modi-get-decls submodi)) ;; If there's a number in the instantiation, it may be a argument to the ;; automatic variable instantiation program. @@ -9249,15 +9907,28 @@ "") tpl-list (aref tpl-info 1))) ;; Find submodule's signals and dump + (let ((sig-list (and (equal (verilog-modi-get-type submodi) "interface") + (verilog-signals-not-in + (append (verilog-decls-get-wires submoddecls) + (verilog-decls-get-regs submoddecls)) + skip-pins))) + (vl-dir "interfaced")) + (when sig-list + (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) + ;; Note these are searched for in verilog-read-sub-decls. + (verilog-insert-indent "// Interfaced\n") + (mapc (lambda (port) + (verilog-auto-inst-port port indent-pt + tpl-list tpl-num for-star par-values)) + sig-list))) (let ((sig-list (verilog-signals-not-in (verilog-decls-get-interfaces submoddecls) skip-pins)) (vl-dir "interface")) (when sig-list (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) - (indent-to indent-pt) ;; Note these are searched for in verilog-read-sub-decls. - (insert "// Interfaces\n") + (verilog-insert-indent "// Interfaces\n") (mapc (lambda (port) (verilog-auto-inst-port port indent-pt tpl-list tpl-num for-star par-values)) @@ -9268,8 +9939,7 @@ (vl-dir "output")) (when sig-list (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) - (indent-to indent-pt) - (insert "// Outputs\n") + (verilog-insert-indent "// Outputs\n") (mapc (lambda (port) (verilog-auto-inst-port port indent-pt tpl-list tpl-num for-star par-values)) @@ -9280,8 +9950,7 @@ (vl-dir "inout")) (when sig-list (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) - (indent-to indent-pt) - (insert "// Inouts\n") + (verilog-insert-indent "// Inouts\n") (mapc (lambda (port) (verilog-auto-inst-port port indent-pt tpl-list tpl-num for-star par-values)) @@ -9292,8 +9961,7 @@ (vl-dir "input")) (when sig-list (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) - (indent-to indent-pt) - (insert "// Inputs\n") + (verilog-insert-indent "// Inputs\n") (mapc (lambda (port) (verilog-auto-inst-port port indent-pt tpl-list tpl-num for-star par-values)) @@ -9321,13 +9989,13 @@ For example, first take the submodule InstModule.v: - module InstModule (o,i) + module InstModule (o,i); parameter PAR; endmodule This is then used in a upper level module: - module ExampInst (o,i) + module ExampInst (o,i); parameter PAR; InstModule #(/*AUTOINSTPARAM*/) instName (/*AUTOINST*/); @@ -9335,7 +10003,7 @@ Typing \\[verilog-auto] will make this into: - module ExampInst (o,i) + module ExampInst (o,i); output o; input i; InstModule #(/*AUTOINSTPARAM*/ @@ -9398,9 +10066,8 @@ (vl-dir "parameter")) (when sig-list (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) - (indent-to indent-pt) ;; Note these are searched for in verilog-read-sub-decls. - (insert "// Parameters\n") + (verilog-insert-indent "// Parameters\n") (mapc (lambda (port) (verilog-auto-inst-port port indent-pt tpl-list tpl-num nil nil)) @@ -9428,7 +10095,7 @@ An example: - module ExampReg (o,i) + module ExampReg (o,i); output o; input i; /*AUTOREG*/ @@ -9437,7 +10104,7 @@ Typing \\[verilog-auto] will make this into: - module ExampReg (o,i) + module ExampReg (o,i); output o; input i; /*AUTOREG*/ @@ -9459,6 +10126,7 @@ (verilog-decls-get-assigns moddecls) (verilog-decls-get-consts moddecls) (verilog-decls-get-gparams moddecls) + (verilog-subdecls-get-interfaced modsubdecls) (verilog-subdecls-get-outputs modsubdecls) (verilog-subdecls-get-inouts modsubdecls))))) (forward-line 1) @@ -9481,7 +10149,7 @@ An example (see `verilog-auto-inst' for what else is going on here): - module ExampRegInput (o,i) + module ExampRegInput (o,i); output o; input i; /*AUTOREGINPUT*/ @@ -9491,7 +10159,7 @@ Typing \\[verilog-auto] will make this into: - module ExampRegInput (o,i) + module ExampRegInput (o,i); output o; input i; /*AUTOREGINPUT*/ @@ -9543,7 +10211,7 @@ An example (see `verilog-auto-inst' for what else is going on here): - module ExampWire (o,i) + module ExampWire (o,i); output o; input i; /*AUTOWIRE*/ @@ -9553,7 +10221,7 @@ Typing \\[verilog-auto] will make this into: - module ExampWire (o,i) + module ExampWire (o,i); output o; input i; /*AUTOWIRE*/ @@ -9613,7 +10281,7 @@ An example (see `verilog-auto-inst' for what else is going on here): - module ExampOutput (ov,i) + module ExampOutput (ov,i); input i; /*AUTOOUTPUT*/ InstModule instName @@ -9622,7 +10290,7 @@ Typing \\[verilog-auto] will make this into: - module ExampOutput (ov,i) + module ExampOutput (ov,i); input i; /*AUTOOUTPUT*/ // Beginning of automatic outputs (from unused autoinst outputs) @@ -9679,7 +10347,7 @@ An example: - module ExampOutputEvery (o,i,tempa,tempb) + module ExampOutputEvery (o,i,tempa,tempb); output o; input i; /*AUTOOUTPUTEVERY*/ @@ -9690,7 +10358,7 @@ Typing \\[verilog-auto] will make this into: - module ExampOutputEvery (o,i,tempa,tempb) + module ExampOutputEvery (o,i,tempa,tempb); output o; input i; /*AUTOOUTPUTEVERY*/ @@ -9742,7 +10410,7 @@ An example (see `verilog-auto-inst' for what else is going on here): - module ExampInput (ov,i) + module ExampInput (ov,i); output [31:0] ov; /*AUTOINPUT*/ InstModule instName @@ -9751,7 +10419,7 @@ Typing \\[verilog-auto] will make this into: - module ExampInput (ov,i) + module ExampInput (ov,i); output [31:0] ov; /*AUTOINPUT*/ // Beginning of automatic inputs (from unused autoinst inputs) @@ -9786,6 +10454,7 @@ (verilog-decls-get-regs moddecls) (verilog-decls-get-consts moddecls) (verilog-decls-get-gparams moddecls) + (verilog-subdecls-get-interfaced modsubdecls) (verilog-subdecls-get-outputs modsubdecls) (verilog-subdecls-get-inouts modsubdecls))))) (when regexp @@ -9822,7 +10491,7 @@ An example (see `verilog-auto-inst' for what else is going on here): - module ExampInout (ov,i) + module ExampInout (ov,i); input i; /*AUTOINOUT*/ InstModule instName @@ -9831,7 +10500,7 @@ Typing \\[verilog-auto] will make this into: - module ExampInout (ov,i) + module ExampInout (ov,i); input i; /*AUTOINOUT*/ // Beginning of automatic inouts (from unused autoinst inouts) @@ -9886,6 +10555,7 @@ into the current module. This is useful for making null templates and shell modules which need to have identical I/O with another module. Any I/O which are already defined in this module will not be redefined. +For the complement of this function, see `verilog-auto-inout-comp'. Limitations: If placed inside the parenthesis of a module declaration, it creates @@ -9901,11 +10571,11 @@ An example: - module ExampShell (/*AUTOARG*/) + module ExampShell (/*AUTOARG*/); /*AUTOINOUTMODULE(\"ExampMain\")*/ endmodule - module ExampMain (i,o,io) + module ExampMain (i,o,io); input i; output o; inout io; @@ -9913,7 +10583,7 @@ Typing \\[verilog-auto] will make this into: - module ExampShell (/*AUTOARG*/i,o,io) + module ExampShell (/*AUTOARG*/i,o,io); /*AUTOINOUTMODULE(\"ExampMain\")*/ // Beginning of automatic in/out/inouts (from specific module) output o; @@ -10004,7 +10674,8 @@ and vice-versa.) This is useful for making test and stimulus modules which need to have complementing I/O with another module. Any I/O which are already defined in this module will not be -redefined. +redefined. For the complement of this function, see +`verilog-auto-inout-module'. Limitations: If placed inside the parenthesis of a module declaration, it creates @@ -10020,11 +10691,11 @@ An example: - module ExampShell (/*AUTOARG*/) + module ExampShell (/*AUTOARG*/); /*AUTOINOUTCOMP(\"ExampMain\")*/ endmodule - module ExampMain (i,o,io) + module ExampMain (i,o,io); input i; output o; inout io; @@ -10032,7 +10703,7 @@ Typing \\[verilog-auto] will make this into: - module ExampShell (/*AUTOARG*/i,o,io) + module ExampShell (/*AUTOARG*/i,o,io); /*AUTOINOUTCOMP(\"ExampMain\")*/ // Beginning of automatic in/out/inouts (from specific module) output i; @@ -10106,6 +10777,7 @@ (forward-line -1) (eval (read cmd)) (forward-line -1) + (setq verilog-scan-cache-tick nil) ;; Clear cache; inserted unknown text (verilog-delete-empty-auto-pair)))) (defun verilog-auto-sense-sigs (moddecls presense-sigs) @@ -10115,6 +10787,7 @@ (verilog-signals-not-in (verilog-alw-get-inputs sigss) (append (and (not verilog-auto-sense-include-inputs) (verilog-alw-get-outputs sigss)) + (verilog-alw-get-temps sigss) (verilog-decls-get-consts moddecls) (verilog-decls-get-gparams moddecls) presense-sigs))))) @@ -10197,7 +10870,7 @@ (when sig-memories (let ((tlen (length sig-list))) (setq sig-list (verilog-signals-not-in sig-list sig-memories)) - (if (not (eq tlen (length sig-list))) (insert " /*memory or*/ ")))) + (if (not (eq tlen (length sig-list))) (verilog-insert " /*memory or*/ ")))) (if (and presense-sigs ;; Add a "or" if not "(.... or /*AUTOSENSE*/" (save-excursion (goto-char (point)) (verilog-re-search-backward "[a-zA-Z0-9$_.%`]+" start-pt t) @@ -10297,12 +10970,13 @@ (concat " <= " verilog-assignment-delay) " = ")) (setq sig-list (verilog-signals-not-in (verilog-alw-get-outputs sigss) - prereset-sigs)) + (append + (verilog-alw-get-temps sigss) + prereset-sigs))) (setq sig-list (sort sig-list `verilog-signals-sort-compare)) (when sig-list (insert "\n"); - (indent-to indent-pt) - (insert "// Beginning of autoreset for uninitialized flops\n"); + (verilog-insert-indent "// Beginning of autoreset for uninitialized flops\n"); (indent-to indent-pt) (while sig-list (let ((sig (or (assoc (verilog-sig-name (car sig-list)) all-list) ;; As sig-list has no widths @@ -10313,7 +10987,7 @@ ";\n") (indent-to indent-pt) (setq sig-list (cdr sig-list)))) - (insert "// End of automatics"))))) + (verilog-insert "// End of automatics"))))) (defun verilog-auto-tieoff () "Expand AUTOTIEOFF statements, as part of \\[verilog-auto]. @@ -10329,6 +11003,9 @@ Signals that match `verilog-active-low-regexp' will be deasserted by tieing them to a one. +You can add signals you do not want included in AUTOTIEOFF with +`verilog-auto-tieoff-ignore-regexp'. + An example of making a stub for another module: module ExampStub (/*AUTOINST*/); @@ -10369,8 +11046,11 @@ (verilog-decls-get-assigns moddecls) (verilog-decls-get-consts moddecls) (verilog-decls-get-gparams moddecls) + (verilog-subdecls-get-interfaced modsubdecls) (verilog-subdecls-get-outputs modsubdecls) (verilog-subdecls-get-inouts modsubdecls))))) + (setq sig-list (verilog-signals-not-matching-regexp + sig-list verilog-auto-tieoff-ignore-regexp)) (when sig-list (forward-line 1) (verilog-insert-indent "// Beginning of automatic tieoffs (for this module's unterminated outputs)\n") @@ -10622,13 +11302,16 @@ "Replace Templated relative line numbers with absolute line numbers. Internal use only. This hacks around the line numbers in AUTOINST Templates being different from the final output's line numbering." - (let ((templateno 0) (template-line (list 0))) + (let ((templateno 0) (template-line (list 0)) (buf-line 1)) ;; Find line number each template is on + ;; Count lines as we go, as otherwise it's O(n^2) to use count-lines (goto-char (point-min)) - (while (search-forward "AUTO_TEMPLATE" nil t) - (setq templateno (1+ templateno)) - (setq template-line - (cons (count-lines (point-min) (point)) template-line))) + (while (not (eobp)) + (when (looking-at ".*AUTO_TEMPLATE") + (setq templateno (1+ templateno)) + (setq template-line (cons buf-line template-line))) + (setq buf-line (1+ buf-line)) + (forward-line 1)) (setq template-line (nreverse template-line)) ;; Replace T# L# with absolute line number (goto-char (point-min)) @@ -10661,7 +11344,7 @@ called before and after this function, respectively. For example: - module ModuleName (/*AUTOARG*/) + module ModuleName (/*AUTOARG*/); /*AUTOINPUT*/ /*AUTOOUTPUT*/ /*AUTOWIRE*/ @@ -10717,89 +11400,102 @@ (font-lock-mode 0) t)) ;; Cache directories; we don't write new files, so can't change - (verilog-dir-cache-preserving t)) - (unwind-protect - (save-excursion - ;; If we're not in verilog-mode, change syntax table so parsing works right - (unless (eq major-mode `verilog-mode) (verilog-mode)) - ;; Allow user to customize - (run-hooks 'verilog-before-auto-hook) - ;; Try to save the user from needing to revert-file to reread file local-variables - (verilog-auto-reeval-locals) - (verilog-read-auto-lisp (point-min) (point-max)) - (verilog-getopt-flags) - ;; From here on out, we can cache anything we read from disk - (verilog-preserve-dir-cache - ;; These two may seem obvious to do always, but on large includes it can be way too slow - (when verilog-auto-read-includes - (verilog-read-includes) - (verilog-read-defines nil nil t)) - ;; This particular ordering is important - ;; INST: Lower modules correct, no internal dependencies, FIRST - (verilog-preserve-modi-cache - ;; Clear existing autos else we'll be screwed by existing ones - (verilog-delete-auto) - ;; Injection if appropriate - (when inject - (verilog-inject-inst) - (verilog-inject-sense) - (verilog-inject-arg)) - ;; - ;; Do user inserts first, so their code can insert AUTOs - ;; We may provide a AUTOINSERTLISPLAST if another cleanup pass is needed - (verilog-auto-re-search-do "/\\*AUTOINSERTLISP(.*?)\\*/" - 'verilog-auto-insert-lisp) - ;; Expand instances before need the signals the instances input/output - (verilog-auto-re-search-do "/\\*AUTOINSTPARAM\\*/" 'verilog-auto-inst-param) - (verilog-auto-re-search-do "/\\*AUTOINST\\*/" 'verilog-auto-inst) - (verilog-auto-re-search-do "\\.\\*" 'verilog-auto-star) - ;; Doesn't matter when done, but combine it with a common changer - (verilog-auto-re-search-do "/\\*\\(AUTOSENSE\\|AS\\)\\*/" 'verilog-auto-sense) - (verilog-auto-re-search-do "/\\*AUTORESET\\*/" 'verilog-auto-reset) - ;; Must be done before autoin/out as creates a reg - (verilog-auto-re-search-do "/\\*AUTOASCIIENUM([^)]*)\\*/" 'verilog-auto-ascii-enum) - ;; - ;; first in/outs from other files - (verilog-auto-re-search-do "/\\*AUTOINOUTMODULE([^)]*)\\*/" 'verilog-auto-inout-module) - (verilog-auto-re-search-do "/\\*AUTOINOUTCOMP([^)]*)\\*/" 'verilog-auto-inout-comp) - ;; next in/outs which need previous sucked inputs first - (verilog-auto-re-search-do "/\\*AUTOOUTPUT\\((\"[^\"]*\")\\)\\*/" - '(lambda () (verilog-auto-output t))) - (verilog-auto-re-search-do "/\\*AUTOOUTPUT\\*/" 'verilog-auto-output) - (verilog-auto-re-search-do "/\\*AUTOINPUT\\((\"[^\"]*\")\\)\\*/" - '(lambda () (verilog-auto-input t))) - (verilog-auto-re-search-do "/\\*AUTOINPUT\\*/" 'verilog-auto-input) - (verilog-auto-re-search-do "/\\*AUTOINOUT\\((\"[^\"]*\")\\)\\*/" - '(lambda () (verilog-auto-inout t))) - (verilog-auto-re-search-do "/\\*AUTOINOUT\\*/" 'verilog-auto-inout) - ;; Then tie off those in/outs - (verilog-auto-re-search-do "/\\*AUTOTIEOFF\\*/" 'verilog-auto-tieoff) - ;; Wires/regs must be after inputs/outputs - (verilog-auto-re-search-do "/\\*AUTOWIRE\\*/" 'verilog-auto-wire) - (verilog-auto-re-search-do "/\\*AUTOREG\\*/" 'verilog-auto-reg) - (verilog-auto-re-search-do "/\\*AUTOREGINPUT\\*/" 'verilog-auto-reg-input) - ;; outputevery needs AUTOOUTPUTs done first - (verilog-auto-re-search-do "/\\*AUTOOUTPUTEVERY\\*/" 'verilog-auto-output-every) - ;; After we've created all new variables - (verilog-auto-re-search-do "/\\*AUTOUNUSED\\*/" 'verilog-auto-unused) - ;; Must be after all inputs outputs are generated - (verilog-auto-re-search-do "/\\*AUTOARG\\*/" 'verilog-auto-arg) - ;; Fix line numbers (comments only) - (verilog-auto-templated-rel))) - ;; - (run-hooks 'verilog-auto-hook) - ;; - (set (make-local-variable 'verilog-auto-update-tick) (buffer-modified-tick)) - ;; - ;; If end result is same as when started, clear modified flag - (cond ((and oldbuf (equal oldbuf (buffer-string))) - (set-buffer-modified-p nil) - (unless noninteractive (message "Updating AUTOs...done (no changes)"))) - (t (unless noninteractive (message "Updating AUTOs...done"))))) - ;; Unwind forms - (progn - ;; Restore font-lock - (when fontlocked (font-lock-mode t)))))) + (verilog-dir-cache-preserving t) + ;; Cache current module + (verilog-modi-cache-current-enable t) + (verilog-modi-cache-current-max (point-min)) ; IE it's invalid + verilog-modi-cache-current) + (unwind-protect + ;; Disable change hooks for speed + ;; This let can't be part of above let; must restore + ;; after-change-functions before font-lock resumes + (verilog-save-no-change-functions + (verilog-save-scan-cache + (save-excursion + ;; If we're not in verilog-mode, change syntax table so parsing works right + (unless (eq major-mode `verilog-mode) (verilog-mode)) + ;; Allow user to customize + (run-hooks 'verilog-before-auto-hook) + ;; Try to save the user from needing to revert-file to reread file local-variables + (verilog-auto-reeval-locals) + (verilog-read-auto-lisp-present) + (verilog-read-auto-lisp (point-min) (point-max)) + (verilog-getopt-flags) + ;; From here on out, we can cache anything we read from disk + (verilog-preserve-dir-cache + ;; These two may seem obvious to do always, but on large includes it can be way too slow + (when verilog-auto-read-includes + (verilog-read-includes) + (verilog-read-defines nil nil t)) + ;; This particular ordering is important + ;; INST: Lower modules correct, no internal dependencies, FIRST + (verilog-preserve-modi-cache + ;; Clear existing autos else we'll be screwed by existing ones + (verilog-delete-auto) + ;; Injection if appropriate + (when inject + (verilog-inject-inst) + (verilog-inject-sense) + (verilog-inject-arg)) + ;; + ;; Do user inserts first, so their code can insert AUTOs + ;; We may provide a AUTOINSERTLISPLAST if another cleanup pass is needed + (verilog-auto-re-search-do "/\\*AUTOINSERTLISP(.*?)\\*/" + 'verilog-auto-insert-lisp) + ;; Expand instances before need the signals the instances input/output + (verilog-auto-re-search-do "/\\*AUTOINSTPARAM\\*/" 'verilog-auto-inst-param) + (verilog-auto-re-search-do "/\\*AUTOINST\\*/" 'verilog-auto-inst) + (verilog-auto-re-search-do "\\.\\*" 'verilog-auto-star) + ;; Doesn't matter when done, but combine it with a common changer + (verilog-auto-re-search-do "/\\*\\(AUTOSENSE\\|AS\\)\\*/" 'verilog-auto-sense) + (verilog-auto-re-search-do "/\\*AUTORESET\\*/" 'verilog-auto-reset) + ;; Must be done before autoin/out as creates a reg + (verilog-auto-re-search-do "/\\*AUTOASCIIENUM([^)]*)\\*/" 'verilog-auto-ascii-enum) + ;; + ;; first in/outs from other files + (verilog-auto-re-search-do "/\\*AUTOINOUTMODULE([^)]*)\\*/" 'verilog-auto-inout-module) + (verilog-auto-re-search-do "/\\*AUTOINOUTCOMP([^)]*)\\*/" 'verilog-auto-inout-comp) + ;; next in/outs which need previous sucked inputs first + (verilog-auto-re-search-do "/\\*AUTOOUTPUT\\((\"[^\"]*\")\\)\\*/" + '(lambda () (verilog-auto-output t))) + (verilog-auto-re-search-do "/\\*AUTOOUTPUT\\*/" 'verilog-auto-output) + (verilog-auto-re-search-do "/\\*AUTOINPUT\\((\"[^\"]*\")\\)\\*/" + '(lambda () (verilog-auto-input t))) + (verilog-auto-re-search-do "/\\*AUTOINPUT\\*/" 'verilog-auto-input) + (verilog-auto-re-search-do "/\\*AUTOINOUT\\((\"[^\"]*\")\\)\\*/" + '(lambda () (verilog-auto-inout t))) + (verilog-auto-re-search-do "/\\*AUTOINOUT\\*/" 'verilog-auto-inout) + ;; Then tie off those in/outs + (verilog-auto-re-search-do "/\\*AUTOTIEOFF\\*/" 'verilog-auto-tieoff) + ;; Wires/regs must be after inputs/outputs + (verilog-auto-re-search-do "/\\*AUTOWIRE\\*/" 'verilog-auto-wire) + (verilog-auto-re-search-do "/\\*AUTOREG\\*/" 'verilog-auto-reg) + (verilog-auto-re-search-do "/\\*AUTOREGINPUT\\*/" 'verilog-auto-reg-input) + ;; outputevery needs AUTOOUTPUTs done first + (verilog-auto-re-search-do "/\\*AUTOOUTPUTEVERY\\*/" 'verilog-auto-output-every) + ;; After we've created all new variables + (verilog-auto-re-search-do "/\\*AUTOUNUSED\\*/" 'verilog-auto-unused) + ;; Must be after all inputs outputs are generated + (verilog-auto-re-search-do "/\\*AUTOARG\\*/" 'verilog-auto-arg) + ;; Fix line numbers (comments only) + (when verilog-auto-inst-template-numbers + (verilog-auto-templated-rel)))) + ;; + (run-hooks 'verilog-auto-hook) + ;; + (set (make-local-variable 'verilog-auto-update-tick) (buffer-chars-modified-tick)) + ;; + ;; If end result is same as when started, clear modified flag + (cond ((and oldbuf (equal oldbuf (buffer-string))) + (set-buffer-modified-p nil) + (unless noninteractive (message "Updating AUTOs...done (no changes)"))) + (t (unless noninteractive (message "Updating AUTOs...done")))) + ;; End of after-change protection + ))) + ;; Unwind forms + (progn + ;; Restore font-lock + (when fontlocked (font-lock-mode t)))))) ;; @@ -11191,91 +11887,119 @@ "Map containing mouse bindings for `verilog-mode'.") -(defun verilog-colorize-include-files (beg end old-len) - "This function colorizes included files when the mouse passes over them. +(defun verilog-highlight-region (beg end old-len) + "Colorize included files and modules in the (changed?) region. Clicking on the middle-mouse button loads them in a buffer (as in dired)." - (save-excursion - (save-match-data - (let (end-point) - (goto-char end) - (setq end-point (verilog-get-end-of-line)) - (goto-char beg) - (beginning-of-line) ; scan entire line ! - ;; delete overlays existing on this line - (let ((overlays (overlays-in (point) end-point))) - (while overlays - (if (and - (overlay-get (car overlays) 'detachable) - (overlay-get (car overlays) 'verilog-include-file)) - (delete-overlay (car overlays))) - (setq overlays (cdr overlays)))) ; let - ;; make new ones, could reuse deleted one ? - (while (search-forward-regexp verilog-include-file-regexp end-point t) - (let (ov) - (goto-char (match-beginning 1)) - (setq ov (make-overlay (match-beginning 1) (match-end 1))) - (overlay-put ov 'start-closed 't) - (overlay-put ov 'end-closed 't) - (overlay-put ov 'evaporate 't) - (overlay-put ov 'verilog-include-file 't) - (overlay-put ov 'mouse-face 'highlight) - (overlay-put ov 'local-map verilog-mode-mouse-map))))))) - - -(defun verilog-colorize-include-files-buffer () - "Colorize an include file." + (when (or verilog-highlight-includes + verilog-highlight-modules) + (save-excursion + (save-match-data ;; A query-replace may call this function - do not disturb + (verilog-save-buffer-state + (verilog-save-scan-cache + (let (end-point) + (goto-char end) + (setq end-point (verilog-get-end-of-line)) + (goto-char beg) + (beginning-of-line) ; scan entire line + ;; delete overlays existing on this line + (let ((overlays (overlays-in (point) end-point))) + (while overlays + (if (and + (overlay-get (car overlays) 'detachable) + (or (overlay-get (car overlays) 'verilog-include-file) + (overlay-get (car overlays) 'verilog-inst-module))) + (delete-overlay (car overlays))) + (setq overlays (cdr overlays)))) + ;; + ;; make new include overlays + (when verilog-highlight-includes + (while (search-forward-regexp verilog-include-file-regexp end-point t) + (goto-char (match-beginning 1)) + (let ((ov (make-overlay (match-beginning 1) (match-end 1)))) + (overlay-put ov 'start-closed 't) + (overlay-put ov 'end-closed 't) + (overlay-put ov 'evaporate 't) + (overlay-put ov 'verilog-include-file 't) + (overlay-put ov 'mouse-face 'highlight) + (overlay-put ov 'local-map verilog-mode-mouse-map)))) + ;; + ;; make new module overlays + (goto-char beg) + ;; This scanner is syntax-fragile, so don't get bent + (when verilog-highlight-modules + (condition-case nil + (while (verilog-re-search-forward "\\(/\\*AUTOINST\\*/\\|\\.\\*\\)" end-point t) + (save-excursion + (goto-char (match-beginning 0)) + (unless (verilog-inside-comment-p) + (verilog-read-inst-module-matcher) ;; sets match 0 + (let* ((ov (make-overlay (match-beginning 0) (match-end 0)))) + (overlay-put ov 'start-closed 't) + (overlay-put ov 'end-closed 't) + (overlay-put ov 'evaporate 't) + (overlay-put ov 'verilog-inst-module 't) + (overlay-put ov 'mouse-face 'highlight) + (overlay-put ov 'local-map verilog-mode-mouse-map))))) + (error nil))) + ;; + ;; Future highlights: + ;; variables - make an Occur buffer of where referenced + ;; pins - make an Occur buffer of the sig in the declaration module + ))))))) + +(defun verilog-highlight-buffer () + "Colorize included files and modules across the whole buffer." + ;; Invoked via verilog-mode calling font-lock then `font-lock-mode-hook' (interactive) - ;; delete overlays - (let ((overlays (overlays-in (point-min) (point-max)))) - (while overlays - (if (and - (overlay-get (car overlays) 'detachable) - (overlay-get (car overlays) 'verilog-include-file)) - (delete-overlay (car overlays))) - (setq overlays (cdr overlays)))) ; let - ;; remake overlays - (verilog-colorize-include-files (point-min) (point-max) nil)) + ;; delete and remake overlays + (verilog-highlight-region (point-min) (point-max) nil)) + +;; Deprecated, but was interactive, so we'll keep it around +(defalias 'verilog-colorize-include-files-buffer 'verilog-highlight-buffer) ;; ffap-at-mouse isn't useful for Verilog mode. It uses library paths. ;; so define this function to do more or less the same as ffap-at-mouse ;; but first resolve filename... (defun verilog-load-file-at-mouse (event) "Load file under button 2 click's EVENT. -Files are checked based on `verilog-library-directories'." +Files are checked based on `verilog-library-flags'." (interactive "@e") (save-excursion ;; implement a Verilog specific ffap-at-mouse (mouse-set-point event) - (beginning-of-line) - (if (looking-at verilog-include-file-regexp) + (verilog-load-file-at-point t))) + +;; ffap isn't useable for Verilog mode. It uses library paths. +;; so define this function to do more or less the same as ffap +;; but first resolve filename... +(defun verilog-load-file-at-point (&optional warn) + "Load file under point. +If WARN, throw warning if not found. +Files are checked based on `verilog-library-flags'." + (interactive) + (save-excursion ;; implement a Verilog specific ffap + (let ((overlays (overlays-in (point) (point))) + hit) + (while (and overlays (not hit)) + (when (overlay-get (car overlays) 'verilog-inst-module) + (verilog-goto-defun-file (buffer-substring + (overlay-start (car overlays)) + (overlay-end (car overlays)))) + (setq hit t)) + (setq overlays (cdr overlays))) + ;; Include? + (beginning-of-line) + (when (and (not hit) + (looking-at verilog-include-file-regexp)) (if (and (car (verilog-library-filenames (match-string 1) (buffer-file-name))) (file-readable-p (car (verilog-library-filenames (match-string 1) (buffer-file-name))))) (find-file (car (verilog-library-filenames (match-string 1) (buffer-file-name)))) - (progn + (when warn (message "File '%s' isn't readable, use shift-mouse2 to paste in this field" - (match-string 1))))))) - -;; ffap isn't useable for Verilog mode. It uses library paths. -;; so define this function to do more or less the same as ffap -;; but first resolve filename... -(defun verilog-load-file-at-point () - "Load file under point. -Files are checked based on `verilog-library-directories'." - (interactive) - (save-excursion ;; implement a Verilog specific ffap - (beginning-of-line) - (if (looking-at verilog-include-file-regexp) - (if (and - (car (verilog-library-filenames - (match-string 1) (buffer-file-name))) - (file-readable-p (car (verilog-library-filenames - (match-string 1) (buffer-file-name))))) - (find-file (car (verilog-library-filenames - (match-string 1) (buffer-file-name)))))))) - + (match-string 1)))))))) ;; ;; Bug reporting @@ -11305,22 +12029,43 @@ "mac@verilog.com, wsnyder@wsnyder.org" (concat "verilog-mode v" verilog-mode-version) '( + verilog-active-low-regexp verilog-align-ifelse + verilog-assignment-delay + verilog-auto-arg-sort verilog-auto-endcomments verilog-auto-hook + verilog-auto-ignore-concat verilog-auto-indent-on-newline + verilog-auto-inout-ignore-regexp + verilog-auto-input-ignore-regexp + verilog-auto-inst-column + verilog-auto-inst-dot-name + verilog-auto-inst-param-value + verilog-auto-inst-template-numbers verilog-auto-inst-vector - verilog-auto-inst-template-numbers verilog-auto-lineup verilog-auto-newline + verilog-auto-output-ignore-regexp + verilog-auto-read-includes + verilog-auto-reset-widths verilog-auto-save-policy verilog-auto-sense-defines-constant verilog-auto-sense-include-inputs + verilog-auto-star-expand + verilog-auto-star-save + verilog-auto-unused-ignore-regexp verilog-before-auto-hook + verilog-before-delete-auto-hook + verilog-before-getopt-flags-hook verilog-case-indent verilog-cexp-indent verilog-compiler verilog-coverage + verilog-delete-auto-hook + verilog-getopt-flags-hook + verilog-highlight-grouping-keywords + verilog-highlight-p1800-keywords verilog-highlight-translate-off verilog-indent-begin-after-if verilog-indent-declaration-macros @@ -11330,16 +12075,18 @@ verilog-indent-level-directive verilog-indent-level-module verilog-indent-lists - verilog-library-flags verilog-library-directories verilog-library-extensions verilog-library-files + verilog-library-flags verilog-linter verilog-minimum-comment-distance verilog-mode-hook + verilog-preprocessor verilog-simulator verilog-tab-always-indent verilog-tab-to-comment + verilog-typedef-regexp ) nil nil (concat "Hi Mac, === modified file 'lisp/woman.el' --- lisp/woman.el 2010-09-25 21:42:48 +0000 +++ lisp/woman.el 2010-10-24 21:36:09 +0000 @@ -1508,7 +1508,7 @@ ;; (topic) ;; (topic (path-index) (path-index) ... ) ;; (topic (path-index filename) (path-index filename) ... ) - ;; where the are no duplicates in the value lists. + ;; where there are no duplicates in the value lists. ;; Topic must match first `word' of filename, so ... (let ((topic-regexp (concat === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-24 16:00:57 +0000 +++ src/ChangeLog 2010-10-24 21:37:38 +0000 @@ -1,3 +1,14 @@ +2010-10-24 Chong Yidong + + * xterm.c (x_connection_closed): Kill Emacs unconditionally. + +2010-10-24 Eli Zaretskii + + * frame.c (Fframep, Fwindow_system): Deprecate use as a predicate. + + * dispnew.c (syms_of_display) : + Deprecate use as a boolean flag. + 2010-10-24 Jim Meyering * emacs.c (argmatch): Don't treat "--" as "--chdir". === modified file 'src/atimer.c' --- src/atimer.c 2010-07-07 22:18:28 +0000 +++ src/atimer.c 2010-10-24 21:36:09 +0000 @@ -171,9 +171,9 @@ for (t = *list, prev = NULL; t && t != timer; prev = t, t = t->next) ; - /* If it is, take it off the its list, and put in on the - free-list. We don't bother to arrange for setting a - different alarm time, since a too early one doesn't hurt. */ + /* If it is, take it off its list, and put in on the free-list. + We don't bother to arrange for setting a different alarm time, + since a too early one doesn't hurt. */ if (t) { if (prev) === modified file 'src/dispnew.c' --- src/dispnew.c 2010-09-27 05:42:43 +0000 +++ src/dispnew.c 2010-10-24 21:36:09 +0000 @@ -6583,13 +6583,29 @@ DEFVAR_LISP ("initial-window-system", &Vinitial_window_system, doc: /* Name of the window system that Emacs uses for the first frame. -The value is a symbol--for instance, `x' for X windows. -The value is nil if Emacs is using a text-only terminal. */); +The value is a symbol: + nil for a termcap frame (a character-only terminal), + 'x' for an Emacs frame that is really an X window, + 'w32' for an Emacs frame that is a window on MS-Windows display, + 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display, + 'pc' for a direct-write MS-DOS frame. + +Use of this variable as a boolean is deprecated. Instead, +use `display-graphic-p' or any of the other `display-*-p' +predicates which report frame's specific UI-related capabilities. */); DEFVAR_KBOARD ("window-system", Vwindow_system, doc: /* Name of window system through which the selected frame is displayed. -The value is a symbol--for instance, `x' for X windows. -The value is nil if the selected frame is on a text-only-terminal. */); +The value is a symbol: + nil for a termcap frame (a character-only terminal), + 'x' for an Emacs frame that is really an X window, + 'w32' for an Emacs frame that is a window on MS-Windows display, + 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display, + 'pc' for a direct-write MS-DOS frame. + +Use of this variable as a boolean is deprecated. Instead, +use `display-graphic-p' or any of the other `display-*-p' +predicates which report frame's specific UI-related capabilities. */); DEFVAR_LISP ("window-system-version", &Vwindow_system_version, doc: /* The version number of the window system in use. === modified file 'src/frame.c' --- src/frame.c 2010-10-23 21:21:49 +0000 +++ src/frame.c 2010-10-24 21:36:09 +0000 @@ -203,11 +203,12 @@ DEFUN ("framep", Fframep, Sframep, 1, 1, 0, doc: /* Return non-nil if OBJECT is a frame. -Value is t for a termcap frame (a character-only terminal), -`x' for an Emacs frame that is really an X window, -`w32' for an Emacs frame that is a window on MS-Windows display, -`ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display, -`pc' for a direct-write MS-DOS frame. +Value is: + t for a termcap frame (a character-only terminal), + 'x' for an Emacs frame that is really an X window, + 'w32' for an Emacs frame that is a window on MS-Windows display, + 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display, + 'pc' for a direct-write MS-DOS frame. See also `frame-live-p'. */) (Lisp_Object object) { @@ -249,10 +250,18 @@ DEFUN ("window-system", Fwindow_system, Swindow_system, 0, 1, 0, doc: /* The name of the window system that FRAME is displaying through. -The value is a symbol---for instance, 'x' for X windows. -The value is nil if Emacs is using a text-only terminal. - -FRAME defaults to the currently selected frame. */) +The value is a symbol: + nil for a termcap frame (a character-only terminal), + 'x' for an Emacs frame that is really an X window, + 'w32' for an Emacs frame that is a window on MS-Windows display, + 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display, + 'pc' for a direct-write MS-DOS frame. + +FRAME defaults to the currently selected frame. + +Use of this function as a predicate is deprecated. Instead, +use `display-graphic-p' or any of the other `display-*-p' +predicates which report frame's specific UI-related capabilities. */) (Lisp_Object frame) { Lisp_Object type; === modified file 'src/xterm.c' --- src/xterm.c 2010-10-24 01:15:43 +0000 +++ src/xterm.c 2010-10-24 21:36:09 +0000 @@ -7698,15 +7698,12 @@ #endif #ifdef USE_GTK - /* Due to bugs in some Gtk+ versions, just exit here if this - is the last display/terminal. */ - if (terminal_list->next_terminal == NULL) - { - fprintf (stderr, "%s\n", error_msg); - Fkill_emacs (make_number (70)); - /* NOTREACHED */ - } - xg_display_close (dpyinfo->display); + /* Due to bugs in some Gtk+ versions, just exit here. */ + { + fprintf (stderr, "%s\n", error_msg); + Fkill_emacs (make_number (70)); + abort (); /* NOTREACHED */ + } #endif /* Indicate that this display is dead. */ ------------------------------------------------------------ revno: 102084 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Sun 2010-10-24 22:47:22 +0200 message: Regenerated. diff: === modified file 'configure' --- configure 2010-10-12 21:03:09 +0000 +++ configure 2010-10-24 20:47:22 +0000 @@ -5506,19 +5506,17 @@ fi -if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x -then - ac_link="$ac_link $GCC_LINK_TEST_OPTIONS" -fi - -if test x$GCC = x && test "x$NON_GCC_LINK_TEST_OPTIONS" != x -then - ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS" +if test x$GCC = xyes; then + test "x$GCC_LINK_TEST_OPTIONS" != x && \ + ac_link="$ac_link $GCC_LINK_TEST_OPTIONS" +else + test "x$NON_GCC_LINK_TEST_OPTIONS" != x && \ + ac_link="$ac_link $NON_GCC_LINK_TEST_OPTIONS" fi late_LDFLAGS=$LDFLAGS -if test "$GCC" = yes; then +if test x$GCC = xyes; then LDFLAGS="$LDFLAGS -Wl,-znocombreloc" else LDFLAGS="$LDFLAGS -znocombreloc" @@ -8054,6 +8052,7 @@ main () { char *data, *data2, *data3; + const char *cdata2; int i, pagesize; int fd, fd2; @@ -8078,10 +8077,10 @@ fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); if (fd2 < 0) return 4; - data2 = ""; - if (write (fd2, data2, 1) != 1) + cdata2 = ""; + if (write (fd2, cdata2, 1) != 1) return 5; - data2 = mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); + data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); if (data2 == MAP_FAILED) return 6; for (i = 0; i < pagesize; ++i) @@ -14968,7 +14967,7 @@ echo " Does Emacs use -ldbus? ${HAVE_DBUS}" echo " Does Emacs use -lgconf? ${HAVE_GCONF}" echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" -echo " Does Emacs use -lgnutls (BROKEN)? ${HAVE_GNUTLS}" +echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}" ------------------------------------------------------------ revno: 102083 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Sun 2010-10-24 22:46:17 +0200 message: * configure.in: Remove the BROKEN annotation from gnutls. diff: === modified file 'ChangeLog' --- ChangeLog 2010-10-22 03:26:34 +0000 +++ ChangeLog 2010-10-24 20:46:17 +0000 @@ -1,3 +1,7 @@ +2010-10-24 Lars Magne Ingebrigtsen + + * configure.in: Remove the BROKEN annotation from gnutls. + 2010-10-22 Glenn Morris * make-dist: Avoid listing .el files twice. Don't try to run === modified file 'configure.in' --- configure.in 2010-10-12 21:03:09 +0000 +++ configure.in 2010-10-24 20:46:17 +0000 @@ -3712,7 +3712,7 @@ echo " Does Emacs use -ldbus? ${HAVE_DBUS}" echo " Does Emacs use -lgconf? ${HAVE_GCONF}" echo " Does Emacs use -lselinux? ${HAVE_LIBSELINUX}" -echo " Does Emacs use -lgnutls (BROKEN)? ${HAVE_GNUTLS}" +echo " Does Emacs use -lgnutls? ${HAVE_GNUTLS}" echo " Does Emacs use -lxml2? ${HAVE_LIBXML2}" echo " Does Emacs use -lfreetype? ${HAVE_FREETYPE}" ------------------------------------------------------------ revno: 102082 committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-10-24 14:43:31 -0400 message: Merge read-color and facemenu-read-color (Bug#7242). * lisp/facemenu.el (facemenu-read-color): Alias for read-color. (facemenu-set-foreground, facemenu-set-background): Use read-color. * lisp/faces.el (read-color): Use the completion code from facemenu-read-color. Require match in completion. Doc fix. * lisp/frame.el (set-background-color, set-foreground-color) (set-cursor-color, set-mouse-color, set-border-color): Use read-color. diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-10-23 09:18:19 +0000 +++ etc/NEWS 2010-10-24 18:43:31 +0000 @@ -663,6 +663,12 @@ ** New completion style `substring'. +** `facemenu-read-color' is now an alias for `read-color'. +The command `read-color' now requires a match for a color name or RGB +triplet, instead of signalling an error if the user provides a invalid +input. + + ** Image API *** When the image type is one of listed in `image-animated-types' === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 17:24:24 +0000 +++ lisp/ChangeLog 2010-10-24 18:43:31 +0000 @@ -1,3 +1,18 @@ +2010-10-24 Chong Yidong + + Merge read-color and facemenu-read-color (Bug#7242). + + * faces.el (read-color): Use the completion code from + facemenu-read-color. Require match in completion. Doc fix. + + * facemenu.el (facemenu-read-color): Alias for read-color. + (facemenu-set-foreground, facemenu-set-background): Use + read-color. + + * frame.el (set-background-color, set-foreground-color) + (set-cursor-color, set-mouse-color, set-border-color): Use + read-color. + 2010-10-24 Leo * eshell/em-unix.el (eshell-remove-entries): Use the TRASH === modified file 'lisp/facemenu.el' --- lisp/facemenu.el 2010-08-29 16:17:13 +0000 +++ lisp/facemenu.el 2010-10-24 18:43:31 +0000 @@ -358,7 +358,7 @@ typing a character to insert cancels the specification." (interactive (list (progn (barf-if-buffer-read-only) - (facemenu-read-color "Foreground color: ")) + (read-color "Foreground color: ")) (if (and mark-active (not current-prefix-arg)) (region-beginning)) (if (and mark-active (not current-prefix-arg)) @@ -380,7 +380,7 @@ typing a character to insert cancels the specification." (interactive (list (progn (barf-if-buffer-read-only) - (facemenu-read-color "Background color: ")) + (read-color "Background color: ")) (if (and mark-active (not current-prefix-arg)) (region-beginning)) (if (and mark-active (not current-prefix-arg)) @@ -462,23 +462,7 @@ (remove-text-properties start end '(invisible nil intangible nil read-only nil)))) -(defun facemenu-read-color (&optional prompt) - "Read a color using the minibuffer." - (let* ((completion-ignore-case t) - (color-list (or facemenu-color-alist (defined-colors))) - (completer - (lambda (string pred all-completions) - (if all-completions - (or (all-completions string color-list pred) - (if (color-defined-p string) - (list string))) - (or (try-completion string color-list pred) - (if (color-defined-p string) - string))))) - (col (completing-read (or prompt "Color: ") completer nil t))) - (if (equal "" col) - nil - col))) +(defalias 'facemenu-read-color 'read-color) (defun color-rgb-to-hsv (r g b) "For R, G, B color components return a list of hue, saturation, value. === modified file 'lisp/faces.el' --- lisp/faces.el 2010-10-14 03:55:18 +0000 +++ lisp/faces.el 2010-10-24 18:43:31 +0000 @@ -1676,89 +1676,76 @@ (t (> (tty-color-gray-shades display) 2))))) -(defun read-color (&optional prompt convert-to-RGB-p allow-empty-name-p msg-p) - "Read a color name or RGB hex value: #RRRRGGGGBBBB. -Completion is available for color names, but not for RGB hex strings. -If the user inputs an RGB hex string, it must have the form -#XXXXXXXXXXXX or XXXXXXXXXXXX, where each X is a hex digit. The -number of Xs must be a multiple of 3, with the same number of Xs for -each of red, green, and blue. The order is red, green, blue. - -In addition to standard color names and RGB hex values, the following -are available as color candidates. In each case, the corresponding -color is used. +(defun read-color (&optional prompt convert-to-RGB allow-empty-name msg) + "Read a color name or RGB triplet of the form \"#RRRRGGGGBBBB\". +Completion is available for color names, but not for RGB triplets. + +RGB triplets have the form #XXXXXXXXXXXX, where each X is a hex +digit. The number of Xs must be a multiple of 3, with the same +number of Xs for each of red, green, and blue. The order is red, +green, blue. + +In addition to standard color names and RGB hex values, the +following are available as color candidates. In each case, the +corresponding color is used. * `foreground at point' - foreground under the cursor * `background at point' - background under the cursor -Checks input to be sure it represents a valid color. If not, raises -an error (but see exception for empty input with non-nil -ALLOW-EMPTY-NAME-P). - -Optional arg PROMPT is the prompt; if nil, uses a default prompt. - -Interactively, or with optional arg CONVERT-TO-RGB-P non-nil, converts -an input color name to an RGB hex string. Returns the RGB hex string. - -Optional arg ALLOW-EMPTY-NAME-P controls what happens if the user -enters an empty color name (that is, just hits `RET'). If non-nil, -then returns an empty color name, \"\". If nil, then raises an error. -Programs must test for \"\" if ALLOW-EMPTY-NAME-P is non-nil. They -can then perform an appropriate action in case of empty input. - -Interactively, or with optional arg MSG-P non-nil, echoes the color in -a message." +Optional arg PROMPT is the prompt; if nil, use a default prompt. + +Interactively, or with optional arg CONVERT-TO-RGB-P non-nil, +convert an input color name to an RGB hex string. Return the RGB +hex string. + +If optional arg ALLOW-EMPTY-NAME is non-nil, the user is allowed +to enter an empty color name (the empty string). + +Interactively, or with optional arg MSG non-nil, print the +resulting color name in the echo area." (interactive "i\np\ni\np") ; Always convert to RGB interactively. (let* ((completion-ignore-case t) - (colors (append '("foreground at point" "background at point") - (defined-colors))) - (color (completing-read (or prompt "Color (name or #R+G+B+): ") - colors)) - hex-string) - (cond ((string= "foreground at point" color) - (setq color (foreground-color-at-point))) - ((string= "background at point" color) - (setq color (background-color-at-point)))) - (unless color - (setq color "")) - (setq hex-string - (string-match "^#?\\([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]\\)+$" color)) - (if (and allow-empty-name-p (string= "" color)) - "" - (when (and hex-string (not (eq (aref color 0) ?#))) - (setq color (concat "#" color))) ; No #; add it. - (unless hex-string - (when (or (string= "" color) (not (test-completion color colors))) - (error "No such color: %S" color)) - (when convert-to-RGB-p - (let ((components (x-color-values color))) - (unless components (error "No such color: %S" color)) - (unless (string-match "^#\\([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]\\)+$" color) - (setq color (format "#%04X%04X%04X" - (logand 65535 (nth 0 components)) - (logand 65535 (nth 1 components)) - (logand 65535 (nth 2 components)))))))) - (when msg-p (message "Color: `%s'" color)) - color))) - -;; Commented out because I decided it is better to include the -;; duplicates in read-color's completion list. - -;; (defun defined-colors-without-duplicates () -;; "Return the list of defined colors, without the no-space versions. -;; For each color name, we keep the variant that DOES have spaces." -;; (let ((result (copy-sequence (defined-colors))) -;; to-be-rejected) -;; (save-match-data -;; (dolist (this result) -;; (if (string-match " " this) -;; (push (replace-regexp-in-string " " "" -;; this) -;; to-be-rejected))) -;; (dolist (elt to-be-rejected) -;; (let ((as-found (car (member-ignore-case elt result)))) -;; (setq result (delete as-found result))))) -;; result)) + (colors (or facemenu-color-alist + (append '("foreground at point" "background at point") + (if allow-empty-name '("")) + (defined-colors)))) + (color (completing-read + (or prompt "Color (name or #RGB triplet): ") + ;; Completing function for reading colors, accepting + ;; both color names and RGB triplets. + (lambda (string pred flag) + (cond + ((null flag) ; Try completion. + (or (try-completion string colors pred) + (if (color-defined-p string) + string))) + ((eq flag t) ; List all completions. + (or (all-completions string colors pred) + (if (color-defined-p string) + (list string)))) + ((eq flag 'lambda) ; Test completion. + (or (memq string colors) + (color-defined-p string))))) + nil t)) + hex-string) + + ;; Process named colors. + (when (member color colors) + (cond ((string-equal color "foreground at point") + (setq color (foreground-color-at-point))) + ((string-equal color "background at point") + (setq color (background-color-at-point)))) + (when (and convert-to-RGB + (not (string-equal color ""))) + (let ((components (x-color-values color))) + (unless (string-match "^#\\([a-fA-F0-9][a-fA-F0-9][a-fA-F0-9]\\)+$" color) + (setq color (format "#%04X%04X%04X" + (logand 65535 (nth 0 components)) + (logand 65535 (nth 1 components)) + (logand 65535 (nth 2 components)))))))) + (when msg (message "Color: `%s'" color)) + color)) + (defun face-at-point () "Return the face of the character after point. === modified file 'lisp/frame.el' --- lisp/frame.el 2010-10-24 00:58:22 +0000 +++ lisp/frame.el 2010-10-24 18:43:31 +0000 @@ -1067,7 +1067,7 @@ "Set the background color of the selected frame to COLOR-NAME. When called interactively, prompt for the name of the color to use. To get the frame's current background color, use `frame-parameters'." - (interactive (list (facemenu-read-color "Background color: "))) + (interactive (list (read-color "Background color: "))) (modify-frame-parameters (selected-frame) (list (cons 'background-color color-name))) (or window-system @@ -1077,7 +1077,7 @@ "Set the foreground color of the selected frame to COLOR-NAME. When called interactively, prompt for the name of the color to use. To get the frame's current foreground color, use `frame-parameters'." - (interactive (list (facemenu-read-color "Foreground color: "))) + (interactive (list (read-color "Foreground color: "))) (modify-frame-parameters (selected-frame) (list (cons 'foreground-color color-name))) (or window-system @@ -1087,7 +1087,7 @@ "Set the text cursor color of the selected frame to COLOR-NAME. When called interactively, prompt for the name of the color to use. To get the frame's current cursor color, use `frame-parameters'." - (interactive (list (facemenu-read-color "Cursor color: "))) + (interactive (list (read-color "Cursor color: "))) (modify-frame-parameters (selected-frame) (list (cons 'cursor-color color-name)))) @@ -1095,7 +1095,7 @@ "Set the color of the mouse pointer of the selected frame to COLOR-NAME. When called interactively, prompt for the name of the color to use. To get the frame's current mouse color, use `frame-parameters'." - (interactive (list (facemenu-read-color "Mouse color: "))) + (interactive (list (read-color "Mouse color: "))) (modify-frame-parameters (selected-frame) (list (cons 'mouse-color (or color-name @@ -1106,7 +1106,7 @@ "Set the color of the border of the selected frame to COLOR-NAME. When called interactively, prompt for the name of the color to use. To get the frame's current border color, use `frame-parameters'." - (interactive (list (facemenu-read-color "Border color: "))) + (interactive (list (read-color "Border color: "))) (modify-frame-parameters (selected-frame) (list (cons 'border-color color-name)))) ------------------------------------------------------------ revno: 102081 author: Leo committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-10-24 13:24:24 -0400 message: Use recursive-trash feature for eshell deletion (Bug#7011). * lisp/eshell/em-unix.el (eshell-remove-entries): Use the TRASH argument of delete-file and delete-directory (Bug#7011). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 15:46:21 +0000 +++ lisp/ChangeLog 2010-10-24 17:24:24 +0000 @@ -1,5 +1,11 @@ +2010-10-24 Leo + + * eshell/em-unix.el (eshell-remove-entries): Use the TRASH + argument of delete-file and delete-directory (Bug#7011). + 2010-10-24 Chong Yidong + * emacs-lisp/package.el (package-menu-mode-map): Inherit from button-buffer-map. === modified file 'lisp/eshell/em-unix.el' --- lisp/eshell/em-unix.el 2010-09-25 21:51:55 +0000 +++ lisp/eshell/em-unix.el 2010-10-24 17:24:24 +0000 @@ -203,13 +203,7 @@ (eshell-error "rm: cannot remove `.' or `..'\n")) (if (and (file-directory-p (car files)) (not (file-symlink-p (car files)))) - (let ((dir (file-name-as-directory (car files)))) - (eshell-remove-entries dir - (mapcar - (function - (lambda (file) - (concat dir file))) - (directory-files dir))) + (progn (if verbose (eshell-printn (format "rm: removing directory `%s'" (car files)))) @@ -219,7 +213,7 @@ (not (y-or-n-p (format "rm: remove directory `%s'? " (car files)))))) - (eshell-funcalln 'delete-directory (car files)))) + (eshell-funcalln 'delete-directory (car files) t t))) (if verbose (eshell-printn (format "rm: removing file `%s'" (car files)))) @@ -228,7 +222,7 @@ (not (y-or-n-p (format "rm: remove `%s'? " (car files)))))) - (eshell-funcalln 'delete-file (car files))))) + (eshell-funcalln 'delete-file (car files) t)))) (setq files (cdr files)))) (defun eshell/rm (&rest args) ------------------------------------------------------------ revno: 102080 author: Jim Meyering committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-10-24 12:00:57 -0400 message: * emacs.c (argmatch): Don't treat "--" as "--chdir". diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-24 02:22:43 +0000 +++ src/ChangeLog 2010-10-24 16:00:57 +0000 @@ -1,3 +1,7 @@ +2010-10-24 Jim Meyering + + * emacs.c (argmatch): Don't treat "--" as "--chdir". + 2010-10-24 Glenn Morris * w16select.c (syms_of_win16select) : === modified file 'src/emacs.c' --- src/emacs.c 2010-10-13 14:50:06 +0000 +++ src/emacs.c 2010-10-24 16:00:57 +0000 @@ -829,13 +829,14 @@ printf ("see the file named COPYING.\n"); exit (0); } - if (argmatch (argv, argc, "-chdir", "--chdir", 2, &ch_to_dir, &skip_args)) - if (chdir (ch_to_dir) == -1) - { - fprintf (stderr, "%s: Can't chdir to %s: %s\n", - argv[0], ch_to_dir, strerror (errno)); - exit (1); - } + + if (argmatch (argv, argc, "-chdir", "--chdir", 4, &ch_to_dir, &skip_args)) + if (chdir (ch_to_dir) == -1) + { + fprintf (stderr, "%s: Can't chdir to %s: %s\n", + argv[0], ch_to_dir, strerror (errno)); + exit (1); + } #ifdef HAVE_PERSONALITY_LINUX32 ------------------------------------------------------------ revno: 102079 committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-10-24 11:46:21 -0400 message: * package.el (package-menu-mode-map): Inherit from button-buffer-map. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 15:39:32 +0000 +++ lisp/ChangeLog 2010-10-24 15:46:21 +0000 @@ -1,3 +1,8 @@ +2010-10-24 Chong Yidong + + * emacs-lisp/package.el (package-menu-mode-map): Inherit from + button-buffer-map. + 2010-10-24 Ralf Angeli * emacs-lisp/package.el (package--generate-package-list): Make the === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2010-10-24 15:39:32 +0000 +++ lisp/emacs-lisp/package.el 2010-10-24 15:46:21 +0000 @@ -1187,7 +1187,7 @@ (defvar package-menu-mode-map (let ((map (make-keymap)) (menu-map (make-sparse-keymap "Package"))) - (suppress-keymap map) + (set-keymap-parent map button-buffer-map) (define-key map "\C-m" 'package-menu-describe-package) (define-key map "q" 'quit-window) (define-key map "n" 'next-line) ------------------------------------------------------------ revno: 102078 committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-10-24 11:39:32 -0400 message: Fix last commit. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 15:37:21 +0000 +++ lisp/ChangeLog 2010-10-24 15:39:32 +0000 @@ -1,4 +1,4 @@ -2010-10-24 Chong Yidong +2010-10-24 Ralf Angeli * emacs-lisp/package.el (package--generate-package-list): Make the *Packages* buffer read-only. === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2010-10-24 15:37:21 +0000 +++ lisp/emacs-lisp/package.el 2010-10-24 15:39:32 +0000 @@ -1474,7 +1474,6 @@ (package-initialize) (let ((inhibit-read-only t) info-list name desc hold builtin) - (setq buffer-read-only t) (erase-buffer) ;; List installed packages (dolist (elt package-alist) ------------------------------------------------------------ revno: 102077 committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-10-24 11:37:21 -0400 message: Make the *Packages* buffer read-only. * emacs-lisp/package.el (package--generate-package-list): Make the *Packages* buffer read-only. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 15:27:37 +0000 +++ lisp/ChangeLog 2010-10-24 15:37:21 +0000 @@ -1,3 +1,8 @@ +2010-10-24 Chong Yidong + + * emacs-lisp/package.el (package--generate-package-list): Make the + *Packages* buffer read-only. + 2010-10-24 Alan Mackenzie * progmodes/cc-fonts.el (c-font-lock-declarations): Cache the === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2010-09-22 03:31:30 +0000 +++ lisp/emacs-lisp/package.el 2010-10-24 15:37:21 +0000 @@ -1474,7 +1474,7 @@ (package-initialize) (let ((inhibit-read-only t) info-list name desc hold builtin) - (setq buffer-read-only nil) + (setq buffer-read-only t) (erase-buffer) ;; List installed packages (dolist (elt package-alist) ------------------------------------------------------------ revno: 102076 committer: Alan Mackenzie branch nick: trunk timestamp: Sun 2010-10-24 15:27:37 +0000 message: progmodes/cc-fonts.el (c-font-lock-declarations): Cache the result of `c-beginning-of-decl-1' between invocations of a lambda function (Bug #7265). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 03:12:17 +0000 +++ lisp/ChangeLog 2010-10-24 15:27:37 +0000 @@ -1,3 +1,9 @@ +2010-10-24 Alan Mackenzie + + * progmodes/cc-fonts.el (c-font-lock-declarations): Cache the + result of `c-beginning-of-decl-1' between invocations of a lambda + function (Bug #7265). + 2010-10-24 Daiki Ueno * epg-config.el (epg-gpg-program): Try to use "gpg2" if "gpg" === modified file 'lisp/progmodes/cc-fonts.el' --- lisp/progmodes/cc-fonts.el 2010-10-09 19:58:28 +0000 +++ lisp/progmodes/cc-fonts.el 2010-10-24 15:27:37 +0000 @@ -1045,6 +1045,9 @@ ;; The position of the next token after the closing paren of ;; the last detected cast. last-cast-end + ;; Start of containing declaration (if any); limit for searching + ;; backwards for it. + decl-start decl-search-lim ;; The result from `c-forward-decl-or-cast-1'. decl-or-cast ;; The maximum of the end positions of all the checked type @@ -1184,20 +1187,29 @@ match-pos context last-cast-end)) (if (not decl-or-cast) - ;; Are we at a declarator? - ;; Try to go back to the declaration to check this. - (let (paren-state bod-res lim encl-pos is-typedef) + ;; Are we at a declarator? Try to go back to the declaration + ;; to check this. Note that `c-beginning-of-decl-1' is slow, + ;; so we cache its result between calls. + (let (paren-state bod-res encl-pos is-typedef) (goto-char start-pos) (save-excursion - (setq lim (and (c-syntactic-skip-backward "^;" nil t) - (point)))) + (unless (and decl-search-lim + (eq decl-search-lim + (save-excursion + (c-syntactic-skip-backward "^;" nil t) + (point)))) + (setq decl-search-lim + (and (c-syntactic-skip-backward "^;" nil t) (point))) + (setq bod-res (car (c-beginning-of-decl-1 decl-search-lim))) + (if (and (eq bod-res 'same) + (progn + (c-backward-syntactic-ws) + (eq (char-before) ?\}))) + (c-beginning-of-decl-1 decl-search-lim)) + (setq decl-start (point)))) + (save-excursion - (setq bod-res (car (c-beginning-of-decl-1 lim))) - (if (and (eq bod-res 'same) - (progn - (c-backward-syntactic-ws) - (eq (char-before) ?\}))) - (c-beginning-of-decl-1 lim)) + (goto-char decl-start) ;; We're now putatively at the declaration. (setq paren-state (c-parse-state)) ;; At top level or inside a "{"? ------------------------------------------------------------ revno: 102075 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2010-10-24 09:55:56 +0000 message: gnus-sum.el (gnus-summary-select-article): Make sure we have the original article buffer live. gnus-sum.el (gnus-summary-select-article-buffer): Mention gnus-widen-article-buffer. shr.el (shr-tag-object): Added. nnir.el, gnus-group.el: Make nnir work by default. gnus-agent.el (gnus-agent-fetch-group): Don't download stuff if the group isn't covered by the agent. gnus-sum.el (gnus-group-make-articles-read): Propagate marks to the backend for unknown groups. gnus-html.el (gnus-html-prefetch-images): Decode entities before prefetching images. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-10-24 00:29:21 +0000 +++ lisp/gnus/ChangeLog 2010-10-24 09:55:56 +0000 @@ -1,3 +1,33 @@ +2010-10-24 Lars Magne Ingebrigtsen + + * gnus-html.el (gnus-html-prefetch-images): Decode entities before + prefetching images. + + * gnus-sum.el (gnus-group-make-articles-read): Propagate marks to the + backend for unknown groups. This is mainly useful for nnimap groups. + + * gnus-agent.el (gnus-agent-fetch-group): Don't download stuff if the + group isn't covered by the agent. + +2010-10-22 Andrew Cohen + + * nnir.el (nnir-method-default-engines): new variable. + (nnir-run-query): use it. + (nnir-group-mode-hook): remove key binding and move to gnus-group.el. + (gnus-summary-nnir-goto-thread): change group if needed. + + * gnus-group.el (gnus-group-group-map): add key binding for + gnus-group-make-nnir-group. + +2010-10-24 Lars Magne Ingebrigtsen + + * shr.el (shr-tag-object): Added. + + * gnus-sum.el (gnus-summary-select-article): Make sure we have the + original article buffer live. + (gnus-summary-select-article-buffer): Mention + gnus-widen-article-buffer. + 2010-10-23 Lars Magne Ingebrigtsen * shr.el (shr-tag-strong): Added. === modified file 'lisp/gnus/gnus-agent.el' --- lisp/gnus/gnus-agent.el 2010-10-18 23:41:03 +0000 +++ lisp/gnus/gnus-agent.el 2010-10-24 09:55:56 +0000 @@ -801,12 +801,13 @@ (setq group (or group gnus-newsgroup-name)) (unless group (error "No group on the current line")) - - (gnus-agent-while-plugged - (let ((gnus-command-method (gnus-find-method-for-group group))) - (gnus-agent-with-fetch - (gnus-agent-fetch-group-1 group gnus-command-method) - (gnus-message 5 "Fetching %s...done" group))))) + (if (not (gnus-agent-group-covered-p group)) + (message "%s isn't covered by the agent" group) + (gnus-agent-while-plugged + (let ((gnus-command-method (gnus-find-method-for-group group))) + (gnus-agent-with-fetch + (gnus-agent-fetch-group-1 group gnus-command-method) + (gnus-message 5 "Fetching %s...done" group)))))) (defun gnus-agent-add-group (category arg) "Add the current group to an agent category." === modified file 'lisp/gnus/gnus-group.el' --- lisp/gnus/gnus-group.el 2010-10-24 00:29:21 +0000 +++ lisp/gnus/gnus-group.el 2010-10-24 09:55:56 +0000 @@ -55,6 +55,8 @@ (autoload 'gnus-agent-total-fetched-for "gnus-agent") (autoload 'gnus-cache-total-fetched-for "gnus-cache") +(autoload 'gnus-group-make-nnir-group "nnir") + (defcustom gnus-no-groups-message "No Gnus is good news" "*Message displayed by Gnus when no groups are available." :group 'gnus-start @@ -653,6 +655,7 @@ "D" gnus-group-enter-directory "f" gnus-group-make-doc-group "w" gnus-group-make-web-group + "G" gnus-group-make-nnir-group "M" gnus-group-read-ephemeral-group "r" gnus-group-rename-group "R" gnus-group-make-rss-group @@ -904,6 +907,7 @@ ["Add the help group" gnus-group-make-help-group t] ["Make a doc group..." gnus-group-make-doc-group t] ["Make a web group..." gnus-group-make-web-group t] + ["Make a search group..." gnus-group-make-nnir-group t] ["Make a virtual group..." gnus-group-make-empty-virtual t] ["Add a group to a virtual..." gnus-group-add-to-virtual t] ["Make an ephemeral group..." gnus-group-read-ephemeral-group t] === modified file 'lisp/gnus/gnus-html.el' --- lisp/gnus/gnus-html.el 2010-10-21 03:48:01 +0000 +++ lisp/gnus/gnus-html.el 2010-10-24 09:55:56 +0000 @@ -494,7 +494,8 @@ (gnus-blocked-images)))) (save-match-data (while (re-search-forward "]+src=[\"']\\(http[^\"']+\\)" nil t) - (let ((url (gnus-html-encode-url (match-string 1)))) + (let ((url (gnus-html-encode-url + (mm-url-decode-entities-string (match-string 1))))) (unless (gnus-html-image-url-blocked-p url blocked-images) (when (gnus-html-cache-expired url gnus-html-image-cache-ttl) (gnus-html-schedule-image-fetching nil === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-10-21 02:52:45 +0000 +++ lisp/gnus/gnus-sum.el 2010-10-24 09:55:56 +0000 @@ -6190,7 +6190,13 @@ (info (nth 2 entry)) (active (gnus-active group)) range) - (when entry + (if (not entry) + ;; Group that Gnus doesn't know exists, but still allow the + ;; backend to set marks. + (gnus-request-set-mark + group (list (list (gnus-compress-sequence (sort articles #'<)) + 'add '(read)))) + ;; Normal, subscribed groups. (setq range (gnus-compute-read-articles group articles)) (with-current-buffer gnus-group-buffer (gnus-undo-register @@ -6942,7 +6948,9 @@ ;; Various summary commands (defun gnus-summary-select-article-buffer () - "Reconfigure windows to show the article buffer." + "Reconfigure windows to show the article buffer. +If `gnus-widen-article-buffer' is set, show only the article +buffer." (interactive) (if (not (gnus-buffer-live-p gnus-article-buffer)) (error "There is no article buffer for this summary buffer") @@ -7584,7 +7592,8 @@ (null (get-buffer gnus-article-buffer)) (not (eq article (cdr gnus-article-current))) (not (equal (car gnus-article-current) - gnus-newsgroup-name)))) + gnus-newsgroup-name)) + (not (buffer-name gnus-original-article-buffer)))) (and (not gnus-single-article-buffer) (or (null gnus-current-article) (not (eq gnus-current-article article)))) === modified file 'lisp/gnus/nnir.el' --- lisp/gnus/nnir.el 2010-10-10 22:48:40 +0000 +++ lisp/gnus/nnir.el 2010-10-24 09:55:56 +0000 @@ -378,6 +378,10 @@ If this variable is nil, or if the provided function returns nil for a search result, `gnus-retrieve-headers' will be called instead.") +(defvar nnir-method-default-engines + '((nnimap . imap) + (nntp . nil)) + "Alist of default search engines by server method") ;;; Developer Extension Variable: @@ -401,8 +405,8 @@ ()) (hyrex nnir-run-hyrex ((group . "Group spec: "))) - (find-grep nnir-run-find-grep - ((grep-options . "Grep options: ")))) + (find-grep nnir-run-find-grep + ((grep-options . "Grep options: ")))) "Alist of supported search engines. Each element in the alist is a three-element list (ENGINE FUNCTION ARGS). ENGINE is a symbol designating the searching engine. FUNCTION is also @@ -677,16 +681,6 @@ gnus-current-window-configuration) nil))) -(eval-when-compile - (when (featurep 'xemacs) - ;; The `kbd' macro requires that the `read-kbd-macro' macro is available. - (require 'edmacro))) - -(defun nnir-group-mode-hook () - (define-key gnus-group-mode-map (kbd "G G") - 'gnus-group-make-nnir-group)) -(add-hook 'gnus-group-mode-hook 'nnir-group-mode-hook) - ;; Why is this needed? Is this for compatibility with old/new gnusae? Using ;; gnus-group-server instead works for me. -- Justus Piater (defmacro nnir-group-server (group) @@ -716,22 +710,22 @@ (id (mail-header-id (gnus-summary-article-header))) (refs (split-string (mail-header-references (gnus-summary-article-header))))) - (if (string= (car (gnus-group-method group)) "nnimap") - (with-current-buffer (nnimap-buffer) - (let* ((cmd (let ((value - (format - "(OR HEADER REFERENCES %s HEADER Message-Id %s)" - id id))) - (dolist (refid refs value) - (setq value (format - "(OR (OR HEADER Message-Id %s HEADER REFERENCES %s) %s)" - refid refid value))))) - (result (nnimap-command - "UID SEARCH %s" cmd))) - (gnus-summary-read-group-1 group t t gnus-summary-buffer nil - (and (car result) - (delete 0 (mapcar #'string-to-number - (cdr (assoc "SEARCH" (cdr result))))))))) + (if (eq (car (gnus-group-method group)) 'nnimap) + (progn (nnimap-possibly-change-group (gnus-group-short-name group) nil) + (with-current-buffer (nnimap-buffer) + (let* ((cmd (let ((value (format + "(OR HEADER REFERENCES %s HEADER Message-Id %s)" + id id))) + (dolist (refid refs value) + (setq value (format + "(OR (OR HEADER Message-Id %s HEADER REFERENCES %s) %s)" + refid refid value))))) + (result (nnimap-command + "UID SEARCH %s" cmd))) + (gnus-summary-read-group-1 group t t gnus-summary-buffer nil + (and (car result) + (delete 0 (mapcar #'string-to-number + (cdr (assoc "SEARCH" (cdr result)))))))))) (gnus-summary-read-group-1 group t t gnus-summary-buffer nil (list backend-number)) (gnus-summary-limit (list backend-number)) @@ -1602,24 +1596,37 @@ (if gnus-group-marked (apply 'vconcat (mapcar (lambda (x) - (let ((server (nnir-group-server x)) - search-func) + (let* ((server (nnir-group-server x)) + (engine + (or (nnir-read-server-parm 'nnir-search-engine + server) + (cdr + (assoc (car (gnus-server-to-method server)) + nnir-method-default-engines)))) + search-func) (setq search-func (cadr (assoc - (nnir-read-server-parm 'nnir-search-engine server) nnir-engines))) + engine + nnir-engines))) (if search-func (funcall search-func q server x) nil))) - gnus-group-marked) - ) + gnus-group-marked)) (apply 'vconcat (mapcar (lambda (x) (if (and (equal (cadr x) 'ok) (not (equal (cadar x) "-ephemeral"))) - (let ((server (format "%s:%s" (caar x) (cadar x))) - search-func) + (let* ((server (format "%s:%s" (caar x) (cadar x))) + (engine + (or (nnir-read-server-parm 'nnir-search-engine + server) + (cdr + (assoc (car (gnus-server-to-method server)) + nnir-method-default-engines)))) + search-func) (setq search-func (cadr (assoc - (nnir-read-server-parm 'nnir-search-engine server) nnir-engines))) + engine + nnir-engines))) (if search-func (funcall search-func q server nil) nil)) === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2010-10-24 00:29:21 +0000 +++ lisp/gnus/shr.el 2010-10-24 09:55:56 +0000 @@ -424,6 +424,18 @@ (apply #'shr-fontize-cont cont types) (shr-ensure-paragraph)) +(defun shr-urlify (start url) + (widget-convert-button + 'url-link start (point) + :help-echo url + :keymap shr-map + url) + (put-text-property start (point) 'shr-url url)) + +(defun shr-encode-url (url) + "Encode URL." + (browse-url-url-encode-chars url "[)$ ]")) + ;;; Tag-specific rendering rules. (defun shr-tag-p (cont) @@ -478,16 +490,14 @@ (start (point)) shr-start) (shr-generic cont) - (widget-convert-button - 'url-link (or shr-start start) (point) - :help-echo url - :keymap shr-map - url) - (put-text-property (or shr-start start) (point) 'shr-url url))) + (shr-urlify (or shr-start start) url))) -(defun shr-encode-url (url) - "Encode URL." - (browse-url-url-encode-chars url "[)$ ]")) +(defun shr-tag-object (cont) + (let ((url (cdr (assq :src (cdr (assq 'embed cont))))) + (start (point))) + (when url + (shr-insert " [multimedia] ") + (shr-urlify start url)))) (defun shr-tag-img (cont) (when (and cont ------------------------------------------------------------ revno: 102074 committer: Daiki Ueno branch nick: trunk timestamp: Sun 2010-10-24 12:12:17 +0900 message: Try to use "gpg2" if "gpg" isn't available. * epg-config.el (epg-gpg-program): Try to use "gpg2" if "gpg" executable is not available on the system (Bug#7268). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 02:22:43 +0000 +++ lisp/ChangeLog 2010-10-24 03:12:17 +0000 @@ -1,3 +1,8 @@ +2010-10-24 Daiki Ueno + + * epg-config.el (epg-gpg-program): Try to use "gpg2" if "gpg" + executable is not available on the system (Bug#7268). + 2010-10-24 Glenn Morris * select.el (selection-coding-system, next-selection-coding-system): === modified file 'lisp/epg-config.el' --- lisp/epg-config.el 2010-08-29 16:17:13 +0000 +++ lisp/epg-config.el 2010-10-24 03:12:17 +0000 @@ -37,7 +37,9 @@ :version "23.1" :group 'data) -(defcustom epg-gpg-program "gpg" +(defcustom epg-gpg-program (or (executable-find "gpg") + (executable-find "gpg2") + "gpg") "The `gpg' executable." :group 'epg :type 'string) ------------------------------------------------------------ revno: 102073 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 19:22:43 -0700 message: Sync docs of selection-coding-system between C and Lisp. * src/w16select.c (syms_of_win16select) : * src/w32select.c (syms_of_w32select) : Sync docs with select.el. * lisp/select.el (selection-coding-system): Sync doc with C versions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 02:13:37 +0000 +++ lisp/ChangeLog 2010-10-24 02:22:43 +0000 @@ -1,6 +1,7 @@ 2010-10-24 Glenn Morris - * select.el (next-selection-coding-system): Sync doc with C versions. + * select.el (selection-coding-system, next-selection-coding-system): + Sync doc with C versions. * w32-vars.el (x-select-enable-clipboard): * term/x-win.el (x-select-enable-clipboard): Move to common-win. === modified file 'lisp/select.el' --- lisp/select.el 2010-10-24 02:13:37 +0000 +++ lisp/select.el 2010-10-24 02:22:43 +0000 @@ -28,8 +28,15 @@ ;;; Code: (defcustom selection-coding-system nil - "Coding system for communicating with other X clients. - + "Coding system for communicating with other programs. + +For MS-Windows and MS-DOS: +When sending or receiving text via selection and clipboard, the text +is encoded or decoded by this coding system. The default value is +the current system default encoding on 9x/Me, `utf-16le-dos' +\(Unicode) on NT/W2K/XP, and `iso-latin-1-dos' on MS-DOS. + +For X Windows: When sending text via selection and clipboard, if the target data-type matches with the type of this coding system, it is used for encoding the text. Otherwise (including the case that this === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-24 02:13:37 +0000 +++ src/ChangeLog 2010-10-24 02:22:43 +0000 @@ -1,7 +1,9 @@ 2010-10-24 Glenn Morris - * w16select.c (syms_of_win16select) : - * w32select.c (syms_of_w32select) : + * w16select.c (syms_of_win16select) : + : + * w32select.c (syms_of_w32select) : + : Sync docs with select.el. * xfaces.c (syms_of_xfaces) : Sync doc with === modified file 'src/w16select.c' --- src/w16select.c 2010-10-24 02:13:37 +0000 +++ src/w16select.c 2010-10-24 02:22:43 +0000 @@ -694,10 +694,35 @@ defsubr (&Sx_selection_exists_p); DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system, - doc: /* Coding system for communicating with other X clients. -When sending or receiving text via cut_buffer, selection, and clipboard, -the text is encoded or decoded by this coding system. -The default value is `iso-latin-1-dos'. */); + doc: /* Coding system for communicating with other programs. + +For MS-Windows and MS-DOS: +When sending or receiving text via selection and clipboard, the text +is encoded or decoded by this coding system. The default value is +the current system default encoding on 9x/Me, `utf-16le-dos' +\(Unicode) on NT/W2K/XP, and `iso-latin-1-dos' on MS-DOS. + +For X Windows: +When sending text via selection and clipboard, if the target +data-type matches with the type of this coding system, it is used +for encoding the text. Otherwise (including the case that this +variable is nil), a proper coding system is used as below: + +data-type coding system +--------- ------------- +UTF8_STRING utf-8 +COMPOUND_TEXT compound-text-with-extensions +STRING iso-latin-1 +C_STRING no-conversion + +When receiving text, if this coding system is non-nil, it is used +for decoding regardless of the data-type. If this is nil, a +proper coding system is used according to the data-type as above. + +See also the documentation of the variable `x-select-request-type' how +to control which data-type to request for receiving text. + +The default value is nil. */); Vselection_coding_system = intern ("iso-latin-1-dos"); DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system, === modified file 'src/w32select.c' --- src/w32select.c 2010-10-24 02:13:37 +0000 +++ src/w32select.c 2010-10-24 02:22:43 +0000 @@ -1070,10 +1070,34 @@ DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system, doc: /* Coding system for communicating with other programs. -When sending or receiving text via cut_buffer, selection, and -clipboard, the text is encoded or decoded by this coding system. -The default value is the current system default encoding on 9x/Me and -`utf-16le-dos' (Unicode) on NT/W2K/XP. */); + +For MS-Windows and MS-DOS: +When sending or receiving text via selection and clipboard, the text +is encoded or decoded by this coding system. The default value is +the current system default encoding on 9x/Me, `utf-16le-dos' +\(Unicode) on NT/W2K/XP, and `iso-latin-1-dos' on MS-DOS. + +For X Windows: +When sending text via selection and clipboard, if the target +data-type matches with the type of this coding system, it is used +for encoding the text. Otherwise (including the case that this +variable is nil), a proper coding system is used as below: + +data-type coding system +--------- ------------- +UTF8_STRING utf-8 +COMPOUND_TEXT compound-text-with-extensions +STRING iso-latin-1 +C_STRING no-conversion + +When receiving text, if this coding system is non-nil, it is used +for decoding regardless of the data-type. If this is nil, a +proper coding system is used according to the data-type as above. + +See also the documentation of the variable `x-select-request-type' how +to control which data-type to request for receiving text. + +The default value is nil. */); /* The actual value is set dynamically in the dumped Emacs, see below. */ Vselection_coding_system = Qnil; ------------------------------------------------------------ revno: 102072 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 19:13:37 -0700 message: Sync Lisp and C docs of next-selection-coding-system. * src/w16select.c (syms_of_win16select) : * src/w32select.c (syms_of_w32select) : Sync docs with select.el. * lisp/select.el (next-selection-coding-system): Sync doc with C versions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 01:57:21 +0000 +++ lisp/ChangeLog 2010-10-24 02:13:37 +0000 @@ -1,5 +1,7 @@ 2010-10-24 Glenn Morris + * select.el (next-selection-coding-system): Sync doc with C versions. + * w32-vars.el (x-select-enable-clipboard): * term/x-win.el (x-select-enable-clipboard): Move to common-win. * term/common-win.el (x-select-enable-clipboard): Move here. === modified file 'lisp/select.el' --- lisp/select.el 2010-09-02 09:47:08 +0000 +++ lisp/select.el 2010-10-24 02:13:37 +0000 @@ -1,12 +1,11 @@ ;;; select.el --- lisp portion of standard selection support +;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +;; 2008, 2009, 2010 Free Software Foundation, Inc. + ;; Maintainer: FSF ;; Keywords: internal -;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, -;; 2008, 2009, 2010 Free Software Foundation, Inc. -;; Based partially on earlier release by Lucid. - ;; This file is part of GNU Emacs. ;; GNU Emacs is free software: you can redistribute it and/or modify @@ -24,6 +23,8 @@ ;;; Commentary: +;; Based partially on earlier release by Lucid. + ;;; Code: (defcustom selection-coding-system nil @@ -58,11 +59,11 @@ (set symbol value))) (defvar next-selection-coding-system nil - "Coding system for the next communication with other X clients. + "Coding system for the next communication with other programs. Usually, `selection-coding-system' is used for communicating with -other X clients. But, if this variable is set, it is used for -the next communication only. After the communication, this -variable is set to nil.") +other programs (X Windows clients or MS Windows programs). But, if this +variable is set, it is used for the next communication only. +After the communication, this variable is set to nil.") (declare-function x-get-selection-internal "xselect.c" (selection-symbol target-type &optional time-stamp)) @@ -380,5 +381,4 @@ (provide 'select) -;; arch-tag: bb634f97-8a3b-4b0a-b940-f6e09982328c ;;; select.el ends here === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-24 01:48:39 +0000 +++ src/ChangeLog 2010-10-24 02:13:37 +0000 @@ -1,5 +1,9 @@ 2010-10-24 Glenn Morris + * w16select.c (syms_of_win16select) : + * w32select.c (syms_of_w32select) : + Sync docs with select.el. + * xfaces.c (syms_of_xfaces) : Sync doc with Lisp version. === modified file 'src/w16select.c' --- src/w16select.c 2010-10-01 13:56:33 +0000 +++ src/w16select.c 2010-10-24 02:13:37 +0000 @@ -1,6 +1,7 @@ /* 16-bit Windows Selection processing for emacs on MS-Windows - Copyright (C) 1996, 1997, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + +Copyright (C) 1996, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, + 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -700,11 +701,11 @@ Vselection_coding_system = intern ("iso-latin-1-dos"); DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system, - doc: /* Coding system for the next communication with other X clients. + doc: /* Coding system for the next communication with other programs. Usually, `selection-coding-system' is used for communicating with -other X clients. But, if this variable is set, it is used for the -next communication only. After the communication, this variable is -set to nil. */); +other programs (X Windows clients or MS Windows programs). But, if this +variable is set, it is used for the next communication only. +After the communication, this variable is set to nil. */); Vnext_selection_coding_system = Qnil; QPRIMARY = intern ("PRIMARY"); staticpro (&QPRIMARY); @@ -713,5 +714,3 @@ #endif /* MSDOS */ -/* arch-tag: 085a22c8-7324-436e-a6da-102464ce95d8 - (do not change this comment) */ === modified file 'src/w32select.c' --- src/w32select.c 2010-10-14 14:32:27 +0000 +++ src/w32select.c 2010-10-24 02:13:37 +0000 @@ -1,6 +1,7 @@ /* Selection processing for Emacs on the Microsoft W32 API. - Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + +Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, + 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -1080,9 +1081,9 @@ DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system, doc: /* Coding system for the next communication with other programs. Usually, `selection-coding-system' is used for communicating with -other programs. But, if this variable is set, it is used for the -next communication only. After the communication, this variable is -set to nil. */); +other programs (X Windows clients or MS Windows programs). But, if this +variable is set, it is used for the next communication only. +After the communication, this variable is set to nil. */); Vnext_selection_coding_system = Qnil; DEFSYM (QCLIPBOARD, "CLIPBOARD"); @@ -1123,5 +1124,3 @@ clipboard_owner = create_owner (); } -/* arch-tag: c96e9724-5eb1-4dad-be07-289f092fd2af - (do not change this comment) */ ------------------------------------------------------------ revno: 102071 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 18:57:21 -0700 message: Reduce duplicate definitions of x-select-enable-clipboard from 3 to 2. * lisp/w32-vars.el (x-select-enable-clipboard): * lisp/term/x-win.el (x-select-enable-clipboard): Move to common-win. * lisp/term/common-win.el (x-select-enable-clipboard): Move here. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 01:48:39 +0000 +++ lisp/ChangeLog 2010-10-24 01:57:21 +0000 @@ -1,5 +1,9 @@ 2010-10-24 Glenn Morris + * w32-vars.el (x-select-enable-clipboard): + * term/x-win.el (x-select-enable-clipboard): Move to common-win. + * term/common-win.el (x-select-enable-clipboard): Move here. + * term/tty-colors.el (tty-defined-color-alist): Remove duplicate definition of C variable. === modified file 'lisp/term/common-win.el' --- lisp/term/common-win.el 2010-06-12 17:12:15 +0000 +++ lisp/term/common-win.el 2010-10-24 01:57:21 +0000 @@ -25,6 +25,17 @@ ;;; Code: +(defcustom x-select-enable-clipboard t + "Non-nil means cutting and pasting uses the clipboard. +This is in addition to, but in preference to, the primary selection. + +Note that MS-Windows does not support selection types other than the +clipboard. \(The primary selection that is set by Emacs is not +accessible to other programs on MS-Windows.\)" + :type 'boolean + :group 'killing + ;; The GNU/Linux version changed in 24.1, the MS-Windows version did not. + :version "24.1") (defvar x-invocation-args) @@ -371,5 +382,4 @@ For Nextstep, this is a list of non-PANTONE colors returned by the operating system.") -;; arch-tag: 2a128601-99cc-401e-9dff-0ee6a36102ef ;;; common-win.el ends here === modified file 'lisp/term/x-win.el' --- lisp/term/x-win.el 2010-10-23 20:43:59 +0000 +++ lisp/term/x-win.el 2010-10-24 01:57:21 +0000 @@ -1206,17 +1206,6 @@ "The value of the PRIMARY X selection last time we selected or pasted text.") -(defcustom x-select-enable-clipboard t - "Non-nil means cutting and pasting uses the clipboard. -This is in addition to, but in preference to, the primary selection. - -Note that MS-Windows does not support selection types other than the -clipboard. \(The primary selection that is set by Emacs is not -accessible to other programs on MS-Windows.\)" - :type 'boolean - :group 'killing - :version "24.1") - (defcustom x-select-enable-primary nil "Non-nil means cutting and pasting uses the primary selection." :type 'boolean === modified file 'lisp/w32-vars.el' --- lisp/w32-vars.el 2010-10-23 20:40:46 +0000 +++ lisp/w32-vars.el 2010-10-24 01:57:21 +0000 @@ -148,16 +148,6 @@ (string :tag "Font"))))))) :group 'w32) -(defcustom x-select-enable-clipboard t - "Non-nil means cutting and pasting uses the clipboard. -This is in addition to, but in preference to, the primary selection. - -Note that MS-Windows does not support selection types other than the -clipboard. \(The primary selection that is set by Emacs is not -accessible to other programs on MS-Windows.\)" - :type 'boolean - :group 'killing) - (provide 'w32-vars) ;;; w32-vars.el ends here ------------------------------------------------------------ revno: 102070 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 18:48:39 -0700 message: Remove duplicate definition of tty-defined-color-alist. * src/xfaces.c (syms_of_xfaces) : Sync doc with Lisp version. * lisp/term/tty-colors.el (tty-defined-color-alist): Remove duplicate definition of C variable. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 00:58:22 +0000 +++ lisp/ChangeLog 2010-10-24 01:48:39 +0000 @@ -1,5 +1,8 @@ 2010-10-24 Glenn Morris + * term/tty-colors.el (tty-defined-color-alist): Remove duplicate + definition of C variable. + * frame.el (show-trailing-whitespace, auto-hscroll-mode) (display-hourglass, hourglass-delay, cursor-in-non-selected-windows): Don't redefine things that are defined in C. === modified file 'lisp/term/tty-colors.el' --- lisp/term/tty-colors.el 2010-01-13 08:35:10 +0000 +++ lisp/term/tty-colors.el 2010-10-24 01:48:39 +0000 @@ -1,7 +1,7 @@ ;;; tty-colors.el --- color support for character terminals -;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +;; 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Eli Zaretskii ;; Maintainer: FSF @@ -768,11 +768,6 @@ (yes . 8)) "An alist of supported standard tty color modes and their aliases.") -(defvar tty-defined-color-alist nil - "An alist of defined terminal colors and their RGB values. - -See the docstring of `tty-color-alist' for the details.") - (defun tty-color-alist (&optional frame) "Return an alist of colors supported by FRAME's terminal. FRAME defaults to the selected frame. @@ -1039,5 +1034,4 @@ (setq colors (cdr colors))) count)) -;; arch-tag: 84d5c3ef-ae22-4754-99ac-e6350c0967ae ;;; tty-colors.el ends here === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-24 01:22:37 +0000 +++ src/ChangeLog 2010-10-24 01:48:39 +0000 @@ -1,5 +1,8 @@ 2010-10-24 Glenn Morris + * xfaces.c (syms_of_xfaces) : Sync doc with + Lisp version. + * w32term.c (syms_of_w32term) : Sync doc with the xterm.c version. === modified file 'src/xfaces.c' --- src/xfaces.c 2010-08-06 10:12:41 +0000 +++ src/xfaces.c 2010-10-24 01:48:39 +0000 @@ -1,6 +1,8 @@ /* xfaces.c -- "Face" primitives. - Copyright (C) 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + +Copyright (C) 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -6731,7 +6733,8 @@ Vface_default_stipple = make_pure_c_string ("gray3"); DEFVAR_LISP ("tty-defined-color-alist", &Vtty_defined_color_alist, - doc: /* An alist of defined terminal colors and their RGB values. */); + doc: /* An alist of defined terminal colors and their RGB values. +See the docstring of `tty-color-alist' for the details. */); Vtty_defined_color_alist = Qnil; DEFVAR_LISP ("scalable-fonts-allowed", &Vscalable_fonts_allowed, @@ -6808,5 +6811,3 @@ #endif } -/* arch-tag: 8a0f7598-5517-408d-9ab3-1da6fcd4c749 - (do not change this comment) */ ------------------------------------------------------------ revno: 102069 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 18:22:37 -0700 message: Sync X and MS-Windows docs for x-use-underline-position-properties. * src/w32term.c (syms_of_w32term) : Sync doc with the xterm.c version. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-24 01:15:43 +0000 +++ src/ChangeLog 2010-10-24 01:22:37 +0000 @@ -1,5 +1,8 @@ 2010-10-24 Glenn Morris + * w32term.c (syms_of_w32term) : + Sync doc with the xterm.c version. + * w32term.c (syms_of_w32term) : * xterm.c (syms_of_xterm) : Sync docs. === modified file 'src/w32term.c' --- src/w32term.c 2010-10-24 01:15:43 +0000 +++ src/w32term.c 2010-10-24 01:22:37 +0000 @@ -6337,7 +6337,9 @@ doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties. A value of nil means ignore them. If you encounter fonts with bogus UNDERLINE_POSITION font properties, for example 7x13 on XFree prior -to 4.1, set this to nil. */); +to 4.1, set this to nil. You can also use `underline-minimum-offset' +to override the font's UNDERLINE_POSITION for small font display +sizes. */); x_use_underline_position_properties = 0; DEFVAR_BOOL ("x-underline-at-descent-line", ------------------------------------------------------------ revno: 102068 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 18:15:43 -0700 message: Sync X and MS-Windows docs of x-toolkit-scroll-bars. * src/w32term.c (syms_of_w32term) : * src/xterm.c (syms_of_xterm) : Sync docs. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-23 21:21:49 +0000 +++ src/ChangeLog 2010-10-24 01:15:43 +0000 @@ -1,3 +1,8 @@ +2010-10-24 Glenn Morris + + * w32term.c (syms_of_w32term) : + * xterm.c (syms_of_xterm) : Sync docs. + 2010-10-23 Glenn Morris * buffer.c (syms_of_buffer) : === modified file 'src/w32term.c' --- src/w32term.c 2010-10-14 14:32:27 +0000 +++ src/w32term.c 2010-10-24 01:15:43 +0000 @@ -1,7 +1,8 @@ /* Implementation of GUI terminal on the Microsoft W32 API. - Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + +Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -6348,12 +6349,14 @@ x_underline_at_descent_line = 0; DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, - doc: /* If not nil, Emacs uses toolkit scroll bars. */); + doc: /* Which toolkit scroll bars Emacs uses, if any. +A value of nil means Emacs doesn't use toolkit scroll bars. +With the X Window system, the value is a symbol describing the +X toolkit. Possible values are: gtk, motif, xaw, or xaw3d. +With MS Windows, the value is t. */); Vx_toolkit_scroll_bars = Qt; staticpro (&last_mouse_motion_frame); last_mouse_motion_frame = Qnil; } -/* arch-tag: 5fa70624-ab86-499c-8a85-473958ee4646 - (do not change this comment) */ === modified file 'src/xterm.c' --- src/xterm.c 2010-10-09 03:30:31 +0000 +++ src/xterm.c 2010-10-24 01:15:43 +0000 @@ -1,7 +1,8 @@ /* X Communication module for terminals which understand the X protocol. - Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 - Free Software Foundation, Inc. + +Copyright (C) 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -10682,9 +10683,11 @@ x_mouse_click_focus_ignore_position = 0; DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, - doc: /* What X toolkit scroll bars Emacs uses. -A value of nil means Emacs doesn't use X toolkit scroll bars. -Otherwise, value is a symbol describing the X toolkit. */); + doc: /* Which toolkit scroll bars Emacs uses, if any. +A value of nil means Emacs doesn't use toolkit scroll bars. +With the X Window system, the value is a symbol describing the +X toolkit. Possible values are: gtk, motif, xaw, or xaw3d. +With MS Windows, the value is t. */); #ifdef USE_TOOLKIT_SCROLL_BARS #ifdef USE_MOTIF Vx_toolkit_scroll_bars = intern_c_string ("motif"); @@ -10750,5 +10753,3 @@ #endif /* HAVE_X_WINDOWS */ -/* arch-tag: 6d4e4cb7-abc1-4302-9585-d84dcfb09d0f - (do not change this comment) */ ------------------------------------------------------------ revno: 102067 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 17:58:22 -0700 message: Avoid redefining some C defcustoms. * lisp/frame.el (show-trailing-whitespace, auto-hscroll-mode) (display-hourglass, hourglass-delay, cursor-in-non-selected-windows): Don't redefine things that are defined in C. * lisp/cus-start.el: Also handle :risky, :safe, :set, and :tag. (show-trailing-whitespace, auto-hscroll-mode) (display-hourglass, hourglass-delay, cursor-in-non-selected-windows): Set up the appropriate custom properties. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-24 00:21:59 +0000 +++ lisp/ChangeLog 2010-10-24 00:58:22 +0000 @@ -1,3 +1,13 @@ +2010-10-24 Glenn Morris + + * frame.el (show-trailing-whitespace, auto-hscroll-mode) + (display-hourglass, hourglass-delay, cursor-in-non-selected-windows): + Don't redefine things that are defined in C. + * cus-start.el: Also handle :risky, :safe, :set, and :tag. + (show-trailing-whitespace, auto-hscroll-mode) + (display-hourglass, hourglass-delay, cursor-in-non-selected-windows): + Set up the appropriate custom properties. + 2010-10-24 Chong Yidong Bind "C-c ]" to ... === modified file 'lisp/cus-start.el' --- lisp/cus-start.el 2010-10-11 23:57:49 +0000 +++ lisp/cus-start.el 2010-10-24 00:58:22 +0000 @@ -96,6 +96,11 @@ "21.1") (line-spacing display (choice (const :tag "none" nil) integer) "22.1") + (cursor-in-non-selected-windows + cursor boolean nil t :tag "Cursor In Non-selected Windows" + :set #'(lambda (symbol value) + (set-default symbol value) + (force-mode-line-update t))) ;; callint.c (mark-even-if-inactive editing-basics boolean) ;; callproc.c @@ -327,6 +332,8 @@ (other :tag "Always" t)) "23.1") ;; xdisp.c + (show-trailing-whitespace whitespace-faces boolean nil nil + :safe booleanp) (scroll-step windows integer) (scroll-conservatively windows integer) (scroll-margin windows integer) @@ -362,6 +369,9 @@ (const :tag "Text-image-horiz" :value text-image-horiz) (const :tag "System default" :value nil)) "23.3") (tool-bar-max-label-size frames integer "23.3") + (auto-hscroll-mode scrolling boolean "21.1") + (display-hourglass cursor boolean) + (hourglass-delay cursor number) ;; xfaces.c (scalable-fonts-allowed display boolean "22.1") @@ -379,7 +389,7 @@ (x-stretch-cursor display boolean "21.1") ;; xsettings.c (font-use-system-font font-selection boolean "23.2"))) - this symbol group type standard version native-p + this symbol group type standard version native-p rest prop propval ;; This function turns a value ;; into an expression which produces that value. (quoter (lambda (sexp) @@ -404,6 +414,7 @@ (nth 4 this) (when (default-boundp symbol) (funcall quoter (default-value symbol)))) + rest (nthcdr 5 this) ;; Don't complain about missing variables which are ;; irrelevant to this platform. native-p (save-match-data @@ -436,6 +447,11 @@ ;; Save the standard value, unless we already did. (or (get symbol 'standard-value) (put symbol 'standard-value (list standard))) + ;; We need these properties independent of whether cus-start is loaded. + (if (setq prop (memq :safe rest)) + (put symbol 'safe-local-variable (cadr prop))) + (if (setq prop (memq :risky rest)) + (put symbol 'risky-local-variable (cadr prop))) ;; If this is NOT while dumping Emacs, ;; set up the rest of the customization info. (unless purify-flag @@ -443,18 +459,25 @@ (custom-add-to-group group symbol 'custom-variable) ;; Set the type. (put symbol 'custom-type type) - (put symbol 'custom-version version))))) + (put symbol 'custom-version version) + (while rest + (setq prop (car rest) + propval (cadr rest) + rest (nthcdr 2 rest)) + (cond ((memq prop '(:risky :safe))) ; handled above + ((eq prop :set) + (put symbol 'custom-set propval)) + ((eq prop :tag) + (put symbol 'custom-tag propval)))))))) (custom-add-to-group 'iswitchb 'read-buffer-function 'custom-variable) (custom-add-to-group 'font-lock 'open-paren-in-column-0-is-defun-start 'custom-variable) -;; Record cus-start as loaded -;; if we have set up all the info that we can set up. -;; Don't record cus-start as loaded -;; if we have set up only the standard values. +;; Record cus-start as loaded if we have set up all the info that we can. +;; Don't record it as loaded if we have only set up the standard values +;; and safe/risky properties. (unless purify-flag (provide 'cus-start)) -;; arch-tag: 4502730d-bcb3-4f5e-99a3-a86f2d54af60 ;;; cus-start.el ends here === modified file 'lisp/frame.el' --- lisp/frame.el 2010-10-23 21:13:39 +0000 +++ lisp/frame.el 2010-10-24 00:58:22 +0000 @@ -1467,14 +1467,6 @@ (make-variable-buffer-local 'show-trailing-whitespace) -(defcustom show-trailing-whitespace nil - "Non-nil means highlight trailing whitespace. -This is done in the face `trailing-whitespace'." - :type 'boolean - :safe 'booleanp - :group 'whitespace-faces) - - ;; Scrolling @@ -1483,13 +1475,6 @@ :version "21.1" :group 'frames) -(defcustom auto-hscroll-mode t - "Allow or disallow automatic horizontal scrolling of windows. -If non-nil, windows are automatically scrolled horizontally to make -point visible." - :version "21.1" - :type 'boolean - :group 'scrolling) (defvaralias 'automatic-hscrolling 'auto-hscroll-mode) @@ -1576,35 +1561,6 @@ 'blink-cursor-start)))) (define-obsolete-variable-alias 'blink-cursor 'blink-cursor-mode "22.1") - -;; Hourglass pointer - -(defcustom display-hourglass t - "Non-nil means show an hourglass pointer, when Emacs is busy. -This feature only works when on a window system that can change -cursor shapes." - :type 'boolean - :group 'cursor) - -(defcustom hourglass-delay 1 - "Seconds to wait before displaying an hourglass pointer when Emacs is busy." - :type 'number - :group 'cursor) - - -(defcustom cursor-in-non-selected-windows t - "Non-nil means show a cursor in non-selected windows. -If nil, only shows a cursor in the selected window. -If t, displays a cursor related to the usual cursor type -\(a solid box becomes hollow, a bar becomes a narrower bar). -You can also specify the cursor type as in the `cursor-type' variable. -Use Custom to set this variable and update the display." - :tag "Cursor In Non-selected Windows" - :type 'boolean - :group 'cursor - :set #'(lambda (symbol value) - (set-default symbol value) - (force-mode-line-update t))) ;;;; Key bindings ------------------------------------------------------------ revno: 102066 author: Lars Magne Ingebrigtsen committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2010-10-24 00:29:21 +0000 message: gnus-group.el (gnus-group-completing-read): Remove all newlines from group names. They mess up the group buffer badly. shr.el (shr-tag-strong): Added. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-10-23 00:01:49 +0000 +++ lisp/gnus/ChangeLog 2010-10-24 00:29:21 +0000 @@ -1,5 +1,12 @@ +2010-10-23 Lars Magne Ingebrigtsen + + * shr.el (shr-tag-strong): Added. + 2010-10-22 Lars Magne Ingebrigtsen + * gnus-group.el (gnus-group-completing-read): Remove all newlines from + group names. They mess up the group buffer badly. + * shr.el (shr-tag-img): Don't bug out on images that don't have a SRC. * gnus-group.el (gnus-group-mark-group): Use gnus-group-position-point === modified file 'lisp/gnus/gnus-group.el' --- lisp/gnus/gnus-group.el 2010-10-23 00:01:49 +0000 +++ lisp/gnus/gnus-group.el 2010-10-24 00:29:21 +0000 @@ -2189,11 +2189,13 @@ require-match initial-input (or hist 'gnus-group-history) def)) - (if (if (listp collection) - (member group (mapcar 'symbol-name collection)) - (symbol-value (intern-soft group collection))) - group - (mm-encode-coding-string group (gnus-group-name-charset nil group))))) + (unless (if (listp collection) + (member group (mapcar 'symbol-name collection)) + (symbol-value (intern-soft group collection))) + (setq group + (mm-encode-coding-string + group (gnus-group-name-charset nil group)))) + (replace-regexp-in-string "\n" "" group))) ;;;###autoload (defun gnus-fetch-group (group &optional articles) === modified file 'lisp/gnus/shr.el' --- lisp/gnus/shr.el 2010-10-23 00:01:49 +0000 +++ lisp/gnus/shr.el 2010-10-24 00:29:21 +0000 @@ -441,6 +441,9 @@ (defun shr-tag-em (cont) (shr-fontize-cont cont 'bold)) +(defun shr-tag-strong (cont) + (shr-fontize-cont cont 'bold)) + (defun shr-tag-u (cont) (shr-fontize-cont cont 'underline)) ------------------------------------------------------------ revno: 102065 committer: Chong Yidong branch nick: trunk timestamp: Sat 2010-10-23 20:21:59 -0400 message: Bind "C-c ]" to block-closing commands in several modes. Bind "C-c ]" to ... * progmodes/f90.el (f90-mode-map): ... f90-insert-end. * nxml/nxml-mode.el (nxml-mode-map): ... nxml-finish-element. * textmodes/tex-mode.el (tex-mode-map): ... latex-close-block. * textmodes/sgml-mode.el (sgml-mode-map): ... sgml-close-tag. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-23 21:58:18 +0000 +++ lisp/ChangeLog 2010-10-24 00:21:59 +0000 @@ -1,3 +1,11 @@ +2010-10-24 Chong Yidong + + Bind "C-c ]" to ... + * progmodes/f90.el (f90-mode-map): ... f90-insert-end. + * nxml/nxml-mode.el (nxml-mode-map): ... nxml-finish-element. + * textmodes/tex-mode.el (tex-mode-map): ... latex-close-block. + * textmodes/sgml-mode.el (sgml-mode-map): ... sgml-close-tag. + 2010-10-23 Glenn Morris * textmodes/flyspell.el (flyspell-mode): If there was an error, === modified file 'lisp/nxml/nxml-mode.el' --- lisp/nxml/nxml-mode.el 2010-06-14 01:43:11 +0000 +++ lisp/nxml/nxml-mode.el 2010-10-24 00:21:59 +0000 @@ -404,6 +404,7 @@ (define-key map "\M-}" 'nxml-forward-paragraph) (define-key map "\M-h" 'nxml-mark-paragraph) (define-key map "\C-c\C-f" 'nxml-finish-element) + (define-key map "\C-c]" 'nxml-finish-element) (define-key map "\C-c/" 'nxml-finish-element) (define-key map "\C-c\C-m" 'nxml-split-element) (define-key map "\C-c\C-b" 'nxml-balanced-close-start-tag-block) === modified file 'lisp/progmodes/f90.el' --- lisp/progmodes/f90.el 2010-05-21 01:13:57 +0000 +++ lisp/progmodes/f90.el 2010-10-24 00:21:59 +0000 @@ -657,6 +657,7 @@ (define-key map "\C-c\C-f" 'f90-fill-region) (define-key map "\C-c\C-p" 'f90-previous-statement) (define-key map "\C-c\C-n" 'f90-next-statement) + (define-key map "\C-c]" 'f90-insert-end) (define-key map "\C-c\C-w" 'f90-insert-end) ;; Standard tab binding will call this, and also handle regions. ;;; (define-key map "\t" 'f90-indent-line) === modified file 'lisp/textmodes/sgml-mode.el' --- lisp/textmodes/sgml-mode.el 2010-09-10 23:13:42 +0000 +++ lisp/textmodes/sgml-mode.el 2010-10-24 00:21:59 +0000 @@ -100,6 +100,7 @@ (define-key map "\C-c\C-d" 'sgml-delete-tag) (define-key map "\C-c\^?" 'sgml-delete-tag) (define-key map "\C-c?" 'sgml-tag-help) + (define-key map "\C-c]" 'sgml-close-tag) (define-key map "\C-c/" 'sgml-close-tag) ;; Redundant keybindings, for consistency with TeX mode. === modified file 'lisp/textmodes/tex-mode.el' --- lisp/textmodes/tex-mode.el 2010-09-23 06:42:45 +0000 +++ lisp/textmodes/tex-mode.el 2010-10-24 00:21:59 +0000 @@ -864,6 +864,7 @@ ;; Redundant keybindings, for consistency with SGML mode. (define-key map "\C-c\C-t" 'latex-insert-block) + (define-key map "\C-c]" 'latex-close-block) (define-key map "\C-c/" 'latex-close-block) (define-key map "\C-c\C-e" 'latex-close-block) ------------------------------------------------------------ revno: 102064 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 14:58:18 -0700 message: * lisp/textmodes/flyspell.el (flyspell-mode): If there was an error, say what it was. Otherwise someone is going to report the same meaningless bug for the rest of time. http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5574 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5576 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7272 diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-23 21:13:39 +0000 +++ lisp/ChangeLog 2010-10-23 21:58:18 +0000 @@ -1,5 +1,8 @@ 2010-10-23 Glenn Morris + * textmodes/flyspell.el (flyspell-mode): If there was an error, + say what it was. + * frame.el (auto-hscroll-mode, cursor-in-non-selected-windows): Sync docs with C version. === modified file 'lisp/textmodes/flyspell.el' --- lisp/textmodes/flyspell.el 2010-08-24 20:58:07 +0000 +++ lisp/textmodes/flyspell.el 2010-10-23 21:58:18 +0000 @@ -494,9 +494,9 @@ :keymap flyspell-mode-map :group 'flyspell (if flyspell-mode - (condition-case () + (condition-case err (flyspell-mode-on) - (error (message "Enabling Flyspell mode gave an error") + (error (message "Error enabling Flyspell mode:\n%s" (cdr err)) (flyspell-mode -1))) (flyspell-mode-off))) @@ -2354,5 +2354,4 @@ (provide 'flyspell) -;; arch-tag: 05d915b9-e9cf-44fb-9137-fc28f5eaab2a ;;; flyspell.el ends here ------------------------------------------------------------ revno: 102063 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 14:21:49 -0700 message: * src/frame.c (syms_of_frame) : Sync doc with Lisp. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-23 21:19:02 +0000 +++ src/ChangeLog 2010-10-23 21:21:49 +0000 @@ -1,6 +1,7 @@ 2010-10-23 Glenn Morris * buffer.c (syms_of_buffer) : + * frame.c (syms_of_frame) : * xdisp.c (syms_of_xdisp) : : Sync docs with Lisp. === modified file 'src/frame.c' --- src/frame.c 2010-10-18 21:07:31 +0000 +++ src/frame.c 2010-10-23 21:21:49 +0000 @@ -1,6 +1,8 @@ /* Generic frame functions. - Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + +Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, + 2004, 2005, 2006, 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -4552,7 +4554,11 @@ staticpro (&Qdelete_frame_functions); DEFVAR_LISP ("menu-bar-mode", &Vmenu_bar_mode, - doc: /* Non-nil if Menu-Bar mode is enabled. */); + doc: /* Non-nil if Menu-Bar mode is enabled. +See the command `menu-bar-mode' for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `menu-bar-mode'. */); Vmenu_bar_mode = Qt; DEFVAR_LISP ("tool-bar-mode", &Vtool_bar_mode, @@ -4646,5 +4652,3 @@ } -/* arch-tag: 7dbf2c69-9aad-45f8-8296-db893d6dd039 - (do not change this comment) */ ------------------------------------------------------------ revno: 102062 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 14:19:02 -0700 message: * src/xdisp.c (syms_of_xdisp) : Sync doc with Lisp. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-23 21:16:39 +0000 +++ src/ChangeLog 2010-10-23 21:19:02 +0000 @@ -2,7 +2,7 @@ * buffer.c (syms_of_buffer) : * xdisp.c (syms_of_xdisp) : - Sync docs with Lisp. + : Sync docs with Lisp. 2010-10-23 Eli Zaretskii === modified file 'src/xdisp.c' --- src/xdisp.c 2010-10-23 21:16:39 +0000 +++ src/xdisp.c 2010-10-23 21:19:02 +0000 @@ -26587,8 +26587,7 @@ display_hourglass_p = 1; DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay, - doc: /* *Seconds to wait before displaying an hourglass pointer. -Value must be an integer or float. */); + doc: /* *Seconds to wait before displaying an hourglass pointer when Emacs is busy. */); Vhourglass_delay = make_number (DEFAULT_HOURGLASS_DELAY); hourglass_atimer = NULL; ------------------------------------------------------------ revno: 102061 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 14:16:39 -0700 message: * src/xdisp.c (syms_of_xdisp) : Sync doc with Lisp. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-23 21:13:39 +0000 +++ src/ChangeLog 2010-10-23 21:16:39 +0000 @@ -1,7 +1,8 @@ 2010-10-23 Glenn Morris * buffer.c (syms_of_buffer) : - * xdisp.c (syms_of_xdisp) : Sync docs with Lisp. + * xdisp.c (syms_of_xdisp) : + Sync docs with Lisp. 2010-10-23 Eli Zaretskii === modified file 'src/xdisp.c' --- src/xdisp.c 2010-10-23 21:02:44 +0000 +++ src/xdisp.c 2010-10-23 21:16:39 +0000 @@ -26581,7 +26581,9 @@ underline_minimum_offset = 1; DEFVAR_BOOL ("display-hourglass", &display_hourglass_p, - doc: /* Non-zero means Emacs displays an hourglass pointer on window systems. */); + doc: /* Non-nil means show an hourglass pointer, when Emacs is busy. +This feature only works when on a window system that can change +cursor shapes. */); display_hourglass_p = 1; DEFVAR_LISP ("hourglass-delay", &Vhourglass_delay, ------------------------------------------------------------ revno: 102060 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 14:13:39 -0700 message: Sync docs of cursor-in-non-selected-windows between Lisp and C. * lisp/frame.el (cursor-in-non-selected-windows): Sync doc with C version. * src/buffer.c (syms_of_buffer) : Sync doc with Lisp version. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-23 21:02:44 +0000 +++ lisp/ChangeLog 2010-10-23 21:13:39 +0000 @@ -1,6 +1,7 @@ 2010-10-23 Glenn Morris - * frame.el (auto-hscroll-mode): Sync doc with C version. + * frame.el (auto-hscroll-mode, cursor-in-non-selected-windows): + Sync docs with C version. * term/ns-win.el (xw-defined-colors): * term/x-win.el (xw-defined-colors): Make docs identical to w32-win. === modified file 'lisp/frame.el' --- lisp/frame.el 2010-10-23 21:02:44 +0000 +++ lisp/frame.el 2010-10-23 21:13:39 +0000 @@ -1593,12 +1593,12 @@ (defcustom cursor-in-non-selected-windows t - "Non-nil means show a hollow box cursor in non-selected windows. -If nil, don't show a cursor except in the selected window. -If t, display a cursor related to the usual cursor type - \(a solid box becomes hollow, a bar becomes a narrower bar). + "Non-nil means show a cursor in non-selected windows. +If nil, only shows a cursor in the selected window. +If t, displays a cursor related to the usual cursor type +\(a solid box becomes hollow, a bar becomes a narrower bar). You can also specify the cursor type as in the `cursor-type' variable. -Use Custom to set this variable to get the display updated." +Use Custom to set this variable and update the display." :tag "Cursor In Non-selected Windows" :type 'boolean :group 'cursor === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-23 21:02:44 +0000 +++ src/ChangeLog 2010-10-23 21:13:39 +0000 @@ -1,6 +1,7 @@ 2010-10-23 Glenn Morris - * xdisp.c (syms_of_xdisp) : Sync doc with Lisp. + * buffer.c (syms_of_buffer) : + * xdisp.c (syms_of_xdisp) : Sync docs with Lisp. 2010-10-23 Eli Zaretskii === modified file 'src/buffer.c' --- src/buffer.c 2010-10-08 10:14:47 +0000 +++ src/buffer.c 2010-10-23 21:13:39 +0000 @@ -1,8 +1,8 @@ /* Buffer manipulation primitives for GNU Emacs. - Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, - 1995, 1997, 1998, 1999, 2000, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 - Free Software Foundation, Inc. + +Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995, 1997, + 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -6140,8 +6140,12 @@ DEFVAR_PER_BUFFER ("cursor-in-non-selected-windows", ¤t_buffer->cursor_in_non_selected_windows, Qnil, - doc: /* *Cursor type to display in non-selected windows. -The value t means to use hollow box cursor. See `cursor-type' for other values. */); + doc: /* *Non-nil means show a cursor in non-selected windows. +If nil, only shows a cursor in the selected window. +If t, displays a cursor related to the usual cursor type +\(a solid box becomes hollow, a bar becomes a narrower bar). +You can also specify the cursor type as in the `cursor-type' variable. +Use Custom to set this variable and update the display." */); DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions, doc: /* List of functions called with no args to query before killing a buffer. @@ -6218,5 +6222,3 @@ Fput (intern_c_string ("erase-buffer"), Qdisabled, Qt); } -/* arch-tag: e48569bf-69a9-4b65-a23b-8e68769436e1 - (do not change this comment) */ ------------------------------------------------------------ revno: 102059 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 14:02:44 -0700 message: Sync docs of C and Lisp version of auto-hscroll-mode. * lisp/frame.el (auto-hscroll-mode): Sync doc with C version. * src/xdisp.c (syms_of_xdisp) : Sync doc with Lisp. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-23 20:43:59 +0000 +++ lisp/ChangeLog 2010-10-23 21:02:44 +0000 @@ -1,5 +1,7 @@ 2010-10-23 Glenn Morris + * frame.el (auto-hscroll-mode): Sync doc with C version. + * term/ns-win.el (xw-defined-colors): * term/x-win.el (xw-defined-colors): Make docs identical to w32-win. === modified file 'lisp/frame.el' --- lisp/frame.el 2010-09-19 09:53:28 +0000 +++ lisp/frame.el 2010-10-23 21:02:44 +0000 @@ -1,7 +1,8 @@ ;;; frame.el --- multi-frame management independent of window systems ;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2002, 2003, -;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: internal @@ -1483,7 +1484,7 @@ :group 'frames) (defcustom auto-hscroll-mode t - "Allow or disallow automatic scrolling windows horizontally. + "Allow or disallow automatic horizontal scrolling of windows. If non-nil, windows are automatically scrolled horizontally to make point visible." :version "21.1" @@ -1615,5 +1616,4 @@ (provide 'frame) -;; arch-tag: 82979c70-b8f2-4306-b2ad-ddbd6b328b56 ;;; frame.el ends here === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-23 17:33:03 +0000 +++ src/ChangeLog 2010-10-23 21:02:44 +0000 @@ -1,3 +1,7 @@ +2010-10-23 Glenn Morris + + * xdisp.c (syms_of_xdisp) : Sync doc with Lisp. + 2010-10-23 Eli Zaretskii Implement mouse highlight for bidi-reordered lines. @@ -28278,10 +28282,10 @@ ;; Local Variables: ;; coding: utf-8 -;; add-log-time-zone-rule: t ;; End: - Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2007, 2008, 2009, 2010 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -28298,4 +28302,3 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . -;; arch-tag: dfb6ad96-1550-4905-9e53-d2059ee84c40 === modified file 'src/xdisp.c' --- src/xdisp.c 2010-10-23 15:30:45 +0000 +++ src/xdisp.c 2010-10-23 21:02:44 +0000 @@ -1,8 +1,8 @@ /* Display generation from window structure and buffer text. - Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, - 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009, 2010 - Free Software Foundation, Inc. + +Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997, 1998, + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -26464,7 +26464,9 @@ Vblink_cursor_alist = Qnil; DEFVAR_BOOL ("auto-hscroll-mode", &automatic_hscrolling_p, - doc: /* *Non-nil means scroll the display automatically to make point visible. */); + doc: /* Allow or disallow automatic horizontal scrolling of windows. +If non-nil, windows are automatically scrolled horizontally to make +point visible. */); automatic_hscrolling_p = 1; Qauto_hscroll_mode = intern_c_string ("auto-hscroll-mode"); staticpro (&Qauto_hscroll_mode); @@ -26706,5 +26708,3 @@ } #endif /* ! WINDOWSNT */ -/* arch-tag: eacc864d-bb6a-4b74-894a-1a4399a1358b - (do not change this comment) */ ------------------------------------------------------------ revno: 102058 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 13:43:59 -0700 message: Make all copies of xw-defined-colors have identical docs. * lisp/term/ns-win.el (xw-defined-colors): * lisp/term/x-win.el (xw-defined-colors): Make docs identical to w32-win. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-23 20:40:46 +0000 +++ lisp/ChangeLog 2010-10-23 20:43:59 +0000 @@ -1,5 +1,8 @@ 2010-10-23 Glenn Morris + * term/ns-win.el (xw-defined-colors): + * term/x-win.el (xw-defined-colors): Make docs identical to w32-win. + * term/pc-win.el (x-select-enable-clipboard): * term/x-win.el (x-select-enable-clipboard): * w32-vars.el (x-select-enable-clipboard): Make doc-strings identical. === modified file 'lisp/term/ns-win.el' --- lisp/term/ns-win.el 2010-10-11 23:57:49 +0000 +++ lisp/term/ns-win.el 2010-10-23 20:43:59 +0000 @@ -1138,7 +1138,7 @@ the operating system.") (defun xw-defined-colors (&optional frame) - "Internal function called by `defined-colors'." + "Internal function called by `defined-colors', which see." (or frame (setq frame (selected-frame))) (let ((all-colors x-colors) (this-color nil) @@ -1263,5 +1263,4 @@ (provide 'ns-win) -;; arch-tag: eb138a45-4e2e-4d68-b1c9-a39665731644 ;;; ns-win.el ends here === modified file 'lisp/term/x-win.el' --- lisp/term/x-win.el 2010-10-23 20:40:46 +0000 +++ lisp/term/x-win.el 2010-10-23 20:43:59 +0000 @@ -255,7 +255,7 @@ (defvar x-colors) (defun xw-defined-colors (&optional frame) - "Internal function called by `defined-colors'." + "Internal function called by `defined-colors', which see." (or frame (setq frame (selected-frame))) (let ((all-colors x-colors) (this-color nil) ------------------------------------------------------------ revno: 102057 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 13:40:46 -0700 message: Make all 3 copies of x-select-enable-clipboard have the same doc. * lisp/term/pc-win.el (x-select-enable-clipboard): * lisp/term/x-win.el (x-select-enable-clipboard): * lisp/w32-vars.el (x-select-enable-clipboard): Make doc-strings identical. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-23 19:56:57 +0000 +++ lisp/ChangeLog 2010-10-23 20:40:46 +0000 @@ -1,5 +1,9 @@ 2010-10-23 Glenn Morris + * term/pc-win.el (x-select-enable-clipboard): + * term/x-win.el (x-select-enable-clipboard): + * w32-vars.el (x-select-enable-clipboard): Make doc-strings identical. + * comint.el (comint-password-prompt-regexp): Make it less vague. Bump version. === modified file 'lisp/term/pc-win.el' --- lisp/term/pc-win.el 2010-10-02 02:46:13 +0000 +++ lisp/term/pc-win.el 2010-10-23 20:40:46 +0000 @@ -1,7 +1,7 @@ ;;; pc-win.el --- setup support for `PC windows' (whatever that is) -;; Copyright (C) 1994, 1996, 1997, 1999, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1994, 1996, 1997, 1999, 2001, 2002, 2003, 2004, 2005, +;; 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Morten Welinder ;; Maintainer: FSF @@ -203,9 +203,9 @@ "Non-nil means cutting and pasting uses the clipboard. This is in addition to, but in preference to, the primary selection. -On MS-Windows, this is non-nil by default, since Windows does not -support other types of selections. \(The primary selection that is -set by Emacs is not accessible to other programs on Windows.\)" +Note that MS-Windows does not support selection types other than the +clipboard. \(The primary selection that is set by Emacs is not +accessible to other programs on MS-Windows.\)" :type 'boolean :group 'killing) @@ -408,5 +408,4 @@ (provide 'pc-win) -;; arch-tag: 5cbdb455-b495-427b-95d0-e417d77d00b4 ;;; pc-win.el ends here === modified file 'lisp/term/x-win.el' --- lisp/term/x-win.el 2010-09-16 22:47:21 +0000 +++ lisp/term/x-win.el 2010-10-23 20:40:46 +0000 @@ -1208,7 +1208,11 @@ (defcustom x-select-enable-clipboard t "Non-nil means cutting and pasting uses the clipboard. -This is in addition to, but in preference to, the primary selection." +This is in addition to, but in preference to, the primary selection. + +Note that MS-Windows does not support selection types other than the +clipboard. \(The primary selection that is set by Emacs is not +accessible to other programs on MS-Windows.\)" :type 'boolean :group 'killing :version "24.1") @@ -1640,5 +1644,4 @@ (provide 'x-win) -;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78 ;;; x-win.el ends here === modified file 'lisp/w32-vars.el' --- lisp/w32-vars.el 2010-08-29 16:17:13 +0000 +++ lisp/w32-vars.el 2010-10-23 20:40:46 +0000 @@ -152,13 +152,12 @@ "Non-nil means cutting and pasting uses the clipboard. This is in addition to, but in preference to, the primary selection. -On MS-Windows, this is non-nil by default, since Windows does not -support other types of selections. \(The primary selection that is -set by Emacs is not accessible to other programs on Windows.\)" +Note that MS-Windows does not support selection types other than the +clipboard. \(The primary selection that is set by Emacs is not +accessible to other programs on MS-Windows.\)" :type 'boolean :group 'killing) (provide 'w32-vars) -;; arch-tag: ee2394fb-9db7-4c15-a8f0-66b47f4a2bb1 ;;; w32-vars.el ends here ------------------------------------------------------------ revno: 102056 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 12:56:57 -0700 message: * lisp/comint.el (comint-password-prompt-regexp): Make it less vague. Bump custom version. The initial regexp-opt was bracketed by \\( \\)?, so it might as well have not been there at all. This change makes it non-optional, and adds back "^". Hopefully the behaviour is now closer to that of emacs-23, before it was re-written in http://debbugs.gnu.org/2817. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-23 02:46:06 +0000 +++ lisp/ChangeLog 2010-10-23 19:56:57 +0000 @@ -1,5 +1,8 @@ 2010-10-23 Glenn Morris + * comint.el (comint-password-prompt-regexp): Make it less vague. + Bump version. + * help-fns.el (doc-file-to-man, doc-file-to-info): New commands. * help.el (finder-by-keyword): Remove unnecessary autoload. === modified file 'lisp/comint.el' --- lisp/comint.el 2010-10-02 02:46:13 +0000 +++ lisp/comint.el 2010-10-23 19:56:57 +0000 @@ -339,13 +339,15 @@ ;; Ubuntu's sudo prompts like `[sudo] password for user:' ;; Some implementations of passwd use "Password (again)" as the 2nd prompt. ;; Something called "perforce" uses "Enter password:". +;; See M-x comint-testsuite--test-comint-password-prompt-regexp. (defcustom comint-password-prompt-regexp (concat - "\\(" + "\\(^ *\\|" (regexp-opt - '("Enter" "Enter same" "Old" "old" "New" "new" "'s" "login" - "Kerberos" "CVS" "UNIX" " SMB" "LDAP" "[sudo]" "Repeat" "Bad")) - " +\\)?" + '("Enter" "enter" "Enter same" "enter same" "Enter the" "enter the" + "Old" "old" "New" "new" "'s" "login" + "Kerberos" "CVS" "UNIX" " SMB" "LDAP" "[sudo]" "Repeat" "Bad") t) + " +\\)" (regexp-opt '("password" "Password" "passphrase" "Passphrase" "pass phrase" "Pass phrase")) @@ -353,6 +355,7 @@ \\(?: for [^:]+\\)?:\\s *\\'") "Regexp matching prompts for passwords in the inferior process. This is used by `comint-watch-for-password-prompt'." + :version "24.1" :type 'regexp :group 'comint) @@ -3748,5 +3751,4 @@ (provide 'comint) -;; arch-tag: 1793314c-09db-40be-9549-9aeae3e75164 ;;; comint.el ends here ------------------------------------------------------------ revno: 102055 committer: Glenn Morris branch nick: trunk timestamp: Sat 2010-10-23 12:51:14 -0700 message: * test/comint-testsuite.el (comint-testsuite--test-comint-password-prompt-regexp): Add "Please enter the password". (Bug#7224) diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2010-09-20 14:57:01 +0000 +++ test/ChangeLog 2010-10-23 19:51:14 +0000 @@ -1,3 +1,9 @@ +2010-10-23 Glenn Morris + + * comint-testsuite.el + (comint-testsuite--test-comint-password-prompt-regexp): Add + "Please enter the password". (Bug#7224) + 2010-09-20 Stefan Monnier * indent/prolog.prolog: Use normal spacing around !. === modified file 'test/comint-testsuite.el' --- test/comint-testsuite.el 2010-06-11 14:39:54 +0000 +++ test/comint-testsuite.el 2010-10-23 19:51:14 +0000 @@ -34,7 +34,8 @@ (interactive) (let ((password-strings '("foo@example.net's password: " ;ssh - "Password for foo@example.org: " ; knit + "Password for foo@example.org: " ; kinit + "Please enter the password for foo@example.org: " ; kinit "Kerberos password for devnull/root GNU.ORG: " ; ksu "Enter passphrase: " ; ssh-add "Enter passphrase (empty for no passphrase): " ; ssh-keygen ------------------------------------------------------------ revno: 102054 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2010-10-23 19:33:03 +0200 message: src/ChangeLog: Revert inadvertent change of entry date. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-23 15:30:45 +0000 +++ src/ChangeLog 2010-10-23 17:33:03 +0000 @@ -1561,7 +1561,7 @@ non-MSDOS, non-WINDOWSNT code, it's only defined for such systems anyway. -2010-08-20 Eli Zaretskii +2010-08-21 Eli Zaretskii * dispnew.c (buffer_posn_from_coords): Fix off-by-one error in mirroring pixel positions. ------------------------------------------------------------ revno: 102053 [merge] committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2010-10-23 17:30:45 +0200 message: Implement mouse highlight for bidi-reordered lines. xdisp.c (fast_find_string_pos): #ifdef away, not used anymore. (mouse_face_from_string_pos): New function, replaces fast_find_string_pos. (note_mouse_highlight): Call it instead of fast_find_string_pos. (note_mode_line_or_margin_highlight): Support bidi-reordered strings and R2L glyph rows. Fix comments. (note_mouse_highlight): When bidi reordering is turned on in a buffer, call next-single-property-change and previous-single-property-change with last argument nil. Clear mouse highlight when mouse pointer is in a R2L row on the stretch glyph that stands for no text beyond the line end. (row_containing_pos): Don't return too early when CHARPOS is in a bidi-reordered continued line. Return immediately when the first hit is found in a line that is not continued, or when an exact match for CHARPOS is found. (rows_from_pos_range): New function. (mouse_face_from_buffer_pos): Use it instead of calling row_containing_pos for START_CHARPOS and END_CHARPOS. Rewrite the function to support mouse highlight in bidi-reordered lines and not to assume that START_CHARPOS is always in mouse_face_beg_row. If necessary, swap mouse_face_beg_row and mouse_face_end_row so that the former is always above the latter or identical to it. (show_mouse_face): Support drawing highlighted R2L lines. (coords_in_mouse_face_p): New function, bidi-aware. (cursor_in_mouse_face_p, note_mouse_highlight, erase_phys_cursor): Call it instead of comparing with mouse-face members of dpyinfo. (note_mode_line_or_margin_highlight): Fix confusingly swapped usage of hpos and vpos. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-10-22 05:49:47 +0000 +++ src/ChangeLog 2010-10-23 15:30:45 +0000 @@ -1,3 +1,36 @@ +2010-10-23 Eli Zaretskii + + Implement mouse highlight for bidi-reordered lines. + + * xdisp.c (fast_find_string_pos): #ifdef away, not used anymore. + (mouse_face_from_string_pos): New function, replaces + fast_find_string_pos. + (note_mouse_highlight): Call it instead of fast_find_string_pos. + (note_mode_line_or_margin_highlight): Support bidi-reordered + strings and R2L glyph rows. Fix comments. + (note_mouse_highlight): When bidi reordering is turned on in a + buffer, call next-single-property-change and + previous-single-property-change with last argument nil. Clear + mouse highlight when mouse pointer is in a R2L row on the stretch + glyph that stands for no text beyond the line end. + (row_containing_pos): Don't return too early when CHARPOS is in a + bidi-reordered continued line. Return immediately when the first + hit is found in a line that is not continued, or when an exact + match for CHARPOS is found. + (rows_from_pos_range): New function. + (mouse_face_from_buffer_pos): Use it instead of calling + row_containing_pos for START_CHARPOS and END_CHARPOS. Rewrite the + function to support mouse highlight in bidi-reordered lines and + not to assume that START_CHARPOS is always in mouse_face_beg_row. + If necessary, swap mouse_face_beg_row and mouse_face_end_row so + that the former is always above the latter or identical to it. + (show_mouse_face): Support drawing highlighted R2L lines. + (coords_in_mouse_face_p): New function, bidi-aware. + (cursor_in_mouse_face_p, note_mouse_highlight, erase_phys_cursor): + Call it instead of comparing with mouse-face members of dpyinfo. + (note_mode_line_or_margin_highlight): Fix confusingly swapped + usage of hpos and vpos. + 2010-10-22 Jan Djärv * xrdb.c: Include keyboard.h for MOTIF. @@ -1528,7 +1561,7 @@ non-MSDOS, non-WINDOWSNT code, it's only defined for such systems anyway. -2010-08-21 Eli Zaretskii +2010-08-20 Eli Zaretskii * dispnew.c (buffer_posn_from_coords): Fix off-by-one error in mirroring pixel positions. === modified file 'src/xdisp.c' --- src/xdisp.c 2010-10-01 17:38:36 +0000 +++ src/xdisp.c 2010-10-23 15:30:45 +0000 @@ -1085,6 +1085,7 @@ int, int, int, int); static void append_stretch_glyph (struct it *, Lisp_Object, int, int, int); +static int coords_in_mouse_face_p (struct window *, int, int); @@ -15333,10 +15334,12 @@ { struct glyph *g; - if (NILP (XBUFFER (w->buffer)->bidi_display_reordering)) + if (NILP (XBUFFER (w->buffer)->bidi_display_reordering) + || (!best_row && !row->continued_p)) return row; /* In bidi-reordered rows, there could be several rows - occluding point. We need to find the one which fits + occluding point, all of them belonging to the same + continued line. We need to find the row which fits CHARPOS the best. */ for (g = row->glyphs[TEXT_AREA]; g < row->glyphs[TEXT_AREA] + row->used[TEXT_AREA]; @@ -15348,11 +15351,14 @@ { mindif = eabs (g->charpos - charpos); best_row = row; + /* Exact match always wins. */ + if (mindif == 0) + return best_row; } } } } - else if (best_row) + else if (best_row && !row->continued_p) return best_row; ++row; } @@ -23411,13 +23417,7 @@ /* If the cursor is in the mouse face area, redisplay that when we clear the cursor. */ if (! NILP (dpyinfo->mouse_face_window) - && w == XWINDOW (dpyinfo->mouse_face_window) - && (vpos > dpyinfo->mouse_face_beg_row - || (vpos == dpyinfo->mouse_face_beg_row - && hpos >= dpyinfo->mouse_face_beg_col)) - && (vpos < dpyinfo->mouse_face_end_row - || (vpos == dpyinfo->mouse_face_end_row - && hpos < dpyinfo->mouse_face_end_col)) + && coords_in_mouse_face_p (w, hpos, vpos) /* Don't redraw the cursor's spot in mouse face if it is at the end of a line (on a newline). The cursor appears there, but mouse highlighting does not. */ @@ -23640,8 +23640,30 @@ /* For all but the first row, the highlight starts at column 0. */ if (row == first) { - start_hpos = dpyinfo->mouse_face_beg_col; - start_x = dpyinfo->mouse_face_beg_x; + /* R2L rows have BEG and END in reversed order, but the + screen drawing geometry is always left to right. So + we need to mirror the beginning and end of the + highlighted area in R2L rows. */ + if (!row->reversed_p) + { + start_hpos = dpyinfo->mouse_face_beg_col; + start_x = dpyinfo->mouse_face_beg_x; + } + else if (row == last) + { + start_hpos = dpyinfo->mouse_face_end_col; + start_x = dpyinfo->mouse_face_end_x; + } + else + { + start_hpos = 0; + start_x = 0; + } + } + else if (row->reversed_p && row == last) + { + start_hpos = dpyinfo->mouse_face_end_col; + start_x = dpyinfo->mouse_face_end_x; } else { @@ -23650,7 +23672,20 @@ } if (row == last) - end_hpos = dpyinfo->mouse_face_end_col; + { + if (!row->reversed_p) + end_hpos = dpyinfo->mouse_face_end_col; + else if (row == first) + end_hpos = dpyinfo->mouse_face_beg_col; + else + { + end_hpos = row->used[TEXT_AREA]; + if (draw == DRAW_NORMAL_TEXT) + row->fill_line_p = 1; /* Clear to end of line */ + } + } + else if (row->reversed_p && row == first) + end_hpos = dpyinfo->mouse_face_beg_col; else { end_hpos = row->used[TEXT_AREA]; @@ -23713,6 +23748,53 @@ return cleared; } +/* Return non-zero if the coordinates HPOS and VPOS on windows W are + within the mouse face on that window. */ +static int +coords_in_mouse_face_p (struct window *w, int hpos, int vpos) +{ + Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame)); + + /* Quickly resolve the easy cases. */ + if (!(WINDOWP (dpyinfo->mouse_face_window) + && XWINDOW (dpyinfo->mouse_face_window) == w)) + return 0; + if (vpos < dpyinfo->mouse_face_beg_row + || vpos > dpyinfo->mouse_face_end_row) + return 0; + if (vpos > dpyinfo->mouse_face_beg_row + && vpos < dpyinfo->mouse_face_end_row) + return 1; + + if (!MATRIX_ROW (w->current_matrix, vpos)->reversed_p) + { + if (dpyinfo->mouse_face_beg_row == dpyinfo->mouse_face_end_row) + { + if (dpyinfo->mouse_face_beg_col <= hpos && hpos < dpyinfo->mouse_face_end_col) + return 1; + } + else if ((vpos == dpyinfo->mouse_face_beg_row + && hpos >= dpyinfo->mouse_face_beg_col) + || (vpos == dpyinfo->mouse_face_end_row + && hpos < dpyinfo->mouse_face_end_col)) + return 1; + } + else + { + if (dpyinfo->mouse_face_beg_row == dpyinfo->mouse_face_end_row) + { + if (dpyinfo->mouse_face_end_col < hpos && hpos <= dpyinfo->mouse_face_beg_col) + return 1; + } + else if ((vpos == dpyinfo->mouse_face_beg_row + && hpos <= dpyinfo->mouse_face_beg_col) + || (vpos == dpyinfo->mouse_face_end_row + && hpos > dpyinfo->mouse_face_end_col)) + return 1; + } + return 0; +} + /* EXPORT: Non-zero if physical cursor of window W is within mouse face. */ @@ -23720,31 +23802,134 @@ int cursor_in_mouse_face_p (struct window *w) { - Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame)); - int in_mouse_face = 0; - - if (WINDOWP (dpyinfo->mouse_face_window) - && XWINDOW (dpyinfo->mouse_face_window) == w) - { - int hpos = w->phys_cursor.hpos; - int vpos = w->phys_cursor.vpos; - - if (vpos >= dpyinfo->mouse_face_beg_row - && vpos <= dpyinfo->mouse_face_end_row - && (vpos > dpyinfo->mouse_face_beg_row - || hpos >= dpyinfo->mouse_face_beg_col) - && (vpos < dpyinfo->mouse_face_end_row - || hpos < dpyinfo->mouse_face_end_col - || dpyinfo->mouse_face_past_end)) - in_mouse_face = 1; - } - - return in_mouse_face; + return coords_in_mouse_face_p (w, w->phys_cursor.hpos, w->phys_cursor.vpos); } - +/* Find the glyph rows START_ROW and END_ROW of window W that display + characters between buffer positions START_CHARPOS and END_CHARPOS + (excluding END_CHARPOS). This is similar to row_containing_pos, + but is more accurate when bidi reordering makes buffer positions + change non-linearly with glyph rows. */ +static void +rows_from_pos_range (struct window *w, + EMACS_INT start_charpos, EMACS_INT end_charpos, + struct glyph_row **start, struct glyph_row **end) +{ + struct glyph_row *first = MATRIX_FIRST_TEXT_ROW (w->current_matrix); + int last_y = window_text_bottom_y (w); + struct glyph_row *row; + + *start = NULL; + *end = NULL; + + while (!first->enabled_p + && first < MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w)) + first++; + + /* Find the START row. */ + for (row = first; + row->enabled_p && MATRIX_ROW_BOTTOM_Y (row) <= last_y; + row++) + { + /* A row can potentially be the START row if the range of the + characters it displays intersects the range + [START_CHARPOS..END_CHARPOS). */ + if (! ((start_charpos < MATRIX_ROW_START_CHARPOS (row) + && end_charpos < MATRIX_ROW_START_CHARPOS (row)) + /* See the commentary in row_containing_pos, for the + explanation of the complicated way to check whether + some position is beyond the end of the characters + displayed by a row. */ + || ((start_charpos > MATRIX_ROW_END_CHARPOS (row) + || (start_charpos == MATRIX_ROW_END_CHARPOS (row) + && !row->ends_at_zv_p + && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row))) + && (end_charpos > MATRIX_ROW_END_CHARPOS (row) + || (end_charpos == MATRIX_ROW_END_CHARPOS (row) + && !row->ends_at_zv_p + && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)))))) + { + /* Found a candidate row. Now make sure at least one of the + glyphs it displays has a charpos from the range + [START_CHARPOS..END_CHARPOS). + + This is not obvious because bidi reordering could make + buffer positions of a row be 1,2,3,102,101,100, and if we + want to highlight characters in [50..60), we don't want + this row, even though [50..60) does intersect [1..103), + the range of character positions given by the row's start + and end positions. */ + struct glyph *g = row->glyphs[TEXT_AREA]; + struct glyph *e = g + row->used[TEXT_AREA]; + + while (g < e) + { + if (BUFFERP (g->object) + && start_charpos <= g->charpos && g->charpos < end_charpos) + *start = row; + g++; + } + if (*start) + break; + } + } + + /* Find the END row. */ + if (!*start + /* If the last row is partially visible, start looking for END + from that row, instead of starting from FIRST. */ + && !(row->enabled_p + && row->y < last_y && MATRIX_ROW_BOTTOM_Y (row) > last_y)) + row = first; + for ( ; row->enabled_p && MATRIX_ROW_BOTTOM_Y (row) <= last_y; row++) + { + struct glyph_row *next = row + 1; + + if (!next->enabled_p + || next >= MATRIX_BOTTOM_TEXT_ROW (w->current_matrix, w) + /* The first row >= START whose range of displayed characters + does NOT intersect the range [START_CHARPOS..END_CHARPOS] + is the row END + 1. */ + || (start_charpos < MATRIX_ROW_START_CHARPOS (next) + && end_charpos < MATRIX_ROW_START_CHARPOS (next)) + || ((start_charpos > MATRIX_ROW_END_CHARPOS (next) + || (start_charpos == MATRIX_ROW_END_CHARPOS (next) + && !next->ends_at_zv_p + && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (next))) + && (end_charpos > MATRIX_ROW_END_CHARPOS (next) + || (end_charpos == MATRIX_ROW_END_CHARPOS (next) + && !next->ends_at_zv_p + && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (next))))) + { + *end = row; + break; + } + else + { + /* If the next row's edges intersect [START_CHARPOS..END_CHARPOS], + but none of the characters it displays are in the range, it is + also END + 1. */ + struct glyph *g = next->glyphs[TEXT_AREA]; + struct glyph *e = g + next->used[TEXT_AREA]; + + while (g < e) + { + if (BUFFERP (g->object) + && start_charpos <= g->charpos && g->charpos < end_charpos) + break; + g++; + } + if (g == e) + { + *end = row; + break; + } + } + } +} + /* This function sets the mouse_face_* elements of DPYINFO, assuming the mouse cursor is on a glyph with buffer charpos MOUSE_CHARPOS in window WINDOW. START_CHARPOS and END_CHARPOS are buffer positions @@ -23766,83 +23951,41 @@ { struct window *w = XWINDOW (window); struct glyph_row *first = MATRIX_FIRST_TEXT_ROW (w->current_matrix); - struct glyph_row *row; + struct glyph_row *r1, *r2; struct glyph *glyph, *end; - EMACS_INT ignore; + EMACS_INT ignore, pos; int x; xassert (NILP (display_string) || STRINGP (display_string)); xassert (NILP (before_string) || STRINGP (before_string)); xassert (NILP (after_string) || STRINGP (after_string)); - /* Find the first highlighted glyph. */ - if (start_charpos < MATRIX_ROW_START_CHARPOS (first)) - { - dpyinfo->mouse_face_beg_col = 0; - dpyinfo->mouse_face_beg_row = MATRIX_ROW_VPOS (first, w->current_matrix); - dpyinfo->mouse_face_beg_x = first->x; - dpyinfo->mouse_face_beg_y = first->y; - } - else - { - row = row_containing_pos (w, start_charpos, first, NULL, 0); - if (row == NULL) - row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); - - /* If the before-string or display-string contains newlines, - row_containing_pos skips to its last row. Move back. */ - if (!NILP (before_string) || !NILP (display_string)) + /* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */ + rows_from_pos_range (w, start_charpos, end_charpos, &r1, &r2); + if (r1 == NULL) + r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); + /* If the before-string or display-string contains newlines, + rows_from_pos_range skips to its last row. Move back. */ + if (!NILP (before_string) || !NILP (display_string)) + { + struct glyph_row *prev; + while ((prev = r1 - 1, prev >= first) + && MATRIX_ROW_END_CHARPOS (prev) == start_charpos + && prev->used[TEXT_AREA] > 0) { - struct glyph_row *prev; - while ((prev = row - 1, prev >= first) - && MATRIX_ROW_END_CHARPOS (prev) == start_charpos - && prev->used[TEXT_AREA] > 0) - { - struct glyph *beg = prev->glyphs[TEXT_AREA]; - glyph = beg + prev->used[TEXT_AREA]; - while (--glyph >= beg && INTEGERP (glyph->object)); - if (glyph < beg - || !(EQ (glyph->object, before_string) - || EQ (glyph->object, display_string))) - break; - row = prev; - } + struct glyph *beg = prev->glyphs[TEXT_AREA]; + glyph = beg + prev->used[TEXT_AREA]; + while (--glyph >= beg && INTEGERP (glyph->object)); + if (glyph < beg + || !(EQ (glyph->object, before_string) + || EQ (glyph->object, display_string))) + break; + r1 = prev; } - - glyph = row->glyphs[TEXT_AREA]; - end = glyph + row->used[TEXT_AREA]; - x = row->x; - dpyinfo->mouse_face_beg_y = row->y; - dpyinfo->mouse_face_beg_row = MATRIX_ROW_VPOS (row, w->current_matrix); - - /* Skip truncation glyphs at the start of the glyph row. */ - if (row->displays_text_p) - for (; glyph < end - && INTEGERP (glyph->object) - && glyph->charpos < 0; - ++glyph) - x += glyph->pixel_width; - - /* Scan the glyph row, stopping before BEFORE_STRING or - DISPLAY_STRING or START_CHARPOS. */ - for (; glyph < end - && !INTEGERP (glyph->object) - && !EQ (glyph->object, before_string) - && !EQ (glyph->object, display_string) - && !(BUFFERP (glyph->object) - && glyph->charpos >= start_charpos); - ++glyph) - x += glyph->pixel_width; - - dpyinfo->mouse_face_beg_x = x; - dpyinfo->mouse_face_beg_col = glyph - row->glyphs[TEXT_AREA]; } - - /* Find the last highlighted glyph. */ - row = row_containing_pos (w, end_charpos, first, NULL, 0); - if (row == NULL) + if (r2 == NULL) { - row = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); + r2 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); dpyinfo->mouse_face_past_end = 1; } else if (!NILP (after_string)) @@ -23852,72 +23995,256 @@ struct glyph_row *last = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); - for (next = row + 1; + for (next = r2 + 1; next <= last && next->used[TEXT_AREA] > 0 && EQ (next->glyphs[TEXT_AREA]->object, after_string); ++next) - row = next; - } - - glyph = row->glyphs[TEXT_AREA]; - end = glyph + row->used[TEXT_AREA]; - x = row->x; - dpyinfo->mouse_face_end_y = row->y; - dpyinfo->mouse_face_end_row = MATRIX_ROW_VPOS (row, w->current_matrix); - - /* Skip truncation glyphs at the start of the row. */ - if (row->displays_text_p) - for (; glyph < end - && INTEGERP (glyph->object) - && glyph->charpos < 0; - ++glyph) - x += glyph->pixel_width; - - /* Scan the glyph row, stopping at END_CHARPOS or when we encounter - AFTER_STRING. */ - for (; glyph < end - && !INTEGERP (glyph->object) - && !EQ (glyph->object, after_string) - && !(BUFFERP (glyph->object) && glyph->charpos >= end_charpos); - ++glyph) - x += glyph->pixel_width; - - /* If we found AFTER_STRING, consume it and stop. */ - if (EQ (glyph->object, after_string)) - { - for (; EQ (glyph->object, after_string) && glyph < end; ++glyph) + r2 = next; + } + /* The rest of the display engine assumes that mouse_face_beg_row is + either above below mouse_face_end_row or identical to it. But + with bidi-reordered continued lines, the row for START_CHARPOS + could be below the row for END_CHARPOS. If so, swap the rows and + store them in correct order. */ + if (r1->y > r2->y) + { + struct glyph_row *tem = r2; + + r2 = r1; + r1 = tem; + } + + dpyinfo->mouse_face_beg_y = r1->y; + dpyinfo->mouse_face_beg_row = MATRIX_ROW_VPOS (r1, w->current_matrix); + dpyinfo->mouse_face_end_y = r2->y; + dpyinfo->mouse_face_end_row = MATRIX_ROW_VPOS (r2, w->current_matrix); + + /* For a bidi-reordered row, the positions of BEFORE_STRING, + AFTER_STRING, DISPLAY_STRING, START_CHARPOS, and END_CHARPOS + could be anywhere in the row and in any order. The strategy + below is to find the leftmost and the rightmost glyph that + belongs to either of these 3 strings, or whose position is + between START_CHARPOS and END_CHARPOS, and highlight all the + glyphs between those two. This may cover more than just the text + between START_CHARPOS and END_CHARPOS if the range of characters + strides the bidi level boundary, e.g. if the beginning is in R2L + text while the end is in L2R text or vice versa. */ + if (!r1->reversed_p) + { + /* This row is in a left to right paragraph. Scan it left to + right. */ + glyph = r1->glyphs[TEXT_AREA]; + end = glyph + r1->used[TEXT_AREA]; + x = r1->x; + + /* Skip truncation glyphs at the start of the glyph row. */ + if (r1->displays_text_p) + for (; glyph < end + && INTEGERP (glyph->object) + && glyph->charpos < 0; + ++glyph) + x += glyph->pixel_width; + + /* Scan the glyph row, looking for BEFORE_STRING, AFTER_STRING, + or DISPLAY_STRING, and the first glyph from buffer whose + position is between START_CHARPOS and END_CHARPOS. */ + for (; glyph < end + && !INTEGERP (glyph->object) + && !EQ (glyph->object, display_string) + && !(BUFFERP (glyph->object) + && (glyph->charpos >= start_charpos + && glyph->charpos < end_charpos)); + ++glyph) + { + /* BEFORE_STRING or AFTER_STRING are only relevant if they + are present at buffer positions between START_CHARPOS and + END_CHARPOS, or if they come from an overlay. */ + if (EQ (glyph->object, before_string)) + { + pos = string_buffer_position (w, before_string, + start_charpos); + /* If pos == 0, it means before_string came from an + overlay, not from a buffer position. */ + if (!pos || pos >= start_charpos && pos < end_charpos) + break; + } + else if (EQ (glyph->object, after_string)) + { + pos = string_buffer_position (w, after_string, end_charpos); + if (!pos || pos >= start_charpos && pos < end_charpos) + break; + } + x += glyph->pixel_width; + } + dpyinfo->mouse_face_beg_x = x; + dpyinfo->mouse_face_beg_col = glyph - r1->glyphs[TEXT_AREA]; + } + else + { + /* This row is in a right to left paragraph. Scan it right to + left. */ + struct glyph *g; + + end = r1->glyphs[TEXT_AREA] - 1; + glyph = end + r1->used[TEXT_AREA]; + + /* Skip truncation glyphs at the start of the glyph row. */ + if (r1->displays_text_p) + for (; glyph > end + && INTEGERP (glyph->object) + && glyph->charpos < 0; + --glyph) + ; + + /* Scan the glyph row, looking for BEFORE_STRING, AFTER_STRING, + or DISPLAY_STRING, and the first glyph from buffer whose + position is between START_CHARPOS and END_CHARPOS. */ + for (; glyph > end + && !INTEGERP (glyph->object) + && !EQ (glyph->object, display_string) + && !(BUFFERP (glyph->object) + && (glyph->charpos >= start_charpos + && glyph->charpos < end_charpos)); + --glyph) + { + /* BEFORE_STRING or AFTER_STRING are only relevant if they + are present at buffer positions between START_CHARPOS and + END_CHARPOS, or if they come from an overlay. */ + if (EQ (glyph->object, before_string)) + { + pos = string_buffer_position (w, before_string, start_charpos); + /* If pos == 0, it means before_string came from an + overlay, not from a buffer position. */ + if (!pos || pos >= start_charpos && pos < end_charpos) + break; + } + else if (EQ (glyph->object, after_string)) + { + pos = string_buffer_position (w, after_string, end_charpos); + if (!pos || pos >= start_charpos && pos < end_charpos) + break; + } + } + + glyph++; /* first glyph to the right of the highlighted area */ + for (g = r1->glyphs[TEXT_AREA], x = r1->x; g < glyph; g++) + x += g->pixel_width; + dpyinfo->mouse_face_beg_x = x; + dpyinfo->mouse_face_beg_col = glyph - r1->glyphs[TEXT_AREA]; + } + + /* If the highlight ends in a different row, compute GLYPH and END + for the end row. Otherwise, reuse the values computed above for + the row where the highlight begins. */ + if (r2 != r1) + { + if (!r2->reversed_p) + { + glyph = r2->glyphs[TEXT_AREA]; + end = glyph + r2->used[TEXT_AREA]; + x = r2->x; + } + else + { + end = r2->glyphs[TEXT_AREA] - 1; + glyph = end + r2->used[TEXT_AREA]; + } + } + + if (!r2->reversed_p) + { + /* Skip truncation and continuation glyphs near the end of the + row, and also blanks and stretch glyphs inserted by + extend_face_to_end_of_line. */ + while (end > glyph + && INTEGERP ((end - 1)->object) + && (end - 1)->charpos <= 0) + --end; + /* Scan the rest of the glyph row from the end, looking for the + first glyph that comes from BEFORE_STRING, AFTER_STRING, or + DISPLAY_STRING, or whose position is between START_CHARPOS + and END_CHARPOS */ + for (--end; + end > glyph + && !INTEGERP (end->object) + && !EQ (end->object, display_string) + && !(BUFFERP (end->object) + && (end->charpos >= start_charpos + && end->charpos < end_charpos)); + --end) + { + /* BEFORE_STRING or AFTER_STRING are only relevant if they + are present at buffer positions between START_CHARPOS and + END_CHARPOS, or if they come from an overlay. */ + if (EQ (end->object, before_string)) + { + pos = string_buffer_position (w, before_string, start_charpos); + if (!pos || pos >= start_charpos && pos < end_charpos) + break; + } + else if (EQ (end->object, after_string)) + { + pos = string_buffer_position (w, after_string, end_charpos); + if (!pos || pos >= start_charpos && pos < end_charpos) + break; + } + } + /* Find the X coordinate of the last glyph to be highlighted. */ + for (; glyph <= end; ++glyph) x += glyph->pixel_width; + + dpyinfo->mouse_face_end_x = x; + dpyinfo->mouse_face_end_col = glyph - r2->glyphs[TEXT_AREA]; } else { - /* If there's no after-string, we must check if we overshot, - which might be the case if we stopped after a string glyph. - That glyph may belong to a before-string or display-string - associated with the end position, which must not be - highlighted. */ - Lisp_Object prev_object; - EMACS_INT pos; - - while (glyph > row->glyphs[TEXT_AREA]) - { - prev_object = (glyph - 1)->object; - if (!STRINGP (prev_object) || EQ (prev_object, display_string)) - break; - - pos = string_buffer_position (w, prev_object, end_charpos); - if (pos && pos < end_charpos) - break; - - for (; glyph > row->glyphs[TEXT_AREA] - && EQ ((glyph - 1)->object, prev_object); - --glyph) - x -= (glyph - 1)->pixel_width; - } + /* Skip truncation and continuation glyphs near the end of the + row, and also blanks and stretch glyphs inserted by + extend_face_to_end_of_line. */ + x = r2->x; + end++; + while (end < glyph + && INTEGERP (end->object) + && end->charpos <= 0) + { + x += end->pixel_width; + ++end; + } + /* Scan the rest of the glyph row from the end, looking for the + first glyph that comes from BEFORE_STRING, AFTER_STRING, or + DISPLAY_STRING, or whose position is between START_CHARPOS + and END_CHARPOS */ + for ( ; + end < glyph + && !INTEGERP (end->object) + && !EQ (end->object, display_string) + && !(BUFFERP (end->object) + && (end->charpos >= start_charpos + && end->charpos < end_charpos)); + ++end) + { + /* BEFORE_STRING or AFTER_STRING are only relevant if they + are present at buffer positions between START_CHARPOS and + END_CHARPOS, or if they come from an overlay. */ + if (EQ (end->object, before_string)) + { + pos = string_buffer_position (w, before_string, start_charpos); + if (!pos || pos >= start_charpos && pos < end_charpos) + break; + } + else if (EQ (end->object, after_string)) + { + pos = string_buffer_position (w, after_string, end_charpos); + if (!pos || pos >= start_charpos && pos < end_charpos) + break; + } + x += end->pixel_width; + } + dpyinfo->mouse_face_end_x = x; + dpyinfo->mouse_face_end_col = end - r2->glyphs[TEXT_AREA]; } - dpyinfo->mouse_face_end_x = x; - dpyinfo->mouse_face_end_col = glyph - row->glyphs[TEXT_AREA]; dpyinfo->mouse_face_window = window; dpyinfo->mouse_face_face_id = face_at_buffer_position (w, mouse_charpos, 0, 0, &ignore, @@ -23926,6 +24253,11 @@ show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); } +/* The following function is not used anymore (replaced with + mouse_face_from_string_pos), but I leave it here for the time + being, in case someone would. */ + +#if 0 /* not used */ /* Find the position of the glyph for position POS in OBJECT in window W's current matrix, and return in *X, *Y the pixel @@ -24003,7 +24335,130 @@ return best_glyph != NULL; } - +#endif /* not used */ + +/* Find the positions of the first and the last glyphs in window W's + current matrix that occlude positions [STARTPOS..ENDPOS] in OBJECT + (assumed to be a string), and return in DPYINFO's mouse_face + members the pixel and column/row coordinates of those glyphs. */ + +static void +mouse_face_from_string_pos (struct window *w, Display_Info *dpyinfo, + Lisp_Object object, + EMACS_INT startpos, EMACS_INT endpos) +{ + int yb = window_text_bottom_y (w); + struct glyph_row *r; + struct glyph *g, *e; + int gx; + int found = 0; + + /* Find the glyph row with at least one position in the range + [STARTPOS..ENDPOS], and the first glyph in that row whose + position belongs to that range. */ + for (r = MATRIX_FIRST_TEXT_ROW (w->current_matrix); + r->enabled_p && r->y < yb; + ++r) + { + if (!r->reversed_p) + { + g = r->glyphs[TEXT_AREA]; + e = g + r->used[TEXT_AREA]; + for (gx = r->x; g < e; gx += g->pixel_width, ++g) + if (EQ (g->object, object) + && startpos <= g->charpos && g->charpos <= endpos) + { + dpyinfo->mouse_face_beg_row = r - w->current_matrix->rows; + dpyinfo->mouse_face_beg_y = r->y; + dpyinfo->mouse_face_beg_col = g - r->glyphs[TEXT_AREA]; + dpyinfo->mouse_face_beg_x = gx; + found = 1; + break; + } + } + else + { + struct glyph *g1; + + e = r->glyphs[TEXT_AREA]; + g = e + r->used[TEXT_AREA]; + for ( ; g > e; --g) + if (EQ ((g-1)->object, object) + && startpos <= (g-1)->charpos && (g-1)->charpos <= endpos) + { + dpyinfo->mouse_face_beg_row = r - w->current_matrix->rows; + dpyinfo->mouse_face_beg_y = r->y; + dpyinfo->mouse_face_beg_col = g - r->glyphs[TEXT_AREA]; + for (gx = r->x, g1 = r->glyphs[TEXT_AREA]; g1 < g; ++g1) + gx += g1->pixel_width; + dpyinfo->mouse_face_beg_x = gx; + found = 1; + break; + } + } + if (found) + break; + } + + if (!found) + return; + + /* Starting with the next row, look for the first row which does NOT + include any glyphs whose positions are in the range. */ + for (++r; r->enabled_p && r->y < yb; ++r) + { + g = r->glyphs[TEXT_AREA]; + e = g + r->used[TEXT_AREA]; + found = 0; + for ( ; g < e; ++g) + if (EQ (g->object, object) + && startpos <= g->charpos && g->charpos <= endpos) + { + found = 1; + break; + } + if (!found) + break; + } + + /* The highlighted region ends on the previous row. */ + r--; + + /* Set the end row and its vertical pixel coordinate. */ + dpyinfo->mouse_face_end_row = r - w->current_matrix->rows; + dpyinfo->mouse_face_end_y = r->y; + + /* Compute and set the end column and the end column's horizontal + pixel coordinate. */ + if (!r->reversed_p) + { + g = r->glyphs[TEXT_AREA]; + e = g + r->used[TEXT_AREA]; + for ( ; e > g; --e) + if (EQ ((e-1)->object, object) + && startpos <= (e-1)->charpos && (e-1)->charpos <= endpos) + break; + dpyinfo->mouse_face_end_col = e - g; + + for (gx = r->x; g < e; ++g) + gx += g->pixel_width; + dpyinfo->mouse_face_end_x = gx; + } + else + { + e = r->glyphs[TEXT_AREA]; + g = e + r->used[TEXT_AREA]; + for (gx = r->x ; e < g; ++e) + { + if (EQ (e->object, object) + && startpos <= e->charpos && e->charpos <= endpos) + break; + gx += e->pixel_width; + } + dpyinfo->mouse_face_end_col = e - r->glyphs[TEXT_AREA]; + dpyinfo->mouse_face_end_x = gx; + } +} /* See if position X, Y is within a hot-spot of an image. */ @@ -24205,6 +24660,8 @@ int x0; struct glyph *end; + /* Kludge alert: mode_line_string takes X/Y in pixels, but + returns them in row/column units! */ string = mode_line_string (w, area, &x, &y, &charpos, &object, &dx, &dy, &width, &height); @@ -24212,7 +24669,7 @@ ? MATRIX_MODE_LINE_ROW (w->current_matrix) : MATRIX_HEADER_LINE_ROW (w->current_matrix)); - /* Find glyph */ + /* Find the glyph under the mouse pointer. */ if (row->mode_line_p && row->enabled_p) { glyph = row_start_glyph = row->glyphs[TEXT_AREA]; @@ -24230,6 +24687,8 @@ else { x -= WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (w); + /* Kludge alert: marginal_area_string takes X/Y in pixels, but + returns them in row/column units! */ string = marginal_area_string (w, area, &x, &y, &charpos, &object, &dx, &dy, &width, &height); } @@ -24318,93 +24777,116 @@ int gpos; int gseq_length; int total_pixel_width; - EMACS_INT ignore; + EMACS_INT begpos, endpos, ignore; int vpos, hpos; b = Fprevious_single_property_change (make_number (charpos + 1), Qmouse_face, string, Qnil); if (NILP (b)) - b = make_number (0); + begpos = 0; + else + begpos = XINT (b); e = Fnext_single_property_change (pos, Qmouse_face, string, Qnil); if (NILP (e)) - e = make_number (SCHARS (string)); - - /* Calculate the position(glyph position: GPOS) of GLYPH in - displayed string. GPOS is different from CHARPOS. - - CHARPOS is the position of glyph in internal string - object. A mode line string format has structures which - is converted to a flatten by emacs lisp interpreter. - The internal string is an element of the structures. - The displayed string is the flatten string. */ - gpos = 0; - if (glyph > row_start_glyph) - { - tmp_glyph = glyph - 1; - while (tmp_glyph >= row_start_glyph - && tmp_glyph->charpos >= XINT (b) - && EQ (tmp_glyph->object, glyph->object)) - { - tmp_glyph--; - gpos++; - } - } - - /* Calculate the lenght(glyph sequence length: GSEQ_LENGTH) of - displayed string holding GLYPH. - - GSEQ_LENGTH is different from SCHARS (STRING). - SCHARS (STRING) returns the length of the internal string. */ - for (tmp_glyph = glyph, gseq_length = gpos; - tmp_glyph->charpos < XINT (e); - tmp_glyph++, gseq_length++) - { - if (!EQ (tmp_glyph->object, glyph->object)) - break; - } - + endpos = SCHARS (string); + else + endpos = XINT (e); + + /* Calculate the glyph position GPOS of GLYPH in the + displayed string, relative to the beginning of the + highlighted part of the string. + + Note: GPOS is different from CHARPOS. CHARPOS is the + position of GLYPH in the internal string object. A mode + line string format has structures which are converted to + a flattened string by the Emacs Lisp interpreter. The + internal string is an element of those structures. The + displayed string is the flattened string. */ + tmp_glyph = row_start_glyph; + while (tmp_glyph < glyph + && (!(EQ (tmp_glyph->object, glyph->object) + && begpos <= tmp_glyph->charpos + && tmp_glyph->charpos < endpos))) + tmp_glyph++; + gpos = glyph - tmp_glyph; + + /* Calculate the length GSEQ_LENGTH of the glyph sequence of + the highlighted part of the displayed string to which + GLYPH belongs. Note: GSEQ_LENGTH is different from + SCHARS (STRING), because the latter returns the length of + the internal string. */ + for (tmp_glyph = row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] - 1; + tmp_glyph > glyph + && (!(EQ (tmp_glyph->object, glyph->object) + && begpos <= tmp_glyph->charpos + && tmp_glyph->charpos < endpos)); + tmp_glyph--) + ; + gseq_length = gpos + (tmp_glyph - glyph) + 1; + + /* Calculate the total pixel width of all the glyphs between + the beginning of the highlighted area and GLYPH. */ total_pixel_width = 0; for (tmp_glyph = glyph - gpos; tmp_glyph != glyph; tmp_glyph++) total_pixel_width += tmp_glyph->pixel_width; - /* Pre calculation of re-rendering position */ - vpos = (x - gpos); - hpos = (area == ON_MODE_LINE + /* Pre calculation of re-rendering position. Note: X is in + column units here, after the call to mode_line_string or + marginal_area_string. */ + hpos = x - gpos; + vpos = (area == ON_MODE_LINE ? (w->current_matrix)->nrows - 1 : 0); - /* If the re-rendering position is included in the last - re-rendering area, we should do nothing. */ + /* If GLYPH's position is included in the region that is + already drawn in mouse face, we have nothing to do. */ if ( EQ (window, dpyinfo->mouse_face_window) - && dpyinfo->mouse_face_beg_col <= vpos - && vpos < dpyinfo->mouse_face_end_col - && dpyinfo->mouse_face_beg_row == hpos ) + && (!row->reversed_p + ? (dpyinfo->mouse_face_beg_col <= hpos + && hpos < dpyinfo->mouse_face_end_col) + /* In R2L rows we swap BEG and END, see below. */ + : (dpyinfo->mouse_face_end_col <= hpos + && hpos < dpyinfo->mouse_face_beg_col)) + && dpyinfo->mouse_face_beg_row == vpos ) return; if (clear_mouse_face (dpyinfo)) cursor = No_Cursor; - dpyinfo->mouse_face_beg_col = vpos; - dpyinfo->mouse_face_beg_row = hpos; - - dpyinfo->mouse_face_beg_x = original_x_pixel - (total_pixel_width + dx); - dpyinfo->mouse_face_beg_y = 0; - - dpyinfo->mouse_face_end_col = vpos + gseq_length; - dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_beg_row; - - dpyinfo->mouse_face_end_x = 0; - dpyinfo->mouse_face_end_y = 0; - + if (!row->reversed_p) + { + dpyinfo->mouse_face_beg_col = hpos; + dpyinfo->mouse_face_beg_x = original_x_pixel + - (total_pixel_width + dx); + dpyinfo->mouse_face_end_col = hpos + gseq_length; + dpyinfo->mouse_face_end_x = 0; + } + else + { + /* In R2L rows, show_mouse_face expects BEG and END + coordinates to be swapped. */ + dpyinfo->mouse_face_end_col = hpos; + dpyinfo->mouse_face_end_x = original_x_pixel + - (total_pixel_width + dx); + dpyinfo->mouse_face_beg_col = hpos + gseq_length; + dpyinfo->mouse_face_beg_x = 0; + } + + dpyinfo->mouse_face_beg_row = vpos; + dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_beg_row; + dpyinfo->mouse_face_beg_y = 0; + dpyinfo->mouse_face_end_y = 0; dpyinfo->mouse_face_past_end = 0; - dpyinfo->mouse_face_window = window; + dpyinfo->mouse_face_window = window; dpyinfo->mouse_face_face_id = face_at_string_position (w, string, charpos, - 0, 0, 0, &ignore, - glyph->face_id, 1); + 0, 0, 0, + &ignore, + glyph->face_id, + 1); show_mouse_face (dpyinfo, DRAW_MOUSE_FACE); if (NILP (pointer)) @@ -24573,7 +25055,15 @@ /* Clear mouse face if X/Y not over text. */ if (glyph == NULL || area != TEXT_AREA - || !MATRIX_ROW (w->current_matrix, vpos)->displays_text_p) + || !MATRIX_ROW (w->current_matrix, vpos)->displays_text_p + /* R2L rows have a stretch glyph at their front, which + stands for no text, whereas L2R rows have no glyphs at + all beyond the end of text. Treat such stretch glyphs + like we do with NULL glyphs in L2R rows. */ + || (MATRIX_ROW (w->current_matrix, vpos)->reversed_p + && glyph == MATRIX_ROW (w->current_matrix, vpos)->glyphs[TEXT_AREA] + && glyph->type == STRETCH_GLYPH + && glyph->avoid_cursor_p)) { if (clear_mouse_face (dpyinfo)) cursor = No_Cursor; @@ -24618,14 +25108,7 @@ else noverlays = 0; - same_region = (EQ (window, dpyinfo->mouse_face_window) - && vpos >= dpyinfo->mouse_face_beg_row - && vpos <= dpyinfo->mouse_face_end_row - && (vpos > dpyinfo->mouse_face_beg_row - || hpos >= dpyinfo->mouse_face_beg_col) - && (vpos < dpyinfo->mouse_face_end_row - || hpos < dpyinfo->mouse_face_end_col - || dpyinfo->mouse_face_past_end)); + same_region = coords_in_mouse_face_p (w, hpos, vpos); if (same_region) cursor = No_Cursor; @@ -24679,17 +25162,8 @@ b = make_number (0); if (NILP (e)) e = make_number (SCHARS (object) - 1); - - fast_find_string_pos (w, XINT (b), object, - &dpyinfo->mouse_face_beg_col, - &dpyinfo->mouse_face_beg_row, - &dpyinfo->mouse_face_beg_x, - &dpyinfo->mouse_face_beg_y, 0); - fast_find_string_pos (w, XINT (e), object, - &dpyinfo->mouse_face_end_col, - &dpyinfo->mouse_face_end_row, - &dpyinfo->mouse_face_end_x, - &dpyinfo->mouse_face_end_y, 1); + mouse_face_from_string_pos (w, dpyinfo, object, + XINT (b), XINT (e)); dpyinfo->mouse_face_past_end = 0; dpyinfo->mouse_face_window = window; dpyinfo->mouse_face_face_id @@ -24729,17 +25203,33 @@ { Lisp_Object before, after; Lisp_Object before_string, after_string; + /* To correctly find the limits of mouse highlight + in a bidi-reordered buffer, we must not use the + optimization of limiting the search in + previous-single-property-change and + next-single-property-change, because + rows_from_pos_range needs the real start and end + positions to DTRT in this case. That's because + the first row visible in a window does not + necessarily display the character whose position + is the smallest. */ + Lisp_Object lim1 = + NILP (XBUFFER (buffer)->bidi_display_reordering) + ? Fmarker_position (w->start) + : Qnil; + Lisp_Object lim2 = + NILP (XBUFFER (buffer)->bidi_display_reordering) + ? make_number (BUF_Z (XBUFFER (buffer)) + - XFASTINT (w->window_end_pos)) + : Qnil; if (NILP (overlay)) { /* Handle the text property case. */ before = Fprevious_single_property_change - (make_number (pos + 1), Qmouse_face, buffer, - Fmarker_position (w->start)); + (make_number (pos + 1), Qmouse_face, buffer, lim1); after = Fnext_single_property_change - (make_number (pos), Qmouse_face, buffer, - make_number (BUF_Z (XBUFFER (buffer)) - - XFASTINT (w->window_end_pos))); + (make_number (pos), Qmouse_face, buffer, lim2); before_string = after_string = Qnil; } else ------------------------------------------------------------ revno: 102052 committer: Jan D. branch nick: trunk timestamp: Sat 2010-10-23 11:18:19 +0200 message: Mention faceName for Lucid menu/dialog fonts. diff: === modified file 'etc/NEWS' --- etc/NEWS 2010-10-23 02:46:06 +0000 +++ etc/NEWS 2010-10-23 09:18:19 +0000 @@ -138,7 +138,9 @@ off by customizing x-gtk-use-system-tooltips. ** Lucid menus and dialogs can display antialiased fonts if Emacs is built -with Xft. +with Xft. To change font, use X resource faceName, for example: +Emacs.pane.menubar.faceName: Courier-12 +Set faceName to none and use font to use the old X fonts. ** On graphical displays, the mode-line no longer ends in dashes. ------------------------------------------------------------ revno: 102051 committer: Glenn Morris branch nick: trunk timestamp: Fri 2010-10-22 19:46:06 -0700 message: Replace digest-doc and sorted-doc C programs with Lisp commands. * lib-src/digest-doc.c, lib-src/sorted-doc.c: Remove files. * lib-src/Makefile.in (UTILITIES): Remove digest-doc and sorted-doc. (digest-doc${EXEEXT}, sorted-doc${EXEEXT}): Remove rules. * lib-src/makefile.w32-in (ALL): Remove digest-doc and sorted-doc. ($(BLD)/sorted-doc.exe, $(BLD)/digest-doc.exe, sorted-doc, digest-doc) ($(BLD)/digest-doc.$(O), $(BLD)/sorted-doc.$(O)): Remove rules. (install): Don't install digest-doc.exe or sorted-doc.exe. * lisp/help-fns.el (doc-file-to-man, doc-file-to-info): New commands. * doc/lispref/help.texi (Documentation Basics): Remove mentions of digest-doc and sorted-doc. * INSTALL, nt/README, nt/README.W32: Do not mention digest-doc and sorted-doc. * etc/NEWS: Mention this change. diff: === modified file 'INSTALL' --- INSTALL 2010-10-09 01:15:15 +0000 +++ INSTALL 2010-10-23 02:46:06 +0000 @@ -676,8 +676,7 @@ the paths to the values specified in `./Makefile'. 2) Go to directory `./lib-src' and run `make'. This creates -executables named `ctags' and `etags' and `make-docfile' and -`digest-doc' and `test-distrib'. And others. +executables named `etags', `make-docfile', and others. 3) Go to directory `./src' and run `make'. This refers to files in the `./lisp' and `./lib-src' subdirectories using names `../lisp' and @@ -709,8 +708,6 @@ are intended to be run by users; they are handled below. - The programs `make-docfile' and `test-distrib' were used in building Emacs, and are not needed any more. -- The programs `digest-doc' and `sorted-doc' convert a `DOC' file into - a file for users to read. There is no important reason to move them. 2) Copy the files in `./info' to the place specified in `./lisp/site-init.el' or `./lisp/paths.el'. Note that if the === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2010-10-15 10:49:07 +0000 +++ doc/lispref/ChangeLog 2010-10-23 02:46:06 +0000 @@ -1,3 +1,8 @@ +2010-10-23 Glenn Morris + + * help.texi (Documentation Basics): Remove mentions of digest-doc and + sorted-doc. + 2010-10-15 Eli Zaretskii * os.texi (Dynamic Libraries): New node, with slightly modified === modified file 'doc/lispref/help.texi' --- doc/lispref/help.texi 2010-01-13 08:35:10 +0000 +++ doc/lispref/help.texi 2010-10-23 02:46:06 +0000 @@ -1,7 +1,8 @@ @c -*-texinfo-*- @c This is part of the GNU Emacs Lisp Reference Manual. @c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, -@c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +@c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 +@c Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. @setfilename ../../info/help @node Documentation, Files, Modes, Top @@ -106,12 +107,6 @@ documentation string from the appropriate file; this is transparent to the user. -@c Wordy to prevent overfull hbox. --rjc 15mar92 - The @file{emacs/lib-src} directory contains two utilities that you can -use to print nice-looking hardcopy for the file -@file{emacs/etc/DOC-@var{version}}. These are @file{sorted-doc} and -@file{digest-doc}. - @node Accessing Documentation @section Access to Documentation Strings @@ -701,6 +696,3 @@ if the user types the help character again. @end defopt -@ignore - arch-tag: ba36b4c2-e60f-49e2-bc25-61158fdcd815 -@end ignore === modified file 'etc/NEWS' --- etc/NEWS 2010-10-19 19:24:39 +0000 +++ etc/NEWS 2010-10-23 02:46:06 +0000 @@ -209,6 +209,9 @@ ** The user option `remote-file-name-inhibit-cache' controls whether the remote file-name cache is used for read access. +** The standalone programs lib-src/digest-doc and sorted-doc have been +replaced with Lisp commands `doc-file-to-man' and `doc-file-to-info'. + * Editing Changes in Emacs 24.1 === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2010-10-20 03:53:34 +0000 +++ lib-src/ChangeLog 2010-10-23 02:46:06 +0000 @@ -1,3 +1,13 @@ +2010-10-23 Glenn Morris + + * digest-doc.c, sorted-doc.c: Remove files. + * Makefile.in (UTILITIES): Remove digest-doc and sorted-doc. + (digest-doc${EXEEXT}, sorted-doc${EXEEXT}): Remove rules. + * makefile.w32-in (ALL): Remove digest-doc and sorted-doc. + ($(BLD)/sorted-doc.exe, $(BLD)/digest-doc.exe, sorted-doc, digest-doc) + ($(BLD)/digest-doc.$(O), $(BLD)/sorted-doc.$(O)): Remove rules. + (install): Don't install digest-doc.exe or sorted-doc.exe. + 2010-10-10 Dan Nicolaescu * Makefile.in (PROFILING_LDFLAGS): Remove, not needed. === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2010-10-10 15:35:04 +0000 +++ lib-src/Makefile.in 2010-10-23 02:46:06 +0000 @@ -118,8 +118,7 @@ # Things that Emacs runs internally, or during the build process, # which should not be installed in bindir. -UTILITIES = profile${EXEEXT} digest-doc${EXEEXT} sorted-doc${EXEEXT} \ - movemail${EXEEXT} fakemail${EXEEXT} \ +UTILITIES = profile${EXEEXT} movemail${EXEEXT} fakemail${EXEEXT} \ hexl${EXEEXT} update-game-score${EXEEXT} DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT} @@ -353,12 +352,6 @@ $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \ -o make-docfile -digest-doc${EXEEXT}: ${srcdir}/digest-doc.c - $(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc - -sorted-doc${EXEEXT}: ${srcdir}/sorted-doc.c - $(CC) ${ALL_CFLAGS} ${srcdir}/sorted-doc.c $(LOADLIBES) -o sorted-doc - movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS) $(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o \ $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MOVE) -o movemail === removed file 'lib-src/digest-doc.c' --- lib-src/digest-doc.c 2010-07-03 00:50:23 +0000 +++ lib-src/digest-doc.c 1970-01-01 00:00:00 +0000 @@ -1,81 +0,0 @@ -/* Give this program DOC-mm.nn.oo as standard input and it outputs to - standard output a file of nroff output containing the doc strings. - -Copyright (C) 1987, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2008, 2009, 2010 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . - - -See also sorted-doc.c, which produces similar output -but in texinfo format and sorted by function/variable name. */ - -#include - -#ifdef DOS_NT -#include /* for O_BINARY */ -#include /* for setmode */ -#endif - -int -main (void) -{ - register int ch; - register int notfirst = 0; - -#ifdef DOS_NT - /* DOC is a binary file. */ - if (!isatty (fileno (stdin))) - setmode (fileno (stdin), O_BINARY); -#endif - - printf (".TL\n"); - printf ("Command Summary for GNU Emacs\n"); - printf (".AU\nRichard M. Stallman\n"); - while ((ch = getchar ()) != EOF) - { - if (ch == '\037') - { - if (notfirst) - printf ("\n.DE"); - else - notfirst = 1; - - printf ("\n.SH\n"); - - ch = getchar (); - printf (ch == 'F' ? "Function " : "Variable "); - - while ((ch = getchar ()) != '\n') /* Changed this line */ - { - if (ch != EOF) - putchar (ch); - else - { - ungetc (ch, stdin); - break; - } - } - printf ("\n.DS L\n"); - } - else - putchar (ch); - } - return 0; -} - -/* arch-tag: 2ba2c9b0-4157-4eba-bd9f-967e3677e35f - (do not change this comment) */ === modified file 'lib-src/makefile.w32-in' --- lib-src/makefile.w32-in 2010-10-09 01:15:15 +0000 +++ lib-src/makefile.w32-in 2010-10-23 02:46:06 +0000 @@ -18,7 +18,7 @@ # along with GNU Emacs. If not, see . -ALL = make-docfile hexl ctags etags movemail ebrowse sorted-doc digest-doc emacsclient +ALL = make-docfile hexl ctags etags movemail ebrowse emacsclient .PHONY: $(ALL) @@ -36,10 +36,6 @@ $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/hexl.$(O) $(LIBS) $(BLD)/fakemail.exe: $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O) $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/fakemail.$(O) $(BLD)/ntlib.$(O) $(LIBS) -$(BLD)/sorted-doc.exe: $(BLD)/sorted-doc.$(O) - $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/sorted-doc.$(O) $(LIBS) -$(BLD)/digest-doc.exe: $(BLD)/digest-doc.$(O) - $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/digest-doc.$(O) $(LIBS) $(BLD)/test-distrib.exe: $(BLD)/test-distrib.$(O) $(LINK) $(LINK_OUT)$@ $(LINK_FLAGS) $(BLD)/test-distrib.$(O) $(LIBS) @@ -50,8 +46,6 @@ hexl: stamp_BLD $(BLD)/hexl.exe movemail: stamp_BLD $(BLD)/movemail.exe fakemail: stamp_BLD $(BLD)/fakemail.exe -sorted-doc: stamp_BLD $(BLD)/sorted-doc.exe -digest-doc: stamp_BLD $(BLD)/digest-doc.exe emacsclient: stamp_BLD $(BLD)/emacsclient.exe $(BLD)/emacsclientw.exe test-distrib: stamp_BLD $(BLD)/test-distrib.exe @@ -335,8 +329,6 @@ $(CP) $(BLD)/ctags.exe $(INSTALL_DIR)/bin $(CP) $(BLD)/hexl.exe $(INSTALL_DIR)/bin $(CP) $(BLD)/movemail.exe $(INSTALL_DIR)/bin - $(CP) $(BLD)/sorted-doc.exe $(INSTALL_DIR)/bin - $(CP) $(BLD)/digest-doc.exe $(INSTALL_DIR)/bin $(CP) $(BLD)/emacsclient.exe $(INSTALL_DIR)/bin $(CP) $(BLD)/emacsclientw.exe $(INSTALL_DIR)/bin - mkdir "$(INSTALL_DIR)/etc" @@ -404,9 +396,6 @@ $(SRC)/ntlib.h \ $(SRC)/getopt.h -$(BLD)/digest-doc.$(O) : \ - $(SRC)/digest-doc.c - $(BLD)/emacsclient.$(O) : \ $(SRC)/emacsclient.c \ $(EMACS_ROOT)/src/s/ms-w32.h \ @@ -496,12 +485,6 @@ $(BLD)/qsort.$(O) : \ $(SRC)/qsort.c -$(BLD)/sorted-doc.$(O) : \ - $(SRC)/sorted-doc.c \ - $(EMACS_ROOT)/src/s/ms-w32.h \ - $(EMACS_ROOT)/src/m/intel386.h \ - $(EMACS_ROOT)/src/config.h - $(BLD)/tcp.$(O) : \ $(SRC)/tcp.c @@ -519,8 +502,6 @@ # $(BLD)/make-docfile.$(O) $(BLD)/hexl.$(O) $(BLD)/fakemail.$(O): stamp_BLD -$(BLD)/sorted-doc.$(O) $(BLD)/digest-doc.$(O): stamp_BLD - $(BLD)/test-distrib.$(O) $(GETOPTOBJS) $(MOVEMAILOBJS): stamp_BLD $(BLD)/emacsclient.$(O) $(BLD)/etags.$(O) $(BLD)/regex.$(O): stamp_BLD === removed file 'lib-src/sorted-doc.c' --- lib-src/sorted-doc.c 2010-10-03 23:35:22 +0000 +++ lib-src/sorted-doc.c 1970-01-01 00:00:00 +0000 @@ -1,296 +0,0 @@ -/* Give this program DOC-mm.nn.oo as standard input and it outputs to - standard output a file of texinfo input containing the doc strings. - -Copyright (C) 1989, 1992, 1994, 1996, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . */ - - -/* This version sorts the output by function name. */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#ifdef DOS_NT -#include /* for O_BINARY */ -#include /* for setmode */ -#endif -#ifndef HAVE_STDLIB_H /* config.h includes stdlib. */ -#ifndef WINDOWSNT /* src/s/ms-w32.h includes stdlib.h */ -extern char *malloc (); -#endif -#endif - -#define NUL '\0' -#define MARKER '\037' - -#define DEBUG 0 - -typedef struct line LINE; - -struct line -{ - LINE *next; /* ptr to next or NULL */ - char *line; /* text of the line */ -}; - -typedef struct docstr DOCSTR; - -struct docstr /* Allocated thing for an entry. */ -{ - DOCSTR *next; /* next in the chain */ - char *name; /* name of the function or var */ - LINE *first; /* first line of doc text. */ - char type; /* 'F' for function, 'V' for variable */ -}; - - -/* Print error message. `s1' is printf control string, `s2' is arg for it. */ - -void -error (const char *s1, const char *s2) -{ - fprintf (stderr, "sorted-doc: "); - fprintf (stderr, s1, s2); - fprintf (stderr, "\n"); -} - -/* Print error message and exit. */ - -void -fatal (const char *s1, const char *s2) -{ - error (s1, s2); - exit (EXIT_FAILURE); -} - -/* Like malloc but get fatal error if memory is exhausted. */ - -char * -xmalloc (int size) -{ - char *result = malloc ((unsigned)size); - if (result == NULL) - fatal ("%s", "virtual memory exhausted"); - return result; -} - -char * -xstrdup (const char *str) -{ - char *buf = xmalloc (strlen (str) + 1); - (void) strcpy (buf, str); - return (buf); -} - -/* Comparison function for qsort to call. */ - -int -cmpdoc (const void *va, const void *vb) -{ - DOCSTR *const *a = va; - DOCSTR *const *b = vb; - register int val = strcmp ((*a)->name, (*b)->name); - if (val) return val; - return (*a)->type - (*b)->type; -} - -enum state -{ - WAITING, BEG_NAME, NAME_GET, BEG_DESC, DESC_GET -}; - -const char *states[] = -{ - "WAITING", "BEG_NAME", "NAME_GET", "BEG_DESC", "DESC_GET" -}; - -int -main (void) -{ - register DOCSTR *dp = NULL; /* allocated DOCSTR */ - register LINE *lp = NULL; /* allocated line */ - register char *bp; /* ptr inside line buffer */ - register enum state state = WAITING; /* state at start */ - int cnt = 0; /* number of DOCSTRs read */ - - DOCSTR *docs = NULL; /* chain of allocated DOCSTRS */ - char buf[512]; /* line buffer */ - -#ifdef DOS_NT - /* DOC is a binary file. */ - if (!isatty (fileno (stdin))) - setmode (fileno (stdin), O_BINARY); -#endif - - bp = buf; - - while (1) /* process one char at a time */ - { - /* this char from the DOCSTR file */ - register int ch = getchar (); - - /* Beginnings */ - - if (state == WAITING) - { - if (ch == MARKER) - state = BEG_NAME; - } - else if (state == BEG_NAME) - { - cnt++; - if (dp == NULL) /* first dp allocated */ - { - docs = dp = (DOCSTR*) xmalloc (sizeof (DOCSTR)); - } - else /* all the rest */ - { - dp->next = (DOCSTR*) xmalloc (sizeof (DOCSTR)); - dp = dp->next; - } - lp = NULL; - dp->next = NULL; - bp = buf; - state = NAME_GET; - /* Record whether function or variable. */ - dp->type = ch; - ch = getchar (); - } - else if (state == BEG_DESC) - { - if (lp == NULL) /* first line for dp */ - { - dp->first = lp = (LINE*)xmalloc (sizeof (LINE)); - } - else /* continuing lines */ - { - lp->next = (LINE*)xmalloc (sizeof (LINE)); - lp = lp->next; - } - lp->next = NULL; - bp = buf; - state = DESC_GET; - } - - /* process gets */ - - if (state == NAME_GET || state == DESC_GET) - { - if (ch != MARKER && ch != '\n' && ch != EOF) - { - *bp++ = ch; - } - else /* saving and changing state */ - { - *bp = NUL; - bp = xstrdup (buf); - - if (state == NAME_GET) - dp->name = bp; - else - lp->line = bp; - - bp = buf; - state = (ch == MARKER) ? BEG_NAME : BEG_DESC; - } - } /* NAME_GET || DESC_GET */ - if (ch == EOF) - break; - } - - { - DOCSTR **array; - register int i; /* counter */ - - /* build array of ptrs to DOCSTRs */ - - array = (DOCSTR**)xmalloc (cnt * sizeof (*array)); - for (dp = docs, i = 0; dp != NULL ; dp = dp->next) - array[i++] = dp; - - /* sort the array by name; within each name, by type */ - - qsort ((char*)array, cnt, sizeof (DOCSTR*), cmpdoc); - - /* write the output header */ - - printf ("\\input texinfo @c -*-texinfo-*-\n"); - printf ("@setfilename ../info/summary\n"); - printf ("@settitle Command Summary for GNU Emacs\n"); - printf ("@finalout\n"); - printf ("@unnumbered Command Summary for GNU Emacs\n"); - printf ("@table @asis\n"); - printf ("\n"); - printf ("@iftex\n"); - printf ("@global@let@ITEM@item\n"); - printf ("@def@item{@filbreak@vskip5pt@ITEM}\n"); - printf ("@font@tensy cmsy10 scaled @magstephalf\n"); - printf ("@font@teni cmmi10 scaled @magstephalf\n"); - printf ("@def\\{{@tensy@char110}}\n"); /* this backslash goes with cmr10 */ - printf ("@def|{{@tensy@char106}}\n"); - printf ("@def@{{{@tensy@char102}}\n"); - printf ("@def@}{{@tensy@char103}}\n"); - printf ("@def<{{@teni@char62}}\n"); - printf ("@def>{{@teni@char60}}\n"); - printf ("@chardef@@64\n"); - printf ("@catcode43=12\n"); - printf ("@tableindent-0.2in\n"); - printf ("@end iftex\n"); - - /* print each function from the array */ - - for (i = 0; i < cnt; i++) - { - printf ("\n@item %s @code{%s}\n@display\n", - array[i]->type == 'F' ? "Function" : "Variable", - array[i]->name); - - for (lp = array[i]->first; lp != NULL ; lp = lp->next) - { - for (bp = lp->line; *bp; bp++) - { - /* the characters "@{}" need special treatment */ - if (*bp == '@' || *bp == '{' || *bp == '}') - { - putchar('@'); - } - putchar(*bp); - } - putchar ('\n'); - } - printf("@end display\n"); - /* Try to avoid a save size overflow in the TeX output - routine. */ - if (i%100 == 0 && i > 0 && i != cnt) - printf("\n@end table\n@table @asis\n"); - } - - printf ("@end table\n"); - printf ("@bye\n"); - } - - return EXIT_SUCCESS; -} - -/* arch-tag: ce28f204-1e70-4b34-8210-3d54a5662071 - (do not change this comment) */ - -/* sorted-doc.c ends here */ === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-23 02:36:28 +0000 +++ lisp/ChangeLog 2010-10-23 02:46:06 +0000 @@ -1,5 +1,7 @@ 2010-10-23 Glenn Morris + * help-fns.el (doc-file-to-man, doc-file-to-info): New commands. + * help.el (finder-by-keyword): Remove unnecessary autoload. 2010-10-22 Glenn Morris === modified file 'lisp/help-fns.el' --- lisp/help-fns.el 2010-09-20 11:13:52 +0000 +++ lisp/help-fns.el 2010-10-23 02:46:06 +0000 @@ -887,7 +887,111 @@ (insert "\nThe parent category table is:") (describe-vector table 'help-describe-category-set)))))) + +;;; Replacements for old lib-src/ programs. Don't seem especially useful. + +;; Replaces lib-src/digest-doc.c. +;;;###autoload +(defun doc-file-to-man (file) + "Produce an nroff buffer containing the doc-strings from the DOC file." + (interactive (list (read-file-name "Name of DOC file: " doc-directory + internal-doc-file-name t))) + (or (file-readable-p file) + (error "Cannot read file `%s'" file)) + (pop-to-buffer (generate-new-buffer "*man-doc*")) + (setq buffer-undo-list t) + (insert ".TH \"Command Summary for GNU Emacs\"\n" + ".AU Richard M. Stallman\n") + (insert-file-contents file) + (let (notfirst) + (while (search-forward "" nil 'move) + (if (looking-at "S") + (delete-region (1- (point)) (line-end-position)) + (delete-char -1) + (if notfirst + (insert "\n.DE\n") + (setq notfirst t)) + (insert "\n.SH ") + (insert (if (looking-at "F") "Function " "Variable ")) + (delete-char 1) + (forward-line 1) + (insert ".DS L\n")))) + (insert "\n.DE\n") + (setq buffer-undo-list nil) + (nroff-mode)) + +;; Replaces lib-src/sorted-doc.c. +;;;###autoload +(defun doc-file-to-info (file) + "Produce a texinfo buffer with sorted doc-strings from the DOC file." + (interactive (list (read-file-name "Name of DOC file: " doc-directory + internal-doc-file-name t))) + (or (file-readable-p file) + (error "Cannot read file `%s'" file)) + (let ((i 0) type name doc alist) + (with-temp-buffer + (insert-file-contents file) + ;; The characters "@{}" need special treatment. + (while (re-search-forward "[@{}]" nil t) + (backward-char) + (insert "@") + (forward-char 1)) + (goto-char (point-min)) + (while (search-forward "" nil t) + (unless (looking-at "S") + (setq type (char-after) + name (buffer-substring (1+ (point)) (line-end-position)) + doc (buffer-substring (line-beginning-position 2) + (if (search-forward "" nil 'move) + (1- (point)) + (point))) + alist (cons (list name type doc) alist)) + (backward-char 1)))) + (pop-to-buffer (generate-new-buffer "*info-doc*")) + (setq buffer-undo-list t) + ;; Write the output header. + (insert "\\input texinfo @c -*-texinfo-*-\n" + "@setfilename emacsdoc.info\n" + "@settitle Command Summary for GNU Emacs\n" + "@finalout\n" + "\n@node Top\n" + "@unnumbered Command Summary for GNU Emacs\n\n" + "@table @asis\n\n" + "@iftex\n" + "@global@let@ITEM@item\n" + "@def@item{@filbreak@vskip5pt@ITEM}\n" + "@font@tensy cmsy10 scaled @magstephalf\n" + "@font@teni cmmi10 scaled @magstephalf\n" + "@def\\{{@tensy@char110}}\n" ; this backslash goes with cmr10 + "@def|{{@tensy@char106}}\n" + "@def@{{{@tensy@char102}}\n" + "@def@}{{@tensy@char103}}\n" + "@def<{{@teni@char62}}\n" + "@def>{{@teni@char60}}\n" + "@chardef@@64\n" + "@catcode43=12\n" + "@tableindent-0.2in\n" + "@end iftex\n") + ;; Sort the array by name; within each name, by type (functions first). + (setq alist (sort alist (lambda (e1 e2) + (if (string-equal (car e1) (car e2)) + (<= (cadr e1) (cadr e2)) + (string-lessp (car e1) (car e2)))))) + ;; Print each function. + (dolist (e alist) + (insert "\n@item " + (if (char-equal (cadr e) ?\F) "Function" "Variable") + " @code{" (car e) "}\n@display\n" + (nth 2 e) + "\n@end display\n") + ;; Try to avoid a save size overflow in the TeX output routine. + (if (zerop (setq i (% (1+ i) 100))) + (insert "\n@end table\n@table @asis\n"))) + (insert "@end table\n" + "@bye\n") + (setq buffer-undo-list nil) + (texinfo-mode))) + (provide 'help-fns) -;; arch-tag: 9e10331c-ae81-4d13-965d-c4819aaab0b3 ;;; help-fns.el ends here === modified file 'nt/README' --- nt/README 2010-01-13 08:35:10 +0000 +++ nt/README 2010-10-23 02:46:06 +0000 @@ -1,7 +1,7 @@ Emacs for Windows NT/2000 and Windows 95/98/ME - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010 Free Software Foundation, Inc. See the end of the file for license conditions. This directory contains support for compiling and running GNU Emacs on @@ -61,9 +61,6 @@ a mail spool or POP server to a local user mailbox. See the `Movemail' node of the Emacs manual. - + digest-doc.exe, sorted-doc.exe - Tools for rebuilding the - built-in documentation. - * Further information There is a web page that serves as a FAQ for the Windows port of === modified file 'nt/README.W32' --- nt/README.W32 2010-07-24 13:35:31 +0000 +++ nt/README.W32 2010-10-23 02:46:06 +0000 @@ -1,5 +1,5 @@ -Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 - Free Software Foundation, Inc. +Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010 Free Software Foundation, Inc. See the end of the file for license conditions. Emacs for Windows @@ -106,9 +106,6 @@ a mail spool or POP server to a local user mailbox. See the `Movemail' node of the Emacs manual. - + digest-doc.exe, sorted-doc.exe - Tools for rebuilding the - built-in documentation. - * Image support Emacs has built in support for XBM and PPM/PGM/PBM images, and the ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.