aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/FOR-RELEASE3
-rw-r--r--admin/nt/README.W3226
-rw-r--r--doc/lispref/keymaps.texi2
-rw-r--r--doc/misc/ChangeLog8
-rw-r--r--doc/misc/calc.texi31
-rw-r--r--etc/NEWS.224
-rw-r--r--lisp/ChangeLog113
-rw-r--r--lisp/bindings.el20
-rw-r--r--lisp/bs.el3
-rw-r--r--lisp/diff-mode.el89
-rw-r--r--lisp/doc-view.el22
-rw-r--r--lisp/emacs-lisp/easy-mmode.el62
-rw-r--r--lisp/emulation/edt.el6
-rw-r--r--lisp/emulation/vi.el6
-rw-r--r--lisp/follow.el39
-rw-r--r--lisp/font-core.el13
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/nnmail.el6
-rw-r--r--lisp/help-fns.el11
-rw-r--r--lisp/loadhist.el156
-rw-r--r--lisp/mouse.el20
-rw-r--r--lisp/obsolete/mlsupport.el4
-rw-r--r--lisp/progmodes/ada-xref.el6
-rw-r--r--lisp/progmodes/etags.el8
-rw-r--r--lisp/progmodes/idlw-shell.el2
-rw-r--r--lisp/progmodes/prolog.el14
-rw-r--r--lisp/smerge-mode.el173
-rw-r--r--lisp/textmodes/bib-mode.el4
-rw-r--r--lisp/textmodes/two-column.el4
-rw-r--r--lisp/vc-arch.el6
-rw-r--r--lisp/vc-bzr.el1
-rw-r--r--lisp/vc-cvs.el6
-rw-r--r--lisp/vc-git.el15
-rw-r--r--lisp/vc-hg.el16
-rw-r--r--lisp/vc-mcvs.el13
-rw-r--r--lisp/vc-mtn.el6
-rw-r--r--lisp/vc-svn.el4
-rw-r--r--lisp/vc.el380
-rw-r--r--src/ChangeLog12
-rw-r--r--src/Makefile.in9
-rw-r--r--src/doc.c12
-rw-r--r--src/process.c2
42 files changed, 805 insertions, 537 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 8ad2fc3ae50..2f415391d8f 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -83,6 +83,9 @@ http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg00103.html
83** rms: gnus-dired.el is a mistake. Those features should not 83** rms: gnus-dired.el is a mistake. Those features should not
84be part of Gnus. They should be moved to some other part of Emacs. 84be part of Gnus. They should be moved to some other part of Emacs.
85 85
86** C-x v v no longer works the way it used to
87http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00785.html
88
86* DOCUMENTATION 89* DOCUMENTATION
87 90
88** Check the Emacs Tutorial. 91** Check the Emacs Tutorial.
diff --git a/admin/nt/README.W32 b/admin/nt/README.W32
index 4b2cc4edc98..4c74f12f96c 100644
--- a/admin/nt/README.W32
+++ b/admin/nt/README.W32
@@ -64,6 +64,32 @@
64 (non-windowed) mode of operation is most useful if you have a telnet 64 (non-windowed) mode of operation is most useful if you have a telnet
65 server on your machine, allowing you to run Emacs remotely. 65 server on your machine, allowing you to run Emacs remotely.
66 66
67* Image support
68
69 Emacs has built in support for XBM and PPM/PGM/PBM images, and the
70 libXpm library is bundled, providing XPM support (required for color
71 toolbar icons and splash screen).
72
73 Emacs can also support some other image formats with appropriate
74 libraries. These libraries are all available as part of GTK, or from
75 gnuwin32.sourceforge.net. Emacs will find them if the directory they
76 are installed in is on the PATH.
77
78 PNG: requires the PNG reference library 1.2 or later, which will
79 be named libpng13d.dll, libpng13.dll, libpng12d.dll, libpng12.dll
80 or libpng.dll. LibPNG requires zlib, which should come from the same
81 source as you got libpng.
82
83 JPEG: requires the Independant JPEG Group's libjpeg 6b or later,
84 which will be called jpeg62.dll, libjpeg.dll, jpeg-62.dll or jpeg.dll.
85
86 TIFF: requires libTIFF 3.0 or later, which will be called libtiff3.dll
87 or libtiff.dll.
88
89 GIF: requires libungif or giflib 4.1 or later, which will be
90 called giflib4.dll, libungif4.dll or libungif.dll.
91
92
67* Uninstalling Emacs 93* Uninstalling Emacs
68 94
69 If you should need to uninstall Emacs, simply delete all the files and 95 If you should need to uninstall Emacs, simply delete all the files and
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index 2bd0de60f58..bdcc0a5a6d6 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -1516,7 +1516,6 @@ being read, as it is read, against @code{input-decode-map}, then
1516@code{function-key-map}, and then against @code{key-translation-map}. 1516@code{function-key-map}, and then against @code{key-translation-map}.
1517 1517
1518@defvar input-decode-map 1518@defvar input-decode-map
1519
1520This variable holds a keymap that describes the character sequences sent 1519This variable holds a keymap that describes the character sequences sent
1521by function keys on an ordinary character terminal. This keymap has the 1520by function keys on an ordinary character terminal. This keymap has the
1522same structure as other keymaps, but is used differently: it specifies 1521same structure as other keymaps, but is used differently: it specifies
@@ -1547,7 +1546,6 @@ deduced from Termcap and Terminfo. @xref{Terminal-Specific}.
1547@end defvar 1546@end defvar
1548 1547
1549@defvar function-key-map 1548@defvar function-key-map
1550
1551This variable holds a keymap similar to @code{input-decode-map} except 1549This variable holds a keymap similar to @code{input-decode-map} except
1552that it describes key sequences which should be translated to 1550that it describes key sequences which should be translated to
1553alternative interpretations that are usually preferred. It applies 1551alternative interpretations that are usually preferred. It applies
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 364b2796ac0..a5b44a846de 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,11 @@
12007-10-20 Jay Belanger <jay.p.belanger@gmail.com>
2
3 * calc.texi (History and Acknowledgements): Turn comment
4 about integer size into past tense.
5 (Time Zones): Remove pointer to Calc author's address.
6 (Trigonometric and Hyperbolic Functions): Mention cotangent
7 and hyperbolic cotangent.
8
12007-10-10 Michael Albinus <michael.albinus@gmx.de> 92007-10-10 Michael Albinus <michael.albinus@gmx.de>
2 10
3 Sync with Tramp 2.1.11. 11 Sync with Tramp 2.1.11.
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index 4445910e43c..75761468443 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -1156,16 +1156,16 @@ solid implementation of Lisp, and the humble task of calculating
1156turned out to be more open-ended than one might have expected. 1156turned out to be more open-ended than one might have expected.
1157 1157
1158Emacs Lisp didn't have built-in floating point math (now it does), so 1158Emacs Lisp didn't have built-in floating point math (now it does), so
1159this had to be 1159this had to be simulated in software. In fact, Emacs integers would
1160simulated in software. In fact, Emacs integers will only comfortably 1160only comfortably fit six decimal digits or so---not enough for a decent
1161fit six decimal digits or so---not enough for a decent calculator. So 1161calculator. So I had to write my own high-precision integer code as
1162I had to write my own high-precision integer code as well, and once I had 1162well, and once I had this I figured that arbitrary-size integers were
1163this I figured that arbitrary-size integers were just as easy as large 1163just as easy as large integers. Arbitrary floating-point precision was
1164integers. Arbitrary floating-point precision was the logical next step. 1164the logical next step. Also, since the large integer arithmetic was
1165Also, since the large integer arithmetic was there anyway it seemed only 1165there anyway it seemed only fair to give the user direct access to it,
1166fair to give the user direct access to it, which in turn made it practical 1166which in turn made it practical to support fractions as well as floats.
1167to support fractions as well as floats. All these features inspired me 1167All these features inspired me to look around for other data types that
1168to look around for other data types that might be worth having. 1168might be worth having.
1169 1169
1170Around this time, my friend Rick Koshi showed me his nifty new HP-28 1170Around this time, my friend Rick Koshi showed me his nifty new HP-28
1171calculator. It allowed the user to manipulate formulas as well as 1171calculator. It allowed the user to manipulate formulas as well as
@@ -17255,11 +17255,6 @@ daylight saving time (e.g., @code{PDT} or @code{PST}) the
17255the algorithms described above are used. If @var{zone} is omitted, 17255the algorithms described above are used. If @var{zone} is omitted,
17256the computation is done for the current time zone. 17256the computation is done for the current time zone.
17257 17257
17258@xref{Reporting Bugs}, for the address of Calc's author, if you
17259should wish to contribute your improved versions of
17260@code{math-tzone-names} and @code{math-daylight-savings-hook}
17261to the Calc distribution.
17262
17263@node Financial Functions, Binary Functions, Date Arithmetic, Arithmetic 17258@node Financial Functions, Binary Functions, Date Arithmetic, Arithmetic
17264@section Financial Functions 17259@section Financial Functions
17265 17260
@@ -18325,11 +18320,11 @@ vector as an argument and computes @code{arctan2} of the elements.
18325@pindex calc-coth 18320@pindex calc-coth
18326@tindex coth 18321@tindex coth
18327The remaining trigonometric functions, @code{calc-sec} [@code{sec}], 18322The remaining trigonometric functions, @code{calc-sec} [@code{sec}],
18328@code{calc-csc} [@code{csc}] and @code{calc-sec} [@code{sec}], are also 18323@code{calc-csc} [@code{csc}] and @code{calc-cot} [@code{cot}], are also
18329available. With the Hyperbolic flag, these compute their hyperbolic 18324available. With the Hyperbolic flag, these compute their hyperbolic
18330counterparts, which are also available separately as @code{calc-sech} 18325counterparts, which are also available separately as @code{calc-sech}
18331[@code{sech}], @code{calc-csch} [@code{csch}] and @code{calc-sech} 18326[@code{sech}], @code{calc-csch} [@code{csch}] and @code{calc-coth}
18332[@code{sech}]. (These commmands do not accept the Inverse flag.) 18327[@code{coth}]. (These commmands do not accept the Inverse flag.)
18333 18328
18334@node Advanced Math Functions, Branch Cuts, Trigonometric and Hyperbolic Functions, Scientific Functions 18329@node Advanced Math Functions, Branch Cuts, Trigonometric and Hyperbolic Functions, Scientific Functions
18335@section Advanced Mathematical Functions 18330@section Advanced Mathematical Functions
diff --git a/etc/NEWS.22 b/etc/NEWS.22
index 867c58c47a4..f68285d1dfd 100644
--- a/etc/NEWS.22
+++ b/etc/NEWS.22
@@ -97,8 +97,8 @@ This can be used to add menu entries for backend specific functions.
97 97
98* Lisp Changes in Emacs 22.2. 98* Lisp Changes in Emacs 22.2.
99 99
100** The command `repeat' will no more attempt to repeat a command bound 100** The command `repeat' no longer attempts to repeat a command bound
101to an input event. 101 to an input event.
102 102
103** The function invisible-p returns non-nil if the character 103** The function invisible-p returns non-nil if the character
104 after a specified position is invisible. 104 after a specified position is invisible.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4fe538b3bd4..ab50949e639 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,108 @@
12007-10-19 Juanma Barranquero <lekktu@gmail.com>
2
3 * bs.el (bs--track-window-changes): Don't refresh the whole list.
4 (bs-mode): Set mode-class property to special.
5
62007-10-20 Stefan Monnier <monnier@iro.umontreal.ca>
7
8 * emacs-lisp/easy-mmode.el (easy-mmode-define-navigation):
9 Add `body' arg. Cleanup the check-narrow-maybe/re-narrow-maybe mess.
10
11 * vc-bzr.el (vc-bzr-diff-tree):
12 * vc-git.el (vc-git-diff-tree):
13 * vc-hg.el (vc-hg-diff-tree):
14 * vc-mcvs.el (vc-mcvs-diff-tree):
15 * vc-mtn.el (vc-mtn-diff-tree):
16 * vc-svn.el (vc-svn-diff-tree): Remove.
17
18 * vc-mtn.el (vc-mtn-revision-completion-table):
19 * vc-cvs.el (vc-cvs-revision-completion-table):
20 * vc-arch.el (vc-arch-revision-completion-table):
21 * vc-hg.el (vc-hg-revision-completion-table, vc-hg-revision-table):
22 * vc-git.el (vc-git-revision-completion-table, vc-git-revision-table):
23 Make it work when the arg is a list of files.
24
252007-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
26
27 * vc.el: Remove `diff-tree' operation, now subsumed by `diff'.
28 Also `revision-completion-table' now takes a list of files.
29 (vc-deduce-fileset): Remove unused var `regexp'.
30 Only obey allow-directory-wildcard in dired buffers.
31 (vc-default-diff-tree): Remove.
32 (vc-diff-added-files): New var.
33 (vc-diff-internal): Use it. Remove arg `backend'. Update callers.
34 (vc-version-diff): Revert from `vc-history-diff' to the original name.
35 Remove the `backend' arg.
36 (vc-contains-version-controlled-file): Remove.
37 (vc-diff): Bring it closer to the version in Emacs-22.
38 (vc-revert): Fix typo in let-binding.
39 (vc-default-unregister): Remove.
40 (vc-dired-buffers-for-dir): Remove N^2 behavior.
41
422007-10-19 Dan Nicolaescu <dann@ics.uci.edu>
43
44 * textmodes/two-column.el (2C-split, 2C-merge):
45 * textmodes/bib-mode.el (bib-find-key, mark-bib):
46 * progmodes/idlw-shell.el (idlwave-shell-move-or-history):
47 * progmodes/etags.el (find-tag-in-order, etags-tags-apropos)
48 * progmodes/ada-xref.el (ada-get-all-references):
49 * obsolete/mlsupport.el (ml-next-line, ml-previous-line):
50 * emulation/vi.el (vi-previous-line-first-nonwhite)
51 (vi-effective-range, vi-put-before):
52 * emulation/edt.el (edt-next-line, edt-previous-line)
53 (edt-paragraph-forward): Use forward-line.
54
55 * progmodes/etags.el (tags-apropos): Require apropos at compile
56 time too.
57
58 * progmodes/prolog.el: Require comint when compiling.
59 (inferior-prolog-flavor): Move defvar before use.
60
612007-10-19 Richard Stallman <rms@gnu.org>
62
63 * font-core.el (turn-on-font-lock-if-desired):
64 Rename from `turn-on-font-lock-if-enabled'.
65 Fully obey `font-lock-global-modes'.
66
672007-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
68
69 * diff-mode.el (diff-fine-highlight-preproc): Stick to minimal changes
70 which will not affect the behavior of things like forward-word.
71 (diff-fine-highlight): Preserve point.
72
73 * doc-view.el (doc-view-mode-map): Use remapping.
74 Don't rebind C-v, M-v to their default value.
75 Don't bind mouse-4 and mouse-5: it's mwheel.el's job.
76
77 * smerge-mode.el: Add word-granularity refinement.
78 (smerge-refine-forward-function, smerge-refine-ignore-whitespace)
79 (smerge-refine-weight-hack): New vars.
80 (smerge-refine-forward): New fun.
81 (smerge-refine-chopup-region, smerge-refine-highlight-change): Use them.
82 (smerge-refine-subst): Use them as well. Preserve point.
83
842007-10-19 Juanma Barranquero <lekktu@gmail.com>
85
86 * follow.el (follow-unload-function): New function.
87
88 * loadhist.el (unload-function-features-list):
89 Rename from `unload-hook-features-list'.
90 (unload-hook-features-list): Add as obsolete alias.
91 (unload-feature): Use `unload-function-features-list'
92 and new FEATURE-unload-function.
93
942007-10-19 Glenn Morris <rgm@gnu.org>
95
96 * bindings.el (mouse-minor-mode-menu)
97 (minor-mode-menu-from-indicator): Move to mouse.el.
98 * mouse.el (mouse-minor-mode-menu, minor-mode-menu-from-indicator):
99 Move here from bindings.el.
100
1012007-10-19 Richard Stallman <rms@gnu.org>
102
103 * help-fns.el (describe-function-1): Don't use the advice origname
104 if it has no function definition.
105
12007-10-18 Johan Bockg,Ae(Brd <bojohan@gnu.org> 1062007-10-18 Johan Bockg,Ae(Brd <bojohan@gnu.org>
2 107
3 * net/tramp.el (tramp-rfn-eshadow-update-overlay): Save excursion. 108 * net/tramp.el (tramp-rfn-eshadow-update-overlay): Save excursion.
@@ -23,10 +128,10 @@
23 * doc-view.el (doc-view-dvi->pdf-sentinel, doc-view-dvi->pdf) 128 * doc-view.el (doc-view-dvi->pdf-sentinel, doc-view-dvi->pdf)
24 (doc-view-pdf/ps->png-sentinel, doc-view-pdf/ps->png) 129 (doc-view-pdf/ps->png-sentinel, doc-view-pdf/ps->png)
25 (doc-view-pdf->txt-sentinel, doc-view-pdf->txt) 130 (doc-view-pdf->txt-sentinel, doc-view-pdf->txt)
26 (doc-view-ps->pdf-sentinel, doc-view-ps->pdf): Remove superfluous 131 (doc-view-ps->pdf-sentinel, doc-view-ps->pdf):
27 messages. 132 Remove superfluous messages.
28 (doc-view-mode-map): Use the image-mode scrolling commands. Don't 133 (doc-view-mode-map): Use the image-mode scrolling commands.
29 rebind C-x k. 134 Don't rebind C-x k.
30 135
312007-10-18 Reiner Steib <Reiner.Steib@gmx.de> 1362007-10-18 Reiner Steib <Reiner.Steib@gmx.de>
32 137
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 19819c15d60..1bc31e04bb9 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -493,26 +493,6 @@ Menu of mode operations in the mode line.")
493 (interactive "@e") 493 (interactive "@e")
494 (x-popup-menu event mode-line-mode-menu)) 494 (x-popup-menu event mode-line-mode-menu))
495 495
496(defun mouse-minor-mode-menu (event)
497 "Show minor-mode menu for EVENT on minor modes area of the mode line."
498 (interactive "@e")
499 (let ((indicator (car (nth 4 (car (cdr event))))))
500 (minor-mode-menu-from-indicator indicator)))
501
502(defun minor-mode-menu-from-indicator (indicator)
503 "Show menu, if any, for minor mode specified by INDICATOR.
504Interactively, INDICATOR is read using completion."
505 (interactive (list (completing-read "Minor mode indicator: "
506 (describe-minor-mode-completion-table-for-indicator))))
507 (let ((minor-mode (lookup-minor-mode-from-indicator indicator)))
508 (if minor-mode
509 (let* ((map (cdr-safe (assq minor-mode minor-mode-map-alist)))
510 (menu (and (keymapp map) (lookup-key map [menu-bar]))))
511 (if menu
512 (popup-menu menu)
513 (message "No menu for minor mode `%s'" minor-mode)))
514 (error "Cannot find minor mode for `%s'" indicator))))
515
516(defun mode-line-minor-mode-help (event) 496(defun mode-line-minor-mode-help (event)
517 "Describe minor mode for EVENT on minor modes area of the mode line." 497 "Describe minor mode for EVENT on minor modes area of the mode line."
518 (interactive "@e") 498 (interactive "@e")
diff --git a/lisp/bs.el b/lisp/bs.el
index bb2dbae83c0..105e5702bcc 100644
--- a/lisp/bs.el
+++ b/lisp/bs.el
@@ -612,7 +612,6 @@ Used from `window-size-change-functions'."
612 (let ((win (get-buffer-window "*buffer-selection*" frame))) 612 (let ((win (get-buffer-window "*buffer-selection*" frame)))
613 (when win 613 (when win
614 (with-selected-window win 614 (with-selected-window win
615 (bs-refresh)
616 (bs--set-window-height))))) 615 (bs--set-window-height)))))
617 616
618(defun bs--remove-hooks () 617(defun bs--remove-hooks ()
@@ -622,6 +621,8 @@ Used from `window-size-change-functions'."
622 (remove-hook 'kill-buffer-hook 'bs--remove-hooks t) 621 (remove-hook 'kill-buffer-hook 'bs--remove-hooks t)
623 (remove-hook 'change-major-mode-hook 'bs--remove-hooks t)) 622 (remove-hook 'change-major-mode-hook 'bs--remove-hooks t))
624 623
624(put 'bs-mode 'mode-class 'special)
625
625(define-derived-mode bs-mode nil "Buffer-Selection-Menu" 626(define-derived-mode bs-mode nil "Buffer-Selection-Menu"
626 "Major mode for editing a subset of Emacs' buffers. 627 "Major mode for editing a subset of Emacs' buffers.
627\\<bs-mode-map> 628\\<bs-mode-map>
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index 894a12b1193..972e7972e75 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -1657,54 +1657,57 @@ For use in `add-log-current-defun-function'."
1657 :group 'diff-mode) 1657 :group 'diff-mode)
1658 1658
1659(defun diff-fine-highlight-preproc () 1659(defun diff-fine-highlight-preproc ()
1660 (while (re-search-forward "^." nil t) 1660 (while (re-search-forward "^[+>]" nil t)
1661 ;; Replace the hunk's leading prefix (+, -, !, <, or >) on each line 1661 ;; Remove spurious changes due to the fact that one side of the hunk is
1662 ;; with something constant, otherwise it'll be flagged as changes 1662 ;; marked with leading + or > and the other with leading - or <.
1663 ;; (since it's typically "-" on one side and "+" on the other). 1663 ;; We used to replace all the prefix chars with " " but this only worked
1664 ;; Note that we keep the same number of chars: we treat the prefix 1664 ;; when we did char-based refinement (or when using
1665 ;; as part of the texts-to-diff, so that finding the right char 1665 ;; smerge-refine-weight-hack) since otherwise, the `forward' motion done
1666 ;; afterwards will be easier. This only makes sense because we make 1666 ;; in chopup do not necessarily do the same as the ones in highlight
1667 ;; diffs at char-granularity. 1667 ;; since the "_" is not treated the same as " ".
1668 (replace-match " "))) 1668 (replace-match (cdr (assq (char-before) '((?+ . "-") (?> . "<"))))))
1669 )
1669 1670
1670(defun diff-fine-highlight () 1671(defun diff-fine-highlight ()
1671 "Highlight changes of hunk at point at a finer granularity." 1672 "Highlight changes of hunk at point at a finer granularity."
1672 (interactive) 1673 (interactive)
1673 (require 'smerge-mode) 1674 (require 'smerge-mode)
1674 (diff-beginning-of-hunk 'try-harder) 1675 (save-excursion
1675 (let* ((style (diff-hunk-style)) ;Skips the hunk header as well. 1676 (diff-beginning-of-hunk 'try-harder)
1676 (beg (point)) 1677 (let* ((style (diff-hunk-style)) ;Skips the hunk header as well.
1677 (props '((diff-mode . fine) (face diff-fine-change))) 1678 (beg (point))
1678 (end (progn (diff-end-of-hunk) (point)))) 1679 (props '((diff-mode . fine) (face diff-fine-change)))
1679 1680 (end (progn (diff-end-of-hunk) (point))))
1680 (remove-overlays beg end 'diff-mode 'fine) 1681
1681 1682 (remove-overlays beg end 'diff-mode 'fine)
1682 (goto-char beg) 1683
1683 (case style 1684 (goto-char beg)
1684 (unified 1685 (case style
1685 (while (re-search-forward "^\\(?:-.*\n\\)+\\(\\)\\(?:\\+.*\n\\)+" end t) 1686 (unified
1686 (smerge-refine-subst (match-beginning 0) (match-end 1) 1687 (while (re-search-forward "^\\(?:-.*\n\\)+\\(\\)\\(?:\\+.*\n\\)+"
1687 (match-end 1) (match-end 0) 1688 end t)
1688 props 'diff-fine-highlight-preproc))) 1689 (smerge-refine-subst (match-beginning 0) (match-end 1)
1689 (context 1690 (match-end 1) (match-end 0)
1690 (let* ((middle (save-excursion (re-search-forward "^---"))) 1691 props 'diff-fine-highlight-preproc)))
1691 (other middle)) 1692 (context
1692 (while (re-search-forward "^\\(?:!.*\n\\)+" middle t) 1693 (let* ((middle (save-excursion (re-search-forward "^---")))
1693 (smerge-refine-subst (match-beginning 0) (match-end 0) 1694 (other middle))
1694 (save-excursion 1695 (while (re-search-forward "^\\(?:!.*\n\\)+" middle t)
1695 (goto-char other) 1696 (smerge-refine-subst (match-beginning 0) (match-end 0)
1696 (re-search-forward "^\\(?:!.*\n\\)+" end) 1697 (save-excursion
1697 (setq other (match-end 0)) 1698 (goto-char other)
1698 (match-beginning 0)) 1699 (re-search-forward "^\\(?:!.*\n\\)+" end)
1699 other 1700 (setq other (match-end 0))
1700 props 'diff-fine-highlight-preproc)))) 1701 (match-beginning 0))
1701 (t ;; Normal diffs. 1702 other
1702 (let ((beg1 (1+ (point)))) 1703 props 'diff-fine-highlight-preproc))))
1703 (when (re-search-forward "^---.*\n" end t) 1704 (t ;; Normal diffs.
1704 ;; It's a combined add&remove, so there's something to do. 1705 (let ((beg1 (1+ (point))))
1705 (smerge-refine-subst beg1 (match-beginning 0) 1706 (when (re-search-forward "^---.*\n" end t)
1706 (match-end 0) end 1707 ;; It's a combined add&remove, so there's something to do.
1707 props 'diff-fine-highlight-preproc))))))) 1708 (smerge-refine-subst beg1 (match-beginning 0)
1709 (match-end 0) end
1710 props 'diff-fine-highlight-preproc))))))))
1708 1711
1709 1712
1710;; provide the package 1713;; provide the package
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index d93a8ca316d..b6d8235a02b 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -212,8 +212,10 @@ has finished."
212 ;; Navigation in the document 212 ;; Navigation in the document
213 (define-key map (kbd "n") 'doc-view-next-page) 213 (define-key map (kbd "n") 'doc-view-next-page)
214 (define-key map (kbd "p") 'doc-view-previous-page) 214 (define-key map (kbd "p") 'doc-view-previous-page)
215 (define-key map (kbd "<next>") 'doc-view-next-page) 215 (define-key map (kbd "<next>") 'forward-page)
216 (define-key map (kbd "<prior>") 'doc-view-previous-page) 216 (define-key map (kbd "<prior>") 'backward-page)
217 (define-key map [remap forward-page] 'doc-view-next-page)
218 (define-key map [remap backward-page] 'doc-view-previous-page)
217 (define-key map (kbd "SPC") 'doc-view-scroll-up-or-next-page) 219 (define-key map (kbd "SPC") 'doc-view-scroll-up-or-next-page)
218 (define-key map (kbd "DEL") 'doc-view-scroll-down-or-previous-page) 220 (define-key map (kbd "DEL") 'doc-view-scroll-down-or-previous-page)
219 (define-key map (kbd "M-<") 'doc-view-first-page) 221 (define-key map (kbd "M-<") 'doc-view-first-page)
@@ -232,18 +234,10 @@ has finished."
232 (define-key map (kbd "C-S-n") 'doc-view-search-next-match) 234 (define-key map (kbd "C-S-n") 'doc-view-search-next-match)
233 (define-key map (kbd "C-S-p") 'doc-view-search-previous-match) 235 (define-key map (kbd "C-S-p") 'doc-view-search-previous-match)
234 ;; Scrolling 236 ;; Scrolling
235 (define-key map (kbd "<right>") 'image-forward-hscroll) 237 (define-key map [remap forward-char] 'image-forward-hscroll)
236 (define-key map (kbd "<left>") 'image-backward-hscroll) 238 (define-key map [remap backward-char] 'image-backward-hscroll)
237 (define-key map (kbd "<down>") 'image-next-line) 239 (define-key map [remap next-line] 'image-next-line)
238 (define-key map (kbd "<up>") 'image-previous-line) 240 (define-key map [remap previous-line] 'image-previous-line)
239 (define-key map (kbd "C-f") 'image-forward-hscroll)
240 (define-key map (kbd "C-b") 'image-backward-hscroll)
241 (define-key map (kbd "C-n") 'image-next-line)
242 (define-key map (kbd "C-p") 'image-previous-line)
243 (define-key map (kbd "C-v") 'scroll-up)
244 (define-key map (kbd "<mouse-4>") 'mwheel-scroll)
245 (define-key map (kbd "<mouse-5>") 'mwheel-scroll)
246 (define-key map (kbd "M-v") 'scroll-down)
247 ;; Show the tooltip 241 ;; Show the tooltip
248 (define-key map (kbd "C-t") 'doc-view-show-tooltip) 242 (define-key map (kbd "C-t") 'doc-view-show-tooltip)
249 ;; Toggle between text and image display or editing 243 ;; Toggle between text and image display or editing
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index da0b76808d5..d3d9e5fdca0 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -478,7 +478,8 @@ CSS contains a list of syntax specifications of the form (CHAR . SYNTAX)."
478;;; easy-mmode-define-navigation 478;;; easy-mmode-define-navigation
479;;; 479;;;
480 480
481(defmacro easy-mmode-define-navigation (base re &optional name endfun narrowfun) 481(defmacro easy-mmode-define-navigation (base re &optional name endfun narrowfun
482 &rest body)
482 "Define BASE-next and BASE-prev to navigate in the buffer. 483 "Define BASE-next and BASE-prev to navigate in the buffer.
483RE determines the places the commands should move point to. 484RE determines the places the commands should move point to.
484NAME should describe the entities matched by RE. It is used to build 485NAME should describe the entities matched by RE. It is used to build
@@ -488,17 +489,20 @@ BASE-next also tries to make sure that the whole entry is visible by
488 the next entry) and recentering if necessary. 489 the next entry) and recentering if necessary.
489ENDFUN should return the end position (with or without moving point). 490ENDFUN should return the end position (with or without moving point).
490NARROWFUN non-nil means to check for narrowing before moving, and if 491NARROWFUN non-nil means to check for narrowing before moving, and if
491found, do `widen' first and then call NARROWFUN with no args after moving." 492found, do `widen' first and then call NARROWFUN with no args after moving.
493BODY is executed after moving to the destination location."
494 (declare (indent 5) (debug (exp exp exp def-form def-form &rest def-body)))
492 (let* ((base-name (symbol-name base)) 495 (let* ((base-name (symbol-name base))
493 (prev-sym (intern (concat base-name "-prev"))) 496 (prev-sym (intern (concat base-name "-prev")))
494 (next-sym (intern (concat base-name "-next"))) 497 (next-sym (intern (concat base-name "-next")))
495 (check-narrow-maybe 498 (when-narrowed
496 (when narrowfun 499 (lambda (body)
497 '(setq was-narrowed 500 (if (null narrowfun) body
498 (prog1 (or (< (- (point-max) (point-min)) (buffer-size))) 501 `(let ((was-narrowed
499 (widen))))) 502 (prog1 (or (< (- (point-max) (point-min)) (buffer-size)))
500 (re-narrow-maybe (when narrowfun 503 (widen))))
501 `(when was-narrowed (,narrowfun))))) 504 ,body
505 (when was-narrowed (,narrowfun)))))))
502 (unless name (setq name base-name)) 506 (unless name (setq name base-name))
503 `(progn 507 `(progn
504 (add-to-list 'debug-ignored-errors 508 (add-to-list 'debug-ignored-errors
@@ -509,33 +513,31 @@ found, do `widen' first and then call NARROWFUN with no args after moving."
509 (unless count (setq count 1)) 513 (unless count (setq count 1))
510 (if (< count 0) (,prev-sym (- count)) 514 (if (< count 0) (,prev-sym (- count))
511 (if (looking-at ,re) (setq count (1+ count))) 515 (if (looking-at ,re) (setq count (1+ count)))
512 (let (was-narrowed) 516 ,(funcall when-narrowed
513 ,check-narrow-maybe 517 `(if (not (re-search-forward ,re nil t count))
514 (if (not (re-search-forward ,re nil t count)) 518 (if (looking-at ,re)
515 (if (looking-at ,re) 519 (goto-char (or ,(if endfun `(,endfun)) (point-max)))
516 (goto-char (or ,(if endfun `(,endfun)) (point-max))) 520 (error "No next %s" ,name))
517 (error "No next %s" ,name)) 521 (goto-char (match-beginning 0))
518 (goto-char (match-beginning 0)) 522 (when (and (eq (current-buffer) (window-buffer (selected-window)))
519 (when (and (eq (current-buffer) (window-buffer (selected-window))) 523 (interactive-p))
520 (interactive-p)) 524 (let ((endpt (or (save-excursion
521 (let ((endpt (or (save-excursion 525 ,(if endfun `(,endfun)
522 ,(if endfun `(,endfun) 526 `(re-search-forward ,re nil t 2)))
523 `(re-search-forward ,re nil t 2))) 527 (point-max))))
524 (point-max)))) 528 (unless (pos-visible-in-window-p endpt nil t)
525 (unless (pos-visible-in-window-p endpt nil t) 529 (recenter '(0)))))))
526 (recenter '(0)))))) 530 ,@body))
527 ,re-narrow-maybe)))
528 (put ',next-sym 'definition-name ',base) 531 (put ',next-sym 'definition-name ',base)
529 (defun ,prev-sym (&optional count) 532 (defun ,prev-sym (&optional count)
530 ,(format "Go to the previous COUNT'th %s" (or name base-name)) 533 ,(format "Go to the previous COUNT'th %s" (or name base-name))
531 (interactive "p") 534 (interactive "p")
532 (unless count (setq count 1)) 535 (unless count (setq count 1))
533 (if (< count 0) (,next-sym (- count)) 536 (if (< count 0) (,next-sym (- count))
534 (let (was-narrowed) 537 ,(funcall when-narrowed
535 ,check-narrow-maybe 538 `(unless (re-search-backward ,re nil t count)
536 (unless (re-search-backward ,re nil t count) 539 (error "No previous %s" ,name)))
537 (error "No previous %s" ,name)) 540 ,@body))
538 ,re-narrow-maybe)))
539 (put ',prev-sym 'definition-name ',base)))) 541 (put ',prev-sym 'definition-name ',base))))
540 542
541 543
diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el
index 44067dba1f2..bff1a583586 100644
--- a/lisp/emulation/edt.el
+++ b/lisp/emulation/edt.el
@@ -649,7 +649,7 @@ Argument NUM is the number of lines to move."
649 (interactive "p") 649 (interactive "p")
650 (edt-check-prefix num) 650 (edt-check-prefix num)
651 (let ((beg (edt-current-line))) 651 (let ((beg (edt-current-line)))
652 (next-line num) 652 (forward-line num)
653 (edt-bottom-check beg num)) 653 (edt-bottom-check beg num))
654 (if edt-x-emacs19-p (setq zmacs-region-stays t))) 654 (if edt-x-emacs19-p (setq zmacs-region-stays t)))
655 655
@@ -659,7 +659,7 @@ Argument NUM is the number of lines to move."
659 (interactive "p") 659 (interactive "p")
660 (edt-check-prefix num) 660 (edt-check-prefix num)
661 (let ((beg (edt-current-line))) 661 (let ((beg (edt-current-line)))
662 (previous-line num) 662 (forward-line (- num))
663 (edt-top-check beg num)) 663 (edt-top-check beg num))
664 (if edt-x-emacs19-p (setq zmacs-region-stays t))) 664 (if edt-x-emacs19-p (setq zmacs-region-stays t)))
665 665
@@ -1426,7 +1426,7 @@ Argument NUM is the positive number of paragraphs to move."
1426 (forward-paragraph (+ num 1)) 1426 (forward-paragraph (+ num 1))
1427 (start-of-paragraph-text) 1427 (start-of-paragraph-text)
1428 (if (eolp) 1428 (if (eolp)
1429 (next-line 1)) 1429 (forward-line 1))
1430 (setq num (1- num))) 1430 (setq num (1- num)))
1431 (cond((> (point) far) 1431 (cond((> (point) far)
1432 (setq left (save-excursion (forward-line height))) 1432 (setq left (save-excursion (forward-line height)))
diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el
index 977a7980803..81ad04b60d9 100644
--- a/lisp/emulation/vi.el
+++ b/lisp/emulation/vi.el
@@ -801,7 +801,7 @@ The given COUNT is remembered for future scrollings."
801(defun vi-previous-line-first-nonwhite (count) 801(defun vi-previous-line-first-nonwhite (count)
802 "Go up COUNT lines. Stop at first non-white." 802 "Go up COUNT lines. Stop at first non-white."
803 (interactive "p") 803 (interactive "p")
804 (previous-line count) 804 (forward-line (- count))
805 (back-to-indentation)) 805 (back-to-indentation))
806 806
807(defun vi-scroll-up-window (count) 807(defun vi-scroll-up-window (count)
@@ -1062,7 +1062,7 @@ MOTION-COMMAND with ARG.
1062 (setq end (1+ end))) 1062 (setq end (1+ end)))
1063 ((eq moving-unit 'line) 1063 ((eq moving-unit 'line)
1064 (goto-char begin) (beginning-of-line) (setq begin (point)) 1064 (goto-char begin) (beginning-of-line) (setq begin (point))
1065 (goto-char end) (next-line 1) (beginning-of-line) (setq end (point)))) 1065 (goto-char end) (forward-line 1) (beginning-of-line) (setq end (point))))
1066 (if (> end (point-max)) (setq end (point-max))) ; force in buffer region 1066 (if (> end (point-max)) (setq end (point-max))) ; force in buffer region
1067 (cons begin end))))) 1067 (cons begin end)))))
1068 1068
@@ -1124,7 +1124,7 @@ text as lines. If the optional after-p is given, put after/below the cursor."
1124 (t (error "Register %c is not containing text string" reg)))) 1124 (t (error "Register %c is not containing text string" reg))))
1125 (if (vi-string-end-with-nl-p put-text) ; put back text as lines 1125 (if (vi-string-end-with-nl-p put-text) ; put back text as lines
1126 (if after-p 1126 (if after-p
1127 (progn (next-line 1) (beginning-of-line)) 1127 (progn (forward-line 1) (beginning-of-line))
1128 (beginning-of-line)) 1128 (beginning-of-line))
1129 (if after-p (forward-char 1))) 1129 (if after-p (forward-char 1)))
1130 (push-mark (point)) 1130 (push-mark (point))
diff --git a/lisp/follow.el b/lisp/follow.el
index 55a331a22d3..50760cd9909 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -712,7 +712,7 @@ in your `~/.emacs' file:
712;;}}} 712;;}}}
713;;{{{ Movement 713;;{{{ Movement
714 714
715;; Note, these functions are not very useful, atleast not unless you 715;; Note, these functions are not very useful, at least not unless you
716;; rebind the rather cumbersome key sequence `C-c . p'. 716;; rebind the rather cumbersome key sequence `C-c . p'.
717 717
718(defun follow-next-window () 718(defun follow-next-window ()
@@ -1267,7 +1267,7 @@ position of the first window. Otherwise it is a good guess."
1267 (let ((done nil) 1267 (let ((done nil)
1268 win-start 1268 win-start
1269 res) 1269 res)
1270 ;; Always calculate what happend when no line is displayed in the first 1270 ;; Always calculate what happens when no line is displayed in the first
1271 ;; window. (The `previous' res is needed below!) 1271 ;; window. (The `previous' res is needed below!)
1272 (goto-char guess) 1272 (goto-char guess)
1273 (vertical-motion 0 (car windows)) 1273 (vertical-motion 0 (car windows))
@@ -1508,9 +1508,9 @@ non-first windows in Follow mode."
1508 (setq win-start-end (follow-windows-start-end windows)) 1508 (setq win-start-end (follow-windows-start-end windows))
1509 (follow-invalidate-cache) 1509 (follow-invalidate-cache)
1510 ;; When the point ends up in another window. This 1510 ;; When the point ends up in another window. This
1511 ;; happends when dest is in the beginning of the 1511 ;; happens when dest is in the beginning of the
1512 ;; file and the selected window is not the first. 1512 ;; file and the selected window is not the first.
1513 ;; It can also, in rare situations happend when 1513 ;; It can also, in rare situations happen when
1514 ;; long lines are used and there is a big 1514 ;; long lines are used and there is a big
1515 ;; difference between the width of the windows. 1515 ;; difference between the width of the windows.
1516 ;; (When scrolling one line in a wide window which 1516 ;; (When scrolling one line in a wide window which
@@ -2162,6 +2162,37 @@ This prevents `mouse-drag-region' from messing things up."
2162 2162
2163;;{{{ The end 2163;;{{{ The end
2164 2164
2165(defun follow-unload-function ()
2166 (easy-menu-remove-item nil '("Tools") "Follow")
2167 (follow-stop-intercept-process-output)
2168 (dolist (group '((before
2169 ;; XEmacs
2170 isearch-done
2171 ;; both
2172 set-process-filter sit-for move-overlay)
2173 (after
2174 ;; Emacs
2175 scroll-bar-drag scroll-bar-drag-1 scroll-bar-scroll-down
2176 scroll-bar-scroll-up scroll-bar-set-window-start
2177 ;; XEmacs
2178 scrollbar-line-down scrollbar-line-up scrollbar-page-down
2179 scrollbar-page-up scrollbar-to-bottom scrollbar-to-top
2180 scrollbar-vertical-drag
2181 ;; both
2182 process-filter)))
2183 (let ((class (car group)))
2184 (dolist (fun (cdr group))
2185 (when (functionp fun)
2186 (condition-case nil
2187 (progn
2188 (ad-remove-advice fun class
2189 (intern (concat "follow-" (symbol-name fun))))
2190 (ad-update fun))
2191 (error nil))))))
2192 nil)
2193
2194(defvar follow-unload-function 'follow-unload-function)
2195
2165;; 2196;;
2166;; We're done! 2197;; We're done!
2167;; 2198;;
diff --git a/lisp/font-core.el b/lisp/font-core.el
index 7d7a65e83cc..b97550d2693 100644
--- a/lisp/font-core.el
+++ b/lisp/font-core.el
@@ -234,7 +234,7 @@ this function onto `change-major-mode-hook'."
234;; hook is run, the major mode is in the process of being changed and we do not 234;; hook is run, the major mode is in the process of being changed and we do not
235;; know what the final major mode will be. So, `font-lock-change-major-mode' 235;; know what the final major mode will be. So, `font-lock-change-major-mode'
236;; only (a) notes the name of the current buffer, and (b) adds our function 236;; only (a) notes the name of the current buffer, and (b) adds our function
237;; `turn-on-font-lock-if-enabled' to the hook variables 237;; `turn-on-font-lock-if-desired' to the hook variables
238;; `after-change-major-mode-hook' and `post-command-hook' (for modes 238;; `after-change-major-mode-hook' and `post-command-hook' (for modes
239;; that do not yet run `after-change-major-mode-hook'). By the time 239;; that do not yet run `after-change-major-mode-hook'). By the time
240;; the functions on the first of these hooks to be run are run, the new major 240;; the functions on the first of these hooks to be run are run, the new major
@@ -281,14 +281,17 @@ means that Font Lock mode is turned on for buffers in C and C++ modes only."
281 (repeat :inline t (symbol :tag "mode")))) 281 (repeat :inline t (symbol :tag "mode"))))
282 :group 'font-lock) 282 :group 'font-lock)
283 283
284(defun turn-on-font-lock-if-enabled () 284(defun turn-on-font-lock-if-desired ()
285 (unless (and (eq (car-safe font-lock-global-modes) 'not) 285 (when (cond ((eq font-lock-global-modes t)
286 (memq major-mode (cdr font-lock-global-modes))) 286 t)
287 ((eq (car-safe font-lock-global-modes) 'not)
288 (not (memq major-mode (cdr font-lock-global-modes))))
289 (t (memq major-mode (cdr font-lock-global-modes))))
287 (let (inhibit-quit) 290 (let (inhibit-quit)
288 (turn-on-font-lock)))) 291 (turn-on-font-lock))))
289 292
290(define-globalized-minor-mode global-font-lock-mode 293(define-globalized-minor-mode global-font-lock-mode
291 font-lock-mode turn-on-font-lock-if-enabled 294 font-lock-mode turn-on-font-lock-if-desired
292 :extra-args (dummy) 295 :extra-args (dummy)
293 :initialize 'custom-initialize-safe-default 296 :initialize 'custom-initialize-safe-default
294 :init-value (not (or noninteractive emacs-basic-display)) 297 :init-value (not (or noninteractive emacs-basic-display))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 59a32921dc5..5f49f2dc81a 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12007-10-18 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * nnmail.el (nnmail-fancy-expiry-target): Use rmail-dont-reply-to to
4 exclude address matching message-dont-reply-to-names.
5
12007-10-15 Katsumi Yamaoka <yamaoka@jpl.org> 62007-10-15 Katsumi Yamaoka <yamaoka@jpl.org>
2 7
3 * gnus-util.el (gnus-string<): New function. 8 * gnus-util.el (gnus-string<): New function.
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index 71a528c0f0b..35f5476f9b4 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1900,8 +1900,10 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
1900 ;; To or From header 1900 ;; To or From header
1901 ((and (equal header 'to-from) 1901 ((and (equal header 'to-from)
1902 (or (string-match (cadr regexp-target-pair) from) 1902 (or (string-match (cadr regexp-target-pair) from)
1903 (and (string-match message-dont-reply-to-names from) 1903 (and (string-match (cadr regexp-target-pair) to)
1904 (string-match (cadr regexp-target-pair) to)))) 1904 (let ((rmail-dont-reply-to-names
1905 message-dont-reply-to-names))
1906 (equal (rmail-dont-reply-to from) "")))))
1905 (setq target (format-time-string (caddr regexp-target-pair) date))) 1907 (setq target (format-time-string (caddr regexp-target-pair) date)))
1906 ((and (not (equal header 'to-from)) 1908 ((and (not (equal header 'to-from))
1907 (string-match (cadr regexp-target-pair) 1909 (string-match (cadr regexp-target-pair)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index befd83c76ef..f62fadc22b5 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -252,11 +252,14 @@ face (according to `face-differs-from-default-p')."
252;;;###autoload 252;;;###autoload
253(defun describe-function-1 (function) 253(defun describe-function-1 (function)
254 (let* ((advised (and (featurep 'advice) (ad-get-advice-info function))) 254 (let* ((advised (and (featurep 'advice) (ad-get-advice-info function)))
255 ;; If the function is advised, get the symbol that has the 255 ;; If the function is advised, use the symbol that has the
256 ;; real definition. 256 ;; real definition, if that symbol is already set up.
257 (real-function 257 (real-function
258 (if advised (cdr (assq 'origname advised)) 258 (or (and advised
259 function)) 259 (cdr (assq 'origname advised))
260 (fboundp (cdr (assq 'origname advised)))
261 (cdr (assq 'origname advised)))
262 function))
260 ;; Get the real definition. 263 ;; Get the real definition.
261 (def (if (symbolp real-function) 264 (def (if (symbolp real-function)
262 (symbol-function real-function) 265 (symbol-function real-function)
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 95de0d822a3..cd8c8ef099b 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -137,11 +137,13 @@ These are symbols with hook-type values whose names don't end in
137`-hook' or `-hooks', from which `unload-feature' tries to remove 137`-hook' or `-hooks', from which `unload-feature' tries to remove
138pertinent symbols.") 138pertinent symbols.")
139 139
140(defvar unload-hook-features-list nil 140(defvar unload-function-features-list nil
141 "List of features of the package being unloaded. 141 "List of features of the package being unloaded.
142 142
143This is meant to be used by FEATURE-unload-hook hooks, see the 143This is meant to be used by FEATURE-unload-function, see the
144documentation of `unload-feature' for details.") 144documentation of `unload-feature' for details.")
145(define-obsolete-variable-alias 'unload-hook-features-list
146 'unload-function-features-list "22.2")
145 147
146;;;###autoload 148;;;###autoload
147(defun unload-feature (feature &optional force) 149(defun unload-feature (feature &optional force)
@@ -172,82 +174,88 @@ such as redefining an Emacs function."
172 (when dependents 174 (when dependents
173 (error "Loaded libraries %s depend on %s" 175 (error "Loaded libraries %s depend on %s"
174 (prin1-to-string dependents) file)))) 176 (prin1-to-string dependents) file))))
175 (let* ((unload-hook-features-list (feature-symbols feature)) 177 (let* ((unload-function-features-list (feature-symbols feature))
176 (file (pop unload-hook-features-list)) 178 (file (pop unload-function-features-list))
177 ;; If non-nil, this is a symbol for which we should 179 ;; If non-nil, this is a symbol for which we should
178 ;; restore a previous autoload if possible. 180 ;; restore a previous autoload if possible.
179 restore-autoload 181 restore-autoload
180 (unload-hook (intern-soft (concat (symbol-name feature) 182 (name (symbol-name feature))
181 "-unload-hook")))) 183 (unload-hook (intern-soft (concat name "-unload-hook")))
182 ;; Try to avoid losing badly when hooks installed in critical 184 (unload-func (intern-soft (concat name "-unload-function"))))
183 ;; places go away. (Some packages install things on 185 ;; If FEATURE-unload-function is defined and returns non-nil,
184 ;; `kill-buffer-hook', `activate-menubar-hook' and the like.) 186 ;; don't try to do anything more; otherwise proceed normally.
185 ;; First off, provide a clean way for package FOO to arrange 187 (unless (and (bound-and-true-p unload-func)
186 ;; this by adding hooks on the variable `FOO-unload-hook'. 188 (funcall unload-func))
187 (if unload-hook 189 ;; Try to avoid losing badly when hooks installed in critical
188 (run-hooks unload-hook) 190 ;; places go away. (Some packages install things on
189 ;; Otherwise, do our best. Look through the obarray for symbols 191 ;; `kill-buffer-hook', `activate-menubar-hook' and the like.)
190 ;; which seem to be hook variables or special hook functions and 192 (if unload-hook
191 ;; remove anything from them which matches the feature-symbols 193 ;; First off, provide a clean way for package FOO to arrange
192 ;; about to get zapped. Obviously this won't get anonymous 194 ;; this by adding hooks on the variable `FOO-unload-hook'.
193 ;; functions which the package might just have installed, and 195 ;; This is obsolete; FEATURE-unload-function should be used now.
194 ;; there might be other important state, but this tactic 196 (run-hooks unload-hook)
195 ;; normally works. 197 ;; Otherwise, do our best. Look through the obarray for symbols
196 (mapatoms 198 ;; which seem to be hook variables or special hook functions and
197 (lambda (x) 199 ;; remove anything from them which matches the feature-symbols
198 (when (and (boundp x) 200 ;; about to get zapped. Obviously this won't get anonymous
199 (or (and (consp (symbol-value x)) ; Random hooks. 201 ;; functions which the package might just have installed, and
200 (string-match "-hooks?\\'" (symbol-name x))) 202 ;; there might be other important state, but this tactic
201 (memq x unload-feature-special-hooks))) ; Known abnormal hooks etc. 203 ;; normally works.
202 (dolist (y unload-hook-features-list) 204 (mapatoms
203 (when (and (eq (car-safe y) 'defun) 205 (lambda (x)
204 (not (get (cdr y) 'autoload))) 206 (when (and (boundp x)
205 (remove-hook x (cdr y))))))) 207 (or (and (consp (symbol-value x)) ; Random hooks.
206 ;; Remove any feature-symbols from auto-mode-alist as well. 208 (string-match "-hooks?\\'" (symbol-name x)))
207 (dolist (y unload-hook-features-list) 209 (memq x unload-feature-special-hooks))) ; Known abnormal hooks etc.
208 (when (and (eq (car-safe y) 'defun) 210 (dolist (y unload-function-features-list)
209 (not (get (cdr y) 'autoload))) 211 (when (and (eq (car-safe y) 'defun)
210 (setq auto-mode-alist 212 (not (get (cdr y) 'autoload)))
211 (rassq-delete-all (cdr y) auto-mode-alist))))) 213 (remove-hook x (cdr y)))))))
212 (when (fboundp 'elp-restore-function) ; remove ELP stuff first 214 ;; Remove any feature-symbols from auto-mode-alist as well.
213 (dolist (elt unload-hook-features-list) 215 (dolist (y unload-function-features-list)
214 (when (symbolp elt) 216 (when (and (eq (car-safe y) 'defun)
215 (elp-restore-function elt)))) 217 (not (get (cdr y) 'autoload)))
218 (setq auto-mode-alist
219 (rassq-delete-all (cdr y) auto-mode-alist)))))
220 (when (fboundp 'elp-restore-function) ; remove ELP stuff first
221 (dolist (elt unload-function-features-list)
222 (when (symbolp elt)
223 (elp-restore-function elt))))
216 224
217 (dolist (x unload-hook-features-list) 225 (dolist (x unload-function-features-list)
218 (if (consp x) 226 (if (consp x)
219 (case (car x) 227 (case (car x)
220 ;; Remove any feature names that this file provided. 228 ;; Remove any feature names that this file provided.
221 (provide 229 (provide
222 (setq features (delq (cdr x) features))) 230 (setq features (delq (cdr x) features)))
223 ((defun autoload) 231 ((defun autoload)
224 (let ((fun (cdr x))) 232 (let ((fun (cdr x)))
225 (when (fboundp fun) 233 (when (fboundp fun)
226 (when (fboundp 'ad-unadvise) 234 (when (fboundp 'ad-unadvise)
227 (ad-unadvise fun)) 235 (ad-unadvise fun))
228 (let ((aload (get fun 'autoload))) 236 (let ((aload (get fun 'autoload)))
229 (if (and aload (eq fun restore-autoload)) 237 (if (and aload (eq fun restore-autoload))
230 (fset fun (cons 'autoload aload)) 238 (fset fun (cons 'autoload aload))
231 (fmakunbound fun)))))) 239 (fmakunbound fun))))))
232 ;; (t . SYMBOL) comes before (defun . SYMBOL) 240 ;; (t . SYMBOL) comes before (defun . SYMBOL)
233 ;; and says we should restore SYMBOL's autoload 241 ;; and says we should restore SYMBOL's autoload
234 ;; when we undefine it. 242 ;; when we undefine it.
235 ((t) (setq restore-autoload (cdr x))) 243 ((t) (setq restore-autoload (cdr x)))
236 ((require defface) nil) 244 ((require defface) nil)
237 (t (message "Unexpected element %s in load-history" x))) 245 (t (message "Unexpected element %s in load-history" x)))
238 ;; Kill local values as much as possible. 246 ;; Kill local values as much as possible.
239 (dolist (buf (buffer-list)) 247 (dolist (buf (buffer-list))
240 (with-current-buffer buf 248 (with-current-buffer buf
241 (if (and (boundp x) (timerp (symbol-value x))) 249 (if (and (boundp x) (timerp (symbol-value x)))
242 (cancel-timer (symbol-value x))) 250 (cancel-timer (symbol-value x)))
243 (kill-local-variable x))) 251 (kill-local-variable x)))
244 (if (and (boundp x) (timerp (symbol-value x))) 252 (if (and (boundp x) (timerp (symbol-value x)))
245 (cancel-timer (symbol-value x))) 253 (cancel-timer (symbol-value x)))
246 ;; Get rid of the default binding if we can. 254 ;; Get rid of the default binding if we can.
247 (unless (local-variable-if-set-p x) 255 (unless (local-variable-if-set-p x)
248 (makunbound x)))) 256 (makunbound x))))
249 ;; Delete the load-history element for this file. 257 ;; Delete the load-history element for this file.
250 (setq load-history (delq (assoc file load-history) load-history))) 258 (setq load-history (delq (assoc file load-history) load-history))))
251 ;; Don't return load-history, it is not useful. 259 ;; Don't return load-history, it is not useful.
252 nil) 260 nil)
253 261
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 27c5dd901f7..82d12ccbdd0 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -151,6 +151,26 @@ PREFIX is the prefix argument (if any) to pass to the command."
151 ;; mouse-major-mode-menu was using `command-execute' instead. 151 ;; mouse-major-mode-menu was using `command-execute' instead.
152 (call-interactively cmd)))) 152 (call-interactively cmd))))
153 153
154(defun minor-mode-menu-from-indicator (indicator)
155 "Show menu, if any, for minor mode specified by INDICATOR.
156Interactively, INDICATOR is read using completion."
157 (interactive (list (completing-read "Minor mode indicator: "
158 (describe-minor-mode-completion-table-for-indicator))))
159 (let ((minor-mode (lookup-minor-mode-from-indicator indicator)))
160 (if minor-mode
161 (let* ((map (cdr-safe (assq minor-mode minor-mode-map-alist)))
162 (menu (and (keymapp map) (lookup-key map [menu-bar]))))
163 (if menu
164 (popup-menu menu)
165 (message "No menu for minor mode `%s'" minor-mode)))
166 (error "Cannot find minor mode for `%s'" indicator))))
167
168(defun mouse-minor-mode-menu (event)
169 "Show minor-mode menu for EVENT on minor modes area of the mode line."
170 (interactive "@e")
171 (let ((indicator (car (nth 4 (car (cdr event))))))
172 (minor-mode-menu-from-indicator indicator)))
173
154(defvar mouse-major-mode-menu-prefix) ; dynamically bound 174(defvar mouse-major-mode-menu-prefix) ; dynamically bound
155 175
156(defun mouse-major-mode-menu (event &optional prefix) 176(defun mouse-major-mode-menu (event &optional prefix)
diff --git a/lisp/obsolete/mlsupport.el b/lisp/obsolete/mlsupport.el
index d1844cd42ce..2465ea4eabd 100644
--- a/lisp/obsolete/mlsupport.el
+++ b/lisp/obsolete/mlsupport.el
@@ -186,10 +186,10 @@
186 (newline (ml-prefix-argument))) 186 (newline (ml-prefix-argument)))
187 187
188(defun ml-next-line () 188(defun ml-next-line ()
189 (next-line (ml-prefix-argument))) 189 (forward-line (ml-prefix-argument)))
190 190
191(defun ml-previous-line () 191(defun ml-previous-line ()
192 (previous-line (ml-prefix-argument))) 192 (forward-line (- (ml-prefix-argument))))
193 193
194(defun delete-to-kill-buffer () 194(defun delete-to-kill-buffer ()
195 (kill-region (point) (mark))) 195 (kill-region (point) (mark)))
diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el
index c37d11910d4..ddea4c293df 100644
--- a/lisp/progmodes/ada-xref.el
+++ b/lisp/progmodes/ada-xref.el
@@ -1706,7 +1706,7 @@ Information is extracted from the ali file."
1706 (beginning-of-line) 1706 (beginning-of-line)
1707 ;; while we have a continuation line, go up one line 1707 ;; while we have a continuation line, go up one line
1708 (while (looking-at "^\\.") 1708 (while (looking-at "^\\.")
1709 (previous-line 1) 1709 (forward-line -1)
1710 (beginning-of-line)) 1710 (beginning-of-line))
1711 (unless (looking-at (concat "[0-9]+.[0-9]+[ *]" 1711 (unless (looking-at (concat "[0-9]+.[0-9]+[ *]"
1712 (ada-name-of identlist) "[ <{=\(\[]")) 1712 (ada-name-of identlist) "[ <{=\(\[]"))
@@ -1735,11 +1735,11 @@ Information is extracted from the ali file."
1735 (let ((current-line (buffer-substring 1735 (let ((current-line (buffer-substring
1736 (point) (save-excursion (end-of-line) (point))))) 1736 (point) (save-excursion (end-of-line) (point)))))
1737 (save-excursion 1737 (save-excursion
1738 (next-line 1) 1738 (forward-line 1)
1739 (beginning-of-line) 1739 (beginning-of-line)
1740 (while (looking-at "^\\.\\(.*\\)") 1740 (while (looking-at "^\\.\\(.*\\)")
1741 (set 'current-line (concat current-line (match-string 1))) 1741 (set 'current-line (concat current-line (match-string 1)))
1742 (next-line 1)) 1742 (forward-line 1))
1743 ) 1743 )
1744 1744
1745 (if (re-search-backward "^X [0-9]+ \\([a-zA-Z0-9_.-]+\\)" nil t) 1745 (if (re-search-backward "^X [0-9]+ \\([a-zA-Z0-9_.-]+\\)" nil t)
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 4148f327ecc..275773049e7 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1130,7 +1130,7 @@ where they were found."
1130 (if (memq (car order) '(tag-exact-file-name-match-p 1130 (if (memq (car order) '(tag-exact-file-name-match-p
1131 tag-file-name-match-p 1131 tag-file-name-match-p
1132 tag-partial-file-name-match-p)) 1132 tag-partial-file-name-match-p))
1133 (save-excursion (next-line 1) 1133 (save-excursion (forward-line 1)
1134 (file-of-tag)) 1134 (file-of-tag))
1135 (file-of-tag))) 1135 (file-of-tag)))
1136 tag-info (funcall snarf-tag-function)) 1136 tag-info (funcall snarf-tag-function))
@@ -1454,10 +1454,10 @@ where they were found."
1454 (tag-info (save-excursion (funcall snarf-tag-function))) 1454 (tag-info (save-excursion (funcall snarf-tag-function)))
1455 (tag (if (eq t (car tag-info)) nil (car tag-info))) 1455 (tag (if (eq t (car tag-info)) nil (car tag-info)))
1456 (file-path (save-excursion (if tag (file-of-tag) 1456 (file-path (save-excursion (if tag (file-of-tag)
1457 (save-excursion (next-line 1) 1457 (save-excursion (forward-line 1)
1458 (file-of-tag))))) 1458 (file-of-tag)))))
1459 (file-label (if tag (file-of-tag t) 1459 (file-label (if tag (file-of-tag t)
1460 (save-excursion (next-line 1) 1460 (save-excursion (forward-line 1)
1461 (file-of-tag t)))) 1461 (file-of-tag t))))
1462 (pt (with-current-buffer standard-output (point)))) 1462 (pt (with-current-buffer standard-output (point))))
1463 (if tag 1463 (if tag
@@ -1884,7 +1884,7 @@ directory specification."
1884 (funcall tags-apropos-function regexp)))) 1884 (funcall tags-apropos-function regexp))))
1885 (etags-tags-apropos-additional regexp)) 1885 (etags-tags-apropos-additional regexp))
1886 (with-current-buffer "*Tags List*" 1886 (with-current-buffer "*Tags List*"
1887 (require 'apropos) 1887 (eval-and-compile (require 'apropos))
1888 (apropos-mode) 1888 (apropos-mode)
1889 ;; apropos-mode is derived from fundamental-mode and it kills 1889 ;; apropos-mode is derived from fundamental-mode and it kills
1890 ;; all local variables. 1890 ;; all local variables.
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index 4d2dd7f315e..eebfd377a7e 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -1474,7 +1474,7 @@ Otherwise just move the line. Move down unless UP is non-nil."
1474 (if (and idlwave-shell-arrows-do-history 1474 (if (and idlwave-shell-arrows-do-history
1475 (>= (1+ (save-excursion (end-of-line) (point))) proc-pos)) 1475 (>= (1+ (save-excursion (end-of-line) (point))) proc-pos))
1476 (comint-previous-input arg) 1476 (comint-previous-input arg)
1477 (previous-line arg)))) 1477 (forward-line (- arg)))))
1478 1478
1479(defun idlwave-shell-up-or-history (&optional arg) 1479(defun idlwave-shell-up-or-history (&optional arg)
1480"When in last line of process buffer, move to previous input. 1480"When in last line of process buffer, move to previous input.
diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el
index 7cff1bc516e..470988f4c14 100644
--- a/lisp/progmodes/prolog.el
+++ b/lisp/progmodes/prolog.el
@@ -31,7 +31,7 @@
31 31
32;;; Code: 32;;; Code:
33 33
34(defvar comint-prompt-regexp) 34(eval-when-compile (require 'comint))
35 35
36 36
37(defgroup prolog nil 37(defgroup prolog nil
@@ -269,6 +269,12 @@ Return not at end copies rest of line to end and sends it.
269 269
270(defvar inferior-prolog-buffer nil) 270(defvar inferior-prolog-buffer nil)
271 271
272(defvar inferior-prolog-flavor 'unknown
273 "Either a symbol or a buffer position offset by one.
274If a buffer position, the flavor has not been determined yet and
275it is expected that the process's output has been or will
276be inserted at that position plus one.")
277
272(defun inferior-prolog-run (&optional name) 278(defun inferior-prolog-run (&optional name)
273 (with-current-buffer (make-comint "prolog" (or name prolog-program-name)) 279 (with-current-buffer (make-comint "prolog" (or name prolog-program-name))
274 (inferior-prolog-mode) 280 (inferior-prolog-mode)
@@ -302,12 +308,6 @@ Return not at end copies rest of line to end and sends it.
302 ;; Try again. 308 ;; Try again.
303 (inferior-prolog-process)))) 309 (inferior-prolog-process))))
304 310
305(defvar inferior-prolog-flavor 'unknown
306 "Either a symbol or a buffer position offset by one.
307If a buffer position, the flavor has not been determined yet and
308it is expected that the process's output has been or will
309be inserted at that position plus one.")
310
311(defun inferior-prolog-guess-flavor (&optional ignored) 311(defun inferior-prolog-guess-flavor (&optional ignored)
312 (save-excursion 312 (save-excursion
313 (goto-char (1+ inferior-prolog-flavor)) 313 (goto-char (1+ inferior-prolog-flavor))
diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el
index 5d4400958d6..a33d21925b7 100644
--- a/lisp/smerge-mode.el
+++ b/lisp/smerge-mode.el
@@ -645,50 +645,119 @@ Point is moved to the end of the conflict."
645 (error nil))) 645 (error nil)))
646 found)) 646 found))
647 647
648;;; Refined change highlighting
649
650(defvar smerge-refine-forward-function 'smerge-refine-forward
651 "Function used to determine an \"atomic\" element.
652You can set it to `forward-char' to get char-level granularity.
653Its behavior has mainly two restrictions:
654- if this function encounters a newline, it's important that it stops right
655 after the newline.
656 This only matters if `smerge-refine-ignore-whitespace' is nil.
657- it needs to be unaffected by changes performed by the `preproc' argument
658 to `smerge-refine-subst'.
659 This only matters if `smerge-refine-weight-hack' is nil.")
660
661(defvar smerge-refine-ignore-whitespace t
662 "If non-nil,Indicate that smerge-refine should try to ignore change in whitespace.")
663
664(defvar smerge-refine-weight-hack t
665 "If non-nil, pass to diff as many lines as there are chars in the region.
666I.e. each atomic element (e.g. word) will be copied as many times (on different
667lines) as it has chars. This has 2 advantages:
668- if `diff' tries to minimize the number *lines* (rather than chars)
669 added/removed, this adjust the weights so that adding/removing long
670 symbols is considered correspondingly more costly.
671- `smerge-refine-forward-function' only needs to be called when chopping up
672 the regions, and `forward-char' can be used afterwards.
673It has the following disadvantages:
674- cannot use `diff -w' because the weighting causes added spaces in a line
675 to be represented as added copies of some line, so `diff -w' can't do the
676 right thing any more.
677- may in degenerate cases take a 1KB input region and turn it into a 1MB
678 file to pass to diff.")
679
680(defun smerge-refine-forward (n)
681 (let ((case-fold-search nil)
682 (re "[[:upper:]]?[[:lower:]]+\\|[[:upper:]]+\\|[[:digit:]]+\\|.\\|\n"))
683 (when (and smerge-refine-ignore-whitespace
684 ;; smerge-refine-weight-hack causes additional spaces to
685 ;; appear as additional lines as well, so even if diff ignore
686 ;; whitespace changes, it'll report added/removed lines :-(
687 (not smerge-refine-weight-hack))
688 (setq re (concat "[ \t]*\\(?:" re "\\)")))
689 (dotimes (i n)
690 (unless (looking-at re) (error "Smerge refine internal error"))
691 (goto-char (match-end 0)))))
692
648(defun smerge-refine-chopup-region (beg end file &optional preproc) 693(defun smerge-refine-chopup-region (beg end file &optional preproc)
649 "Chopup the region into small elements, one per line. 694 "Chopup the region into small elements, one per line.
650Save the result into FILE. 695Save the result into FILE.
651If non-nil, PREPROC is called with no argument in a buffer that contains 696If non-nil, PREPROC is called with no argument in a buffer that contains
652a copy of the text, just before chopping it up. It can be used to replace 697a copy of the text, just before chopping it up. It can be used to replace
653chars to try and eliminate some spurious differences." 698chars to try and eliminate some spurious differences."
654 ;; ediff chops up into words, where the definition of a word is 699 ;; We used to chop up char-by-char rather than word-by-word like ediff
655 ;; customizable. Instead we here keep only one char per line. 700 ;; does. It had the benefit of simplicity and very fine results, but it
656 ;; The advantages are that there's nothing to configure, that we get very 701 ;; often suffered from problem that diff would find correlations where
657 ;; fine results, and that it's trivial to map the line numbers in the 702 ;; there aren't any, so the resulting "change" didn't make much sense.
658 ;; output of diff back into buffer positions. The disadvantage is that it 703 ;; You can still get this behavior by setting
659 ;; can take more time to compute the diff and that the result is sometimes 704 ;; `smerge-refine-forward-function' to `forward-char'.
660 ;; too fine. I'm not too concerned about the slowdown because conflicts
661 ;; are usually significantly smaller than the whole file. As for the
662 ;; problem of too-fine-refinement, I have found it to be unimportant
663 ;; especially when you consider the cases where the fine-grain is just
664 ;; what you want.
665 (let ((buf (current-buffer))) 705 (let ((buf (current-buffer)))
666 (with-temp-buffer 706 (with-temp-buffer
667 (insert-buffer-substring buf beg end) 707 (insert-buffer-substring buf beg end)
668 (when preproc (goto-char (point-min)) (funcall preproc)) 708 (when preproc (goto-char (point-min)) (funcall preproc))
709 (when smerge-refine-ignore-whitespace
710 ;; It doesn't make much of a difference for diff-fine-highlight
711 ;; because we still have the _/+/</>/! prefix anyway. Can still be
712 ;; useful in other circumstances.
713 (subst-char-in-region (point-min) (point-max) ?\n ?\s))
669 (goto-char (point-min)) 714 (goto-char (point-min))
670 (while (not (eobp)) 715 (while (not (eobp))
671 (forward-char 1) 716 (funcall smerge-refine-forward-function 1)
672 ;; We add \n after each char except after \n, so we get one line per 717 (let ((s (if (prog2 (forward-char -1) (bolp) (forward-char 1))
673 ;; text char, where each line contains just one char, except for \n 718 nil
674 ;; chars which are represented by the empty line. 719 (buffer-substring (line-beginning-position) (point)))))
675 (unless (eq (char-before) ?\n) (insert ?\n))) 720 ;; We add \n after each char except after \n, so we get
721 ;; one line per text char, where each line contains
722 ;; just one char, except for \n chars which are
723 ;; represented by the empty line.
724 (unless (eq (char-before) ?\n) (insert ?\n))
725 ;; HACK ALERT!!
726 (if smerge-refine-weight-hack
727 (dotimes (i (1- (length s))) (insert s "\n")))))
728 (unless (bolp) (error "Smerge refine internal error"))
676 (let ((coding-system-for-write 'emacs-mule)) 729 (let ((coding-system-for-write 'emacs-mule))
677 (write-region (point-min) (point-max) file nil 'nomessage))))) 730 (write-region (point-min) (point-max) file nil 'nomessage)))))
678 731
679(defun smerge-refine-highlight-change (buf beg match-num1 match-num2 props) 732(defun smerge-refine-highlight-change (buf beg match-num1 match-num2 props)
680 (let* ((startline (string-to-number (match-string match-num1))) 733 (with-current-buffer buf
681 (ol (make-overlay 734 (goto-char beg)
682 (+ beg startline -1) 735 (let* ((startline (- (string-to-number match-num1) 1))
683 (+ beg (if (match-end match-num2) 736 (beg (progn (funcall (if smerge-refine-weight-hack
684 (string-to-number (match-string match-num2)) 737 'forward-char
685 startline)) 738 smerge-refine-forward-function)
686 buf 739 startline)
687 ;; Make them tend to shrink rather than spread when editing. 740 (point)))
688 'front-advance nil))) 741 (end (progn (funcall (if smerge-refine-weight-hack
689 (overlay-put ol 'evaporate t) 742 'forward-char
690 (dolist (x props) 743 smerge-refine-forward-function)
691 (overlay-put ol (car x) (cdr x))))) 744 (if match-num2
745 (- (string-to-number match-num2)
746 startline)
747 1))
748 (point))))
749 (when smerge-refine-ignore-whitespace
750 (skip-chars-backward " \t\n" beg) (setq end (point))
751 (goto-char beg)
752 (skip-chars-forward " \t\n" end) (setq beg (point)))
753 (when (> end beg)
754 (let ((ol (make-overlay
755 beg end nil
756 ;; Make them tend to shrink rather than spread when editing.
757 'front-advance nil)))
758 (overlay-put ol 'evaporate t)
759 (dolist (x props) (overlay-put ol (car x) (cdr x)))
760 ol)))))
692 761
693(defun smerge-refine-subst (beg1 end1 beg2 end2 props &optional preproc) 762(defun smerge-refine-subst (beg1 end1 beg2 end2 props &optional preproc)
694 "Show fine differences in the two regions BEG1..END1 and BEG2..END2. 763 "Show fine differences in the two regions BEG1..END1 and BEG2..END2.
@@ -697,9 +766,9 @@ If non-nil, PREPROC is called with no argument in a buffer that contains
697a copy of a region, just before preparing it to for `diff'. It can be used to 766a copy of a region, just before preparing it to for `diff'. It can be used to
698replace chars to try and eliminate some spurious differences." 767replace chars to try and eliminate some spurious differences."
699 (let* ((buf (current-buffer)) 768 (let* ((buf (current-buffer))
769 (pos (point))
700 (file1 (make-temp-file "diff1")) 770 (file1 (make-temp-file "diff1"))
701 (file2 (make-temp-file "diff2"))) 771 (file2 (make-temp-file "diff2")))
702
703 ;; Chop up regions into smaller elements and save into files. 772 ;; Chop up regions into smaller elements and save into files.
704 (smerge-refine-chopup-region beg1 end1 file1 preproc) 773 (smerge-refine-chopup-region beg1 end1 file1 preproc)
705 (smerge-refine-chopup-region beg2 end2 file2 preproc) 774 (smerge-refine-chopup-region beg2 end2 file2 preproc)
@@ -710,21 +779,49 @@ replace chars to try and eliminate some spurious differences."
710 (let ((coding-system-for-read 'emacs-mule)) 779 (let ((coding-system-for-read 'emacs-mule))
711 ;; Don't forget -a to make sure diff treats it as a text file 780 ;; Don't forget -a to make sure diff treats it as a text file
712 ;; even if it contains \0 and such. 781 ;; even if it contains \0 and such.
713 (call-process diff-command nil t nil "-a" file1 file2)) 782 (call-process diff-command nil t nil
783 (if (and smerge-refine-ignore-whitespace
784 (not smerge-refine-weight-hack))
785 "-aw" "-a")
786 file1 file2))
714 ;; Process diff's output. 787 ;; Process diff's output.
715 (goto-char (point-min)) 788 (goto-char (point-min))
716 (while (not (eobp)) 789 (let ((last1 nil)
717 (if (not (looking-at "\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)?\\([acd]\\)\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)?$")) 790 (last2 nil))
718 (error "Unexpected patch hunk header: %s" 791 (while (not (eobp))
719 (buffer-substring (point) (line-end-position))) 792 (if (not (looking-at "\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)?\\([acd]\\)\\([0-9]+\\)\\(?:,\\([0-9]+\\)\\)?$"))
720 (let ((op (char-after (match-beginning 3)))) 793 (error "Unexpected patch hunk header: %s"
794 (buffer-substring (point) (line-end-position))))
795 (let ((op (char-after (match-beginning 3)))
796 (m1 (match-string 1))
797 (m2 (match-string 2))
798 (m4 (match-string 4))
799 (m5 (match-string 5)))
721 (when (memq op '(?d ?c)) 800 (when (memq op '(?d ?c))
722 (smerge-refine-highlight-change buf beg1 1 2 props)) 801 (setq last1
802 (smerge-refine-highlight-change buf beg1 m1 m2 props)))
723 (when (memq op '(?a ?c)) 803 (when (memq op '(?a ?c))
724 (smerge-refine-highlight-change buf beg2 4 5 props))) 804 (setq last2
805 (smerge-refine-highlight-change buf beg2 m4 m5 props))))
725 (forward-line 1) ;Skip hunk header. 806 (forward-line 1) ;Skip hunk header.
726 (and (re-search-forward "^[0-9]" nil 'move) ;Skip hunk body. 807 (and (re-search-forward "^[0-9]" nil 'move) ;Skip hunk body.
727 (goto-char (match-beginning 0)))))) 808 (goto-char (match-beginning 0))))
809 ;; (assert (or (null last1) (< (overlay-start last1) end1)))
810 ;; (assert (or (null last2) (< (overlay-start last2) end2)))
811 (if smerge-refine-weight-hack
812 (progn
813 ;; (assert (or (null last1) (<= (overlay-end last1) end1)))
814 ;; (assert (or (null last2) (<= (overlay-end last2) end2)))
815 )
816 ;; smerge-refine-forward-function when calling in chopup may
817 ;; have stopped because it bumped into EOB whereas in
818 ;; smerge-refine-weight-hack it may go a bit further.
819 (if (and last1 (> (overlay-end last1) end1))
820 (move-overlay last1 (overlay-start last1) end1))
821 (if (and last2 (> (overlay-end last2) end2))
822 (move-overlay last2 (overlay-start last2) end2))
823 )))
824 (goto-char pos)
728 (delete-file file1) 825 (delete-file file1)
729 (delete-file file2)))) 826 (delete-file file2))))
730 827
diff --git a/lisp/textmodes/bib-mode.el b/lisp/textmodes/bib-mode.el
index b457956b9ba..74800197bcc 100644
--- a/lisp/textmodes/bib-mode.el
+++ b/lisp/textmodes/bib-mode.el
@@ -127,7 +127,7 @@ with the cdr.")
127 ((null slots) 127 ((null slots)
128 (if (bobp) 128 (if (bobp)
129 "" 129 ""
130 (progn (previous-line 1) (bib-find-key bib-assoc)))) 130 (progn (forward-line -1) (bib-find-key bib-assoc))))
131 ((looking-at (car (car slots))) 131 ((looking-at (car (car slots)))
132 (cdr (car slots))) 132 (cdr (car slots)))
133 (t (bib-find-key (cdr slots))) 133 (t (bib-find-key (cdr slots)))
@@ -181,7 +181,7 @@ with the cdr.")
181 (beginning-of-line nil) 181 (beginning-of-line nil)
182 (push-mark (point)) 182 (push-mark (point))
183 (re-search-forward "^ *$" nil 2) 183 (re-search-forward "^ *$" nil 2)
184 (next-line 1) 184 (forward-line 1)
185 (beginning-of-line nil)) 185 (beginning-of-line nil))
186 186
187(defun unread-bib () 187(defun unread-bib ()
diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el
index e1f55c0dece..367a33a85b8 100644
--- a/lisp/textmodes/two-column.el
+++ b/lisp/textmodes/two-column.el
@@ -463,7 +463,7 @@ First column's text sSs Second column's text
463 (1+ (point))))) 463 (1+ (point)))))
464 (delete-region point (point)) 464 (delete-region point (point))
465 (setq n 0)) 465 (setq n 0))
466 (next-line 1))))) 466 (forward-line 1)))))
467 467
468 468
469 469
@@ -531,7 +531,7 @@ off trailing spaces with \\[delete-trailing-whitespace]."
531 (end-of-line) 531 (end-of-line)
532 (indent-to-column 2C-window-width) 532 (indent-to-column 2C-window-width)
533 (insert 2C-separator string)) 533 (insert 2C-separator string))
534 (next-line 1) ; add one if necessary 534 (forward-line 1) ; add one if necessary
535 (set-buffer b2)))) 535 (set-buffer b2))))
536 (unless (window-full-width-p) 536 (unless (window-full-width-p)
537 (enlarge-window 99999 t))) 537 (enlarge-window 99999 t)))
diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el
index 96957de0812..3c4e4b4d791 100644
--- a/lisp/vc-arch.el
+++ b/lisp/vc-arch.el
@@ -442,11 +442,11 @@ Return non-nil if FILE is unchanged."
442 (concat "*/" string)) 442 (concat "*/" string))
443 "*")))))) 443 "*"))))))
444 444
445(defun vc-arch-revision-completion-table (file) 445(defun vc-arch-revision-completion-table (files)
446 (lexical-let ((file file)) 446 (lexical-let ((files files))
447 (lambda (string pred action) 447 (lambda (string pred action)
448 ;; FIXME: complete revision patches as well. 448 ;; FIXME: complete revision patches as well.
449 (let* ((root (expand-file-name "{arch}" (vc-arch-root file))) 449 (let* ((root (expand-file-name "{arch}" (vc-arch-root (car files))))
450 (table (vc-arch--version-completion-table root string))) 450 (table (vc-arch--version-completion-table root string)))
451 (complete-with-action action table string pred))))) 451 (complete-with-action action table string pred)))))
452 452
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el
index 5ed46431fda..801e1942cb6 100644
--- a/lisp/vc-bzr.el
+++ b/lisp/vc-bzr.el
@@ -391,7 +391,6 @@ EDITABLE is ignored."
391 (list "-r" (format "%s..%s" rev1 rev2)) 391 (list "-r" (format "%s..%s" rev1 rev2))
392 (list "-r" rev1)))))) 392 (list "-r" rev1))))))
393 393
394(defalias 'vc-bzr-diff-tree 'vc-bzr-diff)
395 394
396 395
397;; FIXME: vc-{next,previous}-revision need fixing in vc.el to deal with 396;; FIXME: vc-{next,previous}-revision need fixing in vc.el to deal with
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el
index 5ffb4815182..79a4263854d 100644
--- a/lisp/vc-cvs.el
+++ b/lisp/vc-cvs.el
@@ -962,11 +962,11 @@ is non-nil."
962 (push (match-string 1) res)) 962 (push (match-string 1) res))
963 res))) 963 res)))
964 964
965(defun vc-cvs-revision-completion-table (file) 965(defun vc-cvs-revision-completion-table (files)
966 (lexical-let ((file file) 966 (lexical-let ((files files)
967 table) 967 table)
968 (setq table (lazy-completion-table 968 (setq table (lazy-completion-table
969 table (lambda () (vc-cvs-revision-table file)))) 969 table (lambda () (vc-cvs-revision-table (car files)))))
970 table)) 970 table))
971 971
972 972
diff --git a/lisp/vc-git.el b/lisp/vc-git.el
index 4bf6506dcb1..07714b26c32 100644
--- a/lisp/vc-git.el
+++ b/lisp/vc-git.el
@@ -87,8 +87,7 @@
87;; - comment-history (file) ?? 87;; - comment-history (file) ??
88;; - update-changelog (files) COULD BE SUPPORTED 88;; - update-changelog (files) COULD BE SUPPORTED
89;; * diff (file &optional rev1 rev2 buffer) OK 89;; * diff (file &optional rev1 rev2 buffer) OK
90;; - revision-completion-table (file) NEEDED? 90;; - revision-completion-table (files) NEEDED?
91;; - diff-tree (dir &optional rev1 rev2) OK
92;; - annotate-command (file buf &optional rev) OK 91;; - annotate-command (file buf &optional rev) OK
93;; - annotate-time () OK 92;; - annotate-time () OK
94;; - annotate-current-time () NOT NEEDED 93;; - annotate-current-time () NOT NEEDED
@@ -319,7 +318,8 @@
319 (vc-git-command buf 1 files "diff-tree" "--exit-code" "-p" rev1 rev2 "--") 318 (vc-git-command buf 1 files "diff-tree" "--exit-code" "-p" rev1 rev2 "--")
320 (vc-git-command buf 1 files "diff-index" "--exit-code" "-p" (or rev1 "HEAD") "--")))) 319 (vc-git-command buf 1 files "diff-index" "--exit-code" "-p" (or rev1 "HEAD") "--"))))
321 320
322(defun vc-git-revision-table (file) 321(defun vc-git-revision-table (files)
322 ;; What about `files'?!? --Stef
323 (let ((table (list "HEAD"))) 323 (let ((table (list "HEAD")))
324 (with-temp-buffer 324 (with-temp-buffer
325 (vc-git-command t nil nil "for-each-ref" "--format=%(refname)") 325 (vc-git-command t nil nil "for-each-ref" "--format=%(refname)")
@@ -328,16 +328,13 @@
328 (push (match-string 2) table))) 328 (push (match-string 2) table)))
329 table)) 329 table))
330 330
331(defun vc-git-revision-completion-table (file) 331(defun vc-git-revision-completion-table (files)
332 (lexical-let ((file file) 332 (lexical-let ((files files)
333 table) 333 table)
334 (setq table (lazy-completion-table 334 (setq table (lazy-completion-table
335 table (lambda () (vc-git-revision-table file)))) 335 table (lambda () (vc-git-revision-table files))))
336 table)) 336 table))
337 337
338(defun vc-git-diff-tree (dir &optional rev1 rev2)
339 (vc-git-diff dir rev1 rev2))
340
341(defun vc-git-annotate-command (file buf &optional rev) 338(defun vc-git-annotate-command (file buf &optional rev)
342 ;; FIXME: rev is ignored 339 ;; FIXME: rev is ignored
343 (let ((name (file-relative-name file))) 340 (let ((name (file-relative-name file)))
diff --git a/lisp/vc-hg.el b/lisp/vc-hg.el
index 2e90d06fbc5..872be45a2c1 100644
--- a/lisp/vc-hg.el
+++ b/lisp/vc-hg.el
@@ -76,8 +76,7 @@
76;; - comment-history (file) NOT NEEDED 76;; - comment-history (file) NOT NEEDED
77;; - update-changelog (files) NOT NEEDED 77;; - update-changelog (files) NOT NEEDED
78;; * diff (files &optional rev1 rev2 buffer) OK 78;; * diff (files &optional rev1 rev2 buffer) OK
79;; - revision-completion-table (file) COMMENTED OUT AS A WORKAROUND FOR A BUG 79;; - revision-completion-table (files) OK?
80;; - diff-tree (dir &optional rev1 rev2) TEST IT
81;; - annotate-command (file buf &optional rev) OK 80;; - annotate-command (file buf &optional rev) OK
82;; - annotate-time () OK 81;; - annotate-time () OK
83;; - annotate-current-time () ?? NOT NEEDED 82;; - annotate-current-time () ?? NOT NEEDED
@@ -294,24 +293,21 @@
294 (list "-r" oldvers)) 293 (list "-r" oldvers))
295 (list "")))))) 294 (list ""))))))
296 295
297(defun vc-hg-revision-table (file) 296(defun vc-hg-revision-table (files)
298 (let ((default-directory (file-name-directory file))) 297 (let ((default-directory (file-name-directory (car files))))
299 (with-temp-buffer 298 (with-temp-buffer
300 (vc-hg-command t nil file "log" "--template" "{rev} ") 299 (vc-hg-command t nil file "log" "--template" "{rev} ")
301 (split-string 300 (split-string
302 (buffer-substring-no-properties (point-min) (point-max)))))) 301 (buffer-substring-no-properties (point-min) (point-max))))))
303 302
304;; Modelled after the similar function in vc-cvs.el 303;; Modelled after the similar function in vc-cvs.el
305(defun vc-hg-revision-completion-table (file) 304(defun vc-hg-revision-completion-table (files)
306 (lexical-let ((file file) 305 (lexical-let ((files files)
307 table) 306 table)
308 (setq table (lazy-completion-table 307 (setq table (lazy-completion-table
309 table (lambda () (vc-hg-revision-table file)))) 308 table (lambda () (vc-hg-revision-table files))))
310 table)) 309 table))
311 310
312(defun vc-hg-diff-tree (file &optional oldvers newvers buffer)
313 (vc-hg-diff (list file) oldvers newvers buffer))
314
315(defun vc-hg-annotate-command (file buffer &optional revision) 311(defun vc-hg-annotate-command (file buffer &optional revision)
316 "Execute \"hg annotate\" on FILE, inserting the contents in BUFFER. 312 "Execute \"hg annotate\" on FILE, inserting the contents in BUFFER.
317Optional arg REVISION is a revision to annotate from." 313Optional arg REVISION is a revision to annotate from."
diff --git a/lisp/vc-mcvs.el b/lisp/vc-mcvs.el
index aa99e3f4273..0a2e69cefac 100644
--- a/lisp/vc-mcvs.el
+++ b/lisp/vc-mcvs.el
@@ -463,19 +463,6 @@ The changes are between FIRST-REVISION and SECOND-REVISION."
463 (vc-switches 'MCVS 'diff)))) 463 (vc-switches 'MCVS 'diff))))
464 (if async 1 status))) ; async diff, pessimistic assumption. 464 (if async 1 status))) ; async diff, pessimistic assumption.
465 465
466(defun vc-mcvs-diff-tree (dir &optional rev1 rev2)
467 "Diff all files at and below DIR."
468 (with-current-buffer "*vc-diff*"
469 ;; Run the command from the root dir so that `mcvs filt' returns
470 ;; valid relative names.
471 (setq default-directory (vc-mcvs-root dir))
472 ;; cvs diff: use a single call for the entire tree
473 (let ((coding-system-for-read (or coding-system-for-read 'undecided)))
474 (apply 'vc-mcvs-command "*vc-diff*" 1 dir "diff"
475 (and rev1 (concat "-r" rev1))
476 (and rev2 (concat "-r" rev2))
477 (vc-switches 'MCVS 'diff)))))
478
479(defun vc-mcvs-annotate-command (file buffer &optional revision) 466(defun vc-mcvs-annotate-command (file buffer &optional revision)
480 "Execute \"mcvs annotate\" on FILE, inserting the contents in BUFFER. 467 "Execute \"mcvs annotate\" on FILE, inserting the contents in BUFFER.
481Optional arg REVISION is a revision to annotate from." 468Optional arg REVISION is a revision to annotate from."
diff --git a/lisp/vc-mtn.el b/lisp/vc-mtn.el
index 5365b4d9289..0b209fdd5af 100644
--- a/lisp/vc-mtn.el
+++ b/lisp/vc-mtn.el
@@ -168,7 +168,6 @@
168 168
169(defun vc-mtn-wash-log (file)) 169(defun vc-mtn-wash-log (file))
170 170
171(defalias 'vc-mtn-diff-tree 'vc-mtn-diff)
172(defun vc-mtn-diff (files &optional rev1 rev2 buffer) 171(defun vc-mtn-diff (files &optional rev1 rev2 buffer)
173 (apply 'vc-mtn-command (or buffer "*vc-diff*") 1 files "diff" 172 (apply 'vc-mtn-command (or buffer "*vc-diff*") 1 files "diff"
174 (append (if rev1 (list "-r" rev1)) (if rev2 (list "-r" rev2))))) 173 (append (if rev1 (list "-r" rev1)) (if rev2 (list "-r" rev2)))))
@@ -239,10 +238,11 @@
239 (push (match-string 0) ids)) 238 (push (match-string 0) ids))
240 ids))) 239 ids)))
241 240
242(defun vc-mtn-revision-completion-table (file) 241(defun vc-mtn-revision-completion-table (files)
243 ;; TODO: Implement completion for for selectors 242 ;; TODO: Implement completion for for selectors
244 ;; TODO: Implement completion for composite selectors. 243 ;; TODO: Implement completion for composite selectors.
245 (lexical-let ((file file)) 244 (lexical-let ((files files))
245 ;; What about using `files'?!? --Stef
246 (lambda (string pred action) 246 (lambda (string pred action)
247 (cond 247 (cond
248 ;; "Tag" selectors. 248 ;; "Tag" selectors.
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index 43643b931d9..76fdbe5162f 100644
--- a/lisp/vc-svn.el
+++ b/lisp/vc-svn.el
@@ -437,10 +437,6 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
437 ;; status w.r.t whether the diff was empty or not. 437 ;; status w.r.t whether the diff was empty or not.
438 (buffer-size (get-buffer buffer))))) 438 (buffer-size (get-buffer buffer)))))
439 439
440(defun vc-svn-diff-tree (dir &optional rev1 rev2)
441 "Diff all files at and below DIR."
442 (vc-svn-diff (list (file-name-as-directory dir)) rev1 rev2))
443
444;;; 440;;;
445;;; Snapshot system 441;;; Snapshot system
446;;; 442;;;
diff --git a/lisp/vc.el b/lisp/vc.el
index 0cf800c2ddd..09898aa98c1 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -49,15 +49,15 @@
49;; 49;;
50;; Features in the new version: 50;; Features in the new version:
51;; * Key commands (vc-next-action = C-x v v, vc-print-log = C-x v l, vc-revert 51;; * Key commands (vc-next-action = C-x v v, vc-print-log = C-x v l, vc-revert
52;; = C-x v u, vc-rollback = C-x v c, vc-diff = C-x v =, vc-update = C-x v +) 52;; = C-x v u, vc-rollback = C-x v c, vc-diff = C-x v =, vc-update = C-x v +)
53;; now operate on filesets rather than individual files. 53;; now operate on filesets rather than individual files.
54;; * The fileset for a command is either (a) all marked files in VC-dired 54;; * The fileset for a command is either (a) all marked files in VC-dired
55;; mode, (b) the currently visited file if it's under version control, 55;; mode, (b) the currently visited file if it's under version control,
56;; or (c) the current directory if the visited buffer is not under 56;; or (c) the current directory if the visited buffer is not under
57;; version control and a wildcarding-enable flag has been set. 57;; version control and a wildcarding-enable flag has been set.
58;; 58;;
59;; If you maintain a client of the mode or customize it in your .emacs, 59;; If you maintain a client of the mode or customize it in your .emacs,
60;; note that some backend functions which formerly took single file arguments 60;; note that some backend functions which formerly took single file arguments
61;; now take a list of files. These include: register, checkin, print-log, 61;; now take a list of files. These include: register, checkin, print-log,
62;; rollback, and diff. 62;; rollback, and diff.
63 63
@@ -129,7 +129,7 @@
129;; that return 'file have per-file revision numbering; backends 129;; that return 'file have per-file revision numbering; backends
130;; that return 'repository have per-repository revision numbering, 130;; that return 'repository have per-repository revision numbering,
131;; so a revision level implicitly identifies a changeset 131;; so a revision level implicitly identifies a changeset
132;; 132;;
133;; STATE-QUERYING FUNCTIONS 133;; STATE-QUERYING FUNCTIONS
134;; 134;;
135;; * registered (file) 135;; * registered (file)
@@ -168,7 +168,7 @@
168;; 168;;
169;; Return the working revision of FILE. This is the revision fetched 169;; Return the working revision of FILE. This is the revision fetched
170;; by the last checkout or upate, not necessarily the same thing as the 170;; by the last checkout or upate, not necessarily the same thing as the
171;; head or tip revision. Should return "0" for a file added but not yet 171;; head or tip revision. Should return "0" for a file added but not yet
172;; committed. 172;; committed.
173;; 173;;
174;; - latest-on-branch-p (file) 174;; - latest-on-branch-p (file)
@@ -197,7 +197,7 @@
197;; - mode-line-string (file) 197;; - mode-line-string (file)
198;; 198;;
199;; If provided, this function should return the VC-specific mode 199;; If provided, this function should return the VC-specific mode
200;; line string for FILE. The returned string should have a 200;; line string for FILE. The returned string should have a
201;; `help-echo' property which is the text to be displayed as a 201;; `help-echo' property which is the text to be displayed as a
202;; tooltip when the mouse hovers over the VC entry on the mode-line. 202;; tooltip when the mouse hovers over the VC entry on the mode-line.
203;; The default implementation deals well with all states that 203;; The default implementation deals well with all states that
@@ -213,8 +213,8 @@
213;; 213;;
214;; * create-repo (backend) 214;; * create-repo (backend)
215;; 215;;
216;; Create an empty repository in the current directory and initialize 216;; Create an empty repository in the current directory and initialize
217;; it so VC mode can add files to it. For file-oriented systems, this 217;; it so VC mode can add files to it. For file-oriented systems, this
218;; need do no more than create a subdirectory with the right name. 218;; need do no more than create a subdirectory with the right name.
219;; 219;;
220;; * register (files &optional rev comment) 220;; * register (files &optional rev comment)
@@ -223,7 +223,7 @@
223;; and an initial description of the file, COMMENT, may be specified, 223;; and an initial description of the file, COMMENT, may be specified,
224;; but it is not guaranteed that the backend will do anything with this. 224;; but it is not guaranteed that the backend will do anything with this.
225;; The implementation should pass the value of vc-register-switches 225;; The implementation should pass the value of vc-register-switches
226;; to the backend command. (Note: in older versions of VC, this 226;; to the backend command. (Note: in older versions of VC, this
227;; command took a single file argument and not a list.) 227;; command took a single file argument and not a list.)
228;; 228;;
229;; - init-revision (file) 229;; - init-revision (file)
@@ -264,7 +264,7 @@
264;; should become the new revision number (not all backends do 264;; should become the new revision number (not all backends do
265;; anything with it). COMMENT is used as a check-in comment. The 265;; anything with it). COMMENT is used as a check-in comment. The
266;; implementation should pass the value of vc-checkin-switches to 266;; implementation should pass the value of vc-checkin-switches to
267;; the backend command. (Note: in older versions of VC, this 267;; the backend command. (Note: in older versions of VC, this
268;; command took a single file argument and not a list.) 268;; command took a single file argument and not a list.)
269;; 269;;
270;; * find-revision (file rev buffer) 270;; * find-revision (file rev buffer)
@@ -374,18 +374,11 @@
374;; differences found), or 1 (either non-empty diff or the diff is 374;; differences found), or 1 (either non-empty diff or the diff is
375;; run asynchronously). 375;; run asynchronously).
376;; 376;;
377;; - revision-completion-table (file) 377;; - revision-completion-table (files)
378;; 378;;
379;; Return a completion table for existing revisions of FILE. 379;; Return a completion table for existing revisions of FILES.
380;; The default is to not use any completion table. 380;; The default is to not use any completion table.
381;; 381;;
382;; - diff-tree (dir &optional rev1 rev2)
383;;
384;; Insert the diff for all files at and below DIR into the *vc-diff*
385;; buffer. The meaning of REV1 and REV2 is the same as for
386;; vc-BACKEND-diff. The default implementation does an explicit tree
387;; walk, calling vc-BACKEND-diff for each individual file.
388;;
389;; - annotate-command (file buf &optional rev) 382;; - annotate-command (file buf &optional rev)
390;; 383;;
391;; If this function is provided, it should produce an annotated display 384;; If this function is provided, it should produce an annotated display
@@ -620,7 +613,7 @@ These are passed to the checkin program by \\[vc-register]."
620 :group 'vc 613 :group 'vc
621 :version "20.3") 614 :version "20.3")
622 615
623(defcustom vc-directory-exclusion-list '("SCCS" "RCS" "CVS" "MCVS" ".svn" 616(defcustom vc-directory-exclusion-list '("SCCS" "RCS" "CVS" "MCVS" ".svn"
624 ".git" ".hg" ".bzr" "{arch}") 617 ".git" ".hg" ".bzr" "{arch}")
625 "List of directory names to be ignored when walking directory trees." 618 "List of directory names to be ignored when walking directory trees."
626 :type '(repeat string) 619 :type '(repeat string)
@@ -859,12 +852,11 @@ been updated to their corresponding values."
859 `(let ((vc-touched-properties (list t))) 852 `(let ((vc-touched-properties (list t)))
860 ,form 853 ,form
861 (dolist (file ,files) 854 (dolist (file ,files)
862 (mapc (lambda (setting) 855 (dolist (setting ,settings)
863 (let ((property (car setting))) 856 (let ((property (car setting)))
864 (unless (memq property vc-touched-properties) 857 (unless (memq property vc-touched-properties)
865 (put (intern file vc-file-prop-obarray) 858 (put (intern file vc-file-prop-obarray)
866 property (cdr setting))))) 859 property (cdr setting))))))))
867 ,settings))))
868 860
869;; Two macros for elisp programming 861;; Two macros for elisp programming
870 862
@@ -874,7 +866,7 @@ been updated to their corresponding values."
874Check in FILE with COMMENT (a string) after BODY has been executed. 866Check in FILE with COMMENT (a string) after BODY has been executed.
875FILE is passed through `expand-file-name'; BODY executed within 867FILE is passed through `expand-file-name'; BODY executed within
876`save-excursion'. If FILE is not under version control, or you are 868`save-excursion'. If FILE is not under version control, or you are
877using a locking version-control system and the file is locked by 869using a locking version-control system and the file is locked by
878somebody else, signal error." 870somebody else, signal error."
879 (declare (debug t) (indent 2)) 871 (declare (debug t) (indent 2))
880 (let ((filevar (make-symbol "file"))) 872 (let ((filevar (make-symbol "file")))
@@ -1010,7 +1002,7 @@ considered successful if its exit status does not exceed OKSTATUS (if
1010OKSTATUS is nil, that means to ignore error status, if it is `async', that 1002OKSTATUS is nil, that means to ignore error status, if it is `async', that
1011means not to wait for termination of the subprocess; if it is t it means to 1003means not to wait for termination of the subprocess; if it is t it means to
1012ignore all execution errors). FILE-OR-LIST is the name of a working file; 1004ignore all execution errors). FILE-OR-LIST is the name of a working file;
1013it may be a list of files or be nil (to execute commands that don't expect 1005it may be a list of files or be nil (to execute commands that don't expect
1014a file name or set of files). If an optional list of FLAGS is present, 1006a file name or set of files). If an optional list of FLAGS is present,
1015that is inserted into the command line before the filename." 1007that is inserted into the command line before the filename."
1016 ;; FIXME: file-relative-name can return a bogus result because 1008 ;; FIXME: file-relative-name can return a bogus result because
@@ -1020,15 +1012,15 @@ that is inserted into the command line before the filename."
1020 (mapcar (lambda (f) (file-relative-name (expand-file-name f))) 1012 (mapcar (lambda (f) (file-relative-name (expand-file-name f)))
1021 (if (listp file-or-list) file-or-list (list file-or-list)))) 1013 (if (listp file-or-list) file-or-list (list file-or-list))))
1022 (full-command 1014 (full-command
1023 ;; What we're doing here is preparing a version of the command 1015 ;; What we're doing here is preparing a version of the command
1024 ;; for display in a debug-progess message. If it's fewer than 1016 ;; for display in a debug-progess message. If it's fewer than
1025 ;; 20 characters display the entire command (without trailing 1017 ;; 20 characters display the entire command (without trailing
1026 ;; newline). Otherwise display the first 20 followed by an ellipsis. 1018 ;; newline). Otherwise display the first 20 followed by an ellipsis.
1027 (concat (if (string= (substring command -1) "\n") 1019 (concat (if (string= (substring command -1) "\n")
1028 (substring command 0 -1) 1020 (substring command 0 -1)
1029 command) 1021 command)
1030 " " 1022 " "
1031 (vc-delistify (mapcar (lambda (s) (if (> (length s) 20) (concat (substring s 0 2) "...") s)) flags)) 1023 (vc-delistify (mapcar (lambda (s) (if (> (length s) 20) (concat (substring s 0 2) "...") s)) flags))
1032 " " (vc-delistify files)))) 1024 " " (vc-delistify files))))
1033 (save-current-buffer 1025 (save-current-buffer
1034 (unless (or (eq buffer t) 1026 (unless (or (eq buffer t)
@@ -1082,7 +1074,7 @@ that is inserted into the command line before the filename."
1082 (if vc-command-messages 1074 (if vc-command-messages
1083 (message "Running %s...OK = %d" full-command status))) 1075 (message "Running %s...OK = %d" full-command status)))
1084 (vc-exec-after 1076 (vc-exec-after
1085 `(run-hook-with-args 'vc-post-command-functions 1077 `(run-hook-with-args 'vc-post-command-functions
1086 ',command ',file-or-list ',flags)) 1078 ',command ',file-or-list ',flags))
1087 status)))) 1079 status))))
1088 1080
@@ -1168,7 +1160,8 @@ Used by `vc-restore-buffer-context' to later restore the context."
1168CONTEXT is that which `vc-buffer-context' returns." 1160CONTEXT is that which `vc-buffer-context' returns."
1169 (let ((point-context (nth 0 context)) 1161 (let ((point-context (nth 0 context))
1170 (mark-context (nth 1 context)) 1162 (mark-context (nth 1 context))
1171 (reparse (nth 2 context))) 1163 ;; (reparse (nth 2 context))
1164 )
1172 ;; The new compilation code does not use compilation-error-list any 1165 ;; The new compilation code does not use compilation-error-list any
1173 ;; more, so the code below is now ineffective and might as well 1166 ;; more, so the code below is now ineffective and might as well
1174 ;; be disabled. -- Stef 1167 ;; be disabled. -- Stef
@@ -1251,29 +1244,23 @@ Only files already under version control are noticed."
1251 (nreverse flattened))) 1244 (nreverse flattened)))
1252 1245
1253(defun vc-deduce-fileset (&optional allow-directory-wildcard) 1246(defun vc-deduce-fileset (&optional allow-directory-wildcard)
1254 "Deduce a set of files and a backend to apply an operation to. 1247 "Deduce a set of files and a backend to which to apply an operation.
1255 1248
1256If we're in VC-dired-mode, the fileset is the list of marked 1249If we're in VC-dired mode, the fileset is the list of marked files.
1257files. Otherwise, if we're looking at a buffer visiting a 1250Otherwise, if we're looking at a buffer visiting a version-controlled file,
1258version-controlled file. the fileset is a singleton containing 1251the fileset is a singleton containing this file.
1259the relative filename, throw an error. 1252If neither of these things is true, but ALLOW-DIRECTORY-WILDCARD is on
1260 1253and we're in a dired buffer, select the current directory.
1261If neither of these things is true, but allow-directory-wildcard is on, 1254Otherwise, throw an error."
1262select all files under version control at and below the current 1255 (cond (vc-dired-mode
1263directory. 1256 (let ((marked (dired-map-over-marks (dired-get-filename) nil)))
1264
1265Otherwise, throw an error.
1266"
1267 (cond (vc-dired-mode
1268 (let ((regexp (dired-marker-regexp))
1269 (marked (dired-map-over-marks (dired-get-filename) nil)))
1270 (unless marked 1257 (unless marked
1271 (error "No files have been selected.")) 1258 (error "No files have been selected."))
1272 ;; All members of the fileset must have the same backend 1259 ;; All members of the fileset must have the same backend
1273 (let ((firstbackend (vc-backend (car marked)))) 1260 (let ((firstbackend (vc-backend (car marked))))
1274 (mapc (lambda (f) (unless (eq (vc-backend f) firstbackend) 1261 (dolist (f (cdr marked))
1275 (error "All members of a fileset must be under the same version-control system."))) 1262 (unless (eq (vc-backend f) firstbackend)
1276 (cdr marked))) 1263 (error "All members of a fileset must be under the same version-control system."))))
1277 marked)) 1264 marked))
1278 ((vc-backend buffer-file-name) 1265 ((vc-backend buffer-file-name)
1279 (list buffer-file-name)) 1266 (list buffer-file-name))
@@ -1281,12 +1268,17 @@ Otherwise, throw an error.
1281 (progn 1268 (progn
1282 (set-buffer vc-parent-buffer) 1269 (set-buffer vc-parent-buffer)
1283 (vc-deduce-fileset))) 1270 (vc-deduce-fileset)))
1284 ;; This is guarded by an enabling arg so users won't potentially 1271 ;; This is guarded by an enabling arg so users won't potentially
1285 ;; shoot themselves in the foot by modifying a fileset they can't 1272 ;; shoot themselves in the foot by modifying a fileset they can't
1286 ;; verify by eyeball. Allow it for nondestructive commands like 1273 ;; verify by eyeball. Allow it for nondestructive commands like
1287 ;; making diffs, or possibly for destructive ones that have 1274 ;; making diffs, or possibly for destructive ones that have
1288 ;; confirmation prompts. 1275 ;; confirmation prompts.
1289 (allow-directory-wildcard 1276 ((and allow-directory-wildcard
1277 ;; I think this is a misfeature. For now, I'll leave it in, but
1278 ;; I'll disable it anywhere else than in dired buffers. --Stef
1279 (and (derived-mode-p 'dired-mode)
1280 (equal buffer-file-name nil)
1281 (equal list-buffers-directory default-directory)))
1290 (progn 1282 (progn
1291 (message "All version-controlled files below %s selected." 1283 (message "All version-controlled files below %s selected."
1292 default-directory) 1284 default-directory)
@@ -1377,7 +1369,6 @@ with the logmessage as change commentary. A writable file is retained.
1377merge in the changes into your working copy." 1369merge in the changes into your working copy."
1378 (interactive "P") 1370 (interactive "P")
1379 (let* ((files (vc-deduce-fileset)) 1371 (let* ((files (vc-deduce-fileset))
1380 (backend (vc-backend (car files)))
1381 (state (vc-state (car files))) 1372 (state (vc-state (car files)))
1382 (model (vc-checkout-model (car files))) 1373 (model (vc-checkout-model (car files)))
1383 revision) 1374 revision)
@@ -1411,7 +1402,7 @@ merge in the changes into your working copy."
1411 (or (y-or-n-p (message "Use %s on disk, keeping modified buffer? " file)) 1402 (or (y-or-n-p (message "Use %s on disk, keeping modified buffer? " file))
1412 (error "Aborted"))))))) 1403 (error "Aborted")))))))
1413 ;; Do the right thing 1404 ;; Do the right thing
1414 (cond 1405 (cond
1415 ;; Files aren't registered 1406 ;; Files aren't registered
1416 ((not state) 1407 ((not state)
1417 (mapc 'vc-register files)) 1408 (mapc 'vc-register files))
@@ -1423,16 +1414,16 @@ merge in the changes into your working copy."
1423 (setq revision (read-string "Branch, revision, or backend to move to: ")) 1414 (setq revision (read-string "Branch, revision, or backend to move to: "))
1424 (let ((vsym (intern-soft (upcase revision)))) 1415 (let ((vsym (intern-soft (upcase revision))))
1425 (if (member vsym vc-handled-backends) 1416 (if (member vsym vc-handled-backends)
1426 (mapc (lambda (file) (vc-transfer-file file vsym)) files) 1417 (dolist (file files) (vc-transfer-file file vsym))
1427 (mapc (lambda (file) 1418 (dolist (file files)
1428 (vc-checkout file (eq model 'implicit) revision)))))) 1419 (vc-checkout file (eq model 'implicit) revision)))))
1429 ((not (eq model 'implicit)) 1420 ((not (eq model 'implicit))
1430 ;; check the files out 1421 ;; check the files out
1431 (mapc (lambda (file) (vc-checkout file t)) files)) 1422 (dolist (file files) (vc-checkout file t)))
1432 (t 1423 (t
1433 ;; do nothing 1424 ;; do nothing
1434 (message "Fileset is up-to-date")))) 1425 (message "Fileset is up-to-date"))))
1435 ;; Files have local changes 1426 ;; Files have local changes
1436 ((eq state 'edited) 1427 ((eq state 'edited)
1437 (let ((ready-for-commit files)) 1428 (let ((ready-for-commit files))
1438 ;; If files are edited but read-only, give user a chance to correct 1429 ;; If files are edited but read-only, give user a chance to correct
@@ -1444,27 +1435,25 @@ merge in the changes into your working copy."
1444 (error "Aborted")) 1435 (error "Aborted"))
1445 (set-file-modes file (logior (file-modes file) 128)) 1436 (set-file-modes file (logior (file-modes file) 128))
1446 (let ((visited (get-file-buffer file))) 1437 (let ((visited (get-file-buffer file)))
1447 (if visited 1438 (if visited
1448 (save-excursion 1439 (with-current-buffer visited
1449 (set-buffer visited)
1450 (toggle-read-only -1))))))) 1440 (toggle-read-only -1)))))))
1451 ;; Allow user to revert files with no changes 1441 ;; Allow user to revert files with no changes
1452 (save-excursion 1442 (save-excursion
1453 (let ((revertlist '())) 1443 (dolist (file files)
1454 (dolist (file files) 1444 (let ((visited (get-file-buffer file)))
1455 (let ((visited (get-file-buffer file))) 1445 ;; For files with locking, if the file does not contain
1456 ;; For files with locking, if the file does not contain 1446 ;; any changes, just let go of the lock, i.e. revert.
1457 ;; any changes, just let go of the lock, i.e. revert. 1447 (if (and (not (eq model 'implicit))
1458 (if (and (not (eq model 'implicit)) 1448 (vc-workfile-unchanged-p file)
1459 (vc-workfile-unchanged-p file) 1449 ;; If buffer is modified, that means the user just
1460 ;; If buffer is modified, that means the user just 1450 ;; said no to saving it; in that case, don't revert,
1461 ;; said no to saving it; in that case, don't revert, 1451 ;; because the user might intend to save after
1462 ;; because the user might intend to save after 1452 ;; finishing the log entry and committing.
1463 ;; finishing the log entry and committing. 1453 (not (and visited (buffer-modified-p))))
1464 (not (and visited (buffer-modified-p)))) 1454 (progn
1465 (progn 1455 (vc-revert-file file)
1466 (vc-revert-file file) 1456 (delete file ready-for-commit))))))
1467 (delete file ready-for-commit)))))))
1468 ;; Remaining files need to be committed 1457 ;; Remaining files need to be committed
1469 (if (not ready-for-commit) 1458 (if (not ready-for-commit)
1470 (message "No files remain to be committed") 1459 (message "No files remain to be committed")
@@ -1478,12 +1467,12 @@ merge in the changes into your working copy."
1478 (vc-checkin ready-for-commit revision)))))))) 1467 (vc-checkin ready-for-commit revision))))))))
1479 ;; locked by somebody else (locking VCSes only) 1468 ;; locked by somebody else (locking VCSes only)
1480 ((stringp state) 1469 ((stringp state)
1481 (let ((revision 1470 (let ((revision
1482 (if verbose 1471 (if verbose
1483 (read-string "Revision to steal: ") 1472 (read-string "Revision to steal: ")
1484 (vc-working-revision file)))) 1473 (vc-working-revision file))))
1485 (mapc (lambda (file) (vc-steal-lock file revision state) files)))) 1474 (dolist (file files) (vc-steal-lock file revision state))))
1486 ;; needs-patch 1475 ;; needs-patch
1487 ((eq state 'needs-patch) 1476 ((eq state 'needs-patch)
1488 (dolist (file files) 1477 (dolist (file files)
1489 (if (yes-or-no-p (format 1478 (if (yes-or-no-p (format
@@ -1504,12 +1493,10 @@ merge in the changes into your working copy."
1504 ;; unlocked-changes 1493 ;; unlocked-changes
1505 ((eq state 'unlocked-changes) 1494 ((eq state 'unlocked-changes)
1506 (dolist (file files) 1495 (dolist (file files)
1507 (if (not (equal buffer-file-name file)) 1496 (if (not (equal buffer-file-name file))
1508 (find-file-other-window file)) 1497 (find-file-other-window file))
1509 (if (save-window-excursion 1498 (if (save-window-excursion
1510 (vc-diff-internal 1499 (vc-diff-internal nil (list file) (vc-working-revision file) nil)
1511 (vc-backend file) nil (list file)
1512 (vc-working-revision file) nil)
1513 (goto-char (point-min)) 1500 (goto-char (point-min))
1514 (let ((inhibit-read-only t)) 1501 (let ((inhibit-read-only t))
1515 (insert 1502 (insert
@@ -1644,9 +1631,9 @@ entered COMMENT. If COMMENT is t, also do action immediately with an
1644empty comment. Remember the file's buffer in `vc-parent-buffer' 1631empty comment. Remember the file's buffer in `vc-parent-buffer'
1645\(current one if no file). AFTER-HOOK specifies the local value 1632\(current one if no file). AFTER-HOOK specifies the local value
1646for vc-log-operation-hook." 1633for vc-log-operation-hook."
1647 (let ((parent 1634 (let ((parent
1648 (if (and files (equal (length files) 1)) 1635 (if (and files (equal (length files) 1))
1649 (get-file-buffer (car files)) 1636 (get-file-buffer (car files))
1650 (current-buffer)))) 1637 (current-buffer))))
1651 (if vc-before-checkin-hook 1638 (if vc-before-checkin-hook
1652 (if files 1639 (if files
@@ -1774,7 +1761,7 @@ the buffer contents as a comment."
1774 ;; Check and record the comment, if any. 1761 ;; Check and record the comment, if any.
1775 (unless nocomment 1762 (unless nocomment
1776 ;; Comment too long? 1763 ;; Comment too long?
1777 (vc-call-backend (or (and vc-log-fileset (vc-backend (car vc-log-fileset))) 1764 (vc-call-backend (or (if vc-log-fileset (vc-backend vc-log-fileset))
1778 (vc-responsible-backend default-directory)) 1765 (vc-responsible-backend default-directory))
1779 'logentry-check) 1766 'logentry-check)
1780 (run-hooks 'vc-logentry-check-hook)) 1767 (run-hooks 'vc-logentry-check-hook))
@@ -1810,8 +1797,8 @@ the buffer contents as a comment."
1810 (pop-to-buffer tmp-vc-parent-buffer)))) 1797 (pop-to-buffer tmp-vc-parent-buffer))))
1811 ;; Now make sure we see the expanded headers 1798 ;; Now make sure we see the expanded headers
1812 (if log-fileset 1799 (if log-fileset
1813 (mapc 1800 (mapc
1814 (lambda (file) (vc-resynch-buffer file vc-keep-workfiles t)) 1801 (lambda (file) (vc-resynch-buffer file vc-keep-workfiles t))
1815 log-fileset)) 1802 log-fileset))
1816 (if vc-dired-mode 1803 (if vc-dired-mode
1817 (dired-move-to-filename)) 1804 (dired-move-to-filename))
@@ -1819,24 +1806,24 @@ the buffer contents as a comment."
1819 1806
1820;;; Additional entry points for examining version histories 1807;;; Additional entry points for examining version histories
1821 1808
1822(defun vc-default-diff-tree (backend dir rev1 rev2) 1809;; (defun vc-default-diff-tree (backend dir rev1 rev2)
1823 "List differences for all registered files at and below DIR. 1810;; "List differences for all registered files at and below DIR.
1824The meaning of REV1 and REV2 is the same as for `vc-revision-diff'." 1811;; The meaning of REV1 and REV2 is the same as for `vc-revision-diff'."
1825 ;; This implementation does an explicit tree walk, and calls 1812;; ;; This implementation does an explicit tree walk, and calls
1826 ;; vc-BACKEND-diff directly for each file. An optimization 1813;; ;; vc-BACKEND-diff directly for each file. An optimization
1827 ;; would be to use `vc-diff-internal', so that diffs can be local, 1814;; ;; would be to use `vc-diff-internal', so that diffs can be local,
1828 ;; and to call it only for files that are actually changed. 1815;; ;; and to call it only for files that are actually changed.
1829 ;; However, this is expensive for some backends, and so it is left 1816;; ;; However, this is expensive for some backends, and so it is left
1830 ;; to backend-specific implementations. 1817;; ;; to backend-specific implementations.
1831 (setq default-directory dir) 1818;; (setq default-directory dir)
1832 (vc-file-tree-walk 1819;; (vc-file-tree-walk
1833 default-directory 1820;; default-directory
1834 (lambda (f) 1821;; (lambda (f)
1835 (vc-exec-after 1822;; (vc-exec-after
1836 `(let ((coding-system-for-read (vc-coding-system-for-diff ',f))) 1823;; `(let ((coding-system-for-read (vc-coding-system-for-diff ',f)))
1837 (message "Looking at %s" ',f) 1824;; (message "Looking at %s" ',f)
1838 (vc-call-backend ',(vc-backend f) 1825;; (vc-call-backend ',(vc-backend f)
1839 'diff (list ',f) ',rev1 ',rev2)))))) 1826;; 'diff (list ',f) ',rev1 ',rev2))))))
1840 1827
1841(defun vc-coding-system-for-diff (file) 1828(defun vc-coding-system-for-diff (file)
1842 "Return the coding system for reading diff output for FILE." 1829 "Return the coding system for reading diff output for FILE."
@@ -1885,7 +1872,10 @@ The meaning of REV1 and REV2 is the same as for `vc-revision-diff'."
1885 (goto-char (point-min)) 1872 (goto-char (point-min))
1886 (shrink-window-if-larger-than-buffer)) 1873 (shrink-window-if-larger-than-buffer))
1887 1874
1888(defun vc-diff-internal (backend async files rev1 rev2 &optional verbose) 1875(defvar vc-diff-added-files nil
1876 "If non-nil, diff added files by comparing them to /dev/null.")
1877
1878(defun vc-diff-internal (async files rev1 rev2 &optional verbose)
1889 "Report diffs between two revisions of a fileset. 1879 "Report diffs between two revisions of a fileset.
1890Diff output goes to the *vc-diff* buffer. The function 1880Diff output goes to the *vc-diff* buffer. The function
1891returns t if the buffer had changes, nil otherwise." 1881returns t if the buffer had changes, nil otherwise."
@@ -1895,30 +1885,38 @@ returns t if the buffer had changes, nil otherwise."
1895 ;; Set coding system based on the first file. It's a kluge, 1885 ;; Set coding system based on the first file. It's a kluge,
1896 ;; but the only way to set it for each file included would 1886 ;; but the only way to set it for each file included would
1897 ;; be to call the back end separately for each file. 1887 ;; be to call the back end separately for each file.
1898 (coding-system-for-read 1888 (coding-system-for-read
1899 (if files (vc-coding-system-for-diff (car files)) 'undecided))) 1889 (if files (vc-coding-system-for-diff (car files)) 'undecided)))
1900 (vc-setup-buffer "*vc-diff*") 1890 (vc-setup-buffer "*vc-diff*")
1901 (message "Finding changes in %s..." filenames) 1891 (message "Finding changes in %s..." filenames)
1902 ;; Many backends don't handle well the case of a file that has been 1892 ;; Many backends don't handle well the case of a file that has been
1903 ;; added but not yet committed to the repo (notably CVS and Subversion). 1893 ;; added but not yet committed to the repo (notably CVS and Subversion).
1904 ;; Do that work here so the backends don't have to futz with it. 1894 ;; Do that work here so the backends don't have to futz with it. --ESR
1905 (let ((filtered '())) 1895 ;;
1906 (dolist (file files) 1896 ;; Actually most backends (including CVS) have options to control the
1907 (cond ((and (not (file-directory-p file)) (string= (vc-working-revision file) "0")) 1897 ;; behavior since which one is better depends on the user and on the
1908 (progn 1898 ;; situation). Worse yet: this code does not handle the case where
1909 ;; This file is added but not yet committed; 1899 ;; `file' is a directory which contains added files.
1910 ;; there is no master file to diff against. 1900 ;; I made it conditional on vc-diff-added-files but it should probably
1911 (if (or rev1 rev2) 1901 ;; just be removed (or copied/moved to specific backends). --Stef.
1912 (error "No revisions of %s exist" file) 1902 (when vc-diff-added-files
1913 ;; We regard this as "changed". 1903 (let ((filtered '()))
1914 ;; Diff it against /dev/null. 1904 (dolist (file files)
1915 (apply 'vc-do-command "*vc-diff*" 1905 (if (or (file-directory-p file)
1916 1 "diff" file 1906 (not (string= (vc-working-revision file) "0")))
1917 (append (vc-switches nil 'diff) '("/dev/null")))))) 1907 (push file filtered)
1918 (t 1908 ;; This file is added but not yet committed;
1919 (add-to-list 'filtered file t)))) 1909 ;; there is no master file to diff against.
1920 (let ((vc-disable-async-diff (not async))) 1910 (if (or rev1 rev2)
1921 (vc-call-backend backend 'diff filtered rev1 rev2 "*vc-diff*"))) 1911 (error "No revisions of %s exist" file)
1912 ;; We regard this as "changed".
1913 ;; Diff it against /dev/null.
1914 (apply 'vc-do-command "*vc-diff*"
1915 1 "diff" file
1916 (append (vc-switches nil 'diff) '("/dev/null"))))))
1917 (setq files (nreverse filtered))))
1918 (let ((vc-disable-async-diff (not async)))
1919 (vc-call diff files rev1 rev2 "*vc-diff*"))
1922 (set-buffer "*vc-diff*") 1920 (set-buffer "*vc-diff*")
1923 (if (and (zerop (buffer-size)) 1921 (if (and (zerop (buffer-size))
1924 (not (get-buffer-process (current-buffer)))) 1922 (not (get-buffer-process (current-buffer))))
@@ -1936,14 +1934,13 @@ returns t if the buffer had changes, nil otherwise."
1936 t))) 1934 t)))
1937 1935
1938;;;###autoload 1936;;;###autoload
1939(defun vc-history-diff (backend files rev1 rev2) 1937(defun vc-version-diff (files rev1 rev2)
1940 "Report diffs between revisions of the fileset in the repository history." 1938 "Report diffs between revisions of the fileset in the repository history."
1941 (interactive 1939 (interactive
1942 (let* ((files (vc-deduce-fileset t)) 1940 (let* ((files (vc-deduce-fileset t))
1943 (first (car files)) 1941 (first (car files))
1944 (backend (vc-backend first))
1945 (completion-table 1942 (completion-table
1946 (vc-call-backend backend 'revision-completion-table first)) 1943 (vc-call revision-completion-table files))
1947 (rev1-default nil) 1944 (rev1-default nil)
1948 (rev2-default nil)) 1945 (rev2-default nil))
1949 (cond 1946 (cond
@@ -1980,47 +1977,37 @@ returns t if the buffer had changes, nil otherwise."
1980 (read-string rev2-prompt nil nil rev2-default)))) 1977 (read-string rev2-prompt nil nil rev2-default))))
1981 (if (string= rev1 "") (setq rev1 nil)) 1978 (if (string= rev1 "") (setq rev1 nil))
1982 (if (string= rev2 "") (setq rev2 nil)) 1979 (if (string= rev2 "") (setq rev2 nil))
1983 (list backend files rev1 rev2)))) 1980 (list files rev1 rev2))))
1984 (if (and (not rev1) rev2) 1981 (if (and (not rev1) rev2)
1985 (error "Not a valid revision range.")) 1982 (error "Not a valid revision range."))
1986 (vc-diff-internal backend t files rev1 rev2 (interactive-p))) 1983 (vc-diff-internal t files rev1 rev2 (interactive-p)))
1987 1984
1988(defun vc-contains-version-controlled-file (dir) 1985;; (defun vc-contains-version-controlled-file (dir)
1989 "Return t if DIR contains a version-controlled file, nil otherwise." 1986;; "Return t if DIR contains a version-controlled file, nil otherwise."
1990 (catch 'found 1987;; (catch 'found
1991 (mapc (lambda (f) (and (not (file-directory-p f)) (vc-backend f) (throw 'found 't))) (directory-files dir)) 1988;; (mapc (lambda (f) (and (not (file-directory-p f)) (vc-backend f) (throw 'found 't))) (directory-files dir))
1992 nil)) 1989;; nil))
1993 1990
1994;;;###autoload 1991;;;###autoload
1995(defun vc-diff (historic) 1992(defun vc-diff (historic &optional not-urgent)
1996 "Display diffs between file revisions. 1993 "Display diffs between file revisions.
1997Normally this compares the currently selected fileset with their 1994Normally this compares the currently selected fileset with their
1998working revisions. With a prefix argument HISTORIC, it reads two revision 1995working revisions. With a prefix argument HISTORIC, it reads two revision
1999designators specifying which revisions to compare. 1996designators specifying which revisions to compare.
2000 1997
2001If no current fileset is available (that is, we are not in 1998If no current fileset is available (that is, we are not in
2002VC-Dired mode and the visited file of the current buffer is not 1999VC-Dired mode and the visited file of the current buffer is not
2003under version control) behave specially; if there are 2000under version control) and we're in a Dired buffer, use
2004version-controlled files in the current directory, treat all 2001the current directory.
2005version-controlled files recursively beneath the current 2002The optional argument NOT-URGENT non-nil means it is ok to say no to
2006directory as the selected fileset. 2003saving the buffer."
2007" 2004 (interactive (list current-prefix-arg t))
2005 (if historic
2006 (call-interactively 'vc-version-diff)
2007 (let* ((files (vc-deduce-fileset t)))
2008 (if buffer-file-name (vc-buffer-sync not-urgent))
2009 (vc-diff-internal t files nil nil (interactive-p)))))
2008 2010
2009 (interactive "P")
2010 (cond
2011 ;;((not (vc-contains-version-controlled-file default-directory))
2012 ;;(error "No version-controlled files directly beneath default directory"))
2013 (historic
2014 (call-interactively 'vc-history-diff))
2015 (t
2016 (let* ((files (vc-deduce-fileset t))
2017 (first (car files))
2018 (backend
2019 (cond ((file-directory-p first)
2020 (vc-responsible-backend first))
2021 (t
2022 (vc-backend first)))))
2023 (vc-diff-internal backend t files nil nil (interactive-p))))))
2024 2011
2025;;;###autoload 2012;;;###autoload
2026(defun vc-revision-other-window (rev) 2013(defun vc-revision-other-window (rev)
@@ -2252,7 +2239,7 @@ There is a special command, `*l', to mark all files currently locked."
2252 (setq mode-name (concat mode-name backend-name)) 2239 (setq mode-name (concat mode-name backend-name))
2253 ;; Add menu after `vc-dired-mode-map' has `dired-mode-map' as the parent. 2240 ;; Add menu after `vc-dired-mode-map' has `dired-mode-map' as the parent.
2254 (let ((vc-dire-menu-map (copy-keymap vc-menu-map))) 2241 (let ((vc-dire-menu-map (copy-keymap vc-menu-map)))
2255 (define-key-after (lookup-key vc-dired-mode-map [menu-bar]) [vc] 2242 (define-key-after (lookup-key vc-dired-mode-map [menu-bar]) [vc]
2256 (cons backend-name vc-dire-menu-map) 'subdir))) 2243 (cons backend-name vc-dire-menu-map) 'subdir)))
2257 (setq vc-dired-mode t)) 2244 (setq vc-dired-mode t))
2258 2245
@@ -2377,12 +2364,11 @@ Called by dired after any portion of a vc-dired buffer has been read in."
2377 (let (result) 2364 (let (result)
2378 ;; Check whether dired is loaded. 2365 ;; Check whether dired is loaded.
2379 (when (fboundp 'dired-buffers-for-dir) 2366 (when (fboundp 'dired-buffers-for-dir)
2380 (mapc (lambda (buffer) 2367 (dolist (buffer (dired-buffers-for-dir dir))
2381 (with-current-buffer buffer 2368 (with-current-buffer buffer
2382 (if vc-dired-mode 2369 (if vc-dired-mode
2383 (setq result (append result (list buffer)))))) 2370 (push buffer result)))))
2384 (dired-buffers-for-dir dir))) 2371 (nreverse result)))
2385 result))
2386 2372
2387(defun vc-dired-resynch-file (file) 2373(defun vc-dired-resynch-file (file)
2388 "Update the entries for FILE in any VC Dired buffers that list it." 2374 "Update the entries for FILE in any VC Dired buffers that list it."
@@ -2484,7 +2470,7 @@ allowed and simply skipped)."
2484If WORKING-REVISION is non-nil, leave the point at that revision." 2470If WORKING-REVISION is non-nil, leave the point at that revision."
2485 (interactive) 2471 (interactive)
2486 (let* ((files (vc-deduce-fileset)) 2472 (let* ((files (vc-deduce-fileset))
2487 (backend (vc-backend (car files))) 2473 (backend (vc-backend files))
2488 (working-revision (or working-revision (vc-working-revision (car files))))) 2474 (working-revision (or working-revision (vc-working-revision (car files)))))
2489 ;; Don't switch to the output buffer before running the command, 2475 ;; Don't switch to the output buffer before running the command,
2490 ;; so that any buffer-local settings in the vc-controlled 2476 ;; so that any buffer-local settings in the vc-controlled
@@ -2513,8 +2499,7 @@ If WORKING-REVISION is non-nil, leave the point at that revision."
2513This asks for confirmation if the buffer contents are not identical 2499This asks for confirmation if the buffer contents are not identical
2514to the working revision (except for keyword expansion)." 2500to the working revision (except for keyword expansion)."
2515 (interactive) 2501 (interactive)
2516 (let* ((files (vc-deduce-fileset)) 2502 (let* ((files (vc-deduce-fileset)))
2517 (backend (vc-backend (car files))))
2518 ;; If any of the files is visited by the current buffer, make 2503 ;; If any of the files is visited by the current buffer, make
2519 ;; sure buffer is saved. If the user says `no', abort since 2504 ;; sure buffer is saved. If the user says `no', abort since
2520 ;; we cannot show the changes and ask for confirmation to 2505 ;; we cannot show the changes and ask for confirmation to
@@ -2522,13 +2507,13 @@ to the working revision (except for keyword expansion)."
2522 (if (or (not files) (memq (buffer-file-name) files)) 2507 (if (or (not files) (memq (buffer-file-name) files))
2523 (vc-buffer-sync nil)) 2508 (vc-buffer-sync nil))
2524 (dolist (file files) 2509 (dolist (file files)
2525 (let (buf (get-file-buffer file)) 2510 (let ((buf (get-file-buffer file)))
2526 (if (and buf (buffer-modified-p buf)) 2511 (if (and buf (buffer-modified-p buf))
2527 (error "Please kill or save all modified buffers before reverting."))) 2512 (error "Please kill or save all modified buffers before reverting.")))
2528 (if (vc-up-to-date-p file) 2513 (if (vc-up-to-date-p file)
2529 (unless (yes-or-no-p (format "%s seems up-to-date. Revert anyway? " file)) 2514 (unless (yes-or-no-p (format "%s seems up-to-date. Revert anyway? " file))
2530 (error "Revert canceled")))) 2515 (error "Revert canceled"))))
2531 (if (vc-diff-internal backend vc-allow-async-revert files nil nil) 2516 (if (vc-diff-internal vc-allow-async-revert files nil nil)
2532 (progn 2517 (progn
2533 (unless (yes-or-no-p (format "Discard changes in %s? " (vc-delistify files))) 2518 (unless (yes-or-no-p (format "Discard changes in %s? " (vc-delistify files)))
2534 (error "Revert canceled")) 2519 (error "Revert canceled"))
@@ -2547,7 +2532,7 @@ This may be either a file-level or a repository-level operation,
2547depending on the underlying version-control system." 2532depending on the underlying version-control system."
2548 (interactive) 2533 (interactive)
2549 (let* ((files (vc-deduce-fileset)) 2534 (let* ((files (vc-deduce-fileset))
2550 (backend (vc-backend (car files))) 2535 (backend (vc-backend files))
2551 (granularity (vc-call-backend backend 'revision-granularity))) 2536 (granularity (vc-call-backend backend 'revision-granularity)))
2552 (unless (vc-find-backend-function backend 'rollback) 2537 (unless (vc-find-backend-function backend 'rollback)
2553 (error "Rollback is not supported in %s" backend)) 2538 (error "Rollback is not supported in %s" backend))
@@ -2572,8 +2557,8 @@ depending on the underlying version-control system."
2572 (message "Finding changes...") 2557 (message "Finding changes...")
2573 (let* ((tip (vc-working-revision (car files))) 2558 (let* ((tip (vc-working-revision (car files)))
2574 (previous (vc-call previous-revision (car files) tip))) 2559 (previous (vc-call previous-revision (car files) tip)))
2575 (vc-diff-internal backend nil files previous tip)) 2560 (vc-diff-internal nil files previous tip))
2576 ;; Display changes 2561 ;; Display changes
2577 (unless (yes-or-no-p "Discard these revisions? ") 2562 (unless (yes-or-no-p "Discard these revisions? ")
2578 (error "Rollback canceled")) 2563 (error "Rollback canceled"))
2579 (delete-windows-on "*vc-diff*") 2564 (delete-windows-on "*vc-diff*")
@@ -2586,7 +2571,7 @@ depending on the underlying version-control system."
2586 `((vc-state . ,'up-to-date) 2571 `((vc-state . ,'up-to-date)
2587 (vc-checkout-time . , (nth 5 (file-attributes file))) 2572 (vc-checkout-time . , (nth 5 (file-attributes file)))
2588 (vc-working-revision . nil))) 2573 (vc-working-revision . nil)))
2589 (mapc (lambda (f) (vc-resynch-buffer f t t)) files) 2574 (dolist (f files) (vc-resynch-buffer f t t))
2590 (message "Rolling back %s...done" (vc-delistify files)))) 2575 (message "Rolling back %s...done" (vc-delistify files))))
2591 2576
2592;;;###autoload 2577;;;###autoload
@@ -2595,9 +2580,9 @@ depending on the underlying version-control system."
2595;;;###autoload 2580;;;###autoload
2596(defun vc-update () 2581(defun vc-update ()
2597 "Update the current fileset's files to their tip revisions. 2582 "Update the current fileset's files to their tip revisions.
2598For each one that contains no changes, and is not locked, then this simply 2583For each one that contains no changes, and is not locked, then this simply
2599replaces the work file with the latest revision on its branch. If the file 2584replaces the work file with the latest revision on its branch. If the file
2600contains changes, and the backend supports merging news, then any recent 2585contains changes, and the backend supports merging news, then any recent
2601changes from the current branch are merged into the working file." 2586changes from the current branch are merged into the working file."
2602 (interactive) 2587 (interactive)
2603 (dolist (file (vc-deduce-fileset)) 2588 (dolist (file (vc-deduce-fileset))
@@ -2623,7 +2608,7 @@ changes from the current branch are merged into the working file."
2623(defun vc-version-backup-file (file &optional rev) 2608(defun vc-version-backup-file (file &optional rev)
2624 "Return name of backup file for revision REV of FILE. 2609 "Return name of backup file for revision REV of FILE.
2625If version backups should be used for FILE, and there exists 2610If version backups should be used for FILE, and there exists
2626such a backup for REV or the working revision of file, return 2611such a backup for REV or the working revision of file, return
2627its name; otherwise return nil." 2612its name; otherwise return nil."
2628 (when (vc-call make-version-backups-p file) 2613 (when (vc-call make-version-backups-p file)
2629 (let ((backup-file (vc-version-backup-file-name file rev))) 2614 (let ((backup-file (vc-version-backup-file-name file rev)))
@@ -3048,10 +3033,6 @@ to provide the `find-revision' operation instead."
3048 (vc-call-backend backend 'wash-log) 3033 (vc-call-backend backend 'wash-log)
3049 (buffer-string)))) 3034 (buffer-string))))
3050 3035
3051(defun vc-default-unregister (backend file)
3052 "Default implementation of `vc-unregister', signals an error."
3053 (error "Unregistering files is not supported for %s" backend))
3054
3055(defun vc-default-receive-file (backend file rev) 3036(defun vc-default-receive-file (backend file rev)
3056 "Let BACKEND receive FILE from another version control system." 3037 "Let BACKEND receive FILE from another version control system."
3057 (vc-call-backend backend 'register file rev "")) 3038 (vc-call-backend backend 'register file rev ""))
@@ -3283,9 +3264,9 @@ age, and everything that is older than that is shown in blue.
3283Customization variables: 3264Customization variables:
3284 3265
3285`vc-annotate-menu-elements' customizes the menu elements of the 3266`vc-annotate-menu-elements' customizes the menu elements of the
3286mode-specific menu. `vc-annotate-color-map' and 3267mode-specific menu. `vc-annotate-color-map' and
3287`vc-annotate-very-old-color' defines the mapping of time to 3268`vc-annotate-very-old-color' define the mapping of time to colors.
3288colors. `vc-annotate-background' specifies the background color." 3269`vc-annotate-background' specifies the background color."
3289 (interactive 3270 (interactive
3290 (save-current-buffer 3271 (save-current-buffer
3291 (vc-ensure-vc-buffer) 3272 (vc-ensure-vc-buffer)
@@ -3422,11 +3403,8 @@ revisions after."
3422 (if (not prev-rev) 3403 (if (not prev-rev)
3423 (message "Cannot diff from any revision prior to %s" rev-at-line) 3404 (message "Cannot diff from any revision prior to %s" rev-at-line)
3424 (save-window-excursion 3405 (save-window-excursion
3425 (vc-diff-internal 3406 (vc-diff-internal nil (list vc-annotate-parent-file)
3426 (vc-backend vc-annotate-parent-file) 3407 prev-rev rev-at-line))
3427 nil
3428 (list vc-annotate-parent-file)
3429 prev-rev rev-at-line))
3430 (switch-to-buffer "*vc-diff*")))))) 3408 (switch-to-buffer "*vc-diff*"))))))
3431 3409
3432(defun vc-annotate-warp-revision (revspec) 3410(defun vc-annotate-warp-revision (revspec)
diff --git a/src/ChangeLog b/src/ChangeLog
index c50b6286407..dda5d8e396d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
12007-10-19 Chong Yidong <cyd@stupidchicken.com>
2
3 * Makefile.in [HAVE_LIBRESOLV]: Add -lresolv to linker flags.
4
52007-10-19 Richard Stallman <rms@gnu.org>
6
7 * doc.c (Fdocumentation): Check for and handle an advised function.
8
92007-10-19 Juanma Barranquero <lekktu@gmail.com>
10
11 * process.c (Fset_process_filter): Doc fix.
12
12007-10-18 Stefan Monnier <monnier@iro.umontreal.ca> 132007-10-18 Stefan Monnier <monnier@iro.umontreal.ca>
2 14
3 * keyboard.c (read_key_sequence): Undo a change introduced by multi-tty 15 * keyboard.c (read_key_sequence): Undo a change introduced by multi-tty
diff --git a/src/Makefile.in b/src/Makefile.in
index 6fce595a9ec..1ff7ce30339 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -460,6 +460,13 @@ LIBX= $(LIBXMENU) LD_SWITCH_X_SITE -lX10 LIBX10_MACHINE LIBX10_SYSTEM
460#define LIBGPM 460#define LIBGPM
461#endif /* not HAVE_GPM */ 461#endif /* not HAVE_GPM */
462 462
463#if HAVE_LIBRESOLV
464#ifndef LIBRESOLV
465#define LIBRESOLV -lresolv
466#endif /* not defined LIBRESOLV */
467#else /* not HAVE_LIBRESOLV */
468#define LIBRESOLV
469#endif /* not HAVE_LIBRESOLV */
463 470
464LIBSOUND= @LIBSOUND@ 471LIBSOUND= @LIBSOUND@
465CFLAGS_SOUND= @CFLAGS_SOUND@ 472CFLAGS_SOUND= @CFLAGS_SOUND@
@@ -943,7 +950,7 @@ SOME_MACHINE_LISP = ${dotdot}/lisp/mouse.elc \
943 duplicated symbols. If the standard libraries were compiled 950 duplicated symbols. If the standard libraries were compiled
944 with GCC, we might need gnulib again after them. */ 951 with GCC, we might need gnulib again after them. */
945LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) LIBGPM \ 952LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) LIBGPM \
946 LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \ 953 LIBRESOLV LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
947 LIBS_DEBUG $(GETLOADAVG_LIBS) \ 954 LIBS_DEBUG $(GETLOADAVG_LIBS) \
948 @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ @LIBOTF_LIBS@ \ 955 @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ @LIBOTF_LIBS@ \
949 $(GNULIB_VAR) LIB_MATH LIB_STANDARD $(GNULIB_VAR) 956 $(GNULIB_VAR) LIB_MATH LIB_STANDARD $(GNULIB_VAR)
diff --git a/src/doc.c b/src/doc.c
index f491661a616..c4af523baac 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -434,6 +434,18 @@ string is passed through `substitute-command-keys'. */)
434 doc = tem; 434 doc = tem;
435 else 435 else
436 return Qnil; 436 return Qnil;
437
438 /* Check for an advised function. Its doc string
439 has an `ad-advice-info' text property. */
440 if (STRINGP (doc))
441 {
442 Lisp_Object innerfunc;
443 innerfunc = Fget_text_property (make_number (0),
444 intern ("ad-advice-info"),
445 doc);
446 if (! NILP (innerfunc))
447 doc = call1 (intern ("ad-make-advised-docstring"), innerfunc);
448 }
437 } 449 }
438 else if (EQ (funcar, Qmacro)) 450 else if (EQ (funcar, Qmacro))
439 return Fdocumentation (Fcdr (fun), raw); 451 return Fdocumentation (Fcdr (fun), raw);
diff --git a/src/process.c b/src/process.c
index 6bcaef63303..fb10bf2cc8b 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1006,7 +1006,7 @@ DEFUN ("process-mark", Fprocess_mark, Sprocess_mark,
1006DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter, 1006DEFUN ("set-process-filter", Fset_process_filter, Sset_process_filter,
1007 2, 2, 0, 1007 2, 2, 0,
1008 doc: /* Give PROCESS the filter function FILTER; nil means no filter. 1008 doc: /* Give PROCESS the filter function FILTER; nil means no filter.
1009t means stop accepting output from the process. 1009A value of t means stop accepting output from the process.
1010 1010
1011When a process has a filter, its buffer is not used for output. 1011When a process has a filter, its buffer is not used for output.
1012Instead, each time it does output, the entire string of output is 1012Instead, each time it does output, the entire string of output is