# HG changeset patch # User Katsumi Yamaoka # Date 1270650242 0 # Node ID 79bd972a5a7d05d3a4147de906a1d1d892f45450 # Parent c3217524a4c1f70823a107fbd8982a9d6b8bc33d# Parent bffc7a768bbdcc7e876c9c77ff959066f7dc575b Merge from mainline. diff -r c3217524a4c1 -r 79bd972a5a7d etc/NEWS --- a/etc/NEWS Mon Apr 05 14:19:20 2010 +0000 +++ b/etc/NEWS Wed Apr 07 14:24:02 2010 +0000 @@ -65,6 +65,13 @@ ** GTK scroll-bars are now placed on the right by default. Use `set-scroll-bar-mode' to change this. +** New scrolling commands `scroll-up-command' and `scroll-down-command' +(bound to [next] and [prior]) does not signal errors at top/bottom +of buffer at first key-press (instead moves to top/bottom of buffer). + +** New scrolling commands `scroll-up-line' and `scroll-down-line' +scroll a line instead of full screen. + * Editing Changes in Emacs 24.1 @@ -88,6 +95,8 @@ ** VC and related modes +*** New VC commands: vc-log-incoming and vc-log-outgoing. + *** vc-dir for Bzr supports viewing shelve contents and shelving snapshots. *** Special markup can be added to log-edit buffers. diff -r c3217524a4c1 -r 79bd972a5a7d lib-src/ChangeLog --- a/lib-src/ChangeLog Mon Apr 05 14:19:20 2010 +0000 +++ b/lib-src/ChangeLog Wed Apr 07 14:24:02 2010 +0000 @@ -1,3 +1,8 @@ +2010-04-07 Christoph (tiny change) + + * makefile.w32-in (OTHER_PLATFORM_SUPPORT): Use parenthesis + for macros for nmake compatibility. + 2010-04-03 Juanma Barranquero Add stubs for Windows, required after CVE-2010-0825 change. diff -r c3217524a4c1 -r 79bd972a5a7d lib-src/makefile.w32-in --- a/lib-src/makefile.w32-in Mon Apr 05 14:19:20 2010 +0000 +++ b/lib-src/makefile.w32-in Wed Apr 07 14:24:02 2010 +0000 @@ -195,8 +195,8 @@ $(lispsource)term/pc-win.elc \ $(lispsource)x-dnd.elc \ $(lispsource)term/x-win.elc \ - ${lispsource}emacs-lisp/easymenu.elc \ - ${lispsource}term/ns-win.elc + $(lispsource)emacs-lisp/easymenu.elc \ + $(lispsource)term/ns-win.elc lisp1= \ diff -r c3217524a4c1 -r 79bd972a5a7d lisp/ChangeLog --- a/lisp/ChangeLog Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/ChangeLog Wed Apr 07 14:24:02 2010 +0000 @@ -1,22 +1,131 @@ +2010-04-07 Jan Djärv + + * wid-edit.el (widget-choose): Move cursor to the second line of + the buffer (Bug#5695). + +2010-04-07 Dan Nicolaescu + + Add new VC methods: vc-log-incoming and vc-log-outgoing. + * vc.el (vc-print-log-setup-buttons): New function split out from + vc-print-log-internal. + (vc-log-internal-common): New function, a parametrized version of + vc-print-log-internal. + (vc-print-log-internal): Just call vc-log-internal-common with the + right arguments. + (vc-incoming-outgoing-internal): + (vc-log-incoming, vc-log-outgoing): New functions. + (vc-log-view-type): New permanent local variable. + + * vc-hooks.el (vc-menu-map): Bind vc-log-incoming and vc-log-outgoing. + + * vc-bzr.el (vc-bzr-log-view-mode): Use vc-log-view-type instead + of the dynamic bound vc-short-log. + (vc-bzr-log-incoming, vc-bzr-log-outgoing): New functions. + + * vc-git.el (vc-git-log-outgoing): New function. + (vc-git-log-view-mode): Use vc-log-view-type instead + of the dynamic bound vc-short-log. + + * vc-hg.el (vc-hg-log-view-mode): Use vc-log-view-type instead + of the dynamic bound vc-short-log. Highlight the tag. + (vc-hg-log-incoming, vc-hg-log-outgoing): New functions. + (vc-hg-outgoing, vc-hg-incoming, vc-hg-outgoing-mode): + (vc-hg-incoming-mode): Remove. + (vc-hg-extra-menu-map): Do not bind vc-hg-incoming and vc-hg-outgoing. + +2010-04-07 Dan Nicolaescu + + Fix default-directory for vc-root-diff. + * vc.el (vc-root-diff): Bind default-directory to the root + directory for the diff command. + +2010-04-07 Michael McNamara + + * progmodes/verilog-mode.el (verilog-forward-sexp): + (verilog-calc-1): Support "disable fork" and "fork wait" multi + word keywords, suggested by Steve Pearlmutter. + (verilog-pretty-declarations): Support lineup of declarations in + port lists. + (verilog-skip-backward-comments, verilog-skip-forward-comment-p): + fix bug for /* / comments + (verilog-backward-syntactic-ws, verilog-forward-syntactic-ws): + Speed up and simplfy as this is never called with a bound. + (verilog-pretty-declarations): Enhance to line up declarations + inside a parameter list, suggested by Alan Morgan. + (verilog-pretty-expr): Tune assignment regular expression match + string for corner cases; also use markers instead of character + number as indent changes the later. + +2010-04-07 Wilson Snyder + + * progmodes/verilog-mode.el (verilog-type-keywords): Fix pulldown as missing + keyword. + (verilog-read-sub-decls-line): Fix comments in AUTO_TEMPLATE + causing truncation of AUTOWIRE signals. Reported by Bruce + Tennant. + (verilog-auto-inst, verilog-auto-inst-port): Add vl_mbits for + AUTO_TEMPLATEs needing multiple array bits. Suggested by Bruce + Tennant. + (verilog-keywords): + (verilog-1800-2005-keywords, verilog-1800-2009-keywords): Add IEEE + 1800-2009 keywords, including "global.". + +2010-04-06 John Wiegley + + * ido.el (ido-add-virtual-buffers-to-list): Fix duplicated names + appearing in buffer list (if a live buffer name matched a recentf + file basename). Should use uniquify to offer a real solution. + +2010-04-06 John Wiegley + + * ido.el (ido-use-virtual-buffers, ido-virtual): Move a ChangeLog + comment to code, and add a :version tag. + (ido-virtual-buffers): Move defvar to fix byte-compiler warning. + +2010-04-06 Juanma Barranquero + + Enable recentf-mode if using virtual buffers. + * ido.el (recentf-list): Declare for byte-compiler. + (ido-virtual-buffers): Move up to silence byte-compiler. Add docstring. + (ido-make-buffer-list): Simplify. + (ido-add-virtual-buffers-to-list): Simplify. Enable recentf-mode. + +2010-04-05 Juri Linkov + + Scrolling commands which scroll a line instead of full screen. + http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01452.html + + * simple.el (scroll-up-line, scroll-down-line): New commands. + Put property isearch-scroll=t on them. + + * emulation/ws-mode.el (scroll-down-line, scroll-up-line): + Remove commands. + +2010-04-05 Juri Linkov + + Scrolling commands which do not signal errors at top/bottom. + http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01452.html + + * simple.el (scroll-up-command, scroll-down-command): New commands. + Put property isearch-scroll=t on them. + + * bindings.el (global-map): Rebind [prior] from `scroll-down' to + `scroll-down-command' and [next] from `scroll-up' to + `scroll-up-command'. + + * emulation/cua-base.el: Put property CUA=move on + `scroll-up-command' and `scroll-down-command'. + (cua--init-keymaps): Remap `scroll-up-command' to `cua-scroll-up' + and `scroll-down-command' to `cua-scroll-down'. + 2010-04-05 Juanma Barranquero - * help.el (describe-mode): Return nil (for IELM's sake). + * help.el (describe-mode): Return nil. 2010-04-04 John Wiegley * ido.el (ido-use-virtual-buffers): New variable to indicate - whether "virtual buffer" support is enabled for IDO. Essentially - it works as follows: Say you are visiting a file and the buffer - gets cleaned up by mignight.el. Later, you want to switch to that - buffer, but find it's no longer open. With virtual buffers - enabled, the buffer name stays in the buffer list (using the - ido-virtual face, and always at the end), and if you select it, it - opens the file back up again. This allows you to think less about - whether recently opened files are still open or not. Most of the - time you can quit Emacs, restart, and then switch to a file buffer - that was previously open as if it still were. NOTE: This feature - has been present in iswitchb for several years now, and I'm - porting the same logic to IDO. + whether "virtual buffer" support is enabled for IDO. (ido-virtual): Face used to indicate virtual buffers in the list. (ido-buffer-internal): If a buffer is chosen, and no such buffer exists, but a virtual buffer of that name does (which would be why diff -r c3217524a4c1 -r 79bd972a5a7d lisp/bindings.el --- a/lisp/bindings.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/bindings.el Wed Apr 07 14:24:02 2010 +0000 @@ -873,8 +873,8 @@ (define-key global-map [up] 'previous-line) (define-key global-map [right] 'forward-char) (define-key global-map [down] 'next-line) -(define-key global-map [prior] 'scroll-down) -(define-key global-map [next] 'scroll-up) +(define-key global-map [prior] 'scroll-down-command) +(define-key global-map [next] 'scroll-up-command) (define-key global-map [C-up] 'backward-paragraph) (define-key global-map [C-down] 'forward-paragraph) (define-key global-map [C-prior] 'scroll-right) diff -r c3217524a4c1 -r 79bd972a5a7d lisp/calc/calc-frac.el --- a/lisp/calc/calc-frac.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/calc/calc-frac.el Wed Apr 07 14:24:02 2010 +0000 @@ -205,16 +205,32 @@ n temp)) (math-div n d))) - - (defun calcFunc-fdiv (a b) ; [R I I] [Public] - (if (Math-num-integerp a) - (if (Math-num-integerp b) - (if (Math-zerop b) - (math-reject-arg a "*Division by zero") - (math-make-frac (math-trunc a) (math-trunc b))) - (math-reject-arg b 'integerp)) - (math-reject-arg a 'integerp))) + (cond + ((Math-num-integerp a) + (cond + ((Math-num-integerp b) + (if (Math-zerop b) + (math-reject-arg a "*Division by zero") + (math-make-frac (math-trunc a) (math-trunc b)))) + ((eq (car-safe b) 'frac) + (if (Math-zerop (nth 1 b)) + (math-reject-arg a "*Division by zero") + (math-make-frac (math-mul (math-trunc a) (nth 2 b)) (nth 1 b)))) + (t (math-reject-arg b 'integerp)))) + ((eq (car-safe a) 'frac) + (cond + ((Math-num-integerp b) + (if (Math-zerop b) + (math-reject-arg a "*Division by zero") + (math-make-frac (cadr a) (math-mul (nth 2 a) (math-trunc b))))) + ((eq (car-safe b) 'frac) + (if (Math-zerop (nth 1 b)) + (math-reject-arg a "*Division by zero") + (math-make-frac (math-mul (nth 1 a) (nth 2 b)) (math-mul (nth 2 a) (nth 1 b))))) + (t (math-reject-arg b 'integerp)))) + (t + (math-reject-arg a 'integerp)))) (provide 'calc-frac) diff -r c3217524a4c1 -r 79bd972a5a7d lisp/emulation/cua-base.el --- a/lisp/emulation/cua-base.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/emulation/cua-base.el Wed Apr 07 14:24:02 2010 +0000 @@ -1440,6 +1440,8 @@ ;; scrolling (define-key cua-global-keymap [remap scroll-up] 'cua-scroll-up) (define-key cua-global-keymap [remap scroll-down] 'cua-scroll-down) + (define-key cua-global-keymap [remap scroll-up-command] 'cua-scroll-up) + (define-key cua-global-keymap [remap scroll-down-command] 'cua-scroll-down) (define-key cua--cua-keys-keymap [(control x) timeout] 'kill-region) (define-key cua--cua-keys-keymap [(control c) timeout] 'copy-region-as-kill) @@ -1499,6 +1501,7 @@ move-end-of-line move-beginning-of-line end-of-buffer beginning-of-buffer scroll-up scroll-down + scroll-up-command scroll-down-command up-list down-list backward-up-list end-of-defun beginning-of-defun forward-sexp backward-sexp diff -r c3217524a4c1 -r 79bd972a5a7d lisp/emulation/ws-mode.el --- a/lisp/emulation/ws-mode.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/emulation/ws-mode.el Wed Apr 07 14:24:02 2010 +0000 @@ -339,16 +339,6 @@ (+ left-margin (/ (- fill-column left-margin line-length) 2)))))) -(defun scroll-down-line () - "Scroll one line down." - (interactive) - (scroll-down 1)) - -(defun scroll-up-line () - "Scroll one line up." - (interactive) - (scroll-up 1)) - ;;;;;;;;;;; ;; wordstar special variables: diff -r c3217524a4c1 -r 79bd972a5a7d lisp/help.el --- a/lisp/help.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/help.el Wed Apr 07 14:24:02 2010 +0000 @@ -873,6 +873,7 @@ (add-text-properties start (point) '(face bold))))) (princ " mode:\n") (princ (documentation major-mode))))) + ;; For the sake of IELM and maybe others nil) diff -r c3217524a4c1 -r 79bd972a5a7d lisp/ido.el --- a/lisp/ido.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/ido.el Wed Apr 07 14:24:02 2010 +0000 @@ -323,6 +323,7 @@ ;;; Code: (defvar cua-inhibit-cua-keys) +(defvar recentf-list) ;;; User Variables ;; @@ -776,8 +777,19 @@ (defcustom ido-use-virtual-buffers nil "If non-nil, refer to past buffers as well as existing ones. -This feature relies upon the `recentf' package, which will be +Essentially it works as follows: Say you are visiting a file and +the buffer gets cleaned up by mignight.el. Later, you want to +switch to that buffer, but find it's no longer open. With +virtual buffers enabled, the buffer name stays in the buffer +list (using the ido-virtual face, and always at the end), and if +you select it, it opens the file back up again. This allows you +to think less about whether recently opened files are still open +or not. Most of the time you can quit Emacs, restart, and then +switch to a file buffer that was previously open as if it still +were. + This feature relies upon the `recentf' package, which will be enabled if this variable is configured to a non-nil value." + :version "24.1" :type 'boolean :group 'ido) @@ -807,6 +819,7 @@ (defface ido-virtual '((t (:inherit font-lock-builtin-face))) "Face used by ido for matching virtual buffer names." + :version "24.1" :group 'ido) (defface ido-indicator '((((min-colors 88) (class color)) @@ -1041,6 +1054,11 @@ "Non-nil means to explicitly cursor on entry to minibuffer. Value is an integer which is number of chars to right of prompt.") +(defvar ido-virtual-buffers nil + "List of virtual buffers, that is, past visited files. +This is a copy of `recentf-list', pared down and with faces applied. +Only used if `ido-use-virtual-buffers' is non-nil.") + ;;; Variables with dynamic bindings. ;;; Declared here to keep the byte compiler quiet. @@ -3366,37 +3384,31 @@ (if ido-temp-list (nconc ido-temp-list ido-current-buffers) (setq ido-temp-list ido-current-buffers)) - (if (and default (buffer-live-p (get-buffer default))) - (progn - (setq ido-temp-list - (delete default ido-temp-list)) - (setq ido-temp-list - (cons default ido-temp-list)))) + (when (and default (buffer-live-p (get-buffer default))) + (setq ido-temp-list + (cons default (delete default ido-temp-list)))) (if ido-use-virtual-buffers (ido-add-virtual-buffers-to-list)) (run-hooks 'ido-make-buffer-list-hook) ido-temp-list)) -(defvar ido-virtual-buffers nil) - (defun ido-add-virtual-buffers-to-list () "Add recently visited files, and bookmark files, to the buffer list. This is to make them appear as if they were \"virtual buffers\"." ;; If no buffers matched, and virtual buffers are being used, then ;; consult the list of past visited files, to see if we can find ;; the file which the user might thought was still open. + (unless recentf-mode (recentf-mode 1)) (setq ido-virtual-buffers nil) - (let ((head recentf-list) name) - (while head - (if (and (setq name (file-name-nondirectory (car head))) - (null (get-file-buffer (car head))) - (not (assoc name ido-virtual-buffers)) - (not (ido-ignore-item-p name ido-ignore-buffers)) - ;;(file-exists-p (car head)) - ) - (setq ido-virtual-buffers - (cons (cons name (car head)) ido-virtual-buffers))) - (setq head (cdr head)))) + (let (name) + (dolist (head recentf-list) + (and (setq name (file-name-nondirectory head)) + (null (get-file-buffer head)) + (not (assoc name ido-virtual-buffers)) + (not (member name ido-temp-list)) + (not (ido-ignore-item-p name ido-ignore-buffers)) + ;;(file-exists-p head) + (push (cons name head) ido-virtual-buffers)))) (when ido-virtual-buffers (if ido-use-faces (dolist (comp ido-virtual-buffers) diff -r c3217524a4c1 -r 79bd972a5a7d lisp/progmodes/verilog-mode.el --- a/lisp/progmodes/verilog-mode.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/progmodes/verilog-mode.el Wed Apr 07 14:24:02 2010 +0000 @@ -79,7 +79,7 @@ ;; .emacs, or in your site's site-load.el ; (autoload 'verilog-mode "verilog-mode" "Verilog mode" t ) -; (add-to-list 'auto-mode-alist '("\\.[ds]?v\\'" . verilog-mode)) +; (add-to-list 'auto-mode-alist '("\\.[ds]?vh?\\'" . verilog-mode)) ;; If you want to customize Verilog mode to fit your needs better, ;; you may add these lines (the values of the variables presented @@ -118,9 +118,9 @@ ;;; Code: ;; This variable will always hold the version number of the mode -(defconst verilog-mode-version "556" +(defconst verilog-mode-version "565" "Version of this Verilog mode.") -(defconst verilog-mode-release-date "2009-12-10-GNU" +(defconst verilog-mode-release-date "2010-03-01-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.") @@ -2116,7 +2116,8 @@ `( "endmodule" "endprimitive" "endinterface" "endpackage" "endprogram" "endclass" )))) -(defconst verilog-disable-fork-re "disable\\s-+fork") +(defconst verilog-disable-fork-re "disable\\s-+fork\\>") +(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 "\\(\\\\|\\\\)" @@ -2198,6 +2199,11 @@ "unique" "unsigned" "use" "uwire" "var" "vectored" "virtual" "void" "wait" "wait_order" "wand" "weak0" "weak1" "while" "wildcard" "wire" "with" "within" "wor" "xnor" "xor" + ;; 1800-2009 + "accept_on" "checker" "endchecker" "eventually" "global" "implies" + "let" "nexttime" "reject_on" "restrict" "s_always" "s_eventually" + "s_nexttime" "s_until" "s_until_with" "strong" "sync_accept_on" + "sync_reject_on" "unique0" "until" "until_with" "untyped" "weak" ) "List of Verilog keywords.") @@ -2314,7 +2320,7 @@ "and" "bit" "buf" "bufif0" "bufif1" "cmos" "defparam" "event" "genvar" "inout" "input" "integer" "localparam" "logic" "mailbox" "nand" "nmos" "not" "notif0" "notif1" "or" - "output" "parameter" "pmos" "pull0" "pull1" "pullup" + "output" "parameter" "pmos" "pull0" "pull1" "pulldown" "pullup" "rcmos" "real" "realtime" "reg" "rnmos" "rpmos" "rtran" "rtranif0" "rtranif1" "semaphore" "signed" "struct" "supply" "supply0" "supply1" "time" "tran" "tranif0" "tranif1" @@ -2328,7 +2334,7 @@ '("surefire" "synopsys" "rtl_synthesis" "verilint" "leda" "0in") nil ))) - (verilog-p1800-keywords + (verilog-1800-2005-keywords (eval-when-compile (verilog-regexp-opt '("alias" "assert" "assume" "automatic" "before" "bind" @@ -2352,6 +2358,15 @@ "wait_order" "weak0" "weak1" "wildcard" "with" "within" ) nil ))) + (verilog-1800-2009-keywords + (eval-when-compile + (verilog-regexp-opt + '("accept_on" "checker" "endchecker" "eventually" "global" + "implies" "let" "nexttime" "reject_on" "restrict" "s_always" + "s_eventually" "s_nexttime" "s_until" "s_until_with" "strong" + "sync_accept_on" "sync_reject_on" "unique0" "until" + "until_with" "untyped" "weak" ) nil ))) + (verilog-ams-keywords (eval-when-compile (verilog-regexp-opt @@ -2403,11 +2418,17 @@ 'font-lock-type-face)) (cons (concat "\\<\\(" verilog-type-font-keywords "\\)\\>") 'font-lock-type-face) - ;; Fontify IEEE-P1800 keywords appropriately + ;; Fontify IEEE-1800-2005 keywords appropriately (if verilog-highlight-p1800-keywords - (cons (concat "\\<\\(" verilog-p1800-keywords "\\)\\>") + (cons (concat "\\<\\(" verilog-1800-2005-keywords "\\)\\>") 'verilog-font-lock-p1800-face) - (cons (concat "\\<\\(" verilog-p1800-keywords "\\)\\>") + (cons (concat "\\<\\(" verilog-1800-2005-keywords "\\)\\>") + 'font-lock-type-face)) + ;; Fontify IEEE-1800-2009 keywords appropriately + (if verilog-highlight-p1800-keywords + (cons (concat "\\<\\(" verilog-1800-2009-keywords "\\)\\>") + 'verilog-font-lock-p1800-face) + (cons (concat "\\<\\(" verilog-1800-2009-keywords "\\)\\>") 'font-lock-type-face)) ;; Fontify Verilog-AMS keywords (cons (concat "\\<\\(" verilog-ams-keywords "\\)\\>") @@ -2580,20 +2601,28 @@ (setq md 3) ;; ender is third item in regexp ) ((match-end 4) - ;; might be "disable fork" - (if (or - (looking-at verilog-disable-fork-re) - (and (looking-at "fork") - (progn - (forward-word -1) - (looking-at verilog-disable-fork-re)))) - (progn - (goto-char (match-end 0)) - (forward-word 1) - (setq reg nil)) - (progn - ;; Search forward for matching join - (setq reg "\\(\\\\)\\|\\(\\\\)" )))) + ;; might be "disable fork" or "fork wait" + (let + (here) + (if (looking-at verilog-fork-wait-re) + (progn ;; it is a fork wait; ignore it + (goto-char (match-end 0)) + (setq reg nil)) + (if (or + (looking-at verilog-disable-fork-re) + (and (looking-at "fork") + (progn + (setq here (point)) ;; sometimes a fork is just a fork + (forward-word -1) + (looking-at verilog-disable-fork-re)))) + (progn ;; it is a disable fork; ignore it + (goto-char (match-end 0)) + (forward-word 1) + (setq reg nil)) + (progn ;; it is a nice simple fork + (goto-char here) ;; return from looking for "disable fork" + ;; Search forward for matching join + (setq reg "\\(\\\\)\\|\\(\\\\)" )))))) ((match-end 6) ;; Search forward for matching endclass (setq reg "\\(\\\\)\\|\\(\\\\)" )) @@ -2644,12 +2673,27 @@ (let ((depth 1)) (while (verilog-re-search-forward reg nil 'move) (cond - ((match-end md) ; the closer in reg, so we are climbing out + ((match-end md) ; a closer in regular expression, so we are climbing out (setq depth (1- depth)) (if (= 0 depth) ; we are out! (throw 'skip 1))) - ((match-end 1) ; the opener in reg, so we are deeper now - (setq depth (1+ depth)))))) + ((match-end 1) ; an opener in the r-e, so we are in deeper now + (setq here (point)) ; remember where we started + (goto-char (match-beginning 1)) + (cond + ((looking-at verilog-fork-wait-re) + (goto-char (match-end 0))) ; false alarm + ((if (or + (looking-at verilog-disable-fork-re) + (and (looking-at "fork") + (progn + (forward-word -1) + (looking-at verilog-disable-fork-re)))) + (progn ;; it is a disable fork; another false alarm + (goto-char (match-end 0))) + (progn ;; it is a simple fork (or has nothing to do with fork) + (goto-char here) + (setq depth (1+ depth)))))))))) (if (verilog-re-search-forward reg nil 'move) (throw 'skip 1)))))) @@ -4532,8 +4576,9 @@ ((match-end 4) ; *sigh* could be "disable fork" (let ((here (point))) (verilog-beg-of-statement) - (if (looking-at verilog-disable-fork-re) - t ; is disable fork, this is a normal statement + (if (or (looking-at verilog-disable-fork-re) + (looking-at verilog-fork-wait-re)) + t ; this is a normal statement (progn ; or is fork, starts a new block (goto-char here) (throw 'nesting 'block))))) @@ -4882,31 +4927,13 @@ (goto-char back) t)))))))) -(defun verilog-backward-syntactic-ws (&optional bound) - "Backward skip over syntactic whitespace for Emacs 19. -Optional BOUND limits search." - (save-restriction - (let* ((bound (or bound (point-min))) (here bound) ) - (if (< bound (point)) - (progn - (narrow-to-region bound (point)) - (while (/= here (point)) - (setq here (point)) - (verilog-skip-backward-comments)))))) - t) - -(defun verilog-forward-syntactic-ws (&optional bound) - "Forward skip over syntactic whitespace for Emacs 19. -Optional BOUND limits search." - (save-restriction - (let* ((bound (or bound (point-max))) - (here bound)) - (if (> bound (point)) - (progn - (narrow-to-region (point) bound) - (while (/= here (point)) - (setq here (point)) - (forward-comment (buffer-size)))))))) +(defun verilog-backward-syntactic-ws () + (verilog-skip-backward-comments) + (forward-comment (- (buffer-size)))) + +(defun verilog-forward-syntactic-ws () + (verilog-skip-forward-comment-p) + (forward-comment (buffer-size))) (defun verilog-backward-ws&directives (&optional bound) "Backward skip over syntactic whitespace and compiler directives for Emacs 19. @@ -5119,14 +5146,11 @@ (search-backward "/*") (skip-chars-backward " \t\n\f") t) - ((and (not (bobp)) - (= (char-before) ?\/) - (= (char-before (1- (point))) ?\*)) - (goto-char (- (point) 2)) - t) - (t - (skip-chars-backward " \t\n\f") - nil))))))) + ((if (and (not (bobp)) + (= (char-before) ?\/) + (= (char-before (1- (point))) ?\*)) + (goto-char (- (point) 2)) + (/= (skip-chars-backward " \t\n\f") 0))))))))) (defun verilog-skip-forward-comment-p () "If in comment, move to end and return true." @@ -5134,16 +5158,18 @@ (progn (setq state (save-excursion (verilog-syntax-ppss))) (cond - ((nth 3 state) + ((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 - nil))))) + (skip-chars-forward " \t\n\f")))))) (defun verilog-indent-line-relative () "Cheap version of indent line. @@ -5376,108 +5402,143 @@ "Line up declarations around point. Be verbose about progress unless optional QUIET set." (interactive) - (save-excursion - (if (progn - (verilog-beg-of-statement-1) - (and (not (verilog-in-directive-p)) ;; could have `define input foo - (not (verilog-parenthesis-depth)) ;; could be in a #(param block ) + (let* ((m1 (make-marker)) + (e (point)) + el + r + (here (point)) + ind + start + startpos + end + endpos + base-ind + ) + (save-excursion + (if (progn +; (verilog-beg-of-statement-1) + (beginning-of-line) + (verilog-forward-syntactic-ws) + (and (not (verilog-in-directive-p)) ;; could have `define input foo (looking-at verilog-declaration-re))) - (let* ((m1 (make-marker)) - (e (point)) - (r) - (here (point)) - ;; Start of declaration range - (start - (progn - (verilog-beg-of-statement-1) - (while (and (looking-at verilog-declaration-re) - (not (bobp))) - (skip-chars-backward " \t") - (setq e (point)) - (beginning-of-line) - (verilog-backward-syntactic-ws) - (backward-char) - (verilog-beg-of-statement-1)) - e)) - ;; End of declaration range - (end - (progn - (goto-char here) - (verilog-end-of-statement) - (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)) - e)) - (edpos (set-marker (make-marker) end)) - (ind) - (base-ind - (progn - (goto-char start) - (verilog-do-indent (verilog-calculate-indent)) - (verilog-forward-ws&directives) - (current-column)))) - (goto-char start) - (if (and (not quiet) - (> (- end start) 100)) - (message "Lining up declarations..(please stand by)")) - ;; Get the beginning of line indent first - (while (progn (setq e (marker-position edpos)) - (< (point) e)) - (cond - ( (save-excursion (skip-chars-backward " \t") - (bolp)) - (verilog-forward-ws&directives) - (indent-line-to base-ind) - (verilog-forward-ws&directives) - (verilog-re-search-forward "[ \t\n\f]" e 'move)) - (t - (just-one-space) - (verilog-re-search-forward "[ \t\n\f]" e 'move))) - ;;(forward-line) - ) - ;; Now find biggest prefix - (setq ind (verilog-get-lineup-indent start edpos)) - ;; Now indent each line. - (goto-char start) - (while (progn (setq e (marker-position edpos)) - (setq r (- e (point))) - (> r 0)) - (setq e (point)) - (unless quiet (message "%d" r)) - (verilog-indent-line) - (cond - ((or (and verilog-indent-declaration-macros - (looking-at verilog-declaration-re-2-macro)) - (looking-at verilog-declaration-re-2-no-macro)) - (let ((p (match-end 0))) - (set-marker m1 p) - (if (verilog-re-search-forward "[[#`]" p 'move) - (progn - (forward-char -1) - (just-one-space) - (goto-char (marker-position m1)) - (just-one-space) - (indent-to ind)) - (progn - (just-one-space) - (indent-to ind))))) - ((verilog-continued-line-1 start) - (goto-char e) - (indent-line-to ind)) - ((verilog-in-struct-p) - ;; could have a declaration of a user defined item - (goto-char e) - (verilog-end-of-statement)) - (t ; Must be comment or white space - (goto-char e) - (verilog-forward-ws&directives) - (forward-line -1))) - (forward-line 1)) - (unless quiet (message "")))))) + (progn + (if (verilog-parenthesis-depth) + ;; in an argument list or parameter block + (setq el (backward-up-list -1) + start (progn + (goto-char e) + (backward-up-list 1) + (forward-line) ;; ignore ( input foo, + (verilog-re-search-forward verilog-declaration-re el 'move) + (goto-char (match-beginning 0)) + (skip-chars-backward " \t") + (point)) + startpos (set-marker (make-marker) start) + end (progn + (goto-char start) + (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)) + ) + ;; in a declaration block (not in argument list) + (setq + start (progn + (verilog-beg-of-statement-1) + (while (and (looking-at verilog-declaration-re) + (not (bobp))) + (skip-chars-backward " \t") + (setq e (point)) + (beginning-of-line) + (verilog-backward-syntactic-ws) + (backward-char) + (verilog-beg-of-statement-1)) + e) + startpos (set-marker (make-marker) start) + end (progn + (goto-char here) + (verilog-end-of-statement) + (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)) + e) + endpos (set-marker (make-marker) end) + base-ind (progn + (goto-char start) + (verilog-do-indent (verilog-calculate-indent)) + (verilog-forward-ws&directives) + (current-column)))) + ;; OK, start and end are set + (goto-char (marker-position startpos)) + (if (and (not quiet) + (> (- end start) 100)) + (message "Lining up declarations..(please stand by)")) + ;; Get the beginning of line indent first + (while (progn (setq e (marker-position endpos)) + (< (point) e)) + (cond + ((save-excursion (skip-chars-backward " \t") + (bolp)) + (verilog-forward-ws&directives) + (indent-line-to base-ind) + (verilog-forward-ws&directives) + (if (< (point) e) + (verilog-re-search-forward "[ \t\n\f]" e 'move))) + (t + (just-one-space) + (verilog-re-search-forward "[ \t\n\f]" e 'move))) + ;;(forward-line) + ) + ;; Now find biggest prefix + (setq ind (verilog-get-lineup-indent (marker-position startpos) endpos)) + ;; Now indent each line. + (goto-char (marker-position startpos)) + (while (progn (setq e (marker-position endpos)) + (setq r (- e (point))) + (> r 0)) + (setq e (point)) + (unless quiet (message "%d" r)) + (verilog-indent-line) + (verilog-forward-ws&directives) + (cond + ((or (and verilog-indent-declaration-macros + (looking-at verilog-declaration-re-2-macro)) + (looking-at verilog-declaration-re-2-no-macro)) + (let ((p (match-end 0))) + (set-marker m1 p) + (if (verilog-re-search-forward "[[#`]" p 'move) + (progn + (forward-char -1) + (just-one-space) + (goto-char (marker-position m1)) + (just-one-space) + (indent-to ind)) + (progn + (just-one-space) + (indent-to ind))))) + ((verilog-continued-line-1 (marker-position startpos)) + (goto-char e) + (indent-line-to ind)) + ((verilog-in-struct-p) + ;; could have a declaration of a user defined item + (goto-char e) + (verilog-end-of-statement)) + (t ; Must be comment or white space + (goto-char e) + (verilog-forward-ws&directives) + (forward-line -1))) + (forward-line 1)) + (unless quiet (message ""))))))) (defun verilog-pretty-expr (&optional quiet myre) "Line up expressions around point, optionally QUIET with regexp MYRE." @@ -5486,7 +5547,8 @@ (if (or (eq myre nil) (string-equal myre "")) (setq myre "\\(<\\|:\\)?=")) - (setq myre (concat "\\(^[^;#:<=>]*\\)\\(" myre "\\)")) + ;; want to match the first <= | := | = + (setq myre (concat "\\(^.*?\\)\\(" myre "\\)")) (let ((rexp(concat "^\\s-*" verilog-complete-reg))) (beginning-of-line) (if (and (not (looking-at rexp )) @@ -5529,7 +5591,7 @@ (beginning-of-line) ) e)) - (edpos (set-marker (make-marker) end)) + (endpos (set-marker (make-marker) end)) (ind) ) (goto-char start) @@ -5539,7 +5601,7 @@ (message "Lining up expressions..(please stand by)")) ;; Set indent to minimum throughout region - (while (< (point) (marker-position edpos)) + (while (< (point) (marker-position endpos)) (beginning-of-line) (verilog-just-one-space myre) (end-of-line) @@ -5547,11 +5609,11 @@ ) ;; Now find biggest prefix - (setq ind (verilog-get-lineup-indent-2 myre start edpos)) + (setq ind (verilog-get-lineup-indent-2 myre start endpos)) ;; Now indent each line. (goto-char start) - (while (progn (setq e (marker-position edpos)) + (while (progn (setq e (marker-position endpos)) (setq r (- e (point))) (> r 0)) (setq e (point)) @@ -5679,7 +5741,8 @@ ;; No lineup-string found (goto-char b) (end-of-line) - (skip-chars-backward " \t") + (verilog-backward-syntactic-ws) + ;;(skip-chars-backward " \t") (1+ (current-column)))))) (defun verilog-get-lineup-indent-2 (myre b edpos) @@ -5747,7 +5810,7 @@ '( "and" "buf" "bufif0" "bufif1" "cmos" "defparam" "inout" "input" "integer" "localparam" "logic" "mailbox" "nand" "nmos" "nor" "not" "notif0" - "notif1" "or" "output" "parameter" "pmos" "pull0" "pull1" "pullup" + "notif1" "or" "output" "parameter" "pmos" "pull0" "pull1" "pulldown" "pullup" "rcmos" "real" "realtime" "reg" "rnmos" "rpmos" "rtran" "rtranif0" "rtranif1" "semaphore" "time" "tran" "tranif0" "tranif1" "tri" "tri0" "tri1" "triand" "trior" "trireg" "wand" "wire" "wor" "xnor" "xor" @@ -6974,7 +7037,7 @@ (verilog-read-sub-decls-expr submoddecls comment port (buffer-substring - (point) (1- (progn (backward-char 1) ; start at ( + (point) (1- (progn (search-backward "(") ; start at ( (forward-sexp 1) (point)))))))) ; expr ;; (forward-line 1))))) @@ -8747,6 +8810,8 @@ (defvar vl-name nil "See `verilog-auto-inst'.") ; Prevent compile warning (defvar vl-width nil "See `verilog-auto-inst'.") ; Prevent compile warning (defvar vl-dir nil "See `verilog-auto-inst'.") ; Prevent compile warning +(defvar vl-bits nil "See `verilog-auto-inst'.") ; Prevent compile warning +(defvar vl-mbits nil "See `verilog-auto-inst'.") ; Prevent compile warning (defun verilog-auto-inst-port (port-st indent-pt tpl-list tpl-num for-star par-values) "Print out a instantiation connection for this PORT-ST. @@ -8762,6 +8827,8 @@ (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) + (verilog-sig-multidim-string port-st) "")) (vl-bits (if (or verilog-auto-inst-vector (not (assoc port vector-skip-list)) (not (equal (verilog-sig-bits port-st) @@ -9110,6 +9177,7 @@ vl-name Name portion of the input/output port. vl-bits Bus bits portion of the input/output port ('[2:0]'). + vl-mbits Multidimensional array bits for port ('[2:0][3:0]'). vl-width Width of the input/output port ('3' for [2:0]). May be a (...) expression if bits isn't a constant. vl-dir Direction of the pin input/output/inout/interface. diff -r c3217524a4c1 -r 79bd972a5a7d lisp/simple.el --- a/lisp/simple.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/simple.el Wed Apr 07 14:24:02 2010 +0000 @@ -4738,6 +4738,89 @@ visual-line-mode turn-on-visual-line-mode :lighter " vl") +;;; Scrolling commands. + +;;; Scrolling commands which does not signal errors at top/bottom +;;; of buffer at first key-press (instead moves to top/bottom +;;; of buffer). + +(defun scroll-up-command (&optional arg) + "Scroll text of selected window upward ARG lines; or near full screen if no ARG. +If `scroll-up' cannot scroll window further, move cursor to the bottom line. +When point is already on that position, then signal an error. +A near full screen is `next-screen-context-lines' less than a full screen. +Negative ARG means scroll downward. +If ARG is the atom `-', scroll downward by nearly full screen." + (interactive "^P") + (cond + ((eq arg '-) (scroll-down-command nil)) + ((< (prefix-numeric-value arg) 0) + (scroll-down-command (- (prefix-numeric-value arg)))) + ((eobp) + (scroll-up arg)) ; signal error + (t + (condition-case nil + (scroll-up arg) + (end-of-buffer + (if arg + ;; When scrolling by ARG lines can't be done, + ;; move by ARG lines instead. + (forward-line arg) + ;; When ARG is nil for full-screen scrolling, + ;; move to the bottom of the buffer. + (goto-char (point-max)))))))) + +(put 'scroll-up-command 'isearch-scroll t) + +(defun scroll-down-command (&optional arg) + "Scroll text of selected window down ARG lines; or near full screen if no ARG. +If `scroll-down' cannot scroll window further, move cursor to the top line. +When point is already on that position, then signal an error. +A near full screen is `next-screen-context-lines' less than a full screen. +Negative ARG means scroll upward. +If ARG is the atom `-', scroll upward by nearly full screen." + (interactive "^P") + (cond + ((eq arg '-) (scroll-up-command nil)) + ((< (prefix-numeric-value arg) 0) + (scroll-up-command (- (prefix-numeric-value arg)))) + ((bobp) + (scroll-down arg)) ; signal error + (t + (condition-case nil + (scroll-down arg) + (beginning-of-buffer + (if arg + ;; When scrolling by ARG lines can't be done, + ;; move by ARG lines instead. + (forward-line (- arg)) + ;; When ARG is nil for full-screen scrolling, + ;; move to the top of the buffer. + (goto-char (point-min)))))))) + +(put 'scroll-down-command 'isearch-scroll t) + +;;; Scrolling commands which scroll a line instead of full screen. + +(defun scroll-up-line (&optional arg) + "Scroll text of selected window upward ARG lines; or one line if no ARG. +If ARG is omitted or nil, scroll upward by one line. +This is different from `scroll-up-command' that scrolls a full screen." + (interactive "p") + (scroll-up (or arg 1))) + +(put 'scroll-up-line 'isearch-scroll t) + +(defun scroll-down-line (&optional arg) + "Scroll text of selected window down ARG lines; or one line if no ARG. +If ARG is omitted or nil, scroll down by one line. +This is different from `scroll-down-command' that scrolls a full screen." + (interactive "p") + (scroll-down (or arg 1))) + +(put 'scroll-down-line 'isearch-scroll t) + + (defun scroll-other-window-down (lines) "Scroll the \"other window\" down. For more details, see the documentation for `scroll-other-window'." diff -r c3217524a4c1 -r 79bd972a5a7d lisp/vc-bzr.el --- a/lisp/vc-bzr.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/vc-bzr.el Wed Apr 07 14:24:02 2010 +0000 @@ -478,7 +478,6 @@ (defvar log-view-font-lock-keywords) (defvar log-view-current-tag-function) (defvar log-view-per-file-logs) -(defvar vc-short-log) (define-derived-mode vc-bzr-log-view-mode log-view-mode "Bzr-Log-View" (remove-hook 'log-view-mode-hook 'vc-bzr-log-view-mode) ;Deactivate the hack. @@ -486,13 +485,13 @@ (set (make-local-variable 'log-view-per-file-logs) nil) (set (make-local-variable 'log-view-file-re) "\\`a\\`") (set (make-local-variable 'log-view-message-re) - (if vc-short-log + (if (eq vc-log-view-type 'short) "^ *\\([0-9.]+\\): \\(.*?\\)[ \t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)\\( \\[merge\\]\\)?" "^ *\\(?:revno: \\([0-9.]+\\)\\|merged: .+\\)")) (set (make-local-variable 'log-view-font-lock-keywords) ;; log-view-font-lock-keywords is careful to use the buffer-local ;; value of log-view-message-re only since Emacs-23. - (if vc-short-log + (if (eq vc-log-view-type 'short) (append `((,log-view-message-re (1 'log-view-message-face) (2 'change-log-name) @@ -526,6 +525,14 @@ (list vc-bzr-log-switches) vc-bzr-log-switches))))) +(defun vc-bzr-log-incoming (buffer remote-location) + (apply 'vc-bzr-command "missing" buffer 'async nil + (list "--theirs-only" (unless (string= remote-location "") remote-location)))) + +(defun vc-bzr-log-outgoing (buffer remote-location) + (apply 'vc-bzr-command "missing" buffer 'async nil + (list "--mine-only" (unless (string= remote-location "") remote-location)))) + (defun vc-bzr-show-log-entry (revision) "Find entry for patch name REVISION in bzr change log buffer." (goto-char (point-min)) diff -r c3217524a4c1 -r 79bd972a5a7d lisp/vc-git.el --- a/lisp/vc-git.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/vc-git.el Wed Apr 07 14:24:02 2010 +0000 @@ -592,25 +592,32 @@ (when start-revision (list start-revision)) '("--"))))))) +(defun vc-git-log-outgoing (buffer remote-location) + (interactive) + (vc-git-command + buffer 0 nil + "log" (if (string= remote-location "") + ;; FIXME: this hardcodes the location, it should compute + ;; it properly. + "origin/master..HEAD" + remote-location))) + (defvar log-view-message-re) (defvar log-view-file-re) (defvar log-view-font-lock-keywords) (defvar log-view-per-file-logs) -;; Dynamically bound. -(defvar vc-short-log) - (define-derived-mode vc-git-log-view-mode log-view-mode "Git-Log-View" (require 'add-log) ;; We need the faces add-log. ;; Don't have file markers, so use impossible regexp. (set (make-local-variable 'log-view-file-re) "\\`a\\`") (set (make-local-variable 'log-view-per-file-logs) nil) (set (make-local-variable 'log-view-message-re) - (if vc-short-log + (if (eq vc-log-view-type 'short) "^\\(?:[*/\\| ]+ \\)?\\(?: ([^)]+)\\)?\\([0-9a-z]+\\) \\([-a-z0-9]+\\) \\(.*\\)" "^commit *\\([0-9a-z]+\\)")) (set (make-local-variable 'log-view-font-lock-keywords) - (if vc-short-log + (if (eq vc-log-view-type 'short) '( ;; Same as log-view-message-re, except that we don't ;; want the shy group for the tag name. diff -r c3217524a4c1 -r 79bd972a5a7d lisp/vc-hg.el --- a/lisp/vc-hg.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/vc-hg.el Wed Apr 07 14:24:02 2010 +0000 @@ -245,23 +245,23 @@ (defvar log-view-file-re) (defvar log-view-font-lock-keywords) (defvar log-view-per-file-logs) -(defvar vc-short-log) (define-derived-mode vc-hg-log-view-mode log-view-mode "Hg-Log-View" (require 'add-log) ;; we need the add-log faces (set (make-local-variable 'log-view-file-re) "\\`a\\`") (set (make-local-variable 'log-view-per-file-logs) nil) (set (make-local-variable 'log-view-message-re) - (if vc-short-log - "^\\([0-9]+\\)\\(?:\\[.*\\]\\)? +\\([0-9a-z]\\{12\\}\\) +\\(\\(?:[0-9]+\\)-\\(?:[0-9]+\\)-\\(?:[0-9]+\\) \\(?:[0-9]+\\):\\(?:[0-9]+\\) \\(?:[-+0-9]+\\)\\) +\\(.*\\)$" + (if (eq vc-log-view-type 'short) + "^\\([0-9]+\\)\\(\\[.*\\]\\)? +\\([0-9a-z]\\{12\\}\\) +\\(\\(?:[0-9]+\\)-\\(?:[0-9]+\\)-\\(?:[0-9]+\\) \\(?:[0-9]+\\):\\(?:[0-9]+\\) \\(?:[-+0-9]+\\)\\) +\\(.*\\)$" "^changeset:[ \t]*\\([0-9]+\\):\\(.+\\)")) (set (make-local-variable 'log-view-font-lock-keywords) - (if vc-short-log + (if (eq vc-log-view-type 'short) (append `((,log-view-message-re (1 'log-view-message-face) - (2 'log-view-message-face) - (3 'change-log-date) - (4 'change-log-name)))) + (2 'highlight nil lax) + (3 'log-view-message-face) + (4 'change-log-date) + (5 'change-log-name)))) (append log-view-font-lock-keywords '( @@ -277,7 +277,8 @@ ("^user:[ \t]+\\([A-Za-z0-9_.+-]+\\(?:@[A-Za-z0-9_.-]+\\)?\\)" (1 'change-log-email)) ("^date: \\(.+\\)" (1 'change-log-date)) - ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message))))))) + ("^tag: +\\([^ ]+\\)$" (1 'highlight)) + ("^summary:[ \t]+\\(.+\\)" (1 'log-view-message))))))) (declare-function log-edit-mode "log-edit" ()) (defvar log-edit-extra-flags) @@ -454,8 +455,6 @@ (defvar vc-hg-extra-menu-map (let ((map (make-sparse-keymap))) - (define-key map [incoming] '(menu-item "Show incoming" vc-hg-incoming)) - (define-key map [outgoing] '(menu-item "Show outgoing" vc-hg-outgoing)) map)) (defun vc-hg-extra-menu () vc-hg-extra-menu-map) @@ -464,14 +463,6 @@ (defvar log-view-vc-backend) -(define-derived-mode vc-hg-outgoing-mode vc-hg-log-view-mode "Hg-Outgoing" - "Mode for browsing Hg outgoing changes." - (set (make-local-variable 'log-view-vc-backend) 'Hg)) - -(define-derived-mode vc-hg-incoming-mode vc-hg-log-view-mode "Hg-Incoming" - "Mode for browsing Hg incoming changes." - (set (make-local-variable 'log-view-vc-backend) 'Hg)) - (defstruct (vc-hg-extra-fileinfo (:copier nil) (:constructor vc-hg-create-extra-fileinfo (rename-state extra-name)) @@ -577,33 +568,13 @@ ;; (vc-hg-dir-extra-header "Global id : " "id" "-i") ))) -;; FIXME: this adds another top level menu, instead figure out how to -;; replace the Log-View menu. -(easy-menu-define log-view-mode-menu vc-hg-outgoing-mode-map - "Hg-outgoing Display Menu" - `("Hg-outgoing" - ["Push selected" vc-hg-push])) - -(easy-menu-define log-view-mode-menu vc-hg-incoming-mode-map - "Hg-incoming Display Menu" - `("Hg-incoming" - ["Pull selected" vc-hg-pull])) +(defun vc-hg-log-incoming (buffer remote-location) + (vc-hg-command buffer 1 nil "incoming" "-n" (unless (string= remote-location "") + remote-location))) -(defun vc-hg-outgoing () - (interactive) - (let ((bname "*Hg outgoing*") - (vc-short-log nil)) - (vc-hg-command bname 1 nil "outgoing" "-n") - (pop-to-buffer bname) - (vc-hg-outgoing-mode))) - -(defun vc-hg-incoming () - (interactive) - (let ((bname "*Hg incoming*") - (vc-short-log nil)) - (vc-hg-command bname 0 nil "incoming" "-n") - (pop-to-buffer bname) - (vc-hg-incoming-mode))) +(defun vc-hg-log-outgoing (buffer remote-location) + (vc-hg-command buffer 1 nil "outgoing" "-n" (unless (string= remote-location "") + remote-location))) (declare-function log-view-get-marked "log-view" ()) diff -r c3217524a4c1 -r 79bd972a5a7d lisp/vc-hooks.el --- a/lisp/vc-hooks.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/vc-hooks.el Wed Apr 07 14:24:02 2010 +0000 @@ -981,6 +981,12 @@ (define-key map [vc-update-change-log] `(menu-item ,(purecopy "Update ChangeLog") vc-update-change-log :help ,(purecopy "Find change log file and add entries from recent version control logs"))) + (define-key map [vc-log-out] + `(menu-item ,(purecopy "Show Outgoing Log") vc-log-outgoing + :help ,(purecopy "Show a log of changes that will be sent with a push operation"))) + (define-key map [vc-log-in] + `(menu-item ,(purecopy "Show Incoming Log") vc-log-incoming + :help ,(purecopy "Show a log of changes that will be received with a pull operation"))) (define-key map [vc-print-log] `(menu-item ,(purecopy "Show History") vc-print-log :help ,(purecopy "List the change log of the current file set in a window"))) diff -r c3217524a4c1 -r 79bd972a5a7d lisp/vc.el --- a/lisp/vc.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/vc.el Wed Apr 07 14:24:02 2010 +0000 @@ -345,6 +345,16 @@ ;; revision. At this point START-REVISION is only required to work ;; in conjunction with LIMIT = 1. ;; +;; * log-outgoing (backend remote-location) +;; +;; Insert in BUFFER the revision log for the changes that will be +;; sent when performing a push operation to REMOTE-LOCATION. +;; +;; * log-incoming (backend remote-location) +;; +;; Insert in BUFFER the revision log for the changes that will be +;; received when performing a pull operation from REMOTE-LOCATION. +;; ;; - log-view-mode () ;; ;; Mode to use for the output of print-log. This defaults to @@ -1642,9 +1652,14 @@ (error "Buffer is not version controlled")) (setq rootdir (vc-call-backend backend 'root default-directory)) (setq working-revision (vc-working-revision rootdir)) - (vc-diff-internal - t (list backend (list rootdir) working-revision) nil nil - (called-interactively-p 'interactive))))) + ;; VC diff for the root directory produces output that is + ;; relative to it. Bind default-directory to the root directory + ;; here, this way the *vc-diff* buffer is setup correctly, so + ;; relative file names work. + (let ((default-directory rootdir)) + (vc-diff-internal + t (list backend (list rootdir) working-revision) nil nil + (called-interactively-p 'interactive)))))) ;;;###autoload (defun vc-revision-other-window (rev) @@ -1886,6 +1901,29 @@ (defvar log-view-vc-backend) (defvar log-view-vc-fileset) +(defun vc-print-log-setup-buttons (working-revision is-start-revision limit pl-return) + (when (and limit (not (eq 'limit-unsupported pl-return)) + (not is-start-revision)) + (goto-char (point-max)) + (lexical-let ((working-revision working-revision) + (limit limit)) + (widget-create 'push-button + :notify (lambda (&rest ignore) + (vc-print-log-internal + log-view-vc-backend log-view-vc-fileset + working-revision nil (* 2 limit))) + :help-echo "Show the log again, and double the number of log entries shown" + "Show 2X entries") + (widget-insert " ") + (widget-create 'push-button + :notify (lambda (&rest ignore) + (vc-print-log-internal + log-view-vc-backend log-view-vc-fileset + working-revision nil nil)) + :help-echo "Show the log again, showing all entries" + "Show unlimited entries")) + (widget-setup))) + (defun vc-print-log-internal (backend files working-revision &optional is-start-revision limit) ;; Don't switch to the output buffer before running the command, @@ -1893,6 +1931,8 @@ ;; buffer can be accessed by the command. (let ((dir-present nil) (vc-short-log nil) + (buffer-name "*vc-change-log*") + type pl-return) (dolist (file files) (when (file-directory-p file) @@ -1901,44 +1941,64 @@ (not (null (if dir-present (memq 'directory vc-log-short-style) (memq 'file vc-log-short-style))))) + (setq type (if vc-short-log 'short 'long)) + (lexical-let + ((working-revision working-revision) + (limit limit) + (shortlog vc-short-log) + (is-start-revision is-start-revision)) + (vc-log-internal-common + backend buffer-name files type + (lambda (bk buf type-arg files-arg) + (vc-call-backend bk 'print-log files-arg buf + shortlog (when is-start-revision working-revision) limit)) + (lambda (bk files-arg ret) + (vc-print-log-setup-buttons working-revision + is-start-revision limit ret)) + (lambda (bk) + (vc-call-backend bk 'show-log-entry working-revision)))))) - (setq pl-return (vc-call-backend - backend 'print-log files "*vc-change-log*" - vc-short-log (when is-start-revision working-revision) limit)) - (pop-to-buffer "*vc-change-log*") +(defvar vc-log-view-type nil + "Set this to differentiate the different types of logs.") +(put 'vc-log-view-type 'permanent-local t) + +(defun vc-log-internal-common (backend + buffer-name + files + type + backend-func + setup-buttons-func + goto-location-func) + (let (retval) + (with-current-buffer (get-buffer-create buffer-name) + (set (make-local-variable 'vc-log-view-type) type)) + (setq retval (funcall backend-func backend buffer-name type files)) + (pop-to-buffer buffer-name) (let ((inhibit-read-only t)) ;; log-view-mode used to be called with inhibit-read-only bound ;; to t, so let's keep doing it, just in case. - (vc-call-backend backend 'log-view-mode)) - (set (make-local-variable 'log-view-vc-backend) backend) - (set (make-local-variable 'log-view-vc-fileset) files) - + (vc-call-backend backend 'log-view-mode) + (set (make-local-variable 'log-view-vc-backend) backend) + (set (make-local-variable 'log-view-vc-fileset) files)) (vc-exec-after `(let ((inhibit-read-only t)) - (when (and ,limit (not ,(eq 'limit-unsupported pl-return)) - (not ,is-start-revision)) - (goto-char (point-max)) - (widget-create 'push-button - :notify (lambda (&rest ignore) - (vc-print-log-internal - ',backend ',files ',working-revision nil (* 2 ,limit))) - :help-echo "Show the log again, and double the number of log entries shown" - "Show 2X entries") - (widget-insert " ") - (widget-create 'push-button - :notify (lambda (&rest ignore) - (vc-print-log-internal - ',backend ',files ',working-revision nil nil)) - :help-echo "Show the log again, showing all entries" - "Show unlimited entries") - (widget-setup)) - + (funcall ',setup-buttons-func ',backend ',files ',retval) (shrink-window-if-larger-than-buffer) - ;; move point to the log entry for the working revision - (vc-call-backend ',backend 'show-log-entry ',working-revision) + (funcall ',goto-location-func ',backend) (setq vc-sentinel-movepoint (point)) (set-buffer-modified-p nil))))) +(defun vc-incoming-outgoing-internal (backend remote-location buffer-name type) + (vc-log-internal-common + backend buffer-name nil type + (lexical-let + ((remote-location remote-location)) + (lambda (bk buf type-arg files) + (vc-call-backend bk type-arg buf remote-location))) + (lambda (bk files-arg ret)) + (lambda (bk) + (goto-char (point-min))))) + ;;;###autoload (defun vc-print-log (&optional working-revision limit) "List the change log of the current fileset in a window. @@ -1999,6 +2059,32 @@ (vc-print-log-internal backend (list rootdir) working-revision nil limit))) ;;;###autoload +(defun vc-log-incoming (&optional remote-location) + "Show a log of changes that will be received with a pull operation from REMOTE-LOCATION." + (interactive "sRemote location (empty for default): ") + (let ((backend + (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) + ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory)) + (vc-mode (vc-backend buffer-file-name)))) + rootdir working-revision) + (unless backend + (error "Buffer is not version controlled")) + (vc-incoming-outgoing-internal backend remote-location "*vc-incoming*" 'log-incoming))) + +;;;###autoload +(defun vc-log-outgoing (&optional remote-location) + "Show a log of changes that will be sent with a push operation to REMOTE-LOCATION." + (interactive "sRemote location (empty for default): ") + (let ((backend + (cond ((derived-mode-p 'vc-dir-mode) vc-dir-backend) + ((derived-mode-p 'dired-mode) (vc-responsible-backend default-directory)) + (vc-mode (vc-backend buffer-file-name)))) + rootdir working-revision) + (unless backend + (error "Buffer is not version controlled")) + (vc-incoming-outgoing-internal backend remote-location "*vc-outgoing*" 'log-outgoing))) + +;;;###autoload (defun vc-revert () "Revert working copies of the selected fileset to their repository contents. This asks for confirmation if the buffer contents are not identical diff -r c3217524a4c1 -r 79bd972a5a7d lisp/wid-edit.el --- a/lisp/wid-edit.el Mon Apr 05 14:19:20 2010 +0000 +++ b/lisp/wid-edit.el Wed Apr 07 14:24:02 2010 +0000 @@ -253,7 +253,9 @@ ;; Allocate digits to disabled alternatives ;; so that the digit of a given alternative never varies. (setq next-digit (1+ next-digit))) - (insert "\nC-g = Quit")) + (insert "\nC-g = Quit") + (goto-char (point-min)) + (forward-line)) (or some-choice-enabled (error "None of the choices is currently meaningful")) (define-key map [?\C-g] 'keyboard-quit) diff -r c3217524a4c1 -r 79bd972a5a7d src/ChangeLog --- a/src/ChangeLog Mon Apr 05 14:19:20 2010 +0000 +++ b/src/ChangeLog Wed Apr 07 14:24:02 2010 +0000 @@ -1,3 +1,22 @@ +2010-04-07 Jan Djärv + + * frame.h (FRAME_TEXT_LINES_TO_PIXEL_HEIGHT): Don't use + FRAME_LINE_TO_PIXEL_Y. + + * xterm.c (x_set_window_size_1): Don't add border_width/height to + pixelwidth/height. + +2010-04-07 Dan Nicolaescu + + Simplify code for HP machines. + * m/hp800.h (LOAD_AVE_TYPE, LOAD_AVE_CVT, NO_REMAP): Do not define + for GNU_LINUX, not needed. + (UNEXEC, NEED_BSDTTY): Move definitions... + * s/hpux10-20.h (UNEXEC, NEED_BSDTTY): ... here. + + * m/iris4d.h (UNEXEC): Move definition ... + * s/irix6-5.h (UNEXEC): ... here. + 2010-04-04 Jan Djärv * xfns.c (set_machine_and_pid_properties): New function. diff -r c3217524a4c1 -r 79bd972a5a7d src/frame.h --- a/src/frame.h Mon Apr 05 14:19:20 2010 +0000 +++ b/src/frame.h Wed Apr 07 14:24:02 2010 +0000 @@ -997,8 +997,8 @@ + FRAME_INTERNAL_BORDER_WIDTH (f)) #define FRAME_TEXT_LINES_TO_PIXEL_HEIGHT(f, lines) \ - (FRAME_LINE_TO_PIXEL_Y (f, lines) \ - + FRAME_INTERNAL_BORDER_WIDTH (f)) + ((lines) * FRAME_LINE_HEIGHT (f) \ + + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)) /* Return the row/column (zero-based) of the character cell containing diff -r c3217524a4c1 -r 79bd972a5a7d src/m/hp800.h --- a/src/m/hp800.h Mon Apr 05 14:19:20 2010 +0000 +++ b/src/m/hp800.h Wed Apr 07 14:24:02 2010 +0000 @@ -41,9 +41,9 @@ #define EXPLICIT_SIGN_EXTEND -/* Common definitions for HPUX and GNU/Linux. */ +/* Stuff for just HPUX. */ -#if defined (__hpux) || defined (GNU_LINUX) +#if defined (__hpux) /* Define NO_REMAP if memory segmentation makes it not work well to change the boundary between the text section and data section @@ -52,26 +52,6 @@ #define NO_REMAP -#endif /* __hpux or GNU_LINUX */ - -/* Stuff for just GNU/Linux. */ - -#ifdef GNU_LINUX - -/* Data type of load average, as read out of kmem. */ - -#define LOAD_AVE_TYPE long - -/* Convert that into an integer that is 100 for a load average of 1.0 */ - -#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE) - -#endif /* GNU_LINUX */ - -/* Stuff for just HPUX. */ - -#ifdef __hpux - /* Define VIRT_ADDR_VARIES if the virtual addresses of pure and impure space as loaded can vary, and even their relative order cannot be relied on. @@ -88,14 +68,6 @@ #define DATA_START 0x40000000 #define TEXT_START 0x00000000 -/* This machine requires completely different unexec code - which lives in a separate file. Specify the file name. */ - -#define UNEXEC unexhp9k800.o - -/* Include the file bsdtty.h, since this machine has job control. */ -#define NEED_BSDTTY - /* Data type of load average, as read out of kmem. */ #define LOAD_AVE_TYPE double diff -r c3217524a4c1 -r 79bd972a5a7d src/m/iris4d.h --- a/src/m/iris4d.h Mon Apr 05 14:19:20 2010 +0000 +++ b/src/m/iris4d.h Wed Apr 07 14:24:02 2010 +0000 @@ -36,12 +36,6 @@ #define EXPLICIT_SIGN_EXTEND -/* This machine requires completely different unexec code - which lives in a separate file. Specify the file name. */ - -#undef UNEXEC -#define UNEXEC unexelf.o - #define TEXT_START 0x400000 /* diff -r c3217524a4c1 -r 79bd972a5a7d src/s/hpux10-20.h --- a/src/s/hpux10-20.h Mon Apr 05 14:19:20 2010 +0000 +++ b/src/s/hpux10-20.h Wed Apr 07 14:24:02 2010 +0000 @@ -89,6 +89,11 @@ #define HAVE_PERROR /* Delete this line for version 6. */ +#define UNEXEC unexhp9k800.o + +/* Include the file bsdtty.h, since this machine has job control. */ +#define NEED_BSDTTY + /* This is how to get the device name of the tty end of a pty. */ #define PTY_TTY_NAME_SPRINTF \ sprintf (pty_name, "/dev/pty/tty%c%x", c, i); diff -r c3217524a4c1 -r 79bd972a5a7d src/s/irix6-5.h --- a/src/s/irix6-5.h Mon Apr 05 14:19:20 2010 +0000 +++ b/src/s/irix6-5.h Wed Apr 07 14:24:02 2010 +0000 @@ -82,6 +82,8 @@ /* Tell process_send_signal to use VSUSP instead of VSWTCH. */ #define PREFER_VSUSP +#define UNEXEC unexelf.o + /* define MAIL_USE_FLOCK if the mailer uses flock to interlock access to /usr/spool/mail/$USER. The alternative is that a lock file named diff -r c3217524a4c1 -r 79bd972a5a7d src/xterm.c --- a/src/xterm.c Mon Apr 05 14:19:20 2010 +0000 +++ b/src/xterm.c Wed Apr 07 14:24:02 2010 +0000 @@ -8931,11 +8931,9 @@ compute_fringe_widths (f, 0); - pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols) - + 2*f->border_width; + pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows) - + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f) - + 2*f->border_width; + + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); if (change_gravity) f->win_gravity = NorthWestGravity; x_wm_set_size_hint (f, (long) 0, 0);