aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/ChangeLog6
-rw-r--r--etc/MH-E-NEWS13
-rw-r--r--etc/NEWS55
-rw-r--r--lib-src/ChangeLog20
-rw-r--r--lib-src/etags.c14
-rw-r--r--lib-src/fakemail.c2
-rw-r--r--lib-src/movemail.c2
-rw-r--r--lib-src/sorted-doc.c2
-rw-r--r--lib-src/yow.c1
-rw-r--r--lisp/ChangeLog181
-rw-r--r--lisp/abbrev.el2
-rw-r--r--lisp/allout.el2
-rw-r--r--lisp/bindings.el4
-rw-r--r--lisp/calc/calc-embed.el17
-rw-r--r--lisp/calendar/cal-tex.el20
-rw-r--r--lisp/cvs-status.el2
-rw-r--r--lisp/diff-mode.el170
-rw-r--r--lisp/emacs-lisp/warnings.el3
-rw-r--r--lisp/files.el26
-rw-r--r--lisp/gnus/ChangeLog33
-rw-r--r--lisp/gnus/mm-uu.el17
-rw-r--r--lisp/gnus/mml1991.el25
-rw-r--r--lisp/gnus/mml2015.el2
-rw-r--r--lisp/help-fns.el6
-rw-r--r--lisp/help-mode.el5
-rw-r--r--lisp/log-edit.el2
-rw-r--r--lisp/log-view.el2
-rw-r--r--lisp/mh-e/ChangeLog6
-rw-r--r--lisp/mh-e/mh-e.el4
-rw-r--r--lisp/msb.el5
-rw-r--r--lisp/net/tramp.el166
-rw-r--r--lisp/pcvs-defs.el2
-rw-r--r--lisp/pcvs-info.el2
-rw-r--r--lisp/pcvs-parse.el2
-rw-r--r--lisp/pcvs-util.el2
-rw-r--r--lisp/progmodes/gdb-ui.el13
-rw-r--r--lisp/progmodes/grep.el471
-rw-r--r--lisp/progmodes/gud.el23
-rw-r--r--lisp/replace.el1
-rw-r--r--lisp/reveal.el2
-rw-r--r--lisp/simple.el4
-rw-r--r--lisp/smerge-mode.el2
-rw-r--r--lisp/startup.el2
-rw-r--r--lisp/subr.el42
-rw-r--r--lisp/term/mac-win.el5
-rw-r--r--lisp/textmodes/fill.el2
-rw-r--r--lisp/textmodes/paragraphs.el26
-rw-r--r--lisp/textmodes/reftex-vars.el2
-rw-r--r--lisp/tool-bar.el27
-rw-r--r--lispref/ChangeLog36
-rw-r--r--lispref/intro.texi13
-rw-r--r--lispref/modes.texi171
-rw-r--r--lispref/objects.texi6
-rw-r--r--lispref/variables.texi14
-rw-r--r--man/ChangeLog48
-rw-r--r--man/building.texi38
-rw-r--r--man/calendar.texi4
-rw-r--r--man/custom.texi3
-rw-r--r--man/emacs.texi137
-rw-r--r--man/macos.texi70
-rw-r--r--man/misc.texi83
-rw-r--r--src/ChangeLog67
-rw-r--r--src/dispnew.c2
-rw-r--r--src/keymap.c7
-rw-r--r--src/mac.c50
-rw-r--r--src/macfns.c104
-rw-r--r--src/macgui.h38
-rw-r--r--src/macterm.c119
-rw-r--r--src/macterm.h8
-rw-r--r--src/syntax.c7
-rw-r--r--src/unexmacosx.c3
-rw-r--r--src/xdisp.c11
-rw-r--r--src/xmenu.c1
73 files changed, 1713 insertions, 772 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 4e5030d4984..c80b23c0489 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,9 @@
12006-04-28 Bill Wohler <wohler@newt.com>
2
3 Release MH-E version 7.95.
4
5 * NEWS, MH-E-NEWS: Update for MH-E release 7.95.
6
12006-04-21 Bill Wohler <wohler@newt.com> 72006-04-21 Bill Wohler <wohler@newt.com>
2 8
3 Release MH-E version 7.94. 9 Release MH-E version 7.94.
diff --git a/etc/MH-E-NEWS b/etc/MH-E-NEWS
index 4b3074686b1..db9de4b9043 100644
--- a/etc/MH-E-NEWS
+++ b/etc/MH-E-NEWS
@@ -6,6 +6,19 @@ Copying and distribution of this file, with or without modification,
6are permitted in any medium without royalty provided the copyright 6are permitted in any medium without royalty provided the copyright
7notice and this notice are preserved. 7notice and this notice are preserved.
8 8
9* Changes in MH-E 7.95
10
11Version 7.95, the second 8.0 release candidate, fixes a single bug.
12It would be good to check this version ASAP since the Emacs pretest is
13coming in days: if no showstopper problems are found in this version
14it will be promoted to 8.0 before the pretest. Thanks for your help!
15
16** Bug Fixes in MH-E 7.95
17
18*** Folder Completion Fails in fcc: Field
19
20This has been fixed (closes SF #1476270).
21
9* Changes in MH-E 7.94 22* Changes in MH-E 7.94
10 23
11Version 7.94, the first 8.0 release candidate, fixes a bunch of bugs, 24Version 7.94, the first 8.0 release candidate, fixes a bunch of bugs,
diff --git a/etc/NEWS b/etc/NEWS
index 3c02fe82a85..378f715b286 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1404,20 +1404,35 @@ changes.
1404There's a new separate package grep.el, with its own submenu and 1404There's a new separate package grep.el, with its own submenu and
1405customization group. 1405customization group.
1406 1406
1407+++
1408*** `grep-find' is now also available under the name `find-grep' where
1409people knowing `find-grep-dired' would probably expect it.
1410
1411+++
1412*** New commands `lgrep' (local grep) and `rgrep' (recursive grep) are
1413more user-friendly versions of `grep' and `grep-find', which prompt
1414separately for the regular expression to match, the files to search,
1415and the base directory for the search (rgrep only). Case sensitivitivy
1416of the search is controlled by the current value of `case-fold-search'.
1417
1418These commands build the shell commands based on the new variables
1419`grep-template' (lgrep) and `grep-find-template' (rgrep).
1420
1421The files to search can use aliases defined in `grep-files-aliases'.
1422
1423Subdirectories listed in `grep-find-ignored-directories' such as those
1424typically used by various version control systems, like CVS and arch,
1425are automatically skipped by `rgrep'.
1426
1407--- 1427---
1408*** M-x grep provides highlighting support. 1428*** The grep commands provide highlighting support.
1409 1429
1410Hits are fontified in green, and hits in binary files in orange. Grep buffers 1430Hits are fontified in green, and hits in binary files in orange. Grep buffers
1411can be saved and automatically revisited. 1431can be saved and automatically revisited.
1412 1432
1413+++
1414*** `grep-find' is now also available under the name `find-grep' where
1415people knowing `find-grep-dired' would probably expect it.
1416
1417--- 1433---
1418*** The new variables `grep-window-height', `grep-auto-highlight', and 1434*** The new variables `grep-window-height' and `grep-scroll-output' override
1419`grep-scroll-output' override the corresponding compilation mode 1435the corresponding compilation mode settings, for grep commands only.
1420settings, for grep commands only.
1421 1436
1422+++ 1437+++
1423*** New option `grep-highlight-matches' highlights matches in *grep* 1438*** New option `grep-highlight-matches' highlights matches in *grep*
@@ -1952,6 +1967,21 @@ run most curses applications now.
1952** M-x diff uses Diff mode instead of Compilation mode. 1967** M-x diff uses Diff mode instead of Compilation mode.
1953 1968
1954+++ 1969+++
1970** Diff mode key bindings changed.
1971
1972These are the new bindings:
1973
1974C-c C-e diff-ediff-patch (old M-A)
1975C-c C-n diff-restrict-view (old M-r)
1976C-c C-r diff-reverse-direction (old M-R)
1977C-c C-u diff-context->unified (old M-U)
1978C-c C-w diff-refine-hunk (old C-c C-r)
1979
1980To convert unified to context format, use C-u C-c C-u.
1981In addition, C-c C-u now operates on the region
1982in Transient Mark mode when the mark is active.
1983
1984+++
1955** You can now customize `fill-nobreak-predicate' to control where 1985** You can now customize `fill-nobreak-predicate' to control where
1956filling can break lines. The value is now normally a list of 1986filling can break lines. The value is now normally a list of
1957functions, but it can also be a single function, for compatibility. 1987functions, but it can also be a single function, for compatibility.
@@ -3025,7 +3055,7 @@ See the file GNUS-NEWS or the node "Oort Gnus" in the Gnus manual for details.
3025--- 3055---
3026** MH-E changes. 3056** MH-E changes.
3027 3057
3028Upgraded to MH-E version 7.94. There have been major changes since 3058Upgraded to MH-E version 7.95. There have been major changes since
3029version 5.0.2; see MH-E-NEWS for details. 3059version 5.0.2; see MH-E-NEWS for details.
3030 3060
3031** Calendar changes: 3061** Calendar changes:
@@ -3630,9 +3660,10 @@ This is useful in packages that can be preloaded.
3630If it is non-nil, the function lists only faces matching this regexp. 3660If it is non-nil, the function lists only faces matching this regexp.
3631 3661
3632+++ 3662+++
3633*** New function `string-or-null-p'. 3663*** New functions `string-or-null-p' and `booleanp'.
3634 3664
3635Return t if OBJECT is a string or nil. Otherwise, return nil. 3665`string-or-null-p' returns non-nil iff OBJECT is a string or nil.
3666`booleanp' returns non-nil iff OBJECT is a t or nil.
3636 3667
3637** Lisp code indentation features: 3668** Lisp code indentation features:
3638 3669
@@ -5877,6 +5908,8 @@ Currently, the following actions have been defined:
5877- Mouse-2 on the read-only or modified status in the mode line (`%' or 5908- Mouse-2 on the read-only or modified status in the mode line (`%' or
5878`*') toggles the status. 5909`*') toggles the status.
5879 5910
5911- Mouse-3 on the major mode name displays a major mode menu.
5912
5880- Mouse-3 on the mode name displays a minor-mode menu. 5913- Mouse-3 on the mode name displays a minor-mode menu.
5881 5914
5882** Hourglass pointer 5915** Hourglass pointer
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index a38c0cb6770..2e8581a6f57 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,23 @@
12006-05-02 Francesco Potort,Al(B <pot@gnu.org>
2
3 * etags.c (Perl_functions): Free space allocated for var package.
4 (Erlang_functions): Possibly free space allocated for var last.
5 (Prolog_functions): Possibly free space allocated for var last.
6
72006-04-29 Dan Nicolaescu <dann@ics.uci.edu>
8
9 * sorted-doc.c (main): Initialize docs to NULL.
10
11 * yow.c (yow): Free buf.
12
13 * etags.c: Delete c-indentation-style local variable.
14
152006-04-29 Richard Stallman <rms@gnu.org>
16
17 * movemail.c (main): Check for negative value from `read'.
18
19 * fakemail.c (read_header): Give fatal error if input has no header.
20
12006-04-02 Paul Eggert <eggert@cs.ucla.edu> 212006-04-02 Paul Eggert <eggert@cs.ucla.edu>
2 22
3 * b2m.c (main): Don't include <limits.h>. 23 * b2m.c (main): Don't include <limits.h>.
diff --git a/lib-src/etags.c b/lib-src/etags.c
index a073acb92d6..e206443f39b 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -41,7 +41,7 @@
41 * configuration file containing regexp definitions for etags. 41 * configuration file containing regexp definitions for etags.
42 */ 42 */
43 43
44char pot_etags_version[] = "@(#) pot revision number is 17.15"; 44char pot_etags_version[] = "@(#) pot revision number is 17.17";
45 45
46#define TRUE 1 46#define TRUE 1
47#define FALSE 0 47#define FALSE 0
@@ -4543,6 +4543,7 @@ Perl_functions (inf)
4543 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4543 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4544 } 4544 }
4545 } 4545 }
4546 free (package);
4546} 4547}
4547 4548
4548 4549
@@ -5441,6 +5442,8 @@ Prolog_functions (inf)
5441 last[len] = '\0'; 5442 last[len] = '\0';
5442 } 5443 }
5443 } 5444 }
5445 if (last != NULL)
5446 free (last);
5444} 5447}
5445 5448
5446 5449
@@ -5597,7 +5600,11 @@ Erlang_functions (inf)
5597 else if (cp[0] == '-') /* attribute, e.g. "-define" */ 5600 else if (cp[0] == '-') /* attribute, e.g. "-define" */
5598 { 5601 {
5599 erlang_attribute (cp); 5602 erlang_attribute (cp);
5600 last = NULL; 5603 if (last != NULL)
5604 {
5605 free (last);
5606 last = NULL;
5607 }
5601 } 5608 }
5602 else if ((len = erlang_func (cp, last)) > 0) 5609 else if ((len = erlang_func (cp, last)) > 0)
5603 { 5610 {
@@ -5614,6 +5621,8 @@ Erlang_functions (inf)
5614 last[len] = '\0'; 5621 last[len] = '\0';
5615 } 5622 }
5616 } 5623 }
5624 if (last != NULL)
5625 free (last);
5617} 5626}
5618 5627
5619 5628
@@ -6887,7 +6896,6 @@ xrealloc (ptr, size)
6887 6896
6888/* 6897/*
6889 * Local Variables: 6898 * Local Variables:
6890 * c-indentation-style: gnu
6891 * indent-tabs-mode: t 6899 * indent-tabs-mode: t
6892 * tab-width: 8 6900 * tab-width: 8
6893 * fill-column: 79 6901 * fill-column: 79
diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c
index 6b8634f34ab..30d39db533e 100644
--- a/lib-src/fakemail.c
+++ b/lib-src/fakemail.c
@@ -694,6 +694,8 @@ read_header ()
694 694
695 } while (true); 695 } while (true);
696 696
697 if (! the_header)
698 fatal ("input message has no header");
697 return the_header->next; 699 return the_header->next;
698} 700}
699 701
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index d3ec1fcd178..1f73ee88ba8 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -466,6 +466,8 @@ main (argc, argv)
466 while (1) 466 while (1)
467 { 467 {
468 nread = read (indesc, buf, sizeof buf); 468 nread = read (indesc, buf, sizeof buf);
469 if (nread < 0)
470 pfatal_with_name (inname);
469 if (nread != write (outdesc, buf, nread)) 471 if (nread != write (outdesc, buf, nread))
470 { 472 {
471 int saved_errno = errno; 473 int saved_errno = errno;
diff --git a/lib-src/sorted-doc.c b/lib-src/sorted-doc.c
index a2416993a1b..0a06aa2c984 100644
--- a/lib-src/sorted-doc.c
+++ b/lib-src/sorted-doc.c
@@ -131,7 +131,7 @@ main ()
131 register enum state state = WAITING; /* state at start */ 131 register enum state state = WAITING; /* state at start */
132 int cnt = 0; /* number of DOCSTRs read */ 132 int cnt = 0; /* number of DOCSTRs read */
133 133
134 DOCSTR *docs; /* chain of allocated DOCSTRS */ 134 DOCSTR *docs = NULL; /* chain of allocated DOCSTRS */
135 char buf[512]; /* line buffer */ 135 char buf[512]; /* line buffer */
136 136
137 while (1) /* process one char at a time */ 137 while (1) /* process one char at a time */
diff --git a/lib-src/yow.c b/lib-src/yow.c
index 1356ac6db18..18f0f7b2e13 100644
--- a/lib-src/yow.c
+++ b/lib-src/yow.c
@@ -176,6 +176,7 @@ yow (fp)
176 } 176 }
177 buf[i++] = 0; 177 buf[i++] = 0;
178 printf("%s\n", buf); 178 printf("%s\n", buf);
179 free (buf);
179} 180}
180 181
181/* arch-tag: e40fc0df-bafb-4001-af24-5c883d1c685e 182/* arch-tag: e40fc0df-bafb-4001-af24-5c883d1c685e
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0b384c6d8c3..2a402f88c01 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,170 @@
12006-05-03 Nick Roberts <nickrob@snap.net.nz>
2
3 * progmodes/gdb-ui.el (gud-watch): Let user select an expression.
4 (menu): Fix typo.
5
62006-05-02 Miles Bader <miles@gnu.org>
7
8 * replace.el (occur-engine): Bind `inhibit-field-text-motion' to t.
9
102006-05-02 Jay Belanger <belanger@truman.edu>
11
12 * calc/calc-embed.el: (calc-override-minor-modes-map)
13 (calc-override-minor-modes): New variables.
14 (calc-do-embedded): Make sure that Calc keystrokes aren't
15 overwritten by minor modes.
16
172006-05-02 Chong Yidong <cyd@mit.edu>
18
19 * msb.el (msb): If EVENT is a down event, read and discard the up
20 event.
21
222006-05-02 Reiner Steib <Reiner.Steib@gmx.de>
23
24 * startup.el (command-line-1): Refer to Lisp manual when
25 pure-space-overflow occurs.
26
27 * files.el (byte-compile-dynamic)
28 (byte-compile-dynamic-docstrings, byte-compile-warnings)
29 (find-file-visit-truename, indent-tabs-mode, left-margin)
30 (no-byte-compile no-update-autoloads, truncate-lines)
31 (version-control): Don't use `t' for safe-local-variable
32 declarations.
33
342006-05-01 Richard Stallman <rms@gnu.org>
35
36 * diff-mode.el (diff-mode-shared-map): Don't bind M-W, M-U, M-C,
37 M-r, M-R, M-A, M-SPC or M-DEL.
38 (diff-mode-map): diff-refine-hunk now on C-c C-w
39 (diff-mode-map): Bind C-c C-e, C-c C-n, C-c C-r, C-c C-u.
40
41 * help-mode.el (help-mode): view-exit-action calls delete-window
42 only when it is safe and possible.
43
44 * simple.el (undo-outer-limit-truncate): Put quotes around buffer name
45 in messages.
46
47 * emacs-lisp/warnings.el (display-warning, lwarn): Doc fixes.
48
49 * tool-bar.el (tool-bar-setup): Put Help and Preferences items
50 in the default tool-bar-map.
51
522006-05-01 Michael Albinus <michael.albinus@gmx.de>
53
54 * net/tramp.el (tramp-completion-file-name-handler-alist)
55 (tramp-run-real-handler, tramp-completion-run-real-handler)
56 (tramp-completion-handle-file-name-all-completions)
57 (tramp-completion-handle-file-name-completion): Autoload them.
58 (tramp-completion-handle-file-exists-p)
59 (tramp-completion-handle-file-name-directory)
60 (tramp-completion-handle-file-name-nondirectory)
61 (tramp-completion-handle-expand-file-name): Remove them.
62 (tramp-handle-file-name-directory): Return the real directory name.
63 Returning "/" only doesn't need to be necessary any longer.
64 (tramp-file-name-handler): Make special attention when in hostname
65 completion mode.
66 (tramp-completion-file-name-handler): Revert patch from 2006-04-28.
67 (tramp-register-file-name-handlers): Register
68 `tramp-completion-file-name-handler' only when
69 `partial-completion-mode is enabled.
70 (tramp-completion-handle-file-name-all-completions):
71 Delete directory part from results.
72 (tramp-get-completion-methods, tramp-get-completion-user-host):
73 Discard deleting "/", it doesn't work after the change of
74 `tramp-handle-file-name-directory' above.
75
762006-05-01 Kim F. Storm <storm@cua.dk>
77
78 * progmodes/grep.el (grep-expand-template): Use save-match-data
79 and symbol-value.
80
812006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
82
83 * term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop): Use
84 select-frame-set-input-focus instead of raise-frame.
85 (global-map): Bind M-drag-n-drop to mac-drag-n-drop.
86
872006-05-01 Nick Roberts <nickrob@snap.net.nz>
88
89 * progmodes/gud.el (gud-def): Add %c case.
90 (gud-speedbar-buttons): Don't bind case-fold-search unnecessarily.
91 (gud-format-command): Make match case sensitive. Match on %F.
92
932006-04-30 Glenn Morris <rgm@gnu.org>
94
95 * calendar/cal-tex.el (cal-tex-preamble-extra): New variable.
96 (cal-tex-preamble): Use cal-tex-preamble-extra.
97 (cal-tex-list-diary-entries): Refer to `diary-list-entries' rather
98 than alias `list-diary-entries'.
99
1002006-04-29 Dan Nicolaescu <dann@ics.uci.edu>
101
102 * help-fns.el (describe-variable): Add info about safe local variables.
103
1042006-04-29 Richard Stallman <rms@gnu.org>
105
106 * bindings.el (mode-line-format): help-echo doc fixes.
107
108 * net/tramp.el (tramp-file-name-handler-alist): Delete
109 expand-file-name and other operations that can cause spurious loading.
110
1112006-04-29 Stefan Monnier <monnier@iro.umontreal.ca>
112
113 * files.el (safe-local-variable-p): Remove support for the special
114 value t.
115
116 * textmodes/paragraphs.el (sentence-end-without-space):
117 Fix safety predicate.
118 (sentence-end-double-space, sentence-end-without-period)
119 (paragraph-ignore-fill-prefix):
120 * textmodes/fill.el (colon-double-space):
121 * abbrev.el (abbrev-mode): Tighten the safety predicate.
122
123 * subr.el (booleanp): New fun.
124
125 * textmodes/reftex-vars.el (reftex-guess-label-type):
126 Tighten the safety predicate.
127
1282006-04-28 Kim F. Storm <storm@cua.dk>
129
130 * progmodes/grep.el (defgroup grep): Doc fix.
131 (grep-auto-highlight): Remove.
132 (grep-template): New defcustom.
133 (grep-find-template): Rename from grep-tree-template.
134 (grep-files-aliases): Rename from grep-tree-files-aliases.
135 Remove "all" alias, add "l" alias.
136 (grep-tree-ignore-case, grep-tree-ignore-CVS-directories): Remove.
137 (grep-find-ignored-directories): New defcustom to replace
138 grep-tree-ignore-CVS-directories, to facilitate ignoring
139 subdirectories for multiple version control systems.
140 (grep-mode-map): Add Recursive grep item to GREP menu.
141 (grep-regexp-history, grep-files-history): New defvars.
142 (grep-probe): New helper function.
143 (grep-compute-defaults): Use it to simplify code.
144 Adapt to name changes.
145 Use `.' as base in grep-find-template rather than <D>.
146 (grep): Remove superfluous highlight-regexp arg. Fix doc.
147 Call grep-compute-defaults unconditionally.
148 (grep-expand-keywords): New defconst.
149 (grep-expand-template): Rename from grep-expand-command-macros.
150 Simplify via grep-expand-keywords. Look at case-fold-search instead
151 of grep-tree-ignore-case to add -i option.
152 Bind case-fold-search to nil while matching keywords.
153 (grep-tree-last-regexp, grep-tree-last-files): Remove.
154 (grep-read-regexp, grep-read-files): New helper functions.
155 (rgrep): Rename from grep-tree. Rework to use proper histories.
156 Adapt to changes in defcustoms and functions above.
157 (lgrep): New command, as grep, but using same interactive UI as rgrep.
158
1592006-04-28 Michael Albinus <michael.albinus@gmx.de>
160
161 * net/tramp.el (tramp-completion-file-name-handler):
162 Disable Tramp's functionality while loading Tramp itself.
163 (tramp-register-file-name-handlers): That's a defsubst now.
164 Code from `tramp-repair-jka-compr' moved here. Apply it via
165 `after-init-hook'.
166 (tramp-repair-jka-compr): Remove.
167
12006-04-27 Jay Belanger <belanger@truman.edu> 1682006-04-27 Jay Belanger <belanger@truman.edu>
2 169
3 * calc-embed.el (calc-embedded-make-info): Use `math-read-expr' to 170 * calc-embed.el (calc-embedded-make-info): Use `math-read-expr' to
@@ -2598,7 +2765,7 @@
2598 (describe-key-briefly-internal, describe-key-internal): 2765 (describe-key-briefly-internal, describe-key-internal):
2599 Functions merged back into their callers. 2766 Functions merged back into their callers.
2600 2767
26012006-02-13 Martin Rudalics <rudalics@gmx.at> (tiny change) 27682006-02-13 Martin Rudalics <rudalics@gmx.at>
2602 2769
2603 * info.el (info-xref-visited): Inherit from info-xref too. 2770 * info.el (info-xref-visited): Inherit from info-xref too.
2604 (Info-set-mode-line): Replace occurrences of `%' by `%%' 2771 (Info-set-mode-line): Replace occurrences of `%' by `%%'
@@ -3746,7 +3913,7 @@
3746 * add-log.el (add-change-log-entry, change-log-merge): 3913 * add-log.el (add-change-log-entry, change-log-merge):
3747 Conditionally use `hard-newline'. 3914 Conditionally use `hard-newline'.
3748 3915
37492006-01-13 Martin Rudalics <rudalics@gmx.at> (tiny change) 39162006-01-13 Martin Rudalics <rudalics@gmx.at>
3750 3917
3751 * wid-edit.el (widget-field-end): If the overlay is no longer 3918 * wid-edit.el (widget-field-end): If the overlay is no longer
3752 associated with a buffer, behave as if the overlay didn't exist. 3919 associated with a buffer, behave as if the overlay didn't exist.
@@ -4836,7 +5003,7 @@
4836 * emacs-lisp/edebug.el (edebug-safe-prin1-to-string): 5003 * emacs-lisp/edebug.el (edebug-safe-prin1-to-string):
4837 Capture error from printing circular structures. 5004 Capture error from printing circular structures.
4838 5005
48392005-12-17 Martin Rudalics <rudalics@gmx.at> (tiny change) 50062005-12-17 Martin Rudalics <rudalics@gmx.at>
4840 5007
4841 * wid-edit.el (widget-checkbox-action): Clear undo info. 5008 * wid-edit.el (widget-checkbox-action): Clear undo info.
4842 5009
@@ -6819,7 +6986,7 @@
6819 scrolling the help window. Doc fix. 6986 scrolling the help window. Doc fix.
6820 (help-return-method): Doc fix. 6987 (help-return-method): Doc fix.
6821 6988
68222005-12-03 Martin Rudalics <rudalics@gmx.at> (tiny change) 69892005-12-03 Martin Rudalics <rudalics@gmx.at>
6823 6990
6824 * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Fix bug 6991 * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Fix bug
6825 whereby names of length one or names starting with a 6992 whereby names of length one or names starting with a
@@ -7373,7 +7540,7 @@
7373 7540
7374 * custom.el (defcustom): Update link types in docstring. 7541 * custom.el (defcustom): Update link types in docstring.
7375 7542
73762005-11-20 Martin Rudalics <rudalics@gmx.at> (tiny change) 75432005-11-20 Martin Rudalics <rudalics@gmx.at>
7377 7544
7378 * custom.el (defgroup): Add doc-string-elt info. 7545 * custom.el (defgroup): Add doc-string-elt info.
7379 7546
@@ -7646,7 +7813,7 @@
7646 7813
7647 * apropos.el (apropos-calc-scores): Use apropos-pattern. 7814 * apropos.el (apropos-calc-scores): Use apropos-pattern.
7648 7815
76492005-11-16 Martin Rudalics <rudalics@gmx.at> (tiny change) 78162005-11-16 Martin Rudalics <rudalics@gmx.at>
7650 7817
7651 * wid-edit.el (color): Enclose %t in %{...%}. 7818 * wid-edit.el (color): Enclose %t in %{...%}.
7652 7819
@@ -14577,7 +14744,7 @@
14577 * emulation/edt-mapper.el (edt-save-function-key-map) 14744 * emulation/edt-mapper.el (edt-save-function-key-map)
14578 (EDT-key-name): `defvar' to silence the byte-compiler. 14745 (EDT-key-name): `defvar' to silence the byte-compiler.
14579 14746
145802005-07-02 Martin Rudalics <rudalics@gmx.at> (tiny change) 147472005-07-02 Martin Rudalics <rudalics@gmx.at>
14581 14748
14582 * font-lock.el (font-lock-regexp-grouping-backslash): Rename from 14749 * font-lock.el (font-lock-regexp-grouping-backslash): Rename from
14583 font-lock-regexp-backslash. Doc fix. 14750 font-lock-regexp-backslash. Doc fix.
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index c0380058b53..234b8230587 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -58,7 +58,7 @@ Interactively, use the command `abbrev-mode'
58to enable or disable Abbrev mode in the current buffer." 58to enable or disable Abbrev mode in the current buffer."
59 :type 'boolean 59 :type 'boolean
60 :group 'abbrev-mode) 60 :group 'abbrev-mode)
61;;;###autoload(put 'abbrev-mode 'safe-local-variable 'symbolp) 61;;;###autoload(put 'abbrev-mode 'safe-local-variable 'booleanp)
62 62
63 63
64(defvar edit-abbrevs-map 64(defvar edit-abbrevs-map
diff --git a/lisp/allout.el b/lisp/allout.el
index b6542c1a5dc..dc19c1fa15a 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -301,7 +301,7 @@ alist, then use comment-start string, if any, then use default \(`.').
301Set to the symbol for either of `allout-mode-leaders' or 301Set to the symbol for either of `allout-mode-leaders' or
302`comment-start' to use only one of them, respectively. 302`comment-start' to use only one of them, respectively.
303 303
304Value nil means to always use the default \(`.').t 304Value nil means to always use the default \(`.').
305 305
306comment-start strings that do not end in spaces are tripled, and an 306comment-start strings that do not end in spaces are tripled, and an
307`_' underscore is tacked on the end, to distinguish them from regular 307`_' underscore is tacked on the end, to distinguish them from regular
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 6cbec4a1a86..d965abada6f 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -319,13 +319,13 @@ Keymap to display on minor modes.")
319 (list 319 (list
320 (propertize "%[(" 'help-echo help-echo) 320 (propertize "%[(" 'help-echo help-echo)
321 `(:propertize ("" mode-name) 321 `(:propertize ("" mode-name)
322 help-echo "mouse-1: major-mode-menu mouse-2: help for current major mode" 322 help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes"
323 mouse-face mode-line-highlight 323 mouse-face mode-line-highlight
324 local-map ,mode-line-major-mode-keymap) 324 local-map ,mode-line-major-mode-keymap)
325 '("" mode-line-process) 325 '("" mode-line-process)
326 `(:propertize ("" minor-mode-alist) 326 `(:propertize ("" minor-mode-alist)
327 mouse-face mode-line-highlight 327 mouse-face mode-line-highlight
328 help-echo "mouse-2: help for minor modes, mouse-3: minor mode menu" 328 help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes"
329 local-map ,mode-line-minor-mode-keymap) 329 local-map ,mode-line-minor-mode-keymap)
330 (propertize "%n" 'help-echo "mouse-2: widen" 330 (propertize "%n" 'help-echo "mouse-2: widen"
331 'mouse-face 'mode-line-highlight 331 'mouse-face 'mode-line-highlight
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index adb94ef7381..e54a94e4d39 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -206,6 +206,18 @@
206(defvar calc-embedded-firsttime-buf) 206(defvar calc-embedded-firsttime-buf)
207(defvar calc-embedded-firsttime-formula) 207(defvar calc-embedded-firsttime-formula)
208 208
209;; The following is to take care of any minor modes which override
210;; a Calc command.
211(defvar calc-override-minor-modes-map
212 (make-sparse-keymap)
213 "A list of keybindings that might be overwritten by minor modes.")
214
215;; Add any keys that might be overwritten here.
216(define-key calc-override-minor-modes-map "`" 'calc-edit)
217
218(defvar calc-override-minor-modes
219 (cons t calc-override-minor-modes-map))
220
209(defun calc-do-embedded (calc-embed-arg end obeg oend) 221(defun calc-do-embedded (calc-embed-arg end obeg oend)
210 (if calc-embedded-info 222 (if calc-embedded-info
211 223
@@ -237,6 +249,8 @@
237 truncate-lines (nth 2 mode) 249 truncate-lines (nth 2 mode)
238 buffer-read-only nil) 250 buffer-read-only nil)
239 (use-local-map (nth 1 mode)) 251 (use-local-map (nth 1 mode))
252 (setq minor-mode-overriding-map-alist
253 (remq calc-override-minor-modes minor-mode-overriding-map-alist))
240 (set-buffer-modified-p (buffer-modified-p)) 254 (set-buffer-modified-p (buffer-modified-p))
241 (calc-embedded-restore-original-modes) 255 (calc-embedded-restore-original-modes)
242 (or calc-embedded-quiet 256 (or calc-embedded-quiet
@@ -297,6 +311,9 @@
297 buffer-read-only t) 311 buffer-read-only t)
298 (set-buffer-modified-p (buffer-modified-p)) 312 (set-buffer-modified-p (buffer-modified-p))
299 (use-local-map calc-mode-map) 313 (use-local-map calc-mode-map)
314 (setq minor-mode-overriding-map-alist
315 (cons calc-override-minor-modes
316 minor-mode-overriding-map-alist))
300 (setq calc-no-refresh-evaltos nil) 317 (setq calc-no-refresh-evaltos nil)
301 (and chg calc-any-evaltos (calc-wrapper (calc-refresh-evaltos))) 318 (and chg calc-any-evaltos (calc-wrapper (calc-refresh-evaltos)))
302 (let (str) 319 (let (str)
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el
index a67d90c832e..1fd85513230 100644
--- a/lisp/calendar/cal-tex.el
+++ b/lisp/calendar/cal-tex.el
@@ -45,7 +45,7 @@
45 45
46(require 'calendar) 46(require 'calendar)
47 47
48(autoload 'list-diary-entries "diary-lib" nil t) 48(autoload 'diary-list-entries "diary-lib" nil t)
49(autoload 'calendar-holiday-list "holidays" nil t) 49(autoload 'calendar-holiday-list "holidays" nil t)
50(autoload 'calendar-iso-from-absolute "cal-iso" nil t) 50(autoload 'calendar-iso-from-absolute "cal-iso" nil t)
51 51
@@ -121,6 +121,14 @@ will put the Hebrew date at the bottom of each day."
121 :type 'integer 121 :type 'integer
122 :group 'calendar-tex) 122 :group 'calendar-tex)
123 123
124(defcustom cal-tex-preamble-extra nil
125 "A string giving extra LaTeX commands to insert in the calendar preamble.
126For example, to include extra packages:
127\"\\\\usepackage{foo}\\n\\\\usepackage{bar}\\n\"."
128 :type 'string
129 :group 'calendar-tex
130 :version "22.1")
131
124(defcustom cal-tex-hook nil 132(defcustom cal-tex-hook nil
125 "*List of functions called after any LaTeX calendar buffer is generated. 133 "*List of functions called after any LaTeX calendar buffer is generated.
126You can use this to do postprocessing on the buffer. For example, to change 134You can use this to do postprocessing on the buffer. For example, to change
@@ -240,7 +248,7 @@ This definition is the heart of the calendar!")
240 "Generate a list of all diary-entries from absolute date D1 to D2." 248 "Generate a list of all diary-entries from absolute date D1 to D2."
241 (let ((diary-list-include-blanks nil) 249 (let ((diary-list-include-blanks nil)
242 (diary-display-hook 'ignore)) 250 (diary-display-hook 'ignore))
243 (list-diary-entries 251 (diary-list-entries
244 (calendar-gregorian-from-absolute d1) 252 (calendar-gregorian-from-absolute d1)
245 (1+ (- d2 d1))))) 253 (1+ (- d2 d1)))))
246 254
@@ -253,8 +261,10 @@ Optional ARGS are included."
253 (insert "\\documentclass") 261 (insert "\\documentclass")
254 (if args 262 (if args
255 (insert "[" args "]")) 263 (insert "[" args "]"))
256 (insert "{article}\n" 264 (insert "{article}\n")
257 "\\hbadness 20000 265 (if (stringp cal-tex-preamble-extra)
266 (insert cal-tex-preamble-extra "\n"))
267 (insert "\\hbadness 20000
258\\hfuzz=1000pt 268\\hfuzz=1000pt
259\\vbadness 20000 269\\vbadness 20000
260\\lineskip 0pt 270\\lineskip 0pt
@@ -357,6 +367,8 @@ Optional parameter specifies number of years."
357 (cal-tex-noindent) 367 (cal-tex-noindent)
358 (cal-tex-nl) 368 (cal-tex-nl)
359 (let ((month-names; don't use default in case user changed it 369 (let ((month-names; don't use default in case user changed it
370 ;; These are only used to define the command names, not
371 ;; the names of the months they insert.
360 ["January" "February" "March" "April" "May" "June" 372 ["January" "February" "March" "April" "May" "June"
361 "July" "August" "September" "October" "November" "December"])) 373 "July" "August" "September" "October" "November" "December"]))
362 (calendar-for-loop i from 1 to 12 do 374 (calendar-for-loop i from 1 to 12 do
diff --git a/lisp/cvs-status.el b/lisp/cvs-status.el
index cf0ee85db23..477914293a7 100644
--- a/lisp/cvs-status.el
+++ b/lisp/cvs-status.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1999, 2000, 2002, 2003, 2004, 3;; Copyright (C) 1999, 2000, 2002, 2003, 2004,
4;; 2005, 2006 Free Software Foundation, Inc. 4;; 2005, 2006 Free Software Foundation, Inc.
5 5
6;; Author: Stefan Monnier <monnier@cs.yale.edu> 6;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
7;; Keywords: pcl-cvs cvs status tree tools 7;; Keywords: pcl-cvs cvs status tree tools
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index 7c7f7902d82..cc89aad6ca3 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4;; 2005, 2006 Free Software Foundation, Inc. 4;; 2005, 2006 Free Software Foundation, Inc.
5 5
6;; Author: Stefan Monnier <monnier@cs.yale.edu> 6;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
7;; Keywords: convenience patch diff 7;; Keywords: convenience patch diff
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
@@ -118,7 +118,8 @@ when editing big diffs)."
118 ("\C-m" . diff-goto-source) 118 ("\C-m" . diff-goto-source)
119 ([mouse-2] . diff-goto-source) 119 ([mouse-2] . diff-goto-source)
120 ;; From XEmacs' diff-mode. 120 ;; From XEmacs' diff-mode.
121 ("W" . widen) 121;; Standard M-w is useful, so don't change M-W.
122;; ("W" . widen)
122 ;;("." . diff-goto-source) ;display-buffer 123 ;;("." . diff-goto-source) ;display-buffer
123 ;;("f" . diff-goto-source) ;find-file 124 ;;("f" . diff-goto-source) ;find-file
124 ("o" . diff-goto-source) ;other-window 125 ("o" . diff-goto-source) ;other-window
@@ -127,14 +128,14 @@ when editing big diffs)."
127 ;;("h" . diff-show-header) 128 ;;("h" . diff-show-header)
128 ;;("j" . diff-show-difference) ;jump to Nth diff 129 ;;("j" . diff-show-difference) ;jump to Nth diff
129 ;;("q" . diff-quit) 130 ;;("q" . diff-quit)
130 (" " . scroll-up) 131;; Not useful if you have to metafy them.
131 ("\177" . scroll-down) 132;; (" " . scroll-up)
132 ;; Our very own bindings. 133;; ("\177" . scroll-down)
133 ("A" . diff-ediff-patch) 134;; Standard M-a is useful, so don't change M-A.
134 ("r" . diff-restrict-view) 135;; ("A" . diff-ediff-patch)
135 ("R" . diff-reverse-direction) 136;; Standard M-r is useful, so don't change M-r or M-R.
136 ("U" . diff-context->unified) 137;; ("r" . diff-restrict-view)
137 ("C" . diff-unified->context) 138;; ("R" . diff-reverse-direction)
138 ("q" . quit-window)) 139 ("q" . quit-window))
139 "Basic keymap for `diff-mode', bound to various prefix keys.") 140 "Basic keymap for `diff-mode', bound to various prefix keys.")
140 141
@@ -143,10 +144,14 @@ when editing big diffs)."
143 ;; From compilation-minor-mode. 144 ;; From compilation-minor-mode.
144 ("\C-c\C-c" . diff-goto-source) 145 ("\C-c\C-c" . diff-goto-source)
145 ;; Misc operations. 146 ;; Misc operations.
146 ("\C-c\C-r" . diff-refine-hunk)
147 ("\C-c\C-s" . diff-split-hunk)
148 ("\C-c\C-a" . diff-apply-hunk) 147 ("\C-c\C-a" . diff-apply-hunk)
148 ("\C-c\C-e" . diff-ediff-patch)
149 ("\C-c\C-n" . diff-restrict-view)
150 ("\C-c\C-r" . diff-reverse-direction)
151 ("\C-c\C-s" . diff-split-hunk)
149 ("\C-c\C-t" . diff-test-hunk) 152 ("\C-c\C-t" . diff-test-hunk)
153 ("\C-c\C-u" . diff-context->unified)
154 ("\C-c\C-w" . diff-refine-hunk)
150 ("\C-c\C-f" . next-error-follow-minor-mode)) 155 ("\C-c\C-f" . next-error-follow-minor-mode))
151 "Keymap for `diff-mode'. See also `diff-mode-shared-map'.") 156 "Keymap for `diff-mode'. See also `diff-mode-shared-map'.")
152 157
@@ -711,77 +716,80 @@ else cover the whole bufer."
711 (delete-region last-pt (point)) 716 (delete-region last-pt (point))
712 (setq delete nil))))))))))))))) 717 (setq delete nil)))))))))))))))
713 718
714(defun diff-context->unified (start end) 719(defun diff-context->unified (start end &optional to-context)
715 "Convert context diffs to unified diffs. 720 "Convert context diffs to unified diffs.
716START and END are either taken from the region (if a prefix arg is given) or 721START and END are either taken from the region
717else cover the whole bufer." 722\(when it is highlighted) or else cover the whole buffer.
718 (interactive (if current-prefix-arg 723With a prefix argument, convert unified format to context format."
719 (list (mark) (point)) 724 (interactive (if (and transient-mark-mode mark-active)
720 (list (point-min) (point-max)))) 725 (list (mark) (point) current-prefix-arg)
721 (unless (markerp end) (setq end (copy-marker end))) 726 (list (point-min) (point-max) current-prefix-arg)))
722 (let (;;(diff-inhibit-after-change t) 727 (if to-context
723 (inhibit-read-only t)) 728 (diff-unified->context start end)
724 (save-excursion 729 (unless (markerp end) (setq end (copy-marker end)))
725 (goto-char start) 730 (let ( ;;(diff-inhibit-after-change t)
726 (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t) 731 (inhibit-read-only t))
727 (< (point) end)) 732 (save-excursion
728 (combine-after-change-calls 733 (goto-char start)
729 (if (match-beginning 2) 734 (while (and (re-search-forward "^\\(\\(\\*\\*\\*\\) .+\n\\(---\\) .+\\|\\*\\{15\\}.*\n\\*\\*\\* \\([0-9]+\\),\\(-?[0-9]+\\) \\*\\*\\*\\*\\)$" nil t)
730 ;; we matched a file header 735 (< (point) end))
731 (progn 736 (combine-after-change-calls
732 ;; use reverse order to make sure the indices are kept valid 737 (if (match-beginning 2)
733 (replace-match "+++" t t nil 3) 738 ;; we matched a file header
734 (replace-match "---" t t nil 2)) 739 (progn
735 ;; we matched a hunk header 740 ;; use reverse order to make sure the indices are kept valid
736 (let ((line1s (match-string 4)) 741 (replace-match "+++" t t nil 3)
737 (line1e (match-string 5)) 742 (replace-match "---" t t nil 2))
738 (pt1 (match-beginning 0))) 743 ;; we matched a hunk header
739 (replace-match "") 744 (let ((line1s (match-string 4))
740 (unless (re-search-forward 745 (line1e (match-string 5))
741 "^--- \\([0-9]+\\),\\(-?[0-9]+\\) ----$" nil t) 746 (pt1 (match-beginning 0)))
742 (error "Can't find matching `--- n1,n2 ----' line")) 747 (replace-match "")
743 (let ((line2s (match-string 1)) 748 (unless (re-search-forward
744 (line2e (match-string 2)) 749 "^--- \\([0-9]+\\),\\(-?[0-9]+\\) ----$" nil t)
745 (pt2 (progn 750 (error "Can't find matching `--- n1,n2 ----' line"))
746 (delete-region (progn (beginning-of-line) (point)) 751 (let ((line2s (match-string 1))
747 (progn (forward-line 1) (point))) 752 (line2e (match-string 2))
748 (point-marker)))) 753 (pt2 (progn
749 (goto-char pt1) 754 (delete-region (progn (beginning-of-line) (point))
750 (forward-line 1) 755 (progn (forward-line 1) (point)))
751 (while (< (point) pt2) 756 (point-marker))))
752 (case (char-after)
753 ((?! ?-) (delete-char 2) (insert "-") (forward-line 1))
754 (?\s ;merge with the other half of the chunk
755 (let* ((endline2
756 (save-excursion
757 (goto-char pt2) (forward-line 1) (point)))
758 (c (char-after pt2)))
759 (case c
760 ((?! ?+)
761 (insert "+"
762 (prog1 (buffer-substring (+ pt2 2) endline2)
763 (delete-region pt2 endline2))))
764 (?\s ;FIXME: check consistency
765 (delete-region pt2 endline2)
766 (delete-char 1)
767 (forward-line 1))
768 (?\\ (forward-line 1))
769 (t (delete-char 1) (forward-line 1)))))
770 (t (forward-line 1))))
771 (while (looking-at "[+! ] ")
772 (if (/= (char-after) ?!) (forward-char 1)
773 (delete-char 1) (insert "+"))
774 (delete-char 1) (forward-line 1))
775 (save-excursion
776 (goto-char pt1) 757 (goto-char pt1)
777 (insert "@@ -" line1s "," 758 (forward-line 1)
778 (number-to-string (- (string-to-number line1e) 759 (while (< (point) pt2)
779 (string-to-number line1s) 760 (case (char-after)
780 -1)) 761 ((?! ?-) (delete-char 2) (insert "-") (forward-line 1))
781 " +" line2s "," 762 (?\s ;merge with the other half of the chunk
782 (number-to-string (- (string-to-number line2e) 763 (let* ((endline2
783 (string-to-number line2s) 764 (save-excursion
784 -1)) " @@")))))))))) 765 (goto-char pt2) (forward-line 1) (point)))
766 (c (char-after pt2)))
767 (case c
768 ((?! ?+)
769 (insert "+"
770 (prog1 (buffer-substring (+ pt2 2) endline2)
771 (delete-region pt2 endline2))))
772 (?\s ;FIXME: check consistency
773 (delete-region pt2 endline2)
774 (delete-char 1)
775 (forward-line 1))
776 (?\\ (forward-line 1))
777 (t (delete-char 1) (forward-line 1)))))
778 (t (forward-line 1))))
779 (while (looking-at "[+! ] ")
780 (if (/= (char-after) ?!) (forward-char 1)
781 (delete-char 1) (insert "+"))
782 (delete-char 1) (forward-line 1))
783 (save-excursion
784 (goto-char pt1)
785 (insert "@@ -" line1s ","
786 (number-to-string (- (string-to-number line1e)
787 (string-to-number line1s)
788 -1))
789 " +" line2s ","
790 (number-to-string (- (string-to-number line2e)
791 (string-to-number line2s)
792 -1)) " @@")))))))))))
785 793
786(defun diff-reverse-direction (start end) 794(defun diff-reverse-direction (start end)
787 "Reverse the direction of the diffs. 795 "Reverse the direction of the diffs.
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index 133c4c42f2a..a02a8c14eba 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -209,6 +209,7 @@ only, and you can use whatever symbols you like.)
209 209
210LEVEL should be either :debug, :warning, :error, or :emergency 210LEVEL should be either :debug, :warning, :error, or :emergency
211\(but see `warning-minimum-level' and `warning-minimum-log-level'). 211\(but see `warning-minimum-level' and `warning-minimum-log-level').
212Default is :warning.
212 213
213:emergency -- a problem that will seriously impair Emacs operation soon 214:emergency -- a problem that will seriously impair Emacs operation soon
214 if you do not attend to it promptly. 215 if you do not attend to it promptly.
@@ -292,7 +293,7 @@ See also `warning-series', `warning-prefix-function' and
292Aside from generating the message with `format', 293Aside from generating the message with `format',
293this is equivalent to `display-warning'. 294this is equivalent to `display-warning'.
294 295
295TYPE is the warning type: either a custom group name (a symbol). 296TYPE is the warning type: either a custom group name (a symbol),
296or a list of symbols whose first element is a custom group name. 297or a list of symbols whose first element is a custom group name.
297\(The rest of the symbols represent subcategories and 298\(The rest of the symbols represent subcategories and
298can be whatever you like.) 299can be whatever you like.)
diff --git a/lisp/files.el b/lisp/files.el
index 10cdb473045..16c0f1288a1 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2354,27 +2354,27 @@ asking you for confirmation."
2354 (eval 2354 (eval
2355 `(mapc (lambda (pair) 2355 `(mapc (lambda (pair)
2356 (put (car pair) 'safe-local-variable (cdr pair))) 2356 (put (car pair) 'safe-local-variable (cdr pair)))
2357 '((byte-compile-dynamic . t) 2357 '((byte-compile-dynamic . booleanp)
2358 (byte-compile-dynamic-docstrings . t) 2358 (byte-compile-dynamic-docstrings . booleanp)
2359 (byte-compile-warnings . t) 2359 (byte-compile-warnings . booleanp)
2360 (c-basic-offset . integerp) 2360 (c-basic-offset . integerp)
2361 (c-file-style . stringp) 2361 (c-file-style . stringp)
2362 (c-indent-level . integerp) 2362 (c-indent-level . integerp)
2363 (comment-column . integerp) 2363 (comment-column . integerp)
2364 (compile-command . string-or-null-p) 2364 (compile-command . string-or-null-p)
2365 (find-file-visit-truename . t) 2365 (find-file-visit-truename . booleanp)
2366 (fill-column . integerp) 2366 (fill-column . integerp)
2367 (fill-prefix . string-or-null-p) 2367 (fill-prefix . string-or-null-p)
2368 (indent-tabs-mode . t) 2368 (indent-tabs-mode . booleanp) ;; C source code
2369 (kept-old-versions . integerp) 2369 (kept-old-versions . integerp)
2370 (kept-new-versions . integerp) 2370 (kept-new-versions . integerp)
2371 (left-margin . t) 2371 (left-margin . integerp)
2372 (no-byte-compile . t) 2372 (no-byte-compile . booleanp)
2373 (no-update-autoloads . t) 2373 (no-update-autoloads . booleanp)
2374 (outline-regexp . string-or-null-p) 2374 (outline-regexp . string-or-null-p)
2375 (tab-width . integerp) ;; C source code 2375 (tab-width . integerp) ;; C source code
2376 (truncate-lines . t) ;; C source code 2376 (truncate-lines . booleanp) ;; C source code
2377 (version-control . t))))) 2377 (version-control . symbolp)))))
2378 2378
2379(put 'c-set-style 'safe-local-eval-function t) 2379(put 'c-set-style 'safe-local-eval-function t)
2380 2380
@@ -2653,15 +2653,11 @@ It is safe if any of these conditions are met:
2653 * There is a matching entry (SYM . VAL) in the 2653 * There is a matching entry (SYM . VAL) in the
2654 `safe-local-variable-values' user option. 2654 `safe-local-variable-values' user option.
2655 2655
2656 * The `safe-local-variable' property of SYM is t.
2657
2658 * The `safe-local-variable' property of SYM is a function that 2656 * The `safe-local-variable' property of SYM is a function that
2659 evaluates to a non-nil value with VAL as an argument." 2657 evaluates to a non-nil value with VAL as an argument."
2660 (or (member (cons sym val) safe-local-variable-values) 2658 (or (member (cons sym val) safe-local-variable-values)
2661 (let ((safep (get sym 'safe-local-variable))) 2659 (let ((safep (get sym 'safe-local-variable)))
2662 (or (eq safep t) 2660 (and (functionp safep) (funcall safep val)))))
2663 (and (functionp safep)
2664 (funcall safep val))))))
2665 2661
2666(defun risky-local-variable-p (sym &optional ignored) 2662(defun risky-local-variable-p (sym &optional ignored)
2667 "Non-nil if SYM could be dangerous as a file-local variable. 2663 "Non-nil if SYM could be dangerous as a file-local variable.
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 2976d0db3e4..cecc180f522 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,17 @@
12006-04-28 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * mm-uu.el (mm-uu-pgp-encrypted-extract-1): Assume buffer is made
4 unibyte after clear-decrypt function runs.
5
6 * mml2015.el (mml2015-pgg-clear-decrypt): Treat data which pgg
7 returns as a unibyte string.
8
92006-04-27 Katsumi Yamaoka <yamaoka@jpl.org>
10
11 * mml1991.el (mml1991-pgg-sign): No need to load pgg.el, which is
12 always loaded by way of gnus-art.el -> mm-uu.el -> mml2015.el.
13 (mml1991-pgg-encrypt): Ditto.
14
12006-04-26 Reiner Steib <Reiner.Steib@gmx.de> 152006-04-26 Reiner Steib <Reiner.Steib@gmx.de>
2 16
3 * deuglify.el (gnus-outlook-deuglify-unwrap-min) 17 * deuglify.el (gnus-outlook-deuglify-unwrap-min)
@@ -21,6 +35,18 @@
21 (mml-attach-file, mml-attach-buffer, mml-attach-external): Sync 35 (mml-attach-file, mml-attach-buffer, mml-attach-external): Sync
22 DND support and use of message-in-body-p from the trunk. 36 DND support and use of message-in-body-p from the trunk.
23 37
382006-04-26 Katsumi Yamaoka <yamaoka@jpl.org>
39
40 * mml1991.el (mml1991-pgg-sign): Make sure to load pgg.el before
41 binding pgg-* variables; reimplement the section which prevents
42 MIME header from being signed.
43 (mml1991-pgg-encrypt): Make sure to load pgg.el before binding
44 pgg-text-mode; remove a blank line at the top of body.
45
46 * mm-uu.el (mm-uu-pgp-encrypted-extract-1): Don't remove blank
47 lines at the top of body; use gnus-newsgroup-charset if there's no
48 Charset header.
49
242006-04-25 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> 502006-04-25 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de>
25 51
26 * nnweb.el (nnweb-google-wash-article): Sync up to new Google 52 * nnweb.el (nnweb-google-wash-article): Sync up to new Google
@@ -458,13 +484,6 @@
458 484
4592006-02-09 Daiki Ueno <ueno@unixuser.org> 4852006-02-09 Daiki Ueno <ueno@unixuser.org>
460 486
461 * pgg-gpg.el (pgg-gpg-encrypt-region): Don't convert line-endings
462 in elisp.
463 (pgg-gpg-encrypt-symmetric-region): Ditto.
464 (pgg-gpg-sign-region): Ditto.
465
466 * pgg-def.el (pgg-text-mode): New variable.
467
468 * mml2015.el (mml2015-pgg-sign): Enable pgg-text-mode. 487 * mml2015.el (mml2015-pgg-sign): Enable pgg-text-mode.
469 (mml2015-pgg-encrypt): Ditto. 488 (mml2015-pgg-encrypt): Ditto.
470 489
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index 944e40bc964..9d9d87a3670 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -436,11 +436,18 @@ Return that buffer."
436 "OK"))) 436 "OK")))
437 (progn 437 (progn
438 ;; Decode charset. 438 ;; Decode charset.
439 (when (and (or charset 439 (if (and (or charset
440 (setq charset gnus-newsgroup-charset)) 440 (setq charset gnus-newsgroup-charset))
441 (setq charset (mm-charset-to-coding-system charset)) 441 (setq charset (mm-charset-to-coding-system charset))
442 (not (eq charset 'ascii))) 442 (not (eq charset 'ascii)))
443 (mm-decode-coding-region (point-min) (point-max) charset)) 443 ;; Assume that buffer's multibyteness is turned off.
444 ;; See `mml2015-pgg-clear-decrypt'.
445 (insert (mm-decode-coding-string (prog1
446 (buffer-string)
447 (erase-buffer)
448 (mm-enable-multibyte))
449 charset))
450 (mm-enable-multibyte))
444 (list (mm-make-handle buf mm-uu-text-plain-type))) 451 (list (mm-make-handle buf mm-uu-text-plain-type)))
445 (list (mm-make-handle buf '("application/pgp-encrypted"))))))) 452 (list (mm-make-handle buf '("application/pgp-encrypted")))))))
446 453
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index 23953cd6208..4db3540aec1 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -229,8 +229,6 @@
229 (defvar pgg-output-buffer)) 229 (defvar pgg-output-buffer))
230 230
231(defun mml1991-pgg-sign (cont) 231(defun mml1991-pgg-sign (cont)
232 ;; Make sure to load pgg.el before binding pgg-* variables.
233 (require 'pgg)
234 (let ((pgg-text-mode t) 232 (let ((pgg-text-mode t)
235 (pgg-default-user-id (or (message-options-get 'mml-sender) 233 (pgg-default-user-id (or (message-options-get 'mml-sender)
236 pgg-default-user-id)) 234 pgg-default-user-id))
@@ -275,19 +273,16 @@
275 (delete-region (point-min) (point)) 273 (delete-region (point-min) (point))
276 (when cte 274 (when cte
277 (mm-decode-content-transfer-encoding (intern (downcase cte)))))) 275 (mm-decode-content-transfer-encoding (intern (downcase cte))))))
278 (unless (progn 276 (unless (let ((pgg-text-mode t))
279 ;; Make sure to load pgg.el before binding `pgg-text-mode'. 277 (pgg-encrypt-region
280 (require 'pgg) 278 (point-min) (point-max)
281 (let ((pgg-text-mode t)) 279 (split-string
282 (pgg-encrypt-region 280 (or
283 (point-min) (point-max) 281 (message-options-get 'message-recipients)
284 (split-string 282 (message-options-set 'message-recipients
285 (or 283 (read-string "Recipients: ")))
286 (message-options-get 'message-recipients) 284 "[ \f\t\n\r\v,]+")
287 (message-options-set 'message-recipients 285 sign))
288 (read-string "Recipients: ")))
289 "[ \f\t\n\r\v,]+")
290 sign)))
291 (pop-to-buffer pgg-errors-buffer) 286 (pop-to-buffer pgg-errors-buffer)
292 (error "Encrypt error")) 287 (error "Encrypt error"))
293 (delete-region (point-min) (point-max)) 288 (delete-region (point-min) (point-max))
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el
index 80dd5b26597..591ef647678 100644
--- a/lisp/gnus/mml2015.el
+++ b/lisp/gnus/mml2015.el
@@ -707,6 +707,8 @@
707 (buffer-string)))) 707 (buffer-string))))
708 (progn 708 (progn
709 (erase-buffer) 709 (erase-buffer)
710 ;; Treat data which pgg returns as a unibyte string.
711 (mm-disable-multibyte)
710 (insert-buffer-substring pgg-output-buffer) 712 (insert-buffer-substring pgg-output-buffer)
711 (goto-char (point-min)) 713 (goto-char (point-min))
712 (while (search-forward "\r\n" nil t) 714 (while (search-forward "\r\n" nil t)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 0a78ed8d68b..12a4b4bdbf2 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -638,6 +638,7 @@ it is displayed along with the global value."
638 (indirect-variable variable) 638 (indirect-variable variable)
639 (error variable))) 639 (error variable)))
640 (obsolete (get variable 'byte-obsolete-variable)) 640 (obsolete (get variable 'byte-obsolete-variable))
641 (safe-var (get variable 'safe-local-variable))
641 (doc (or (documentation-property variable 'variable-documentation) 642 (doc (or (documentation-property variable 'variable-documentation)
642 (documentation-property alias 'variable-documentation)))) 643 (documentation-property alias 'variable-documentation))))
643 (unless (eq alias variable) 644 (unless (eq alias variable)
@@ -649,6 +650,11 @@ it is displayed along with the global value."
649 (princ (if (stringp (car obsolete)) (car obsolete) 650 (princ (if (stringp (car obsolete)) (car obsolete)
650 (format "use `%s' instead." (car obsolete)))) 651 (format "use `%s' instead." (car obsolete))))
651 (terpri)) 652 (terpri))
653 (when safe-var
654 (princ "This variable is safe to use as a file local variable")
655 (princ (format " only if its value\nsatisfies the predicate `%s'.\n"
656 safe-var))
657 (terpri))
652 (princ "Documentation:\n") 658 (princ "Documentation:\n")
653 (princ (or doc "Not documented as a variable."))) 659 (princ (or doc "Not documented as a variable.")))
654 ;; Make a link to customize if this variable can be customized. 660 ;; Make a link to customize if this variable can be customized.
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index a5cdf1f4d72..0c6e0f47453 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -197,7 +197,10 @@ Commands:
197 (view-mode) 197 (view-mode)
198 (make-local-variable 'view-no-disable-on-exit) 198 (make-local-variable 'view-no-disable-on-exit)
199 (setq view-no-disable-on-exit t) 199 (setq view-no-disable-on-exit t)
200 (setq view-exit-action (lambda (buffer) (delete-window))) 200 (setq view-exit-action (lambda (buffer)
201 (or (window-minibuffer-p (selected-window))
202 (one-window-p t)
203 (delete-window))))
201 (run-mode-hooks 'help-mode-hook)) 204 (run-mode-hooks 'help-mode-hook))
202 205
203;;;###autoload 206;;;###autoload
diff --git a/lisp/log-edit.el b/lisp/log-edit.el
index 0c7a655a237..611bab0a247 100644
--- a/lisp/log-edit.el
+++ b/lisp/log-edit.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1999, 2000, 2002, 2003, 2004, 3;; Copyright (C) 1999, 2000, 2002, 2003, 2004,
4;; 2005, 2006 Free Software Foundation, Inc. 4;; 2005, 2006 Free Software Foundation, Inc.
5 5
6;; Author: Stefan Monnier <monnier@cs.yale.edu> 6;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
7;; Keywords: pcl-cvs cvs commit log 7;; Keywords: pcl-cvs cvs commit log
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
diff --git a/lisp/log-view.el b/lisp/log-view.el
index 8a6f88650d2..dbee454b7d6 100644
--- a/lisp/log-view.el
+++ b/lisp/log-view.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4;; 2006 Free Software Foundation, Inc. 4;; 2006 Free Software Foundation, Inc.
5 5
6;; Author: Stefan Monnier <monnier@cs.yale.edu> 6;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
7;; Keywords: rcs sccs cvs log version-control 7;; Keywords: rcs sccs cvs log version-control
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 2f84e2e8222..f7846394638 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,9 @@
12006-04-28 Bill Wohler <wohler@newt.com>
2
3 Release MH-E version 7.95.
4
5 * mh-e.el (Version, mh-version): Update for release 7.95.
6
12006-04-26 Eric Ding <ericding@alum.mit.edu> 72006-04-26 Eric Ding <ericding@alum.mit.edu>
2 8
3 * mh-e.el (mh-invisible-header-fields-internal): Add entry 9 * mh-e.el (mh-invisible-header-fields-internal): Add entry
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 4b7627562f0..88b8c5bac09 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -6,7 +6,7 @@
6 6
7;; Author: Bill Wohler <wohler@newt.com> 7;; Author: Bill Wohler <wohler@newt.com>
8;; Maintainer: Bill Wohler <wohler@newt.com> 8;; Maintainer: Bill Wohler <wohler@newt.com>
9;; Version: 7.94+cvs 9;; Version: 7.95
10;; Keywords: mail 10;; Keywords: mail
11 11
12;; This file is part of GNU Emacs. 12;; This file is part of GNU Emacs.
@@ -136,7 +136,7 @@
136;; Try to keep variables local to a single file. Provide accessors if 136;; Try to keep variables local to a single file. Provide accessors if
137;; variables are shared. Use this section as a last resort. 137;; variables are shared. Use this section as a last resort.
138 138
139(defconst mh-version "7.94+cvs" "Version number of MH-E.") 139(defconst mh-version "7.95" "Version number of MH-E.")
140 140
141;; Variants 141;; Variants
142 142
diff --git a/lisp/msb.el b/lisp/msb.el
index 95cbfc85df4..61ddce5dae0 100644
--- a/lisp/msb.el
+++ b/lisp/msb.el
@@ -473,6 +473,11 @@ selects that window.
473See the function `mouse-select-buffer' and the variable 473See the function `mouse-select-buffer' and the variable
474`msb-menu-cond' for more information about how the menus are split." 474`msb-menu-cond' for more information about how the menus are split."
475 (interactive "e") 475 (interactive "e")
476 ;; If EVENT is a down-event, read and discard the
477 ;; corresponding up-event.
478 (and (eventp event)
479 (memq 'down (event-modifiers event))
480 (read-event))
476 (let ((old-window (selected-window)) 481 (let ((old-window (selected-window))
477 (window (posn-window (event-start event)))) 482 (window (posn-window (event-start event))))
478 (unless (framep window) (select-window window)) 483 (unless (framep window) (select-window window))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 5f3ab41e5cb..6e166aa2393 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1821,8 +1821,6 @@ while (my $data = <STDIN>) {
1821Escape sequence %s is replaced with name of Perl binary. 1821Escape sequence %s is replaced with name of Perl binary.
1822This string is passed to `format', so percent characters need to be doubled.") 1822This string is passed to `format', so percent characters need to be doubled.")
1823 1823
1824; These values conform to `file-attributes' from XEmacs 21.2.
1825; GNU Emacs and other tools not checked.
1826(defconst tramp-file-mode-type-map '((0 . "-") ; Normal file (SVID-v2 and XPG2) 1824(defconst tramp-file-mode-type-map '((0 . "-") ; Normal file (SVID-v2 and XPG2)
1827 (1 . "p") ; fifo 1825 (1 . "p") ; fifo
1828 (2 . "c") ; character device 1826 (2 . "c") ; character device
@@ -1927,17 +1925,12 @@ on the FILENAME argument, even if VISIT was a string.")
1927 "Alist of handler functions. 1925 "Alist of handler functions.
1928Operations not mentioned here will be handled by the normal Emacs functions.") 1926Operations not mentioned here will be handled by the normal Emacs functions.")
1929 1927
1930;; Handlers for partial tramp file names. For GNU Emacs just 1928;; Handlers for partial tramp file names. For Emacs just
1931;; `file-name-all-completions' is needed. The other ones are necessary 1929;; `file-name-all-completions' is needed.
1932;; for XEmacs. 1930;;;###autoload
1933(defconst tramp-completion-file-name-handler-alist 1931(defconst tramp-completion-file-name-handler-alist
1934 '( 1932 '((file-name-all-completions . tramp-completion-handle-file-name-all-completions)
1935 (file-name-directory . tramp-completion-handle-file-name-directory) 1933 (file-name-completion . tramp-completion-handle-file-name-completion))
1936 (file-name-nondirectory . tramp-completion-handle-file-name-nondirectory)
1937 (file-exists-p . tramp-completion-handle-file-exists-p)
1938 (file-name-all-completions . tramp-completion-handle-file-name-all-completions)
1939 (file-name-completion . tramp-completion-handle-file-name-completion)
1940 (expand-file-name . tramp-completion-handle-expand-file-name))
1941 "Alist of completion handler functions. 1934 "Alist of completion handler functions.
1942Used for file names matching `tramp-file-name-regexp'. Operations not 1935Used for file names matching `tramp-file-name-regexp'. Operations not
1943mentioned here will be handled by `tramp-file-name-handler-alist' or the 1936mentioned here will be handled by `tramp-file-name-handler-alist' or the
@@ -2172,28 +2165,11 @@ target of the symlink differ."
2172;; Localname manipulation functions that grok TRAMP localnames... 2165;; Localname manipulation functions that grok TRAMP localnames...
2173(defun tramp-handle-file-name-directory (file) 2166(defun tramp-handle-file-name-directory (file)
2174 "Like `file-name-directory' but aware of TRAMP files." 2167 "Like `file-name-directory' but aware of TRAMP files."
2175 ;; everything except the last filename thing is the directory 2168 ;; Everything except the last filename thing is the directory.
2176 (with-parsed-tramp-file-name file nil 2169 (with-parsed-tramp-file-name file nil
2177 ;; For the following condition, two possibilities should be tried: 2170 ;; Run the command on the localname portion only.
2178 ;; (1) (string= localname "") 2171 (tramp-make-tramp-file-name
2179 ;; (2) (or (string= localname "") (string= localname "/")) 2172 multi-method method user host (file-name-directory (or localname "")))))
2180 ;; The second variant fails when completing a "/" directory on
2181 ;; the remote host, that is a filename which looks like
2182 ;; "/user@host:/". But maybe wildcards fail with the first variant.
2183 ;; We should do some investigation.
2184 (if (string= localname "")
2185 ;; For a filename like "/[foo]", we return "/". The `else'
2186 ;; case would return "/[foo]" unchanged. But if we do that,
2187 ;; then `file-expand-wildcards' ceases to work. It's not
2188 ;; quite clear to me what's the intuition that tells that this
2189 ;; behavior is the right behavior, but oh, well.
2190 "/"
2191 ;; run the command on the localname portion only
2192 ;; CCC: This should take into account the remote machine type, no?
2193 ;; --daniel <daniel@danann.net>
2194 (tramp-make-tramp-file-name multi-method method user host
2195 ;; This will not recurse...
2196 (or (file-name-directory localname) "")))))
2197 2173
2198(defun tramp-handle-file-name-nondirectory (file) 2174(defun tramp-handle-file-name-nondirectory (file)
2199 "Like `file-name-nondirectory' but aware of TRAMP files." 2175 "Like `file-name-nondirectory' but aware of TRAMP files."
@@ -4144,7 +4120,8 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
4144;; (inhibit-file-name-operation operation)) 4120;; (inhibit-file-name-operation operation))
4145;; (apply operation args))) 4121;; (apply operation args)))
4146 4122
4147(defun tramp-run-real-handler (operation args) 4123;;;###autoload
4124(progn (defun tramp-run-real-handler (operation args)
4148 "Invoke normal file name handler for OPERATION. 4125 "Invoke normal file name handler for OPERATION.
4149First arg specifies the OPERATION, second arg is a list of arguments to 4126First arg specifies the OPERATION, second arg is a list of arguments to
4150pass to the OPERATION." 4127pass to the OPERATION."
@@ -4157,13 +4134,14 @@ pass to the OPERATION."
4157 ,(and (eq inhibit-file-name-operation operation) 4134 ,(and (eq inhibit-file-name-operation operation)
4158 inhibit-file-name-handlers))) 4135 inhibit-file-name-handlers)))
4159 (inhibit-file-name-operation operation)) 4136 (inhibit-file-name-operation operation))
4160 (apply operation args))) 4137 (apply operation args))))
4161 4138
4162;; This function is used from `tramp-completion-file-name-handler' functions 4139;; This function is used from `tramp-completion-file-name-handler' functions
4163;; only, if `tramp-completion-mode' is true. But this cannot be checked here 4140;; only, if `tramp-completion-mode' is true. But this cannot be checked here
4164;; because the check is based on a full filename, not available for all 4141;; because the check is based on a full filename, not available for all
4165;; basic I/O operations. 4142;; basic I/O operations.
4166(defun tramp-completion-run-real-handler (operation args) 4143;;;###autoload
4144(progn (defun tramp-completion-run-real-handler (operation args)
4167 "Invoke `tramp-file-name-handler' for OPERATION. 4145 "Invoke `tramp-file-name-handler' for OPERATION.
4168First arg specifies the OPERATION, second arg is a list of arguments to 4146First arg specifies the OPERATION, second arg is a list of arguments to
4169pass to the OPERATION." 4147pass to the OPERATION."
@@ -4175,7 +4153,7 @@ pass to the OPERATION."
4175 ,(and (eq inhibit-file-name-operation operation) 4153 ,(and (eq inhibit-file-name-operation operation)
4176 inhibit-file-name-handlers))) 4154 inhibit-file-name-handlers)))
4177 (inhibit-file-name-operation operation)) 4155 (inhibit-file-name-operation operation))
4178 (apply operation args))) 4156 (apply operation args))))
4179 4157
4180;; We handle here all file primitives. Most of them have the file 4158;; We handle here all file primitives. Most of them have the file
4181;; name as first parameter; nevertheless we check for them explicitly 4159;; name as first parameter; nevertheless we check for them explicitly
@@ -4272,12 +4250,25 @@ ARGS are the arguments OPERATION has been called with."
4272(defun tramp-file-name-handler (operation &rest args) 4250(defun tramp-file-name-handler (operation &rest args)
4273 "Invoke Tramp file name handler. 4251 "Invoke Tramp file name handler.
4274Falls back to normal file name handler if no tramp file name handler exists." 4252Falls back to normal file name handler if no tramp file name handler exists."
4253;; (setq edebug-trace t)
4254;; (edebug-trace "%s" (with-output-to-string (backtrace)))
4275 (save-match-data 4255 (save-match-data
4276 (let* ((filename (apply 'tramp-file-name-for-operation operation args)) 4256 (let* ((filename (apply 'tramp-file-name-for-operation operation args))
4257 (completion (tramp-completion-mode filename))
4277 (foreign (tramp-find-foreign-file-name-handler filename))) 4258 (foreign (tramp-find-foreign-file-name-handler filename)))
4278 (cond 4259 (with-parsed-tramp-file-name filename nil
4279 (foreign (apply foreign operation args)) 4260 (cond
4280 (t (tramp-run-real-handler operation args)))))) 4261 ;; When we are in completion mode, some operations shouldn' be
4262 ;; handled by backend.
4263 ((and completion (memq operation '(expand-file-name)))
4264 (tramp-run-real-handler operation args))
4265 ((and completion (zerop (length localname))
4266 (memq operation '(file-exists-p file-directory-p)))
4267 t)
4268 ;; Call the backend function.
4269 (foreign (apply foreign operation args))
4270 ;; Nothing to do for us.
4271 (t (tramp-run-real-handler operation args)))))))
4281 4272
4282 4273
4283;; In Emacs, there is some concurrency due to timers. If a timer 4274;; In Emacs, there is some concurrency due to timers. If a timer
@@ -4325,42 +4316,39 @@ Fall back to normal file name handler if no Tramp handler exists."
4325 (setq tramp-locked tl)))) 4316 (setq tramp-locked tl))))
4326 4317
4327;;;###autoload 4318;;;###autoload
4328(defun tramp-completion-file-name-handler (operation &rest args) 4319(progn (defun tramp-completion-file-name-handler (operation &rest args)
4329 "Invoke tramp file name completion handler. 4320 "Invoke tramp file name completion handler.
4330Falls back to normal file name handler if no tramp file name handler exists." 4321Falls back to normal file name handler if no tramp file name handler exists."
4331;; (setq tramp-debug-buffer t) 4322;; (setq edebug-trace t)
4332;; (tramp-message 1 "%s %s" operation args) 4323;; (edebug-trace "%s" (with-output-to-string (backtrace)))
4333;; (tramp-message 1 "%s %s\n%s"
4334;; operation args (with-output-to-string (backtrace)))
4335 (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) 4324 (let ((fn (assoc operation tramp-completion-file-name-handler-alist)))
4336 (if fn 4325 (if fn
4337 (save-match-data (apply (cdr fn) args)) 4326 (save-match-data (apply (cdr fn) args))
4338 (tramp-completion-run-real-handler operation args)))) 4327 (tramp-completion-run-real-handler operation args)))))
4339 4328
4340;; Register in `file-name-handler-alist'.
4341;; `tramp-completion-file-name-handler' must not be active when temacs
4342;; dumps. And it makes no sense in batch mode anyway.
4343;;;###autoload 4329;;;###autoload
4344(defun tramp-register-file-name-handlers () 4330(defsubst tramp-register-file-name-handlers ()
4345 "Add tramp file name handlers to `file-name-handler-alist'." 4331 "Add tramp file name handlers to `file-name-handler-alist'."
4346 (unless noninteractive 4332 (add-to-list 'file-name-handler-alist
4347 (add-to-list 'file-name-handler-alist 4333 (cons tramp-file-name-regexp 'tramp-file-name-handler))
4348 (cons tramp-file-name-regexp 'tramp-file-name-handler)) 4334 (when partial-completion-mode
4349 (add-to-list 'file-name-handler-alist 4335 (add-to-list 'file-name-handler-alist
4350 (cons tramp-completion-file-name-regexp 4336 (cons tramp-completion-file-name-regexp
4351 'tramp-completion-file-name-handler)) 4337 'tramp-completion-file-name-handler))
4352 (put 'tramp-completion-file-name-handler 'safe-magic t))) 4338 (put 'tramp-completion-file-name-handler 'safe-magic t))
4339 ;; If jka-compr is already loaded, move it to the front of
4340 ;; `file-name-handler-alist'.
4341 (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist)))
4342 (when jka
4343 (setq file-name-handler-alist
4344 (cons jka (delete jka file-name-handler-alist))))))
4353 4345
4354;; LAMBDA function used temporarily, because older/other versions of 4346;; During autoload, it shall be checked whether
4355;; Tramp don't know of `tramp-register-file-name-handlers'. Can be 4347;; `partial-completion-mode' is active. Therefore registering will be
4356;; replaced once that DEFUN is established. Relevant for Emacs 22 only. 4348;; delayed.
4357;;;###;autoload(add-hook 'emacs-startup-hook 'tramp-register-file-name-handlers)
4358;;;###autoload(add-hook 4349;;;###autoload(add-hook
4359;;;###autoload 'emacs-startup-hook 4350;;;###autoload 'after-init-hook
4360;;;###autoload '(lambda () 4351;;;###autoload '(lambda () (tramp-register-file-name-handlers)))
4361;;;###autoload (condition-case nil
4362;;;###autoload (funcall 'tramp-register-file-name-handlers)
4363;;;###autoload (error nil))))
4364(tramp-register-file-name-handlers) 4352(tramp-register-file-name-handlers)
4365 4353
4366;;;###autoload 4354;;;###autoload
@@ -4374,16 +4362,6 @@ Falls back to normal file name handler if no tramp file name handler exists."
4374 4362
4375(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers) 4363(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers)
4376 4364
4377(defun tramp-repair-jka-compr ()
4378 "If jka-compr is already loaded, move it to the front of
4379`file-name-handler-alist'. On Emacs 22 or so this will not be
4380necessary anymore."
4381 (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist)))
4382 (when jka
4383 (setq file-name-handler-alist
4384 (cons jka (delete jka file-name-handler-alist))))))
4385(tramp-repair-jka-compr)
4386
4387 4365
4388;;; Interactions with other packages: 4366;;; Interactions with other packages:
4389 4367
@@ -4497,31 +4475,10 @@ necessary anymore."
4497 last-input-event) ?\ )))))) 4475 last-input-event) ?\ ))))))
4498 t))) 4476 t)))
4499 4477
4500(defun tramp-completion-handle-file-exists-p (filename)
4501 "Like `file-exists-p' for tramp files."
4502 (if (tramp-completion-mode filename)
4503 (tramp-run-real-handler
4504 'file-exists-p (list filename))
4505 (tramp-completion-run-real-handler
4506 'file-exists-p (list filename))))
4507
4508;; Localname manipulation in case of partial TRAMP file names.
4509(defun tramp-completion-handle-file-name-directory (file)
4510 "Like `file-name-directory' but aware of TRAMP files."
4511 (if (tramp-completion-mode file)
4512 "/"
4513 (tramp-completion-run-real-handler
4514 'file-name-directory (list file))))
4515
4516;; Localname manipulation in case of partial TRAMP file names.
4517(defun tramp-completion-handle-file-name-nondirectory (file)
4518 "Like `file-name-nondirectory' but aware of TRAMP files."
4519 (substring
4520 file (length (tramp-completion-handle-file-name-directory file))))
4521
4522;; Method, host name and user name completion. 4478;; Method, host name and user name completion.
4523;; `tramp-completion-dissect-file-name' returns a list of 4479;; `tramp-completion-dissect-file-name' returns a list of
4524;; tramp-file-name structures. For all of them we return possible completions. 4480;; tramp-file-name structures. For all of them we return possible completions.
4481;;;###autoload
4525(defun tramp-completion-handle-file-name-all-completions (filename directory) 4482(defun tramp-completion-handle-file-name-all-completions (filename directory)
4526 "Like `file-name-all-completions' for partial tramp files." 4483 "Like `file-name-all-completions' for partial tramp files."
4527 4484
@@ -4576,7 +4533,8 @@ necessary anymore."
4576 ;; unify list, remove nil elements 4533 ;; unify list, remove nil elements
4577 (while result 4534 (while result
4578 (let ((car (car result))) 4535 (let ((car (car result)))
4579 (when car (add-to-list 'result1 car)) 4536 (when car (add-to-list
4537 'result1 (substring car (length directory))))
4580 (setq result (cdr result)))) 4538 (setq result (cdr result))))
4581 4539
4582 ;; Complete local parts 4540 ;; Complete local parts
@@ -4595,6 +4553,7 @@ necessary anymore."
4595 (setq tramp-completion-mode nil))) 4553 (setq tramp-completion-mode nil)))
4596 4554
4597;; Method, host name and user name completion for a file. 4555;; Method, host name and user name completion for a file.
4556;;;###autoload
4598(defun tramp-completion-handle-file-name-completion (filename directory) 4557(defun tramp-completion-handle-file-name-completion (filename directory)
4599 "Like `file-name-completion' for tramp files." 4558 "Like `file-name-completion' for tramp files."
4600 (try-completion filename 4559 (try-completion filename
@@ -4721,8 +4680,7 @@ remote host and localname (filename on remote host)."
4721 (lambda (method) 4680 (lambda (method)
4722 (and method 4681 (and method
4723 (string-match (concat "^" (regexp-quote partial-method)) method) 4682 (string-match (concat "^" (regexp-quote partial-method)) method)
4724 ;; we must remove leading "/". 4683 (tramp-make-tramp-file-name nil method nil nil nil)))
4725 (substring (tramp-make-tramp-file-name nil method nil nil nil) 1)))
4726 (delete "multi" (mapcar 'car tramp-methods)))) 4684 (delete "multi" (mapcar 'car tramp-methods))))
4727 4685
4728;; Compares partial user and host names with possible completions. 4686;; Compares partial user and host names with possible completions.
@@ -4755,8 +4713,7 @@ PARTIAL-USER must match USER, PARTIAL-HOST must match HOST."
4755 host nil))) 4713 host nil)))
4756 4714
4757 (unless (zerop (+ (length user) (length host))) 4715 (unless (zerop (+ (length user) (length host)))
4758 ;; we must remove leading "/". 4716 (tramp-make-tramp-file-name nil method user host nil)))
4759 (substring (tramp-make-tramp-file-name nil method user host nil) 1)))
4760 4717
4761(defun tramp-parse-rhosts (filename) 4718(defun tramp-parse-rhosts (filename)
4762 "Return a list of (user host) tuples allowed to access. 4719 "Return a list of (user host) tuples allowed to access.
@@ -4975,15 +4932,6 @@ User may be nil."
4975 (forward-line 1) 4932 (forward-line 1)
4976 result)) 4933 result))
4977 4934
4978(defun tramp-completion-handle-expand-file-name (name &optional dir)
4979 "Like `expand-file-name' for tramp files."
4980 (let ((fullname (concat (or dir default-directory) name)))
4981 (if (tramp-completion-mode fullname)
4982 (tramp-run-real-handler
4983 'expand-file-name (list name dir))
4984 (tramp-completion-run-real-handler
4985 'expand-file-name (list name dir)))))
4986
4987;;; Internal Functions: 4935;;; Internal Functions:
4988 4936
4989(defun tramp-maybe-send-perl-script (multi-method method user host script name) 4937(defun tramp-maybe-send-perl-script (multi-method method user host script name)
diff --git a/lisp/pcvs-defs.el b/lisp/pcvs-defs.el
index 8f7de913261..127a550b28c 100644
--- a/lisp/pcvs-defs.el
+++ b/lisp/pcvs-defs.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 4;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
5 5
6;; Author: Stefan Monnier <monnier@cs.yale.edu> 6;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
7;; Keywords: pcl-cvs 7;; Keywords: pcl-cvs
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
diff --git a/lisp/pcvs-info.el b/lisp/pcvs-info.el
index 7d1a11ccb68..4aaa5add58d 100644
--- a/lisp/pcvs-info.el
+++ b/lisp/pcvs-info.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 4;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
5 5
6;; Author: Stefan Monnier <monnier@cs.yale.edu> 6;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
7;; Keywords: pcl-cvs 7;; Keywords: pcl-cvs
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
diff --git a/lisp/pcvs-parse.el b/lisp/pcvs-parse.el
index 892dc962767..0193939606c 100644
--- a/lisp/pcvs-parse.el
+++ b/lisp/pcvs-parse.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 4;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
5 5
6;; Author: Stefan Monnier <monnier@cs.yale.edu> 6;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
7;; Keywords: pcl-cvs 7;; Keywords: pcl-cvs
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
diff --git a/lisp/pcvs-util.el b/lisp/pcvs-util.el
index b04f3c121a1..cb18fc83d59 100644
--- a/lisp/pcvs-util.el
+++ b/lisp/pcvs-util.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 4;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
5 5
6;; Author: Stefan Monnier <monnier@cs.yale.edu> 6;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
7;; Keywords: pcl-cvs 7;; Keywords: pcl-cvs
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index a5163319fbf..4b3202c6e41 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -690,10 +690,13 @@ With arg, enter name of variable to be watched in the minibuffer."
690 (if event (posn-set-point (event-end event))) 690 (if event (posn-set-point (event-end event)))
691 (require 'tooltip) 691 (require 'tooltip)
692 (save-selected-window 692 (save-selected-window
693 (let ((expr (if arg 693 (let ((expr
694 (completing-read "Name of variable: " 694 (if arg
695 'gud-gdb-complete-command) 695 (completing-read "Name of variable: "
696 (tooltip-identifier-from-point (point))))) 696 'gud-gdb-complete-command)
697 (if (and transient-mark-mode mark-active)
698 (buffer-substring (region-beginning) (region-end))
699 (tooltip-identifier-from-point (point))))))
697 (catch 'already-watched 700 (catch 'already-watched
698 (dolist (var gdb-var-list) 701 (dolist (var gdb-var-list)
699 (unless (string-match "\\." (car var)) 702 (unless (string-match "\\." (car var))
@@ -2691,7 +2694,7 @@ corresponding to the mode line clicked."
2691 '(menu-item "Inferior IO" gdb-frame-separate-io-buffer 2694 '(menu-item "Inferior IO" gdb-frame-separate-io-buffer
2692 :enable gdb-use-separate-io-buffer)) 2695 :enable gdb-use-separate-io-buffer))
2693 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) 2696 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
2694 (define-key menu [disassembly] '("Disassembiy" . gdb-frame-assembler-buffer)) 2697 (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer))
2695 (define-key menu [breakpoints] 2698 (define-key menu [breakpoints]
2696 '("Breakpoints" . gdb-frame-breakpoints-buffer)) 2699 '("Breakpoints" . gdb-frame-breakpoints-buffer))
2697 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer)) 2700 (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 6afa3f29348..c695272e92b 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -35,7 +35,7 @@
35 35
36 36
37(defgroup grep nil 37(defgroup grep nil
38 "Run compiler as inferior of Emacs, parse error messages." 38 "Run grep as inferior of Emacs, parse error messages."
39 :group 'tools 39 :group 'tools
40 :group 'processes) 40 :group 'processes)
41 41
@@ -48,23 +48,6 @@
48 :version "22.1" 48 :version "22.1"
49 :group 'grep) 49 :group 'grep)
50 50
51(defcustom grep-auto-highlight t
52 "*Specify how many grep matches to highlight (and parse) initially.
53\(Highlighting applies to an grep match when the mouse is over it.)
54If this is a number N, all grep matches in the first N lines
55are highlighted and parsed as soon as they arrive in Emacs.
56If t, highlight and parse the whole grep output as soon as it arrives.
57If nil, don't highlight or parse any of the grep buffer until you try to
58move to the error messages.
59
60Those grep matches which are not parsed and highlighted initially
61will be parsed and highlighted as soon as you try to move to them."
62 :type '(choice (const :tag "All" t)
63 (const :tag "None" nil)
64 (integer :tag "First N lines"))
65 :version "22.1"
66 :group 'grep)
67
68(defcustom grep-highlight-matches 'auto-detect 51(defcustom grep-highlight-matches 'auto-detect
69 "If t, use special markers to highlight grep matches. 52 "If t, use special markers to highlight grep matches.
70 53
@@ -108,6 +91,20 @@ call that function before using this variable in your program."
108 (const :tag "Not Set" nil)) 91 (const :tag "Not Set" nil))
109 :group 'grep) 92 :group 'grep)
110 93
94(defcustom grep-template nil
95 "The default command to run for \\[lgrep].
96The default value of this variable is set up by `grep-compute-defaults';
97call that function before using this variable in your program.
98The following place holders should be present in the string:
99 <C> - place to put -i if case insensitive grep.
100 <F> - file names and wildcards to search.
101 <R> - the regular expression searched for.
102 <N> - place to insert null-device."
103 :type '(choice string
104 (const :tag "Not Set" nil))
105 :version "22.1"
106 :group 'grep)
107
111(defcustom grep-use-null-device 'auto-detect 108(defcustom grep-use-null-device 'auto-detect
112 "If t, append the value of `null-device' to `grep' commands. 109 "If t, append the value of `null-device' to `grep' commands.
113This is done to ensure that the output of grep includes the filename of 110This is done to ensure that the output of grep includes the filename of
@@ -130,8 +127,8 @@ call that function before using this variable in your program."
130 (const :tag "Not Set" nil)) 127 (const :tag "Not Set" nil))
131 :group 'grep) 128 :group 'grep)
132 129
133(defcustom grep-tree-command nil 130(defcustom grep-find-template nil
134 "The default find command for \\[grep-tree]. 131 "The default command to run for \\[rgrep].
135The default value of this variable is set up by `grep-compute-defaults'; 132The default value of this variable is set up by `grep-compute-defaults';
136call that function before using this variable in your program. 133call that function before using this variable in your program.
137The following place holders should be present in the string: 134The following place holders should be present in the string:
@@ -145,27 +142,22 @@ The following place holders should be present in the string:
145 :version "22.1" 142 :version "22.1"
146 :group 'grep) 143 :group 'grep)
147 144
148(defcustom grep-tree-files-aliases '( 145(defcustom grep-files-aliases '(
146 ("el" . "*.el")
149 ("ch" . "*.[ch]") 147 ("ch" . "*.[ch]")
150 ("c" . "*.c") 148 ("c" . "*.c")
151 ("h" . "*.h") 149 ("h" . "*.h")
152 ("m" . "[Mm]akefile*")
153 ("asm" . "*.[sS]") 150 ("asm" . "*.[sS]")
154 ("all" . "*") 151 ("m" . "[Mm]akefile*")
155 ("el" . "*.el") 152 ("l" . "[Cc]hange[Ll]og*")
156 ) 153 )
157 "*Alist of aliases for the FILES argument to `grep-tree'." 154 "*Alist of aliases for the FILES argument to `lgrep' and `rgrep'."
158 :type 'alist 155 :type 'alist
159 :group 'grep) 156 :group 'grep)
160 157
161(defcustom grep-tree-ignore-case t 158(defcustom grep-find-ignored-directories '("CVS" ".hg" "{arch}")
162 "*If non-nil, `grep-tree' ignores case in matches." 159 "*List of names of sub-directories which `rgrep' shall not recurse into."
163 :type 'boolean 160 :type '(repeat string)
164 :group 'grep)
165
166(defcustom grep-tree-ignore-CVS-directories t
167 "*If non-nil, `grep-tree' does no recurse into CVS directories."
168 :type 'boolean
169 :group 'grep) 161 :group 'grep)
170 162
171(defcustom grep-error-screen-columns nil 163(defcustom grep-error-screen-columns nil
@@ -208,6 +200,8 @@ See `compilation-error-screen-columns'"
208 '("Compile..." . compile)) 200 '("Compile..." . compile))
209 (define-key map [menu-bar grep compilation-grep] 201 (define-key map [menu-bar grep compilation-grep]
210 '("Another grep..." . grep)) 202 '("Another grep..." . grep))
203 (define-key map [menu-bar grep compilation-grep-find]
204 '("Recursive grep..." . grep-find))
211 (define-key map [menu-bar grep compilation-recompile] 205 (define-key map [menu-bar grep compilation-recompile]
212 '("Repeat grep" . recompile)) 206 '("Repeat grep" . recompile))
213 (define-key map [menu-bar grep compilation-separator2] 207 (define-key map [menu-bar grep compilation-separator2]
@@ -353,6 +347,11 @@ This variable's value takes effect when `grep-compute-defaults' is called.")
353;;;###autoload 347;;;###autoload
354(defvar grep-find-history nil) 348(defvar grep-find-history nil)
355 349
350;; History of lgrep and rgrep regexp and files args.
351(defvar grep-regexp-history nil)
352(defvar grep-files-history '("ch" "el"))
353
354
356;;;###autoload 355;;;###autoload
357(defun grep-process-setup () 356(defun grep-process-setup ()
358 "Setup compilation variables and buffer for `grep'. 357 "Setup compilation variables and buffer for `grep'.
@@ -378,6 +377,12 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
378 (cons msg code)))) 377 (cons msg code))))
379 (run-hooks 'grep-setup-hook)) 378 (run-hooks 'grep-setup-hook))
380 379
380(defun grep-probe (command args &optional func result)
381 (equal (condition-case nil
382 (apply (or func 'call-process) command args)
383 (error nil))
384 (or result 0)))
385
381;;;###autoload 386;;;###autoload
382(defun grep-compute-defaults () 387(defun grep-compute-defaults ()
383 (unless (or (not grep-use-null-device) (eq grep-use-null-device t)) 388 (unless (or (not grep-use-null-device) (eq grep-use-null-device t))
@@ -385,73 +390,67 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
385 (with-temp-buffer 390 (with-temp-buffer
386 (let ((hello-file (expand-file-name "HELLO" data-directory))) 391 (let ((hello-file (expand-file-name "HELLO" data-directory)))
387 (not 392 (not
388 (and (equal (condition-case nil 393 (and (if grep-command
389 (if grep-command 394 ;; `grep-command' is already set, so
390 ;; `grep-command' is already set, so 395 ;; use that for testing.
391 ;; use that for testing. 396 (grep-probe grep-command
392 (call-process-shell-command 397 `(nil t nil "^English" ,hello-file)
393 grep-command nil t nil 398 #'call-process-shell-command)
394 "^English" hello-file) 399 ;; otherwise use `grep-program'
395 ;; otherwise use `grep-program' 400 (grep-probe grep-program
396 (call-process grep-program nil t nil 401 `(nil t nil "-nH" "^English" ,hello-file)))
397 "-nH" "^English" hello-file))
398 (error nil))
399 0)
400 (progn 402 (progn
401 (goto-char (point-min)) 403 (goto-char (point-min))
402 (looking-at 404 (looking-at
403 (concat (regexp-quote hello-file) 405 (concat (regexp-quote hello-file)
404 ":[0-9]+:English"))))))))) 406 ":[0-9]+:English")))))))))
405 (unless grep-command 407 (unless (and grep-command grep-find-command
406 (setq grep-command 408 grep-template grep-find-template)
407 (let ((required-options (if grep-use-null-device "-n" "-nH"))) 409 (let ((grep-options
408 (if (equal (condition-case nil ; in case "grep" isn't in exec-path 410 (concat (if grep-use-null-device "-n" "-nH")
409 (call-process grep-program nil nil nil 411 (if (grep-probe grep-program
410 "-e" "foo" null-device) 412 `(nil nil nil "-e" "foo" ,null-device)
411 (error nil)) 413 nil 1)
412 1) 414 " -e"))))
413 (format "%s %s -e " grep-program required-options) 415 (unless grep-command
414 (format "%s %s " grep-program required-options))))) 416 (setq grep-command
415 (unless grep-find-use-xargs 417 (format "%s %s " grep-program grep-options)))
416 (setq grep-find-use-xargs 418 (unless grep-template
417 (if (and 419 (setq grep-template
418 (equal (call-process "find" nil nil nil 420 (format "%s <C> %s <R> <F>" grep-program grep-options)))
419 null-device "-print0") 421 (unless grep-find-use-xargs
420 0) 422 (setq grep-find-use-xargs
421 (equal (call-process "xargs" nil nil nil 423 (if (and
422 "-0" "-e" "echo") 424 (grep-probe find-program `(nil nil nil ,null-device "-print0"))
423 0)) 425 (grep-probe "xargs" `(nil nil nil "-0" "-e" "echo")))
424 'gnu))) 426 'gnu)))
425 (unless grep-find-command 427 (unless grep-find-command
426 (setq grep-find-command 428 (setq grep-find-command
427 (cond ((eq grep-find-use-xargs 'gnu) 429 (cond ((eq grep-find-use-xargs 'gnu)
428 (format "%s . -type f -print0 | xargs -0 -e %s" 430 (format "%s . -type f -print0 | xargs -0 -e %s"
429 find-program grep-command)) 431 find-program grep-command))
430 (grep-find-use-xargs 432 (grep-find-use-xargs
431 (format "%s . -type f -print | xargs %s" 433 (format "%s . -type f -print | xargs %s"
432 find-program grep-command)) 434 find-program grep-command))
433 (t (cons (format "%s . -type f -exec %s {} %s \\;" 435 (t (cons (format "%s . -type f -exec %s {} %s \\;"
434 find-program grep-command null-device) 436 find-program grep-command null-device)
435 (+ 22 (length grep-command))))))) 437 (+ 22 (length grep-command)))))))
436 (unless grep-tree-command 438 (unless grep-find-template
437 (setq grep-tree-command 439 (setq grep-find-template
438 (let* ((glen (length grep-program)) 440 (let ((gcmd (format "%s <C> %s <R>"
439 (gcmd (concat grep-program " <C>" (substring grep-command glen)))) 441 grep-program grep-options)))
440 (cond ((eq grep-find-use-xargs 'gnu) 442 (cond ((eq grep-find-use-xargs 'gnu)
441 (format "%s <D> <X> -type f <F> -print0 | xargs -0 -e %s <R>" 443 (format "%s . <X> -type f <F> -print0 | xargs -0 -e %s"
442 find-program gcmd)) 444 find-program gcmd))
443 (grep-find-use-xargs 445 (grep-find-use-xargs
444 (format "%s <D> <X> -type f <F> -print | xargs %s <R>" 446 (format "%s . <X> -type f <F> -print | xargs %s"
445 find-program gcmd)) 447 find-program gcmd))
446 (t (format "%s <D> <X> -type f <F> -exec %s <R> {} %s \\;" 448 (t (format "%s . <X> -type f <F> -exec %s {} %s \\;"
447 find-program gcmd null-device)))))) 449 find-program gcmd null-device))))))))
448 (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t)) 450 (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t))
449 (setq grep-highlight-matches 451 (setq grep-highlight-matches
450 (with-temp-buffer 452 (with-temp-buffer
451 (and (equal (condition-case nil 453 (and (grep-probe grep-program '(nil t nil "--help"))
452 (call-process grep-program nil t nil "--help")
453 (error nil))
454 0)
455 (progn 454 (progn
456 (goto-char (point-min)) 455 (goto-char (point-min))
457 (search-forward "--color" nil t)) 456 (search-forward "--color" nil t))
@@ -487,8 +486,22 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
487 (file-name-extension buffer-file-name)))) 486 (file-name-extension buffer-file-name))))
488 (replace-match tag-default t t grep-default 1)))) 487 (replace-match tag-default t t grep-default 1))))
489 488
489
490;;;###autoload 490;;;###autoload
491(defun grep (command-args &optional highlight-regexp) 491(define-compilation-mode grep-mode "Grep"
492 "Sets `grep-last-buffer' and `compilation-window-height'."
493 (setq grep-last-buffer (current-buffer))
494 (set (make-local-variable 'compilation-error-face)
495 grep-hit-face)
496 (set (make-local-variable 'compilation-error-regexp-alist)
497 grep-regexp-alist)
498 (set (make-local-variable 'compilation-process-setup-function)
499 'grep-process-setup)
500 (set (make-local-variable 'compilation-disable-input) t))
501
502
503;;;###autoload
504(defun grep (command-args)
492 "Run grep, with user-specified args, and collect output in a buffer. 505 "Run grep, with user-specified args, and collect output in a buffer.
493While grep runs asynchronously, you can use \\[next-error] (M-x next-error), 506While grep runs asynchronously, you can use \\[next-error] (M-x next-error),
494or \\<grep-mode-map>\\[compile-goto-error] in the grep \ 507or \\<grep-mode-map>\\[compile-goto-error] in the grep \
@@ -501,15 +514,10 @@ easily repeat a grep command.
501A prefix argument says to default the argument based upon the current 514A prefix argument says to default the argument based upon the current
502tag the cursor is over, substituting it into the last grep command 515tag the cursor is over, substituting it into the last grep command
503in the grep command history (or into `grep-command' 516in the grep command history (or into `grep-command'
504if that history list is empty). 517if that history list is empty)."
505
506If specified, optional second arg HIGHLIGHT-REGEXP is the regexp to
507temporarily highlight in visited source lines."
508 (interactive 518 (interactive
509 (progn 519 (progn
510 (unless (and grep-command 520 (grep-compute-defaults)
511 (or (not grep-use-null-device) (eq grep-use-null-device t)))
512 (grep-compute-defaults))
513 (let ((default (grep-default-command))) 521 (let ((default (grep-default-command)))
514 (list (read-from-minibuffer "Run grep (like this): " 522 (list (read-from-minibuffer "Run grep (like this): "
515 (if current-prefix-arg 523 (if current-prefix-arg
@@ -522,19 +530,8 @@ temporarily highlight in visited source lines."
522 (compilation-start (if (and grep-use-null-device null-device) 530 (compilation-start (if (and grep-use-null-device null-device)
523 (concat command-args " " null-device) 531 (concat command-args " " null-device)
524 command-args) 532 command-args)
525 'grep-mode nil highlight-regexp)) 533 'grep-mode))
526 534
527;;;###autoload
528(define-compilation-mode grep-mode "Grep"
529 "Sets `grep-last-buffer' and `compilation-window-height'."
530 (setq grep-last-buffer (current-buffer))
531 (set (make-local-variable 'compilation-error-face)
532 grep-hit-face)
533 (set (make-local-variable 'compilation-error-regexp-alist)
534 grep-regexp-alist)
535 (set (make-local-variable 'compilation-process-setup-function)
536 'grep-process-setup)
537 (set (make-local-variable 'compilation-disable-input) t))
538 535
539;;;###autoload 536;;;###autoload
540(defun grep-find (command-args) 537(defun grep-find (command-args)
@@ -547,9 +544,7 @@ This command uses a special history list for its arguments, so you can
547easily repeat a find command." 544easily repeat a find command."
548 (interactive 545 (interactive
549 (progn 546 (progn
550 (unless (and grep-command 547 (grep-compute-defaults)
551 (or (not grep-use-null-device) (eq grep-use-null-device t)))
552 (grep-compute-defaults))
553 (if grep-find-command 548 (if grep-find-command
554 (list (read-from-minibuffer "Run find (like this): " 549 (list (read-from-minibuffer "Run find (like this): "
555 grep-find-command nil nil 550 grep-find-command nil nil
@@ -565,84 +560,190 @@ easily repeat a find command."
565;;;###autoload 560;;;###autoload
566(defalias 'find-grep 'grep-find) 561(defalias 'find-grep 'grep-find)
567 562
568(defun grep-expand-command-macros (command &optional regexp files dir excl case-fold) 563
569 "Patch grep COMMAND replacing <D>, etc." 564;; User-friendly interactive API.
570 (setq command 565
571 (replace-regexp-in-string "<D>" 566(defconst grep-expand-keywords
572 (or dir ".") command t t)) 567 '(("<C>" . (and cf (isearch-no-upper-case-p regexp t) "-i"))
573 (setq command 568 ("<D>" . dir)
574 (replace-regexp-in-string "<X>" 569 ("<F>" . files)
575 (or excl "") command t t)) 570 ("<N>" . null-device)
576 (setq command 571 ("<X>" . excl)
577 (replace-regexp-in-string "<F>" 572 ("<R>" . (shell-quote-argument (or regexp ""))))
578 (or files "") command t t)) 573 "List of substitutions performed by `grep-expand-template'.
579 (setq command 574If car of an element matches, the cdr is evalled in to get the
580 (replace-regexp-in-string "<C>" 575substitution string. Note dynamic scoping of variables.")
581 (if case-fold "-i" "") command t t)) 576
582 (setq command 577(defun grep-expand-template (template &optional regexp files dir excl)
583 (replace-regexp-in-string "<R>" 578 "Patch grep COMMAND string replacing <C>, <D>, <F>, <R>, and <X>."
584 (or regexp "") command t t)) 579 (let ((command template)
585 command) 580 (cf case-fold-search)
586 581 (case-fold-search nil))
587(defvar grep-tree-last-regexp "") 582 (dolist (kw grep-expand-keywords command)
588(defvar grep-tree-last-files (car (car grep-tree-files-aliases))) 583 (if (string-match (car kw) command)
584 (setq command
585 (replace-match
586 (or (if (symbolp (cdr kw))
587 (symbol-value (cdr kw))
588 (save-match-data (eval (cdr kw))))
589 "")
590 t t command))))))
591
592(defun grep-read-regexp ()
593 "Read regexp arg for interactive grep."
594 (let ((default
595 (or (funcall (or find-tag-default-function
596 (get major-mode 'find-tag-default-function)
597 'find-tag-default))
598 "")))
599 (read-string
600 (concat "Search for"
601 (if (and default (> (length default) 0))
602 (format " (default %s): " default) ": "))
603 nil 'grep-regexp-history default)))
604
605(defun grep-read-files (regexp)
606 "Read files arg for interactive grep."
607 (let* ((bn (or (buffer-file-name) (buffer-name)))
608 (fn (and bn
609 (stringp bn)
610 (file-name-nondirectory bn)))
611 (default
612 (or (and fn
613 (let ((aliases grep-files-aliases)
614 alias)
615 (while aliases
616 (setq alias (car aliases)
617 aliases (cdr aliases))
618 (if (string-match (wildcard-to-regexp (cdr alias)) fn)
619 (setq aliases nil)
620 (setq alias nil)))
621 (cdr alias)))
622 (and fn
623 (let ((ext (file-name-extension fn)))
624 (and ext (concat "*." ext))))))
625 (files (read-string
626 (concat "Search for \"" regexp
627 "\" in files"
628 (if default (concat " (default " default ")"))
629 ": ")
630 nil 'grep-files-history default)))
631 (and files
632 (or (cdr (assoc files grep-files-aliases))
633 files))))
589 634
590;;;###autoload 635;;;###autoload
591(defun grep-tree (regexp files dir &optional subdirs) 636(defun lgrep (regexp &optional files)
592 "Grep for REGEXP in FILES in directory tree rooted at DIR. 637 "Run grep, searching for REGEXP in FILES in current directory.
593Collect output in a buffer.
594Interactively, prompt separately for each search parameter.
595With prefix arg, reuse previous REGEXP.
596The search is limited to file names matching shell pattern FILES. 638The search is limited to file names matching shell pattern FILES.
597FILES may use abbreviations defined in `grep-tree-files-aliases', e.g. 639FILES may use abbreviations defined in `grep-files-aliases', e.g.
598entering `ch' is equivalent to `*.[ch]'. 640entering `ch' is equivalent to `*.[ch]'.
599 641
600While find runs asynchronously, you can use the \\[next-error] command 642With \\[universal-argument] prefix, allow user to edit the constructed
601to find the text that grep hits refer to. 643shell command line before it is executed.
644With two \\[universal-argument] prefixes, edit and run grep shell command.
602 645
603This command uses a special history list for its arguments, so you can 646Collect output in a buffer. While grep runs asynchronously, you
604easily repeat a find command. 647can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error]
648in the grep output buffer, to go to the lines where grep found matches.
605 649
606When used non-interactively, optional arg SUBDIRS limits the search to 650This command shares argument histories with \\[rgrep] and \\[grep]."
607those sub directories of DIR."
608 (interactive 651 (interactive
609 (let* ((regexp 652 (progn
610 (if current-prefix-arg 653 (grep-compute-defaults)
611 grep-tree-last-regexp 654 (cond
612 (let* ((default (current-word)) 655 ((and grep-command (equal current-prefix-arg '(16)))
613 (spec (read-string 656 (list (read-from-minibuffer "Run: " grep-command
614 (concat "Search for" 657 nil nil 'grep-history)
615 (if (and default (> (length default) 0)) 658 nil))
616 (format " (default %s): " default) ": "))))) 659 ((not grep-template)
617 (if (equal spec "") default spec)))) 660 (list nil
618 (files 661 (read-string "grep.el: No `grep-template' available. Press RET.")))
619 (read-string (concat "Search for \"" regexp "\" in files (default " grep-tree-last-files "): "))) 662 (t (let* ((regexp (grep-read-regexp))
620 (dir 663 (files (grep-read-files regexp)))
621 (read-directory-name "Base directory: " nil default-directory t))) 664 (list regexp files))))))
622 (list regexp files dir))) 665 (when (and (stringp regexp) (> (length regexp) 0))
623 (unless grep-tree-command 666 (let ((command regexp))
624 (grep-compute-defaults)) 667 (if (null files)
625 (unless (and (stringp files) (> (length files) 0)) 668 (if (string= command grep-command)
626 (setq files grep-tree-last-files)) 669 (setq command nil))
627 (when files 670 (setq command (grep-expand-template
628 (setq grep-tree-last-files files) 671 grep-template
629 (let ((mf (assoc files grep-tree-files-aliases))) 672 regexp
630 (if mf 673 files))
631 (setq files (cdr mf))))) 674 (when command
632 (let ((command-args (grep-expand-command-macros 675 (if (equal current-prefix-arg '(4))
633 grep-tree-command 676 (setq command
634 (setq grep-tree-last-regexp regexp) 677 (read-from-minibuffer "Confirm: "
635 (and files (concat "-name '" files "'")) 678 command nil nil 'grep-history))
636 (if subdirs 679 (push command grep-history))))
637 (if (stringp subdirs) 680 (when command
638 subdirs 681 ;; Setting process-setup-function makes exit-message-function work
639 (mapconcat 'identity subdirs " ")) 682 ;; even when async processes aren't supported.
640 nil) ;; we change default-directory to dir 683 (compilation-start (if (and grep-use-null-device null-device)
641 (and grep-tree-ignore-CVS-directories "-path '*/CVS' -prune -o ") 684 (concat command " " null-device)
642 grep-tree-ignore-case)) 685 command) 'grep-mode)))))
643 (default-directory (file-name-as-directory (expand-file-name dir))) 686
644 (null-device nil)) ; see grep 687
645 (grep command-args regexp))) 688;;;###autoload
689(defun rgrep (regexp &optional files dir)
690 "Recusively grep for REGEXP in FILES in directory tree rooted at DIR.
691The search is limited to file names matching shell pattern FILES.
692FILES may use abbreviations defined in `grep-files-aliases', e.g.
693entering `ch' is equivalent to `*.[ch]'.
694
695With \\[universal-argument] prefix, allow user to edit the constructed
696shell command line before it is executed.
697With two \\[universal-argument] prefixes, edit and run grep-find shell command.
698
699Collect output in a buffer. While find runs asynchronously, you
700can use \\[next-error] (M-x next-error), or \\<grep-mode-map>\\[compile-goto-error]
701in the grep output buffer, to go to the lines where grep found matches.
702
703This command shares argument histories with \\[lgrep] and \\[grep-find]."
704 (interactive
705 (progn
706 (grep-compute-defaults)
707 (cond
708 ((and grep-find-command (equal current-prefix-arg '(16)))
709 (list (read-from-minibuffer "Run: " grep-find-command
710 nil nil 'grep-find-history)
711 nil))
712 ((not grep-find-template)
713 (list nil nil
714 (read-string "grep.el: No `grep-find-template' available. Press RET.")))
715 (t (let* ((regexp (grep-read-regexp))
716 (files (grep-read-files regexp))
717 (dir (read-directory-name "Base directory: "
718 nil default-directory t)))
719 (list regexp files dir))))))
720 (when (and (stringp regexp) (> (length regexp) 0))
721 (if (null files)
722 (if (not (string= regexp grep-find-command))
723 (compilation-start regexp 'grep-mode))
724 (let* ((default-directory (file-name-as-directory (expand-file-name dir)))
725 (command (grep-expand-template
726 grep-find-template
727 regexp
728 (concat "\\( -name "
729 (mapconcat #'shell-quote-argument
730 (split-string files)
731 " -o -name ")
732 " \\)")
733 default-directory
734 (and grep-find-ignored-directories
735 (concat "\\( -path '*/"
736 (mapconcat #'identity
737 grep-find-ignored-directories
738 "' -o -path '*/")
739 "' \\) -prune -o ")))))
740 (when command
741 (if current-prefix-arg
742 (setq command
743 (read-from-minibuffer "Confirm: "
744 command nil nil 'grep-find-history))
745 (push command grep-find-history))
746 (compilation-start command 'grep-mode))))))
646 747
647 748
648(provide 'grep) 749(provide 'grep)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 1549150dfa8..11259aa3965 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -303,13 +303,15 @@ Uses `gud-<MINOR-MODE>-directories' to find the source files."
303optional doc string DOC. Certain %-escapes in the string arguments 303optional doc string DOC. Certain %-escapes in the string arguments
304are interpreted specially if present. These are: 304are interpreted specially if present. These are:
305 305
306 %f name (without directory) of current source file. 306 %f -- Name (without directory) of current source file.
307 %F name (without directory or extension) of current source file. 307 %F -- Name (without directory or extension) of current source file.
308 %d directory of current source file. 308 %d -- Directory of current source file.
309 %l number of current source line 309 %l -- Number of current source line.
310 %e text of the C lvalue or function-call expression surrounding point. 310 %e -- Text of the C lvalue or function-call expression surrounding point.
311 %a text of the hexadecimal address surrounding point 311 %a -- Text of the hexadecimal address surrounding point.
312 %p prefix argument to the command (if any) as a number 312 %p -- Prefix argument to the command (if any) as a number.
313 %c -- Fully qualified class name derived from the expression
314 surrounding point (jdb only).
313 315
314 The `current' source file is the file of the current buffer (if 316 The `current' source file is the file of the current buffer (if
315we're in a C file) or the source file current at the last break or 317we're in a C file) or the source file current at the last break or
@@ -446,8 +448,7 @@ required by the caller."
446 (when (or gdb-force-update 448 (when (or gdb-force-update
447 (not (save-excursion 449 (not (save-excursion
448 (goto-char (point-min)) 450 (goto-char (point-min))
449 (let ((case-fold-search t)) 451 (looking-at "Watch Expressions:"))))
450 (looking-at "Watch Expressions:")))))
451 (erase-buffer) 452 (erase-buffer)
452 (insert "Watch Expressions:\n") 453 (insert "Watch Expressions:\n")
453 (if gdb-speedbar-auto-raise 454 (if gdb-speedbar-auto-raise
@@ -2804,7 +2805,9 @@ Obeying it means displaying in another window the specified file and line."
2804 (let ((insource (not (eq (current-buffer) gud-comint-buffer))) 2805 (let ((insource (not (eq (current-buffer) gud-comint-buffer)))
2805 (frame (or gud-last-frame gud-last-last-frame)) 2806 (frame (or gud-last-frame gud-last-last-frame))
2806 result) 2807 result)
2807 (while (and str (string-match "\\([^%]*\\)%\\([adeflpc]\\)" str)) 2808 (while (and str
2809 (let ((case-fold-search nil))
2810 (string-match "\\([^%]*\\)%\\([adefFlpc]\\)" str)))
2808 (let ((key (string-to-char (match-string 2 str))) 2811 (let ((key (string-to-char (match-string 2 str)))
2809 subst) 2812 subst)
2810 (cond 2813 (cond
diff --git a/lisp/replace.el b/lisp/replace.el
index 3187bbbbd36..f1792b499fc 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1098,6 +1098,7 @@ See also `multi-occur'."
1098 (endpt nil) 1098 (endpt nil)
1099 (marker nil) 1099 (marker nil)
1100 (curstring "") 1100 (curstring "")
1101 (inhibit-field-text-motion t)
1101 (headerpt (with-current-buffer out-buf (point)))) 1102 (headerpt (with-current-buffer out-buf (point))))
1102 (with-current-buffer buf 1103 (with-current-buffer buf
1103 (or coding 1104 (or coding
diff --git a/lisp/reveal.el b/lisp/reveal.el
index 4120f9331b3..84411f98658 100644
--- a/lisp/reveal.el
+++ b/lisp/reveal.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 3;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
4;; 2005, 2006 Free Software Foundation, Inc. 4;; 2005, 2006 Free Software Foundation, Inc.
5 5
6;; Author: Stefan Monnier <monnier@cs.yale.edu> 6;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
7;; Keywords: outlines 7;; Keywords: outlines
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
diff --git a/lisp/simple.el b/lisp/simple.el
index 99192d79ec0..bf620c2533d 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1697,7 +1697,7 @@ This variable only matters if `undo-ask-before-discard' is non-nil.")
1697 ;; but we don't want to ask the question again. 1697 ;; but we don't want to ask the question again.
1698 (setq undo-extra-outer-limit (+ size 50000)) 1698 (setq undo-extra-outer-limit (+ size 50000))
1699 (if (let (use-dialog-box track-mouse executing-kbd-macro ) 1699 (if (let (use-dialog-box track-mouse executing-kbd-macro )
1700 (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? " 1700 (yes-or-no-p (format "Buffer `%s' undo info is %d bytes long; discard it? "
1701 (buffer-name) size))) 1701 (buffer-name) size)))
1702 (progn (setq buffer-undo-list nil) 1702 (progn (setq buffer-undo-list nil)
1703 (setq undo-extra-outer-limit nil) 1703 (setq undo-extra-outer-limit nil)
@@ -1705,7 +1705,7 @@ This variable only matters if `undo-ask-before-discard' is non-nil.")
1705 nil)) 1705 nil))
1706 (display-warning '(undo discard-info) 1706 (display-warning '(undo discard-info)
1707 (concat 1707 (concat
1708 (format "Buffer %s undo info was %d bytes long.\n" 1708 (format "Buffer `%s' undo info was %d bytes long.\n"
1709 (buffer-name) size) 1709 (buffer-name) size)
1710 "The undo info was discarded because it exceeded \ 1710 "The undo info was discarded because it exceeded \
1711`undo-outer-limit'. 1711`undo-outer-limit'.
diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el
index 9fddc4b1a05..8d9df188875 100644
--- a/lisp/smerge-mode.el
+++ b/lisp/smerge-mode.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 3;; Copyright (C) 1999, 2000, 2001, 2002, 2003,
4;; 2004, 2005, 2006 Free Software Foundation, Inc. 4;; 2004, 2005, 2006 Free Software Foundation, Inc.
5 5
6;; Author: Stefan Monnier <monnier@cs.yale.edu> 6;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
7;; Keywords: tools revision-control merge diff3 cvs conflict 7;; Keywords: tools revision-control merge diff3 cvs conflict
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
diff --git a/lisp/startup.el b/lisp/startup.el
index 695cdf4410f..07039fa8c18 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1623,7 +1623,7 @@ normal otherwise."
1623 (not noninteractive)) 1623 (not noninteractive))
1624 (display-warning 1624 (display-warning
1625 'initialization 1625 'initialization
1626 "Building Emacs overflowed pure space." 1626 "Building Emacs overflowed pure space. See \"(elisp)Building Emacs\" for more information."
1627 ;; FIXME: Tell the user what kind of problems are possible and how to fix 1627 ;; FIXME: Tell the user what kind of problems are possible and how to fix
1628 ;; the overflow. 1628 ;; the overflow.
1629 :warning)) 1629 :warning))
diff --git a/lisp/subr.el b/lisp/subr.el
index 6bd25f12dde..43f1d5e57b1 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1262,25 +1262,25 @@ If TOGGLE has a `:menu-tag', that is used for the menu item's label."
1262 1262
1263;;; Load history 1263;;; Load history
1264 1264
1265;;; (defvar symbol-file-load-history-loaded nil 1265;; (defvar symbol-file-load-history-loaded nil
1266;;; "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'. 1266;; "Non-nil means we have loaded the file `fns-VERSION.el' in `exec-directory'.
1267;;; That file records the part of `load-history' for preloaded files, 1267;; That file records the part of `load-history' for preloaded files,
1268;;; which is cleared out before dumping to make Emacs smaller.") 1268;; which is cleared out before dumping to make Emacs smaller.")
1269 1269
1270;;; (defun load-symbol-file-load-history () 1270;; (defun load-symbol-file-load-history ()
1271;;; "Load the file `fns-VERSION.el' in `exec-directory' if not already done. 1271;; "Load the file `fns-VERSION.el' in `exec-directory' if not already done.
1272;;; That file records the part of `load-history' for preloaded files, 1272;; That file records the part of `load-history' for preloaded files,
1273;;; which is cleared out before dumping to make Emacs smaller." 1273;; which is cleared out before dumping to make Emacs smaller."
1274;;; (unless symbol-file-load-history-loaded 1274;; (unless symbol-file-load-history-loaded
1275;;; (load (expand-file-name 1275;; (load (expand-file-name
1276;;; ;; fns-XX.YY.ZZ.el does not work on DOS filesystem. 1276;; ;; fns-XX.YY.ZZ.el does not work on DOS filesystem.
1277;;; (if (eq system-type 'ms-dos) 1277;; (if (eq system-type 'ms-dos)
1278;;; "fns.el" 1278;; "fns.el"
1279;;; (format "fns-%s.el" emacs-version)) 1279;; (format "fns-%s.el" emacs-version))
1280;;; exec-directory) 1280;; exec-directory)
1281;;; ;; The file name fns-%s.el already has a .el extension. 1281;; ;; The file name fns-%s.el already has a .el extension.
1282;;; nil nil t) 1282;; nil nil t)
1283;;; (setq symbol-file-load-history-loaded t))) 1283;; (setq symbol-file-load-history-loaded t)))
1284 1284
1285(defun symbol-file (symbol &optional type) 1285(defun symbol-file (symbol &optional type)
1286 "Return the input source in which SYMBOL was defined. 1286 "Return the input source in which SYMBOL was defined.
@@ -1927,6 +1927,10 @@ a system-dependent default device name is used."
1927Otherwise, return nil." 1927Otherwise, return nil."
1928 (or (stringp object) (null object))) 1928 (or (stringp object) (null object)))
1929 1929
1930(defun booleanp (object)
1931 "Return non-nil if OBJECT is one of the two canonical boolean values: t or nil."
1932 (memq object '(nil t)))
1933
1930 1934
1931;;;; Support for yanking and text properties. 1935;;;; Support for yanking and text properties.
1932 1936
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index ef5e8648b5c..4ab0606c18a 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -1480,7 +1480,7 @@ in `selection-converter-alist', which see."
1480 (re-search-forward 1480 (re-search-forward
1481 (mapconcat 'regexp-quote (split-string search-text) "\\|") 1481 (mapconcat 'regexp-quote (split-string search-text) "\\|")
1482 nil t))))) 1482 nil t)))))
1483 (raise-frame)) 1483 (select-frame-set-input-focus (selected-frame)))
1484 1484
1485(defun mac-ae-text (ae) 1485(defun mac-ae-text (ae)
1486 (or (cdr (mac-ae-parameter ae nil "TEXT")) 1486 (or (cdr (mac-ae-parameter ae nil "TEXT"))
@@ -2039,9 +2039,10 @@ Switch to a buffer editing the last file dropped."
2039 (dolist (file-name (nth 2 event)) 2039 (dolist (file-name (nth 2 event))
2040 (dnd-handle-one-url window 'private 2040 (dnd-handle-one-url window 'private
2041 (concat "file:" file-name)))) 2041 (concat "file:" file-name))))
2042 (raise-frame)) 2042 (select-frame-set-input-focus (selected-frame)))
2043 2043
2044(global-set-key [drag-n-drop] 'mac-drag-n-drop) 2044(global-set-key [drag-n-drop] 'mac-drag-n-drop)
2045(global-set-key [M-drag-n-drop] 'mac-drag-n-drop)
2045 2046
2046;;;; Non-toolkit Scroll bars 2047;;;; Non-toolkit Scroll bars
2047 2048
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 545e9fe14b5..9218c565c97 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -48,7 +48,7 @@ A value of nil means that any change in indentation starts a new paragraph."
48 "*Non-nil means put two spaces after a colon when filling." 48 "*Non-nil means put two spaces after a colon when filling."
49 :type 'boolean 49 :type 'boolean
50 :group 'fill) 50 :group 'fill)
51;;;###autoload(put 'colon-double-space 'safe-local-variable 'symbolp) 51;;;###autoload(put 'colon-double-space 'safe-local-variable 'booleanp)
52 52
53(defvar fill-paragraph-function nil 53(defvar fill-paragraph-function nil
54 "Mode-specific function to fill a paragraph, or nil if there is none. 54 "Mode-specific function to fill a paragraph, or nil if there is none.
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 9e7d02182ef..aac4cee4dd7 100644
--- a/lisp/textmodes/paragraphs.el
+++ b/lisp/textmodes/paragraphs.el
@@ -81,7 +81,7 @@ to paragraphs. The fill functions insert and delete only soft newlines."
81 (set-hard-newline-properties (point) (1+ (point))))))))))) 81 (set-hard-newline-properties (point) (1+ (point)))))))))))
82 82
83(defcustom paragraph-start "\f\\|[ \t]*$" "\ 83(defcustom paragraph-start "\f\\|[ \t]*$" "\
84*Regexp for beginning of a line that starts OR separates paragraphs. 84Regexp for beginning of a line that starts OR separates paragraphs.
85This regexp should match lines that separate paragraphs 85This regexp should match lines that separate paragraphs
86and should also match lines that start a paragraph 86and should also match lines that start a paragraph
87\(and are part of that paragraph). 87\(and are part of that paragraph).
@@ -107,7 +107,7 @@ hard newline are considered to match."
107;; start a new paragraph). 107;; start a new paragraph).
108 108
109(defcustom paragraph-separate "[ \t\f]*$" 109(defcustom paragraph-separate "[ \t\f]*$"
110 "*Regexp for beginning of a line that separates paragraphs. 110 "Regexp for beginning of a line that separates paragraphs.
111If you change this, you may have to change `paragraph-start' also. 111If you change this, you may have to change `paragraph-start' also.
112 112
113This is matched against the text at the left margin, which is not necessarily 113This is matched against the text at the left margin, which is not necessarily
@@ -119,7 +119,7 @@ text indented by a margin setting."
119;;;###autoload(put 'paragraph-separate 'safe-local-variable 'stringp) 119;;;###autoload(put 'paragraph-separate 'safe-local-variable 'stringp)
120 120
121(defcustom sentence-end-double-space t 121(defcustom sentence-end-double-space t
122 "*Non-nil means a single space does not end a sentence. 122 "Non-nil means a single space does not end a sentence.
123This is relevant for filling. See also `sentence-end-without-period' 123This is relevant for filling. See also `sentence-end-without-period'
124and `colon-double-space'. 124and `colon-double-space'.
125 125
@@ -128,10 +128,10 @@ regexp describing the end of a sentence, when the value of the variable
128`sentence-end' is nil. See Info node `(elisp)Standard Regexps'." 128`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
129 :type 'boolean 129 :type 'boolean
130 :group 'fill) 130 :group 'fill)
131;;;###autoload(put 'sentence-end-double-space 'safe-local-variable 'symbolp) 131;;;###autoload(put 'sentence-end-double-space 'safe-local-variable 'booleanp)
132 132
133(defcustom sentence-end-without-period nil 133(defcustom sentence-end-without-period nil
134 "*Non-nil means a sentence will end without a period. 134 "Non-nil means a sentence will end without a period.
135For example, a sentence in Thai text ends with double space but 135For example, a sentence in Thai text ends with double space but
136without a period. 136without a period.
137 137
@@ -140,21 +140,21 @@ regexp describing the end of a sentence, when the value of the variable
140`sentence-end' is nil. See Info node `(elisp)Standard Regexps'." 140`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
141 :type 'boolean 141 :type 'boolean
142 :group 'fill) 142 :group 'fill)
143;;;###autoload(put 'sentence-end-without-period 'safe-local-variable 'symbolp) 143;;;###autoload(put 'sentence-end-without-period 'safe-local-variable 'booleanp)
144 144
145(defcustom sentence-end-without-space 145(defcustom sentence-end-without-space
146 "$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B" 146 "$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B"
147 "*String of characters that end sentence without following spaces. 147 "String of characters that end sentence without following spaces.
148 148
149This value is used by the function `sentence-end' to construct the 149This value is used by the function `sentence-end' to construct the
150regexp describing the end of a sentence, when the value of the variable 150regexp describing the end of a sentence, when the value of the variable
151`sentence-end' is nil. See Info node `(elisp)Standard Regexps'." 151`sentence-end' is nil. See Info node `(elisp)Standard Regexps'."
152 :group 'paragraphs 152 :group 'paragraphs
153 :type 'string) 153 :type 'string)
154;;;###autoload(put 'sentence-end-without-space 'safe-local-variable 'symbolp) 154;;;###autoload(put 'sentence-end-without-space 'safe-local-variable 'stringp)
155 155
156(defcustom sentence-end nil 156(defcustom sentence-end nil
157 "*Regexp describing the end of a sentence. 157 "Regexp describing the end of a sentence.
158The value includes the whitespace following the sentence. 158The value includes the whitespace following the sentence.
159All paragraph boundaries also end sentences, regardless. 159All paragraph boundaries also end sentences, regardless.
160 160
@@ -166,7 +166,7 @@ to obtain the value of this variable."
166;;;###autoload(put 'sentence-end 'safe-local-variable 'string-or-null-p) 166;;;###autoload(put 'sentence-end 'safe-local-variable 'string-or-null-p)
167 167
168(defcustom sentence-end-base "[.?!][]\"'$B!I$,1r}(B)}]*" 168(defcustom sentence-end-base "[.?!][]\"'$B!I$,1r}(B)}]*"
169 "*Regexp matching the basic end of a sentence, not including following space." 169 "Regexp matching the basic end of a sentence, not including following space."
170 :group 'paragraphs 170 :group 'paragraphs
171 :type 'string 171 :type 'string
172 :version "22.1") 172 :version "22.1")
@@ -195,17 +195,17 @@ in between. See Info node `(elisp)Standard Regexps'."
195 "[ \t\n]*"))) 195 "[ \t\n]*")))
196 196
197(defcustom page-delimiter "^\014" 197(defcustom page-delimiter "^\014"
198 "*Regexp describing line-beginnings that separate pages." 198 "Regexp describing line-beginnings that separate pages."
199 :group 'paragraphs 199 :group 'paragraphs
200 :type 'regexp) 200 :type 'regexp)
201;;;###autoload(put 'page-delimiter 'safe-local-variable 'stringp) 201;;;###autoload(put 'page-delimiter 'safe-local-variable 'stringp)
202 202
203(defcustom paragraph-ignore-fill-prefix nil 203(defcustom paragraph-ignore-fill-prefix nil
204 "*Non-nil means the paragraph commands are not affected by `fill-prefix'. 204 "Non-nil means the paragraph commands are not affected by `fill-prefix'.
205This is desirable in modes where blank lines are the paragraph delimiters." 205This is desirable in modes where blank lines are the paragraph delimiters."
206 :group 'paragraphs 206 :group 'paragraphs
207 :type 'boolean) 207 :type 'boolean)
208;;;###autoload(put 'paragraph-ignore-fill-prefix 'safe-local-variable 'symbolp) 208;;;###autoload(put 'paragraph-ignore-fill-prefix 'safe-local-variable 'booleanp)
209 209
210(defun forward-paragraph (&optional arg) 210(defun forward-paragraph (&optional arg)
211 "Move forward to end of paragraph. 211 "Move forward to end of paragraph.
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 026336c301e..f4334fbbd70 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -975,7 +975,7 @@ immediately offer the correct label menu - otherwise it will prompt you for
975a label type. If you set this variable to nil, RefTeX will always prompt." 975a label type. If you set this variable to nil, RefTeX will always prompt."
976 :group 'reftex-referencing-labels 976 :group 'reftex-referencing-labels
977 :type 'boolean) 977 :type 'boolean)
978;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable 'symbolp) 978;;;###autoload(put 'reftex-guess-label-type 'safe-local-variable (lambda (x) (memq x '(nil t))))
979 979
980(defcustom reftex-format-ref-function nil 980(defcustom reftex-format-ref-function nil
981 "Function which produces the string to insert as a reference. 981 "Function which produces the string to insert as a reference.
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 023b90af5d9..e58114e5b26 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -269,21 +269,26 @@ holds a keymap."
269 269
270 ;; There's no icon appropriate for News and we need a command rather 270 ;; There's no icon appropriate for News and we need a command rather
271 ;; than a lambda for Read Mail. 271 ;; than a lambda for Read Mail.
272 ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose") 272 ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
273 273
274 (tool-bar-add-item-from-menu 'print-buffer "print") 274 (tool-bar-add-item-from-menu 'print-buffer "print")
275 (tool-bar-add-item "preferences" 'customize 'customize
276 :help "Edit preferences (customize)")
277 275
278 (tool-bar-add-item "help" (lambda () 276 ;; tool-bar-add-item-from-menu itself operates on
279 (interactive) 277 ;; (default-value 'tool-bar-map), but when we don't use that function,
280 (popup-menu menu-bar-help-menu)) 278 ;; we must explicitly operate on the default value.
281 'help
282 :help "Pop up the Help menu")
283 279
284 (setq tool-bar-setup t)))) 280 (let ((tool-bar-map (default-value 'tool-bar-map)))
281 (tool-bar-add-item "preferences" 'customize 'customize
282 :help "Edit preferences (customize)")
283
284 (tool-bar-add-item "help" (lambda ()
285 (interactive)
286 (popup-menu menu-bar-help-menu))
287 'help
288 :help "Pop up the Help menu"))
289 (setq tool-bar-setup t))))
285 290
286(provide 'tool-bar)
287 291
292(provide 'tool-bar)
288;;; arch-tag: 15f30f0a-d0d7-4d50-bbb7-f48fd0c8582f 293;;; arch-tag: 15f30f0a-d0d7-4d50-bbb7-f48fd0c8582f
289;;; tool-bar.el ends here 294;;; tool-bar.el ends here
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index ac6bd07a175..020e667ec16 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,31 @@
12006-05-01 Richard Stallman <rms@gnu.org>
2
3 * intro.texi (nil and t): Clarify.
4
5 * variables.texi (File Local Variables): Suggest using booleanp.
6
72006-05-01 Juanma Barranquero <lekktu@gmail.com>
8
9 * objects.texi (Type Predicates): Fix typos.
10
112006-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
12
13 * intro.texi (nil and t): Add booleanp.
14
15 * objects.texi (Type Predicates): Add links for booleanp and
16 string-or-null-p.
17
182006-04-29 Richard Stallman <rms@gnu.org>
19
20 * modes.texi (Multiline Font Lock): Rename from
21 Multi line Font Lock Elements. Much clarification.
22 (Font Lock Multiline, Region to Fontify): Much clarification.
23
242006-04-29 Stefan Monnier <monnier@iro.umontreal.ca>
25
26 * variables.texi (File Local Variables): Remove the special case t for
27 safe-local-variable.
28
12006-04-26 Richard Stallman <rms@gnu.org> 292006-04-26 Richard Stallman <rms@gnu.org>
2 30
3 * syntax.texi (Parsing Expressions): Minor cleanup. 31 * syntax.texi (Parsing Expressions): Minor cleanup.
@@ -64,7 +92,7 @@
64 92
652006-03-25 Karl Berry <karl@gnu.org> 932006-03-25 Karl Berry <karl@gnu.org>
66 94
67 * elisp.texi: use @copyright{} instead of (C), and do not indent 95 * elisp.texi: Use @copyright{} instead of (C), and do not indent
68 the year list. 96 the year list.
69 97
702006-03-21 Nick Roberts <nickrob@snap.net.nz> 982006-03-21 Nick Roberts <nickrob@snap.net.nz>
@@ -98,7 +126,7 @@
98 126
99 * display.texi (Defining Images): Fix example in 127 * display.texi (Defining Images): Fix example in
100 image-load-path-for-library by not recommending that one binds 128 image-load-path-for-library by not recommending that one binds
101 image-load-path. Just defvar it to placate compiler and only use 129 image-load-path. Just defvar it to placate compiler and only use
102 it if previously defined. 130 it if previously defined.
103 131
1042006-03-14 Bill Wohler <wohler@newt.com> 1322006-03-14 Bill Wohler <wohler@newt.com>
@@ -570,11 +598,11 @@
570 598
5712005-09-26 Chong Yidong <cyd@stupidchicken.com> 5992005-09-26 Chong Yidong <cyd@stupidchicken.com>
572 600
573 * errors.texi (Standard Errors): Corrected xrefs. 601 * errors.texi (Standard Errors): Correct xrefs.
574 602
5752005-09-18 Chong Yidong <cyd@stupidchicken.com> 6032005-09-18 Chong Yidong <cyd@stupidchicken.com>
576 604
577 * display.texi (Defining Images): Updated documentation for 605 * display.texi (Defining Images): Update documentation for
578 `image-load-path'. 606 `image-load-path'.
579 607
5802005-09-17 Richard M. Stallman <rms@gnu.org> 6082005-09-17 Richard M. Stallman <rms@gnu.org>
diff --git a/lispref/intro.texi b/lispref/intro.texi
index b2294be4c2d..7e1b6155b35 100644
--- a/lispref/intro.texi
+++ b/lispref/intro.texi
@@ -163,7 +163,7 @@ person reading this manual, are thought of as ``the programmer'' and are
163addressed as ``you''. ``The user'' is the person who uses Lisp 163addressed as ``you''. ``The user'' is the person who uses Lisp
164programs, including those you write. 164programs, including those you write.
165 165
166@cindex fonts 166@cindex fonts in this manual
167 Examples of Lisp code are formatted like this: @code{(list 1 2 3)}. 167 Examples of Lisp code are formatted like this: @code{(list 1 2 3)}.
168Names that represent metasyntactic variables, or arguments to a function 168Names that represent metasyntactic variables, or arguments to a function
169being described, are formatted like this: @var{first-number}. 169being described, are formatted like this: @var{first-number}.
@@ -187,14 +187,14 @@ readers. After the Lisp reader has read either @samp{()} or @samp{nil},
187there is no way to determine which representation was actually written 187there is no way to determine which representation was actually written
188by the programmer. 188by the programmer.
189 189
190 In this manual, we use @code{()} when we wish to emphasize that it 190 In this manual, we write @code{()} when we wish to emphasize that it
191means the empty list, and we use @code{nil} when we wish to emphasize 191means the empty list, and we write @code{nil} when we wish to emphasize
192that it means the truth value @var{false}. That is a good convention to use 192that it means the truth value @var{false}. That is a good convention to use
193in Lisp programs also. 193in Lisp programs also.
194 194
195@example 195@example
196(cons 'foo ()) ; @r{Emphasize the empty list} 196(cons 'foo ()) ; @r{Emphasize the empty list}
197(not nil) ; @r{Emphasize the truth value @var{false}} 197(setq foo-flag nil) ; @r{Emphasize the truth value @var{false}}
198@end example 198@end example
199 199
200@cindex @code{t}, uses of 200@cindex @code{t}, uses of
@@ -212,6 +212,11 @@ to use them as constants in a program. An attempt to change their
212values results in a @code{setting-constant} error. @xref{Constant 212values results in a @code{setting-constant} error. @xref{Constant
213Variables}. 213Variables}.
214 214
215@defun booleanp object
216Return non-nil iff @var{object} is one of the two canonical boolean
217values: @code{t} or @code{nil}.
218@end defun
219
215@node Evaluation Notation 220@node Evaluation Notation
216@subsection Evaluation Notation 221@subsection Evaluation Notation
217@cindex evaluation notation 222@cindex evaluation notation
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 3f56179231c..9e55ca847fc 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -2345,8 +2345,8 @@ Search-based fontification happens second.
2345* Syntactic Font Lock:: Fontification based on syntax tables. 2345* Syntactic Font Lock:: Fontification based on syntax tables.
2346* Setting Syntax Properties:: Defining character syntax based on context 2346* Setting Syntax Properties:: Defining character syntax based on context
2347 using the Font Lock mechanism. 2347 using the Font Lock mechanism.
2348* Multi line Font Lock Elements:: How to coerce Font Lock into properly 2348* Multiline Font Lock:: How to coerce Font Lock into properly
2349 highlighting multiline elements. 2349 highlighting multiline constructs.
2350@end menu 2350@end menu
2351 2351
2352@node Font Lock Basics 2352@node Font Lock Basics
@@ -2625,7 +2625,7 @@ Its value should have one of the forms described in this table.
2625 2625
2626@strong{Warning:} Do not design an element of @code{font-lock-keywords} 2626@strong{Warning:} Do not design an element of @code{font-lock-keywords}
2627to match text which spans lines; this does not work reliably. 2627to match text which spans lines; this does not work reliably.
2628For details, see @xref{Multi line Font Lock Elements}. 2628For details, see @xref{Multiline Font Lock}.
2629 2629
2630You can use @var{case-fold} in @code{font-lock-defaults} to specify 2630You can use @var{case-fold} in @code{font-lock-defaults} to specify
2631the value of @code{font-lock-keywords-case-fold-search} which says 2631the value of @code{font-lock-keywords-case-fold-search} which says
@@ -2944,8 +2944,8 @@ value returns @code{font-lock-comment-face} for comments and
2944 2944
2945This can be used to highlighting different kinds of strings or 2945This can be used to highlighting different kinds of strings or
2946comments differently. It is also sometimes abused together with 2946comments differently. It is also sometimes abused together with
2947@code{font-lock-syntactic-keywords} to highlight elements that span 2947@code{font-lock-syntactic-keywords} to highlight constructs that span
2948multiple lines, but this is too obscure to document in this manual. 2948multiple lines, but this is too esoteric to document here.
2949 2949
2950Specify this variable using @var{other-vars} in 2950Specify this variable using @var{other-vars} in
2951@code{font-lock-defaults}. 2951@code{font-lock-defaults}.
@@ -3015,21 +3015,61 @@ Major modes normally set this variable with @var{other-vars} in
3015@code{font-lock-defaults}. 3015@code{font-lock-defaults}.
3016@end defvar 3016@end defvar
3017 3017
3018@node Multi line Font Lock Elements 3018@node Multiline Font Lock
3019@subsection Multi line Font Lock Elements 3019@subsection Multiline Font Lock Constructs
3020@cindex multi line font lock 3020@cindex multiline font lock
3021
3022 Normally, elements of @code{font-lock-keywords} should not match
3023across multiple lines; that doesn't work reliably, because Font Lock
3024usually scans just part of the buffer, and it can miss a multi-line
3025construct that crosses the line boundary where the scan starts. (The
3026scan normally starts at the beginning of a line.)
3027
3028 Making elements that match multiline constructs work properly has
3029two aspects: correct @emph{identification} and correct
3030@emph{rehighlighting}. The first means that Font Lock finds all
3031multiline constructs. The second means that Font Lock will correctly
3032rehighlight all the relevant text when a multiline construct is
3033changed---for example, if some of the text that was previously part of
3034a multiline construct ceases to be part of it. The two aspects are
3035closely related, and often getting one of them to work will appear to
3036make the other also work. However, for reliable results you must
3037attend explicitly to both aspects.
3038
3039 There are two ways to ensure correct identification of multiline
3040constructs:
3041
3042@itemize
3043@item
3044Place a @code{font-lock-multiline} or @code{jit-lock-defer-multiline}
3045property on the construct when it is added to the buffer.
3046@item
3047Use @code{font-lock-fontify-region-function} hook to extend the scan
3048so that the scanned text never starts or ends in the middle of a
3049multiline construct.
3050@end itemize
3021 3051
3022Normally, Font Lock elements specified via @code{font-lock-keywords} 3052 There are three ways to do rehighlighting of multiline constructs:
3023should not match across multiple lines. If they do, Font Lock may
3024fail to highlight them properly. This is fundamentally due to the
3025fact that Font Lock does not always look at the whole buffer at
3026a time, for obvious performance reasons, and instead only looks
3027at a small chunk at a time. In order for the highlight to be correct,
3028a chunk should not straddle an element matched by
3029@code{font-lock-keywords}. The default heuristic used for this is to
3030start and end chunks at the beginning resp. end of a line.
3031 3053
3032To work around this limitations, a few tools are provided. 3054@itemize
3055@item
3056Place a @code{font-lock-multiline} property on the construct. This
3057will rehighlight the whole construct if any part of it is changed. In
3058some cases you can do this automatically by setting the
3059@code{font-lock-multiline} variable.
3060@item
3061Use @code{jit-lock-contextually}. This will only rehighlight the part
3062of the construct that follows the actual change, and will do it after
3063a short delay. This only works if the highlighting of the various
3064parts of your multiline construct never depends on text in subsequent
3065lines. Since @code{jit-lock-contextually} is activated by default,
3066this can be an attractive solution.
3067@item
3068Place a @code{jit-lock-defer-multiline} property on the construct.
3069This works only if @code{jit-lock-contextually} is used, but it can
3070handle the case where highlighting depends on subsequent lines.
3071@item
3072@end itemize
3033 3073
3034@menu 3074@menu
3035* Font Lock Multiline:: Marking multiline chunks with a text property 3075* Font Lock Multiline:: Marking multiline chunks with a text property
@@ -3040,60 +3080,75 @@ To work around this limitations, a few tools are provided.
3040@node Font Lock Multiline 3080@node Font Lock Multiline
3041@subsubsection Font Lock Multiline 3081@subsubsection Font Lock Multiline
3042 3082
3043In order to make it possible to properly highlight elements that span 3083 One way to ensure reliable rehighlighting of multiline Font Lock
3044multiple lines, Font Lock obeys a special text property 3084constructs is to put on the text property @code{font-lock-multiline}.
3045@code{font-lock-multiline} which if non-@code{nil} indicates that this 3085It should be present and non-@code{nil} for text that is part of a
3046piece of text is part of a multiline construct. So when Font Lock is 3086multiline construct.
3047asked to highlight a region, it first verifies the two boundaries and 3087
3048extends them as needed so they do not fall in the middle of a piece of 3088 When Font Lock is about to highlight a range of text, it first
3049text marked with the @code{font-lock-multiline} property. 3089extends the boundaries of the range as necessary so that they do not
3050Immediately after that, it also erases all @code{font-lock-multiline} 3090fall within text marked with the @code{font-lock-multiline} property.
3051properties from the region it is about to highlight, so it is the 3091Then it removes any @code{font-lock-multiline} properties from the
3052responsability of the highlighting specification (mostly 3092range, and highlights it. The highlighting specification (mostly
3053@code{font-lock-keywords}) to make sure that this property is re-added 3093@code{font-lock-keywords}) must reinstall this property each time,
3054where needed so as to inform the next round of Font Locking of the 3094whenever it is appropriate.
3055presence of a multiline construct. 3095
3056 3096 @strong{Warning:} don't use the @code{font-lock-multiline} property
3057It is important to understand that the @code{font-lock-multiline} 3097on large ranges of text, because that will make rehighlighting slow.
3058property should preferably only be used on Font Lock elements of
3059moderate size: every time that text is modified within the multiline
3060elements (or nearby), the whole multiline element will be completely
3061re-highlighted, so if its size is large, the time to font-lock may
3062render editing painfully slow.
3063 3098
3064@defvar font-lock-multiline 3099@defvar font-lock-multiline
3065If the @code{font-lock-multiline} variable is set to @code{t}, Font 3100If the @code{font-lock-multiline} variable is set to @code{t}, Font
3066Lock will try to automatically add the @code{font-lock-multiline} 3101Lock will try to add the @code{font-lock-multiline} property
3067property on the keywords that span several lines. This is no silver 3102automatically on multiline constructs. This is not a universal
3068bullet however since it slows down Font Lock somewhat, and still does 3103solution, however, since it slows down Font Lock somewhat. It can
3069not always find all multiline constructs, especially when used with 3104miss some multiline constructs, or make the property larger or smaller
3070Jit Lock, which is enabled by default. 3105than necessary.
3106
3107For elements whose @var{matcher} is a function, the function should
3108ensure that submatch 0 covers the whole relevant multiline construct,
3109even if only a small subpart will be highlighted. It is often just as
3110easy to add the @code{font-lock-multiline} property by hand.
3071@end defvar 3111@end defvar
3072 3112
3113 The @code{font-lock-multiline} property is meant to ensure proper
3114refontification; it does not automatically identify new multiline
3115constructs. Identifying the requires that Font-Lock operate on large
3116enough chunks at a time. This will happen by accident on many cases,
3117which may give the impression that multiline constructs magically work.
3118If you set the @code{font-lock-multiline} variable non-@code{nil},
3119this impression will be even stronger, since the highlighting of those
3120constructs which are found will be properly updated from then on.
3121But that does not work reliably.
3122
3123 To find multiline constructs reliably, you must either manually
3124place the @code{font-lock-multiline} property on the text before
3125Font-Lock looks at it, or use
3126@code{font-lock-fontify-region-function}.
3127
3073@node Region to Fontify 3128@node Region to Fontify
3074@subsubsection Region to Fontify after a Buffer Change 3129@subsubsection Region to Fontify after a Buffer Change
3075 3130
3076 When a buffer is changed, the region that Font Lock refontifies is by 3131 When a buffer is changed, the region that Font Lock refontifies is
3077default the smallest sequence of whole lines that spans the change. 3132by default the smallest sequence of whole lines that spans the change.
3078While this works well most of the time, sometimes it doesn't---for 3133While this works well most of the time, sometimes it doesn't---for
3079example, when a buffer change has changed the syntactic meaning of text 3134example, when a change alters the syntactic meaning of text on an
3080on an earlier line. 3135earlier line.
3081 3136
3082You can enlarge (or even reduce) the region to fontify by setting @c either of 3137 You can enlarge (or even reduce) the region to fontify by setting
3083the following variables: 3138one the following variables:
3084 3139
3085@defvar font-lock-extend-region-function 3140@defvar font-lock-extend-region-function
3086This buffer-local variable is either @code{nil} or is a function that 3141This buffer-local variable is either @code{nil} or a function for
3087determines the region to fontify, which Emacs then calls after each 3142Font-Lock to call to determine the region to scan and fontify.
3088buffer change.
3089 3143
3090The function is given three parameters, the standard @var{beg}, 3144The function is given three parameters, the standard @var{beg},
3091@var{end}, and @var{old-len} from after-change-functions (@pxref{Change 3145@var{end}, and @var{old-len} from after-change-functions
3092Hooks}). It should return either a cons of the beginning and end buffer 3146(@pxref{Change Hooks}). It should return either a cons of the
3093positions (in that order) of the region to fontify, or @code{nil} (which 3147beginning and end buffer positions (in that order) of the region to
3094directs the caller to fontify the default region). This function needs 3148fontify, or @code{nil} (which means choose the region in the standard
3095to preserve point, the match-data, and the current restriction. 3149way). This function needs to preserve point, the match-data, and the
3096The region it returns may start or end in the middle of a line. 3150current restriction. The region it returns may start or end in the
3151middle of a line.
3097 3152
3098Since this function is called after every buffer change, it should be 3153Since this function is called after every buffer change, it should be
3099reasonably fast. 3154reasonably fast.
diff --git a/lispref/objects.texi b/lispref/objects.texi
index 93848cffe09..5665e5beee6 100644
--- a/lispref/objects.texi
+++ b/lispref/objects.texi
@@ -1779,6 +1779,12 @@ with references to further information.
1779 1779
1780@item windowp 1780@item windowp
1781@xref{Basic Windows, windowp}. 1781@xref{Basic Windows, windowp}.
1782
1783@item booleanp
1784@xref{nil and t, booleanp}.
1785
1786@item string-or-null-p
1787@xref{Predicates for Strings, string-or-null-p}.
1782@end table 1788@end table
1783 1789
1784 The most general way to check the type of an object is to call the 1790 The most general way to check the type of an object is to call the
diff --git a/lispref/variables.texi b/lispref/variables.texi
index d97848549c0..5b4b779448e 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -1778,13 +1778,13 @@ measures to prevent this.
1778 1778
1779@cindex safe local variable 1779@cindex safe local variable
1780 You can specify safe values for a variable with a 1780 You can specify safe values for a variable with a
1781@code{safe-local-variable} property. If the property is @code{t}, 1781@code{safe-local-variable} property. The property has to be
1782setting that variable in a file is always considered safe, regardless 1782a function of one argument; any value is safe if the function
1783of the value used. If the property is a function of one argument, 1783returns non-@code{nil} given that value. Many commonly encountered
1784then any value is safe if the function returns non-@code{nil} given 1784file variables standardly have @code{safe-local-variable} properties,
1785that value. Many commonly encountered file variables standardly have 1785including @code{fill-column}, @code{fill-prefix}, and
1786@code{safe-local-variable} properties, including @code{fill-column}, 1786@code{indent-tabs-mode}. For boolean-valued variables that are safe,
1787@code{fill-prefix}, and @code{indent-tabs-mode}. 1787use @code{booleanp} as the property value.
1788 1788
1789@defopt safe-local-variable-values 1789@defopt safe-local-variable-values
1790This variable provides another way to mark some variable values as 1790This variable provides another way to mark some variable values as
diff --git a/man/ChangeLog b/man/ChangeLog
index 1f417968fa9..bd48e3f4f20 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,16 +1,46 @@
12006-05-01 Richard Stallman <rms@gnu.org>
2
3 * emacs.texi (Top): Add Diff Mode to menu.
4
52006-05-01 Aaron S. Hawley <Aaron.Hawley@uvm.edu>
6
7 * misc.texi (Diff Mode): New node.
8
92006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10
11 * macos.texi (Mac International): Now Carbon Emacs has ATSUI support.
12 (Mac Environment Variables): Shorten example line.
13 (Mac Font Specs): Shorten lisp lines. Add descriptions for ATSUI.
14
152006-05-01 Nick Roberts <nickrob@snap.net.nz>
16
17 * building.texi (GUD Customization): Describe cases %d and %c.
18 Update description for %e.
19
202006-04-30 Glenn Morris <rgm@gnu.org>
21
22 * calendar.texi (LaTeX Calendar): Mention cal-tex-preamble-extra.
23
242006-04-29 Dan Nicolaescu <dann@ics.uci.edu>
25
26 * custom.texi (Examining): Update C-h v output example.
27
282006-04-29 Kim F. Storm <storm@cua.dk>
29
30 * building.texi (Grep Searching): Add lgrep and rgrep.
31
12006-04-26 Reiner Steib <Reiner.Steib@gmx.de> 322006-04-26 Reiner Steib <Reiner.Steib@gmx.de>
2 33
3 * pgg.texi (Caching passphrase): Fix markup and typos. Simplify. 34 * pgg.texi (Caching passphrase): Fix markup and typos. Simplify.
4 35
52006-04-26 Sascha Wilde <wilde@sha-bang.de> 362006-04-26 Sascha Wilde <wilde@sha-bang.de>
6 37
7 * pgg.texi (Caching passphrase): Added documentation for 38 * pgg.texi (Caching passphrase): Add pgg-gpg-use-agent.
8 pgg-gpg-use-agent.
9 39
102006-04-24 Bill Wohler <wohler@newt.com> 402006-04-24 Bill Wohler <wohler@newt.com>
11 41
12 * mh-e.texi (Getting Started): Made it more explicit that you need 42 * mh-e.texi (Getting Started): Make it more explicit that you need
13 to install MH, and also included pointers to current MH implementations. 43 to install MH. Add pointers to current MH implementations.
14 44
152006-04-23 Richard Stallman <rms@gnu.org> 452006-04-23 Richard Stallman <rms@gnu.org>
16 46
@@ -24,14 +54,14 @@
242006-04-21 Bill Wohler <wohler@newt.com> 542006-04-21 Bill Wohler <wohler@newt.com>
25 55
26 Release MH-E manual version 7.94. 56 Release MH-E manual version 7.94.
27 57
28 * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for 58 * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
29 release 7.94. 59 release 7.94.
30 60
312006-04-21 Carsten Dominik <dominik@science.uva.nl> 612006-04-21 Carsten Dominik <dominik@science.uva.nl>
32 62
33 * org.texi: Many small fixes. 63 * org.texi: Many small fixes.
34 (Handling links): Renamed from "Managing links". 64 (Handling links): Rename from "Managing links".
35 65
362006-04-21 Eli Zaretskii <eliz@gnu.org> 662006-04-21 Eli Zaretskii <eliz@gnu.org>
37 67
@@ -57,7 +87,7 @@
57 87
582006-04-20 Carsten Dominik <dominik@science.uva.nl> 882006-04-20 Carsten Dominik <dominik@science.uva.nl>
59 89
60 * org.texi: (Time stamps): Better explanation of the purpose of 90 * org.texi (Time stamps): Better explanation of the purpose of
61 different time stamps. 91 different time stamps.
62 (Structure editing, Plain lists): More details on how new items 92 (Structure editing, Plain lists): More details on how new items
63 and headings are inserted. 93 and headings are inserted.
@@ -74,7 +104,7 @@
74 104
752006-04-18 Carsten Dominik <dominik@science.uva.nl> 1052006-04-18 Carsten Dominik <dominik@science.uva.nl>
76 106
77 * org.texi: (Formula syntax): Fixed link to Calc Manual. 107 * org.texi (Formula syntax): Fixed link to Calc Manual.
78 108
792006-04-17 Reiner Steib <Reiner.Steib@gmx.de> 1092006-04-17 Reiner Steib <Reiner.Steib@gmx.de>
80 110
@@ -96,7 +126,7 @@
96 126
972006-04-13 Carsten Dominik <dominik@science.uva.nl> 1272006-04-13 Carsten Dominik <dominik@science.uva.nl>
98 128
99 * org.texi: (Updating settings): New section. 129 * org.texi (Updating settings): New section.
100 (Visibility cycling): Better names for the startup folding 130 (Visibility cycling): Better names for the startup folding
101 options. 131 options.
102 (Exporting): Completely restructured. 132 (Exporting): Completely restructured.
diff --git a/man/building.texi b/man/building.texi
index cc5e667f1c3..0cbaa5d1826 100644
--- a/man/building.texi
+++ b/man/building.texi
@@ -335,10 +335,12 @@ treating the matches reported by @code{grep} as if they were ``errors.''
335 335
336@table @kbd 336@table @kbd
337@item M-x grep 337@item M-x grep
338@item M-x lgrep
338Run @code{grep} asynchronously under Emacs, with matching lines 339Run @code{grep} asynchronously under Emacs, with matching lines
339listed in the buffer named @samp{*grep*}. 340listed in the buffer named @samp{*grep*}.
340@item M-x grep-find 341@item M-x grep-find
341@itemx M-x find-grep 342@itemx M-x find-grep
343@itemx M-x rgrep
342Run @code{grep} via @code{find}, with user-specified arguments, and 344Run @code{grep} via @code{find}, with user-specified arguments, and
343collect output in the buffer named @samp{*grep*}. 345collect output in the buffer named @samp{*grep*}.
344@item M-x kill-grep 346@item M-x kill-grep
@@ -373,6 +375,27 @@ initial default for the command---one that runs both @code{find} and
373@code{grep}, so as to search every file in a directory tree. See also 375@code{grep}, so as to search every file in a directory tree. See also
374the @code{find-grep-dired} command, in @ref{Dired and Find}. 376the @code{find-grep-dired} command, in @ref{Dired and Find}.
375 377
378@findex lgrep
379@findex rgrep
380 The commands @kbd{M-x lgrep} (local grep) and @kbd{M-x rgrep}
381(recursive grep) are more user-friendly versions of @code{grep} and
382@code{grep-find}, which prompt separately for the regular expression
383to match, the files to search, and the base directory for the search
384(rgrep only). Case sensitivitivy of the search is controlled by the
385current value of @code{case-fold-search}.
386
387These commands build the shell commands based on the variables
388@code{grep-template} (for @code{lgrep}) and @code{grep-find-template}
389(for @code{rgrep}).
390
391The files to search can use aliases defined in the variable
392@code{grep-files-aliases}.
393
394Subdirectories listed in the variable
395@code{grep-find-ignored-directories} such as those typically used by
396various version control systems, like CVS and arch, are automatically
397skipped by @code{rgrep}.
398
376@node Flymake 399@node Flymake
377@section Finding Syntax Errors On The Fly 400@section Finding Syntax Errors On The Fly
378@cindex checking syntax 401@cindex checking syntax
@@ -676,7 +699,7 @@ This key is available only in the GUD interaction buffer.
676@kindex C-c C-f @r{(GUD)} 699@kindex C-c C-f @r{(GUD)}
677@itemx C-x C-a C-f 700@itemx C-x C-a C-f
678@findex gud-finish 701@findex gud-finish
679Run the program until the selected stack frame returns or 702Run the program until the selected stack frame returns or
680stops for some other reason (@code{gud-finish}). 703stops for some other reason (@code{gud-finish}).
681 704
682@item C-x C-a C-j 705@item C-x C-a C-j
@@ -743,8 +766,6 @@ the command to @kbd{C-c @var{binding}} in the GUD buffer's mode and to
743The name of the current source file. If the current buffer is the GUD 766The name of the current source file. If the current buffer is the GUD
744buffer, then the ``current source file'' is the file that the program 767buffer, then the ``current source file'' is the file that the program
745stopped in. 768stopped in.
746@c This said, ``the name of the file the program counter was in at the last breakpoint.''
747@c But I suspect it is really the last stop file.
748 769
749@item %l 770@item %l
750The number of the current source line. If the current buffer is the GUD 771The number of the current source line. If the current buffer is the GUD
@@ -752,7 +773,9 @@ buffer, then the ``current source line'' is the line that the program
752stopped in. 773stopped in.
753 774
754@item %e 775@item %e
755The text of the C lvalue or function-call expression at or adjacent to point. 776In transient-mark-mode the text in the region, if it is active.
777Otherwise the text of the C lvalue or function-call expression at or
778adjacent to point.
756 779
757@item %a 780@item %a
758The text of the hexadecimal address at or adjacent to point. 781The text of the hexadecimal address at or adjacent to point.
@@ -764,6 +787,13 @@ empty string.
764 787
765If you don't use @samp{%p} in the command string, the command you define 788If you don't use @samp{%p} in the command string, the command you define
766ignores any numeric argument. 789ignores any numeric argument.
790
791@item %d
792The name of the directory of the current source file.
793
794@item %c
795Fully qualified class name derived from the expression surrounding point
796(jdb only).
767@end table 797@end table
768 798
769@node GDB Graphical Interface 799@node GDB Graphical Interface
diff --git a/man/calendar.texi b/man/calendar.texi
index 23aeb191e86..b48b1d547de 100644
--- a/man/calendar.texi
+++ b/man/calendar.texi
@@ -395,7 +395,9 @@ If the variable @code{cal-tex-diary} is non-@code{nil} (the default is
395@code{nil}), diary entries are included also (in weekly and monthly 395@code{nil}), diary entries are included also (in weekly and monthly
396calendars only). If the variable @code{cal-tex-rules} is non-@code{nil} 396calendars only). If the variable @code{cal-tex-rules} is non-@code{nil}
397(the default is @code{nil}), the calendar displays ruled pages 397(the default is @code{nil}), the calendar displays ruled pages
398in styles that have sufficient room. 398in styles that have sufficient room. You can use the variable
399@code{cal-tex-preamble-extra} to insert extra LaTeX commands in the
400preamble of the generated document if you need to.
399 401
400@node Holidays 402@node Holidays
401@section Holidays 403@section Holidays
diff --git a/man/custom.texi b/man/custom.texi
index f133e890b0a..35c9222628c 100644
--- a/man/custom.texi
+++ b/man/custom.texi
@@ -822,6 +822,9 @@ fill-column's value is 70
822Local in buffer custom.texi; global value is 70 822Local in buffer custom.texi; global value is 70
823Automatically becomes buffer-local when set in any fashion. 823Automatically becomes buffer-local when set in any fashion.
824 824
825This variable is safe to use as a file local variable only if its value
826satisfies the predicate `integerp'.
827
825Documentation: 828Documentation:
826*Column beyond which automatic line-wrapping should happen. 829*Column beyond which automatic line-wrapping should happen.
827Interactively, you can set the buffer local value using C-x f. 830Interactively, you can set the buffer local value using C-x f.
diff --git a/man/emacs.texi b/man/emacs.texi
index 478244aecf6..c30bcb93954 100644
--- a/man/emacs.texi
+++ b/man/emacs.texi
@@ -89,9 +89,9 @@ some of how to customize it; it corresponds to GNU Emacs version
89@value{EMACSVER}. 89@value{EMACSVER}.
90 90
91@ifinfo 91@ifinfo
92If you never before used the Info documentation system, type @kbd{h}, 92To learn more about the Info documentation system, type @kbd{h}, and
93and Emacs will take you to a programmed instruction sequence for the 93Emacs will take you to a programmed instruction sequence for the Info
94Info commands. 94commands.
95@end ifinfo 95@end ifinfo
96 96
97For information on extending Emacs, see @ref{Top, Emacs Lisp,, elisp, The 97For information on extending Emacs, see @ref{Top, Emacs Lisp,, elisp, The
@@ -197,6 +197,7 @@ Advanced Features
197* Sorting:: Sorting lines, paragraphs or pages within Emacs. 197* Sorting:: Sorting lines, paragraphs or pages within Emacs.
198* Narrowing:: Restricting display and editing to a portion 198* Narrowing:: Restricting display and editing to a portion
199 of the buffer. 199 of the buffer.
200* Diff Mode:: Editing diff output.
200* Two-Column:: Splitting apart columns to edit them 201* Two-Column:: Splitting apart columns to edit them
201 in side-by-side windows. 202 in side-by-side windows.
202* Editing Binary Files::Using Hexl mode to edit binary files. 203* Editing Binary Files::Using Hexl mode to edit binary files.
@@ -286,7 +287,7 @@ Killing and Moving Text
286* Killing by Lines:: How to kill entire lines of text at one time. 287* Killing by Lines:: How to kill entire lines of text at one time.
287* Other Kill Commands:: Commands to kill large regions of text and 288* Other Kill Commands:: Commands to kill large regions of text and
288 syntactic units such as words and sentences. 289 syntactic units such as words and sentences.
289* Graphical Kill:: The kill ring on graphical terminals: 290* Graphical Kill:: The kill ring on graphical displays:
290 yanking between applications. 291 yanking between applications.
291* CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} for copy 292* CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} for copy
292 and paste, with enhanced rectangle support. 293 and paste, with enhanced rectangle support.
@@ -867,47 +868,47 @@ Emacs and Microsoft Windows
867@unnumbered Preface 868@unnumbered Preface
868 869
869 This manual documents the use and simple customization of the Emacs 870 This manual documents the use and simple customization of the Emacs
870editor. The reader is not expected to be a programmer; simple 871editor. Simple Emacs customizations do not require you to be a
871customizations do not require programming skill. The user who is not 872programmer, but if you are not interested in customizing, you can
872interested in customizing can ignore the scattered customization hints. 873ignore the customization hints.
873 874
874 This is primarily a reference manual, but can also be used as a 875 This is primarily a reference manual, but can also be used as a
875primer. For complete beginners, it is a good idea to start with the 876primer. If you are a complete beginner, we recommend you start with
876on-line, learn-by-doing tutorial, before reading the manual. To run the 877the on-line, learn-by-doing tutorial, before reading the manual. To
877tutorial, start Emacs and type @kbd{C-h t}. This way you can learn 878run the tutorial, start Emacs and type @kbd{C-h t}. The tutorial
878Emacs by using Emacs on a specially designed file which describes 879describes commands, tells you when to try them, and explains the
879commands, tells you when to try them, and then explains the results you 880results.
880see.
881 881
882 On first reading, just skim chapters 1 and 2, which describe the 882 On first reading, just skim chapters 1 and 2, which describe the
883notational conventions of the manual and the general appearance of the 883notational conventions of the manual and the general appearance of the
884Emacs display screen. Note which questions are answered in these 884Emacs display screen. Note which questions are answered in these
885chapters, so you can refer back later. After reading chapter 4, you 885chapters, so you can refer back later. After reading chapter 4, you
886should practice the commands there. The next few chapters describe 886should practice the commands shown there. The next few chapters
887fundamental techniques and concepts that are used constantly. You need 887describe fundamental techniques and concepts that are used constantly.
888to understand them thoroughly, experimenting with them if necessary. 888You need to understand them thoroughly, so experiment with them
889until you are fluent.
889 890
890 Chapters 14 through 19 describe intermediate-level features that are 891 Chapters 14 through 19 describe intermediate-level features that are
891useful for all kinds of editing. Chapter 20 and following chapters 892useful for many kinds of editing. Chapter 20 and following chapters
892describe features that you may or may not want to use; read those 893describe optional but useful features; read those chapters when you
893chapters when you need them. 894need them.
894 895
895 Read the Trouble chapter if Emacs does not seem to be working 896 Read the Trouble chapter if Emacs does not seem to be working
896properly. It explains how to cope with some common problems 897properly. It explains how to cope with several common problems
897(@pxref{Lossage}), as well as when and how to report Emacs bugs 898(@pxref{Lossage}), as well as when and how to report Emacs bugs
898(@pxref{Bugs}). 899(@pxref{Bugs}).
899 900
900 To find the documentation on a particular command, look in the index. 901 To find the documentation of a particular command, look in the index.
901Keys (character commands) and command names have separate indexes. There 902Keys (character commands) and command names have separate indexes.
902is also a glossary, with a cross reference for each term. 903There is also a glossary, with a cross reference for each term.
903 904
904 This manual is available as a printed book and also as an Info file. 905 This manual is available as a printed book and also as an Info file.
905The Info file is for on-line perusal with the Info program, which will 906The Info file is for on-line perusal with the Info program, which is
906be the principal way of viewing documentation on-line in the GNU system. 907the principal means of accessing on-line documentation in the GNU
907Both the Info file and the Info program itself are distributed along 908system. Both the Emacs Info file and an Info reader are included with
908with GNU Emacs. The Info file and the printed book contain 909GNU Emacs. The Info file and the printed book contain substantially
909substantially the same text and are generated from the same source 910the same text and are generated from the same source files, which are
910files, which are also distributed along with GNU Emacs. 911also distributed with GNU Emacs.
911 912
912 GNU Emacs is a member of the Emacs editor family. There are many 913 GNU Emacs is a member of the Emacs editor family. There are many
913Emacs editors, all sharing common principles of organization. For 914Emacs editors, all sharing common principles of organization. For
@@ -1058,59 +1059,51 @@ T.@: Zimmermann, Reto Zimmermann, Neal Ziring, and Detlev Zundel.
1058@node Intro, Glossary, Distrib, Top 1059@node Intro, Glossary, Distrib, Top
1059@unnumbered Introduction 1060@unnumbered Introduction
1060 1061
1061 You are reading about GNU Emacs, the GNU incarnation of the advanced, 1062 You are reading about GNU Emacs, the GNU incarnation of the
1062self-documenting, customizable, extensible real-time display editor Emacs. 1063advanced, self-documenting, customizable, extensible editor Emacs.
1063(The `G' in `GNU' is not silent.) 1064(The `G' in `GNU' is not silent.)
1064 1065
1065 We say that Emacs is a @dfn{display} editor because normally the text 1066 We call Emacs advanced because it provides much more than simple
1066being edited is visible on the screen and is updated automatically as you 1067insertion and deletion. It can control subprocesses, indent programs
1067type your commands. @xref{Screen,Display}. 1068automatically, show two or more files at once, and edit formatted
1068 1069text. Emacs editing commands operate in terms of characters, words,
1069 We call it a @dfn{real-time} editor because the display is updated very 1070lines, sentences, paragraphs, and pages, as well as expressions and
1070frequently, usually after each character or pair of characters you 1071comments in various programming languages.
1071type. This minimizes the amount of information you must keep in your
1072head as you edit. @xref{Basic,Real-time,Basic Editing}.
1073
1074 We call Emacs advanced because it provides facilities that go beyond
1075simple insertion and deletion: controlling subprocesses; automatic
1076indentation of programs; viewing two or more files at once; editing
1077formatted text; and dealing in terms of characters, words, lines,
1078sentences, paragraphs, and pages, as well as expressions and comments in
1079several different programming languages.
1080 1072
1081 @dfn{Self-documenting} means that at any time you can type a special 1073 @dfn{Self-documenting} means that at any time you can type a special
1082character, @kbd{Control-h}, to find out what your options are. You can 1074character, @kbd{Control-h}, to find out what your options are. You can
1083also use it to find out what any command does, or to find all the commands 1075also use it to find out what any command does, or to find all the commands
1084that pertain to a topic. @xref{Help}. 1076that pertain to a topic. @xref{Help}.
1085 1077
1086 @dfn{Customizable} means that you can change the definitions of Emacs 1078 @dfn{Customizable} means that you can alter Emacs commands' behavior
1087commands in little ways. For example, if you use a programming language in 1079in simple ways. For example, if you use a programming language in
1088which comments start with @samp{<**} and end with @samp{**>}, you can tell 1080which comments start with @samp{<**} and end with @samp{**>}, you can
1089the Emacs comment manipulation commands to use those strings 1081tell the Emacs comment manipulation commands to use those strings
1090(@pxref{Comments}). Another sort of customization is rearrangement of the 1082(@pxref{Comments}). Another sort of customization is rearrangement of
1091command set. For example, if you prefer the four basic cursor motion 1083the command set. For example, you can rebind the basic cursor motion
1092commands (up, down, left and right) on keys in a diamond pattern on the 1084commands (up, down, left and right) to any keys on the keyboard that
1093keyboard, you can rebind the keys that way. @xref{Customization}. 1085you find comfortable. @xref{Customization}.
1094 1086
1095 @dfn{Extensible} means that you can go beyond simple customization and 1087 @dfn{Extensible} means that you can go beyond simple customization
1096write entirely new commands, programs in the Lisp language to be run by 1088and write entirely new commands---programs in the Lisp language to be
1097Emacs's own Lisp interpreter. Emacs is an ``on-line extensible'' 1089run by Emacs's own Lisp interpreter. Emacs is an ``on-line
1098system, which means that it is divided into many functions that call 1090extensible'' system, which means that it is divided into many
1099each other, any of which can be redefined in the middle of an editing 1091functions that call each other, any of which can be redefined in the
1100session. Almost any part of Emacs can be replaced without making a 1092middle of an editing session. Almost any part of Emacs can be
1101separate copy of all of Emacs. Most of the editing commands of Emacs 1093replaced without making a separate copy of all of Emacs. Most of the
1102are written in Lisp; the few exceptions could have been written 1094editing commands of Emacs are written in Lisp; the few exceptions
1103in Lisp but are written in C for efficiency. Although only a programmer 1095could have been written in Lisp but use C instead for efficiency.
1104can write an extension, anybody can use it afterward. @xref{Top, 1096Writing an extension is programming, but non-programmers can use it
1105Emacs Lisp Intro, Preface, eintr, An Introduction to Programming in 1097afterwards. @xref{Top, Emacs Lisp Intro, Preface, eintr, An
1106Emacs Lisp}, if you want to learn Emacs Lisp programming. 1098Introduction to Programming in Emacs Lisp}, if you want to learn Emacs
1099Lisp programming.
1107 1100
1108 When running on a graphical display, Emacs provides its own menus 1101 When running on a graphical display, Emacs provides its own menus
1109and convenient handling of mouse buttons. But Emacs provides many of 1102and convenient handling of mouse buttons. In addition, Emacs provides
1110the benefits of a graphical display even on a text-only terminal. For 1103many of the benefits of a graphical display even on a text-only
1111instance, it can highlight parts of a file, display and edit several 1104terminal. For instance, it can highlight parts of a file, display and
1112files at once, move text between files, and edit files while running 1105edit several files at once, move text between files, and edit files
1113shell commands. 1106while running shell commands.
1114 1107
1115@include screen.texi 1108@include screen.texi
1116@include commands.texi 1109@include commands.texi
diff --git a/man/macos.texi b/man/macos.texi
index 89ce13d1d1b..272609b8392 100644
--- a/man/macos.texi
+++ b/man/macos.texi
@@ -104,13 +104,6 @@ character codes in the range 128-159. The coding systems
104@code{mac-roman}, @code{mac-centraleurroman}, and @code{mac-cyrillic} 104@code{mac-roman}, @code{mac-centraleurroman}, and @code{mac-cyrillic}
105are used to represent these Mac encodings. 105are used to represent these Mac encodings.
106 106
107 The fontset @code{fontset-standard} is created automatically when
108Emacs is run on Mac, and used by default. It displays as many kinds
109of characters as possible using 12-point Monaco as a base font. If
110you see some character as a hollow box with this fontset, then it's
111almost impossible to display it only by customizing font settings
112(@pxref{Mac Font Specs}).
113
114 You can use input methods provided either by LEIM (@pxref{Input 107 You can use input methods provided either by LEIM (@pxref{Input
115Methods}) or Mac OS to enter international characters. To use the 108Methods}) or Mac OS to enter international characters. To use the
116former, see the International Character Set Support section of the 109former, see the International Character Set Support section of the
@@ -195,7 +188,7 @@ invoked from the Finder or the @command{open} command.
195 Command line arguments are specified like 188 Command line arguments are specified like
196 189
197@example 190@example
198/Applications/Emacs.app/Contents/MacOS/Emacs -geometry 80x25 & 191/Applications/Emacs.app/Contents/MacOS/Emacs -g 80x25 &
199@end example 192@end example
200 193
201@noindent 194@noindent
@@ -295,7 +288,8 @@ you specify face attributes instead. For example, you can use 14pt
295Courier by customizing the default face attributes for all frames: 288Courier by customizing the default face attributes for all frames:
296 289
297@lisp 290@lisp
298(set-face-attribute 'default nil :family "courier" :height 140) 291(set-face-attribute 'default nil
292 :family "courier" :height 140)
299@end lisp 293@end lisp
300 294
301@noindent 295@noindent
@@ -313,21 +307,30 @@ standard X font name:
313@noindent 307@noindent
314@xref{Font X}. Wildcards are supported as they are on X. 308@xref{Font X}. Wildcards are supported as they are on X.
315 309
316 Native Apple fonts in Mac Roman encoding has maker name @code{apple} 310 Emacs on Mac OS Classic uses QuickDraw Text routines for drawing texts
317and charset @code{mac-roman}. For example 12-point Monaco can be 311by default. Emacs on Mac OS X uses @acronym{ATSUI, Apple Type Services
318specified by the name @samp{-apple-monaco-*-12-*-mac-roman}. When 312for Unicode Imaging} as well as QuickDraw Text, and most of the
319using a particular size of scalable fonts, it must be specified in a 313characters other than Chinese, Japanese, and Korean ones are drawn using
320format containing 14 @samp{-}s like 314the former by default.
321@samp{-apple-monaco-medium-r-normal--13-*-*-*-*-*-mac-roman}. 315
322 316 @acronym{ATSUI}-compatible fonts have maker name @code{apple} and
323 You can specify a @code{mac-roman} font for @acronym{ASCII} 317charset @code{iso10646-1}. For example 12-point Monaco can be specified
324characters like 318by the name
325 319@samp{-apple-monaco-medium-r-normal--12-*-*-*-*-*-iso10646-1}. Note
326@lisp 320that it must be specified in a format containing 14 @samp{-}s (i.e., not
321by @samp{-apple-monaco-medium-r-normal-12-*-iso10646-1}) because every
322@acronym{ATSUI}-compatible font is a scalable one.
323
324 QuickDraw Text fonts have maker name @code{apple} and various charset
325names other than @code{iso10646-1}. Native Apple fonts in Mac Roman
326encoding has charset @code{mac-roman}. You can specify a
327@code{mac-roman} font for @acronym{ASCII} characters like
328
329@smalllisp
327(add-to-list 330(add-to-list
328 'default-frame-alist 331 'default-frame-alist
329 '(font . "-apple-monaco-medium-r-normal--13-*-*-*-*-*-mac-roman")) 332 '(font . "-apple-monaco-medium-r-normal--13-*-*-*-*-*-mac-roman"))
330@end lisp 333@end smalllisp
331 334
332@noindent 335@noindent
333but that does not extend to ISO-8859-1: specifying a @code{mac-roman} 336but that does not extend to ISO-8859-1: specifying a @code{mac-roman}
@@ -341,16 +344,11 @@ charsets @samp{big5-0}, @samp{gb2312.1980-0},
341@samp{mac-cyrillic}, @samp{mac-symbol}, and @samp{mac-dingbats}, 344@samp{mac-cyrillic}, @samp{mac-symbol}, and @samp{mac-dingbats},
342respectively. 345respectively.
343 346
344 Since Emacs as of the current version uses QuickDraw Text routines
345for drawing texts, only characters in the charsets listed above can be
346displayed with the OS-bundled fonts, even if other applications that
347use @acronym{ATSUI} or Cocoa can display variety of characters with
348them.
349
350 The use of @code{create-fontset-from-fontset-spec} (@pxref{Defining 347 The use of @code{create-fontset-from-fontset-spec} (@pxref{Defining
351Fontsets}) for defining fontsets often results in wrong ones 348Fontsets}) for defining fontsets often results in wrong ones especially
352especially when using only OS-bundled fonts. The recommended way is 349when using only OS-bundled QuickDraw Text fonts. The recommended way to
353to create a fontset using @code{create-fontset-from-mac-roman-font}: 350use them is to create a fontset using
351@code{create-fontset-from-mac-roman-font}:
354 352
355@lisp 353@lisp
356(create-fontset-from-mac-roman-font 354(create-fontset-from-mac-roman-font
@@ -374,11 +372,13 @@ encoded in the names of their font suitcases. E.g., the font suitcase
374the name @samp{-ETL-fixed-*-iso8859-1}. 372the name @samp{-ETL-fixed-*-iso8859-1}.
375 373
376@vindex mac-allow-anti-aliasing 374@vindex mac-allow-anti-aliasing
377 Emacs uses the QuickDraw text rendering by default. On Mac OS X 375 Mac OS X 10.2 or later can use two types of text renderings: Quartz 2D
37810.2 and later, it can be changed so that it uses the Quartz 2D text 376(aka Core Graphics) and QuickDraw. By default, Emacs uses the former on
379rendering (aka CG text rendering) by setting 377such versions. It can be changed by setting
380@code{mac-allow-anti-aliasing} to @code{t}. However, it is reported 378@code{mac-allow-anti-aliasing} to @code{t} (Quartz 2D) or @code{nil}
381to sometimes leave some garbages. 379(QuickDraw). Both @acronym{ATSUI} and QuickDraw Text drawings are
380affected by the value of this variable.
381
382 382
383@node Mac Functions 383@node Mac Functions
384@section Mac-Specific Lisp Functions 384@section Mac-Specific Lisp Functions
diff --git a/man/misc.texi b/man/misc.texi
index 0b07e04ed68..71f4aba2b49 100644
--- a/man/misc.texi
+++ b/man/misc.texi
@@ -1761,7 +1761,7 @@ rectangle moves along with the text inside the rectangle.
1761 Many of the sort commands ignore case differences when comparing, if 1761 Many of the sort commands ignore case differences when comparing, if
1762@code{sort-fold-case} is non-@code{nil}. 1762@code{sort-fold-case} is non-@code{nil}.
1763 1763
1764@node Narrowing, Two-Column, Sorting, Top 1764@node Narrowing, Diff Mode, Sorting, Top
1765@section Narrowing 1765@section Narrowing
1766@cindex widening 1766@cindex widening
1767@cindex restriction 1767@cindex restriction
@@ -1827,7 +1827,86 @@ this command asks for confirmation and gives you the option of enabling it;
1827if you enable the command, confirmation will no longer be required for 1827if you enable the command, confirmation will no longer be required for
1828it. @xref{Disabling}. 1828it. @xref{Disabling}.
1829 1829
1830@node Two-Column, Editing Binary Files, Narrowing, Top 1830@node Diff Mode, Two-Column, Narrowing, Top
1831@section Diff Mode
1832@cindex Diff mode
1833
1834 Diff mode is useful for editing patches and comparisons produced by
1835the @command{diff} program. You can select Diff mode by typing
1836@kbd{M-x diff-mode}; Emacs commands that compare files automatically
1837select Diff mode. @xref{Top,, Diff, diff, Comparing and Merging Files},
1838for more information about @command{diff} output formats.
1839
1840 One general feature of Diff mode is that manual edits to the patch
1841automatically correct line numbers, including those in the hunk
1842header, so that you can actually apply the edited patch. Diff mode
1843also provides the following commands to navigate, manipulate and apply
1844parts of patches:
1845
1846@table @kbd
1847@item M-n
1848Move to the next hunk-start (@code{diff-hunk-next}).
1849
1850@item M-p
1851Move to the previous hunk-start (@code{diff-hunk-prev}).
1852
1853@item M-@}
1854Move to the next file-start, in a multi-file patch
1855(@code{diff-file-next}).
1856
1857@item M-@{
1858Move to the previous file-start, in a multi-file patch
1859(@code{diff-file-prev}).
1860
1861@item M-k
1862Kill the hunk at point (@code{diff-hunk-kill}).
1863
1864@item M-K
1865In a multi-file patch, kill the current file part.
1866(@code{diff-file-kill}).
1867
1868@item C-c C-a
1869Apply this hunk to its target file (@code{diff-apply-hunk}). With a
1870prefix argument of @kbd{C-u}, revert this hunk.
1871
1872@item C-c C-c
1873Go to the source corresponding to this hunk (@code{diff-goto-source}).
1874
1875@item C-c C-e
1876Start an Ediff session with the patch (@code{diff-ediff-patch}).
1877@xref{Top, Ediff, Ediff, ediff, The Ediff Manual}.
1878
1879@item C-c C-n
1880Restrict the view to the current hunk (@code{diff-restrict-view}).
1881@xref{Narrowing}. With a prefix argument of @kbd{C-u}, restrict the
1882view to the current patch of a multiple file patch. To widen again,
1883use @kbd{C-x n w}.
1884
1885@item C-c C-r
1886Reverse the direction of comparison for the entire buffer
1887(@code{diff-reverse-direction}).
1888
1889@item C-c C-s
1890Split the hunk at point (@code{diff-split-hunk}). This is for
1891manually editing patches, and only works with the unified diff format.
1892
1893@item C-c C-u
1894Convert the entire buffer to unified format
1895(@code{diff-context->unified}). With a prefix argument, convert
1896unified format to context format. In Transient Mark mode, when the
1897mark is active, this command operates only on the region.
1898
1899@item C-c C-w
1900Refine the current hunk so that it disregards changes in whitespace
1901(@code{diff-refine-hunk}).
1902@end table
1903
1904 @kbd{C-x 4 a} in Diff mode operates on behalf of the target file,
1905but gets the function name from the patch itself. @xref{Change Log}.
1906This is useful for making log entries for functions that are deleted
1907by the patch.
1908
1909@node Two-Column, Editing Binary Files, Diff Mode, Top
1831@section Two-Column Editing 1910@section Two-Column Editing
1832@cindex two-column editing 1911@cindex two-column editing
1833@cindex splitting columns 1912@cindex splitting columns
diff --git a/src/ChangeLog b/src/ChangeLog
index a4d458bee0f..bf52364ee66 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,66 @@
12006-05-02 Andreas Schwab <schwab@suse.de>
2
3 * xmenu.c (restore_menu_items): Return a value.
4
52006-05-01 Martin Rudalics <rudalics@gmx.at>
6
7 * syntax.c (Fforward_comment): Detect generic comment at beginning of
8 buffer when moving backwards.
9
102006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11
12 * dispnew.c (update_window): Don't set changed_p when mode/header
13 line is updated.
14
15 * xdisp.c (prepare_menu_bars) [MAC_OS]: Call mac_update_title_bar.
16 (get_glyph_face_and_encoding, get_char_face_and_encoding):
17 Don't distinguish known faces from others.
18
19 * mac.c (mac_coerce_file_name_ptr): Try typeFSRef if coercion
20 through typeFileURL failed.
21
22 * macfns.c (mac_update_title_bar): New function.
23 [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): New function.
24 (show_hourglass, hide_hourglass) [USE_CG_DRAWING]:
25 Call mac_prepare_for_quickdraw.
26
27 * macgui.h (USE_ATSUI): Set default to 1 if MAC_OSX is defined.
28 (USE_CG_DRAWING): Don't define if compiled on Mac OS X 10.1.
29 (enum pcm_status): New enum.
30 (XCHARSTRUCTROW_CHAR_VALID_P, XCHARSTRUCTROW_SET_CHAR_VALID)
31 (XCharStructRow): Remove. Now validity is represented by
32 non-negativeness of sum of ascent and descent.
33 (struct MacFontStruct): Change type of member `rows'.
34 (struct _XGC) [USE_CG_DRAWING]: Add member `clip_rects'.
35
36 * macterm.c (mac_draw_line, mac_draw_line_to_pixmap):
37 Adjust endpoints of strictly horizontal/vertical lines.
38 (mac_set_clip_rectangles) [USE_CG_DRAWING]: Set clip_rects.
39 (pcm_init, pcm_get_status): New functions.
40 (x_per_char_metric, XLoadQueryFont): Use them instead of
41 XCharStructRow and related macros.
42 (x_draw_relief_rect): Don't adjust arguments of mac_draw_line.
43 (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Free FRAME_FILE_NAME.
44 (XTread_socket) [TARGET_API_MAC_CARBON]: Handle proxy icon drag
45 and window path pop-up menu on title bar.
46 (mac_use_core_graphics) [USE_CG_DRAWING]: Set default to 1.
47
48 * macterm.h (mac_update_title_bar): Add extern.
49 (struct mac_output) [TARGET_API_MAC_CARBON]: New member `file_name'.
50 (FRAME_FILE_NAME): New macro.
51
52 * unexmacosx.c (unexec): Error if trying unexec from dumped executable.
53
542006-04-30 Richard Stallman <rms@gnu.org>
55
56 * keymap.c (Fdefine_key): Improve error message
57 when KEY begins with a non-prefix key.
58
592006-04-30 Martin Rudalics <rudalics@gmx.at>
60
61 * syntax.c (Fforward_comment): Don't forget to break out of the loop
62 when we skipped backward over a generic comment.
63
12006-04-27 Nick Roberts <nickrob@snap.net.nz> 642006-04-27 Nick Roberts <nickrob@snap.net.nz>
2 65
3 * .gdbinit (pp1, pv1): Only print value as expression is now 66 * .gdbinit (pp1, pv1): Only print value as expression is now
@@ -31,7 +94,7 @@
31 * xdisp.c (fill_stretch_glyph_string): Set s->nchars = 1 for code which 94 * xdisp.c (fill_stretch_glyph_string): Set s->nchars = 1 for code which
32 does last_glyph=s->first_glyph+s->nchars-1, e.g. if stretch has relief. 95 does last_glyph=s->first_glyph+s->nchars-1, e.g. if stretch has relief.
33 (produce_stretch_glyph): Assume that face box height and width is 96 (produce_stretch_glyph): Assume that face box height and width is
34 already included in in stretch glyph size so caller doesn't have to 97 already included in stretch glyph size so caller doesn't have to
35 consider the extra space otherwise added (fixes problem in ses.el). 98 consider the extra space otherwise added (fixes problem in ses.el).
36 99
37 * frame.c (x_set_font): Clear f->n_tool_bar_rows and current frame 100 * frame.c (x_set_font): Clear f->n_tool_bar_rows and current frame
@@ -1678,7 +1741,7 @@
1678 1741
1679 * image.c [MAC_OS] (find_image_fsspec): Likewise. 1742 * image.c [MAC_OS] (find_image_fsspec): Likewise.
1680 1743
16812005-12-23 Martin Rudalics <rudalics@gmx.at> (tiny change) 17442005-12-23 Martin Rudalics <rudalics@gmx.at>
1682 1745
1683 * insdel.c (insert, insert_and_inherit, insert_before_markers) 1746 * insdel.c (insert, insert_and_inherit, insert_before_markers)
1684 (insert_before_markers_and_inherit): Make sure FROM is correct 1747 (insert_before_markers_and_inherit): Make sure FROM is correct
diff --git a/src/dispnew.c b/src/dispnew.c
index 8298ee694d6..a3ac89e05d5 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -4157,7 +4157,6 @@ update_window (w, force_p)
4157 update_window_line (w, MATRIX_ROW_VPOS (mode_line_row, 4157 update_window_line (w, MATRIX_ROW_VPOS (mode_line_row,
4158 desired_matrix), 4158 desired_matrix),
4159 &mouse_face_overwritten_p); 4159 &mouse_face_overwritten_p);
4160 changed_p = 1;
4161 } 4160 }
4162 4161
4163 /* Find first enabled row. Optimizations in redisplay_internal 4162 /* Find first enabled row. Optimizations in redisplay_internal
@@ -4227,7 +4226,6 @@ update_window (w, force_p)
4227 { 4226 {
4228 header_line_row->y = 0; 4227 header_line_row->y = 0;
4229 update_window_line (w, 0, &mouse_face_overwritten_p); 4228 update_window_line (w, 0, &mouse_face_overwritten_p);
4230 changed_p = 1;
4231 } 4229 }
4232 4230
4233 /* Fix the appearance of overlapping/overlapped rows. */ 4231 /* Fix the appearance of overlapping/overlapped rows. */
diff --git a/src/keymap.c b/src/keymap.c
index 7ff3f471b0f..c609ed6c4e4 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1186,8 +1186,11 @@ binding KEY to DEF is added at the front of KEYMAP. */)
1186 if (!CONSP (keymap)) 1186 if (!CONSP (keymap))
1187 /* We must use Fkey_description rather than just passing key to 1187 /* We must use Fkey_description rather than just passing key to
1188 error; key might be a vector, not a string. */ 1188 error; key might be a vector, not a string. */
1189 error ("Key sequence %s uses invalid prefix characters", 1189 error ("Key sequence %s starts with non-prefix key %s",
1190 SDATA (Fkey_description (key, Qnil))); 1190 SDATA (Fkey_description (key, Qnil)),
1191 SDATA (Fkey_description (Fsubstring (key, make_number (0),
1192 make_number (idx)),
1193 Qnil)));
1191 } 1194 }
1192} 1195}
1193 1196
diff --git a/src/mac.c b/src/mac.c
index 7172301b6b0..444320322c3 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -448,6 +448,22 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size,
448 } 448 }
449 else 449 else
450 err = memFullErr; 450 err = memFullErr;
451
452 if (err != noErr)
453 {
454 /* Just to be paranoid ... */
455 FSRef fref;
456 char *buf;
457
458 buf = xmalloc (data_size + 1);
459 memcpy (buf, data_ptr, data_size);
460 buf[data_size] = '\0';
461 err = FSPathMakeRef (buf, &fref, NULL);
462 xfree (buf);
463 if (err == noErr)
464 err = AECoercePtr (typeFSRef, &fref, sizeof (FSRef),
465 to_type, result);
466 }
451#else 467#else
452 FSSpec fs; 468 FSSpec fs;
453 char *buf; 469 char *buf;
@@ -510,6 +526,34 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size,
510 CFDataGetLength (data), result); 526 CFDataGetLength (data), result);
511 CFRelease (data); 527 CFRelease (data);
512 } 528 }
529
530 if (err != noErr)
531 {
532 /* Coercion from typeAlias to typeFileURL fails on Mac OS X
533 10.2. In such cases, try typeFSRef as a target type. */
534 char file_name[MAXPATHLEN];
535
536 if (type_code == typeFSRef && data_size == sizeof (FSRef))
537 err = FSRefMakePath (data_ptr, file_name, sizeof (file_name));
538 else
539 {
540 AEDesc desc;
541 FSRef fref;
542
543 err = AECoercePtr (type_code, data_ptr, data_size,
544 typeFSRef, &desc);
545 if (err == noErr)
546 {
547 err = AEGetDescData (&desc, &fref, sizeof (FSRef));
548 AEDisposeDesc (&desc);
549 }
550 if (err == noErr)
551 err = FSRefMakePath (&fref, file_name, sizeof (file_name));
552 }
553 if (err == noErr)
554 err = AECreateDesc (TYPE_FILE_NAME, file_name,
555 strlen (file_name), result);
556 }
513#else 557#else
514 char file_name[MAXPATHLEN]; 558 char file_name[MAXPATHLEN];
515 559
@@ -529,11 +573,11 @@ mac_coerce_file_name_ptr (type_code, data_ptr, data_size,
529#else 573#else
530 fs = *(FSSpec *)(*(desc.dataHandle)); 574 fs = *(FSSpec *)(*(desc.dataHandle));
531#endif 575#endif
532 if (err == noErr)
533 err = fsspec_to_posix_pathname (&fs, file_name,
534 sizeof (file_name) - 1);
535 AEDisposeDesc (&desc); 576 AEDisposeDesc (&desc);
536 } 577 }
578 if (err == noErr)
579 err = fsspec_to_posix_pathname (&fs, file_name,
580 sizeof (file_name) - 1);
537 } 581 }
538 if (err == noErr) 582 if (err == noErr)
539 err = AECreateDesc (TYPE_FILE_NAME, file_name, 583 err = AECreateDesc (TYPE_FILE_NAME, file_name,
diff --git a/src/macfns.c b/src/macfns.c
index 3f5151daee9..2a83fef0870 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -1919,6 +1919,100 @@ mac_set_scroll_bar_width (f, arg, oldval)
1919 x_set_scroll_bar_width (f, arg, oldval); 1919 x_set_scroll_bar_width (f, arg, oldval);
1920} 1920}
1921 1921
1922#if TARGET_API_MAC_CARBON
1923static void
1924mac_update_proxy_icon (f)
1925 struct frame *f;
1926{
1927 Lisp_Object file_name =
1928 XBUFFER (XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer)->filename;
1929 Window w = FRAME_MAC_WINDOW (f);
1930
1931 if (FRAME_FILE_NAME (f) == NULL && !STRINGP (file_name))
1932 return;
1933 if (FRAME_FILE_NAME (f) && STRINGP (file_name)
1934 && strcmp (FRAME_FILE_NAME (f), SDATA (file_name)) == 0)
1935 return;
1936
1937 if (FRAME_FILE_NAME (f))
1938 {
1939 xfree (FRAME_FILE_NAME (f));
1940 FRAME_FILE_NAME (f) = NULL;
1941 }
1942
1943 BLOCK_INPUT;
1944
1945 if (STRINGP (file_name))
1946 {
1947 OSStatus err;
1948 AEDesc desc;
1949 Lisp_Object encoded_file_name = ENCODE_FILE (file_name);
1950
1951#ifdef MAC_OS8
1952 SetPortWindowPort (w);
1953#endif
1954 err = AECoercePtr (TYPE_FILE_NAME, SDATA (encoded_file_name),
1955 SBYTES (encoded_file_name), typeAlias, &desc);
1956 if (err == noErr)
1957 {
1958 Size size = AEGetDescDataSize (&desc);
1959 AliasHandle alias = (AliasHandle) NewHandle (size);
1960
1961 if (alias == NULL)
1962 err = memFullErr;
1963 else
1964 {
1965 HLock ((Handle) alias);
1966 err = AEGetDescData (&desc, *alias, size);
1967 HUnlock ((Handle) alias);
1968 if (err == noErr)
1969 err = SetWindowProxyAlias (w, alias);
1970 DisposeHandle ((Handle) alias);
1971 }
1972 AEDisposeDesc (&desc);
1973 }
1974 if (err == noErr)
1975 {
1976 FRAME_FILE_NAME (f) = xmalloc (SBYTES (file_name) + 1);
1977 strcpy (FRAME_FILE_NAME (f), SDATA (file_name));
1978 }
1979 }
1980
1981 if (FRAME_FILE_NAME (f) == NULL)
1982 RemoveWindowProxy (w);
1983
1984 UNBLOCK_INPUT;
1985}
1986#endif
1987
1988void
1989mac_update_title_bar (f, save_match_data)
1990 struct frame *f;
1991 int save_match_data;
1992{
1993#if TARGET_API_MAC_CARBON
1994 struct window *w;
1995 int modified_p;
1996
1997 if (!FRAME_MAC_P (f))
1998 return;
1999
2000 w = XWINDOW (FRAME_SELECTED_WINDOW (f));
2001 modified_p = (BUF_SAVE_MODIFF (XBUFFER (w->buffer))
2002 < BUF_MODIFF (XBUFFER (w->buffer)));
2003 if (windows_or_buffers_changed
2004 /* Minibuffer modification status shown in the close button is
2005 confusing. */
2006 || (!MINI_WINDOW_P (w)
2007 && (modified_p != !NILP (w->last_had_star))))
2008 SetWindowModified (FRAME_MAC_WINDOW (f),
2009 !MINI_WINDOW_P (w) && modified_p);
2010
2011 if (windows_or_buffers_changed)
2012 mac_update_proxy_icon (f);
2013#endif
2014}
2015
1922 2016
1923/* Subroutines of creating a frame. */ 2017/* Subroutines of creating a frame. */
1924 2018
@@ -3470,6 +3564,9 @@ show_hourglass (timer)
3470 if (FRAME_LIVE_P (f) && FRAME_MAC_P (f) 3564 if (FRAME_LIVE_P (f) && FRAME_MAC_P (f)
3471 && FRAME_MAC_WINDOW (f) != tip_window) 3565 && FRAME_MAC_WINDOW (f) != tip_window)
3472 { 3566 {
3567#if USE_CG_DRAWING
3568 mac_prepare_for_quickdraw (f);
3569#endif
3473 if (!f->output_data.mac->hourglass_control) 3570 if (!f->output_data.mac->hourglass_control)
3474 { 3571 {
3475 Window w = FRAME_MAC_WINDOW (f); 3572 Window w = FRAME_MAC_WINDOW (f);
@@ -3514,7 +3611,12 @@ hide_hourglass ()
3514 if (FRAME_MAC_P (f) 3611 if (FRAME_MAC_P (f)
3515 /* Watch out for newly created frames. */ 3612 /* Watch out for newly created frames. */
3516 && f->output_data.mac->hourglass_control) 3613 && f->output_data.mac->hourglass_control)
3517 HideControl (f->output_data.mac->hourglass_control); 3614 {
3615#if USE_CG_DRAWING
3616 mac_prepare_for_quickdraw (f);
3617#endif
3618 HideControl (f->output_data.mac->hourglass_control);
3619 }
3518 } 3620 }
3519 3621
3520 hourglass_shown_p = 0; 3622 hourglass_shown_p = 0;
diff --git a/src/macgui.h b/src/macgui.h
index 7eb6c9942ab..579ae2b7663 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -79,14 +79,26 @@ typedef unsigned long Time;
79#include <Gestalt.h> 79#include <Gestalt.h>
80#endif /* not HAVE_CARBON */ 80#endif /* not HAVE_CARBON */
81 81
82/* Whether to use ATSUI (Apple Type Services for Unicode Imaging) for
83 text drawing. */
84#ifndef USE_ATSUI
85#ifdef MAC_OSX
86#define USE_ATSUI 1
87#endif
88#endif
89
90/* Whether to use low-level Quartz 2D (aka Core Graphics) text drawing
91 in preference to ATSUI for ASCII and Latin-1 characters. */
82#ifndef USE_CG_TEXT_DRAWING 92#ifndef USE_CG_TEXT_DRAWING
83#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 93#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
84#define USE_CG_TEXT_DRAWING 1 94#define USE_CG_TEXT_DRAWING 1
85#endif 95#endif
86#endif 96#endif
87 97
98/* Whether to use Quartz 2D routines for drawing operations other than
99 texts. */
88#ifndef USE_CG_DRAWING 100#ifndef USE_CG_DRAWING
89#if USE_ATSUI && defined (MAC_OSX) 101#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
90#define USE_CG_DRAWING 1 102#define USE_CG_DRAWING 1
91#endif 103#endif
92#endif 104#endif
@@ -105,6 +117,8 @@ typedef GWorldPtr Pixmap;
105 117
106 118
107/* Emulate XCharStruct. */ 119/* Emulate XCharStruct. */
120/* If the sum of ascent and descent is negative, that means some
121 special status specified by enum pcm_status. */
108typedef struct _XCharStruct 122typedef struct _XCharStruct
109{ 123{
110 short lbearing; /* origin to left edge of raster */ 124 short lbearing; /* origin to left edge of raster */
@@ -117,6 +131,12 @@ typedef struct _XCharStruct
117#endif 131#endif
118} XCharStruct; 132} XCharStruct;
119 133
134enum pcm_status
135 {
136 PCM_VALID = 0, /* pcm data is valid */
137 PCM_INVALID = -1, /* pcm data is invalid */
138 };
139
120#define STORE_XCHARSTRUCT(xcs, w, bds) \ 140#define STORE_XCHARSTRUCT(xcs, w, bds) \
121 ((xcs).width = (w), \ 141 ((xcs).width = (w), \
122 (xcs).lbearing = (bds).left, \ 142 (xcs).lbearing = (bds).left, \
@@ -124,18 +144,6 @@ typedef struct _XCharStruct
124 (xcs).ascent = -(bds).top, \ 144 (xcs).ascent = -(bds).top, \
125 (xcs).descent = (bds).bottom) 145 (xcs).descent = (bds).bottom)
126 146
127typedef struct
128{
129 char valid_bits[0x100 / 8];
130 XCharStruct per_char[0x100];
131} XCharStructRow;
132
133#define XCHARSTRUCTROW_CHAR_VALID_P(row, byte2) \
134 ((row)->valid_bits[(byte2) / 8] & (1 << (byte2) % 8))
135
136#define XCHARSTRUCTROW_SET_CHAR_VALID(row, byte2) \
137 ((row)->valid_bits[(byte2) / 8] |= (1 << (byte2) % 8))
138
139struct MacFontStruct { 147struct MacFontStruct {
140 char *full_name; 148 char *full_name;
141 149
@@ -175,7 +183,7 @@ struct MacFontStruct {
175 XCharStruct max_bounds; /* maximum bounds over all existing char */ 183 XCharStruct max_bounds; /* maximum bounds over all existing char */
176 union { 184 union {
177 XCharStruct *per_char; /* first_char to last_char information */ 185 XCharStruct *per_char; /* first_char to last_char information */
178 XCharStructRow **rows; /* first row to last row information */ 186 XCharStruct **rows; /* first row to last row information */
179 } bounds; 187 } bounds;
180 int ascent; /* logical extent above baseline for spacing */ 188 int ascent; /* logical extent above baseline for spacing */
181 int descent; /* logical decent below baseline for spacing */ 189 int descent; /* logical decent below baseline for spacing */
@@ -229,7 +237,7 @@ typedef struct _XGC
229 /* QuickDraw clipping region. Ignored if n_clip_rects == 0. */ 237 /* QuickDraw clipping region. Ignored if n_clip_rects == 0. */
230 RgnHandle clip_region; 238 RgnHandle clip_region;
231 239
232#if defined (MAC_OSX) && USE_ATSUI 240#if defined (MAC_OSX) && (USE_ATSUI || USE_CG_DRAWING)
233 /* Clipping rectangles used in Quartz 2D drawing. The y-coordinate 241 /* Clipping rectangles used in Quartz 2D drawing. The y-coordinate
234 is in QuickDraw's. */ 242 is in QuickDraw's. */
235 CGRect clip_rects[MAX_CLIP_RECTS]; 243 CGRect clip_rects[MAX_CLIP_RECTS];
diff --git a/src/macterm.c b/src/macterm.c
index 6c47e2f932f..45bc533893c 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -389,16 +389,37 @@ mac_draw_line (f, gc, x1, y1, x2, y2)
389{ 389{
390#if USE_CG_DRAWING 390#if USE_CG_DRAWING
391 CGContextRef context; 391 CGContextRef context;
392 float gx1 = x1, gy1 = y1, gx2 = x2, gy2 = y2;
393
394 if (y1 != y2)
395 gx1 += 0.5f, gx2 += 0.5f;
396 if (x1 != x2)
397 gy1 += 0.5f, gy2 += 0.5f;
392 398
393 context = mac_begin_cg_clip (f, gc); 399 context = mac_begin_cg_clip (f, gc);
394 CG_SET_STROKE_COLOR (context, gc->xgcv.foreground); 400 CG_SET_STROKE_COLOR (context, gc->xgcv.foreground);
395 CGContextBeginPath (context); 401 CGContextBeginPath (context);
396 CGContextMoveToPoint (context, x1 + 0.5f, y1 + 0.5f); 402 CGContextMoveToPoint (context, gx1, gy1);
397 CGContextAddLineToPoint (context, x2 + 0.5f, y2 + 0.5f); 403 CGContextAddLineToPoint (context, gx2, gy2);
398 CGContextClosePath (context); 404 CGContextClosePath (context);
399 CGContextStrokePath (context); 405 CGContextStrokePath (context);
400 mac_end_cg_clip (f); 406 mac_end_cg_clip (f);
401#else 407#else
408 if (x1 == x2)
409 {
410 if (y1 > y2)
411 y1--;
412 else if (y2 > y1)
413 y2--;
414 }
415 else if (y1 == y2)
416 {
417 if (x1 > x2)
418 x1--;
419 else
420 x2--;
421 }
422
402 SetPortWindowPort (FRAME_MAC_WINDOW (f)); 423 SetPortWindowPort (FRAME_MAC_WINDOW (f));
403 424
404 RGBForeColor (GC_FORE_COLOR (gc)); 425 RGBForeColor (GC_FORE_COLOR (gc));
@@ -420,6 +441,21 @@ mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2)
420 CGrafPtr old_port; 441 CGrafPtr old_port;
421 GDHandle old_gdh; 442 GDHandle old_gdh;
422 443
444 if (x1 == x2)
445 {
446 if (y1 > y2)
447 y1--;
448 else if (y2 > y1)
449 y2--;
450 }
451 else if (y1 == y2)
452 {
453 if (x1 > x2)
454 x1--;
455 else
456 x2--;
457 }
458
423 GetGWorld (&old_port, &old_gdh); 459 GetGWorld (&old_port, &old_gdh);
424 SetGWorld (p, NULL); 460 SetGWorld (p, NULL);
425 461
@@ -1625,7 +1661,7 @@ mac_set_clip_rectangles (display, gc, rectangles, n)
1625 DisposeRgn (region); 1661 DisposeRgn (region);
1626 } 1662 }
1627 } 1663 }
1628#if defined (MAC_OSX) && USE_ATSUI 1664#if defined (MAC_OSX) && (USE_ATSUI || USE_CG_DRAWING)
1629 for (i = 0; i < n; i++) 1665 for (i = 0; i < n; i++)
1630 { 1666 {
1631 Rect *rect = rectangles + i; 1667 Rect *rect = rectangles + i;
@@ -2136,6 +2172,29 @@ static XCharStruct *x_per_char_metric P_ ((XFontStruct *, XChar2b *));
2136static int mac_encode_char P_ ((int, XChar2b *, struct font_info *, int *)); 2172static int mac_encode_char P_ ((int, XChar2b *, struct font_info *, int *));
2137 2173
2138 2174
2175static void
2176pcm_init (pcm, count)
2177 XCharStruct *pcm;
2178 int count;
2179{
2180 bzero (pcm, sizeof (XCharStruct) * count);
2181 while (--count >= 0)
2182 {
2183 pcm->descent = PCM_INVALID;
2184 pcm++;
2185 }
2186}
2187
2188static enum pcm_status
2189pcm_get_status (pcm)
2190 XCharStruct *pcm;
2191{
2192 int height = pcm->ascent + pcm->descent;
2193
2194 /* Negative height means some special status. */
2195 return height >= 0 ? PCM_VALID : height;
2196}
2197
2139/* Get metrics of character CHAR2B in FONT. Value is null if CHAR2B 2198/* Get metrics of character CHAR2B in FONT. Value is null if CHAR2B
2140 is not contained in the font. */ 2199 is not contained in the font. */
2141 2200
@@ -2152,22 +2211,21 @@ x_per_char_metric (font, char2b)
2152#if USE_ATSUI 2211#if USE_ATSUI
2153 if (font->mac_style) 2212 if (font->mac_style)
2154 { 2213 {
2155 XCharStructRow **row = font->bounds.rows + char2b->byte1; 2214 XCharStruct **row = font->bounds.rows + char2b->byte1;
2156 2215
2157 if (*row == NULL) 2216 if (*row == NULL)
2158 { 2217 {
2159 *row = xmalloc (sizeof (XCharStructRow)); 2218 *row = xmalloc (sizeof (XCharStruct) * 0x100);
2160 bzero (*row, sizeof (XCharStructRow)); 2219 pcm_init (*row, 0x100);
2161 } 2220 }
2162 pcm = (*row)->per_char + char2b->byte2; 2221 pcm = *row + char2b->byte2;
2163 if (!XCHARSTRUCTROW_CHAR_VALID_P (*row, char2b->byte2)) 2222 if (pcm_get_status (pcm) != PCM_VALID)
2164 { 2223 {
2165 BLOCK_INPUT; 2224 BLOCK_INPUT;
2166 mac_query_char_extents (font->mac_style, 2225 mac_query_char_extents (font->mac_style,
2167 (char2b->byte1 << 8) + char2b->byte2, 2226 (char2b->byte1 << 8) + char2b->byte2,
2168 NULL, NULL, pcm, NULL); 2227 NULL, NULL, pcm, NULL);
2169 UNBLOCK_INPUT; 2228 UNBLOCK_INPUT;
2170 XCHARSTRUCTROW_SET_CHAR_VALID (*row, char2b->byte2);
2171 } 2229 }
2172 } 2230 }
2173 else 2231 else
@@ -3122,13 +3180,13 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
3122 for (i = 0; i < width; ++i) 3180 for (i = 0; i < width; ++i)
3123 mac_draw_line (f, gc, 3181 mac_draw_line (f, gc,
3124 left_x + i * left_p, top_y + i, 3182 left_x + i * left_p, top_y + i,
3125 right_x - i * right_p, top_y + i); 3183 right_x + 1 - i * right_p, top_y + i);
3126 3184
3127 /* Left. */ 3185 /* Left. */
3128 if (left_p) 3186 if (left_p)
3129 for (i = 0; i < width; ++i) 3187 for (i = 0; i < width; ++i)
3130 mac_draw_line (f, gc, 3188 mac_draw_line (f, gc,
3131 left_x + i, top_y + i, left_x + i, bottom_y - i); 3189 left_x + i, top_y + i, left_x + i, bottom_y - i + 1);
3132 3190
3133 mac_reset_clip_rectangles (dpy, gc); 3191 mac_reset_clip_rectangles (dpy, gc);
3134 if (raised_p) 3192 if (raised_p)
@@ -3142,13 +3200,13 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
3142 for (i = 0; i < width; ++i) 3200 for (i = 0; i < width; ++i)
3143 mac_draw_line (f, gc, 3201 mac_draw_line (f, gc,
3144 left_x + i * left_p, bottom_y - i, 3202 left_x + i * left_p, bottom_y - i,
3145 right_x - i * right_p, bottom_y - i); 3203 right_x + 1 - i * right_p, bottom_y - i);
3146 3204
3147 /* Right. */ 3205 /* Right. */
3148 if (right_p) 3206 if (right_p)
3149 for (i = 0; i < width; ++i) 3207 for (i = 0; i < width; ++i)
3150 mac_draw_line (f, gc, 3208 mac_draw_line (f, gc,
3151 right_x - i, top_y + i + 1, right_x - i, bottom_y - i - 1); 3209 right_x - i, top_y + i + 1, right_x - i, bottom_y - i);
3152 3210
3153 mac_reset_clip_rectangles (dpy, gc); 3211 mac_reset_clip_rectangles (dpy, gc);
3154} 3212}
@@ -6300,6 +6358,11 @@ x_free_frame_resources (f)
6300 if (FRAME_SIZE_HINTS (f)) 6358 if (FRAME_SIZE_HINTS (f))
6301 xfree (FRAME_SIZE_HINTS (f)); 6359 xfree (FRAME_SIZE_HINTS (f));
6302 6360
6361#if TARGET_API_MAC_CARBON
6362 if (FRAME_FILE_NAME (f))
6363 xfree (FRAME_FILE_NAME (f));
6364#endif
6365
6303 xfree (f->output_data.mac); 6366 xfree (f->output_data.mac);
6304 f->output_data.mac = NULL; 6367 f->output_data.mac = NULL;
6305 6368
@@ -7746,10 +7809,10 @@ XLoadQueryFont (Display *dpy, char *fontname)
7746 font->min_char_or_byte2 = 0; 7809 font->min_char_or_byte2 = 0;
7747 font->max_char_or_byte2 = 0xff; 7810 font->max_char_or_byte2 = 0xff;
7748 7811
7749 font->bounds.rows = xmalloc (sizeof (XCharStructRow *) * 0x100); 7812 font->bounds.rows = xmalloc (sizeof (XCharStruct *) * 0x100);
7750 bzero (font->bounds.rows, sizeof (XCharStructRow *) * 0x100); 7813 bzero (font->bounds.rows, sizeof (XCharStruct *) * 0x100);
7751 font->bounds.rows[0] = xmalloc (sizeof (XCharStructRow)); 7814 font->bounds.rows[0] = xmalloc (sizeof (XCharStruct) * 0x100);
7752 bzero (font->bounds.rows[0], sizeof (XCharStructRow)); 7815 pcm_init (font->bounds.rows[0], 0x100);
7753 7816
7754#if USE_CG_TEXT_DRAWING 7817#if USE_CG_TEXT_DRAWING
7755 { 7818 {
@@ -7775,7 +7838,7 @@ XLoadQueryFont (Display *dpy, char *fontname)
7775 bzero (font->cg_glyphs, sizeof (CGGlyph) * 0x100); 7838 bzero (font->cg_glyphs, sizeof (CGGlyph) * 0x100);
7776 } 7839 }
7777#endif 7840#endif
7778 space_bounds = font->bounds.rows[0]->per_char + 0x20; 7841 space_bounds = font->bounds.rows[0] + 0x20;
7779 err = mac_query_char_extents (font->mac_style, 0x20, 7842 err = mac_query_char_extents (font->mac_style, 0x20,
7780 &font->ascent, &font->descent, 7843 &font->ascent, &font->descent,
7781 space_bounds, 7844 space_bounds,
@@ -7791,9 +7854,8 @@ XLoadQueryFont (Display *dpy, char *fontname)
7791 mac_unload_font (&one_mac_display_info, font); 7854 mac_unload_font (&one_mac_display_info, font);
7792 return NULL; 7855 return NULL;
7793 } 7856 }
7794 XCHARSTRUCTROW_SET_CHAR_VALID (font->bounds.rows[0], 0x20);
7795 7857
7796 pcm = font->bounds.rows[0]->per_char; 7858 pcm = font->bounds.rows[0];
7797 for (c = 0x21; c <= 0xff; c++) 7859 for (c = 0x21; c <= 0xff; c++)
7798 { 7860 {
7799 if (c == 0xad) 7861 if (c == 0xad)
@@ -7813,7 +7875,6 @@ XLoadQueryFont (Display *dpy, char *fontname)
7813 NULL 7875 NULL
7814#endif 7876#endif
7815 ); 7877 );
7816 XCHARSTRUCTROW_SET_CHAR_VALID (font->bounds.rows[0], c);
7817 7878
7818#if USE_CG_TEXT_DRAWING 7879#if USE_CG_TEXT_DRAWING
7819 if (font->cg_glyphs && font->cg_glyphs[c] == 0) 7880 if (font->cg_glyphs && font->cg_glyphs[c] == 0)
@@ -9997,8 +10058,20 @@ XTread_socket (sd, expected, hold_quit)
9997 } 10058 }
9998 break; 10059 break;
9999 10060
10061#if TARGET_API_MAC_CARBON
10062 case inProxyIcon:
10063 if (TrackWindowProxyDrag (window_ptr, er.where)
10064 != errUserWantsToDragWindow)
10065 break;
10066 /* fall through */
10067#endif
10000 case inDrag: 10068 case inDrag:
10001#if TARGET_API_MAC_CARBON 10069#if TARGET_API_MAC_CARBON
10070 if (IsWindowPathSelectClick (window_ptr, &er))
10071 {
10072 WindowPathSelect (window_ptr, NULL, NULL);
10073 break;
10074 }
10002 DragWindow (window_ptr, er.where, NULL); 10075 DragWindow (window_ptr, er.where, NULL);
10003#else /* not TARGET_API_MAC_CARBON */ 10076#else /* not TARGET_API_MAC_CARBON */
10004 DragWindow (window_ptr, er.where, &qd.screenBits.bounds); 10077 DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
@@ -11050,7 +11123,11 @@ button will be mouse-3. */);
11050 doc: /* *If non-nil, allow anti-aliasing. 11123 doc: /* *If non-nil, allow anti-aliasing.
11051The text will be rendered using Core Graphics text rendering which 11124The text will be rendered using Core Graphics text rendering which
11052may anti-alias the text. */); 11125may anti-alias the text. */);
11126#if USE_CG_DRAWING
11127 mac_use_core_graphics = 1;
11128#else
11053 mac_use_core_graphics = 0; 11129 mac_use_core_graphics = 0;
11130#endif
11054 11131
11055 /* Register an entry for `mac-roman' so that it can be used when 11132 /* Register an entry for `mac-roman' so that it can be used when
11056 creating the terminal frame on Mac OS 9 before loading 11133 creating the terminal frame on Mac OS 9 before loading
diff --git a/src/macterm.h b/src/macterm.h
index db284fe7788..80276b45102 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -335,6 +335,11 @@ struct mac_output {
335 /* Hints for the size and the position of a window. */ 335 /* Hints for the size and the position of a window. */
336 XSizeHints *size_hints; 336 XSizeHints *size_hints;
337 337
338#if TARGET_API_MAC_CARBON
339 /* File name for the proxy icon of this frame. Might be NULL. */
340 char *file_name;
341#endif
342
338#if USE_CG_DRAWING 343#if USE_CG_DRAWING
339 /* Quartz 2D graphics context. */ 344 /* Quartz 2D graphics context. */
340 CGContextRef cg_context; 345 CGContextRef cg_context;
@@ -357,6 +362,8 @@ typedef struct mac_output mac_output;
357 362
358#define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints) 363#define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints)
359 364
365#define FRAME_FILE_NAME(f) ((f)->output_data.mac->file_name)
366
360/* This gives the mac_display_info structure for the display F is on. */ 367/* This gives the mac_display_info structure for the display F is on. */
361#define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info) 368#define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info)
362#define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info) 369#define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info)
@@ -603,6 +610,7 @@ extern int x_char_width P_ ((struct frame *));
603extern int x_char_height P_ ((struct frame *)); 610extern int x_char_height P_ ((struct frame *));
604extern void x_sync P_ ((struct frame *)); 611extern void x_sync P_ ((struct frame *));
605extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); 612extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
613extern void mac_update_title_bar P_ ((struct frame *, int));
606 614
607/* Defined in macmenu.c */ 615/* Defined in macmenu.c */
608 616
diff --git a/src/syntax.c b/src/syntax.c
index 3f668eac946..1c8d0debbf3 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2123,8 +2123,6 @@ between them, return t; otherwise return nil. */)
2123 while (1) 2123 while (1)
2124 { 2124 {
2125 DEC_BOTH (from, from_byte); 2125 DEC_BOTH (from, from_byte);
2126 if (from == stop)
2127 break;
2128 UPDATE_SYNTAX_TABLE_BACKWARD (from); 2126 UPDATE_SYNTAX_TABLE_BACKWARD (from);
2129 c = FETCH_CHAR (from_byte); 2127 c = FETCH_CHAR (from_byte);
2130 if (SYNTAX (c) == Scomment_fence 2128 if (SYNTAX (c) == Scomment_fence
@@ -2133,6 +2131,8 @@ between them, return t; otherwise return nil. */)
2133 found = 1; 2131 found = 1;
2134 break; 2132 break;
2135 } 2133 }
2134 else if (from == stop)
2135 break;
2136 } 2136 }
2137 if (found == 0) 2137 if (found == 0)
2138 { 2138 {
@@ -2140,6 +2140,9 @@ between them, return t; otherwise return nil. */)
2140 from_byte = ini_byte; 2140 from_byte = ini_byte;
2141 goto leave; 2141 goto leave;
2142 } 2142 }
2143 else
2144 /* We have skipped one comment. */
2145 break;
2143 } 2146 }
2144 else if (code == Sendcomment) 2147 else if (code == Sendcomment)
2145 { 2148 {
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index 4ca0be829a2..f65fd9cbc22 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -1021,6 +1021,9 @@ void
1021unexec (char *outfile, char *infile, void *start_data, void *start_bss, 1021unexec (char *outfile, char *infile, void *start_data, void *start_bss,
1022 void *entry_address) 1022 void *entry_address)
1023{ 1023{
1024 if (in_dumped_exec)
1025 unexec_error ("Unexec from a dumped executable is not supported.");
1026
1024 infd = open (infile, O_RDONLY, 0); 1027 infd = open (infile, O_RDONLY, 0);
1025 if (infd < 0) 1028 if (infd < 0)
1026 { 1029 {
diff --git a/src/xdisp.c b/src/xdisp.c
index 25dd0ffce3d..d05b1c5293d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -8955,6 +8955,9 @@ prepare_menu_bars ()
8955 update_menu_bar (f, 0); 8955 update_menu_bar (f, 0);
8956#ifdef HAVE_WINDOW_SYSTEM 8956#ifdef HAVE_WINDOW_SYSTEM
8957 update_tool_bar (f, 0); 8957 update_tool_bar (f, 0);
8958#ifdef MAC_OS
8959 mac_update_title_bar (f, 0);
8960#endif
8958#endif 8961#endif
8959 UNGCPRO; 8962 UNGCPRO;
8960 } 8963 }
@@ -8967,6 +8970,9 @@ prepare_menu_bars ()
8967 update_menu_bar (sf, 1); 8970 update_menu_bar (sf, 1);
8968#ifdef HAVE_WINDOW_SYSTEM 8971#ifdef HAVE_WINDOW_SYSTEM
8969 update_tool_bar (sf, 1); 8972 update_tool_bar (sf, 1);
8973#ifdef MAC_OS
8974 mac_update_title_bar (sf, 1);
8975#endif
8970#endif 8976#endif
8971 } 8977 }
8972 8978
@@ -18534,8 +18540,7 @@ get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
18534 sure to use a face suitable for unibyte. */ 18540 sure to use a face suitable for unibyte. */
18535 STORE_XCHAR2B (char2b, 0, glyph->u.ch); 18541 STORE_XCHAR2B (char2b, 0, glyph->u.ch);
18536 } 18542 }
18537 else if (glyph->u.ch < 128 18543 else if (glyph->u.ch < 128)
18538 && glyph->face_id < BASIC_FACE_ID_SENTINEL)
18539 { 18544 {
18540 /* Case of ASCII in a face known to fit ASCII. */ 18545 /* Case of ASCII in a face known to fit ASCII. */
18541 STORE_XCHAR2B (char2b, 0, glyph->u.ch); 18546 STORE_XCHAR2B (char2b, 0, glyph->u.ch);
@@ -18937,7 +18942,7 @@ get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p)
18937 face_id = FACE_FOR_CHAR (f, face, c); 18942 face_id = FACE_FOR_CHAR (f, face, c);
18938 face = FACE_FROM_ID (f, face_id); 18943 face = FACE_FROM_ID (f, face_id);
18939 } 18944 }
18940 else if (c < 128 && face_id < BASIC_FACE_ID_SENTINEL) 18945 else if (c < 128)
18941 { 18946 {
18942 /* Case of ASCII in a face known to fit ASCII. */ 18947 /* Case of ASCII in a face known to fit ASCII. */
18943 STORE_XCHAR2B (char2b, 0, c); 18948 STORE_XCHAR2B (char2b, 0, c);
diff --git a/src/xmenu.c b/src/xmenu.c
index 6e5ec6c5058..794a6f22898 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -327,6 +327,7 @@ restore_menu_items (saved)
327 menu_items_n_panes = XINT (XCAR (saved)); 327 menu_items_n_panes = XINT (XCAR (saved));
328 saved = XCDR (saved); 328 saved = XCDR (saved);
329 menu_items_submenu_depth = XINT (XCAR (saved)); 329 menu_items_submenu_depth = XINT (XCAR (saved));
330 return Qnil;
330} 331}
331 332
332/* Push the whole state of menu_items processing onto the specpdl. 333/* Push the whole state of menu_items processing onto the specpdl.