aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/ChangeLog4
-rw-r--r--etc/NEWS14
-rw-r--r--lisp/ChangeLog81
-rw-r--r--lisp/calc/calc-math.el31
-rw-r--r--lisp/cus-edit.el13
-rw-r--r--lisp/emacs-lisp/pp.el6
-rw-r--r--lisp/ibuf-ext.el2
-rw-r--r--lisp/menu-bar.el14
-rw-r--r--lisp/net/telnet.el3
-rw-r--r--lisp/pcvs.el9
-rw-r--r--lisp/progmodes/fortran.el164
-rw-r--r--lisp/progmodes/python.el34
-rw-r--r--lisp/vc-bzr.el12
-rw-r--r--lisp/vc-git.el10
-rw-r--r--lisp/vc-hg.el6
-rw-r--r--lisp/vc-hooks.el7
-rw-r--r--lisp/vc.el13
-rw-r--r--man/ChangeLog5
-rw-r--r--man/cc-mode.texi12
-rw-r--r--src/ChangeLog9
-rw-r--r--src/gtkutil.c5
-rw-r--r--src/mac.c10
22 files changed, 344 insertions, 120 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 5dded8c4f91..7da5459c40c 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
12007-08-01 Glenn Morris <rgm@gnu.org>
2
3 * NEWS: Add fortran-line-length, plus some more sections.
4
12007-07-25 Glenn Morris <rgm@gnu.org> 52007-07-25 Glenn Morris <rgm@gnu.org>
2 6
3 * Relicense all FSF files to GPLv3 or later. 7 * Relicense all FSF files to GPLv3 or later.
diff --git a/etc/NEWS b/etc/NEWS
index cf6019cbfd2..f56a7a0bf0c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -96,6 +96,9 @@ considered for update.
96 96
97*** The VC mode-line entry now has a tooltip. 97*** The VC mode-line entry now has a tooltip.
98 98
99*** VC backends can provide extra menu entries to be added to the "Version Control" menu.
100This can be used to add menu entries for backend specific functions.
101
99*** VC has some support for Bazaar (bzr). 102*** VC has some support for Bazaar (bzr).
100 103
101** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs. 104** sgml-electric-tag-pair-mode lets you simultaneously edit matched tag pairs.
@@ -139,13 +142,20 @@ Running processes on a remote host can be controlled by settings in
139When the variable `file-precious-flag' is set, the success of a remote 142When the variable `file-precious-flag' is set, the success of a remote
140file copy is checked via the file's checksum. 143file copy is checked via the file's checksum.
141 144
142** comint-mode uses `start-file-process' now (see Lisp Changes). 145** Miscellaneous programming mode changes
146
147*** The variable `fortran-line-length' can change the fixed-form line-length.
148
149** Miscellaneous
150
151*** comint-mode uses `start-file-process' now (see Lisp Changes).
143If `default-directory' is a remote file name, subprocesses are started 152If `default-directory' is a remote file name, subprocesses are started
144on the corresponding remote system. 153on the corresponding remote system.
145 154
146** C-x C-q in dired-mode now runs the command wdired-change-to-wdired-mode, 155*** C-x C-q in dired-mode now runs the command wdired-change-to-wdired-mode,
147and C-x C-q in wdired-mode exits it with asking a question about 156and C-x C-q in wdired-mode exits it with asking a question about
148saving changes. 157saving changes.
158
149 159
150* Changes in Emacs 23.1 on non-free operating systems 160* Changes in Emacs 23.1 on non-free operating systems
151 161
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f48ea78a246..19014a996f9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,84 @@
12007-08-03 Miles Bader <miles@gnu.org>
2
3 * vc-hooks.el (vc-handled-backends): Change capitalization of VC
4 backend names for new backends to `Git', `Hg', and `Bzr'.
5 * vc-hg.el (vc-hg-dired-state-info): Use `Hg' as VC backend name,
6 not `HG'.
7 * vc-git.el (vc-git-dired-state-info): Use `Git' as VC backend
8 name, not `GIT'.
9 * vc-bzr.el (vc-bzr-dir-state, vc-bzr-dired-state-info)
10 (vc-bzr-unload-hook): Use `Bzr' as VC backend name, not `BZR'.
11
122007-08-03 Glenn Morris <rgm@gnu.org>
13
14 * cus-edit.el (customize-apropos): Make the error message indicate
15 what kind of thing the user was trying to customize.
16
17 * net/telnet.el (telnet-mode): Set comint-use-prompt-regexp to t.
18
19 * progmodes/fortran.el (fortran-font-lock-syntactic-keywords): Fix
20 off-by-one error in previous change.
21
222007-08-03 Drew Adams <drew.adams@oracle.com>
23
24 * emacs-lisp/pp.el (pp-eval-expression): Add progress message.
25 Make buffer writable.
26
272007-08-01 Jay Belanger <jay.p.belanger@gmail.com>
28
29 * calc/calc-math.el (math-sqrt-raw,math-sin-raw-2)
30 (math-cos-raw-2,math-arctan-raw,math-ln-raw):
31 Use native Emacs functions, when appropriate.
32
332007-08-01 Dan Nicolaescu <dann@ics.uci.edu>
34 Stefan Monnier <monnier@iro.umontreal.ca>
35
36 * vc.el: Document new VC operation `extra-menu'.
37
38 * vc-hooks.el (vc-default-extra-menu): New function.
39
40 * menu-bar.el (menu-bar-vc-filter): New function.
41 (menu-bar-tools-menu): Use it as a filter.
42
432007-08-01 Eric Hanchrow <offby1@blarg.net> (tiny change)
44
45 * ibuf-ext.el (ibuffer-mark-old-buffers): Docstring fix.
46
472007-08-01 Glenn Morris <rgm@gnu.org>
48
49 * progmodes/fortran.el: Remove leading `*' from all defcustom doc
50 strings.
51 (fortran-tab-mode-default): Remove needless autoload.
52 (fortran-tab-mode-string): Add help-echo and mouse properties, and
53 mark as risky.
54 (fortran-line-length): New buffer-local variable, safe if integer.
55 (fortran-if-start-re, fortran-end-prog-re1, fortran-end-prog-re):
56 Change from variables to constants.
57 (fortran-font-lock-syntactic-keywords): Delete as a variable,
58 replace with a new function definition.
59 (fortran-mode): Use fortran-line-length, and
60 fortran-font-lock-syntactic-keywords as a function. Add a
61 hack-local-variables-hook function.
62 (fortran-line-length, fortran-hack-local-variables): New
63 functions.
64 (fortran-window-create, fortran-strip-sequence-nos): Doc fix. Use
65 fortran-line-length rather than 72.
66 (fortran-window-create-momentarily): Doc fix.
67
682007-07-31 Drew Adams <drew.adams@oracle.com> (tiny change)
69
70 * cus-edit.el (custom-group-value-create, custom-goto-parent): Fix
71 parent groups link.
72
732007-07-31 Paul Pogonyshev <pogonyshev@gmx.net>
74
75 * progmodes/python.el (python-current-defun): Adjust to never fall
76 into infinite loop.
77
782007-07-31 Stefan Monnier <monnier@iro.umontreal.ca>
79
80 * pcvs.el (cvs-vc-command-advice): Handle the new fileset case.
81
12007-07-29 Kimit Yada <kimitto@gmail.com> (tiny change) 822007-07-29 Kimit Yada <kimitto@gmail.com> (tiny change)
2 83
3 * emacs-lisp/copyright.el (copyright-update-year, copyright-update) 84 * emacs-lisp/copyright.el (copyright-update-year, copyright-update)
diff --git a/lisp/calc/calc-math.el b/lisp/calc/calc-math.el
index a442f2b4e03..a4dad15c14e 100644
--- a/lisp/calc/calc-math.el
+++ b/lisp/calc/calc-math.el
@@ -529,13 +529,16 @@ If this can't be done, return NIL."
529(defun math-sqrt-raw (a &optional guess) ; [F F F] 529(defun math-sqrt-raw (a &optional guess) ; [F F F]
530 (if (not (Math-posp a)) 530 (if (not (Math-posp a))
531 (math-sqrt a) 531 (math-sqrt a)
532 (if (null guess) 532 (cond
533 (let ((ldiff (- (math-numdigs (nth 1 a)) 6))) 533 ((math-use-emacs-fn 'sqrt a))
534 (or (= (% (+ (nth 2 a) ldiff) 2) 0) (setq ldiff (1+ ldiff))) 534 (t
535 (setq guess (math-make-float (math-isqrt-small 535 (if (null guess)
536 (math-scale-int (nth 1 a) (- ldiff))) 536 (let ((ldiff (- (math-numdigs (nth 1 a)) 6)))
537 (/ (+ (nth 2 a) ldiff) 2))))) 537 (or (= (% (+ (nth 2 a) ldiff) 2) 0) (setq ldiff (1+ ldiff)))
538 (math-sqrt-float-iter a guess))) 538 (setq guess (math-make-float (math-isqrt-small
539 (math-scale-int (nth 1 a) (- ldiff)))
540 (/ (+ (nth 2 a) ldiff) 2)))))
541 (math-sqrt-float-iter a guess)))))
539 542
540(defun math-sqrt-float-iter (a guess) ; [F F F] 543(defun math-sqrt-float-iter (a guess) ; [F F F]
541 (math-working "sqrt" guess) 544 (math-working "sqrt" guess)
@@ -1201,11 +1204,13 @@ If this can't be done, return NIL."
1201 ((math-lessp-float x (math-neg (math-pi-over-4))) 1204 ((math-lessp-float x (math-neg (math-pi-over-4)))
1202 (math-neg (math-cos-raw-2 (math-add (math-pi-over-2) x) orgx))) 1205 (math-neg (math-cos-raw-2 (math-add (math-pi-over-2) x) orgx)))
1203 ((math-nearly-zerop-float x orgx) '(float 0 0)) 1206 ((math-nearly-zerop-float x orgx) '(float 0 0))
1207 ((math-use-emacs-fn 'sin x))
1204 (calc-symbolic-mode (signal 'inexact-result nil)) 1208 (calc-symbolic-mode (signal 'inexact-result nil))
1205 (t (math-sin-series x 6 4 x (math-neg-float (math-sqr-float x))))))) 1209 (t (math-sin-series x 6 4 x (math-neg-float (math-sqr-float x)))))))
1206 1210
1207(defun math-cos-raw-2 (x orgx) ; [F F] 1211(defun math-cos-raw-2 (x orgx) ; [F F]
1208 (cond ((math-nearly-zerop-float x orgx) '(float 1 0)) 1212 (cond ((math-nearly-zerop-float x orgx) '(float 1 0))
1213 ((math-use-emacs-fn 'cos x))
1209 (calc-symbolic-mode (signal 'inexact-result nil)) 1214 (calc-symbolic-mode (signal 'inexact-result nil))
1210 (t (let ((xnegsqr (math-neg-float (math-sqr-float x)))) 1215 (t (let ((xnegsqr (math-neg-float (math-sqr-float x))))
1211 (math-sin-series 1216 (math-sin-series
@@ -1319,6 +1324,7 @@ If this can't be done, return NIL."
1319 ((Math-integer-negp (nth 1 x)) 1324 ((Math-integer-negp (nth 1 x))
1320 (math-neg-float (math-arctan-raw (math-neg-float x)))) 1325 (math-neg-float (math-arctan-raw (math-neg-float x))))
1321 ((math-zerop x) x) 1326 ((math-zerop x) x)
1327 ((math-use-emacs-fn 'atan x))
1322 (calc-symbolic-mode (signal 'inexact-result nil)) 1328 (calc-symbolic-mode (signal 'inexact-result nil))
1323 ((math-equal-int x 1) (math-pi-over-4)) 1329 ((math-equal-int x 1) (math-pi-over-4))
1324 ((math-equal-int x -1) (math-neg (math-pi-over-4))) 1330 ((math-equal-int x -1) (math-neg (math-pi-over-4)))
@@ -1737,10 +1743,13 @@ If this can't be done, return NIL."
1737 '(float 0 0)) 1743 '(float 0 0))
1738 (calc-symbolic-mode (signal 'inexact-result nil)) 1744 (calc-symbolic-mode (signal 'inexact-result nil))
1739 ((math-posp (nth 1 x)) ; positive and real 1745 ((math-posp (nth 1 x)) ; positive and real
1740 (let ((xdigs (1- (math-numdigs (nth 1 x))))) 1746 (cond
1741 (math-add-float (math-ln-raw-2 (list 'float (nth 1 x) (- xdigs))) 1747 ((math-use-emacs-fn 'log x))
1742 (math-mul-float (math-float (+ (nth 2 x) xdigs)) 1748 (t
1743 (math-ln-10))))) 1749 (let ((xdigs (1- (math-numdigs (nth 1 x)))))
1750 (math-add-float (math-ln-raw-2 (list 'float (nth 1 x) (- xdigs)))
1751 (math-mul-float (math-float (+ (nth 2 x) xdigs))
1752 (math-ln-10)))))))
1744 ((math-zerop x) 1753 ((math-zerop x)
1745 (math-reject-arg x "*Logarithm of zero")) 1754 (math-reject-arg x "*Logarithm of zero"))
1746 ((eq calc-complex-mode 'polar) ; negative and real 1755 ((eq calc-complex-mode 'polar) ; negative and real
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index ff86711e041..2cfd247a645 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1376,7 +1376,14 @@ that are not customizable options, as well as faces and groups
1376 (get symbol 'variable-documentation)))) 1376 (get symbol 'variable-documentation))))
1377 (push (list symbol 'custom-variable) found))))) 1377 (push (list symbol 'custom-variable) found)))))
1378 (if (not found) 1378 (if (not found)
1379 (error "No customizable items matching %s" regexp) 1379 (error "No %s matching %s"
1380 (if (eq all t)
1381 "items"
1382 (format "customizable %s"
1383 (if (memq all '(options faces groups))
1384 (symbol-name all)
1385 "items")))
1386 regexp)
1380 (custom-buffer-create 1387 (custom-buffer-create
1381 (custom-sort-items found t custom-buffer-order-groups) 1388 (custom-sort-items found t custom-buffer-order-groups)
1382 "*Customize Apropos*")))) 1389 "*Customize Apropos*"))))
@@ -3878,7 +3885,7 @@ If GROUPS-ONLY non-nil, return only those members that are groups."
3878 ;;; was made to display a group. 3885 ;;; was made to display a group.
3879 (when (eq level 1) 3886 (when (eq level 1)
3880 (if (custom-add-parent-links widget 3887 (if (custom-add-parent-links widget
3881 "Parent group:") 3888 "Parent groups:")
3882 (insert "\n")))) 3889 (insert "\n"))))
3883 ;; Create level indicator. 3890 ;; Create level indicator.
3884 (insert-char ?\ (* custom-buffer-indent (1- level))) 3891 (insert-char ?\ (* custom-buffer-indent (1- level)))
@@ -4480,7 +4487,7 @@ If several parents are listed, go to the first of them."
4480 (interactive) 4487 (interactive)
4481 (save-excursion 4488 (save-excursion
4482 (goto-char (point-min)) 4489 (goto-char (point-min))
4483 (if (search-forward "\nGo to parent group: " nil t) 4490 (if (search-forward "\nParent groups: " nil t)
4484 (let* ((button (get-char-property (point) 'button)) 4491 (let* ((button (get-char-property (point) 'button))
4485 (parent (downcase (widget-get button :tag)))) 4492 (parent (downcase (widget-get button :tag))))
4486 (customize-group parent))))) 4493 (customize-group parent)))))
diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el
index 21175a03b4d..a5cefff399f 100644
--- a/lisp/emacs-lisp/pp.el
+++ b/lisp/emacs-lisp/pp.el
@@ -103,6 +103,7 @@ Also add the value to the front of the list in the variable `values'."
103 (interactive 103 (interactive
104 (list (read-from-minibuffer "Eval: " nil read-expression-map t 104 (list (read-from-minibuffer "Eval: " nil read-expression-map t
105 'read-expression-history))) 105 'read-expression-history)))
106 (message "Evaluating...")
106 (setq values (cons (eval expression) values)) 107 (setq values (cons (eval expression) values))
107 (let* ((old-show-function temp-buffer-show-function) 108 (let* ((old-show-function temp-buffer-show-function)
108 ;; Use this function to display the buffer. 109 ;; Use this function to display the buffer.
@@ -126,13 +127,16 @@ Also add the value to the front of the list in the variable `values'."
126 (progn 127 (progn
127 (select-window window) 128 (select-window window)
128 (run-hooks 'temp-buffer-show-hook)) 129 (run-hooks 'temp-buffer-show-hook))
129 (select-window old-selected))) 130 (select-window old-selected)
131 (message "Evaluating...done. \
132See buffer *Pp Eval Output*.")))
130 (message "%s" (buffer-substring (point-min) (point))) 133 (message "%s" (buffer-substring (point-min) (point)))
131 )))))) 134 ))))))
132 (with-output-to-temp-buffer "*Pp Eval Output*" 135 (with-output-to-temp-buffer "*Pp Eval Output*"
133 (pp (car values)) 136 (pp (car values))
134 (with-current-buffer standard-output 137 (with-current-buffer standard-output
135 (emacs-lisp-mode) 138 (emacs-lisp-mode)
139 (setq buffer-read-only nil)
136 (set (make-local-variable 'font-lock-verbose) nil))))) 140 (set (make-local-variable 'font-lock-verbose) nil)))))
137 141
138;;;###autoload 142;;;###autoload
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 4f510472d54..b077342e5f5 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -1482,7 +1482,7 @@ You can then feed the file name(s) to other commands with \\[yank]."
1482 1482
1483;;;###autoload 1483;;;###autoload
1484(defun ibuffer-mark-old-buffers () 1484(defun ibuffer-mark-old-buffers ()
1485 "Mark buffers which have not been viewed in `ibuffer-old-time' days." 1485 "Mark buffers which have not been viewed in `ibuffer-old-time' hours."
1486 (interactive) 1486 (interactive)
1487 (ibuffer-mark-on-buffer 1487 (ibuffer-mark-on-buffer
1488 #'(lambda (buf) 1488 #'(lambda (buf)
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 7d9dff8c501..aaa1d8a1bbd 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1165,7 +1165,19 @@ mail status in mode line"))
1165(define-key menu-bar-tools-menu [pcl-cvs] 1165(define-key menu-bar-tools-menu [pcl-cvs]
1166 '(menu-item "PCL-CVS" cvs-global-menu)) 1166 '(menu-item "PCL-CVS" cvs-global-menu))
1167(define-key menu-bar-tools-menu [vc] 1167(define-key menu-bar-tools-menu [vc]
1168 (list 'menu-item "Version Control" vc-menu-map)) 1168 (list 'menu-item "Version Control" vc-menu-map
1169 :filter 'menu-bar-vc-filter))
1170
1171(defun menu-bar-vc-filter (orig-binding)
1172 (let ((ext-binding
1173 (if vc-mode (vc-call 'extra-menu buffer-file-name))))
1174 ;; Give the VC backend a chance to add menu entries
1175 ;; specific for that backend.
1176 (if (null ext-binding)
1177 orig-binding
1178 (append orig-binding
1179 '((ext-menu-separator "---"))
1180 ext-binding))))
1169 1181
1170(define-key menu-bar-tools-menu [separator-compare] 1182(define-key menu-bar-tools-menu [separator-compare]
1171 '("--")) 1183 '("--"))
diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el
index c7b37050ed2..28f7d1ddb46 100644
--- a/lisp/net/telnet.el
+++ b/lisp/net/telnet.el
@@ -247,7 +247,8 @@ It has most of the same commands as comint-mode.
247There is a variable ``telnet-interrupt-string'' which is the character 247There is a variable ``telnet-interrupt-string'' which is the character
248sent to try to stop execution of a job on the remote host. 248sent to try to stop execution of a job on the remote host.
249Data is sent to the remote host when RET is typed." 249Data is sent to the remote host when RET is typed."
250 (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern)) 250 (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern)
251 (setq comint-use-prompt-regexp t))
251 252
252;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)") 253;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)")
253 254
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index 901110bbfa3..5c79f7a5fb9 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -2354,7 +2354,7 @@ The exact behavior is determined also by `cvs-dired-use-hook'."
2354 2354
2355(add-hook 'vc-post-command-functions 'cvs-vc-command-advice) 2355(add-hook 'vc-post-command-functions 'cvs-vc-command-advice)
2356 2356
2357(defun cvs-vc-command-advice (command file flags) 2357(defun cvs-vc-command-advice (command files flags)
2358 (when (and (equal command "cvs") 2358 (when (and (equal command "cvs")
2359 (progn 2359 (progn
2360 (while (and (stringp (car flags)) 2360 (while (and (stringp (car flags))
@@ -2383,9 +2383,10 @@ The exact behavior is determined also by `cvs-dired-use-hook'."
2383 (when (and (equal (car flags) "add") 2383 (when (and (equal (car flags) "add")
2384 (goto-char (point-min)) 2384 (goto-char (point-min))
2385 (looking-at ".*to add this file permanently\n\\'")) 2385 (looking-at ".*to add this file permanently\n\\'"))
2386 (insert "cvs add: scheduling file `" 2386 (dolist (file (if (listp files) files (list file)))
2387 (file-name-nondirectory file) 2387 (insert "cvs add: scheduling file `"
2388 "' for addition\n")) 2388 (file-name-nondirectory file)
2389 "' for addition\n")))
2389 ;; VC never (?) does `cvs -n update' so dcd=nil 2390 ;; VC never (?) does `cvs -n update' so dcd=nil
2390 ;; should probably always be the right choice. 2391 ;; should probably always be the right choice.
2391 (cvs-parse-process nil subdir)))))))) 2392 (cvs-parse-process nil subdir))))))))
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index b9865613765..97f4c1c2616 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -1,7 +1,8 @@
1;;; fortran.el --- Fortran mode for GNU Emacs 1;;; fortran.el --- Fortran mode for GNU Emacs
2 2
3;; Copyright (C) 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 3;; Copyright (C) 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
4;; 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 4;; 2002, 2003, 2004, 2005, 2006, 2007
5;; Free Software Foundation, Inc.
5 6
6;; Author: Michael D. Prange <prange@erl.mit.edu> 7;; Author: Michael D. Prange <prange@erl.mit.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org> 8;; Maintainer: Glenn Morris <rgm@gnu.org>
@@ -78,42 +79,52 @@
78 :group 'fortran) 79 :group 'fortran)
79 80
80 81
81;;;###autoload
82(defcustom fortran-tab-mode-default nil 82(defcustom fortran-tab-mode-default nil
83 "*Default tabbing/carriage control style for empty files in Fortran mode. 83 "Default tabbing/carriage control style for empty files in Fortran mode.
84A non-nil value specifies tab-digit style of continuation control. 84A non-nil value specifies tab-digit style of continuation control.
85A value of nil specifies that continuation lines are marked 85A value of nil specifies that continuation lines are marked
86with a character in column 6." 86with a character in column 6."
87 :type 'boolean 87 :type 'boolean
88 :group 'fortran-indent) 88 :group 'fortran-indent)
89 89
90(defcustom fortran-tab-mode-string "/t" 90;; TODO add more detail of what tab mode is to doc string.
91 "*String to appear in mode line in TAB format buffers." 91(defcustom fortran-tab-mode-string
92 (propertize "/t" 'help-echo "This buffer is in Fortran TAB mode"
93 'mouse-face 'mode-line-highlight
94 'local-map
95 (make-mode-line-mouse-map 'mouse-1
96 (lambda ()
97 (interactive)
98 (describe-variable
99 'fortran-tab-mode-string))))
100 "String to appear in mode line in TAB format buffers."
92 :type 'string 101 :type 'string
93 :group 'fortran-indent) 102 :group 'fortran-indent)
94 103
104(put 'fortran-tab-mode-string 'risky-local-variable t)
105
95(defcustom fortran-do-indent 3 106(defcustom fortran-do-indent 3
96 "*Extra indentation applied to DO blocks." 107 "Extra indentation applied to DO blocks."
97 :type 'integer 108 :type 'integer
98 :group 'fortran-indent) 109 :group 'fortran-indent)
99 110
100(defcustom fortran-if-indent 3 111(defcustom fortran-if-indent 3
101 "*Extra indentation applied to IF, SELECT CASE and WHERE blocks." 112 "Extra indentation applied to IF, SELECT CASE and WHERE blocks."
102 :type 'integer 113 :type 'integer
103 :group 'fortran-indent) 114 :group 'fortran-indent)
104 115
105(defcustom fortran-structure-indent 3 116(defcustom fortran-structure-indent 3
106 "*Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks." 117 "Extra indentation applied to STRUCTURE, UNION, MAP and INTERFACE blocks."
107 :type 'integer 118 :type 'integer
108 :group 'fortran-indent) 119 :group 'fortran-indent)
109 120
110(defcustom fortran-continuation-indent 5 121(defcustom fortran-continuation-indent 5
111 "*Extra indentation applied to continuation lines." 122 "Extra indentation applied to continuation lines."
112 :type 'integer 123 :type 'integer
113 :group 'fortran-indent) 124 :group 'fortran-indent)
114 125
115(defcustom fortran-comment-indent-style 'fixed 126(defcustom fortran-comment-indent-style 'fixed
116 "*How to indent comments. 127 "How to indent comments.
117nil forces comment lines not to be touched; 128nil forces comment lines not to be touched;
118`fixed' indents to `fortran-comment-line-extra-indent' columns beyond 129`fixed' indents to `fortran-comment-line-extra-indent' columns beyond
119 `fortran-minimum-statement-indent-fixed' (if `indent-tabs-mode' nil), or 130 `fortran-minimum-statement-indent-fixed' (if `indent-tabs-mode' nil), or
@@ -124,13 +135,13 @@ nil forces comment lines not to be touched;
124 :group 'fortran-indent) 135 :group 'fortran-indent)
125 136
126(defcustom fortran-comment-line-extra-indent 0 137(defcustom fortran-comment-line-extra-indent 0
127 "*Amount of extra indentation for text within full-line comments." 138 "Amount of extra indentation for text within full-line comments."
128 :type 'integer 139 :type 'integer
129 :group 'fortran-indent 140 :group 'fortran-indent
130 :group 'fortran-comment) 141 :group 'fortran-comment)
131 142
132(defcustom fortran-comment-line-start "C" 143(defcustom fortran-comment-line-start "C"
133 "*Delimiter inserted to start new full-line comment. 144 "Delimiter inserted to start new full-line comment.
134You might want to change this to \"*\", for instance." 145You might want to change this to \"*\", for instance."
135 :version "21.1" 146 :version "21.1"
136 :type 'string 147 :type 'string
@@ -147,7 +158,7 @@ You might want to change this to \"*\", for instance."
147 158
148(defcustom fortran-directive-re 159(defcustom fortran-directive-re
149 "^[ \t]*#.*" 160 "^[ \t]*#.*"
150 "*Regexp to match a directive line. 161 "Regexp to match a directive line.
151The matching text will be fontified with `font-lock-keyword-face'. 162The matching text will be fontified with `font-lock-keyword-face'.
152The matching line will be given zero indentation." 163The matching line will be given zero indentation."
153 :version "22.1" 164 :version "22.1"
@@ -155,12 +166,12 @@ The matching line will be given zero indentation."
155 :group 'fortran-indent) 166 :group 'fortran-indent)
156 167
157(defcustom fortran-minimum-statement-indent-fixed 6 168(defcustom fortran-minimum-statement-indent-fixed 6
158 "*Minimum statement indentation for fixed format continuation style." 169 "Minimum statement indentation for fixed format continuation style."
159 :type 'integer 170 :type 'integer
160 :group 'fortran-indent) 171 :group 'fortran-indent)
161 172
162(defcustom fortran-minimum-statement-indent-tab (max tab-width 6) 173(defcustom fortran-minimum-statement-indent-tab (max tab-width 6)
163 "*Minimum statement indentation for TAB format continuation style." 174 "Minimum statement indentation for TAB format continuation style."
164 :type 'integer 175 :type 'integer
165 :group 'fortran-indent) 176 :group 'fortran-indent)
166 177
@@ -168,30 +179,30 @@ The matching line will be given zero indentation."
168;; of length one rather than a single character. 179;; of length one rather than a single character.
169;; The code in this file accepts either format for compatibility. 180;; The code in this file accepts either format for compatibility.
170(defcustom fortran-comment-indent-char " " 181(defcustom fortran-comment-indent-char " "
171 "*Single-character string inserted for Fortran comment indentation. 182 "Single-character string inserted for Fortran comment indentation.
172Normally a space." 183Normally a space."
173 :type 'string 184 :type 'string
174 :group 'fortran-comment) 185 :group 'fortran-comment)
175 186
176(defcustom fortran-line-number-indent 1 187(defcustom fortran-line-number-indent 1
177 "*Maximum indentation for Fortran line numbers. 188 "Maximum indentation for Fortran line numbers.
1785 means right-justify them within their five-column field." 1895 means right-justify them within their five-column field."
179 :type 'integer 190 :type 'integer
180 :group 'fortran-indent) 191 :group 'fortran-indent)
181 192
182(defcustom fortran-check-all-num-for-matching-do nil 193(defcustom fortran-check-all-num-for-matching-do nil
183 "*Non-nil causes all numbered lines to be treated as possible DO loop ends." 194 "Non-nil causes all numbered lines to be treated as possible DO loop ends."
184 :type 'boolean 195 :type 'boolean
185 :group 'fortran) 196 :group 'fortran)
186 197
187(defcustom fortran-blink-matching-if nil 198(defcustom fortran-blink-matching-if nil
188 "*Non-nil causes \\[fortran-indent-line] on ENDIF to blink on matching IF. 199 "Non-nil causes \\[fortran-indent-line] on ENDIF to blink on matching IF.
189Also, from an ENDDO statement blink on matching DO [WHILE] statement." 200Also, from an ENDDO statement blink on matching DO [WHILE] statement."
190 :type 'boolean 201 :type 'boolean
191 :group 'fortran) 202 :group 'fortran)
192 203
193(defcustom fortran-continuation-string "$" 204(defcustom fortran-continuation-string "$"
194 "*Single-character string used for Fortran continuation lines. 205 "Single-character string used for Fortran continuation lines.
195In fixed format continuation style, this character is inserted in 206In fixed format continuation style, this character is inserted in
196column 6 by \\[fortran-split-line] to begin a continuation line. 207column 6 by \\[fortran-split-line] to begin a continuation line.
197Also, if \\[fortran-indent-line] finds this at the beginning of a 208Also, if \\[fortran-indent-line] finds this at the beginning of a
@@ -201,16 +212,17 @@ appropriate style. Normally $."
201 :group 'fortran) 212 :group 'fortran)
202 213
203(defcustom fortran-comment-region "c$$$" 214(defcustom fortran-comment-region "c$$$"
204 "*String inserted by \\[fortran-comment-region] at start of each \ 215 "String inserted by \\[fortran-comment-region] at start of each \
205line in region." 216line in region."
206 :type 'string 217 :type 'string
207 :group 'fortran-comment) 218 :group 'fortran-comment)
208 219
209(defcustom fortran-electric-line-number t 220(defcustom fortran-electric-line-number t
210 "*Non-nil causes line numbers to be moved to the correct column as typed." 221 "Non-nil causes line numbers to be moved to the correct column as typed."
211 :type 'boolean 222 :type 'boolean
212 :group 'fortran) 223 :group 'fortran)
213 224
225;; TODO use fortran-line-length, somehow.
214(defcustom fortran-column-ruler-fixed 226(defcustom fortran-column-ruler-fixed
215 "0 4 6 10 20 30 40 5\ 227 "0 4 6 10 20 30 40 5\
2160 60 70\n\ 2280 60 70\n\
@@ -222,6 +234,7 @@ See the variable `fortran-column-ruler-tab' for TAB format mode."
222 :type 'string 234 :type 'string
223 :group 'fortran) 235 :group 'fortran)
224 236
237;; TODO use fortran-line-length, somehow.
225(defcustom fortran-column-ruler-tab 238(defcustom fortran-column-ruler-tab
226 "0 810 20 30 40 5\ 239 "0 810 20 30 40 5\
2270 60 70\n\ 2400 60 70\n\
@@ -239,11 +252,38 @@ See the variable `fortran-column-ruler-fixed' for fixed format mode."
239 :group 'fortran) 252 :group 'fortran)
240 253
241(defcustom fortran-break-before-delimiters t 254(defcustom fortran-break-before-delimiters t
242 "*Non-nil causes filling to break lines before delimiters. 255 "Non-nil causes filling to break lines before delimiters.
243Delimiters are characters matching the regexp `fortran-break-delimiters-re'." 256Delimiters are characters matching the regexp `fortran-break-delimiters-re'."
244 :type 'boolean 257 :type 'boolean
245 :group 'fortran) 258 :group 'fortran)
246 259
260;; TODO 0 as no-limit, as per g77.
261(defcustom fortran-line-length 72
262 "Maximum number of characters in a line of fixed-form Fortran code.
263Characters beyond this point are treated as comments. Setting
264this variable directly (after fortran mode is loaded) does not
265take effect. Use either \\[customize] (which affects all Fortran
266buffers and the default) or the function
267`fortran-line-length' (which can also operate on just the current
268buffer). This corresponds to the g77 compiler option
269`-ffixed-line-length-N'."
270 :type 'integer
271 :initialize 'custom-initialize-default
272 :set (lambda (symbol value)
273 ;; Do all fortran buffers, and the default.
274 (fortran-line-length value t))
275 :version "23.1"
276 :group 'fortran)
277
278(put 'fortran-line-length 'safe-local-variable 'integerp)
279(make-variable-buffer-local 'fortran-line-length)
280
281(defcustom fortran-mode-hook nil
282 "Hook run when entering Fortran mode."
283 :type 'hook
284 :group 'fortran)
285
286
247(defconst fortran-break-delimiters-re "[-+*/><=, \t]" 287(defconst fortran-break-delimiters-re "[-+*/><=, \t]"
248 "Regexp matching delimiter characters at which lines may be broken. 288 "Regexp matching delimiter characters at which lines may be broken.
249There are certain tokens comprised entirely of characters 289There are certain tokens comprised entirely of characters
@@ -259,22 +299,16 @@ characters matching the regexp `fortran-break-delimiters-re' that should
259not be split by filling. Each element is assumed to be two 299not be split by filling. Each element is assumed to be two
260characters long.") 300characters long.")
261 301
262(defcustom fortran-mode-hook nil 302(defconst fortran-if-start-re "\\(\\(\\sw\\|\\s_\\)+:[ \t]*\\)?if[ \t]*("
263 "Hook run when entering Fortran mode."
264 :type 'hook
265 :group 'fortran)
266
267
268(defvar fortran-if-start-re "\\(\\(\\sw\\|\\s_\\)+:[ \t]*\\)?if[ \t]*("
269 "Regexp matching the start of an IF statement.") 303 "Regexp matching the start of an IF statement.")
270 304
271(defvar fortran-end-prog-re1 305(defconst fortran-end-prog-re1
272 "end\ 306 "end\
273\\([ \t]*\\(program\\|subroutine\\|function\\|block[ \t]*data\\)\\>\ 307\\([ \t]*\\(program\\|subroutine\\|function\\|block[ \t]*data\\)\\>\
274\\([ \t]*\\(\\sw\\|\\s_\\)+\\)?\\)?" 308\\([ \t]*\\(\\sw\\|\\s_\\)+\\)?\\)?"
275 "Regexp possibly matching the end of a subprogram.") 309 "Regexp possibly matching the end of a subprogram.")
276 310
277(defvar fortran-end-prog-re 311(defconst fortran-end-prog-re
278 (concat "^[ \t0-9]*" fortran-end-prog-re1) 312 (concat "^[ \t0-9]*" fortran-end-prog-re1)
279 "Regexp possibly matching the end of a subprogram, from the line start. 313 "Regexp possibly matching the end of a subprogram, from the line start.
280See also `fortran-end-prog-re1'.") 314See also `fortran-end-prog-re1'.")
@@ -402,11 +436,13 @@ Consists of level 3 plus all other intrinsics not already highlighted.")
402;; (We can do so for F90-style). Therefore an unmatched quote in a 436;; (We can do so for F90-style). Therefore an unmatched quote in a
403;; standard comment will throw fontification off on the wrong track. 437;; standard comment will throw fontification off on the wrong track.
404;; So we do syntactic fontification with regexps. 438;; So we do syntactic fontification with regexps.
405(defvar fortran-font-lock-syntactic-keywords 439(defun fortran-font-lock-syntactic-keywords ()
406 '(("^[cd\\*]" 0 (11)) 440 "Return a value for `font-lock-syntactic-keywords' in Fortran mode.
407 ("^[^cd\\*\t\n].\\{71\\}\\([^\n]+\\)" 1 (11))) 441This varies according to the value of `fortran-line-length'.
408 "`font-lock-syntactic-keywords' for Fortran. 442This is used to fontify fixed-format Fortran comments."
409These get fixed-format comments fontified.") 443 `(("^[cd\\*]" 0 (11))
444 (,(format "^[^cd\\*\t\n].\\{%d\\}\\([^\n]+\\)" (1- fortran-line-length))
445 1 (11))))
410 446
411(defvar fortran-font-lock-keywords fortran-font-lock-keywords-1 447(defvar fortran-font-lock-keywords fortran-font-lock-keywords-1
412 "Default expressions to highlight in Fortran mode.") 448 "Default expressions to highlight in Fortran mode.")
@@ -582,6 +618,8 @@ Used in the Fortran entry in `hs-special-modes-alist'.")
582 ["Widen" widen t] 618 ["Widen" widen t]
583 "--" 619 "--"
584 ["Temporary column ruler" fortran-column-ruler t] 620 ["Temporary column ruler" fortran-column-ruler t]
621 ;; May not be '72', depending on fortran-line-length, but this
622 ;; seems ok for a menu item.
585 ["72-column window" fortran-window-create t] 623 ["72-column window" fortran-window-create t]
586 ["Full Width Window" 624 ["Full Width Window"
587 (enlarge-window-horizontally (- (frame-width) (window-width))) 625 (enlarge-window-horizontally (- (frame-width) (window-width)))
@@ -780,7 +818,7 @@ with no args, if that value is non-nil."
780 (set (make-local-variable 'normal-auto-fill-function) 'fortran-auto-fill) 818 (set (make-local-variable 'normal-auto-fill-function) 'fortran-auto-fill)
781 (set (make-local-variable 'indent-tabs-mode) (fortran-analyze-file-format)) 819 (set (make-local-variable 'indent-tabs-mode) (fortran-analyze-file-format))
782 (setq mode-line-process '(indent-tabs-mode fortran-tab-mode-string)) 820 (setq mode-line-process '(indent-tabs-mode fortran-tab-mode-string))
783 (set (make-local-variable 'fill-column) 72) 821 (set (make-local-variable 'fill-column) fortran-line-length)
784 (set (make-local-variable 'fill-paragraph-function) 'fortran-fill-paragraph) 822 (set (make-local-variable 'fill-paragraph-function) 'fortran-fill-paragraph)
785 (set (make-local-variable 'font-lock-defaults) 823 (set (make-local-variable 'font-lock-defaults)
786 '((fortran-font-lock-keywords 824 '((fortran-font-lock-keywords
@@ -791,7 +829,7 @@ with no args, if that value is non-nil."
791 nil t ((?/ . "$/") ("_$" . "w")) 829 nil t ((?/ . "$/") ("_$" . "w"))
792 fortran-beginning-of-subprogram)) 830 fortran-beginning-of-subprogram))
793 (set (make-local-variable 'font-lock-syntactic-keywords) 831 (set (make-local-variable 'font-lock-syntactic-keywords)
794 fortran-font-lock-syntactic-keywords) 832 (fortran-font-lock-syntactic-keywords))
795 (set (make-local-variable 'imenu-case-fold-search) t) 833 (set (make-local-variable 'imenu-case-fold-search) t)
796 (set (make-local-variable 'imenu-generic-expression) 834 (set (make-local-variable 'imenu-generic-expression)
797 fortran-imenu-generic-expression) 835 fortran-imenu-generic-expression)
@@ -804,9 +842,38 @@ with no args, if that value is non-nil."
804 #'fortran-current-defun) 842 #'fortran-current-defun)
805 (set (make-local-variable 'dabbrev-case-fold-search) 'case-fold-search) 843 (set (make-local-variable 'dabbrev-case-fold-search) 'case-fold-search)
806 (set (make-local-variable 'gud-find-expr-function) 'fortran-gud-find-expr) 844 (set (make-local-variable 'gud-find-expr-function) 'fortran-gud-find-expr)
845 (add-hook 'hack-local-variables-hook 'fortran-hack-local-variables nil t)
807 (run-mode-hooks 'fortran-mode-hook)) 846 (run-mode-hooks 'fortran-mode-hook))
808 847
809 848
849(defun fortran-line-length (nchars &optional global)
850 "Set the length of fixed-form Fortran lines to NCHARS.
851This normally only affects the current buffer, which must be in
852Fortran mode. If the optional argument GLOBAL is non-nil, it
853affects all Fortran buffers, and also the default."
854 (interactive "p")
855 (let (new)
856 (mapcar (lambda (buff)
857 (with-current-buffer buff
858 (when (eq major-mode 'fortran-mode)
859 (setq fortran-line-length nchars
860 fill-column fortran-line-length
861 new (fortran-font-lock-syntactic-keywords))
862 ;; Refontify only if necessary.
863 (unless (equal new font-lock-syntactic-keywords)
864 (setq font-lock-syntactic-keywords
865 (fortran-font-lock-syntactic-keywords))
866 (if font-lock-mode (font-lock-mode 1))))))
867 (if global
868 (buffer-list)
869 (list (current-buffer))))
870 (if global
871 (setq-default fortran-line-length nchars))))
872
873(defun fortran-hack-local-variables ()
874 "Fortran mode adds this to `hack-local-variables-hook'."
875 (fortran-line-length fortran-line-length))
876
810(defun fortran-gud-find-expr () 877(defun fortran-gud-find-expr ()
811 ;; Consider \n as punctuation (end of expression). 878 ;; Consider \n as punctuation (end of expression).
812 (with-syntax-table fortran-gud-syntax-table 879 (with-syntax-table fortran-gud-syntax-table
@@ -940,7 +1007,7 @@ The next key typed is executed unless it is SPC."
940 nil "Type SPC or any command to erase ruler.")) 1007 nil "Type SPC or any command to erase ruler."))
941 1008
942(defun fortran-window-create () 1009(defun fortran-window-create ()
943 "Make the window 72 columns wide. 1010 "Make the window `fortran-line-length' (default 72) columns wide.
944See also `fortran-window-create-momentarily'." 1011See also `fortran-window-create-momentarily'."
945 (interactive) 1012 (interactive)
946 (let ((window-min-width 2)) 1013 (let ((window-min-width 2))
@@ -951,13 +1018,13 @@ See also `fortran-window-create-momentarily'."
951 (scroll-bar-width (- (nth 2 window-edges) 1018 (scroll-bar-width (- (nth 2 window-edges)
952 (car window-edges) 1019 (car window-edges)
953 (window-width)))) 1020 (window-width))))
954 (split-window-horizontally (+ 72 scroll-bar-width))) 1021 (split-window-horizontally (+ fortran-line-length scroll-bar-width)))
955 (other-window 1) 1022 (other-window 1)
956 (switch-to-buffer " fortran-window-extra" t) 1023 (switch-to-buffer " fortran-window-extra" t)
957 (select-window (previous-window)))) 1024 (select-window (previous-window))))
958 1025
959(defun fortran-window-create-momentarily (&optional arg) 1026(defun fortran-window-create-momentarily (&optional arg)
960 "Momentarily make the window 72 columns wide. 1027 "Momentarily make the window `fortran-line-length' (default 72) columns wide.
961Optional ARG non-nil and non-unity disables the momentary feature. 1028Optional ARG non-nil and non-unity disables the momentary feature.
962See also `fortran-window-create'." 1029See also `fortran-window-create'."
963 (interactive "p") 1030 (interactive "p")
@@ -1065,7 +1132,8 @@ Auto-indent does not happen if a numeric ARG is used."
1065 (string-match "^\\s-*\\(\\'\\|\\s<\\)" 1132 (string-match "^\\s-*\\(\\'\\|\\s<\\)"
1066 (buffer-substring (match-end 0) 1133 (buffer-substring (match-end 0)
1067 (min (line-end-position) 1134 (min (line-end-position)
1068 (+ 72 (line-beginning-position))))))) 1135 (+ fortran-line-length
1136 (line-beginning-position)))))))
1069 1137
1070;; Note that you can't just check backwards for `subroutine' &c in 1138;; Note that you can't just check backwards for `subroutine' &c in
1071;; case of un-marked main programs not at the start of the file. 1139;; case of un-marked main programs not at the start of the file.
@@ -1996,13 +2064,15 @@ Always returns non-nil (to prevent `fill-paragraph' being called)."
1996 (fortran-indent-line))) 2064 (fortran-indent-line)))
1997 2065
1998(defun fortran-strip-sequence-nos (&optional do-space) 2066(defun fortran-strip-sequence-nos (&optional do-space)
1999 "Delete all text in column 72 and up (assumed to be sequence numbers). 2067 "Delete all text in column `fortran-line-length' (default 72) and up.
2000Normally also deletes trailing whitespace after stripping such text. 2068This is assumed to be sequence numbers. Normally also deletes
2001Supplying prefix arg DO-SPACE prevents stripping the whitespace." 2069trailing whitespace after stripping such text. Supplying prefix
2070arg DO-SPACE prevents stripping the whitespace."
2002 (interactive "*p") 2071 (interactive "*p")
2003 (save-excursion 2072 (save-excursion
2004 (goto-char (point-min)) 2073 (goto-char (point-min))
2005 (while (re-search-forward "^.\\{72\\}\\(.*\\)" nil t) 2074 (while (re-search-forward (format "^.\\{%d\\}\\(.*\\)" fortran-line-length)
2075 nil t)
2006 (replace-match "" nil nil nil 1) 2076 (replace-match "" nil nil nil 1)
2007 (unless do-space (delete-horizontal-space))))) 2077 (unless do-space (delete-horizontal-space)))))
2008 2078
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index c3caa7e397c..9bef41a0878 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1005,7 +1005,7 @@ don't move and return nil. Otherwise return t."
1005 (set-text-properties 0 (length function-name) nil function-name) 1005 (set-text-properties 0 (length function-name) nil function-name)
1006 function-name)) 1006 function-name))
1007 1007
1008 1008
1009;;;; Imenu. 1009;;;; Imenu.
1010 1010
1011(defvar python-recursing) 1011(defvar python-recursing)
@@ -1828,21 +1828,25 @@ of current line."
1828 (save-excursion 1828 (save-excursion
1829 ;; Move up the tree of nested `class' and `def' blocks until we 1829 ;; Move up the tree of nested `class' and `def' blocks until we
1830 ;; get to zero indentation, accumulating the defined names. 1830 ;; get to zero indentation, accumulating the defined names.
1831 (let ((start t) 1831 (let ((accum)
1832 (accum)
1833 (length -1)) 1832 (length -1))
1834 (while (and (or start (> (current-indentation) 0)) 1833 (catch 'done
1835 (or (null length-limit) 1834 (while (or (null length-limit)
1836 (null (cdr accum)) 1835 (null (cdr accum))
1837 (< length length-limit))) 1836 (< length length-limit))
1838 (setq start nil) 1837 (setq start nil)
1839 (python-beginning-of-block) 1838 (let ((started-from (point)))
1840 (end-of-line) 1839 (python-beginning-of-block)
1841 (beginning-of-defun) 1840 (end-of-line)
1842 (when (looking-at (rx (0+ space) (or "def" "class") (1+ space) 1841 (beginning-of-defun)
1843 (group (1+ (or word (syntax symbol)))))) 1842 (when (= (point) started-from)
1844 (push (match-string 1) accum) 1843 (throw 'done nil)))
1845 (setq length (+ length 1 (length (car accum)))))) 1844 (when (looking-at (rx (0+ space) (or "def" "class") (1+ space)
1845 (group (1+ (or word (syntax symbol))))))
1846 (push (match-string 1) accum)
1847 (setq length (+ length 1 (length (car accum)))))
1848 (when (= (current-indentation) 0)
1849 (throw 'done nil))))
1846 (when accum 1850 (when accum
1847 (when (and length-limit (> length length-limit)) 1851 (when (and length-limit (> length length-limit))
1848 (setcar accum "..")) 1852 (setcar accum ".."))
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el
index 6a8f930f00f..b2011a7176e 100644
--- a/lisp/vc-bzr.el
+++ b/lisp/vc-bzr.el
@@ -63,7 +63,7 @@
63 63
64;; Clear up the cache to force vc-call to check again and discover 64;; Clear up the cache to force vc-call to check again and discover
65;; new functions when we reload this file. 65;; new functions when we reload this file.
66(put 'BZR 'vc-functions nil) 66(put 'Bzr 'vc-functions nil)
67 67
68(defgroup vc-bzr nil 68(defgroup vc-bzr nil
69 "VC bzr backend." 69 "VC bzr backend."
@@ -197,7 +197,7 @@ Return nil if there isn't one."
197 'implicit) 197 'implicit)
198 198
199(defun vc-bzr-create-repo () 199(defun vc-bzr-create-repo ()
200 "Create a new BZR repository." 200 "Create a new Bzr repository."
201 (vc-bzr-command "init" nil 0 nil)) 201 (vc-bzr-command "init" nil 0 nil))
202 202
203(defun vc-bzr-register (files &optional rev comment) 203(defun vc-bzr-register (files &optional rev comment)
@@ -440,7 +440,7 @@ Optional argument LOCALP is always ignored."
440 (vc-file-setprop file 'vc-state 'up-to-date) 440 (vc-file-setprop file 'vc-state 'up-to-date)
441 ;; XXX: is this correct? what happens if one 441 ;; XXX: is this correct? what happens if one
442 ;; mixes different SCMs in the same dir? 442 ;; mixes different SCMs in the same dir?
443 (vc-file-setprop file 'vc-backend 'BZR)))) 443 (vc-file-setprop file 'vc-backend 'Bzr))))
444 ;; `bzr status' reports on added/modified/renamed and unknown/ignored files 444 ;; `bzr status' reports on added/modified/renamed and unknown/ignored files
445 (setq at-start t) 445 (setq at-start t)
446 (with-temp-buffer 446 (with-temp-buffer
@@ -492,18 +492,18 @@ Optional argument LOCALP is always ignored."
492 (if bzr-state 492 (if bzr-state
493 (concat "(" (symbol-name bzr-state) ")") 493 (concat "(" (symbol-name bzr-state) ")")
494 ;; else fall back to default vc representation 494 ;; else fall back to default vc representation
495 (vc-default-dired-state-info 'BZR file))))) 495 (vc-default-dired-state-info 'Bzr file)))))
496 496
497;; In case of just `(load "vc-bzr")', but that's probably the wrong 497;; In case of just `(load "vc-bzr")', but that's probably the wrong
498;; way to do it. 498;; way to do it.
499(add-to-list 'vc-handled-backends 'BZR) 499(add-to-list 'vc-handled-backends 'Bzr)
500 500
501(eval-after-load "vc" 501(eval-after-load "vc"
502 '(add-to-list 'vc-directory-exclusion-list ".bzr" t)) 502 '(add-to-list 'vc-directory-exclusion-list ".bzr" t))
503 503
504(defconst vc-bzr-unload-hook 504(defconst vc-bzr-unload-hook
505 (lambda () 505 (lambda ()
506 (setq vc-handled-backends (delq 'BZR vc-handled-backends)) 506 (setq vc-handled-backends (delq 'Bzr vc-handled-backends))
507 (remove-hook 'vc-post-command-functions 'vc-bzr-post-command-function))) 507 (remove-hook 'vc-post-command-functions 'vc-bzr-post-command-function)))
508 508
509(provide 'vc-bzr) 509(provide 'vc-bzr)
diff --git a/lisp/vc-git.el b/lisp/vc-git.el
index e4a9d26105a..156b2866eb9 100644
--- a/lisp/vc-git.el
+++ b/lisp/vc-git.el
@@ -30,11 +30,11 @@
30 30
31;;; Installation: 31;;; Installation:
32 32
33;; To install: put this file on the load-path and add GIT to the list 33;; To install: put this file on the load-path and add Git to the list
34;; of supported backends in `vc-handled-backends'; the following line, 34;; of supported backends in `vc-handled-backends'; the following line,
35;; placed in your ~/.emacs, will accomplish this: 35;; placed in your ~/.emacs, will accomplish this:
36;; 36;;
37;; (add-to-list 'vc-handled-backends 'GIT) 37;; (add-to-list 'vc-handled-backends 'Git)
38 38
39;;; Todo: 39;;; Todo:
40;; - check if more functions could use vc-git-command instead 40;; - check if more functions could use vc-git-command instead
@@ -214,12 +214,12 @@
214 (if (eq git-state 'edited) 214 (if (eq git-state 'edited)
215 "(modified)" 215 "(modified)"
216 ;; fall back to the default VC representation 216 ;; fall back to the default VC representation
217 (vc-default-dired-state-info 'GIT file)))) 217 (vc-default-dired-state-info 'Git file))))
218 218
219;;; STATE-CHANGING FUNCTIONS 219;;; STATE-CHANGING FUNCTIONS
220 220
221(defun vc-git-create-repo () 221(defun vc-git-create-repo ()
222 "Create a new GIT repository." 222 "Create a new Git repository."
223 (vc-git-command "init" nil 0 nil)) 223 (vc-git-command "init" nil 0 nil))
224 224
225(defun vc-git-register (files &optional rev comment) 225(defun vc-git-register (files &optional rev comment)
@@ -287,7 +287,7 @@
287(defvar log-view-file-re) 287(defvar log-view-file-re)
288(defvar log-view-font-lock-keywords) 288(defvar log-view-font-lock-keywords)
289 289
290(define-derived-mode vc-git-log-view-mode log-view-mode "GIT-Log-View" 290(define-derived-mode vc-git-log-view-mode log-view-mode "Git-Log-View"
291 (require 'add-log) ;; we need the faces add-log 291 (require 'add-log) ;; we need the faces add-log
292 ;; Don't have file markers, so use impossible regexp. 292 ;; Don't have file markers, so use impossible regexp.
293 (set (make-local-variable 'log-view-file-re) "^File:[ \t]+\\(.+\\)") 293 (set (make-local-variable 'log-view-file-re) "^File:[ \t]+\\(.+\\)")
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el
index d8a7ec0dd46..1415f8d9499 100644
--- a/lisp/vc-hg.el
+++ b/lisp/vc-hg.el
@@ -256,7 +256,7 @@
256(defvar log-view-file-re) 256(defvar log-view-file-re)
257(defvar log-view-font-lock-keywords) 257(defvar log-view-font-lock-keywords)
258 258
259(define-derived-mode vc-hg-log-view-mode log-view-mode "HG-Log-View" 259(define-derived-mode vc-hg-log-view-mode log-view-mode "Hg-Log-View"
260 (require 'add-log) ;; we need the faces add-log 260 (require 'add-log) ;; we need the faces add-log
261 ;; Don't have file markers, so use impossible regexp. 261 ;; Don't have file markers, so use impossible regexp.
262 (set (make-local-variable 'log-view-file-re) "^File:[ \t]+\\(.+\\)") 262 (set (make-local-variable 'log-view-file-re) "^File:[ \t]+\\(.+\\)")
@@ -399,7 +399,7 @@ COMMENT is ignored."
399;; (vc-hg-command nil nil file "remove")) 399;; (vc-hg-command nil nil file "remove"))
400 400
401(defun vc-hg-checkin (files rev comment) 401(defun vc-hg-checkin (files rev comment)
402 "HG-specific version of `vc-backend-checkin'. 402 "Hg-specific version of `vc-backend-checkin'.
403REV is ignored." 403REV is ignored."
404 (vc-hg-command nil 0 files "commit" "-m" comment)) 404 (vc-hg-command nil 0 files "commit" "-m" comment))
405 405
@@ -436,7 +436,7 @@ REV is the revision to check out into WORKFILE."
436 (if (equal (vc-workfile-version file) "0") 436 (if (equal (vc-workfile-version file) "0")
437 "(added)" "(modified)") 437 "(added)" "(modified)")
438 ;; fall back to the default VC representation 438 ;; fall back to the default VC representation
439 (vc-default-dired-state-info 'HG file)))) 439 (vc-default-dired-state-info 'Hg file))))
440 440
441;; Modelled after the similar function in vc-bzr.el 441;; Modelled after the similar function in vc-bzr.el
442(defun vc-hg-revert (file &optional contents-done) 442(defun vc-hg-revert (file &optional contents-done)
diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el
index a8b6297caa2..09001e59691 100644
--- a/lisp/vc-hooks.el
+++ b/lisp/vc-hooks.el
@@ -62,8 +62,8 @@ interpreted as hostnames."
62 :type 'regexp 62 :type 'regexp
63 :group 'vc) 63 :group 'vc)
64 64
65(defcustom vc-handled-backends '(RCS CVS SVN SCCS BZR GIT HG Arch MCVS) 65(defcustom vc-handled-backends '(RCS CVS SVN SCCS Bzr Git Hg Arch MCVS)
66 ;; BZR, GIT, HG, Arch and MCVS come last because they are per-tree 66 ;; Bzr, Git, Hg, Arch and MCVS come last because they are per-tree
67 ;; rather than per-dir. 67 ;; rather than per-dir.
68 "List of version control backends for which VC will be used. 68 "List of version control backends for which VC will be used.
69Entries in this list will be tried in order to determine whether a 69Entries in this list will be tried in order to determine whether a
@@ -950,6 +950,9 @@ Used in `find-file-not-found-functions'."
950 (define-key vc-menu-map [vc-next-action] '("Check In/Out" . vc-next-action)) 950 (define-key vc-menu-map [vc-next-action] '("Check In/Out" . vc-next-action))
951 (define-key vc-menu-map [vc-register] '("Register" . vc-register))) 951 (define-key vc-menu-map [vc-register] '("Register" . vc-register)))
952 952
953(defun vc-default-extra-menu (backend)
954 nil)
955
953;; These are not correct and it's not currently clear how doing it 956;; These are not correct and it's not currently clear how doing it
954;; better (with more complicated expressions) might slow things down 957;; better (with more complicated expressions) might slow things down
955;; on older systems. 958;; on older systems.
diff --git a/lisp/vc.el b/lisp/vc.el
index 5030fb64471..78e098d874f 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -387,7 +387,7 @@
387;; 387;;
388;; Only required if `annotate-command' is defined for the backend, 388;; Only required if `annotate-command' is defined for the backend,
389;; AND you'd like the current time considered to be anything besides 389;; AND you'd like the current time considered to be anything besides
390;; (vs-annotate-convert-time (current-time)) -- i.e. the current 390;; (vc-annotate-convert-time (current-time)) -- i.e. the current
391;; time with hours, minutes, and seconds included. Probably safe to 391;; time with hours, minutes, and seconds included. Probably safe to
392;; ignore. Return the current-time, in units of fractional days. 392;; ignore. Return the current-time, in units of fractional days.
393;; 393;;
@@ -480,11 +480,20 @@
480;; 480;;
481;; Operation called in current buffer when opening a file. This can 481;; Operation called in current buffer when opening a file. This can
482;; be used by the backend to setup some local variables it might need. 482;; be used by the backend to setup some local variables it might need.
483; 483;;
484;; - find-file-not-found-hook () 484;; - find-file-not-found-hook ()
485;; 485;;
486;; Operation called in current buffer when opening a non-existing file. 486;; Operation called in current buffer when opening a non-existing file.
487;; By default, this asks the user if she wants to check out the file. 487;; By default, this asks the user if she wants to check out the file.
488;;
489;; - extra-menu ()
490;;
491;; Return a menu keymap, the items in the keymap will appear at the
492;; end of the Version Control menu. The goal is to allow backends
493;; to specify extra menu items that appear in the VC menu. This way
494;; you can provide menu entries for functionality that is specific
495;; to your backend and which does not map to any of the VC generic
496;; concepts.
488 497
489;;; Code: 498;;; Code:
490 499
diff --git a/man/ChangeLog b/man/ChangeLog
index 703b3d3441f..80ddad0085d 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,8 @@
12007-08-01 Alan Mackenzie <acm@muc.de>
2
3 * cc-mode.texi (Mailing Lists and Bug Reports): Correct "-no-site-file"
4 to "--no-site-file".
5
12007-07-29 Michael Albinus <michael.albinus@gmx.de> 62007-07-29 Michael Albinus <michael.albinus@gmx.de>
2 7
3 * tramp.texi (Frequently Asked Questions): Point to mode line 8 * tramp.texi (Frequently Asked Questions): Point to mode line
diff --git a/man/cc-mode.texi b/man/cc-mode.texi
index 3cb670b3b53..423892d7d30 100644
--- a/man/cc-mode.texi
+++ b/man/cc-mode.texi
@@ -540,7 +540,7 @@ section @ref{Minor Modes}.
540@item Making the @key{RET} key indent the new line 540@item Making the @key{RET} key indent the new line
541The standard Emacs binding for @key{RET} just adds a new line. If you 541The standard Emacs binding for @key{RET} just adds a new line. If you
542want it to reindent the new line as well, rebind the key. Note that 542want it to reindent the new line as well, rebind the key. Note that
543the action of rebinding will fail if the pertinent keymap doesn't yet 543the action of rebinding would fail if the pertinent keymap didn't yet
544exist---we thus need to delay the action until after @ccmode{} has 544exist---we thus need to delay the action until after @ccmode{} has
545been loaded. Put the following code into your @file{.emacs}: 545been loaded. Put the following code into your @file{.emacs}:
546 546
@@ -881,8 +881,8 @@ lines.
881@ccmode{} contains some useful commands for moving around in C code. 881@ccmode{} contains some useful commands for moving around in C code.
882 882
883@table @asis 883@table @asis
884@item @kbd{C-M-a} 884@item @kbd{C-M-a} (@code{c-beginning-of-defun})
885@itemx @kbd{C-M-e} 885@itemx @kbd{C-M-e} (@code{c-end-of-defun})
886@findex c-beginning-of-defun 886@findex c-beginning-of-defun
887@findex c-end-of-defun 887@findex c-end-of-defun
888 888
@@ -6911,11 +6911,11 @@ to include any code that appears @emph{before} your bug example, if
6911you think it might affect our ability to reproduce it. 6911you think it might affect our ability to reproduce it.
6912 6912
6913Please try to produce the problem in an Emacs instance without any 6913Please try to produce the problem in an Emacs instance without any
6914customizations loaded (i.e. start it with the @samp{-q -no-site-file} 6914customizations loaded (i.e. start it with the @samp{-q --no-site-file}
6915arguments). If it works correctly there, the problem might be caused 6915arguments). If it works correctly there, the problem might be caused
6916by faulty customizations in either your own or your site 6916by faulty customizations in either your own or your site
6917configuration. In that case, we'd appreciate if you isolate the Emacs 6917configuration. In that case, we'd appreciate it if you isolate the
6918Lisp code that triggers the bug and include it in your report. 6918Emacs Lisp code that triggers the bug and include it in your report.
6919 6919
6920@cindex bug report mailing list 6920@cindex bug report mailing list
6921Bug reports should be sent to @email{bug-cc-mode@@gnu.org}. You can 6921Bug reports should be sent to @email{bug-cc-mode@@gnu.org}. You can
diff --git a/src/ChangeLog b/src/ChangeLog
index b8054295979..f26f918c941 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12007-08-01 Ryo Yoshitake <ryo@shiftmode.net> (tiny change)
2
3 * mac.c (init_mac_osx_environment): Adjust load-path on self-contained
4 build.
5
62007-07-31 Stefan Monnier <monnier@iro.umontreal.ca>
7
8 * gtkutil.c (xg_tool_bar_callback): Generate a single TOOL_BAR_EVENT.
9
12007-07-30 Katsumi Yamaoka <yamaoka@jpl.org> 102007-07-30 Katsumi Yamaoka <yamaoka@jpl.org>
2 11
3 * puresize.h (BASE_PURESIZE): Increase to 1130000. 12 * puresize.h (BASE_PURESIZE): Increase to 1130000.
diff --git a/src/gtkutil.c b/src/gtkutil.c
index ca8c380abb5..a4c0522c49b 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3374,11 +3374,6 @@ xg_tool_bar_callback (w, client_data)
3374 XSETFRAME (frame, f); 3374 XSETFRAME (frame, f);
3375 event.kind = TOOL_BAR_EVENT; 3375 event.kind = TOOL_BAR_EVENT;
3376 event.frame_or_window = frame; 3376 event.frame_or_window = frame;
3377 event.arg = frame;
3378 kbd_buffer_store_event (&event);
3379
3380 event.kind = TOOL_BAR_EVENT;
3381 event.frame_or_window = frame;
3382 event.arg = key; 3377 event.arg = key;
3383 /* Convert between the modifier bits GDK uses and the modifier bits 3378 /* Convert between the modifier bits GDK uses and the modifier bits
3384 Emacs uses. This assumes GDK an X masks are the same, which they are when 3379 Emacs uses. This assumes GDK an X masks are the same, which they are when
diff --git a/src/mac.c b/src/mac.c
index a64c3d208e3..e81db1479b9 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -5318,8 +5318,8 @@ init_mac_osx_environment ()
5318 /* P should have sufficient room for the pathname of the bundle plus 5318 /* P should have sufficient room for the pathname of the bundle plus
5319 the subpath in it leading to the respective directories. Q 5319 the subpath in it leading to the respective directories. Q
5320 should have three times that much room because EMACSLOADPATH can 5320 should have three times that much room because EMACSLOADPATH can
5321 have the value "<path to lisp dir>:<path to leim dir>:<path to 5321 have the value "<path to site-lisp dir>:<path to lisp dir>:<path
5322 site-lisp dir>". */ 5322 to leim dir>". */
5323 p = (char *) alloca (app_bundle_pathname_len + 50); 5323 p = (char *) alloca (app_bundle_pathname_len + 50);
5324 q = (char *) alloca (3 * app_bundle_pathname_len + 150); 5324 q = (char *) alloca (3 * app_bundle_pathname_len + 150);
5325 if (!getenv ("EMACSLOADPATH")) 5325 if (!getenv ("EMACSLOADPATH"))
@@ -5327,12 +5327,12 @@ init_mac_osx_environment ()
5327 q[0] = '\0'; 5327 q[0] = '\0';
5328 5328
5329 strcpy (p, app_bundle_pathname); 5329 strcpy (p, app_bundle_pathname);
5330 strcat (p, "/Contents/Resources/lisp"); 5330 strcat (p, "/Contents/Resources/site-lisp");
5331 if (stat (p, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR) 5331 if (stat (p, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR)
5332 strcat (q, p); 5332 strcat (q, p);
5333 5333
5334 strcpy (p, app_bundle_pathname); 5334 strcpy (p, app_bundle_pathname);
5335 strcat (p, "/Contents/Resources/leim"); 5335 strcat (p, "/Contents/Resources/lisp");
5336 if (stat (p, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR) 5336 if (stat (p, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR)
5337 { 5337 {
5338 if (q[0] != '\0') 5338 if (q[0] != '\0')
@@ -5341,7 +5341,7 @@ init_mac_osx_environment ()
5341 } 5341 }
5342 5342
5343 strcpy (p, app_bundle_pathname); 5343 strcpy (p, app_bundle_pathname);
5344 strcat (p, "/Contents/Resources/site-lisp"); 5344 strcat (p, "/Contents/Resources/leim");
5345 if (stat (p, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR) 5345 if (stat (p, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR)
5346 { 5346 {
5347 if (q[0] != '\0') 5347 if (q[0] != '\0')