changeset 83649:b210fca2fe6e

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 839-842) - Update from CVS - Change capitalization of VC backend names for new backends Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-29
author Miles Bader <miles@gnu.org>
date Fri, 03 Aug 2007 05:27:43 +0000
parents 65663fcd2caa (current diff) 36893fdf92ab (diff)
children 984b1dfd7601
files lisp/ChangeLog lisp/menu-bar.el src/ChangeLog src/gtkutil.c
diffstat 22 files changed, 344 insertions(+), 120 deletions(-) [+]
line wrap: on
line diff
--- a/etc/ChangeLog	Tue Jul 31 05:50:45 2007 +0000
+++ b/etc/ChangeLog	Fri Aug 03 05:27:43 2007 +0000
@@ -1,3 +1,7 @@
+2007-08-01  Glenn Morris  <rgm@gnu.org>
+
+	* NEWS: Add fortran-line-length, plus some more sections.
+
 2007-07-25  Glenn Morris  <rgm@gnu.org>
 
 	*  Relicense all FSF files to GPLv3 or later.
--- a/etc/NEWS	Tue Jul 31 05:50:45 2007 +0000
+++ b/etc/NEWS	Fri Aug 03 05:27:43 2007 +0000
@@ -96,6 +96,9 @@
 
 *** The VC mode-line entry now has a tooltip.
 
+*** VC backends can provide extra menu entries to be added to the "Version Control" menu.
+This can be used to add menu entries for backend specific functions.
+
 *** VC has some support for Bazaar (bzr).
 
 ** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs.
@@ -139,13 +142,20 @@
 When the variable `file-precious-flag' is set, the success of a remote
 file copy is checked via the file's checksum.
 
-** comint-mode uses `start-file-process' now (see Lisp Changes).
+** Miscellaneous programming mode changes
+
+*** The variable `fortran-line-length' can change the fixed-form line-length.
+
+** Miscellaneous
+
+*** comint-mode uses `start-file-process' now (see Lisp Changes).
 If `default-directory' is a remote file name, subprocesses are started
 on the corresponding remote system.
 
-** C-x C-q in dired-mode now runs the command wdired-change-to-wdired-mode,
+*** C-x C-q in dired-mode now runs the command wdired-change-to-wdired-mode,
 and C-x C-q in wdired-mode exits it with asking a question about
 saving changes.
+
 
 * Changes in Emacs 23.1 on non-free operating systems
 
--- a/lisp/ChangeLog	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/ChangeLog	Fri Aug 03 05:27:43 2007 +0000
@@ -1,3 +1,84 @@
+2007-08-03  Miles Bader  <miles@gnu.org>
+
+	* vc-hooks.el (vc-handled-backends): Change capitalization of VC
+	backend names for new backends to `Git', `Hg', and `Bzr'.
+	* vc-hg.el (vc-hg-dired-state-info): Use `Hg' as VC backend name,
+	not `HG'.
+	* vc-git.el (vc-git-dired-state-info): Use `Git' as VC backend
+	name, not `GIT'.
+	* vc-bzr.el (vc-bzr-dir-state, vc-bzr-dired-state-info)
+	(vc-bzr-unload-hook): Use `Bzr' as VC backend name, not `BZR'.
+
+2007-08-03  Glenn Morris  <rgm@gnu.org>
+
+	* cus-edit.el (customize-apropos): Make the error message indicate
+	what kind of thing the user was trying to customize.
+
+	* net/telnet.el (telnet-mode): Set comint-use-prompt-regexp to t.
+
+	* progmodes/fortran.el (fortran-font-lock-syntactic-keywords): Fix
+	off-by-one error in previous change.
+
+2007-08-03  Drew Adams  <drew.adams@oracle.com>
+
+	* emacs-lisp/pp.el (pp-eval-expression): Add progress message.
+	Make buffer writable.
+
+2007-08-01  Jay Belanger  <jay.p.belanger@gmail.com>
+
+	* calc/calc-math.el (math-sqrt-raw,math-sin-raw-2)
+	(math-cos-raw-2,math-arctan-raw,math-ln-raw):
+	Use native Emacs functions, when appropriate.
+
+2007-08-01  Dan Nicolaescu  <dann@ics.uci.edu>
+	    Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* vc.el: Document new VC operation `extra-menu'.
+
+	* vc-hooks.el (vc-default-extra-menu): New function.
+
+	* menu-bar.el (menu-bar-vc-filter): New function.
+	(menu-bar-tools-menu): Use it as a filter.
+
+2007-08-01  Eric Hanchrow  <offby1@blarg.net>  (tiny change)
+
+	* ibuf-ext.el (ibuffer-mark-old-buffers): Docstring fix.
+
+2007-08-01  Glenn Morris  <rgm@gnu.org>
+
+	* progmodes/fortran.el: Remove leading `*' from all defcustom doc
+	strings.
+	(fortran-tab-mode-default): Remove needless autoload.
+	(fortran-tab-mode-string): Add help-echo and mouse properties, and
+	mark as risky.
+	(fortran-line-length): New buffer-local variable, safe if integer.
+	(fortran-if-start-re, fortran-end-prog-re1, fortran-end-prog-re):
+	Change from variables to constants.
+	(fortran-font-lock-syntactic-keywords): Delete as a variable,
+	replace with a new function definition.
+	(fortran-mode): Use fortran-line-length, and
+	fortran-font-lock-syntactic-keywords as a function.  Add a
+	hack-local-variables-hook function.
+	(fortran-line-length, fortran-hack-local-variables): New
+	functions.
+	(fortran-window-create, fortran-strip-sequence-nos): Doc fix.  Use
+	fortran-line-length rather than 72.
+	(fortran-window-create-momentarily): Doc fix.
+
+2007-07-31  Drew Adams  <drew.adams@oracle.com>  (tiny change)
+
+	* cus-edit.el (custom-group-value-create, custom-goto-parent): Fix
+	parent groups link.
+
+2007-07-31  Paul Pogonyshev  <pogonyshev@gmx.net>
+
+	* progmodes/python.el (python-current-defun): Adjust to never fall
+	into infinite loop.
+
+2007-07-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* pcvs.el (cvs-vc-command-advice): Handle the new fileset case.
+
 2007-07-29  Kimit Yada  <kimitto@gmail.com>  (tiny change)
 
 	* emacs-lisp/copyright.el (copyright-update-year, copyright-update)
--- a/lisp/calc/calc-math.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/calc/calc-math.el	Fri Aug 03 05:27:43 2007 +0000
@@ -529,13 +529,16 @@
 (defun math-sqrt-raw (a &optional guess)   ; [F F F]
   (if (not (Math-posp a))
       (math-sqrt a)
-    (if (null guess)
-	(let ((ldiff (- (math-numdigs (nth 1 a)) 6)))
-	  (or (= (% (+ (nth 2 a) ldiff) 2) 0) (setq ldiff (1+ ldiff)))
-	  (setq guess (math-make-float (math-isqrt-small
-					(math-scale-int (nth 1 a) (- ldiff)))
-				       (/ (+ (nth 2 a) ldiff) 2)))))
-    (math-sqrt-float-iter a guess)))
+    (cond
+     ((math-use-emacs-fn 'sqrt a))
+     (t
+      (if (null guess)
+          (let ((ldiff (- (math-numdigs (nth 1 a)) 6)))
+            (or (= (% (+ (nth 2 a) ldiff) 2) 0) (setq ldiff (1+ ldiff)))
+            (setq guess (math-make-float (math-isqrt-small
+                                          (math-scale-int (nth 1 a) (- ldiff)))
+                                         (/ (+ (nth 2 a) ldiff) 2)))))
+      (math-sqrt-float-iter a guess)))))
 
 (defun math-sqrt-float-iter (a guess)   ; [F F F]
   (math-working "sqrt" guess)
@@ -1201,11 +1204,13 @@
 	  ((math-lessp-float x (math-neg (math-pi-over-4)))
 	   (math-neg (math-cos-raw-2 (math-add (math-pi-over-2) x) orgx)))
 	  ((math-nearly-zerop-float x orgx) '(float 0 0))
+          ((math-use-emacs-fn 'sin x))
 	  (calc-symbolic-mode (signal 'inexact-result nil))
 	  (t (math-sin-series x 6 4 x (math-neg-float (math-sqr-float x)))))))
 
 (defun math-cos-raw-2 (x orgx)   ; [F F]
   (cond ((math-nearly-zerop-float x orgx) '(float 1 0))
+        ((math-use-emacs-fn 'cos x))
 	(calc-symbolic-mode (signal 'inexact-result nil))
 	(t (let ((xnegsqr (math-neg-float (math-sqr-float x))))
 	     (math-sin-series
@@ -1319,6 +1324,7 @@
 	((Math-integer-negp (nth 1 x))
 	 (math-neg-float (math-arctan-raw (math-neg-float x))))
 	((math-zerop x) x)
+        ((math-use-emacs-fn 'atan x))
 	(calc-symbolic-mode (signal 'inexact-result nil))
 	((math-equal-int x 1) (math-pi-over-4))
 	((math-equal-int x -1) (math-neg (math-pi-over-4)))
@@ -1737,10 +1743,13 @@
 	 '(float 0 0))
 	(calc-symbolic-mode (signal 'inexact-result nil))
 	((math-posp (nth 1 x))    ; positive and real
-	 (let ((xdigs (1- (math-numdigs (nth 1 x)))))
-	   (math-add-float (math-ln-raw-2 (list 'float (nth 1 x) (- xdigs)))
-			   (math-mul-float (math-float (+ (nth 2 x) xdigs))
-					   (math-ln-10)))))
+         (cond 
+          ((math-use-emacs-fn 'log x))
+          (t
+           (let ((xdigs (1- (math-numdigs (nth 1 x)))))
+             (math-add-float (math-ln-raw-2 (list 'float (nth 1 x) (- xdigs)))
+                             (math-mul-float (math-float (+ (nth 2 x) xdigs))
+                                             (math-ln-10)))))))
 	((math-zerop x)
 	 (math-reject-arg x "*Logarithm of zero"))
 	((eq calc-complex-mode 'polar)    ; negative and real
--- a/lisp/cus-edit.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/cus-edit.el	Fri Aug 03 05:27:43 2007 +0000
@@ -1376,7 +1376,14 @@
 				      (get symbol 'variable-documentation))))
 		    (push (list symbol 'custom-variable) found)))))
     (if (not found)
-	(error "No customizable items matching %s" regexp)
+	(error "No %s matching %s"
+               (if (eq all t)
+                   "items"
+                 (format "customizable %s"
+                         (if (memq all '(options faces groups))
+                             (symbol-name all)
+                           "items")))
+               regexp)
       (custom-buffer-create
        (custom-sort-items found t custom-buffer-order-groups)
        "*Customize Apropos*"))))
@@ -3878,7 +3885,7 @@
 		    ;;; was made to display a group.
 	       (when (eq level 1)
 		 (if (custom-add-parent-links widget
-					      "Parent group:")
+					      "Parent groups:")
 		     (insert "\n"))))
 	   ;; Create level indicator.
 	   (insert-char ?\  (* custom-buffer-indent (1- level)))
@@ -4480,7 +4487,7 @@
   (interactive)
   (save-excursion
     (goto-char (point-min))
-    (if (search-forward "\nGo to parent group: " nil t)
+    (if (search-forward "\nParent groups: " nil t)
 	(let* ((button (get-char-property (point) 'button))
 	       (parent (downcase (widget-get  button :tag))))
 	  (customize-group parent)))))
--- a/lisp/emacs-lisp/pp.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/emacs-lisp/pp.el	Fri Aug 03 05:27:43 2007 +0000
@@ -103,6 +103,7 @@
   (interactive
    (list (read-from-minibuffer "Eval: " nil read-expression-map t
 			       'read-expression-history)))
+  (message "Evaluating...")
   (setq values (cons (eval expression) values))
   (let* ((old-show-function temp-buffer-show-function)
 	 ;; Use this function to display the buffer.
@@ -126,13 +127,16 @@
 			 (progn
 			   (select-window window)
 			   (run-hooks 'temp-buffer-show-hook))
-		       (select-window old-selected)))
+		       (select-window old-selected)
+		       (message "Evaluating...done.  \
+See buffer *Pp Eval Output*.")))
 		 (message "%s" (buffer-substring (point-min) (point)))
 		 ))))))
     (with-output-to-temp-buffer "*Pp Eval Output*"
       (pp (car values))
       (with-current-buffer standard-output
 	(emacs-lisp-mode)
+	(setq buffer-read-only nil)
 	(set (make-local-variable 'font-lock-verbose) nil)))))
 
 ;;;###autoload
--- a/lisp/ibuf-ext.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/ibuf-ext.el	Fri Aug 03 05:27:43 2007 +0000
@@ -1482,7 +1482,7 @@
 
 ;;;###autoload
 (defun ibuffer-mark-old-buffers ()
-  "Mark buffers which have not been viewed in `ibuffer-old-time' days."
+  "Mark buffers which have not been viewed in `ibuffer-old-time' hours."
   (interactive)
   (ibuffer-mark-on-buffer
    #'(lambda (buf)
--- a/lisp/menu-bar.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/menu-bar.el	Fri Aug 03 05:27:43 2007 +0000
@@ -1165,7 +1165,19 @@
 (define-key menu-bar-tools-menu [pcl-cvs]
   '(menu-item "PCL-CVS" cvs-global-menu))
 (define-key menu-bar-tools-menu [vc]
-  (list 'menu-item "Version Control" vc-menu-map))
+  (list 'menu-item "Version Control" vc-menu-map
+  :filter 'menu-bar-vc-filter))
+
+(defun menu-bar-vc-filter (orig-binding)
+  (let ((ext-binding
+   (if vc-mode (vc-call 'extra-menu buffer-file-name))))
+    ;; Give the VC backend a chance to add menu entries
+    ;; specific for that backend.
+    (if (null ext-binding)
+    orig-binding
+      (append orig-binding
+	      '((ext-menu-separator "---"))
+	            ext-binding))))
 
 (define-key menu-bar-tools-menu [separator-compare]
   '("--"))
--- a/lisp/net/telnet.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/net/telnet.el	Fri Aug 03 05:27:43 2007 +0000
@@ -247,7 +247,8 @@
 There is a variable ``telnet-interrupt-string'' which is the character
 sent to try to stop execution of a job on the remote host.
 Data is sent to the remote host when RET is typed."
-  (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern))
+  (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern)
+  (setq comint-use-prompt-regexp t))
 
 ;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)")
 
--- a/lisp/pcvs.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/pcvs.el	Fri Aug 03 05:27:43 2007 +0000
@@ -2354,7 +2354,7 @@
 
 (add-hook 'vc-post-command-functions 'cvs-vc-command-advice)
 
-(defun cvs-vc-command-advice (command file flags)
+(defun cvs-vc-command-advice (command files flags)
   (when (and (equal command "cvs")
 	     (progn
 	       (while (and (stringp (car flags))
@@ -2383,9 +2383,10 @@
 	      (when (and (equal (car flags) "add")
 			 (goto-char (point-min))
 			 (looking-at ".*to add this file permanently\n\\'"))
-		(insert "cvs add: scheduling file `"
-			(file-name-nondirectory file)
-			"' for addition\n"))
+                (dolist (file (if (listp files) files (list file)))
+                  (insert "cvs add: scheduling file `"
+                          (file-name-nondirectory file)
+                          "' for addition\n")))
 	      ;; VC never (?) does `cvs -n update' so dcd=nil
 	      ;; should probably always be the right choice.
 	      (cvs-parse-process nil subdir))))))))
--- a/lisp/progmodes/fortran.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/progmodes/fortran.el	Fri Aug 03 05:27:43 2007 +0000
@@ -1,7 +1,8 @@
 ;;; fortran.el --- Fortran mode for GNU Emacs
 
 ;; Copyright (C) 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
-;;               2002, 2003, 2004, 2005, 2006, 2007  Free Software Foundation, Inc.
+;;               2002, 2003, 2004, 2005, 2006, 2007
+;;               Free Software Foundation, Inc.
 
 ;; Author: Michael D. Prange <prange@erl.mit.edu>
 ;; Maintainer: Glenn Morris <rgm@gnu.org>
@@ -78,42 +79,52 @@
   :group  'fortran)
 
 
-;;;###autoload
 (defcustom fortran-tab-mode-default nil
-  "*Default tabbing/carriage control style for empty files in Fortran mode.
+  "Default tabbing/carriage control style for empty files in Fortran mode.
 A non-nil value specifies tab-digit style of continuation control.
 A value of nil specifies that continuation lines are marked
 with a character in column 6."
   :type  'boolean
   :group 'fortran-indent)
 
-(defcustom fortran-tab-mode-string "/t"
-  "*String to appear in mode line in TAB format buffers."
+;; TODO add more detail of what tab mode is to doc string.
+(defcustom fortran-tab-mode-string
+  (propertize "/t" 'help-echo "This buffer is in Fortran TAB mode"
+              'mouse-face 'mode-line-highlight
+              'local-map
+              (make-mode-line-mouse-map 'mouse-1
+                                        (lambda ()
+                                          (interactive)
+                                          (describe-variable
+                                           'fortran-tab-mode-string))))
+  "String to appear in mode line in TAB format buffers."
   :type  'string
   :group 'fortran-indent)
 
+(put 'fortran-tab-mode-string 'risky-local-variable t)
+
 (defcustom fortran-do-indent 3
-  "*Extra indentation applied to DO blocks."
+  "Extra indentation applied to DO blocks."
   :type  'integer
   :group 'fortran-indent)
 
 (defcustom fortran-if-indent 3
-  "*Extra indentation applied to IF, SELECT CASE and WHERE blocks."
+  "Extra indentation applied to IF, SELECT CASE and WHERE blocks."
   :type  'integer
   :group 'fortran-indent)
 
 (defcustom fortran-structure-indent 3
-  "*Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks."
+  "Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks."
   :type  'integer
   :group 'fortran-indent)
 
 (defcustom fortran-continuation-indent 5
-  "*Extra indentation applied to continuation lines."
+  "Extra indentation applied to continuation lines."
   :type  'integer
   :group 'fortran-indent)
 
 (defcustom fortran-comment-indent-style 'fixed
-  "*How to indent comments.
+  "How to indent comments.
 nil forces comment lines not to be touched;
 `fixed' indents to `fortran-comment-line-extra-indent' columns beyond
   `fortran-minimum-statement-indent-fixed' (if `indent-tabs-mode' nil), or
@@ -124,13 +135,13 @@
   :group 'fortran-indent)
 
 (defcustom fortran-comment-line-extra-indent 0
-  "*Amount of extra indentation for text within full-line comments."
+  "Amount of extra indentation for text within full-line comments."
   :type  'integer
   :group 'fortran-indent
   :group 'fortran-comment)
 
 (defcustom fortran-comment-line-start "C"
-  "*Delimiter inserted to start new full-line comment.
+  "Delimiter inserted to start new full-line comment.
 You might want to change this to \"*\", for instance."
   :version "21.1"
   :type    'string
@@ -147,7 +158,7 @@
 
 (defcustom fortran-directive-re
   "^[ \t]*#.*"
-  "*Regexp to match a directive line.
+  "Regexp to match a directive line.
 The matching text will be fontified with `font-lock-keyword-face'.
 The matching line will be given zero indentation."
   :version "22.1"
@@ -155,12 +166,12 @@
   :group   'fortran-indent)
 
 (defcustom fortran-minimum-statement-indent-fixed 6
-  "*Minimum statement indentation for fixed format continuation style."
+  "Minimum statement indentation for fixed format continuation style."
   :type  'integer
   :group 'fortran-indent)
 
 (defcustom fortran-minimum-statement-indent-tab (max tab-width 6)
-  "*Minimum statement indentation for TAB format continuation style."
+  "Minimum statement indentation for TAB format continuation style."
   :type  'integer
   :group 'fortran-indent)
 
@@ -168,30 +179,30 @@
 ;; of length one rather than a single character.
 ;; The code in this file accepts either format for compatibility.
 (defcustom fortran-comment-indent-char " "
-  "*Single-character string inserted for Fortran comment indentation.
+  "Single-character string inserted for Fortran comment indentation.
 Normally a space."
   :type  'string
   :group 'fortran-comment)
 
 (defcustom fortran-line-number-indent 1
-  "*Maximum indentation for Fortran line numbers.
+  "Maximum indentation for Fortran line numbers.
 5 means right-justify them within their five-column field."
   :type  'integer
   :group 'fortran-indent)
 
 (defcustom fortran-check-all-num-for-matching-do nil
-  "*Non-nil causes all numbered lines to be treated as possible DO loop ends."
+  "Non-nil causes all numbered lines to be treated as possible DO loop ends."
   :type  'boolean
   :group 'fortran)
 
 (defcustom fortran-blink-matching-if nil
-  "*Non-nil causes \\[fortran-indent-line] on ENDIF to blink on matching IF.
+  "Non-nil causes \\[fortran-indent-line] on ENDIF to blink on matching IF.
 Also, from an ENDDO statement blink on matching DO [WHILE] statement."
   :type  'boolean
   :group 'fortran)
 
 (defcustom fortran-continuation-string "$"
-  "*Single-character string used for Fortran continuation lines.
+  "Single-character string used for Fortran continuation lines.
 In fixed format continuation style, this character is inserted in
 column 6 by \\[fortran-split-line] to begin a continuation line.
 Also, if \\[fortran-indent-line] finds this at the beginning of a
@@ -201,16 +212,17 @@
   :group 'fortran)
 
 (defcustom fortran-comment-region "c$$$"
-  "*String inserted by \\[fortran-comment-region] at start of each \
+  "String inserted by \\[fortran-comment-region] at start of each \
 line in region."
   :type  'string
   :group 'fortran-comment)
 
 (defcustom fortran-electric-line-number t
-  "*Non-nil causes line numbers to be moved to the correct column as typed."
+  "Non-nil causes line numbers to be moved to the correct column as typed."
   :type  'boolean
   :group 'fortran)
 
+;; TODO use fortran-line-length, somehow.
 (defcustom fortran-column-ruler-fixed
   "0   4 6  10        20        30        40        5\
 0        60        70\n\
@@ -222,6 +234,7 @@
   :type  'string
   :group 'fortran)
 
+;; TODO use fortran-line-length, somehow.
 (defcustom fortran-column-ruler-tab
   "0       810        20        30        40        5\
 0        60        70\n\
@@ -239,11 +252,38 @@
   :group 'fortran)
 
 (defcustom fortran-break-before-delimiters t
-  "*Non-nil causes filling to break lines before delimiters.
+  "Non-nil causes filling to break lines before delimiters.
 Delimiters are characters matching the regexp `fortran-break-delimiters-re'."
   :type  'boolean
   :group 'fortran)
 
+;; TODO 0 as no-limit, as per g77.
+(defcustom fortran-line-length 72
+  "Maximum number of characters in a line of fixed-form Fortran code.
+Characters beyond this point are treated as comments.  Setting
+this variable directly (after fortran mode is loaded) does not
+take effect.  Use either \\[customize] (which affects all Fortran
+buffers and the default) or the function
+`fortran-line-length' (which can also operate on just the current
+buffer).  This corresponds to the g77 compiler option
+`-ffixed-line-length-N'."
+  :type 'integer
+  :initialize 'custom-initialize-default
+  :set (lambda (symbol value)
+         ;; Do all fortran buffers, and the default.
+         (fortran-line-length value t))
+  :version "23.1"
+  :group 'fortran)
+
+(put 'fortran-line-length 'safe-local-variable 'integerp)
+(make-variable-buffer-local 'fortran-line-length)
+
+(defcustom fortran-mode-hook nil
+  "Hook run when entering Fortran mode."
+  :type  'hook
+  :group 'fortran)
+
+
 (defconst fortran-break-delimiters-re "[-+*/><=, \t]"
   "Regexp matching delimiter characters at which lines may be broken.
 There are certain tokens comprised entirely of characters
@@ -259,22 +299,16 @@
 not be split by filling.  Each element is assumed to be two
 characters long.")
 
-(defcustom fortran-mode-hook nil
-  "Hook run when entering Fortran mode."
-  :type  'hook
-  :group 'fortran)
-
-
-(defvar fortran-if-start-re "\\(\\(\\sw\\|\\s_\\)+:[ \t]*\\)?if[ \t]*("
+(defconst fortran-if-start-re "\\(\\(\\sw\\|\\s_\\)+:[ \t]*\\)?if[ \t]*("
   "Regexp matching the start of an IF statement.")
 
-(defvar fortran-end-prog-re1
+(defconst fortran-end-prog-re1
   "end\
 \\([ \t]*\\(program\\|subroutine\\|function\\|block[ \t]*data\\)\\>\
 \\([ \t]*\\(\\sw\\|\\s_\\)+\\)?\\)?"
   "Regexp possibly matching the end of a subprogram.")
 
-(defvar fortran-end-prog-re
+(defconst fortran-end-prog-re
   (concat "^[ \t0-9]*" fortran-end-prog-re1)
   "Regexp possibly matching the end of a subprogram, from the line start.
 See also `fortran-end-prog-re1'.")
@@ -402,11 +436,13 @@
 ;; (We can do so for F90-style).  Therefore an unmatched quote in a
 ;; standard comment will throw fontification off on the wrong track.
 ;; So we do syntactic fontification with regexps.
-(defvar fortran-font-lock-syntactic-keywords
-  '(("^[cd\\*]" 0 (11))
-    ("^[^cd\\*\t\n].\\{71\\}\\([^\n]+\\)" 1 (11)))
-  "`font-lock-syntactic-keywords' for Fortran.
-These get fixed-format comments fontified.")
+(defun fortran-font-lock-syntactic-keywords ()
+  "Return a value for `font-lock-syntactic-keywords' in Fortran mode.
+This varies according to the value of `fortran-line-length'.
+This is used to fontify fixed-format Fortran comments."
+  `(("^[cd\\*]" 0 (11))
+    (,(format "^[^cd\\*\t\n].\\{%d\\}\\([^\n]+\\)" (1- fortran-line-length))
+     1 (11))))
 
 (defvar fortran-font-lock-keywords fortran-font-lock-keywords-1
   "Default expressions to highlight in Fortran mode.")
@@ -582,6 +618,8 @@
         ["Widen" widen t]
         "--"
         ["Temporary column ruler" fortran-column-ruler  t]
+        ;; May not be '72', depending on fortran-line-length, but this
+        ;; seems ok for a menu item.
         ["72-column window"       fortran-window-create t]
         ["Full Width Window"
          (enlarge-window-horizontally (- (frame-width) (window-width)))
@@ -780,7 +818,7 @@
   (set (make-local-variable 'normal-auto-fill-function) 'fortran-auto-fill)
   (set (make-local-variable 'indent-tabs-mode) (fortran-analyze-file-format))
   (setq mode-line-process '(indent-tabs-mode fortran-tab-mode-string))
-  (set (make-local-variable 'fill-column) 72)
+  (set (make-local-variable 'fill-column) fortran-line-length)
   (set (make-local-variable 'fill-paragraph-function) 'fortran-fill-paragraph)
   (set (make-local-variable 'font-lock-defaults)
        '((fortran-font-lock-keywords
@@ -791,7 +829,7 @@
          nil t ((?/ . "$/") ("_$" . "w"))
          fortran-beginning-of-subprogram))
   (set (make-local-variable 'font-lock-syntactic-keywords)
-       fortran-font-lock-syntactic-keywords)
+       (fortran-font-lock-syntactic-keywords))
   (set (make-local-variable 'imenu-case-fold-search) t)
   (set (make-local-variable 'imenu-generic-expression)
        fortran-imenu-generic-expression)
@@ -804,9 +842,38 @@
        #'fortran-current-defun)
   (set (make-local-variable 'dabbrev-case-fold-search) 'case-fold-search)
   (set (make-local-variable 'gud-find-expr-function) 'fortran-gud-find-expr)
+  (add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t)
   (run-mode-hooks 'fortran-mode-hook))
 
 
+(defun fortran-line-length (nchars &optional global)
+  "Set the length of fixed-form Fortran lines to NCHARS.
+This normally only affects the current buffer, which must be in
+Fortran mode.  If the optional argument GLOBAL is non-nil, it
+affects all Fortran buffers, and also the default."
+  (interactive "p")
+  (let (new)
+    (mapcar (lambda (buff)
+              (with-current-buffer buff
+                (when (eq major-mode 'fortran-mode)
+                  (setq fortran-line-length nchars
+                        fill-column fortran-line-length
+                        new (fortran-font-lock-syntactic-keywords))
+                  ;; Refontify only if necessary.
+                  (unless (equal new font-lock-syntactic-keywords)
+                    (setq font-lock-syntactic-keywords
+                          (fortran-font-lock-syntactic-keywords))
+                    (if font-lock-mode (font-lock-mode 1))))))
+            (if global
+                (buffer-list)
+              (list (current-buffer))))
+    (if global
+        (setq-default fortran-line-length nchars))))
+
+(defun fortran-hack-local-variables ()
+  "Fortran mode adds this to `hack-local-variables-hook'."
+  (fortran-line-length fortran-line-length))
+
 (defun fortran-gud-find-expr ()
   ;; Consider \n as punctuation (end of expression).
   (with-syntax-table fortran-gud-syntax-table
@@ -940,7 +1007,7 @@
    nil "Type SPC or any command to erase ruler."))
 
 (defun fortran-window-create ()
-  "Make the window 72 columns wide.
+  "Make the window `fortran-line-length' (default 72) columns wide.
 See also `fortran-window-create-momentarily'."
   (interactive)
   (let ((window-min-width 2))
@@ -951,13 +1018,13 @@
 	   (scroll-bar-width (- (nth 2 window-edges)
 				(car window-edges)
 				(window-width))))
-      (split-window-horizontally (+ 72 scroll-bar-width)))
+      (split-window-horizontally (+ fortran-line-length scroll-bar-width)))
     (other-window 1)
     (switch-to-buffer " fortran-window-extra" t)
     (select-window (previous-window))))
 
 (defun fortran-window-create-momentarily (&optional arg)
-  "Momentarily make the window 72 columns wide.
+  "Momentarily make the window `fortran-line-length' (default 72) columns wide.
 Optional ARG non-nil and non-unity disables the momentary feature.
 See also `fortran-window-create'."
   (interactive "p")
@@ -1065,7 +1132,8 @@
     (string-match "^\\s-*\\(\\'\\|\\s<\\)"
 		  (buffer-substring (match-end 0)
 				    (min (line-end-position)
-					 (+ 72 (line-beginning-position)))))))
+					 (+ fortran-line-length
+                                            (line-beginning-position)))))))
 
 ;; Note that you can't just check backwards for `subroutine' &c in
 ;; case of un-marked main programs not at the start of the file.
@@ -1996,13 +2064,15 @@
     (fortran-indent-line)))
 
 (defun fortran-strip-sequence-nos (&optional do-space)
-  "Delete all text in column 72 and up (assumed to be sequence numbers).
-Normally also deletes trailing whitespace after stripping such text.
-Supplying prefix arg DO-SPACE prevents stripping the whitespace."
+  "Delete all text in column `fortran-line-length' (default 72) and up.
+This is assumed to be sequence numbers.  Normally also deletes
+trailing whitespace after stripping such text.  Supplying prefix
+arg DO-SPACE prevents stripping the whitespace."
   (interactive "*p")
   (save-excursion
     (goto-char (point-min))
-    (while (re-search-forward "^.\\{72\\}\\(.*\\)" nil t)
+    (while (re-search-forward (format "^.\\{%d\\}\\(.*\\)" fortran-line-length)
+                              nil t)
       (replace-match "" nil nil nil 1)
       (unless do-space (delete-horizontal-space)))))
 
--- a/lisp/progmodes/python.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/progmodes/python.el	Fri Aug 03 05:27:43 2007 +0000
@@ -1005,7 +1005,7 @@
     (set-text-properties 0 (length function-name) nil function-name)
     function-name))
 
- 
+
 ;;;; Imenu.
 
 (defvar python-recursing)
@@ -1828,21 +1828,25 @@
   (save-excursion
     ;; Move up the tree of nested `class' and `def' blocks until we
     ;; get to zero indentation, accumulating the defined names.
-    (let ((start t)
-	  (accum)
+    (let ((accum)
 	  (length -1))
-      (while (and (or start (> (current-indentation) 0))
-		  (or (null length-limit)
-		      (null (cdr accum))
-		      (< length length-limit)))
-	(setq start nil)
-	(python-beginning-of-block)
-	(end-of-line)
-	(beginning-of-defun)
-	(when (looking-at (rx (0+ space) (or "def" "class") (1+ space)
-			      (group (1+ (or word (syntax symbol))))))
-	  (push (match-string 1) accum)
-	  (setq length (+ length 1 (length (car accum))))))
+      (catch 'done
+	(while (or (null length-limit)
+		   (null (cdr accum))
+		   (< length length-limit))
+	  (setq start nil)
+	  (let ((started-from (point)))
+	    (python-beginning-of-block)
+	    (end-of-line)
+	    (beginning-of-defun)
+	    (when (= (point) started-from)
+	      (throw 'done nil)))
+	  (when (looking-at (rx (0+ space) (or "def" "class") (1+ space)
+				(group (1+ (or word (syntax symbol))))))
+	    (push (match-string 1) accum)
+	    (setq length (+ length 1 (length (car accum)))))
+	  (when (= (current-indentation) 0)
+	    (throw 'done nil))))
       (when accum
 	(when (and length-limit (> length length-limit))
 	  (setcar accum ".."))
--- a/lisp/vc-bzr.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/vc-bzr.el	Fri Aug 03 05:27:43 2007 +0000
@@ -63,7 +63,7 @@
 
 ;; Clear up the cache to force vc-call to check again and discover
 ;; new functions when we reload this file.
-(put 'BZR 'vc-functions nil)
+(put 'Bzr 'vc-functions nil)
 
 (defgroup vc-bzr nil
   "VC bzr backend."
@@ -197,7 +197,7 @@
   'implicit)
 
 (defun vc-bzr-create-repo ()
-  "Create a new BZR repository."
+  "Create a new Bzr repository."
   (vc-bzr-command "init" nil 0 nil))
 
 (defun vc-bzr-register (files &optional rev comment)
@@ -440,7 +440,7 @@
           (vc-file-setprop file 'vc-state 'up-to-date)
           ;; XXX: is this correct? what happens if one 
           ;; mixes different SCMs in the same dir?
-          (vc-file-setprop file 'vc-backend 'BZR))))
+          (vc-file-setprop file 'vc-backend 'Bzr))))
     ;; `bzr status' reports on added/modified/renamed and unknown/ignored files
     (setq at-start t)
     (with-temp-buffer 
@@ -492,18 +492,18 @@
         (if bzr-state
             (concat "(" (symbol-name bzr-state) ")")
           ;; else fall back to default vc representation
-          (vc-default-dired-state-info 'BZR file)))))
+          (vc-default-dired-state-info 'Bzr file)))))
 
 ;; In case of just `(load "vc-bzr")', but that's probably the wrong
 ;; way to do it.
-(add-to-list 'vc-handled-backends 'BZR)
+(add-to-list 'vc-handled-backends 'Bzr)
 
 (eval-after-load "vc"
   '(add-to-list 'vc-directory-exclusion-list ".bzr" t))
 
 (defconst vc-bzr-unload-hook
   (lambda ()
-    (setq vc-handled-backends (delq 'BZR vc-handled-backends))
+    (setq vc-handled-backends (delq 'Bzr vc-handled-backends))
     (remove-hook 'vc-post-command-functions 'vc-bzr-post-command-function)))
 
 (provide 'vc-bzr)
--- a/lisp/vc-git.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/vc-git.el	Fri Aug 03 05:27:43 2007 +0000
@@ -30,11 +30,11 @@
 
 ;;; Installation:
 
-;; To install: put this file on the load-path and add GIT to the list
+;; To install: put this file on the load-path and add Git to the list
 ;; of supported backends in `vc-handled-backends'; the following line,
 ;; placed in your ~/.emacs, will accomplish this:
 ;;
-;;     (add-to-list 'vc-handled-backends 'GIT)
+;;     (add-to-list 'vc-handled-backends 'Git)
 
 ;;; Todo:
 ;;  - check if more functions could use vc-git-command instead
@@ -214,12 +214,12 @@
     (if (eq git-state 'edited)
 	"(modified)"
       ;; fall back to the default VC representation
-      (vc-default-dired-state-info 'GIT file))))
+      (vc-default-dired-state-info 'Git file))))
 
 ;;; STATE-CHANGING FUNCTIONS
 
 (defun vc-git-create-repo ()
-  "Create a new GIT repository."
+  "Create a new Git repository."
   (vc-git-command "init" nil 0 nil))
 
 (defun vc-git-register (files &optional rev comment)
@@ -287,7 +287,7 @@
 (defvar log-view-file-re)
 (defvar log-view-font-lock-keywords)
 
-(define-derived-mode vc-git-log-view-mode log-view-mode "GIT-Log-View"
+(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) "^File:[ \t]+\\(.+\\)")
--- a/lisp/vc-hg.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/vc-hg.el	Fri Aug 03 05:27:43 2007 +0000
@@ -256,7 +256,7 @@
 (defvar log-view-file-re)
 (defvar log-view-font-lock-keywords)
 
-(define-derived-mode vc-hg-log-view-mode log-view-mode "HG-Log-View"
+(define-derived-mode vc-hg-log-view-mode log-view-mode "Hg-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) "^File:[ \t]+\\(.+\\)")
@@ -399,7 +399,7 @@
 ;;   (vc-hg-command nil nil file "remove"))
 
 (defun vc-hg-checkin (files rev comment)
-  "HG-specific version of `vc-backend-checkin'.
+  "Hg-specific version of `vc-backend-checkin'.
 REV is ignored."
   (vc-hg-command nil 0 files  "commit" "-m" comment))
 
@@ -436,7 +436,7 @@
 	(if (equal (vc-workfile-version file) "0")
 	    "(added)" "(modified)")
       ;; fall back to the default VC representation
-      (vc-default-dired-state-info 'HG file))))
+      (vc-default-dired-state-info 'Hg file))))
 
 ;; Modelled after the similar function in vc-bzr.el
 (defun vc-hg-revert (file &optional contents-done)
--- a/lisp/vc-hooks.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/vc-hooks.el	Fri Aug 03 05:27:43 2007 +0000
@@ -62,8 +62,8 @@
   :type 'regexp
   :group 'vc)
 
-(defcustom vc-handled-backends '(RCS CVS SVN SCCS BZR GIT HG Arch MCVS)
-  ;; BZR, GIT, HG, Arch and MCVS come last because they are per-tree
+(defcustom vc-handled-backends '(RCS CVS SVN SCCS Bzr Git Hg Arch MCVS)
+  ;; Bzr, Git, Hg, Arch and MCVS come last because they are per-tree
   ;; rather than per-dir.
   "List of version control backends for which VC will be used.
 Entries in this list will be tried in order to determine whether a
@@ -950,6 +950,9 @@
   (define-key vc-menu-map [vc-next-action] '("Check In/Out" . vc-next-action))
   (define-key vc-menu-map [vc-register] '("Register" . vc-register)))
 
+(defun vc-default-extra-menu (backend)
+  nil)
+
 ;; These are not correct and it's not currently clear how doing it
 ;; better (with more complicated expressions) might slow things down
 ;; on older systems.
--- a/lisp/vc.el	Tue Jul 31 05:50:45 2007 +0000
+++ b/lisp/vc.el	Fri Aug 03 05:27:43 2007 +0000
@@ -387,7 +387,7 @@
 ;;
 ;;   Only required if `annotate-command' is defined for the backend,
 ;;   AND you'd like the current time considered to be anything besides
-;;   (vs-annotate-convert-time (current-time)) -- i.e. the current
+;;   (vc-annotate-convert-time (current-time)) -- i.e. the current
 ;;   time with hours, minutes, and seconds included.  Probably safe to
 ;;   ignore.  Return the current-time, in units of fractional days.
 ;;
@@ -480,11 +480,20 @@
 ;;
 ;;   Operation called in current buffer when opening a file.  This can
 ;;   be used by the backend to setup some local variables it might need.
-;
+;;
 ;; - find-file-not-found-hook ()
 ;;
 ;;   Operation called in current buffer when opening a non-existing file.
 ;;   By default, this asks the user if she wants to check out the file.
+;;
+;; - extra-menu ()
+;;
+;;   Return a menu keymap, the items in the keymap will appear at the
+;;   end of the Version Control menu.  The goal is to allow backends
+;;   to specify extra menu items that appear in the VC menu.  This way
+;;   you can provide menu entries for functionality that is specific
+;;   to your backend and which does not map to any of the VC generic
+;;   concepts.
 
 ;;; Code:
 
--- a/man/ChangeLog	Tue Jul 31 05:50:45 2007 +0000
+++ b/man/ChangeLog	Fri Aug 03 05:27:43 2007 +0000
@@ -1,3 +1,8 @@
+2007-08-01  Alan Mackenzie  <acm@muc.de>
+
+	* cc-mode.texi (Mailing Lists and Bug Reports): Correct "-no-site-file"
+	to "--no-site-file".
+
 2007-07-29  Michael Albinus  <michael.albinus@gmx.de>
 
 	* tramp.texi (Frequently Asked Questions): Point to mode line
--- a/man/cc-mode.texi	Tue Jul 31 05:50:45 2007 +0000
+++ b/man/cc-mode.texi	Fri Aug 03 05:27:43 2007 +0000
@@ -540,7 +540,7 @@
 @item Making the @key{RET} key indent the new line
 The standard Emacs binding for @key{RET} just adds a new line.  If you
 want it to reindent the new line as well, rebind the key.  Note that
-the action of rebinding will fail if the pertinent keymap doesn't yet
+the action of rebinding would fail if the pertinent keymap didn't yet
 exist---we thus need to delay the action until after @ccmode{} has
 been loaded.  Put the following code into your @file{.emacs}:
 
@@ -881,8 +881,8 @@
 @ccmode{} contains some useful commands for moving around in C code.
 
 @table @asis
-@item @kbd{C-M-a}
-@itemx @kbd{C-M-e}
+@item @kbd{C-M-a} (@code{c-beginning-of-defun})
+@itemx @kbd{C-M-e} (@code{c-end-of-defun})
 @findex c-beginning-of-defun
 @findex c-end-of-defun
 
@@ -6911,11 +6911,11 @@
 you think it might affect our ability to reproduce it.
 
 Please try to produce the problem in an Emacs instance without any
-customizations loaded (i.e. start it with the @samp{-q -no-site-file}
+customizations loaded (i.e. start it with the @samp{-q --no-site-file}
 arguments).  If it works correctly there, the problem might be caused
 by faulty customizations in either your own or your site
-configuration.  In that case, we'd appreciate if you isolate the Emacs
-Lisp code that triggers the bug and include it in your report.
+configuration.  In that case, we'd appreciate it if you isolate the
+Emacs Lisp code that triggers the bug and include it in your report.
 
 @cindex bug report mailing list
 Bug reports should be sent to @email{bug-cc-mode@@gnu.org}.  You can
--- a/src/ChangeLog	Tue Jul 31 05:50:45 2007 +0000
+++ b/src/ChangeLog	Fri Aug 03 05:27:43 2007 +0000
@@ -1,3 +1,12 @@
+2007-08-01  Ryo Yoshitake  <ryo@shiftmode.net>  (tiny change)
+
+	* mac.c (init_mac_osx_environment): Adjust load-path on self-contained
+	build.
+
+2007-07-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* gtkutil.c (xg_tool_bar_callback): Generate a single TOOL_BAR_EVENT.
+
 2007-07-30  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* puresize.h (BASE_PURESIZE): Increase to 1130000.
--- a/src/gtkutil.c	Tue Jul 31 05:50:45 2007 +0000
+++ b/src/gtkutil.c	Fri Aug 03 05:27:43 2007 +0000
@@ -3374,11 +3374,6 @@
   XSETFRAME (frame, f);
   event.kind = TOOL_BAR_EVENT;
   event.frame_or_window = frame;
-  event.arg = frame;
-  kbd_buffer_store_event (&event);
-
-  event.kind = TOOL_BAR_EVENT;
-  event.frame_or_window = frame;
   event.arg = key;
   /* Convert between the modifier bits GDK uses and the modifier bits
      Emacs uses.  This assumes GDK an X masks are the same, which they are when
--- a/src/mac.c	Tue Jul 31 05:50:45 2007 +0000
+++ b/src/mac.c	Fri Aug 03 05:27:43 2007 +0000
@@ -5318,8 +5318,8 @@
   /* P should have sufficient room for the pathname of the bundle plus
      the subpath in it leading to the respective directories.  Q
      should have three times that much room because EMACSLOADPATH can
-     have the value "<path to lisp dir>:<path to leim dir>:<path to
-     site-lisp dir>".  */
+     have the value "<path to site-lisp dir>:<path to lisp dir>:<path
+     to leim dir>".  */
   p = (char *) alloca (app_bundle_pathname_len + 50);
   q = (char *) alloca (3 * app_bundle_pathname_len + 150);
   if (!getenv ("EMACSLOADPATH"))
@@ -5327,12 +5327,12 @@
       q[0] = '\0';
 
       strcpy (p, app_bundle_pathname);
-      strcat (p, "/Contents/Resources/lisp");
+      strcat (p, "/Contents/Resources/site-lisp");
       if (stat (p, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR)
 	strcat (q, p);
 
       strcpy (p, app_bundle_pathname);
-      strcat (p, "/Contents/Resources/leim");
+      strcat (p, "/Contents/Resources/lisp");
       if (stat (p, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR)
 	{
 	  if (q[0] != '\0')
@@ -5341,7 +5341,7 @@
 	}
 
       strcpy (p, app_bundle_pathname);
-      strcat (p, "/Contents/Resources/site-lisp");
+      strcat (p, "/Contents/Resources/leim");
       if (stat (p, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR)
 	{
 	  if (q[0] != '\0')