changeset 108044:c2a207021794

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Wed, 07 Apr 2010 21:55:20 +0000
parents d55e807557fc (current diff) 25be388c76cc (diff)
children ad01848d2984
files
diffstat 21 files changed, 568 insertions(+), 311 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS	Tue Apr 06 21:56:56 2010 +0000
+++ b/etc/NEWS	Wed Apr 07 21:55:20 2010 +0000
@@ -95,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.
--- a/lib-src/ChangeLog	Tue Apr 06 21:56:56 2010 +0000
+++ b/lib-src/ChangeLog	Wed Apr 07 21:55:20 2010 +0000
@@ -1,3 +1,8 @@
+2010-04-07  Christoph  <cschol2112@googlemail.com>  (tiny change)
+
+	* makefile.w32-in (OTHER_PLATFORM_SUPPORT): Use parenthesis
+	for macros for nmake compatibility.
+
 2010-04-03  Juanma Barranquero  <lekktu@gmail.com>
 
 	Add stubs for Windows, required after CVE-2010-0825 change.
--- a/lib-src/makefile.w32-in	Tue Apr 06 21:56:56 2010 +0000
+++ b/lib-src/makefile.w32-in	Wed Apr 07 21:55:20 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= \
--- a/lisp/ChangeLog	Tue Apr 06 21:56:56 2010 +0000
+++ b/lisp/ChangeLog	Wed Apr 07 21:55:20 2010 +0000
@@ -1,3 +1,81 @@
+2010-04-07  Sam Steingold  <sds@gnu.org>
+
+	* progmodes/compile.el (compilation-save-buffers-predicate): New
+	custom variable.
+	(compile, recompile): Pass it to `save-some-buffers'.
+
+2010-04-07  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* wid-edit.el (widget-choose): Move cursor to the second line of
+	the buffer (Bug#5695).
+
+2010-04-07  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	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  <dann@ics.uci.edu>
+
+	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  <mac@mail.brushroad.com>
+
+        * 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  <wsnyder@wsnyder.org>
+
+        * 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  <jwiegley@gmail.com>
 
 	* ido.el (ido-add-virtual-buffers-to-list): Fix duplicated names
--- a/lisp/calc/calc-frac.el	Tue Apr 06 21:56:56 2010 +0000
+++ b/lisp/calc/calc-frac.el	Wed Apr 07 21:55:20 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)
 
--- a/lisp/progmodes/bug-reference.el	Tue Apr 06 21:56:56 2010 +0000
+++ b/lisp/progmodes/bug-reference.el	Wed Apr 07 21:55:20 2010 +0000
@@ -130,6 +130,7 @@
       (widen)
       (bug-reference-unfontify (point-min) (point-max)))))
 
+;;;###autoload
 (defun turn-on-bug-reference-mode ()
   "Unconditionally turn bug reference mode on."
   (unless bug-reference-mode
@@ -148,6 +149,7 @@
       (widen)
       (bug-reference-unfontify (point-min) (point-max)))))
 
+;;;###autoload
 (defun turn-on-bug-reference-prog-mode ()
   "Unconditionally turn bug reference prog mode on."
   (unless bug-reference-prog-mode
--- a/lisp/progmodes/compile.el	Tue Apr 06 21:56:56 2010 +0000
+++ b/lisp/progmodes/compile.el	Wed Apr 07 21:55:20 2010 +0000
@@ -584,6 +584,21 @@
   :group 'compilation)
 
 ;;;###autoload
+(defcustom compilation-save-buffers-predicate nil
+  "The second argument (PRED) passed to `save-some-buffers' before compiling.
+E.g., one can set this to
+  (lambda ()
+    (string-prefix-p my-compilation-root (file-truename (buffer-file-name))))
+to limit saving to files located under `my-compilation-root'.
+Note, that, in general, `compilation-directory' cannot be used instead
+of `my-compilation-root' here."
+  :type '(choice
+          (const :tag "Default (save all file-visiting buffers)" nil)
+          (const :tag "Save all buffers" t)
+          function)
+  :group 'compilation)
+
+;;;###autoload
 (defcustom compilation-search-path '(nil)
   "List of directories to search for source files named in error messages.
 Elements should be directory names, not file names of directories.
@@ -1097,7 +1112,8 @@
     (consp current-prefix-arg)))
   (unless (equal command (eval compile-command))
     (setq compile-command command))
-  (save-some-buffers (not compilation-ask-about-save) nil)
+  (save-some-buffers (not compilation-ask-about-save)
+                     compilation-save-buffers-predicate)
   (setq-default compilation-directory default-directory)
   (compilation-start command comint))
 
@@ -1108,7 +1124,8 @@
 original use.  Otherwise, recompile using `compile-command'.
 If the optional argument `edit-command' is non-nil, the command can be edited."
   (interactive "P")
-  (save-some-buffers (not compilation-ask-about-save) nil)
+  (save-some-buffers (not compilation-ask-about-save)
+                     compilation-save-buffers-predicate)
   (let ((default-directory (or compilation-directory default-directory)))
     (when edit-command
       (setcar compilation-arguments
--- a/lisp/progmodes/verilog-mode.el	Tue Apr 06 21:56:56 2010 +0000
+++ b/lisp/progmodes/verilog-mode.el	Wed Apr 07 21:55:20 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 "\\(\\<extern\\s-+\\|\\<virtual\\s-+\\|\\<protected\\s-+\\)*\\(\\<function\\>\\|\\<task\\>\\)"
@@ -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 "\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|_none\\)?\\>\\)" ))))
+	;; 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 "\\(\\<fork\\>\\)\\|\\(\\<join\\(_any\\|_none\\)?\\>\\)" ))))))
        ((match-end 6)
 	;; Search forward for matching endclass
 	(setq reg "\\(\\<class\\>\\)\\|\\(\\<endclass\\>\\)" ))
@@ -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.
--- a/lisp/vc-bzr.el	Tue Apr 06 21:56:56 2010 +0000
+++ b/lisp/vc-bzr.el	Wed Apr 07 21:55:20 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))
--- a/lisp/vc-git.el	Tue Apr 06 21:56:56 2010 +0000
+++ b/lisp/vc-git.el	Wed Apr 07 21:55:20 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.
--- a/lisp/vc-hg.el	Tue Apr 06 21:56:56 2010 +0000
+++ b/lisp/vc-hg.el	Wed Apr 07 21:55:20 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" ())
 
--- a/lisp/vc-hooks.el	Tue Apr 06 21:56:56 2010 +0000
+++ b/lisp/vc-hooks.el	Wed Apr 07 21:55:20 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")))
--- a/lisp/vc.el	Tue Apr 06 21:56:56 2010 +0000
+++ b/lisp/vc.el	Wed Apr 07 21:55:20 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
--- a/lisp/wid-edit.el	Tue Apr 06 21:56:56 2010 +0000
+++ b/lisp/wid-edit.el	Wed Apr 07 21:55:20 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)
--- a/src/ChangeLog	Tue Apr 06 21:56:56 2010 +0000
+++ b/src/ChangeLog	Wed Apr 07 21:55:20 2010 +0000
@@ -1,3 +1,22 @@
+2010-04-07  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* 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  <dann@ics.uci.edu>
+
+	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  <jan.h.d@swipnet.se>
 
 	* xfns.c (set_machine_and_pid_properties): New function.
--- a/src/frame.h	Tue Apr 06 21:56:56 2010 +0000
+++ b/src/frame.h	Wed Apr 07 21:55:20 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
--- a/src/m/hp800.h	Tue Apr 06 21:56:56 2010 +0000
+++ b/src/m/hp800.h	Wed Apr 07 21:55:20 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
--- a/src/m/iris4d.h	Tue Apr 06 21:56:56 2010 +0000
+++ b/src/m/iris4d.h	Wed Apr 07 21:55:20 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
 
 /*
--- a/src/s/hpux10-20.h	Tue Apr 06 21:56:56 2010 +0000
+++ b/src/s/hpux10-20.h	Wed Apr 07 21:55:20 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);
--- a/src/s/irix6-5.h	Tue Apr 06 21:56:56 2010 +0000
+++ b/src/s/irix6-5.h	Wed Apr 07 21:55:20 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
--- a/src/xterm.c	Tue Apr 06 21:56:56 2010 +0000
+++ b/src/xterm.c	Wed Apr 07 21:55:20 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);