aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/ChangeLog12
-rw-r--r--etc/MH-E-NEWS97
-rw-r--r--etc/NEWS55
-rw-r--r--etc/orgcard.tex2
-rw-r--r--lib-src/ChangeLog14
-rw-r--r--lib-src/etags.c1
-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/ChangeLog367
-rw-r--r--lisp/ChangeLog.116
-rw-r--r--lisp/abbrev.el4
-rw-r--r--lisp/add-log.el85
-rw-r--r--lisp/allout.el100
-rw-r--r--lisp/bindings.el4
-rw-r--r--lisp/calc/calc-embed.el4
-rw-r--r--lisp/calendar/cal-menu.el2
-rw-r--r--lisp/calendar/cal-tex.el20
-rw-r--r--lisp/calendar/diary-lib.el2
-rw-r--r--lisp/comint.el2
-rw-r--r--lisp/cus-edit.el2
-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/faces.el8
-rw-r--r--lisp/files.el6
-rw-r--r--lisp/follow.el525
-rw-r--r--lisp/gnus/ChangeLog72
-rw-r--r--lisp/gnus/deuglify.el3
-rw-r--r--lisp/gnus/message.el20
-rw-r--r--lisp/gnus/mm-decode.el2
-rw-r--r--lisp/gnus/mm-uu.el54
-rw-r--r--lisp/gnus/mml-sec.el51
-rw-r--r--lisp/gnus/mml.el159
-rw-r--r--lisp/gnus/mml1991.el67
-rw-r--r--lisp/gnus/mml2015.el2
-rw-r--r--lisp/gnus/nnweb.el4
-rw-r--r--lisp/help-fns.el6
-rw-r--r--lisp/help-mode.el5
-rw-r--r--lisp/image.el44
-rw-r--r--lisp/international/mule.el6
-rw-r--r--lisp/log-edit.el2
-rw-r--r--lisp/log-view.el2
-rw-r--r--lisp/mh-e/ChangeLog37
-rw-r--r--lisp/mh-e/mh-e.el5
-rw-r--r--lisp/mh-e/mh-letter.el29
-rw-r--r--lisp/net/rcirc.el79
-rw-r--r--lisp/net/tramp.el169
-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/antlr-mode.el2
-rw-r--r--lisp/progmodes/asm-mode.el10
-rw-r--r--lisp/progmodes/cc-subword.el49
-rw-r--r--lisp/progmodes/grep.el471
-rw-r--r--lisp/progmodes/gud.el50
-rw-r--r--lisp/progmodes/python.el12
-rw-r--r--lisp/reveal.el2
-rw-r--r--lisp/simple.el4
-rw-r--r--lisp/smerge-mode.el2
-rw-r--r--lisp/startup.el9
-rw-r--r--lisp/subr.el50
-rw-r--r--lisp/term/mac-win.el5
-rw-r--r--lisp/textmodes/bibtex.el14
-rw-r--r--lisp/textmodes/fill.el2
-rw-r--r--lisp/textmodes/org.el98
-rw-r--r--lisp/textmodes/paragraphs.el28
-rw-r--r--lisp/textmodes/reftex-vars.el6
-rw-r--r--lisp/time-stamp.el6
-rw-r--r--lisp/tool-bar.el22
-rw-r--r--lisp/url/ChangeLog8
-rw-r--r--lisp/url/url-gw.el16
-rw-r--r--lisp/url/url-handlers.el56
-rw-r--r--lispref/ChangeLog40
-rw-r--r--lispref/intro.texi13
-rw-r--r--lispref/modes.texi188
-rw-r--r--lispref/objects.texi6
-rw-r--r--lispref/syntax.texi4
-rw-r--r--lispref/variables.texi14
-rw-r--r--man/ChangeLog83
-rw-r--r--man/building.texi38
-rw-r--r--man/calendar.texi4
-rw-r--r--man/custom.texi3
-rw-r--r--man/emacs-xtra.texi148
-rw-r--r--man/emacs.texi142
-rw-r--r--man/macos.texi70
-rw-r--r--man/mh-e.texi83
-rw-r--r--man/misc.texi83
-rw-r--r--man/msdog.texi286
-rw-r--r--man/org.texi132
-rw-r--r--man/pgg.texi8
-rw-r--r--man/xresmini.texi303
-rw-r--r--man/xresources.texi66
-rw-r--r--src/.gdbinit11
-rw-r--r--src/ChangeLog187
-rw-r--r--src/dispextern.h9
-rw-r--r--src/dispnew.c2
-rw-r--r--src/editfns.c2
-rw-r--r--src/frame.c8
-rw-r--r--src/image.c136
-rw-r--r--src/keymap.c9
-rw-r--r--src/mac.c50
-rw-r--r--src/macfns.c104
-rw-r--r--src/macgui.h38
-rw-r--r--src/macmenu.c58
-rw-r--r--src/macterm.c241
-rw-r--r--src/macterm.h8
-rw-r--r--src/process.h6
-rw-r--r--src/puresize.h2
-rw-r--r--src/s/ms-w32.h6
-rw-r--r--src/syntax.c7
-rw-r--r--src/unexmacosx.c3
-rw-r--r--src/w32fns.c2
-rw-r--r--src/w32term.c6
-rw-r--r--src/window.c2
-rw-r--r--src/xdisp.c61
-rw-r--r--src/xmenu.c1
119 files changed, 4052 insertions, 1869 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 013b59d5305..c80b23c0489 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,15 @@
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
72006-04-21 Bill Wohler <wohler@newt.com>
8
9 Release MH-E version 7.94.
10
11 * NEWS, MH-E-NEWS: Update for MH-E release 7.94.
12
12006-04-21 Nick Roberts <nickrob@snap.net.nz> 132006-04-21 Nick Roberts <nickrob@snap.net.nz>
2 14
3 * NEWS: Mention t-mouse.el. Touch up description of gdb-ui.el. 15 * NEWS: Mention t-mouse.el. Touch up description of gdb-ui.el.
diff --git a/etc/MH-E-NEWS b/etc/MH-E-NEWS
index 0fd4ec62174..db9de4b9043 100644
--- a/etc/MH-E-NEWS
+++ b/etc/MH-E-NEWS
@@ -6,6 +6,103 @@ 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
22* Changes in MH-E 7.94
23
24Version 7.94, the first 8.0 release candidate, fixes a bunch of bugs,
25incorporates new features introduced in Emacs 22.1, improves folder
26completion, and spruces up the tool bar.
27
28** New Features in MH-E 7.94
29
30*** Add :package-version Keyword to Options
31
32This `defcustom', `defgroup', and `defface' keyword was introduced in
33Emacs 22.1. MH-E has been extended to take advantage of it. With this
34keyword, you can now use `M-x customize-changed-options' to see what
35options in MH-E have changed between versions of Emacs. In a future
36version of Emacs, you'll be able to see changes between MH-E versions
37as well (closes SF #1452724).
38
39** Bug Fixes in MH-E 7.94
40
41*** mhparam -components Fails on mailutils
42
43This error prevented MH-E from loading when using GNU mailutils. GNU
44mailutils drops the `s' in this argument, so we did too since
45-component still works in nmh and MH (closes SF #1446985).
46
47*** "/ s" Still Has Problems With []'d Mail
48
49On XEmacs, subjects that had special characters would prevent `/ s'
50from narrowing to the given subject. These characters are now quoted
51correctly in XEmacs (closes SF #1447598).
52
53*** Incorrect Example in mh-folder-list Docstring
54
55This has been fixed (closes SF #1448498).
56
57*** Variable mh-send-args Is a String, Not a List
58
59This was causing errors when sending under GNU mailutils. The internal
60variable `mh-send-args' is now a list which fixes the problem (closes
61SF #1448604).
62
63*** Update Icons
64
65Most of the tool bar icons have been replaced by GTK or GNOME 2 icons
66(closes SF #1452715).
67
68*** Can't customize tool bar for current session
69
70If you customized `mh-tool-bar-folder-buttons' or
71`mh-tool-bar-letter-buttons', and clicked Set for Current Session, the
72tool bar was not updated. This has been fixed (closes SF #1452718).
73
74*** Strip Build Number From emacs-version in X-Mailer
75
76This has been done (closes SF #1466481).
77
78*** mh-folder-completion-function Problems
79
80One could not longer browse folders outside of the standard MH Mail
81directory. This has been fixed. As a beneficial side-effect, you can
82once again use SPC to complete folders (closes SF #1470518).
83
84*** Rename Function and Variable Definers
85
86If you had ever shown help for an MH-E symbol that was both a function
87or variable, you might have found that the hyperlink to the file
88brought you to the wrong definition. This has been fixed by renaming
89the macros `mh-defgroup', `mh-defcustom', `mh-defface',
90`mh-defun-compat', and `mh-defmacro-compat' to `defgroup-mh',
91`defcustom-mh', `defface-mh', `defun-mh', `defmacro-mh' respectively
92(closes SF #1472029).
93
94*** mh-insert-letter Uses Wrong Default
95
96If you had used `C-c TAB' (`mh-insert-letter') to insert a letter into
97your draft, specified a different folder, and chose the default
98message number, you got the wrong message. This has been fixed (closes
99SF #1473729).
100
101*** "echo -e" in Makefile Causes Solaris 10 Problem
102
103This construct has been replaced with printf, which is reputed to be
104more portable (closes SF #1467222, #1473908).
105
9* Changes in MH-E 7.93 106* Changes in MH-E 7.93
10 107
11Version 7.93, the fourth 8.0 beta release, fixes a handful of bugs in 108Version 7.93, the fourth 8.0 beta release, fixes a handful of bugs in
diff --git a/etc/NEWS b/etc/NEWS
index c3a54e7e6ff..9b7eb5e88da 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1479,20 +1479,35 @@ changes.
1479There's a new separate package grep.el, with its own submenu and 1479There's a new separate package grep.el, with its own submenu and
1480customization group. 1480customization group.
1481 1481
1482+++
1483*** `grep-find' is now also available under the name `find-grep' where
1484people knowing `find-grep-dired' would probably expect it.
1485
1486+++
1487*** New commands `lgrep' (local grep) and `rgrep' (recursive grep) are
1488more user-friendly versions of `grep' and `grep-find', which prompt
1489separately for the regular expression to match, the files to search,
1490and the base directory for the search (rgrep only). Case sensitivitivy
1491of the search is controlled by the current value of `case-fold-search'.
1492
1493These commands build the shell commands based on the new variables
1494`grep-template' (lgrep) and `grep-find-template' (rgrep).
1495
1496The files to search can use aliases defined in `grep-files-aliases'.
1497
1498Subdirectories listed in `grep-find-ignored-directories' such as those
1499typically used by various version control systems, like CVS and arch,
1500are automatically skipped by `rgrep'.
1501
1482--- 1502---
1483*** M-x grep provides highlighting support. 1503*** The grep commands provide highlighting support.
1484 1504
1485Hits are fontified in green, and hits in binary files in orange. Grep buffers 1505Hits are fontified in green, and hits in binary files in orange. Grep buffers
1486can be saved and automatically revisited. 1506can be saved and automatically revisited.
1487 1507
1488+++
1489*** `grep-find' is now also available under the name `find-grep' where
1490people knowing `find-grep-dired' would probably expect it.
1491
1492--- 1508---
1493*** The new variables `grep-window-height', `grep-auto-highlight', and 1509*** The new variables `grep-window-height' and `grep-scroll-output' override
1494`grep-scroll-output' override the corresponding compilation mode 1510the corresponding compilation mode settings, for grep commands only.
1495settings, for grep commands only.
1496 1511
1497+++ 1512+++
1498*** New option `grep-highlight-matches' highlights matches in *grep* 1513*** New option `grep-highlight-matches' highlights matches in *grep*
@@ -2027,6 +2042,21 @@ run most curses applications now.
2027** M-x diff uses Diff mode instead of Compilation mode. 2042** M-x diff uses Diff mode instead of Compilation mode.
2028 2043
2029+++ 2044+++
2045** Diff mode key bindings changed.
2046
2047These are the new bindings:
2048
2049C-c C-e diff-ediff-patch (old M-A)
2050C-c C-n diff-restrict-view (old M-r)
2051C-c C-r diff-reverse-direction (old M-R)
2052C-c C-u diff-context->unified (old M-U)
2053C-c C-w diff-refine-hunk (old C-c C-r)
2054
2055To convert unified to context format, use C-u C-c C-u.
2056In addition, C-c C-u now operates on the region
2057in Transient Mark mode when the mark is active.
2058
2059+++
2030** You can now customize `fill-nobreak-predicate' to control where 2060** You can now customize `fill-nobreak-predicate' to control where
2031filling can break lines. The value is now normally a list of 2061filling can break lines. The value is now normally a list of
2032functions, but it can also be a single function, for compatibility. 2062functions, but it can also be a single function, for compatibility.
@@ -3100,7 +3130,7 @@ See the file GNUS-NEWS or the node "Oort Gnus" in the Gnus manual for details.
3100--- 3130---
3101** MH-E changes. 3131** MH-E changes.
3102 3132
3103Upgraded to MH-E version 7.93. There have been major changes since 3133Upgraded to MH-E version 7.95. There have been major changes since
3104version 5.0.2; see MH-E-NEWS for details. 3134version 5.0.2; see MH-E-NEWS for details.
3105 3135
3106** Calendar changes: 3136** Calendar changes:
@@ -3705,9 +3735,10 @@ This is useful in packages that can be preloaded.
3705If it is non-nil, the function lists only faces matching this regexp. 3735If it is non-nil, the function lists only faces matching this regexp.
3706 3736
3707+++ 3737+++
3708*** New function `string-or-null-p'. 3738*** New functions `string-or-null-p' and `booleanp'.
3709 3739
3710Return t if OBJECT is a string or nil. Otherwise, return nil. 3740`string-or-null-p' returns non-nil iff OBJECT is a string or nil.
3741`booleanp' returns non-nil iff OBJECT is a t or nil.
3711 3742
3712** Lisp code indentation features: 3743** Lisp code indentation features:
3713 3744
@@ -5952,6 +5983,8 @@ Currently, the following actions have been defined:
5952- Mouse-2 on the read-only or modified status in the mode line (`%' or 5983- Mouse-2 on the read-only or modified status in the mode line (`%' or
5953`*') toggles the status. 5984`*') toggles the status.
5954 5985
5986- Mouse-3 on the major mode name displays a major mode menu.
5987
5955- Mouse-3 on the mode name displays a minor-mode menu. 5988- Mouse-3 on the mode name displays a minor-mode menu.
5956 5989
5957** Hourglass pointer 5990** Hourglass pointer
diff --git a/etc/orgcard.tex b/etc/orgcard.tex
index c5577a95be0..45608ac1795 100644
--- a/etc/orgcard.tex
+++ b/etc/orgcard.tex
@@ -1,5 +1,5 @@
1% Reference Card for Org Mode 1% Reference Card for Org Mode
2\def\orgversionnumber{4.25} 2\def\orgversionnumber{4.26}
3\def\year{2006} 3\def\year{2006}
4% 4%
5%**start of header 5%**start of header
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index a38c0cb6770..115e43c2d03 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,17 @@
12006-04-29 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * sorted-doc.c (main): Initialize docs to NULL.
4
5 * yow.c (yow): Free buf.
6
7 * etags.c: Delete c-indentation-style local variable.
8
92006-04-29 Richard Stallman <rms@gnu.org>
10
11 * movemail.c (main): Check for negative value from `read'.
12
13 * fakemail.c (read_header): Give fatal error if input has no header.
14
12006-04-02 Paul Eggert <eggert@cs.ucla.edu> 152006-04-02 Paul Eggert <eggert@cs.ucla.edu>
2 16
3 * b2m.c (main): Don't include <limits.h>. 17 * b2m.c (main): Don't include <limits.h>.
diff --git a/lib-src/etags.c b/lib-src/etags.c
index a073acb92d6..a7c98f090bb 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -6887,7 +6887,6 @@ xrealloc (ptr, size)
6887 6887
6888/* 6888/*
6889 * Local Variables: 6889 * Local Variables:
6890 * c-indentation-style: gnu
6891 * indent-tabs-mode: t 6890 * indent-tabs-mode: t
6892 * tab-width: 8 6891 * tab-width: 8
6893 * fill-column: 79 6892 * 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 56ee9cb71e6..b39bebc7215 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,6 +1,303 @@
12006-05-01 Richard Stallman <rms@gnu.org>
2
3 * diff-mode.el (diff-mode-shared-map): Don't bind M-W, M-U, M-C,
4 M-r, M-R, M-A, M-SPC or M-DEL.
5 (diff-mode-map): diff-refine-hunk now on C-c C-w
6 (diff-mode-map): Bind C-c C-e, C-c C-n, C-c C-r, C-c C-u.
7
8 * help-mode.el (help-mode): view-exit-action calls delete-window
9 only when it is safe and possible.
10
11 * simple.el (undo-outer-limit-truncate): Put quotes around buffer name
12 in messages.
13
14 * emacs-lisp/warnings.el (display-warning, lwarn): Doc fixes.
15
16 * tool-bar.el (tool-bar-setup): Put Help and Preferences items
17 in the default tool-bar-map.
18
192006-05-01 Michael Albinus <michael.albinus@gmx.de>
20
21 * net/tramp.el (tramp-completion-file-name-handler-alist)
22 (tramp-run-real-handler, tramp-completion-run-real-handler)
23 (tramp-completion-handle-file-name-all-completions)
24 (tramp-completion-handle-file-name-completion): Autoload them.
25 (tramp-completion-handle-file-exists-p)
26 (tramp-completion-handle-file-name-directory)
27 (tramp-completion-handle-file-name-nondirectory)
28 (tramp-completion-handle-expand-file-name): Remove them.
29 (tramp-handle-file-name-directory): Return the real directory
30 name. Returning "/" only doesn't need to be necessary any longer.
31 (tramp-file-name-handler): Make special attention when in hostname
32 completion mode.
33 (tramp-completion-file-name-handler): Revert patch from
34 2006-04-28.
35 (tramp-register-file-name-handlers): Register
36 `tramp-completion-file-name-handler' only when
37 `partial-completion-mode is enabled.
38 (tramp-completion-handle-file-name-all-completions): Delete
39 directory part from results.
40 (tramp-get-completion-methods, tramp-get-completion-user-host):
41 Discard deleting "/", it doesn't work after the change of
42 `tramp-handle-file-name-directory' above.
43
442006-05-01 Kim F. Storm <storm@cua.dk>
45
46 * progmodes/grep.el (grep-expand-template): Use save-match-data.
47
482006-05-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
49
50 * term/mac-win.el (mac-ae-open-documents, mac-drag-n-drop): Use
51 select-frame-set-input-focus instead of raise-frame.
52 (global-map): Bind M-drag-n-drop to mac-drag-n-drop.
53
542006-05-01 Nick Roberts <nickrob@snap.net.nz>
55
56 * progmodes/gud.el (gud-def): Add %c case.
57 (gud-speedbar-buttons): Don'bind case-fold-search unnecessarily.
58 (gud-format-command): Make match case sensitive. Match on %F.
59
602006-04-30 Glenn Morris <rgm@gnu.org>
61
62 * calendar/cal-tex.el (cal-tex-preamble-extra): New variable.
63 (cal-tex-preamble): Use cal-tex-preamble-extra.
64 (cal-tex-list-diary-entries): Refer to `diary-list-entries' rather
65 than alias `list-diary-entries'.
66
672006-04-29 Dan Nicolaescu <dann@ics.uci.edu>
68
69 * help-fns.el (describe-variable): Add info about safe local variables.
70
712006-04-29 Richard Stallman <rms@gnu.org>
72
73 * bindings.el (mode-line-format): help-echo doc fixes.
74
75 * net/tramp.el (tramp-file-name-handler-alist): Delete
76 expand-file-name and other operations that can cause spurious loading.
77
782006-04-29 Stefan Monnier <monnier@iro.umontreal.ca>
79
80 * files.el (safe-local-variable-p): Remove support for the special
81 value t.
82
83 * textmodes/paragraphs.el (sentence-end-without-space):
84 Fix safety predicate.
85 (sentence-end-double-space, sentence-end-without-period)
86 (paragraph-ignore-fill-prefix):
87 * textmodes/fill.el (colon-double-space):
88 * abbrev.el (abbrev-mode): Tighten the safety predicate.
89
90 * subr.el (booleanp): New fun.
91
92 * textmodes/reftex-vars.el (reftex-guess-label-type):
93 Tighten the safety predicate.
94
952006-04-28 Kim F. Storm <storm@cua.dk>
96
97 * progmodes/grep.el (defgroup grep): Doc fix.
98 (grep-auto-highlight): Remove.
99 (grep-template): New defcustom.
100 (grep-find-template): Rename from grep-tree-template.
101 (grep-files-aliases): Rename from grep-tree-files-aliases.
102 Remove "all" alias, add "l" alias.
103 (grep-tree-ignore-case, grep-tree-ignore-CVS-directories): Remove.
104 (grep-find-ignored-directories): New defcustom to replace
105 grep-tree-ignore-CVS-directories, to facilitate ignoring
106 subdirectories for multiple version control systems.
107 (grep-mode-map): Add Recursive grep item to GREP menu.
108 (grep-regexp-history, grep-files-history): New defvars.
109 (grep-probe): New helper function.
110 (grep-compute-defaults): Use it to simplify code.
111 Adapt to name changes.
112 Use `.' as base in grep-find-template rather than <D>.
113 (grep): Remove superfluous highlight-regexp arg. Fix doc.
114 Call grep-compute-defaults unconditionally.
115 (grep-expand-keywords): New defconst.
116 (grep-expand-template): Rename from grep-expand-command-macros.
117 Simplify via grep-expand-keywords. Look at case-fold-search instead
118 of grep-tree-ignore-case to add -i option.
119 Bind case-fold-search to nil while matching keywords.
120 (grep-tree-last-regexp, grep-tree-last-files): Remove.
121 (grep-read-regexp, grep-read-files): New helper functions.
122 (rgrep): Rename from grep-tree. Rework to use proper histories.
123 Adapt to changes in defcustoms and functions above.
124 (lgrep): New command, as grep, but using same interactive api as rgrep.
125
1262006-04-28 Michael Albinus <michael.albinus@gmx.de>
127
128 * net/tramp.el (tramp-completion-file-name-handler):
129 Disable Tramp's functionality while loading Tramp itself.
130 (tramp-register-file-name-handlers): That's a defsubst now.
131 Code from `tramp-repair-jka-compr' moved here. Apply it via
132 `after-init-hook'.
133 (tramp-repair-jka-compr): Remove.
134
1352006-04-27 Jay Belanger <belanger@truman.edu>
136
137 * calc-embed.el (calc-embedded-make-info): Use `math-read-expr' to
138 read expression when `math-read-big-expr' doesn't work.
139
1402006-04-27 Reiner Steib <Reiner.Steib@gmx.de>
141
142 * startup.el (command-line-1): Display warning when
143 pure-space-overflow is non-nil.
144
1452006-04-26 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
146
147 * textmodes/bibtex.el (bibtex-user-optional-fields): Mark as
148 risky.
149
1502006-04-26 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
151
152 * textmodes/bibtex.el (bibtex-url): New optional arg no-browse.
153 Return the URL or nil if none can be generated.
154
1552006-04-27 Nick Roberts <nickrob@snap.net.nz>
156
157 * progmodes/gud.el (gud-comint-buffer): Move forward to stop
158 byte compiler warnings.
159 (gud-basic-call, gud-find-expr): Let user select an expression
160 for printing. Print expression as well as value in GUD buffer.
161
1622006-04-17 Ken Manheimer <ken.manheimer@gmail.com>
163
164 * allout.el: Remove local autoload declaration for
165 pgg-gpg-symmetric-key-p, since that's now done in pgg-gpg.el.
166 (allout-show-bodies, allout-header-prefix, allout-primary-bullet)
167 (allout-plain-bullets-string, allout-distinctive-bullets-string)
168 (allout-use-mode-specific-leader, allout-old-style-prefixes)
169 (allout-stylish-prefixes, allout-numbered-bullet)
170 (allout-file-xref-bullet, allout-presentation-padding)
171 (allout-use-hanging-indents, allout-reindent-bodies): Mark as
172 safe-local-variable with suitable value spec, and add autoload
173 cookie for loaddefs inclusion. We now use an explicit spec everywhere.
174 (move-beginning-of-line, move-end-of-line): Repair so these compat
175 functions now actually resituate the point, when appropriate.
176
1772006-04-26 Stefan Monnier <monnier@iro.umontreal.ca>
178
179 * progmodes/cc-subword.el (c-subword-mode-map): Use command remapping.
180
181 * add-log.el (add-log-iso8601-time-zone): Make parameter optional.
182 (add-log-iso8601-time-string): Fix call to format-time-string.
183
1842006-04-26 Kim F. Storm <storm@cua.dk>
185
186 * subr.el (posn-string, posn-image, posn-object): Doc fix.
187
1882006-04-26 Masatake YAMATO <jet@gyve.org>
189
190 * progmodes/asm-mode.el (asm-mode, asm-mode-syntax-table):
191 Add support for "//" style comments. Remove `b' flag
192 from ?* in `asm-mode-syntax-table'.
193
1942006-04-26 Stefan Monnier <monnier@iro.umontreal.ca>
195
196 * follow.el: Use (featurep 'xemacs) everywhere.
197 (follow-mode): Use define-minor-mode.
198 (follow-mode-map): Move initialization into the declaration.
199 Use command remapping.
200 (follow-emacs-version-xemacs-p): Remove.
201 (follow-submit-feedback): Remove.
202
203 * allout.el (allout-layout, allout-passphrase-verifier-string)
204 (allout-passphrase-hint-string): Tighten up a bit the safety predicate.
205
206 * textmodes/reftex-vars.el (reftex-vref-is-default)
207 (reftex-fref-is-default, reftex-guess-label-type):
208 Tighten up a bit the safety predicate.
209
210 * textmodes/paragraphs.el (sentence-end-double-space)
211 (sentence-end-without-period, sentence-end-without-space)
212 (page-delimiter, paragraph-ignore-fill-prefix):
213 Tighten up a bit the safety predicate.
214
215 * textmodes/fill.el (colon-double-space): Tighten up the safety pred.
216
217 * progmodes/python.el (python-continuation-line-p)
218 (python-beginning-of-statement): syntax-ppss may return
219 a negative depth.
220 (python-mode): Don't forcefully enable font-lock.
221
222 * time-stamp.el (time-stamp-start, time-stamp-end)
223 (time-stamp-inserts-lines): Tighten up a bit the safety predicate.
224
225 * add-log.el: Remove spurious * in docstrings.
226 (add-log-time-zone-rule): Rename from change-log-time-zone-rule.
227 (add-change-log-entry): Use it here, since it's not specific
228 to iso8601.
229 (add-log-iso8601-time-string): Don't use it here any more.
230 (change-log-indent-text, change-log-indent): Rename from add-log-*.
231
232 * abbrev.el (abbrev-mode): Tighten up a bit the safety predicate.
233
2342006-04-25 Ryan Yeske <rcyeske@gmail.com>
235
236 * net/rcirc.el (rcirc-print): Revert last change with ignored nicks.
237 (rcirc-toggle-low-priority): Doc fix.
238 (rcirc-handler-NOTICE): Remove beginning of line anchor in
239 ChanServ regexp.
240 (rcirc-startup-channels-alist): Connect to #rcirc by default, not
241 #emacs.
242 (rcirc-bright-nick-regexp, rcirc-dim-nick-regexp): Add variables.
243 (rcirc-decode-coding-system): Use utf-8 as the default.
244 (rcirc-multiline-minor-mode): Set the fill-column.
245 (rcirc-format-response-string): Display bright and dim nicks.
246 (rcirc-browse-url): Update interactive spec to fill ARG.
247 (rcirc-bright-nick, rcirc-dim-nick): Add faces.
248 (rcirc-print): Ignore dim-nick messages wrt modeline-activity.
249
2502006-04-24 J.D. Smith <jdsmith@as.arizona.edu>
251
252 * textmodes/bibtex.el (bibtex-find-entry): Don't demand matching
253 case for @Article, etc.
254
2552006-04-23 Michael Albinus <michael.albinus@gmx.de>
256
257 * net/tramp.el (tramp-register-file-name-handlers): New defun.
258 Added with autoload cookie.
259 (tramp-unload-file-name-handlers): Rename from
260 `tramp-unload-file-name-handler-alist'.
261
2622006-04-23 Romain Francoise <romain@orebokech.com>
263
264 * comint.el (comint-match-partial-filename): Doc fix.
265
2662006-04-21 Glenn Morris <rgm@gnu.org>
267
268 * calendar/cal-menu.el (calendar-mode-map): Refer to
269 `diary-view-entries' rather than alias `view-diary-entries'.
270 * calendar/diary-lib.el (view-other-diary-entries): Ditto.
271
2722006-04-21 Luc Teirlinck <teirllm@auburn.edu>
273
274 * progmodes/antlr-mode.el (antlr-default):
275 * cus-edit.el (custom-documentation):
276 * faces.el (scroll-bar, border, cursor, mouse): Avoid nil spec
277 in defface.
278
2792006-04-21 Kim F. Storm <storm@cua.dk>
280
281 * image.el (image-type): New defun split out of create-image.
282 (create-image): Use it.
283
2842006-04-21 Carsten Dominik <dominik@science.uva.nl>
285
286 * textmodes/org.el (org-mode-map): Catch conflict with old allout.el.
287 (org-open-at-point): Remove the "...done" message to keep output
288 in the echo area visible.
289 (org-export-as-xoxo): Fix call to `indent-region'.
290
2912006-04-21 Kevin Ryde <user42@zip.com.au>
292
293 * international/mule.el (keyboard-coding-system): defcustom
294 info-link fixes: "Specify Coding" has been split, keyboard now in
295 "Terminal Coding", and "Single-Byte Character Support" is now
296 "Unibyte Mode".
297
12006-04-21 Nick Roberts <nickrob@snap.net.nz> 2982006-04-21 Nick Roberts <nickrob@snap.net.nz>
2 299
3 * progmodes/gdb-ui.el (gdb-data-list-register-values-handler): 300 * progmodes/gdb-ui.el (gdb-data-list-register-values-handler):
4 Use font-lock-warning-face for any errors e.g. no stack. 301 Use font-lock-warning-face for any errors e.g. no stack.
5 (gdb-stack-list-locals-handler): Display any errors e.g. no stack. 302 (gdb-stack-list-locals-handler): Display any errors e.g. no stack.
6 303
@@ -13,26 +310,26 @@
13 310
142006-04-20 Carsten Dominik <dominik@science.uva.nl> 3112006-04-20 Carsten Dominik <dominik@science.uva.nl>
15 312
16 * textmodes/org.el: (org-deadline-announce): Face removed. 313 * textmodes/org.el (org-deadline-announce): Face removed.
17 (org-level-faces, org-n-levels): Converted to constant. 314 (org-level-faces, org-n-levels): Convert to constant.
18 (org-compatible-face): New function. 315 (org-compatible-face): New function.
19 (org-hide, org-level-1, org-level-2, org-level-3, org-level-4) 316 (org-hide, org-level-1, org-level-2, org-level-3, org-level-4)
20 (org-level-5, org-level-6, org-level-7, org-level-8) 317 (org-level-5, org-level-6, org-level-7, org-level-8)
21 (org-special-keyword, org-warning, org-headline-done, org-link) 318 (org-special-keyword, org-warning, org-headline-done, org-link)
22 (org-date, org-tag, org-todo, org-done, org-table, org-formula) 319 (org-date, org-tag, org-todo, org-done, org-table, org-formula)
23 (org-scheduled-today, org-scheduled-previously, org-time-grid): 320 (org-scheduled-today, org-scheduled-previously, org-time-grid):
24 Face definition revised for better color tty support. 321 Face definition revised for better color tty support.
25 (org-bold-re, org-italic-re, org-underline-re): New constants. 322 (org-bold-re, org-italic-re, org-underline-re): New constants.
26 (org-set-font-lock-defaults): Use the new constants. 323 (org-set-font-lock-defaults): Use the new constants.
27 (org-agenda-highlight-todo): New function. 324 (org-agenda-highlight-todo): New function.
28 (org-agenda-todo): Fixed bug with point at end of line. 325 (org-agenda-todo): Fix bug with point at end of line.
29 (org-agenda-change-all-lines, org-finalize-agenda-entries): 326 (org-agenda-change-all-lines, org-finalize-agenda-entries):
30 Fontify TODO keywords. 327 Fontify TODO keywords.
31 (org-insert-link): Preserve relative path in ../ links. 328 (org-insert-link): Preserve relative path in ../ links.
32 (org-export-as-html): Convert links pointing to .org files into 329 (org-export-as-html): Convert links pointing to .org files into
33 links that will work beteen the exported HTML files. 330 links that will work beteen the exported HTML files.
34 (org-todo-list): Fix bug when arg=0. 331 (org-todo-list): Fix bug when arg=0.
35 (org-insert-heading): More fine-tuning. 332 (org-insert-heading): More fine-tuning.
36 333
372006-04-19 Romain Francoise <romain@orebokech.com> 3342006-04-19 Romain Francoise <romain@orebokech.com>
38 335
@@ -49,12 +346,11 @@
49 when moving off either end of the input history ring. 346 when moving off either end of the input history ring.
50 (comint-delete-input): New function, used by 347 (comint-delete-input): New function, used by
51 `comint-previous-input' and others. 348 `comint-previous-input' and others.
52 (comint-previous-matching-input): Use 349 (comint-previous-matching-input):
53 `coming-delete-input'. Save the partial input if leaving the 350 Use `coming-delete-input'. Save the partial input if leaving the
54 edit line. Goto point-max before deleting input to avoid 351 edit line. Goto point-max before deleting input to avoid
55 partial input fragments hanging around. 352 partial input fragments hanging around.
56 (comint-restore-input): New function, used by 353 (comint-restore-input): New function, used by `comint-previous-input'.
57 `comint-previous-input', and bound to "C-c C-j".
58 354
592006-04-18 Luc Teirlinck <teirllm@auburn.edu> 3552006-04-18 Luc Teirlinck <teirllm@auburn.edu>
60 356
@@ -62,8 +358,7 @@
62 358
632006-04-18 Dan Nicolaescu <dann@ics.uci.edu> 3592006-04-18 Dan Nicolaescu <dann@ics.uci.edu>
64 360
65 * progmodes/python.el (python-mode): Add support for 361 * progmodes/python.el (python-mode): Add support for hs-minor-mode.
66 hs-minor-mode.
67 362
682006-04-19 Reiner Steib <Reiner.Steib@gmx.de> 3632006-04-19 Reiner Steib <Reiner.Steib@gmx.de>
69 364
@@ -141,7 +436,7 @@
141 (gdb-frame-address): Re-use to identify frame for watch expression. 436 (gdb-frame-address): Re-use to identify frame for watch expression.
142 (gdb-var-list, gdb-var-create-handler): Add frame address for root 437 (gdb-var-list, gdb-var-create-handler): Add frame address for root
143 variables. 438 variables.
144 (gdb-init-1, gdb-source, gdb-post-prompt, ) 439 (gdb-init-1, gdb-source, gdb-post-prompt)
145 (gdb-assembler-custom, gdb-invalidate-assembler): Use gdb-pc-address. 440 (gdb-assembler-custom, gdb-invalidate-assembler): Use gdb-pc-address.
146 (gdb-frame-handler): Get gdb-frame-address. 441 (gdb-frame-handler): Get gdb-frame-address.
147 442
@@ -222,7 +517,7 @@
222 517
2232006-04-13 Carsten Dominik <dominik@science.uva.nl> 5182006-04-13 Carsten Dominik <dominik@science.uva.nl>
224 519
225 * textmodes/org.el: (org-set-regexps-and-options) 520 * textmodes/org.el (org-set-regexps-and-options)
226 (org-get-current-options): Better names for the startup folding 521 (org-get-current-options): Better names for the startup folding
227 options. 522 options.
228 523
@@ -231,7 +526,7 @@
231 * vc.el (vc-annotate): Arrange for point to end up at the same 526 * vc.el (vc-annotate): Arrange for point to end up at the same
232 line number as in the original, but only when using a new buffer. 527 line number as in the original, but only when using a new buffer.
233 528
2342006-04-12 Davis Herring <herring@lanl.gov> (tiny change) 5292006-04-12 Stuart Herring <herring@lanl.gov> (tiny change)
235 530
236 * files.el (hack-one-local-variable-eval-safep): 531 * files.el (hack-one-local-variable-eval-safep):
237 Recognize `edebug-form-spec' for `put', but only if it passes 532 Recognize `edebug-form-spec' for `put', but only if it passes
@@ -245,7 +540,7 @@
245 540
2462006-04-13 Carsten Dominik <dominik@science.uva.nl> 5412006-04-13 Carsten Dominik <dominik@science.uva.nl>
247 542
248 * textmodes/org.el: (org-ctrl-c-ctrl-c): Improve documentation string. 543 * textmodes/org.el (org-ctrl-c-ctrl-c): Improve documentation string.
249 (org-agenda-mouse-1-follows-link) 544 (org-agenda-mouse-1-follows-link)
250 (org-mouse-1-follows-link): New options. 545 (org-mouse-1-follows-link): New options.
251 (org-format-agenda-item): Fix bug if TAGS is nil. 546 (org-format-agenda-item): Fix bug if TAGS is nil.
@@ -2437,7 +2732,7 @@
2437 (describe-key-briefly-internal, describe-key-internal): 2732 (describe-key-briefly-internal, describe-key-internal):
2438 Functions merged back into their callers. 2733 Functions merged back into their callers.
2439 2734
24402006-02-13 Martin Rudalics <rudalics@gmx.at> (tiny change) 27352006-02-13 Martin Rudalics <rudalics@gmx.at>
2441 2736
2442 * info.el (info-xref-visited): Inherit from info-xref too. 2737 * info.el (info-xref-visited): Inherit from info-xref too.
2443 (Info-set-mode-line): Replace occurrences of `%' by `%%' 2738 (Info-set-mode-line): Replace occurrences of `%' by `%%'
@@ -3585,7 +3880,7 @@
3585 * add-log.el (add-change-log-entry, change-log-merge): 3880 * add-log.el (add-change-log-entry, change-log-merge):
3586 Conditionally use `hard-newline'. 3881 Conditionally use `hard-newline'.
3587 3882
35882006-01-13 Martin Rudalics <rudalics@gmx.at> (tiny change) 38832006-01-13 Martin Rudalics <rudalics@gmx.at>
3589 3884
3590 * wid-edit.el (widget-field-end): If the overlay is no longer 3885 * wid-edit.el (widget-field-end): If the overlay is no longer
3591 associated with a buffer, behave as if the overlay didn't exist. 3886 associated with a buffer, behave as if the overlay didn't exist.
@@ -4595,7 +4890,7 @@
4595 display-multi-frame-p, use selected-frame when menu-updating-frame 4890 display-multi-frame-p, use selected-frame when menu-updating-frame
4596 is nil. 4891 is nil.
4597 4892
45982005-12-20 Davis Herring <herring@lanl.gov> (tiny change) 48932005-12-20 Stuart Herring <herring@lanl.gov> (tiny change)
4599 4894
4600 * align.el (align-rules-list): Use [ \t] instead of \s- 4895 * align.el (align-rules-list): Use [ \t] instead of \s-
4601 for column separators in text mode. 4896 for column separators in text mode.
@@ -4675,7 +4970,7 @@
4675 * emacs-lisp/edebug.el (edebug-safe-prin1-to-string): 4970 * emacs-lisp/edebug.el (edebug-safe-prin1-to-string):
4676 Capture error from printing circular structures. 4971 Capture error from printing circular structures.
4677 4972
46782005-12-17 Martin Rudalics <rudalics@gmx.at> (tiny change) 49732005-12-17 Martin Rudalics <rudalics@gmx.at>
4679 4974
4680 * wid-edit.el (widget-checkbox-action): Clear undo info. 4975 * wid-edit.el (widget-checkbox-action): Clear undo info.
4681 4976
@@ -6658,7 +6953,7 @@
6658 scrolling the help window. Doc fix. 6953 scrolling the help window. Doc fix.
6659 (help-return-method): Doc fix. 6954 (help-return-method): Doc fix.
6660 6955
66612005-12-03 Martin Rudalics <rudalics@gmx.at> (tiny change) 69562005-12-03 Martin Rudalics <rudalics@gmx.at>
6662 6957
6663 * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Fix bug 6958 * emacs-lisp/lisp-mode.el (lisp-imenu-generic-expression): Fix bug
6664 whereby names of length one or names starting with a 6959 whereby names of length one or names starting with a
@@ -7212,7 +7507,7 @@
7212 7507
7213 * custom.el (defcustom): Update link types in docstring. 7508 * custom.el (defcustom): Update link types in docstring.
7214 7509
72152005-11-20 Martin Rudalics <rudalics@gmx.at> (tiny change) 75102005-11-20 Martin Rudalics <rudalics@gmx.at>
7216 7511
7217 * custom.el (defgroup): Add doc-string-elt info. 7512 * custom.el (defgroup): Add doc-string-elt info.
7218 7513
@@ -7485,7 +7780,7 @@
7485 7780
7486 * apropos.el (apropos-calc-scores): Use apropos-pattern. 7781 * apropos.el (apropos-calc-scores): Use apropos-pattern.
7487 7782
74882005-11-16 Martin Rudalics <rudalics@gmx.at> (tiny change) 77832005-11-16 Martin Rudalics <rudalics@gmx.at>
7489 7784
7490 * wid-edit.el (color): Enclose %t in %{...%}. 7785 * wid-edit.el (color): Enclose %t in %{...%}.
7491 7786
@@ -14401,7 +14696,7 @@
14401 * emulation/edt-mapper.el (edt-save-function-key-map) 14696 * emulation/edt-mapper.el (edt-save-function-key-map)
14402 (EDT-key-name): `defvar' to silence the byte-compiler. 14697 (EDT-key-name): `defvar' to silence the byte-compiler.
14403 14698
144042005-07-02 Martin Rudalics <rudalics@gmx.at> (tiny change) 146992005-07-02 Martin Rudalics <rudalics@gmx.at>
14405 14700
14406 * font-lock.el (font-lock-regexp-grouping-backslash): Rename from 14701 * font-lock.el (font-lock-regexp-grouping-backslash): Rename from
14407 font-lock-regexp-backslash. Doc fix. 14702 font-lock-regexp-backslash. Doc fix.
diff --git a/lisp/ChangeLog.11 b/lisp/ChangeLog.11
index 8b00b539e69..f9c93d4102e 100644
--- a/lisp/ChangeLog.11
+++ b/lisp/ChangeLog.11
@@ -5065,7 +5065,7 @@
5065 5065
5066 * imenu.el: Several doc fixes: don't say variables are buffer-local. 5066 * imenu.el: Several doc fixes: don't say variables are buffer-local.
5067 5067
50682004-08-16 Davis Herring <herring@lanl.gov> 50682004-08-16 Stuart Herring <herring@lanl.gov>
5069 5069
5070 * isearch.el (isearch-string, isearch-message-string, isearch-point) 5070 * isearch.el (isearch-string, isearch-message-string, isearch-point)
5071 (isearch-success, isearch-forward-flag, isearch-other-end) 5071 (isearch-success, isearch-forward-flag, isearch-other-end)
@@ -5082,7 +5082,7 @@
5082 * term/x-win.el (x-selection-value): If utf8 was successful but 5082 * term/x-win.el (x-selection-value): If utf8 was successful but
5083 ctext was not, use utf8 string. 5083 ctext was not, use utf8 string.
5084 5084
50852004-08-14 Davis Herring <herring@lanl.gov> 50852004-08-14 Stuart Herring <herring@lanl.gov>
5086 5086
5087 * isearch.el: Remove accidental changes of March 4. Fix backing 5087 * isearch.el: Remove accidental changes of March 4. Fix backing
5088 up when a regexp isearch is made more general. Use symbolic 5088 up when a regexp isearch is made more general. Use symbolic
@@ -11471,7 +11471,7 @@
11471 11471
11472 * files.el (kill-some-buffers): Doc fix. 11472 * files.el (kill-some-buffers): Doc fix.
11473 11473
114742003-12-29 David Herring <sdh6@ra.msstate.edu> (tiny change) 114742003-12-29 Stuart Herring <herring@lanl.gov> (tiny change)
11475 11475
11476 * comint.el (comint-watch-for-password-prompt): Pass `string' as 11476 * comint.el (comint-watch-for-password-prompt): Pass `string' as
11477 arg to send-invisible 11477 arg to send-invisible
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 9ba53f6f6f5..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 t) 61;;;###autoload(put 'abbrev-mode 'safe-local-variable 'booleanp)
62 62
63 63
64(defvar edit-abbrevs-map 64(defvar edit-abbrevs-map
@@ -363,5 +363,5 @@ A prefix argument means don't query; expand all abbrevs."
363 (if (or noquery (y-or-n-p (format "Expand `%s'? " string))) 363 (if (or noquery (y-or-n-p (format "Expand `%s'? " string)))
364 (expand-abbrev))))))) 364 (expand-abbrev)))))))
365 365
366;;; arch-tag: dbd6f3ae-dfe3-40ba-b00f-f9e3ff960df5 366;; arch-tag: dbd6f3ae-dfe3-40ba-b00f-f9e3ff960df5
367;;; abbrev.el ends here 367;;; abbrev.el ends here
diff --git a/lisp/add-log.el b/lisp/add-log.el
index 1afdc7dcb72..47a839d539d 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -72,7 +72,7 @@ This defaults to the value returned by the function `user-full-name'."
72 72
73;;;###autoload 73;;;###autoload
74(defcustom add-log-mailing-address nil 74(defcustom add-log-mailing-address nil
75 "*Email addresses of user, for inclusion in ChangeLog headers. 75 "Email addresses of user, for inclusion in ChangeLog headers.
76This defaults to the value of `user-mail-address'. In addition to 76This defaults to the value of `user-mail-address'. In addition to
77being a simple string, this value can also be a list. All elements 77being a simple string, this value can also be a list. All elements
78will be recognized as referring to the same user; when creating a new 78will be recognized as referring to the same user; when creating a new
@@ -83,7 +83,7 @@ ChangeLog entry, one element will be chosen at random."
83 :group 'change-log) 83 :group 'change-log)
84 84
85(defcustom add-log-time-format 'add-log-iso8601-time-string 85(defcustom add-log-time-format 'add-log-iso8601-time-string
86 "*Function that defines the time format. 86 "Function that defines the time format.
87For example, `add-log-iso8601-time-string', which gives the 87For example, `add-log-iso8601-time-string', which gives the
88date in international ISO 8601 format, 88date in international ISO 8601 format,
89and `current-time-string' are two valid values." 89and `current-time-string' are two valid values."
@@ -95,7 +95,7 @@ and `current-time-string' are two valid values."
95 :group 'change-log) 95 :group 'change-log)
96 96
97(defcustom add-log-keep-changes-together nil 97(defcustom add-log-keep-changes-together nil
98 "*If non-nil, normally keep day's log entries for one file together. 98 "If non-nil, normally keep day's log entries for one file together.
99 99
100Log entries for a given file made with \\[add-change-log-entry] or 100Log entries for a given file made with \\[add-change-log-entry] or
101\\[add-change-log-entry-other-window] will only be added to others \ 101\\[add-change-log-entry-other-window] will only be added to others \
@@ -127,20 +127,20 @@ this variable."
127 :group 'change-log) 127 :group 'change-log)
128 128
129(defcustom add-log-always-start-new-record nil 129(defcustom add-log-always-start-new-record nil
130 "*If non-nil, `add-change-log-entry' will always start a new record." 130 "If non-nil, `add-change-log-entry' will always start a new record."
131 :version "22.1" 131 :version "22.1"
132 :type 'boolean 132 :type 'boolean
133 :group 'change-log) 133 :group 'change-log)
134 134
135(defcustom add-log-buffer-file-name-function nil 135(defcustom add-log-buffer-file-name-function nil
136 "*If non-nil, function to call to identify the full filename of a buffer. 136 "If non-nil, function to call to identify the full filename of a buffer.
137This function is called with no argument. If this is nil, the default is to 137This function is called with no argument. If this is nil, the default is to
138use `buffer-file-name'." 138use `buffer-file-name'."
139 :type '(choice (const nil) function) 139 :type '(choice (const nil) function)
140 :group 'change-log) 140 :group 'change-log)
141 141
142(defcustom add-log-file-name-function nil 142(defcustom add-log-file-name-function nil
143 "*If non-nil, function to call to identify the filename for a ChangeLog entry. 143 "If non-nil, function to call to identify the filename for a ChangeLog entry.
144This function is called with one argument, the value of variable 144This function is called with one argument, the value of variable
145`buffer-file-name' in that buffer. If this is nil, the default is to 145`buffer-file-name' in that buffer. If this is nil, the default is to
146use the file's name relative to the directory of the change log file." 146use the file's name relative to the directory of the change log file."
@@ -286,12 +286,16 @@ Note: The search is conducted only within 10%, at the beginning of the file."
286 map) 286 map)
287 "Keymap for Change Log major mode.") 287 "Keymap for Change Log major mode.")
288 288
289(defvar change-log-time-zone-rule nil 289;; It used to be called change-log-time-zone-rule but really should be
290;; called add-log-time-zone-rule since it's only used from add-log-* code.
291(defvaralias 'change-log-time-zone-rule 'add-log-time-zone-rule)
292(defvar add-log-time-zone-rule nil
290 "Time zone used for calculating change log time stamps. 293 "Time zone used for calculating change log time stamps.
291It takes the same format as the TZ argument of `set-time-zone-rule'. 294It takes the same format as the TZ argument of `set-time-zone-rule'.
292If nil, use local time.") 295If nil, use local time.
296If t, use universal time.")
293 297
294(defun add-log-iso8601-time-zone (time) 298(defun add-log-iso8601-time-zone (&optional time)
295 (let* ((utc-offset (or (car (current-time-zone time)) 0)) 299 (let* ((utc-offset (or (car (current-time-zone time)) 0))
296 (sign (if (< utc-offset 0) ?- ?+)) 300 (sign (if (< utc-offset 0) ?- ?+))
297 (sec (abs utc-offset)) 301 (sec (abs utc-offset))
@@ -304,18 +308,14 @@ If nil, use local time.")
304 (t "%c%02d")) 308 (t "%c%02d"))
305 sign hh mm ss))) 309 sign hh mm ss)))
306 310
311(defvar add-log-iso8601-with-time-zone nil)
312
307(defun add-log-iso8601-time-string () 313(defun add-log-iso8601-time-string ()
308 (if change-log-time-zone-rule 314 (let ((time (format-time-string "%Y-%m-%d"
309 (let ((tz (getenv "TZ")) 315 nil (eq t add-log-time-zone-rule))))
310 (now (current-time))) 316 (if add-log-iso8601-with-time-zone
311 (unwind-protect 317 (concat time " " (add-log-iso8601-time-zone))
312 (progn 318 time)))
313 (set-time-zone-rule change-log-time-zone-rule)
314 (concat
315 (format-time-string "%Y-%m-%d " now)
316 (add-log-iso8601-time-zone now)))
317 (set-time-zone-rule tz)))
318 (format-time-string "%Y-%m-%d")))
319 319
320(defun change-log-name () 320(defun change-log-name ()
321 "Return (system-dependent) default name for a change log file." 321 "Return (system-dependent) default name for a change log file."
@@ -494,7 +494,7 @@ The change log file can start with a copyright notice and a copying
494permission notice. The first blank line indicates the end of these 494permission notice. The first blank line indicates the end of these
495notices. 495notices.
496 496
497Today's date is calculated according to `change-log-time-zone-rule' if 497Today's date is calculated according to `add-log-time-zone-rule' if
498non-nil, otherwise in local time." 498non-nil, otherwise in local time."
499 (interactive (list current-prefix-arg 499 (interactive (list current-prefix-arg
500 (prompt-for-change-log-name))) 500 (prompt-for-change-log-name)))
@@ -538,13 +538,22 @@ non-nil, otherwise in local time."
538 (skip-chars-forward "\n")) 538 (skip-chars-forward "\n"))
539 539
540 ;; Advance into first entry if it is usable; else make new one. 540 ;; Advance into first entry if it is usable; else make new one.
541 (let ((new-entries (mapcar (lambda (addr) 541 (let ((new-entries
542 (concat (funcall add-log-time-format) 542 (mapcar (lambda (addr)
543 " " full-name 543 (concat
544 " <" addr ">")) 544 (if (stringp add-log-time-zone-rule)
545 (if (consp mailing-address) 545 (let ((tz (getenv "TZ")))
546 mailing-address 546 (unwind-protect
547 (list mailing-address))))) 547 (progn
548 (set-time-zone-rule add-log-time-zone-rule)
549 (funcall add-log-time-format))
550 (set-time-zone-rule tz)))
551 (funcall add-log-time-format))
552 " " full-name
553 " <" addr ">"))
554 (if (consp mailing-address)
555 mailing-address
556 (list mailing-address)))))
548 (if (and (not add-log-always-start-new-record) 557 (if (and (not add-log-always-start-new-record)
549 (let ((hit nil)) 558 (let ((hit nil))
550 (dolist (entry new-entries hit) 559 (dolist (entry new-entries hit)
@@ -652,21 +661,21 @@ the change log file in another window."
652 (add-change-log-entry whoami file-name t)) 661 (add-change-log-entry whoami file-name t))
653;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window) 662;;;###autoload (define-key ctl-x-4-map "a" 'add-change-log-entry-other-window)
654 663
655(defvar add-log-indent-text 0) 664(defvar change-log-indent-text 0)
656 665
657(defun add-log-indent () 666(defun change-log-indent ()
658 (let* ((indent 667 (let* ((indent
659 (save-excursion 668 (save-excursion
660 (beginning-of-line) 669 (beginning-of-line)
661 (skip-chars-forward " \t") 670 (skip-chars-forward " \t")
662 (cond 671 (cond
663 ((and (looking-at "\\(.*\\) [^ \n].*[^ \n] <.*>$") 672 ((and (looking-at "\\(.*\\) [^ \n].*[^ \n] <.*>\\(?: +(.*)\\)? *$")
664 ;; Matching the output of add-log-time-format is difficult, 673 ;; Matching the output of add-log-time-format is difficult,
665 ;; but I'll get it has at least two adjacent digits. 674 ;; but I'll get it has at least two adjacent digits.
666 (string-match "[[:digit:]][[:digit:]]" (match-string 1))) 675 (string-match "[[:digit:]][[:digit:]]" (match-string 1)))
667 0) 676 0)
668 ((looking-at "[^*(]") 677 ((looking-at "[^*(]")
669 (+ (current-left-margin) add-log-indent-text)) 678 (+ (current-left-margin) change-log-indent-text))
670 (t (current-left-margin))))) 679 (t (current-left-margin)))))
671 (pos (save-excursion (indent-line-to indent) (point)))) 680 (pos (save-excursion (indent-line-to indent) (point))))
672 (if (> pos (point)) (goto-char pos)))) 681 (if (> pos (point)) (goto-char pos))))
@@ -688,7 +697,7 @@ Runs `change-log-mode-hook'.
688 tab-width 8) 697 tab-width 8)
689 (set (make-local-variable 'fill-paragraph-function) 698 (set (make-local-variable 'fill-paragraph-function)
690 'change-log-fill-paragraph) 699 'change-log-fill-paragraph)
691 (set (make-local-variable 'indent-line-function) 'add-log-indent) 700 (set (make-local-variable 'indent-line-function) 'change-log-indent)
692 (set (make-local-variable 'tab-always-indent) nil) 701 (set (make-local-variable 'tab-always-indent) nil)
693 ;; We really do want "^" in paragraph-start below: it is only the 702 ;; We really do want "^" in paragraph-start below: it is only the
694 ;; lines that begin at column 0 (despite the left-margin of 8) that 703 ;; lines that begin at column 0 (despite the left-margin of 8) that
@@ -722,23 +731,23 @@ Prefix arg means justify as well."
722 731
723(defcustom add-log-current-defun-header-regexp 732(defcustom add-log-current-defun-header-regexp
724 "^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alpha:]]+\\)[ \t]*[:=]" 733 "^\\([[:upper:]][[:upper:]_ ]*[[:upper:]_]\\|[-_[:alpha:]]+\\)[ \t]*[:=]"
725 "*Heuristic regexp used by `add-log-current-defun' for unknown major modes." 734 "Heuristic regexp used by `add-log-current-defun' for unknown major modes."
726 :type 'regexp 735 :type 'regexp
727 :group 'change-log) 736 :group 'change-log)
728 737
729;;;###autoload 738;;;###autoload
730(defvar add-log-lisp-like-modes 739(defvar add-log-lisp-like-modes
731 '(emacs-lisp-mode lisp-mode scheme-mode dsssl-mode lisp-interaction-mode) 740 '(emacs-lisp-mode lisp-mode scheme-mode dsssl-mode lisp-interaction-mode)
732 "*Modes that look like Lisp to `add-log-current-defun'.") 741 "*Modes that look like Lisp to `add-log-current-defun'.")
733 742
734;;;###autoload 743;;;###autoload
735(defvar add-log-c-like-modes 744(defvar add-log-c-like-modes
736 '(c-mode c++-mode c++-c-mode objc-mode) 745 '(c-mode c++-mode c++-c-mode objc-mode)
737 "*Modes that look like C to `add-log-current-defun'.") 746 "*Modes that look like C to `add-log-current-defun'.")
738 747
739;;;###autoload 748;;;###autoload
740(defvar add-log-tex-like-modes 749(defvar add-log-tex-like-modes
741 '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode) 750 '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode)
742 "*Modes that look like TeX to `add-log-current-defun'.") 751 "*Modes that look like TeX to `add-log-current-defun'.")
743 752
744;;;###autoload 753;;;###autoload
@@ -1103,5 +1112,5 @@ old-style time formats for entries are supported."
1103 1112
1104(provide 'add-log) 1113(provide 'add-log)
1105 1114
1106;;; arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e762 1115;; arch-tag: 81eee6fc-088f-4372-a37f-80ad9620e762
1107;;; add-log.el ends here 1116;;; add-log.el ends here
diff --git a/lisp/allout.el b/lisp/allout.el
index 66c4b8681db..dc19c1fa15a 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -84,8 +84,6 @@
84 (require 'pgg-gpg) 84 (require 'pgg-gpg)
85 (require 'overlay) 85 (require 'overlay)
86 )) 86 ))
87(autoload 'pgg-gpg-symmetric-key-p "pgg-gpg"
88 "True if decoded armor MESSAGE-KEYS has symmetric encryption indicator.")
89 87
90;;;_* USER CUSTOMIZATION VARIABLES: 88;;;_* USER CUSTOMIZATION VARIABLES:
91 89
@@ -199,6 +197,9 @@ just the header."
199 :type 'boolean 197 :type 'boolean
200 :group 'allout) 198 :group 'allout)
201(make-variable-buffer-local 'allout-show-bodies) 199(make-variable-buffer-local 'allout-show-bodies)
200;;;###autoload
201(put 'allout-show-bodies 'safe-local-variable
202 (lambda (x) (member x '(t nil))))
202 203
203;;;_ = allout-header-prefix 204;;;_ = allout-header-prefix
204(defcustom allout-header-prefix "." 205(defcustom allout-header-prefix "."
@@ -212,6 +213,8 @@ outlines start at level 2 to avoid this discrepancy."
212 :type 'string 213 :type 'string
213 :group 'allout) 214 :group 'allout)
214(make-variable-buffer-local 'allout-header-prefix) 215(make-variable-buffer-local 'allout-header-prefix)
216;;;###autoload
217(put 'allout-header-prefix 'safe-local-variable 'stringp)
215;;;_ = allout-primary-bullet 218;;;_ = allout-primary-bullet
216(defcustom allout-primary-bullet "*" 219(defcustom allout-primary-bullet "*"
217 "Bullet used for top-level outline topics. 220 "Bullet used for top-level outline topics.
@@ -227,6 +230,8 @@ bullets."
227 :type 'string 230 :type 'string
228 :group 'allout) 231 :group 'allout)
229(make-variable-buffer-local 'allout-primary-bullet) 232(make-variable-buffer-local 'allout-primary-bullet)
233;;;###autoload
234(put 'allout-primary-bullet 'safe-local-variable 'stringp)
230;;;_ = allout-plain-bullets-string 235;;;_ = allout-plain-bullets-string
231(defcustom allout-plain-bullets-string ".," 236(defcustom allout-plain-bullets-string ".,"
232 "*The bullets normally used in outline topic prefixes. 237 "*The bullets normally used in outline topic prefixes.
@@ -241,6 +246,8 @@ of this var to take effect."
241 :type 'string 246 :type 'string
242 :group 'allout) 247 :group 'allout)
243(make-variable-buffer-local 'allout-plain-bullets-string) 248(make-variable-buffer-local 'allout-plain-bullets-string)
249;;;###autoload
250(put 'allout-plain-bullets-string 'safe-local-variable 'stringp)
244;;;_ = allout-distinctive-bullets-string 251;;;_ = allout-distinctive-bullets-string
245(defcustom allout-distinctive-bullets-string "*+-=>()[{}&!?#%\"X@$~_\\:;^" 252(defcustom allout-distinctive-bullets-string "*+-=>()[{}&!?#%\"X@$~_\\:;^"
246 "*Persistent outline header bullets used to distinguish special topics. 253 "*Persistent outline header bullets used to distinguish special topics.
@@ -274,6 +281,8 @@ strings."
274 :type 'string 281 :type 'string
275 :group 'allout) 282 :group 'allout)
276(make-variable-buffer-local 'allout-distinctive-bullets-string) 283(make-variable-buffer-local 'allout-distinctive-bullets-string)
284;;;###autoload
285(put 'allout-distinctive-bullets-string 'safe-local-variable 'stringp)
277 286
278;;;_ = allout-use-mode-specific-leader 287;;;_ = allout-use-mode-specific-leader
279(defcustom allout-use-mode-specific-leader t 288(defcustom allout-use-mode-specific-leader t
@@ -305,6 +314,9 @@ incorrect.]"
305 (const allout-mode-leaders) 314 (const allout-mode-leaders)
306 (const comment-start)) 315 (const comment-start))
307 :group 'allout) 316 :group 'allout)
317;;;###autoload
318(put 'allout-use-mode-specific-leader 'safe-local-variable
319 (lambda (x) (or (member x '(t nil)) (stringp x))))
308;;;_ = allout-mode-leaders 320;;;_ = allout-mode-leaders
309(defvar allout-mode-leaders '() 321(defvar allout-mode-leaders '()
310 "Specific allout-prefix leading strings per major modes. 322 "Specific allout-prefix leading strings per major modes.
@@ -330,6 +342,9 @@ are always respected by the topic maneuvering functions."
330 :type 'boolean 342 :type 'boolean
331 :group 'allout) 343 :group 'allout)
332(make-variable-buffer-local 'allout-old-style-prefixes) 344(make-variable-buffer-local 'allout-old-style-prefixes)
345;;;###autoload
346(put 'allout-old-style-prefixes 'safe-local-variable
347 (lambda (x) (member x '(t nil))))
333;;;_ = allout-stylish-prefixes - alternating bullets 348;;;_ = allout-stylish-prefixes - alternating bullets
334(defcustom allout-stylish-prefixes t 349(defcustom allout-stylish-prefixes t
335 "*Do fancy stuff with topic prefix bullets according to level, etc. 350 "*Do fancy stuff with topic prefix bullets according to level, etc.
@@ -376,6 +391,9 @@ is non-nil."
376 :type 'boolean 391 :type 'boolean
377 :group 'allout) 392 :group 'allout)
378(make-variable-buffer-local 'allout-stylish-prefixes) 393(make-variable-buffer-local 'allout-stylish-prefixes)
394;;;###autoload
395(put 'allout-stylish-prefixes 'safe-local-variable
396 (lambda (x) (member x '(t nil))))
379 397
380;;;_ = allout-numbered-bullet 398;;;_ = allout-numbered-bullet
381(defcustom allout-numbered-bullet "#" 399(defcustom allout-numbered-bullet "#"
@@ -388,6 +406,9 @@ disables numbering maintenance."
388 :type '(choice (const nil) string) 406 :type '(choice (const nil) string)
389 :group 'allout) 407 :group 'allout)
390(make-variable-buffer-local 'allout-numbered-bullet) 408(make-variable-buffer-local 'allout-numbered-bullet)
409;;;###autoload
410(put 'allout-numbered-bullet 'safe-local-variable
411 (lambda (x) (or (not x) (stringp x))))
391;;;_ = allout-file-xref-bullet 412;;;_ = allout-file-xref-bullet
392(defcustom allout-file-xref-bullet "@" 413(defcustom allout-file-xref-bullet "@"
393 "*Bullet signifying file cross-references, for `allout-resolve-xref'. 414 "*Bullet signifying file cross-references, for `allout-resolve-xref'.
@@ -395,6 +416,9 @@ disables numbering maintenance."
395Set this var to the bullet you want to use for file cross-references." 416Set this var to the bullet you want to use for file cross-references."
396 :type '(choice (const nil) string) 417 :type '(choice (const nil) string)
397 :group 'allout) 418 :group 'allout)
419;;;###autoload
420(put 'allout-file-xref-bullet 'safe-local-variable
421 (lambda (x) (or (not x) (stringp x))))
398;;;_ = allout-presentation-padding 422;;;_ = allout-presentation-padding
399(defcustom allout-presentation-padding 2 423(defcustom allout-presentation-padding 2
400 "*Presentation-format white-space padding factor, for greater indent." 424 "*Presentation-format white-space padding factor, for greater indent."
@@ -402,6 +426,8 @@ Set this var to the bullet you want to use for file cross-references."
402 :group 'allout) 426 :group 'allout)
403 427
404(make-variable-buffer-local 'allout-presentation-padding) 428(make-variable-buffer-local 'allout-presentation-padding)
429;;;###autoload
430(put 'allout-presentation-padding 'safe-local-variable 'integerp)
405 431
406;;;_ = allout-abbreviate-flattened-numbering 432;;;_ = allout-abbreviate-flattened-numbering
407(defcustom allout-abbreviate-flattened-numbering nil 433(defcustom allout-abbreviate-flattened-numbering nil
@@ -455,11 +481,16 @@ formatted copy."
455 :group 'allout) 481 :group 'allout)
456 482
457;;;_ + Topic encryption 483;;;_ + Topic encryption
484;;;_ = allout-encryption group
485(defgroup allout-encryption nil
486 "Settings for topic encryption features of allout outliner."
487 :group 'allout)
458;;;_ = allout-topic-encryption-bullet 488;;;_ = allout-topic-encryption-bullet
459(defcustom allout-topic-encryption-bullet "~" 489(defcustom allout-topic-encryption-bullet "~"
460 "*Bullet signifying encryption of the entry's body." 490 "*Bullet signifying encryption of the entry's body."
461 :type '(choice (const nil) string) 491 :type '(choice (const nil) string)
462 :group 'allout) 492 :version "22.0"
493 :group 'allout-encryption)
463;;;_ = allout-passphrase-verifier-handling 494;;;_ = allout-passphrase-verifier-handling
464(defcustom allout-passphrase-verifier-handling t 495(defcustom allout-passphrase-verifier-handling t
465 "*Enable use of symmetric encryption passphrase verifier if non-nil. 496 "*Enable use of symmetric encryption passphrase verifier if non-nil.
@@ -467,7 +498,8 @@ formatted copy."
467See the docstring for the `allout-enable-file-variable-adjustment' 498See the docstring for the `allout-enable-file-variable-adjustment'
468variable for details about allout ajustment of file variables." 499variable for details about allout ajustment of file variables."
469 :type 'boolean 500 :type 'boolean
470 :group 'allout) 501 :version "22.0"
502 :group 'allout-encryption)
471(make-variable-buffer-local 'allout-passphrase-verifier-handling) 503(make-variable-buffer-local 'allout-passphrase-verifier-handling)
472;;;_ = allout-passphrase-hint-handling 504;;;_ = allout-passphrase-hint-handling
473(defcustom allout-passphrase-hint-handling 'always 505(defcustom allout-passphrase-hint-handling 'always
@@ -482,7 +514,8 @@ variable for details about allout ajustment of file variables."
482 :type '(choice (const always) 514 :type '(choice (const always)
483 (const needed) 515 (const needed)
484 (const disabled)) 516 (const disabled))
485 :group 'allout) 517 :version "22.0"
518 :group 'allout-encryption)
486(make-variable-buffer-local 'allout-passphrase-hint-handling) 519(make-variable-buffer-local 'allout-passphrase-hint-handling)
487;;;_ = allout-encrypt-unencrypted-on-saves 520;;;_ = allout-encrypt-unencrypted-on-saves
488(defcustom allout-encrypt-unencrypted-on-saves t 521(defcustom allout-encrypt-unencrypted-on-saves t
@@ -514,7 +547,8 @@ disable auto-saves for that file."
514 :type '(choice (const :tag "Yes" t) 547 :type '(choice (const :tag "Yes" t)
515 (const :tag "All except current topic" except-current) 548 (const :tag "All except current topic" except-current)
516 (const :tag "No" nil)) 549 (const :tag "No" nil))
517 :group 'allout) 550 :version "22.0"
551 :group 'allout-encryption)
518(make-variable-buffer-local 'allout-encrypt-unencrypted-on-saves) 552(make-variable-buffer-local 'allout-encrypt-unencrypted-on-saves)
519 553
520;;;_ + Miscellaneous customization 554;;;_ + Miscellaneous customization
@@ -585,6 +619,9 @@ where auto-fill occurs."
585 :type 'boolean 619 :type 'boolean
586 :group 'allout) 620 :group 'allout)
587(make-variable-buffer-local 'allout-use-hanging-indents) 621(make-variable-buffer-local 'allout-use-hanging-indents)
622;;;###autoload
623(put 'allout-use-hanging-indents 'safe-local-variable
624 (lambda (x) (member x '(t nil))))
588 625
589;;;_ = allout-reindent-bodies 626;;;_ = allout-reindent-bodies
590(defcustom allout-reindent-bodies (if allout-use-hanging-indents 627(defcustom allout-reindent-bodies (if allout-use-hanging-indents
@@ -602,6 +639,9 @@ those that do not have the variable `comment-start' set. A value of
602 :group 'allout) 639 :group 'allout)
603 640
604(make-variable-buffer-local 'allout-reindent-bodies) 641(make-variable-buffer-local 'allout-reindent-bodies)
642;;;###autoload
643(put 'allout-reindent-bodies 'safe-local-variable
644 (lambda (x) (member x '(nil t text force))))
605 645
606;;;_ = allout-enable-file-variable-adjustment 646;;;_ = allout-enable-file-variable-adjustment
607(defcustom allout-enable-file-variable-adjustment t 647(defcustom allout-enable-file-variable-adjustment t
@@ -667,7 +707,9 @@ the layout used for the allout.el source file.)
667case the value of `allout-default-layout' is used.") 707case the value of `allout-default-layout' is used.")
668(make-variable-buffer-local 'allout-layout) 708(make-variable-buffer-local 'allout-layout)
669;;;###autoload 709;;;###autoload
670(put 'allout-layout 'safe-local-variable t) 710(put 'allout-layout 'safe-local-variable
711 (lambda (x) (or (numberp x) (listp x) (integerp x)
712 (member x '(: * + -)))))
671 713
672;;;_ : Topic header format 714;;;_ : Topic header format
673;;;_ = allout-regexp 715;;;_ = allout-regexp
@@ -1053,7 +1095,8 @@ The verifier string is retained as an Emacs file variable, as well as in
1053the emacs buffer state, if file variable adjustments are enabled. See 1095the emacs buffer state, if file variable adjustments are enabled. See
1054`allout-enable-file-variable-adjustment' for details about that.") 1096`allout-enable-file-variable-adjustment' for details about that.")
1055(make-variable-buffer-local 'allout-passphrase-verifier-string) 1097(make-variable-buffer-local 'allout-passphrase-verifier-string)
1056(put 'allout-passphrase-verifier-string 'safe-local-variable t) 1098;;;###autoload
1099(put 'allout-passphrase-verifier-string 'safe-local-variable 'stringp)
1057;;;_ = allout-passphrase-hint-string 1100;;;_ = allout-passphrase-hint-string
1058(defvar allout-passphrase-hint-string "" 1101(defvar allout-passphrase-hint-string ""
1059 "Variable used to retain reminder string for file's encryption passphrase. 1102 "Variable used to retain reminder string for file's encryption passphrase.
@@ -1065,8 +1108,9 @@ The hint is retained as an Emacs file variable, as well as in the emacs buffer
1065state, if file variable adjustments are enabled. See 1108state, if file variable adjustments are enabled. See
1066`allout-enable-file-variable-adjustment' for details about that.") 1109`allout-enable-file-variable-adjustment' for details about that.")
1067(make-variable-buffer-local 'allout-passphrase-hint-string) 1110(make-variable-buffer-local 'allout-passphrase-hint-string)
1068(put 'allout-passphrase-hint-string 'safe-local-variable t)
1069(setq-default allout-passphrase-hint-string "") 1111(setq-default allout-passphrase-hint-string "")
1112;;;###autoload
1113(put 'allout-passphrase-hint-string 'safe-local-variable 'stringp)
1070;;;_ = allout-after-save-decrypt 1114;;;_ = allout-after-save-decrypt
1071(defvar allout-after-save-decrypt nil 1115(defvar allout-after-save-decrypt nil
1072 "Internal variable, is nil or has the value of two points: 1116 "Internal variable, is nil or has the value of two points:
@@ -1573,6 +1617,12 @@ OPEN: A topic that is not closed, though its offspring or body may be."
1573 ; epoch, minor-mode key bindings: 1617 ; epoch, minor-mode key bindings:
1574 (setq allout-mode-map 1618 (setq allout-mode-map
1575 (produce-allout-mode-map allout-keybindings-list)) 1619 (produce-allout-mode-map allout-keybindings-list))
1620 (substitute-key-definition 'beginning-of-line
1621 'move-beginning-of-line
1622 allout-mode-map global-map)
1623 (substitute-key-definition 'end-of-line
1624 'move-end-of-line
1625 allout-mode-map global-map)
1576 (produce-allout-mode-menubar-entries) 1626 (produce-allout-mode-menubar-entries)
1577 (fset 'allout-mode-map allout-mode-map) 1627 (fset 'allout-mode-map allout-mode-map)
1578 ; Include on minor-mode-map-alist, 1628 ; Include on minor-mode-map-alist,
@@ -5778,17 +5828,14 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
5778 (if (/= arg 1) 5828 (if (/= arg 1)
5779 (condition-case nil (line-move (1- arg)) (error nil))) 5829 (condition-case nil (line-move (1- arg)) (error nil)))
5780 5830
5781 (let ((orig (point))) 5831 ;; Move to beginning-of-line, ignoring fields and invisibles.
5782 ;; Move to beginning-of-line, ignoring fields and invisibles. 5832 (skip-chars-backward "^\n")
5783 (skip-chars-backward "^\n") 5833 (while (and (not (bobp)) (line-move-invisible-p (1- (point))))
5784 (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) 5834 (goto-char (if (featurep 'xemacs)
5785 (goto-char (if (featurep 'xemacs) 5835 (previous-property-change (point))
5786 (previous-property-change (point)) 5836 (previous-char-property-change (point))))
5787 (previous-char-property-change (point)))) 5837 (skip-chars-backward "^\n"))
5788 (skip-chars-backward "^\n")) 5838 (vertical-motion 0))
5789 (vertical-motion 0)
5790 (if (/= orig (point))
5791 (goto-char orig))))
5792) 5839)
5793;;;_ > move-end-of-line if necessary - older emacs, xemacs 5840;;;_ > move-end-of-line if necessary - older emacs, xemacs
5794(if (not (fboundp 'move-end-of-line)) 5841(if (not (fboundp 'move-end-of-line))
@@ -5802,8 +5849,7 @@ If point reaches the beginning or end of buffer, it stops there.
5802To ignore intangibility, bind `inhibit-point-motion-hooks' to t." 5849To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
5803 (interactive "p") 5850 (interactive "p")
5804 (or arg (setq arg 1)) 5851 (or arg (setq arg 1))
5805 (let ((orig (point)) 5852 (let (done)
5806 done)
5807 (while (not done) 5853 (while (not done)
5808 (let ((newpos 5854 (let ((newpos
5809 (save-excursion 5855 (save-excursion
@@ -5813,8 +5859,10 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
5813 (error nil)) 5859 (error nil))
5814 (not (bobp)) 5860 (not (bobp))
5815 (progn 5861 (progn
5816 (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) 5862 (while (and (not (bobp))
5817 (goto-char (previous-char-property-change (point)))) 5863 (line-move-invisible-p (1- (point))))
5864 (goto-char
5865 (previous-char-property-change (point))))
5818 (backward-char 1))) 5866 (backward-char 1)))
5819 (point))))) 5867 (point)))))
5820 (goto-char newpos) 5868 (goto-char newpos)
@@ -5827,9 +5875,7 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
5827 ;; and now we're not really at eol, 5875 ;; and now we're not really at eol,
5828 ;; keep going. 5876 ;; keep going.
5829 (setq arg 1) 5877 (setq arg 1)
5830 (setq done t))))) 5878 (setq done t)))))))
5831 (if (/= orig (point))
5832 (goto-char orig))))
5833 ) 5879 )
5834;;;_ > line-move-invisible-p if necessary 5880;;;_ > line-move-invisible-p if necessary
5835(if (not (fboundp 'line-move-invisible-p)) 5881(if (not (fboundp 'line-move-invisible-p))
diff --git a/lisp/bindings.el b/lisp/bindings.el
index f8dfc9fe6c0..4fdfb172e3e 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -310,13 +310,13 @@ Keymap to display on minor modes.")
310 (list 310 (list
311 (propertize "%[(" 'help-echo help-echo) 311 (propertize "%[(" 'help-echo help-echo)
312 `(:propertize ("" mode-name) 312 `(:propertize ("" mode-name)
313 help-echo "mouse-1: major-mode-menu mouse-2: help for current major mode" 313 help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes"
314 mouse-face mode-line-highlight 314 mouse-face mode-line-highlight
315 local-map ,mode-line-major-mode-keymap) 315 local-map ,mode-line-major-mode-keymap)
316 '("" mode-line-process) 316 '("" mode-line-process)
317 `(:propertize ("" minor-mode-alist) 317 `(:propertize ("" minor-mode-alist)
318 mouse-face mode-line-highlight 318 mouse-face mode-line-highlight
319 help-echo "mouse-2: help for minor modes, mouse-3: minor mode menu" 319 help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes"
320 local-map ,mode-line-minor-mode-keymap) 320 local-map ,mode-line-minor-mode-keymap)
321 (propertize "%n" 'help-echo "mouse-2: widen" 321 (propertize "%n" 'help-echo "mouse-2: widen"
322 'mouse-face 'mode-line-highlight 322 'mouse-face 'mode-line-highlight
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index 28a319f84e4..adb94ef7381 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -932,7 +932,9 @@ The command \\[yank] can retrieve it from there."
932 (substring str pref-len suff-pos))) 932 (substring str pref-len suff-pos)))
933 (if (string-match "[^ \t\n]" str) 933 (if (string-match "[^ \t\n]" str)
934 (setq pref-len 0 934 (setq pref-len 0
935 val (math-read-big-expr str)) 935 val (condition-case nil
936 (math-read-big-expr str)
937 (error (math-read-expr str))))
936 (setq val nil)))) 938 (setq val nil))))
937 (if (eq (car-safe val) 'error) 939 (if (eq (car-safe val) 'error)
938 (setq val (list 'error 940 (setq val (list 'error
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el
index c377bcc8735..262e474f7b9 100644
--- a/lisp/calendar/cal-menu.el
+++ b/lisp/calendar/cal-menu.el
@@ -89,7 +89,7 @@
89(define-key calendar-mode-map [menu-bar diary mark] 89(define-key calendar-mode-map [menu-bar diary mark]
90 '("Mark All" . mark-diary-entries)) 90 '("Mark All" . mark-diary-entries))
91(define-key calendar-mode-map [menu-bar diary view] 91(define-key calendar-mode-map [menu-bar diary view]
92 '("Cursor Date" . view-diary-entries)) 92 '("Cursor Date" . diary-view-entries))
93(define-key calendar-mode-map [menu-bar diary view] 93(define-key calendar-mode-map [menu-bar diary view]
94 '("Other File" . view-other-diary-entries)) 94 '("Other File" . view-other-diary-entries))
95 95
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/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index a8eeebae8fc..6ced08bf083 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -79,7 +79,7 @@ D-FILE specifies the file to use as the diary file."
79 (list (prefix-numeric-value current-prefix-arg) 79 (list (prefix-numeric-value current-prefix-arg)
80 (read-file-name "Enter diary file name: " default-directory nil t))) 80 (read-file-name "Enter diary file name: " default-directory nil t)))
81 (let ((diary-file d-file)) 81 (let ((diary-file d-file))
82 (view-diary-entries arg))) 82 (diary-view-entries arg)))
83 83
84(autoload 'check-calendar-holidays "holidays" 84(autoload 'check-calendar-holidays "holidays"
85 "Check the list of holidays for any that occur on DATE. 85 "Check the list of holidays for any that occur on DATE.
diff --git a/lisp/comint.el b/lisp/comint.el
index f8edc85c1ac..946085661fc 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -2703,7 +2703,7 @@ interpreter (e.g., the percent notation of cmd.exe on NT)."
2703 name)) 2703 name))
2704 2704
2705(defun comint-match-partial-filename () 2705(defun comint-match-partial-filename ()
2706 "Return the filename at point, or nil if non is found. 2706 "Return the filename at point, or nil if none is found.
2707Environment variables are substituted. See `comint-word'." 2707Environment variables are substituted. See `comint-word'."
2708 (let ((filename (comint-word comint-file-name-chars))) 2708 (let ((filename (comint-word comint-file-name-chars)))
2709 (and filename (comint-substitute-in-file-name 2709 (and filename (comint-substitute-in-file-name
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index e68d2eab293..52f66038ea6 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -2089,7 +2089,7 @@ and `face'."
2089 'custom-button-pressed 2089 'custom-button-pressed
2090 'custom-button-pressed-unraised)) 2090 'custom-button-pressed-unraised))
2091 2091
2092(defface custom-documentation nil 2092(defface custom-documentation '((t nil))
2093 "Face used for documentation strings in customization buffers." 2093 "Face used for documentation strings in customization buffers."
2094 :group 'custom-faces) 2094 :group 'custom-faces)
2095;; backward-compatibility alias 2095;; backward-compatibility alias
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/faces.el b/lisp/faces.el
index 67f8a2af07a..6a05edc84ca 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2144,19 +2144,19 @@ used to display the prompt text."
2144 :group 'frames 2144 :group 'frames
2145 :group 'basic-faces) 2145 :group 'basic-faces)
2146 2146
2147(defface scroll-bar '() 2147(defface scroll-bar '((t nil))
2148 "Basic face for the scroll bar colors under X." 2148 "Basic face for the scroll bar colors under X."
2149 :version "21.1" 2149 :version "21.1"
2150 :group 'frames 2150 :group 'frames
2151 :group 'basic-faces) 2151 :group 'basic-faces)
2152 2152
2153(defface border '() 2153(defface border '((t nil))
2154 "Basic face for the frame border under X." 2154 "Basic face for the frame border under X."
2155 :version "21.1" 2155 :version "21.1"
2156 :group 'frames 2156 :group 'frames
2157 :group 'basic-faces) 2157 :group 'basic-faces)
2158 2158
2159(defface cursor '() 2159(defface cursor '((t nil))
2160 "Basic face for the cursor color under X. 2160 "Basic face for the cursor color under X.
2161Note: Other faces cannot inherit from the cursor face." 2161Note: Other faces cannot inherit from the cursor face."
2162 :version "21.1" 2162 :version "21.1"
@@ -2165,7 +2165,7 @@ Note: Other faces cannot inherit from the cursor face."
2165 2165
2166(put 'cursor 'face-no-inherit t) 2166(put 'cursor 'face-no-inherit t)
2167 2167
2168(defface mouse '() 2168(defface mouse '((t nil))
2169 "Basic face for the mouse color under X." 2169 "Basic face for the mouse color under X."
2170 :version "21.1" 2170 :version "21.1"
2171 :group 'mouse 2171 :group 'mouse
diff --git a/lisp/files.el b/lisp/files.el
index df63e016c63..76167eb27cf 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2652,15 +2652,11 @@ It is safe if any of these conditions are met:
2652 * There is a matching entry (SYM . VAL) in the 2652 * There is a matching entry (SYM . VAL) in the
2653 `safe-local-variable-values' user option. 2653 `safe-local-variable-values' user option.
2654 2654
2655 * The `safe-local-variable' property of SYM is t.
2656
2657 * The `safe-local-variable' property of SYM is a function that 2655 * The `safe-local-variable' property of SYM is a function that
2658 evaluates to a non-nil value with VAL as an argument." 2656 evaluates to a non-nil value with VAL as an argument."
2659 (or (member (cons sym val) safe-local-variable-values) 2657 (or (member (cons sym val) safe-local-variable-values)
2660 (let ((safep (get sym 'safe-local-variable))) 2658 (let ((safep (get sym 'safe-local-variable)))
2661 (or (eq safep t) 2659 (and (functionp safep) (funcall safep val)))))
2662 (and (functionp safep)
2663 (funcall safep val))))))
2664 2660
2665(defun risky-local-variable-p (sym &optional ignored) 2661(defun risky-local-variable-p (sym &optional ignored)
2666 "Non-nil if SYM could be dangerous as a file-local variable. 2662 "Non-nil if SYM could be dangerous as a file-local variable.
diff --git a/lisp/follow.el b/lisp/follow.el
index 1958c407664..27c37132f0a 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -7,7 +7,6 @@
7;; Maintainer: FSF (Anders' email bounces, Sep 2005) 7;; Maintainer: FSF (Anders' email bounces, Sep 2005)
8;; Created: 1995-05-25 8;; Created: 1995-05-25
9;; Keywords: display, window, minor-mode, convenience 9;; Keywords: display, window, minor-mode, convenience
10;; Last Changed: 1999-11-17
11 10
12;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
13 12
@@ -46,14 +45,14 @@
46;; movement commands. 45;; movement commands.
47;; 46;;
48;; Follow mode comes to its prime when a large screen and two 47;; Follow mode comes to its prime when a large screen and two
49;; side-by-side window are used. The user can, with the help of Follow 48;; side-by-side window are used. The user can, with the help of Follow
50;; mode, use two full-height windows as though they would have been 49;; mode, use two full-height windows as though they would have been
51;; one. Imagine yourself editing a large function, or section of text, 50;; one. Imagine yourself editing a large function, or section of text,
52;; and being able to use 144 lines instead of the normal 72... (your 51;; and being able to use 144 lines instead of the normal 72... (your
53;; mileage may vary). 52;; mileage may vary).
54 53
55;; To test this package, make sure `follow' is loaded, or will be 54;; To test this package, make sure `follow' is loaded, or will be
56;; autoloaded when activated (see below). Then do the following: 55;; autoloaded when activated (see below). Then do the following:
57;; 56;;
58;; * Find your favorite file (preferably a long one). 57;; * Find your favorite file (preferably a long one).
59;; 58;;
@@ -77,13 +76,13 @@
77;; +----------+----------+ 76;; +----------+----------+
78;; 77;;
79;; As you can see, the right-hand window starts at line 73, the line 78;; As you can see, the right-hand window starts at line 73, the line
80;; immediately below the end of the left-hand window. As long as 79;; immediately below the end of the left-hand window. As long as
81;; `follow-mode' is active, the two windows will follow eachother! 80;; `follow-mode' is active, the two windows will follow eachother!
82;; 81;;
83;; * Play around and enjoy! Scroll one window and watch the other. 82;; * Play around and enjoy! Scroll one window and watch the other.
84;; Jump to the beginning or end. Press `Cursor down' at the last 83;; Jump to the beginning or end. Press `Cursor down' at the last
85;; line of the left-hand window. Enter new lines into the 84;; line of the left-hand window. Enter new lines into the
86;; text. Enter long lines spanning several lines, or several 85;; text. Enter long lines spanning several lines, or several
87;; windows. 86;; windows.
88;; 87;;
89;; * Should you find `Follow' mode annoying, just type 88;; * Should you find `Follow' mode annoying, just type
@@ -146,7 +145,7 @@
146;; Usage: 145;; Usage:
147;; 146;;
148;; To activate issue the command "M-x follow-mode" 147;; To activate issue the command "M-x follow-mode"
149;; and press return. To deactivate, do it again. 148;; and press return. To deactivate, do it again.
150;; 149;;
151;; The following is a list of commands useful when follow-mode is active. 150;; The following is a list of commands useful when follow-mode is active.
152;; 151;;
@@ -197,7 +196,7 @@
197;; in the same frame. (My apoligies to you who can't use frames.) 196;; in the same frame. (My apoligies to you who can't use frames.)
198;; 197;;
199;; 2) Bind `follow-mode' to key so you can turn it off whenever 198;; 2) Bind `follow-mode' to key so you can turn it off whenever
200;; you want to view two locations. Of course, `follow' mode can 199;; you want to view two locations. Of course, `follow' mode can
201;; be reactivated by hitting the same key again. 200;; be reactivated by hitting the same key again.
202;; 201;;
203;; Example from my ~/.emacs: 202;; Example from my ~/.emacs:
@@ -208,7 +207,7 @@
208;; 207;;
209;; In an ideal world, follow mode would have been implemented in the 208;; In an ideal world, follow mode would have been implemented in the
210;; kernel of the display routines, making sure that the windows (using 209;; kernel of the display routines, making sure that the windows (using
211;; follow mode) ALWAYS are aligned. On planet earth, however, we must 210;; follow mode) ALWAYS are aligned. On planet earth, however, we must
212;; accept a solution where we ALMOST ALWAYS can make sure that the 211;; accept a solution where we ALMOST ALWAYS can make sure that the
213;; windows are aligned. 212;; windows are aligned.
214;; 213;;
@@ -222,7 +221,7 @@
222;; 221;;
223;; Note that only the selected window is checked, for the reason of 222;; Note that only the selected window is checked, for the reason of
224;; efficiency and code complexity. (I.e. it is possible to make a 223;; efficiency and code complexity. (I.e. it is possible to make a
225;; non-selected windows unaligned. It will, however, pop right back 224;; non-selected windows unaligned. It will, however, pop right back
226;; when it is selected.) 225;; when it is selected.)
227 226
228;;}}} 227;;}}}
@@ -259,7 +258,7 @@
259(eval-when-compile 258(eval-when-compile
260 (if (or (featurep 'bytecomp) 259 (if (or (featurep 'bytecomp)
261 (featurep 'byte-compile)) 260 (featurep 'byte-compile))
262 (cond ((string-match "XEmacs" emacs-version) 261 (cond ((featurep 'xemacs)
263 ;; Make XEmacs shut up! I'm using standard Emacs 262 ;; Make XEmacs shut up! I'm using standard Emacs
264 ;; functions, they are NOT obsolete! 263 ;; functions, they are NOT obsolete!
265 (if (eq (get 'force-mode-line-update 'byte-compile) 264 (if (eq (get 'force-mode-line-update 'byte-compile)
@@ -278,176 +277,44 @@
278 :group 'windows 277 :group 'windows
279 :group 'convenience) 278 :group 'convenience)
280 279
281(defvar follow-mode nil
282 "Variable indicating if Follow mode is active.")
283
284(defcustom follow-mode-hook nil 280(defcustom follow-mode-hook nil
285 "*Hooks to run when follow-mode is turned on." 281 "Hooks to run when follow-mode is turned on."
286 :type 'hook 282 :type 'hook
287 :group 'follow) 283 :group 'follow)
288 284
289(defcustom follow-mode-off-hook nil 285(defcustom follow-mode-off-hook nil
290 "*Hooks to run when follow-mode is turned off." 286 "Hooks to run when follow-mode is turned off."
291 :type 'hook 287 :type 'hook
292 :group 'follow) 288 :group 'follow)
293 289
294(defvar follow-mode-map nil
295 "*Minor mode keymap for Follow mode.")
296 290
297(defcustom follow-mode-line-text " Follow" 291;;{{{ Keymap/Menu
298 "*Text shown in the mode line when Follow mode is active.
299Defaults to \" Follow\". Examples of other values
300are \" Fw\", or simply \"\"."
301 :type 'string
302 :group 'follow)
303 292
304(defcustom follow-auto nil 293;; Define keys for the follow-mode minor mode map and replace some
305 "*Non-nil activates Follow mode whenever a file is loaded." 294;; functions in the global map. All `follow' mode special functions
306 :type 'boolean 295;; can be found on (the somewhat cumbersome) "C-c . <key>"
307 :group 'follow) 296;; (Control-C dot <key>). (As of Emacs 19.29 the keys
297;; C-c <punctuation character> are reserved for minor modes.)
298;;
299;; To change the prefix, redefine `follow-mode-prefix' before
300;; `follow' is loaded, or see the section on `follow-mode-hook'
301;; above for an example of how to bind the keys the way you like.
302;;
303;; Please note that the keymap is defined the first time this file is
304;; loaded. Also note that the only legal way to manipulate the
305;; keymap is to use `define-key'. Don't change it using `setq' or
306;; similar!
308 307
309(defcustom follow-mode-prefix "\C-c." 308(defcustom follow-mode-prefix "\C-c."
310 "*Prefix key to use for follow commands in Follow mode. 309 "Prefix key to use for follow commands in Follow mode.
311The value of this variable is checked as part of loading Follow mode. 310The value of this variable is checked as part of loading Follow mode.
312After that, changing the prefix key requires manipulating keymaps." 311After that, changing the prefix key requires manipulating keymaps."
313 :type 'string 312 :type 'string
314 :group 'follow) 313 :group 'follow)
315 314
316(defcustom follow-intercept-processes 315(defvar follow-mode-map
317 (fboundp 'start-process) 316 (let ((mainmap (make-sparse-keymap))
318 "*When non-nil, Follow Mode will monitor process output." 317 (map (make-sparse-keymap)))
319 :type 'boolean
320 :group 'follow)
321
322(defvar follow-emacs-version-xemacs-p
323 (string-match "XEmacs" emacs-version)
324 "Non-nil when running under XEmacs.")
325
326(defvar follow-avoid-tail-recenter-p
327 (not follow-emacs-version-xemacs-p)
328 "*When non-nil, patch emacs so that tail windows won't be recentered.
329
330A \"tail window\" is a window that displays only the end of
331the buffer. Normally it is practical for the user that empty
332windows are recentered automatically. However, when using
333Follow Mode it breaks the display when the end is displayed
334in a window \"above\" the last window. This is for
335example the case when displaying a short page in info.
336
337Must be set before Follow Mode is loaded.
338
339Please note that it is not possible to fully prevent Emacs from
340recentering empty windows. Please report if you find a repeatable
341situation in which Emacs recenters empty windows.
342
343XEmacs, as of 19.12, does not recenter windows, good!")
344
345(defvar follow-cache-command-list
346 '(next-line previous-line forward-char backward-char)
347 "List of commands that don't require recalculation.
348
349In order to be able to use the cache, a command should not change the
350contents of the buffer, nor should it change selected window or current
351buffer.
352
353The commands in this list are checked at load time.
354
355To mark other commands as suitable for caching, set the symbol
356property `follow-mode-use-cache' to non-nil.")
357
358(defvar follow-debug nil
359 "*Non-nil when debugging Follow mode.")
360
361
362;; Internal variables:
363
364(defvar follow-internal-force-redisplay nil
365 "True when Follow mode should redisplay the windows.")
366
367(defvar follow-process-filter-alist '()
368 "The original filters for processes intercepted by Follow mode.")
369
370(defvar follow-active-menu nil
371 "The menu visible when Follow mode is active.")
372
373(defvar follow-deactive-menu nil
374 "The menu visible when Follow mode is deactivated.")
375
376(defvar follow-inside-post-command-hook nil
377 "Non-nil when inside Follow modes `post-command-hook'.
378Used by `follow-window-size-change'.")
379
380(defvar follow-windows-start-end-cache nil
381 "Cache used by `follow-window-start-end'.")
382
383;;}}}
384;;{{{ Bug report
385
386(eval-when-compile (require 'reporter))
387
388(defun follow-submit-feedback ()
389 "Submit feedback on Follow mode to the author: andersl@andersl.com"
390 (interactive)
391 (require 'reporter)
392 (and (y-or-n-p "Do you really want to submit a report on Follow mode? ")
393 (reporter-submit-bug-report
394 "Anders Lindgren <andersl@andersl.com>"
395 "follow.el"
396 '(post-command-hook
397 pre-command-hook
398 window-size-change-functions
399 window-scroll-functions
400 follow-mode-hook
401 follow-mode-off-hook
402 follow-auto
403 follow-intercept-processes
404 follow-avoid-tail-recenter-p
405 follow-process-filter-alist)
406 nil
407 nil
408 (concat
409 "Hi Anders!\n\n"
410 "(I have read the section on how to report bugs in the "
411 "Emacs manual.)\n\n"
412 "Even though I know you are busy, I thought you might "
413 "want to know...\n\n"))))
414
415;;}}}
416;;{{{ Debug messages
417
418;; This inline function must be as small as possible!
419;; Maybe we should define a macro that expands to nil if
420;; the variable is not set.
421
422(defsubst follow-debug-message (&rest args)
423 "Like message, but only active when `follow-debug' is non-nil."
424 (if (and (boundp 'follow-debug) follow-debug)
425 (apply 'message args)))
426
427;;}}}
428
429;;{{{ Keymap/Menu
430
431;;; Define keys for the follow-mode minor mode map and replace some
432;;; functions in the global map. All `follow' mode special functions
433;;; can be found on (the somewhat cumbersome) "C-c . <key>"
434;;; (Control-C dot <key>). (As of Emacs 19.29 the keys
435;;; C-c <punctuation character> are reserved for minor modes.)
436;;;
437;;; To change the prefix, redefine `follow-mode-prefix' before
438;;; `follow' is loaded, or see the section on `follow-mode-hook'
439;;; above for an example of how to bind the keys the way you like.
440;;;
441;;; Please note that the keymap is defined the first time this file is
442;;; loaded. Also note that the only legal way to manipulate the
443;;; keymap is to use `define-key'. Don't change it using `setq' or
444;;; similar!
445
446
447(if follow-mode-map
448 nil
449 (setq follow-mode-map (make-sparse-keymap))
450 (let ((map (make-sparse-keymap)))
451 (define-key map "\C-v" 'follow-scroll-up) 318 (define-key map "\C-v" 'follow-scroll-up)
452 (define-key map "\M-v" 'follow-scroll-down) 319 (define-key map "\M-v" 'follow-scroll-down)
453 (define-key map "v" 'follow-scroll-down) 320 (define-key map "v" 'follow-scroll-down)
@@ -460,38 +327,26 @@ Used by `follow-window-size-change'.")
460 (define-key map "n" 'follow-next-window) 327 (define-key map "n" 'follow-next-window)
461 (define-key map "p" 'follow-previous-window) 328 (define-key map "p" 'follow-previous-window)
462 329
463 (define-key follow-mode-map follow-mode-prefix map) 330 (define-key mainmap follow-mode-prefix map)
464 331
465 ;; Replace the standard `end-of-buffer', when in Follow Mode. (I 332 ;; Replace the standard `end-of-buffer', when in Follow Mode. (I
466 ;; don't see the point in trying to replace every function that 333 ;; don't see the point in trying to replace every function that
467 ;; could be enhanced in Follow mode. End-of-buffer is a special 334 ;; could be enhanced in Follow mode. End-of-buffer is a special
468 ;; case since it is very simple to define and it greatly enhances 335 ;; case since it is very simple to define and it greatly enhances
469 ;; the look and feel of Follow mode.) 336 ;; the look and feel of Follow mode.)
470 ;; 337 (define-key mainmap [remap end-of-buffer] 'follow-end-of-buffer)
471 ;; (The function `substitute-key-definition' does not work
472 ;; in all versions of Emacs.)
473 (mapcar
474 (function
475 (lambda (pair)
476 (let ((old (car pair))
477 (new (cdr pair)))
478 (mapcar (function (lambda (key)
479 (define-key follow-mode-map key new)))
480 (where-is-internal old global-map)))))
481 '((end-of-buffer . follow-end-of-buffer)
482 (fkey-end-of-buffer . follow-end-of-buffer)))
483 338
484 ;;; 339 ;;
485 ;;; The menu. 340 ;; The menu.
486 ;;; 341 ;;
487 342
488 (if (not follow-emacs-version-xemacs-p) 343 (if (not (featurep 'xemacs))
489 344
490 ;; 345 ;;
491 ;; Emacs 346 ;; Emacs
492 ;; 347 ;;
493 (let ((menumap (funcall (symbol-function 'make-sparse-keymap) 348 (let ((menumap (funcall (symbol-function 'make-sparse-keymap)
494 "Follow")) 349 "Follow"))
495 (count 0) 350 (count 0)
496 id) 351 id)
497 (mapcar 352 (mapcar
@@ -516,16 +371,16 @@ Used by `follow-window-size-change'.")
516 ("First Window" . follow-first-window) 371 ("First Window" . follow-first-window)
517 ("--") 372 ("--")
518 ("Switch To Buffer (all windows)" 373 ("Switch To Buffer (all windows)"
519 . follow-switch-to-buffer-all) 374 . follow-switch-to-buffer-all)
520 ("Switch To Buffer" . follow-switch-to-buffer) 375 ("Switch To Buffer" . follow-switch-to-buffer)
521 ("--") 376 ("--")
522 ("Delete Other Windows and Split" 377 ("Delete Other Windows and Split"
523 . follow-delete-other-windows-and-split) 378 . follow-delete-other-windows-and-split)
524 ("--") 379 ("--")
525 ("Scroll Down" . follow-scroll-down) 380 ("Scroll Down" . follow-scroll-down)
526 ("Scroll Up" . follow-scroll-up))) 381 ("Scroll Up" . follow-scroll-up)))
527 382
528 ;; If there is a `tools' meny, we use it. However, we can't add a 383 ;; If there is a `tools' menu, we use it. However, we can't add a
529 ;; minor-mode specific item to it (it's broken), so we make the 384 ;; minor-mode specific item to it (it's broken), so we make the
530 ;; contents ghosted when not in use, and add ourselves to the 385 ;; contents ghosted when not in use, and add ourselves to the
531 ;; global map. If no `tools' menu is present, just make a 386 ;; global map. If no `tools' menu is present, just make a
@@ -546,7 +401,7 @@ Used by `follow-window-size-change'.")
546 (if last 401 (if last
547 (progn 402 (progn
548 (funcall (symbol-function 'define-key-after) 403 (funcall (symbol-function 'define-key-after)
549 tools-map [separator-follow] '("--") last) 404 tools-map [separator-follow] '("--") last)
550 (funcall (symbol-function 'define-key-after) 405 (funcall (symbol-function 'define-key-after)
551 tools-map [follow] (cons "Follow" menumap) 406 tools-map [follow] (cons "Follow" menumap)
552 'separator-follow)) 407 'separator-follow))
@@ -555,7 +410,7 @@ Used by `follow-window-size-change'.")
555 (define-key (current-global-map) [menu-bar tools follow] 410 (define-key (current-global-map) [menu-bar tools follow]
556 (cons "Follow" menumap)))) 411 (cons "Follow" menumap))))
557 ;; No tools menu, add "Follow" to the menubar. 412 ;; No tools menu, add "Follow" to the menubar.
558 (define-key follow-mode-map [menu-bar follow] 413 (define-key mainmap [menu-bar follow]
559 (cons "Follow" menumap))))) 414 (cons "Follow" menumap)))))
560 415
561 ;; 416 ;;
@@ -593,21 +448,103 @@ Used by `follow-window-size-change'.")
593 (defun follow-menu-filter (menu) 448 (defun follow-menu-filter (menu)
594 (if follow-mode 449 (if follow-mode
595 menu 450 menu
596 '(["Activate " follow-mode t])))))) 451 '(["Activate " follow-mode t]))))
452
453 mainmap)
454 "Minor mode keymap for Follow mode.")
597 455
456;;}}}
598 457
599;;; Register the follow mode keymap. 458(defcustom follow-mode-line-text " Follow"
600(or (assq 'follow-mode minor-mode-map-alist) 459 "Text shown in the mode line when Follow mode is active.
601 (setq minor-mode-map-alist 460Defaults to \" Follow\". Examples of other values
602 (cons (cons 'follow-mode follow-mode-map) minor-mode-map-alist))) 461are \" Fw\", or simply \"\"."
462 :type 'string
463 :group 'follow)
464
465(defcustom follow-auto nil
466 "Non-nil activates Follow mode whenever a file is loaded."
467 :type 'boolean
468 :group 'follow)
469
470(defcustom follow-intercept-processes (fboundp 'start-process)
471 "When non-nil, Follow Mode will monitor process output."
472 :type 'boolean
473 :group 'follow)
474
475(defvar follow-avoid-tail-recenter-p (not (featurep 'xemacs))
476 "*When non-nil, patch emacs so that tail windows won't be recentered.
477
478A \"tail window\" is a window that displays only the end of
479the buffer. Normally it is practical for the user that empty
480windows are recentered automatically. However, when using
481Follow Mode it breaks the display when the end is displayed
482in a window \"above\" the last window. This is for
483example the case when displaying a short page in info.
484
485Must be set before Follow Mode is loaded.
486
487Please note that it is not possible to fully prevent Emacs from
488recentering empty windows. Please report if you find a repeatable
489situation in which Emacs recenters empty windows.
490
491XEmacs, as of 19.12, does not recenter windows, good!")
492
493(defvar follow-cache-command-list
494 '(next-line previous-line forward-char backward-char)
495 "List of commands that don't require recalculation.
496
497In order to be able to use the cache, a command should not change the
498contents of the buffer, nor should it change selected window or current
499buffer.
500
501The commands in this list are checked at load time.
502
503To mark other commands as suitable for caching, set the symbol
504property `follow-mode-use-cache' to non-nil.")
505
506(defvar follow-debug nil
507 "*Non-nil when debugging Follow mode.")
508
509
510;; Internal variables:
511
512(defvar follow-internal-force-redisplay nil
513 "True when Follow mode should redisplay the windows.")
514
515(defvar follow-process-filter-alist '()
516 "The original filters for processes intercepted by Follow mode.")
517
518(defvar follow-active-menu nil
519 "The menu visible when Follow mode is active.")
520
521(defvar follow-deactive-menu nil
522 "The menu visible when Follow mode is deactivated.")
523
524(defvar follow-inside-post-command-hook nil
525 "Non-nil when inside Follow modes `post-command-hook'.
526Used by `follow-window-size-change'.")
527
528(defvar follow-windows-start-end-cache nil
529 "Cache used by `follow-window-start-end'.")
530
531;;}}}
532;;{{{ Debug messages
533
534;; This inline function must be as small as possible!
535;; Maybe we should define a macro that expands to nil if
536;; the variable is not set.
537
538(defsubst follow-debug-message (&rest args)
539 "Like message, but only active when `follow-debug' is non-nil."
540 (if (and (boundp 'follow-debug) follow-debug)
541 (apply 'message args)))
603 542
604;;}}} 543;;}}}
605;;{{{ Cache 544;;{{{ Cache
606 545
607(let ((cmds follow-cache-command-list)) 546(dolist (cmd follow-cache-command-list)
608 (while cmds 547 (put cmd 'follow-mode-use-cache t))
609 (put (car cmds) 'follow-mode-use-cache t)
610 (setq cmds (cdr cmds))))
611 548
612;;}}} 549;;}}}
613 550
@@ -615,20 +552,20 @@ Used by `follow-window-size-change'.")
615 552
616;;;###autoload 553;;;###autoload
617(defun turn-on-follow-mode () 554(defun turn-on-follow-mode ()
618 "Turn on Follow mode. Please see the function `follow-mode'." 555 "Turn on Follow mode. Please see the function `follow-mode'."
619 (interactive) 556 (interactive)
620 (follow-mode 1)) 557 (follow-mode 1))
621 558
622 559
623;;;###autoload 560;;;###autoload
624(defun turn-off-follow-mode () 561(defun turn-off-follow-mode ()
625 "Turn off Follow mode. Please see the function `follow-mode'." 562 "Turn off Follow mode. Please see the function `follow-mode'."
626 (interactive) 563 (interactive)
627 (follow-mode -1)) 564 (follow-mode -1))
628 565
629 566(put 'follow-mode 'permanent-local t)
630;;;###autoload 567;;;###autoload
631(defun follow-mode (arg) 568(define-minor-mode follow-mode
632 "Minor mode that combines windows into one tall virtual window. 569 "Minor mode that combines windows into one tall virtual window.
633 570
634The feeling of a \"virtual window\" has been accomplished by the use 571The feeling of a \"virtual window\" has been accomplished by the use
@@ -665,39 +602,21 @@ is called. When turned off, `follow-mode-off-hook' is called.
665 602
666Keys specific to Follow mode: 603Keys specific to Follow mode:
667\\{follow-mode-map}" 604\\{follow-mode-map}"
668 (interactive "P") 605 :keymap follow-mode-map
669 (make-local-variable 'follow-mode) 606 (if (and follow-mode follow-intercept-processes)
670 (put 'follow-mode 'permanent-local t) 607 (follow-intercept-process-output))
671 (let ((follow-mode-orig follow-mode)) 608 (cond (follow-mode ; On
672 (setq follow-mode 609 ;; XEmacs: If this is non-nil, the window will scroll before
673 (if (null arg) 610 ;; the point will have a chance to get into the next window.
674 (not follow-mode) 611 (if (boundp 'scroll-on-clipped-lines)
675 (> (prefix-numeric-value arg) 0))) 612 (setq scroll-on-clipped-lines nil))
676 (if (and follow-mode follow-intercept-processes) 613 (force-mode-line-update)
677 (follow-intercept-process-output)) 614 (add-hook 'post-command-hook 'follow-post-command-hook t)
678 (cond ((and follow-mode (not follow-mode-orig)) ; On 615 (run-hooks 'follow-mode-hook))
679 ;; XEmacs: If this is non-nil, the window will scroll before 616
680 ;; the point will have a chance to get into the next window. 617 ((not follow-mode) ; Off
681 (if (boundp 'scroll-on-clipped-lines) 618 (force-mode-line-update)
682 (set 'scroll-on-clipped-lines nil)) 619 (run-hooks 'follow-mode-off-hook))))
683 (force-mode-line-update)
684 (add-hook 'post-command-hook 'follow-post-command-hook t)
685 (run-hooks 'follow-mode-hook))
686
687 ((and (not follow-mode) follow-mode-orig) ; Off
688 (force-mode-line-update)
689 (run-hooks 'follow-mode-off-hook)))))
690
691
692;; Register follow-mode as a minor mode.
693
694(if (fboundp 'add-minor-mode)
695 ;; XEmacs
696 (funcall (symbol-function 'add-minor-mode)
697 'follow-mode 'follow-mode-line-text)
698 (or (assq 'follow-mode minor-mode-alist)
699 (setq minor-mode-alist
700 (cons '(follow-mode follow-mode-line-text) minor-mode-alist))))
701 620
702;;}}} 621;;}}}
703;;{{{ Find file hook 622;;{{{ Find file hook
@@ -1033,7 +952,7 @@ window, normally is the end plus one.
1033If WIN is nil, the selected window is used. 952If WIN is nil, the selected window is used.
1034 953
1035Returns (end-pos end-of-buffer-p)" 954Returns (end-pos end-of-buffer-p)"
1036 (if follow-emacs-version-xemacs-p 955 (if (featurep 'xemacs)
1037 ;; XEmacs can calculate the end of the window by using 956 ;; XEmacs can calculate the end of the window by using
1038 ;; the 'guarantee options. GOOD! 957 ;; the 'guarantee options. GOOD!
1039 (let ((end (window-end win t))) 958 (let ((end (window-end win t)))
@@ -1511,7 +1430,7 @@ non-first windows in Follow Mode."
1511;;}}} 1430;;}}}
1512;;{{{ Post Command Hook 1431;;{{{ Post Command Hook
1513 1432
1514;;; The magic little box. This function is called after every command. 1433;; The magic little box. This function is called after every command.
1515 1434
1516;; This is not as complicated as it seems. It is simply a list of common 1435;; This is not as complicated as it seems. It is simply a list of common
1517;; display situations and the actions to take, plus commands for redrawing 1436;; display situations and the actions to take, plus commands for redrawing
@@ -1735,17 +1654,17 @@ non-first windows in Follow Mode."
1735 1654
1736;;;; Scroll-bar support code. 1655;;;; Scroll-bar support code.
1737 1656
1738;;; Why is it needed? Well, if the selected window is in follow mode, 1657;; Why is it needed? Well, if the selected window is in follow mode,
1739;;; all its follower stick to it blindly. If one of them is scrolled, 1658;; all its follower stick to it blindly. If one of them is scrolled,
1740;;; it immediately returns to the original position when the mouse is 1659;; it immediately returns to the original position when the mouse is
1741;;; released. If the selected window is not a follower of the dragged 1660;; released. If the selected window is not a follower of the dragged
1742;;; window the windows will be unaligned. 1661;; window the windows will be unaligned.
1743 1662
1744;;; The advices doesn't get compiled. Aestetically, this might be a 1663;; The advices doesn't get compiled. Aestetically, this might be a
1745;;; problem but in practical life it isn't. 1664;; problem but in practical life it isn't.
1746 1665
1747;;; Discussion: Now when the other windows in the chain follow the 1666;; Discussion: Now when the other windows in the chain follow the
1748;;; dragged, should we really select it? 1667;; dragged, should we really select it?
1749 1668
1750(cond ((fboundp 'scroll-bar-drag) 1669(cond ((fboundp 'scroll-bar-drag)
1751 ;;; 1670 ;;;
@@ -1851,29 +1770,29 @@ WINDOW can be an object or a window."
1851;;}}} 1770;;}}}
1852;;{{{ Process output 1771;;{{{ Process output
1853 1772
1854;;; The following sections installs a spy that listens to process 1773;; The following sections installs a spy that listens to process
1855;;; output and tries to reposition the windows whose buffers are in 1774;; output and tries to reposition the windows whose buffers are in
1856;;; Follow mode. We play safe as much as possible... 1775;; Follow mode. We play safe as much as possible...
1857;;; 1776;;
1858;;; When follow-mode is activated all active processes are 1777;; When follow-mode is activated all active processes are
1859;;; intercepted. All new processes that change their filter function 1778;; intercepted. All new processes that change their filter function
1860;;; using `set-process-filter' are also intercepted. The reason is 1779;; using `set-process-filter' are also intercepted. The reason is
1861;;; that a process can cause a redisplay recentering "tail" windows. 1780;; that a process can cause a redisplay recentering "tail" windows.
1862;;; Note that it doesn't hurt to spy on more processes than needed. 1781;; Note that it doesn't hurt to spy on more processes than needed.
1863;;; 1782;;
1864;;; Technically, we set the process filter to `follow-generic-filter'. 1783;; Technically, we set the process filter to `follow-generic-filter'.
1865;;; The original filter is stored in `follow-process-filter-alist'. 1784;; The original filter is stored in `follow-process-filter-alist'.
1866;;; Our generic filter calls the original filter, or inserts the 1785;; Our generic filter calls the original filter, or inserts the
1867;;; output into the buffer, if the buffer originally didn't have an 1786;; output into the buffer, if the buffer originally didn't have an
1868;;; output filter. It also makes sure that the windows connected to 1787;; output filter. It also makes sure that the windows connected to
1869;;; the buffer are aligned. 1788;; the buffer are aligned.
1870;;; 1789;;
1871;;; Discussion: How do we find processes that don't call 1790;; Discussion: How do we find processes that don't call
1872;;; `set-process-filter'? (How often are processes created in a 1791;; `set-process-filter'? (How often are processes created in a
1873;;; buffer after Follow mode are activated?) 1792;; buffer after Follow mode are activated?)
1874;;; 1793;;
1875;;; Discussion: Should we also advice `process-filter' to make our 1794;; Discussion: Should we also advice `process-filter' to make our
1876;;; filter invisible to others? 1795;; filter invisible to others?
1877 1796
1878;;{{{ Advice for `set-process-filter' 1797;;{{{ Advice for `set-process-filter'
1879 1798
@@ -1980,7 +1899,7 @@ connected to processes.
1980 1899
1981The only reason to call this function is if the Follow mode spy filter 1900The only reason to call this function is if the Follow mode spy filter
1982would interfere with some other package. If this happens, please 1901would interfere with some other package. If this happens, please
1983report this using the `follow-submit-feedback' function." 1902report this using the `report-emacs-bug' function."
1984 (interactive) 1903 (interactive)
1985 (follow-tidy-process-filter-alist) 1904 (follow-tidy-process-filter-alist)
1986 (let ((list (process-list))) 1905 (let ((list (process-list)))
@@ -1999,12 +1918,12 @@ report this using the `follow-submit-feedback' function."
1999;;}}} 1918;;}}}
2000;;{{{ The filter 1919;;{{{ The filter
2001 1920
2002;;; The following section is a naive method to make buffers with 1921;; The following section is a naive method to make buffers with
2003;;; process output to work with Follow mode. Whenever the start of the 1922;; process output to work with Follow mode. Whenever the start of the
2004;;; window displaying the buffer is moved, we moves it back to its 1923;; window displaying the buffer is moved, we moves it back to its
2005;;; original position and try to select a new window. (If we fail, 1924;; original position and try to select a new window. (If we fail,
2006;;; the normal redisplay functions of Emacs will scroll it right 1925;; the normal redisplay functions of Emacs will scroll it right
2007;;; back!) 1926;; back!)
2008 1927
2009(defun follow-generic-filter (proc output) 1928(defun follow-generic-filter (proc output)
2010 "Process output filter for process connected to buffers in Follow mode." 1929 "Process output filter for process connected to buffers in Follow mode."
@@ -2219,7 +2138,7 @@ report this using the `follow-submit-feedback' function."
2219;; unless we are in `slow-search-mode', i.e. only a few lines 2138;; unless we are in `slow-search-mode', i.e. only a few lines
2220;; of text is visible. 2139;; of text is visible.
2221 2140
2222(if follow-emacs-version-xemacs-p 2141(if (featurep 'xemacs)
2223 (defadvice isearch-done (before follow-isearch-done activate) 2142 (defadvice isearch-done (before follow-isearch-done activate)
2224 (if (and (boundp 'follow-mode) 2143 (if (and (boundp 'follow-mode)
2225 follow-mode 2144 follow-mode
@@ -2235,28 +2154,28 @@ report this using the `follow-submit-feedback' function."
2235;;}}} 2154;;}}}
2236;;{{{ Tail window handling 2155;;{{{ Tail window handling
2237 2156
2238;;; In Emacs (not XEmacs) windows showing nothing are sometimes 2157;; In Emacs (not XEmacs) windows showing nothing are sometimes
2239;;; recentered. When in Follow Mode, this is not desireable for 2158;; recentered. When in Follow Mode, this is not desireable for
2240;;; non-first windows in the window chain. This section tries to 2159;; non-first windows in the window chain. This section tries to
2241;;; make the windows stay where they should be. 2160;; make the windows stay where they should be.
2242;;; 2161;;
2243;;; If the display is updated, all windows starting at (point-max) are 2162;; If the display is updated, all windows starting at (point-max) are
2244;;; going to be recentered at the next redisplay, unless we do a 2163;; going to be recentered at the next redisplay, unless we do a
2245;;; read-and-write cycle to update the `force' flag inside the windows. 2164;; read-and-write cycle to update the `force' flag inside the windows.
2246;;; 2165;;
2247;;; In 19.30, a new varible `window-scroll-functions' is called every 2166;; In 19.30, a new varible `window-scroll-functions' is called every
2248;;; time a window is recentered. It is not perfect for our situation, 2167;; time a window is recentered. It is not perfect for our situation,
2249;;; since when it is called for a tail window, it is to late. However, 2168;; since when it is called for a tail window, it is to late. However,
2250;;; if it is called for another window, we can try to update our 2169;; if it is called for another window, we can try to update our
2251;;; windows. 2170;; windows.
2252;;; 2171;;
2253;;; By patching `sit-for' we can make sure that to catch all explicit 2172;; By patching `sit-for' we can make sure that to catch all explicit
2254;;; updates initiated by lisp programs. Internal calls, on the other 2173;; updates initiated by lisp programs. Internal calls, on the other
2255;;; hand, are not handled. 2174;; hand, are not handled.
2256;;; 2175;;
2257;;; Please note that the function `follow-avoid-tail-recenter' is also 2176;; Please note that the function `follow-avoid-tail-recenter' is also
2258;;; called from other places, e.g. `post-command-hook' and 2177;; called from other places, e.g. `post-command-hook' and
2259;;; `post-command-idle-hook'. 2178;; `post-command-idle-hook'.
2260 2179
2261;; If this function is called it is too late for this window, but 2180;; If this function is called it is too late for this window, but
2262;; we might save other windows from being recentered. 2181;; we might save other windows from being recentered.
@@ -2328,9 +2247,9 @@ This prevents `mouse-drag-region' from messing things up."
2328 2247
2329;;{{{ The end 2248;;{{{ The end
2330 2249
2331;;; 2250;;
2332;;; We're done! 2251;; We're done!
2333;;; 2252;;
2334 2253
2335(provide 'follow) 2254(provide 'follow)
2336 2255
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index c66def4af66..cecc180f522 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,68 @@
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
152006-04-26 Reiner Steib <Reiner.Steib@gmx.de>
16
17 * deuglify.el (gnus-outlook-deuglify-unwrap-min)
18 (gnus-outlook-deuglify-unwrap-max): Remove autoload.
19
20 * mml-sec.el (mml-secure-method): New internal variable.
21 (mml-secure-sign, mml-secure-encrypt, mml-secure-message-sign)
22 (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): New
23 functions using mml-secure-method. Sync from the trunk.
24
25 * mml.el (mml-mode-map): Add key bindings for those functions.
26 (mml-menu): Simplify security menu entries. Suggested by Jesper
27 Harder <harder@myrealbox.com>. Sync from the trunk.
28
29 * message.el (message-valid-fqdn-regexp): Add TLDs .cat, jobs,
30 .mobi and .travel. Remove .nato, .bitnet and .uucp.
31 (message-in-body-p): New function. Sync from the trunk.
32
33 * mml.el (mml-mode, mml-dnd-protocol-alist)
34 (mml-dnd-attach-options, mml-dnd-attach-file)
35 (mml-attach-file, mml-attach-buffer, mml-attach-external): Sync
36 DND support and use of message-in-body-p from the trunk.
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
502006-04-25 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de>
51
52 * nnweb.el (nnweb-google-wash-article): Sync up to new Google
53 HTML.
54
552006-04-25 Katsumi Yamaoka <yamaoka@jpl.org>
56
57 * mm-uu.el (mm-uu-pgp-signed-test): Erase prompt.
58 (mm-uu-pgp-encrypted-test): Ditto.
59 (mm-uu-pgp-encrypted-extract-1): Make sure there's a blank line
60 between header and body; return application/pgp-encrypted handle
61 if decryption failed; decode decrypted body by charset.
62
63 * mm-decode.el (mm-automatic-display): Don't make application/pgp
64 element match to application/pgp-*.
65
12006-04-20 Reiner Steib <Reiner.Steib@gmx.de> 662006-04-20 Reiner Steib <Reiner.Steib@gmx.de>
2 67
3 * gnus-util.el (gnus-replace-in-string): Prefer 68 * gnus-util.el (gnus-replace-in-string): Prefer
@@ -419,13 +484,6 @@
419 484
4202006-02-09 Daiki Ueno <ueno@unixuser.org> 4852006-02-09 Daiki Ueno <ueno@unixuser.org>
421 486
422 * pgg-gpg.el (pgg-gpg-encrypt-region): Don't convert line-endings
423 in elisp.
424 (pgg-gpg-encrypt-symmetric-region): Ditto.
425 (pgg-gpg-sign-region): Ditto.
426
427 * pgg-def.el (pgg-text-mode): New variable.
428
429 * mml2015.el (mml2015-pgg-sign): Enable pgg-text-mode. 487 * mml2015.el (mml2015-pgg-sign): Enable pgg-text-mode.
430 (mml2015-pgg-encrypt): Ditto. 488 (mml2015-pgg-encrypt): Ditto.
431 489
diff --git a/lisp/gnus/deuglify.el b/lisp/gnus/deuglify.el
index 4096324fdaa..404aebbd921 100644
--- a/lisp/gnus/deuglify.el
+++ b/lisp/gnus/deuglify.el
@@ -234,14 +234,12 @@
234 :version "22.1" 234 :version "22.1"
235 :group 'gnus) 235 :group 'gnus)
236 236
237;;;###autoload
238(defcustom gnus-outlook-deuglify-unwrap-min 45 237(defcustom gnus-outlook-deuglify-unwrap-min 45
239 "Minimum length of the cited line above the (possibly) wrapped line." 238 "Minimum length of the cited line above the (possibly) wrapped line."
240 :version "22.1" 239 :version "22.1"
241 :type 'integer 240 :type 'integer
242 :group 'gnus-outlook-deuglify) 241 :group 'gnus-outlook-deuglify)
243 242
244;;;###autoload
245(defcustom gnus-outlook-deuglify-unwrap-max 95 243(defcustom gnus-outlook-deuglify-unwrap-max 95
246 "Maximum length of the cited line after unwrapping." 244 "Maximum length of the cited line after unwrapping."
247 :version "22.1" 245 :version "22.1"
@@ -288,7 +286,6 @@
288 :type 'string 286 :type 'string
289 :group 'gnus-outlook-deuglify) 287 :group 'gnus-outlook-deuglify)
290 288
291;;;###autoload
292(defcustom gnus-outlook-display-hook nil 289(defcustom gnus-outlook-display-hook nil
293 "A hook called after an deuglified article has been prepared. 290 "A hook called after an deuglified article has been prepared.
294It is run after `gnus-article-prepare-hook'." 291It is run after `gnus-article-prepare-hook'."
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 472eb2468dd..8bc0f704b5c 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1586,11 +1586,16 @@ functionality to work."
1586(defcustom message-valid-fqdn-regexp 1586(defcustom message-valid-fqdn-regexp
1587 (concat "[a-z0-9][-.a-z0-9]+\\." ;; [hostname.subdomain.]domain. 1587 (concat "[a-z0-9][-.a-z0-9]+\\." ;; [hostname.subdomain.]domain.
1588 ;; valid TLDs: 1588 ;; valid TLDs:
1589 "\\([a-z][a-z]" ;; two letter country TDLs 1589 "\\([a-z][a-z]\\|" ;; two letter country TDLs
1590 "\\|biz\\|com\\|edu\\|gov\\|int\\|mil\\|net\\|org" 1590 "aero\\|arpa\\|bitnet\\|biz\\|bofh\\|"
1591 "\\|aero\\|coop\\|info\\|name\\|museum" 1591 "cat\\|com\\|coop\\|edu\\|gov\\|"
1592 "\\|arpa\\|pro\\|uucp\\|bitnet\\|bofh" ;; old style? 1592 "info\\|int\\|jobs\\|"
1593 "\\)") 1593 "mil\\|mobi\\|museum\\|name\\|net\\|"
1594 "org\\|pro\\|travel\\|uucp\\)")
1595 ;; http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains
1596 ;; http://en.wikipedia.org/wiki/GTLD
1597 ;; `in the process of being approved': .asia .post .tel .sex
1598 ;; "dead" nato bitnet uucp
1594 "Regular expression that matches a valid FQDN." 1599 "Regular expression that matches a valid FQDN."
1595 ;; see also: gnus-button-valid-fqdn-regexp 1600 ;; see also: gnus-button-valid-fqdn-regexp
1596 :version "22.1" 1601 :version "22.1"
@@ -2679,6 +2684,11 @@ M-RET `message-newline-and-reformat' (break the line and reformat)."
2679 (or (search-forward (concat "\n" mail-header-separator "\n") nil t) 2684 (or (search-forward (concat "\n" mail-header-separator "\n") nil t)
2680 (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t))) 2685 (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t)))
2681 2686
2687(defun message-in-body-p ()
2688 "Return t if point is in the message body."
2689 (let ((body (save-excursion (message-goto-body) (point))))
2690 (>= (point) body)))
2691
2682(defun message-goto-eoh () 2692(defun message-goto-eoh ()
2683 "Move point to the end of the headers." 2693 "Move point to the end of the headers."
2684 (interactive) 2694 (interactive)
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 5ee47a8ce26..b79e081f0e1 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -307,7 +307,7 @@ when selecting a different article."
307 "application/pkcs7-signature" "application/x-pkcs7-mime" 307 "application/pkcs7-signature" "application/x-pkcs7-mime"
308 "application/pkcs7-mime" 308 "application/pkcs7-mime"
309 ;; Mutt still uses this even though it has already been withdrawn. 309 ;; Mutt still uses this even though it has already been withdrawn.
310 "application/pgp") 310 "application/pgp\\'")
311 "A list of MIME types to be displayed automatically." 311 "A list of MIME types to be displayed automatically."
312 :type '(repeat regexp) 312 :type '(repeat regexp)
313 :group 'mime-display) 313 :group 'mime-display)
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index 9029e0d699c..9d9d87a3670 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -352,7 +352,9 @@ Return that buffer."
352 ((eq mm-verify-option 'never) nil) 352 ((eq mm-verify-option 'never) nil)
353 ((eq mm-verify-option 'always) t) 353 ((eq mm-verify-option 'always) t)
354 ((eq mm-verify-option 'known) t) 354 ((eq mm-verify-option 'known) t)
355 (t (y-or-n-p "Verify pgp signed part? "))))) 355 (t (prog1
356 (y-or-n-p "Verify pgp signed part? ")
357 (message ""))))))
356 358
357(eval-when-compile 359(eval-when-compile
358 (defvar gnus-newsgroup-charset)) 360 (defvar gnus-newsgroup-charset))
@@ -403,15 +405,51 @@ Return that buffer."
403 ((eq mm-decrypt-option 'never) nil) 405 ((eq mm-decrypt-option 'never) nil)
404 ((eq mm-decrypt-option 'always) t) 406 ((eq mm-decrypt-option 'always) t)
405 ((eq mm-decrypt-option 'known) t) 407 ((eq mm-decrypt-option 'known) t)
406 (t (y-or-n-p "Decrypt pgp encrypted part? "))))) 408 (t (prog1
409 (y-or-n-p "Decrypt pgp encrypted part? ")
410 (message ""))))))
407 411
408(defun mm-uu-pgp-encrypted-extract-1 (handles ctl) 412(defun mm-uu-pgp-encrypted-extract-1 (handles ctl)
409 (let ((buf (mm-uu-copy-to-buffer (point-min) (point-max)))) 413 (let ((buf (mm-uu-copy-to-buffer (point-min) (point-max)))
410 (if (mm-uu-pgp-encrypted-test) 414 (first t)
411 (with-current-buffer buf 415 charset)
412 (mml2015-clean-buffer) 416 ;; Make sure there's a blank line between header and body.
413 (funcall (mml2015-clear-decrypt-function)))) 417 (with-current-buffer buf
414 (list (mm-make-handle buf mm-uu-text-plain-type)))) 418 (goto-char (point-min))
419 (while (prog2
420 (forward-line 1)
421 (if first
422 (looking-at "[^\t\n ]+:")
423 (looking-at "[^\t\n ]+:\\|[\t ]"))
424 (setq first nil)))
425 (unless (memq (char-after) '(?\n nil))
426 (insert "\n"))
427 (save-restriction
428 (narrow-to-region (point-min) (point))
429 (setq charset (mail-fetch-field "charset")))
430 (if (and (mm-uu-pgp-encrypted-test)
431 (progn
432 (mml2015-clean-buffer)
433 (funcall (mml2015-clear-decrypt-function))
434 (equal (mm-handle-multipart-ctl-parameter mm-security-handle
435 'gnus-info)
436 "OK")))
437 (progn
438 ;; Decode charset.
439 (if (and (or charset
440 (setq charset gnus-newsgroup-charset))
441 (setq charset (mm-charset-to-coding-system charset))
442 (not (eq charset 'ascii)))
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))
451 (list (mm-make-handle buf mm-uu-text-plain-type)))
452 (list (mm-make-handle buf '("application/pgp-encrypted")))))))
415 453
416(defun mm-uu-pgp-encrypted-extract () 454(defun mm-uu-pgp-encrypted-extract ()
417 (let ((mm-security-handle (list (format "multipart/encrypted")))) 455 (let ((mm-security-handle (list (format "multipart/encrypted"))))
diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el
index 2af068897f0..df301dc74b7 100644
--- a/lisp/gnus/mml-sec.el
+++ b/lisp/gnus/mml-sec.el
@@ -188,6 +188,29 @@ You can also customize or set `mml-signencrypt-style-alist' instead."
188 (cons method tags)))) 188 (cons method tags))))
189 (t (error "The message is corrupted. No mail header separator")))))) 189 (t (error "The message is corrupted. No mail header separator"))))))
190 190
191(defvar mml-secure-method
192 (if (equal mml-default-encrypt-method mml-default-sign-method)
193 mml-default-sign-method
194 "pgpmime")
195 "Current security method. Internal variable.")
196
197(defun mml-secure-sign (&optional method)
198 "Add MML tags to sign this MML part.
199Use METHOD if given. Else use `mml-secure-method' or
200`mml-default-sign-method'."
201 (interactive)
202 (mml-secure-part
203 (or method mml-secure-method mml-default-sign-method)
204 'sign))
205
206(defun mml-secure-encrypt (&optional method)
207 "Add MML tags to encrypt this MML part.
208Use METHOD if given. Else use `mml-secure-method' or
209`mml-default-sign-method'."
210 (interactive)
211 (mml-secure-part
212 (or method mml-secure-method mml-default-sign-method)))
213
191(defun mml-secure-sign-pgp () 214(defun mml-secure-sign-pgp ()
192 "Add MML tags to PGP sign this MML part." 215 "Add MML tags to PGP sign this MML part."
193 (interactive) 216 (interactive)
@@ -249,6 +272,34 @@ You can also customize or set `mml-signencrypt-style-alist' instead."
249 (when (re-search-backward "^<#secure.*>\n" nil t) 272 (when (re-search-backward "^<#secure.*>\n" nil t)
250 (delete-region (match-beginning 0) (match-end 0))))) 273 (delete-region (match-beginning 0) (match-end 0)))))
251 274
275
276(defun mml-secure-message-sign (&optional method)
277 "Add MML tags to sign this MML part.
278Use METHOD if given. Else use `mml-secure-method' or
279`mml-default-sign-method'."
280 (interactive)
281 (mml-secure-part
282 (or method mml-secure-method mml-default-sign-method)
283 'sign))
284
285(defun mml-secure-message-sign-encrypt (&optional method)
286 "Add MML tag to sign and encrypt the entire message.
287Use METHOD if given. Else use `mml-secure-method' or
288`mml-default-sign-method'."
289 (interactive)
290 (mml-secure-message
291 (or method mml-secure-method mml-default-sign-method)
292 'signencrypt))
293
294(defun mml-secure-message-encrypt (&optional method)
295 "Add MML tag to encrypt the entire message.
296Use METHOD if given. Else use `mml-secure-method' or
297`mml-default-sign-method'."
298 (interactive)
299 (mml-secure-message
300 (or method mml-secure-method mml-default-sign-method)
301 'encrypt))
302
252(defun mml-secure-message-sign-smime () 303(defun mml-secure-message-sign-smime ()
253 "Add MML tag to encrypt/sign the entire message." 304 "Add MML tag to encrypt/sign the entire message."
254 (interactive) 305 (interactive)
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 6ae004a2a3b..466c0b832de 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -40,7 +40,8 @@
40 (autoload 'message-fetch-field "message") 40 (autoload 'message-fetch-field "message")
41 (autoload 'message-info "message") 41 (autoload 'message-info "message")
42 (autoload 'fill-flowed-encode "flow-fill") 42 (autoload 'fill-flowed-encode "flow-fill")
43 (autoload 'message-posting-charset "message")) 43 (autoload 'message-posting-charset "message")
44 (autoload 'dnd-get-local-file-name "dnd"))
44 45
45(defvar gnus-article-mime-handles) 46(defvar gnus-article-mime-handles)
46(defvar gnus-mouse-2) 47(defvar gnus-mouse-2)
@@ -51,6 +52,7 @@
51(defvar message-posting-charset) 52(defvar message-posting-charset)
52(defvar message-required-mail-headers) 53(defvar message-required-mail-headers)
53(defvar message-required-news-headers) 54(defvar message-required-news-headers)
55(defvar dnd-protocol-alist)
54 56
55(defcustom mml-content-type-parameters 57(defcustom mml-content-type-parameters
56 '(name access-type expiration size permission format) 58 '(name access-type expiration size permission format)
@@ -877,6 +879,11 @@ If HANDLES is non-nil, use it instead reparsing the buffer."
877 (encryptpart (make-sparse-keymap)) 879 (encryptpart (make-sparse-keymap))
878 (map (make-sparse-keymap)) 880 (map (make-sparse-keymap))
879 (main (make-sparse-keymap))) 881 (main (make-sparse-keymap)))
882 (define-key map "\C-s" 'mml-secure-message-sign)
883 (define-key map "\C-c" 'mml-secure-message-encrypt)
884 (define-key map "\C-e" 'mml-secure-message-sign-encrypt)
885 (define-key map "\C-p\C-s" 'mml-secure-sign)
886 (define-key map "\C-p\C-c" 'mml-secure-encrypt)
880 (define-key sign "p" 'mml-secure-message-sign-pgpmime) 887 (define-key sign "p" 'mml-secure-message-sign-pgpmime)
881 (define-key sign "o" 'mml-secure-message-sign-pgp) 888 (define-key sign "o" 'mml-secure-message-sign-pgp)
882 (define-key sign "s" 'mml-secure-message-sign-smime) 889 (define-key sign "s" 'mml-secure-message-sign-smime)
@@ -914,26 +921,54 @@ If HANDLES is non-nil, use it instead reparsing the buffer."
914 ["Attach File..." mml-attach-file 921 ["Attach File..." mml-attach-file
915 ,@(if (featurep 'xemacs) '(t) 922 ,@(if (featurep 'xemacs) '(t)
916 '(:help "Attach a file at point"))] 923 '(:help "Attach a file at point"))]
917 ["Attach Buffer..." mml-attach-buffer t] 924 ["Attach Buffer..." mml-attach-buffer
918 ["Attach External..." mml-attach-external t] 925 ,@(if (featurep 'xemacs) '(t)
919 ["Insert Part..." mml-insert-part t] 926 '(:help "Attach a buffer to the outgoing MIME message"))]
920 ["Insert Multipart..." mml-insert-multipart t] 927 ["Attach External..." mml-attach-external
921 ["PGP/MIME Sign" mml-secure-message-sign-pgpmime t] 928 ,@(if (featurep 'xemacs) '(t)
922 ["PGP/MIME Encrypt" mml-secure-message-encrypt-pgpmime t] 929 '(:help "Attach reference to file"))]
923 ["PGP Sign" mml-secure-message-sign-pgp t] 930 ;;
924 ["PGP Encrypt" mml-secure-message-encrypt-pgp t] 931 ("Change Security Method"
925 ["S/MIME Sign" mml-secure-message-sign-smime t] 932 ["PGP/MIME"
926 ["S/MIME Encrypt" mml-secure-message-encrypt-smime t] 933 (lambda () (interactive) (setq mml-secure-method "pgpmime"))
927 ("Secure MIME part" 934 ,@(if (featurep 'xemacs) nil
928 ["PGP/MIME Sign Part" mml-secure-sign-pgpmime t] 935 '(:help "Set Security Method to PGP/MIME"))
929 ["PGP/MIME Encrypt Part" mml-secure-encrypt-pgpmime t] 936 :style radio
930 ["PGP Sign Part" mml-secure-sign-pgp t] 937 :selected (equal mml-secure-method "pgpmime") ]
931 ["PGP Encrypt Part" mml-secure-encrypt-pgp t] 938 ["S/MIME"
932 ["S/MIME Sign Part" mml-secure-sign-smime t] 939 (lambda () (interactive) (setq mml-secure-method "smime"))
933 ["S/MIME Encrypt Part" mml-secure-encrypt-smime t]) 940 ,@(if (featurep 'xemacs) nil
934 ["Encrypt/Sign off" mml-unsecure-message t] 941 '(:help "Set Security Method to S/MIME"))
942 :style radio
943 :selected (equal mml-secure-method "smime") ]
944 ["Inline PGP"
945 (lambda () (interactive) (setq mml-secure-method "pgp"))
946 ,@(if (featurep 'xemacs) nil
947 '(:help "Set Security Method to inline PGP"))
948 :style radio
949 :selected (equal mml-secure-method "pgp") ] )
950 ;;
951 ["Sign Message" mml-secure-message-sign t]
952 ["Encrypt Message" mml-secure-message-encrypt t]
953 ["Sign and Encrypt Message" mml-secure-message-sign-encrypt t]
954 ["Encrypt/Sign off" mml-unsecure-message
955 ,@(if (featurep 'xemacs) '(t)
956 '(:help "Don't Encrypt/Sign Message"))]
957 ;; Maybe we could remove these, because people who write MML most probably
958 ;; don't use the menu:
959 ["Insert Part..." mml-insert-part
960 :active (message-in-body-p)]
961 ["Insert Multipart..." mml-insert-multipart
962 :active (message-in-body-p)]
963 ;;
964 ;; Do we have separate encrypt and encrypt/sign commands for parts?
965 ["Sign Part" mml-secure-sign t]
966 ["Encrypt Part" mml-secure-encrypt t]
935 ;;["Narrow" mml-narrow-to-part t] 967 ;;["Narrow" mml-narrow-to-part t]
936 ["Quote MML" mml-quote-region t] 968 ["Quote MML in region" mml-quote-region
969 :active (message-mark-active-p)
970 ,@(if (featurep 'xemacs) nil
971 '(:help "Quote MML tags in region"))]
937 ["Validate MML" mml-validate t] 972 ["Validate MML" mml-validate t]
938 ["Preview" mml-preview t] 973 ["Preview" mml-preview t]
939 "----" 974 "----"
@@ -957,8 +992,11 @@ See Info node `(emacs-mime)Composing'.
957 (when (set (make-local-variable 'mml-mode) 992 (when (set (make-local-variable 'mml-mode)
958 (if (null arg) (not mml-mode) 993 (if (null arg) (not mml-mode)
959 (> (prefix-numeric-value arg) 0))) 994 (> (prefix-numeric-value arg) 0)))
960 (gnus-add-minor-mode 'mml-mode " MML" mml-mode-map) 995 (add-minor-mode 'mml-mode " MML" mml-mode-map)
961 (easy-menu-add mml-menu mml-mode-map) 996 (easy-menu-add mml-menu mml-mode-map)
997 (when (boundp 'dnd-protocol-alist)
998 (set (make-local-variable 'dnd-protocol-alist)
999 (append mml-dnd-protocol-alist dnd-protocol-alist)))
962 (run-hooks 'mml-mode-hook))) 1000 (run-hooks 'mml-mode-hook)))
963 1001
964;;; 1002;;;
@@ -1056,6 +1094,36 @@ See Info node `(emacs-mime)Composing'.
1056 1094
1057;;; Attachment functions. 1095;;; Attachment functions.
1058 1096
1097(defcustom mml-dnd-protocol-alist
1098 '(("^file:///" . mml-dnd-attach-file)
1099 ("^file://" . dnd-open-file)
1100 ("^file:" . mml-dnd-attach-file))
1101 "The functions to call when a drop in `mml-mode' is made.
1102See `dnd-protocol-alist' for more information. When nil, behave
1103as in other buffers."
1104 :type '(choice (repeat (cons (regexp) (function)))
1105 (const :tag "Behave as in other buffers" nil))
1106 :version "22.1" ;; Gnus 5.10.9
1107 :group 'message)
1108
1109(defcustom mml-dnd-attach-options nil
1110 "Which options should be queried when attaching a file via drag and drop.
1111
1112If it is a list, valid members are `type', `description' and
1113`disposition'. `disposition' implies `type'. If it is nil,
1114don't ask for options. If it is t, ask the user whether or not
1115to specify options."
1116 :type '(choice
1117 (const :tag "Non" nil)
1118 (const :tag "Query" t)
1119 (list :value (type description disposition)
1120 (set :inline t
1121 (const type)
1122 (const description)
1123 (const disposition))))
1124 :version "22.1" ;; Gnus 5.10.9
1125 :group 'message)
1126
1059(defun mml-attach-file (file &optional type description disposition) 1127(defun mml-attach-file (file &optional type description disposition)
1060 "Attach a file to the outgoing MIME message. 1128 "Attach a file to the outgoing MIME message.
1061The file is not inserted or encoded until you send the message with 1129The file is not inserted or encoded until you send the message with
@@ -1073,11 +1141,37 @@ body) or \"attachment\" (separate from the body)."
1073 (description (mml-minibuffer-read-description)) 1141 (description (mml-minibuffer-read-description))
1074 (disposition (mml-minibuffer-read-disposition type))) 1142 (disposition (mml-minibuffer-read-disposition type)))
1075 (list file type description disposition))) 1143 (list file type description disposition)))
1076 (mml-insert-empty-tag 'part 1144 (save-excursion
1077 'type type 1145 (unless (message-in-body-p) (goto-char (point-max)))
1078 'filename file 1146 (mml-insert-empty-tag 'part
1079 'disposition (or disposition "attachment") 1147 'type type
1080 'description description)) 1148 'filename file
1149 'disposition (or disposition "attachment")
1150 'description description)))
1151
1152(defun mml-dnd-attach-file (uri action)
1153 "Attach a drag and drop file.
1154
1155Ask for type, description or disposition according to
1156`mml-dnd-attach-options'."
1157 (let ((file (dnd-get-local-file-name uri t)))
1158 (when (and file (file-regular-p file))
1159 (let ((mml-dnd-attach-options mml-dnd-attach-options)
1160 type description disposition)
1161 (setq mml-dnd-attach-options
1162 (when (and (eq mml-dnd-attach-options t)
1163 (not
1164 (y-or-n-p
1165 "Use default type, disposition and description? ")))
1166 '(type description disposition)))
1167 (when (or (memq 'type mml-dnd-attach-options)
1168 (memq 'disposition mml-dnd-attach-options))
1169 (setq type (mml-minibuffer-read-type file)))
1170 (when (memq 'description mml-dnd-attach-options)
1171 (setq description (mml-minibuffer-read-description)))
1172 (when (memq 'disposition mml-dnd-attach-options)
1173 (setq disposition (mml-minibuffer-read-disposition type)))
1174 (mml-attach-file file type description disposition)))))
1081 1175
1082(defun mml-attach-buffer (buffer &optional type description) 1176(defun mml-attach-buffer (buffer &optional type description)
1083 "Attach a buffer to the outgoing MIME message. 1177 "Attach a buffer to the outgoing MIME message.
@@ -1087,8 +1181,11 @@ See `mml-attach-file' for details of operation."
1087 (type (mml-minibuffer-read-type buffer "text/plain")) 1181 (type (mml-minibuffer-read-type buffer "text/plain"))
1088 (description (mml-minibuffer-read-description))) 1182 (description (mml-minibuffer-read-description)))
1089 (list buffer type description))) 1183 (list buffer type description)))
1090 (mml-insert-empty-tag 'part 'type type 'buffer buffer 1184 (save-excursion
1091 'disposition "attachment" 'description description)) 1185 (unless (message-in-body-p) (goto-char (point-max)))
1186 (mml-insert-empty-tag 'part 'type type 'buffer buffer
1187 'disposition "attachment"
1188 'description description)))
1092 1189
1093(defun mml-attach-external (file &optional type description) 1190(defun mml-attach-external (file &optional type description)
1094 "Attach an external file into the buffer. 1191 "Attach an external file into the buffer.
@@ -1099,8 +1196,10 @@ TYPE is the MIME type to use."
1099 (type (mml-minibuffer-read-type file)) 1196 (type (mml-minibuffer-read-type file))
1100 (description (mml-minibuffer-read-description))) 1197 (description (mml-minibuffer-read-description)))
1101 (list file type description))) 1198 (list file type description)))
1102 (mml-insert-empty-tag 'external 'type type 'name file 1199 (save-excursion
1103 'disposition "attachment" 'description description)) 1200 (unless (message-in-body-p) (goto-char (point-max)))
1201 (mml-insert-empty-tag 'external 'type type 'name file
1202 'disposition "attachment" 'description description)))
1104 1203
1105(defun mml-insert-multipart (&optional type) 1204(defun mml-insert-multipart (&optional type)
1106 (interactive (list (completing-read "Multipart type (default mixed): " 1205 (interactive (list (completing-read "Multipart type (default mixed): "
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index 0c6bb675388..4db3540aec1 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -230,22 +230,22 @@
230 230
231(defun mml1991-pgg-sign (cont) 231(defun mml1991-pgg-sign (cont)
232 (let ((pgg-text-mode t) 232 (let ((pgg-text-mode t)
233 (pgg-default-user-id (or (message-options-get 'mml-sender)
234 pgg-default-user-id))
233 headers cte) 235 headers cte)
234 ;; Don't sign headers. 236 ;; Don't sign headers.
235 (goto-char (point-min)) 237 (goto-char (point-min))
236 (while (not (looking-at "^$")) 238 (when (re-search-forward "^$" nil t)
237 (forward-line))
238 (unless (eobp) ;; no headers?
239 (setq headers (buffer-substring (point-min) (point))) 239 (setq headers (buffer-substring (point-min) (point)))
240 (forward-line) ;; skip header/body separator 240 (save-restriction
241 (delete-region (point-min) (point))) 241 (narrow-to-region (point-min) (point))
242 (when (string-match "^Content-Transfer-Encoding: \\(.+\\)" headers) 242 (setq cte (mail-fetch-field "content-transfer-encoding")))
243 (setq cte (intern (match-string 1 headers)))) 243 (forward-line 1)
244 (mm-decode-content-transfer-encoding cte) 244 (delete-region (point-min) (point))
245 (unless (let ((pgg-default-user-id 245 (when cte
246 (or (message-options-get 'mml-sender) 246 (setq cte (intern (downcase cte)))
247 pgg-default-user-id))) 247 (mm-decode-content-transfer-encoding cte)))
248 (pgg-sign-region (point-min) (point-max) t)) 248 (unless (pgg-sign-region (point-min) (point-max) t)
249 (pop-to-buffer pgg-errors-buffer) 249 (pop-to-buffer pgg-errors-buffer)
250 (error "Encrypt error")) 250 (error "Encrypt error"))
251 (delete-region (point-min) (point-max)) 251 (delete-region (point-min) (point-max))
@@ -254,7 +254,8 @@
254 (goto-char (point-min)) 254 (goto-char (point-min))
255 (while (re-search-forward "\r+$" nil t) 255 (while (re-search-forward "\r+$" nil t)
256 (replace-match "" t t)) 256 (replace-match "" t t))
257 (mm-encode-content-transfer-encoding cte) 257 (when cte
258 (mm-encode-content-transfer-encoding cte))
258 (goto-char (point-min)) 259 (goto-char (point-min))
259 (when headers 260 (when headers
260 (insert headers)) 261 (insert headers))
@@ -262,18 +263,18 @@
262 t)) 263 t))
263 264
264(defun mml1991-pgg-encrypt (cont &optional sign) 265(defun mml1991-pgg-encrypt (cont &optional sign)
265 (let ((pgg-text-mode t) 266 (goto-char (point-min))
266 cte) 267 (when (re-search-forward "^$" nil t)
267 ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED 268 (let ((cte (save-restriction
268 (goto-char (point-min)) 269 (narrow-to-region (point-min) (point))
269 (while (looking-at "^Content[^ ]+:") 270 (mail-fetch-field "content-transfer-encoding"))))
270 (when (looking-at "^Content-Transfer-Encoding: \\(.+\\)") 271 ;; Strip MIME headers since it will be ASCII armoured.
271 (setq cte (intern (match-string 1)))) 272 (forward-line 1)
272 (forward-line)) 273 (delete-region (point-min) (point))
273 (unless (bobp) 274 (when cte
274 (delete-region (point-min) (point))) 275 (mm-decode-content-transfer-encoding (intern (downcase cte))))))
275 (mm-decode-content-transfer-encoding cte) 276 (unless (let ((pgg-text-mode t))
276 (unless (pgg-encrypt-region 277 (pgg-encrypt-region
277 (point-min) (point-max) 278 (point-min) (point-max)
278 (split-string 279 (split-string
279 (or 280 (or
@@ -281,15 +282,13 @@
281 (message-options-set 'message-recipients 282 (message-options-set 'message-recipients
282 (read-string "Recipients: "))) 283 (read-string "Recipients: ")))
283 "[ \f\t\n\r\v,]+") 284 "[ \f\t\n\r\v,]+")
284 sign) 285 sign))
285 (pop-to-buffer pgg-errors-buffer) 286 (pop-to-buffer pgg-errors-buffer)
286 (error "Encrypt error")) 287 (error "Encrypt error"))
287 (delete-region (point-min) (point-max)) 288 (delete-region (point-min) (point-max))
288 ;;(insert "Content-Type: application/pgp-encrypted\n\n") 289 (insert "\n")
289 ;;(insert "Version: 1\n\n") 290 (insert-buffer-substring pgg-output-buffer)
290 (insert "\n") 291 t)
291 (insert-buffer-substring pgg-output-buffer)
292 t))
293 292
294;;;###autoload 293;;;###autoload
295(defun mml1991-encrypt (cont &optional sign) 294(defun mml1991-encrypt (cont &optional sign)
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/gnus/nnweb.el b/lisp/gnus/nnweb.el
index 134b62e97b9..a67d5a469f6 100644
--- a/lisp/gnus/nnweb.el
+++ b/lisp/gnus/nnweb.el
@@ -307,8 +307,8 @@ Valid types include `google', `dejanews', and `gmane'.")
307(defun nnweb-google-wash-article () 307(defun nnweb-google-wash-article ()
308 ;; We have Google's masked e-mail addresses here. :-/ 308 ;; We have Google's masked e-mail addresses here. :-/
309 (let ((case-fold-search t) 309 (let ((case-fold-search t)
310 (start-re "<pre>\n *") 310 (start-re "<pre>[\r\n ]*")
311 (end-re "\n *</pre>")) 311 (end-re "[\r\n ]*</pre>"))
312 (goto-char (point-min)) 312 (goto-char (point-min))
313 (if (save-excursion 313 (if (save-excursion
314 (or (re-search-forward "The requested message.*could not be found." 314 (or (re-search-forward "The requested message.*could not be found."
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index d30fc02c409..2b75e7fd053 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -630,6 +630,7 @@ it is displayed along with the global value."
630 (indirect-variable variable) 630 (indirect-variable variable)
631 (error variable))) 631 (error variable)))
632 (obsolete (get variable 'byte-obsolete-variable)) 632 (obsolete (get variable 'byte-obsolete-variable))
633 (safe-var (get variable 'safe-local-variable))
633 (doc (or (documentation-property variable 'variable-documentation) 634 (doc (or (documentation-property variable 'variable-documentation)
634 (documentation-property alias 'variable-documentation)))) 635 (documentation-property alias 'variable-documentation))))
635 (unless (eq alias variable) 636 (unless (eq alias variable)
@@ -641,6 +642,11 @@ it is displayed along with the global value."
641 (princ (if (stringp (car obsolete)) (car obsolete) 642 (princ (if (stringp (car obsolete)) (car obsolete)
642 (format "use `%s' instead." (car obsolete)))) 643 (format "use `%s' instead." (car obsolete))))
643 (terpri)) 644 (terpri))
645 (when safe-var
646 (princ "This variable is safe to use as a file local variable")
647 (princ (format " only if its value\nsatisfies the predicate `%s'.\n"
648 safe-var))
649 (terpri))
644 (princ "Documentation:\n") 650 (princ "Documentation:\n")
645 (princ (or doc "Not documented as a variable."))) 651 (princ (or doc "Not documented as a variable.")))
646 ;; Make a link to customize if this variable can be customized. 652 ;; 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/image.el b/lisp/image.el
index 2212b0fb471..b388396ded7 100644
--- a/lisp/image.el
+++ b/lisp/image.el
@@ -280,27 +280,14 @@ be determined."
280 280
281 281
282;;;###autoload 282;;;###autoload
283(defun image-type-available-p (type) 283(defun image-type (file-or-data &optional type data-p)
284 "Return non-nil if image type TYPE is available. 284 "Determine and return image type.
285Image types are symbols like `xbm' or `jpeg'."
286 (and (fboundp 'init-image-library)
287 (init-image-library type image-library-alist)))
288
289
290;;;###autoload
291(defun create-image (file-or-data &optional type data-p &rest props)
292 "Create an image.
293FILE-OR-DATA is an image file name or image data. 285FILE-OR-DATA is an image file name or image data.
294Optional TYPE is a symbol describing the image type. If TYPE is omitted 286Optional TYPE is a symbol describing the image type. If TYPE is omitted
295or nil, try to determine the image type from its first few bytes 287or nil, try to determine the image type from its first few bytes
296of image data. If that doesn't work, and FILE-OR-DATA is a file name, 288of image data. If that doesn't work, and FILE-OR-DATA is a file name,
297use its file extension as image type. 289use its file extension as image type.
298Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data. 290Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data."
299Optional PROPS are additional image attributes to assign to the image,
300like, e.g. `:mask MASK'.
301Value is the image created, or nil if images of type TYPE are not supported.
302
303Images should not be larger than specified by `max-image-size'."
304 (when (and (not data-p) (not (stringp file-or-data))) 291 (when (and (not data-p) (not (stringp file-or-data)))
305 (error "Invalid image file name `%s'" file-or-data)) 292 (error "Invalid image file name `%s'" file-or-data))
306 (cond ((null data-p) 293 (cond ((null data-p)
@@ -319,6 +306,31 @@ Images should not be larger than specified by `max-image-size'."
319 (error "Cannot determine image type")) 306 (error "Cannot determine image type"))
320 (unless (symbolp type) 307 (unless (symbolp type)
321 (error "Invalid image type `%s'" type)) 308 (error "Invalid image type `%s'" type))
309 type)
310
311;;;###autoload
312(defun image-type-available-p (type)
313 "Return non-nil if image type TYPE is available.
314Image types are symbols like `xbm' or `jpeg'."
315 (and (fboundp 'init-image-library)
316 (init-image-library type image-library-alist)))
317
318
319;;;###autoload
320(defun create-image (file-or-data &optional type data-p &rest props)
321 "Create an image.
322FILE-OR-DATA is an image file name or image data.
323Optional TYPE is a symbol describing the image type. If TYPE is omitted
324or nil, try to determine the image type from its first few bytes
325of image data. If that doesn't work, and FILE-OR-DATA is a file name,
326use its file extension as image type.
327Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data.
328Optional PROPS are additional image attributes to assign to the image,
329like, e.g. `:mask MASK'.
330Value is the image created, or nil if images of type TYPE are not supported.
331
332Images should not be larger than specified by `max-image-size'."
333 (setq type (image-type file-or-data type data-p))
322 (when (image-type-available-p type) 334 (when (image-type-available-p type)
323 (append (list 'image :type type (if data-p :data :file) file-or-data) 335 (append (list 'image :type type (if data-p :data :file) file-or-data)
324 props))) 336 props)))
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 3a6c53c3113..82c022075a4 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -1265,15 +1265,15 @@ or by the previous use of this command."
1265 "Specify coding system for keyboard input. 1265 "Specify coding system for keyboard input.
1266If you set this on a terminal which can't distinguish Meta keys from 1266If you set this on a terminal which can't distinguish Meta keys from
12678-bit characters, you will have to use ESC to type Meta characters. 12678-bit characters, you will have to use ESC to type Meta characters.
1268See Info node `Specify Coding' and Info node `Single-Byte Character Support'. 1268See Info node `Terminal Coding' and Info node `Unibyte Mode'.
1269 1269
1270On non-windowing terminals, this is set from the locale by default. 1270On non-windowing terminals, this is set from the locale by default.
1271 1271
1272Setting this variable directly does not take effect; 1272Setting this variable directly does not take effect;
1273use either \\[customize] or \\[set-keyboard-coding-system]." 1273use either \\[customize] or \\[set-keyboard-coding-system]."
1274 :type '(coding-system :tag "Coding system") 1274 :type '(coding-system :tag "Coding system")
1275 :link '(info-link "(emacs)Specify Coding") 1275 :link '(info-link "(emacs)Terminal Coding")
1276 :link '(info-link "(emacs)Single-Byte Character Support") 1276 :link '(info-link "(emacs)Unibyte Mode")
1277 :set (lambda (symbol value) 1277 :set (lambda (symbol value)
1278 ;; Don't load encoded-kbd-mode unnecessarily. 1278 ;; Don't load encoded-kbd-mode unnecessarily.
1279 (if (or value (boundp 'encoded-kbd-mode)) 1279 (if (or value (boundp 'encoded-kbd-mode))
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 89ca1dc04aa..f7846394638 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,40 @@
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
72006-04-26 Eric Ding <ericding@alum.mit.edu>
8
9 * mh-e.el (mh-invisible-header-fields-internal): Add entry
10 "X-Provags-ID:"
11
122006-04-25 Bill Wohler <wohler@newt.com>
13
14 * mh-letter.el (mh-folder-expand-at-point): Fix folder completion.
15 Folders returned by mh-folder-completion-function no longer need
16 adornment (closes SF #1476270).
17
182006-04-21 Bill Wohler <wohler@newt.com>
19
20 * mh-e.el (Version, mh-version): Add +cvs to version.
21
222006-04-21 Bill Wohler <wohler@newt.com>
23
24 Release MH-E version 7.94.
25
26 * mh-e.el (Version, mh-version): Update for release 7.94.
27
282006-04-21 Bill Wohler <wohler@newt.com>
29
30 * mh-letter.el (mh-insert-letter): If a message number isn't
31 given, throw an error rather than using a potentially incorrect
32 message number (closes SF #1473729). In addition, use the cur
33 message if mh-sent-from-msg is nil (when sending a message, in
34 contrast to replying). Move conversion of int to string into
35 interactive stanza so body can assume variables are of proper
36 type.
37
12006-04-20 Bill Wohler <wohler@newt.com> 382006-04-20 Bill Wohler <wohler@newt.com>
2 39
3 * mh-tool-bar.el (image-load-path): Define to shush compiler. 40 * mh-tool-bar.el (image-load-path): Define to shush compiler.
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 9ae686d8950..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.93+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.93+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
@@ -2526,6 +2526,7 @@ of citations entirely, choose \"None\"."
2526 "X-Originating-IP:" ; Hotmail 2526 "X-Originating-IP:" ; Hotmail
2527 "X-Postfilter:" 2527 "X-Postfilter:"
2528 "X-Priority:" ; MS Outlook 2528 "X-Priority:" ; MS Outlook
2529 "X-Provags-ID:"
2529 "X-Qotd-" ; User added 2530 "X-Qotd-" ; User added
2530 "X-RM" 2531 "X-RM"
2531 "X-Received-Date:" 2532 "X-Received-Date:"
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el
index 9445b5ea41f..d037c09e2aa 100644
--- a/lisp/mh-e/mh-letter.el
+++ b/lisp/mh-e/mh-letter.el
@@ -393,24 +393,26 @@ message is not indented, and \"> \" is not inserted before each line.
393This command leaves the mark before the letter and point after it." 393This command leaves the mark before the letter and point after it."
394 (interactive 394 (interactive
395 (let* ((folder 395 (let* ((folder
396 (mh-prompt-for-folder "Message from" 396 (mh-prompt-for-folder "Message from" mh-sent-from-folder nil))
397 mh-sent-from-folder nil))
398 (default 397 (default
399 (if (and (equal folder mh-sent-from-folder) 398 (if (equal folder mh-sent-from-folder)
400 (numberp mh-sent-from-msg)) 399 (or mh-sent-from-msg (nth 0 (mh-translate-range folder "cur")))
401 mh-sent-from-msg
402 (nth 0 (mh-translate-range folder "cur")))) 400 (nth 0 (mh-translate-range folder "cur"))))
403 (message 401 (message
404 (read-string (concat "Message number" 402 (read-string (concat "Message number"
405 (or (and default 403 (or (and default
406 (format " (default %d): " default)) 404 (format " (default %d): " default))
407 ": "))))) 405 ": "))
406 nil nil
407 (if (numberp default)
408 (int-to-string default)
409 default))))
408 (list folder message current-prefix-arg))) 410 (list folder message current-prefix-arg)))
411 (if (equal message "")
412 (error "No message number given"))
409 (save-restriction 413 (save-restriction
410 (narrow-to-region (point) (point)) 414 (narrow-to-region (point) (point))
411 (let ((start (point-min))) 415 (let ((start (point-min)))
412 (if (and (equal message "") (numberp mh-sent-from-msg))
413 (setq message (int-to-string mh-sent-from-msg)))
414 (insert-file-contents 416 (insert-file-contents
415 (expand-file-name message (mh-expand-file-name folder))) 417 (expand-file-name message (mh-expand-file-name folder)))
416 (when (not verbatim) 418 (when (not verbatim)
@@ -864,15 +866,12 @@ downcasing the field name."
864 "Do folder name completion in Fcc header field." 866 "Do folder name completion in Fcc header field."
865 (let* ((end (point)) 867 (let* ((end (point))
866 (beg (mh-beginning-of-word)) 868 (beg (mh-beginning-of-word))
867 (folder (buffer-substring beg end)) 869 (folder (buffer-substring-no-properties beg end))
868 (leading-plus (and (> (length folder) 0) (equal (aref folder 0) ?+))) 870 (leading-plus (and (> (length folder) 0) (equal (aref folder 0) ?+)))
869 (last-slash (mh-search-from-end ?/ folder)) 871 (choices (mapcar (lambda (x) (list x))
870 (prefix (and last-slash (substring folder 0 last-slash)))
871 (choices (mapcar #'(lambda (x)
872 (list (cond (prefix (format "%s/%s" prefix x))
873 (leading-plus (format "+%s" x))
874 (t x))))
875 (mh-folder-completion-function folder nil t)))) 872 (mh-folder-completion-function folder nil t))))
873 (unless leading-plus
874 (setq folder (concat "+" folder)))
876 (mh-complete-word folder choices beg end))) 875 (mh-complete-word folder choices beg end)))
877 876
878;;;###mh-autoload 877;;;###mh-autoload
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 53703166e64..a0b328413b0 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -74,13 +74,13 @@
74 :group 'rcirc) 74 :group 'rcirc)
75 75
76(defcustom rcirc-default-user-full-name (if (string= (user-full-name) "") 76(defcustom rcirc-default-user-full-name (if (string= (user-full-name) "")
77 rcirc-user-name 77 rcirc-user-name
78 (user-full-name)) 78 (user-full-name))
79 "The full name sent to the server when connecting." 79 "The full name sent to the server when connecting."
80 :type 'string 80 :type 'string
81 :group 'rcirc) 81 :group 'rcirc)
82 82
83(defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#emacs")) 83(defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#rcirc"))
84 "Alist of channels to join at startup. 84 "Alist of channels to join at startup.
85Each element looks like (SERVER-REGEXP . CHANNEL-LIST)." 85Each element looks like (SERVER-REGEXP . CHANNEL-LIST)."
86 :type '(alist :key-type string :value-type (repeat string)) 86 :type '(alist :key-type string :value-type (repeat string))
@@ -206,6 +206,18 @@ When an ignored person renames, their nick is added to both lists.
206Nicks will be removed from the automatic list on follow-up renamings or 206Nicks will be removed from the automatic list on follow-up renamings or
207parts.") 207parts.")
208 208
209(defcustom rcirc-bright-nick-regexp nil
210 "Regexp matching nicks to be emphasized.
211See `rcirc-bright-nick' face."
212 :type 'regexp
213 :group 'rcirc)
214
215(defcustom rcirc-dim-nick-regexp nil
216 "Regexp matching nicks to be deemphasized.
217See `rcirc-dim-nick' face."
218 :type 'regexp
219 :group 'rcirc)
220
209(defcustom rcirc-print-hooks nil 221(defcustom rcirc-print-hooks nil
210 "Hook run after text is printed. 222 "Hook run after text is printed.
211Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT." 223Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT."
@@ -217,7 +229,7 @@ Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT."
217 :type 'boolean 229 :type 'boolean
218 :group 'rcirc) 230 :group 'rcirc)
219 231
220(defcustom rcirc-decode-coding-system 'undecided 232(defcustom rcirc-decode-coding-system 'utf-8
221 "Coding system used to decode incoming irc messages." 233 "Coding system used to decode incoming irc messages."
222 :type 'coding-system 234 :type 'coding-system
223 :group 'rcirc) 235 :group 'rcirc)
@@ -546,7 +558,7 @@ With no argument or nil as argument, use the current buffer."
546 (with-current-buffer rcirc-server-buffer 558 (with-current-buffer rcirc-server-buffer
547 (or rcirc-nick rcirc-default-nick)))) 559 (or rcirc-nick rcirc-default-nick))))
548 560
549(defvar rcirc-max-message-length 450 561(defvar rcirc-max-message-length 420
550 "Messages longer than this value will be split.") 562 "Messages longer than this value will be split.")
551 563
552(defun rcirc-send-message (process target message &optional noticep) 564(defun rcirc-send-message (process target message &optional noticep)
@@ -955,7 +967,8 @@ Create the buffer if it doesn't exist."
955 :global nil 967 :global nil
956 :group 'rcirc 968 :group 'rcirc
957 (make-local-variable 'rcirc-parent-buffer) 969 (make-local-variable 'rcirc-parent-buffer)
958 (put 'rcirc-parent-buffer 'permanent-local t)) 970 (put 'rcirc-parent-buffer 'permanent-local t)
971 (setq fill-column rcirc-max-message-length))
959 972
960(defun rcirc-multiline-minor-submit () 973(defun rcirc-multiline-minor-submit ()
961 "Send the text in buffer back to parent buffer." 974 "Send the text in buffer back to parent buffer."
@@ -1029,6 +1042,7 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
1029 (split-string (or (cdr (assoc response rcirc-response-formats)) 1042 (split-string (or (cdr (assoc response rcirc-response-formats))
1030 (cdr (assq t rcirc-response-formats))) 1043 (cdr (assq t rcirc-response-formats)))
1031 "%")) 1044 "%"))
1045 (sender (or sender ""))
1032 (result "") 1046 (result "")
1033 (face nil) 1047 (face nil)
1034 key face-key repl) 1048 key face-key repl)
@@ -1054,9 +1068,16 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
1054 (rcirc-facify nick 1068 (rcirc-facify nick
1055 (if (eq key ?n) 1069 (if (eq key ?n)
1056 face 1070 face
1057 (if (string= sender (rcirc-nick process)) 1071 (cond ((string= sender (rcirc-nick process))
1058 'rcirc-my-nick 1072 'rcirc-my-nick)
1059 'rcirc-other-nick))))) 1073 ((and rcirc-bright-nick-regexp
1074 (string-match rcirc-bright-nick-regexp sender))
1075 'rcirc-bright-nick)
1076 ((and rcirc-dim-nick-regexp
1077 (string-match rcirc-dim-nick-regexp sender))
1078 'rcirc-dim-nick)
1079 (t
1080 'rcirc-other-nick))))))
1060 ((eq key ?T) 1081 ((eq key ?T)
1061 ;; %T -- timestamp 1082 ;; %T -- timestamp
1062 (rcirc-facify 1083 (rcirc-facify
@@ -1130,8 +1151,9 @@ record activity."
1130 (or text (setq text "")) 1151 (or text (setq text ""))
1131 (unless (or (member sender rcirc-ignore-list) 1152 (unless (or (member sender rcirc-ignore-list)
1132 (member (with-syntax-table rcirc-nick-syntax-table 1153 (member (with-syntax-table rcirc-nick-syntax-table
1133 (when (string-match "^\\([^/]\\w*\\)\\b" text) 1154 (when (string-match "^\\([^/]\\w*\\)[:,]" text)
1134 (match-string 1 text))) rcirc-ignore-list)) 1155 (match-string 1 text)))
1156 rcirc-ignore-list))
1135 (let* ((buffer (rcirc-target-buffer process sender response target text)) 1157 (let* ((buffer (rcirc-target-buffer process sender response target text))
1136 (inhibit-read-only t)) 1158 (inhibit-read-only t))
1137 (with-current-buffer buffer 1159 (with-current-buffer buffer
@@ -1222,10 +1244,12 @@ record activity."
1222 (regexp-quote (rcirc-nick process)) 1244 (regexp-quote (rcirc-nick process))
1223 "\\b") 1245 "\\b")
1224 text))) 1246 text)))
1225 (when (or (not rcirc-ignore-buffer-activity-flag) 1247 (when (if rcirc-ignore-buffer-activity-flag
1226 ;; always notice when our nick is mentioned, even 1248 ;; - Always notice when our nick is mentioned
1227 ;; if ignoring channel activity 1249 nick-match
1228 nick-match) 1250 ;; - Never bother us if a dim-nick spoke
1251 (not (and rcirc-dim-nick-regexp sender
1252 (string-match rcirc-dim-nick-regexp sender))))
1229 (rcirc-record-activity 1253 (rcirc-record-activity
1230 (current-buffer) 1254 (current-buffer)
1231 (when (or nick-match (and (not (rcirc-channel-p rcirc-target)) 1255 (when (or nick-match (and (not (rcirc-channel-p rcirc-target))
@@ -1375,7 +1399,7 @@ if NICK is also on `rcirc-ignore-list-automatic'."
1375 (force-mode-line-update)) 1399 (force-mode-line-update))
1376 1400
1377(defun rcirc-toggle-low-priority () 1401(defun rcirc-toggle-low-priority ()
1378 "Toggle the value of `rcirc-ignore-buffer-activity-flag'." 1402 "Toggle the value of `rcirc-low-priority-flag'."
1379 (interactive) 1403 (interactive)
1380 (setq rcirc-low-priority-flag 1404 (setq rcirc-low-priority-flag
1381 (not rcirc-low-priority-flag)) 1405 (not rcirc-low-priority-flag))
@@ -1788,7 +1812,7 @@ ones added to the list automatically are marked with an asterisk."
1788 1812
1789(defun rcirc-browse-url (&optional arg) 1813(defun rcirc-browse-url (&optional arg)
1790 "Prompt for URL to browse based on URLs in buffer." 1814 "Prompt for URL to browse based on URLs in buffer."
1791 (interactive) 1815 (interactive "P")
1792 (let ((completions (mapcar (lambda (x) (cons x nil)) rcirc-urls)) 1816 (let ((completions (mapcar (lambda (x) (cons x nil)) rcirc-urls))
1793 (initial-input (car rcirc-urls)) 1817 (initial-input (car rcirc-urls))
1794 (history (cdr rcirc-urls))) 1818 (history (cdr rcirc-urls)))
@@ -1910,7 +1934,7 @@ FUNCTION takes 3 arguments, MATCH-START, MATCH-END, and STRING."
1910 (cond ((rcirc-channel-p target) 1934 (cond ((rcirc-channel-p target)
1911 target) 1935 target)
1912 ;;; -ChanServ- [#gnu] Welcome... 1936 ;;; -ChanServ- [#gnu] Welcome...
1913 ((string-match "^\\[\\(#[^ ]+\\)\\]" message) 1937 ((string-match "\\[\\(#[^\] ]+\\)\\]" message)
1914 (match-string 1 message)) 1938 (match-string 1 message))
1915 (sender 1939 (sender
1916 (if (string= sender (rcirc-server-name process)) 1940 (if (string= sender (rcirc-server-name process))
@@ -2211,6 +2235,25 @@ Passwords are stored in `rcirc-authinfo' (which see)."
2211 "The face used to highlight other messages." 2235 "The face used to highlight other messages."
2212 :group 'rcirc-faces) 2236 :group 'rcirc-faces)
2213 2237
2238(defface rcirc-bright-nick
2239 '((((class grayscale) (background light))
2240 (:foreground "LightGray" :weight bold :underline t))
2241 (((class grayscale) (background dark))
2242 (:foreground "Gray50" :weight bold :underline t))
2243 (((class color) (min-colors 88) (background light)) (:foreground "CadetBlue"))
2244 (((class color) (min-colors 88) (background dark)) (:foreground "Aquamarine"))
2245 (((class color) (min-colors 16) (background light)) (:foreground "CadetBlue"))
2246 (((class color) (min-colors 16) (background dark)) (:foreground "Aquamarine"))
2247 (((class color) (min-colors 8)) (:foreground "magenta"))
2248 (t (:weight bold :underline t)))
2249 "Face used for nicks matched by `rcirc-bright-nick-regexp'."
2250 :group 'rcirc-faces)
2251
2252(defface rcirc-dim-nick
2253 '((t :inherit default))
2254 "Face used for nicks matched by `rcirc-dim-nick-regexp'."
2255 :group 'rcirc-faces)
2256
2214(defface rcirc-server ; font-lock-comment-face 2257(defface rcirc-server ; font-lock-comment-face
2215 '((((class grayscale) (background light)) 2258 '((((class grayscale) (background light))
2216 (:foreground "DimGray" :weight bold :slant italic)) 2259 (:foreground "DimGray" :weight bold :slant italic))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 617e21ebfeb..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,31 +4316,43 @@ 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;;;###autoload 4329;;;###autoload
4341(put 'tramp-completion-file-name-handler 'safe-magic t) 4330(defsubst tramp-register-file-name-handlers ()
4331 "Add tramp file name handlers to `file-name-handler-alist'."
4332 (add-to-list 'file-name-handler-alist
4333 (cons tramp-file-name-regexp 'tramp-file-name-handler))
4334 (when partial-completion-mode
4335 (add-to-list 'file-name-handler-alist
4336 (cons tramp-completion-file-name-regexp
4337 'tramp-completion-file-name-handler))
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))))))
4342 4345
4343;; Register in file name handler alist 4346;; During autoload, it shall be checked whether
4344;;;###autoload 4347;; `partial-completion-mode' is active. Therefore registering will be
4345(add-to-list 'file-name-handler-alist 4348;; delayed.
4346 (cons tramp-file-name-regexp 'tramp-file-name-handler)) 4349;;;###autoload(add-hook
4347(add-to-list 'file-name-handler-alist 4350;;;###autoload 'after-init-hook
4348 (cons tramp-completion-file-name-regexp 4351;;;###autoload '(lambda () (tramp-register-file-name-handlers)))
4349 'tramp-completion-file-name-handler)) 4352(tramp-register-file-name-handlers)
4350 4353
4351;;;###autoload 4354;;;###autoload
4352(defun tramp-unload-file-name-handler-alist () 4355(defun tramp-unload-file-name-handlers ()
4353 (setq file-name-handler-alist 4356 (setq file-name-handler-alist
4354 (delete (rassoc 'tramp-file-name-handler 4357 (delete (rassoc 'tramp-file-name-handler
4355 file-name-handler-alist) 4358 file-name-handler-alist)
@@ -4357,17 +4360,7 @@ Falls back to normal file name handler if no tramp file name handler exists."
4357 file-name-handler-alist) 4360 file-name-handler-alist)
4358 file-name-handler-alist)))) 4361 file-name-handler-alist))))
4359 4362
4360(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handler-alist) 4363(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers)
4361
4362(defun tramp-repair-jka-compr ()
4363 "If jka-compr is already loaded, move it to the front of
4364`file-name-handler-alist'. On Emacs 22 or so this will not be
4365necessary anymore."
4366 (let ((jka (rassoc 'jka-compr-handler file-name-handler-alist)))
4367 (when jka
4368 (setq file-name-handler-alist
4369 (cons jka (delete jka file-name-handler-alist))))))
4370(tramp-repair-jka-compr)
4371 4364
4372 4365
4373;;; Interactions with other packages: 4366;;; Interactions with other packages:
@@ -4482,31 +4475,10 @@ necessary anymore."
4482 last-input-event) ?\ )))))) 4475 last-input-event) ?\ ))))))
4483 t))) 4476 t)))
4484 4477
4485(defun tramp-completion-handle-file-exists-p (filename)
4486 "Like `file-exists-p' for tramp files."
4487 (if (tramp-completion-mode filename)
4488 (tramp-run-real-handler
4489 'file-exists-p (list filename))
4490 (tramp-completion-run-real-handler
4491 'file-exists-p (list filename))))
4492
4493;; Localname manipulation in case of partial TRAMP file names.
4494(defun tramp-completion-handle-file-name-directory (file)
4495 "Like `file-name-directory' but aware of TRAMP files."
4496 (if (tramp-completion-mode file)
4497 "/"
4498 (tramp-completion-run-real-handler
4499 'file-name-directory (list file))))
4500
4501;; Localname manipulation in case of partial TRAMP file names.
4502(defun tramp-completion-handle-file-name-nondirectory (file)
4503 "Like `file-name-nondirectory' but aware of TRAMP files."
4504 (substring
4505 file (length (tramp-completion-handle-file-name-directory file))))
4506
4507;; Method, host name and user name completion. 4478;; Method, host name and user name completion.
4508;; `tramp-completion-dissect-file-name' returns a list of 4479;; `tramp-completion-dissect-file-name' returns a list of
4509;; 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
4510(defun tramp-completion-handle-file-name-all-completions (filename directory) 4482(defun tramp-completion-handle-file-name-all-completions (filename directory)
4511 "Like `file-name-all-completions' for partial tramp files." 4483 "Like `file-name-all-completions' for partial tramp files."
4512 4484
@@ -4561,7 +4533,8 @@ necessary anymore."
4561 ;; unify list, remove nil elements 4533 ;; unify list, remove nil elements
4562 (while result 4534 (while result
4563 (let ((car (car result))) 4535 (let ((car (car result)))
4564 (when car (add-to-list 'result1 car)) 4536 (when car (add-to-list
4537 'result1 (substring car (length directory))))
4565 (setq result (cdr result)))) 4538 (setq result (cdr result))))
4566 4539
4567 ;; Complete local parts 4540 ;; Complete local parts
@@ -4580,6 +4553,7 @@ necessary anymore."
4580 (setq tramp-completion-mode nil))) 4553 (setq tramp-completion-mode nil)))
4581 4554
4582;; Method, host name and user name completion for a file. 4555;; Method, host name and user name completion for a file.
4556;;;###autoload
4583(defun tramp-completion-handle-file-name-completion (filename directory) 4557(defun tramp-completion-handle-file-name-completion (filename directory)
4584 "Like `file-name-completion' for tramp files." 4558 "Like `file-name-completion' for tramp files."
4585 (try-completion filename 4559 (try-completion filename
@@ -4706,8 +4680,7 @@ remote host and localname (filename on remote host)."
4706 (lambda (method) 4680 (lambda (method)
4707 (and method 4681 (and method
4708 (string-match (concat "^" (regexp-quote partial-method)) method) 4682 (string-match (concat "^" (regexp-quote partial-method)) method)
4709 ;; we must remove leading "/". 4683 (tramp-make-tramp-file-name nil method nil nil nil)))
4710 (substring (tramp-make-tramp-file-name nil method nil nil nil) 1)))
4711 (delete "multi" (mapcar 'car tramp-methods)))) 4684 (delete "multi" (mapcar 'car tramp-methods))))
4712 4685
4713;; Compares partial user and host names with possible completions. 4686;; Compares partial user and host names with possible completions.
@@ -4740,8 +4713,7 @@ PARTIAL-USER must match USER, PARTIAL-HOST must match HOST."
4740 host nil))) 4713 host nil)))
4741 4714
4742 (unless (zerop (+ (length user) (length host))) 4715 (unless (zerop (+ (length user) (length host)))
4743 ;; we must remove leading "/". 4716 (tramp-make-tramp-file-name nil method user host nil)))
4744 (substring (tramp-make-tramp-file-name nil method user host nil) 1)))
4745 4717
4746(defun tramp-parse-rhosts (filename) 4718(defun tramp-parse-rhosts (filename)
4747 "Return a list of (user host) tuples allowed to access. 4719 "Return a list of (user host) tuples allowed to access.
@@ -4960,15 +4932,6 @@ User may be nil."
4960 (forward-line 1) 4932 (forward-line 1)
4961 result)) 4933 result))
4962 4934
4963(defun tramp-completion-handle-expand-file-name (name &optional dir)
4964 "Like `expand-file-name' for tramp files."
4965 (let ((fullname (concat (or dir default-directory) name)))
4966 (if (tramp-completion-mode fullname)
4967 (tramp-run-real-handler
4968 'expand-file-name (list name dir))
4969 (tramp-completion-run-real-handler
4970 'expand-file-name (list name dir)))))
4971
4972;;; Internal Functions: 4935;;; Internal Functions:
4973 4936
4974(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)
@@ -7629,7 +7592,7 @@ Therefore, the contents of files might be included in the debug buffer(s).")
7629(defun tramp-unload-tramp () 7592(defun tramp-unload-tramp ()
7630 (interactive) 7593 (interactive)
7631 ;; When Tramp is not loaded yet, its autoloads are still active. 7594 ;; When Tramp is not loaded yet, its autoloads are still active.
7632 (tramp-unload-file-name-handler-alist) 7595 (tramp-unload-file-name-handlers)
7633 ;; ange-ftp settings must be enabled. 7596 ;; ange-ftp settings must be enabled.
7634 (when (functionp 'tramp-ftp-enable-ange-ftp) 7597 (when (functionp 'tramp-ftp-enable-ange-ftp)
7635 (funcall (symbol-function 'tramp-ftp-enable-ange-ftp))) 7598 (funcall (symbol-function 'tramp-ftp-enable-ange-ftp)))
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/antlr-mode.el b/lisp/progmodes/antlr-mode.el
index 7ddd9212f6c..e31a94030c3 100644
--- a/lisp/progmodes/antlr-mode.el
+++ b/lisp/progmodes/antlr-mode.el
@@ -829,7 +829,7 @@ in the grammar's actions and semantic predicates, see
829`antlr-font-lock-maximum-decoration'.") 829`antlr-font-lock-maximum-decoration'.")
830 830
831(defvar antlr-default-face 'antlr-default) 831(defvar antlr-default-face 'antlr-default)
832(defface antlr-default nil 832(defface antlr-default '((t nil))
833 "Face to prevent strings from language dependent highlighting. 833 "Face to prevent strings from language dependent highlighting.
834Do not change." 834Do not change."
835 :group 'antlr) 835 :group 'antlr)
diff --git a/lisp/progmodes/asm-mode.el b/lisp/progmodes/asm-mode.el
index b79237adba7..ebb532a3525 100644
--- a/lisp/progmodes/asm-mode.el
+++ b/lisp/progmodes/asm-mode.el
@@ -62,9 +62,9 @@
62 62
63(defvar asm-mode-syntax-table 63(defvar asm-mode-syntax-table
64 (let ((st (make-syntax-table))) 64 (let ((st (make-syntax-table)))
65 (modify-syntax-entry ?\n ">" st) 65 (modify-syntax-entry ?\n "> b" st)
66 (modify-syntax-entry ?/ ". 14b" st) 66 (modify-syntax-entry ?/ ". 124b" st)
67 (modify-syntax-entry ?* ". 23b" st) 67 (modify-syntax-entry ?* ". 23" st)
68 st) 68 st)
69 "Syntax table used while in Asm mode.") 69 "Syntax table used while in Asm mode.")
70 70
@@ -136,14 +136,14 @@ Special commands:
136 (use-local-map (nconc (make-sparse-keymap) asm-mode-map)) 136 (use-local-map (nconc (make-sparse-keymap) asm-mode-map))
137 (local-set-key (vector asm-comment-char) 'asm-comment) 137 (local-set-key (vector asm-comment-char) 'asm-comment)
138 (set-syntax-table (make-syntax-table asm-mode-syntax-table)) 138 (set-syntax-table (make-syntax-table asm-mode-syntax-table))
139 (modify-syntax-entry asm-comment-char "<") 139 (modify-syntax-entry asm-comment-char "< b")
140 140
141 (make-local-variable 'comment-start) 141 (make-local-variable 'comment-start)
142 (setq comment-start (string asm-comment-char)) 142 (setq comment-start (string asm-comment-char))
143 (make-local-variable 'comment-add) 143 (make-local-variable 'comment-add)
144 (setq comment-add 1) 144 (setq comment-add 1)
145 (make-local-variable 'comment-start-skip) 145 (make-local-variable 'comment-start-skip)
146 (setq comment-start-skip "\\(?:\\s<+\\|/\\*+\\)[ \t]*") 146 (setq comment-start-skip "\\(?:\\s<+\\|/[/*]+\\)[ \t]*")
147 (make-local-variable 'comment-end-skip) 147 (make-local-variable 'comment-end-skip)
148 (setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)") 148 (setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)")
149 (make-local-variable 'comment-end) 149 (make-local-variable 'comment-end)
diff --git a/lisp/progmodes/cc-subword.el b/lisp/progmodes/cc-subword.el
index 6ba76708ebf..72227e33290 100644
--- a/lisp/progmodes/cc-subword.el
+++ b/lisp/progmodes/cc-subword.el
@@ -91,8 +91,8 @@
91;; Don't complain about the `define-minor-mode' form if it isn't defined. 91;; Don't complain about the `define-minor-mode' form if it isn't defined.
92(cc-bytecomp-defvar c-subword-mode) 92(cc-bytecomp-defvar c-subword-mode)
93 93
94;;; Autoload directives must be on the top level, so we construct an 94;; Autoload directives must be on the top level, so we construct an
95;;; autoload form instead. 95;; autoload form instead.
96;;;###autoload (autoload 'c-subword-mode "cc-subword" "Mode enabling subword movement and editing keys." t) 96;;;###autoload (autoload 'c-subword-mode "cc-subword" "Mode enabling subword movement and editing keys." t)
97 97
98(if (not (fboundp 'define-minor-mode)) 98(if (not (fboundp 'define-minor-mode))
@@ -107,36 +107,19 @@ telling us which (X)Emacs version you're using."
107 107
108 (defvar c-subword-mode-map 108 (defvar c-subword-mode-map
109 (let ((map (make-sparse-keymap))) 109 (let ((map (make-sparse-keymap)))
110 (substitute-key-definition 'forward-word 110 (dolist (cmd '(forward-word backward-word mark-word
111 'c-forward-subword 111 kill-word backward-kill-word
112 map global-map) 112 transpose-words
113 (substitute-key-definition 'backward-word 113 capitalize-word upcase-word downcase-word))
114 'c-backward-subword 114 (let ((othercmd (let ((name (symbol-name cmd)))
115 map global-map) 115 (string-match "\\(.*-\\)\\(word.*\\)" name)
116 (substitute-key-definition 'mark-word 116 (intern (concat "c-"
117 'c-mark-subword 117 (match-string 1 name)
118 map global-map) 118 "sub"
119 119 (match-string 2 name))))))
120 (substitute-key-definition 'kill-word 120 (if (fboundp 'command-remapping)
121 'c-kill-subword 121 (define-key map (vector 'remap cmd) othercmd)
122 map global-map) 122 (substitute-key-definition cmd othercmd map global-map))))
123 (substitute-key-definition 'backward-kill-word
124 'c-backward-kill-subword
125 map global-map)
126
127 (substitute-key-definition 'transpose-words
128 'c-transpose-subwords
129 map global-map)
130
131 (substitute-key-definition 'capitalize-word
132 'c-capitalize-subword
133 map global-map)
134 (substitute-key-definition 'upcase-word
135 'c-upcase-subword
136 map global-map)
137 (substitute-key-definition 'downcase-word
138 'c-downcase-subword
139 map global-map)
140 map) 123 map)
141 "Keymap used in command `c-subword-mode' minor mode.") 124 "Keymap used in command `c-subword-mode' minor mode.")
142 125
@@ -308,5 +291,5 @@ Optional argument ARG is the same as for `upcase-word'."
308 291
309(cc-provide 'cc-subword) 292(cc-provide 'cc-subword)
310 293
311;;; arch-tag: 2be9d294-7f30-4626-95e6-9964bb93c7a3 294;; arch-tag: 2be9d294-7f30-4626-95e6-9964bb93c7a3
312;;; cc-subword.el ends here 295;;; cc-subword.el ends here
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 6afa3f29348..0aba9d42b84 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 (eval (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 e1e2b9e28cd..11259aa3965 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -83,6 +83,8 @@ Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb, and b
83(defvar gud-minor-mode nil) 83(defvar gud-minor-mode nil)
84(put 'gud-minor-mode 'permanent-local t) 84(put 'gud-minor-mode 'permanent-local t)
85 85
86(defvar gud-comint-buffer nil)
87
86(defvar gud-keep-buffer nil) 88(defvar gud-keep-buffer nil)
87 89
88(defun gud-symbol (sym &optional soft minor-mode) 90(defun gud-symbol (sym &optional soft minor-mode)
@@ -301,13 +303,15 @@ Uses `gud-<MINOR-MODE>-directories' to find the source files."
301optional doc string DOC. Certain %-escapes in the string arguments 303optional doc string DOC. Certain %-escapes in the string arguments
302are interpreted specially if present. These are: 304are interpreted specially if present. These are:
303 305
304 %f name (without directory) of current source file. 306 %f -- Name (without directory) of current source file.
305 %F name (without directory or extension) of current source file. 307 %F -- Name (without directory or extension) of current source file.
306 %d directory of current source file. 308 %d -- Directory of current source file.
307 %l number of current source line 309 %l -- Number of current source line.
308 %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.
309 %a text of the hexadecimal address surrounding point 311 %a -- Text of the hexadecimal address surrounding point.
310 %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).
311 315
312 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
313we'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
@@ -444,8 +448,7 @@ required by the caller."
444 (when (or gdb-force-update 448 (when (or gdb-force-update
445 (not (save-excursion 449 (not (save-excursion
446 (goto-char (point-min)) 450 (goto-char (point-min))
447 (let ((case-fold-search t)) 451 (looking-at "Watch Expressions:"))))
448 (looking-at "Watch Expressions:")))))
449 (erase-buffer) 452 (erase-buffer)
450 (insert "Watch Expressions:\n") 453 (insert "Watch Expressions:\n")
451 (if gdb-speedbar-auto-raise 454 (if gdb-speedbar-auto-raise
@@ -740,8 +743,6 @@ To run GDB in text command mode, set `gud-gdb-command-name' to
740;; The completion list is constructed by the process filter. 743;; The completion list is constructed by the process filter.
741(defvar gud-gdb-fetched-lines) 744(defvar gud-gdb-fetched-lines)
742 745
743(defvar gud-comint-buffer nil)
744
745(defun gud-gdb-complete-command (&optional command a b) 746(defun gud-gdb-complete-command (&optional command a b)
746 "Perform completion on the GDB command preceding point. 747 "Perform completion on the GDB command preceding point.
747This is implemented using the GDB `complete' command which isn't 748This is implemented using the GDB `complete' command which isn't
@@ -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
@@ -2889,8 +2892,11 @@ Obeying it means displaying in another window the specified file and line."
2889 (set-buffer gud-comint-buffer) 2892 (set-buffer gud-comint-buffer)
2890 (save-restriction 2893 (save-restriction
2891 (widen) 2894 (widen)
2892 (goto-char (process-mark proc)) 2895 (if (marker-position gud-delete-prompt-marker)
2893 (forward-line 0) 2896 ;; We get here when printing an expression.
2897 (goto-char gud-delete-prompt-marker)
2898 (goto-char (process-mark proc))
2899 (forward-line 0))
2894 (if (looking-at comint-prompt-regexp) 2900 (if (looking-at comint-prompt-regexp)
2895 (set-marker gud-delete-prompt-marker (point))) 2901 (set-marker gud-delete-prompt-marker (point)))
2896 (if (memq gud-minor-mode '(gdbmi gdba)) 2902 (if (memq gud-minor-mode '(gdbmi gdba))
@@ -2911,7 +2917,21 @@ Obeying it means displaying in another window the specified file and line."
2911(defvar gud-find-expr-function 'gud-find-c-expr) 2917(defvar gud-find-expr-function 'gud-find-c-expr)
2912 2918
2913(defun gud-find-expr (&rest args) 2919(defun gud-find-expr (&rest args)
2914 (apply gud-find-expr-function args)) 2920 (let ((expr (if (and transient-mark-mode mark-active)
2921 (buffer-substring (region-beginning) (region-end))
2922 (apply gud-find-expr-function args))))
2923 (save-match-data
2924 (if (string-match "\n" expr)
2925 (error "Expression must not include a newline"))
2926 (with-current-buffer gud-comint-buffer
2927 (save-excursion
2928 (goto-char (process-mark (get-buffer-process gud-comint-buffer)))
2929 (forward-line 0)
2930 (when (looking-at comint-prompt-regexp)
2931 (set-marker gud-delete-prompt-marker (point))
2932 (set-marker-insertion-type gud-delete-prompt-marker t))
2933 (insert (concat expr " = ")))))
2934 expr))
2915 2935
2916;; The next eight functions are hacked from gdbsrc.el by 2936;; The next eight functions are hacked from gdbsrc.el by
2917;; Debby Ayers <ayers@asc.slb.com>, 2937;; Debby Ayers <ayers@asc.slb.com>,
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 5e645535a23..9636f7eaeae 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -292,9 +292,9 @@ The criteria are that the previous line ends in a backslash outside
292comments and strings, or that the bracket/paren nesting depth is nonzero." 292comments and strings, or that the bracket/paren nesting depth is nonzero."
293 (or (and (eq ?\\ (char-before (line-end-position 0))) 293 (or (and (eq ?\\ (char-before (line-end-position 0)))
294 (not (syntax-ppss-context (syntax-ppss)))) 294 (not (syntax-ppss-context (syntax-ppss))))
295 (/= 0 (syntax-ppss-depth 295 (< 0 (syntax-ppss-depth
296 (save-excursion ; syntax-ppss with arg changes point 296 (save-excursion ; syntax-ppss with arg changes point
297 (syntax-ppss (line-beginning-position))))))) 297 (syntax-ppss (line-beginning-position)))))))
298 298
299(defun python-comment-line-p () 299(defun python-comment-line-p ()
300 "Return non-nil iff current line has only a comment." 300 "Return non-nil iff current line has only a comment."
@@ -719,7 +719,10 @@ expressions."
719 (python-beginning-of-string) 719 (python-beginning-of-string)
720 ;; Skip forward out of nested brackets. 720 ;; Skip forward out of nested brackets.
721 (condition-case () ; beware invalid syntax 721 (condition-case () ; beware invalid syntax
722 (progn (backward-up-list (syntax-ppss-depth (syntax-ppss))) t) 722 (let ((depth (syntax-ppss-depth (syntax-ppss))))
723 ;; Beware negative depths.
724 (if (> depth 0) (backward-up-list depth))
725 t)
723 (error (throw 'foo nil)))))) 726 (error (throw 'foo nil))))))
724 (back-to-indentation)) 727 (back-to-indentation))
725 728
@@ -1755,7 +1758,6 @@ lines count as headers.
1755 (if (featurep 'hippie-exp) 1758 (if (featurep 'hippie-exp)
1756 (set (make-local-variable 'hippie-expand-try-functions-list) 1759 (set (make-local-variable 'hippie-expand-try-functions-list)
1757 (cons 'python-try-complete hippie-expand-try-functions-list))) 1760 (cons 'python-try-complete hippie-expand-try-functions-list)))
1758 (unless font-lock-mode (font-lock-mode 1))
1759 (when python-guess-indent (python-guess-indent)) 1761 (when python-guess-indent (python-guess-indent))
1760 (set (make-local-variable 'python-command) python-python-command) 1762 (set (make-local-variable 'python-command) python-python-command)
1761 (unless (boundp 'python-mode-running) ; kill the recursion from jython-mode 1763 (unless (boundp 'python-mode-running) ; kill the recursion from jython-mode
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 36b2d8b8f21..6b571aaba3f 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1709,7 +1709,7 @@ This variable only matters if `undo-ask-before-discard' is non-nil.")
1709 ;; but we don't want to ask the question again. 1709 ;; but we don't want to ask the question again.
1710 (setq undo-extra-outer-limit (+ size 50000)) 1710 (setq undo-extra-outer-limit (+ size 50000))
1711 (if (let (use-dialog-box track-mouse executing-kbd-macro ) 1711 (if (let (use-dialog-box track-mouse executing-kbd-macro )
1712 (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? " 1712 (yes-or-no-p (format "Buffer `%s' undo info is %d bytes long; discard it? "
1713 (buffer-name) size))) 1713 (buffer-name) size)))
1714 (progn (setq buffer-undo-list nil) 1714 (progn (setq buffer-undo-list nil)
1715 (setq undo-extra-outer-limit nil) 1715 (setq undo-extra-outer-limit nil)
@@ -1717,7 +1717,7 @@ This variable only matters if `undo-ask-before-discard' is non-nil.")
1717 nil)) 1717 nil))
1718 (display-warning '(undo discard-info) 1718 (display-warning '(undo discard-info)
1719 (concat 1719 (concat
1720 (format "Buffer %s undo info was %d bytes long.\n" 1720 (format "Buffer `%s' undo info was %d bytes long.\n"
1721 (buffer-name) size) 1721 (buffer-name) size)
1722 "The undo info was discarded because it exceeded \ 1722 "The undo info was discarded because it exceeded \
1723`undo-outer-limit'. 1723`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 c28fc728145..66676c302b9 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1620,6 +1620,15 @@ normal otherwise."
1620 (when init-file-had-error 1620 (when init-file-had-error
1621 (sit-for 2)) 1621 (sit-for 2))
1622 1622
1623 (when (and pure-space-overflow
1624 (not noninteractive))
1625 (display-warning
1626 'initialization
1627 "Building Emacs overflowed pure space."
1628 ;; FIXME: Tell the user what kind of problems are possible and how to fix
1629 ;; the overflow.
1630 :warning))
1631
1623 (when command-line-args-left 1632 (when command-line-args-left
1624 ;; We have command args; process them. 1633 ;; We have command args; process them.
1625 (let ((dir command-line-default-directory) 1634 (let ((dir command-line-default-directory)
diff --git a/lisp/subr.el b/lisp/subr.el
index 5e18eaa5992..5c0317d00c3 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -851,19 +851,23 @@ and `event-end' functions."
851 (nth 3 position)) 851 (nth 3 position))
852 852
853(defsubst posn-string (position) 853(defsubst posn-string (position)
854 "Return the string object of POSITION, or nil if a buffer position. 854 "Return the string object of POSITION.
855Value is a cons (STRING . STRING-POS), or nil if not a string.
855POSITION should be a list of the form returned by the `event-start' 856POSITION should be a list of the form returned by the `event-start'
856and `event-end' functions." 857and `event-end' functions."
857 (nth 4 position)) 858 (nth 4 position))
858 859
859(defsubst posn-image (position) 860(defsubst posn-image (position)
860 "Return the image object of POSITION, or nil if a not an image. 861 "Return the image object of POSITION.
862Value is an list (image ...), or nil if not an image.
861POSITION should be a list of the form returned by the `event-start' 863POSITION should be a list of the form returned by the `event-start'
862and `event-end' functions." 864and `event-end' functions."
863 (nth 7 position)) 865 (nth 7 position))
864 866
865(defsubst posn-object (position) 867(defsubst posn-object (position)
866 "Return the object (image or string) of POSITION. 868 "Return the object (image or string) of POSITION.
869Value is a list (image ...) for an image object, a cons cell
870\(STRING . STRING-POS) for a string object, and nil for a buffer position.
867POSITION should be a list of the form returned by the `event-start' 871POSITION should be a list of the form returned by the `event-start'
868and `event-end' functions." 872and `event-end' functions."
869 (or (posn-image position) (posn-string position))) 873 (or (posn-image position) (posn-string position)))
@@ -1258,25 +1262,25 @@ If TOGGLE has a `:menu-tag', that is used for the menu item's label."
1258 1262
1259;;; Load history 1263;;; Load history
1260 1264
1261;;; (defvar symbol-file-load-history-loaded nil 1265;; (defvar symbol-file-load-history-loaded nil
1262;;; "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'.
1263;;; That file records the part of `load-history' for preloaded files, 1267;; That file records the part of `load-history' for preloaded files,
1264;;; which is cleared out before dumping to make Emacs smaller.") 1268;; which is cleared out before dumping to make Emacs smaller.")
1265 1269
1266;;; (defun load-symbol-file-load-history () 1270;; (defun load-symbol-file-load-history ()
1267;;; "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.
1268;;; That file records the part of `load-history' for preloaded files, 1272;; That file records the part of `load-history' for preloaded files,
1269;;; which is cleared out before dumping to make Emacs smaller." 1273;; which is cleared out before dumping to make Emacs smaller."
1270;;; (unless symbol-file-load-history-loaded 1274;; (unless symbol-file-load-history-loaded
1271;;; (load (expand-file-name 1275;; (load (expand-file-name
1272;;; ;; fns-XX.YY.ZZ.el does not work on DOS filesystem. 1276;; ;; fns-XX.YY.ZZ.el does not work on DOS filesystem.
1273;;; (if (eq system-type 'ms-dos) 1277;; (if (eq system-type 'ms-dos)
1274;;; "fns.el" 1278;; "fns.el"
1275;;; (format "fns-%s.el" emacs-version)) 1279;; (format "fns-%s.el" emacs-version))
1276;;; exec-directory) 1280;; exec-directory)
1277;;; ;; The file name fns-%s.el already has a .el extension. 1281;; ;; The file name fns-%s.el already has a .el extension.
1278;;; nil nil t) 1282;; nil nil t)
1279;;; (setq symbol-file-load-history-loaded t))) 1283;; (setq symbol-file-load-history-loaded t)))
1280 1284
1281(defun symbol-file (symbol &optional type) 1285(defun symbol-file (symbol &optional type)
1282 "Return the input source in which SYMBOL was defined. 1286 "Return the input source in which SYMBOL was defined.
@@ -1923,6 +1927,10 @@ a system-dependent default device name is used."
1923Otherwise, return nil." 1927Otherwise, return nil."
1924 (or (stringp object) (null object))) 1928 (or (stringp object) (null object)))
1925 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
1926 1934
1927;;;; Support for yanking and text properties. 1935;;;; Support for yanking and text properties.
1928 1936
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index c5c5bc5ef03..fa8934aec9e 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"))
@@ -1911,9 +1911,10 @@ Switch to a buffer editing the last file dropped."
1911 (dolist (file-name (nth 2 event)) 1911 (dolist (file-name (nth 2 event))
1912 (dnd-handle-one-url window 'private 1912 (dnd-handle-one-url window 'private
1913 (concat "file:" file-name)))) 1913 (concat "file:" file-name))))
1914 (raise-frame)) 1914 (select-frame-set-input-focus (selected-frame)))
1915 1915
1916(global-set-key [drag-n-drop] 'mac-drag-n-drop) 1916(global-set-key [drag-n-drop] 'mac-drag-n-drop)
1917(global-set-key [M-drag-n-drop] 'mac-drag-n-drop)
1917 1918
1918;;;; Non-toolkit Scroll bars 1919;;;; Non-toolkit Scroll bars
1919 1920
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index ff1c1e48eb0..e4f0a3db545 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -103,6 +103,7 @@ CROSSREF-OPTIONAL lists in `bibtex-entry-field-alist' (which see)."
103 (choice :tag "Init" :value "" 103 (choice :tag "Init" :value ""
104 string 104 string
105 function)))))) 105 function))))))
106(put 'bibtex-user-optional-fields 'risky-local-variable t)
106 107
107(defcustom bibtex-entry-format 108(defcustom bibtex-entry-format
108 '(opts-or-alts required-fields numerical-fields) 109 '(opts-or-alts required-fields numerical-fields)
@@ -3303,7 +3304,7 @@ Otherwise, use `set-buffer'. DISPLAY is t when called interactively."
3303 (display (message "Key `%s' not found" key))) 3304 (display (message "Key `%s' not found" key)))
3304 found) 3305 found)
3305 3306
3306 (let* (case-fold-search 3307 (let* ((case-fold-search t)
3307 (pnt (save-excursion 3308 (pnt (save-excursion
3308 (goto-char (or start (point-min))) 3309 (goto-char (or start (point-min)))
3309 (if (re-search-forward (concat "^[ \t]*\\(" 3310 (if (re-search-forward (concat "^[ \t]*\\("
@@ -4330,11 +4331,12 @@ An error is signaled if point is outside key or BibTeX field."
4330 "\n") 4331 "\n")
4331 (goto-char endpos))) 4332 (goto-char endpos)))
4332 4333
4333(defun bibtex-url (&optional pos) 4334(defun bibtex-url (&optional pos no-browse)
4334 "Browse a URL for the BibTeX entry at point. 4335 "Browse a URL for the BibTeX entry at point.
4335Optional POS is the location of the BibTeX entry. 4336Optional POS is the location of the BibTeX entry.
4336The URL is generated using the schemes defined in `bibtex-generate-url-list' 4337The URL is generated using the schemes defined in `bibtex-generate-url-list'
4337\(see there\). Then the URL is passed to `browse-url'." 4338\(see there\). Then the URL is passed to `browse-url' unless NO-BROWSE is nil.
4339Return the URL or nil if none can be generated."
4338 (interactive) 4340 (interactive)
4339 (save-excursion 4341 (save-excursion
4340 (if pos (goto-char pos)) 4342 (if pos (goto-char pos))
@@ -4369,8 +4371,10 @@ The URL is generated using the schemes defined in `bibtex-generate-url-list'
4369 (error "Match failed: %s" field))) 4371 (error "Match failed: %s" field)))
4370 (if fmt (apply 'format fmt (nreverse obj)) 4372 (if fmt (apply 'format fmt (nreverse obj))
4371 (apply 'concat (nreverse obj))))) 4373 (apply 'concat (nreverse obj)))))
4372 (browse-url (message "%s" url)))) 4374 (if (interactive-p) (message "%s" url))
4373 (unless url (message "No URL known."))))) 4375 (unless no-browse (browse-url url))))
4376 (if (and (not url) (interactive-p)) (message "No URL known."))
4377 url)))
4374 4378
4375 4379
4376;; Make BibTeX a Feature 4380;; Make BibTeX a Feature
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 312c73a380b..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 t) 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/org.el b/lisp/textmodes/org.el
index 12359391f73..3c18eda2305 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <dominik at science dot uva dot nl> 5;; Author: Carsten Dominik <dominik at science dot uva dot nl>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ 7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
8;; Version: 4.25 8;; Version: 4.26
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -79,8 +79,11 @@
79;; excellent reference card made by Philip Rooke. This card can be found 79;; excellent reference card made by Philip Rooke. This card can be found
80;; in the etc/ directory of Emacs 22. 80;; in the etc/ directory of Emacs 22.
81;; 81;;
82;; Changes since version 4.00: 82;; Changes since version 4.10:
83;; --------------------------- 83;; ---------------------------
84;; Version 4.26
85;; - Bug fixes.
86;;
84;; Version 4.25 87;; Version 4.25
85;; - Revision of the font-lock faces section, with better tty support. 88;; - Revision of the font-lock faces section, with better tty support.
86;; - TODO keywords in Agenda buffer are fontified. 89;; - TODO keywords in Agenda buffer are fontified.
@@ -119,60 +122,6 @@
119;; `org-time-stamp-rounding-minutes'. 122;; `org-time-stamp-rounding-minutes'.
120;; - Bug fixes (there are *always* more bugs). 123;; - Bug fixes (there are *always* more bugs).
121;; 124;;
122;; Version 4.10
123;; - Bug fixes.
124;;
125;; Version 4.09
126;; - Bug fixes.
127;; - Small improvements to font-lock support.
128;; - MHE support finalized.
129;;
130;; Version 4.08
131;; - Bug fixes.
132;; - Improved MHE support
133;;
134;; Version 4.07
135;; - Bug fixes.
136;; - Leading stars in headlines can be hidden, so make the outline look
137;; cleaner.
138;; - Mouse-1 can be used to follow links.
139;;
140;; Version 4.06
141;; - HTML exporter treats targeted internal links.
142;; - Bug fixes.
143;;
144;; Version 4.05
145;; - Changes to internal link system (thanks to David Wainberg for ideas).
146;; - in-file links: [[Search String]] instead of <file:::Search String>
147;; - automatic links to "radio targets".
148;; - CamelCase not longer active by default, configure org-activate-camels
149;; if you want to turn it back on.
150;; - After following a link, `C-c &' jumps back to it.
151;; - MH-E link support (thanks to Thomas Baumann).
152;; - Special table lines are no longer exported.
153;; - Bug fixes and minor improvements.
154;;
155;; Version 4.04
156;; - Cleanup tags display in agenda.
157;; - Bug fixes.
158;;
159;; Version 4.03
160;; - Table alignment fixed for use with wide characters.
161;; - `C-c -' leaves cursor in current table line.
162;; - The current TAG can be incorporated into the agenda prefix.
163;; See option `org-agenda-prefix-format' for details.
164;;
165;; Version 4.02
166;; - Minor bug fixes and improvements around tag searches.
167;; - XEmacs compatibility fixes.
168;;
169;; Version 4.01
170;; - Tags can also be set remotely from agenda buffer.
171;; - Boolean logic for tag searches.
172;; - Additional agenda commands can be configured through the variable
173;; `org-agenda-custom-commands'.
174;; - Minor bug fixes.
175;;
176;;; Code: 125;;; Code:
177 126
178(eval-when-compile 127(eval-when-compile
@@ -188,7 +137,7 @@
188 137
189;;; Customization variables 138;;; Customization variables
190 139
191(defvar org-version "4.25" 140(defvar org-version "4.26"
192 "The version number of the file org.el.") 141 "The version number of the file org.el.")
193(defun org-version () 142(defun org-version ()
194 (interactive) 143 (interactive)
@@ -198,7 +147,7 @@
198;; of outline.el. 147;; of outline.el.
199(defconst org-noutline-p (featurep 'noutline) 148(defconst org-noutline-p (featurep 'noutline)
200 "Are we using the new outline mode?") 149 "Are we using the new outline mode?")
201(defconst org-xemacs-p (featurep 'xemacs)) ;; FIXME: used by external code? 150(defconst org-xemacs-p (featurep 'xemacs)) ; not used by org.el itself
202(defconst org-format-transports-properties-p 151(defconst org-format-transports-properties-p
203 (let ((x "a")) 152 (let ((x "a"))
204 (add-text-properties 0 1 '(test t) x) 153 (add-text-properties 0 1 '(test t) x)
@@ -2383,7 +2332,10 @@ This face is only used if `org-fontify-done-headline' is set."
2383(defvar orgtbl-mode) ; defined later in this file 2332(defvar orgtbl-mode) ; defined later in this file
2384;;; Define the mode 2333;;; Define the mode
2385 2334
2386(defvar org-mode-map (copy-keymap outline-mode-map) 2335(defvar org-mode-map
2336 (if (and (not (keymapp outline-mode-map)) (featurep 'allout))
2337 (error "Conflict with outdated version of allout.el. Load org.el before allout.el, or ugrade to newer allout, for example by switching to Emacs 22.")
2338 (copy-keymap outline-mode-map))
2387 "Keymap for Org-mode.") 2339 "Keymap for Org-mode.")
2388 2340
2389(defvar org-struct-menu) ; defined later in this file 2341(defvar org-struct-menu) ; defined later in this file
@@ -7448,9 +7400,8 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
7448 (org-add-props cmd nil 7400 (org-add-props cmd nil
7449 'face 'org-warning)))) 7401 'face 'org-warning))))
7450 (progn 7402 (progn
7451 (message "Executing %s..." cmd) 7403 (message "Executing %s" cmd)
7452 (shell-command cmd) 7404 (shell-command cmd))
7453 (message "Executing %s...done" cmd))
7454 (error "Abort")))) 7405 (error "Abort"))))
7455 7406
7456 (t 7407 (t
@@ -7904,8 +7855,7 @@ If the file does not exist, an error is thrown."
7904 (setq cmd 'emacs)))) 7855 (setq cmd 'emacs))))
7905 (cond 7856 (cond
7906 ((and (stringp cmd) (not (string-match "^\\s-*$" cmd))) 7857 ((and (stringp cmd) (not (string-match "^\\s-*$" cmd)))
7907; (setq cmd (format cmd (concat "\"" file "\""))) 7858 ;; Normalize use of quote, this can vary.
7908 ;; FIXME: normalize use of quotes
7909 (if (string-match "['\"]%s['\"]" cmd) 7859 (if (string-match "['\"]%s['\"]" cmd)
7910 (setq cmd (replace-match "'%s'" t t cmd))) 7860 (setq cmd (replace-match "'%s'" t t cmd)))
7911 (setq cmd (format cmd file)) 7861 (setq cmd (format cmd file))
@@ -8958,10 +8908,10 @@ Optional argument NEW may specify text to replace the current field content."
8958 e (not (= (match-beginning 2) (match-end 2)))) 8908 e (not (= (match-beginning 2) (match-end 2))))
8959 (setq f (format (if num " %%%ds %s" " %%-%ds %s") 8909 (setq f (format (if num " %%%ds %s" " %%-%ds %s")
8960 l (if e "|" (setq org-table-may-need-update t) "")) 8910 l (if e "|" (setq org-table-may-need-update t) ""))
8961 n (format f s t t)) 8911 n (format f s))
8962 (if new 8912 (if new
8963 (if (<= (length new) l) 8913 (if (<= (length new) l) ;; FIXME: length -> str-width?
8964 (setq n (format f new t t)) ;; FIXME: why t t????? 8914 (setq n (format f new t t)) ;; FIXME: t t?
8965 (setq n (concat new "|") org-table-may-need-update t))) 8915 (setq n (concat new "|") org-table-may-need-update t)))
8966 (or (equal n o) 8916 (or (equal n o)
8967 (let (org-table-may-need-update) 8917 (let (org-table-may-need-update)
@@ -12277,16 +12227,6 @@ stacked delimiters is N. Escaping delimiters is not possible."
12277 (setq string (replace-match (match-string 1 string) t t string)))) 12227 (setq string (replace-match (match-string 1 string) t t string))))
12278 string) 12228 string)
12279 12229
12280;(defun org-export-html-convert-emphasize (string)
12281; (let (c (s 0))
12282; (while (string-match "\\(\\W\\|^\\)\\([*/_]\\)\\(\\w+\\)\\2\\(\\W\\|$\\)" string s)
12283; (setq c (cdr (assoc (match-string 2 string)
12284; '(("*" . "b") ("/" . "i") ("_" . "u"))))
12285; s (+ (match-end 0) 3)
12286; string (replace-match
12287; (concat "\\1<" c ">\\3</" c ">\\4") t nil string)))
12288; string))
12289
12290(defun org-export-html-convert-emphasize (string) 12230(defun org-export-html-convert-emphasize (string)
12291 (while (string-match org-italic-re string) 12231 (while (string-match org-italic-re string)
12292 (setq string (replace-match "\\1<i>\\3</i>\\4" t nil string))) 12232 (setq string (replace-match "\\1<i>\\3</i>\\4" t nil string)))
@@ -12496,7 +12436,7 @@ The XOXO buffer is named *xoxo-<source buffer name>*"
12496 12436
12497 ;; Finish the buffer off and clean it up. 12437 ;; Finish the buffer off and clean it up.
12498 (switch-to-buffer-other-window out) 12438 (switch-to-buffer-other-window out)
12499 (indent-region (point-min) (point-max)) 12439 (indent-region (point-min) (point-max) nil)
12500 (save-buffer) 12440 (save-buffer)
12501 (goto-char (point-min)) 12441 (goto-char (point-min))
12502 ))) 12442 )))
@@ -12719,6 +12659,8 @@ a time), or the day by one (if it does not contain a time)."
12719(define-key org-mode-map [?\C-c ?\C-x (right)] 'org-shiftright) 12659(define-key org-mode-map [?\C-c ?\C-x (right)] 'org-shiftright)
12720 12660
12721;; All the other keys 12661;; All the other keys
12662
12663(define-key org-mode-map "\C-c\C-a" 'show-all) ; in case allout messed up.
12722(define-key org-mode-map "\C-c$" 'org-archive-subtree) 12664(define-key org-mode-map "\C-c$" 'org-archive-subtree)
12723(define-key org-mode-map "\C-c\C-j" 'org-goto) 12665(define-key org-mode-map "\C-c\C-j" 'org-goto)
12724(define-key org-mode-map "\C-c\C-t" 'org-todo) 12666(define-key org-mode-map "\C-c\C-t" 'org-todo)
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el
index 6693be4e0c9..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 t) 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 t) 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 t) 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 t) 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 t) 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 07b5d1ca178..f4334fbbd70 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -948,7 +948,7 @@ Instead of nil or t, this may also be a string of type letters indicating
948the label types for which it should be true." 948the label types for which it should be true."
949 :group 'reftex-referencing-labels 949 :group 'reftex-referencing-labels
950 :type `(choice :tag "\\vref is default macro" ,@reftex-tmp)) 950 :type `(choice :tag "\\vref is default macro" ,@reftex-tmp))
951;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable t) 951;;;###autoload(put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
952 952
953(defcustom reftex-fref-is-default nil 953(defcustom reftex-fref-is-default nil
954 "*Non-nil means, the fancyref macro \\fref is used as default. 954 "*Non-nil means, the fancyref macro \\fref is used as default.
@@ -959,7 +959,7 @@ Instead of nil or t, this may also be a string of type letters indicating
959the label types for which it should be true." 959the label types for which it should be true."
960 :group 'reftex-referencing-labels 960 :group 'reftex-referencing-labels
961 :type `(choice :tag "\\fref is default macro" ,@reftex-tmp)) 961 :type `(choice :tag "\\fref is default macro" ,@reftex-tmp))
962;;;###autoload(put 'reftex-fref-is-default 'safe-local-variable t) 962;;;###autoload(put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
963 963
964(defcustom reftex-level-indent 2 964(defcustom reftex-level-indent 2
965 "*Number of spaces to be used for indentation per section level." 965 "*Number of spaces to be used for indentation per section level."
@@ -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 t) 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/time-stamp.el b/lisp/time-stamp.el
index 2f6d860bd21..4a14a0197e8 100644
--- a/lisp/time-stamp.el
+++ b/lisp/time-stamp.el
@@ -164,7 +164,7 @@ Do not change `time-stamp-line-limit', `time-stamp-start',
164incompatible with other people's files! If you must change them for some 164incompatible with other people's files! If you must change them for some
165application, do so in the local variables section of the time-stamped file 165application, do so in the local variables section of the time-stamped file
166itself.") 166itself.")
167;;;###autoload(put 'time-stamp-start 'safe-local-variable t) 167;;;###autoload(put 'time-stamp-start 'safe-local-variable 'stringp)
168 168
169(defvar time-stamp-end "\\\\?[\">]" ;Do not change! 169(defvar time-stamp-end "\\\\?[\">]" ;Do not change!
170 "Regexp marking the text after the time stamp. 170 "Regexp marking the text after the time stamp.
@@ -184,7 +184,7 @@ Do not change `time-stamp-start', `time-stamp-end', `time-stamp-pattern',
184or `time-stamp-inserts-lines' for yourself or you will be incompatible 184or `time-stamp-inserts-lines' for yourself or you will be incompatible
185with other people's files! If you must change them for some application, 185with other people's files! If you must change them for some application,
186do so in the local variables section of the time-stamped file itself.") 186do so in the local variables section of the time-stamped file itself.")
187;;;###autoload(put 'time-stamp-end 'safe-local-variable t) 187;;;###autoload(put 'time-stamp-end 'safe-local-variable 'stringp)
188 188
189 189
190(defvar time-stamp-inserts-lines nil ;Do not change! 190(defvar time-stamp-inserts-lines nil ;Do not change!
@@ -201,7 +201,7 @@ Do not change `time-stamp-end' or `time-stamp-inserts-lines' for
201yourself or you will be incompatible with other people's files! 201yourself or you will be incompatible with other people's files!
202If you must change them for some application, do so in the local 202If you must change them for some application, do so in the local
203variables section of the time-stamped file itself.") 203variables section of the time-stamped file itself.")
204;;;###autoload(put 'time-stamp-inserts-lines 'safe-local-variable t) 204;;;###autoload(put 'time-stamp-inserts-lines 'safe-local-variable 'symbolp)
205 205
206 206
207(defvar time-stamp-count 1 ;Do not change! 207(defvar time-stamp-count 1 ;Do not change!
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 0a1d706a694..37d60441648 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -267,14 +267,20 @@ holds a keymap."
267 ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose") 267 ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
268 268
269 (tool-bar-add-item-from-menu 'print-buffer "print") 269 (tool-bar-add-item-from-menu 'print-buffer "print")
270 (tool-bar-add-item "preferences" 'customize 'customize 270
271 :help "Edit preferences (customize)") 271 ;; tool-bar-add-item-from-menu itself operates on
272 272 ;; (default-value 'tool-bar-map), but when we don't use that function,
273 (tool-bar-add-item "help" (lambda () 273 ;; we must explicitly operate on the default value.
274 (interactive) 274
275 (popup-menu menu-bar-help-menu)) 275 (let ((tool-bar-map (default-value 'tool-bar-map)))
276 'help 276 (tool-bar-add-item "preferences" 'customize 'customize
277 :help "Pop up the Help menu") 277 :help "Edit preferences (customize)")
278
279 (tool-bar-add-item "help" (lambda ()
280 (interactive)
281 (popup-menu menu-bar-help-menu))
282 'help
283 :help "Pop up the Help menu"))
278 ) 284 )
279 285
280(provide 'tool-bar) 286(provide 'tool-bar)
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 7d9e289e8e5..92bdf480e06 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,11 @@
12006-04-26 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * url-gw.el (url-open-stream): Don't hide errors.
4 (url-gateway-nslookup-host, url-open-telnet): Use with-current-buffer.
5
6 * url-handlers.el (url-insert): New function.
7 (url-insert-file-contents): Use it.
8
12006-03-29 Stefan Monnier <monnier@iro.umontreal.ca> 92006-03-29 Stefan Monnier <monnier@iro.umontreal.ca>
2 10
3 * url-handlers.el (url-handler-directory-file-name): New handler. 11 * url-handlers.el (url-handler-directory-file-name): New handler.
diff --git a/lisp/url/url-gw.el b/lisp/url/url-gw.el
index 0cd2e6f9a50..878259927eb 100644
--- a/lisp/url/url-gw.el
+++ b/lisp/url/url-gw.el
@@ -118,8 +118,7 @@ linked Emacs under SunOS 4.x"
118 url-gateway-nslookup-program host)) 118 url-gateway-nslookup-program host))
119 (res host)) 119 (res host))
120 (set-process-query-on-exit-flag proc nil) 120 (set-process-query-on-exit-flag proc nil)
121 (save-excursion 121 (with-current-buffer (process-buffer proc)
122 (set-buffer (process-buffer proc))
123 (while (memq (process-status proc) '(run open)) 122 (while (memq (process-status proc) '(run open))
124 (accept-process-output proc)) 123 (accept-process-output proc))
125 (goto-char (point-min)) 124 (goto-char (point-min))
@@ -168,8 +167,7 @@ linked Emacs under SunOS 4.x"
168(defun url-open-telnet (name buffer host service) 167(defun url-open-telnet (name buffer host service)
169 (if (not (stringp service)) 168 (if (not (stringp service))
170 (setq service (int-to-string service))) 169 (setq service (int-to-string service)))
171 (save-excursion 170 (with-current-buffer (get-buffer-create buffer)
172 (set-buffer (get-buffer-create buffer))
173 (erase-buffer) 171 (erase-buffer)
174 (let ((proc (start-process name buffer "telnet" "-8")) 172 (let ((proc (start-process name buffer "telnet" "-8"))
175 (case-fold-search t)) 173 (case-fold-search t))
@@ -261,11 +259,15 @@ Will not make a connection if `url-gateway-unplugged' is non-nil."
261 (otherwise 259 (otherwise
262 (error "Bad setting of url-gateway-method: %s" 260 (error "Bad setting of url-gateway-method: %s"
263 url-gateway-method))))) 261 url-gateway-method)))))
264 (error 262 ;; Ignoring errors here seems wrong. E.g. it'll throw away the
265 (setq conn nil))) 263 ;; error signalled two lines above. It was also found inconvenient
264 ;; during debugging.
265 ;; (error
266 ;; (setq conn nil))
267 )
266 conn))) 268 conn)))
267 269
268(provide 'url-gw) 270(provide 'url-gw)
269 271
270;;; arch-tag: 1c4c0317-6d03-45b8-b3f3-838bd8f9d838 272;; arch-tag: 1c4c0317-6d03-45b8-b3f3-838bd8f9d838
271;;; url-gw.el ends here 273;;; url-gw.el ends here
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el
index 00fc415659e..6c6d85a1e03 100644
--- a/lisp/url/url-handlers.el
+++ b/lisp/url/url-handlers.el
@@ -216,33 +216,47 @@ accessible."
216 (url-copy-file url filename) 216 (url-copy-file url filename)
217 filename)) 217 filename))
218 218
219(defun url-insert (buffer &optional beg end)
220 "Insert the body of a URL object.
221BUFFER should be a complete URL buffer as returned by `url-retrieve'.
222If the headers specify a coding-system, it is applied to the body before it is inserted.
223Returns a list of the form (SIZE CHARSET), where SIZE is the size in bytes
224of the inserted text and CHARSET is the charset that was specified in the header,
225or nil if none was found.
226BEG and END can be used to only insert a subpart of the body.
227They count bytes from the beginning of the body."
228 (let* ((handle (with-current-buffer buffer (mm-dissect-buffer t)))
229 (data (with-current-buffer (mm-handle-buffer handle)
230 (if beg
231 (buffer-substring (+ (point-min) beg)
232 (if end (+ (point-min) end) (point-max)))
233 (buffer-string))))
234 (charset (mail-content-type-get (mm-handle-type handle)
235 'charset)))
236 (mm-destroy-parts handle)
237 (if charset
238 (insert (mm-decode-string data (mm-charset-to-coding-system charset)))
239 (insert data))
240 (list (length data) charset)))
241
219;;;###autoload 242;;;###autoload
220(defun url-insert-file-contents (url &optional visit beg end replace) 243(defun url-insert-file-contents (url &optional visit beg end replace)
221 (let ((buffer (url-retrieve-synchronously url)) 244 (let ((buffer (url-retrieve-synchronously url)))
222 (handle nil)
223 (charset nil)
224 (data nil))
225 (if (not buffer) 245 (if (not buffer)
226 (error "Opening input file: No such file or directory, %s" url)) 246 (error "Opening input file: No such file or directory, %s" url))
227 (if visit (setq buffer-file-name url)) 247 (if visit (setq buffer-file-name url))
228 (with-current-buffer buffer
229 (setq handle (mm-dissect-buffer t))
230 (set-buffer (mm-handle-buffer handle))
231 (setq data (if beg (buffer-substring beg end)
232 (buffer-string))))
233 (kill-buffer buffer)
234 (mm-destroy-parts handle)
235 (if replace (delete-region (point-min) (point-max)))
236 (save-excursion 248 (save-excursion
237 (setq charset (mail-content-type-get (mm-handle-type handle) 249 (let* ((start (point))
238 'charset)) 250 (size-and-charset (url-insert buffer beg end)))
239 (let ((start (point))) 251 (kill-buffer buffer)
240 (if charset 252 (when replace
241 (insert (mm-decode-string data (mm-charset-to-coding-system charset))) 253 (delete-region (point-min) start)
242 (progn 254 (delete-region (point) (point-max)))
243 (insert data) 255 (unless (cadr size-and-charset)
244 (decode-coding-inserted-region start (point) url visit beg end replace))))) 256 ;; If the headers don't specify any particular charset, use the
245 (list url (length data)))) 257 ;; usual heuristic/rules that we apply to files.
258 (decode-coding-inserted-region start (point) url visit beg end replace))
259 (list url (car size-and-charset))))))
246 260
247(defun url-file-name-completion (url directory) 261(defun url-file-name-completion (url directory)
248 (error "Unimplemented")) 262 (error "Unimplemented"))
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 48205488ef8..020e667ec16 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,35 @@
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
292006-04-26 Richard Stallman <rms@gnu.org>
30
31 * syntax.texi (Parsing Expressions): Minor cleanup.
32
12006-04-18 Richard Stallman <rms@gnu.org> 332006-04-18 Richard Stallman <rms@gnu.org>
2 34
3 * tips.texi (Coding Conventions): Explain when the package's 35 * tips.texi (Coding Conventions): Explain when the package's
@@ -60,7 +92,7 @@
60 92
612006-03-25 Karl Berry <karl@gnu.org> 932006-03-25 Karl Berry <karl@gnu.org>
62 94
63 * elisp.texi: use @copyright{} instead of (C), and do not indent 95 * elisp.texi: Use @copyright{} instead of (C), and do not indent
64 the year list. 96 the year list.
65 97
662006-03-21 Nick Roberts <nickrob@snap.net.nz> 982006-03-21 Nick Roberts <nickrob@snap.net.nz>
@@ -94,7 +126,7 @@
94 126
95 * display.texi (Defining Images): Fix example in 127 * display.texi (Defining Images): Fix example in
96 image-load-path-for-library by not recommending that one binds 128 image-load-path-for-library by not recommending that one binds
97 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
98 it if previously defined. 130 it if previously defined.
99 131
1002006-03-14 Bill Wohler <wohler@newt.com> 1322006-03-14 Bill Wohler <wohler@newt.com>
@@ -566,11 +598,11 @@
566 598
5672005-09-26 Chong Yidong <cyd@stupidchicken.com> 5992005-09-26 Chong Yidong <cyd@stupidchicken.com>
568 600
569 * errors.texi (Standard Errors): Corrected xrefs. 601 * errors.texi (Standard Errors): Correct xrefs.
570 602
5712005-09-18 Chong Yidong <cyd@stupidchicken.com> 6032005-09-18 Chong Yidong <cyd@stupidchicken.com>
572 604
573 * display.texi (Defining Images): Updated documentation for 605 * display.texi (Defining Images): Update documentation for
574 `image-load-path'. 606 `image-load-path'.
575 607
5762005-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 b33424a58be..9e55ca847fc 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -2336,8 +2336,6 @@ Search-based fontification happens second.
2336* Font Lock Basics:: Overview of customizing Font Lock. 2336* Font Lock Basics:: Overview of customizing Font Lock.
2337* Search-based Fontification:: Fontification based on regexps. 2337* Search-based Fontification:: Fontification based on regexps.
2338* Customizing Keywords:: Customizing search-based fontification. 2338* Customizing Keywords:: Customizing search-based fontification.
2339* Region to Fontify:: Controlling which region gets refontified
2340 after a buffer change.
2341* Other Font Lock Variables:: Additional customization facilities. 2339* Other Font Lock Variables:: Additional customization facilities.
2342* Levels of Font Lock:: Each mode can define alternative levels 2340* Levels of Font Lock:: Each mode can define alternative levels
2343 so that the user can select more or less. 2341 so that the user can select more or less.
@@ -2347,6 +2345,8 @@ Search-based fontification happens second.
2347* Syntactic Font Lock:: Fontification based on syntax tables. 2345* Syntactic Font Lock:: Fontification based on syntax tables.
2348* Setting Syntax Properties:: Defining character syntax based on context 2346* Setting Syntax Properties:: Defining character syntax based on context
2349 using the Font Lock mechanism. 2347 using the Font Lock mechanism.
2348* Multiline Font Lock:: How to coerce Font Lock into properly
2349 highlighting multiline constructs.
2350@end menu 2350@end menu
2351 2351
2352@node Font Lock Basics 2352@node Font Lock Basics
@@ -2623,16 +2623,9 @@ this value of @code{font-lock-keywords} is used in a buffer.
2623Its value should have one of the forms described in this table. 2623Its value should have one of the forms described in this table.
2624@end table 2624@end table
2625 2625
2626@vindex font-lock-multiline
2627@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}
2628to match text which spans lines; this does not work reliably. While 2627to match text which spans lines; this does not work reliably.
2629@code{font-lock-fontify-buffer} handles multi-line patterns correctly, 2628For details, see @xref{Multiline Font Lock}.
2630updating when you edit the buffer does not, since it considers text one
2631line at a time. If you have patterns that typically only span one
2632line but can occasionally span two or three, such as
2633@samp{<title>...</title>}, you can ask Font Lock to be more careful by
2634setting @code{font-lock-multiline} to @code{t}. But it still will not
2635work in all cases.
2636 2629
2637You 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
2638the value of @code{font-lock-keywords-case-fold-search} which says 2631the value of @code{font-lock-keywords-case-fold-search} which says
@@ -2718,36 +2711,6 @@ C mode @emph{and} all modes derived from it, do this instead:
2718 font-lock-keyword-face))))) 2711 font-lock-keyword-face)))))
2719@end smallexample 2712@end smallexample
2720 2713
2721@node Region to Fontify
2722@subsection Region to Fontify after a Buffer Change
2723
2724 When a buffer is changed, the region that Font Lock refontifies is by
2725default the smallest sequence of whole lines that spans the change.
2726While this works well most of the time, sometimes it doesn't---for
2727example, when a buffer change has changed the syntactic meaning of text
2728on an earlier line.
2729
2730You can enlarge (or even reduce) the region to fontify by setting either
2731of the following variables:
2732
2733@defvar font-lock-extend-region-function
2734This buffer-local variable is either @code{nil} or is a function that
2735determines the region to fontify, which Emacs then calls after each
2736buffer change.
2737
2738The function is given three parameters, the standard @var{beg},
2739@var{end}, and @var{old-len} from after-change-functions (@pxref{Change
2740Hooks}). It should return either a cons of the beginning and end buffer
2741positions (in that order) of the region to fontify, or @code{nil} (which
2742directs the caller to fontify the default region). This function need
2743not preserve point or the match-data, but must preserve the current
2744restriction. The region it returns may start or end in the middle of a
2745line.
2746
2747Since this function is called after every buffer change, it should be
2748reasonably fast.
2749@end defvar
2750
2751@node Other Font Lock Variables 2714@node Other Font Lock Variables
2752@subsection Other Font Lock Variables 2715@subsection Other Font Lock Variables
2753 2716
@@ -2981,8 +2944,8 @@ value returns @code{font-lock-comment-face} for comments and
2981 2944
2982This can be used to highlighting different kinds of strings or 2945This can be used to highlighting different kinds of strings or
2983comments differently. It is also sometimes abused together with 2946comments differently. It is also sometimes abused together with
2984@code{font-lock-syntactic-keywords} to highlight elements that span 2947@code{font-lock-syntactic-keywords} to highlight constructs that span
2985multiple lines, but this is too obscure to document in this manual. 2948multiple lines, but this is too esoteric to document here.
2986 2949
2987Specify this variable using @var{other-vars} in 2950Specify this variable using @var{other-vars} in
2988@code{font-lock-defaults}. 2951@code{font-lock-defaults}.
@@ -3052,6 +3015,145 @@ Major modes normally set this variable with @var{other-vars} in
3052@code{font-lock-defaults}. 3015@code{font-lock-defaults}.
3053@end defvar 3016@end defvar
3054 3017
3018@node Multiline Font Lock
3019@subsection Multiline Font Lock Constructs
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
3051
3052 There are three ways to do rehighlighting of multiline constructs:
3053
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
3073
3074@menu
3075* Font Lock Multiline:: Marking multiline chunks with a text property
3076* Region to Fontify:: Controlling which region gets refontified
3077 after a buffer change.
3078@end menu
3079
3080@node Font Lock Multiline
3081@subsubsection Font Lock Multiline
3082
3083 One way to ensure reliable rehighlighting of multiline Font Lock
3084constructs is to put on the text property @code{font-lock-multiline}.
3085It should be present and non-@code{nil} for text that is part of a
3086multiline construct.
3087
3088 When Font Lock is about to highlight a range of text, it first
3089extends the boundaries of the range as necessary so that they do not
3090fall within text marked with the @code{font-lock-multiline} property.
3091Then it removes any @code{font-lock-multiline} properties from the
3092range, and highlights it. The highlighting specification (mostly
3093@code{font-lock-keywords}) must reinstall this property each time,
3094whenever it is appropriate.
3095
3096 @strong{Warning:} don't use the @code{font-lock-multiline} property
3097on large ranges of text, because that will make rehighlighting slow.
3098
3099@defvar font-lock-multiline
3100If the @code{font-lock-multiline} variable is set to @code{t}, Font
3101Lock will try to add the @code{font-lock-multiline} property
3102automatically on multiline constructs. This is not a universal
3103solution, however, since it slows down Font Lock somewhat. It can
3104miss some multiline constructs, or make the property larger or smaller
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.
3111@end defvar
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
3128@node Region to Fontify
3129@subsubsection Region to Fontify after a Buffer Change
3130
3131 When a buffer is changed, the region that Font Lock refontifies is
3132by default the smallest sequence of whole lines that spans the change.
3133While this works well most of the time, sometimes it doesn't---for
3134example, when a change alters the syntactic meaning of text on an
3135earlier line.
3136
3137 You can enlarge (or even reduce) the region to fontify by setting
3138one the following variables:
3139
3140@defvar font-lock-extend-region-function
3141This buffer-local variable is either @code{nil} or a function for
3142Font-Lock to call to determine the region to scan and fontify.
3143
3144The function is given three parameters, the standard @var{beg},
3145@var{end}, and @var{old-len} from after-change-functions
3146(@pxref{Change Hooks}). It should return either a cons of the
3147beginning and end buffer positions (in that order) of the region to
3148fontify, or @code{nil} (which means choose the region in the standard
3149way). This function needs to preserve point, the match-data, and the
3150current restriction. The region it returns may start or end in the
3151middle of a line.
3152
3153Since this function is called after every buffer change, it should be
3154reasonably fast.
3155@end defvar
3156
3055@node Desktop Save Mode 3157@node Desktop Save Mode
3056@section Desktop Save Mode 3158@section Desktop Save Mode
3057@cindex desktop save mode 3159@cindex desktop save mode
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/syntax.texi b/lispref/syntax.texi
index 7297f6b9104..1575ebeb850 100644
--- a/lispref/syntax.texi
+++ b/lispref/syntax.texi
@@ -672,7 +672,9 @@ the parse:
672 672
673@enumerate 0 673@enumerate 0
674@item 674@item
675The depth in parentheses, counting from 0. 675The depth in parentheses, counting from 0. @strong{Warning:} this can
676be negative if there are more close parens than open parens between
677the start of the defun and point.
676 678
677@item 679@item
678@cindex innermost containing parentheses 680@cindex innermost containing parentheses
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 100920e311a..bd48e3f4f20 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,80 @@
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
322006-04-26 Reiner Steib <Reiner.Steib@gmx.de>
33
34 * pgg.texi (Caching passphrase): Fix markup and typos. Simplify.
35
362006-04-26 Sascha Wilde <wilde@sha-bang.de>
37
38 * pgg.texi (Caching passphrase): Add pgg-gpg-use-agent.
39
402006-04-24 Bill Wohler <wohler@newt.com>
41
42 * mh-e.texi (Getting Started): Make it more explicit that you need
43 to install MH. Add pointers to current MH implementations.
44
452006-04-23 Richard Stallman <rms@gnu.org>
46
47 * emacs.texi [TeX]: Use xresmini.texi instead of xresources.texi.
48
49 * xresmini.texi: New file.
50
51 * xresources.texi (Face Resources): Split table into font resources
52 and the rest. Combine similar attributes for brevity.
53
542006-04-21 Bill Wohler <wohler@newt.com>
55
56 Release MH-E manual version 7.94.
57
58 * mh-e.texi (VERSION, EDITION, UPDATED, UPDATE-MONTH): Update for
59 release 7.94.
60
612006-04-21 Carsten Dominik <dominik@science.uva.nl>
62
63 * org.texi: Many small fixes.
64 (Handling links): Rename from "Managing links".
65
662006-04-21 Eli Zaretskii <eliz@gnu.org>
67
68 * emacs-xtra.texi (MS-DOS File Names): Remove section about
69 backslashes and case-insensitivity in file names (moved to the
70 main manual).
71 (MS-DOS Printing): Move most of the text to the main manual.
72
73 * msdog.texi (Windows Files, Windows HOME, MS-Windows Printing):
74 New nodes.
75 (Windows Processes, Windows System Menu): Add index entries and
76 fix wording.
77
12006-04-20 Reiner Steib <Reiner.Steib@gmx.de> 782006-04-20 Reiner Steib <Reiner.Steib@gmx.de>
2 79
3 * gnus.texi (Spam Statistics Package): Fix typo in @pxref. 80 * gnus.texi (Spam Statistics Package): Fix typo in @pxref.
@@ -10,7 +87,7 @@
10 87
112006-04-20 Carsten Dominik <dominik@science.uva.nl> 882006-04-20 Carsten Dominik <dominik@science.uva.nl>
12 89
13 * org.texi: (Time stamps): Better explanation of the purpose of 90 * org.texi (Time stamps): Better explanation of the purpose of
14 different time stamps. 91 different time stamps.
15 (Structure editing, Plain lists): More details on how new items 92 (Structure editing, Plain lists): More details on how new items
16 and headings are inserted. 93 and headings are inserted.
@@ -27,7 +104,7 @@
27 104
282006-04-18 Carsten Dominik <dominik@science.uva.nl> 1052006-04-18 Carsten Dominik <dominik@science.uva.nl>
29 106
30 * org.texi: (Formula syntax): Fixed link to Calc Manual. 107 * org.texi (Formula syntax): Fixed link to Calc Manual.
31 108
322006-04-17 Reiner Steib <Reiner.Steib@gmx.de> 1092006-04-17 Reiner Steib <Reiner.Steib@gmx.de>
33 110
@@ -49,7 +126,7 @@
49 126
502006-04-13 Carsten Dominik <dominik@science.uva.nl> 1272006-04-13 Carsten Dominik <dominik@science.uva.nl>
51 128
52 * org.texi: (Updating settings): New section. 129 * org.texi (Updating settings): New section.
53 (Visibility cycling): Better names for the startup folding 130 (Visibility cycling): Better names for the startup folding
54 options. 131 options.
55 (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-xtra.texi b/man/emacs-xtra.texi
index d4a1e5f000e..d6b1ca42583 100644
--- a/man/emacs-xtra.texi
+++ b/man/emacs-xtra.texi
@@ -3316,7 +3316,7 @@ Windows).
3316* Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS. 3316* Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS.
3317* Display: MS-DOS Display. Fonts, frames and display size on MS-DOS. 3317* Display: MS-DOS Display. Fonts, frames and display size on MS-DOS.
3318* Files: MS-DOS File Names. File name conventions on MS-DOS. 3318* Files: MS-DOS File Names. File name conventions on MS-DOS.
3319* Printing: MS-DOS Printing. How to specify the printer on MS-DOS. 3319* Printing: MS-DOS Printing. Printing specifics on MS-DOS.
3320* I18N: MS-DOS and MULE. Support for internationalization on MS-DOS. 3320* I18N: MS-DOS and MULE. Support for internationalization on MS-DOS.
3321* Processes: MS-DOS Processes. Running subprocesses on MS-DOS. 3321* Processes: MS-DOS Processes. Running subprocesses on MS-DOS.
3322@end menu 3322@end menu
@@ -3534,11 +3534,6 @@ other frames to the new dimensions.
3534@cindex file names under MS-DOS 3534@cindex file names under MS-DOS
3535@cindex init file, default name under MS-DOS 3535@cindex init file, default name under MS-DOS
3536 3536
3537 MS-DOS normally uses a backslash, @samp{\}, to separate name units
3538within a file name, instead of the slash used on other systems. Emacs
3539on MS-DOS permits use of either slash or backslash, and also knows
3540about drive letters in file names.
3541
3542 On MS-DOS, file names are case-insensitive and limited to eight 3537 On MS-DOS, file names are case-insensitive and limited to eight
3543characters, plus optionally a period and three more characters. Emacs 3538characters, plus optionally a period and three more characters. Emacs
3544knows enough about these limitations to handle file names that were 3539knows enough about these limitations to handle file names that were
@@ -3593,55 +3588,14 @@ using an actual directory named @file{/dev} on any disk.
3593@section Printing and MS-DOS 3588@section Printing and MS-DOS
3594 3589
3595 Printing commands, such as @code{lpr-buffer} 3590 Printing commands, such as @code{lpr-buffer}
3596(@pxref{Printing,,,emacs, the Emacs Manual }) and 3591(@pxref{Printing,,,emacs, the Emacs Manual}) and
3597@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}) 3592@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual})
3598can work in MS-DOS and MS-Windows by sending the output to one of the 3593can work on MS-DOS by sending the output to one of the printer ports,
3599printer ports, if a Posix-style @code{lpr} program is unavailable. 3594if a Posix-style @code{lpr} program is unavailable. The same Emacs
3600The same Emacs variables control printing on all systems, but in some 3595variables control printing on all systems, but in some cases they have
3601cases they have different default values on MS-DOS and MS-Windows. 3596different default values on MS-DOS.
3602 3597
3603@vindex printer-name @r{(MS-DOS)} 3598@xref{MS-Windows Printing,,,emacs, the Emacs Manual}, for details.
3604 If you want to use your local printer, printing on it in the usual DOS
3605manner, then set the Lisp variable @code{lpr-command} to @code{""} (its
3606default value) and @code{printer-name} to the name of the printer
3607port---for example, @code{"PRN"}, the usual local printer port (that's
3608the default), or @code{"LPT2"}, or @code{"COM1"} for a serial printer.
3609You can also set @code{printer-name} to a file name, in which case
3610``printed'' output is actually appended to that file. If you set
3611@code{printer-name} to @code{"NUL"}, printed output is silently
3612discarded (sent to the system null device).
3613
3614 On MS-Windows, when the Windows network software is installed, you can
3615also use a printer shared by another machine by setting
3616@code{printer-name} to the UNC share name for that printer---for example,
3617@code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward
3618slashes or backslashes here.) To find out the names of shared printers,
3619run the command @samp{net view} at a DOS command prompt to obtain a list
3620of servers, and @samp{net view @var{server-name}} to see the names of printers
3621(and directories) shared by that server. Alternatively, click the
3622@samp{Network Neighborhood} icon on your desktop, and look for machines
3623which share their printers via the network.
3624
3625@cindex @samp{net use}, and printing on MS-Windows
3626@cindex networked printers (MS-Windows)
3627 If the printer doesn't appear in the output of @samp{net view}, or
3628if setting @code{printer-name} to the UNC share name doesn't produce a
3629hardcopy on that printer, you can use the @samp{net use} command to
3630connect a local print port such as @code{"LPT2"} to the networked
3631printer. For example, typing @kbd{net use LPT2:
3632\\joes_pc\hp4si}@footnote{
3633Note that the @samp{net use} command requires the UNC share name to be
3634typed with the Windows-style backslashes, while the value of
3635@code{printer-name} can be set with either forward- or backslashes.}
3636causes Windows to @dfn{capture} the LPT2 port and redirect the printed
3637material to the printer connected to the machine @code{joes_pc}.
3638After this command, setting @code{printer-name} to @code{"LPT2"}
3639should produce the hardcopy on the networked printer.
3640
3641 With some varieties of Windows network software, you can instruct
3642Windows to capture a specific printer port such as @code{"LPT2"}, and
3643redirect it to a networked printer via the @w{@code{Control
3644Panel->Printers}} applet instead of @samp{net use}.
3645 3599
3646 Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even 3600 Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even
3647though they are connected to a Windows machine which uses a different 3601though they are connected to a Windows machine which uses a different
@@ -3655,95 +3609,11 @@ M-x lpr-region RET} will print the region while converting it to the
3655codepage 850 encoding. You may need to create the @code{cp@var{nnn}} 3609codepage 850 encoding. You may need to create the @code{cp@var{nnn}}
3656coding system with @kbd{M-x codepage-setup}. 3610coding system with @kbd{M-x codepage-setup}.
3657 3611
3658 If you set @code{printer-name} to a file name, it's best to use an
3659absolute file name. Emacs changes the working directory according to
3660the default directory of the current buffer, so if the file name in
3661@code{printer-name} is relative, you will end up with several such
3662files, each one in the directory of the buffer from which the printing
3663was done.
3664
3665@findex print-buffer @r{(MS-DOS)}
3666@findex print-region @r{(MS-DOS)}
3667@vindex lpr-headers-switches @r{(MS-DOS)}
3668 The commands @code{print-buffer} and @code{print-region} call the
3669@code{pr} program, or use special switches to the @code{lpr} program, to
3670produce headers on each printed page. MS-DOS and MS-Windows don't
3671normally have these programs, so by default, the variable
3672@code{lpr-headers-switches} is set so that the requests to print page
3673headers are silently ignored. Thus, @code{print-buffer} and
3674@code{print-region} produce the same output as @code{lpr-buffer} and
3675@code{lpr-region}, respectively. If you do have a suitable @code{pr}
3676program (for example, from GNU Textutils), set
3677@code{lpr-headers-switches} to @code{nil}; Emacs will then call
3678@code{pr} to produce the page headers, and print the resulting output as
3679specified by @code{printer-name}.
3680
3681@vindex print-region-function @r{(MS-DOS)}
3682@cindex lpr usage under MS-DOS
3683@vindex lpr-command @r{(MS-DOS)}
3684@vindex lpr-switches @r{(MS-DOS)}
3685 Finally, if you do have an @code{lpr} work-alike, you can set the
3686variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use
3687@code{lpr} for printing, as on other systems. (If the name of the
3688program isn't @code{lpr}, set @code{lpr-command} to specify where to
3689find it.) The variable @code{lpr-switches} has its standard meaning
3690when @code{lpr-command} is not @code{""}. If the variable
3691@code{printer-name} has a string value, it is used as the value for the
3692@code{-P} option to @code{lpr}, as on Unix.
3693
3694@findex ps-print-buffer @r{(MS-DOS)}
3695@findex ps-spool-buffer @r{(MS-DOS)}
3696@vindex ps-printer-name @r{(MS-DOS)}
3697@vindex ps-lpr-command @r{(MS-DOS)}
3698@vindex ps-lpr-switches @r{(MS-DOS)}
3699 A parallel set of variables, @code{ps-lpr-command},
3700@code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript
3701Variables,,,emacs, the Emacs Manual}), defines how PostScript files
3702should be printed. These variables are used in the same way as the
3703corresponding variables described above for non-PostScript printing.
3704Thus, the value of @code{ps-printer-name} is used as the name of the
3705device (or file) to which PostScript output is sent, just as
3706@code{printer-name} is used for non-PostScript printing. (There are
3707two distinct sets of variables in case you have two printers attached
3708to two different ports, and only one of them is a PostScript printer.)
3709
3710 The default value of the variable @code{ps-lpr-command} is @code{""},
3711which causes PostScript output to be sent to the printer port specified
3712by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to
3713the name of a program which will accept PostScript files. Thus, if you
3714have a non-PostScript printer, you can set this variable to the name of
3715a PostScript interpreter program (such as Ghostscript). Any switches
3716that need to be passed to the interpreter program are specified using
3717@code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a
3718string, it will be added to the list of switches as the value for the
3719@code{-P} option. This is probably only useful if you are using
3720@code{lpr}, so when using an interpreter typically you would set
3721@code{ps-printer-name} to something other than a string so it is
3722ignored.)
3723
3724 For example, to use Ghostscript for printing on an Epson printer
3725connected to the @samp{LPT2} port, put this in your @file{_emacs} file:
3726
3727@example
3728(setq ps-printer-name t) ; Ghostscript doesn't understand -P
3729(setq ps-lpr-command "c:/gs/gs386")
3730(setq ps-lpr-switches '("-q" "-dNOPAUSE"
3731 "-sDEVICE=epson"
3732 "-r240x72"
3733 "-sOutputFile=LPT2"
3734 "-Ic:/gs"))
3735@end example
3736
3737@noindent
3738(This assumes that Ghostscript is installed in the @file{"c:/gs"}
3739directory.)
3740
3741@vindex dos-printer 3612@vindex dos-printer
3742@vindex dos-ps-printer 3613@vindex dos-ps-printer
3743 For backwards compatibility, the value of @code{dos-printer} 3614 For backwards compatibility, the value of @code{dos-printer}
3744(@code{dos-ps-printer}), if it has a value, overrides the value of 3615(@code{dos-ps-printer}), if it has a value, overrides the value of
3745@code{printer-name} (@code{ps-printer-name}), on MS-DOS and MS-Windows 3616@code{printer-name} (@code{ps-printer-name}), on MS-DOS.
3746only.
3747 3617
3748 3618
3749@node MS-DOS and MULE 3619@node MS-DOS and MULE
diff --git a/man/emacs.texi b/man/emacs.texi
index c926961891f..c058e02d8eb 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
@@ -1544,7 +1537,12 @@ Public License instead of this License.
1544 1537
1545@include doclicense.texi 1538@include doclicense.texi
1546@include cmdargs.texi 1539@include cmdargs.texi
1540@iftex
1541@include xresmini.texi
1542@end iftex
1543@ifnottex
1547@include xresources.texi 1544@include xresources.texi
1545@end ifnottex
1548 1546
1549@include anti.texi 1547@include anti.texi
1550@include macos.texi 1548@include macos.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/mh-e.texi b/man/mh-e.texi
index d8245b325ab..6f20c47f40f 100644
--- a/man/mh-e.texi
+++ b/man/mh-e.texi
@@ -8,11 +8,11 @@
8@c %**end of header 8@c %**end of header
9 9
10@c Version of the software and manual. 10@c Version of the software and manual.
11@set VERSION 7.93 11@set VERSION 7.94
12@c Edition of the manual. It is either empty for the first edition or 12@c Edition of the manual. It is either empty for the first edition or
13@c has the form ", nth Edition" (without the quotes). 13@c has the form ", nth Edition" (without the quotes).
14@set EDITION , 7th Edition 14@set EDITION , 2nd Edition
15@set UPDATED 2006-04-17 15@set UPDATED 2006-04-24
16@set UPDATE-MONTH April, 2006 16@set UPDATE-MONTH April, 2006
17 17
18@c Other variables. 18@c Other variables.
@@ -245,6 +245,8 @@ If more information is needed, you can go to the Unix manual pages of
245the individual MH commands. When the name is not obvious, I'll guide 245the individual MH commands. When the name is not obvious, I'll guide
246you to a relevant MH manual page that describes the action more fully. 246you to a relevant MH manual page that describes the action more fully.
247 247
248@cindex @cite{MH & nmh: Email for Users & Programmers}
249@cindex MH book
248@cindex info 250@cindex info
249@kindex C-h i 251@kindex C-h i
250 252
@@ -536,12 +538,49 @@ quite easy. @xref{Getting MH-E}, for instructions for getting and
536installing MH-E. 538installing MH-E.
537 539
538If the @code{mh-version} command displays @samp{No MH variant 540If the @code{mh-version} command displays @samp{No MH variant
539detected}, then you need to install MH or tell MH-E where to find 541detected}@footnote{In very old versions of MH-E, you may get the error
540MH@footnote{In very old versions of MH-E, you may get the error
541message, @samp{Cannot find the commands `inc' and `mhl' and the file 542message, @samp{Cannot find the commands `inc' and `mhl' and the file
542`components'} if MH-E can't find MH. In this case, you need to update 543`components'} if MH-E can't find MH. In this case, you need to update
543MH-E, and you may need to install MH too. However, newer versions of 544MH-E, and you may need to install MH too. However, newer versions of
544MH-E are better at finding MH if it is on your system.}. 545MH-E are better at finding MH if it is on your system.}, then you need
546to install MH or tell MH-E where to find MH.
547
548@cindex Debian
549@cindex nmh
550@cindex GNU mailutils
551
552If you don't have MH on your system already, you must install a
553variant of MH. The Debian mh-e package does this for you automatically
554(@pxref{Getting MH-E}). Most people use
555@uref{http://www.nongnu.org/nmh/, nmh}, but you may be interested in
556trying out @uref{http://www.gnu.org/software/mailutils/, GNU
557mailutils}, which supports IMAP. Your GNU/Linux distribution probably
558has packages for both of these.
559
560@cindex @command{install-mh}
561@cindex MH commands, @command{install-mh}
562@cindex MH book
563
564If you've never run MH before, you need to run @command{install-mh}
565from the shell before you continue. This sets up your personal MH
566environment@footnote{See the section
567@uref{@value{MH-BOOK-HOME}/../overall/setup.htm, Setting Up MH} in the
568MH book.}. If you don't, you'll be greeted with the error message:
569@samp{Install MH and run install-mh before running MH-E}. This is all
570you need to know about MH to use MH-E, but the more you know about MH,
571the more you can leverage its power. See the
572@uref{@value{MH-BOOK-HOME}, MH book} to learn more about MH.
573
574@cindex @samp{Path:} MH profile component
575@cindex MH profile
576@cindex MH profile component
577@cindex MH profile component, @samp{Path:}
578
579Your MH environment includes your @dfn{MH profile} which is found in
580the file @file{~/.mh_profile}. This file contains a number of @dfn{MH
581profile components}. For example, the @samp{Path:} MH profile
582component contains the path to your mail directory, which is
583@file{~/Mail} by default.
545 584
546@cindex @command{mhparam} 585@cindex @command{mhparam}
547@cindex MH commands, @command{mhparam} 586@cindex MH commands, @command{mhparam}
@@ -551,8 +590,9 @@ MH-E are better at finding MH if it is on your system.}.
551@vindex mh-variant 590@vindex mh-variant
552@vindex mh-variant-in-use 591@vindex mh-variant-in-use
553 592
554The option @code{mh-variant} specifies the variant used by MH-E 593There are several options MH-E uses to interact with your MH
555(@pxref{Options}). The default setting of this option is 594installation. The option @code{mh-variant} specifies the variant used
595by MH-E (@pxref{Options}). The default setting of this option is
556@samp{Auto-detect} which means that MH-E will automatically choose the 596@samp{Auto-detect} which means that MH-E will automatically choose the
557first of nmh, MH, or GNU mailutils that it finds in the directories 597first of nmh, MH, or GNU mailutils that it finds in the directories
558listed in @code{mh-path} (which you can customize), 598listed in @code{mh-path} (which you can customize),
@@ -585,27 +625,6 @@ actually cause problems.
585@end quotation 625@end quotation
586@sp 1 626@sp 1
587 627
588@cindex @command{install-mh}
589@cindex MH commands, @command{install-mh}
590
591If you've never run MH before, you need to run @command{install-mh}
592from the shell before you continue. This sets up your personal MH
593environment@footnote{See the section
594@uref{@value{MH-BOOK-HOME}/../overall/setup.htm, Setting Up MH} in the
595MH book.}. If you don't, you'll be greeted with the error message:
596@samp{Install MH and run install-mh before running MH-E}.
597
598@cindex @samp{Path:} MH profile component
599@cindex MH profile
600@cindex MH profile component
601@cindex MH profile component, @samp{Path:}
602
603Your MH environment includes your @dfn{MH profile} which is found in
604the file @file{~/.mh_profile}. This file contains a number of @dfn{MH
605profile components}. For example, the @samp{Path:} MH profile
606component contains the path to your mail directory, which is
607@file{~/Mail} by default.
608
609@cindex MH profile component, @samp{Draft-Folder:} 628@cindex MH profile component, @samp{Draft-Folder:}
610@cindex MH profile component, @samp{Path:} 629@cindex MH profile component, @samp{Path:}
611@cindex MH profile component, @samp{Previous-Sequence:} 630@cindex MH profile component, @samp{Previous-Sequence:}
@@ -8609,6 +8628,12 @@ change log to see if you are interested in what the given release of
8609MH-E has to offer (although we have no doubt that you will be 8628MH-E has to offer (although we have no doubt that you will be
8610extremely interested in all new releases). 8629extremely interested in all new releases).
8611 8630
8631@cindex Debian
8632
8633If you use Debian, you can install the Debian
8634@uref{http://packages.debian.org/unstable/mail/mh-e, mh-e package}
8635instead.
8636
8612@cindex files, @samp{MH-E-NEWS} 8637@cindex files, @samp{MH-E-NEWS}
8613@cindex files, @samp{README} 8638@cindex files, @samp{README}
8614@cindex news 8639@cindex news
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/man/msdog.texi b/man/msdog.texi
index 3bdc9051a71..2f7cc229884 100644
--- a/man/msdog.texi
+++ b/man/msdog.texi
@@ -5,22 +5,26 @@
5@node Emacs and Microsoft Windows, Manifesto, Mac OS, Top 5@node Emacs and Microsoft Windows, Manifesto, Mac OS, Top
6@appendix Emacs and Microsoft Windows 6@appendix Emacs and Microsoft Windows
7@cindex Microsoft Windows 7@cindex Microsoft Windows
8@cindex MS-Windows, Emacs peculiarities
8 9
9 This section describes peculiarities of using Emacs on Microsoft 10 This section describes peculiarities of using Emacs on Microsoft
10Windows. Information about Emacs and Microsoft's older MS-DOS 11Windows. Some of these peculiarities are also relevant to Microsoft's
11``operating system'' (also known as ``MS-DOG'') is now in a separate 12older MS-DOS ``operating system'' (also known as ``MS-DOG'').
12manual (@inforef{MS-DOG,, emacs-xtra}). 13However, Emacs features that are relevant @emph{only} to MS-DOS are
14described in a separate manual (@inforef{MS-DOG,, emacs-xtra}).
13 15
14 Iif you want to use Emacs on Windows, you would normally build Emacs 16 The behavior of Emacs on MS-Windows is reasonably similar to what is
15specifically for Windows. If you do that, the behavior is reasonably 17documented in the rest of the manual, including support for long file
16similar to what is documented in the rest of the manual, including 18names, multiple frames, scroll bars, mouse menus, and subprocesses.
17support for long file names, multiple frames, scroll bars, mouse 19However, a few special considerations apply, and they are described
18menus, and subprocesses. However, a few special considerations apply, 20here.
19and they are described here.
20 21
21@menu 22@menu
22* Text and Binary:: Text files use CRLF to terminate lines. 23* Text and Binary:: Text files use CRLF to terminate lines.
24* Windows Files:: File-name conventions on Windows.
25* Windows HOME:: Where Emacs looks for your @file{.emacs}.
23* Windows Processes:: Running subprocesses on Windows. 26* Windows Processes:: Running subprocesses on Windows.
27* Windows Printing:: How to specify the printer on MS-Windows.
24* Windows System Menu:: Controlling what the ALT key does. 28* Windows System Menu:: Controlling what the ALT key does.
25@end menu 29@end menu
26 30
@@ -29,11 +33,11 @@ and they are described here.
29@cindex text and binary files on MS-DOS/MS-Windows 33@cindex text and binary files on MS-DOS/MS-Windows
30 34
31 GNU Emacs uses newline characters to separate text lines. This is the 35 GNU Emacs uses newline characters to separate text lines. This is the
32convention used on GNU and Unix. 36convention used on GNU, Unix, and other Posix-compliant systems.
33 37
34@cindex end-of-line conversion on MS-DOS/MS-Windows 38@cindex end-of-line conversion on MS-DOS/MS-Windows
35 MS-DOS and MS-Windows normally use carriage-return linefeed, a 39 By contrast, MS-DOS and MS-Windows normally use carriage-return linefeed,
36two-character sequence, to separate text lines. (Linefeed is the same 40a two-character sequence, to separate text lines. (Linefeed is the same
37character as newline.) Therefore, convenient editing of typical files 41character as newline.) Therefore, convenient editing of typical files
38with Emacs requires conversion of these end-of-line (EOL) sequences. 42with Emacs requires conversion of these end-of-line (EOL) sequences.
39And that is what Emacs normally does: it converts carriage-return 43And that is what Emacs normally does: it converts carriage-return
@@ -57,11 +61,11 @@ end-of-line convention after you edit them.
57 61
58 The mode line indicates whether end-of-line translation was used for 62 The mode line indicates whether end-of-line translation was used for
59the current buffer. If MS-DOS end-of-line translation is in use for the 63the current buffer. If MS-DOS end-of-line translation is in use for the
60buffer, a backslash @samp{\} is displayed after the coding system 64buffer, the MS-Windows build of Emacs displays a backslash @samp{\} after
61mnemonic near the beginning of the mode line (@pxref{Mode Line}). If no 65the coding system mnemonic near the beginning of the mode line
62EOL translation was performed, the string @samp{(Unix)} is displayed 66(@pxref{Mode Line}). If no EOL translation was performed, the string
63instead of the backslash, to alert you that the file's EOL format is not 67@samp{(Unix)} is displayed instead of the backslash, to alert you that the
64the usual carriage-return linefeed. 68file's EOL format is not the usual carriage-return linefeed.
65 69
66@cindex DOS-to-Unix conversion of files 70@cindex DOS-to-Unix conversion of files
67 To visit a file and specify whether it uses DOS-style or Unix-style 71 To visit a file and specify whether it uses DOS-style or Unix-style
@@ -78,14 +82,14 @@ effectively converts the file to Unix EOL style, like @code{dos2unix}.
78 82
79@cindex untranslated file system 83@cindex untranslated file system
80@findex add-untranslated-filesystem 84@findex add-untranslated-filesystem
81 When you use NFS or Samba to access file systems that reside on 85 When you use NFS, Samba, or some other similar method to access file
82computers using GNU or Unix systems, Emacs should not perform 86systems that reside on computers using GNU or Unix systems, Emacs
83end-of-line translation on any files in these file systems---not even 87should not perform end-of-line translation on any files in these file
84when you create a new file. To request this, designate these file 88systems---not even when you create a new file. To request this,
85systems as @dfn{untranslated} file systems by calling the function 89designate these file systems as @dfn{untranslated} file systems by
86@code{add-untranslated-filesystem}. It takes one argument: the file 90calling the function @code{add-untranslated-filesystem}. It takes one
87system name, including a drive letter and optionally a directory. For 91argument: the file system name, including a drive letter and
88example, 92optionally a directory. For example,
89 93
90@example 94@example
91(add-untranslated-filesystem "Z:") 95(add-untranslated-filesystem "Z:")
@@ -103,7 +107,7 @@ designates directory @file{\foo} on drive Z as an untranslated file
103system. 107system.
104 108
105 Most often you would use @code{add-untranslated-filesystem} in your 109 Most often you would use @code{add-untranslated-filesystem} in your
106@file{_emacs} file, or in @file{site-start.el} so that all the users at 110@file{.emacs} file, or in @file{site-start.el} so that all the users at
107your site get the benefit of it. 111your site get the benefit of it.
108 112
109@findex remove-untranslated-filesystem 113@findex remove-untranslated-filesystem
@@ -120,9 +124,9 @@ newline at the end of a line. @xref{Coding Systems}.
120@vindex file-name-buffer-file-type-alist 124@vindex file-name-buffer-file-type-alist
121@cindex binary files, on MS-DOS/MS-Windows 125@cindex binary files, on MS-DOS/MS-Windows
122 Some kinds of files should not be converted at all, because their 126 Some kinds of files should not be converted at all, because their
123contents are not really text. Therefore, Emacs on MS-DOS distinguishes 127contents are not really text. Therefore, Emacs on MS-Windows distinguishes
124certain files as @dfn{binary files}. (This distinction is not part of 128certain files as @dfn{binary files}. (This distinction is not part of
125MS-DOS; it is made by Emacs only.) Binary files include executable 129MS-Windows; it is made by Emacs only.) Binary files include executable
126programs, compressed archives, etc. Emacs uses the file name to decide 130programs, compressed archives, etc. Emacs uses the file name to decide
127whether to treat a file as binary: the variable 131whether to treat a file as binary: the variable
128@code{file-name-buffer-file-type-alist} defines the file-name patterns 132@code{file-name-buffer-file-type-alist} defines the file-name patterns
@@ -132,29 +136,88 @@ for binary files (those whose associations are of the type
132@code{no-conversion} coding system (@pxref{Coding Systems}) which turns 136@code{no-conversion} coding system (@pxref{Coding Systems}) which turns
133off @emph{all} coding-system conversions, not only the EOL conversion. 137off @emph{all} coding-system conversions, not only the EOL conversion.
134@code{file-name-buffer-file-type-alist} also includes file-name patterns 138@code{file-name-buffer-file-type-alist} also includes file-name patterns
135for files which are known to be DOS-style text files with 139for files which are known to be Windows-style text files with
136carriage-return linefeed EOL format, such as @file{CONFIG.SYS}; Emacs 140carriage-return linefeed EOL format, such as @file{CONFIG.SYS}; Emacs
137always writes those files with DOS-style EOLs. 141always writes those files with Windows-style EOLs.
138 142
139 If a file which belongs to an untranslated file system matches one of 143 If a file which belongs to an untranslated file system matches one of
140the file-name patterns in @code{file-name-buffer-file-type-alist}, the 144the file-name patterns in @code{file-name-buffer-file-type-alist}, the
141EOL conversion is determined by @code{file-name-buffer-file-type-alist}. 145EOL conversion is determined by @code{file-name-buffer-file-type-alist}.
142 146
147@node Windows Files
148@section File Names on MS-Windows
149@cindex file names on MS-Windows
150
151 MS-Windows and MS-DOS normally use a backslash, @samp{\}, to
152separate name units within a file name, instead of the slash used on
153other systems. Emacs on MS-DOS/MS-Windows permits use of either slash or
154backslash, and also knows about drive letters in file names.
155
156@cindex file-name completion, on MS-Windows
157 On MS-DOS/MS-Windows, file names are case-insensitive, so Emacs by
158default ignores letter-case in file names during completion.
159
160@node Windows HOME
161@section HOME Directory on MS-Windows
162@cindex @code{HOME} directory on MS-Windows
163
164 The MS-Windows equivalent of the @code{HOME} directory is the
165@dfn{user-specific application data directory}. The actual location
166depends on your Windows version and system configuration; typical values
167are @file{C:\Documents and Settings\@var{username}\Application Data} on
168Windows 2K/XP and later, and either @file{C:\WINDOWS\Application Data}
169or @file{C:\WINDOWS\Profiles\@var{username}\Application Data} on the
170older Windows 9X/ME systems.
171
172@cindex init file @file{.emacs} on MS-Windows
173 The home directory is where your init file @file{.emacs} is stored.
174When Emacs starts, it first checks whether the environment variable
175@env{HOME} is set. If it is, it looks for the init file in the
176directory pointed by @env{HOME}. If @env{HOME} is not defined, Emacs
177checks for an existing @file{.emacs} file in @file{C:\}, the root
178directory of drive @file{C:}@footnote{
179The check in @file{C:\} is in preference to the application data
180directory for compatibility with older versions of Emacs, which didn't
181check the application data directory.
182}. If there's no such file in @file{C:\}, Emacs next uses the Windows
183system calls to find out the exact location of your application data
184directory. If that fails as well, Emacs falls back to @file{C:\}.
185
186 Whatever the final place is, Emacs sets the value of the @env{HOME}
187environment variable to point to it, and it will use that location for
188other files and directories it normally creates in the user's home
189directory.
190
191 You can always find out where Emacs thinks is your home directory's
192location by typing @kbd{C-x d ~/ @key{RET}}. This should present the
193list of files in the home directory, and show its full name on the
194first line. Likewise, to visit your init file, type @kbd{C-x C-f
195~/.emacs @key{RET}}.
196
197@cindex @file{_emacs} init file, MS-Windows
198 Because MS-DOS does not allow file names with leading dots, and
199because older Windows systems made it hard to create files with such
200names, the Windows port of Emacs supports an alternative name
201@file{_emacs} as a fallback, if such a file exists in the home
202directory, whereas @file{.emacs} does not.
203
143@node Windows Processes 204@node Windows Processes
144@section Subprocesses on Windows 9X/ME and Windows NT/2K 205@section Subprocesses on Windows 9X/ME and Windows NT/2K/XP
206@cindex subprocesses on MS-Windows
145 207
208@cindex DOS applications, running from Emacs
146 Emacs compiled as a native Windows application (as opposed to the DOS 209 Emacs compiled as a native Windows application (as opposed to the DOS
147version) includes full support for asynchronous subprocesses. 210version) includes full support for asynchronous subprocesses.
148In the Windows version, synchronous and asynchronous subprocesses work 211In the Windows version, synchronous and asynchronous subprocesses work
149fine on both 212fine on both
150Windows 9X and Windows NT/2K as long as you run only 32-bit Windows 213Windows 9X/ME and Windows NT/2K/XP as long as you run only 32-bit Windows
151applications. However, when you run a DOS application in a subprocess, 214applications. However, when you run a DOS application in a subprocess,
152you may encounter problems or be unable to run the application at all; 215you may encounter problems or be unable to run the application at all;
153and if you run two DOS applications at the same time in two 216and if you run two DOS applications at the same time in two
154subprocesses, you may have to reboot your system. 217subprocesses, you may have to reboot your system.
155 218
156Since the standard command interpreter (and most command line utilities) 219Since the standard command interpreter (and most command line utilities)
157on Windows 95 are DOS applications, these problems are significant when 220on Windows 9X are DOS applications, these problems are significant when
158using that system. But there's nothing we can do about them; only 221using that system. But there's nothing we can do about them; only
159Microsoft can fix them. 222Microsoft can fix them.
160 223
@@ -174,13 +237,14 @@ If you attempt to run two DOS applications at the same time in separate
174subprocesses, the second one that is started will be suspended until the 237subprocesses, the second one that is started will be suspended until the
175first one finishes, even if either or both of them are asynchronous. 238first one finishes, even if either or both of them are asynchronous.
176 239
240@cindex kill DOS application
177If you can go to the first subprocess, and tell it to exit, the second 241If you can go to the first subprocess, and tell it to exit, the second
178subprocess should continue normally. However, if the second subprocess 242subprocess should continue normally. However, if the second subprocess
179is synchronous, Emacs itself will be hung until the first subprocess 243is synchronous, Emacs itself will be hung until the first subprocess
180finishes. If it will not finish without user input, then you have no 244finishes. If it will not finish without user input, then you have no
181choice but to reboot if you are running on Windows 9X. If you are 245choice but to reboot if you are running on Windows 9X. If you are
182running on Windows NT/2K, you can use a process viewer application to kill 246running on Windows NT/2K/XP, you can use a process viewer application to kill
183the appropriate instance of ntvdm instead (this will terminate both DOS 247the appropriate instance of NTVDM instead (this will terminate both DOS
184subprocesses). 248subprocesses).
185 249
186If you have to reboot Windows 9X in this situation, do not use the 250If you have to reboot Windows 9X in this situation, do not use the
@@ -189,16 +253,156 @@ system. Instead, type @kbd{CTL-ALT-@key{DEL}} and then choose
189@code{Shutdown}. That usually works, although it may take a few minutes 253@code{Shutdown}. That usually works, although it may take a few minutes
190to do its job. 254to do its job.
191 255
256@node Windows Printing
257@section Printing and MS-Windows
258
259 Printing commands, such as @code{lpr-buffer} (@pxref{Printing}) and
260@code{ps-print-buffer} (@pxref{PostScript}) work in MS-DOS and
261MS-Windows by sending the output to one of the printer ports, if a
262Posix-style @code{lpr} program is unavailable. The same Emacs
263variables control printing on all systems, but in some cases they have
264different default values on MS-DOS and MS-Windows.
265
266 Emacs on Windows automatically determines your default printer and
267sets the variable @var{printer-name} to that printer's name. But in
268some rare cases this can fail, or you may wish to use a different
269printer from within Emacs. The rest of this section explains how to
270tell Emacs which printer to use.
271
272@vindex printer-name@r{, (MS-DOS/MW-Windows)}
273 If you want to use your local printer, then set the Lisp variable
274@code{lpr-command} to @code{""} (its default value on Windows) and
275@code{printer-name} to the name of the printer port---for example,
276@code{"PRN"}, the usual local printer port or @code{"LPT2"}, or
277@code{"COM1"} for a serial printer. You can also set
278@code{printer-name} to a file name, in which case ``printed'' output
279is actually appended to that file. If you set @code{printer-name} to
280@code{"NUL"}, printed output is silently discarded (sent to the system
281null device).
282
283 You can also use a printer shared by another machine by setting
284@code{printer-name} to the UNC share name for that printer---for
285example, @code{"//joes_pc/hp4si"}. (It doesn't matter whether you use
286forward slashes or backslashes here.) To find out the names of shared
287printers, run the command @samp{net view} from the command prompt to
288obtain a list of servers, and @samp{net view @var{server-name}} to see
289the names of printers (and directories) shared by that server.
290Alternatively, click the @samp{Network Neighborhood} icon on your
291desktop, and look for machines which share their printers via the
292network.
293
294@cindex @samp{net use}, and printing on MS-Windows
295@cindex networked printers (MS-Windows)
296 If the printer doesn't appear in the output of @samp{net view}, or
297if setting @code{printer-name} to the UNC share name doesn't produce a
298hardcopy on that printer, you can use the @samp{net use} command to
299connect a local print port such as @code{"LPT2"} to the networked
300printer. For example, typing @kbd{net use LPT2: \\joes_pc\hp4si}@footnote{
301Note that the @samp{net use} command requires the UNC share name to be
302typed with the Windows-style backslashes, while the value of
303@code{printer-name} can be set with either forward- or backslashes.}
304causes Windows to @dfn{capture} the @code{LPT2} port and redirect the
305printed material to the printer connected to the machine @code{joes_pc}.
306After this command, setting @code{printer-name} to @code{"LPT2"}
307should produce the hardcopy on the networked printer.
308
309 With some varieties of Windows network software, you can instruct
310Windows to capture a specific printer port such as @code{"LPT2"}, and
311redirect it to a networked printer via the @w{@code{Control
312Panel->Printers}} applet instead of @samp{net use}.
313
314 If you set @code{printer-name} to a file name, it's best to use an
315absolute file name. Emacs changes the working directory according to
316the default directory of the current buffer, so if the file name in
317@code{printer-name} is relative, you will end up with several such
318files, each one in the directory of the buffer from which the printing
319was done.
320
321@findex print-buffer @r{(MS-DOS)}
322@findex print-region @r{(MS-DOS)}
323@vindex lpr-headers-switches @r{(MS-DOS)}
324 The commands @code{print-buffer} and @code{print-region} call the
325@code{pr} program, or use special switches to the @code{lpr} program, to
326produce headers on each printed page. MS-DOS and MS-Windows don't
327normally have these programs, so by default, the variable
328@code{lpr-headers-switches} is set so that the requests to print page
329headers are silently ignored. Thus, @code{print-buffer} and
330@code{print-region} produce the same output as @code{lpr-buffer} and
331@code{lpr-region}, respectively. If you do have a suitable @code{pr}
332program (for example, from GNU Coreutils), set
333@code{lpr-headers-switches} to @code{nil}; Emacs will then call
334@code{pr} to produce the page headers, and print the resulting output as
335specified by @code{printer-name}.
336
337@vindex print-region-function @r{(MS-DOS)}
338@cindex lpr usage under MS-DOS
339@vindex lpr-command @r{(MS-DOS)}
340@vindex lpr-switches @r{(MS-DOS)}
341 Finally, if you do have an @code{lpr} work-alike, you can set the
342variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use
343@code{lpr} for printing, as on other systems. (If the name of the
344program isn't @code{lpr}, set @code{lpr-command} to specify where to
345find it.) The variable @code{lpr-switches} has its standard meaning
346when @code{lpr-command} is not @code{""}. If the variable
347@code{printer-name} has a string value, it is used as the value for the
348@code{-P} option to @code{lpr}, as on Unix.
349
350@findex ps-print-buffer @r{(MS-DOS)}
351@findex ps-spool-buffer @r{(MS-DOS)}
352@vindex ps-printer-name @r{(MS-DOS)}
353@vindex ps-lpr-command @r{(MS-DOS)}
354@vindex ps-lpr-switches @r{(MS-DOS)}
355 A parallel set of variables, @code{ps-lpr-command},
356@code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript
357Variables}), defines how PostScript files should be printed. These
358variables are used in the same way as the corresponding variables
359described above for non-PostScript printing. Thus, the value of
360@code{ps-printer-name} is used as the name of the device (or file) to
361which PostScript output is sent, just as @code{printer-name} is used
362for non-PostScript printing. (There are two distinct sets of
363variables in case you have two printers attached to two different
364ports, and only one of them is a PostScript printer.)
365
366 The default value of the variable @code{ps-lpr-command} is @code{""},
367which causes PostScript output to be sent to the printer port specified
368by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to
369the name of a program which will accept PostScript files. Thus, if you
370have a non-PostScript printer, you can set this variable to the name of
371a PostScript interpreter program (such as Ghostscript). Any switches
372that need to be passed to the interpreter program are specified using
373@code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a
374string, it will be added to the list of switches as the value for the
375@code{-P} option. This is probably only useful if you are using
376@code{lpr}, so when using an interpreter typically you would set
377@code{ps-printer-name} to something other than a string so it is
378ignored.)
379
380 For example, to use Ghostscript for printing on the system's default
381printer, put this in your @file{.emacs} file:
382
383@example
384(setq ps-printer-name t)
385(setq ps-lpr-command "D:/gs6.01/bin/gswin32c.exe")
386(setq ps-lpr-switches '("-q" "-dNOPAUSE" "-dBATCH"
387 "-sDEVICE=mswinpr2"
388 "-sPAPERSIZE=a4"))
389@end example
390
391@noindent
392(This assumes that Ghostscript is installed in the
393@file{D:/gs6.01} directory.)
394
192@node Windows System Menu 395@node Windows System Menu
193@section Using the System Menu on Windows 396@section Using the System Menu on Windows
397@cindex @code{Alt} key invokes menu (Windows)
194 398
195Emacs compiled as a native Windows application normally turns off the 399Emacs compiled as a native Windows application normally turns off the
196Windows feature that tapping the @key{ALT} 400Windows feature that tapping the @key{ALT} key invokes the Windows
197key invokes the Windows menu. The reason is that the @key{ALT} also 401menu. The reason is that the @key{ALT} serves as @key{META} in Emacs.
198serves as @key{META} in Emacs. When using Emacs, users often press the 402When using Emacs, users often press the @key{META} key temporarily and
199@key{META} key temporarily and then change their minds; if this has the 403then change their minds; if this has the effect of bringing up the
200effect of bringing up the Windows menu, it alters the meaning of 404Windows menu, it alters the meaning of subsequent commands. Many
201subsequent commands. Many users find this frustrating. 405users find this frustrating.
202 406
203@vindex w32-pass-alt-to-system 407@vindex w32-pass-alt-to-system
204You can re-enable Windows' default handling of tapping the @key{ALT} key 408You can re-enable Windows' default handling of tapping the @key{ALT} key
diff --git a/man/org.texi b/man/org.texi
index efb42ab5b3a..40e24d30146 100644
--- a/man/org.texi
+++ b/man/org.texi
@@ -4,7 +4,7 @@
4@setfilename ../info/org 4@setfilename ../info/org
5@settitle Org Mode Manual 5@settitle Org Mode Manual
6 6
7@set VERSION 4.25 7@set VERSION 4.26
8@set DATE April 2006 8@set DATE April 2006
9 9
10@dircategory Emacs 10@dircategory Emacs
@@ -130,7 +130,7 @@ Hyperlinks
130* Link format:: How links in Org-mode are formatted 130* Link format:: How links in Org-mode are formatted
131* Internal links:: Links to other places in the current file 131* Internal links:: Links to other places in the current file
132* External links:: URL-like links to the world 132* External links:: URL-like links to the world
133* Managing links:: Creating, inserting and following 133* Handling links:: Creating, inserting and following
134* Search Options:: Linking to a specific location 134* Search Options:: Linking to a specific location
135* Remember:: Org-trees store quick notes 135* Remember:: Org-trees store quick notes
136 136
@@ -242,10 +242,10 @@ structured ASCII file, as HTML, or (todo and agenda items only) as an
242iCalendar file. 242iCalendar file.
243 243
244Org-mode keeps simple things simple. When first fired up, it should 244Org-mode keeps simple things simple. When first fired up, it should
245feel like a simple but easy to use outliner. Complexity is not 245feel like a simple, easy to use outliner. Complexity is not imposed,
246imposed, but a large amount of functionality is available when you 246but a large amount of functionality is available when you need it.
247need it. Org-mode can be used on different levels and in different 247Org-mode can be used on different levels and in different ways, for
248ways, for example: 248example:
249 249
250@example 250@example
251@r{@bullet{} as an outline extension with visibility cycling and structure editing} 251@r{@bullet{} as an outline extension with visibility cycling and structure editing}
@@ -642,7 +642,7 @@ C-v} creates a sparse TODO tree (@pxref{TODO basics}).
642To print a sparse tree, you can use the Emacs command 642To print a sparse tree, you can use the Emacs command
643@code{ps-print-buffer-with-faces} which does not print invisible parts 643@code{ps-print-buffer-with-faces} which does not print invisible parts
644of the document @footnote{This does not work under XEmacs, because 644of the document @footnote{This does not work under XEmacs, because
645XEmacs uses selective display for outlining, not text properties}. 645XEmacs uses selective display for outlining, not text properties.}.
646Or you can use the command @kbd{C-c C-x v} to copy the visible part of 646Or you can use the command @kbd{C-c C-x v} to copy the visible part of
647the document to another file (extension @file{.txt}) which can then be 647the document to another file (extension @file{.txt}) which can then be
648printed in any desired way. 648printed in any desired way.
@@ -678,6 +678,7 @@ ends before the next line that is indented like the bullet/number, or
678less. For example: 678less. For example:
679 679
680@example 680@example
681@group
681** Lord of the Rings 682** Lord of the Rings
682My favorite scenes are (in this order) 683My favorite scenes are (in this order)
6831. Eowyns fight with the witch king 6841. Eowyns fight with the witch king
@@ -687,6 +688,8 @@ My favorite scenes are (in this order)
6873. Peter Jackson being shot by Legolas 6883. Peter Jackson being shot by Legolas
688 - on DVD only 689 - on DVD only
689 He makes a really funny face when it happens. 690 He makes a really funny face when it happens.
691But in the end, not individual scenes matter but the film as a whole.
692@end group
690@end example 693@end example
691 694
692Org-mode supports these lists by tuning filling and wrapping commands 695Org-mode supports these lists by tuning filling and wrapping commands
@@ -998,9 +1001,10 @@ The width of columns is automatically determined by the table editor.
998Sometimes a single field or a few fields need to carry more text, 1001Sometimes a single field or a few fields need to carry more text,
999leading to inconveniently wide columns. To limit@footnote{This feature 1002leading to inconveniently wide columns. To limit@footnote{This feature
1000does not work on XEmacs.} the width of a column, one field anywhere in 1003does not work on XEmacs.} the width of a column, one field anywhere in
1001the column must carry the string @samp{<N>} where @samp{N} is an integer 1004the column may contain just the string @samp{<N>} where @samp{N} is an
1002specifying the width of the column in characters. The next re-align 1005integer specifying the width of the column in characters. The next
1003will then set the width of this column to no more than this value. 1006re-align will then set the width of this column to no more than this
1007value.
1004 1008
1005@example 1009@example
1006|---+------------------------------| |---+--------| 1010|---+------------------------------| |---+--------|
@@ -1372,7 +1376,7 @@ links to other files, Usenet articles, emails and much more.
1372* Link format:: How links in Org-mode are formatted 1376* Link format:: How links in Org-mode are formatted
1373* Internal links:: Links to other places in the current file 1377* Internal links:: Links to other places in the current file
1374* External links:: URL-like links to the world 1378* External links:: URL-like links to the world
1375* Managing links:: Creating, inserting and following 1379* Handling links:: Creating, inserting and following
1376* Search Options:: Linking to a specific location 1380* Search Options:: Linking to a specific location
1377* Remember:: Org-trees store quick notes 1381* Remember:: Org-trees store quick notes
1378@end menu 1382@end menu
@@ -1413,29 +1417,28 @@ internal structure of all links, use the menu entry
1413@cindex links, internal 1417@cindex links, internal
1414@cindex CamelCase links 1418@cindex CamelCase links
1415 1419
1416If the link text does not look like a URL, links are considered to be 1420If the link does not look like a URL, it is considered to be internal in
1417internal in the current file. Links such as @samp{[[My Target]]} or 1421the current file. Links such as @samp{[[My Target]]} or @samp{[[My
1418@samp{[[My Target][Find my target]]} lead to a text search in the 1422Target][Find my target]]} lead to a text search in the current file.
1419current file. The link can be followed with @kbd{C-c C-o} when the 1423The link can be followed with @kbd{C-c C-o} when the cursor is on the
1420cursor is on the link, or with a mouse click (@pxref{Managing links}). 1424link, or with a mouse click (@pxref{Handling links}). The preferred
1421The preferred match for such a link is a dedicated target: The same 1425match for such a link is a dedicated target: The same string in double
1422string in double angular brackets. Targets may be located anywhere, 1426angular brackets. Targets may be located anywhere, often it is
1423often it is convenient to put them into a comment line, for example 1427convenient to put them into a comment line, for example
1424 1428
1425@example 1429@example
1426# <<My Target>> 1430# <<My Target>>
1427@end example 1431@end example
1428 1432
1429@noindent In HTML export (@pxref{HTML export}), such targets will become 1433@noindent In HTML export (@pxref{HTML export}), such targets will become
1430named anchors for direct access through http links. 1434named anchors for direct access through @samp{http} links.
1431 1435
1432If no dedicated target exists, Org-mode will search for the words in the 1436If no dedicated target exists, Org-mode will search for the words in the
1433link, often removing the need for a dedicated target. In the above 1437link. In the above example the search would be for @samp{my target}.
1434example the search would be for @samp{my target}. Links starting with a 1438Links starting with a star like @samp{*My Target} restrict the search to
1435star like @samp{*My Target} restrict the search to headlines. When 1439headlines. When searching, Org-mode will first try an exact match, but
1436searching, Org-mode will first try an exact match, but then move on to 1440then move on to more and more lenient searches. For example, the link
1437more and more lenient searches. For example, the link @samp{[[*My 1441@samp{[[*My Targets]]} will find any of the following:
1438Targets]]} will find any of the following:
1439 1442
1440@example 1443@example
1441** My targets 1444** My targets
@@ -1446,7 +1449,7 @@ Targets]]} will find any of the following:
1446To insert a link targeting a headline, in-buffer completion can be used. 1449To insert a link targeting a headline, in-buffer completion can be used.
1447Just type a star followed by a few optional letters into the buffer and 1450Just type a star followed by a few optional letters into the buffer and
1448press @kbd{M-@key{TAB}}. All headlines in the current buffer will be 1451press @kbd{M-@key{TAB}}. All headlines in the current buffer will be
1449offered as completions. @xref{Managing links}, for more commands 1452offered as completions. @xref{Handling links}, for more commands
1450creating links. 1453creating links.
1451 1454
1452Following a link pushes a mark onto Org-mode's own mark ring. You can 1455Following a link pushes a mark onto Org-mode's own mark ring. You can
@@ -1484,7 +1487,7 @@ the option @code{org-activate-links}. A CamelCase word then leads to a
1484text search such that @samp{CamelCaseLink} is equivalent to 1487text search such that @samp{CamelCaseLink} is equivalent to
1485@samp{[[camel case link]]}. 1488@samp{[[camel case link]]}.
1486 1489
1487@node External links, Managing links, Internal links, Hyperlinks 1490@node External links, Handling links, Internal links, Hyperlinks
1488@section External links 1491@section External links
1489@cindex links, external 1492@cindex links, external
1490@cindex external links 1493@cindex external links
@@ -1540,8 +1543,8 @@ as links. If spaces must be part of the link (for example in
1540@samp{bbdb:Richard Stallman}) or to remove ambiguities about the end of 1543@samp{bbdb:Richard Stallman}) or to remove ambiguities about the end of
1541the link, enclose them in angular brackets. 1544the link, enclose them in angular brackets.
1542 1545
1543@node Managing links, Search Options, External links, Hyperlinks 1546@node Handling links, Search Options, External links, Hyperlinks
1544@section Managing links 1547@section Handling links
1545 1548
1546Org-mode provides methods to create a link in the correct syntax, to 1549Org-mode provides methods to create a link in the correct syntax, to
1547insert it into an org-mode file, and to follow the link. 1550insert it into an org-mode file, and to follow the link.
@@ -1552,15 +1555,17 @@ insert it into an org-mode file, and to follow the link.
1552@item C-c l 1555@item C-c l
1553Store a link to the current location. This is a @emph{global} command 1556Store a link to the current location. This is a @emph{global} command
1554which can be used in any buffer to create a link. The link will be 1557which can be used in any buffer to create a link. The link will be
1555stored for later insertion into an Org-mode buffer (see below). For VM, 1558stored for later insertion into an Org-mode buffer (see below). For
1556RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will point to 1559Org-mode files, if there is a @samp{<<target>>} at the cursor, the link
1557the current article/entry. For W3 and W3M buffers, the link goes to the 1560points to the target. Otherwise it points to the current headline. For
1558current URL. For Org-mode files, the current headline is targeted. For 1561VM, RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will
1559any other files, the link will point to the file, with a search string 1562indicate to the current article/entry. For W3 and W3M buffers, the link
1560(@pxref{Search Options}) pointing to the contents of the current line. 1563goes to the current URL. For any other files, the link will point to
1561If there is an active region, the selected words will form the basis of 1564the file, with a search string (@pxref{Search Options}) pointing to the
1562the search string. The key binding @kbd{C-c l} is only a suggestion - 1565contents of the current line. If there is an active region, the
1563see @ref{Installation and activation}. 1566selected words will form the basis of the search string. The key
1567binding @kbd{C-c l} is only a suggestion - see @ref{Installation and
1568activation}.
1564 1569
1565@kindex C-c C-l 1570@kindex C-c C-l
1566@cindex link completion 1571@cindex link completion
@@ -1571,12 +1576,12 @@ Insert a link. This prompts for a link to be inserted into the buffer.
1571You can just type a link, using text for an internal link, or one of the 1576You can just type a link, using text for an internal link, or one of the
1572link type prefixes mentioned in the examples above. Through completion, 1577link type prefixes mentioned in the examples above. Through completion,
1573all links stored during the current session can be accessed. The link 1578all links stored during the current session can be accessed. The link
1574will be formatted as given in the variable @code{org-link-format} and 1579will be inserted into the buffer, along with a descriptive text. Note
1575inserted into the buffer, along with a descriptive text. Note that you 1580that you don't have to use this command to insert a link. Links in
1576don't have to use this command to insert a link. Links in Org-mode are 1581Org-mode are plain text, and you can type or paste them straight into
1577plain text, and you can type or paste them straight into the buffer. 1582the buffer. By using this command, the links are automatically enclosed
1578By using this command, the links are automatically enclosed in double 1583in double brackets, and you will be asked for the optional descriptive
1579brackets, and you will be asked for the optional descriptive text. 1584text.
1580 1585
1581@kindex C-u C-c C-l 1586@kindex C-u C-c C-l
1582@cindex file name completion 1587@cindex file name completion
@@ -1638,7 +1643,7 @@ previously recorded positions.
1638@end table 1643@end table
1639 1644
1640 1645
1641@node Search Options, Remember, Managing links, Hyperlinks 1646@node Search Options, Remember, Handling links, Hyperlinks
1642@section Search options in file links 1647@section Search options in file links
1643@cindex search option in file links 1648@cindex search option in file links
1644@cindex file links, searching 1649@cindex file links, searching
@@ -1843,9 +1848,9 @@ agenda files (@pxref{Agenda views}) into a single buffer. The buffer is in
1843@code{agenda-mode}, so there are commands to examine and manipulate 1848@code{agenda-mode}, so there are commands to examine and manipulate
1844the TODO entries directly from that buffer (@pxref{Agenda commands}). 1849the TODO entries directly from that buffer (@pxref{Agenda commands}).
1845@xref{Global TODO list}, for more information. 1850@xref{Global TODO list}, for more information.
1846@item @code{org-agenda-include-all-todo} 1851@c @item @code{org-agenda-include-all-todo}
1847If you would like to have all your TODO items listed as part of your 1852@c If you would like to have all your TODO items listed as part of your
1848agenda, customize the variable @code{org-agenda-include-all-todo}. 1853@c agenda, customize the variable @code{org-agenda-include-all-todo}.
1849@end table 1854@end table
1850 1855
1851@node Progress logging, TODO extensions, TODO basics, TODO items 1856@node Progress logging, TODO extensions, TODO basics, TODO items
@@ -2086,7 +2091,7 @@ for @emph{today}, until the entry is marked DONE. I.e., the task will
2086automatically be forwarded until completed. 2091automatically be forwarded until completed.
2087 2092
2088@example 2093@example
2089*** TODO Call Trillian to ask her out for a date on New Years Eve. 2094*** TODO Call Trillian for a date on New Years Eve.
2090 SCHEDULED: <2004-12-25 Sat> 2095 SCHEDULED: <2004-12-25 Sat>
2091@end example 2096@end example
2092 2097
@@ -3352,7 +3357,7 @@ variable is @code{org-startup-align-all-tables}, with a default value
3352@code{nil}. 3357@code{nil}.
3353@example 3358@example
3354align @r{align all tables} 3359align @r{align all tables}
3355noalign @r{don't align table on startup} 3360noalign @r{don't align tables on startup}
3356@end example 3361@end example
3357Here are the options for hiding leading stars in outline headings. The 3362Here are the options for hiding leading stars in outline headings. The
3358corresponding variables are @code{org-hide-leading-stars} and 3363corresponding variables are @code{org-hide-leading-stars} and
@@ -3375,7 +3380,7 @@ end of the file.
3375@item #+TBLFM: 3380@item #+TBLFM:
3376This line contains the formulas for the table directly above the line. 3381This line contains the formulas for the table directly above the line.
3377@item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS: 3382@item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS:
3378These line provide setting for exporting files. For more details see 3383These lines provide setting for exporting files. For more details see
3379@ref{Export options}. 3384@ref{Export options}.
3380@end table 3385@end table
3381 3386
@@ -3563,10 +3568,24 @@ rather use @kbd{C-c .} to re-insert the timestamp.
3563@cindex FAQ 3568@cindex FAQ
3564 3569
3565@enumerate 3570@enumerate
3571
3572@cindex allout.el, conflict with
3573@cindex @code{keymapp nil} error
3574@item @b{When I try to use Org-mode, I always get
3575@code{(wrong-type-argument keymapp nil)}}.@*
3576This is a conflict with an outdated version of the @file{allout.el}
3577package which pretends to be also the standard outline-mode but is not.
3578This happens with older versions of @file{allout.el}, for example the
3579one distributed with Emacs 21. Upgrade to Emacs 22 and this problem
3580will disappear. If for some reason you cannot do this, make sure that
3581org.el is loaded @emph{before} @file{allout.el}, for example by putting
3582@code{(require 'org)} early enough into your @file{.emacs} file.
3583
3566@item @b{Org-mode seems to be a useful default mode for the various 3584@item @b{Org-mode seems to be a useful default mode for the various
3567@file{README} files I have scattered through my directories. How do I 3585@file{README} files I have scattered through my directories. How do I
3568turn it on for all @file{README} files?}@* 3586turn it on for all @file{README} files?}
3569@c 3587@c @*
3588
3570@example 3589@example
3571(add-to-list 'auto-mode-alist '("README$" . org-mode)) 3590(add-to-list 'auto-mode-alist '("README$" . org-mode))
3572@end example 3591@end example
@@ -3584,7 +3603,7 @@ convention that hides the link part and the brackets, only showing the
3584description part. How can I convert my old links to this new format?}@* 3603description part. How can I convert my old links to this new format?}@*
3585@c 3604@c
3586Execute once in each Org-mode file: @kbd{M-x org-upgrade-old-links}. 3605Execute once in each Org-mode file: @kbd{M-x org-upgrade-old-links}.
3587The replaces angular brackets with the link format. 3606This replaces angular brackets with the new link format.
3588 3607
3589@item @b{I don't care if you find the new bracket links great, I am 3608@item @b{I don't care if you find the new bracket links great, I am
3590attached to the old style using angular brackets and no hiding of the 3609attached to the old style using angular brackets and no hiding of the
@@ -3890,6 +3909,9 @@ control.
3890@item 3909@item
3891Kevin Rogers contributed code to access VM files on remote hosts. 3910Kevin Rogers contributed code to access VM files on remote hosts.
3892@item 3911@item
3912Frank Ruell solved the mystery of the @code{keymapp nil} bug, a conflict
3913with @file{allout.el}.
3914@item
3893Philip Rooke created the Org-mode reference card and provided lots of feedback. 3915Philip Rooke created the Org-mode reference card and provided lots of feedback.
3894@item 3916@item
3895Christian Schlauer proposed angular brackets around links, among other 3917Christian Schlauer proposed angular brackets around links, among other
diff --git a/man/pgg.texi b/man/pgg.texi
index 80dce7a9639..b8934b526e3 100644
--- a/man/pgg.texi
+++ b/man/pgg.texi
@@ -234,6 +234,14 @@ variable to @code{nil}.
234Elapsed time for expiration in seconds. 234Elapsed time for expiration in seconds.
235@end defvar 235@end defvar
236 236
237@defvar pgg-gpg-use-agent
238When using GnuPG (gpg) as PGP scheme you can use @code{gpg-agent} for
239caching@footnote{Actually @code{gpg-agent} does not cache passphrases
240but private keys. On the other hand, from a users point of view this
241technical difference isn't visible.}. If non-@code{nil} try to use a
242running @code{gpg-agent}. It defaults to @code{nil}.
243@end defvar
244
237@node Default user identity 245@node Default user identity
238@section Default user identity 246@section Default user identity
239 247
diff --git a/man/xresmini.texi b/man/xresmini.texi
new file mode 100644
index 00000000000..bf791a59e36
--- /dev/null
+++ b/man/xresmini.texi
@@ -0,0 +1,303 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1987, 1993, 1994, 1995, 1997, 2001, 2002, 2003,
3@c 2004, 2005, 2006 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node X Resources, Antinews, Emacs Invocation, Top
6@appendix X Options and Resources
7
8 You can customize some X-related aspects of Emacs behavior using X
9resources, as is usual for programs that use X. On MS-Windows, you
10can customize some of the same aspects using the system registry.
11@xref{MS-Windows Registry}. Likewise, Emacs on MacOS Carbon emulates X
12resources using the Preferences system. @xref{Mac Environment Variables}.
13
14 When Emacs is built using an ``X toolkit'', such as Lucid or
15LessTif, you need to use X resources to customize the appearance of
16the widgets, including the menu-bar, scroll-bar, and dialog boxes.
17This is because the libraries that implement these don't provide for
18customization through Emacs. GTK+ widgets use a separate system of
19``GTK resources''. In this chapter we describe the most commonly used
20resource specifications. For full documentation, see the online
21manual.
22
23@c Add xref for LessTif/Motif menu resources.
24
25@menu
26* Resources:: Using X resources with Emacs (in general).
27* Table of Resources:: Table of specific X resources that affect Emacs.
28* Face Resources:: X resources for customizing faces.
29* Lucid Resources:: X resources for Lucid menus.
30* GTK resources:: Resources for GTK widgets.
31@end menu
32
33@node Resources
34@appendixsec X Resources
35@cindex resources
36@cindex X resources
37@cindex @file{~/.Xdefaults} file
38@cindex @file{~/.Xresources} file
39
40 Programs running under the X Window System organize their user
41options under a hierarchy of classes and resources. You can specify
42default values for these options in your X resources file, usually
43named @file{~/.Xdefaults} or @file{~/.Xresources}.
44If changes in @file{~/.Xdefaults} do not
45take effect, it is because your X server stores its own list of
46resources; to update them, use the shell command @command{xrdb}---for
47instance, @samp{xrdb ~/.Xdefaults}.
48
49 Each line in the file specifies a value for one option or for a
50collection of related options, for one program or for several programs
51(optionally even for all programs).
52
53@cindex Registry (MS-Windows)
54 MS-Windows systems don't support @file{~/.Xdefaults} files, but
55Emacs compiled for Windows looks for X resources in the Windows
56Registry, under the key @samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs}
57and then under the key @samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs}.
58The menu and scrollbars are native widgets on MS-Windows, so they are
59only customizable via the system-wide settings in the Display Control
60Panel. You can also set resources using the @samp{-xrm} command line
61option (see below.)
62
63 Applications such as Emacs look for resources with specific names
64and their particular meanings. Case distinctions are significant in
65these names. Each resource specification in @file{~/.Xdefaults}
66states the name of the program and the name of the resource. For
67Emacs, the program name is @samp{Emacs}. It looks like this:
68
69@example
70Emacs.borderWidth: 2
71@end example
72
73 The order in which the lines appear in the file does not matter.
74Also, command-line options always override the X resources file.
75
76 You can experiment with the effect of different resource settings
77with the @code{editres} program. Select @samp{Get Tree} from the
78@samp{Commands} menu, then click on an Emacs frame. This will display
79a tree showing the structure of X toolkit widgets used in an Emacs
80frame. Select one of them, such as @samp{menubar}, then select
81@samp{Show Resource Box} from the @samp{Commands} menu. This displays
82a list of all the meaningful X resources for that widget, and allows
83you to edit them. Changes take effect when you click on the
84@samp{Apply} button. (See the @code{editres} man page for more
85details.)
86
87@node Table of Resources
88@appendixsec Table of X Resources for Emacs
89
90 This table lists the resource names that designate options for
91Emacs, not counting those for the appearance of the menu bar, each
92with the class that it belongs to:
93
94@table @asis
95@item @code{background} (class @code{Background})
96Background color name.
97
98@item @code{borderColor} (class @code{BorderColor})
99Color name for the external border.
100
101@item @code{cursorColor} (class @code{Foreground})
102Color name for text cursor (point).
103
104@item @code{font} (class @code{Font})
105Font name (or fontset name, @pxref{Fontsets}) for @code{default} font.
106
107@item @code{foreground} (class @code{Foreground})
108Color name for text.
109
110@item @code{geometry} (class @code{Geometry})
111Window size and position. Be careful not to specify this resource as
112@samp{emacs*geometry}, because that may affect individual menus as well
113as the Emacs frame itself.
114
115If this resource specifies a position, that position applies only to the
116initial Emacs frame (or, in the case of a resource for a specific frame
117name, only that frame). However, the size, if specified here, applies to
118all frames.
119
120@item @code{iconName} (class @code{Title})
121Name to display in the icon.
122
123@item @code{internalBorder} (class @code{BorderWidth})
124Width in pixels of the internal border.
125
126@item @code{lineSpacing} (class @code{LineSpacing})
127@cindex line spacing
128@cindex leading
129Additional space (@dfn{leading}) between lines, in pixels.
130
131@item @code{menuBar} (class @code{MenuBar})
132@cindex menu bar
133Give frames menu bars if @samp{on}; don't have menu bars if
134@samp{off}. @xref{Lucid Resources}, and @ref{LessTif Resources}, for
135how to control the appearance of the menu bar if you have one.
136
137@item @code{pointerColor} (class @code{Foreground})
138Color of the mouse cursor.
139
140@item @code{screenGamma} (class @code{ScreenGamma})
141@cindex gamma correction
142Gamma correction for colors, equivalent to the frame parameter
143@code{screen-gamma}.
144
145@item @code{title} (class @code{Title})
146Name to display in the title bar of the initial Emacs frame.
147
148@item @code{toolBar} (class @code{ToolBar})
149@cindex tool bar
150Number of lines to reserve for the tool bar. A zero value suppresses
151the tool bar. If the value is non-zero and
152@code{auto-resize-tool-bars} is non-@code{nil}, the tool bar's size
153will be changed automatically so that all tool bar items are visible.
154
155@item @code{useXIM} (class @code{UseXIM})
156@cindex XIM
157@cindex X input methods
158@cindex input methods, X
159Turn off use of X input methods (XIM) if @samp{false} or @samp{off}.
160This is only relevant if your Emacs is actually built with XIM
161support. It is potentially useful to turn off XIM for efficiency,
162especially slow X client/server links.
163
164@item @code{verticalScrollBars} (class @code{ScrollBars})
165Give frames scroll bars if @samp{on}; don't have scroll bars if
166@samp{off}.
167@end table
168
169@node Face Resources
170@appendixsec X Resources for Faces
171
172 You can use resources to customize the appearance of particular
173faces (@pxref{Faces}):
174
175@table @code
176@item @var{face}.attributeForeground
177Foreground color for face @var{face}.
178@item @var{face}.attributeBackground
179Background color for face @var{face}.
180@item @var{face}.attributeUnderline
181Underline flag for face @var{face}. Use @samp{on} or @samp{true} for
182yes.
183@item @var{face}.attributeStrikeThrough
184@itemx @var{face}.attributeOverline
185@itemx @var{face}.attributeBox
186@itemx @var{face}.attributeInverse
187Likewise, for other boolean font attributes.
188@item @var{face}.attributeStipple
189The name of a pixmap data file to use for the stipple pattern, or
190@code{false} to not use stipple for the face @var{face}.
191@item @var{face}.attributeBackgroundPixmap
192The background pixmap for the face @var{face}. Should be a name of a
193pixmap file or @code{false}.
194@item @var{face}.attributeFont
195Font name (full XFD name or valid X abbreviation) for face @var{face}.
196Instead of this, you can specify the font through separate attributes.
197@end table
198
199 Instead of using @code{attributeFont} to specify a font name, you can
200select a font through these separate attributes:
201
202@table @code
203@item @var{face}.attributeFamily
204Font family for face @var{face}.
205@item @var{face}.attributeHeight
206Height of the font to use for face @var{face}: either an integer
207specifying the height in units of 1/10@dmn{pt}, or a floating point
208number that specifies a scale factor to scale the underlying face's
209default font, or a function to be called with the default height which
210will return a new height.
211@item @var{face}.attributeWidth
212@itemx @var{face}.attributeWeight
213@itemx @var{face}.attributeSlant
214Each of these resources corresponds to a like-named font attribute,
215and you write the resource value the same as the symbol you would use
216for the font attribute value.
217@item @var{face}.attributeBold
218Bold flag for face @var{face}---instead of @code{attributeWeight}. Use @samp{on} or @samp{true} for
219yes.
220@item @var{face}.attributeItalic
221Italic flag for face @var{face}---instead of @code{attributeSlant}.
222@end table
223
224@node Lucid Resources
225@appendixsec Lucid Menu X Resources
226@cindex Menu X Resources (Lucid widgets)
227@cindex Lucid Widget X Resources
228
229 If the Emacs installed at your site was built to use the X toolkit
230with the Lucid menu widgets, then the menu bar is a separate widget
231and has its own resources. The resource specifications start with
232@samp{Emacs.pane.menubar}---for instance, to specify the font
233@samp{8x16} for the menu-bar items, write this:
234
235@example
236Emacs.pane.menubar.font: 8x16
237@end example
238
239@noindent
240Resources for @emph{non-menubar} toolkit pop-up menus have
241@samp{menu*} instead of @samp{pane.menubar}. For example, to specify
242the font @samp{8x16} for the pop-up menu items, write this:
243
244@example
245Emacs.menu*.font: 8x16
246@end example
247
248@noindent
249For dialog boxes, use @samp{dialog*}:
250
251@example
252Emacs.dialog*.font: 8x16
253@end example
254
255@noindent
256The Lucid menus can display multilingual text in your locale. For
257more information about fontsets see the man page for
258@code{XCreateFontSet}. To enable multilingual menu text you specify a
259@code{fontSet} resource instead of the font resource. If both
260@code{font} and @code{fontSet} resources are specified, the
261@code{fontSet} resource is used.
262
263 Thus, to specify @samp{-*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*}
264for both the popup and menu bar menus, write this:
265
266@example
267Emacs*menu*fontSet: -*-helvetica-medium-r-*--*-120-*-*-*-*-*-*,*
268@end example
269
270@noindent
271The @samp{*menu*} as a wildcard matches @samp{pane.menubar} and
272@samp{menu@dots{}}.
273
274 Experience shows that on some systems you may need to add
275@samp{shell.}@: before the @samp{pane.menubar} or @samp{menu*}. On
276some other systems, you must not add @samp{shell.}. The generic wildcard
277approach should work on both kinds of systems.
278
279 Here is a list of the specific resources for menu bars and pop-up menus:
280
281@table @code
282@item font
283Font for menu item text.
284@item fontSet
285Fontset for menu item text.
286@item foreground
287Color of the foreground.
288@item background
289Color of the background.
290@item buttonForeground
291In the menu bar, the color of the foreground for a selected item.
292@item margin
293The margin of the menu bar, in characters. Default is 1.
294@end table
295
296@node GTK resources
297@appendixsec GTK resources
298
299@c Waiting for contents
300
301@ignore
302 arch-tag: e1856f29-2482-42c0-a990-233cdccd1f21
303@end ignore
diff --git a/man/xresources.texi b/man/xresources.texi
index 87781da582c..ce6709ad764 100644
--- a/man/xresources.texi
+++ b/man/xresources.texi
@@ -301,12 +301,10 @@ program outputs information saying which ones.
301@node Face Resources 301@node Face Resources
302@appendixsec X Resources for Faces 302@appendixsec X Resources for Faces
303 303
304 You can also use resources to customize the appearance of particular 304 You can use resources to customize the appearance of particular
305faces (@pxref{Faces}): 305faces (@pxref{Faces}):
306 306
307@table @code 307@table @code
308@item @var{face}.attributeFont
309Font for face @var{face}.
310@item @var{face}.attributeForeground 308@item @var{face}.attributeForeground
311Foreground color for face @var{face}. 309Foreground color for face @var{face}.
312@item @var{face}.attributeBackground 310@item @var{face}.attributeBackground
@@ -314,49 +312,45 @@ Background color for face @var{face}.
314@item @var{face}.attributeUnderline 312@item @var{face}.attributeUnderline
315Underline flag for face @var{face}. Use @samp{on} or @samp{true} for 313Underline flag for face @var{face}. Use @samp{on} or @samp{true} for
316yes. 314yes.
315@item @var{face}.attributeStrikeThrough
316@itemx @var{face}.attributeOverline
317@itemx @var{face}.attributeBox
318@itemx @var{face}.attributeInverse
319Likewise, for other boolean font attributes.
320@item @var{face}.attributeStipple
321The name of a pixmap data file to use for the stipple pattern, or
322@code{false} to not use stipple for the face @var{face}.
323@item @var{face}.attributeBackgroundPixmap
324The background pixmap for the face @var{face}. Should be a name of a
325pixmap file or @code{false}.
326@item @var{face}.attributeFont
327Font name (full XFD name or valid X abbreviation) for face @var{face}.
328Instead of this, you can specify the font through separate attributes.
329@end table
330
331 Instead of using @code{attributeFont} to specify a font name, you can
332select a font through these separate attributes:
333
334@table @code
317@item @var{face}.attributeFamily 335@item @var{face}.attributeFamily
318Font family for face @var{face}. 336Font family for face @var{face}.
319@item @var{face}.attributeWidth
320Relative proportional width of the font to use for face @var{face}.
321It should be one of @code{ultra-condensed}, @code{extra-condensed},
322@code{condensed}, @code{semi-condensed}, @code{normal},
323@code{semi-expanded}, @code{expanded}, @code{extra-expanded}, or
324@code{ultra-expanded}.
325@item @var{face}.attributeHeight 337@item @var{face}.attributeHeight
326Height of the font to use for face @var{face}: either an integer 338Height of the font to use for face @var{face}: either an integer
327specifying the height in units of 1/10@dmn{pt}, or a floating point 339specifying the height in units of 1/10@dmn{pt}, or a floating point
328number that specifies a scale factor to scale the underlying face's 340number that specifies a scale factor to scale the underlying face's
329default font, or a function to be called with the default height which 341default font, or a function to be called with the default height which
330will return a new height. 342will return a new height.
331@item @var{face}.attributeWeight 343@item @var{face}.attributeWidth
332A weight to use for the face @var{face}. It must be one of 344@itemx @var{face}.attributeWeight
333@code{ultra-bold}, @code{extra-bold}, @code{bold}, 345@itemx @var{face}.attributeSlant
334@code{semi-bold}, @code{normal}, @code{semi-light}, @code{light}, 346Each of these resources corresponds to a like-named font attribute,
335@code{extra-light}, @code{ultra-light}. 347and you write the resource value the same as the symbol you would use
336@item @var{face}.attributeSlant 348for the font attribute value.
337The slant to use for the font of face @var{face}. It must be one of
338@code{italic}, @code{oblique}, @code{normal},
339@code{reverse-italic}, or @code{reverse-oblique}.
340@item @var{face}.attributeStrikeThrough
341Whether the face @var{face} should be drawn with a line striking
342through the characters.
343@item @var{face}.attributeOverline
344Whether the characters in the face @var{face} should be overlined.
345@item @var{face}.attributeBox
346Whether to draw a box around the characters in face @var{face}.
347@item @var{face}.attributeInverse
348Whether to display the characters in face @var{face} in inverse
349video.
350@item @var{face}.attributeStipple
351The name of a pixmap data file to use for the stipple pattern, or
352@code{false} to not use stipple for the face @var{face}.
353@item @var{face}.attributeBackgroundPixmap
354The background pixmap for the face @var{face}. Should be a name of a
355pixmap file or @code{false}.
356@item @var{face}.attributeBold 349@item @var{face}.attributeBold
357Whether to draw the characters in the face @var{face} as bold. 350Bold flag for face @var{face}---instead of @code{attributeWeight}. Use @samp{on} or @samp{true} for
351yes.
358@item @var{face}.attributeItalic 352@item @var{face}.attributeItalic
359Whether to draw the characters in the face @var{face} as italic. 353Italic flag for face @var{face}---instead of @code{attributeSlant}.
360@end table 354@end table
361 355
362@node Lucid Resources 356@node Lucid Resources
diff --git a/src/.gdbinit b/src/.gdbinit
index af2114ebd18..881a11dc8c0 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -88,15 +88,13 @@ end
88# Print out s-expressions from tool bar 88# Print out s-expressions from tool bar
89define pp1 89define pp1
90 set $tmp = $arg0 90 set $tmp = $arg0
91 echo $arg0
92 printf " = "
93 set $output_debug = print_output_debug_flag 91 set $output_debug = print_output_debug_flag
94 set print_output_debug_flag = 0 92 set print_output_debug_flag = 0
95 set safe_debug_print ($tmp) 93 set safe_debug_print ($tmp)
96 set print_output_debug_flag = $output_debug 94 set print_output_debug_flag = $output_debug
97end 95end
98document pp1 96document pp1
99Print the argument as an emacs s-expression 97Print the argument as an emacs s-expression.
100Works only when an inferior emacs is executing. 98Works only when an inferior emacs is executing.
101For use on tool bar when debugging in Emacs 99For use on tool bar when debugging in Emacs
102where the variable name would not otherwise 100where the variable name would not otherwise
@@ -119,8 +117,6 @@ end
119# Print value of lisp variable 117# Print value of lisp variable
120define pv1 118define pv1
121 set $tmp = "$arg0" 119 set $tmp = "$arg0"
122 echo $arg0
123 printf " = "
124 set $output_debug = print_output_debug_flag 120 set $output_debug = print_output_debug_flag
125 set print_output_debug_flag = 0 121 set print_output_debug_flag = 0
126 set safe_debug_print (find_symbol_value (intern ($tmp))) 122 set safe_debug_print (find_symbol_value (intern ($tmp)))
@@ -129,9 +125,8 @@ end
129document pv1 125document pv1
130Print the value of the lisp variable given as argument. 126Print the value of the lisp variable given as argument.
131Works only when an inferior emacs is executing. 127Works only when an inferior emacs is executing.
132For use on tool bar when debugging in Emacs 128For use when debugging in Emacs where the variable
133where the variable name would not otherwise 129name would not otherwise be recorded in the GUD buffer.
134be recorded in the GUD buffer.
135end 130end
136 131
137# Print out current buffer point and boundaries 132# Print out current buffer point and boundaries
diff --git a/src/ChangeLog b/src/ChangeLog
index 5c66a6b5c7d..f68510f2fb4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,11 +1,172 @@
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
642006-04-27 Nick Roberts <nickrob@snap.net.nz>
65
66 * .gdbinit (pp1, pv1): Only print value as expression is now
67 printed out by gud-print.
68 (pv1): Correct doc string.
69
702006-04-26 Stefan Monnier <monnier@iro.umontreal.ca>
71
72 * keymap.c (store_in_keymap): Change `def' arg to not be `register'.
73 Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8):
74 keymap.c:895: error: address of register variable `def' requested.
75
762006-04-26 Jason Rumney <jasonr@gnu.org>
77
78 * w32term.c (construct_mouse_wheel): Handle negative coordinates.
79
80 * w32fns.c (w32_wnd_proc) <WM_LBUTTONDOWN, WM_RBUTTONDOWN>:
81 <WM_LBUTTONUP, WM_RBUTTONUP>: Call signal_user_input in the cases
82 where we preempt mouse_button_timer.
83
842006-04-25 Miles Bader <miles@gnu.org>
85
86 * editfns.c (Ffield_beginning, find_field): Undo change of 2006-04-23.
87
882006-04-24 Stefan Monnier <monnier@iro.umontreal.ca>
89
90 * process.h: Include headers for pid_t.
91
922006-04-24 Kim F. Storm <storm@cua.dk>
93
94 * xdisp.c (fill_stretch_glyph_string): Set s->nchars = 1 for code which
95 does last_glyph=s->first_glyph+s->nchars-1, e.g. if stretch has relief.
96 (produce_stretch_glyph): Assume that face box height and width is
97 already included in stretch glyph size so caller doesn't have to
98 consider the extra space otherwise added (fixes problem in ses.el).
99
100 * frame.c (x_set_font): Clear f->n_tool_bar_rows and current frame
101 matrices to force recalculation of tool-bar height after font change.
102
103 * xdisp.c (tool_bar_lines_needed): New local `temp_row' for clarity.
104 Clear it when done, so we don't accidentally draw a second copy of
105 the tool-bar after resetting f->n_tool_bar_rows.
106 (redisplay_tool_bar): Update tool-bar-lines frame parameter whenever
107 we recalculate f->n_tool_bar_rows.
108
1092006-04-23 Lars Hansen <larsh@soem.dk>
110
111 * editfns.c (find_field): Fix comment.
112 (Ffield_beginning): Fix bug when POS is at field beginning.
113
1142006-04-22 Eli Zaretskii <eliz@gnu.org>
115
116 * puresize.h (BASE_PURESIZE): Increase to 1205000.
117
1182006-04-21 Kim F. Storm <storm@cua.dk>
119
120 * xdisp.c (redisplay_window): Fix last change. Don't recenter if
121 window start is at BEGV.
122
123 * dispextern.h (struct image): New member `corners'.
124 (TOP_CORNER, LEFT_CORNER, BOT_CORNER, RIGHT_CORNER): New macros.
125
126 * image.c (four_corners_best): New arg CORNERS specifies what pixels
127 to look at in case image has margin.
128 (x_create_bitmap_mask): Pass NULL for CORNERS to four_corners_best.
129 (image_background, image_background_transparent)
130 (x_build_heuristic_mask): Pass img->corners to four_corners_best.
131 (gif_load): Set img->corners according to image's margin spec.
132 Use img->corners values directly where applicable.
133 Save image extension data in img->data.lisp_val.
134 (gif_clear_image): New function to free img->data.lisp_val.
135 (gif_type): Use it instead of generic x_clear_image.
136 (Fimage_extension_data): New defun.
137 (syms_of_image): Defsubr it.
138
1392006-04-21 John Sullivan <john@wjsullivan.net> (tiny change)
140
141 * window.c (Fdisplay_buffer): Doc fix.
142
1432006-04-21 Eli Zaretskii <eliz@gnu.org>
144
145 * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Increase to 25000.
146
1472006-04-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
148
149 * image.c [MAC_OS] (xpm_load_image): Fill in background field
150 while we have ximg handy.
151
152 * macmenu.c (restore_menu_items, save_menu_items): New functions
153 from xmenu.c.
154 (set_frame_menubar, digest_single_submenu): Apply 2006-04-18
155 changes for xmenu.c.
156
157 * macterm.c (x_per_char_metric): Return NULL if glyph width is 0.
158 (add_mac_font_name): New function.
159 (init_font_name_table): Use it. Adopt the first found font from
160 those having the same family name.
161
12006-04-21 Nick Roberts <nickrob@snap.net.nz> 1622006-04-21 Nick Roberts <nickrob@snap.net.nz>
2 163
3 * xdisp.c (note_mouse_highlight): Use build_string. 164 * xdisp.c (note_mouse_highlight): Use build_string.
4 165
52006-04-20 Lars Hansen <larsh@soem.dk> 1662006-04-20 Lars Hansen <larsh@soem.dk>
6 167
7 * textprop.c (Fremove_list_of_text_properties): Ensure 168 * textprop.c (Fremove_list_of_text_properties):
8 modify_region is called only when buffer is modified and that 169 Ensure modify_region is called only when buffer is modified and that
9 signal_after_change is allways called in that case. 170 signal_after_change is allways called in that case.
10 171
11 * print.c (PRINTFINISH): Call signal_after_change. 172 * print.c (PRINTFINISH): Call signal_after_change.
@@ -23,8 +184,8 @@
23 184
24 * xmenu.c (restore_menu_items, save_menu_items): New fns. 185 * xmenu.c (restore_menu_items, save_menu_items): New fns.
25 (set_frame_menubar): Use save_menu_items. Save updated vector in 186 (set_frame_menubar): Use save_menu_items. Save updated vector in
26 the frame before unwinding it. Don't use unuse_menu_items. Don't 187 the frame before unwinding it. Don't use unuse_menu_items.
27 use discard_menu_items. 188 Don't use discard_menu_items.
28 (digest_single_submenu): Abort if an item is not in a pane. 189 (digest_single_submenu): Abort if an item is not in a pane.
29 (init_menu_items): Put the error check at the top. 190 (init_menu_items): Put the error check at the top.
30 191
@@ -51,8 +212,8 @@
51 212
52 * macterm.c (XCreateGC, x_per_char_metric, xlfdpat_create) 213 * macterm.c (XCreateGC, x_per_char_metric, xlfdpat_create)
53 (init_font_name_table, init_font_name_table, mac_do_list_fonts) 214 (init_font_name_table, init_font_name_table, mac_do_list_fonts)
54 (XLoadQueryFont, mac_store_apple_event): Don't check 215 (XLoadQueryFont, mac_store_apple_event): Don't check return value
55 return value of xmalloc. 216 of xmalloc.
56 217
572006-04-17 Kim F. Storm <storm@cua.dk> 2182006-04-17 Kim F. Storm <storm@cua.dk>
58 219
@@ -96,8 +257,7 @@
962006-04-13 Kenichi Handa <handa@m17n.org> 2572006-04-13 Kenichi Handa <handa@m17n.org>
97 258
98 * coding.c (setup_coding_system): Fix previous change. 259 * coding.c (setup_coding_system): Fix previous change.
99 (encode_coding): If eol_type is not yet decided, use 260 (encode_coding): If eol_type is not yet decided, use system_eol_type.
100 system_eol_type.
101 (shrink_encoding_region): If eol_type is not yet decided and 261 (shrink_encoding_region): If eol_type is not yet decided and
102 system_eol_type is not LF, don't shrink. 262 system_eol_type is not LF, don't shrink.
103 263
@@ -197,8 +357,8 @@
197 within ||. Add explicit braces to avoid ambiguous `else'. 357 within ||. Add explicit braces to avoid ambiguous `else'.
198 (dump_glyph_row): Remove label for `inverse_p' from legend. 358 (dump_glyph_row): Remove label for `inverse_p' from legend.
199 359
200 * xfaces.c (Finternal_merge_in_global_face, try_font_list): Add 360 * xfaces.c (Finternal_merge_in_global_face, try_font_list):
201 explicit braces to avoid ambiguous `else'. 361 Add explicit braces to avoid ambiguous `else'.
202 362
2032006-04-11 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> (tiny change) 3632006-04-11 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> (tiny change)
204 364
@@ -907,11 +1067,6 @@
907 (mac_set_clip_rectangles): When resetting clip region, make it 1067 (mac_set_clip_rectangles): When resetting clip region, make it
908 empty instead of disposing of it. 1068 empty instead of disposing of it.
909 1069
9102006-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
911
912 * keymap.c (store_in_keymap): Change `def' arg to not be `register'.
913 Seems to trigger a bug in gcc-amd64 4.0.2 20051125 (Red Hat 4.0.2-8).
914
9152006-02-20 Kim F. Storm <storm@cua.dk> 10702006-02-20 Kim F. Storm <storm@cua.dk>
916 1071
917 * Makefile.in: Add fringe.elc to WINDOW_SUPPORT. 1072 * Makefile.in: Add fringe.elc to WINDOW_SUPPORT.
@@ -1586,7 +1741,7 @@
1586 1741
1587 * image.c [MAC_OS] (find_image_fsspec): Likewise. 1742 * image.c [MAC_OS] (find_image_fsspec): Likewise.
1588 1743
15892005-12-23 Martin Rudalics <rudalics@gmx.at> (tiny change) 17442005-12-23 Martin Rudalics <rudalics@gmx.at>
1590 1745
1591 * insdel.c (insert, insert_and_inherit, insert_before_markers) 1746 * insdel.c (insert, insert_and_inherit, insert_before_markers)
1592 (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/dispextern.h b/src/dispextern.h
index f6b0fbbbf15..b1e71315086 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2417,6 +2417,15 @@ struct image
2417#define DEFAULT_IMAGE_WIDTH 30 2417#define DEFAULT_IMAGE_WIDTH 30
2418#define DEFAULT_IMAGE_HEIGHT 30 2418#define DEFAULT_IMAGE_HEIGHT 30
2419 2419
2420 /* Top/left and bottom/right corner pixel of actual image data.
2421 Used by four_corners_best to consider the real image data,
2422 rather than looking at the optional image margin. */
2423 int corners[4];
2424#define TOP_CORNER 0
2425#define LEFT_CORNER 1
2426#define BOT_CORNER 2
2427#define RIGHT_CORNER 3
2428
2420 /* Percent of image height used as ascent. A value of 2429 /* Percent of image height used as ascent. A value of
2421 CENTERED_IMAGE_ASCENT means draw the image centered on the 2430 CENTERED_IMAGE_ASCENT means draw the image centered on the
2422 line. */ 2431 line. */
diff --git a/src/dispnew.c b/src/dispnew.c
index 2884a687e5f..e8833376701 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -4142,7 +4142,6 @@ update_window (w, force_p)
4142 update_window_line (w, MATRIX_ROW_VPOS (mode_line_row, 4142 update_window_line (w, MATRIX_ROW_VPOS (mode_line_row,
4143 desired_matrix), 4143 desired_matrix),
4144 &mouse_face_overwritten_p); 4144 &mouse_face_overwritten_p);
4145 changed_p = 1;
4146 } 4145 }
4147 4146
4148 /* Find first enabled row. Optimizations in redisplay_internal 4147 /* Find first enabled row. Optimizations in redisplay_internal
@@ -4212,7 +4211,6 @@ update_window (w, force_p)
4212 { 4211 {
4213 header_line_row->y = 0; 4212 header_line_row->y = 0;
4214 update_window_line (w, 0, &mouse_face_overwritten_p); 4213 update_window_line (w, 0, &mouse_face_overwritten_p);
4215 changed_p = 1;
4216 } 4214 }
4217 4215
4218 /* Fix the appearance of overlapping/overlapped rows. */ 4216 /* Fix the appearance of overlapping/overlapped rows. */
diff --git a/src/editfns.c b/src/editfns.c
index b0e79057988..4f8b349b749 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -489,7 +489,7 @@ get_pos_property (position, prop, object)
489} 489}
490 490
491/* Find the field surrounding POS in *BEG and *END. If POS is nil, 491/* Find the field surrounding POS in *BEG and *END. If POS is nil,
492 the value of point is used instead. If BEG or END null, 492 the value of point is used instead. If BEG or END is null,
493 means don't store the beginning or end of the field. 493 means don't store the beginning or end of the field.
494 494
495 BEG_LIMIT and END_LIMIT serve to limit the ranged of the returned 495 BEG_LIMIT and END_LIMIT serve to limit the ranged of the returned
diff --git a/src/frame.c b/src/frame.c
index 914bc5abf65..3efd04bf110 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1,5 +1,5 @@
1/* Generic frame functions. 1/* Generic frame functions.
2 Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2 Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2006,
3 2004, 2005, 2006 Free Software Foundation, Inc. 3 2004, 2005, 2006 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -3093,9 +3093,15 @@ x_set_font (f, arg, oldval)
3093 return; 3093 return;
3094 } 3094 }
3095 store_frame_param (f, Qfont, result); 3095 store_frame_param (f, Qfont, result);
3096
3096 if (!NILP (Fequal (result, oldval))) 3097 if (!NILP (Fequal (result, oldval)))
3097 return; 3098 return;
3098 3099
3100 /* Recalculate toolbar height. */
3101 f->n_tool_bar_rows = 0;
3102 /* Ensure we redraw it. */
3103 clear_current_matrices (f);
3104
3099 recompute_basic_faces (f); 3105 recompute_basic_faces (f);
3100 } 3106 }
3101 else 3107 else
diff --git a/src/image.c b/src/image.c
index 10c402be119..688ff200055 100644
--- a/src/image.c
+++ b/src/image.c
@@ -603,7 +603,9 @@ x_destroy_all_bitmaps (dpyinfo)
603/* Useful functions defined in the section 603/* Useful functions defined in the section
604 `Image type independent image structures' below. */ 604 `Image type independent image structures' below. */
605 605
606static unsigned long four_corners_best P_ ((XImagePtr ximg, unsigned long width, 606static unsigned long four_corners_best P_ ((XImagePtr ximg,
607 int *corners,
608 unsigned long width,
607 unsigned long height)); 609 unsigned long height));
608 610
609static int x_create_x_image_and_pixmap P_ ((struct frame *f, int width, int height, 611static int x_create_x_image_and_pixmap P_ ((struct frame *f, int width, int height,
@@ -657,7 +659,7 @@ x_create_bitmap_mask (f, id)
657 return -1; 659 return -1;
658 } 660 }
659 661
660 bg = four_corners_best (ximg, width, height); 662 bg = four_corners_best (ximg, NULL, width, height);
661 663
662 for (y = 0; y < ximg->height; ++y) 664 for (y = 0; y < ximg->height; ++y)
663 { 665 {
@@ -732,7 +734,7 @@ Lisp_Object Qxbm;
732/* Keywords. */ 734/* Keywords. */
733 735
734extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile; 736extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile;
735extern Lisp_Object QCdata, QCtype; 737extern Lisp_Object QCdata, QCtype, Qcount;
736extern Lisp_Object Qcenter; 738extern Lisp_Object Qcenter;
737Lisp_Object QCascent, QCmargin, QCrelief; 739Lisp_Object QCascent, QCmargin, QCrelief;
738Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask; 740Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask;
@@ -1141,6 +1143,27 @@ or omitted means use the selected frame. */)
1141 return mask; 1143 return mask;
1142} 1144}
1143 1145
1146DEFUN ("image-extension-data", Fimage_extension_data, Simage_extension_data, 1, 2, 0,
1147 doc: /* Return extension data for image SPEC.
1148FRAME is the frame on which the image will be displayed. FRAME nil
1149or omitted means use the selected frame. */)
1150 (spec, frame)
1151 Lisp_Object spec, frame;
1152{
1153 Lisp_Object ext;
1154
1155 ext = Qnil;
1156 if (valid_image_p (spec))
1157 {
1158 struct frame *f = check_x_frame (frame);
1159 int id = lookup_image (f, spec);
1160 struct image *img = IMAGE_FROM_ID (f, id);
1161 ext = img->data.lisp_val;
1162 }
1163
1164 return ext;
1165}
1166
1144 1167
1145/*********************************************************************** 1168/***********************************************************************
1146 Image type independent image structures 1169 Image type independent image structures
@@ -1171,6 +1194,7 @@ make_image (spec, hash)
1171 img->data.lisp_val = Qnil; 1194 img->data.lisp_val = Qnil;
1172 img->ascent = DEFAULT_IMAGE_ASCENT; 1195 img->ascent = DEFAULT_IMAGE_ASCENT;
1173 img->hash = hash; 1196 img->hash = hash;
1197 img->corners[BOT_CORNER] = -1; /* Full image */
1174 return img; 1198 return img;
1175} 1199}
1176 1200
@@ -1322,30 +1346,41 @@ image_ascent (img, face, slice)
1322 On W32, XIMG is assumed to a device context with the bitmap selected. */ 1346 On W32, XIMG is assumed to a device context with the bitmap selected. */
1323 1347
1324static RGB_PIXEL_COLOR 1348static RGB_PIXEL_COLOR
1325four_corners_best (ximg, width, height) 1349four_corners_best (ximg, corners, width, height)
1326 XImagePtr_or_DC ximg; 1350 XImagePtr_or_DC ximg;
1351 int *corners;
1327 unsigned long width, height; 1352 unsigned long width, height;
1328{ 1353{
1329 RGB_PIXEL_COLOR corners[4], best; 1354 RGB_PIXEL_COLOR corner_pixels[4], best;
1330 int i, best_count; 1355 int i, best_count;
1331 1356
1332 /* Get the colors at the corners of ximg. */ 1357 if (corners && corners[BOT_CORNER] >= 0)
1333 corners[0] = GET_PIXEL (ximg, 0, 0); 1358 {
1334 corners[1] = GET_PIXEL (ximg, width - 1, 0); 1359 /* Get the colors at the corner_pixels of ximg. */
1335 corners[2] = GET_PIXEL (ximg, width - 1, height - 1); 1360 corner_pixels[0] = GET_PIXEL (ximg, corners[LEFT_CORNER], corners[TOP_CORNER]);
1336 corners[3] = GET_PIXEL (ximg, 0, height - 1); 1361 corner_pixels[1] = GET_PIXEL (ximg, corners[RIGHT_CORNER] - 1, corners[TOP_CORNER]);
1337 1362 corner_pixels[2] = GET_PIXEL (ximg, corners[RIGHT_CORNER] - 1, corners[BOT_CORNER] - 1);
1363 corner_pixels[3] = GET_PIXEL (ximg, corners[LEFT_CORNER], corners[BOT_CORNER] - 1);
1364 }
1365 else
1366 {
1367 /* Get the colors at the corner_pixels of ximg. */
1368 corner_pixels[0] = GET_PIXEL (ximg, 0, 0);
1369 corner_pixels[1] = GET_PIXEL (ximg, width - 1, 0);
1370 corner_pixels[2] = GET_PIXEL (ximg, width - 1, height - 1);
1371 corner_pixels[3] = GET_PIXEL (ximg, 0, height - 1);
1372 }
1338 /* Choose the most frequently found color as background. */ 1373 /* Choose the most frequently found color as background. */
1339 for (i = best_count = 0; i < 4; ++i) 1374 for (i = best_count = 0; i < 4; ++i)
1340 { 1375 {
1341 int j, n; 1376 int j, n;
1342 1377
1343 for (j = n = 0; j < 4; ++j) 1378 for (j = n = 0; j < 4; ++j)
1344 if (corners[i] == corners[j]) 1379 if (corner_pixels[i] == corner_pixels[j])
1345 ++n; 1380 ++n;
1346 1381
1347 if (n > best_count) 1382 if (n > best_count)
1348 best = corners[i], best_count = n; 1383 best = corner_pixels[i], best_count = n;
1349 } 1384 }
1350 1385
1351 return best; 1386 return best;
@@ -1404,7 +1439,7 @@ image_background (img, f, ximg)
1404#endif /* !HAVE_NTGUI */ 1439#endif /* !HAVE_NTGUI */
1405 } 1440 }
1406 1441
1407 img->background = four_corners_best (ximg, img->width, img->height); 1442 img->background = four_corners_best (ximg, img->corners, img->width, img->height);
1408 1443
1409 if (free_ximg) 1444 if (free_ximg)
1410 Destroy_Image (ximg, prev); 1445 Destroy_Image (ximg, prev);
@@ -1449,7 +1484,7 @@ image_background_transparent (img, f, mask)
1449 } 1484 }
1450 1485
1451 img->background_transparent 1486 img->background_transparent
1452 = (four_corners_best (mask, img->width, img->height) == PIX_MASK_RETAIN); 1487 = (four_corners_best (mask, img->corners, img->width, img->height) == PIX_MASK_RETAIN);
1453 1488
1454 if (free_mask) 1489 if (free_mask)
1455 Destroy_Image (mask, prev); 1490 Destroy_Image (mask, prev);
@@ -4460,6 +4495,10 @@ xpm_load_image (f, img, contents, end)
4460 img->width = width; 4495 img->width = width;
4461 img->height = height; 4496 img->height = height;
4462 4497
4498 /* Maybe fill in the background field while we have ximg handy. */
4499 if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
4500 IMAGE_BACKGROUND (img, f, ximg);
4501
4463 x_put_x_image (f, ximg, img->pixmap, width, height); 4502 x_put_x_image (f, ximg, img->pixmap, width, height);
4464 x_destroy_x_image (ximg); 4503 x_destroy_x_image (ximg);
4465 if (have_mask) 4504 if (have_mask)
@@ -5354,7 +5393,7 @@ x_build_heuristic_mask (f, img, how)
5354 } 5393 }
5355 5394
5356 if (use_img_background) 5395 if (use_img_background)
5357 bg = four_corners_best (ximg, img->width, img->height); 5396 bg = four_corners_best (ximg, img->corners, img->width, img->height);
5358 5397
5359 /* Set all bits in mask_img to 1 whose color in ximg is different 5398 /* Set all bits in mask_img to 1 whose color in ximg is different
5360 from the background color bg. */ 5399 from the background color bg. */
@@ -7447,6 +7486,7 @@ tiff_load (f, img)
7447 7486
7448static int gif_image_p P_ ((Lisp_Object object)); 7487static int gif_image_p P_ ((Lisp_Object object));
7449static int gif_load P_ ((struct frame *f, struct image *img)); 7488static int gif_load P_ ((struct frame *f, struct image *img));
7489static void gif_clear_image P_ ((struct frame *f, struct image *img));
7450 7490
7451/* The symbol `gif' identifying images of this type. */ 7491/* The symbol `gif' identifying images of this type. */
7452 7492
@@ -7495,10 +7535,22 @@ static struct image_type gif_type =
7495 &Qgif, 7535 &Qgif,
7496 gif_image_p, 7536 gif_image_p,
7497 gif_load, 7537 gif_load,
7498 x_clear_image, 7538 gif_clear_image,
7499 NULL 7539 NULL
7500}; 7540};
7501 7541
7542/* Free X resources of GIF image IMG which is used on frame F. */
7543
7544static void
7545gif_clear_image (f, img)
7546 struct frame *f;
7547 struct image *img;
7548{
7549 /* IMG->data.ptr_val may contain extension data. */
7550 img->data.lisp_val = Qnil;
7551 x_clear_image (f, img);
7552}
7553
7502/* Return non-zero if OBJECT is a valid GIF image specification. */ 7554/* Return non-zero if OBJECT is a valid GIF image specification. */
7503 7555
7504static int 7556static int
@@ -7619,7 +7671,7 @@ gif_load (f, img)
7619 GifFileType *gif; 7671 GifFileType *gif;
7620 struct gcpro gcpro1; 7672 struct gcpro gcpro1;
7621 Lisp_Object image; 7673 Lisp_Object image;
7622 int ino, image_left, image_top, image_width, image_height; 7674 int ino, image_height, image_width;
7623 gif_memory_source memsrc; 7675 gif_memory_source memsrc;
7624 unsigned char *raster; 7676 unsigned char *raster;
7625 7677
@@ -7696,17 +7748,19 @@ gif_load (f, img)
7696 return 0; 7748 return 0;
7697 } 7749 }
7698 7750
7699 image_top = gif->SavedImages[ino].ImageDesc.Top; 7751 img->corners[TOP_CORNER] = gif->SavedImages[ino].ImageDesc.Top;
7700 image_left = gif->SavedImages[ino].ImageDesc.Left; 7752 img->corners[LEFT_CORNER] = gif->SavedImages[ino].ImageDesc.Left;
7701 image_width = gif->SavedImages[ino].ImageDesc.Width;
7702 image_height = gif->SavedImages[ino].ImageDesc.Height; 7753 image_height = gif->SavedImages[ino].ImageDesc.Height;
7754 img->corners[BOT_CORNER] = img->corners[TOP_CORNER] + image_height;
7755 image_width = gif->SavedImages[ino].ImageDesc.Width;
7756 img->corners[RIGHT_CORNER] = img->corners[LEFT_CORNER] + image_width;
7703 7757
7704 width = img->width = max (gif->SWidth, 7758 width = img->width = max (gif->SWidth,
7705 max (gif->Image.Left + gif->Image.Width, 7759 max (gif->Image.Left + gif->Image.Width,
7706 image_left + image_width)); 7760 img->corners[RIGHT_CORNER]));
7707 height = img->height = max (gif->SHeight, 7761 height = img->height = max (gif->SHeight,
7708 max (gif->Image.Top + gif->Image.Height, 7762 max (gif->Image.Top + gif->Image.Height,
7709 image_top + image_height)); 7763 img->corners[BOT_CORNER]));
7710 7764
7711 if (!check_image_size (f, width, height)) 7765 if (!check_image_size (f, width, height))
7712 { 7766 {
@@ -7749,19 +7803,19 @@ gif_load (f, img)
7749 requires more than can be done here (see the gif89 spec, 7803 requires more than can be done here (see the gif89 spec,
7750 disposal methods). Let's simply assume that the part 7804 disposal methods). Let's simply assume that the part
7751 not covered by a sub-image is in the frame's background color. */ 7805 not covered by a sub-image is in the frame's background color. */
7752 for (y = 0; y < image_top; ++y) 7806 for (y = 0; y < img->corners[TOP_CORNER]; ++y)
7753 for (x = 0; x < width; ++x) 7807 for (x = 0; x < width; ++x)
7754 XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f)); 7808 XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f));
7755 7809
7756 for (y = image_top + image_height; y < height; ++y) 7810 for (y = img->corners[BOT_CORNER]; y < height; ++y)
7757 for (x = 0; x < width; ++x) 7811 for (x = 0; x < width; ++x)
7758 XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f)); 7812 XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f));
7759 7813
7760 for (y = image_top; y < image_top + image_height; ++y) 7814 for (y = img->corners[TOP_CORNER]; y < img->corners[BOT_CORNER]; ++y)
7761 { 7815 {
7762 for (x = 0; x < image_left; ++x) 7816 for (x = 0; x < img->corners[LEFT_CORNER]; ++x)
7763 XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f)); 7817 XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f));
7764 for (x = image_left + image_width; x < width; ++x) 7818 for (x = img->corners[RIGHT_CORNER]; x < width; ++x)
7765 XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f)); 7819 XPutPixel (ximg, x, y, FRAME_BACKGROUND_PIXEL (f));
7766 } 7820 }
7767 7821
@@ -7791,8 +7845,8 @@ gif_load (f, img)
7791 for (x = 0; x < image_width; x++) 7845 for (x = 0; x < image_width; x++)
7792 { 7846 {
7793 int i = raster[(y * image_width) + x]; 7847 int i = raster[(y * image_width) + x];
7794 XPutPixel (ximg, x + image_left, row + image_top, 7848 XPutPixel (ximg, x + img->corners[LEFT_CORNER],
7795 pixel_colors[i]); 7849 row + img->corners[TOP_CORNER], pixel_colors[i]);
7796 } 7850 }
7797 7851
7798 row += interlace_increment[pass]; 7852 row += interlace_increment[pass];
@@ -7804,10 +7858,29 @@ gif_load (f, img)
7804 for (x = 0; x < image_width; ++x) 7858 for (x = 0; x < image_width; ++x)
7805 { 7859 {
7806 int i = raster[y * image_width + x]; 7860 int i = raster[y * image_width + x];
7807 XPutPixel (ximg, x + image_left, y + image_top, pixel_colors[i]); 7861 XPutPixel (ximg, x + img->corners[LEFT_CORNER],
7862 y + img->corners[TOP_CORNER], pixel_colors[i]);
7808 } 7863 }
7809 } 7864 }
7810 7865
7866 /* Save GIF image extension data for `image-extension-data'.
7867 Format is (count IMAGES FUNCTION "BYTES" ...). */
7868 img->data.lisp_val = Qnil;
7869 if (gif->SavedImages[ino].ExtensionBlockCount > 0)
7870 {
7871 ExtensionBlock *ext = gif->SavedImages[ino].ExtensionBlocks;
7872 for (i = 0; i < gif->SavedImages[ino].ExtensionBlockCount; i++, ext++)
7873 /* Append (... FUNCTION "BYTES") */
7874 img->data.lisp_val = Fcons (make_unibyte_string (ext->Bytes, ext->ByteCount),
7875 Fcons (make_number (ext->Function),
7876 img->data.lisp_val));
7877 img->data.lisp_val = Fnreverse (img->data.lisp_val);
7878 }
7879 if (gif->ImageCount > 1)
7880 img->data.lisp_val = Fcons (Qcount,
7881 Fcons (make_number (gif->ImageCount),
7882 img->data.lisp_val));
7883
7811 fn_DGifCloseFile (gif); 7884 fn_DGifCloseFile (gif);
7812 7885
7813 /* Maybe fill in the background field while we have ximg handy. */ 7886 /* Maybe fill in the background field while we have ximg handy. */
@@ -8553,6 +8626,7 @@ non-numeric, there is no explicit limit on the size of images. */);
8553 defsubr (&Sclear_image_cache); 8626 defsubr (&Sclear_image_cache);
8554 defsubr (&Simage_size); 8627 defsubr (&Simage_size);
8555 defsubr (&Simage_mask_p); 8628 defsubr (&Simage_mask_p);
8629 defsubr (&Simage_extension_data);
8556 8630
8557#if GLYPH_DEBUG 8631#if GLYPH_DEBUG
8558 defsubr (&Simagep); 8632 defsubr (&Simagep);
diff --git a/src/keymap.c b/src/keymap.c
index 6930ed08d8c..f5aea3b3902 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -841,7 +841,7 @@ static Lisp_Object
841store_in_keymap (keymap, idx, def) 841store_in_keymap (keymap, idx, def)
842 Lisp_Object keymap; 842 Lisp_Object keymap;
843 register Lisp_Object idx; 843 register Lisp_Object idx;
844 register Lisp_Object def; 844 Lisp_Object def;
845{ 845{
846 /* Flush any reverse-map cache. */ 846 /* Flush any reverse-map cache. */
847 where_is_cache = Qnil; 847 where_is_cache = Qnil;
@@ -1226,8 +1226,11 @@ binding KEY to DEF is added at the front of KEYMAP. */)
1226 if (!CONSP (keymap)) 1226 if (!CONSP (keymap))
1227 /* We must use Fkey_description rather than just passing key to 1227 /* We must use Fkey_description rather than just passing key to
1228 error; key might be a vector, not a string. */ 1228 error; key might be a vector, not a string. */
1229 error ("Key sequence %s uses invalid prefix characters", 1229 error ("Key sequence %s starts with non-prefix key %s",
1230 SDATA (Fkey_description (key, Qnil))); 1230 SDATA (Fkey_description (key, Qnil)),
1231 SDATA (Fkey_description (Fsubstring (key, make_number (0),
1232 make_number (idx)),
1233 Qnil)));
1231 } 1234 }
1232} 1235}
1233 1236
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 f4cfd61acb3..74b5288e781 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/macmenu.c b/src/macmenu.c
index 29233ec0d64..be565f89259 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -303,6 +303,37 @@ discard_menu_items ()
303 } 303 }
304} 304}
305 305
306/* This undoes save_menu_items, and it is called by the specpdl unwind
307 mechanism. */
308
309static Lisp_Object
310restore_menu_items (saved)
311 Lisp_Object saved;
312{
313 menu_items = XCAR (saved);
314 menu_items_allocated = (VECTORP (menu_items) ? ASIZE (menu_items) : 0);
315 saved = XCDR (saved);
316 menu_items_used = XINT (XCAR (saved));
317 saved = XCDR (saved);
318 menu_items_n_panes = XINT (XCAR (saved));
319 saved = XCDR (saved);
320 menu_items_submenu_depth = XINT (XCAR (saved));
321}
322
323/* Push the whole state of menu_items processing onto the specpdl.
324 It will be restored when the specpdl is unwound. */
325
326static void
327save_menu_items ()
328{
329 Lisp_Object saved = list4 (menu_items,
330 make_number (menu_items_used),
331 make_number (menu_items_n_panes),
332 make_number (menu_items_submenu_depth));
333 record_unwind_protect (restore_menu_items, saved);
334 menu_items = Qnil;
335}
336
306/* Make the menu_items vector twice as large. */ 337/* Make the menu_items vector twice as large. */
307 338
308static void 339static void
@@ -313,6 +344,7 @@ grow_menu_items ()
313 old = menu_items; 344 old = menu_items;
314 345
315 menu_items_allocated *= 2; 346 menu_items_allocated *= 2;
347
316 menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil); 348 menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil);
317 bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents, 349 bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents,
318 old_size * sizeof (Lisp_Object)); 350 old_size * sizeof (Lisp_Object));
@@ -1185,6 +1217,7 @@ digest_single_submenu (start, end, top_level_items)
1185 int i; 1217 int i;
1186 int submenu_depth = 0; 1218 int submenu_depth = 0;
1187 widget_value **submenu_stack; 1219 widget_value **submenu_stack;
1220 int panes_seen = 0;
1188 1221
1189 submenu_stack 1222 submenu_stack
1190 = (widget_value **) alloca (menu_items_used * sizeof (widget_value *)); 1223 = (widget_value **) alloca (menu_items_used * sizeof (widget_value *));
@@ -1231,6 +1264,8 @@ digest_single_submenu (start, end, top_level_items)
1231 Lisp_Object pane_name, prefix; 1264 Lisp_Object pane_name, prefix;
1232 char *pane_string; 1265 char *pane_string;
1233 1266
1267 panes_seen++;
1268
1234 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; 1269 pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME];
1235 prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; 1270 prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX];
1236 1271
@@ -1278,6 +1313,10 @@ digest_single_submenu (start, end, top_level_items)
1278 Lisp_Object item_name, enable, descrip, def, type, selected; 1313 Lisp_Object item_name, enable, descrip, def, type, selected;
1279 Lisp_Object help; 1314 Lisp_Object help;
1280 1315
1316 /* All items should be contained in panes. */
1317 if (panes_seen == 0)
1318 abort ();
1319
1281 item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME); 1320 item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME);
1282 enable = AREF (menu_items, i + MENU_ITEMS_ITEM_ENABLE); 1321 enable = AREF (menu_items, i + MENU_ITEMS_ITEM_ENABLE);
1283 descrip = AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY); 1322 descrip = AREF (menu_items, i + MENU_ITEMS_ITEM_EQUIV_KEY);
@@ -1529,6 +1568,8 @@ set_frame_menubar (f, first_time, deep_p)
1529 1568
1530 /* Fill in menu_items with the current menu bar contents. 1569 /* Fill in menu_items with the current menu bar contents.
1531 This can evaluate Lisp code. */ 1570 This can evaluate Lisp code. */
1571 save_menu_items ();
1572
1532 menu_items = f->menu_bar_vector; 1573 menu_items = f->menu_bar_vector;
1533 menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; 1574 menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
1534 submenu_start = (int *) alloca (XVECTOR (items)->size * sizeof (int *)); 1575 submenu_start = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
@@ -1588,23 +1629,33 @@ set_frame_menubar (f, first_time, deep_p)
1588 } 1629 }
1589 1630
1590 set_buffer_internal_1 (prev); 1631 set_buffer_internal_1 (prev);
1591 unbind_to (specpdl_count, Qnil);
1592 1632
1593 /* If there has been no change in the Lisp-level contents 1633 /* If there has been no change in the Lisp-level contents
1594 of the menu bar, skip redisplaying it. Just exit. */ 1634 of the menu bar, skip redisplaying it. Just exit. */
1595 1635
1636 /* Compare the new menu items with the ones computed last time. */
1596 for (i = 0; i < previous_menu_items_used; i++) 1637 for (i = 0; i < previous_menu_items_used; i++)
1597 if (menu_items_used == i 1638 if (menu_items_used == i
1598 || (!EQ (previous_items[i], XVECTOR (menu_items)->contents[i]))) 1639 || (!EQ (previous_items[i], XVECTOR (menu_items)->contents[i])))
1599 break; 1640 break;
1600 if (i == menu_items_used && i == previous_menu_items_used && i != 0) 1641 if (i == menu_items_used && i == previous_menu_items_used && i != 0)
1601 { 1642 {
1643 /* The menu items have not changed. Don't bother updating
1644 the menus in any form, since it would be a no-op. */
1602 free_menubar_widget_value_tree (first_wv); 1645 free_menubar_widget_value_tree (first_wv);
1603 discard_menu_items (); 1646 discard_menu_items ();
1604 1647 unbind_to (specpdl_count, Qnil);
1605 return; 1648 return;
1606 } 1649 }
1607 1650
1651 /* The menu items are different, so store them in the frame. */
1652 f->menu_bar_vector = menu_items;
1653 f->menu_bar_items_used = menu_items_used;
1654
1655 /* This calls restore_menu_items to restore menu_items, etc.,
1656 as they were outside. */
1657 unbind_to (specpdl_count, Qnil);
1658
1608 /* Now GC cannot happen during the lifetime of the widget_value, 1659 /* Now GC cannot happen during the lifetime of the widget_value,
1609 so it's safe to store data from a Lisp_String. */ 1660 so it's safe to store data from a Lisp_String. */
1610 wv = first_wv->contents; 1661 wv = first_wv->contents;
@@ -1619,9 +1670,6 @@ set_frame_menubar (f, first_time, deep_p)
1619 wv = wv->next; 1670 wv = wv->next;
1620 } 1671 }
1621 1672
1622 f->menu_bar_vector = menu_items;
1623 f->menu_bar_items_used = menu_items_used;
1624 discard_menu_items ();
1625 } 1673 }
1626 else 1674 else
1627 { 1675 {
diff --git a/src/macterm.c b/src/macterm.c
index b7a7fadeab2..8ddd8febd69 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -391,16 +391,37 @@ mac_draw_line (f, gc, x1, y1, x2, y2)
391{ 391{
392#if USE_CG_DRAWING 392#if USE_CG_DRAWING
393 CGContextRef context; 393 CGContextRef context;
394 float gx1 = x1, gy1 = y1, gx2 = x2, gy2 = y2;
395
396 if (y1 != y2)
397 gx1 += 0.5f, gx2 += 0.5f;
398 if (x1 != x2)
399 gy1 += 0.5f, gy2 += 0.5f;
394 400
395 context = mac_begin_cg_clip (f, gc); 401 context = mac_begin_cg_clip (f, gc);
396 CG_SET_STROKE_COLOR (context, gc->xgcv.foreground); 402 CG_SET_STROKE_COLOR (context, gc->xgcv.foreground);
397 CGContextBeginPath (context); 403 CGContextBeginPath (context);
398 CGContextMoveToPoint (context, x1 + 0.5f, y1 + 0.5f); 404 CGContextMoveToPoint (context, gx1, gy1);
399 CGContextAddLineToPoint (context, x2 + 0.5f, y2 + 0.5f); 405 CGContextAddLineToPoint (context, gx2, gy2);
400 CGContextClosePath (context); 406 CGContextClosePath (context);
401 CGContextStrokePath (context); 407 CGContextStrokePath (context);
402 mac_end_cg_clip (f); 408 mac_end_cg_clip (f);
403#else 409#else
410 if (x1 == x2)
411 {
412 if (y1 > y2)
413 y1--;
414 else if (y2 > y1)
415 y2--;
416 }
417 else if (y1 == y2)
418 {
419 if (x1 > x2)
420 x1--;
421 else
422 x2--;
423 }
424
404 SetPortWindowPort (FRAME_MAC_WINDOW (f)); 425 SetPortWindowPort (FRAME_MAC_WINDOW (f));
405 426
406 RGBForeColor (GC_FORE_COLOR (gc)); 427 RGBForeColor (GC_FORE_COLOR (gc));
@@ -422,6 +443,21 @@ mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2)
422 CGrafPtr old_port; 443 CGrafPtr old_port;
423 GDHandle old_gdh; 444 GDHandle old_gdh;
424 445
446 if (x1 == x2)
447 {
448 if (y1 > y2)
449 y1--;
450 else if (y2 > y1)
451 y2--;
452 }
453 else if (y1 == y2)
454 {
455 if (x1 > x2)
456 x1--;
457 else
458 x2--;
459 }
460
425 GetGWorld (&old_port, &old_gdh); 461 GetGWorld (&old_port, &old_gdh);
426 SetGWorld (p, NULL); 462 SetGWorld (p, NULL);
427 463
@@ -1627,7 +1663,7 @@ mac_set_clip_rectangles (display, gc, rectangles, n)
1627 DisposeRgn (region); 1663 DisposeRgn (region);
1628 } 1664 }
1629 } 1665 }
1630#if defined (MAC_OSX) && USE_ATSUI 1666#if defined (MAC_OSX) && (USE_ATSUI || USE_CG_DRAWING)
1631 for (i = 0; i < n; i++) 1667 for (i = 0; i < n; i++)
1632 { 1668 {
1633 Rect *rect = rectangles + i; 1669 Rect *rect = rectangles + i;
@@ -2139,6 +2175,29 @@ static int mac_encode_char P_ ((int, XChar2b *, struct font_info *,
2139 struct charset *, int *)); 2175 struct charset *, int *));
2140 2176
2141 2177
2178static void
2179pcm_init (pcm, count)
2180 XCharStruct *pcm;
2181 int count;
2182{
2183 bzero (pcm, sizeof (XCharStruct) * count);
2184 while (--count >= 0)
2185 {
2186 pcm->descent = PCM_INVALID;
2187 pcm++;
2188 }
2189}
2190
2191static enum pcm_status
2192pcm_get_status (pcm)
2193 XCharStruct *pcm;
2194{
2195 int height = pcm->ascent + pcm->descent;
2196
2197 /* Negative height means some special status. */
2198 return height >= 0 ? PCM_VALID : height;
2199}
2200
2142/* Get metrics of character CHAR2B in FONT. Value is null if CHAR2B 2201/* Get metrics of character CHAR2B in FONT. Value is null if CHAR2B
2143 is not contained in the font. */ 2202 is not contained in the font. */
2144 2203
@@ -2155,22 +2214,21 @@ x_per_char_metric (font, char2b)
2155#if USE_ATSUI 2214#if USE_ATSUI
2156 if (font->mac_style) 2215 if (font->mac_style)
2157 { 2216 {
2158 XCharStructRow **row = font->bounds.rows + char2b->byte1; 2217 XCharStruct **row = font->bounds.rows + char2b->byte1;
2159 2218
2160 if (*row == NULL) 2219 if (*row == NULL)
2161 { 2220 {
2162 *row = xmalloc (sizeof (XCharStructRow)); 2221 *row = xmalloc (sizeof (XCharStruct) * 0x100);
2163 bzero (*row, sizeof (XCharStructRow)); 2222 pcm_init (*row, 0x100);
2164 } 2223 }
2165 pcm = (*row)->per_char + char2b->byte2; 2224 pcm = *row + char2b->byte2;
2166 if (!XCHARSTRUCTROW_CHAR_VALID_P (*row, char2b->byte2)) 2225 if (pcm_get_status (pcm) != PCM_VALID)
2167 { 2226 {
2168 BLOCK_INPUT; 2227 BLOCK_INPUT;
2169 mac_query_char_extents (font->mac_style, 2228 mac_query_char_extents (font->mac_style,
2170 (char2b->byte1 << 8) + char2b->byte2, 2229 (char2b->byte1 << 8) + char2b->byte2,
2171 NULL, NULL, pcm, NULL); 2230 NULL, NULL, pcm, NULL);
2172 UNBLOCK_INPUT; 2231 UNBLOCK_INPUT;
2173 XCHARSTRUCTROW_SET_CHAR_VALID (*row, char2b->byte2);
2174 } 2232 }
2175 } 2233 }
2176 else 2234 else
@@ -2233,7 +2291,11 @@ x_per_char_metric (font, char2b)
2233#endif 2291#endif
2234 2292
2235 return ((pcm == NULL 2293 return ((pcm == NULL
2236 || (pcm->width == 0 && (pcm->rbearing - pcm->lbearing) == 0)) 2294 || (pcm->width == 0
2295#if 0 /* Show hollow boxes for zero-width glyphs such as combining diacritics. */
2296 && (pcm->rbearing - pcm->lbearing) == 0
2297#endif
2298 ))
2237 ? NULL : pcm); 2299 ? NULL : pcm);
2238} 2300}
2239 2301
@@ -3120,13 +3182,13 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
3120 for (i = 0; i < width; ++i) 3182 for (i = 0; i < width; ++i)
3121 mac_draw_line (f, gc, 3183 mac_draw_line (f, gc,
3122 left_x + i * left_p, top_y + i, 3184 left_x + i * left_p, top_y + i,
3123 right_x - i * right_p, top_y + i); 3185 right_x + 1 - i * right_p, top_y + i);
3124 3186
3125 /* Left. */ 3187 /* Left. */
3126 if (left_p) 3188 if (left_p)
3127 for (i = 0; i < width; ++i) 3189 for (i = 0; i < width; ++i)
3128 mac_draw_line (f, gc, 3190 mac_draw_line (f, gc,
3129 left_x + i, top_y + i, left_x + i, bottom_y - i); 3191 left_x + i, top_y + i, left_x + i, bottom_y - i + 1);
3130 3192
3131 mac_reset_clip_rectangles (dpy, gc); 3193 mac_reset_clip_rectangles (dpy, gc);
3132 if (raised_p) 3194 if (raised_p)
@@ -3140,13 +3202,13 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width,
3140 for (i = 0; i < width; ++i) 3202 for (i = 0; i < width; ++i)
3141 mac_draw_line (f, gc, 3203 mac_draw_line (f, gc,
3142 left_x + i * left_p, bottom_y - i, 3204 left_x + i * left_p, bottom_y - i,
3143 right_x - i * right_p, bottom_y - i); 3205 right_x + 1 - i * right_p, bottom_y - i);
3144 3206
3145 /* Right. */ 3207 /* Right. */
3146 if (right_p) 3208 if (right_p)
3147 for (i = 0; i < width; ++i) 3209 for (i = 0; i < width; ++i)
3148 mac_draw_line (f, gc, 3210 mac_draw_line (f, gc,
3149 right_x - i, top_y + i + 1, right_x - i, bottom_y - i - 1); 3211 right_x - i, top_y + i + 1, right_x - i, bottom_y - i);
3150 3212
3151 mac_reset_clip_rectangles (dpy, gc); 3213 mac_reset_clip_rectangles (dpy, gc);
3152} 3214}
@@ -6315,6 +6377,11 @@ x_free_frame_resources (f)
6315 if (FRAME_SIZE_HINTS (f)) 6377 if (FRAME_SIZE_HINTS (f))
6316 xfree (FRAME_SIZE_HINTS (f)); 6378 xfree (FRAME_SIZE_HINTS (f));
6317 6379
6380#if TARGET_API_MAC_CARBON
6381 if (FRAME_FILE_NAME (f))
6382 xfree (FRAME_FILE_NAME (f));
6383#endif
6384
6318 xfree (f->output_data.mac); 6385 xfree (f->output_data.mac);
6319 f->output_data.mac = NULL; 6386 f->output_data.mac = NULL;
6320 6387
@@ -7061,6 +7128,25 @@ add_font_name_table_entry (char *font_name)
7061 font_name_table[font_name_count++] = font_name; 7128 font_name_table[font_name_count++] = font_name;
7062} 7129}
7063 7130
7131static void
7132add_mac_font_name (name, size, style, charset)
7133 char *name;
7134 int size;
7135 Style style;
7136 char *charset;
7137{
7138 if (size > 0)
7139 add_font_name_table_entry (mac_to_x_fontname (name, size, style, charset));
7140 else
7141 {
7142 add_font_name_table_entry (mac_to_x_fontname (name, 0, style, charset));
7143 add_font_name_table_entry (mac_to_x_fontname (name, 0, italic, charset));
7144 add_font_name_table_entry (mac_to_x_fontname (name, 0, bold, charset));
7145 add_font_name_table_entry (mac_to_x_fontname (name, 0, italic | bold,
7146 charset));
7147 }
7148}
7149
7064/* Sets up the table font_name_table to contain the list of all fonts 7150/* Sets up the table font_name_table to contain the list of all fonts
7065 in the system the first time the table is used so that the Resource 7151 in the system the first time the table is used so that the Resource
7066 Manager need not be accessed every time this information is 7152 Manager need not be accessed every time this information is
@@ -7086,16 +7172,21 @@ init_font_name_table ()
7086 text_encoding_info_alist))) 7172 text_encoding_info_alist)))
7087 { 7173 {
7088 OSErr err; 7174 OSErr err;
7175 struct Lisp_Hash_Table *h;
7176 unsigned hash_code;
7089 ItemCount nfonts, i; 7177 ItemCount nfonts, i;
7090 ATSUFontID *font_ids = NULL; 7178 ATSUFontID *font_ids = NULL;
7091 Ptr name, prev_name = NULL; 7179 Ptr name;
7092 ByteCount name_len; 7180 ByteCount name_len;
7181 Lisp_Object family;
7093 7182
7094 atsu_font_id_hash = 7183 atsu_font_id_hash =
7095 make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), 7184 make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
7096 make_float (DEFAULT_REHASH_SIZE), 7185 make_float (DEFAULT_REHASH_SIZE),
7097 make_float (DEFAULT_REHASH_THRESHOLD), 7186 make_float (DEFAULT_REHASH_THRESHOLD),
7098 Qnil, Qnil, Qnil);; 7187 Qnil, Qnil, Qnil);;
7188 h = XHASH_TABLE (atsu_font_id_hash);
7189
7099 err = ATSUFontCount (&nfonts); 7190 err = ATSUFontCount (&nfonts);
7100 if (err == noErr) 7191 if (err == noErr)
7101 { 7192 {
@@ -7117,32 +7208,19 @@ init_font_name_table ()
7117 kFontNoLanguage, name_len, name, 7208 kFontNoLanguage, name_len, name,
7118 NULL, NULL); 7209 NULL, NULL);
7119 if (err == noErr) 7210 if (err == noErr)
7120 decode_mac_font_name (name, name_len + 1, Qnil);
7121 if (err == noErr
7122 && *name != '.'
7123 && (prev_name == NULL
7124 || strcmp (name, prev_name) != 0))
7125 { 7211 {
7126 static char *cs = "iso10646-1"; 7212 decode_mac_font_name (name, name_len + 1, Qnil);
7127 7213 family = make_unibyte_string (name, name_len);
7128 add_font_name_table_entry (mac_to_x_fontname (name, 0, 7214 if (*name != '.'
7129 normal, cs)); 7215 && hash_lookup (h, family, &hash_code) < 0)
7130 add_font_name_table_entry (mac_to_x_fontname (name, 0, 7216 {
7131 italic, cs)); 7217 add_mac_font_name (name, 0, normal, "iso10646-1");
7132 add_font_name_table_entry (mac_to_x_fontname (name, 0, 7218 hash_put (h, family, long_to_cons (font_ids[i]),
7133 bold, cs)); 7219 hash_code);
7134 add_font_name_table_entry (mac_to_x_fontname (name, 0, 7220 }
7135 italic | bold, cs));
7136 Fputhash (make_unibyte_string (name, name_len),
7137 long_to_cons (font_ids[i]), atsu_font_id_hash);
7138 xfree (prev_name);
7139 prev_name = name;
7140 } 7221 }
7141 else 7222 xfree (name);
7142 xfree (name);
7143 } 7223 }
7144 if (prev_name)
7145 xfree (prev_name);
7146 if (font_ids) 7224 if (font_ids)
7147 xfree (font_ids); 7225 xfree (font_ids);
7148 } 7226 }
@@ -7170,16 +7248,16 @@ init_font_name_table ()
7170 FMFontSize size; 7248 FMFontSize size;
7171 TextEncoding encoding; 7249 TextEncoding encoding;
7172 TextEncodingBase sc; 7250 TextEncodingBase sc;
7173 Lisp_Object text_encoding_info; 7251 Lisp_Object text_encoding_info, family;
7174 7252
7175 if (FMGetFontFamilyName (ff, name) != noErr) 7253 if (FMGetFontFamilyName (ff, name) != noErr)
7176 break; 7254 continue;
7177 p2cstr (name); 7255 p2cstr (name);
7178 if (*name == '.') 7256 if (*name == '.')
7179 continue; 7257 continue;
7180 7258
7181 if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr) 7259 if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr)
7182 break; 7260 continue;
7183 sc = GetTextEncodingBase (encoding); 7261 sc = GetTextEncodingBase (encoding);
7184 text_encoding_info = assq_no_quit (make_number (sc), 7262 text_encoding_info = assq_no_quit (make_number (sc),
7185 text_encoding_info_alist); 7263 text_encoding_info_alist);
@@ -7188,13 +7266,15 @@ init_font_name_table ()
7188 text_encoding_info_alist); 7266 text_encoding_info_alist);
7189 decode_mac_font_name (name, sizeof (name), 7267 decode_mac_font_name (name, sizeof (name),
7190 XCAR (XCDR (text_encoding_info))); 7268 XCAR (XCDR (text_encoding_info)));
7191 fm_font_family_alist = Fcons (Fcons (build_string (name), 7269 family = build_string (name);
7192 make_number (ff)), 7270 if (!NILP (Fassoc (family, fm_font_family_alist)))
7271 continue;
7272 fm_font_family_alist = Fcons (Fcons (family, make_number (ff)),
7193 fm_font_family_alist); 7273 fm_font_family_alist);
7194 7274
7195 /* Point the instance iterator at the current font family. */ 7275 /* Point the instance iterator at the current font family. */
7196 if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr) 7276 if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr)
7197 break; 7277 continue;
7198 7278
7199 while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size) 7279 while (FMGetNextFontFamilyInstance (&ffii, &font, &style, &size)
7200 == noErr) 7280 == noErr)
@@ -7203,27 +7283,7 @@ init_font_name_table ()
7203 7283
7204 if (size > 0 || style == normal) 7284 if (size > 0 || style == normal)
7205 for (; !NILP (rest); rest = XCDR (rest)) 7285 for (; !NILP (rest); rest = XCDR (rest))
7206 { 7286 add_mac_font_name (name, size, style, SDATA (XCAR (rest)));
7207 char *cs = SDATA (XCAR (rest));
7208
7209 if (size == 0)
7210 {
7211 add_font_name_table_entry (mac_to_x_fontname (name, size,
7212 style, cs));
7213 add_font_name_table_entry (mac_to_x_fontname (name, size,
7214 italic, cs));
7215 add_font_name_table_entry (mac_to_x_fontname (name, size,
7216 bold, cs));
7217 add_font_name_table_entry (mac_to_x_fontname (name, size,
7218 italic | bold,
7219 cs));
7220 }
7221 else
7222 {
7223 add_font_name_table_entry (mac_to_x_fontname (name, size,
7224 style, cs));
7225 }
7226 }
7227 } 7287 }
7228 } 7288 }
7229 7289
@@ -7243,7 +7303,7 @@ init_font_name_table ()
7243 Str255 name; 7303 Str255 name;
7244 struct FontAssoc *fat; 7304 struct FontAssoc *fat;
7245 struct AsscEntry *assc_entry; 7305 struct AsscEntry *assc_entry;
7246 Lisp_Object text_encoding_info_alist, text_encoding_info; 7306 Lisp_Object text_encoding_info_alist, text_encoding_info, family;
7247 struct gcpro gcpro1; 7307 struct gcpro gcpro1;
7248 7308
7249 GetPort (&port); /* save the current font number used */ 7309 GetPort (&port); /* save the current font number used */
@@ -7262,7 +7322,7 @@ init_font_name_table ()
7262 GetResInfo (font_handle, &id, &type, name); 7322 GetResInfo (font_handle, &id, &type, name);
7263 GetFNum (name, &fontnum); 7323 GetFNum (name, &fontnum);
7264 p2cstr (name); 7324 p2cstr (name);
7265 if (fontnum == 0) 7325 if (fontnum == 0 || *name == '.')
7266 continue; 7326 continue;
7267 7327
7268 TextFont (fontnum); 7328 TextFont (fontnum);
@@ -7274,8 +7334,10 @@ init_font_name_table ()
7274 text_encoding_info_alist); 7334 text_encoding_info_alist);
7275 decode_mac_font_name (name, sizeof (name), 7335 decode_mac_font_name (name, sizeof (name),
7276 XCAR (XCDR (text_encoding_info))); 7336 XCAR (XCDR (text_encoding_info)));
7277 fm_font_family_alist = Fcons (Fcons (build_string (name), 7337 family = build_string (name);
7278 make_number (fontnum)), 7338 if (!NILP (Fassoc (family, fm_font_family_alist)))
7339 continue;
7340 fm_font_family_alist = Fcons (Fcons (family, make_number (fontnum)),
7279 fm_font_family_alist); 7341 fm_font_family_alist);
7280 do 7342 do
7281 { 7343 {
@@ -7296,14 +7358,9 @@ init_font_name_table ()
7296 Lisp_Object rest = XCDR (XCDR (text_encoding_info)); 7358 Lisp_Object rest = XCDR (XCDR (text_encoding_info));
7297 7359
7298 for (; !NILP (rest); rest = XCDR (rest)) 7360 for (; !NILP (rest); rest = XCDR (rest))
7299 { 7361 add_mac_font_name (name, assc_entry->fontSize,
7300 char *cs = SDATA (XCAR (rest)); 7362 assc_entry->fontStyle,
7301 7363 SDATA (XCAR (rest)));
7302 add_font_name_table_entry (mac_to_x_fontname (name,
7303 assc_entry->fontSize,
7304 assc_entry->fontStyle,
7305 cs));
7306 }
7307 } 7364 }
7308 } 7365 }
7309 7366
@@ -7771,10 +7828,10 @@ XLoadQueryFont (Display *dpy, char *fontname)
7771 font->min_char_or_byte2 = 0; 7828 font->min_char_or_byte2 = 0;
7772 font->max_char_or_byte2 = 0xff; 7829 font->max_char_or_byte2 = 0xff;
7773 7830
7774 font->bounds.rows = xmalloc (sizeof (XCharStructRow *) * 0x100); 7831 font->bounds.rows = xmalloc (sizeof (XCharStruct *) * 0x100);
7775 bzero (font->bounds.rows, sizeof (XCharStructRow *) * 0x100); 7832 bzero (font->bounds.rows, sizeof (XCharStruct *) * 0x100);
7776 font->bounds.rows[0] = xmalloc (sizeof (XCharStructRow)); 7833 font->bounds.rows[0] = xmalloc (sizeof (XCharStruct) * 0x100);
7777 bzero (font->bounds.rows[0], sizeof (XCharStructRow)); 7834 pcm_init (font->bounds.rows[0], 0x100);
7778 7835
7779#if USE_CG_TEXT_DRAWING 7836#if USE_CG_TEXT_DRAWING
7780 { 7837 {
@@ -7800,7 +7857,7 @@ XLoadQueryFont (Display *dpy, char *fontname)
7800 bzero (font->cg_glyphs, sizeof (CGGlyph) * 0x100); 7857 bzero (font->cg_glyphs, sizeof (CGGlyph) * 0x100);
7801 } 7858 }
7802#endif 7859#endif
7803 space_bounds = font->bounds.rows[0]->per_char + 0x20; 7860 space_bounds = font->bounds.rows[0] + 0x20;
7804 err = mac_query_char_extents (font->mac_style, 0x20, 7861 err = mac_query_char_extents (font->mac_style, 0x20,
7805 &font->ascent, &font->descent, 7862 &font->ascent, &font->descent,
7806 space_bounds, 7863 space_bounds,
@@ -7816,9 +7873,8 @@ XLoadQueryFont (Display *dpy, char *fontname)
7816 mac_unload_font (&one_mac_display_info, font); 7873 mac_unload_font (&one_mac_display_info, font);
7817 return NULL; 7874 return NULL;
7818 } 7875 }
7819 XCHARSTRUCTROW_SET_CHAR_VALID (font->bounds.rows[0], 0x20);
7820 7876
7821 pcm = font->bounds.rows[0]->per_char; 7877 pcm = font->bounds.rows[0];
7822 for (c = 0x21; c <= 0xff; c++) 7878 for (c = 0x21; c <= 0xff; c++)
7823 { 7879 {
7824 if (c == 0xad) 7880 if (c == 0xad)
@@ -7838,7 +7894,6 @@ XLoadQueryFont (Display *dpy, char *fontname)
7838 NULL 7894 NULL
7839#endif 7895#endif
7840 ); 7896 );
7841 XCHARSTRUCTROW_SET_CHAR_VALID (font->bounds.rows[0], c);
7842 7897
7843#if USE_CG_TEXT_DRAWING 7898#if USE_CG_TEXT_DRAWING
7844 if (font->cg_glyphs && font->cg_glyphs[c] == 0) 7899 if (font->cg_glyphs && font->cg_glyphs[c] == 0)
@@ -10024,8 +10079,20 @@ XTread_socket (sd, expected, hold_quit)
10024 } 10079 }
10025 break; 10080 break;
10026 10081
10082#if TARGET_API_MAC_CARBON
10083 case inProxyIcon:
10084 if (TrackWindowProxyDrag (window_ptr, er.where)
10085 != errUserWantsToDragWindow)
10086 break;
10087 /* fall through */
10088#endif
10027 case inDrag: 10089 case inDrag:
10028#if TARGET_API_MAC_CARBON 10090#if TARGET_API_MAC_CARBON
10091 if (IsWindowPathSelectClick (window_ptr, &er))
10092 {
10093 WindowPathSelect (window_ptr, NULL, NULL);
10094 break;
10095 }
10029 DragWindow (window_ptr, er.where, NULL); 10096 DragWindow (window_ptr, er.where, NULL);
10030#else /* not TARGET_API_MAC_CARBON */ 10097#else /* not TARGET_API_MAC_CARBON */
10031 DragWindow (window_ptr, er.where, &qd.screenBits.bounds); 10098 DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
@@ -11076,7 +11143,11 @@ button will be mouse-3. */);
11076 doc: /* *If non-nil, allow anti-aliasing. 11143 doc: /* *If non-nil, allow anti-aliasing.
11077The text will be rendered using Core Graphics text rendering which 11144The text will be rendered using Core Graphics text rendering which
11078may anti-alias the text. */); 11145may anti-alias the text. */);
11146#if USE_CG_DRAWING
11147 mac_use_core_graphics = 1;
11148#else
11079 mac_use_core_graphics = 0; 11149 mac_use_core_graphics = 0;
11150#endif
11080 11151
11081 /* Register an entry for `mac-roman' so that it can be used when 11152 /* Register an entry for `mac-roman' so that it can be used when
11082 creating the terminal frame on Mac OS 9 before loading 11153 creating the terminal frame on Mac OS 9 before loading
diff --git a/src/macterm.h b/src/macterm.h
index e35f04a6ba6..f23554f01c6 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;
@@ -360,6 +365,8 @@ typedef struct mac_output mac_output;
360 365
361#define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints) 366#define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints)
362 367
368#define FRAME_FILE_NAME(f) ((f)->output_data.mac->file_name)
369
363/* This gives the mac_display_info structure for the display F is on. */ 370/* This gives the mac_display_info structure for the display F is on. */
364#define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info) 371#define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info)
365#define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info) 372#define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info)
@@ -606,6 +613,7 @@ extern int x_char_width P_ ((struct frame *));
606extern int x_char_height P_ ((struct frame *)); 613extern int x_char_height P_ ((struct frame *));
607extern void x_sync P_ ((struct frame *)); 614extern void x_sync P_ ((struct frame *));
608extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object)); 615extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
616extern void mac_update_title_bar P_ ((struct frame *, int));
609 617
610/* Defined in macmenu.c */ 618/* Defined in macmenu.c */
611 619
diff --git a/src/process.h b/src/process.h
index c4b4281fedf..b585515d6b1 100644
--- a/src/process.h
+++ b/src/process.h
@@ -19,6 +19,12 @@ along with GNU Emacs; see the file COPYING. If not, write to
19the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20Boston, MA 02110-1301, USA. */ 20Boston, MA 02110-1301, USA. */
21 21
22#ifdef HAVE_SYS_TYPES_H
23#include <sys/types.h>
24#endif
25#ifdef HAVE_UNISTD_H
26#include <unistd.h>
27#endif
22 28
23/* This structure records information about a subprocess 29/* This structure records information about a subprocess
24 or network connection. 30 or network connection.
diff --git a/src/puresize.h b/src/puresize.h
index fa73736bc43..1288feff151 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA. */
43#endif 43#endif
44 44
45#ifndef BASE_PURESIZE 45#ifndef BASE_PURESIZE
46#define BASE_PURESIZE (1200000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) 46#define BASE_PURESIZE (1205000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
47#endif 47#endif
48 48
49/* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ 49/* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 55f62644d04..fa4ca565171 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -466,9 +466,9 @@ extern char *get_emacs_configuration_options (void);
466#include <string.h> 466#include <string.h>
467 467
468/* We need a little extra space, see ../../lisp/loadup.el. 468/* We need a little extra space, see ../../lisp/loadup.el.
469 The number below comes from 22038 bytes worth (as of 2006-04) 469 The number below comes from 23923 bytes worth (as of 2006-04)
470 of w32-specific files loaded by loadup.el, plus 2K spare. */ 470 of w32-specific files loaded by loadup.el, plus 1K spare. */
471#define SYSTEM_PURESIZE_EXTRA 24000 471#define SYSTEM_PURESIZE_EXTRA 25000
472 472
473/* For unexec to work on Alpha systems, we need to put Emacs' 473/* For unexec to work on Alpha systems, we need to put Emacs'
474 initialized data into a separate section from the CRT initialized 474 initialized data into a separate section from the CRT initialized
diff --git a/src/syntax.c b/src/syntax.c
index f8d50d1e5b4..3f6058e3b1a 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -2344,8 +2344,6 @@ between them, return t; otherwise return nil. */)
2344 while (1) 2344 while (1)
2345 { 2345 {
2346 DEC_BOTH (from, from_byte); 2346 DEC_BOTH (from, from_byte);
2347 if (from == stop)
2348 break;
2349 UPDATE_SYNTAX_TABLE_BACKWARD (from); 2347 UPDATE_SYNTAX_TABLE_BACKWARD (from);
2350 c = FETCH_CHAR_AS_MULTIBYTE (from_byte); 2348 c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
2351 if (SYNTAX (c) == Scomment_fence 2349 if (SYNTAX (c) == Scomment_fence
@@ -2354,6 +2352,8 @@ between them, return t; otherwise return nil. */)
2354 found = 1; 2352 found = 1;
2355 break; 2353 break;
2356 } 2354 }
2355 else if (from == stop)
2356 break;
2357 } 2357 }
2358 if (found == 0) 2358 if (found == 0)
2359 { 2359 {
@@ -2361,6 +2361,9 @@ between them, return t; otherwise return nil. */)
2361 from_byte = ini_byte; 2361 from_byte = ini_byte;
2362 goto leave; 2362 goto leave;
2363 } 2363 }
2364 else
2365 /* We have skipped one comment. */
2366 break;
2364 } 2367 }
2365 else if (code == Sendcomment) 2368 else if (code == Sendcomment)
2366 { 2369 {
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/w32fns.c b/src/w32fns.c
index 95ba34fc1e4..4da5271c870 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -3191,6 +3191,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
3191 } 3191 }
3192 wmsg.dwModifiers = w32_get_modifiers (); 3192 wmsg.dwModifiers = w32_get_modifiers ();
3193 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); 3193 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
3194 signal_user_input ();
3194 3195
3195 /* Clear message buffer. */ 3196 /* Clear message buffer. */
3196 saved_mouse_button_msg.msg.hwnd = 0; 3197 saved_mouse_button_msg.msg.hwnd = 0;
@@ -3248,6 +3249,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam)
3248 } 3249 }
3249 wmsg.dwModifiers = w32_get_modifiers (); 3250 wmsg.dwModifiers = w32_get_modifiers ();
3250 my_post_msg (&wmsg, hwnd, msg, wParam, lParam); 3251 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
3252 signal_user_input ();
3251 3253
3252 /* Always clear message buffer and cancel timer. */ 3254 /* Always clear message buffer and cancel timer. */
3253 saved_mouse_button_msg.msg.hwnd = 0; 3255 saved_mouse_button_msg.msg.hwnd = 0;
diff --git a/src/w32term.c b/src/w32term.c
index 5681b6ee62f..305527946fb 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3282,8 +3282,10 @@ construct_mouse_wheel (result, msg, f)
3282 result->modifiers = (msg->dwModifiers 3282 result->modifiers = (msg->dwModifiers
3283 | ((delta < 0 ) ? down_modifier : up_modifier)); 3283 | ((delta < 0 ) ? down_modifier : up_modifier));
3284 3284
3285 p.x = LOWORD (msg->msg.lParam); 3285 /* With multiple monitors, we can legitimately get negative
3286 p.y = HIWORD (msg->msg.lParam); 3286 coordinates, so cast to short to interpret them correctly. */
3287 p.x = (short) LOWORD (msg->msg.lParam);
3288 p.y = (short) HIWORD (msg->msg.lParam);
3287 ScreenToClient (msg->msg.hwnd, &p); 3289 ScreenToClient (msg->msg.hwnd, &p);
3288 XSETINT (result->x, p.x); 3290 XSETINT (result->x, p.x);
3289 XSETINT (result->y, p.y); 3291 XSETINT (result->y, p.y);
diff --git a/src/window.c b/src/window.c
index 1bd8c3924a1..1abeec92367 100644
--- a/src/window.c
+++ b/src/window.c
@@ -3437,7 +3437,7 @@ displaying BUFFER, then simply raise that frame.
3437The variables `special-display-buffer-names', 3437The variables `special-display-buffer-names',
3438`special-display-regexps', `same-window-buffer-names', and 3438`special-display-regexps', `same-window-buffer-names', and
3439`same-window-regexps' customize how certain buffer names are handled. 3439`same-window-regexps' customize how certain buffer names are handled.
3440The latter two take effect only if NOT-THIS-WINDOW is t. 3440The latter two take effect only if NOT-THIS-WINDOW is nil.
3441 3441
3442If optional argument FRAME is `visible', search all visible frames. 3442If optional argument FRAME is `visible', search all visible frames.
3443If FRAME is 0, search all visible and iconified frames. 3443If FRAME is 0, search all visible and iconified frames.
diff --git a/src/xdisp.c b/src/xdisp.c
index 1689ec88be5..63a1338b2cb 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9060,6 +9060,9 @@ prepare_menu_bars ()
9060 update_menu_bar (f, 0); 9060 update_menu_bar (f, 0);
9061#ifdef HAVE_WINDOW_SYSTEM 9061#ifdef HAVE_WINDOW_SYSTEM
9062 update_tool_bar (f, 0); 9062 update_tool_bar (f, 0);
9063#ifdef MAC_OS
9064 mac_update_title_bar (f, 0);
9065#endif
9063#endif 9066#endif
9064 UNGCPRO; 9067 UNGCPRO;
9065 } 9068 }
@@ -9072,6 +9075,9 @@ prepare_menu_bars ()
9072 update_menu_bar (sf, 1); 9075 update_menu_bar (sf, 1);
9073#ifdef HAVE_WINDOW_SYSTEM 9076#ifdef HAVE_WINDOW_SYSTEM
9074 update_tool_bar (sf, 1); 9077 update_tool_bar (sf, 1);
9078#ifdef MAC_OS
9079 mac_update_title_bar (sf, 1);
9080#endif
9075#endif 9081#endif
9076 } 9082 }
9077 9083
@@ -9668,20 +9674,22 @@ tool_bar_lines_needed (f, n_rows)
9668{ 9674{
9669 struct window *w = XWINDOW (f->tool_bar_window); 9675 struct window *w = XWINDOW (f->tool_bar_window);
9670 struct it it; 9676 struct it it;
9677 struct glyph_row *temp_row = w->desired_matrix->rows;
9671 9678
9672 /* Initialize an iterator for iteration over 9679 /* Initialize an iterator for iteration over
9673 F->desired_tool_bar_string in the tool-bar window of frame F. */ 9680 F->desired_tool_bar_string in the tool-bar window of frame F. */
9674 init_iterator (&it, w, -1, -1, w->desired_matrix->rows, TOOL_BAR_FACE_ID); 9681 init_iterator (&it, w, -1, -1, temp_row, TOOL_BAR_FACE_ID);
9675 it.first_visible_x = 0; 9682 it.first_visible_x = 0;
9676 it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f); 9683 it.last_visible_x = FRAME_TOTAL_COLS (f) * FRAME_COLUMN_WIDTH (f);
9677 reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); 9684 reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1);
9678 9685
9679 while (!ITERATOR_AT_END_P (&it)) 9686 while (!ITERATOR_AT_END_P (&it))
9680 { 9687 {
9681 it.glyph_row = w->desired_matrix->rows; 9688 clear_glyph_row (temp_row);
9682 clear_glyph_row (it.glyph_row); 9689 it.glyph_row = temp_row;
9683 display_tool_bar_line (&it, -1); 9690 display_tool_bar_line (&it, -1);
9684 } 9691 }
9692 clear_glyph_row (temp_row);
9685 9693
9686 /* f->n_tool_bar_rows == 0 means "unknown"; -1 means no tool-bar. */ 9694 /* f->n_tool_bar_rows == 0 means "unknown"; -1 means no tool-bar. */
9687 if (n_rows) 9695 if (n_rows)
@@ -9761,7 +9769,29 @@ redisplay_tool_bar (f)
9761 reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1); 9769 reseat_to_string (&it, NULL, f->desired_tool_bar_string, 0, 0, 0, -1);
9762 9770
9763 if (f->n_tool_bar_rows == 0) 9771 if (f->n_tool_bar_rows == 0)
9764 (void)tool_bar_lines_needed (f, &f->n_tool_bar_rows); 9772 {
9773 int nlines;
9774
9775 if ((nlines = tool_bar_lines_needed (f, &f->n_tool_bar_rows),
9776 nlines != WINDOW_TOTAL_LINES (w)))
9777 {
9778 extern Lisp_Object Qtool_bar_lines;
9779 Lisp_Object frame;
9780 int old_height = WINDOW_TOTAL_LINES (w);
9781
9782 XSETFRAME (frame, f);
9783 clear_glyph_matrix (w->desired_matrix);
9784 Fmodify_frame_parameters (frame,
9785 Fcons (Fcons (Qtool_bar_lines,
9786 make_number (nlines)),
9787 Qnil));
9788 if (WINDOW_TOTAL_LINES (w) != old_height)
9789 {
9790 fonts_changed_p = 1;
9791 return 1;
9792 }
9793 }
9794 }
9765 9795
9766 /* Display as many lines as needed to display all tool-bar items. */ 9796 /* Display as many lines as needed to display all tool-bar items. */
9767 9797
@@ -12957,7 +12987,8 @@ redisplay_window (window, just_this_one_p)
12957 /* If first window line is a continuation line, and window start 12987 /* If first window line is a continuation line, and window start
12958 is inside the modified region, but the first change is before 12988 is inside the modified region, but the first change is before
12959 current window start, we must select a new window start.*/ 12989 current window start, we must select a new window start.*/
12960 if (NILP (w->start_at_line_beg)) 12990 if (NILP (w->start_at_line_beg)
12991 && CHARPOS (startp) > BEGV)
12961 { 12992 {
12962 /* Make sure beg_unchanged and end_unchanged are up to date. 12993 /* Make sure beg_unchanged and end_unchanged are up to date.
12963 Do it only if buffer has really changed. This may or may 12994 Do it only if buffer has really changed. This may or may
@@ -18593,8 +18624,7 @@ get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
18593 sure to use a face suitable for unibyte. */ 18624 sure to use a face suitable for unibyte. */
18594 STORE_XCHAR2B (char2b, 0, glyph->u.ch); 18625 STORE_XCHAR2B (char2b, 0, glyph->u.ch);
18595 } 18626 }
18596 else if (glyph->u.ch < 128 18627 else if (glyph->u.ch < 128)
18597 && glyph->face_id < BASIC_FACE_ID_SENTINEL)
18598 { 18628 {
18599 /* Case of ASCII in a face known to fit ASCII. */ 18629 /* Case of ASCII in a face known to fit ASCII. */
18600 STORE_XCHAR2B (char2b, 0, glyph->u.ch); 18630 STORE_XCHAR2B (char2b, 0, glyph->u.ch);
@@ -18814,6 +18844,7 @@ fill_stretch_glyph_string (s, row, area, start, end)
18814 s->font = s->face->font; 18844 s->font = s->face->font;
18815 s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id); 18845 s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id);
18816 s->width = glyph->pixel_width; 18846 s->width = glyph->pixel_width;
18847 s->nchars = 1;
18817 voffset = glyph->voffset; 18848 voffset = glyph->voffset;
18818 18849
18819 for (++glyph; 18850 for (++glyph;
@@ -19011,7 +19042,7 @@ get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p)
19011 face_id = FACE_FOR_CHAR (f, face, c, -1, Qnil); 19042 face_id = FACE_FOR_CHAR (f, face, c, -1, Qnil);
19012 face = FACE_FROM_ID (f, face_id); 19043 face = FACE_FROM_ID (f, face_id);
19013 } 19044 }
19014 else if (c < 128 && face_id < BASIC_FACE_ID_SENTINEL) 19045 else if (c < 128)
19015 { 19046 {
19016 /* Case of ASCII in a face known to fit ASCII. */ 19047 /* Case of ASCII in a face known to fit ASCII. */
19017 STORE_XCHAR2B (char2b, 0, c); 19048 STORE_XCHAR2B (char2b, 0, c);
@@ -19968,20 +19999,6 @@ produce_stretch_glyph (it)
19968 it->descent = it->phys_descent = height - it->ascent; 19999 it->descent = it->phys_descent = height - it->ascent;
19969 it->nglyphs = width > 0 && height > 0 ? 1 : 0; 20000 it->nglyphs = width > 0 && height > 0 ? 1 : 0;
19970 20001
19971 if (width > 0 && height > 0 && face->box != FACE_NO_BOX)
19972 {
19973 if (face->box_line_width > 0)
19974 {
19975 it->ascent += face->box_line_width;
19976 it->descent += face->box_line_width;
19977 }
19978
19979 if (it->start_of_box_run_p)
19980 it->pixel_width += abs (face->box_line_width);
19981 if (it->end_of_box_run_p)
19982 it->pixel_width += abs (face->box_line_width);
19983 }
19984
19985 take_vertical_position_into_account (it); 20002 take_vertical_position_into_account (it);
19986} 20003}
19987 20004
diff --git a/src/xmenu.c b/src/xmenu.c
index 8558e113863..2abf0a48319 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.