aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaroly Lorentey2005-12-11 22:42:40 +0000
committerKaroly Lorentey2005-12-11 22:42:40 +0000
commitbe3d2d66d2dff979604134c5dc5fb506ded4aa54 (patch)
tree683fc7324392d0023e995b593a627c294375aba1
parent16986fcfcca94e88e620c38775e15f758aa44935 (diff)
parentac8fcf0f17ab5d81f3b30db5599337d000ad12d9 (diff)
downloademacs-be3d2d66d2dff979604134c5dc5fb506ded4aa54.tar.gz
emacs-be3d2d66d2dff979604134c5dc5fb506ded4aa54.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-667 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-668 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-669 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-670 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-157 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-158 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-159 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-160 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-161 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-162 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-163 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-164 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-165 Update from CVS: texi/message.texi: Fix default values. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-166 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-167 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-168 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-448
-rw-r--r--admin/ChangeLog7
-rw-r--r--admin/FOR-RELEASE66
-rw-r--r--etc/ChangeLog5
-rw-r--r--etc/NEWS13
-rw-r--r--etc/orgcard.ps16
-rw-r--r--etc/orgcard.tex6
-rw-r--r--lisp/ChangeLog1457
-rw-r--r--lisp/align.el6
-rw-r--r--lisp/button.el1
-rw-r--r--lisp/calendar/appt.el5
-rw-r--r--lisp/calendar/cal-bahai.el2
-rw-r--r--lisp/calendar/cal-china.el4
-rw-r--r--lisp/calendar/cal-coptic.el4
-rw-r--r--lisp/calendar/cal-dst.el4
-rw-r--r--lisp/calendar/cal-french.el4
-rw-r--r--lisp/calendar/cal-hebrew.el4
-rw-r--r--lisp/calendar/cal-islam.el4
-rw-r--r--lisp/calendar/cal-iso.el3
-rw-r--r--lisp/calendar/cal-julian.el4
-rw-r--r--lisp/calendar/cal-mayan.el4
-rw-r--r--lisp/calendar/cal-menu.el3
-rw-r--r--lisp/calendar/cal-move.el3
-rw-r--r--lisp/calendar/cal-persia.el4
-rw-r--r--lisp/calendar/cal-tex.el4
-rw-r--r--lisp/calendar/cal-x.el3
-rw-r--r--lisp/calendar/calendar.el2
-rw-r--r--lisp/calendar/diary-lib.el4
-rw-r--r--lisp/calendar/holidays.el4
-rw-r--r--lisp/calendar/lunar.el4
-rw-r--r--lisp/calendar/parse-time.el3
-rw-r--r--lisp/calendar/solar.el3
-rw-r--r--lisp/calendar/time-date.el5
-rw-r--r--lisp/calendar/timeclock.el3
-rw-r--r--lisp/calendar/todo-mode.el3
-rw-r--r--lisp/compare-w.el4
-rw-r--r--lisp/cus-edit.el8
-rw-r--r--lisp/emacs-lisp/lisp.el13
-rw-r--r--lisp/emulation/cua-base.el71
-rw-r--r--lisp/emulation/cua-rect.el16
-rw-r--r--lisp/files.el4
-rw-r--r--lisp/foldout.el40
-rw-r--r--lisp/gnus/ChangeLog201
-rw-r--r--lisp/gnus/gnus-agent.el123
-rw-r--r--lisp/gnus/gnus-art.el3
-rw-r--r--lisp/gnus/gnus-cache.el25
-rw-r--r--lisp/gnus/gnus-start.el1
-rw-r--r--lisp/gnus/imap.el7
-rw-r--r--lisp/gnus/mm-decode.el74
-rw-r--r--lisp/gnus/mm-view.el26
-rw-r--r--lisp/gnus/nnmail.el10
-rw-r--r--lisp/gnus/nntp.el22
-rw-r--r--lisp/gnus/rfc2231.el12
-rw-r--r--lisp/help.el3
-rw-r--r--lisp/hi-lock.el63
-rw-r--r--lisp/ibuf-ext.el10
-rw-r--r--lisp/ido.el97
-rw-r--r--lisp/info.el1
-rw-r--r--lisp/international/ucs-tables.el4
-rw-r--r--lisp/isearch.el26
-rw-r--r--lisp/locate.el3
-rw-r--r--lisp/mail/mail-extr.el7
-rw-r--r--lisp/mail/rmail.el13
-rw-r--r--lisp/mail/sendmail.el5
-rw-r--r--lisp/mail/smtpmail.el1
-rw-r--r--lisp/menu-bar.el2
-rw-r--r--lisp/mh-e/ChangeLog9
-rw-r--r--lisp/mh-e/mh-customize.el17
-rw-r--r--lisp/mh-e/mh-init.el57
-rw-r--r--lisp/pcvs.el1
-rw-r--r--lisp/progmodes/gud.el93
-rw-r--r--lisp/progmodes/octave-mod.el3
-rw-r--r--lisp/recentf.el385
-rw-r--r--lisp/replace.el2
-rw-r--r--lisp/simple.el2
-rw-r--r--lisp/term/mac-win.el216
-rw-r--r--lisp/textmodes/ispell.el8
-rw-r--r--lisp/textmodes/org.el77
-rw-r--r--lisp/tooltip.el59
-rw-r--r--lisp/wid-edit.el1
-rw-r--r--lisp/window.el262
-rw-r--r--lispref/ChangeLog9
-rw-r--r--lispref/minibuf.texi35
-rw-r--r--lispref/objects.texi5
-rw-r--r--mac/ChangeLog5
-rw-r--r--mac/Emacs.app/Contents/Info.plist21
-rw-r--r--man/ChangeLog148
-rw-r--r--man/custom.texi149
-rw-r--r--man/display.texi63
-rw-r--r--man/faq.texi377
-rw-r--r--man/gnus.texi33
-rw-r--r--man/killing.texi23
-rw-r--r--man/message.texi89
-rw-r--r--man/mini.texi14
-rw-r--r--man/org.texi10
-rw-r--r--man/pgg.texi23
-rw-r--r--nt/ChangeLog5
-rw-r--r--nt/INSTALL37
-rw-r--r--src/ChangeLog97
-rw-r--r--src/Makefile.in2
-rw-r--r--src/image.c10
-rw-r--r--src/indent.c12
-rw-r--r--src/keyboard.c22
-rw-r--r--src/lread.c11
-rw-r--r--src/mac.c324
-rw-r--r--src/macselect.c493
-rw-r--r--src/macterm.c534
-rw-r--r--src/macterm.h9
-rw-r--r--src/termhooks.h18
-rw-r--r--src/w32fns.c8
109 files changed, 4643 insertions, 1697 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index b5545f5d76a..553a57aba06 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,10 @@
12005-12-09 Reiner Steib <Reiner.Steib@gmx.de>
2
3 * FOR-RELEASE (DOCUMENTATION): Remove message-mail, gnus-*
4 completing-read-multiple, mail-extract-address-components,
5 mail-mode, quail-define-package, save-buffer and
6 ucs-set-table-for-input from doc strings item (Done).
7
12005-11-28 Chong Yidong <cyd@stupidchicken.com> 82005-11-28 Chong Yidong <cyd@stupidchicken.com>
2 9
3 * FOR-RELEASE: Icons installed. Partial completion bug fixed. 10 * FOR-RELEASE: Icons installed. Partial completion bug fixed.
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index adfef077064..6d88077a0f2 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -47,9 +47,7 @@ invalid pointer from string_free_list.
47 47
48* BUGS 48* BUGS
49 49
50** Fix window resizing bug: 50** Ronan Keryell's Sep 23 bug about "tramp sudo:: and version control on RCS"
51C-x 2, C-x 3, C-x 2. Now try to move the bottom of the
52second window to the left.
53 51
54** TCP server processes do not work on Windows. 52** TCP server processes do not work on Windows.
55 53
@@ -60,8 +58,64 @@ Seems to be a problem in sys_select in w32proc.c.
60 58
61* DOCUMENTATION 59* DOCUMENTATION
62 60
63** Update what needs to be updated now that Global Font Lock mode and 61** Fix some of these doc strings by adding \\<keymap-name> where needed.
64File Name Shadow mode are enabled by default. 62
63ada-mode
64array-mode
65artist-mode
66autoarg-mode
67bibtext-mode
68bookmark-bmenu-other-window-with-mouse
69checkdoc-minor-mode
70constrain-to-field
71copy-file
72decipher-mode
73define-generic-mode
74define-ibuffer-op
75diff-mode
76dired-maybe-insert-subdir
77ediff-merge-buffers-with-ancestor
78ediff-merge-directories-with-ancestor
79ediff-merge-directory-revisions-with-ancestor
80edir-merge-revisions-with-ancestor
81edirs-merge-with-ancestor
82edit-picture
83ethio-fidel-to-sera-mail-or-marker
84ethio-sera-to-fidel-mail-or-marker
85face-attribute-specified-or
86face-equal
87flyspell-mode
88hexl-mode
89hi-lock-mode
90ibuffer
91ido-find-file
92internal-lisp-face-equal-p
93isearch-forward
94kmacro-start-macro
95kmacro-start-macro-or-insert-counter
96make-byte-code
97mh-user-agent-compose
98next-single-char-property-change
99octave-mode
100outline-mode
101pascal-mode
102picture-mode
103previous-single-char-property-change
104python-mode
105read-from-minibuffer
106read-key-sequence
107read-key-sequence-vector
108reftex-index-phrases-mode
109reftex-mode
110rmail-mode
111sh-mode
112shell-script-mode
113solar-equinoxes-solstices
114table-capture
115table-insert
116table-split-cell-horizontally
117view-mode
118w32-shell-dos-semantics
65 119
66** Check man/info.texi. 120** Check man/info.texi.
67 121
@@ -77,7 +131,7 @@ leim working Kenichi Handa
77lib-src done ttn 131lib-src done ttn
78lisp done ttn 132lisp done ttn
79lisp/calc done ttn 133lisp/calc done ttn
80lisp/calendar working Glenn Morris 134lisp/calendar done Glenn Morris
81lisp/emacs-lisp done ttn 135lisp/emacs-lisp done ttn
82lisp/emulation done ttn 136lisp/emulation done ttn
83lisp/eshell done ttn 137lisp/eshell done ttn
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 072bc7b785f..5d49c8e9a3b 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,8 @@
12005-12-10 David Koppelman <koppel@ece.lsu.edu>
2
3 * NEWS: hi-lock-mode is now buffer local, use global-hi-lock-mode
4 instead.
5
12005-12-02 Jay Belanger <belanger@truman.edu> 62005-12-02 Jay Belanger <belanger@truman.edu>
2 7
3 * NEWS: Add comment about the Calc prefix. 8 * NEWS: Add comment about the Calc prefix.
diff --git a/etc/NEWS b/etc/NEWS
index 5253362a66e..69be423eff6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -268,6 +268,7 @@ the actual file name into the minibuffer.
268to the text before point. If there is text in the buffer after point, 268to the text before point. If there is text in the buffer after point,
269it remains unchanged. 269it remains unchanged.
270 270
271+++
271** When Emacs prompts for file names, SPC no longer completes the file name. 272** When Emacs prompts for file names, SPC no longer completes the file name.
272This is so filenames with embedded spaces could be input without the 273This is so filenames with embedded spaces could be input without the
273need to quote the space with a C-q. The underlying changes in the 274need to quote the space with a C-q. The underlying changes in the
@@ -1809,6 +1810,18 @@ boundaries during scrolling.
1809 1810
1810* Changes in Specialized Modes and Packages in Emacs 22.1: 1811* Changes in Specialized Modes and Packages in Emacs 22.1:
1811 1812
1813** Changes in Hi Lock:
1814
1815+++
1816*** hi-lock-mode now only affects a single buffer, and a new function
1817`global-hi-lock-mode' enables Hi Lock in all buffers. By default, if
1818hi-lock-mode is used in what appears to be the initialization file, a
1819warning message suggests to use global-hi-lock-mode instead. However,
1820if the new variable `hi-lock-archaic-interface-deduce' is non-nil,
1821using hi-lock-mode in an initialization file will turn on Hi Lock in all
1822buffers and no warning will be issued (for compatibility with the
1823behavior in older versions of Emacs).
1824
1812** Changes in Allout 1825** Changes in Allout
1813 1826
1814*** Topic cryptography added, enabling easy gpg topic encryption and 1827*** Topic cryptography added, enabling easy gpg topic encryption and
diff --git a/etc/orgcard.ps b/etc/orgcard.ps
index 9911d0bbfba..4543d1264f9 100644
--- a/etc/orgcard.ps
+++ b/etc/orgcard.ps
@@ -10,7 +10,7 @@
10%DVIPSWebPage: (www.radicaleye.com) 10%DVIPSWebPage: (www.radicaleye.com)
11%DVIPSCommandLine: dvips -t landscape -o orgcard.ps orgcard.dvi 11%DVIPSCommandLine: dvips -t landscape -o orgcard.ps orgcard.dvi
12%DVIPSParameters: dpi=600, compressed 12%DVIPSParameters: dpi=600, compressed
13%DVIPSSource: TeX output 2005.12.06:1143 13%DVIPSSource: TeX output 2005.12.08:1407
14%%BeginProcSet: texc.pro 14%%BeginProcSet: texc.pro
15%! 15%!
16/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S 16/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S
@@ -2338,7 +2338,7 @@ TeXDict begin
2338%%Page: 1 1 2338%%Page: 1 1
2339TeXDict begin @landscape 1 0 bop -169 -357 a Fj(Org-Mo)t(de)45 2339TeXDict begin @landscape 1 0 bop -169 -357 a Fj(Org-Mo)t(de)45
2340b(Reference)h(Card)g(\(1/2\))546 -242 y Fi(\(for)23 b(v)n(ersion)h 2340b(Reference)h(Card)g(\(1/2\))546 -242 y Fi(\(for)23 b(v)n(ersion)h
2341(3.22\))-150 -36 y Fh(Getting)37 b(Started)-150 96 y 2341(3.23\))-150 -36 y Fh(Getting)37 b(Started)-150 96 y
2342Fg(\(add-to-list)i('auto-mode-alist)h('\("\\\\.org$")e(.)e 2342Fg(\(add-to-list)i('auto-mode-alist)h('\("\\\\.org$")e(.)e
2343(org-mode\)\))-150 179 y(\(define-key)i(global-map)h("\\C-cl")e 2343(org-mode\)\))-150 179 y(\(define-key)i(global-map)h("\\C-cl")e
2344('org-store-link\))1504 155 y Ff(2)-150 261 y Fg(\(define-key)h 2344('org-store-link\))1504 155 y Ff(2)-150 261 y Fg(\(define-key)h
@@ -2360,10 +2360,10 @@ b Fg(C-c)36 b(C-f)-150 1560 y Fi(previous)24 b(heading,)g(same)g(lev)n
2360b(to)f(higher)g(lev)n(el)f(heading)424 b Fg(C-c)36 b(C-u)-150 2360b(to)f(higher)g(lev)n(el)f(heading)424 b Fg(C-c)36 b(C-u)-150
23611700 y Fi(jump)23 b(to)i(another)f(place)h(in)e(do)r(cumen)n(t)350 23611700 y Fi(jump)23 b(to)i(another)f(place)h(in)e(do)r(cumen)n(t)350
2362b Fg(C-c)36 b(C-j)-150 1905 y Fh(Structure)g(Editing)-150 2362b Fg(C-c)36 b(C-j)-150 1905 y Fh(Structure)g(Editing)-150
23632060 y Fi(insert)23 b(new)i(heading)f(at)g(same)g(lev)n(el)g(as)g 23632060 y Fi(insert)23 b(new)i(heading/item)g(at)f(curren)n(t)g(lev)n(el)
2364(curren)n(t)104 b Fg(M-RET)-150 2130 y Fi(insert)23 b(new)i(TODO)e(en)n 2364195 b Fg(M-RET)-150 2130 y Fi(insert)23 b(new)i(TODO)e(en)n(try)700
2365(try)700 b Fg(M-S-RET)-150 2228 y Fi(promote)24 b(curren)n(t)h(heading) 2365b Fg(M-S-RET)-150 2228 y Fi(promote)24 b(curren)n(t)h(heading)f(up)g
2366f(up)g(one)h(lev)n(el)285 b Fg(M-LEFT)-150 2298 y Fi(demote)25 2366(one)h(lev)n(el)285 b Fg(M-LEFT)-150 2298 y Fi(demote)25
2367b(curren)n(t)f(heading)h(do)n(wn)f(one)g(lev)n(el)233 2367b(curren)n(t)f(heading)h(do)n(wn)f(one)g(lev)n(el)233
2368b Fg(M-RIGHT)-150 2368 y Fi(promote)24 b(curren)n(t)h(subtree)f(up)g 2368b Fg(M-RIGHT)-150 2368 y Fi(promote)24 b(curren)n(t)h(subtree)f(up)g
2369(one)g(lev)n(el)301 b Fg(M-S-LEFT)-150 2437 y Fi(demote)25 2369(one)g(lev)n(el)301 b Fg(M-S-LEFT)-150 2437 y Fi(demote)25
@@ -2549,7 +2549,7 @@ end
2549%%Page: 2 2 2549%%Page: 2 2
2550TeXDict begin @landscape 2 1 bop -169 -357 a Fj(Org-Mo)t(de)45 2550TeXDict begin @landscape 2 1 bop -169 -357 a Fj(Org-Mo)t(de)45
2551b(Reference)h(Card)g(\(2/2\))546 -242 y Fi(\(for)23 b(v)n(ersion)h 2551b(Reference)h(Card)g(\(2/2\))546 -242 y Fi(\(for)23 b(v)n(ersion)h
2552(3.22\))-150 -36 y Fh(Timeline,)36 b(Agenda,)h(Global)g(TODO)h(List) 2552(3.23\))-150 -36 y Fh(Timeline,)36 b(Agenda,)h(Global)g(TODO)h(List)
2553-150 120 y Fi(sho)n(w)24 b(timeline)f(of)h(curren)n(t)g(org)f(\014le) 2553-150 120 y Fi(sho)n(w)24 b(timeline)f(of)h(curren)n(t)g(org)f(\014le)
2554458 b Fg(C-c)36 b(C-r)-150 190 y Fi(...)30 b(include)24 2554458 b Fg(C-c)36 b(C-r)-150 190 y Fi(...)30 b(include)24
2555b(past)h(dates)793 b Fg(C-u)36 b(C-c)g(C-r)-150 288 y 2555b(past)h(dates)793 b Fg(C-u)36 b(C-c)g(C-r)-150 288 y
@@ -2741,7 +2741,7 @@ b Fi(with)g(the)h(cur-)4242 3574 y(sor)h(still)g(in)g(a)h(line)f(to)h
2741Fg(org-CUA-compatibility)p Fi(.)4535 3770 y Fb(Cop)n(yrigh)n(t)4838 2741Fg(org-CUA-compatibility)p Fi(.)4535 3770 y Fb(Cop)n(yrigh)n(t)4838
27423768 y(c)4821 3770 y Fa(\015)d Fb(2005)i(F)-5 b(ree)21 27423768 y(c)4821 3770 y Fa(\015)d Fb(2005)i(F)-5 b(ree)21
2743b(Soft)n(w)n(are)i(F)-5 b(oundation,)20 b(Inc.)4795 3826 2743b(Soft)n(w)n(are)i(F)-5 b(oundation,)20 b(Inc.)4795 3826
2744y(v3.22)h(for)h(Org-Mo)r(de)e(3.22,)i(2005)4912 3882 2744y(v3.23)h(for)h(Org-Mo)r(de)e(3.23,)i(2005)4912 3882
2745y(Author:)k(Philip)18 b(Ro)r(ok)n(e)4473 3937 y(based)j(on)g(refcard)g 2745y(Author:)k(Philip)18 b(Ro)r(ok)n(e)4473 3937 y(based)j(on)g(refcard)g
2746(design)g(and)f(format)i(b)n(y)f(Stephen)f(Gildea)4242 2746(design)g(and)f(format)i(b)n(y)f(Stephen)f(Gildea)4242
27474022 y(P)n(ermission)28 b(is)f(gran)n(ted)i(to)f(mak)n(e)h(and)e 27474022 y(P)n(ermission)28 b(is)f(gran)n(ted)i(to)f(mak)n(e)h(and)e
diff --git a/etc/orgcard.tex b/etc/orgcard.tex
index bf1de65ac3f..4ce34432682 100644
--- a/etc/orgcard.tex
+++ b/etc/orgcard.tex
@@ -1,4 +1,4 @@
1% Reference Card for Org Mode 3.22 1% Reference Card for Org Mode 3.23
2% 2%
3%**start of header 3%**start of header
4\newcount\columnsperpage 4\newcount\columnsperpage
@@ -58,7 +58,7 @@
58% Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik 58% Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
59% for their many good ideas. 59% for their many good ideas.
60 60
61\def\orgversionnumber{3.22} 61\def\orgversionnumber{3.23}
62\def\year{2005} 62\def\year{2005}
63 63
64\def\shortcopyrightnotice{\vskip 1ex plus 2 fill 64\def\shortcopyrightnotice{\vskip 1ex plus 2 fill
@@ -307,7 +307,7 @@ are preserved on all copies.
307 307
308\section{Structure Editing} 308\section{Structure Editing}
309 309
310\key{insert new heading at same level as current}{M-RET} 310\key{insert new heading/item at current level}{M-RET}
311\key{insert new TODO entry}{M-S-RET} 311\key{insert new TODO entry}{M-S-RET}
312 312
313\key{promote current heading up one level}{M-LEFT} 313\key{promote current heading up one level}{M-LEFT}
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 84232e0a2be..377f2ce0fc2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,1439 @@
12005-12-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * term/mac-win.el: Create keymap for mac-apple-event-map.
4
52005-12-11 Nick Roberts <nickrob@snap.net.nz>
6
7 * tooltip.el (tooltip-mode): Move to start of file so that it
8 appears at top of customize buffer.
9
10 * progmodes/gud.el (gud-tooltip-modes, gud-tooltip-display):
11 Add the gud groupname.
12 (gud-tooltip-mode): Add the tooltip groupname.
13 (gud-tooltip-echo-area): Add the gud groupname. Remove tag to
14 avoid conflict with tooltip-use-echo-area.
15
162005-12-10 Romain Francoise <romain@orebokech.com>
17
18 * help.el (help-for-help-internal): Add `r' in doc string.
19
202005-12-10 Johan Bockg,Ae(Brd <bojohan@dd.chalmers.se>
21
22 * align.el (align-regexp, align-highlight-rule): Use
23 region-beginning and region-end instead of point and mark, so that
24 repetition (with `repeat-complex-command') recomputes the region
25 bounds.
26
272005-12-10 Lennart Borgman <lennart.borgman.073@student.lu.se>
28
29 * window.el (bw-get-tree, bw-get-tree-1, bw-find-tree-sub)
30 (bw-find-tree-sub-1, bw-l, bw-t, bw-r, bw-b, bw-dir, bw-eqdir)
31 (bw-refresh-edges, bw-adjust-window, bw-balance-sub): New functions.
32 (balance-windows): Rewrite using the above new functions.
33
342005-12-10 David Koppelman <koppel@ece.lsu.edu>
35
36 * hi-lock.el: (hi-lock-mode) Renamed from hi-lock-buffer-mode;
37 react if global-hi-lock-mode seems intended.
38 (global-hi-lock-mode) Renamed from hi-lock-mode.
39 (hi-lock-archaic-interface-message-used)
40 (hi-lock-archaic-interface-deduce): New variables.
41 (turn-on-hi-lock-if-enabled, hi-lock-line-face-buffer)
42 (hi-lock-face-buffer, hi-lock-face-phrase-buffer)
43 (hi-lock-find-patterns, hi-lock-font-lock-hook): Replace
44 hi-lock-buffer-mode with hi-lock-mode.
45
462005-12-10 Kevin Rodgers <ihs_4664@ihs.com>
47
48 * emacs-lisp/lisp.el (lisp-complete-symbol): Regenerate the
49 completion list, even after a partial completion has been
50 inserted in the current buffer. If there are more than 1
51 completion, redisplay the *Completions* buffer; if the
52 completion is unique, delete the *Completions* window.
53
542005-12-10 Eli Zaretskii <eliz@gnu.org>
55
56 * mail/rmail.el (rmail-next-same-subject): Handle multiple "Re: "
57 strings and long subject lines that were broken into multiple
58 lines at arbitrary places. Handle subjects that have "Re: " in
59 the middle.
60
612005-12-10 John W. Eaton <jwe@octave.org>
62
63 * emacs/octave-mod.el (octave-electric-space): Don't indent
64 comments or strings if octave-auto-indent is nil.
65
662005-12-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
67
68 * term/mac-win.el: Require url when compiling. Call
69 mac-process-deferred-apple-events after loading init files.
70 (mac-apple-event-map): New defvar. Define event handlers in it.
71 (core-event, internet-event): New Apple event class symbols.
72 (open-application, reopen-application, open-documents)
73 (print-documents, open-contents, quit-application)
74 (application-died, show-preferences, autosave-now, get-url): New
75 Apple event ID symbols.
76 (about): New HICommand ID symbol.
77 (mac-event-spec, mac-event-ae): New macros.
78 (mac-ae-parameter, mac-ae-list, mac-bytes-to-integer)
79 (mac-ae-selection-range, mac-ae-text-for-search)
80 (mac-ae-open-documents, mac-ae-text, mac-ae-get-url): New functions.
81 (mac-application-menu-map): Remove keymap. Handlers for HICommand
82 and Services menu events are now defined in mac-apple-event-map.
83 (mac-drag-n-drop): Remove selection range handling.
84
852005-12-10 Kenichi Handa <handa@m17n.org>
86
87 * simple.el (zap-to-char): Translate CHAR by
88 translation-table-for-input.
89
90 * isearch.el (isearch-process-search-char): Translate CHAR by
91 translation-table-for-input.
92
932005-12-09 Chong Yidong <cyd@stupidchicken.com>
94
95 * foldout.el (foldout-exit-fold): Properly hide subtree.
96
972005-12-09 Reiner Steib <Reiner.Steib@gmx.de>
98
99 * files.el (save-buffer):
100 * international/ucs-tables.el (ucs-set-table-for-input):
101 * mail/mail-extr.el (mail-extract-address-components):
102 * mail/sendmail.el (mail-mode): Reformat doc string.
103
1042005-12-09 Juri Linkov <juri@jurta.org>
105
106 * isearch.el (isearch-highlight): Change main overlay priority
107 from 1 to 1001. Simplify.
108 (isearch-lazy-highlight-update): Change lazy overlay priority
109 from 0 to 1000.
110
111 * replace.el (replace-highlight): Change overlay priority from
112 1 to 1001.
113
114 * textmodes/ispell.el (ispell-highlight-spelling-error-overlay):
115 Change overlay priority from 1 to 1001. Reuse existing overlay.
116
117 * compare-w.el (compare-windows-highlight): Change overlay
118 priority from 1 to 1000.
119
120 * menu-bar.el (menu-bar-edit-menu): Add listp around
121 pending-undo-list to disable menu item "undo" when pending
122 undo list is empty.
123
124 * locate.el (locate): Disable undo in *Locate* buffer.
125
1262005-12-09 Kim F. Storm <storm@cua.dk>
127
128 * mail/smtpmail.el (smtpmail-via-smtp): Disable undo in SMTP buffer.
129
1302005-12-09 David Ponce <david@dponce.com>
131
132 * recentf.el: Improvement of the menu code.
133 (recentf-enabled-p): Move before first use. Use `kill-emacs-hook'
134 instead of menu hook.
135 (recentf-show-menu, recentf-hide-menu): New functions.
136 (recentf-menu-customization-changed, recentf-mode): Use them.
137 (recentf-menu-action, recentf-max-menu-items)
138 (recentf-menu-open-all-flag, recentf-menu-append-commands-flag)
139 (recentf-arrange-by-rule-others)
140 (recentf-arrange-by-rules-min-items)
141 (recentf-arrange-by-rule-subfilter) : Don't use
142 `recentf-menu-customization-changed'.
143 (recentf-arrange-rules): Likewise. Accept functions to compute
144 sub-menu titles.
145 (recentf-menu-filter): Likewise. Doc fix.
146 (recentf-menu-value-shortcut): Doc fix.
147 (recentf-dump-variable): Quote atom value.
148 (recentf-make-menu-items): Update to use it as a menu filter.
149 (recentf-match-rule): New function.
150 (recentf-arrange-by-rule): Use it.
151 (recentf-indirect-mode-rule): New function.
152 (recentf-build-mode-rules): Use it.
153 (recentf-dir-rule): New function.
154 (recentf-arrange-by-dir): Use it.
155 (recentf-filter-changer-current): Rename from
156 `recentf-filter-changer-state'. All references updated.
157 (recentf-filter-changer-alist): Update filter names.
158 (recentf-filter-changer-select): New function.
159 (recentf-filter-changer): Use it. Make a sub-menu from filters
160 available in `recentf-filter-changer-alist'.
161 (recentf-data-cache, recentf-clear-data)
162 (recentf-update-menu): Remove. All references updated.
163 (recentf-match-rule-p, recentf-build-dir-rules)
164 (recentf-filter-changer-goto-next)
165 (recentf-filter-changer-get-current)
166 (recentf-filter-changer-get-next): Remove.
167
1682005-12-08 Luc Teirlinck <teirllm@auburn.edu>
169
170 * cus-edit.el (custom-buffer-create-internal): Relabel the whole
171 buffer "Reset" button to "Reset to Current" for consistency with
172 the State buttons.
173
1742005-12-08 John Paul Wallington <jpw@pobox.com>
175
176 * ibuf-ext.el (define-ibuffer-filter filename):
177 If `dired-directory' is a list then really use its car.
178
1792005-12-08 Kim F. Storm <storm@cua.dk>
180
181 * emulation/cua-rect.el (cua--rectangle-aux-replace): Fix
182 indention of text on right side of replaced rectangle.
183
1842005-12-09 Nick Roberts <nickrob@snap.net.nz>
185
186 * progmodes/gud.el (gud-speedbar-buttons, gud-tooltip-tips):
187 No need to check gud-comint-buffer is bound.
188 (gdb): Prevent multiple debugging when first session uses gdba.
189
1902005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
191
192 CC Mode update to 5.31.
193
194 * progmodes/cc-subword.el: Add a dummy `c-subword-mode' for
195 Emacsen which lack `define-minor-mode'. (Currently Emacs <21. We
196 might do this function properly in the future).
197
198 * progmodes/cc-cmds.el, cc-defs.el, cc-styles.el, cc-vars.el: New
199 macros c-sentence-end and c-default-value-sentence end, to cope
200 with Emacs 22's new function `sentence-end'.
201
2022005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
203
204 * progmodes/cc-cmds.el (c-show-syntactic-information): Solved the
205 compat issue using `c-put-overlay' and `c-delete-overlay'.
206
207 * progmodes/cc-defs.el (c-put-overlay, c-delete-overlay): New
208 compat macros to handle overlays/extents.
209
2102005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
211
212 * progmodes/cc-fix.el: Add definitions of the macros push and pop
213 (for GNU Emacs 20.4)
214
215 * progmodes/cc-defs.el:
216 (i) Load cc-fix.elc for `push' and `pop' (for GNU Emacs 20.4)
217
218 * progmodes/cc-cmds.el (c-show-syntactic-information): change the
219 highlighting mechanism so it will work in XEmacs too.
220
221 * progmodes/cc-defs.el: Insert c-int-to-char.
222
223 * progmodes/cc-langs.el (c-nonsymbol-token-char-list): Insert a
224 call to the new macro c-int-to-char. This solves XEmacs's
225 regarding characters as different from integers.
226
2272005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
228
229 * progmodes/cc-fonts.el (c-make-syntactic-matcher): New internal
230 helper.
231
232 (c-cpp-matchers, c-basic-matchers-before): Use the `eval'
233 construct to make the indirect face lookup work in XEmacs.
234
235 (c-cpp-matchers): Append the negation char face to the existing
236 fontification, so that the cpp face doesn't disappear. Use
237 `c-make-syntactic-matcher' to avoid negation chars in comments and
238 strings.
239
240 * progmodes/cc-fonts.el (c-negation-char-face-name): New variable
241 to map to `font-lock-negation-char-face' in emacsen where it
242 exists.
243
2442005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
245
246 * progmodes/cc-mode.el: Bind c-subword-mode to C-c C-w.
247
248 * progmodes/cc-subword.el, cc-cmds.el, cc-mode.el: Rename
249 "c-subword-move-mode" as "c-subword-mode".
250
251 * progmodes/cc-mode.el: Added tty suitable bindings for C-c
252 <delete> and C-c C-<delete>. (To the c-hungry- delete functions).
253
2542005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
255
256 * progmodes/cc-mode.el: Added autoload directive for
257 `c-subword-move-mode' for use in older emacsen.
258
2592005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
260
261 * progmodes/cc-mode.el:
262 (i) Insert a binding for C-c C-backspace into
263 c-bind-special-erase-keys which works in TTYs.
264 (ii) Make sure that when file styles are used, any explicitly
265 given style variables take priority over those in the style. Do
266 this by calling `hack-local-variables' a second time.
267
268 * progmodes/cc-vars.el: Add language specific customization
269 widgets for AWK to c-doc-comment-style, c-require-final-newline
270 and c-default-style. Add a defcustom for awk-mode-hook. Give
271 c-syntactic-element and c-syntactic-context doc-strings by
272 directly setting their `variable-documentation' propery. This
273 allows Emacs 22.1 to read these with C-h v.
274
275 * progmodes/cc-awk.el: Apply a tidy-up patch (from Stefan
276 Monnier).
277
2782005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
279
280 * progmodes/cc-fonts.el, cc-vars.el
281 (gtkdoc-font-lock-doc-comments, gtkdoc-font-lock-doc-protection,
282 gtkdoc-font-lock-keywords): GtkDoc patterns contributed by
283 Masatake YAMATO.
284
285 (c-doc-comment-style): Made GtkDoc default in C mode.
286
287 * progmodes/cc-mode.el: Fixed key bindings for C-c C-<backspace>
288 and C-c C-<delete>.
289
290 (c-bind-special-erase-keys): New function for use on
291 `normal-erase-is-backspace-hook' to bind C-c C-<delete> correctly.
292
293 * progmodes/cc-cmds.el (c-hungry-delete): New function to fix
294 <delete> key behavior in XEmacs according to `delete-forward-p'.
295 C.f. `c-electric-delete'.
296
2972005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
298
299 * progmodes/cc-mode.el: Give c-hungry-backspace and
300 c-hungry-delete-forward permanent key bindings.
301
302 * progmodes/cc-cmds.el (c-electric-semi&comma): Bind
303 c-syntactic-context for calls to "criteria functions", for
304 consistency with other calls to user functions.
305
306 * progmodes/cc-cmds.el (c-indent-command): expunge use of
307 `current-prefix-arg', since this might be the prefix arg to a
308 command which calls c-indent-command as a function. Change the
309 interactive spec from "p" to "P".
310
311 * progmodes/cc-styles.el: Amend the doc-string of c-set-style, in
312 reponse to a report from Joseph Kiniry <kiniry@acm.org> that it
313 was difficult to understand.
314
3152005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
316
317 * progmodes/cc-engine.el (c-on-identifier): Fixed bug when at the
318 first char of an identifier.
319
320 * progmodes/cc-engine.el (c-on-identifier): Handle the "operator
321 +" syntax in C++.
322
3232005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
324
325 * progmodes/cc-cmds.el (c-mask-paragraph): correct, so that
326 auto-fill doesn't split a c-comment's last word from a hanging
327 "*/" when a space is typed between them after fill-column.
328
329 * progmodes/cc-defs.el: New macro c-delete-and-extract-region.
330
331 * progmodes/cc-styles.el (c-set-style,
332 c-setup-paragraph-variables): Abort the command if we're not in a
333 CC Mode buffer.
334
335 * progmodes/cc-align.el (c-lineup-C-comments): Correct indentation
336 with blank comment-prefix, and a blank line as the comment's
337 second line.
338
3392005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
340
341 * progmodes/cc-fonts.el (c-cpp-matchers, c-basic-matchers-before):
342 Incorporated the patterns added in the Emacs development branch
343 for the new Emacs 22 face `font-lock-negation-char-face'.
344
345 * progmodes/cc-fonts.el (c-invalid-face-name): Use "red1" instead
346 of "red" since it stands out better in xterms and DOS terminals.
347
348 * progmodes/cc-engine.el (c-literal-faces): Added
349 `font-lock-comment-delimiter-face' which is new in Emacs 22.
350
3512005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
352
353 * progmodes/cc-cmds.el: Make C-c C-a (`c-toggle-auto-newline')
354 forcibly enable c-electric-flag.
355
356 * progmodes/cc-vars.el, cc-cmds.el: New clean-up
357 `comment-close-slash' on c-electric-slash: if enabled, typing `/'
358 just after the comment-prefix of a C-style comment will close that
359 comment.
360
3612005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
362
363 * progmodes/cc-fonts.el (c-basic-matchers-before,
364 c-complex-decl-matchers): Fixed the "not-arrow-prefix" regexp used
365 in Pike.
366
367 * progmodes/cc-langs.el (c-other-op-syntax-tokens): Only C++ has
368 digraphs.
369
370 * progmodes/cc-fonts.el, cc-langs.el, cc-engine.el
371 (c-cpp-message-directives, c-cpp-include-directives,
372 c-opt-cpp-macro-define, c-opt-cpp-macro-define-start,
373 c-cpp-expr-directives): Introduced new language constants to
374 control cpp syntax in a cleaner way.
375
376 (c-cpp-expr-functions): Renamed from c-cpp-defined-fns.
377
378 (c-cpp-matchers, c-forward-to-cpp-define-body): Use them.
379
380 * progmodes/cc-langs.el, cc-fonts.el (c-string-escaped-newlines,
381 c-multiline-string-start-char): New language constants and
382 variables to specify how newlines in string literals work.
383
384 (c-font-lock-invalid-string): Use them.
385
386 * progmodes/cc-cmds.el (c-try-one-liner): Robustness fix if an
387 unbalanced close brace is entered. Optimization by avoiding going
388 back over arbitrarily large blocks. Removed hints that this
389 function only would be relevant/useful in AWK.
390
391 (c-electric-brace): Indent syntactically after the cleanups since
392 lineup functions might do it differently then.
393
394 * progmodes/cc-engine.el, cc-langs.el
395 (c-opt-op-identifier-prefix): New language constant and variable.
396
397 (c-just-after-func-arglist-p, c-after-special-operator-id,
398 c-search-decl-header-end, c-inside-bracelist-p): Use it.
399
400 * progmodes/cc-align.el, cc-engine.el
401 (c-after-special-operator-id): New helper to handle C++ operator
402 identifiers.
403
404 (c-lineup-topmost-intro-cont, c-just-after-func-arglist-p,
405 c-guess-basic-syntax): Handle C++ operator identifiers in
406 declarations.
407
408 * progmodes/cc-langs.el (c-assignment-operators): Added the
409 trigraph version of ^= too.
410
411 * progmodes/cc-langs.el (c-assignment-operators): Added the
412 trigraph version of |= in C++.
413
414 * progmodes/cc-fonts.el (c-font-lock-declarators): Handle
415 `c-decl-hangon-kwds' after the identifier name.
416
417 * progmodes/cc-engine.el (c-guess-basic-syntax): When deciding
418 whether an arglist is "nonempty", ignore a comment after the open
419 paren if it isn't followed by a non-comment token on the same
420 line.
421
422 * progmodes/cc-engine.el (c-guess-basic-syntax): Case 4: Enable
423 heuristics below the point to cope with classes inside special
424 brace lists in Pike.
425
4262005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
427
428 * progmodes/cc-cmds.el: Amend c-point-syntax to handle macros.
429
4302005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
431
432 * progmodes/cc-guess.el (cc-guess-install): New function to
433 install an already guessed style in another buffer.
434
435 * progmodes/cc-defs.el (c-tentative-buffer-changes): No longer
436 sets `inhibit-read-only' - `c-save-buffer-state' should be used
437 anyway if the change always is undone.
438
4392005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
440
441 Implement togglable electricity:
442
443 * progmodes/cc-defs.el: Enhance c-save-buffer-state's doc-string,
444 saying when it should be used.
445
446 * progmodes/cc-engine.el: Add the new buffer-local variable,
447 c-electric-flag.
448
449 * progmodes/cc-langs.el: Change the name of c-toggle-auto-state to
450 c-toggle-auto-newline.
451
452 * progmodes/cc-mode.el: Rename c-toggle-auto-state to
453 c-toggle-auto-newline. Remove the binding for
454 c-toggle-auto-hungry-state. Add the binding C-c C-l for the new
455 c-toggle-electric-state.
456
457 * progmodes/cc-vars.el: Make c-syntactic-indentation buffer local.
458
459 * progmodes/cc-cmds.el: Add `c-bytecomp-defun's for
460 c-\(forward\|backward\)-subword.
461 (c-update-modeline): Add the new modeline flag `l' for
462 `c-electric-flag'. Make the auto-newline flag `a' dependent on
463 `l'.
464 (c-toggle-auto-state): Rename it to `c-toggle-auto-newline'. Make
465 the old name an alias of the new name.
466 (c-toggle-electric-state): New function.
467 c-electric-\(pound\|brace\|slash\|star\|semi&comma\|colon\|lt-gt\|paren\|continued-statement\):
468 Adapt these functions to do electric things only when
469 c-electric-flag is non-nil.
470 (c-point-syntax, c-brace-newlines, c-try-oneliner): Extract these
471 new functions from c-electric-brace.
472 (c-point-syntax): Add a check for "virtual semicolons" in AWK
473 mode, so that the tentative extra newline doesn't change the
474 syntax of the following brace.
475 (c-electric-brace): restructure by extracting the above functions.
476 Tidy up the coding somewhat.
477 (c-electric-semi&comma, c-electric-colon, c-electric-paren):
478 restructure a bit.
479
4802005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
481
482 * progmodes/cc-cmds.el (c-show-syntactic-information): Show the
483 anchor position(s) using faces. Thanks to Masatake YAMATO for the
484 idea.
485
486 * progmodes/cc-mode.el, cc-cmds.el, cc-defs.el, cc-engine.el
487 (c-submode-indicators): Changed name from `c-auto-hungry-string'
488 since it's now used to track another submode.
489
490 (c-update-modeline): Converted to function and extended to check
491 `c-subword-move-mode'.
492
493 (c-forward-into-nomenclature, c-backward-into-nomenclature):
494 Converted to compat aliases for `c-forward-subword' and
495 `c-backward-subword'.
496
497 * progmodes/cc-subword.el: New functions and minor mode to handle
498 SillyCapsedStyleIndentifiers, contributed by Masatake YAMATO:
499
500 (c-forward-subword, c-backward-subword, c-mark-subword,
501 c-kill-subword, c-backward-kill-subword, c-transpose-subwords,
502 c-capitalize-subword, c-downcase-subword, c-upcase-subword):
503 Functions corresponding to the standard word handling functions.
504
505 (c-subword-move-mode): Minor mode that replaces all the standard
506 word handling functions with their subword equivalences.
507
5082005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
509
510 * progmodes/cc-vars.el (c-cleanup-list): Insert a customization
511 entry for one-liner-defun.
512
513 * progmodes/cc-defs.el: Give c-tentative-buffer-changes its own
514 name in its def-edebug-spec.
515
516 * progmodes/cc-cmds.el (c-electric-brace): Make the
517 one-liner-defun clean-up work with empty-defun-braces. o-l-d now
518 compacts space before a comment, if this will make things fit on
519 one line.
520
521 Introduce an "awk" style, mainly for auto-newline and clean-ups.
522
523 * progmodes/cc-align.el: new function c-snug-1line-defun-close
524
525 * progmodes/cc-cmds.el: In c-electric-brace, add code for new
526 clean-up one-liner-defun.
527
528 * progmodes/cc-styles.el: Add the new "awk" style.
529
530 * progmodes/cc-vars.el: Add description of one-liner-defun to
531 c-cleanup-list's doc-string. New user options,
532 c-max-one-liner-length. In c-default-style, set the default style
533 for AWK to "awk".
534
5352005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
536
537 * progmodes/cc-engine.el (c-forward-label): Fixed fontification of
538 macros inside labels.
539
540 * progmodes/cc-engine.el (c-looking-at-bos): Obsoleted in favor of
541 `c-at-statement-start-p' and `c-at-expression-start-p'.
542
543 * progmodes/cc-defs.el (c-tnt-chng-record-state): Don't signal an
544 error if the mark isn't set.
545
546 * progmodes/cc-engine.el (c-guess-continued-construct,
547 c-guess-basic-syntax): Use `c-forward-decl-or-cast-1' to more
548 accurately detect functions inside functions.
549
550 * progmodes/cc-engine.el (c-at-expression-start-p): New function
551 like `c-at-statement-start-p' that additionally recognizes commas
552 and expression parentheses as delimiters.
553
554 * progmodes/cc-engine.el (c-looking-at-inexpr-block): Added flag
555 to avoid heuristics that doesn't work for unclosed blocks.
556
557 (c-at-statement-start-p): New function.
558
559 * progmodes/cc-engine.el, cc-fonts.el: Fixes in handling of
560 Objective-C directives, e.g. directives spanning lines should work
561 reasonably well now.
562
563 (c-put-c-type-property, c-clear-c-type-property): New helpers.
564
565 (c-forward-objc-directive): New function to move over any ObjC
566 directive.
567
568 (c-just-after-func-arglist-p, c-guess-basic-syntax,
569 c-basic-matchers-before): Use it.
570
571 (c-font-lock-objc-iip-decl): Removed.
572
573 * progmodes/cc-engine.el (c-guess-basic-syntax): Some improvement
574 in the template arglist recognition.
575
576 * progmodes/cc-styles.el (c-style-alist): Fixed several
577 inconsistencies in the Whitesmith style.
578
579 * progmodes/cc-align.el (c-lineup-after-whitesmith-blocks): New
580 lineup function to get lines after Whitesmith style blocks
581 correctly indented.
582
583 (c-lineup-whitesmith-in-block): Backed out the compensation for
584 opening parens since it's done using `add' lists in the style
585 definition instead. Don't use the anchor position since it varies
586 too much between the syntactic symbols. :P
587
588 * progmodes/cc-vars.el (c-valid-offset): Updated.
589
590 * progmodes/cc-engine.el (c-evaluate-offset): Extended to handle
591 lists where the offsets are combined according to several
592 different methods: `first', `min', `max', and `add'. Report
593 offset evaluation errors with `c-benign-error' so that some kind
594 of reindentation still is done.
595
596 * progmodes/cc-engine.el (c-guess-basic-syntax): Anchor
597 `arglist-intro' the same way as `arglist-cont-nonempty' and
598 `arglist-close'.
599
600 * progmodes/cc-engine.el (c-guess-basic-syntax): Fixed similar
601 situations for `arglist-cont-nonempty' and `arglist-close'.
602
603 * progmodes/cc-langs.el (c-opt-identifier-concat-key-depth): New
604 constant.
605
606 * progmodes/cc-defs.el: Use `cc-bytecomp-fboundp' and
607 cc-bytecomp-boundp' in a number of places.
608
609 * progmodes/cc-engine.el (c-beginning-of-statement-1): Fixed a
610 macro related issue.
611
6122005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
613
614 * progmodes/cc-awk.el: Change the terminology of regexps: A char
615 list is now
616 [asdf], a char class [:alpha:]. Include code for char classes.
617 Set c-awk-NL-prop on lines ending in open strings. (Bug fix.)
618 Add character classes (e.g. "[:alpha:]") into AWK Mode's regexps.
619
620 Remove (nearly all of) the cruft associated with AWK Mode's former
621 concept of "virtual semicolons":
622
623 Adapt c-beginning-of-statement, c-end-of-statement (together with
624 subfunctions) to use the new notion of "virtual semicolon" in
625 place of the old awkward special handling for AWK. There remains
626 much cruft in cc-awk.el, cc-cmds.el and cc-engine.el to clear out.
627 * progmodes/cc-cmds.el:
628 (c-ascertain-adjacent-literal): In the backwards direction, now
629 recognises AWK regexp delimiters as string delimiters.
630 (c-after-statement-terminator-p): Adapt for virtual semicolons;
631 check more rigorously for "end of macro".
632 (c-back-over-illiterals, c-forward-over-illiterals): Adapt for
633 virtual semicolons;
634 (c-beginning-of-statement): Adapt for virtual semicolons; Separate
635 out the code for forward movement into ...
636 (c-end-of-statement): Now contains the code for forward movement,
637 adapted for virtual semicolons.
638
639 * progmodes/cc-engine.el:
640 (c-ws*-string-limit-regexp): new regexp.
641 (c-forward-single-comment, c-backward-single-comment): Comment out
642 the (now redundant) "special" AWK stuff.
643
644 * progmodes/cc-styles.el, cc-vars.el: Change the settings of
645 c-string-par-start, c-string-par-separate to be more like Text
646 Mode than Fundamental Mode.
647
6482005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
649
650 * progmodes/cc-fonts.el (c-font-lock-declarations): Always narrow
651 to the fontified region so that fontification doesn't occur
652 outside it
653 (could happen e.g. when fontifying a line with an unfinished
654 declaration).
655
6562005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
657
658 * progmodes/cc-awk.el: Regexps for analysing AWK code have been
659 moved to near the start of the file. ^L now separate sections of
660 the file. New defconsts: c-awk-non-eol-esc-pair-re,
661 c-awk-blank-or-comment-line-re,
662 c-awk-one-line-possibly-open-string-re,
663 c-awk-regexp-one-line-possibly-open-char-class-re,
664 c-awk-one-line-possibly-open-regexp-re,
665 c-awk-one-line-non-syn-ws*-re. New functions: c-awk-at-vsemi-p,
666 c-awk-vsemi-status-unknown-p.
667
668 Amend the concept of "virtual semicolons" (in the indentation
669 engine) for languages like AWK, such that they are now
670 conceptually attached to end of the last token of a statement, not
671 the end of the line. (In AWK Mode, however, the pertinent text
672 property is still physically set on the EOL.) Remove the specific
673 tests for awk-mode, thus facilitating the introduction of other
674 language modes where EOLs can end statements. (Note: The
675 funtionality in cc-cmds.el, specifically
676 c-beginning/end-of-statement has yet to be amended.)
677
678 * progmodes/cc-defs.el: New macros c-at-vsemi-p,
679 c-vsemi-status-unknown-p.
680
681 * progmodes/cc-langs.el: Added `#' into AWK Mode's value of
682 c-stmt-delim-chars. New c-lang-defvars: c-at-vsemi-p-fn,
683 c-vsemi-status-unknown-p-fn (in a new page).
684
685 * progmodes/cc-engine.el: In c-beginning-of-statement-1,
686 c-crosses-statement-barrier-p, c-guess-basic-syntax, replace
687 numerous awkward forms like
688 (if (c-major-mode-is 'awk-mode) (c-awk-prev-line-incomplete-p))
689 with
690 (c-at-vsemi-p). Fix a few typos. In c-guess-basic-syntax, new
691 variable before-ws-ip, the place just after char-before-ip
692 appears.
693
694 * progmodes/cc-mode.el: Fix what's almost a semantic ambiguity in
695 a comment.
696
6972005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
698
699 * progmodes/cc-cmds.el (c-electric-brace): Cleaned up using
700 `c-tentative-buffer-changes'.
701
702 * progmodes/cc-defs.el (c-region-is-active-p): Simplified and
703 converted to macro to choose between Emacs and XEmacs at compile
704 time.
705
706 (c-set-region-active): New set counterpart to
707 `c-region-is-active-p'.
708
709 (c-tentative-buffer-changes): New macro to handle temporary buffer
710 changes in a convenient way.
711
712 (c-tnt-chng-record-state, c-tnt-chng-cleanup): Internal helpers
713 for `c-tentative-buffer-changes'.
714
715 * progmodes/cc-engine.el (c-looking-at-inexpr-block): Tightened up
716 the checks for paren sexps between the point and the keyword, to
717 avoid some false alarms.
718
719 * progmodes/cc-engine.el, cc-langs.el (c-looking-at-inexpr-block):
720 Fixed a situation where an error could be thrown for unbalanced
721 parens. Changed to make use of c-keyword-member' to avoid some
722 repeated regexp matches.
723
724 (c-opt-lambda-key, c-opt-inexpr-block-key,
725 c-opt-inexpr-class-key): These language variable are no longer
726 necessary.
727
728 (c-block-stmt-kwds): New language constant used by
729 c-looking-at-inexpr-block'.
730
731 (c-guess-basic-syntax): Removed an optional check that looked at
732 the existence of the now removed language variables.
733
734 * progmodes/cc-engine.el (c-fdoc-shift-type-backward,
735 c-forward-decl-or-cast-1): Fixed invalid recognition of C++ style
736 object instantiation expressions as declarations in some contexts.
737 This bug only affected languages where the declarator can't be
738 enclosed in parentheses.
739
740 * progmodes/cc-styles.el (c-style-alist): Fixed the GNU style to
741 insert newlines before and after substatement braces.
742
743 * progmodes/cc-engine.el: Improved the heuristics for recognizing
744 function declaration headers and the handling of C++ style member
745 init lists.
746
747 (c-just-after-func-arglist-p): Rewritten to use
748 `c-forward-decl-or-cast-1'. Now behaves a bit differently too.
749
750 (c-beginning-of-member-init-list): Removed since it isn't used
751 anymore.
752
753 (c-guess-basic-syntax): Case 5B adapted for the new
754 `c-just-after-func-arglist-p'. Cases 5B.1 and 5B.3 merged. Cases
755 5D.1 and 5D.2 removed since they aren't trigged anymore (case 5B.1
756 covers all cases now).
757
758 * progmodes/cc-defs.el (c-point): Added 'bosws and 'eosws.
759
7602005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
761
762 * progmodes/cc-cmds.el, cc-styles.el, cc-vars.el: New variables
763 c-string-par-start/separate c-sentence-end-with-esc-eol,
764 initialised in c-setup-paragraph-variables, used in string
765 scanning subroutines of c-beginning-of-statement.
766
767 * progmodes/cc-cmds.el (c-electric-brace): don't delete a comment
768 which precedes the newly inserted `{'.
769
7702005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
771
772 * progmodes/cc-engine.el, cc-langs.el: Rewrote the recognition
773 function for declaration level blocks. It should now cope with
774 templates better and also be a lot more comprehensible.
775
776 (c-looking-at-decl-block): The new function.
777
778 (c-search-uplist-for-classkey): The old one. It's now a wrapper
779 for compatibility.
780
781 (c-add-class-syntax, c-guess-continued-construct,
782 c-guess-basic-syntax): Adapted for `c-looking-at-decl-block'.
783
784 (c-decl-block-key): Changed to tell apart ambiguous and
785 unambiguous keywords. Pike specials are now handled directly in
786 the code instead.
787
788 (c-block-prefix-disallowed-chars, c-block-prefix-charset): New
789 language constants and variables to make the backward skip in
790 `c-looking-at-decl-block' as tight as possible.
791
792 (c-nonsymbol-token-char-list): New language constant.
793
794 * progmodes/cc-engine.el (c-backward-<>-arglist): New function to
795 find balanced template arglists backwards.
796
797 * progmodes/cc-defs.el (c-make-bare-char-alt): New helper for
798 making char classes for `c-syntactic-skip-backward'.
799
800 * progmodes/cc-engine.el (c-guess-basic-syntax): Simplified case
801 16D - can't be a class-close at that point.
802
803 * progmodes/cc-engine.el (c-guess-basic-syntax,
804 c-add-class-syntax): Don't narrow out the enclosing declaration
805 level. This makes everything a lot easier, and it was actually
806 only four small places that needed it to work. Some places that
807 previously did `widen' are removed now, which has the effect that
808 `c-guess-basic-syntax' never will look at things outside the
809 current narrowment now. The anchor position for `topmost-intro'
810 is affected by this, but it was so bogus it was basically useless
811 before, and now it's equally bogus but in a slightly different
812 way.
813
814 (c-narrow-out-enclosing-class): Gone.
815
816 (c-most-enclosing-brace, c-least-enclosing-brace): Don't filter to
817 the narrowed region.
818
819 (c-least-enclosing-brace): Removed silly optional argument.
820
821 * progmodes/cc-engine.el (c-beginning-of-decl-1): Fixed bug where
822 the point could be left directly after an open paren when finding
823 the beginning of the first decl in the block.
824
825 * progmodes/cc-engine.el, cc-fonts.el (c-forward-keyword-clause):
826 Specify which submatch to use.
827
828 * progmodes/cc-langs.el (c-symbol-start): Include '@' in ObjC.
829
830 (c-decl-start-re): No no longer any need for special treatment of
831 ObjC due to the above.
832
833 (c-other-block-decl-kwds): Handle "extern" in ObjC too since it
834 presumably follows C in that regard.
835
836 * progmodes/cc-langs.el (c-identifier-ops, c-after-id-concat-ops):
837 New language constants to specify operator tokens inside
838 identifiers in a more high level way.
839
840 (c-opt-identifier-prefix-key): New internal language constant.
841
842 (c-opt-identifier-concat-key, c-opt-after-id-concat-key,
843 c-identifier-start, c-identifier-key): Now completely calculated
844 from other constants.
845
846 (c-identifier-last-sym-match): Decommissioned since it's no longer
847 used.
848
849 (c-operators): Use `c-identifier-ops'. Documented
850 `postfix-if-paren'.
851
852 * progmodes/cc-engine.el (c-forward-name): Removed the
853 optimization when c-identifier-key is equal to c-symbol-key since
854 it doesn't work in byte compiled files. Don't record empty
855 regions as identifiers.
856
857 * progmodes/cc-langs.el (c-filter-ops): New helper function to
858 simplify access to `c-operators' and its likes.
859
860 (c-operator-list, c-all-op-syntax-tokens,
861 c-nonsymbol-token-regexp, c-<>-multichar-token-regexp,
862 c-<-op-cont-regexp, c->-op-cont-regexp, c-expr-kwds,
863 c-primary-expr-regexp, c-cast-parens): Use it.
864
865 * progmodes/cc-defs.el (c-lang-const): Fixes to allow use without
866 an explicit language in functions.
867
868 * progmodes/cc-defs.el (c-make-keywords-re): Added an appendable
869 variant of adornment.
870
871 * progmodes/cc-langs.el (c-any-class-key): Removed unused language
872 variable.
873
874 (c-type-decl-prefix-key): Removed some now unnecessary cruft from
875 the Pike value.
876
877 * progmodes/cc-engine.el (c-on-identifier,
878 c-simple-skip-symbol-backward): Small fix for handling "-"
879 correctly in `skip-chars-backward'. Affected the operator lfun
880 syntax in Pike.
881
882 * progmodes/cc-langs.el (c-make-init-lang-vars-fun): Disabled the
883 diagnostic message about precompiled language vars not being used.
884
885 * progmodes/cc-langs.el (c-paren-nontype-kwds): The GCC keyword
886 "__attribute__" is followed by a parenthesis.
887
888 (c-type-start-kwds, c-prefix-spec-kwds, c-prefix-spec-kwds-re,
889 c-specifier-key, c-not-decl-init-keywords): Some cleanup using new
890 language constants `c-type-start-kwds' and `c-prefix-spec-kwds'.
891
892 * progmodes/cc-fonts.el, cc-langs.el, cc-engine.el: Internal
893 cleanups to properly detect the declared identifiers in various
894 declarations.
895
896 (c-decl-start-kwds): New language constant to recognize
897 declarations that can start anywhere. Used for class declarations
898 in Pike.
899
900 (c-specifier-key, c-not-decl-init-keywords,
901 c-decl-prefix-or-start-re, c-find-decl-prefix-search,
902 c-find-decl-spots): Implement `c-decl-start-kwds'.
903
904 (c-other-decl-kwds, c-postfix-decl-spec-kwds, c-decl-hangon-kwds,
905 c-decl-hangon-key, c-forward-decl-or-cast-1): Separated the
906 handling of the compiler specific extension keywords into a new
907 language constant `c-decl-hangon-kwds' that defines keyword
908 clauses to be ignored in declarations.
909
910 (c-forward-id-comma-list, c-forward-keyword-clause): Don't skip
911 past unrecognized tokens when handling `c-colon-type-list-kwds'.
912 Necessary to stop at the declared identifier in e.g. IDL valuetype
913 declarations.
914
915 (c-typedef-decl-kwds, c-typeless-decl-kwds, c-type-list-kwds,
916 c-prefix-spec-kwds-re, c-postfix-spec-kwds,
917 c-after-suffixed-type-decl-key, c-opt-postfix-decl-spec-key,
918 c-forward-decl-or-cast-1): Recognize the declared identifier in
919 class and enum declarations as such and not as part of the type.
920
921 (c-forward-decl-or-cast-1, c-forward-label): Relaxed the
922 interpretation of PRECEDING-TOKEN-END when there's no preceding
923 token.
924
925 (c-forward-decl-or-cast-1): Don't disregard sure signs of
926 declarations when there's some syntax error later on.
927
928 (c-complex-decl-matchers): Did away with a reference to
929 `c-specifier-key'.
930
931 * progmodes/cc-engine.el (c-maybe-labelp): Provide no default
932 value - this variable is always dynamically bound.
933
934 * progmodes/cc-engine.el, cc-fonts.el, cc-langs.el, cc-menus.el,
935 cc-mode.el, cc-styles.el, cc-vars.el, cc-align.el, cc-awk.el,
936 cc-cmds.el, cc-defs.el: Changed the policy for marking up
937 functions that might do hidden buffer changes: All such internal
938 functions are now marked instead of those that don't.
939
940 (c-beginning-of-macro, c-end-of-macro, c-(forward|backward)-comments,
941 c-(forward|backward)-single-comment, c-parse-state, c-on-identifier,
942 c-(fast-|slow-|)in-literal, c-literal-limits, c-collect-line-comments,
943 c-literal-type): Allow these functions to make hidden buffer changes,
944 so that they are free to use text property caching later on.
945
946 (c-electric-backspace, c-electric-delete-forward, c-electric-pound,
947 c-electric-brace, c-electric-slash, c-electric-star,
948 c-electric-semi&comma, c-electric-colon, c-electric-lt-gt,
949 c-electric-paren, c-electric-continued-statement, c-indent-command,
950 c-indent-region, c-mask-paragraph, c-indent-new-comment-line,
951 c-context-line-break): Added `c-save-buffer-state' calls to comply
952 with the changed semantics of the functions above.
953
954 * progmodes/cc-engine.el (c-beginning-of-statement-1): Fixed a bug
955 when macros occur in obscure places. Optimized the sexp movement
956 a bit.
957
9582005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
959
960 Enhancements for c-beginning-of-statement to work in AWK Mode:
961
962 * progmodes/cc-awk.el: Supersede c-awk-NL-prop value `;'
963 (completed statement) with `}' (statement completed by closing
964 brace or semicolon) and `$' (statement completed by EOL).
965
966 (c-awk-virtual-semicolon-ends-prev-line-p,
967 c-awk-virtual-semicolon-ends-line-p,
968 c-awk-skip-semantic-ws-forward, c-awk-skip-semantic-ws-backward,
969 c-awk-at-statement-end-p): new functions
970
971 * progmodes/cc-cmds.el: Simplify the structure of functions
972 c-forward-over-illiterals, c-back-over-illiterals. Enhance these
973 two functions and c-beginning-of-statement to handle AWK Mode.
974
975 * progmodes/cc-engine.el: Enhance c-forward-single-comment,
976 c-backward-single-comment for AWK mode. Attempt to clarify their
977 doc-strings.
978
979 * progmodes/cc-mode.el: Put M-a and M-e into awk-mode-map.
980
9812005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
982
983 * progmodes/cc-engine.el, cc-fonts.el, cc-langs.el: Cleaned up the
984 label handling. Labels are now recognized in a uniform and more
985 robust way, regardless of context. Text properties are put on all
986 labels to recognize the following declarations better. Multiword
987 labels are handled both in indentation and fontification for the
988 benefit of language extensions like Qt. For consistency, keywords
989 in labels are now fontified with the label face instead. That
990 also applies to "case" and "default".
991
992 (c-beginning-of-statement-1): Fixed some bugs in the label
993 handling. Disregard `c-nonlabel-token-key' in labels that begin
994 with `c-label-kwds'.
995
996 (c-find-decl-spots): Support that the callback adds more
997 `c-decl-end' spots to find.
998
999 (c-forward-decl-or-cast-1): Don't treat a list of plain
1000 identifiers followed by a colon as a declaration.
1001
1002 (c-forward-label): New function to recognize labels.
1003
1004 (c-guess-basic-syntax): Replaced uses of `c-label-key' with
1005 `c-forward-label'. Moved the label recognition cases (14 and 15)
1006 earlier since they aren't so context sensitive now. Handle labels
1007 on the top level gracefully. Moved access label recognition to
1008 the generic label case (CASE 15) - removed CASE 5E.
1009
1010 (c-font-lock-declarations): Added recognition of labels in the
1011 same round since we need to handle labels in parallell with other
1012 declarations to recognize both accurately. It should also improve
1013 speed.
1014
1015 (c-simple-decl-matchers, c-basic-matchers-after): Moved
1016 `c-font-lock-labels' so that it only is used on decoration level 2
1017 since `c-font-lock-declarations' handles it otherwise.
1018
1019 (c-complex-decl-matchers): Removed the simplistic recognition of
1020 access labels.
1021
1022 (c-decl-prefix-re): Removed the kludges that was necessary to cope
1023 with labels earlier.
1024
1025 (c-decl-start-re): New language variable to make
1026 `c-font-lock-declarations' stop for the special protection labels
1027 in Objective-C that start with '@'.
1028
1029 (c-label-key): Removed since it's no longer used.
1030
1031 (c-recognize-colon-labels, c-label-prefix-re): New language
1032 constants to support recognition of generic colon-terminated
1033 labels.
1034
1035 (c-type-decl-end-used): `c-decl-end' is now used whenever there
1036 are colon terminated labels.
1037
1038 * progmodes/cc-align.el (c-lineup-arglist): Fixed bug when the
1039 first argument starts with a special brace list.
1040
1041 * progmodes/cc-engine.el, cc-fonts.el (c-forward-decl-or-cast-1,
1042 c-font-lock-declarations): Broke out the declaration and cast
1043 recognition from `c-font-lock-declarations' to a new function, so
1044 that it can be used in the indentation engine.
1045
1046 * progmodes/cc-engine.el (c-find-decl-spots): Fixed bug in backing
1047 up to the start of the literal. Fixed bug with the point on the
1048 wrong side of the search limit that could happen when the start
1049 position is inside a literal.
1050
1051 * progmodes/cc-engine.el (c-parse-state,
1052 c-invalidate-state-cache): Modified the use of `c-state-cache-end'
1053 so that it's kept a little bit back to increase the hit rate.
1054
1055 (c-parse-state): Changed the macro handling and fixed some
1056 glitches. Macro context is checked more often than necessary now,
1057 but otoh less garbage conses are generated.
1058
1059 * progmodes/cc-engine.el (c-parse-state,
1060 c-invalidate-state-cache): Cache the last position where
1061 `c-state-cache' applies. This can speed up refontification quite
1062 a bit in blocks where there are many non-brace parens before the
1063 point.
1064
1065 (c-state-cache-end): New variable for this.
1066
1067 (c-guess-basic-syntax, c-debug-parse-state): Adapted for the new
1068 cache variable.
1069
1070 * progmodes/cc-engine.el (c-find-decl-spots): Take more care to
1071 get close initial continue positions when the start position is
1072 inside a literal or macro. Do not call the callback for spots
1073 before the start position (which can happen e.g. for `c-decl-end'
1074 spots inside comments). Optimize better in special cases when the
1075 region is a single line inside a literal or macro (typically when
1076 the current line is refontified).
1077
1078 * progmodes/cc-engine.el (c-guess-basic-syntax): Simplified calls
1079 to `c-add-stmt-syntax' - there's no need to explicitly whack off
1080 entries from the paren state.
1081
1082 * progmodes/cc-engine.el (c-add-stmt-syntax): Narrowed down the
1083 special case for "else if" clauses.
1084
1085 * progmodes/cc-engine.el (c-looking-at-inexpr-block,
1086 c-add-stmt-syntax): Use `c-recognize-paren-inexpr-blocks'.
1087
1088 * progmodes/cc-langs.el (c-recognize-paren-inexpr-blocks): New
1089 language variable to recognize the gcc extension with statement
1090 blocks inside expressions.
1091
1092 * progmodes/cc-engine.el (c-add-stmt-syntax): Restructured to make
1093 it somewhat more comprehensible. The argument AT-BLOCK-START is
1094 no longer used and hence removed.
1095
1096 (c-guess-continued-construct, c-guess-basic-syntax): Updated calls
1097 to `c-add-stmt-syntax'.
1098
1099 * progmodes/cc-engine.el (c-backward-to-decl-anchor): Use
1100 `c-beginning-of-statement-1' instead of duplicating parts of it.
1101 This fixes bogus label recognition.
1102
1103 * progmodes/cc-engine.el (c-add-type, c-check-type,
1104 c-forward-name, c-forward-type): Improved storage of template
1105 types in `c-found-types' so that they can be recognized better.
1106
1107 (c-syntactic-content): Added option to skip past nested parens.
1108
1109 * progmodes/cc-engine.el (c-forward-name): Set
1110 `c-last-identifier-range' all the time. It's less work that way.
1111 Handle that there might not be an identifier to store in
1112 `c-last-identifier-range'.
1113
1114 (c-forward-type): Handle that `c-last-identifier-range' might be
1115 nil from `c-forward-name'.
1116
1117 * progmodes/cc-defs.el: (c-safe-scan-lists,
1118 c-(go-)?(up|down)-list-(forward|backward)): Added limit arguments.
1119
1120 * progmodes/cc-defs.el (c-save-buffer-state): Use `unwind-protect'
1121 to work even if the form fails.
1122
1123 * progmodes/cc-engine.el (c-parse-state): Speedup when moving far
1124 down in a large file in one go.
1125
1126 (c-get-fallback-start-pos): New helper function for
1127 `c-parse-state'.
1128
1129 * progmodes/cc-align.el (c-lineup-assignments): New lineup
1130 function which is like `c-lineup-math' but returns nil instead of
1131 `c-basic-offset' when it doesn't match.
1132
1133 (c-lineup-math): Changed to use `c-lineup-assignments'.
1134
11352005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
1136
1137 * progmodes/cc-cmds.el: Fix some bugs in subfunctions of
1138 c-beginning-of-statement. New subfunctions
1139 c-in-comment-line-prefix-p, c-narrow-to-comment-innards.
1140
11412005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
1142
1143 * progmodes/cc-fonts.el, cc-langs.el: Use `c-simple-ws' instead of
1144 hardcoded char classes whereever possible. Changed a couple of
1145 places to use skip by syntax instead of skip by char class.
1146
1147 * progmodes/cc-langs.el (c-unterminated-block-comment-regexp):
1148 Fixed a bug in the regexp that caused extreme backtracking.
1149
1150 * progmodes/cc-langs.el (c-block-comment-starter,
1151 c-block-comment-ender): New language constants to specify in a
1152 single place how block comments look.
1153
1154 (c-comment-start-regexp, c-block-comment-start-regexp,
1155 comment-start, comment-end, comment-start-skip,
1156 c-syntactic-ws-start, c-syntactic-ws-end, c-nonwhite-syntactic-ws,
1157 c-syntactic-ws, c-nonempty-syntactic-ws,
1158 c-single-line-syntactic-ws, c-syntactic-eol): Now built from
1159 `c-line-comment-starter', `c-block-comment-starter' and
1160 `c-block-comment-ender'.
1161
1162 (c-block-comment-regexp, c-unterminated-block-comment-regexp): New
1163 language constants to break up things a bit.
1164
1165 (c-simple-ws): New language constant for simple whitespace.
1166
1167 * progmodes/cc-defs.el (c-concat-separated): New convenience
1168 function.
1169
1170 * progmodes/cc-defs.el (c-make-keywords-re): Added kludge for bug
1171 in `regexp-opt' in Emacs 20 and XEmacs when strings contain
1172 newlines. Allow and ignore nil elements in the list.
1173
11742005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
1175
1176 * progmodes/cc-cmds.el: Comment out a (n almost certainly
1177 superfluous) check, (eq here (point-max)) in
1178 c-beginning-of-statement.
1179
1180 * progmodes/cc-cmds.el: Tidy up the comments in
1181 c-beginning-of-statement and subfunctions.
1182
1183 * progmodes/cc-awk.el: Replace calls to put-text-property to the
1184 more flexible c-put-char-property and c-clear-char-properties.
1185 Add the author's email address.
1186
1187 * progmodes/cc-langs.el: New variable,
1188 c-block-comment-start-regexp.
1189
1190 * progmodes/cc-cmds.el: Fix bug with M-e, when point is inside the
1191 closing "*/" of a block comment.
1192
1193 * progmodes/cc-cmds.el: Tidy c-beginning-of-sentence (and
1194 subfunctions) so that it works at BOB and EOB.
1195
1196 * progmodes/cc-cmds.el, cc-vars.el: More updating of
1197 c-beginning-of-statement, including new variable
1198 c-block-comment-start-regexp.
1199
12002005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
1201
1202 * progmodes/cc-langs.el (c-known-type-key): Optimize simple
1203 symbols from `*-font-lock-extra-types' so that there's no need to
1204 use `regexp-opt' on those lists.
1205
1206 * progmodes/cc-langs.el (c-type-decl-suffix-key): Fix when
1207 `c-type-modifier-kwds' is empty.
1208
1209 * progmodes/cc-fonts.el (c-font-lock-invalid-string): Fix when
1210 there are several strings on the same line.
1211
1212 * progmodes/cc-engine.el (c-literal-limits): Removed the
1213 compatibility function for older emacsen. `c-literal-limits-fast'
1214 has now taken the place of this function.
1215
1216 * progmodes/cc-vars.el (c-emacs-features): Removed compatibility
1217 with older emacsen: We now require 'pps-extended-state.
1218
12192005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
1220
1221 * progmodes/cc-cmds.el: New function c-beginning-of-sentence,
1222 which obviates the need to hack sentence-end. This now handles
1223 escaped newlines in strings correctly. Correct minor bugs in
1224 c-move-over-sentence and in c-beginning-of-statement.
1225
1226 * progmodes/cc-cmds.el (c-beginning-of-statement (and
1227 subfunctions)): Adapt c-\(back\|forward\)-over-illiterals such
1228 that movement over macros and code are rigorously separated from
1229 eachother. Correct a few incidental bugs.
1230
1231 * progmodes/cc-cmds.el: Restructure c-beginning-of-statement:
1232 Improve its doc-string. Improve the handling of certain specific
1233 cases.
1234
12352005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
1236
1237 * progmodes/cc-engine.el, cc-fonts.el, cc-langs.el
1238 (c-guess-basic-syntax): Changed the way class-level labels are
1239 recognized; they can now contain essentially any symbols.
1240
1241 (c-opt-extra-label-key): New language variable to cope with the
1242 special protection label syntax in Objective-C.
1243
1244 (c-opt-access-key): Removed; this is now handled better by
1245 `c-nonlabel-token-key' and `c-opt-extra-label-key'.
1246
1247 (c-complex-decl-matchers): Update to handle that
1248 `c-opt-access-key' no longer exists.
1249
1250 * progmodes/cc-engine.el (c-guess-basic-syntax): Make use of the
1251 improved label recognition in `c-beginning-of-statement-1'.
1252
1253 * progmodes/cc-engine.el (c-beginning-of-member-init-list):
1254 Recognize bitfields better.
1255
1256 * progmodes/cc-engine.el (c-beginning-of-inheritance-list):
1257 Removed some cruft and fixed a bug that could cause it to go to a
1258 position further down.
1259
1260 * progmodes/cc-langs.el, cc-engine.el
1261 (c-beginning-of-statement-1): Improved detection of labels in
1262 declaration contexts.
1263
1264 (c-beginning-of-decl-1): Use it.
1265
1266 (c-nonlabel-token-key): New language constant and variable needed
1267 by `c-beginning-of-statement-1'.
1268
1269 * progmodes/cc-engine.el (c-guess-basic-syntax): Fixed bug that
1270 manifested itself due to the correction in `c-forward-sexp'.
1271
1272 * progmodes/cc-defs.el (c-forward-sexp, c-backward-sexp): Made
1273 these behave as documented when used at the buffer limits.
1274
1275 * progmodes/cc-mode.el, cc-engine.el, cc-langs.el
1276 (c-type-decl-end-used): Made this a language variable.
1277
1278 * progmodes/cc-mode.el (c-after-change): Widen the buffer to work
1279 correctly when `combine-after-change-calls' is used together with
1280 temporary narrowings.
1281
1282 * progmodes/cc-engine.el (c-beginning-of-statement-1): Report
1283 labels correctly when the start point is immediately after the
1284 colon.
1285
1286 * progmodes/cc-defs.el (c-parse-sexp-lookup-properties): Removed
1287 since it isn't used anymore.
1288
1289 * progmodes/cc-cmds.el (c-electric-lt-gt): Detect and mark angle
1290 bracket arglists such as template parens in C++.
1291
1292 * progmodes/cc-engine.el (c-syntactic-skip-backward): Fixed a bug
1293 in the last check-in. Some optimization.
1294
1295 * progmodes/cc-engine.el (c-syntactic-skip-backward): Fixed bug
1296 where it could stop at the same level in a preceding sexp when
1297 PAREN-LEVEL is set.
1298
1299 * progmodes/cc-mode.el (c-basic-common-init): Turn on syntax-table
1300 text property lookup only when it's needed.
1301
1302 * progmodes/cc-langs.el, cc-engine.el, cc-fonts.el, cc-mode.el:
1303 Changed the policy for paren marked angle brackets to be more
1304 persistent; once marked they remain marked even when they're found
1305 to be unbalanced in the searched region. This should keep the
1306 paren syntax around even when individual lines are refontified in
1307 multiline template arglists.
1308
1309 (c-parse-and-markup-<>-arglists): New dynamically bound variable
1310 to control markup so that incorrect angle bracket arglists aren't
1311 marked in contexts where the correct value for
1312 `c-disallow-comma-in-<>-arglists' isn't known.
1313
1314 (c-forward-<>-arglist, c-forward-<>-arglist-recur): The reparse
1315 argument has become `c-parse-and-markup-<>-arglists'.
1316
1317 (c-remove-<>-arglist-properties): Removed - no longer used.
1318
1319 (c-after-change-check-<>-operators): New function used on
1320 `after-change-functions' to avoid that "<" and ">" characters that
1321 are part of longer operators have paren syntax.
1322
1323 (c-<>-multichar-token-regexp): New language variable used by
1324 `c-after-change-check-<>-operators'.
1325
1326 (c-after-change): Call `c-after-change-check-<>-operators'.
1327
1328 (c-font-lock-<>-arglists): Use the context properties set by
1329 `c-font-lock-declarations' to set
1330 `c-disallow-comma-in-<>-arglists' correctly to avoid doing invalid
1331 markup.
1332
1333 (c-font-lock-declarations): Removed code that undoes the invalid
1334 markup done by `c-font-lock-<>-arglists'.
1335
1336 (c-complex-decl-matchers): `c-font-lock-<>-arglists' now runs
1337 after `c-font-lock-declarations'.
1338
1339 * progmodes/cc-engine.el (c-syntactic-skip-backward): Added
1340 paren-level feature.
1341
1342 (c-guess-basic-syntax): Improved the anchor position for
1343 `template-args-cont' in nested template arglists. There's still
1344 much to be desired in this area, though.
1345
13462005-12-08 Alan Mackenzie <bug-cc-mode@gnu.org>
1347
1348 * progmodes/cc-cmds.el, cc-engine.el, cc-langs.el, cc-vars.el:
1349 Make the "Text Filling and Line Breaking" commands work for AWK
1350 buffers.
1351
13522005-12-08 Martin Stjernholm <bug-cc-mode@gnu.org>
1353
1354 * progmodes/cc-defs.el, cc-engine.el (c-mode-is-new-awk-p):
1355 Removed;
1356 (c-major-mode-is 'awk-mode) can be used instead now.
1357
1358 * progmodes/cc-mode.el: Always set up AWK mode since emacsen where
1359 it doesn't work no longer are supported.
1360
1361 * progmodes/cc-mode.el, cc-styles.el, cc-vars.el, cc-defs.el,
1362 cc-engine.el, cc-fonts.el, cc-langs.el, cc-cmds.el: CC Mode now
1363 requires support for the syntax-table' text property, which rules
1364 out Emacs 19 and XEmacs < 21.4. Removed various compatibility
1365 cruft associated with those versions.
1366
1367 * progmodes/cc-defs.el, cc-fix.el: CC Mode now requires support
1368 for the `syntax-table' text property, which rules out Emacs 19 and
1369 XEmacs < 21.4. Removed various compatibility cruft associated
1370 with those versions.
1371
1372 * progmodes/cc-vars.el (c-emacs-features): CC Mode now requires
1373 support for the `syntax-table' text property.
1374
1375 * progmodes/cc-fonts.el (c-nonbreakable-space-face): Remove the
1376 variable and use an extra quoted face name instead. All the
1377 emacsen flavors handle that correctly.
1378
1379 * progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare,
1380 c-font-lock-declarators, c-font-lock-declarations,
1381 c-complex-decl-matchers, c-basic-matchers-after): Use a text
1382 property to mark the items in in declarator lists to handle
1383 refontification inside multiline declarations better.
1384
1385 * progmodes/cc-fonts.el (c-font-lock-declarations): Recognize a
1386 construct like "a * b = c;" as a declaration.
1387
13882005-12-08 Kim F. Storm <storm@cua.dk>
1389
1390 * emulation/cua-base.el (cua-use-hyper-key): Replaced by ...
1391 (cua-rectangle-modifier-key): ... this. New defcustom. Can now
1392 select either meta, hyper, or super modifier for rectangle commands.
1393 (cua--rectangle-modifier-key): New defvar.
1394 (cua--M/H-key): Use it. Remove special case for 'space.
1395 (cua--init-keymaps): Initialize it from cua-rectangle-modifier-key
1396 on X, to meta otherwise. Always bind C-return to toggle
1397 rectangle. Pass ?\s instead of 'space to cua--M/H-key.
1398
1399 * emulation/cua-rect.el (cua-help-for-rectangle): Use
1400 cua--rectangle-modifier-key. Handle super modifier too.
1401 (cua--init-rectangles): Always bind C-return to toggle rectangle.
1402 Pass ?\s instead of 'space to cua--M/H-key and cua--rect-M/H-key.
1403
1404 * ido.el: Move Acknowledgements and History after Commentary.
1405 Minor changes to Commentary.
1406
1407 * emulation/cua-base.el (cua--select-keymaps): Enable repeat
1408 keymap if cua--prefix-override-timer equals 'shift.
1409 (cua--shift-control-prefix): New function; emulate "type prefix
1410 key twice" functionality to handle shifted prefix key override.
1411 (cua--shift-control-c-prefix, cua--shift-control-x-prefix): New
1412 commands.
1413 (cua--init-keymaps): Bind them to S-C-c and S-C-x.
1414
14152005-12-08 Carsten Dominik <dominik@science.uva.nl>
1416
1417 * textmodes/org.el (org-insert-heading): Try to do items before
1418 headings.
1419 (org-agenda-mode): Quote `org-agenda-mode-hook'.
1420 (org-insert-item): New function.
1421 (org-renumber-ordered-list): Don't skip to higher level lists.
1422
14232005-12-08 Juri Linkov <juri@jurta.org>
1424
1425 * info.el (Info-mode-map): Bind M-TAB to `Info-prev-reference'.
1426
1427 * button.el (button-buffer-map): Bind M-TAB to `backward-button'.
1428
1429 * wid-edit.el (widget-keymap): Bind M-TAB to `widget-backward'.
1430
1431 * pcvs.el (defun-cvs-mode): Put `definition-name' property on
1432 the constructed function name fun-1.
1433
1434 * cus-edit.el (custom-add-parent-links): Filter out custom-group-link,
1435 because such links don't lead to parent documentation.
1436
12005-12-08 Kenichi Handa <handa@m17n.org> 14372005-12-08 Kenichi Handa <handa@m17n.org>
2 1438
3 * descr-text.el (describe-char): Use *Help-2* buffer if the 1439 * descr-text.el (describe-char): Use *Help-2* buffer if the
@@ -62,7 +1498,7 @@
62 (gdb-locals-watch-map): Rename from gdb-*-*-keymap. 1498 (gdb-locals-watch-map): Rename from gdb-*-*-keymap.
63 (gdb-locals-font-lock-keywords-1) 1499 (gdb-locals-font-lock-keywords-1)
64 (gdb-locals-font-lock-keywords-2): New variables. 1500 (gdb-locals-font-lock-keywords-2): New variables.
65 (gdb-find-file-hook): fgfg. 1501 (gdb-find-file-hook): Make it work with GDB 6.4+ too.
66 (gdb-set-gud-minor-mode-existing-buffers-1) 1502 (gdb-set-gud-minor-mode-existing-buffers-1)
67 (gdb-var-list-children-1, gdb-var-list-children-handler-1) 1503 (gdb-var-list-children-1, gdb-var-list-children-handler-1)
68 (gdb-var-update-1, gdb-var-update-handler-1) 1504 (gdb-var-update-1, gdb-var-update-handler-1)
@@ -94,7 +1530,7 @@
94 1530
952005-12-06 Carsten Dominik <dominik@science.uva.nl> 15312005-12-06 Carsten Dominik <dominik@science.uva.nl>
96 1532
97 * textmodes/org.el: (org-occur-highlights): New variable. 1533 * textmodes/org.el (org-occur-highlights): New variable.
98 (org-highlight-new-match, org-remove-occur-highlights): New functions. 1534 (org-highlight-new-match, org-remove-occur-highlights): New functions.
99 (org-highlight-sparse-tree-matches): New option. 1535 (org-highlight-sparse-tree-matches): New option.
100 (org-do-occur): New function. 1536 (org-do-occur): New function.
@@ -187,7 +1623,8 @@
187 1623
188 * font-core.el (global-font-lock-mode): Use define-global-minor-mode 1624 * font-core.el (global-font-lock-mode): Use define-global-minor-mode
189 instead of easy-mmode-define-global-mode. Add `:group font-lock'. 1625 instead of easy-mmode-define-global-mode. Add `:group font-lock'.
190 (font-lock-mode): Replace `:group font-lock' with `nil nil nil'. 1626 (font-lock-mode): Replace `:group font-lock' with `nil nil nil'
1627 because there is no customization option for it.
191 1628
192 * font-lock.el (lisp-font-lock-keywords-1): 1629 * font-lock.el (lisp-font-lock-keywords-1):
193 Add define-global-minor-mode. 1630 Add define-global-minor-mode.
@@ -223,8 +1660,8 @@
223 property on their symbols (they have only `custom-loads'). 1660 property on their symbols (they have only `custom-loads').
224 1661
225 * simple.el (completion-setup-function): Put completions-common-part 1662 * simple.el (completion-setup-function): Put completions-common-part
226 face on full completion string too (i.e. completion string without 1663 face on complete completion string too (i.e. completion string
227 completions-first-difference face). 1664 without completions-first-difference face).
228 1665
229 * man.el (Man-section-regexp): Add 0-9 to support "3X11" sections. 1666 * man.el (Man-section-regexp): Add 0-9 to support "3X11" sections.
230 1667
@@ -698,7 +2135,7 @@
698 2135
6992005-11-24 Carsten Dominik <dominik@science.uva.nl> 21362005-11-24 Carsten Dominik <dominik@science.uva.nl>
700 2137
701 * textmodes/org.el: (org-export-plain-list-max-depth): Renamed from 2138 * textmodes/org.el (org-export-plain-list-max-depth): Renamed from
702 `org-export-local-list-max-depth'. Change default value to 3. 2139 `org-export-local-list-max-depth'. Change default value to 3.
703 (org-auto-renumber-ordered-lists) 2140 (org-auto-renumber-ordered-lists)
704 (org-plain-list-ordered-item-terminator): New options. 2141 (org-plain-list-ordered-item-terminator): New options.
@@ -912,7 +2349,7 @@
912 2349
9132005-11-18 Carsten Dominik <dominik@science.uva.nl> 23502005-11-18 Carsten Dominik <dominik@science.uva.nl>
914 2351
915 * textmodes/org.el: (org-table-sort-lines): New command. 2352 * textmodes/org.el (org-table-sort-lines): New command.
916 (org-tbl-menu): Add entry for `org-table-sort-lines'. 2353 (org-tbl-menu): Add entry for `org-table-sort-lines'.
917 (org-add-file): Command removed, use `org-agenda-file-to-front' 2354 (org-add-file): Command removed, use `org-agenda-file-to-front'
918 instead. 2355 instead.
@@ -2812,7 +4249,7 @@
2812 4249
28132005-10-21 Carsten Dominik <dominik@science.uva.nl> 42502005-10-21 Carsten Dominik <dominik@science.uva.nl>
2814 4251
2815 * textmodes/org.el: (org-combined-agenda-icalendar-file) 4252 * textmodes/org.el (org-combined-agenda-icalendar-file)
2816 (org-icalendar-include-todo, org-icalendar-combined-name): New options. 4253 (org-icalendar-include-todo, org-icalendar-combined-name): New options.
2817 (org-export-icalendar-this-file) 4254 (org-export-icalendar-this-file)
2818 (org-export-icalendar-all-agenda-files) 4255 (org-export-icalendar-all-agenda-files)
@@ -3494,7 +4931,7 @@
3494 4931
34952005-10-10 Carsten Dominik <dominik@science.uva.nl> 49322005-10-10 Carsten Dominik <dominik@science.uva.nl>
3496 4933
3497 * textmodes/org.el: (org-mode-map): Explicit definition of `C-c 4934 * textmodes/org.el (org-mode-map): Explicit definition of `C-c
3498 C-x' as a prefix. 4935 C-x' as a prefix.
3499 (orgtbl-mode-map): Full keymap instead of sparse, because all 4936 (orgtbl-mode-map): Full keymap instead of sparse, because all
3500 `self-insert-command' keys are redefined in this map. 4937 `self-insert-command' keys are redefined in this map.
@@ -15377,7 +16814,7 @@
15377 16814
15378 * cus-edit.el (custom-bury-buffer): Function deleted. 16815 * cus-edit.el (custom-bury-buffer): Function deleted.
15379 (custom-buffer-done-function): Option deleted. 16816 (custom-buffer-done-function): Option deleted.
15380 (custom-buffer-done-kill): New (replacement option. 16817 (custom-buffer-done-kill): New replacement option.
15381 (Custom-buffer-done): Call quit-window. 16818 (Custom-buffer-done): Call quit-window.
15382 (custom-buffer-create-internal): Update for above changes. 16819 (custom-buffer-create-internal): Update for above changes.
15383 16820
diff --git a/lisp/align.el b/lisp/align.el
index 2cbc43e38d3..122ce2f0f88 100644
--- a/lisp/align.el
+++ b/lisp/align.el
@@ -931,8 +931,7 @@ using a REGEXP like \"(\". All you would have to do is to mark the
931region, call `align-regexp' and type in that regular expression." 931region, call `align-regexp' and type in that regular expression."
932 (interactive 932 (interactive
933 (append 933 (append
934 (list (min (point) (mark)) 934 (list (region-beginning) (region-end))
935 (max (point) (mark)))
936 (if current-prefix-arg 935 (if current-prefix-arg
937 (list (read-string "Complex align using regexp: " 936 (list (read-string "Complex align using regexp: "
938 "\\(\\s-*\\)") 937 "\\(\\s-*\\)")
@@ -988,8 +987,7 @@ list of rules (see `align-rules-list'), it can be used to override the
988default alignment rules that would have been used to identify the text 987default alignment rules that would have been used to identify the text
989to be colored." 988to be colored."
990 (interactive 989 (interactive
991 (list (min (mark) (point)) 990 (list (region-beginning) (region-end)
992 (max (mark) (point))
993 (completing-read 991 (completing-read
994 "Title of rule to highlight: " 992 "Title of rule to highlight: "
995 (mapcar 993 (mapcar
diff --git a/lisp/button.el b/lisp/button.el
index d58e53c2895..375182dd36b 100644
--- a/lisp/button.el
+++ b/lisp/button.el
@@ -69,6 +69,7 @@
69(defvar button-buffer-map 69(defvar button-buffer-map
70 (let ((map (make-sparse-keymap))) 70 (let ((map (make-sparse-keymap)))
71 (define-key map [?\t] 'forward-button) 71 (define-key map [?\t] 'forward-button)
72 (define-key map "\e\t" 'backward-button)
72 (define-key map [backtab] 'backward-button) 73 (define-key map [backtab] 'backward-button)
73 map) 74 map)
74 "Keymap useful for buffers containing buttons. 75 "Keymap useful for buffers containing buttons.
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index 590fcc9b871..40c6bfc2c86 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -1,6 +1,7 @@
1;;; appt.el --- appointment notification functions 1;;; appt.el --- appointment notification functions
2 2
3;; Copyright (C) 1989, 1990, 1994, 1998, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 1989, 1990, 1994, 1998, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Neil Mager <neilm@juliet.ll.mit.edu> 6;; Author: Neil Mager <neilm@juliet.ll.mit.edu>
6;; Maintainer: Glenn Morris <rgm@gnu.org> 7;; Maintainer: Glenn Morris <rgm@gnu.org>
@@ -235,6 +236,8 @@ The variable `appt-audible' controls the audible reminder."
235 (cond ((eq appt-display-format 'window) 236 (cond ((eq appt-display-format 'window)
236 (funcall appt-disp-window-function 237 (funcall appt-disp-window-function
237 (number-to-string mins) 238 (number-to-string mins)
239 ;; TODO - use calendar-month-abbrev-array rather
240 ;; than %b?
238 (format-time-string "%a %b %e " (current-time)) 241 (format-time-string "%a %b %e " (current-time))
239 string) 242 string)
240 (run-at-time (format "%d sec" appt-display-duration) 243 (run-at-time (format "%d sec" appt-display-duration)
diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el
index dd06ca6b9ef..91d4d3636df 100644
--- a/lisp/calendar/cal-bahai.el
+++ b/lisp/calendar/cal-bahai.el
@@ -1,6 +1,6 @@
1;;; cal-bahai.el --- calendar functions for the Baha'i calendar. 1;;; cal-bahai.el --- calendar functions for the Baha'i calendar.
2 2
3;; Copyright (C) 2001 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6;; Keywords: calendar 6;; Keywords: calendar
diff --git a/lisp/calendar/cal-china.el b/lisp/calendar/cal-china.el
index 24d9c4f161b..a4b83b87b15 100644
--- a/lisp/calendar/cal-china.el
+++ b/lisp/calendar/cal-china.el
@@ -1,8 +1,10 @@
1;;; cal-china.el --- calendar functions for the Chinese calendar 1;;; cal-china.el --- calendar functions for the Chinese calendar
2 2
3;; Copyright (C) 1995, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: Chinese calendar, calendar, holidays, diary 9;; Human-Keywords: Chinese calendar, calendar, holidays, diary
8 10
diff --git a/lisp/calendar/cal-coptic.el b/lisp/calendar/cal-coptic.el
index 14b3c65796f..4673053246f 100644
--- a/lisp/calendar/cal-coptic.el
+++ b/lisp/calendar/cal-coptic.el
@@ -1,8 +1,10 @@
1;;; cal-coptic.el --- calendar functions for the Coptic/Ethiopic calendars 1;;; cal-coptic.el --- calendar functions for the Coptic/Ethiopic calendars
2 2
3;; Copyright (C) 1995, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: Coptic calendar, Ethiopic calendar, calendar, diary 9;; Human-Keywords: Coptic calendar, Ethiopic calendar, calendar, diary
8 10
diff --git a/lisp/calendar/cal-dst.el b/lisp/calendar/cal-dst.el
index 141ca2d8183..1f3859d8bf1 100644
--- a/lisp/calendar/cal-dst.el
+++ b/lisp/calendar/cal-dst.el
@@ -1,9 +1,11 @@
1;;; cal-dst.el --- calendar functions for daylight savings rules 1;;; cal-dst.el --- calendar functions for daylight savings rules
2 2
3;; Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. 3;; Copyright (C) 1993, 1994, 1995, 1996, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Paul Eggert <eggert@twinsun.com> 6;; Author: Paul Eggert <eggert@twinsun.com>
6;; Edward M. Reingold <reingold@cs.uiuc.edu> 7;; Edward M. Reingold <reingold@cs.uiuc.edu>
8;; Maintainer: Glenn Morris <rgm@gnu.org>
7;; Keywords: calendar 9;; Keywords: calendar
8;; Human-Keywords: daylight savings time, calendar, diary, holidays 10;; Human-Keywords: daylight savings time, calendar, diary, holidays
9 11
diff --git a/lisp/calendar/cal-french.el b/lisp/calendar/cal-french.el
index 7bab001a0bb..ed974d312bb 100644
--- a/lisp/calendar/cal-french.el
+++ b/lisp/calendar/cal-french.el
@@ -1,8 +1,10 @@
1;;; cal-french.el --- calendar functions for the French Revolutionary calendar 1;;; cal-french.el --- calendar functions for the French Revolutionary calendar
2 2
3;; Copyright (C) 1988, 89, 92, 94, 95, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1988, 1989, 1992, 1994, 1995, 1997, 2001, 2002, 2003,
4;; 2004, 2005 Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: French Revolutionary calendar, calendar, diary 9;; Human-Keywords: French Revolutionary calendar, calendar, diary
8 10
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index 9805a00cc7a..99823db8215 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -1,9 +1,11 @@
1;;; cal-hebrew.el --- calendar functions for the Hebrew calendar 1;;; cal-hebrew.el --- calendar functions for the Hebrew calendar
2 2
3;; Copyright (C) 1995, 1997, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Nachum Dershowitz <nachum@cs.uiuc.edu> 6;; Author: Nachum Dershowitz <nachum@cs.uiuc.edu>
6;; Edward M. Reingold <reingold@cs.uiuc.edu> 7;; Edward M. Reingold <reingold@cs.uiuc.edu>
8;; Maintainer: Glenn Morris <rgm@gnu.org>
7;; Keywords: calendar 9;; Keywords: calendar
8;; Human-Keywords: Hebrew calendar, calendar, diary 10;; Human-Keywords: Hebrew calendar, calendar, diary
9 11
diff --git a/lisp/calendar/cal-islam.el b/lisp/calendar/cal-islam.el
index 9cdcba6a370..52801600157 100644
--- a/lisp/calendar/cal-islam.el
+++ b/lisp/calendar/cal-islam.el
@@ -1,8 +1,10 @@
1;;; cal-islam.el --- calendar functions for the Islamic calendar 1;;; cal-islam.el --- calendar functions for the Islamic calendar
2 2
3;; Copyright (C) 1995, 1997, 2001, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: Islamic calendar, calendar, diary 9;; Human-Keywords: Islamic calendar, calendar, diary
8 10
diff --git a/lisp/calendar/cal-iso.el b/lisp/calendar/cal-iso.el
index bee3e1ec482..41a3713d3ea 100644
--- a/lisp/calendar/cal-iso.el
+++ b/lisp/calendar/cal-iso.el
@@ -1,6 +1,7 @@
1;;; cal-iso.el --- calendar functions for the ISO calendar 1;;; cal-iso.el --- calendar functions for the ISO calendar
2 2
3;; Copyright (C) 1995, 1997, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
6;; Maintainer: Glenn Morris <rgm@gnu.org> 7;; Maintainer: Glenn Morris <rgm@gnu.org>
diff --git a/lisp/calendar/cal-julian.el b/lisp/calendar/cal-julian.el
index 48fe8725b06..068e705410a 100644
--- a/lisp/calendar/cal-julian.el
+++ b/lisp/calendar/cal-julian.el
@@ -1,8 +1,10 @@
1;;; cal-julian.el --- calendar functions for the Julian calendar 1;;; cal-julian.el --- calendar functions for the Julian calendar
2 2
3;; Copyright (C) 1995, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: Julian calendar, Julian day number, calendar, diary 9;; Human-Keywords: Julian calendar, Julian day number, calendar, diary
8 10
diff --git a/lisp/calendar/cal-mayan.el b/lisp/calendar/cal-mayan.el
index da411c14984..ce4f42e3328 100644
--- a/lisp/calendar/cal-mayan.el
+++ b/lisp/calendar/cal-mayan.el
@@ -1,9 +1,11 @@
1;;; cal-mayan.el --- calendar functions for the Mayan calendars 1;;; cal-mayan.el --- calendar functions for the Mayan calendars
2 2
3;; Copyright (C) 1992, 1993, 1995, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1992, 1993, 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Stewart M. Clamen <clamen@cs.cmu.edu> 6;; Author: Stewart M. Clamen <clamen@cs.cmu.edu>
6;; Edward M. Reingold <reingold@cs.uiuc.edu> 7;; Edward M. Reingold <reingold@cs.uiuc.edu>
8;; Maintainer: Glenn Morris <rgm@gnu.org>
7;; Keywords: calendar 9;; Keywords: calendar
8;; Human-Keywords: Mayan calendar, Maya, calendar, diary 10;; Human-Keywords: Mayan calendar, Maya, calendar, diary
9 11
diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el
index 81ec46751df..0f8e7295d32 100644
--- a/lisp/calendar/cal-menu.el
+++ b/lisp/calendar/cal-menu.el
@@ -1,6 +1,7 @@
1;;; cal-menu.el --- calendar functions for menu bar and popup menu support 1;;; cal-menu.el --- calendar functions for menu bar and popup menu support
2 2
3;; Copyright (C) 1994, 1995, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
6;; Lara Rios <lrios@coewl.cen.uiuc.edu> 7;; Lara Rios <lrios@coewl.cen.uiuc.edu>
diff --git a/lisp/calendar/cal-move.el b/lisp/calendar/cal-move.el
index 3091822d7ff..70275017bfd 100644
--- a/lisp/calendar/cal-move.el
+++ b/lisp/calendar/cal-move.el
@@ -1,6 +1,7 @@
1;;; cal-move.el --- calendar functions for movement in the calendar 1;;; cal-move.el --- calendar functions for movement in the calendar
2 2
3;; Copyright (C) 1995, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
6;; Maintainer: Glenn Morris <rgm@gnu.org> 7;; Maintainer: Glenn Morris <rgm@gnu.org>
diff --git a/lisp/calendar/cal-persia.el b/lisp/calendar/cal-persia.el
index b92f8c29b8c..e9583a3f00d 100644
--- a/lisp/calendar/cal-persia.el
+++ b/lisp/calendar/cal-persia.el
@@ -1,8 +1,10 @@
1;;; cal-persia.el --- calendar functions for the Persian calendar 1;;; cal-persia.el --- calendar functions for the Persian calendar
2 2
3;; Copyright (C) 1996, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1996, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: Persian calendar, calendar, diary 9;; Human-Keywords: Persian calendar, calendar, diary
8 10
diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el
index f3ec25cee9e..7b029bc93c5 100644
--- a/lisp/calendar/cal-tex.el
+++ b/lisp/calendar/cal-tex.el
@@ -1,9 +1,11 @@
1;;; cal-tex.el --- calendar functions for printing calendars with LaTeX 1;;; cal-tex.el --- calendar functions for printing calendars with LaTeX
2 2
3;; Copyright (C) 1995 Free Software Foundation, Inc. 3;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Steve Fisk <fisk@bowdoin.edu> 6;; Author: Steve Fisk <fisk@bowdoin.edu>
6;; Edward M. Reingold <reingold@cs.uiuc.edu> 7;; Edward M. Reingold <reingold@cs.uiuc.edu>
8;; Maintainer: Glenn Morris <rgm@gnu.org>
7;; Keywords: calendar 9;; Keywords: calendar
8;; Human-Keywords: Calendar, LaTeX 10;; Human-Keywords: Calendar, LaTeX
9 11
diff --git a/lisp/calendar/cal-x.el b/lisp/calendar/cal-x.el
index 903f91af57b..a512c7c1e20 100644
--- a/lisp/calendar/cal-x.el
+++ b/lisp/calendar/cal-x.el
@@ -1,6 +1,7 @@
1;;; cal-x.el --- calendar windows in dedicated frames in X 1;;; cal-x.el --- calendar windows in dedicated frames in X
2 2
3;; Copyright (C) 1994, 1995, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 1994, 1995, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Michael Kifer <kifer@cs.sunysb.edu> 6;; Author: Michael Kifer <kifer@cs.sunysb.edu>
6;; Edward M. Reingold <reingold@cs.uiuc.edu> 7;; Edward M. Reingold <reingold@cs.uiuc.edu>
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index bb36ae4bb6e..1ef8d048c88 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1,7 +1,7 @@
1;;; calendar.el --- calendar functions 1;;; calendar.el --- calendar functions
2 2
3;; Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1997, 3;; Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1997,
4;; 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. 4;; 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org> 7;; Maintainer: Glenn Morris <rgm@gnu.org>
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 18d984d9ae9..91c396f7bf5 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -1,7 +1,7 @@
1;;; diary-lib.el --- diary functions 1;;; diary-lib.el --- diary functions
2 2
3;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2003, 2004, 2005 3;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1995, 2001, 2002, 2003,
4;; Free Software Foundation, Inc. 4;; 2004, 2005 Free Software Foundation, Inc.
5 5
6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org> 7;; Maintainer: Glenn Morris <rgm@gnu.org>
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el
index aef07e39c8d..b18844c18d9 100644
--- a/lisp/calendar/holidays.el
+++ b/lisp/calendar/holidays.el
@@ -1,7 +1,7 @@
1;;; holidays.el --- holiday functions for the calendar package 1;;; holidays.el --- holiday functions for the calendar package
2 2
3;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1997, 2004 Free 3;; Copyright (C) 1989, 1990, 1992, 1993, 1994, 1997, 2001, 2002, 2003,
4;; Software Foundation, Inc. 4;; 2004, 2005 Free Software Foundation, Inc.
5 5
6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org> 7;; Maintainer: Glenn Morris <rgm@gnu.org>
diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el
index d4d5cf23157..ed54bc88394 100644
--- a/lisp/calendar/lunar.el
+++ b/lisp/calendar/lunar.el
@@ -1,8 +1,10 @@
1;;; lunar.el --- calendar functions for phases of the moon 1;;; lunar.el --- calendar functions for phases of the moon
2 2
3;; Copyright (C) 1992, 1993, 1995, 1997 Free Software Foundation, Inc. 3;; Copyright (C) 1992, 1993, 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
7;; Maintainer: Glenn Morris <rgm@gnu.org>
6;; Keywords: calendar 8;; Keywords: calendar
7;; Human-Keywords: moon, lunar phases, calendar, diary 9;; Human-Keywords: moon, lunar phases, calendar, diary
8 10
diff --git a/lisp/calendar/parse-time.el b/lisp/calendar/parse-time.el
index 1b4ac116fe1..3e09e7b1fb6 100644
--- a/lisp/calendar/parse-time.el
+++ b/lisp/calendar/parse-time.el
@@ -1,6 +1,7 @@
1;;; parse-time.el --- parsing time strings 1;;; parse-time.el --- parsing time strings
2 2
3;; Copyright (C) 1996, 2000 by Free Software Foundation, Inc. 3;; Copyright (C) 1996, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Erik Naggum <erik@naggum.no> 6;; Author: Erik Naggum <erik@naggum.no>
6;; Keywords: util 7;; Keywords: util
diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el
index 52d12e0a18a..5b58b739dba 100644
--- a/lisp/calendar/solar.el
+++ b/lisp/calendar/solar.el
@@ -1,6 +1,7 @@
1;;; solar.el --- calendar functions for solar events 1;;; solar.el --- calendar functions for solar events
2 2
3;; Copyright (C) 1992, 1993, 1995, 1997, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1992, 1993, 1995, 1997, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Edward M. Reingold <reingold@cs.uiuc.edu> 6;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
6;; Denis B. Roegel <Denis.Roegel@loria.fr> 7;; Denis B. Roegel <Denis.Roegel@loria.fr>
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index b1646a5665c..fd74e5a6251 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -1,6 +1,7 @@
1;;; time-date.el --- Date and time handling functions 1;;; time-date.el --- Date and time handling functions
2;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 2
3;; Free Software Foundation, Inc. 3;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> 6;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6;; Masanobu Umeda <umerin@mse.kyutech.ac.jp> 7;; Masanobu Umeda <umerin@mse.kyutech.ac.jp>
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el
index f2ee3f3a048..f46ec4eba23 100644
--- a/lisp/calendar/timeclock.el
+++ b/lisp/calendar/timeclock.el
@@ -1,6 +1,7 @@
1;;; timeclock.el --- mode for keeping track of how much you work 1;;; timeclock.el --- mode for keeping track of how much you work
2 2
3;; Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: John Wiegley <johnw@gnu.org> 6;; Author: John Wiegley <johnw@gnu.org>
6;; Created: 25 Mar 1999 7;; Created: 25 Mar 1999
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index c49733e2158..b6871a38ab9 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -1,6 +1,7 @@
1;;; todo-mode.el --- major mode for editing TODO list files 1;;; todo-mode.el --- major mode for editing TODO list files
2 2
3;; Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1997, 1999, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Oliver Seidel <os10000@seidel-space.de> 6;; Author: Oliver Seidel <os10000@seidel-space.de>
6;; [Not clear the above works, July 2000] 7;; [Not clear the above works, July 2000]
diff --git a/lisp/compare-w.el b/lisp/compare-w.el
index 3fda5f5de76..e3e7bd3945d 100644
--- a/lisp/compare-w.el
+++ b/lisp/compare-w.el
@@ -343,13 +343,13 @@ on third call it again advances points to the next difference and so on."
343 (move-overlay compare-windows-overlay1 beg1 end1 b1) 343 (move-overlay compare-windows-overlay1 beg1 end1 b1)
344 (setq compare-windows-overlay1 (make-overlay beg1 end1 b1)) 344 (setq compare-windows-overlay1 (make-overlay beg1 end1 b1))
345 (overlay-put compare-windows-overlay1 'face 'compare-windows) 345 (overlay-put compare-windows-overlay1 'face 'compare-windows)
346 (overlay-put compare-windows-overlay1 'priority 1)) 346 (overlay-put compare-windows-overlay1 'priority 1000))
347 (overlay-put compare-windows-overlay1 'window w1) 347 (overlay-put compare-windows-overlay1 'window w1)
348 (if compare-windows-overlay2 348 (if compare-windows-overlay2
349 (move-overlay compare-windows-overlay2 beg2 end2 b2) 349 (move-overlay compare-windows-overlay2 beg2 end2 b2)
350 (setq compare-windows-overlay2 (make-overlay beg2 end2 b2)) 350 (setq compare-windows-overlay2 (make-overlay beg2 end2 b2))
351 (overlay-put compare-windows-overlay2 'face 'compare-windows) 351 (overlay-put compare-windows-overlay2 'face 'compare-windows)
352 (overlay-put compare-windows-overlay2 'priority 1)) 352 (overlay-put compare-windows-overlay2 'priority 1000))
353 (overlay-put compare-windows-overlay2 'window w2) 353 (overlay-put compare-windows-overlay2 'window w2)
354 ;; Remove highlighting before next command is executed 354 ;; Remove highlighting before next command is executed
355 (add-hook 'pre-command-hook 'compare-windows-dehighlight))) 355 (add-hook 'pre-command-hook 'compare-windows-dehighlight)))
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index d4ea953bc09..eed12113568 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1466,7 +1466,7 @@ This updates your Emacs initialization file or creates a new one."
1466 (custom-reset event)))) 1466 (custom-reset event))))
1467 (widget-insert "\n ") 1467 (widget-insert "\n ")
1468 (widget-create 'push-button 1468 (widget-create 'push-button
1469 :tag "Reset" 1469 :tag "Reset to Current"
1470 :help-echo "\ 1470 :help-echo "\
1471Reset all edited text in this buffer to reflect current values." 1471Reset all edited text in this buffer to reflect current values."
1472 :action 'Custom-reset-current) 1472 :action 'Custom-reset-current)
@@ -2155,7 +2155,11 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
2155 (setq parents (cons symbol parents))))) 2155 (setq parents (cons symbol parents)))))
2156 (and (null (get name 'custom-links)) ;No links of its own. 2156 (and (null (get name 'custom-links)) ;No links of its own.
2157 (= (length parents) 1) ;A single parent. 2157 (= (length parents) 1) ;A single parent.
2158 (let* ((links (get (car parents) 'custom-links)) 2158 (let* ((links (delq nil (mapcar (lambda (w)
2159 (unless (eq (widget-type w)
2160 'custom-group-link)
2161 w))
2162 (get (car parents) 'custom-links))))
2159 (many (> (length links) 2))) 2163 (many (> (length links) 2)))
2160 (when links 2164 (when links
2161 (insert "\nParent documentation: ") 2165 (insert "\nParent documentation: ")
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 4b799ebfedf..7aeb33a648e 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -569,10 +569,11 @@ considered."
569 ((null completion) 569 ((null completion)
570 (message "Can't find completion for \"%s\"" pattern) 570 (message "Can't find completion for \"%s\"" pattern)
571 (ding)) 571 (ding))
572 ((not (string= pattern completion))
573 (delete-region beg end)
574 (insert completion))
575 (t 572 (t
573 (unless (string= completion pattern)
574 (delete-region beg end)
575 (insert completion)
576 (setq pattern completion))
576 (message "Making completion list...") 577 (message "Making completion list...")
577 (let ((list (all-completions pattern obarray predicate))) 578 (let ((list (all-completions pattern obarray predicate)))
578 (setq list (sort list 'string<)) 579 (setq list (sort list 'string<))
@@ -585,8 +586,10 @@ considered."
585 new)) 586 new))
586 (setq list (cdr list))) 587 (setq list (cdr list)))
587 (setq list (nreverse new)))) 588 (setq list (nreverse new))))
588 (with-output-to-temp-buffer "*Completions*" 589 (if (> (length list) 1)
589 (display-completion-list list pattern))) 590 (with-output-to-temp-buffer "*Completions*"
591 (display-completion-list list pattern))
592 (delete-windows-on "*Completions*")))
590 (message "Making completion list...%s" "done"))))))) 593 (message "Making completion list...%s" "done")))))))
591 594
592;;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e 595;;; arch-tag: aa7fa8a4-2e6f-4e9b-9cd9-fef06340e67e
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index bcfdeef4501..26d94e99e88 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -329,15 +329,6 @@ interpreted as a register number."
329 :type 'boolean 329 :type 'boolean
330 :group 'cua) 330 :group 'cua)
331 331
332(defcustom cua-use-hyper-key nil
333 "*If non-nil, bind rectangle commands to H-... instead of M-....
334If set to `also', toggle region command is also on C-return.
335Must be set prior to enabling CUA."
336 :type '(choice (const :tag "Meta key and C-return" nil)
337 (const :tag "Hyper key only" only)
338 (const :tag "Hyper key and C-return" also))
339 :group 'cua)
340
341(defcustom cua-enable-region-auto-help nil 332(defcustom cua-enable-region-auto-help nil
342 "*If non-nil, automatically show help for active region." 333 "*If non-nil, automatically show help for active region."
343 :type 'boolean 334 :type 'boolean
@@ -379,6 +370,15 @@ and after the region marked by the rectangle to search."
379 (other :tag "Enabled" t)) 370 (other :tag "Enabled" t))
380 :group 'cua) 371 :group 'cua)
381 372
373(defcustom cua-rectangle-modifier-key 'meta
374 "*Modifier key used for rectangle commands bindings.
375On non-window systems, always use the meta modifier.
376Must be set prior to enabling CUA."
377 :type '(choice (const :tag "Meta key" meta)
378 (const :tag "Hyper key" hyper )
379 (const :tag "Super key" super))
380 :group 'cua)
381
382(defcustom cua-enable-rectangle-auto-help t 382(defcustom cua-enable-rectangle-auto-help t
383 "*If non-nil, automatically show help for region, rectangle and global mark." 383 "*If non-nil, automatically show help for region, rectangle and global mark."
384 :type 'boolean 384 :type 'boolean
@@ -1180,11 +1180,13 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1180 1180
1181;;; Keymaps 1181;;; Keymaps
1182 1182
1183;; Cached value of actual cua-rectangle-modifier-key
1184(defvar cua--rectangle-modifier-key 'meta)
1185
1183(defun cua--M/H-key (map key fct) 1186(defun cua--M/H-key (map key fct)
1184 ;; bind H-KEY or M-KEY to FCT in MAP 1187 ;; bind H-KEY or M-KEY to FCT in MAP
1185 (if (eq key 'space) (setq key ?\s))
1186 (unless (listp key) (setq key (list key))) 1188 (unless (listp key) (setq key (list key)))
1187 (define-key map (vector (cons (if cua-use-hyper-key 'hyper 'meta) key)) fct)) 1189 (define-key map (vector (cons cua--rectangle-modifier-key key)) fct))
1188 1190
1189(defun cua--self-insert-char-p (def) 1191(defun cua--self-insert-char-p (def)
1190 ;; Return DEF if current key sequence is self-inserting in 1192 ;; Return DEF if current key sequence is self-inserting in
@@ -1232,7 +1234,8 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1232 (not cua--prefix-override-timer))) 1234 (not cua--prefix-override-timer)))
1233 (setq cua--ena-prefix-repeat-keymap 1235 (setq cua--ena-prefix-repeat-keymap
1234 (and cua--ena-region-keymap 1236 (and cua--ena-region-keymap
1235 (timerp cua--prefix-override-timer))) 1237 (or (timerp cua--prefix-override-timer)
1238 (eq cua--prefix-override-timer 'shift))))
1236 (setq cua--ena-cua-keys-keymap 1239 (setq cua--ena-cua-keys-keymap
1237 (and cua-enable-cua-keys 1240 (and cua-enable-cua-keys
1238 (not cua-inhibit-cua-keys) 1241 (not cua-inhibit-cua-keys)
@@ -1244,12 +1247,39 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1244 1247
1245(defvar cua--keymaps-initalized nil) 1248(defvar cua--keymaps-initalized nil)
1246 1249
1250(defun cua--shift-control-prefix (prefix arg)
1251 ;; handle S-C-x and S-C-c by emulating the fast double prefix function.
1252 ;; Don't record this command
1253 (setq this-command last-command)
1254 ;; Restore the prefix arg
1255 (setq prefix-arg arg)
1256 (reset-this-command-lengths)
1257 ;; Activate the cua--prefix-repeat-keymap
1258 (setq cua--prefix-override-timer 'shift)
1259 ;; Push duplicate keys back on the event queue
1260 (setq unread-command-events (cons prefix (cons prefix unread-command-events))))
1261
1262(defun cua--shift-control-c-prefix (arg)
1263 (interactive "P")
1264 (cua--shift-control-prefix ?\C-c arg))
1265
1266(defun cua--shift-control-x-prefix (arg)
1267 (interactive "P")
1268 (cua--shift-control-prefix ?\C-x arg))
1269
1247(defun cua--init-keymaps () 1270(defun cua--init-keymaps ()
1248 (unless (eq cua-use-hyper-key 'only) 1271 ;; Cache actual rectangle modifier key.
1249 (define-key cua-global-keymap [(control return)] 'cua-set-rectangle-mark)) 1272 (setq cua--rectangle-modifier-key
1250 (when cua-use-hyper-key 1273 (if (and cua-rectangle-modifier-key
1251 (cua--M/H-key cua-global-keymap 'space 'cua-set-rectangle-mark) 1274 (memq window-system '(x)))
1252 (define-key cua-global-keymap [(hyper mouse-1)] 'cua-mouse-set-rectangle-mark)) 1275 cua-rectangle-modifier-key
1276 'meta))
1277 ;; C-return always toggles rectangle mark
1278 (define-key cua-global-keymap [(control return)] 'cua-set-rectangle-mark)
1279 (unless (eq cua--rectangle-modifier-key 'meta)
1280 (cua--M/H-key cua-global-keymap ?\s 'cua-set-rectangle-mark)
1281 (define-key cua-global-keymap
1282 (vector (list cua--rectangle-modifier-key 'mouse-1)) 'cua-mouse-set-rectangle-mark))
1253 1283
1254 (define-key cua-global-keymap [(shift control ?\s)] 'cua-toggle-global-mark) 1284 (define-key cua-global-keymap [(shift control ?\s)] 'cua-toggle-global-mark)
1255 1285
@@ -1287,8 +1317,9 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1287 (define-key cua--prefix-repeat-keymap [(control c) right] 'cua--prefix-copy-handler) 1317 (define-key cua--prefix-repeat-keymap [(control c) right] 'cua--prefix-copy-handler)
1288 1318
1289 ;; Enable shifted fallbacks for C-x and C-c when region is active 1319 ;; Enable shifted fallbacks for C-x and C-c when region is active
1290 (define-key cua--region-keymap [(shift control x)] 'Control-X-prefix) 1320 (define-key cua--region-keymap [(shift control x)] 'cua--shift-control-x-prefix)
1291 (define-key cua--region-keymap [(shift control c)] 'mode-specific-command-prefix) 1321 (define-key cua--region-keymap [(shift control c)] 'cua--shift-control-c-prefix)
1322
1292 ;; replace current region 1323 ;; replace current region
1293 (define-key cua--region-keymap [remap self-insert-command] 'cua-replace-region) 1324 (define-key cua--region-keymap [remap self-insert-command] 'cua-replace-region)
1294 (define-key cua--region-keymap [remap self-insert-iso] 'cua-replace-region) 1325 (define-key cua--region-keymap [remap self-insert-iso] 'cua-replace-region)
@@ -1365,7 +1396,7 @@ CUA bindings, or `cua-prefix-override-inhibit-delay' to change
1365the prefix fallback behavior." 1396the prefix fallback behavior."
1366 :global t 1397 :global t
1367 :group 'cua 1398 :group 'cua
1368 :set-after '(cua-enable-modeline-indications cua-use-hyper-key) 1399 :set-after '(cua-enable-modeline-indications cua-rectangle-modifier-key)
1369 :require 'cua-base 1400 :require 'cua-base
1370 :link '(emacs-commentary-link "cua-base.el") 1401 :link '(emacs-commentary-link "cua-base.el")
1371 (setq mark-even-if-inactive t) 1402 (setq mark-even-if-inactive t)
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index 0590af50249..aa82e148aff 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -1242,6 +1242,7 @@ The numbers are formatted according to the FORMAT string."
1242 (setq z (cdr z))) 1242 (setq z (cdr z)))
1243 (if cua--debug 1243 (if cua--debug
1244 (print (list (current-column) cc) auxbuf)) 1244 (print (list (current-column) cc) auxbuf))
1245 (just-one-space 0)
1245 (indent-to cc)))) 1246 (indent-to cc))))
1246 (if (> tr 0) 1247 (if (> tr 0)
1247 (message "Warning: Truncated %d row%s" tr (if (> tr 1) "s" ""))) 1248 (message "Warning: Truncated %d row%s" tr (if (> tr 1) "s" "")))
@@ -1358,7 +1359,9 @@ With prefix arg, indent to that column."
1358 1359
1359(defun cua-help-for-rectangle (&optional help) 1360(defun cua-help-for-rectangle (&optional help)
1360 (interactive) 1361 (interactive)
1361 (let ((M (if cua-use-hyper-key " H-" " M-"))) 1362 (let ((M (cond ((eq cua--rectangle-modifier-key 'hyper) " H-")
1363 ((eq cua--rectangle-modifier-key 'super) " s-")
1364 (t " M-"))))
1362 (message 1365 (message
1363 (concat (if help "C-?:help" "") 1366 (concat (if help "C-?:help" "")
1364 M "p:pad" M "o:open" M "c:close" M "b:blank" 1367 M "p:pad" M "o:open" M "c:close" M "b:blank"
@@ -1410,12 +1413,11 @@ With prefix arg, indent to that column."
1410 (cua--M/H-key cua--rectangle-keymap key cmd)) 1413 (cua--M/H-key cua--rectangle-keymap key cmd))
1411 1414
1412(defun cua--init-rectangles () 1415(defun cua--init-rectangles ()
1413 (unless (eq cua-use-hyper-key 'only) 1416 (define-key cua--rectangle-keymap [(control return)] 'cua-clear-rectangle-mark)
1414 (define-key cua--rectangle-keymap [(control return)] 'cua-clear-rectangle-mark) 1417 (define-key cua--region-keymap [(control return)] 'cua-toggle-rectangle-mark)
1415 (define-key cua--region-keymap [(control return)] 'cua-toggle-rectangle-mark)) 1418 (unless (eq cua--rectangle-modifier-key 'meta)
1416 (when cua-use-hyper-key 1419 (cua--rect-M/H-key ?\s 'cua-clear-rectangle-mark)
1417 (cua--rect-M/H-key 'space 'cua-clear-rectangle-mark) 1420 (cua--M/H-key cua--region-keymap ?\s 'cua-toggle-rectangle-mark))
1418 (cua--M/H-key cua--region-keymap 'space 'cua-toggle-rectangle-mark))
1419 1421
1420 (define-key cua--rectangle-keymap [remap copy-region-as-kill] 'cua-copy-rectangle) 1422 (define-key cua--rectangle-keymap [remap copy-region-as-kill] 'cua-copy-rectangle)
1421 (define-key cua--rectangle-keymap [remap kill-ring-save] 'cua-copy-rectangle) 1423 (define-key cua--rectangle-keymap [remap kill-ring-save] 'cua-copy-rectangle)
diff --git a/lisp/files.el b/lisp/files.el
index a67a6c7de3b..e3760f53fad 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3197,7 +3197,9 @@ on a DOS/Windows machine, it returns FILENAME in expanded form."
3197 ancestor)))))) 3197 ancestor))))))
3198 3198
3199(defun save-buffer (&optional args) 3199(defun save-buffer (&optional args)
3200 "Save current buffer in visited file if modified. Variations are described below. 3200 "Save current buffer in visited file if modified.
3201Variations are described below.
3202
3201By default, makes the previous version into a backup file 3203By default, makes the previous version into a backup file
3202 if previously requested or if this is the first save. 3204 if previously requested or if this is the first save.
3203Prefixed with one \\[universal-argument], marks this version 3205Prefixed with one \\[universal-argument], marks this version
diff --git a/lisp/foldout.el b/lisp/foldout.el
index 54fca4eb6f0..632a09bb05f 100644
--- a/lisp/foldout.el
+++ b/lisp/foldout.el
@@ -308,7 +308,8 @@ optional arg EXPOSURE \(interactively with prefix arg\) changes this:-
308Normally causes exited folds to be hidden, but with ARG < 0, -ARG folds are 308Normally causes exited folds to be hidden, but with ARG < 0, -ARG folds are
309exited and text is left visible." 309exited and text is left visible."
310 (interactive "p") 310 (interactive "p")
311 (let (start-marker end-marker (hide-fold t)) 311 (let ((hide-fold t) start-marker end-marker
312 beginning-of-heading end-of-subtree)
312 313
313 ;; check there are some folds to leave 314 ;; check there are some folds to leave
314 (if (null foldout-fold-list) 315 (if (null foldout-fold-list)
@@ -355,26 +356,23 @@ exited and text is left visible."
355 ;; is \n otherwise it will be hidden. If there is a newline 356 ;; is \n otherwise it will be hidden. If there is a newline
356 ;; before this one, make it visible too so we do the same as 357 ;; before this one, make it visible too so we do the same as
357 ;; outline.el and leave a blank line before the heading. 358 ;; outline.el and leave a blank line before the heading.
358 (if (zerop num-folds) 359 (when (zerop num-folds)
359 (let ((beginning-of-heading (point)) 360 (if end-marker
360 (end-of-subtree (if end-marker 361 (setq beginning-of-heading (point)
361 (progn 362 end-of-subtree (progn (forward-char -1)
362 (forward-char -1) 363 (if (memq (preceding-char)
363 (if (memq (preceding-char) 364 '(?\n ?\^M))
364 '(?\n ?\^M)) 365 (forward-char -1))
365 (forward-char -1)) 366 (point))))
366 (point)) 367 ;; hide the subtree
367 (point-max)))) 368 (when hide-fold
368 ;; hide the subtree 369 (goto-char start-marker)
369 (if hide-fold 370 (hide-subtree))
370 (outline-flag-region start-marker end-of-subtree 371
371 foldout-hide-flag)) 372 ;; make sure the next heading is exposed
372 373 (if end-marker
373 ;; make sure the next heading is exposed 374 (outline-flag-region end-of-subtree beginning-of-heading
374 (if end-marker 375 foldout-show-flag)))
375 (outline-flag-region end-of-subtree beginning-of-heading
376 foldout-show-flag))
377 ))
378 376
379 ;; zap the markers so they don't slow down editing 377 ;; zap the markers so they don't slow down editing
380 (set-marker start-marker nil) 378 (set-marker start-marker nil)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 01babcddc86..708d232e994 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,204 @@
12005-12-08 Reiner Steib <Reiner.Steib@gmx.de>
2
3 * mm-decode.el (mm-discouraged-alternatives): Fix custom type.
4 Suggest image/.* in the doc string.
5
62005-12-07 Katsumi Yamaoka <yamaoka@jpl.org>
7
8 * mm-decode.el (mm-display-external): Use nametemplate (defined in
9 RFC1524) if it is in mailcap or add a suffix according to
10 mailcap-mime-extensions when generating a temp filename; postpone
11 deleting a temp file for 2 seconds for some wrappers, shell
12 scripts, and so on, which might exit right after having started a
13 viewer command as a background job.
14
152005-12-06 Reiner Steib <Reiner.Steib@gmx.de>
16
17 * gnus-art.el (gnus-default-article-saver): Add user-defined
18 `function' to custom type.
19
202005-12-02 ARISAWA Akihiro <ari@mbf.ocn.ne.jp> (tiny change)
21
22 * mm-view.el (mm-inline-text-html-render-with-w3m): Fix misplaced
23 parens.
24
252005-11-29 Reiner Steib <Reiner.Steib@gmx.de>
26
27 * gnus-cache.el (gnus-cache-rename-group): Wrap doc strings and
28 long lines.
29 (gnus-cache-delete-group): Wrap doc strings.
30
31 * gnus-agent.el (gnus-agent-rename-group)
32 (gnus-agent-delete-group): Wrap doc strings.
33
342005-11-24 Pascal Rigaux <pixel@mandriva.com> (tiny change)
35
36 * rfc2231.el (rfc2231-parse-string): Support non-ascii chars.
37
382005-11-22 Katsumi Yamaoka <yamaoka@jpl.org>
39
40 * nnmail.el (nnmail-fancy-expiry-target): Use current-time instead
41 of current-time-string.
42
432005-11-20 Stefan Schimanski <schimmi@debian.org> (tiny change)
44
45 * nnmail.el (nnmail-fancy-expiry-target): Protect against invalid
46 date header.
47
482005-11-16 Boris Samorodov <bsam@ipt.ru> (tiny patch)
49
50 * imap.el (imap-kerberos4-open): Ignore SSL stuff.
51
522005-11-14 Kevin Greiner <kevin.greiner@compsol.cc>
53
54 * gnus-agent.el (gnus-agent-article-alist-save-format): Changed
55 internal variable to a custom variable. Changed default value
56 from compressed(2) to uncompressed(1).
57 (gnus-agent-read-agentview): Reversed revision 7.8 to restore
58 support for uncompressed agentview files. Taken together, reading
59 the agentview file should now be 6-7 times faster.
60 (gnus-agent-long-article,
61 gnus-agent-short-article, gnus-agent-score): Renamed category
62 keywords to match gnus-cus.
63 (gnus-agent-summary-fetch-series): Modified to protect against
64 gnus-agent-summary-fetch-group clearing processable flags.
65 (gnus-agent-synchronize-group-flags): Update live group buffer as
66 synchronization may occur due to the user toggling the plugged
67 status.
68 (gnus-agent-braid-nov): Now tests new nov entries
69 for duplicates which are removed. The invalid sort check then
70 triggers a rescan after the sort as sorting may have moved
71 duplicate entries such that they can be cheaply detected.
72 (gnus-agent-read-local): Trivial fix to format of
73 error message to display actual error condition.
74 (gnus-agent-save-local): Avoid saving symbols that are bound to
75 nil as they simply result in a warning message in
76 gnus-agent-read-local.
77 (gnus-agent-fetch-group-1): Clear downloadable flag when article
78 successfully downloaded.
79 (gnus-agent-regenerate-group): Use
80 gnus-agent-synchronize-group-flags to reset read status in both
81 gnus and server.
82
83 * nntp.el (nntp-end-of-line): Doc fix.
84 (nntp-authinfo-rejected): New error condition.
85 (nntp-wait-for): Use new error condition to signal authentication
86 error.
87 (nntp-retrieve-data): Rethrow new error condition to break out of
88 recursive call to nntp-send-authinfo.
89
902005-11-13 Katsumi Yamaoka <yamaoka@jpl.org>
91
92 * gnus-start.el (gnus-dribble-read-file): Use make-local-variable
93 rather than make-variable-buffer-local for file-precious-flag.
94
952005-11-13 Katsumi Yamaoka <yamaoka@jpl.org>
96
97 * gnus-start.el (gnus-dribble-read-file): Quote file-precious-flag.
98
992005-11-11 Jan Nieuwenhuizen <janneke@gnu.org>
100
101 * gnus-start.el (gnus-dribble-read-file): Set file-precious-flag,
102 as a buffer-local variable. This avoids creating truncated
103 dribble files as a result of a hang up, eg.
104
1052005-11-04 Ken Manheimer <ken.manheimer@gmail.com>
106
107 * pgg-pgp.el (pgg-pgp-encrypt-region, pgg-pgp-decrypt-region)
108 (pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric)
109 (pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt)
110 (pgg-pgp-sign-region, pgg-pgp-sign): Add optional 'passphrase'
111 argument to all these routines, so the passphrase can be managed
112 externally and passed in to the system.
113 (pgg-pgp-decrypt-region, pgg-pgp-sign-region): Use new name for
114 pgg-add-passphrase-to-cache function.
115
116 * pgg-pgp5.el (pgg-pgp5-encrypt-region, pgg-pgp5-decrypt-region)
117 (pgg-pgp5-encrypt-symmetric-region, pgg-pgp5-encrypt-symmetric)
118 (pgg-pgp5-encrypt, pgg-pgp5-decrypt-region, pgg-pgp5-decrypt)
119 (pgg-pgp5-sign-region, pgg-pgp5-sign): Add optional 'passphrase'
120 argument to all these routines, so the passphrase can be managed
121 externally and passed in to the system.
122 (pgg-pgp5-sign-region): Use new name of pgg-add-passphrase-to-cache
123 function.
124
1252005-10-30 Chong Yidong <cyd@stupidchicken.com>
126
127 * imap.el (imap-open): Handle case where buffer is a buffer
128 object.
129
1302005-10-29 Ken Manheimer <ken.manheimer@gmail.com>
131
132 * pgg-gpg.el (pgg-gpg-select-matching-key): Fix: look at the right
133 part of the decoded armor to find the key-identifier.
134 (pgg-gpg-lookup-key-owner): New function to return the
135 human-readable identifier of a key owner.
136 (pgg-gpg-lookup-id-from-key-owner): Make it easy to identify the
137 key itself.
138 (pgg-gpg-decrypt-region): Prompt with the key owner (rather than
139 the key value) if we have a key and can match it against a secret
140 key. Also, added a note pointing out fact that the prompt only
141 indicates the first matching key.
142
143 * pgg.el (pgg-decrypt): Passing along 'passphrase' in call to
144 pgg-decrypt-region.
145 (pgg-pending-timers): A new hash for tracking the passphrase cache
146 timers, so that new ones supercede old ones.
147 (pgg-add-passphrase-to-cache): Rename from
148 `pgg-add-passphrase-cache' to reduce confusion (all callers
149 changed). Modified to cancel old timers when new ones are added.
150 (pgg-remove-passphrase-from-cache): Rename from
151 `pgg-remove-passphrase-cache' to reduce confusion (all callers
152 changed). Modified to cancel old timers when their keys are
153 removed from the cache.
154 (pgg-cancel-timer): In Emacs, an alias for cancel-timer; in
155 XEmacs, an indirection to delete-itimer.
156 (pgg-read-passphrase-from-cache, pgg-read-passphrase):
157 Extract pgg-read-passphrase-from-cache from pgg-read-passphrase so
158 users can only check cache without risk of prompting. Correct bug in
159 notruncate behavior.
160 (pgg-read-passphrase-from-cache, pgg-read-passphrase)
161 (pgg-add-passphrase-cache, pgg-remove-passphrase-cache):
162 Add informative docstrings.
163 (pgg-decrypt): Convey provided passphrase in subordinate call to
164 pgg-decrypt-region.
165
1662005-10-20 Ken Manheimer <ken.manheimer+emacs@gmail.com>
167
168 * pgg.el (pgg-encrypt-region, pgg-encrypt-symmetric-region)
169 (pgg-encrypt-symmetric, pgg-encrypt, pgg-decrypt-region)
170 (pgg-decrypt, pgg-sign-region, pgg-sign): Add optional
171 'passphrase' argument, so the passphrase can be managed externally
172 and then passed in to the system.
173
174 * pgg.el (pgg-read-passphrase, pgg-add-passphrase-cache)
175 (pgg-remove-passphrase-cache): Add optional 'notruncate' argument,
176 so the passphrase cache can be used reliably with identifiers
177 besides a pgp packet's key id.
178
179 * pgg-gpg.el (pgg-pgp-encrypt-region)
180 (pgg-pgp-encrypt-symmetric-region, pgg-pgp-encrypt-symmetric)
181 (pgg-pgp-encrypt, pgg-pgp-decrypt-region, pgg-pgp-decrypt)
182 (pgg-pgp-sign-region, pgg-pgp-sign): Add optional 'passphrase'
183 argument to all these routines, so the passphrase can be managed
184 externally and passed in to the system.
185
186 * pgg-gpg.el (pgg-gpg-possibly-cache-passphrase): Add optional
187 'notruncate' argument, so the passphrase cache can be used
188 reliably with identifiers besides a pgp packet's key id.
189
1902005-10-29 Sascha Wilde <swilde@sha-bang.de>
191
192 * pgg-gpg.el (pgg-gpg-encrypt-symmetric-region): New function for
193 symmetric encryption.
194 (pgg-gpg-symmetric-key-p): New function to check for an symmetric
195 encrypted session key.
196 (pgg-gpg-decrypt-region): When decrypting a symmetric encrypted
197 message ask for the passphrase in a proper way.
198
199 * pgg.el (pgg-encrypt-symmetric, pgg-encrypt-symmetric-region):
200 New user commands for symmetric encryption.
201
12005-11-30 Stefan Monnier <monnier@iro.umontreal.ca> 2022005-11-30 Stefan Monnier <monnier@iro.umontreal.ca>
2 203
3 * gnus-delay.el (gnus-delay-group): Don't autoload. 204 * gnus-delay.el (gnus-delay-group): Don't autoload.
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index 0357ddd18cb..2139c485720 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -213,6 +213,17 @@ unplugged."
213 :group 'gnus-agent 213 :group 'gnus-agent
214 :type 'boolean) 214 :type 'boolean)
215 215
216(defcustom gnus-agent-article-alist-save-format 1
217 "Indicates whether to use compression(2), verses no
218 compression(1), when writing agentview files. The compressed
219 files do save space but load times are 6-7 times higher. A
220 group must be opened then closed for the agentview to be
221 updated using the new format."
222 :version "22.1"
223 :group 'gnus-agent
224 :type '(radio (const :format "Compressed" 2)
225 (const :format "Uncompressed" 1)))
226
216;;; Internal variables 227;;; Internal variables
217 228
218(defvar gnus-agent-history-buffers nil) 229(defvar gnus-agent-history-buffers nil)
@@ -357,17 +368,17 @@ manipulated as follows:
357(gnus-agent-cat-defaccessor 368(gnus-agent-cat-defaccessor
358 gnus-agent-cat-high-score agent-high-score) 369 gnus-agent-cat-high-score agent-high-score)
359(gnus-agent-cat-defaccessor 370(gnus-agent-cat-defaccessor
360 gnus-agent-cat-length-when-long agent-length-when-long) 371 gnus-agent-cat-length-when-long agent-long-article)
361(gnus-agent-cat-defaccessor 372(gnus-agent-cat-defaccessor
362 gnus-agent-cat-length-when-short agent-length-when-short) 373 gnus-agent-cat-length-when-short agent-short-article)
363(gnus-agent-cat-defaccessor 374(gnus-agent-cat-defaccessor
364 gnus-agent-cat-low-score agent-low-score) 375 gnus-agent-cat-low-score agent-low-score)
365(gnus-agent-cat-defaccessor 376(gnus-agent-cat-defaccessor
366 gnus-agent-cat-predicate agent-predicate) 377 gnus-agent-cat-predicate agent-predicate)
367(gnus-agent-cat-defaccessor 378(gnus-agent-cat-defaccessor
368 gnus-agent-cat-score-file agent-score-file) 379 gnus-agent-cat-score-file agent-score)
369(gnus-agent-cat-defaccessor 380(gnus-agent-cat-defaccessor
370 gnus-agent-cat-enable-undownloaded-faces agent-enable-undownloaded-faces) 381 gnus-agent-cat-enable-undownloaded-faces agent-enable-undownloaded-faces)
371 382
372 383
373;; This form is equivalent to defsetf except that it calls make-symbol 384;; This form is equivalent to defsetf except that it calls make-symbol
@@ -858,9 +869,11 @@ be a select method."
858 869
859;;;###autoload 870;;;###autoload
860(defun gnus-agent-rename-group (old-group new-group) 871(defun gnus-agent-rename-group (old-group new-group)
861 "Rename fully-qualified OLD-GROUP as NEW-GROUP. Always updates the agent, even when 872 "Rename fully-qualified OLD-GROUP as NEW-GROUP.
862disabled, as the old agent files would corrupt gnus when the agent was 873Always updates the agent, even when disabled, as the old agent
863next enabled. Depends upon the caller to determine whether group renaming is supported." 874files would corrupt gnus when the agent was next enabled.
875Depends upon the caller to determine whether group renaming is
876supported."
864 (let* ((old-command-method (gnus-find-method-for-group old-group)) 877 (let* ((old-command-method (gnus-find-method-for-group old-group))
865 (old-path (directory-file-name 878 (old-path (directory-file-name
866 (let (gnus-command-method old-command-method) 879 (let (gnus-command-method old-command-method)
@@ -888,9 +901,11 @@ next enabled. Depends upon the caller to determine whether group renaming is sup
888 901
889;;;###autoload 902;;;###autoload
890(defun gnus-agent-delete-group (group) 903(defun gnus-agent-delete-group (group)
891 "Delete fully-qualified GROUP. Always updates the agent, even when 904 "Delete fully-qualified GROUP.
892disabled, as the old agent files would corrupt gnus when the agent was 905Always updates the agent, even when disabled, as the old agent
893next enabled. Depends upon the caller to determine whether group deletion is supported." 906files would corrupt gnus when the agent was next enabled.
907Depends upon the caller to determine whether group deletion is
908supported."
894 (let* ((command-method (gnus-find-method-for-group group)) 909 (let* ((command-method (gnus-find-method-for-group group))
895 (path (directory-file-name 910 (path (directory-file-name
896 (let (gnus-command-method command-method) 911 (let (gnus-command-method command-method)
@@ -1134,20 +1149,22 @@ downloadable."
1134 (when gnus-newsgroup-processable 1149 (when gnus-newsgroup-processable
1135 (setq gnus-newsgroup-downloadable 1150 (setq gnus-newsgroup-downloadable
1136 (let* ((dl gnus-newsgroup-downloadable) 1151 (let* ((dl gnus-newsgroup-downloadable)
1137 (gnus-newsgroup-downloadable 1152 (processable (sort (gnus-copy-sequence gnus-newsgroup-processable) '<))
1138 (sort (gnus-copy-sequence gnus-newsgroup-processable) '<)) 1153 (gnus-newsgroup-downloadable processable))
1139 (fetched-articles (gnus-agent-summary-fetch-group))) 1154 (gnus-agent-summary-fetch-group)
1140 ;; The preceeding call to (gnus-agent-summary-fetch-group)
1141 ;; updated gnus-newsgroup-downloadable to remove each
1142 ;; article successfully fetched.
1143 1155
1144 ;; For each article that I processed, remove its 1156 ;; For each article that I processed that is no longer
1145 ;; processable mark IF the article is no longer 1157 ;; undownloaded, remove its processable mark.
1146 ;; downloadable (i.e. it's already downloaded) 1158
1147 (dolist (article gnus-newsgroup-processable) 1159 (mapc #'gnus-summary-remove-process-mark
1148 (unless (memq article gnus-newsgroup-downloadable) 1160 (gnus-sorted-ndifference gnus-newsgroup-processable gnus-newsgroup-undownloaded))
1149 (gnus-summary-remove-process-mark article))) 1161
1150 (gnus-sorted-ndifference dl fetched-articles))))) 1162 ;; The preceeding call to (gnus-agent-summary-fetch-group)
1163 ;; updated the temporary gnus-newsgroup-downloadable to
1164 ;; remove each article successfully fetched. Now, I
1165 ;; update the real gnus-newsgroup-downloadable to only
1166 ;; include undownloaded articles.
1167 (gnus-sorted-ndifference dl (gnus-sorted-ndifference processable gnus-newsgroup-undownloaded))))))
1151 1168
1152(defun gnus-agent-summary-fetch-group (&optional all) 1169(defun gnus-agent-summary-fetch-group (&optional all)
1153 "Fetch the downloadable articles in the group. 1170 "Fetch the downloadable articles in the group.
@@ -1240,7 +1257,13 @@ This can be added to `gnus-select-article-hook' or
1240 'gnus-range-add 1257 'gnus-range-add
1241 'gnus-remove-from-range) 1258 'gnus-remove-from-range)
1242 (cdr info-marks) 1259 (cdr info-marks)
1243 range))))))))) 1260 range))))))))
1261
1262 ;;Marks can be synchronized at any time by simply toggling from
1263 ;;unplugged to plugged. If that is what is happening right now, make
1264 ;;sure that the group buffer is up to date.
1265 (when (gnus-buffer-live-p gnus-group-buffer)
1266 (gnus-group-update-group group t)))
1244 nil)) 1267 nil))
1245 1268
1246(defun gnus-agent-save-active (method) 1269(defun gnus-agent-save-active (method)
@@ -1330,7 +1353,7 @@ downloaded into the agent."
1330 (when (re-search-forward 1353 (when (re-search-forward
1331 (concat "^" (regexp-quote group) " ") nil t) 1354 (concat "^" (regexp-quote group) " ") nil t)
1332 (save-excursion 1355 (save-excursion
1333 (setq oactive-max (read (current-buffer)) ;; max 1356 (setq oactive-max (read (current-buffer)) ;; max
1334 oactive-min (read (current-buffer)))) ;; min 1357 oactive-min (read (current-buffer)))) ;; min
1335 (gnus-delete-line))) 1358 (gnus-delete-line)))
1336 (when active 1359 (when active
@@ -1824,7 +1847,7 @@ article numbers will be returned."
1824(defsubst gnus-agent-read-article-number () 1847(defsubst gnus-agent-read-article-number ()
1825 "Reads the article number at point. Returns nil when a valid article number can not be read." 1848 "Reads the article number at point. Returns nil when a valid article number can not be read."
1826 1849
1827 ;; It is unfortunite but the read function quietly overflows 1850 ;; It is unfortunate but the read function quietly overflows
1828 ;; integer. As a result, I have to use string operations to test 1851 ;; integer. As a result, I have to use string operations to test
1829 ;; for overflow BEFORE calling read. 1852 ;; for overflow BEFORE calling read.
1830 (when (looking-at "[0-9]+\t") 1853 (when (looking-at "[0-9]+\t")
@@ -1913,6 +1936,7 @@ doesn't exist, to valid the overview buffer."
1913 (goto-char p)) 1936 (goto-char p))
1914 1937
1915 (setq last (or last -134217728)) 1938 (setq last (or last -134217728))
1939 (while (catch 'problems
1916 (let (sort art) 1940 (let (sort art)
1917 (while (not (eobp)) 1941 (while (not (eobp))
1918 (setq art (gnus-agent-read-article-number)) 1942 (setq art (gnus-agent-read-article-number))
@@ -1924,12 +1948,27 @@ doesn't exist, to valid the overview buffer."
1924 ;; Art num out of order - enable sort 1948 ;; Art num out of order - enable sort
1925 (setq sort t) 1949 (setq sort t)
1926 (forward-line 1)) 1950 (forward-line 1))
1951 ((= art last)
1952 ;; Bad repeat of art number - delete this line
1953 (beginning-of-line)
1954 (delete-region (point) (progn (forward-line 1) (point))))
1927 (t 1955 (t
1928 ;; Good art num 1956 ;; Good art num
1929 (setq last art) 1957 (setq last art)
1930 (forward-line 1)))) 1958 (forward-line 1))))
1931 (when sort 1959 (when sort
1932 (sort-numeric-fields 1 (point-min) (point-max))))))) 1960 ;; something is seriously wrong as we simply shouldn't see out-of-order data.
1961 ;; First, we'll fix the sort.
1962 (sort-numeric-fields 1 (point-min) (point-max))
1963
1964 ;; but now we have to consider that we may have duplicate rows...
1965 ;; so reset to beginning of file
1966 (goto-char (point-min))
1967 (setq last -134217728)
1968
1969 ;; and throw a code that restarts this scan
1970 (throw 'problems t))
1971 nil))))))
1933 1972
1934;; Keeps the compiler from warning about the free variable in 1973;; Keeps the compiler from warning about the free variable in
1935;; gnus-agent-read-agentview. 1974;; gnus-agent-read-agentview.
@@ -1946,11 +1985,6 @@ doesn't exist, to valid the overview buffer."
1946 'gnus-agent-file-loading-cache 1985 'gnus-agent-file-loading-cache
1947 'gnus-agent-read-agentview)))) 1986 'gnus-agent-read-agentview))))
1948 1987
1949;; Save format may be either 1 or 2. Two is the new, compressed
1950;; format that is still being tested. Format 1 is uncompressed but
1951;; known to be reliable.
1952(defconst gnus-agent-article-alist-save-format 2)
1953
1954(defun gnus-agent-read-agentview (file) 1988(defun gnus-agent-read-agentview (file)
1955 "Load FILE and do a `read' there." 1989 "Load FILE and do a `read' there."
1956 (with-temp-buffer 1990 (with-temp-buffer
@@ -1964,8 +1998,6 @@ doesn't exist, to valid the overview buffer."
1964 changed-version) 1998 changed-version)
1965 1999
1966 (cond 2000 (cond
1967 ((< version 2)
1968 (error "gnus-agent-read-agentview no longer supports version %d. Stop gnus, manually evaluate gnus-agent-convert-to-compressed-agentview, then restart gnus." version))
1969 ((= version 0) 2001 ((= version 0)
1970 (let ((inhibit-quit t) 2002 (let ((inhibit-quit t)
1971 entry) 2003 entry)
@@ -1996,7 +2028,8 @@ doesn't exist, to valid the overview buffer."
1996 (setq uncomp (cons (cons article-id state) uncomp))) 2028 (setq uncomp (cons (cons article-id state) uncomp)))
1997 sequence))) 2029 sequence)))
1998 alist) 2030 alist)
1999 (setq alist (sort uncomp 'car-less-than-car))))) 2031 (setq alist (sort uncomp 'car-less-than-car)))
2032 (setq changed-version (not (= 2 gnus-agent-article-alist-save-format)))))
2000 (when changed-version 2033 (when changed-version
2001 (let ((gnus-agent-article-alist alist)) 2034 (let ((gnus-agent-article-alist alist))
2002 (gnus-agent-save-alist gnus-agent-read-agentview))) 2035 (gnus-agent-save-alist gnus-agent-read-agentview)))
@@ -2110,7 +2143,7 @@ modified) original contents, they are first saved to their own file."
2110 ;; NOTE: The '+ 0' ensure that min and max are both numerics. 2143 ;; NOTE: The '+ 0' ensure that min and max are both numerics.
2111 (set group (cons (+ 0 min) (+ 0 max)))) 2144 (set group (cons (+ 0 min) (+ 0 max))))
2112 (error 2145 (error
2113 (gnus-message 3 "Warning - invalid agent local: %s on line %d: " 2146 (gnus-message 3 "Warning - invalid agent local: %s on line %d: %s"
2114 file line (error-message-string err)))) 2147 file line (error-message-string err))))
2115 (forward-line 1) 2148 (forward-line 1)
2116 (setq line (1+ line)))) 2149 (setq line (1+ line))))
@@ -2141,13 +2174,14 @@ modified) original contents, they are first saved to their own file."
2141 ((member (symbol-name symbol) '("+dirty" "+method")) 2174 ((member (symbol-name symbol) '("+dirty" "+method"))
2142 nil) 2175 nil)
2143 (t 2176 (t
2144 (prin1 symbol)
2145 (let ((range (symbol-value symbol))) 2177 (let ((range (symbol-value symbol)))
2178 (when range
2179 (prin1 symbol)
2146 (princ " ") 2180 (princ " ")
2147 (princ (car range)) 2181 (princ (car range))
2148 (princ " ") 2182 (princ " ")
2149 (princ (cdr range)) 2183 (princ (cdr range))
2150 (princ "\n"))))) 2184 (princ "\n"))))))
2151 my-obarray)))))))) 2185 my-obarray))))))))
2152 2186
2153(defun gnus-agent-get-local (group &optional gmane method) 2187(defun gnus-agent-get-local (group &optional gmane method)
@@ -2402,7 +2436,9 @@ modified) original contents, they are first saved to their own file."
2402 (dolist (article marked-articles) 2436 (dolist (article marked-articles)
2403 (gnus-summary-set-agent-mark article t)) 2437 (gnus-summary-set-agent-mark article t))
2404 (dolist (article fetched-articles) 2438 (dolist (article fetched-articles)
2405 (if gnus-agent-mark-unread-after-downloaded 2439 (when gnus-agent-mark-unread-after-downloaded
2440 (setq gnus-newsgroup-downloadable
2441 (delq article gnus-newsgroup-downloadable))
2406 (gnus-summary-mark-article 2442 (gnus-summary-mark-article
2407 article gnus-unread-mark)) 2443 article gnus-unread-mark))
2408 (when (gnus-summary-goto-subject article nil t) 2444 (when (gnus-summary-goto-subject article nil t)
@@ -3191,7 +3227,7 @@ missing NOV entry. Run gnus-agent-regenerate-group to restore it.")))
3191 ((setq type 3227 ((setq type
3192 (cond 3228 (cond
3193 ((not (integerp fetch-date)) 3229 ((not (integerp fetch-date))
3194 'read) ;; never fetched article (may expire 3230 'read) ;; never fetched article (may expire
3195 ;; right now) 3231 ;; right now)
3196 ((not (file-exists-p 3232 ((not (file-exists-p
3197 (concat dir (number-to-string 3233 (concat dir (number-to-string
@@ -3871,8 +3907,9 @@ If REREAD is not nil, downloaded articles are marked as unread."
3871 (gnus-agent-possibly-alter-active group group-active))))) 3907 (gnus-agent-possibly-alter-active group group-active)))))
3872 3908
3873 (when (and reread gnus-agent-article-alist) 3909 (when (and reread gnus-agent-article-alist)
3874 (gnus-make-ascending-articles-unread 3910 (gnus-agent-synchronize-group-flags
3875 group 3911 group
3912 (list (list
3876 (if (listp reread) 3913 (if (listp reread)
3877 reread 3914 reread
3878 (delq nil (mapcar (function (lambda (c) 3915 (delq nil (mapcar (function (lambda (c)
@@ -3880,7 +3917,9 @@ If REREAD is not nil, downloaded articles are marked as unread."
3880 (car c)) 3917 (car c))
3881 ((cdr c) 3918 ((cdr c)
3882 (car c))))) 3919 (car c)))))
3883 gnus-agent-article-alist)))) 3920 gnus-agent-article-alist)))
3921 'del '(read)))
3922 gnus-command-method)
3884 3923
3885 (when (gnus-buffer-live-p gnus-group-buffer) 3924 (when (gnus-buffer-live-p gnus-group-buffer)
3886 (gnus-group-update-group group t))) 3925 (gnus-group-update-group group t)))
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 98e699cd80c..ef5796a6083 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -535,7 +535,8 @@ Gnus provides the following functions:
535 (function-item gnus-summary-save-in-file) 535 (function-item gnus-summary-save-in-file)
536 (function-item gnus-summary-save-body-in-file) 536 (function-item gnus-summary-save-body-in-file)
537 (function-item gnus-summary-save-in-vm) 537 (function-item gnus-summary-save-in-vm)
538 (function-item gnus-summary-write-to-file))) 538 (function-item gnus-summary-write-to-file)
539 (function)))
539 540
540(defcustom gnus-rmail-save-name 'gnus-plain-save-name 541(defcustom gnus-rmail-save-name 'gnus-plain-save-name
541 "A function generating a file name to save articles in Rmail format. 542 "A function generating a file name to save articles in Rmail format.
diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el
index 4477e8f579e..7785fd4c7de 100644
--- a/lisp/gnus/gnus-cache.el
+++ b/lisp/gnus/gnus-cache.el
@@ -730,9 +730,11 @@ If GROUP is non-nil, also cater to `gnus-cacheable-groups' and
730 730
731;;;###autoload 731;;;###autoload
732(defun gnus-cache-rename-group (old-group new-group) 732(defun gnus-cache-rename-group (old-group new-group)
733 "Rename OLD-GROUP as NEW-GROUP. Always updates the cache, even when 733 "Rename OLD-GROUP as NEW-GROUP.
734disabled, as the old cache files would corrupt gnus when the cache was 734Always updates the cache, even when disabled, as the old cache
735next enabled. Depends upon the caller to determine whether group renaming is supported." 735files would corrupt Gnus when the cache was next enabled. It
736depends on the caller to determine whether group renaming is
737supported."
736 (let ((old-dir (gnus-cache-file-name old-group "")) 738 (let ((old-dir (gnus-cache-file-name old-group ""))
737 (new-dir (gnus-cache-file-name new-group ""))) 739 (new-dir (gnus-cache-file-name new-group "")))
738 (gnus-rename-file old-dir new-dir t)) 740 (gnus-rename-file old-dir new-dir t))
@@ -740,9 +742,12 @@ next enabled. Depends upon the caller to determine whether group renaming is sup
740 (let ((no-save gnus-cache-active-hashtb)) 742 (let ((no-save gnus-cache-active-hashtb))
741 (unless gnus-cache-active-hashtb 743 (unless gnus-cache-active-hashtb
742 (gnus-cache-read-active)) 744 (gnus-cache-read-active))
743 (let* ((old-group-hash-value (gnus-gethash old-group gnus-cache-active-hashtb)) 745 (let* ((old-group-hash-value
744 (new-group-hash-value (gnus-gethash new-group gnus-cache-active-hashtb)) 746 (gnus-gethash old-group gnus-cache-active-hashtb))
745 (delta (or old-group-hash-value new-group-hash-value))) 747 (new-group-hash-value
748 (gnus-gethash new-group gnus-cache-active-hashtb))
749 (delta
750 (or old-group-hash-value new-group-hash-value)))
746 (gnus-sethash new-group old-group-hash-value gnus-cache-active-hashtb) 751 (gnus-sethash new-group old-group-hash-value gnus-cache-active-hashtb)
747 (gnus-sethash old-group nil gnus-cache-active-hashtb) 752 (gnus-sethash old-group nil gnus-cache-active-hashtb)
748 753
@@ -752,9 +757,11 @@ next enabled. Depends upon the caller to determine whether group renaming is sup
752 757
753;;;###autoload 758;;;###autoload
754(defun gnus-cache-delete-group (group) 759(defun gnus-cache-delete-group (group)
755 "Delete GROUP. Always updates the cache, even when 760 "Delete GROUP from the cache.
756disabled, as the old cache files would corrupt gnus when the cache was 761Always updates the cache, even when disabled, as the old cache
757next enabled. Depends upon the caller to determine whether group deletion is supported." 762files would corrupt gnus when the cache was next enabled.
763Depends upon the caller to determine whether group deletion is
764supported."
758 (let ((dir (gnus-cache-file-name group ""))) 765 (let ((dir (gnus-cache-file-name group "")))
759 (gnus-delete-directory dir)) 766 (gnus-delete-directory dir))
760 767
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 113d80bd124..d3b313c621f 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -858,6 +858,7 @@ prompt the user for the name of an NNTP server to use."
858 (set-buffer (setq gnus-dribble-buffer 858 (set-buffer (setq gnus-dribble-buffer
859 (gnus-get-buffer-create 859 (gnus-get-buffer-create
860 (file-name-nondirectory dribble-file)))) 860 (file-name-nondirectory dribble-file))))
861 (set (make-local-variable 'file-precious-flag) t)
861 (erase-buffer) 862 (erase-buffer)
862 (setq buffer-file-name dribble-file) 863 (setq buffer-file-name dribble-file)
863 (auto-save-mode t) 864 (auto-save-mode t)
diff --git a/lisp/gnus/imap.el b/lisp/gnus/imap.el
index 2be30aa6e47..967d79463f2 100644
--- a/lisp/gnus/imap.el
+++ b/lisp/gnus/imap.el
@@ -591,6 +591,13 @@ sure of changing the value of `foo'."
591 (while (and (memq (process-status process) '(open run)) 591 (while (and (memq (process-status process) '(open run))
592 (set-buffer buffer) ;; XXX "blue moon" nntp.el bug 592 (set-buffer buffer) ;; XXX "blue moon" nntp.el bug
593 (goto-char (point-min)) 593 (goto-char (point-min))
594 ;; Athena IMTEST can output SSL verify errors
595 (or (while (looking-at "^verify error:num=")
596 (forward-line))
597 t)
598 (or (while (looking-at "^TLS connection established")
599 (forward-line))
600 t)
594 ;; cyrus 1.6.x (13? < x <= 22) queries capabilities 601 ;; cyrus 1.6.x (13? < x <= 22) queries capabilities
595 (or (while (looking-at "^C:") 602 (or (while (looking-at "^C:")
596 (forward-line)) 603 (forward-line))
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 9d0bbdfeb63..108c5056541 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -335,8 +335,11 @@ for instance, text/html parts are very unwanted, and text/richtext are
335somewhat unwanted, then the value of this variable should be set 335somewhat unwanted, then the value of this variable should be set
336to: 336to:
337 337
338 (\"text/html\" \"text/richtext\")" 338 (\"text/html\" \"text/richtext\")
339 :type '(repeat string) 339
340Adding \"image/.*\" might also be useful. Spammers use it as the
341prefered part of multipart/alternative messages."
342 :type '(repeat regexp) ;; See `mm-preferred-alternative-precedence'.
340 :group 'mime-display) 343 :group 'mime-display)
341 344
342(defcustom mm-tmp-directory 345(defcustom mm-tmp-directory
@@ -761,7 +764,19 @@ external if displayed external."
761 (gnus-map-function mm-file-name-rewrite-functions 764 (gnus-map-function mm-file-name-rewrite-functions
762 (file-name-nondirectory filename)) 765 (file-name-nondirectory filename))
763 dir)) 766 dir))
764 (setq file (mm-make-temp-file (expand-file-name "mm." dir)))) 767 (setq file (mm-make-temp-file (expand-file-name "mm." dir)))
768 (let ((newname
769 ;; Use nametemplate (defined in RFC1524) if it is
770 ;; specified in mailcap.
771 (if (assoc "nametemplate" mime-info)
772 (format (assoc "nametemplate" mime-info) file)
773 ;; Add a suffix according to `mailcap-mime-extensions'.
774 (concat file (car (rassoc (mm-handle-media-type handle)
775 mailcap-mime-extensions))))))
776 (unless (string-equal file newname)
777 (when (file-exists-p file)
778 (rename-file file newname))
779 (setq file newname))))
765 (let ((coding-system-for-write mm-binary-coding-system)) 780 (let ((coding-system-for-write mm-binary-coding-system))
766 (write-region (point-min) (point-max) file nil 'nomesg)) 781 (write-region (point-min) (point-max) file nil 'nomesg))
767 (message "Viewing with %s" method) 782 (message "Viewing with %s" method)
@@ -819,6 +834,9 @@ external if displayed external."
819 (ignore-errors (kill-buffer buffer)))))) 834 (ignore-errors (kill-buffer buffer))))))
820 'inline) 835 'inline)
821 (t 836 (t
837 ;; Deleting the temp file should be postponed for some wrappers,
838 ;; shell scripts, and so on, which might exit right after having
839 ;; started a viewer command as a background job.
822 (let ((command (mm-mailcap-command 840 (let ((command (mm-mailcap-command
823 method file (mm-handle-type handle)))) 841 method file (mm-handle-type handle))))
824 (unwind-protect 842 (unwind-protect
@@ -830,24 +848,38 @@ external if displayed external."
830 shell-command-switch command) 848 shell-command-switch command)
831 (set-process-sentinel 849 (set-process-sentinel
832 (get-buffer-process buffer) 850 (get-buffer-process buffer)
833 `(lambda (process state) 851 (lexical-let ;; Don't use `let'.
834 (when (eq 'exit (process-status process)) 852 ;; Function used to remove temp file and directory.
835 ;; Don't use `ignore-errors'. 853 ((fn `(lambda nil
836 (condition-case nil 854 ;; Don't use `ignore-errors'.
837 (delete-file ,file) 855 (condition-case nil
838 (error)) 856 (delete-file ,file)
839 (condition-case nil 857 (error))
840 (delete-directory ,(file-name-directory file)) 858 (condition-case nil
841 (error)) 859 (delete-directory
842 (condition-case nil 860 ,(file-name-directory file))
843 (kill-buffer ,buffer) 861 (error))))
844 (error)) 862 ;; Form uses to kill the process buffer and
845 (condition-case nil 863 ;; remove the undisplayer.
846 ,(macroexpand (list 'mm-handle-set-undisplayer 864 (fm `(progn
847 (list 'quote handle) 865 (kill-buffer ,buffer)
848 nil)) 866 ,(macroexpand
849 (error)) 867 (list 'mm-handle-set-undisplayer
850 (message "Displaying %s...done" ,command))))) 868 (list 'quote handle)
869 nil))))
870 ;; Message to be issued when the process exits.
871 (done (format "Displaying %s...done" command))
872 ;; In particular, the timer object (which is
873 ;; a vector in Emacs but is a list in XEmacs)
874 ;; requires that it is lexically scoped.
875 (timer (run-at-time 2.0 nil 'ignore)))
876 (lambda (process state)
877 (when (eq 'exit (process-status process))
878 (if (memq timer timer-list)
879 (timer-set-function timer fn)
880 (funcall fn))
881 (ignore-errors (eval fm))
882 (message "%s" done))))))
851 (mm-handle-set-external-undisplayer 883 (mm-handle-set-external-undisplayer
852 handle (cons file buffer))) 884 handle (cons file buffer)))
853 (message "Displaying %s..." command)) 885 (message "Displaying %s..." command))
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index 033548e3bed..03c188b87a0 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -250,19 +250,19 @@
250 (point-min) (point-max) 250 (point-min) (point-max)
251 (list 'keymap w3m-minor-mode-map 251 (list 'keymap w3m-minor-mode-map
252 ;; Put the mark meaning this part was rendered by emacs-w3m. 252 ;; Put the mark meaning this part was rendered by emacs-w3m.
253 'mm-inline-text-html-with-w3m t)))) 253 'mm-inline-text-html-with-w3m t)))
254 (mm-handle-set-undisplayer 254 (mm-handle-set-undisplayer
255 handle 255 handle
256 `(lambda () 256 `(lambda ()
257 (let (buffer-read-only) 257 (let (buffer-read-only)
258 (if (functionp 'remove-specifier) 258 (if (functionp 'remove-specifier)
259 (mapcar (lambda (prop) 259 (mapcar (lambda (prop)
260 (remove-specifier 260 (remove-specifier
261 (face-property 'default prop) 261 (face-property 'default prop)
262 (current-buffer))) 262 (current-buffer)))
263 '(background background-pixmap foreground))) 263 '(background background-pixmap foreground)))
264 (delete-region ,(point-min-marker) 264 (delete-region ,(point-min-marker)
265 ,(point-max-marker)))))))) 265 ,(point-max-marker)))))))))
266 266
267(defun mm-links-remove-leading-blank () 267(defun mm-links-remove-leading-blank ()
268 ;; Delete the annoying three spaces preceding each line of links 268 ;; Delete the annoying three spaces preceding each line of links
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index ad913d441b7..1f0d1c91f49 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1872,9 +1872,15 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
1872 (case-fold-search nil) 1872 (case-fold-search nil)
1873 (from (or (message-fetch-field "from") "")) 1873 (from (or (message-fetch-field "from") ""))
1874 (to (or (message-fetch-field "to") "")) 1874 (to (or (message-fetch-field "to") ""))
1875 (date (date-to-time 1875 (date (message-fetch-field "date"))
1876 (or (message-fetch-field "date") (current-time-string))))
1877 (target 'delete)) 1876 (target 'delete))
1877 (setq date (if date
1878 (condition-case err
1879 (date-to-time date)
1880 (error
1881 (message "%s" (error-message-string err))
1882 (current-time)))
1883 (current-time)))
1878 (dolist (regexp-target-pair (reverse nnmail-fancy-expiry-targets) target) 1884 (dolist (regexp-target-pair (reverse nnmail-fancy-expiry-targets) target)
1879 (setq header (car regexp-target-pair)) 1885 (setq header (car regexp-target-pair))
1880 (cond 1886 (cond
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 0885737c953..ca63fa597ef 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -102,7 +102,7 @@ This command is used by the various nntp-open-via-* methods.")
102(defvoo nntp-end-of-line "\r\n" 102(defvoo nntp-end-of-line "\r\n"
103 "*String to use on the end of lines when talking to the NNTP server. 103 "*String to use on the end of lines when talking to the NNTP server.
104This is \"\\r\\n\" by default, but should be \"\\n\" when 104This is \"\\r\\n\" by default, but should be \"\\n\" when
105using and indirect connection method (nntp-open-via-*).") 105using an indirect connection method (nntp-open-via-*).")
106 106
107(defvoo nntp-via-rlogin-command "rsh" 107(defvoo nntp-via-rlogin-command "rsh"
108 "*Rlogin command used to connect to an intermediate host. 108 "*Rlogin command used to connect to an intermediate host.
@@ -259,6 +259,13 @@ Within a string, %s is replaced with the server address and %p with
259port number on server. The program should accept IMAP commands on 259port number on server. The program should accept IMAP commands on
260stdin and return responses to stdout.") 260stdin and return responses to stdout.")
261 261
262(defvar nntp-authinfo-rejected nil
263"A custom error condition used to report 'Authentication Rejected' errors.
264Condition handlers that match just this condition ensure that the nntp
265backend doesn't catch this error.")
266(put 'nntp-authinfo-rejected 'error-conditions '(error nntp-authinfo-rejected))
267(put 'nntp-authinfo-rejected 'error-message "Authorization Rejected")
268
262 269
263 270
264;;; Internal functions. 271;;; Internal functions.
@@ -313,12 +320,15 @@ be restored and the command retried."
313 (set-buffer (process-buffer process)) 320 (set-buffer (process-buffer process))
314 (goto-char (point-min)) 321 (goto-char (point-min))
315 (while (and (or (not (memq (char-after (point)) '(?2 ?3 ?4 ?5))) 322 (while (and (or (not (memq (char-after (point)) '(?2 ?3 ?4 ?5)))
316 (looking-at "480")) 323 (looking-at "48[02]"))
317 (memq (process-status process) '(open run))) 324 (memq (process-status process) '(open run)))
318 (when (looking-at "480") 325 (cond ((looking-at "480")
319 (nntp-handle-authinfo process)) 326 (nntp-handle-authinfo process))
320 (when (looking-at "^.*\n") 327 ((looking-at "482")
321 (delete-region (point) (progn (forward-line 1) (point)))) 328 (nnheader-report 'nntp (get 'nntp-authinfo-rejected 'error-message))
329 (signal 'nntp-authinfo-rejected nil))
330 ((looking-at "^.*\n")
331 (delete-region (point) (progn (forward-line 1) (point)))))
322 (nntp-accept-process-output process) 332 (nntp-accept-process-output process)
323 (goto-char (point-min))) 333 (goto-char (point-min)))
324 (prog1 334 (prog1
@@ -411,6 +421,8 @@ be restored and the command retried."
411 (wait-for 421 (wait-for
412 (nntp-wait-for process wait-for buffer decode)) 422 (nntp-wait-for process wait-for buffer decode))
413 (t t))) 423 (t t)))
424 (nntp-authinfo-rejected
425 (signal 'nntp-authinfo-rejected (cdr err)))
414 (error 426 (error
415 (nnheader-report 'nntp "Couldn't open connection to %s: %s" 427 (nnheader-report 'nntp "Couldn't open connection to %s: %s"
416 address err)) 428 address err))
diff --git a/lisp/gnus/rfc2231.el b/lisp/gnus/rfc2231.el
index f328f2dbc6a..df9a5b7bd82 100644
--- a/lisp/gnus/rfc2231.el
+++ b/lisp/gnus/rfc2231.el
@@ -127,7 +127,17 @@ The list will be on the form
127 (> c ?\177)) ;; EXTENSION: Support non-ascii chars. 127 (> c ?\177)) ;; EXTENSION: Support non-ascii chars.
128 (not (memq c stoken))) 128 (not (memq c stoken)))
129 (setq value (buffer-substring 129 (setq value (buffer-substring
130 (point) (progn (forward-sexp) (point))))) 130 (point)
131 (progn
132 (forward-sexp)
133 ;; We might not have reached at the end of
134 ;; the value because of non-ascii chars,
135 ;; so we should jump over them if any.
136 (while (and (not (eobp))
137 (> (char-after) ?\177))
138 (forward-char 1)
139 (forward-sexp))
140 (point)))))
131 (t 141 (t
132 (error "Invalid header: %s" string))) 142 (error "Invalid header: %s" string)))
133 (if number 143 (if number
diff --git a/lisp/help.el b/lisp/help.el
index 9a779f14d0c..02040007f6e 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -178,7 +178,7 @@ specifies what to do when the user exits the help buffer."
178(defalias 'help-for-help 'help-for-help-internal) 178(defalias 'help-for-help 'help-for-help-internal)
179;; It can't find this, but nobody will look. 179;; It can't find this, but nobody will look.
180(make-help-screen help-for-help-internal 180(make-help-screen help-for-help-internal
181 "a b c C e f F i I k C-k l L m p s t v w C-c C-d C-f C-n C-p C-t C-w . or ? :" 181 "a b c C e f F i I k C-k l L m p r s t v w C-c C-d C-f C-n C-p C-t C-w . or ? :"
182 "You have typed %THIS-KEY%, the help character. Type a Help option: 182 "You have typed %THIS-KEY%, the help character. Type a Help option:
183\(Use SPC or DEL to scroll through this text. Type \\<help-map>\\[help-quit] to exit the Help command.) 183\(Use SPC or DEL to scroll through this text. Type \\<help-map>\\[help-quit] to exit the Help command.)
184 184
@@ -217,6 +217,7 @@ m describe-mode. Display documentation of current minor modes,
217 and the current major mode, including their special commands. 217 and the current major mode, including their special commands.
218n view-emacs-news. Display news of recent Emacs changes. 218n view-emacs-news. Display news of recent Emacs changes.
219p finder-by-keyword. Find packages matching a given topic keyword. 219p finder-by-keyword. Find packages matching a given topic keyword.
220r info-emacs-manual. Display the Emacs manual in Info mode.
220s describe-syntax. Display contents of syntax table, plus explanations. 221s describe-syntax. Display contents of syntax table, plus explanations.
221S info-lookup-symbol. Display the definition of a specific symbol 222S info-lookup-symbol. Display the definition of a specific symbol
222 as found in the manual for the language this buffer is written in. 223 as found in the manual for the language this buffer is written in.
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 4c61be5529e..c3e2d814767 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -58,7 +58,7 @@
58;; hi-lock mode and adds a "Regexp Highlighting" entry 58;; hi-lock mode and adds a "Regexp Highlighting" entry
59;; to the edit menu. 59;; to the edit menu.
60;; 60;;
61;; (hi-lock-mode 1) 61;; (global-hi-lock-mode 1)
62;; 62;;
63;; You might also want to bind the hi-lock commands to more 63;; You might also want to bind the hi-lock commands to more
64;; finger-friendly sequences: 64;; finger-friendly sequences:
@@ -188,6 +188,17 @@ calls."
188(defvar hi-lock-file-patterns-prefix "Hi-lock" 188(defvar hi-lock-file-patterns-prefix "Hi-lock"
189 "Regexp for finding hi-lock patterns at top of file.") 189 "Regexp for finding hi-lock patterns at top of file.")
190 190
191(defvar hi-lock-archaic-interface-message-used nil
192 "True if user alerted that global-hi-lock-mode is now the global switch.
193Earlier versions of hi-lock used hi-lock-mode as the global switch,
194the message is issued if it appears that hi-lock-mode is used assuming
195that older functionality. This variable avoids multiple reminders.")
196
197(defvar hi-lock-archaic-interface-deduce nil
198 "If non-nil, sometimes assume that hi-lock-mode means global-hi-lock-mode.
199Assumption is made if hi-lock-mode used in the *scratch* buffer while
200a library is being loaded.")
201
191(make-variable-buffer-local 'hi-lock-interactive-patterns) 202(make-variable-buffer-local 'hi-lock-interactive-patterns)
192(put 'hi-lock-interactive-patterns 'permanent-local t) 203(put 'hi-lock-interactive-patterns 'permanent-local t)
193(make-variable-buffer-local 'hi-lock-regexp-history) 204(make-variable-buffer-local 'hi-lock-regexp-history)
@@ -238,13 +249,15 @@ calls."
238 249
239 250
240;;;###autoload 251;;;###autoload
241(define-minor-mode hi-lock-buffer-mode 252(define-minor-mode hi-lock-mode
242 "Toggle minor mode for interactively adding font-lock highlighting patterns. 253 "Toggle minor mode for interactively adding font-lock highlighting patterns.
243 254
244If ARG positive turn hi-lock on. Issuing a hi-lock command will also 255If ARG positive turn hi-lock on. Issuing a hi-lock command will also
245turn hi-lock on. When hi-lock is turned on, a \"Regexp Highlighting\" 256turn hi-lock on; to turn hi-lock on in all buffers use
246submenu is added to the \"Edit\" menu. The commands in the submenu, 257global-hi-lock-mode or in your .emacs file (global-hi-lock-mode 1).
247which can be called interactively, are: 258When hi-lock is turned on, a \"Regexp Highlighting\" submenu is added
259to the \"Edit\" menu. The commands in the submenu, which can be
260called interactively, are:
248 261
249\\[highlight-regexp] REGEXP FACE 262\\[highlight-regexp] REGEXP FACE
250 Highlight matches of pattern REGEXP in current buffer with FACE. 263 Highlight matches of pattern REGEXP in current buffer with FACE.
@@ -283,7 +296,24 @@ is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
283 :lighter " H" 296 :lighter " H"
284 :global nil 297 :global nil
285 :keymap hi-lock-map 298 :keymap hi-lock-map
286 (if hi-lock-buffer-mode 299 (when (and (equal (buffer-name) "*scratch*")
300 load-in-progress
301 (not (interactive-p))
302 (not hi-lock-archaic-interface-message-used))
303 (setq hi-lock-archaic-interface-message-used t)
304 (if hi-lock-archaic-interface-deduce
305 (global-hi-lock-mode hi-lock-mode)
306 (warn
307 "Possible archaic use of (hi-lock-mode).
308Use (global-hi-lock-mode 1) in .emacs to enable hi-lock for all buffers,
309use (hi-lock-mode 1) for individual buffers. For compatibility with Emacs
310versions before 22 use the following in your .emacs file:
311
312 (if (functionp 'global-hi-lock-mode)
313 (global-hi-lock-mode 1)
314 (hi-lock-mode 1))
315")))
316 (if hi-lock-mode
287 ;; Turned on. 317 ;; Turned on.
288 (progn 318 (progn
289 (unless font-lock-mode (font-lock-mode 1)) 319 (unless font-lock-mode (font-lock-mode 1))
@@ -294,7 +324,7 @@ is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
294 ;; Turned off. 324 ;; Turned off.
295 (when (or hi-lock-interactive-patterns 325 (when (or hi-lock-interactive-patterns
296 hi-lock-file-patterns) 326 hi-lock-file-patterns)
297 (when hi-lock-interactive-patterns 327 (when hi-lock-interactive-patterns
298 (font-lock-remove-keywords nil hi-lock-interactive-patterns) 328 (font-lock-remove-keywords nil hi-lock-interactive-patterns)
299 (setq hi-lock-interactive-patterns nil)) 329 (setq hi-lock-interactive-patterns nil))
300 (when hi-lock-file-patterns 330 (when hi-lock-file-patterns
@@ -306,13 +336,14 @@ is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'."
306 (remove-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook t))) 336 (remove-hook 'font-lock-mode-hook 'hi-lock-font-lock-hook t)))
307 337
308;;;###autoload 338;;;###autoload
309(define-global-minor-mode hi-lock-mode 339(define-global-minor-mode global-hi-lock-mode
310 hi-lock-buffer-mode turn-on-hi-lock-if-enabled 340 hi-lock-mode turn-on-hi-lock-if-enabled
311 :group 'hi-lock) 341 :group 'hi-lock)
312 342
313(defun turn-on-hi-lock-if-enabled () 343(defun turn-on-hi-lock-if-enabled ()
344 (setq hi-lock-archaic-interface-message-used t)
314 (unless (memq major-mode hi-lock-exclude-modes) 345 (unless (memq major-mode hi-lock-exclude-modes)
315 (hi-lock-buffer-mode 1))) 346 (hi-lock-mode 1)))
316 347
317;;;###autoload 348;;;###autoload
318(defalias 'highlight-lines-matching-regexp 'hi-lock-line-face-buffer) 349(defalias 'highlight-lines-matching-regexp 'hi-lock-line-face-buffer)
@@ -332,7 +363,7 @@ list maintained for regexps, global history maintained for faces.
332 nil nil 'hi-lock-regexp-history)) 363 nil nil 'hi-lock-regexp-history))
333 (hi-lock-read-face-name))) 364 (hi-lock-read-face-name)))
334 (or (facep face) (setq face 'hi-yellow)) 365 (or (facep face) (setq face 'hi-yellow))
335 (unless hi-lock-buffer-mode (hi-lock-buffer-mode 1)) 366 (unless hi-lock-mode (hi-lock-mode 1))
336 (hi-lock-set-pattern 367 (hi-lock-set-pattern
337 ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ? 368 ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ?
338 ;; or a trailing $ in REGEXP will be interpreted correctly. 369 ;; or a trailing $ in REGEXP will be interpreted correctly.
@@ -357,7 +388,7 @@ list maintained for regexps, global history maintained for faces.
357 nil nil 'hi-lock-regexp-history)) 388 nil nil 'hi-lock-regexp-history))
358 (hi-lock-read-face-name))) 389 (hi-lock-read-face-name)))
359 (or (facep face) (setq face 'hi-yellow)) 390 (or (facep face) (setq face 'hi-yellow))
360 (unless hi-lock-buffer-mode (hi-lock-buffer-mode 1)) 391 (unless hi-lock-mode (hi-lock-mode 1))
361 (hi-lock-set-pattern regexp face)) 392 (hi-lock-set-pattern regexp face))
362 393
363;;;###autoload 394;;;###autoload
@@ -377,7 +408,7 @@ lower-case letters made case insensitive."
377 nil nil 'hi-lock-regexp-history))) 408 nil nil 'hi-lock-regexp-history)))
378 (hi-lock-read-face-name))) 409 (hi-lock-read-face-name)))
379 (or (facep face) (setq face 'hi-yellow)) 410 (or (facep face) (setq face 'hi-yellow))
380 (unless hi-lock-buffer-mode (hi-lock-buffer-mode 1)) 411 (unless hi-lock-mode (hi-lock-mode 1))
381 (hi-lock-set-pattern regexp face)) 412 (hi-lock-set-pattern regexp face))
382 413
383;;;###autoload 414;;;###autoload
@@ -535,7 +566,7 @@ not suitable."
535 (setq all-patterns (append (read (current-buffer)) all-patterns)) 566 (setq all-patterns (append (read (current-buffer)) all-patterns))
536 (error (message "Invalid pattern list expression at %d" 567 (error (message "Invalid pattern list expression at %d"
537 (line-number-at-pos))))))) 568 (line-number-at-pos)))))))
538 (when hi-lock-buffer-mode (hi-lock-set-file-patterns all-patterns)) 569 (when hi-lock-mode (hi-lock-set-file-patterns all-patterns))
539 (if (interactive-p) 570 (if (interactive-p)
540 (message "Hi-lock added %d patterns." (length all-patterns)))))) 571 (message "Hi-lock added %d patterns." (length all-patterns))))))
541 572
@@ -544,7 +575,7 @@ not suitable."
544 (if font-lock-mode 575 (if font-lock-mode
545 (progn (font-lock-add-keywords nil hi-lock-file-patterns) 576 (progn (font-lock-add-keywords nil hi-lock-file-patterns)
546 (font-lock-add-keywords nil hi-lock-interactive-patterns)) 577 (font-lock-add-keywords nil hi-lock-interactive-patterns))
547 (hi-lock-buffer-mode -1))) 578 (hi-lock-mode -1)))
548 579
549(provide 'hi-lock) 580(provide 'hi-lock)
550 581
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 4e8f8f61221..2de72547887 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -1021,10 +1021,12 @@ currently used by buffers."
1021 (ibuffer-awhen (with-current-buffer buf 1021 (ibuffer-awhen (with-current-buffer buf
1022 (or buffer-file-name 1022 (or buffer-file-name
1023 (and (boundp 'dired-directory) 1023 (and (boundp 'dired-directory)
1024 (if (stringp dired-directory) 1024 (let ((dired-dir
1025 dired-directory 1025 (if (stringp dired-directory)
1026 (car dired-directory)) 1026 dired-directory
1027 (expand-file-name dired-directory)))) 1027 (car dired-directory))))
1028 (and dired-dir
1029 (expand-file-name dired-dir))))))
1028 (string-match qualifier it))) 1030 (string-match qualifier it)))
1029 1031
1030;;;###autoload (autoload 'ibuffer-filter-by-size-gt "ibuf-ext") 1032;;;###autoload (autoload 'ibuffer-filter-by-size-gt "ibuf-ext")
diff --git a/lisp/ido.el b/lisp/ido.el
index e6dcea5fd21..9fe063bade6 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -24,45 +24,6 @@
24;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 24;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25;; Boston, MA 02110-1301, USA. 25;; Boston, MA 02110-1301, USA.
26 26
27;;; Acknowledgements
28
29;; Infinite amounts of gratitude goes to Stephen Eglen <stephen@cns.ed.ac.uk>
30;; who wrote iswitch-buffer mode - from which I ripped off 99% of the code
31;; for ido-switch-buffer and found the inspiration for ido-find-file.
32;; The ido package would never have existed without his work.
33
34;; Also thanks to Klaus Berndl, Rohit Namjoshi, Robert Fenk, Alex
35;; Schroeder, Bill Benedetto, Stephen Eglen, and many others for bug
36;; fixes and improvements.
37
38;;; History
39
40;; Since I discovered Stephen Eglen's excellent iswitchb package, I just
41;; couldn't live without it, but once being addicted to switching buffers
42;; with a minimum of keystrokes, I soon found that opening files in the
43;; old-fashioned way was just too slow - so I decided to write a package
44;; which could open files with the same speed and ease as iswitchb could
45;; switch buffers.
46
47;; I originally wrote a separate ifindf.el package based on a copy of
48;; iswitchb.el, which did for opening files what iswitchb did for
49;; switching buffers. Along the way, I corrected a few errors in
50;; ifindf which could have found its way back into iswitchb, but since
51;; most of the functionality of the two package was practically
52;; identical, I decided that the proper thing to do was to merge my
53;; ifindf package back into iswitchb.
54;;
55;; This is basically what ido (interactively do) is all about; but I
56;; found it ackward to merge my changes into the "iswitchb-" namespace,
57;; so I invented a common "ido-" namespace for the merged packages.
58;;
59;; This version is based on ido.el version 1.57 released on
60;; gnu.emacs.sources adapted for emacs 22.1 to use command remapping
61;; and optionally hooking the read-buffer and read-file-name functions.
62;;
63;; Prefix matching was added by Klaus Berndl <klaus.berndl@sdm.de> based on
64;; an idea of Yuji Minejima <ggb01164@nifty.ne.jp> and his mcomplete-package.
65
66 27
67;;; Commentary: 28;;; Commentary:
68 29
@@ -94,10 +55,10 @@
94;; most recent, when I use ido-switch-buffer, I first of all get 55;; most recent, when I use ido-switch-buffer, I first of all get
95;; presented with the list of all the buffers 56;; presented with the list of all the buffers
96;; 57;;
97;; Buffer: {123456,123} 58;; Buffer: {123456 | 123}
98;; 59;;
99;; If I then press 2: 60;; If I then press 2:
100;; Buffer: 2[3]{123456,123} 61;; Buffer: 2[3]{123456 | 123}
101;; 62;;
102;; The list in {...} are the matching buffers, most recent first 63;; The list in {...} are the matching buffers, most recent first
103;; (buffers visible in the current frame are put at the end of the 64;; (buffers visible in the current frame are put at the end of the
@@ -110,7 +71,7 @@
110;; pressing TAB. In this case, I will get "3" added to my input. 71;; pressing TAB. In this case, I will get "3" added to my input.
111 72
112;; So, I press TAB: 73;; So, I press TAB:
113;; Buffer: 23{123456,123} 74;; Buffer: 23{123456 | 123}
114;; 75;;
115;; At this point, I still have two matching buffers. 76;; At this point, I still have two matching buffers.
116;; If I want the first buffer in the list, I simply press RET. If I 77;; If I want the first buffer in the list, I simply press RET. If I
@@ -118,13 +79,16 @@
118;; top of the list and then RET to select it. 79;; top of the list and then RET to select it.
119;; 80;;
120;; However, if I type 4, I only have one match left: 81;; However, if I type 4, I only have one match left:
121;; Buffer: 234[123456] [Matched] 82;; Buffer: 234[123456]
83;;
84;; Since there is only one matching buffer left, it is given in [] and
85;; it is shown in the `ido-only-match' face (ForestGreen). I can now
86;; press TAB or RET to go to that buffer.
122;; 87;;
123;; Since there is only one matching buffer left, it is given in [] and we 88;; If I want to create a new buffer named "234", I press C-j instead of
124;; see the text [Matched] afterwards. I can now press TAB or RET to go 89;; TAB or RET.
125;; to that buffer.
126;; 90;;
127;; If however, I now type "a": 91;; If instead, I type "a":
128;; Buffer: 234a [No match] 92;; Buffer: 234a [No match]
129;; There are no matching buffers. If I press RET or TAB, I can be 93;; There are no matching buffers. If I press RET or TAB, I can be
130;; prompted to create a new buffer called "234a". 94;; prompted to create a new buffer called "234a".
@@ -318,6 +282,45 @@
318;; can be used by other packages to read a buffer name, a file name, 282;; can be used by other packages to read a buffer name, a file name,
319;; or a directory name in the `ido' way. 283;; or a directory name in the `ido' way.
320 284
285;;; Acknowledgements
286
287;; Infinite amounts of gratitude goes to Stephen Eglen <stephen@cns.ed.ac.uk>
288;; who wrote iswitch-buffer mode - from which I ripped off 99% of the code
289;; for ido-switch-buffer and found the inspiration for ido-find-file.
290;; The ido package would never have existed without his work.
291
292;; Also thanks to Klaus Berndl, Rohit Namjoshi, Robert Fenk, Alex
293;; Schroeder, Bill Benedetto, Stephen Eglen, and many others for bug
294;; fixes and improvements.
295
296;;; History
297
298;; Since I discovered Stephen Eglen's excellent iswitchb package, I just
299;; couldn't live without it, but once being addicted to switching buffers
300;; with a minimum of keystrokes, I soon found that opening files in the
301;; old-fashioned way was just too slow - so I decided to write a package
302;; which could open files with the same speed and ease as iswitchb could
303;; switch buffers.
304
305;; I originally wrote a separate ifindf.el package based on a copy of
306;; iswitchb.el, which did for opening files what iswitchb did for
307;; switching buffers. Along the way, I corrected a few errors in
308;; ifindf which could have found its way back into iswitchb, but since
309;; most of the functionality of the two package was practically
310;; identical, I decided that the proper thing to do was to merge my
311;; ifindf package back into iswitchb.
312;;
313;; This is basically what ido (interactively do) is all about; but I
314;; found it ackward to merge my changes into the "iswitchb-" namespace,
315;; so I invented a common "ido-" namespace for the merged packages.
316;;
317;; This version is based on ido.el version 1.57 released on
318;; gnu.emacs.sources adapted for emacs 22.1 to use command remapping
319;; and optionally hooking the read-buffer and read-file-name functions.
320;;
321;; Prefix matching was added by Klaus Berndl <klaus.berndl@sdm.de> based on
322;; an idea of Yuji Minejima <ggb01164@nifty.ne.jp> and his mcomplete-package.
323
321 324
322;;; Code: 325;;; Code:
323 326
diff --git a/lisp/info.el b/lisp/info.el
index 2853a0f94ee..94bf36222f0 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3071,6 +3071,7 @@ if point is in a menu item description, follow that menu item."
3071 (define-key Info-mode-map " " 'Info-scroll-up) 3071 (define-key Info-mode-map " " 'Info-scroll-up)
3072 (define-key Info-mode-map "\C-m" 'Info-follow-nearest-node) 3072 (define-key Info-mode-map "\C-m" 'Info-follow-nearest-node)
3073 (define-key Info-mode-map "\t" 'Info-next-reference) 3073 (define-key Info-mode-map "\t" 'Info-next-reference)
3074 (define-key Info-mode-map "\e\t" 'Info-prev-reference)
3074 (define-key Info-mode-map [(shift tab)] 'Info-prev-reference) 3075 (define-key Info-mode-map [(shift tab)] 'Info-prev-reference)
3075 (define-key Info-mode-map [backtab] 'Info-prev-reference) 3076 (define-key Info-mode-map [backtab] 'Info-prev-reference)
3076 (define-key Info-mode-map "1" 'Info-nth-menu-item) 3077 (define-key Info-mode-map "1" 'Info-nth-menu-item)
diff --git a/lisp/international/ucs-tables.el b/lisp/international/ucs-tables.el
index 8d0760563c5..a8ca220466a 100644
--- a/lisp/international/ucs-tables.el
+++ b/lisp/international/ucs-tables.el
@@ -2499,8 +2499,8 @@ See also command `unify-8859-on-encoding-mode' and the user option
2499;; normal-mode and minibuffer-setup-hook. 2499;; normal-mode and minibuffer-setup-hook.
2500(defun ucs-set-table-for-input (&optional buffer) 2500(defun ucs-set-table-for-input (&optional buffer)
2501 "Set up an appropriate `translation-table-for-input' for BUFFER. 2501 "Set up an appropriate `translation-table-for-input' for BUFFER.
2502BUFFER defaults to the current buffer. 2502BUFFER defaults to the current buffer. This function is
2503This function is automatically called directly at the end of `get-buffer-create'." 2503automatically called directly at the end of `get-buffer-create'."
2504 (when (and unify-8859-on-encoding-mode 2504 (when (and unify-8859-on-encoding-mode
2505 (not unify-8859-on-decoding-mode) 2505 (not unify-8859-on-decoding-mode)
2506 (char-table-p translation-table-for-input)) 2506 (char-table-p translation-table-for-input))
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 5ccf2bf92ba..99c637e5664 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1809,6 +1809,8 @@ Isearch mode."
1809 ((eq char ?|) (isearch-fallback t nil t))) 1809 ((eq char ?|) (isearch-fallback t nil t)))
1810 1810
1811 ;; Append the char to the search string, update the message and re-search. 1811 ;; Append the char to the search string, update the message and re-search.
1812 (if (char-table-p translation-table-for-input)
1813 (setq char (or (aref translation-table-for-input char) char)))
1812 (isearch-process-search-string 1814 (isearch-process-search-string
1813 (char-to-string char) 1815 (char-to-string char)
1814 (if (>= char ?\200) 1816 (if (>= char ?\200)
@@ -2235,17 +2237,15 @@ since they have special meaning in a regexp."
2235(defvar isearch-overlay nil) 2237(defvar isearch-overlay nil)
2236 2238
2237(defun isearch-highlight (beg end) 2239(defun isearch-highlight (beg end)
2238 (unless (null search-highlight) 2240 (if search-highlight
2239 (cond (isearch-overlay 2241 (if isearch-overlay
2240 ;; Overlay already exists, just move it. 2242 ;; Overlay already exists, just move it.
2241 (move-overlay isearch-overlay beg end (current-buffer))) 2243 (move-overlay isearch-overlay beg end (current-buffer))
2242 2244 ;; Overlay doesn't exist, create it.
2243 (t 2245 (setq isearch-overlay (make-overlay beg end))
2244 ;; Overlay doesn't exist, create it. 2246 ;; 1001 is higher than lazy's 1000 and ediff's 100+
2245 (setq isearch-overlay (make-overlay beg end)) 2247 (overlay-put isearch-overlay 'priority 1001)
2246 (overlay-put isearch-overlay 'face isearch) 2248 (overlay-put isearch-overlay 'face isearch))))
2247 (overlay-put isearch-overlay 'priority 1) ;higher than lazy overlays
2248 ))))
2249 2249
2250(defun isearch-dehighlight () 2250(defun isearch-dehighlight ()
2251 (when isearch-overlay 2251 (when isearch-overlay
@@ -2409,8 +2409,10 @@ Attempt to do the search exactly the way the pending isearch would."
2409 ;; non-zero-length match 2409 ;; non-zero-length match
2410 (let ((ov (make-overlay mb me))) 2410 (let ((ov (make-overlay mb me)))
2411 (push ov isearch-lazy-highlight-overlays) 2411 (push ov isearch-lazy-highlight-overlays)
2412 ;; 1000 is higher than ediff's 100+,
2413 ;; but lower than isearch main overlay's 1001
2414 (overlay-put ov 'priority 1000)
2412 (overlay-put ov 'face lazy-highlight-face) 2415 (overlay-put ov 'face lazy-highlight-face)
2413 (overlay-put ov 'priority 0) ;lower than main overlay
2414 (overlay-put ov 'window (selected-window)))) 2416 (overlay-put ov 'window (selected-window))))
2415 (if isearch-forward 2417 (if isearch-forward
2416 (setq isearch-lazy-highlight-end (point)) 2418 (setq isearch-lazy-highlight-end (point))
diff --git a/lisp/locate.el b/lisp/locate.el
index 5b61ed522e9..5934a572d4d 100644
--- a/lisp/locate.el
+++ b/lisp/locate.el
@@ -229,7 +229,8 @@ With prefix arg, prompt for the locate command to run."
229 (save-window-excursion 229 (save-window-excursion
230 (set-buffer (get-buffer-create locate-buffer-name)) 230 (set-buffer (get-buffer-create locate-buffer-name))
231 (locate-mode) 231 (locate-mode)
232 (let ((inhibit-read-only t)) 232 (let ((inhibit-read-only t)
233 (buffer-undo-list t))
233 (erase-buffer) 234 (erase-buffer)
234 235
235 (setq locate-current-filter filter) 236 (setq locate-current-filter filter)
diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el
index da5ec4bfda1..0f5aa1e18f7 100644
--- a/lisp/mail/mail-extr.el
+++ b/lisp/mail/mail-extr.el
@@ -699,9 +699,10 @@ Unless NO-REPLACE is true, at each of the positions in LIST-SYMBOL
699;;;###autoload 699;;;###autoload
700(defun mail-extract-address-components (address &optional all) 700(defun mail-extract-address-components (address &optional all)
701 "Given an RFC-822 address ADDRESS, extract full name and canonical address. 701 "Given an RFC-822 address ADDRESS, extract full name and canonical address.
702Returns a list of the form (FULL-NAME CANONICAL-ADDRESS). 702Returns a list of the form (FULL-NAME CANONICAL-ADDRESS). If no
703If no name can be extracted, FULL-NAME will be nil. Also see 703name can be extracted, FULL-NAME will be nil. Also see
704`mail-extr-ignore-single-names' and `mail-extr-ignore-realname-equals-mailbox-name'. 704`mail-extr-ignore-single-names' and
705`mail-extr-ignore-realname-equals-mailbox-name'.
705 706
706If the optional argument ALL is non-nil, then ADDRESS can contain zero 707If the optional argument ALL is non-nil, then ADDRESS can contain zero
707or more recipients, separated by commas, and we return a list of 708or more recipients, separated by commas, and we return a list of
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 0decf2813aa..b45467386ba 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -3155,13 +3155,18 @@ If N is negative, go backwards instead."
3155 search-regexp found) 3155 search-regexp found)
3156 (if (string-match "\\`[ \t]+" subject) 3156 (if (string-match "\\`[ \t]+" subject)
3157 (setq subject (substring subject (match-end 0)))) 3157 (setq subject (substring subject (match-end 0))))
3158 (if (string-match "Re:[ \t]*" subject) 3158 (if (string-match "\\`\\(Re:[ \t]*\\)+" subject)
3159 (setq subject (substring subject (match-end 0)))) 3159 (setq subject (substring subject (match-end 0))))
3160 (if (string-match "[ \t]+\\'" subject) 3160 (if (string-match "[ \t]+\\'" subject)
3161 (setq subject (substring subject 0 (match-beginning 0)))) 3161 (setq subject (substring subject 0 (match-beginning 0))))
3162 (setq search-regexp (concat "^Subject: *\\(Re:[ \t]*\\)?" 3162 ;; If Subject is long, mailers will break it into several lines at
3163 (regexp-quote subject) 3163 ;; arbitrary places, so replace whitespace with a regexp that will
3164 "[ \t]*\n")) 3164 ;; match any sequence of spaces, TABs, and newlines.
3165 (setq subject (regexp-quote subject))
3166 (setq subject
3167 (replace-regexp-in-string "[ \t\n]+" "[ \t\n]+" subject t t))
3168 (setq search-regexp (concat "^Subject: *\\(Re:[ \t]*\\)*"
3169 subject "[ \t]*\n"))
3165 (save-excursion 3170 (save-excursion
3166 (save-restriction 3171 (save-restriction
3167 (widen) 3172 (widen)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 4a4d2172c8b..40e678aa130 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -596,7 +596,10 @@ actually occur.")
596(define-derived-mode mail-mode text-mode "Mail" 596(define-derived-mode mail-mode text-mode "Mail"
597 "Major mode for editing mail to be sent. 597 "Major mode for editing mail to be sent.
598Like Text Mode but with these additional commands: 598Like Text Mode but with these additional commands:
599\\[mail-send] mail-send (send the message) \\[mail-send-and-exit] mail-send-and-exit 599
600\\[mail-send] mail-send (send the message)
601\\[mail-send-and-exit] mail-send-and-exit (send the message and exit)
602
600Here are commands that move to a header field (and create it if there isn't): 603Here are commands that move to a header field (and create it if there isn't):
601 \\[mail-to] move to To: \\[mail-subject] move to Subject: 604 \\[mail-to] move to To: \\[mail-subject] move to Subject:
602 \\[mail-cc] move to CC: \\[mail-bcc] move to BCC: 605 \\[mail-cc] move to CC: \\[mail-bcc] move to BCC:
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 175e32becdf..0eb956981ce 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -605,6 +605,7 @@ This is relative to `smtpmail-queue-dir'.")
605 605
606 ;; clear the trace buffer of old output 606 ;; clear the trace buffer of old output
607 (with-current-buffer process-buffer 607 (with-current-buffer process-buffer
608 (setq buffer-undo-list t)
608 (erase-buffer)) 609 (erase-buffer))
609 610
610 ;; open the connection to the server 611 ;; open the connection to the server
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 64dad08988c..56745d82cc4 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -481,7 +481,7 @@ A large number or nil slows down menu responsiveness."
481 :enable (and (not buffer-read-only) 481 :enable (and (not buffer-read-only)
482 (not (eq t buffer-undo-list)) 482 (not (eq t buffer-undo-list))
483 (if (eq last-command 'undo) 483 (if (eq last-command 'undo)
484 pending-undo-list 484 (listp pending-undo-list)
485 (consp buffer-undo-list))) 485 (consp buffer-undo-list)))
486 :help "Undo last operation")) 486 :help "Undo last operation"))
487 487
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index e88a64f3dc7..dafa37c6b3d 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,12 @@
12005-12-09 Bill Wohler <wohler@newt.com>
2
3 * mh-customize.el (mh-path): Move here from mh-init.el.
4 (mh-variant): Mention that mh-path can be customized.
5 (mh-invisible-header-fields-internal): Add X-ContentStamp,
6 X-MAIL-INFO, and X-UNTD- from NetZero.
7
8 * mh-init.el (mh-path): Move defcustom to mh-customize.el.
9
12005-12-04 Bill Wohler <wohler@newt.com> 102005-12-04 Bill Wohler <wohler@newt.com>
2 11
3 * mh-customize.el (mh-sortm-args): Sync docstrings with manual. 12 * mh-customize.el (mh-sortm-args): Sync docstrings with manual.
diff --git a/lisp/mh-e/mh-customize.el b/lisp/mh-e/mh-customize.el
index 2b834c5913e..49aceae3b61 100644
--- a/lisp/mh-e/mh-customize.el
+++ b/lisp/mh-e/mh-customize.el
@@ -260,15 +260,21 @@ mailutils."
260(eval-when (compile) 260(eval-when (compile)
261 (setq mh-variant 'none)) 261 (setq mh-variant 'none))
262 262
263(defcustom mh-path nil
264 "*Additional list of directories to search for MH.
265See `mh-variant'."
266 :group 'mh-e
267 :type '(repeat (directory)))
268
263(defcustom mh-variant 'autodetect 269(defcustom mh-variant 'autodetect
264 "*Specifies the variant used by MH-E. 270 "*Specifies the variant used by MH-E.
265 271
266The default setting of this option is `Auto-detect' which means that MH-E will 272The default setting of this option is `Auto-detect' which means that MH-E will
267automatically choose the first of nmh, MH, or GNU mailutils that it finds in 273automatically choose the first of nmh, MH, or GNU mailutils that it finds in
268the directories listed in `mh-path', `mh-sys-path', and `exec-path'. If, for 274the directories listed in `mh-path' (which you can customize), `mh-sys-path',
269example, you have both nmh and mailutils installed and `mh-variant-in-use' was 275and `exec-path'. If, for example, you have both nmh and mailutils installed
270initialized to nmh but you want to use mailutils, then you can set this option 276and `mh-variant-in-use' was initialized to nmh but you want to use mailutils,
271to `mailutils'. 277then you can set this option to `mailutils'.
272 278
273When this variable is changed, MH-E resets `mh-progs', `mh-lib', 279When this variable is changed, MH-E resets `mh-progs', `mh-lib',
274`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use' 280`mh-lib-progs', `mh-flists-present-flag', and `mh-variant-in-use'
@@ -1421,6 +1427,7 @@ of citations entirely, choose \"None\"."
1421 "X-Bogosity:" ; bogofilter 1427 "X-Bogosity:" ; bogofilter
1422 "X-Bugzilla-*" ; Bugzilla 1428 "X-Bugzilla-*" ; Bugzilla
1423 "X-Complaints-To:" 1429 "X-Complaints-To:"
1430 "X-ContentStamp:" ; NetZero
1424 "X-Cron-Env:" 1431 "X-Cron-Env:"
1425 "X-DMCA" 1432 "X-DMCA"
1426 "X-Delivered" 1433 "X-Delivered"
@@ -1453,6 +1460,7 @@ of citations entirely, choose \"None\"."
1453 "X-Listprocessor-" ; ListProc(tm) by CREN 1460 "X-Listprocessor-" ; ListProc(tm) by CREN
1454 "X-Listserver:" ; Unknown mailing list managers 1461 "X-Listserver:" ; Unknown mailing list managers
1455 "X-Loop:" ; Unknown mailing list managers 1462 "X-Loop:" ; Unknown mailing list managers
1463 "X-MAIL-INFO:" ; NetZero
1456 "X-MHE-Checksum" ; Checksum added during index search 1464 "X-MHE-Checksum" ; Checksum added during index search
1457 "X-MIME-Autoconverted:" ; sendmail 1465 "X-MIME-Autoconverted:" ; sendmail
1458 "X-MIMETrack:" 1466 "X-MIMETrack:"
@@ -1506,6 +1514,7 @@ of citations entirely, choose \"None\"."
1506 "X-Trace:" 1514 "X-Trace:"
1507 "X-UID" 1515 "X-UID"
1508 "X-UIDL:" 1516 "X-UIDL:"
1517 "X-UNTD-" ; NetZero
1509 "X-USANET-" ; usa.net 1518 "X-USANET-" ; usa.net
1510 "X-UserInfo1:" 1519 "X-UserInfo1:"
1511 "X-Virus-Scanned" ; amavisd-new 1520 "X-Virus-Scanned" ; amavisd-new
diff --git a/lisp/mh-e/mh-init.el b/lisp/mh-e/mh-init.el
index 3ef478fd55f..79f779810e2 100644
--- a/lisp/mh-e/mh-init.el
+++ b/lisp/mh-e/mh-init.el
@@ -73,6 +73,31 @@ This directory contains, among other things, the mhl program.")
73;;;###autoload 73;;;###autoload
74(put 'mh-lib-progs 'risky-local-variable t) 74(put 'mh-lib-progs 'risky-local-variable t)
75 75
76(defvar mh-variants nil
77 "List describing known MH variants.
78Created by the function `mh-variants'")
79
80;;;###mh-autoload
81(defun mh-variants ()
82 "Return a list of installed variants of MH on the system.
83This function looks for MH in `mh-sys-path', `mh-path' and
84`exec-path'. The format of the list of variants that is returned is described
85by the variable `mh-variants'."
86 (if mh-variants
87 mh-variants
88 (let ((list-unique))
89 ;; Make a unique list of directories, keeping the given order.
90 ;; We don't want the same MH variant to be listed multiple times.
91 (loop for dir in (append mh-path mh-sys-path exec-path) do
92 (setq dir (file-chase-links (directory-file-name dir)))
93 (add-to-list 'list-unique dir))
94 (loop for dir in (nreverse list-unique) do
95 (when (and dir (file-directory-p dir) (file-readable-p dir))
96 (let ((variant (mh-variant-info dir)))
97 (if variant
98 (add-to-list 'mh-variants variant)))))
99 mh-variants)))
100
76(defvar mh-variant-in-use nil 101(defvar mh-variant-in-use nil
77 "The MH variant currently in use; a string with variant and version number. 102 "The MH variant currently in use; a string with variant and version number.
78This differs from `mh-variant' when the latter is set to `autodetect'.") 103This differs from `mh-variant' when the latter is set to `autodetect'.")
@@ -171,17 +196,6 @@ The list `exec-path' is searched in addition to this list.
171There's no need for users to modify this list. Instead add extra 196There's no need for users to modify this list. Instead add extra
172directories to the customizable variable `mh-path'.") 197directories to the customizable variable `mh-path'.")
173 198
174(defcustom mh-path nil
175 "*List of directories to search for variants of the MH variant.
176The directories will be searched for `mhparam' in addition to directories
177listed in `mh-sys-path' and `exec-path'."
178 :group 'mh-e
179 :type '(repeat (directory)))
180
181(defvar mh-variants nil
182 "List describing known MH variants.
183Created by the function `mh-variants'")
184
185(defun mh-variant-mh-info (dir) 199(defun mh-variant-mh-info (dir)
186 "Return info for MH variant in DIR assuming a temporary buffer is setup." 200 "Return info for MH variant in DIR assuming a temporary buffer is setup."
187 ;; MH does not have the -version option. 201 ;; MH does not have the -version option.
@@ -281,27 +295,6 @@ This assumes that a temporary buffer is setup."
281 ((mh-variant-nmh-info dir)) 295 ((mh-variant-nmh-info dir))
282 ((mh-variant-mu-mh-info dir)))))) 296 ((mh-variant-mu-mh-info dir))))))
283 297
284;;;###mh-autoload
285(defun mh-variants ()
286 "Return a list of installed variants of MH on the system.
287This function looks for MH in `mh-sys-path', `mh-path' and
288`exec-path'. The format of the list of variants that is returned is described
289by the variable `mh-variants'."
290 (if mh-variants
291 mh-variants
292 (let ((list-unique))
293 ;; Make a unique list of directories, keeping the given order.
294 ;; We don't want the same MH variant to be listed multiple times.
295 (loop for dir in (append mh-path mh-sys-path exec-path) do
296 (setq dir (file-chase-links (directory-file-name dir)))
297 (add-to-list 'list-unique dir))
298 (loop for dir in (nreverse list-unique) do
299 (when (and dir (file-directory-p dir) (file-readable-p dir))
300 (let ((variant (mh-variant-info dir)))
301 (if variant
302 (add-to-list 'mh-variants variant)))))
303 mh-variants)))
304
305 298
306 299
307(defvar mh-image-load-path-called-flag nil) 300(defvar mh-image-load-path-called-flag nil)
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index 1e9f1bce7ce..0f0ff76ed0c 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -775,6 +775,7 @@ clear what alternative to use.
775For interactive use, use `" (symbol-name fun) "' instead.") 775For interactive use, use `" (symbol-name fun) "' instead.")
776 ,interact 776 ,interact
777 ,@body) 777 ,@body)
778 (put ',fun-1 'definition-name ',fun)
778 (defun ,fun () 779 (defun ,fun ()
779 ,(concat line1 "\nWrapper function that switches to a *cvs* buffer 780 ,(concat line1 "\nWrapper function that switches to a *cvs* buffer
780before calling the real function `" (symbol-name fun-1) "'.\n") 781before calling the real function `" (symbol-name fun-1) "'.\n")
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index f6ef6f1e810..aa0fd0c1378 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -436,8 +436,7 @@ ZERO are not used, but are required by the caller."
436If the GUD BUFFER is not running a supported debugger, then turn 436If the GUD BUFFER is not running a supported debugger, then turn
437off the specialized speedbar mode. BUFFER is not used, but are 437off the specialized speedbar mode. BUFFER is not used, but are
438required by the caller." 438required by the caller."
439 (when (and (boundp 'gud-comint-buffer) 439 (when (and gud-comint-buffer
440 gud-comint-buffer
441 ;; gud-comint-buffer might be killed 440 ;; gud-comint-buffer might be killed
442 (buffer-name gud-comint-buffer)) 441 (buffer-name gud-comint-buffer))
443 (let* ((minor-mode (with-current-buffer buffer gud-minor-mode)) 442 (let* ((minor-mode (with-current-buffer buffer gud-minor-mode))
@@ -661,6 +660,11 @@ The directory containing FILE becomes the initial working directory
661and source-file directory for your debugger." 660and source-file directory for your debugger."
662 (interactive (list (gud-query-cmdline 'gdb))) 661 (interactive (list (gud-query-cmdline 'gdb)))
663 662
663 (if (and gud-comint-buffer
664 (buffer-name gud-comint-buffer)
665 (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
666 (error "Multiple debugging is only supported with \"gdb --fullname\""))
667
664 (gud-common-init command-line nil 'gud-gdb-marker-filter) 668 (gud-common-init command-line nil 'gud-gdb-marker-filter)
665 (set (make-local-variable 'gud-minor-mode) 'gdb) 669 (set (make-local-variable 'gud-minor-mode) 'gdb)
666 670
@@ -3217,10 +3221,50 @@ Treats actions as defuns."
3217;;; tooltips for GUD 3221;;; tooltips for GUD
3218 3222
3219;;; Customizable settings 3223;;; Customizable settings
3224
3225;;;###autoload
3226(define-minor-mode gud-tooltip-mode
3227 "Toggle the display of GUD tooltips."
3228 :global t
3229 :group 'gud
3230 :group 'tooltip
3231 (require 'tooltip)
3232 (if gud-tooltip-mode
3233 (progn
3234 (add-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
3235 (add-hook 'pre-command-hook 'tooltip-hide)
3236 (add-hook 'tooltip-hook 'gud-tooltip-tips)
3237 (define-key global-map [mouse-movement] 'gud-tooltip-mouse-motion))
3238 (unless tooltip-mode (remove-hook 'pre-command-hook 'tooltip-hide)
3239 (remove-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
3240 (remove-hook 'tooltip-hook 'gud-tooltip-tips)
3241 (define-key global-map [mouse-movement] 'ignore)))
3242 (gud-tooltip-activate-mouse-motions-if-enabled)
3243 (if (and
3244 gud-comint-buffer
3245 (buffer-name gud-comint-buffer); gud-comint-buffer might be killed
3246 (with-current-buffer gud-comint-buffer
3247 (memq gud-minor-mode '(gdbmi gdba))))
3248 (if gud-tooltip-mode
3249 (progn
3250 (dolist (buffer (buffer-list))
3251 (unless (eq buffer gud-comint-buffer)
3252 (with-current-buffer buffer
3253 (when (and (memq gud-minor-mode '(gdbmi gdba))
3254 (not (string-match "\\`\\*.+\\*\\'"
3255 (buffer-name))))
3256 (make-local-variable 'gdb-define-alist)
3257 (gdb-create-define-alist)
3258 (add-hook 'after-save-hook
3259 'gdb-create-define-alist nil t))))))
3260 (kill-local-variable 'gdb-define-alist)
3261 (remove-hook 'after-save-hook 'gdb-create-define-alist t))))
3262
3220(defcustom gud-tooltip-modes '(gud-mode c-mode c++-mode fortran-mode) 3263(defcustom gud-tooltip-modes '(gud-mode c-mode c++-mode fortran-mode)
3221 "List of modes for which to enable GUD tips." 3264 "List of modes for which to enable GUD tooltips."
3222 :type 'sexp 3265 :type 'sexp
3223 :tag "GUD modes" 3266 :tag "GUD modes"
3267 :group 'gud
3224 :group 'tooltip) 3268 :group 'tooltip)
3225 3269
3226(defcustom gud-tooltip-display 3270(defcustom gud-tooltip-display
@@ -3232,12 +3276,13 @@ Forms in the list are combined with AND. The default is to display
3232only tooltips in the buffer containing the overlay arrow." 3276only tooltips in the buffer containing the overlay arrow."
3233 :type 'sexp 3277 :type 'sexp
3234 :tag "GUD buffers predicate" 3278 :tag "GUD buffers predicate"
3279 :group 'gud
3235 :group 'tooltip) 3280 :group 'tooltip)
3236 3281
3237(defcustom gud-tooltip-echo-area nil 3282(defcustom gud-tooltip-echo-area nil
3238 "Use the echo area instead of frames for GUD tooltips." 3283 "Use the echo area instead of frames for GUD tooltips."
3239 :type 'boolean 3284 :type 'boolean
3240 :tag "Use echo area" 3285 :group 'gud
3241 :group 'tooltip) 3286 :group 'tooltip)
3242 3287
3243(define-obsolete-variable-alias 'tooltip-gud-modes 3288(define-obsolete-variable-alias 'tooltip-gud-modes
@@ -3311,43 +3356,6 @@ This event can be examined by forms in GUD-TOOLTIP-DISPLAY.")
3311(define-obsolete-function-alias 'tooltip-gud-toggle-dereference 3356(define-obsolete-function-alias 'tooltip-gud-toggle-dereference
3312 'toggle-gud-tooltip-dereference "22.1") 3357 'toggle-gud-tooltip-dereference "22.1")
3313 3358
3314;;;###autoload
3315(define-minor-mode gud-tooltip-mode
3316 "Toggle the display of GUD tooltips."
3317 :global t
3318 :group 'gud
3319 (require 'tooltip)
3320 (if gud-tooltip-mode
3321 (progn
3322 (add-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
3323 (add-hook 'pre-command-hook 'tooltip-hide)
3324 (add-hook 'tooltip-hook 'gud-tooltip-tips)
3325 (define-key global-map [mouse-movement] 'gud-tooltip-mouse-motion))
3326 (unless tooltip-mode (remove-hook 'pre-command-hook 'tooltip-hide)
3327 (remove-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode)
3328 (remove-hook 'tooltip-hook 'gud-tooltip-tips)
3329 (define-key global-map [mouse-movement] 'ignore)))
3330 (gud-tooltip-activate-mouse-motions-if-enabled)
3331 (if (and
3332 gud-comint-buffer
3333 (buffer-name gud-comint-buffer); gud-comint-buffer might be kille
3334 (with-current-buffer gud-comint-buffer
3335 (memq gud-minor-mode '(gdbmi gdba))))
3336 (if gud-tooltip-mode
3337 (progn
3338 (dolist (buffer (buffer-list))
3339 (unless (eq buffer gud-comint-buffer)
3340 (with-current-buffer buffer
3341 (when (and (memq gud-minor-mode '(gdbmi gdba))
3342 (not (string-match "\\`\\*.+\\*\\'"
3343 (buffer-name))))
3344 (make-local-variable 'gdb-define-alist)
3345 (gdb-create-define-alist)
3346 (add-hook 'after-save-hook
3347 'gdb-create-define-alist nil t))))))
3348 (kill-local-variable 'gdb-define-alist)
3349 (remove-hook 'after-save-hook 'gdb-create-define-alist t))))
3350
3351; This will only display data that comes in one chunk. 3359; This will only display data that comes in one chunk.
3352; Larger arrays (say 400 elements) are displayed in 3360; Larger arrays (say 400 elements) are displayed in
3353; the tooltip incompletely and spill over into the gud buffer. 3361; the tooltip incompletely and spill over into the gud buffer.
@@ -3384,9 +3392,8 @@ This function must return nil if it doesn't handle EVENT."
3384 (let (process) 3392 (let (process)
3385 (when (and (eventp event) 3393 (when (and (eventp event)
3386 gud-tooltip-mode 3394 gud-tooltip-mode
3387 (boundp 'gud-comint-buffer)
3388 gud-comint-buffer 3395 gud-comint-buffer
3389 (buffer-name gud-comint-buffer); gud-comint-buffer might be killed 3396 (buffer-name gud-comint-buffer); might be killed
3390 (setq process (get-buffer-process gud-comint-buffer)) 3397 (setq process (get-buffer-process gud-comint-buffer))
3391 (posn-point (event-end event)) 3398 (posn-point (event-end event))
3392 (or (and (eq gud-minor-mode 'gdba) (not gdb-active-process)) 3399 (or (and (eq gud-minor-mode 'gdba) (not gdb-active-process))
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el
index 0cda438fa6a..56dac972472 100644
--- a/lisp/progmodes/octave-mod.el
+++ b/lisp/progmodes/octave-mod.el
@@ -1311,7 +1311,8 @@ Maybe expand abbrevs and blink matching block open keywords.
1311Reindent the line of `octave-auto-indent' is non-nil." 1311Reindent the line of `octave-auto-indent' is non-nil."
1312 (interactive) 1312 (interactive)
1313 (setq last-command-char ? ) 1313 (setq last-command-char ? )
1314 (if (not (octave-not-in-string-or-comment-p)) 1314 (if (and octave-auto-indent
1315 (not (octave-not-in-string-or-comment-p)))
1315 (progn 1316 (progn
1316 (indent-according-to-mode) 1317 (indent-according-to-mode)
1317 (self-insert-command 1)) 1318 (self-insert-command 1))
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 287ab3014cb..d92bc92f6ee 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -46,9 +46,9 @@
46(defvar recentf-list nil 46(defvar recentf-list nil
47 "List of recently opened files.") 47 "List of recently opened files.")
48 48
49(defvar recentf-data-cache nil 49(defsubst recentf-enabled-p ()
50 "Cache of data used to build the recentf menu. 50 "Return non-nil if recentf mode is currently enabled."
51The menu is rebuilt when this data has changed.") 51 (memq 'recentf-save-list kill-emacs-hook))
52 52
53;;; Customization 53;;; Customization
54;; 54;;
@@ -111,10 +111,13 @@ remote access."
111(defun recentf-menu-customization-changed (variable value) 111(defun recentf-menu-customization-changed (variable value)
112 "Function called when the recentf menu customization has changed. 112 "Function called when the recentf menu customization has changed.
113Set VARIABLE with VALUE, and force a rebuild of the recentf menu." 113Set VARIABLE with VALUE, and force a rebuild of the recentf menu."
114 (when (featurep 'recentf) 114 (if (and (featurep 'recentf) (recentf-enabled-p))
115 ;; Unavailable until recentf has been loaded. 115 (progn
116 (recentf-clear-data)) 116 ;; Unavailable until recentf has been loaded.
117 (set-default variable value)) 117 (recentf-hide-menu)
118 (set-default variable value)
119 (recentf-show-menu))
120 (set-default variable value)))
118 121
119(defcustom recentf-menu-title "Open Recent" 122(defcustom recentf-menu-title "Open Recent"
120 "*Name of the recentf menu." 123 "*Name of the recentf menu."
@@ -142,14 +145,12 @@ If nil add it at end of menu (see also `easy-menu-add-item')."
142 "*Function to invoke with a filename item of the recentf menu. 145 "*Function to invoke with a filename item of the recentf menu.
143The default is to call `find-file' to edit the selected file." 146The default is to call `find-file' to edit the selected file."
144 :group 'recentf 147 :group 'recentf
145 :type 'function 148 :type 'function)
146 :set 'recentf-menu-customization-changed)
147 149
148(defcustom recentf-max-menu-items 10 150(defcustom recentf-max-menu-items 10
149 "*Maximum number of items in the recentf menu." 151 "*Maximum number of items in the recentf menu."
150 :group 'recentf 152 :group 'recentf
151 :type 'integer 153 :type 'integer)
152 :set 'recentf-menu-customization-changed)
153 154
154(defcustom recentf-menu-filter nil 155(defcustom recentf-menu-filter nil
155 "*Function used to filter files displayed in the recentf menu. 156 "*Function used to filter files displayed in the recentf menu.
@@ -182,7 +183,7 @@ A nil value means no filter. The following functions are predefined:
182- `recentf-arrange-by-dir' 183- `recentf-arrange-by-dir'
183 Show a sub-menu for each directory. 184 Show a sub-menu for each directory.
184- `recentf-filter-changer' 185- `recentf-filter-changer'
185 Manage a ring of filters. 186 Manage a menu of filters.
186 187
187The filter function is called with one argument, the list of menu 188The filter function is called with one argument, the list of menu
188elements used to build the menu and must return a new list of menu 189elements used to build the menu and must return a new list of menu
@@ -203,21 +204,18 @@ elements (see `recentf-make-menu-element' for menu element form)."
203 (function-item recentf-arrange-by-mode) 204 (function-item recentf-arrange-by-mode)
204 (function-item recentf-arrange-by-dir) 205 (function-item recentf-arrange-by-dir)
205 (function-item recentf-filter-changer) 206 (function-item recentf-filter-changer)
206 function) 207 function))
207 :set 'recentf-menu-customization-changed)
208 208
209(defcustom recentf-menu-open-all-flag nil 209(defcustom recentf-menu-open-all-flag nil
210 "*Non-nil means to show an \"All...\" item in the menu. 210 "*Non-nil means to show an \"All...\" item in the menu.
211This item will replace the \"More...\" item." 211This item will replace the \"More...\" item."
212 :group 'recentf 212 :group 'recentf
213 :type 'boolean 213 :type 'boolean)
214 :set 'recentf-menu-customization-changed)
215 214
216(defcustom recentf-menu-append-commands-flag t 215(defcustom recentf-menu-append-commands-flag t
217 "*Non-nil means to append command items to the menu." 216 "*Non-nil means to append command items to the menu."
218 :group 'recentf 217 :group 'recentf
219 :type 'boolean 218 :type 'boolean)
220 :set 'recentf-menu-customization-changed)
221 219
222(define-obsolete-variable-alias 'recentf-menu-append-commands-p 220(define-obsolete-variable-alias 'recentf-menu-append-commands-p
223 'recentf-menu-append-commands-flag 221 'recentf-menu-append-commands-flag
@@ -331,7 +329,7 @@ specifies a maximum number of elements to insert. By default insert
331the full list." 329the full list."
332 (let ((value (symbol-value variable))) 330 (let ((value (symbol-value variable)))
333 (if (atom value) 331 (if (atom value)
334 (insert (format "\n(setq %S %S)\n" variable value)) 332 (insert (format "\n(setq %S '%S)\n" variable value))
335 (when (and (integerp limit) (> limit 0)) 333 (when (and (integerp limit) (> limit 0))
336 (setq value (recentf-trunc-list value limit))) 334 (setq value (recentf-trunc-list value limit)))
337 (insert (format "\n(setq %S\n '(" variable)) 335 (insert (format "\n(setq %S\n '(" variable))
@@ -576,35 +574,40 @@ menu-elements (no sub-menu)."
576;; Count the number of assigned menu shortcuts. 574;; Count the number of assigned menu shortcuts.
577(defvar recentf-menu-shortcuts) 575(defvar recentf-menu-shortcuts)
578 576
579(defun recentf-make-menu-items () 577(defun recentf-make-menu-items (&optional menu)
580 "Make menu items from the recent list." 578 "Make menu items from the recent list.
579This is a menu filter function which ignores the MENU argument."
581 (setq recentf-menu-filter-commands nil) 580 (setq recentf-menu-filter-commands nil)
582 (let* ((recentf-menu-shortcuts 0) 581 (let* ((recentf-menu-shortcuts 0)
583 (file-items 582 (file-items
584 (mapcar 'recentf-make-menu-item 583 (condition-case err
585 (recentf-apply-menu-filter 584 (mapcar 'recentf-make-menu-item
586 recentf-menu-filter 585 (recentf-apply-menu-filter
587 (recentf-menu-elements recentf-max-menu-items))))) 586 recentf-menu-filter
588 (append (or file-items (list ["No files" t 587 (recentf-menu-elements recentf-max-menu-items)))
589 :help "No recent file to open" 588 (error
590 :active nil])) 589 (message "recentf update menu failed: %s"
591 (if recentf-menu-open-all-flag 590 (error-message-string err))))))
592 (list ["All..." recentf-open-files 591 (append
593 :help "Open recent files through a dialog" 592 (or file-items
594 :active t]) 593 '(["No files" t
595 (and (< recentf-max-menu-items (length recentf-list)) 594 :help "No recent file to open"
596 (list ["More..." recentf-open-more-files 595 :active nil]))
597 :help "Open files not in the menu through a dialog" 596 (if recentf-menu-open-all-flag
598 :active t]))) 597 '(["All..." recentf-open-files
599 (and recentf-menu-filter-commands 598 :help "Open recent files through a dialog"
600 (cons "---" 599 :active t])
601 recentf-menu-filter-commands)) 600 (and (< recentf-max-menu-items (length recentf-list))
602 (and recentf-menu-append-commands-flag 601 '(["More..." recentf-open-more-files
603 (cons "---" 602 :help "Open files not in the menu through a dialog"
604 recentf-menu-items-for-commands))))) 603 :active t])))
604 (and recentf-menu-filter-commands '("---"))
605 recentf-menu-filter-commands
606 (and recentf-menu-items-for-commands '("---"))
607 recentf-menu-items-for-commands)))
605 608
606(defun recentf-menu-value-shortcut (name) 609(defun recentf-menu-value-shortcut (name)
607 "Return a shorcut digit for file NAME. 610 "Return a shortcut digit for file NAME.
608Return nil if file NAME is not one of the ten more recent." 611Return nil if file NAME is not one of the ten more recent."
609 (let ((i 0) k) 612 (let ((i 0) k)
610 (while (and (not k) (< i 10)) 613 (while (and (not k) (< i 10))
@@ -639,12 +642,17 @@ Return nil if file NAME is not one of the ten more recent."
639 "Return the keymap of the global menu bar." 642 "Return the keymap of the global menu bar."
640 (lookup-key global-map [menu-bar])) 643 (lookup-key global-map [menu-bar]))
641 644
642(defun recentf-clear-data () 645(defun recentf-show-menu ()
643 "Clear data used to build the recentf menu. 646 "Show the menu of recently opened files."
644This forces a rebuild of the menu." 647 (easy-menu-add-item
645 (easy-menu-remove-item (recentf-menu-bar) 648 (recentf-menu-bar) recentf-menu-path
646 recentf-menu-path recentf-menu-title) 649 (list recentf-menu-title :filter 'recentf-make-menu-items)
647 (setq recentf-data-cache nil)) 650 recentf-menu-before))
651
652(defun recentf-hide-menu ()
653 "Hide the menu of recently opened files."
654 (easy-menu-remove-item (recentf-menu-bar) recentf-menu-path
655 recentf-menu-title))
648 656
649;;; Predefined menu filters 657;;; Predefined menu filters
650;; 658;;
@@ -750,19 +758,24 @@ Filenames are relative to the `default-directory'."
750;; 758;;
751(defcustom recentf-arrange-rules 759(defcustom recentf-arrange-rules
752 '( 760 '(
753 ("Elisp files (%d)" ".\\.el$") 761 ("Elisp files (%d)" ".\\.el\\'")
754 ("Java files (%d)" ".\\.java$") 762 ("Java files (%d)" ".\\.java\\'")
755 ("C/C++ files (%d)" "c\\(pp\\)?$") 763 ("C/C++ files (%d)" "c\\(pp\\)?\\'")
756 ) 764 )
757 "*List of rules used by `recentf-arrange-by-rule' to build sub-menus. 765 "*List of rules used by `recentf-arrange-by-rule' to build sub-menus.
758A rule is a pair (SUB-MENU-TITLE . MATCHER). SUB-MENU-TITLE is the 766A rule is a pair (SUB-MENU-TITLE . MATCHER). SUB-MENU-TITLE is the
759displayed title of the sub-menu where a '%d' `format' pattern is 767displayed title of the sub-menu where a '%d' `format' pattern is
760replaced by the number of items in the sub-menu. MATCHER is a regexp 768replaced by the number of items in the sub-menu. MATCHER is a regexp
761or a list of regexps. Items matching one of the regular expressions in 769or a list of regexps. Items matching one of the regular expressions in
762MATCHER are added to the corresponding sub-menu." 770MATCHER are added to the corresponding sub-menu.
771SUB-MENU-TITLE can be a function. It is passed every items that
772matched the corresponding MATCHER, and it must return a
773pair (SUB-MENU-TITLE . ITEM). SUB-MENU-TITLE is a computed sub-menu
774title that can be another function. ITEM is the received item which
775may have been modified to match another rule."
763 :group 'recentf-filters 776 :group 'recentf-filters
764 :type '(repeat (cons string (repeat regexp))) 777 :type '(repeat (cons (choice string function)
765 :set 'recentf-menu-customization-changed) 778 (repeat regexp))))
766 779
767(defcustom recentf-arrange-by-rule-others "Other files (%d)" 780(defcustom recentf-arrange-by-rule-others "Other files (%d)"
768 "*Title of the `recentf-arrange-by-rule' sub-menu. 781 "*Title of the `recentf-arrange-by-rule' sub-menu.
@@ -772,8 +785,7 @@ displayed in the main recent files menu. A '%d' `format' pattern in
772the title is replaced by the number of items in the sub-menu." 785the title is replaced by the number of items in the sub-menu."
773 :group 'recentf-filters 786 :group 'recentf-filters
774 :type '(choice (const :tag "Main menu" nil) 787 :type '(choice (const :tag "Main menu" nil)
775 (string :tag "Title")) 788 (string :tag "Title")))
776 :set 'recentf-menu-customization-changed)
777 789
778(defcustom recentf-arrange-by-rules-min-items 0 790(defcustom recentf-arrange-by-rules-min-items 0
779 "*Minimum number of items in a `recentf-arrange-by-rule' sub-menu. 791 "*Minimum number of items in a `recentf-arrange-by-rule' sub-menu.
@@ -782,8 +794,7 @@ corresponding sub-menu items are displayed in the main recent files
782menu or in the `recentf-arrange-by-rule-others' sub-menu if 794menu or in the `recentf-arrange-by-rule-others' sub-menu if
783defined." 795defined."
784 :group 'recentf-filters 796 :group 'recentf-filters
785 :type 'number 797 :type 'number)
786 :set 'recentf-menu-customization-changed)
787 798
788(defcustom recentf-arrange-by-rule-subfilter nil 799(defcustom recentf-arrange-by-rule-subfilter nil
789 "*Function called by a rule based filter to filter sub-menu elements. 800 "*Function called by a rule based filter to filter sub-menu elements.
@@ -796,81 +807,82 @@ You can't use another rule based filter here."
796 recentf-arrange-by-mode 807 recentf-arrange-by-mode
797 recentf-arrange-by-dir)) 808 recentf-arrange-by-dir))
798 (error "Recursive use of a rule based filter")) 809 (error "Recursive use of a rule based filter"))
799 (recentf-menu-customization-changed variable value))) 810 (set-default variable value)))
800 811
801(defun recentf-match-rule-p (matcher filename) 812(defun recentf-match-rule (file)
802 "Return non-nil if the rule specified by MATCHER match FILENAME. 813 "Return the rule that match FILE."
803See `recentf-arrange-rules' for details on MATCHER." 814 (let ((rules recentf-arrange-rules)
804 (if (stringp matcher) 815 match found)
805 (string-match matcher filename) 816 (while (and (not found) rules)
806 (while (and (consp matcher) 817 (setq match (cdar rules))
807 (not (string-match (car matcher) filename))) 818 (when (stringp match)
808 (setq matcher (cdr matcher))) 819 (setq match (list match)))
809 matcher)) 820 (while (and match (not (string-match (car match) file)))
821 (setq match (cdr match)))
822 (if match
823 (setq found (cons (caar rules) file))
824 (setq rules (cdr rules))))
825 found))
810 826
811(defun recentf-arrange-by-rule (l) 827(defun recentf-arrange-by-rule (l)
812 "Filter the list of menu-elements L. 828 "Filter the list of menu-elements L.
813Arrange them in sub-menus following rules in `recentf-arrange-rules'." 829Arrange them in sub-menus following rules in `recentf-arrange-rules'."
814 (if (not recentf-arrange-rules) 830 (when recentf-arrange-rules
815 l 831 (let (menus others menu file min count)
816 (let* ((strip (assq t recentf-arrange-rules))
817 (rules (remq strip recentf-arrange-rules))
818 (menus (mapcar #'(lambda (r) (list (car r))) rules))
819 others l1 l2 menu file min count)
820 ;; Put menu items into sub-menus as defined by rules. 832 ;; Put menu items into sub-menus as defined by rules.
821 (dolist (elt l) 833 (dolist (elt l)
822 (setq l1 menus ;; List of sub-menus 834 (setq file (recentf-menu-element-value elt)
823 l2 rules ;; List of corresponding matchers. 835 menu (recentf-match-rule file))
824 file (recentf-menu-element-value elt) 836 (while (functionp (car menu))
825 menu nil) 837 (setq menu (funcall (car menu) (cdr menu))))
826 ;; Apply the strip suffix rule. 838 (if (not (stringp (car menu)))
827 (while (recentf-match-rule-p (cdr strip) file) 839 (push elt others)
828 (setq file (substring file 0 (match-beginning 0)))) 840 (setq menu (or (assoc (car menu) menus)
829 ;; Search which sub-menu to put the menu item into. 841 (car (push (list (car menu)) menus))))
830 (while (and (not menu) l2) 842 (recentf-set-menu-element-value
831 (when (recentf-match-rule-p (cdar l2) file) 843 menu (cons elt (recentf-menu-element-value menu)))))
832 (setq menu (car l1)) 844 ;; Finalize each sub-menu:
833 (recentf-set-menu-element-value
834 menu (cons elt (recentf-menu-element-value menu))))
835 (setq l1 (cdr l1)
836 l2 (cdr l2)))
837 ;; Put unmatched menu items in the `others' bin.
838 (or menu (push elt others)))
839 ;; Finalize the sub-menus. That is, for each one:
840 ;; - truncate it depending on the value of 845 ;; - truncate it depending on the value of
841 ;; `recentf-arrange-by-rules-min-items', 846 ;; `recentf-arrange-by-rules-min-items',
842 ;; - replace %d by the number of menu items, 847 ;; - replace %d by the number of menu items,
843 ;; - apply `recentf-arrange-by-rule-subfilter' to menu items. 848 ;; - apply `recentf-arrange-by-rule-subfilter' to menu items.
844 (setq min (if (natnump recentf-arrange-by-rules-min-items) 849 (setq min (if (natnump recentf-arrange-by-rules-min-items)
845 recentf-arrange-by-rules-min-items 0) 850 recentf-arrange-by-rules-min-items 0)
846 l2 nil) 851 l nil)
847 (dolist (menu menus) 852 (dolist (elt menus)
848 (when (setq l1 (recentf-menu-element-value menu)) 853 (setq menu (recentf-menu-element-value elt)
849 (setq count (length l1)) 854 count (length menu))
850 (if (< count min) 855 (if (< count min)
851 (setq others (nconc l1 others)) 856 (setq others (nconc menu others))
852 (recentf-set-menu-element-item 857 (recentf-set-menu-element-item
853 menu (format (recentf-menu-element-item menu) count)) 858 elt (format (recentf-menu-element-item elt) count))
854 (recentf-set-menu-element-value 859 (recentf-set-menu-element-value
855 menu (recentf-apply-menu-filter 860 elt (recentf-apply-menu-filter
856 recentf-arrange-by-rule-subfilter (nreverse l1))) 861 recentf-arrange-by-rule-subfilter (nreverse menu)))
857 (push menu l2)))) 862 (push elt l)))
858 ;; Add the menu items remaining in the `others' bin. 863 ;; Add the menu items remaining in the `others' bin.
859 (if (and (stringp recentf-arrange-by-rule-others) others) 864 (when (setq others (nreverse others))
860 (nreverse 865 (setq l (nconc
861 (cons 866 l
862 (recentf-make-menu-element 867 ;; Put items in an sub menu.
863 (format recentf-arrange-by-rule-others (length others)) 868 (if (stringp recentf-arrange-by-rule-others)
864 (recentf-apply-menu-filter 869 (list
865 recentf-arrange-by-rule-subfilter (nreverse others))) 870 (recentf-make-menu-element
866 l2)) 871 (format recentf-arrange-by-rule-others
867 (nconc 872 (length others))
868 (nreverse l2) 873 (recentf-apply-menu-filter
869 (recentf-apply-menu-filter 874 recentf-arrange-by-rule-subfilter others)))
870 recentf-arrange-by-rule-subfilter (nreverse others))))))) 875 ;; Append items to the main menu.
876 (recentf-apply-menu-filter
877 recentf-arrange-by-rule-subfilter others)))))))
878 l)
871 879
872;;; Predefined rule based menu filters 880;;; Predefined rule based menu filters
873;; 881;;
882(defun recentf-indirect-mode-rule (file)
883 "Apply a second level `auto-mode-alist' regexp to FILE."
884 (recentf-match-rule (substring file 0 (match-beginning 0))))
885
874(defun recentf-build-mode-rules () 886(defun recentf-build-mode-rules ()
875 "Convert `auto-mode-alist' to menu filter rules. 887 "Convert `auto-mode-alist' to menu filter rules.
876Rules obey `recentf-arrange-rules' format." 888Rules obey `recentf-arrange-rules' format."
@@ -886,7 +898,7 @@ Rules obey `recentf-arrange-rules' format."
886 ;; ignored by the menu filter. So in some corner cases a 898 ;; ignored by the menu filter. So in some corner cases a
887 ;; wrong mode could be guessed. 899 ;; wrong mode could be guessed.
888 ((and (consp mode) (cadr mode)) 900 ((and (consp mode) (cadr mode))
889 (setq rule-name t)) 901 (setq rule-name 'recentf-indirect-mode-rule))
890 ((and mode (symbolp mode)) 902 ((and mode (symbolp mode))
891 (setq rule-name (symbol-name mode)) 903 (setq rule-name (symbol-name mode))
892 (if (string-match "\\(.*\\)-mode$" rule-name) 904 (if (string-match "\\(.*\\)-mode$" rule-name)
@@ -906,21 +918,6 @@ Rules obey `recentf-arrange-rules' format."
906 (recentf-arrange-by-rule-others "others (%d)")) 918 (recentf-arrange-by-rule-others "others (%d)"))
907 (recentf-arrange-by-rule l))) 919 (recentf-arrange-by-rule l)))
908 920
909(defun recentf-build-dir-rules (l)
910 "Convert directories in menu-elements L to menu filter rules.
911Rules obey `recentf-arrange-rules' format."
912 (let (dirs)
913 (mapcar #'(lambda (e)
914 (let ((dir (file-name-directory
915 (recentf-menu-element-value e))))
916 (or (recentf-string-member dir dirs)
917 (push dir dirs))))
918 l)
919 (mapcar #'(lambda (d)
920 (cons (concat d " (%d)")
921 (concat "\\`" d)))
922 (nreverse (sort dirs 'recentf-string-lessp)))))
923
924(defun recentf-file-name-nondir (l) 921(defun recentf-file-name-nondir (l)
925 "Filter the list of menu-elements L to show filenames sans directory. 922 "Filter the list of menu-elements L to show filenames sans directory.
926This simplified version of `recentf-show-basenames' does not handle 923This simplified version of `recentf-show-basenames' does not handle
@@ -932,23 +929,27 @@ duplicates. It is used by `recentf-arrange-by-dir' as its
932 (recentf-menu-element-value e))) 929 (recentf-menu-element-value e)))
933 l)) 930 l))
934 931
932(defun recentf-dir-rule (file)
933 "Return as a sub-menu, the directory FILE belongs to."
934 (cons (file-name-directory file) file))
935
935(defun recentf-arrange-by-dir (l) 936(defun recentf-arrange-by-dir (l)
936 "Split the list of menu-elements L into sub-menus by directory." 937 "Split the list of menu-elements L into sub-menus by directory."
937 (let ((recentf-arrange-rules (recentf-build-dir-rules l)) 938 (let ((recentf-arrange-rules '((recentf-dir-rule . ".*")))
938 (recentf-arrange-by-rule-subfilter 'recentf-file-name-nondir) 939 (recentf-arrange-by-rule-subfilter 'recentf-file-name-nondir)
939 recentf-arrange-by-rule-others) 940 recentf-arrange-by-rule-others)
940 (nreverse (recentf-arrange-by-rule l)))) 941 (recentf-arrange-by-rule l)))
941 942
942;;; Ring of menu filters 943;;; Menu of menu filters
943;; 944;;
944(defvar recentf-filter-changer-state nil 945(defvar recentf-filter-changer-current nil
945 "Used by `recentf-filter-changer' to hold its state.") 946 "Current filter used by `recentf-filter-changer'.")
946 947
947(defcustom recentf-filter-changer-alist 948(defcustom recentf-filter-changer-alist
948 '( 949 '(
949 (recentf-arrange-by-mode . "*Files by Mode*") 950 (recentf-arrange-by-mode . "Grouped by Mode")
950 (recentf-arrange-by-dir . "*Files by Directory*") 951 (recentf-arrange-by-dir . "Grouped by Directory")
951 (recentf-arrange-by-rule . "*Files by User Rule*") 952 (recentf-arrange-by-rule . "Grouped by Custom Rules")
952 ) 953 )
953 "*List of filters managed by `recentf-filter-changer'. 954 "*List of filters managed by `recentf-filter-changer'.
954Each filter is defined by a pair (FUNCTION . LABEL), where FUNCTION is 955Each filter is defined by a pair (FUNCTION . LABEL), where FUNCTION is
@@ -957,50 +958,38 @@ that filter."
957 :group 'recentf-filters 958 :group 'recentf-filters
958 :type '(repeat (cons function string)) 959 :type '(repeat (cons function string))
959 :set (lambda (variable value) 960 :set (lambda (variable value)
960 (setq recentf-filter-changer-state nil) 961 (setq recentf-filter-changer-current nil)
961 (recentf-menu-customization-changed variable value))) 962 (set-default variable value)))
962
963(defun recentf-filter-changer-goto-next ()
964 "Go to the next filter available.
965See `recentf-filter-changer'."
966 (setq recentf-filter-changer-state (cdr recentf-filter-changer-state))
967 (recentf-clear-data))
968 963
969(defsubst recentf-filter-changer-get-current () 964(defun recentf-filter-changer-select (filter)
970 "Get the current filter available. 965 "Select FILTER as the current menu filter.
971See `recentf-filter-changer'." 966See `recentf-filter-changer'."
972 (unless recentf-filter-changer-state 967 (setq recentf-filter-changer-current filter))
973 (setq recentf-filter-changer-state recentf-filter-changer-alist))
974 (car recentf-filter-changer-state))
975
976(defsubst recentf-filter-changer-get-next ()
977 "Get the next filter available.
978See `recentf-filter-changer'."
979 ;; At this point the current filter is the first element of
980 ;; `recentf-filter-changer-state'.
981 (car (or (cdr recentf-filter-changer-state)
982 ;; There is no next element in
983 ;; `recentf-filter-changer-state', so loop back to the
984 ;; first element of `recentf-filter-changer-alist'.
985 recentf-filter-changer-alist)))
986 968
987(defun recentf-filter-changer (l) 969(defun recentf-filter-changer (l)
988 "Manage a ring of menu filters. 970 "Manage a sub-menu of menu filters.
989`recentf-filter-changer-alist' defines the filters in the ring. 971`recentf-filter-changer-alist' defines the filters in the menu.
990Filtering of L is delegated to the current filter in the ring. A 972Filtering of L is delegated to the selected filter in the menu."
991filter menu item is displayed allowing to dynamically activate the 973 (unless recentf-filter-changer-current
992next filter in the ring. If the filter ring is empty, L is left 974 (setq recentf-filter-changer-current
993unchanged." 975 (caar recentf-filter-changer-alist)))
994 (let ((filter (recentf-filter-changer-get-current))) 976 (if (not recentf-filter-changer-current)
995 (when filter 977 l
996 (setq l (recentf-apply-menu-filter (car filter) l) 978 (setq recentf-menu-filter-commands
997 filter (recentf-filter-changer-get-next)) 979 (list
998 (when filter 980 `("Show files"
999 (setq recentf-menu-filter-commands 981 ,@(mapcar
1000 (list (vector (cdr filter) 982 #'(lambda (f)
1001 '(recentf-filter-changer-goto-next) 983 `[,(cdr f)
1002 t))))) 984 (setq recentf-filter-changer-current ',(car f))
1003 l)) 985 ;;:active t
986 :style radio ;;radio Don't work with GTK :-(
987 :selected (eq recentf-filter-changer-current
988 ',(car f))
989 ;;:help ,(cdr f)
990 ])
991 recentf-filter-changer-alist))))
992 (recentf-apply-menu-filter recentf-filter-changer-current l)))
1004 993
1005;;; Hooks 994;;; Hooks
1006;; 995;;
@@ -1017,35 +1006,14 @@ That is, remove a non kept file from the recent list."
1017 (and buffer-file-name 1006 (and buffer-file-name
1018 (recentf-remove-if-non-kept buffer-file-name))) 1007 (recentf-remove-if-non-kept buffer-file-name)))
1019 1008
1020(defun recentf-update-menu ()
1021 "Update the recentf menu from the current recent list."
1022 (let ((cache (cons default-directory recentf-list)))
1023 ;; Does nothing, if nothing has changed.
1024 (unless (equal recentf-data-cache cache)
1025 (setq recentf-data-cache cache)
1026 (condition-case err
1027 (easy-menu-add-item
1028 (recentf-menu-bar) recentf-menu-path
1029 (easy-menu-create-menu recentf-menu-title
1030 (recentf-make-menu-items))
1031 recentf-menu-before)
1032 (error
1033 (message "recentf update menu failed: %s"
1034 (error-message-string err)))))))
1035
1036(defconst recentf-used-hooks 1009(defconst recentf-used-hooks
1037 '( 1010 '(
1038 (find-file-hook recentf-track-opened-file) 1011 (find-file-hook recentf-track-opened-file)
1039 (write-file-functions recentf-track-opened-file) 1012 (write-file-functions recentf-track-opened-file)
1040 (kill-buffer-hook recentf-track-closed-file) 1013 (kill-buffer-hook recentf-track-closed-file)
1041 (menu-bar-update-hook recentf-update-menu)
1042 (kill-emacs-hook recentf-save-list) 1014 (kill-emacs-hook recentf-save-list)
1043 ) 1015 )
1044 "Hooks used by recentf.") 1016 "Hooks used by recentf.")
1045
1046(defsubst recentf-enabled-p ()
1047 "Return non-nil if recentf mode is currently enabled."
1048 (memq 'recentf-update-menu menu-bar-update-hook))
1049 1017
1050;;; Commands 1018;;; Commands
1051;; 1019;;
@@ -1126,8 +1094,7 @@ IGNORE arguments."
1126 (setq recentf-list (delq e recentf-list) 1094 (setq recentf-list (delq e recentf-list)
1127 i (1+ i))) 1095 i (1+ i)))
1128 (kill-buffer (current-buffer)) 1096 (kill-buffer (current-buffer))
1129 (message "%S file(s) removed from the list" i) 1097 (message "%S file(s) removed from the list" i))
1130 (recentf-clear-data))
1131 (message "No file selected"))) 1098 (message "No file selected")))
1132 1099
1133(defun recentf-edit-list () 1100(defun recentf-edit-list ()
@@ -1292,7 +1259,7 @@ Write data into the file specified by `recentf-save-file'."
1292 (set-buffer-file-coding-system recentf-save-file-coding-system) 1259 (set-buffer-file-coding-system recentf-save-file-coding-system)
1293 (insert (format recentf-save-file-header (current-time-string))) 1260 (insert (format recentf-save-file-header (current-time-string)))
1294 (recentf-dump-variable 'recentf-list recentf-max-saved-items) 1261 (recentf-dump-variable 'recentf-list recentf-max-saved-items)
1295 (recentf-dump-variable 'recentf-filter-changer-state) 1262 (recentf-dump-variable 'recentf-filter-changer-current)
1296 (insert "\n \n;;; Local Variables:\n" 1263 (insert "\n \n;;; Local Variables:\n"
1297 (format ";;; coding: %s\n" recentf-save-file-coding-system) 1264 (format ";;; coding: %s\n" recentf-save-file-coding-system)
1298 ";;; End:\n") 1265 ";;; End:\n")
@@ -1354,10 +1321,12 @@ that were operated on recently.
1354 :keymap recentf-mode-map 1321 :keymap recentf-mode-map
1355 (unless (and recentf-mode (recentf-enabled-p)) 1322 (unless (and recentf-mode (recentf-enabled-p))
1356 (if recentf-mode 1323 (if recentf-mode
1357 (recentf-load-list) 1324 (progn
1325 (recentf-load-list)
1326 (recentf-show-menu))
1327 (recentf-hide-menu)
1358 (recentf-save-list)) 1328 (recentf-save-list))
1359 (recentf-auto-cleanup) 1329 (recentf-auto-cleanup)
1360 (recentf-clear-data)
1361 (let ((hook-setup (if recentf-mode 'add-hook 'remove-hook))) 1330 (let ((hook-setup (if recentf-mode 'add-hook 'remove-hook)))
1362 (dolist (hook recentf-used-hooks) 1331 (dolist (hook recentf-used-hooks)
1363 (apply hook-setup hook))) 1332 (apply hook-setup hook)))
diff --git a/lisp/replace.el b/lisp/replace.el
index fbfa1be09c2..8229eda85a4 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1710,7 +1710,7 @@ make, or the user didn't cancel the call."
1710 (if replace-overlay 1710 (if replace-overlay
1711 (move-overlay replace-overlay match-beg match-end (current-buffer)) 1711 (move-overlay replace-overlay match-beg match-end (current-buffer))
1712 (setq replace-overlay (make-overlay match-beg match-end)) 1712 (setq replace-overlay (make-overlay match-beg match-end))
1713 (overlay-put replace-overlay 'priority 1) ;higher than lazy overlays 1713 (overlay-put replace-overlay 'priority 1001) ;higher than lazy overlays
1714 (overlay-put replace-overlay 'face 'query-replace))) 1714 (overlay-put replace-overlay 'face 'query-replace)))
1715 (if query-replace-lazy-highlight 1715 (if query-replace-lazy-highlight
1716 (let ((isearch-string string) 1716 (let ((isearch-string string)
diff --git a/lisp/simple.el b/lisp/simple.el
index 580b5fef38c..2b0645b5a6d 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2745,6 +2745,8 @@ and KILLP is t if a prefix arg was specified."
2745Case is ignored if `case-fold-search' is non-nil in the current buffer. 2745Case is ignored if `case-fold-search' is non-nil in the current buffer.
2746Goes backward if ARG is negative; error if CHAR not found." 2746Goes backward if ARG is negative; error if CHAR not found."
2747 (interactive "p\ncZap to char: ") 2747 (interactive "p\ncZap to char: ")
2748 (if (char-table-p translation-table-for-input)
2749 (setq char (or (aref translation-table-for-input char) char)))
2748 (kill-region (point) (progn 2750 (kill-region (point) (progn
2749 (search-forward (char-to-string char) nil nil arg) 2751 (search-forward (char-to-string char) nil nil arg)
2750; (goto-char (if (> arg 0) (1- (point)) (1+ (point)))) 2752; (goto-char (if (> arg 0) (1- (point)) (1+ (point))))
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 66a633d6f36..c4ccc9588ed 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -76,10 +76,12 @@
76(require 'menu-bar) 76(require 'menu-bar)
77(require 'fontset) 77(require 'fontset)
78(require 'dnd) 78(require 'dnd)
79(eval-when-compile (require 'url))
79 80
80(defvar mac-charset-info-alist) 81(defvar mac-charset-info-alist)
81(defvar mac-services-selection) 82(defvar mac-services-selection)
82(defvar mac-system-script-code) 83(defvar mac-system-script-code)
84(defvar mac-apple-event-map)
83(defvar x-invocation-args) 85(defvar x-invocation-args)
84 86
85(defvar x-command-line-resources nil) 87(defvar x-command-line-resources nil)
@@ -1148,7 +1150,7 @@ correspoinding TextEncodingBase value."
1148 1150
1149(define-key special-event-map [language-change] 'mac-handle-language-change) 1151(define-key special-event-map [language-change] 'mac-handle-language-change)
1150 1152
1151;;;; Selections and Services menu 1153;;;; Selections
1152 1154
1153;; Setup to use the Mac clipboard. 1155;; Setup to use the Mac clipboard.
1154(set-selection-coding-system mac-system-coding-system) 1156(set-selection-coding-system mac-system-coding-system)
@@ -1386,6 +1388,157 @@ in `selection-converter-alist', which see."
1386 (public.file-url . mac-select-convert-to-file-url) 1388 (public.file-url . mac-select-convert-to-file-url)
1387 ) 1389 )
1388 selection-converter-alist)) 1390 selection-converter-alist))
1391
1392;;;; Apple events, HICommand events, and Services menu
1393
1394;;; Event classes
1395(put 'core-event 'mac-apple-event-class "aevt") ; kCoreEventClass
1396(put 'internet-event 'mac-apple-event-class "GURL") ; kAEInternetEventClass
1397
1398;;; Event IDs
1399;; kCoreEventClass
1400(put 'open-application 'mac-apple-event-id "oapp") ; kAEOpenApplication
1401(put 'reopen-application 'mac-apple-event-id "rapp") ; kAEReopenApplication
1402(put 'open-documents 'mac-apple-event-id "odoc") ; kAEOpenDocuments
1403(put 'print-documents 'mac-apple-event-id "pdoc") ; kAEPrintDocuments
1404(put 'open-contents 'mac-apple-event-id "ocon") ; kAEOpenContents
1405(put 'quit-application 'mac-apple-event-id "quit") ; kAEQuitApplication
1406(put 'application-died 'mac-apple-event-id "obit") ; kAEApplicationDied
1407(put 'show-preferences 'mac-apple-event-id "pref") ; kAEShowPreferences
1408(put 'autosave-now 'mac-apple-event-id "asav") ; kAEAutosaveNow
1409;; kAEInternetEventClass
1410(put 'get-url 'mac-apple-event-id "GURL") ; kAEGetURL
1411;; Converted HICommand events
1412(put 'about 'mac-apple-event-id "abou") ; kHICommandAbout
1413
1414(defmacro mac-event-spec (event)
1415 `(nth 1 ,event))
1416
1417(defmacro mac-event-ae (event)
1418 `(nth 2 ,event))
1419
1420(defun mac-ae-parameter (ae &optional keyword type)
1421 (or keyword (setq keyword "----")) ;; Direct object.
1422 (if (not (and (consp ae) (equal (car ae) "aevt")))
1423 (error "Not an Apple event: %S" ae)
1424 (let ((type-data (cdr (assoc keyword (cdr ae))))
1425 data)
1426 (when (and type type-data)
1427 (setq data (mac-coerce-ae-data (car type-data) (cdr type-data) type))
1428 (setq type-data (if data (cons type data) nil)))
1429 type-data)))
1430
1431(defun mac-ae-list (ae &optional keyword type)
1432 (or keyword (setq keyword "----")) ;; Direct object.
1433 (let ((desc (mac-ae-parameter ae keyword)))
1434 (cond ((null desc)
1435 nil)
1436 ((not (equal (car desc) "list"))
1437 (error "Parameter for \"%s\" is not a list" keyword))
1438 (t
1439 (if (null type)
1440 (cdr desc)
1441 (mapcar
1442 (lambda (type-data)
1443 (mac-coerce-ae-data (car type-data) (cdr type-data) type))
1444 (cdr desc)))))))
1445
1446(defun mac-bytes-to-integer (bytes &optional from to)
1447 (or from (setq from 0))
1448 (or to (setq to (length bytes)))
1449 (let* ((len (- to from))
1450 (extended-sign-len (- (1+ (ceiling (log most-positive-fixnum 2)))
1451 (* 8 len)))
1452 (result 0))
1453 (dotimes (i len)
1454 (setq result (logior (lsh result 8)
1455 (aref bytes (+ from (if (eq (byteorder) ?B) i
1456 (- len i 1)))))))
1457 (if (> extended-sign-len 0)
1458 (ash (lsh result extended-sign-len) (- extended-sign-len))
1459 result)))
1460
1461(defun mac-ae-selection-range (ae)
1462;; #pragma options align=mac68k
1463;; typedef struct SelectionRange {
1464;; short unused1; // 0 (not used)
1465;; short lineNum; // line to select (<0 to specify range)
1466;; long startRange; // start of selection range (if line < 0)
1467;; long endRange; // end of selection range (if line < 0)
1468;; long unused2; // 0 (not used)
1469;; long theDate; // modification date/time
1470;; } SelectionRange;
1471;; #pragma options align=reset
1472 (let ((range-bytes (cdr (mac-ae-parameter ae "kpos" "TEXT"))))
1473 (and range-bytes
1474 (list (mac-bytes-to-integer range-bytes 2 4)
1475 (mac-bytes-to-integer range-bytes 4 8)
1476 (mac-bytes-to-integer range-bytes 8 12)
1477 (mac-bytes-to-integer range-bytes 16 20)))))
1478
1479;; On Mac OS X 10.4 and later, the `open-document' event contains an
1480;; optional parameter keyAESearchText from the Spotlight search.
1481(defun mac-ae-text-for-search (ae)
1482 (let ((utf8-text (cdr (mac-ae-parameter ae "stxt" "utf8"))))
1483 (and utf8-text
1484 (decode-coding-string utf8-text 'utf-8))))
1485
1486(defun mac-ae-open-documents (event)
1487 (interactive "e")
1488 (let ((ae (mac-event-ae event)))
1489 (dolist (file-name (mac-ae-list ae nil 'undecoded-file-name))
1490 (if file-name
1491 (dnd-open-local-file (concat "file:" file-name) nil)))
1492 (let ((selection-range (mac-ae-selection-range ae))
1493 (search-text (mac-ae-text-for-search ae)))
1494 (cond (selection-range
1495 (let ((line (car selection-range))
1496 (start (cadr selection-range))
1497 (end (nth 2 selection-range)))
1498 (if (> line 0)
1499 (goto-line line)
1500 (if (and (> start 0) (> end 0))
1501 (progn (set-mark start)
1502 (goto-char end))))))
1503 ((stringp search-text)
1504 (re-search-forward
1505 (mapconcat 'regexp-quote (split-string search-text) "\\|")
1506 nil t)))))
1507 (raise-frame))
1508
1509(defun mac-ae-text (ae)
1510 (or (cdr (mac-ae-parameter ae nil "TEXT"))
1511 (error "No text in Apple event.")))
1512
1513(defun mac-ae-get-url (event)
1514 (interactive "e")
1515 (let* ((ae (mac-event-ae event))
1516 (parsed-url (url-generic-parse-url (mac-ae-text ae))))
1517 (if (string= (url-type parsed-url) "mailto")
1518 (url-mailto parsed-url)
1519 (error "Unsupported URL scheme: %s" (url-type parsed-url)))))
1520
1521(setq mac-apple-event-map (make-sparse-keymap))
1522
1523;; Received when Emacs is launched without associated documents.
1524;; Accept it as an Apple event, but no Emacs event is generated so as
1525;; not to erase the splash screen.
1526(define-key mac-apple-event-map [core-event open-application] 0)
1527
1528;; Received when a dock or application icon is clicked and Emacs is
1529;; already running. Simply ignored. Another idea is to make a new
1530;; frame if all frames are invisible.
1531(define-key mac-apple-event-map [core-event reopen-application] 'ignore)
1532
1533(define-key mac-apple-event-map [core-event open-documents]
1534 'mac-ae-open-documents)
1535(define-key mac-apple-event-map [core-event show-preferences] 'customize)
1536(define-key mac-apple-event-map [core-event quit-application]
1537 'save-buffers-kill-emacs)
1538
1539(define-key mac-apple-event-map [internet-event get-url] 'mac-ae-get-url)
1540
1541(define-key mac-apple-event-map [hicommand about] 'display-splash-screen)
1389 1542
1390(defun mac-services-open-file () 1543(defun mac-services-open-file ()
1391 (interactive) 1544 (interactive)
@@ -1420,21 +1573,35 @@ in `selection-converter-alist', which see."
1420 (substitute-command-keys 1573 (substitute-command-keys
1421 "The text from the Services menu can be accessed with \\[yank]"))))) 1574 "The text from the Services menu can be accessed with \\[yank]")))))
1422 1575
1423(defvar mac-application-menu-map (make-sparse-keymap)) 1576(define-key mac-apple-event-map [services paste] 'mac-services-insert-text)
1424(define-key mac-application-menu-map [quit] 'save-buffers-kill-emacs) 1577(define-key mac-apple-event-map [services perform open-file]
1425(define-key mac-application-menu-map [services perform open-file]
1426 'mac-services-open-file) 1578 'mac-services-open-file)
1427(define-key mac-application-menu-map [services perform open-selection] 1579(define-key mac-apple-event-map [services perform open-selection]
1428 'mac-services-open-selection) 1580 'mac-services-open-selection)
1429(define-key mac-application-menu-map [services perform mail-selection] 1581(define-key mac-apple-event-map [services perform mail-selection]
1430 'mac-services-mail-selection) 1582 'mac-services-mail-selection)
1431(define-key mac-application-menu-map [services perform mail-to] 1583(define-key mac-apple-event-map [services perform mail-to]
1432 'mac-services-mail-to) 1584 'mac-services-mail-to)
1433(define-key mac-application-menu-map [services paste] 1585
1434 'mac-services-insert-text) 1586(defun mac-dispatch-apple-event (event)
1435(define-key mac-application-menu-map [preferences] 'customize) 1587 (interactive "e")
1436(define-key mac-application-menu-map [about] 'display-splash-screen) 1588 (let* ((binding (lookup-key mac-apple-event-map (mac-event-spec event)))
1437(global-set-key [menu-bar application] mac-application-menu-map) 1589 (service-message
1590 (and (keymapp binding)
1591 (cdr (mac-ae-parameter (mac-event-ae event) "svmg")))))
1592 (when service-message
1593 (setq service-message
1594 (intern (decode-coding-string service-message 'utf-8)))
1595 (setq binding (lookup-key binding (vector service-message))))
1596 (call-interactively binding)))
1597
1598(global-set-key [mac-apple-event] 'mac-dispatch-apple-event)
1599
1600;; Processing of Apple events are deferred at the startup time. For
1601;; example, files dropped onto the Emacs application icon can only be
1602;; processed when the initial frame has been created: this is where
1603;; the files should be opened.
1604(add-hook 'after-init-hook 'mac-process-deferred-apple-events)
1438 1605
1439;;; Do the actual Windows setup here; the above code just defines 1606;;; Do the actual Windows setup here; the above code just defines
1440;;; functions and variables that we use now. 1607;;; functions and variables that we use now.
@@ -1855,31 +2022,12 @@ Switch to a buffer editing the last file dropped."
1855 (y (cdr coords))) 2022 (y (cdr coords)))
1856 (if (and (> x 0) (> y 0)) 2023 (if (and (> x 0) (> y 0))
1857 (set-frame-selected-window nil window)) 2024 (set-frame-selected-window nil window))
1858 (mapcar (lambda (file-name) 2025 (dolist (file-name (nth 2 event))
1859 (if (listp file-name) 2026 (dnd-handle-one-url window 'private
1860 (let ((line (car file-name)) 2027 (concat "file:" file-name))))
1861 (start (car (cdr file-name)))
1862 (end (car (cdr (cdr file-name)))))
1863 (if (> line 0)
1864 (goto-line line)
1865 (if (and (> start 0) (> end 0))
1866 (progn (set-mark start)
1867 (goto-char end)))))
1868 (dnd-handle-one-url window 'private
1869 (concat "file:" file-name))))
1870 (car (cdr (cdr event)))))
1871 (raise-frame)) 2028 (raise-frame))
1872 2029
1873(global-set-key [drag-n-drop] 'mac-drag-n-drop) 2030(global-set-key [drag-n-drop] 'mac-drag-n-drop)
1874
1875;; By checking whether the variable mac-ready-for-drag-n-drop has been
1876;; defined, the event loop in macterm.c can be informed that it can
1877;; now receive Finder drag and drop events. Files dropped onto the
1878;; Emacs application icon can only be processed when the initial frame
1879;; has been created: this is where the files should be opened.
1880(add-hook 'after-init-hook
1881 '(lambda ()
1882 (defvar mac-ready-for-drag-n-drop t)))
1883 2031
1884;;;; Non-toolkit Scroll bars 2032;;;; Non-toolkit Scroll bars
1885 2033
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 99bcc621765..9e81c224855 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -2307,11 +2307,13 @@ otherwise it is displayed normally.
2307 2307
2308The variable `ispell-highlight-face' selects the face to use for highlighting." 2308The variable `ispell-highlight-face' selects the face to use for highlighting."
2309 (if highlight 2309 (if highlight
2310 (progn 2310 (if ispell-overlay
2311 (move-overlay ispell-overlay start end (current-buffer))
2311 (setq ispell-overlay (make-overlay start end)) 2312 (setq ispell-overlay (make-overlay start end))
2312 (overlay-put ispell-overlay 'priority 1) ;higher than lazy overlays 2313 (overlay-put ispell-overlay 'priority 1001) ;higher than lazy overlays
2313 (overlay-put ispell-overlay 'face ispell-highlight-face)) 2314 (overlay-put ispell-overlay 'face ispell-highlight-face))
2314 (delete-overlay ispell-overlay)) 2315 (if ispell-overlay
2316 (delete-overlay ispell-overlay)))
2315 (if (and ispell-lazy-highlight (boundp 'lazy-highlight-cleanup)) 2317 (if (and ispell-lazy-highlight (boundp 'lazy-highlight-cleanup))
2316 (if highlight 2318 (if highlight
2317 (let ((isearch-string 2319 (let ((isearch-string
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index 6d2db55654d..47d6464da19 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 6;; Keywords: outlines, hypermedia, calendar
7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ 7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
8;; Version: 3.22 8;; Version: 3.23
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -82,6 +82,10 @@
82;; 82;;
83;; Changes: 83;; Changes:
84;; ------- 84;; -------
85;; Version 3.23
86;; - M-RET makes new items as well as new headings.
87;; - Various small bug fixes
88;;
85;; Version 3.22 89;; Version 3.22
86;; - CamelCase words link to other locations in the same file. 90;; - CamelCase words link to other locations in the same file.
87;; - File links accept search options, to link to specific locations. 91;; - File links accept search options, to link to specific locations.
@@ -253,7 +257,7 @@
253 257
254;;; Customization variables 258;;; Customization variables
255 259
256(defvar org-version "3.22" 260(defvar org-version "3.23"
257 "The version number of the file org.el.") 261 "The version number of the file org.el.")
258(defun org-version () 262(defun org-version ()
259 (interactive) 263 (interactive)
@@ -2530,22 +2534,39 @@ or nil."
2530(defvar org-ignore-region nil 2534(defvar org-ignore-region nil
2531 "To temporarily disable the active region.") 2535 "To temporarily disable the active region.")
2532 2536
2533(defun org-insert-heading () 2537(defun org-insert-heading (&optional force-heading)
2534 "Insert a new heading with same depth at point." 2538 "Insert a new heading or item with same depth at point.
2535 (interactive) 2539If ARG is non-nil"
2536 (let* ((head (save-excursion 2540 (interactive "P")
2537 (condition-case nil 2541 (when (or force-heading (not (org-insert-item)))
2538 (org-back-to-heading) 2542 (let* ((head (save-excursion
2539 (error (outline-next-heading))) 2543 (condition-case nil
2540 (prog1 (match-string 0) 2544 (org-back-to-heading)
2541 (funcall outline-level))))) 2545 (error (outline-next-heading)))
2546 (prog1 (match-string 0)
2547 (funcall outline-level)))))
2548 (unless (bolp) (newline))
2549 (insert head)
2550 (unless (eolp)
2551 (save-excursion (newline-and-indent)))
2552 (unless (equal (char-before) ?\ )
2553 (insert " "))
2554 (run-hooks 'org-insert-heading-hook))))
2555
2556(defun org-insert-item ()
2557 "Insert a new item at the current level.
2558Return t when tings worked, nil when we are not in an item."
2559 (when (save-excursion
2560 (condition-case nil
2561 (progn
2562 (org-beginning-of-item)
2563 (org-at-item-p)
2564 t)
2565 (error nil)))
2542 (unless (bolp) (newline)) 2566 (unless (bolp) (newline))
2543 (insert head) 2567 (insert (match-string 0))
2544 (unless (eolp) 2568 (org-maybe-renumber-ordered-list)
2545 (save-excursion (newline-and-indent))) 2569 t))
2546 (unless (equal (char-before) ?\ )
2547 (insert " "))
2548 (run-hooks 'org-insert-heading-hook)))
2549 2570
2550(defun org-insert-todo-heading (arg) 2571(defun org-insert-todo-heading (arg)
2551 "Insert a new heading with the same level and TODO state as current heading. 2572 "Insert a new heading with the same level and TODO state as current heading.
@@ -3034,8 +3055,9 @@ with something like \"1.\" or \"2)\"."
3034 (beginning-of-line 0) 3055 (beginning-of-line 0)
3035 (if (looking-at "[ \t]*$") (throw 'next t)) 3056 (if (looking-at "[ \t]*$") (throw 'next t))
3036 (skip-chars-forward " \t") (setq ind1 (current-column)) 3057 (skip-chars-forward " \t") (setq ind1 (current-column))
3037 (if (and (<= ind1 ind) 3058 (if (or (< ind1 ind)
3038 (not (org-at-item-p))) 3059 (and (= ind1 ind)
3060 (not (org-at-item-p))))
3039 (throw 'exit t))))) 3061 (throw 'exit t)))))
3040 ;; Walk forward and replace these numbers 3062 ;; Walk forward and replace these numbers
3041 (catch 'exit 3063 (catch 'exit
@@ -3055,7 +3077,7 @@ with something like \"1.\" or \"2)\"."
3055 (insert (format "%d" (setq n (1+ n))))))) 3077 (insert (format "%d" (setq n (1+ n)))))))
3056 (goto-line line) 3078 (goto-line line)
3057 (move-to-column col))) 3079 (move-to-column col)))
3058 3080
3059(defvar org-last-indent-begin-marker (make-marker)) 3081(defvar org-last-indent-begin-marker (make-marker))
3060(defvar org-last-indent-end-marker (make-marker)) 3082(defvar org-last-indent-end-marker (make-marker))
3061 3083
@@ -3422,9 +3444,10 @@ that the match should indeed be shown."
3422 (save-match-data (funcall callback))) 3444 (save-match-data (funcall callback)))
3423 (setq cnt (1+ cnt)) 3445 (setq cnt (1+ cnt))
3424 (org-highlight-new-match (match-beginning 0) (match-end 0)) 3446 (org-highlight-new-match (match-beginning 0) (match-end 0))
3425 (add-hook 'before-change-functions 'org-remove-occur-highlights
3426 nil 'local)
3427 (org-show-hierarchy-above)))) 3447 (org-show-hierarchy-above))))
3448 (make-local-hook 'before-change-functions) ; needed for XEmacs
3449 (add-hook 'before-change-functions 'org-remove-occur-highlights
3450 nil 'local)
3428 (run-hooks 'org-occur-hook) 3451 (run-hooks 'org-occur-hook)
3429 (if (interactive-p) 3452 (if (interactive-p)
3430 (message "%d match(es) for regexp %s" cnt regexp)) 3453 (message "%d match(es) for regexp %s" cnt regexp))
@@ -4036,7 +4059,9 @@ The following commands are available:
4036 (use-local-map org-agenda-mode-map) 4059 (use-local-map org-agenda-mode-map)
4037 (easy-menu-add org-agenda-menu) 4060 (easy-menu-add org-agenda-menu)
4038 (if org-startup-truncated (setq truncate-lines t)) 4061 (if org-startup-truncated (setq truncate-lines t))
4062 (make-local-hook 'post-command-hook) ; Needed for XEmacs
4039 (add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local) 4063 (add-hook 'post-command-hook 'org-agenda-post-command-hook nil 'local)
4064 (make-local-hook 'pre-command-hook) ; Needed for XEmacs
4040 (add-hook 'pre-command-hook 'org-unhighlight nil 'local) 4065 (add-hook 'pre-command-hook 'org-unhighlight nil 'local)
4041 (setq org-agenda-follow-mode nil) 4066 (setq org-agenda-follow-mode nil)
4042 (easy-menu-change 4067 (easy-menu-change
@@ -4049,7 +4074,7 @@ The following commands are available:
4049 (org-agenda-set-mode-name) 4074 (org-agenda-set-mode-name)
4050 (apply 4075 (apply
4051 (if (fboundp 'run-mode-hooks) 'run-mode-hooks 'run-hooks) 4076 (if (fboundp 'run-mode-hooks) 'run-mode-hooks 'run-hooks)
4052 org-agenda-mode-hook)) 4077 (list 'org-agenda-mode-hook)))
4053 4078
4054(define-key org-agenda-mode-map "\C-i" 'org-agenda-goto) 4079(define-key org-agenda-mode-map "\C-i" 'org-agenda-goto)
4055(define-key org-agenda-mode-map "\C-m" 'org-agenda-switch-to) 4080(define-key org-agenda-mode-map "\C-m" 'org-agenda-switch-to)
@@ -4903,8 +4928,8 @@ function from a program - use `org-agenda-get-day-entries' instead."
4903 (let (tbl) 4928 (let (tbl)
4904 (save-excursion 4929 (save-excursion
4905 (goto-char (point-min)) 4930 (goto-char (point-min))
4906 (while (re-search-forward "^#\\+CATEGORY:[ \t]*\\(.*\\)" nil t) 4931 (while (re-search-forward "\\(^\\|\r\\)#\\+CATEGORY:[ \t]*\\(.*\\)" nil t)
4907 (push (cons (point) (org-trim (match-string 1))) tbl))) 4932 (push (cons (point) (org-trim (match-string 2))) tbl)))
4908 tbl)) 4933 tbl))
4909 (defun org-get-category (&optional pos) 4934 (defun org-get-category (&optional pos)
4910 "Get the category applying to position POS." 4935 "Get the category applying to position POS."
@@ -10899,7 +10924,7 @@ See the individual commands for more information."
10899 (cond 10924 (cond
10900 ((org-at-table-p) 10925 ((org-at-table-p)
10901 (org-table-wrap-region arg)) 10926 (org-table-wrap-region arg))
10902 (t (org-insert-heading)))) 10927 (t (org-insert-heading arg))))
10903 10928
10904;;; Menu entries 10929;;; Menu entries
10905 10930
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 50715cf800c..451ca389013 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -30,6 +30,35 @@
30(defvar comint-prompt-regexp) 30(defvar comint-prompt-regexp)
31 31
32;;; Customizable settings 32;;; Customizable settings
33;;; Switching tooltips on/off
34
35;; We don't set track-mouse globally because this is a big redisplay
36;; problem in buffers having a pre-command-hook or such installed,
37;; which does a set-buffer, like the summary buffer of Gnus. Calling
38;; set-buffer prevents redisplay optimizations, so every mouse motion
39;; would be accompanied by a full redisplay.
40
41(define-minor-mode tooltip-mode
42 "Toggle Tooltip display.
43With ARG, turn tooltip mode on if and only if ARG is positive."
44 :global t
45 :init-value (not (or noninteractive
46 emacs-basic-display
47 (not (display-graphic-p))
48 (not (fboundp 'x-show-tip))))
49 :initialize 'custom-initialize-safe-default
50 :group 'tooltip
51 (unless (or (null tooltip-mode) (fboundp 'x-show-tip))
52 (error "Sorry, tooltips are not yet available on this system"))
53 (if tooltip-mode
54 (progn
55 (add-hook 'pre-command-hook 'tooltip-hide)
56 (add-hook 'tooltip-hook 'tooltip-help-tips))
57 (unless (and (boundp 'gud-tooltip-mode) gud-tooltip-mode)
58 (remove-hook 'pre-command-hook 'tooltip-hide))
59 (remove-hook 'tooltip-hook 'tooltip-help-tips))
60 (setq show-help-function
61 (if tooltip-mode 'tooltip-show-help nil)))
33 62
34(defgroup tooltip nil 63(defgroup tooltip nil
35 "Customization group for the `tooltip' package." 64 "Customization group for the `tooltip' package."
@@ -145,36 +174,6 @@ This might return nil if the event did not occur over a buffer."
145 (let ((window (posn-window (event-end event)))) 174 (let ((window (posn-window (event-end event))))
146 (and window (window-buffer window)))) 175 (and window (window-buffer window))))
147 176
148;;; Switching tooltips on/off
149
150;; We don't set track-mouse globally because this is a big redisplay
151;; problem in buffers having a pre-command-hook or such installed,
152;; which does a set-buffer, like the summary buffer of Gnus. Calling
153;; set-buffer prevents redisplay optimizations, so every mouse motion
154;; would be accompanied by a full redisplay.
155
156(define-minor-mode tooltip-mode
157 "Toggle Tooltip display.
158With ARG, turn tooltip mode on if and only if ARG is positive."
159 :global t
160 :init-value (not (or noninteractive
161 emacs-basic-display
162 (not (display-graphic-p))
163 (not (fboundp 'x-show-tip))))
164 :initialize 'custom-initialize-safe-default
165 :group 'tooltip
166 (unless (or (null tooltip-mode) (fboundp 'x-show-tip))
167 (error "Sorry, tooltips are not yet available on this system"))
168 (if tooltip-mode
169 (progn
170 (add-hook 'pre-command-hook 'tooltip-hide)
171 (add-hook 'tooltip-hook 'tooltip-help-tips))
172 (unless (and (boundp 'gud-tooltip-mode) gud-tooltip-mode)
173 (remove-hook 'pre-command-hook 'tooltip-hide))
174 (remove-hook 'tooltip-hook 'tooltip-help-tips))
175 (setq show-help-function
176 (if tooltip-mode 'tooltip-show-help nil)))
177
178 177
179;;; Timeout for tooltip display 178;;; Timeout for tooltip display
180 179
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 0df0b7365db..b6dc9470d2c 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -852,6 +852,7 @@ button end points."
852(defvar widget-keymap 852(defvar widget-keymap
853 (let ((map (make-sparse-keymap))) 853 (let ((map (make-sparse-keymap)))
854 (define-key map "\t" 'widget-forward) 854 (define-key map "\t" 'widget-forward)
855 (define-key map "\e\t" 'widget-backward)
855 (define-key map [(shift tab)] 'widget-backward) 856 (define-key map [(shift tab)] 'widget-backward)
856 (define-key map [backtab] 'widget-backward) 857 (define-key map [backtab] 'widget-backward)
857 (define-key map [down-mouse-2] 'widget-button-click) 858 (define-key map [down-mouse-2] 'widget-button-click)
diff --git a/lisp/window.el b/lisp/window.el
index cd4b22f3e7e..6cb553c3799 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -228,75 +228,201 @@ If WINDOW is nil or omitted, it defaults to the currently selected window."
228 (or (= (nth 2 edges) (nth 2 (window-edges (previous-window)))) 228 (or (= (nth 2 edges) (nth 2 (window-edges (previous-window))))
229 (= (nth 0 edges) (nth 0 (window-edges (next-window)))))))) 229 (= (nth 0 edges) (nth 0 (window-edges (next-window))))))))
230 230
231 231
232(defun balance-windows () 232;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
233 "Make all visible windows the same height (approximately)." 233;;; `balance-windows' subroutines using `window-tree'
234
235;;; Translate from internal window tree format
236
237(defun bw-get-tree (&optional window-or-frame)
238 "Get a window split tree in our format.
239
240WINDOW-OR-FRAME must be nil, a frame, or a window. If it is nil,
241then the whole window split tree for `selected-frame' is returned.
242If it is a frame, then this is used instead. If it is a window,
243then the smallest tree containing that window is returned."
244 (when window-or-frame
245 (unless (or (framep window-or-frame)
246 (windowp window-or-frame))
247 (error "Not a frame or window: %s" window-or-frame)))
248 (let ((subtree (bw-find-tree-sub window-or-frame)))
249 (if (integerp subtree)
250 nil
251 (bw-get-tree-1 subtree))))
252
253(defun bw-get-tree-1 (split)
254 (if (windowp split)
255 split
256 (let ((dir (car split))
257 (edges (car (cdr split)))
258 (childs (cdr (cdr split))))
259 (list
260 (cons 'dir (if dir 'ver 'hor))
261 (cons 'b (nth 3 edges))
262 (cons 'r (nth 2 edges))
263 (cons 't (nth 1 edges))
264 (cons 'l (nth 0 edges))
265 (cons 'childs (mapcar #'bw-get-tree-1 childs))))))
266
267(defun bw-find-tree-sub (window-or-frame &optional get-parent)
268 (let* ((window (when (windowp window-or-frame) window-or-frame))
269 (frame (when (windowp window) (window-frame window)))
270 (wt (car (window-tree frame))))
271 (when (< 1 (length (window-list frame 0)))
272 (if window
273 (bw-find-tree-sub-1 wt window get-parent)
274 wt))))
275
276(defun bw-find-tree-sub-1 (tree win &optional get-parent)
277 (unless (windowp win) (error "Not a window: %s" win))
278 (if (memq win tree)
279 (if get-parent
280 get-parent
281 tree)
282 (let ((childs (cdr (cdr tree)))
283 child
284 subtree)
285 (while (and childs (not subtree))
286 (setq child (car childs))
287 (setq childs (cdr childs))
288 (when (and child (listp child))
289 (setq subtree (bw-find-tree-sub-1 child win get-parent))))
290 (if (integerp subtree)
291 (progn
292 (if (= 1 subtree)
293 tree
294 (1- subtree)))
295 subtree
296 ))))
297
298;;; Window or object edges
299
300(defun bw-l(obj)
301 "Left edge of OBJ."
302 (if (windowp obj) (nth 0 (window-edges obj)) (cdr (assq 'l obj))))
303(defun bw-t(obj)
304 "Top edge of OBJ."
305 (if (windowp obj) (nth 1 (window-edges obj)) (cdr (assq 't obj))))
306(defun bw-r(obj)
307 "Right edge of OBJ."
308 (if (windowp obj) (nth 2 (window-edges obj)) (cdr (assq 'r obj))))
309(defun bw-b(obj)
310 "Bottom edge of OBJ."
311 (if (windowp obj) (nth 3 (window-edges obj)) (cdr (assq 'b obj))))
312
313;;; Split directions
314
315(defun bw-dir(obj)
316 "Return window split tree direction if OBJ.
317If OBJ is a window return 'both. If it is a window split tree
318then return its direction."
319 (if (symbolp obj)
320 obj
321 (if (windowp obj)
322 'both
323 (let ((dir (cdr (assq 'dir obj))))
324 (unless (memq dir '(hor ver both))
325 (error "Can't find dir in %s" obj))
326 dir))))
327
328(defun bw-eqdir(obj1 obj2)
329 "Return t if window split tree directions are equal.
330OBJ1 and OBJ2 should be either windows or window split trees in
331our format. The directions returned by `bw-dir' are compared and
332t is returned if they are `eq' or one of them is 'both."
333 (let ((dir1 (bw-dir obj1))
334 (dir2 (bw-dir obj2)))
335 (or (eq dir1 dir2)
336 (eq dir1 'both)
337 (eq dir2 'both))))
338
339;;; Building split tree
340
341(defun bw-refresh-edges(obj)
342 "Refresh the edge information of OBJ and return OBJ."
343 (unless (windowp obj)
344 (let ((childs (cdr (assq 'childs obj)))
345 (ol 1000)
346 (ot 1000)
347 (or -1)
348 (ob -1))
349 (dolist (o childs)
350 (when (> ol (bw-l o)) (setq ol (bw-l o)))
351 (when (> ot (bw-t o)) (setq ot (bw-t o)))
352 (when (< or (bw-r o)) (setq or (bw-r o)))
353 (when (< ob (bw-b o)) (setq ob (bw-b o))))
354 (setq obj (delq 'l obj))
355 (setq obj (delq 't obj))
356 (setq obj (delq 'r obj))
357 (setq obj (delq 'b obj))
358 (add-to-list 'obj (cons 'l ol))
359 (add-to-list 'obj (cons 't ot))
360 (add-to-list 'obj (cons 'r or))
361 (add-to-list 'obj (cons 'b ob))
362 ))
363 obj)
364
365;;; Balance windows
366
367(defun balance-windows(&optional window-or-frame)
368 "Make windows the same heights or widths in window split subtrees.
369
370When called non-interactively WINDOW-OR-FRAME may be either a
371window or a frame. It then balances the windows on the implied
372frame. If the parameter is a window only the corresponding window
373subtree is balanced."
234 (interactive) 374 (interactive)
235 (let ((count -1) levels newsizes level-size 375 (let (
236 ;; Don't count the lines that are above the uppermost windows. 376 (wt (bw-get-tree window-or-frame))
237 ;; (These are the menu bar lines, if any.) 377 (w)
238 (mbl (nth 1 (window-edges (frame-first-window (selected-frame))))) 378 (h)
239 (last-window (previous-window (frame-first-window (selected-frame)))) 379 (tried-sizes)
240 ;; Don't count the lines that are past the lowest main window. 380 (last-sizes)
241 total) 381 (windows (window-list nil 0))
242 ;; Bottom edge of last window determines what size we have to work with. 382 (counter 0))
243 (setq total 383 (when wt
244 (+ (window-height last-window) 384 (while (not (member last-sizes tried-sizes))
245 (nth 1 (window-edges last-window)))) 385 (when last-sizes (setq tried-sizes (cons last-sizes tried-sizes)))
246 386 (setq last-sizes (mapcar (lambda(w)
247 ;; Find all the different vpos's at which windows start, 387 (window-edges w))
248 ;; then count them. But ignore levels that differ by only 1. 388 windows))
249 (let (tops (prev-top -2)) 389 (when (eq 'hor (bw-dir wt))
250 (walk-windows (function (lambda (w) 390 (setq w (- (bw-r wt) (bw-l wt))))
251 (setq tops (cons (nth 1 (window-edges w)) 391 (when (eq 'ver (bw-dir wt))
252 tops)))) 392 (setq h (- (bw-b wt) (bw-t wt))))
253 'nomini) 393 (bw-balance-sub wt w h)))))
254 (setq tops (sort tops '<)) 394
255 (while tops 395(defun bw-adjust-window(window delta horizontal)
256 (if (> (car tops) (1+ prev-top)) 396 "Wrapper around `adjust-window-trailing-edge' with error checking.
257 (setq prev-top (car tops) 397Arguments WINDOW, DELTA and HORIZONTAL are passed on to that function."
258 count (1+ count))) 398 (condition-case err
259 (setq levels (cons (cons (car tops) count) levels)) 399 (adjust-window-trailing-edge window delta horizontal)
260 (setq tops (cdr tops))) 400 (error
261 (setq count (1+ count))) 401 ;;(message "adjust: %s" (error-message-string err))
262 ;; Subdivide the frame into desired number of vertical levels. 402 )))
263 (setq level-size (/ (- total mbl) count)) 403
264 (save-selected-window 404(defun bw-balance-sub(wt w h)
265 ;; Set up NEWSIZES to map windows to their desired sizes. 405 (setq wt (bw-refresh-edges wt))
266 ;; If a window ends at the bottom level, don't include 406 (unless w (setq w (- (bw-r wt) (bw-l wt))))
267 ;; it in NEWSIZES. Those windows get the right sizes 407 (unless h (setq h (- (bw-b wt) (bw-t wt))))
268 ;; by adjusting the ones above them. 408 (if (windowp wt)
269 (walk-windows (function 409 (progn
270 (lambda (w) 410 (when w
271 (let ((newtop (cdr (assq (nth 1 (window-edges w)) 411 (let ((dw (- w (- (bw-r wt) (bw-l wt)))))
272 levels))) 412 (when (/= 0 dw)
273 (newbot (cdr (assq (+ (window-height w) 413 (bw-adjust-window wt dw t))))
274 (nth 1 (window-edges w))) 414 (when h
275 levels)))) 415 (let ((dh (- h (- (bw-b wt) (bw-t wt)))))
276 (if newbot 416 (when (/= 0 dh)
277 (setq newsizes 417 (bw-adjust-window wt dh nil)))))
278 (cons (cons w (* level-size (- newbot newtop))) 418 (let* ((childs (cdr (assq 'childs wt)))
279 newsizes)))))) 419 (lastchild (car (last childs)))
280 'nomini) 420 (cw (when w (/ w (if (bw-eqdir 'hor wt) (length childs) 1))))
281 ;; Make walk-windows start with the topmost window. 421 (ch (when h (/ h (if (bw-eqdir 'ver wt) (length childs) 1)))))
282 (select-window (previous-window (frame-first-window (selected-frame)))) 422 (dolist (c childs)
283 (let (done (count 0)) 423 (bw-balance-sub c cw ch)))))
284 ;; Give each window its precomputed size, or at least try. 424
285 ;; Keep trying until they all get the intended sizes, 425;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
286 ;; but not more than 3 times (to prevent infinite loop).
287 (while (and (not done) (< count 3))
288 (setq done t)
289 (setq count (1+ count))
290 (walk-windows (function (lambda (w)
291 (select-window w)
292 (let ((newsize (cdr (assq w newsizes))))
293 (when newsize
294 (enlarge-window (- newsize
295 (window-height))
296 nil)
297 (unless (= (window-height) newsize)
298 (setq done nil))))))
299 'nomini))))))
300 426
301;; I think this should be the default; I think people will prefer it--rms. 427;; I think this should be the default; I think people will prefer it--rms.
302(defcustom split-window-keep-point t 428(defcustom split-window-keep-point t
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index e48370fe7ae..a1e236c3314 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,12 @@
12005-12-08 Richard M. Stallman <rms@gnu.org>
2
3 * minibuf.texi (Intro to Minibuffers): Replace list of local maps
4 with xrefs and better explanation.
5 (Completion Commands): Add the filename completion maps.
6
7 * objects.texi (Character Type): Clarify that \s is not space
8 if a dash follows.
9
12005-12-05 Richard M. Stallman <rms@gnu.org> 102005-12-05 Richard M. Stallman <rms@gnu.org>
2 11
3 * windows.texi (Resizing Windows): Delete preserve-before args. 12 * windows.texi (Resizing Windows): Delete preserve-before args.
diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi
index ced4524c4c0..a920defb5be 100644
--- a/lispref/minibuf.texi
+++ b/lispref/minibuf.texi
@@ -85,25 +85,12 @@ permit or forbid recursive minibuffers by setting the variable
85@code{enable-recursive-minibuffers} or by putting properties of that 85@code{enable-recursive-minibuffers} or by putting properties of that
86name on command symbols (@pxref{Recursive Mini}). 86name on command symbols (@pxref{Recursive Mini}).
87 87
88 Like other buffers, a minibuffer may use any of several local keymaps 88 Like other buffers, a minibuffer uses a local keymap
89(@pxref{Keymaps}); these contain various exit commands and in some cases 89(@pxref{Keymaps}) to specify special key bindings. The function that
90completion commands (@pxref{Completion}). 90invokes the minibuffer also sets up its local map according to the job
91 91to be done. @xref{Text from Minibuffer}, for the non-completion
92@itemize @bullet 92minibuffer local maps. @xref{Completion Commands}, for the minibuffer
93@item 93local maps for completion.
94@code{minibuffer-local-map} is for ordinary input (no completion).
95
96@item
97@code{minibuffer-local-ns-map} is similar, except that @key{SPC} exits
98just like @key{RET}.
99
100@item
101@code{minibuffer-local-completion-map} is for permissive completion.
102
103@item
104@code{minibuffer-local-must-match-map} is for strict completion and
105for cautious completion.
106@end itemize
107 94
108 When Emacs is running in batch mode, any request to read from the 95 When Emacs is running in batch mode, any request to read from the
109minibuffer actually reads a line from the standard input descriptor that 96minibuffer actually reads a line from the standard input descriptor that
@@ -1034,6 +1021,16 @@ bindings:
1034with other characters bound as in @code{minibuffer-local-map}. 1021with other characters bound as in @code{minibuffer-local-map}.
1035@end defvar 1022@end defvar
1036 1023
1024@defvar minibuffer-local-filename-completion-map
1025This is like @code{minibuffer-local-completion-map}
1026except that it does not bind @key{SPC}.
1027@end defvar
1028
1029@defvar minibuffer-local-must-match-filename-map
1030This is like @code{minibuffer-local-must-match-map}
1031except that it does not bind @key{SPC}.
1032@end defvar
1033
1037@node High-Level Completion 1034@node High-Level Completion
1038@subsection High-Level Completion Functions 1035@subsection High-Level Completion Functions
1039 1036
diff --git a/lispref/objects.texi b/lispref/objects.texi
index fcfad022dd0..f8a093656b9 100644
--- a/lispref/objects.texi
+++ b/lispref/objects.texi
@@ -291,7 +291,8 @@ you @emph{must} use a second @samp{\} to quote it: @samp{?\\}.
291vertical tab, formfeed, space, return, del, and escape as @samp{?\a}, 291vertical tab, formfeed, space, return, del, and escape as @samp{?\a},
292@samp{?\b}, @samp{?\t}, @samp{?\n}, @samp{?\v}, @samp{?\f}, 292@samp{?\b}, @samp{?\t}, @samp{?\n}, @samp{?\v}, @samp{?\f},
293@samp{?\s}, @samp{?\r}, @samp{?\d}, and @samp{?\e}, respectively. 293@samp{?\s}, @samp{?\r}, @samp{?\d}, and @samp{?\e}, respectively.
294Thus, 294(@samp{?\s} followed by a dash has a different meaning---it applies
295the ``super'' modifier to the following character.) Thus,
295 296
296@example 297@example
297?\a @result{} 7 ; @r{control-g, @kbd{C-g}} 298?\a @result{} 7 ; @r{control-g, @kbd{C-g}}
@@ -311,7 +312,7 @@ Thus,
311 These sequences which start with backslash are also known as 312 These sequences which start with backslash are also known as
312@dfn{escape sequences}, because backslash plays the role of an 313@dfn{escape sequences}, because backslash plays the role of an
313``escape character''; this terminology has nothing to do with the 314``escape character''; this terminology has nothing to do with the
314character @key{ESC}. @samp{\s} is meant for use only in character 315character @key{ESC}. @samp{\s} is meant for use in character
315constants; in string constants, just write the space. 316constants; in string constants, just write the space.
316 317
317@cindex control characters 318@cindex control characters
diff --git a/mac/ChangeLog b/mac/ChangeLog
index e61cb12a946..cc097906046 100644
--- a/mac/ChangeLog
+++ b/mac/ChangeLog
@@ -1,3 +1,8 @@
12005-12-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * Emacs.app/Contents/Info.plist: Add CFBundleURLTypes key and
4 data. Make NSServices open-selection the first entry.
5
12005-11-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 62005-11-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 7
3 * makefile.MPW (shortlisp): Sync with src/Makefile.in. 8 * makefile.MPW (shortlisp): Sync with src/Makefile.in.
diff --git a/mac/Emacs.app/Contents/Info.plist b/mac/Emacs.app/Contents/Info.plist
index 176dbf81276..d03123cc3cd 100644
--- a/mac/Emacs.app/Contents/Info.plist
+++ b/mac/Emacs.app/Contents/Info.plist
@@ -35,7 +35,18 @@
35 <string>EMAx</string> 35 <string>EMAx</string>
36 <key>CFBundleVersion</key> 36 <key>CFBundleVersion</key>
37 <string>1.1</string> 37 <string>1.1</string>
38 <key>NSServices</key> 38 <key>CFBundleURLTypes</key>
39 <array>
40 <dict>
41 <key>CFBundleURLName</key>
42 <string>Email Address URL</string>
43 <key>CFBundleURLSchemes</key>
44 <array>
45 <string>mailto</string>
46 </array>
47 </dict>
48 </array>
49 <key>NSServices</key>
39 <array> 50 <array>
40 <dict> 51 <dict>
41 <key>NSKeyEquivalent</key> 52 <key>NSKeyEquivalent</key>
@@ -43,10 +54,10 @@
43 <key>NSMenuItem</key> 54 <key>NSMenuItem</key>
44 <dict> 55 <dict>
45 <key>default</key> 56 <key>default</key>
46 <string>Emacs/Open Selected File</string> 57 <string>Emacs/New Buffer Containing Selection</string>
47 </dict> 58 </dict>
48 <key>NSMessage</key> 59 <key>NSMessage</key>
49 <string>open-file</string> 60 <string>open-selection</string>
50 <key>NSPortName</key> 61 <key>NSPortName</key>
51 <string>Emacs</string> 62 <string>Emacs</string>
52 <key>NSReturnTypes</key> 63 <key>NSReturnTypes</key>
@@ -62,10 +73,10 @@
62 <key>NSMenuItem</key> 73 <key>NSMenuItem</key>
63 <dict> 74 <dict>
64 <key>default</key> 75 <key>default</key>
65 <string>Emacs/New Buffer Containing Selection</string> 76 <string>Emacs/Open Selected File</string>
66 </dict> 77 </dict>
67 <key>NSMessage</key> 78 <key>NSMessage</key>
68 <string>open-selection</string> 79 <string>open-file</string>
69 <key>NSPortName</key> 80 <key>NSPortName</key>
70 <string>Emacs</string> 81 <string>Emacs</string>
71 <key>NSReturnTypes</key> 82 <key>NSReturnTypes</key>
diff --git a/man/ChangeLog b/man/ChangeLog
index bb532094028..52fa75c2187 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,145 @@
12005-12-10 Romain Francoise <romain@orebokech.com>
2
3 Update the Emacs FAQ for the 22.1 release.
4
5 * faq.texi: Set VER to `22.1'.
6 (Basic editing): Explain how to use localized versions of the
7 Tutorial. Mention that `C-h r' displays the manual. Delete
8 obsolete WWW link to an Emacs 18 tutorial.
9 (Getting a printed manual): Point to the new locations of the
10 manuals on the GNU Web site.
11 (Emacs Lisp documentation): Explain that the Emacs Lisp manual is
12 available via Info (it was previously distributed separately).
13 (Installing Texinfo documentation): The latest version of Texinfo
14 is 4.8, not 4.0.
15 (Informational files for Emacs): COPYING is the GNU General Public
16 License, not the Emacs General Public License.
17 (Informational files for Emacs): Delete obsolete link to the
18 GNUinfo pages as they have been removed from the GNU Web site.
19 (New in Emacs 22): New node.
20 (Setting up a customization file): Say that most packages support
21 Customize nowadays.
22 (Colors on a TTY): Delete reference to instructions on how to
23 enable syntax highlighting, it is now enabled by default.
24 (Turning on abbrevs by default): Emacs now reads the abbrevs file
25 at startup automatically.
26 (Controlling case sensitivity): Mention `M-c' in isearch.
27 (Using an already running Emacs process): Emacs now creates the
28 socket in `/tmp/emacsUID'. Fix typos. Change default location of
29 gnuserv. As emacsclient can now run Lisp code as well, delete a
30 sentence praising gnuserv for that. Simplify description of how
31 the client/server operation works.
32 (Compiler error messages): Delete obsolete text (compile.el has
33 been rewritten).
34 (Indenting switch statements): Fix typo.
35 (Matching parentheses): Simplify setup instructions, mention the
36 menu bar item in the Options menu.
37 (Repeating a command as many times as possible): Mention `C-x e'.
38 (Going to a line by number): Mention new keymap and bindings
39 `M-g M-g', `M-g M-p' and `M-g M-n'.
40 (Turning on syntax highlighting): Now on by default. Simplify.
41 (Replacing highlighted text): Use `1', not `t'.
42 (Problems with very large files): The maximum size is now 256MB on
43 32-bit machines.
44 (^M in the shell buffer): Mention `comint-process-echoes'.
45 (Emacs for Apple computers): Emacs 22 has native support for Mac
46 OS X.
47 (Translating names to IP addresses): Delete node.
48 (Binding keys to commands): Fix typo.
49 (SPC no longer completes file names): New node.
50 (MIME with Emacs mail packages): Delete section about the Emacs
51 MIME FAQ (it's not reachable anymore).
52
532005-12-10 David Koppelman <koppel@ece.lsu.edu>
54
55 * display.texi (Highlight Interactively): Include
56 global-hi-lock-mode. Add miscellaneous details and elaborations.
57
582005-12-09 Richard M. Stallman <rms@gnu.org>
59
60 * display.texi (Font Lock): Delete the Global FL menu item.
61
622005-12-09 Luc Teirlinck <teirllm@auburn.edu>
63
64 * custom.texi (Minibuffer Maps): Mention the maps for file name
65 completion.
66
672005-12-09 Kim F. Storm <storm@cua.dk>
68
69 * killing.texi (CUA Bindings): Describe how to use C-x and C-c as
70 prefix keys even when mark is active. Decribe that RET moves
71 cursor to next corner in rectangle; clarify insert around rectangle.
72
732005-12-05 Katsumi Yamaoka <yamaoka@jpl.org>
74
75 * pgg.texi (User Commands): Fix description of pgg-verify-region.
76 (Selecting an implementation): Fix descriptions.
77
782005-11-30 Katsumi Yamaoka <yamaoka@jpl.org>
79
80 * message.texi (Various Message Variables): Addition.
81
822005-11-29 Katsumi Yamaoka <yamaoka@jpl.org>
83
84 * message.texi: Fix default values.
85
862005-11-25 Katsumi Yamaoka <yamaoka@jpl.org>
87
88 * message.texi (Header Commands): Clarify descriptions of
89 message-cross-post-followup-to, message-reduce-to-to-cc, and
90 message-insert-wide-reply.
91 (Various Commands): Fix kindex for message-kill-to-signature;
92 clarify description of message-tab.
93
942005-11-22 Katsumi Yamaoka <yamaoka@jpl.org>
95
96 * message.texi (Mailing Lists): Fix description about MFT.
97
98 * gnus.texi (Emacs Lisp): Use ~/.gnus.el instead of ~/.emacs.
99
1002005-11-17 Katsumi Yamaoka <yamaoka@jpl.org>
101
102 * gnus.texi (Slow Terminal Connection): Replace old description
103 with new one.
104
1052005-11-16 Katsumi Yamaoka <yamaoka@jpl.org>
106
107 * gnus.texi (Oort Gnus): Use ~/.gnus.el instead of ~/.emacs;
108 replace X-Draft-Headers with X-Draft-From.
109
1102005-11-14 Katsumi Yamaoka <yamaoka@jpl.org>
111
112 * gnus.texi (Various Various): Fix the default value of
113 nnheader-max-head-length.
114 (Gnus Versions): Fix typo.
115
1162005-12-08 Luc Teirlinck <teirllm@auburn.edu>
117
118 * custom.texi (Customization): Use xref to elisp manual for
119 non-TeX output.
120 (Minor Modes): Update.
121 (Customization Groups, Changing a Variable, Face Customization):
122 Update for new appearance of Custom buffers.
123 (Changing a Variable): `custom-buffer-done-function' has been
124 replaced by `custom-buffer-done-kill'.
125 (Specific Customization): In the `customize-group' buffer, a
126 subgroup's contents are not "hidden". They are not included at
127 all. They have no [Show] button.
128 (Mouse Buttons): Add pxref to description of mouse event lists in
129 Elisp manual. Add `menu-bar' and `header-line' dummy prefix keys.
130 (Find Init): Emacs now looks for ~/.emacs.d/init.el instead of
131 ~/.emacs.d/.emacs, if it can not find ~/.emacs(.el).
132
1332005-12-08 Richard M. Stallman <rms@gnu.org>
134
135 * mini.texi (Completion Commands, Completion):
136 In file name input, SPC does not do completion.
137
1382005-12-08 Carsten Dominik <dominik@science.uva.nl>
139
140 * org.texi (Structure editing): Document new functionality of
141 M-RET.
142
12005-12-08 Nick Roberts <nickrob@snap.net.nz> 1432005-12-08 Nick Roberts <nickrob@snap.net.nz>
2 144
3 * building.texi (GDB Graphical Interface): Explain screen size 145 * building.texi (GDB Graphical Interface): Explain screen size
@@ -30,11 +172,11 @@
30 172
312005-11-28 Jay Belanger <belanger@truman.edu> 1732005-11-28 Jay Belanger <belanger@truman.edu>
32 174
33 * calc.texi: Change references of `M-#' to `C-x *' prefix. 175 * calc.texi: Change references of `M-#' to `C-x *' prefix.
34 176
352005-11-24 Carsten Dominik <dominik@science.uva.nl> 1772005-11-24 Carsten Dominik <dominik@science.uva.nl>
36 178
37 * org.texi: (Structure editing): New item moving commands added. 179 * org.texi (Structure editing): New item moving commands added.
38 (Plain Lists): New section. 180 (Plain Lists): New section.
39 181
402005-11-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 1822005-11-24 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
@@ -82,7 +224,7 @@
82 224
832005-11-18 Carsten Dominik <dominik@science.uva.nl> 2252005-11-18 Carsten Dominik <dominik@science.uva.nl>
84 226
85 * org.texi: (FAQ): Document `org-table-tab-jumps-over-hlines'. 227 * org.texi (FAQ): Document `org-table-tab-jumps-over-hlines'.
86 (Agenda): Document commands `org-cycle-agenda-files' and 228 (Agenda): Document commands `org-cycle-agenda-files' and
87 `org-agenda-file-to-front' 229 `org-agenda-file-to-front'
88 (Built-in table editor): Document `org-table-sort-lines'. 230 (Built-in table editor): Document `org-table-sort-lines'.
diff --git a/man/custom.texi b/man/custom.texi
index 9a76f0cc111..f0dcbdc4d34 100644
--- a/man/custom.texi
+++ b/man/custom.texi
@@ -7,8 +7,15 @@
7@cindex customization 7@cindex customization
8 8
9 This chapter talks about various topics relevant to adapting the 9 This chapter talks about various topics relevant to adapting the
10behavior of Emacs in minor ways. See @cite{The Emacs Lisp Reference 10behavior of Emacs in minor ways.
11Manual} for how to make more far-reaching changes. @xref{X Resources}, 11@iftex
12See @cite{The Emacs Lisp Reference Manual}
13@end iftex
14@ifnottex
15@xref{Top, Emacs Lisp, Emacs Lisp, elisp, The Emacs Lisp
16Reference Manual},
17@end ifnottex
18for how to make more far-reaching changes. @xref{X Resources},
12for information on using X resources to customize Emacs. 19for information on using X resources to customize Emacs.
13 20
14 Customization that you do within Emacs normally affects only the 21 Customization that you do within Emacs normally affects only the
@@ -52,8 +59,8 @@ line when they are on; for example, @samp{Fill} in the mode line means
52that Auto Fill mode is on. 59that Auto Fill mode is on.
53 60
54 Append @code{-mode} to the name of a minor mode to get the name of a 61 Append @code{-mode} to the name of a minor mode to get the name of a
55command function that turns the mode on or off. Thus, the command to 62command that turns the mode on or off. Thus, the command to
56enable or disable Auto Fill mode is called @kbd{M-x auto-fill-mode}. These 63enable or disable Auto Fill mode is called @code{auto-fill-mode}. These
57commands are usually invoked with @kbd{M-x}, but you can bind keys to them 64commands are usually invoked with @kbd{M-x}, but you can bind keys to them
58if you wish. With no argument, the function turns the mode on if it was 65if you wish. With no argument, the function turns the mode on if it was
59off and off if it was on. This is known as @dfn{toggling}. A positive 66off and off if it was on. This is known as @dfn{toggling}. A positive
@@ -66,21 +73,25 @@ buffer-local; they apply only to the current buffer, so you can enable
66the mode in certain buffers and not others. 73the mode in certain buffers and not others.
67 74
68 For most minor modes, the command name is also the name of a 75 For most minor modes, the command name is also the name of a
69variable which directly controls the mode. The mode is enabled 76variable. The variable's value is non-@code{nil} if the mode is
70whenever this variable's value is non-@code{nil}, and the minor-mode 77enabled and @code{nil} if it is disabled. Some minor-mode commands
71command works by setting the variable. For example, the command 78work by just setting the variable. For example, the command
72@code{outline-minor-mode} works by setting the value of 79@code{abbrev-mode} works by setting the value of @code{abbrev-mode} as
73@code{outline-minor-mode} as a variable; it is this variable that 80a variable; it is this variable that directly turns Abbrev mode on and
74directly turns Outline minor mode on and off. To check whether a 81off. You can directly set the variable's value instead of calling the
75given minor mode works this way, use @kbd{C-h v} to ask for 82mode function. For other minor modes, you need to either set the
76documentation on the variable name. 83variable through the Customize interface or call the mode function to
77 84correctly enable or disable the mode. To check which of these two
78 These minor-mode variables provide a good way for Lisp programs to 85possibilities applies to a given minor mode, use @kbd{C-h v} to ask
79turn minor modes on and off; they are also useful in a file's local 86for documentation on the variable name.
80variables list (@pxref{File Variables}). But please think twice 87
81before setting minor modes with a local variables list, because most 88 For minor mode commands that work by just setting the minor mode
82minor modes are a matter of user preference---other users editing the 89variable, that variable provides a good way for Lisp programs to turn
83same file might not want the same minor modes you prefer. 90minor modes on and off; it is also useful in a file's local variables
91list (@pxref{File Variables}). But please think twice before setting
92minor modes with a local variables list, because most minor modes are
93a matter of user preference---other users editing the same file might
94not want the same minor modes you prefer.
84 95
85 The most useful buffer-local minor modes include Abbrev mode, Auto 96 The most useful buffer-local minor modes include Abbrev mode, Auto
86Fill mode, Auto Save mode, Font-Lock mode, Glasses mode, ISO Accents 97Fill mode, Auto Save mode, Font-Lock mode, Glasses mode, ISO Accents
@@ -144,9 +155,10 @@ In Binary Overwrite mode, digits after @kbd{C-q} specify an
144octal character code, as usual. 155octal character code, as usual.
145 156
146 Here are some useful minor modes that normally apply to all buffers 157 Here are some useful minor modes that normally apply to all buffers
147at once. Since each is enabled or disabled by the value of a 158at once. Since Line Number mode and Transient Mark mode can be
159enabled or disabled just by setting the value of the minor mode
148variable, you @emph{can} set them differently for particular buffers, 160variable, you @emph{can} set them differently for particular buffers,
149by explicitly making the corresponding variables local in those 161by explicitly making the corresponding variable local in those
150buffers. @xref{Locals}. 162buffers. @xref{Locals}.
151 163
152 Icomplete mode displays an indication of available completions when 164 Icomplete mode displays an indication of available completions when
@@ -166,7 +178,7 @@ these modes are enabled by default when you use the X Window System.
166will get an error. This means you must either set the mark, or 178will get an error. This means you must either set the mark, or
167explicitly ``reactivate'' it, before each command that uses the region. 179explicitly ``reactivate'' it, before each command that uses the region.
168The advantage of Transient Mark mode is that Emacs can display the 180The advantage of Transient Mark mode is that Emacs can display the
169region highlighted (currently only when using X). @xref{Mark}. 181region highlighted. @xref{Mark}.
170 182
171@node Easy Customization 183@node Easy Customization
172@section Easy Customization Interface 184@section Easy Customization Interface
@@ -274,7 +286,7 @@ variables and faces), and their structure.
274@samp{[-]}; invoking that hides the group contents. 286@samp{[-]}; invoking that hides the group contents.
275 287
276 Each group, variable, or face name in this buffer has an active field 288 Each group, variable, or face name in this buffer has an active field
277which says @samp{[Group]}, @samp{[Variable]} or @samp{[Face]}. Invoking 289which says @samp{[Group]}, @samp{[Option]} or @samp{[Face]}. Invoking
278that active field creates an ordinary customization buffer showing just 290that active field creates an ordinary customization buffer showing just
279that group and its contents, just that variable, or just that face. 291that group and its contents, just that variable, or just that face.
280This is the way to set values in it. 292This is the way to set values in it.
@@ -286,16 +298,16 @@ This is the way to set values in it.
286customization buffer: 298customization buffer:
287 299
288@smallexample 300@smallexample
289Kill Ring Max: [Hide] 60 301Kill Ring Max: [Hide Value] 60
290 [State]: this variable is unchanged from its standard setting. 302 [State]: STANDARD.
291Maximum length of kill ring before oldest elements are thrown away. 303Maximum length of kill ring before oldest elements are thrown away.
292@end smallexample 304@end smallexample
293 305
294 The text following @samp{[Hide]}, @samp{60} in this case, indicates 306 The text following @samp{[Hide Value]}, @samp{60} in this case, indicates
295the current value of the variable. If you see @samp{[Show]} instead of 307the current value of the variable. If you see @samp{[Show Value]} instead of
296@samp{[Hide]}, it means that the value is hidden; the customization 308@samp{[Hide Value]}, it means that the value is hidden; the customization
297buffer initially hides values that take up several lines. Invoke 309buffer initially hides values that take up several lines. Invoke
298@samp{[Show]} to show the value. 310@samp{[Show Value]} to show the value.
299 311
300 The line after the option name indicates the @dfn{customization state} 312 The line after the option name indicates the @dfn{customization state}
301of the variable: in the example above, it says you have not changed the 313of the variable: in the example above, it says you have not changed the
@@ -317,7 +329,8 @@ another number.
317change to say that you have edited the value: 329change to say that you have edited the value:
318 330
319@smallexample 331@smallexample
320[State]: you have edited the value as text, but not set the variable. 332[State]: EDITED, shown value does not take effect until you set or @r{@dots{}}
333 save it.
321@end smallexample 334@end smallexample
322 335
323@cindex setting option value 336@cindex setting option value
@@ -328,7 +341,7 @@ that, you must @dfn{set} it. To do this, invoke the word
328 The state of the variable changes visibly when you set it: 341 The state of the variable changes visibly when you set it:
329 342
330@smallexample 343@smallexample
331[State]: you have set this variable, but not saved it for future sessions. 344[State]: SET for current session only.
332@end smallexample 345@end smallexample
333 346
334 You don't have to worry about specifying a value that is not valid; 347 You don't have to worry about specifying a value that is not valid;
@@ -355,7 +368,7 @@ value of @code{file-coding-system-alist} is an association list. Here
355is how it appears in the customization buffer: 368is how it appears in the customization buffer:
356 369
357@smallexample 370@smallexample
358File Coding System Alist: [Hide] 371File Coding System Alist: [Hide Value]
359[INS] [DEL] File regexp: \.elc\' 372[INS] [DEL] File regexp: \.elc\'
360 Choice: [Value Menu] Encoding/decoding pair: 373 Choice: [Value Menu] Encoding/decoding pair:
361 Decoding: emacs-mule 374 Decoding: emacs-mule
@@ -373,8 +386,9 @@ File Coding System Alist: [Hide]
373 Decoding: undecided 386 Decoding: undecided
374 Encoding: nil 387 Encoding: nil
375[INS] 388[INS]
376 [State]: this variable is unchanged from its standard setting. 389 [State]: STANDARD.
377Alist to decide a coding system to use for a file I/O operation. [Hide] 390Alist to decide a coding system to use for a file I/O @r{@dots{}}
391 operation. [Hide Rest]
378The format is ((PATTERN . VAL) ...), 392The format is ((PATTERN . VAL) ...),
379where PATTERN is a regular expression matching a file name, 393where PATTERN is a regular expression matching a file name,
380@r{[@dots{}more lines of documentation@dots{}]} 394@r{[@dots{}more lines of documentation@dots{}]}
@@ -420,10 +434,10 @@ Customizations}).
420 434
421 You can also restore the variable to its standard value by invoking 435 You can also restore the variable to its standard value by invoking
422@samp{[State]} and selecting the @samp{Erase Customization} operation. 436@samp{[State]} and selecting the @samp{Erase Customization} operation.
423There are actually three reset operations: 437There are actually four reset operations:
424 438
425@table @samp 439@table @samp
426@item Reset 440@item Reset to Current
427If you have made some modifications and not yet set the variable, 441If you have made some modifications and not yet set the variable,
428this restores the text in the customization buffer to match 442this restores the text in the customization buffer to match
429the actual value. 443the actual value.
@@ -452,28 +466,25 @@ comment you enter will be saved, and displayed again if you again view
452the same variable in a customization buffer, even in another session. 466the same variable in a customization buffer, even in another session.
453 467
454 The state of a group indicates whether anything in that group has been 468 The state of a group indicates whether anything in that group has been
455edited, set or saved. You can select @samp{Set for Current Session}, 469edited, set or saved.
456@samp{Save for Future Sessions} and the various kinds of @samp{Reset}
457operation for the group; these operations on the group apply to all
458options in the group and its subgroups.
459 470
460 Near the top of the customization buffer there are two lines 471 Near the top of the customization buffer there are two lines
461containing several active fields: 472containing several active fields:
462 473
463@smallexample 474@smallexample
464 [Set for Current Session] [Save for Future Sessions] 475 [Set for Current Session] [Save for Future Sessions]
465 [Reset] [Reset to Saved] [Erase Customization] [Finish] 476 [Reset to Current] [Reset to Saved] [Erase Customization] [Finish]
466@end smallexample 477@end smallexample
467 478
468@vindex custom-buffer-done-function 479@vindex custom-buffer-done-function
469@noindent 480@noindent
470Invoking @samp{[Finish]} either buries or kills this customization 481Invoking @samp{[Finish]} either buries or kills this customization
471buffer according to the setting of the option 482buffer according to the setting of the option
472@code{custom-buffer-done-function}; the default is to bury the buffer. 483@code{custom-buffer-done-kill}; the default is to bury the buffer.
473Each of the other fields performs an operation---set, save or 484Each of the other fields performs an operation---set, save or
474reset---on each of the options in the buffer that could meaningfully 485reset---on each of the options in the buffer that could meaningfully
475be set, saved or reset. They do not operate on options whose values 486be set, saved or reset. They do not operate on options whose values
476are hidden. 487are hidden, nor on subgroups.
477 488
478@node Saving Customizations 489@node Saving Customizations
479@subsection Saving Customizations 490@subsection Saving Customizations
@@ -529,10 +540,10 @@ the faces in the group appear in the customization buffer. Here is an
529example of how a face looks: 540example of how a face looks:
530 541
531@smallexample 542@smallexample
532Custom Changed Face:(sample) [Hide] 543Custom Changed Face:(sample) [Hide Face]
533 [State]: this face is unchanged from its standard setting. 544 [State]: STANDARD.
534Face used when the customize item has been changed. 545Face used when the customize item has been changed.
535Parent groups: => Custom Magic Faces 546Parent groups: [Custom Magic Faces]
536Attributes: [ ] Font Family: * 547Attributes: [ ] Font Family: *
537 [ ] Width: * 548 [ ] Width: *
538 [ ] Height: * 549 [ ] Height: *
@@ -556,7 +567,7 @@ attribute by invoking that field. When the attribute is enabled, you
556can change the attribute value in the usual ways. 567can change the attribute value in the usual ways.
557 568
558 For the colors, you can specify a color name (use @kbd{M-x 569 For the colors, you can specify a color name (use @kbd{M-x
559list-colors-display}) for a list of them) or a hexadecimal color 570list-colors-display} for a list of them) or a hexadecimal color
560specification of the form @samp{#@var{rr}@var{gg}@var{bb}}. 571specification of the form @samp{#@var{rr}@var{gg}@var{bb}}.
561(@samp{#000000} is black, @samp{#ff0000} is red, @samp{#00ff00} is 572(@samp{#000000} is black, @samp{#ff0000} is red, @samp{#00ff00} is
562green, @samp{#0000ff} is blue, and @samp{#ffffff} is white.) On a 573green, @samp{#0000ff} is blue, and @samp{#ffffff} is white.) On a
@@ -627,16 +638,15 @@ on the character after point.
627 You can also set up the customization buffer with a specific group, 638 You can also set up the customization buffer with a specific group,
628using @kbd{M-x customize-group}. The immediate contents of the chosen 639using @kbd{M-x customize-group}. The immediate contents of the chosen
629group, including user options, faces, and other groups, all appear 640group, including user options, faces, and other groups, all appear
630as well. However, these subgroups' own contents start out hidden. You 641as well. However, these subgroups' own contents are not included.
631can show their contents in the usual way, by invoking @samp{[Show]}.
632 642
633@findex customize-apropos 643@findex customize-apropos
634 To control more precisely what to customize, you can use @kbd{M-x 644 To control more precisely what to customize, you can use @kbd{M-x
635customize-apropos}. You specify a regular expression as argument; then 645customize-apropos}. You specify a regular expression as argument; then
636all options, faces and groups whose names match this regular expression 646all options, faces and groups whose names match this regular expression
637are set up in the customization buffer. If you specify an empty regular 647are set up in the customization buffer. If you specify an empty regular
638expression, this includes @emph{all} groups, options and faces in the 648expression, this includes @emph{all} groups, options and faces (but
639customization buffer (but that takes a long time). 649that takes a long time).
640 650
641@findex customize-changed-options 651@findex customize-changed-options
642 When you upgrade to a new Emacs version, you might want to customize 652 When you upgrade to a new Emacs version, you might want to customize
@@ -1396,6 +1406,8 @@ to add local bindings (not very useful, we admit) for @kbd{C-c n} and
1396@vindex minibuffer-local-ns-map 1406@vindex minibuffer-local-ns-map
1397@vindex minibuffer-local-completion-map 1407@vindex minibuffer-local-completion-map
1398@vindex minibuffer-local-must-match-map 1408@vindex minibuffer-local-must-match-map
1409@vindex minibuffer-local-filename-completion-map
1410@vindex minibuffer-local-must-match-filename-map
1399 The minibuffer has its own set of local keymaps; they contain various 1411 The minibuffer has its own set of local keymaps; they contain various
1400completion and exit commands. 1412completion and exit commands.
1401 1413
@@ -1410,6 +1422,11 @@ just like @key{RET}. This is used mainly for Mocklisp compatibility.
1410@item 1422@item
1411@code{minibuffer-local-must-match-map} is for strict completion and 1423@code{minibuffer-local-must-match-map} is for strict completion and
1412for cautious completion. 1424for cautious completion.
1425@item
1426@code{minibuffer-local-filename-completion-map} and
1427@code{minibuffer-local-must-match-filename-map} are like the two
1428previous ones, but they are specifically for file name completion.
1429They do not bind @key{SPC}.
1413@end itemize 1430@end itemize
1414 1431
1415@node Rebinding 1432@node Rebinding
@@ -1688,9 +1705,9 @@ word:
1688@cindex keypad 1705@cindex keypad
1689 Many keyboards have a ``numeric keypad'' on the right hand side. 1706 Many keyboards have a ``numeric keypad'' on the right hand side.
1690The numeric keys in the keypad double up as cursor motion keys, 1707The numeric keys in the keypad double up as cursor motion keys,
1691toggled by a key labelled @samp{Num Lock}. By default, Emacs 1708toggled by a key labeled @samp{Num Lock}. By default, Emacs
1692translates these keys to the corresponding keys in the main keyboard. 1709translates these keys to the corresponding keys in the main keyboard.
1693For example, when @samp{Num Lock} is on, the key labelled @samp{8} on 1710For example, when @samp{Num Lock} is on, the key labeled @samp{8} on
1694the numeric keypad produces @code{kp-8}, which is translated to 1711the numeric keypad produces @code{kp-8}, which is translated to
1695@kbd{8}; when @samp{Num Lock} is off, the same key produces 1712@kbd{8}; when @samp{Num Lock} is off, the same key produces
1696@code{kp-up}, which is translated to @key{UP}. If you rebind a key 1713@code{kp-up}, which is translated to @key{UP}. If you rebind a key
@@ -1825,12 +1842,13 @@ twice.
1825 Emacs also supports triple-click events whose names start with 1842 Emacs also supports triple-click events whose names start with
1826@samp{triple-}. Emacs does not distinguish quadruple clicks as event 1843@samp{triple-}. Emacs does not distinguish quadruple clicks as event
1827types; clicks beyond the third generate additional triple-click events. 1844types; clicks beyond the third generate additional triple-click events.
1828However, the full number of clicks is recorded in the event list, so you 1845However, the full number of clicks is recorded in the event list, so
1829can distinguish if you really want to. We don't recommend distinct 1846if you know Emacs Lisp you can distinguish if you really want to
1830meanings for more than three clicks, but sometimes it is useful for 1847(@pxref{Accessing Events,,, elisp, The Emacs Lisp Reference Manual}).
1831subsequent clicks to cycle through the same set of three meanings, so 1848We don't recommend distinct meanings for more than three clicks, but
1832that four clicks are equivalent to one click, five are equivalent to 1849sometimes it is useful for subsequent clicks to cycle through the same
1833two, and six are equivalent to three. 1850set of three meanings, so that four clicks are equivalent to one
1851click, five are equivalent to two, and six are equivalent to three.
1834 1852
1835 Emacs also records multiple presses in drag and button-down events. 1853 Emacs also records multiple presses in drag and button-down events.
1836For example, when you press a button twice, then move the mouse while 1854For example, when you press a button twice, then move the mouse while
@@ -1848,7 +1866,7 @@ click. Its value is in units of milliseconds. If the value is
1848 1866
1849@vindex double-click-fuzz 1867@vindex double-click-fuzz
1850 The variable @code{double-click-fuzz} specifies how much the mouse 1868 The variable @code{double-click-fuzz} specifies how much the mouse
1851can move between clicks still allow them to be grouped as a multiple 1869can move between clicks and still allow them to be grouped as a multiple
1852click. Its value is in units of pixels on windowed displays and in 1870click. Its value is in units of pixels on windowed displays and in
1853units of 1/8 of a character cell on text-mode terminals; the default is 1871units of 1/8 of a character cell on text-mode terminals; the default is
18543. 18723.
@@ -1882,6 +1900,10 @@ you use scroll bars, they appear in place of these vertical lines.)
1882@item vertical-scroll-bar 1900@item vertical-scroll-bar
1883The mouse was in a vertical scroll bar. (This is the only kind of 1901The mouse was in a vertical scroll bar. (This is the only kind of
1884scroll bar Emacs currently supports.) 1902scroll bar Emacs currently supports.)
1903@item menu-bar
1904The mouse was in the menu bar.
1905@item header-line
1906The mouse was in a header line.
1885@ignore 1907@ignore
1886@item horizontal-scroll-bar 1908@item horizontal-scroll-bar
1887The mouse was in a horizontal scroll bar. Horizontal scroll bars do 1909The mouse was in a horizontal scroll bar. Horizontal scroll bars do
@@ -2397,9 +2419,10 @@ library. @xref{Hooks}.
2397@subsection How Emacs Finds Your Init File 2419@subsection How Emacs Finds Your Init File
2398 2420
2399 Normally Emacs uses the environment variable @env{HOME} to find 2421 Normally Emacs uses the environment variable @env{HOME} to find
2400@file{.emacs}; that's what @samp{~} means in a file name. If @file{.emacs} 2422@file{.emacs}; that's what @samp{~} means in a file name. If
2401is not found directly inside @file{~/}, Emacs looks for it in 2423@file{.emacs} is not found inside @file{~/} (nor @file{.emacs.el}),
2402@file{~/.emacs.d/}. 2424Emacs looks for @file{~/.emacs.d/init.el} (which, like
2425@file{~/.emacs.el}, can be byte-compiled).
2403 2426
2404 However, if you run Emacs from a shell started by @code{su}, Emacs 2427 However, if you run Emacs from a shell started by @code{su}, Emacs
2405tries to find your own @file{.emacs}, not that of the user you are 2428tries to find your own @file{.emacs}, not that of the user you are
diff --git a/man/display.texi b/man/display.texi
index cc345b93b8f..a0cb73c03bc 100644
--- a/man/display.texi
+++ b/man/display.texi
@@ -274,10 +274,6 @@ interface (@pxref{Easy Customization}), or use the function
274(global-font-lock-mode 0) 274(global-font-lock-mode 0)
275@end example 275@end example
276 276
277@noindent
278Global Font Lock mode can also be set using the menu bar Options menu,
279specifying first Syntax Highlighting and then Save Options.
280
281@findex turn-on-font-lock 277@findex turn-on-font-lock
282 If you have disabled Global Font Lock mode, you can still enable font 278 If you have disabled Global Font Lock mode, you can still enable font
283lock for specific major modes by adding the function 279lock for specific major modes by adding the function
@@ -393,35 +389,48 @@ group @samp{jit-lock}. @xref{Specific Customization}.
393@cindex highlighting by matching 389@cindex highlighting by matching
394@cindex interactive highlighting 390@cindex interactive highlighting
395 391
396 It is sometimes useful to highlight the strings that match a certain 392 It is sometimes useful to temporarily highlight text that
397regular expression. For example, you might wish to see all the 393matches a certain regular expression. For example, you might wish to
398references to a certain variable in a program source file, or highlight 394see all the references to a certain variable in a program source file,
399certain parts in a voluminous output of some program, or make certain 395highlight certain parts in a voluminous output of some program, or
400cliches stand out in an article. 396make certain names stand out in an article.
401 397
402@findex hi-lock-mode 398@findex hi-lock-mode
403 Use the @kbd{M-x hi-lock-mode} command to turn on a minor mode that 399 Use the @kbd{M-x hi-lock-mode} command to turn on a minor mode that
404allows you to specify regular expressions of the text to be 400allows you to interactively add and remove regular expressions
405highlighted. Hi-lock mode works like Font Lock (@pxref{Font Lock}), 401specifying text to be highlighted. Hi Lock mode works like Font Lock
406except that it lets you specify explicitly what parts of text to 402mode (@pxref{Font Lock}), except that it lets you easily add and
407highlight. You control Hi-lock mode with these commands: 403remove regular expressions while you are editing a buffer. To enable
404Hi Lock mode for all buffers use @kbd{M-x global-hi-lock-mode} or
405place @code{(global-hi-lock-mode 1)} in your @file{.emacs} file.
406
407You control Hi Lock mode with these commands:
408 408
409@table @kbd 409@table @kbd
410@item C-x w h @var{regexp} @key{RET} @var{face} @key{RET} 410@item C-x w h @var{regexp} @key{RET} @var{face} @key{RET}
411@kindex C-x w h 411@kindex C-x w h
412@findex highlight-regexp 412@findex highlight-regexp
413Highlight text that matches 413Highlight text that matches @var{regexp} using face @var{face}
414@var{regexp} using face @var{face} (@code{highlight-regexp}). 414(@code{highlight-regexp}). By using this command more than once, you
415By using this command more than once, you can highlight various 415can highlight various parts of the text in different ways. The
416parts of the text in different ways. 416highlighting will remain as long as the buffer is loaded. For
417example, to highlight all occurrences of the word ``whim'' using the
418default face (a yellow background) @kbd{C-x w h whim @key{RET}
419@key{RET}}. Any face can be used for highlighting, Hi Lock provides
420several of its own and these are pre-loaded into a history list. While
421being prompted for a face use @kbd{C-p} and @kbd{C-n} to cycle through
422them.
417 423
418@item C-x w r @var{regexp} @key{RET} 424@item C-x w r @var{regexp} @key{RET}
419@kindex C-x w r 425@kindex C-x w r
420@findex unhighlight-regexp 426@findex unhighlight-regexp
421Unhighlight @var{regexp} (@code{unhighlight-regexp}). You must enter 427Unhighlight @var{regexp} (@code{unhighlight-regexp}).
422one of the regular expressions currently specified for highlighting. 428When activated from the menu select the expression to unhighlight from
423(You can use completion, or choose from a menu, to enter one of them 429a list. When activated from the keyboard the most recently added
424conveniently.) 430expression will be shown. Use @kbd{C-p} to show the next older
431expression and @kbd{C-n} to select the next newer expression. When
432the expression to unhighlight appears press @kbd{@key{RET}} to unhighlight
433it. The expression can also be typed and completion is available.
425 434
426@item C-x w l @var{regexp} @key{RET} @var{face} @key{RET} 435@item C-x w l @var{regexp} @key{RET} @var{face} @key{RET}
427@kindex C-x w l 436@kindex C-x w l
@@ -440,7 +449,7 @@ program. This key binding runs the
440@code{hi-lock-write-interactive-patterns} command. 449@code{hi-lock-write-interactive-patterns} command.
441 450
442These patterns will be read the next time you visit the file while 451These patterns will be read the next time you visit the file while
443Hi-lock mode is enabled, or whenever you use the @kbd{M-x 452Hi Lock mode is enabled, or whenever you use the @kbd{M-x
444hi-lock-find-patterns} command. 453hi-lock-find-patterns} command.
445 454
446@item C-x w i 455@item C-x w i
@@ -448,8 +457,14 @@ hi-lock-find-patterns} command.
448@findex hi-lock-find-patterns 457@findex hi-lock-find-patterns
449@vindex hi-lock-exclude-modes 458@vindex hi-lock-exclude-modes
450Re-read regexp/face pairs in the current buffer 459Re-read regexp/face pairs in the current buffer
451(@code{hi-lock-write-interactive-patterns}). The list of pairs is 460(@code{hi-lock-write-interactive-patterns}). Users familiar with Font
452found no matter where in the buffer it may be. 461Lock keywords might interactively enter patterns
462(@code{highlight-regexp}), write them into the file
463(@code{hi-lock-write-interactive-patterns}), edit them, perhaps
464including different faces for different parenthesized parts of the
465match, and finally use this command
466(@code{hi-lock-write-interactive-patterns}) to have Hi Lock highlight
467them.
453 468
454This command does nothing if the major mode is a member of the list 469This command does nothing if the major mode is a member of the list
455@code{hi-lock-exclude-modes}. 470@code{hi-lock-exclude-modes}.
diff --git a/man/faq.texi b/man/faq.texi
index 4ac0bdc979c..df21cb7d79c 100644
--- a/man/faq.texi
+++ b/man/faq.texi
@@ -7,7 +7,7 @@
7@setchapternewpage odd 7@setchapternewpage odd
8 8
9@c This is used in many places 9@c This is used in many places
10@set VER 21.3 10@set VER 22.1
11 11
12@copying 12@copying
13Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 13Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
@@ -30,8 +30,8 @@ The FAQ may be copied and redistributed under these conditions, except that
30the FAQ may not be embedded in a larger literary work unless that work 30the FAQ may not be embedded in a larger literary work unless that work
31itself allows free copying and redistribution. 31itself allows free copying and redistribution.
32 32
33[This version has been somewhat edited from the last-posted version 33[This version has been heavily edited since it was included in the Emacs
34(as of August 1999) for inclusion in the Emacs distribution.] 34distribution.]
35@end quotation 35@end quotation
36@end copying 36@end copying
37 37
@@ -556,8 +556,11 @@ This chapter tells you how to get help with Emacs
556@cindex Self-paced tutorial, invoking the 556@cindex Self-paced tutorial, invoking the
557@cindex Help system, entering the 557@cindex Help system, entering the
558 558
559Type @kbd{C-h t} to invoke the self-paced tutorial. Just typing @kbd{C-h} 559Type @kbd{C-h t} to invoke the self-paced tutorial. Just typing
560enters the help system. 560@kbd{C-h} enters the help system. Starting with Emacs 22, the tutorial
561is available in many foreign languages such as French, German, Japanese,
562Russian, etc. Use @kbd{M-x help-with-tutorial-spec-language @key{RET}}
563to choose your language and start the tutorial.
561 564
562Your system administrator may have changed @kbd{C-h} to act like 565Your system administrator may have changed @kbd{C-h} to act like
563@key{DEL} to deal with local keyboards. You can use @kbd{M-x 566@key{DEL} to deal with local keyboards. You can use @kbd{M-x
@@ -570,11 +573,6 @@ sequence listed. Each of the resulting key sequences invokes help.
570Emacs help works best if it is invoked by a single key whose value 573Emacs help works best if it is invoked by a single key whose value
571should be stored in the variable @code{help-char}. 574should be stored in the variable @code{help-char}.
572 575
573There is also a WWW-based tutorial for Emacs 18, much of which is also
574relevant for later versions of Emacs, available at
575
576@uref{http://kufacts.cc.ukans.edu/cwis/writeups/misc/emacsguide.html}
577
578@node Learning how to do something, Getting a printed manual, Basic editing, Getting help 576@node Learning how to do something, Getting a printed manual, Basic editing, Getting help
579@section How do I find out how to do something in Emacs? 577@section How do I find out how to do something in Emacs?
580@cindex Help for Emacs 578@cindex Help for Emacs
@@ -589,9 +587,9 @@ There are several methods for finding out how to do things in Emacs.
589@cindex Reading the Emacs manual 587@cindex Reading the Emacs manual
590@item 588@item
591The complete text of the Emacs manual is available on-line via the Info 589The complete text of the Emacs manual is available on-line via the Info
592hypertext reader. Type @kbd{C-h i} to invoke Info. Typing @key{h} 590hypertext reader. Type @kbd{C-h r} to display the manual in Info mode.
593immediately after entering Info will provide a short tutorial on how to 591Typing @key{h} immediately after entering Info will provide a short
594use it. 592tutorial on how to use it.
595 593
596@cindex Lookup a subject in a manual 594@cindex Lookup a subject in a manual
597@cindex Index search in a manual 595@cindex Index search in a manual
@@ -668,12 +666,12 @@ file}).
668If you absolutely have to print your own copy, and you don't have @TeX{}, 666If you absolutely have to print your own copy, and you don't have @TeX{},
669you can get a PostScript version from 667you can get a PostScript version from
670 668
671@uref{http://www.gnu.org/manual/emacs/ps/emacs.ps.gz} 669@uref{http://www.gnu.org/software/emacs/manual/emacs.ps.gz}
672 670
673@cindex HTML version of Emacs manual, obtaining 671@cindex HTML version of Emacs manual, obtaining
674An HTML version of the manual is at 672An HTML version of the manual is at
675 673
676@uref{www.gnu.org/manual/emacs/index.html} 674@uref{http://www.gnu.org/software/emacs/manual/emacs.html}
677 675
678@xref{Learning how to do something}, for how to view the manual on-line. 676@xref{Learning how to do something}, for how to view the manual on-line.
679 677
@@ -688,24 +686,16 @@ An HTML version of the manual is at
688Within Emacs, you can type @kbd{C-h f} to get the documentation for a 686Within Emacs, you can type @kbd{C-h f} to get the documentation for a
689function, @kbd{C-h v} for a variable. 687function, @kbd{C-h v} for a variable.
690 688
691For more information, obtain the Emacs Lisp Reference Manual. Details 689For more information, the Emacs Lisp Reference Manual is available
692on ordering it from FSF are on the 690on-line, in Info format. @xref{Top, Emacs Lisp,, elisp, The
693@uref{http://www.gnu.org/order/order.html, GNU Web site}. 691Emacs Lisp Reference Manual}.
694 692
695The Emacs Lisp Reference Manual is also available on-line, in Info 693You can also order a hardcopy of the manual, details on ordering it from
696format. Texinfo source for the manual (along with pregenerated Info 694FSF are on the @uref{http://www.gnu.org/order/order.html, GNU Web site}.
697files) is available at
698
699@uref{ftp://ftp.gnu.org/pub/gnu/emacs/elisp-manual-21-2.6.tar.gz}
700
701and all mirrors of @samp{ftp.gnu.org} (for a list, @pxref{Current GNU
702distributions}). @xref{Installing Texinfo documentation}, if you want
703to install the Info files, or @ref{Printing a Texinfo file}, if you want
704to use the Texinfo source to print the manual yourself.
705 695
706An HTML version of the Emacs Lisp Reference Manual is available at 696An HTML version of the Emacs Lisp Reference Manual is available at
707 697
708@uref{http://www.gnu.org/manual/elisp-manual-21-2.6/elisp.html} 698@uref{http://www.gnu.org/software/emacs/elisp-manual/elisp.html}
709 699
710@node Installing Texinfo documentation, Printing a Texinfo file, Emacs Lisp documentation, Getting help 700@node Installing Texinfo documentation, Printing a Texinfo file, Emacs Lisp documentation, Getting help
711@section How do I install a piece of Texinfo documentation? 701@section How do I install a piece of Texinfo documentation?
@@ -719,7 +709,7 @@ First, you must turn the Texinfo files into Info files. You may do this
719using the stand-alone @file{makeinfo} program, available as part of the latest 709using the stand-alone @file{makeinfo} program, available as part of the latest
720Texinfo package at 710Texinfo package at
721 711
722@uref{ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-4.0.tar.gz} 712@uref{ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-4.8.tar.gz}
723 713
724and all mirrors of @samp{ftp.gnu.org} (for a list, @pxref{Current GNU 714and all mirrors of @samp{ftp.gnu.org} (for a list, @pxref{Current GNU
725distributions}). 715distributions}).
@@ -903,7 +893,7 @@ where that is).
903@table @file 893@table @file
904 894
905@item COPYING 895@item COPYING
906Emacs General Public License 896GNU General Public License
907 897
908@item DISTRIB 898@item DISTRIB
909Emacs Availability Information, including the popular Free Software 899Emacs Availability Information, including the popular Free Software
@@ -939,10 +929,6 @@ including ``Using Emacstool with GNU Emacs''
939 929
940@end table 930@end table
941 931
942Latest versions of the above files also available at
943
944@uref{ftp://ftp.gnu.org/pub/gnu/GNUinfo/}
945
946More GNU information, including back issues of the @cite{GNU's 932More GNU information, including back issues of the @cite{GNU's
947Bulletin}, are at 933Bulletin}, are at
948 934
@@ -1049,6 +1035,7 @@ latest version status.
1049* Latest version of Emacs:: 1035* Latest version of Emacs::
1050* New in Emacs 20:: 1036* New in Emacs 20::
1051* New in Emacs 21:: 1037* New in Emacs 21::
1038* New in Emacs 22::
1052@end menu 1039@end menu
1053 1040
1054@node Origin of the term Emacs, Latest version of Emacs, Status of Emacs, Status of Emacs 1041@node Origin of the term Emacs, Latest version of Emacs, Status of Emacs, Status of Emacs
@@ -1112,7 +1099,7 @@ calendar/diary, have been updated and enhanced to work with Emacs 20,
1112and are now included with the standard distribution. 1099and are now included with the standard distribution.
1113 1100
1114 1101
1115@node New in Emacs 21, , New in Emacs 20, Status of Emacs 1102@node New in Emacs 21, New in Emacs 22, New in Emacs 20, Status of Emacs
1116@section What is different about Emacs 21? 1103@section What is different about Emacs 21?
1117@cindex Differences between Emacs 20 and Emacs 21 1104@cindex Differences between Emacs 20 and Emacs 21
1118@cindex Emacs 21, new features in 1105@cindex Emacs 21, new features in
@@ -1134,6 +1121,39 @@ In addition, Emacs 21 supports faces on text-only terminals. This means
1134that you can now have colors when you run Emacs on a GNU/Linux console 1121that you can now have colors when you run Emacs on a GNU/Linux console
1135and on @code{xterm} with @kbd{emacs -nw}. 1122and on @code{xterm} with @kbd{emacs -nw}.
1136 1123
1124@node New in Emacs 22, , New in Emacs 21, Status of Emacs
1125@section What is different about Emacs 22?
1126@cindex Differences between Emacs 21 and Emacs 22
1127@cindex Emacs 22, new features in
1128@cindex Recently introduced features
1129
1130@c FIXME: Improve this node before the 22.1 release.
1131@cindex Default features
1132Font-lock mode, auto-compression mode, and file name shadow mode are now
1133enabled by default. It is now possible to follow links with
1134@kbd{mouse-1}.
1135
1136@cindex Supported systems
1137Emacs 22 features support for GNU/Linux systems on S390 and X86-64
1138machines, as well as support for the Mac OS X and Cygwin operating
1139systems.
1140
1141@cindex GTK+ Toolkit
1142@cindex Drag-and-drop
1143@cindex Mouse wheel
1144Emacs can now be built with GTK+ widgets, and supports drag-and-drop
1145operation on X. Mouse wheel support is now enabled by default.
1146
1147@cindex New modes
1148Many new modes and packages have been included in Emacs, such as Leim,
1149Calc, Tramp and URL, as well as IDO, CUA, rcirc, conf-mode,
1150python-mode, table, tumme, SES, ruler, Flymake, Org, etc.
1151
1152@cindex Documentation
1153@cindex Emacs Lisp Manual
1154In addition, Emacs 22 now includes the Emacs Lisp Reference Manual
1155(@pxref{Emacs Lisp documentation}) and the Emacs Lisp Intro.
1156
1137@c ------------------------------------------------------------ 1157@c ------------------------------------------------------------
1138@node Common requests, Bugs and problems, Status of Emacs, Top 1158@node Common requests, Bugs and problems, Status of Emacs, Top
1139@chapter Common requests 1159@chapter Common requests
@@ -1205,12 +1225,11 @@ it causes confusing non-standard behavior. Then they send questions to
1205@email{help-gnu-emacs@@gnu.org} asking why Emacs isn't behaving as 1225@email{help-gnu-emacs@@gnu.org} asking why Emacs isn't behaving as
1206documented. 1226documented.
1207 1227
1208Beginning with version 20.1, Emacs includes the new Customize 1228Beginning with version 20.1, Emacs includes the new Customize facility,
1209facility, which can be invoked using @kbd{M-x customize @key{RET}}. 1229which can be invoked using @kbd{M-x customize @key{RET}}. This allows
1210This allows users who are unfamiliar with Emacs Lisp to modify their 1230users who are unfamiliar with Emacs Lisp to modify their @file{.emacs}
1211@file{.emacs} files in a relatively straightforward way, using menus 1231files in a relatively straightforward way, using menus rather than Lisp
1212rather than Lisp code. Not all packages support Customize as of this 1232code. Most packages support Customize as of this writing.
1213writing, but the number is growing fairly steadily.
1214 1233
1215While Customize might indeed make it easier to configure Emacs, 1234While Customize might indeed make it easier to configure Emacs,
1216consider taking a bit of time to learn Emacs Lisp and modifying your 1235consider taking a bit of time to learn Emacs Lisp and modifying your
@@ -1240,8 +1259,7 @@ capabilities.
1240The command @kbd{M-x list-colors-display} pops up a window which 1259The command @kbd{M-x list-colors-display} pops up a window which
1241exhibits all the colors Emacs knows about on the current display. 1260exhibits all the colors Emacs knows about on the current display.
1242 1261
1243Syntax highlighting is usually turned off by default; see @ref{Turning 1262Syntax highlighting is on by default since version 22.1.
1244on syntax highlighting}, for instructions how to turn it on.
1245 1263
1246@node Debugging a customization file, Displaying the current line or column, Colors on a TTY, Common requests 1264@node Debugging a customization file, Displaying the current line or column, Colors on a TTY, Common requests
1247@section How do I debug a @file{.emacs} file? 1265@section How do I debug a @file{.emacs} file?
@@ -1362,6 +1380,9 @@ Put this in your @file{.emacs} file:
1362 (setq abbrev-mode t))) 1380 (setq abbrev-mode t)))
1363@end lisp 1381@end lisp
1364 1382
1383Starting with Emacs 22, the standard abbrevs file is read automatically
1384at startup, so the first of these two forms becomes unnecessary.
1385
1365@node Turning on auto-fill by default, Associating modes with files, Turning on abbrevs by default, Common requests 1386@node Turning on auto-fill by default, Associating modes with files, Turning on abbrevs by default, Common requests
1366@section How do I turn on @code{auto-fill-mode} by default? 1387@section How do I turn on @code{auto-fill-mode} by default?
1367@cindex @code{auto-fill-mode}, activating automatically 1388@cindex @code{auto-fill-mode}, activating automatically
@@ -1510,6 +1531,8 @@ determines whether they are case sensitive:
1510Similarly, for replacing, the variable @code{case-replace} determines 1531Similarly, for replacing, the variable @code{case-replace} determines
1511whether replacements preserve case. 1532whether replacements preserve case.
1512 1533
1534You can also toggle case sensitivity at will in isearch with @kbd{M-c}.
1535
1513To change the case sensitivity just for one major mode, use the major 1536To change the case sensitivity just for one major mode, use the major
1514mode's hook. For example: 1537mode's hook. For example:
1515 1538
@@ -1597,10 +1620,9 @@ or by invoking @code{server-start} from @file{.emacs}:
1597(if (@var{some conditions are met}) (server-start)) 1620(if (@var{some conditions are met}) (server-start))
1598@end lisp 1621@end lisp
1599 1622
1600When this is done, Emacs creates a Unix domain socket. 1623When this is done, Emacs creates a Unix domain socket named
1601The socket is either named @file{.emacs_server}, in the user's home directory, 1624@file{server} in @file{/tmp/emacs@var{userid}}. See
1602or @file{esrv-@var{userid}-@var{systemname}}, in the @file{/tmp} 1625@code{server-socket-dir}.
1603directory, depending on your system. See @code{server-socket-name}.
1604 1626
1605To get your news reader, mail reader, etc., to invoke 1627To get your news reader, mail reader, etc., to invoke
1606@samp{emacsclient}, try setting the environment variable @code{EDITOR} 1628@samp{emacsclient}, try setting the environment variable @code{EDITOR}
@@ -1622,40 +1644,24 @@ EDITOR=emacsclient ; export EDITOR
1622@item 1644@item
1623Normal use: 1645Normal use:
1624 1646
1625When @samp{emacsclient} is run, it connects to the @file{.emacs_server} 1647When @samp{emacsclient} is run, it connects to the socket and passes its
1626socket and passes its command line options to @samp{server}. When 1648command line options to Emacs, which at the next opportunity will visit
1627@samp{server} receives these requests, it sends this information to the 1649the files specified. (Line numbers can be specified just like with
1628the Emacs process, which at the next opportunity will visit the files 1650Emacs.) The user will have to switch to the Emacs window by hand. When
1629specified. (Line numbers can be specified just like with Emacs.) The 1651the user is done editing a file, the user can type @kbd{C-x #} (or
1630user will have to switch to the Emacs window by hand. When the user is 1652@kbd{M-x server-edit}) to indicate this. If there is another buffer
1631done editing a file, the user can type @kbd{C-x #} (or @kbd{M-x 1653requested by @code{emacsclient}, Emacs will switch to it; otherwise
1632server-edit}) to indicate this. If there is another buffer requested by
1633@code{emacsclient}, Emacs will switch to it; otherwise
1634@code{emacsclient} will exit, signaling the calling program to continue. 1654@code{emacsclient} will exit, signaling the calling program to continue.
1635 1655
1636@samp{emacsclient} and @samp{server} must be running on machines which
1637share the same filesystem for this to work. The pathnames that
1638@samp{emacsclient} specifies should be correct for the filesystem that
1639the Emacs process sees. The Emacs process should not be suspended at
1640the time @samp{emacsclient} is invoked. On Unix and GNU/Linux systems,
1641@samp{emacsclient} should either be invoked from another X window, or
1642from a shell window inside Emacs itself, or from another interactive
1643session, e.g., by means of a @code{screen} program.
1644
1645@cindex @code{gnuserv} 1656@cindex @code{gnuserv}
1646There is an enhanced version of @samp{emacsclient}/server called 1657There is an enhanced version of @samp{emacsclient} called
1647@samp{gnuserv}, written by @email{ange@@hplb.hpl.hp.com, Andy Norman} 1658@samp{gnuserv}, written by @email{ange@@hplb.hpl.hp.com, Andy Norman}
1648(@pxref{Packages that do not come with Emacs}). @samp{gnuserv} uses 1659(@pxref{Packages that do not come with Emacs}). @samp{gnuserv} uses
1649Internet domain sockets, so it can work across most network connections. 1660Internet domain sockets, so it can work across most network connections.
1650It also supports the execution of arbitrary Emacs Lisp forms and does
1651not require the client program to wait for completion.
1652 1661
1653The alpha version of an enhanced @samp{gnuserv} is available at 1662The most recent @samp{gnuserv} package is available at
1654 1663
1655@uref{ftp://ftp.wellfleet.com/netman/psmith/emacs/gnuserv-2.1alpha.tar.gz} 1664@uref{http://meltin.net/hacks/emacs/}
1656
1657The version available from @uref{http://meltin.net/hacks/emacs/} is
1658more recent, and has been tested with Emacs 21.2.
1659 1665
1660@end itemize 1666@end itemize
1661 1667
@@ -1666,23 +1672,7 @@ more recent, and has been tested with Emacs 21.2.
1666@cindex Regexps for recognizing compiler errors 1672@cindex Regexps for recognizing compiler errors
1667@cindex Errors, recognizing compiler 1673@cindex Errors, recognizing compiler
1668 1674
1669The variable @code{compilation-error-regexp-alist} helps control how 1675Customize the @code{compilation-error-regexp-alist} variable.
1670Emacs parses your compiler output. It is a list of triplets of the form:
1671@code{(@var{regexp} @var{file-idx} @var{line-idx})}, where @var{regexp},
1672@var{file-idx} and @var{line-idx} are strings. To help determine what
1673the constituent elements should be, load @file{compile.el} and then type
1674@kbd{C-h v compilation-error-regexp-alist @key{RET}} to see the current
1675value. A good idea is to look at @file{compile.el} itself as the
1676comments included for this variable are quite useful---the regular
1677expressions required for your compiler's output may be very close to one
1678already provided. Once you have determined the proper regexps, use the
1679following to inform Emacs of your changes:
1680
1681@lisp
1682(setq compilation-error-regexp-alist
1683 (cons '(@var{regexp} @var{file-idx} @var{line-idx})
1684 compilation-error-regexp-alist))
1685@end lisp
1686 1676
1687@node Indenting switch statements, Customizing C and C++ indentation, Compiler error messages, Common requests 1677@node Indenting switch statements, Customizing C and C++ indentation, Compiler error messages, Common requests
1688@section How do I change the indentation for @code{switch}? 1678@section How do I change the indentation for @code{switch}?
@@ -1712,7 +1702,7 @@ The solution at first appears to be: set @code{c-indent-level} to 4 and
1712spacing of four instead of two. 1702spacing of four instead of two.
1713 1703
1714The @emph{real} solution is to use @code{cc-mode} (the default mode for 1704The @emph{real} solution is to use @code{cc-mode} (the default mode for
1715C programming in Emacs 20 and later) and add the following line to yoyr 1705C programming in Emacs 20 and later) and add the following line to your
1716@file{.emacs}: 1706@file{.emacs}:
1717 1707
1718@lisp 1708@lisp
@@ -1949,28 +1939,17 @@ new paragraph. There are many packages available to deal with this
1949@cindex Pairs of parentheses, highlighting 1939@cindex Pairs of parentheses, highlighting
1950@cindex Matching parentheses 1940@cindex Matching parentheses
1951 1941
1952As of version 19, Emacs comes with @file{paren.el}, which (when loaded) 1942Call @code{show-paren-mode} in your @file{.emacs} file:
1953will automatically highlight matching parentheses whenever point (i.e.,
1954the cursor) is located over one. To load @file{paren.el} automatically,
1955include the line
1956
1957@lisp
1958(require 'paren)
1959@end lisp
1960
1961in your @file{.emacs} file. @email{shutkoa@@ugsolutions.com, Alan Shutko}
1962reports that as of version 20.1, you must also call @code{show-paren-mode} in
1963your @file{.emacs} file:
1964 1943
1965@lisp 1944@lisp
1966(show-paren-mode 1) 1945(show-paren-mode 1)
1967@end lisp 1946@end lisp
1968 1947
1969Customize will let you turn on @code{show-paren-mode}. Use @kbd{M-x 1948You can also enable this mode by selecting the @samp{Paren Match
1970customize-group @key{RET} paren-showing @key{RET}}. From within 1949Highlighting} option from the @samp{Options} menu of the Emacs menu bar
1971Customize, you can also go directly to the ``paren-showing'' group. 1950at the top of any Emacs frame.
1972 1951
1973Alternatives to paren include: 1952Alternatives to this mode include:
1974 1953
1975@itemize @bullet 1954@itemize @bullet
1976 1955
@@ -2160,7 +2139,7 @@ the command and then type @kbd{M-0 C-x e}.
2160Any messages your command prints in the echo area will be suppressed. 2139Any messages your command prints in the echo area will be suppressed.
2161 2140
2162If you need to repeat a command a small number of times, you can use 2141If you need to repeat a command a small number of times, you can use
2163@kbd{C-x z}, see @ref{Repeating commands}. 2142@kbd{C-x z} (@pxref{Repeating commands}) or @kbd{C-x e}.
2164 2143
2165@node Forcing the cursor to remain in the same column, Forcing Emacs to iconify itself, Repeating a command as many times as possible, Common requests 2144@node Forcing the cursor to remain in the same column, Forcing Emacs to iconify itself, Repeating a command as many times as possible, Common requests
2166@section How do I make Emacs behave like this: when I go up or down, the cursor should stay in the same column even if the line is too short? 2145@section How do I make Emacs behave like this: when I go up or down, the cursor should stay in the same column even if the line is too short?
@@ -2315,27 +2294,20 @@ effective way of doing that. Emacs automatically intercepts the compile
2315error messages, inserts them into a special buffer called 2294error messages, inserts them into a special buffer called
2316@code{*compilation*}, and lets you visit the locus of each message in 2295@code{*compilation*}, and lets you visit the locus of each message in
2317the source. Type @kbd{C-x `} to step through the offending lines one by 2296the source. Type @kbd{C-x `} to step through the offending lines one by
2318one. Click @kbd{Mouse-2} or press @key{RET} on a message text in the 2297one (starting with Emacs 22, you can also use @kbd{M-g M-p} and
2298@kbd{M-g M-n} to go to the previous and next matches directly). Click
2299@kbd{Mouse-2} or press @key{RET} on a message text in the
2319@code{*compilation*} buffer to go to the line whose number is mentioned 2300@code{*compilation*} buffer to go to the line whose number is mentioned
2320in that message. 2301in that message.
2321 2302
2322But if you indeed need to go to a certain text line, type @kbd{M-x 2303But if you indeed need to go to a certain text line, type @kbd{M-g M-g}
2323goto-line @key{RET}}. Emacs will prompt you for the number of the line 2304(which is the default binding of the @code{goto-line} function starting
2324and go to that line. 2305with Emacs 22). Emacs will prompt you for the number of the line and go
2306to that line.
2325 2307
2326You can do this faster by invoking @code{goto-line} with a numeric 2308You can do this faster by invoking @code{goto-line} with a numeric
2327argument that is the line's number. For example, @kbd{C-u 286 M-x 2309argument that is the line's number. For example, @kbd{C-u 286 M-g M-g}
2328goto-line @key{RET}} will jump to line number 286 in the current 2310will jump to line number 286 in the current buffer.
2329buffer.
2330
2331If you need to use this command frequently, you might consider binding
2332it to a key. The following snippet, if added to your @file{~/.emacs}
2333file, will bind the sequence @kbd{C-x g} to @code{goto-line}:
2334
2335@lisp
2336 (global-set-key "\C-xg" 'goto-line)
2337@end lisp
2338
2339 2311
2340@node Modifying pull-down menus, Deleting menus and menu options, Going to a line by number, Common requests 2312@node Modifying pull-down menus, Deleting menus and menu options, Going to a line by number, Common requests
2341@section How can I create or modify new pull-down menu options? 2313@section How can I create or modify new pull-down menu options?
@@ -2457,9 +2429,11 @@ menus}), use:
2457@cindex FAQ, @code{font-lock-mode} 2429@cindex FAQ, @code{font-lock-mode}
2458 2430
2459@code{font-lock-mode} is the standard way to have Emacs perform syntax 2431@code{font-lock-mode} is the standard way to have Emacs perform syntax
2460highlighting in the current buffer. With @code{font-lock-mode} turned 2432highlighting in the current buffer. It is enabled by default in Emacs
2461on, different types of text will appear in different colors. For 243322.1 and later.
2462instance, if you turn on @code{font-lock-mode} in a programming mode, 2434
2435With @code{font-lock-mode} turned on, different types of text will
2436appear in different colors. For instance, in a programming mode,
2463variables will appear in one face, keywords in a second, and comments in 2437variables will appear in one face, keywords in a second, and comments in
2464a third. 2438a third.
2465 2439
@@ -2468,33 +2442,16 @@ Earlier versions of Emacs supported hilit19, a similar package. Use of
2468hilit19 is now considered non-standard, although @file{hilit19.el} comes 2442hilit19 is now considered non-standard, although @file{hilit19.el} comes
2469with the stock Emacs distribution. It is no longer maintained. 2443with the stock Emacs distribution. It is no longer maintained.
2470 2444
2471To turn @code{font-lock-mode} on within an existing buffer, use @kbd{M-x 2445To turn @code{font-lock-mode} off within an existing buffer, use
2472font-lock-mode @key{RET}}. 2446@kbd{M-x font-lock-mode @key{RET}}.
2473
2474To automatically invoke @code{font-lock-mode} when a particular major
2475mode is invoked, set the major mode's hook. For example, to fontify all
2476@code{c-mode} buffers, add the following to your @file{.emacs} file:
2477 2447
2478@lisp 2448In Emacs 21 and earlier versions, you could use the following code in
2479(add-hook 'c-mode-hook 'turn-on-font-lock) 2449your @file{.emacs} file to turn on @code{font-lock-mode} globally:
2480@end lisp
2481
2482To automatically invoke @code{font-lock-mode} for all major modes, you
2483can turn on @code{global-font-lock-mode} by including the following line
2484in your @file{.emacs} file:
2485 2450
2486@lisp 2451@lisp
2487(global-font-lock-mode 1) 2452(global-font-lock-mode 1)
2488@end lisp 2453@end lisp
2489 2454
2490@noindent
2491This instructs Emacs to turn on font-lock mode in those buffers for
2492which a font-lock mode definition has been provided (in the variable
2493@code{font-lock-global-modes}). If you edit a file in
2494@code{pie-ala-mode}, and no font-lock definitions have been provided for
2495@code{pie-ala} files, then the above setting will have no effect on that
2496particular buffer.
2497
2498Highlighting a buffer with @code{font-lock-mode} can take quite a while, 2455Highlighting a buffer with @code{font-lock-mode} can take quite a while,
2499and cause an annoying delay in display, so several features exist to 2456and cause an annoying delay in display, so several features exist to
2500work around this. 2457work around this.
@@ -2534,12 +2491,6 @@ Also see the documentation for the function @code{font-lock-mode},
2534available by typing @kbd{C-h f font-lock-mode} (@kbd{M-x 2491available by typing @kbd{C-h f font-lock-mode} (@kbd{M-x
2535describe-function @key{RET} font-lock-mode @key{RET}}). 2492describe-function @key{RET} font-lock-mode @key{RET}}).
2536 2493
2537For more information on font-lock mode, take a look at the
2538@code{font-lock-mode} FAQ, maintained by
2539@email{jari.aalto@@ntc.nokia.com, Jari Aalto} at
2540
2541@uref{ftp://cs.uta.fi/pub/ssjaaa/ema-font.gui}
2542
2543To print buffers with the faces (i.e., colors and fonts) intact, use 2494To print buffers with the faces (i.e., colors and fonts) intact, use
2544@kbd{M-x ps-print-buffer-with-faces} or @kbd{M-x 2495@kbd{M-x ps-print-buffer-with-faces} or @kbd{M-x
2545ps-print-region-with-faces}. You will need a way to send text to a 2496ps-print-region-with-faces}. You will need a way to send text to a
@@ -2570,7 +2521,7 @@ Use @code{delete-selection-mode}, which you can start automatically by
2570placing the following Lisp form in your @file{.emacs} file: 2521placing the following Lisp form in your @file{.emacs} file:
2571 2522
2572@lisp 2523@lisp
2573(delete-selection-mode t) 2524(delete-selection-mode 1)
2574@end lisp 2525@end lisp
2575 2526
2576According to the documentation string for @code{delete-selection-mode} 2527According to the documentation string for @code{delete-selection-mode}
@@ -2686,41 +2637,10 @@ type @kbd{C-h C-e} to read it.
2686@cindex Files, maximum size 2637@cindex Files, maximum size
2687 2638
2688Old versions (i.e., anything before 19.29) of Emacs had problems editing 2639Old versions (i.e., anything before 19.29) of Emacs had problems editing
2689files larger than 8 megabytes. As of version 19.29, the maximum buffer 2640files larger than 8 megabytes. In versions 19.29 and later, the maximum
2690size is at least 2^27-1, or 134,217,727 bytes, or 132 MBytes. Emacs 20 2641buffer size is at least 2^27-1, or 134,217,727 bytes, or 132 MBytes.
2691can be compiled on some 64-bit systems in a way that enlarges the buffer 2642And in Emacs 22, the maximum buffer size has been increased to
2692size up to 576,460,752,303,423,487 bytes, or 549,755,813 GBytes. 2643268,435,455 bytes (or 256 MBytes) on 32-bit machines.
2693
2694If you are using a version of Emacs older than 19.29 and cannot upgrade,
2695you will have to recompile. @email{lnz@@lucid.com, Leonard N. Zubkoff}
2696suggests putting the following two lines in @file{src/config.h} before
2697compiling Emacs to allow for 26-bit integers and pointers (and thus file
2698sizes of up to 33,554,431 bytes):
2699
2700@example
2701#define VALBITS 26
2702#define GCTYPEBITS 5
2703@end example
2704
2705@noindent
2706This method may result in ``ILLEGAL DATATYPE'' and other random errors on
2707some machines.
2708
2709@email{daveg@@csvax.cs.caltech.edu, David Gillespie} explains how this
2710problems crops up; while his numbers are true only for pre-19.29
2711versions of Emacs, the theory remains the same with current versions.
2712
2713@quotation
2714Emacs is largely written in a dialect of Lisp; Lisp is a freely-typed
2715language in the sense that you can put any value of any type into any
2716variable, or return it from a function, and so on. So each value
2717must carry a @dfn{tag} along with it identifying what kind of thing it
2718is, e.g., integer, pointer to a list, pointer to an editing buffer, and
2719so on. Emacs uses standard 32-bit integers for data objects, taking the
2720top 8 bits for the tag and the bottom 24 bits for the value. So
2721integers (and pointers) are somewhat restricted compared to true C
2722integers and pointers.
2723@end quotation
2724 2644
2725@node ^M in the shell buffer, Shell process exits abnormally, Problems with very large files, Bugs and problems 2645@node ^M in the shell buffer, Shell process exits abnormally, Problems with very large files, Bugs and problems
2726@section How do I get rid of @samp{^M} or echoed commands in my shell buffer? 2646@section How do I get rid of @samp{^M} or echoed commands in my shell buffer?
@@ -2785,9 +2705,10 @@ file:
2785(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m) 2705(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m)
2786@end smalllisp 2706@end smalllisp
2787 2707
2788On a related note: If your shell is echoing your input line in the shell 2708On a related note: if your shell is echoing your input line in the shell
2789buffer, you might want to try the following command in your shell 2709buffer, you might want to customize the @code{comint-process-echoes}
2790start-up file: 2710variable in your shell buffers, or try the following command in your
2711shell start-up file:
2791 2712
2792@example 2713@example
2793stty -icrnl -onlcr -echo susp ^Z 2714stty -icrnl -onlcr -echo susp ^Z
@@ -3456,7 +3377,6 @@ To get the Xmenu stuff to work, you need to find a copy of MIT's
3456* Emacs for Apple computers:: 3377* Emacs for Apple computers::
3457* Emacs for VMS and DECwindows:: 3378* Emacs for VMS and DECwindows::
3458* Modes for various languages:: 3379* Modes for various languages::
3459* Translating names to IP addresses::
3460@end menu 3380@end menu
3461 3381
3462@node Finding Emacs on the Internet, Finding a package with particular functionality, Finding Emacs and related packages, Finding Emacs and related packages 3382@node Finding Emacs on the Internet, Finding a package with particular functionality, Finding Emacs and related packages, Finding Emacs and related packages
@@ -3665,7 +3585,7 @@ Note that while many of these programs look similar to Emacs, they often
3665lack certain features, such as the Emacs Lisp extension language. 3585lack certain features, such as the Emacs Lisp extension language.
3666 3586
3667@node Emacs for Windows, Emacs for OS/2, Emacs for MS-DOS, Finding Emacs and related packages 3587@node Emacs for Windows, Emacs for OS/2, Emacs for MS-DOS, Finding Emacs and related packages
3668@section Where can I get Emacs for Microsoft Windows 3588@section Where can I get Emacs for Microsoft Windows?
3669@cindex FAQ for NT Emacs 3589@cindex FAQ for NT Emacs
3670@cindex Emacs for MS-Windows 3590@cindex Emacs for MS-Windows
3671@cindex Microsoft Windows, Emacs for 3591@cindex Microsoft Windows, Emacs for
@@ -3745,8 +3665,7 @@ Beginning with version 21.1, the Macintosh is supported in the official
3745Emacs distribution; see the files @file{mac/README} and 3665Emacs distribution; see the files @file{mac/README} and
3746@file{mac/INSTALL} in the Emacs distribution for build instructions. 3666@file{mac/INSTALL} in the Emacs distribution for build instructions.
3747 3667
3748Apple's ``OS X'' is based largely on NeXTSTEP and OpenStep. 3668Beginning with version 22.1, Emacs supports Mac OS X natively.
3749@xref{Emacs for NeXTSTEP}, for more details about that version.
3750 3669
3751@node Emacs for VMS and DECwindows, Modes for various languages, Emacs for Apple computers, Finding Emacs and related packages 3670@node Emacs for VMS and DECwindows, Modes for various languages, Emacs for Apple computers, Finding Emacs and related packages
3752@section Where do I get Emacs that runs on VMS under DECwindows? 3671@section Where do I get Emacs that runs on VMS under DECwindows?
@@ -3756,7 +3675,7 @@ Apple's ``OS X'' is based largely on NeXTSTEP and OpenStep.
3756Up-to-date information about GNU software (including Emacs) for VMS is 3675Up-to-date information about GNU software (including Emacs) for VMS is
3757available at @uref{http://vms.gnu.org/}. 3676available at @uref{http://vms.gnu.org/}.
3758 3677
3759@node Modes for various languages, Translating names to IP addresses, Emacs for VMS and DECwindows, Finding Emacs and related packages 3678@node Modes for various languages, , Emacs for VMS and DECwindows, Finding Emacs and related packages
3760@section Where can I get modes for Lex, Yacc/Bison, Bourne shell, csh, C@t{++}, Objective-C, Pascal, Java, and Awk? 3679@section Where can I get modes for Lex, Yacc/Bison, Bourne shell, csh, C@t{++}, Objective-C, Pascal, Java, and Awk?
3761@cindex Awk, mode for 3680@cindex Awk, mode for
3762@cindex @code{awk-mode} 3681@cindex @code{awk-mode}
@@ -3781,37 +3700,6 @@ Barry Warsaw's @code{cc-mode} now works for C, C@t{++}, Objective-C, and
3781Java code. It is distributed with Emacs, but has 3700Java code. It is distributed with Emacs, but has
3782@uref{http://cc-mode.sourceforge.net/, its own homepage}. 3701@uref{http://cc-mode.sourceforge.net/, its own homepage}.
3783 3702
3784@node Translating names to IP addresses, , Modes for various languages, Finding Emacs and related packages
3785@section What is the IP address of XXX.YYY.ZZZ?
3786@cindex Translating names to IP addresses
3787@cindex IP addresses from names
3788@cindex Using BIND to translate addresses
3789@cindex DNS and IP addresses
3790
3791If you are on a Unix machine, try using the @samp{nslookup} command,
3792included in the Berkeley BIND package. For example, to find the IP
3793address of @samp{ftp.gnu.org}, you would type @code{nslookup
3794ftp.gnu.org}.
3795
3796Your computer should then provide the IP address of that machine.
3797
3798If your site's nameserver is deficient, you can use IP addresses to FTP
3799files. You can get this information by e-mail:
3800
3801@example
3802To: dns@@[134.214.84.25] (to grasp.insa-lyon.fr)
3803Body: ip XXX.YYY.ZZZ (or "help" for more information
3804 and options - no quotes)
3805@end example
3806
3807@noindent
3808or:
3809
3810@example
3811To: resolve@@[147.31.254.130] (to laverne.cs.widener.edu)
3812Body: site XXX.YYY.ZZZ
3813@end example
3814
3815@c ------------------------------------------------------------ 3703@c ------------------------------------------------------------
3816@node Major packages and programs, Key bindings, Finding Emacs and related packages, Top 3704@node Major packages and programs, Key bindings, Finding Emacs and related packages, Top
3817@chapter Major packages and programs 3705@chapter Major packages and programs
@@ -4183,6 +4071,7 @@ jde-subscribe@@sunsite.auc.dk
4183* Binding combinations of modifiers and function keys:: 4071* Binding combinations of modifiers and function keys::
4184* Meta key does not work in xterm:: 4072* Meta key does not work in xterm::
4185* ExtendChar key does not work as Meta:: 4073* ExtendChar key does not work as Meta::
4074* SPC no longer completes file names::
4186@end menu 4075@end menu
4187 4076
4188@node Binding keys to commands, Invalid prefix characters, Key bindings, Key bindings 4077@node Binding keys to commands, Invalid prefix characters, Key bindings, Key bindings
@@ -4200,7 +4089,7 @@ local-set-key @key{RET} @var{key} @var{cmd} @key{RET}}.
4200 4089
4201@inforef{Key Bindings, Key Bindings, emacs}, for further details. 4090@inforef{Key Bindings, Key Bindings, emacs}, for further details.
4202 4091
4203To make the process of binding keys interactively eaiser, use the 4092To make the process of binding keys interactively easier, use the
4204following ``trick'': First bind the key interactively, then immediately 4093following ``trick'': First bind the key interactively, then immediately
4205type @kbd{C-x @key{ESC} @key{ESC} C-a C-k C-g}. Now, the command needed 4094type @kbd{C-x @key{ESC} @key{ESC} C-a C-k C-g}. Now, the command needed
4206to bind the key is in the kill ring, and can be yanked into your 4095to bind the key is in the kill ring, and can be yanked into your
@@ -4829,7 +4718,7 @@ You might have to replace @samp{Meta} with @samp{Alt}.
4829 4718
4830@end itemize 4719@end itemize
4831 4720
4832@node ExtendChar key does not work as Meta, , Meta key does not work in xterm, Key bindings 4721@node ExtendChar key does not work as Meta, SPC no longer completes file names, Meta key does not work in xterm, Key bindings
4833@section Why doesn't my @key{ExtendChar} key work as a @key{Meta} key under HP-UX 8.0 and 9.x? 4722@section Why doesn't my @key{ExtendChar} key work as a @key{Meta} key under HP-UX 8.0 and 9.x?
4834@cindex @key{ExtendChar} key as @key{Meta} 4723@cindex @key{ExtendChar} key as @key{Meta}
4835@cindex @key{Meta}, using @key{ExtendChar} for 4724@cindex @key{Meta}, using @key{ExtendChar} for
@@ -4852,6 +4741,25 @@ xmodmap -e 'remove mod1 = Mode_switch'
4852This will disable the use of the extra keysyms systemwide, which may be 4741This will disable the use of the extra keysyms systemwide, which may be
4853undesirable if you actually intend to use them. 4742undesirable if you actually intend to use them.
4854 4743
4744@node SPC no longer completes file names, , ExtendChar key does not work as Meta, Key bindings
4745@section Why doesn't SPC complete file names anymore?
4746@cindex @kbd{SPC} file name completion
4747
4748Starting with Emacs 22.1, @kbd{SPC} no longer completes file names in
4749the minibuffer, so that file names with embedded spaces could be typed
4750without the need to quote the spaces.
4751
4752You can get the old behavior by binding @kbd{SPC} to
4753@code{minibuffer-complete-word} in the minibuffer, as follows:
4754
4755@lisp
4756(define-key minibuffer-local-filename-completion-map (kbd "SPC")
4757 'minibuffer-complete-word)
4758
4759(define-key minibuffer-local-must-match-filename-map (kbd "SPC")
4760 'minibuffer-complete-word)
4761@end lisp
4762
4855@c ------------------------------------------------------------ 4763@c ------------------------------------------------------------
4856@node Alternate character sets, Mail and news, Key bindings, Top 4764@node Alternate character sets, Mail and news, Key bindings, Top
4857@chapter Alternate character sets 4765@chapter Alternate character sets
@@ -5154,11 +5062,6 @@ best fix I've been able to come up with:
5154@cindex Mail packages and MIME 5062@cindex Mail packages and MIME
5155@cindex FAQ for MIME and Emacs 5063@cindex FAQ for MIME and Emacs
5156 5064
5157Read the Emacs MIME FAQ, maintained by @email{trey@@cs.berkeley.edu,
5158MacDonald Hall Jackson} at
5159
5160@uref{http://bmrc.berkeley.edu/~trey/emacs/mime.html}
5161
5162Version 6.x of VM supports MIME. @xref{VM}. Gnus supports MIME in mail 5065Version 6.x of VM supports MIME. @xref{VM}. Gnus supports MIME in mail
5163and news messages as of version 5.8.1 (Pterodactyl). Rmail has limited 5066and news messages as of version 5.8.1 (Pterodactyl). Rmail has limited
5164support for single-part MIME messages beginning with Emacs 20.3. 5067support for single-part MIME messages beginning with Emacs 20.3.
diff --git a/man/gnus.texi b/man/gnus.texi
index a588dd78974..2ab494a835d 100644
--- a/man/gnus.texi
+++ b/man/gnus.texi
@@ -24310,7 +24310,7 @@ to the Gnus back ends instead of Gnus proper.
24310@item nnheader-max-head-length 24310@item nnheader-max-head-length
24311@vindex nnheader-max-head-length 24311@vindex nnheader-max-head-length
24312When the back ends read straight heads of articles, they all try to read 24312When the back ends read straight heads of articles, they all try to read
24313as little as possible. This variable (default 4096) specifies 24313as little as possible. This variable (default 8192) specifies
24314the absolute max length the back ends will try to read before giving up 24314the absolute max length the back ends will try to read before giving up
24315on finding a separator line between the head and the body. If this 24315on finding a separator line between the head and the body. If this
24316variable is @code{nil}, there is no upper read bound. If it is 24316variable is @code{nil}, there is no upper read bound. If it is
@@ -24491,7 +24491,7 @@ On July 28th 1996 work on Red Gnus was begun, and it was released on
24491January 25th 1997 (after 84 releases) as ``Gnus 5.4'' (67 releases). 24491January 25th 1997 (after 84 releases) as ``Gnus 5.4'' (67 releases).
24492 24492
24493On September 13th 1997, Quassia Gnus was started and lasted 37 releases. 24493On September 13th 1997, Quassia Gnus was started and lasted 37 releases.
24494If was released as ``Gnus 5.6'' on March 8th 1998 (46 releases). 24494It was released as ``Gnus 5.6'' on March 8th 1998 (46 releases).
24495 24495
24496Gnus 5.6 begat Pterodactyl Gnus on August 29th 1998 and was released as 24496Gnus 5.6 begat Pterodactyl Gnus on August 29th 1998 and was released as
24497``Gnus 5.8'' (after 99 releases and a CVS repository) on December 3rd 24497``Gnus 5.8'' (after 99 releases and a CVS repository) on December 3rd
@@ -26032,7 +26032,7 @@ The new variable @code{gnus-parameters} can be used to set group parameters.
26032Earlier this was done only via @kbd{G p} (or @kbd{G c}), which stored 26032Earlier this was done only via @kbd{G p} (or @kbd{G c}), which stored
26033the parameters in @file{~/.newsrc.eld}, but via this variable you can 26033the parameters in @file{~/.newsrc.eld}, but via this variable you can
26034enjoy the powers of customize, and simplified backups since you set the 26034enjoy the powers of customize, and simplified backups since you set the
26035variable in @file{~/.emacs} instead of @file{~/.newsrc.eld}. The 26035variable in @file{~/.gnus.el} instead of @file{~/.newsrc.eld}. The
26036variable maps regular expressions matching group names to group 26036variable maps regular expressions matching group names to group
26037parameters, a'la: 26037parameters, a'la:
26038@lisp 26038@lisp
@@ -26047,7 +26047,7 @@ parameters, a'la:
26047@item 26047@item
26048Smileys (@samp{:-)}, @samp{;-)} etc) are now iconized for Emacs too. 26048Smileys (@samp{:-)}, @samp{;-)} etc) are now iconized for Emacs too.
26049 26049
26050Put @code{(setq gnus-treat-display-smileys nil)} in @file{~/.emacs} to 26050Put @code{(setq gnus-treat-display-smileys nil)} in @file{~/.gnus.el} to
26051disable it. 26051disable it.
26052 26052
26053@item 26053@item
@@ -26074,8 +26074,8 @@ appropriate headers and a note in the body for cross-postings and
26074followups (see the variables @code{message-cross-post-@var{*}}). 26074followups (see the variables @code{message-cross-post-@var{*}}).
26075 26075
26076@item 26076@item
26077References and X-Draft-Headers are no longer generated when you start 26077References and X-Draft-From headers are no longer generated when you
26078composing messages and @code{message-generate-headers-first} is 26078start composing messages and @code{message-generate-headers-first} is
26079@code{nil}. 26079@code{nil}.
26080 26080
26081@item 26081@item
@@ -26316,7 +26316,8 @@ It was aliased to @kbd{Y c}
26316(@code{gnus-summary-insert-cached-articles}). The new function filters 26316(@code{gnus-summary-insert-cached-articles}). The new function filters
26317out other articles. 26317out other articles.
26318 26318
26319@item Some limiting commands accept a @kbd{C-u} prefix to negate the match. 26319@item
26320Some limiting commands accept a @kbd{C-u} prefix to negate the match.
26320 26321
26321If @kbd{C-u} is used on subject, author or extra headers, i.e., @kbd{/ 26322If @kbd{C-u} is used on subject, author or extra headers, i.e., @kbd{/
26322s}, @kbd{/ a}, and @kbd{/ x} 26323s}, @kbd{/ a}, and @kbd{/ x}
@@ -26767,7 +26768,7 @@ minimum. You can, in fact, make do without them altogether---most of the
26767useful data is in the summary buffer, anyway. Set this variable to 26768useful data is in the summary buffer, anyway. Set this variable to
26768@samp{^NEVVVVER} or @samp{From:}, or whatever you feel you need. 26769@samp{^NEVVVVER} or @samp{From:}, or whatever you feel you need.
26769 26770
26770Set this hook to all the available hiding commands: 26771Use the following to enable all the available hiding features:
26771@lisp 26772@lisp
26772(setq gnus-treat-hide-headers 'head 26773(setq gnus-treat-hide-headers 'head
26773 gnus-treat-hide-signature t 26774 gnus-treat-hide-signature t
@@ -28495,8 +28496,10 @@ interpreted.) If you decide that you don't like the way Gnus does
28495certain things, it's trivial to have it do something a different way. 28496certain things, it's trivial to have it do something a different way.
28496(Well, at least if you know how to write Lisp code.) However, that's 28497(Well, at least if you know how to write Lisp code.) However, that's
28497beyond the scope of this manual, so we are simply going to talk about 28498beyond the scope of this manual, so we are simply going to talk about
28498some common constructs that you normally use in your @file{.emacs} file 28499some common constructs that you normally use in your @file{~/.gnus.el}
28499to customize Gnus. 28500file to customize Gnus. (You can also use the @file{~/.emacs} file, but
28501in order to set things of Gnus up, it is much better to use the
28502@file{~/.gnus.el} file, @xref{Startup Files}.)
28500 28503
28501If you want to set the variable @code{gnus-florgbnize} to four (4), you 28504If you want to set the variable @code{gnus-florgbnize} to four (4), you
28502write the following: 28505write the following:
@@ -28507,12 +28510,12 @@ write the following:
28507 28510
28508This function (really ``special form'') @code{setq} is the one that can 28511This function (really ``special form'') @code{setq} is the one that can
28509set a variable to some value. This is really all you need to know. Now 28512set a variable to some value. This is really all you need to know. Now
28510you can go and fill your @file{.emacs} file with lots of these to change 28513you can go and fill your @file{~/.gnus.el} file with lots of these to
28511how Gnus works. 28514change how Gnus works.
28512 28515
28513If you have put that thing in your @file{.emacs} file, it will be read 28516If you have put that thing in your @file{~/.gnus.el} file, it will be
28514and @code{eval}ed (which is lisp-ese for ``run'') the next time you 28517read and @code{eval}ed (which is Lisp-ese for ``run'') the next time you
28515start Emacs. If you want to change the variable right away, simply say 28518start Gnus. If you want to change the variable right away, simply say
28516@kbd{C-x C-e} after the closing parenthesis. That will @code{eval} the 28519@kbd{C-x C-e} after the closing parenthesis. That will @code{eval} the
28517previous ``form'', which is a simple @code{setq} statement here. 28520previous ``form'', which is a simple @code{setq} statement here.
28518 28521
diff --git a/man/killing.texi b/man/killing.texi
index 8353eb00bb3..5b5c55f4083 100644
--- a/man/killing.texi
+++ b/man/killing.texi
@@ -655,20 +655,29 @@ compatible with the Common User Access (CUA) system used in many other
655applications. @kbd{C-x} means cut (kill), @kbd{C-c} copy, @kbd{C-v} 655applications. @kbd{C-x} means cut (kill), @kbd{C-c} copy, @kbd{C-v}
656paste (yank), and @kbd{C-z} undo. Standard Emacs commands like 656paste (yank), and @kbd{C-z} undo. Standard Emacs commands like
657@kbd{C-x C-c} still work, because @kbd{C-x} and @kbd{C-c} only take 657@kbd{C-x C-c} still work, because @kbd{C-x} and @kbd{C-c} only take
658effect when the mark is active. However, if you don't want these 658effect when the mark is active (and the region is highlighted).
659bindings at all, set @code{cua-enable-cua-keys} to @code{nil}. 659However, if you don't want these bindings at all, set
660@code{cua-enable-cua-keys} to @code{nil}.
660 661
661 In CUA mode, using @kbd{Shift} together with the movement keys 662 In CUA mode, using @kbd{Shift} together with the movement keys
662activates the region over which they move. The standard (unshifted) 663activates and highlights the region over which they move. The
663movement keys deactivate the mark, and typed text replaces the active 664standard (unshifted) movement keys deactivate the mark, and typed text
664region as in Delete-Selection mode (@pxref{Graphical Kill}). 665replaces the active region as in Delete-Selection mode
666(@pxref{Graphical Kill}).
667
668 To run a command like @kbd{C-x C-f} while the mark is active, use
669one of the following methods: either hold @kbd{Shift} together with
670the prefix key, e.g. @kbd{S-C-x C-f}, or quickly type the prefix key
671twice, e.g. @kbd{C-x C-x C-f}.
665 672
666@cindex rectangle highlighting 673@cindex rectangle highlighting
667 CUA mode provides enhanced rectangle support with visible 674 CUA mode provides enhanced rectangle support with visible
668rectangle highlighting. Use @kbd{C-RET} to start a rectangle, 675rectangle highlighting. Use @kbd{C-RET} to start a rectangle,
669extend it using the movement commands, and cut or copy it using 676extend it using the movement commands, and cut or copy it using
670@kbd{C-x} or @kbd{C-c}. When a rectangle is active, text you type is 677@kbd{C-x} or @kbd{C-c}. @kbd{RET} moves the cursor to the next
671automatically inserted before or after each line in the rectangle. 678(clockwise) corner of the rectangle, so you can easily expand it in
679any direction. Normal text you type is inserted to the left or right
680of each line in the rectangle (on the same side as the cursor).
672 681
673 With CUA you can easily copy text and rectangles into and out of 682 With CUA you can easily copy text and rectangles into and out of
674registers by providing a one-digit numeric prefix the the kill, copy, 683registers by providing a one-digit numeric prefix the the kill, copy,
diff --git a/man/message.texi b/man/message.texi
index 35fb3e726c3..b2cd3aa782d 100644
--- a/man/message.texi
+++ b/man/message.texi
@@ -249,7 +249,10 @@ supersede the message in the current buffer.
249Headers matching the @code{message-ignored-supersedes-headers} are 249Headers matching the @code{message-ignored-supersedes-headers} are
250removed before popping up the new message buffer. The default is@* 250removed before popping up the new message buffer. The default is@*
251@samp{^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|@* 251@samp{^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|@*
252^Received:\\|^X-From-Line:\\|Return-Path:\\|^Supersedes:}. 252^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-Complaints-To:\\|@*
253Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|@*
254^X-Complaints-To:\\|^Cancel-Lock:\\|^Cancel-Key:\\|^X-Hashcash:\\|@*
255^X-Payment:}.
253 256
254 257
255 258
@@ -330,7 +333,7 @@ undeliverable.
330@vindex message-ignored-bounced-headers 333@vindex message-ignored-bounced-headers
331Headers that match the @code{message-ignored-bounced-headers} regexp 334Headers that match the @code{message-ignored-bounced-headers} regexp
332will be removed before popping up the buffer. The default is 335will be removed before popping up the buffer. The default is
333@samp{^\\(Received\\|Return-Path\\):}. 336@samp{^\\(Received\\|Return-Path\\|Delivered-To\\):}.
334 337
335 338
336@node Mailing Lists 339@node Mailing Lists
@@ -339,7 +342,7 @@ will be removed before popping up the buffer. The default is
339@cindex Mail-Followup-To 342@cindex Mail-Followup-To
340Sometimes while posting to mailing lists, the poster needs to direct 343Sometimes while posting to mailing lists, the poster needs to direct
341followups to the post to specific places. The Mail-Followup-To (MFT) 344followups to the post to specific places. The Mail-Followup-To (MFT)
342was created to enable just this. Two example scenarios where this is 345was created to enable just this. Three example scenarios where this is
343useful: 346useful:
344 347
345@itemize @bullet 348@itemize @bullet
@@ -681,26 +684,30 @@ stripped on replying, see @code{message-subject-trailing-was-query}
681@kindex C-c C-f x 684@kindex C-c C-f x
682@findex message-cross-post-followup-to 685@findex message-cross-post-followup-to
683@vindex message-cross-post-default 686@vindex message-cross-post-default
687@vindex message-cross-post-note-function
684@cindex X-Post 688@cindex X-Post
685@cindex cross-post 689@cindex cross-post
686Ask for an additional @samp{Newsgroups} and @samp{FollowUp-To} for a 690Set up the @samp{FollowUp-To} header with a target newsgroup for a
687cross-post. @code{message-cross-post-followup-to} mangles 691cross-post, add that target newsgroup to the @samp{Newsgroups} header if
688@samp{FollowUp-To} and @samp{Newsgroups} header to point to group. 692it is not a member of @samp{Newsgroups}, and insert a note in the body.
689If @code{message-cross-post-default} is @code{nil} or if called with a 693If @code{message-cross-post-default} is @code{nil} or if this command is
690prefix-argument @samp{Follow-Up} is set, but the message is not 694called with a prefix-argument, only the @samp{FollowUp-To} header will
691cross-posted. 695be set but the the target newsgroup will not be added to the
696@samp{Newsgroups} header. The function to insert a note is controlled
697by the @code{message-cross-post-note-function} variable.
692 698
693@item C-c C-f t 699@item C-c C-f t
694@kindex C-c C-f t 700@kindex C-c C-f t
695@findex message-reduce-to-to-cc 701@findex message-reduce-to-to-cc
696Replace contents of @samp{To} header with contents of @samp{Cc} or 702Replace contents of @samp{To} header with contents of @samp{Cc} or
697@samp{Bcc} header. 703@samp{Bcc} header. (Iff @samp{Cc} header is not present, @samp{Bcc}
704header will be used instead.)
698 705
699@item C-c C-f w 706@item C-c C-f w
700@kindex C-c C-f w 707@kindex C-c C-f w
701@findex message-insert-wide-reply 708@findex message-insert-wide-reply
702Insert @samp{To} and @samp{Cc} headers as if you were doing a wide 709Insert @samp{To} and @samp{Cc} headers as if you were doing a wide
703reply. 710reply even if the message was not made for a wide reply first.
704 711
705@item C-c C-f a 712@item C-c C-f a
706@kindex C-c C-f a 713@kindex C-c C-f a
@@ -839,8 +846,8 @@ typed a non-@acronym{ASCII} domain name.
839The @code{message-use-idna} variable control whether @acronym{IDNA} is 846The @code{message-use-idna} variable control whether @acronym{IDNA} is
840used. If the variable is @code{nil} no @acronym{IDNA} encoding will 847used. If the variable is @code{nil} no @acronym{IDNA} encoding will
841ever happen, if it is set to the symbol @code{ask} the user will be 848ever happen, if it is set to the symbol @code{ask} the user will be
842queried, and if set to @code{t} @acronym{IDNA} encoding happens 849queried, and if set to @code{t} (which is the default if @acronym{IDNA}
843automatically (the default). 850is fully available) @acronym{IDNA} encoding happens automatically.
844 851
845@findex message-idna-to-ascii-rhs 852@findex message-idna-to-ascii-rhs
846If you want to experiment with the @acronym{IDNA} encoding, you can 853If you want to experiment with the @acronym{IDNA} encoding, you can
@@ -1081,7 +1088,7 @@ The text is killed and replaced with the contents of the variable
1081(@samp{[...]}). 1088(@samp{[...]}).
1082 1089
1083@item C-c C-z 1090@item C-c C-z
1084@kindex C-c C-x 1091@kindex C-c C-z
1085@findex message-kill-to-signature 1092@findex message-kill-to-signature
1086Kill all the text up to the signature, or if that's missing, up to the 1093Kill all the text up to the signature, or if that's missing, up to the
1087end of the message (@code{message-kill-to-signature}). 1094end of the message (@code{message-kill-to-signature}).
@@ -1125,9 +1132,9 @@ prompt for a new buffer name.
1125@kindex TAB 1132@kindex TAB
1126@findex message-tab 1133@findex message-tab
1127@vindex message-tab-body-function 1134@vindex message-tab-body-function
1128If non-@code{nil} execute the function specified in 1135If @code{message-tab-body-function} is non-@code{nil}, execute the
1129@code{message-tab-body-function}. Otherwise use the function bound to 1136function it specifies. Otherwise use the function bound to @kbd{TAB} in
1130@kbd{TAB} in @code{text-mode-map} or @code{global-map}. 1137@code{text-mode-map} or @code{global-map}.
1131 1138
1132@end table 1139@end table
1133 1140
@@ -1417,13 +1424,14 @@ header when the message is already @code{Cc}ed to the recipient.
1417@item message-required-mail-headers 1424@item message-required-mail-headers
1418@vindex message-required-mail-headers 1425@vindex message-required-mail-headers
1419@xref{News Headers}, for the syntax of this variable. It is 1426@xref{News Headers}, for the syntax of this variable. It is
1420@code{(From Date Subject (optional . In-Reply-To) Message-ID Lines 1427@code{(From Subject Date (optional . In-Reply-To) Message-ID
1421(optional . User-Agent))} by default. 1428(optional . User-Agent))} by default.
1422 1429
1423@item message-ignored-mail-headers 1430@item message-ignored-mail-headers
1424@vindex message-ignored-mail-headers 1431@vindex message-ignored-mail-headers
1425Regexp of headers to be removed before mailing. The default is 1432Regexp of headers to be removed before mailing. The default is@*
1426@samp{^[GF]cc:\\|^Resent-Fcc:\\|^Xref:\\|^X-Draft-From:}. 1433@samp{^[GF]cc:\\|^Resent-Fcc:\\|^Xref:\\|^X-Draft-From:\\|@*
1434^X-Gnus-Agent-Meta-Information:}.
1427 1435
1428@item message-default-mail-headers 1436@item message-default-mail-headers
1429@vindex message-default-mail-headers 1437@vindex message-default-mail-headers
@@ -1694,7 +1702,8 @@ All these conditions are checked by default.
1694@item message-ignored-news-headers 1702@item message-ignored-news-headers
1695@vindex message-ignored-news-headers 1703@vindex message-ignored-news-headers
1696Regexp of headers to be removed before posting. The default is@* 1704Regexp of headers to be removed before posting. The default is@*
1697@samp{^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|^X-Draft-From:}. 1705@samp{^NNTP-Posting-Host:\\|^Xref:\\|^[BGF]cc:\\|^Resent-Fcc:\\|@*
1706^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:}.
1698 1707
1699@item message-default-news-headers 1708@item message-default-news-headers
1700@vindex message-default-news-headers 1709@vindex message-default-news-headers
@@ -1847,12 +1856,13 @@ say.
1847@item message-default-charset 1856@item message-default-charset
1848@vindex message-default-charset 1857@vindex message-default-charset
1849@cindex charset 1858@cindex charset
1850Symbol naming a @acronym{MIME} charset. Non-@acronym{ASCII} 1859Symbol naming a @acronym{MIME} charset. Non-@acronym{ASCII} characters
1851characters in messages are assumed to be encoded using this charset. 1860in messages are assumed to be encoded using this charset. The default
1852The default is @code{nil}, which means ask the user. (This variable 1861is @code{iso-8859-1} on non-@sc{mule} Emacsen; otherwise @code{nil},
1853is used only on non-@sc{mule} Emacsen. @xref{Charset Translation, , 1862which means ask the user. (This variable is used only on non-@sc{mule}
1854Charset Translation, emacs-mime, Emacs MIME Manual}, for details on 1863Emacsen.) @xref{Charset Translation, , Charset Translation, emacs-mime,
1855the @sc{mule}-to-@acronym{MIME} translation process. 1864Emacs MIME Manual}, for details on the @sc{mule}-to-@acronym{MIME}
1865translation process.
1856 1866
1857@item message-signature-separator 1867@item message-signature-separator
1858@vindex message-signature-separator 1868@vindex message-signature-separator
@@ -1954,8 +1964,11 @@ message composition doesn't break too bad.
1954 1964
1955@item message-send-method-alist 1965@item message-send-method-alist
1956@vindex message-send-method-alist 1966@vindex message-send-method-alist
1957 1967@findex message-mail-p
1958Alist of ways to send outgoing messages. Each element has the form 1968@findex message-news-p
1969@findex message-send-via-mail
1970@findex message-send-via-news
1971Alist of ways to send outgoing messages. Each element has the form:
1959 1972
1960@lisp 1973@lisp
1961(@var{type} @var{predicate} @var{function}) 1974(@var{type} @var{predicate} @var{function})
@@ -1967,20 +1980,32 @@ A symbol that names the method.
1967 1980
1968@item predicate 1981@item predicate
1969A function called without any parameters to determine whether the 1982A function called without any parameters to determine whether the
1970message is a message of type @var{type}. 1983message is a message of type @var{type}. The function will be called in
1984the buffer where the message is.
1971 1985
1972@item function 1986@item function
1973A function to be called if @var{predicate} returns non-@code{nil}. 1987A function to be called if @var{predicate} returns non-@code{nil}.
1974@var{function} is called with one parameter -- the prefix. 1988@var{function} is called with one parameter -- the prefix.
1975@end table 1989@end table
1976 1990
1991The default is:
1992
1977@lisp 1993@lisp
1978((news message-news-p message-send-via-news) 1994((news message-news-p message-send-via-news)
1979 (mail message-mail-p message-send-via-mail)) 1995 (mail message-mail-p message-send-via-mail))
1980@end lisp 1996@end lisp
1981 1997
1982 1998The @code{message-news-p} function returns non-@code{nil} if the message
1983 1999looks like news, and the @code{message-send-via-news} function sends the
2000message according to the @code{message-send-news-function} variable
2001(@pxref{News Variables}). The @code{message-mail-p} function returns
2002non-@code{nil} if the message looks like mail, and the
2003@code{message-send-via-mail} function sends the message according to the
2004@code{message-send-mail-function} variable (@pxref{Mail Variables}).
2005
2006All the elements in this alist will be tried in order, so a message
2007containing both a valid @samp{Newsgroups} header and a valid @samp{To}
2008header, for example, will be sent as news, and then as mail.
1984@end table 2009@end table
1985 2010
1986 2011
diff --git a/man/mini.texi b/man/mini.texi
index 5264a13bd9a..a39251dedea 100644
--- a/man/mini.texi
+++ b/man/mini.texi
@@ -198,14 +198,16 @@ into a longer string that it stands for, by matching it against a set of
198argument. @kbd{?} is defined to display a list of possible completions 198argument. @kbd{?} is defined to display a list of possible completions
199of what you have inserted. 199of what you have inserted.
200 200
201 For example, when @kbd{M-x} uses the minibuffer to read the name of a 201 For example, when @kbd{M-x} uses the minibuffer to read the name of
202command, it provides a list of all available Emacs command names to 202a command, it provides a list of all available Emacs command names to
203complete against. The completion keys match the minibuffer text 203complete against. The completion keys match the minibuffer text
204against all the command names, find any additional name characters 204against all the command names, find any additional name characters
205implied by the ones already present in the minibuffer, and add those 205implied by the ones already present in the minibuffer, and add those
206characters to the ones you have given. This is what makes it possible 206characters to the ones you have given. This is what makes it possible
207to type @kbd{M-x ins @key{SPC} b @key{RET}} instead of @kbd{M-x 207to type @kbd{M-x ins @key{SPC} b @key{RET}} instead of @kbd{M-x
208insert-buffer @key{RET}} (for example). 208insert-buffer @key{RET}} (for example). (@key{SPC} does not do
209completion in reading file names, because it is common to use spaces
210in file names on some systems.)
209 211
210 Case is normally significant in completion, because it is significant 212 Case is normally significant in completion, because it is significant
211in most of the names that you can complete (buffer names, file names and 213in most of the names that you can complete (buffer names, file names and
@@ -260,8 +262,10 @@ when completion is available.
260Complete the text before point in the minibuffer as much as possible 262Complete the text before point in the minibuffer as much as possible
261(@code{minibuffer-complete}). 263(@code{minibuffer-complete}).
262@item @key{SPC} 264@item @key{SPC}
263Complete the minibuffer text before point, but don't go beyond one word 265Complete the minibuffer text before point, but don't go beyond one
264(@code{minibuffer-complete-word}). 266word (@code{minibuffer-complete-word}). @key{SPC} for completion is
267not available when entering a file name, since some users often put
268spaces in filenames.
265@item @key{RET} 269@item @key{RET}
266Submit the text in the minibuffer as the argument, possibly completing 270Submit the text in the minibuffer as the argument, possibly completing
267first as described 271first as described
diff --git a/man/org.texi b/man/org.texi
index d4602db4a2a..7521ce624e1 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 3.22 7@set VERSION 3.23
8@set DATE December 2005 8@set DATE December 2005
9 9
10@dircategory Emacs 10@dircategory Emacs
@@ -469,7 +469,10 @@ visible.
469@table @kbd 469@table @kbd
470@kindex M-@key{RET} 470@kindex M-@key{RET}
471@item M-@key{RET} 471@item M-@key{RET}
472Insert new heading with same level as current 472Insert new heading with same level as current. If the cursor is in a
473plain list item, a new item is created. To force creation of a new
474headline, use a prefix arg, or first press @key{RET} to get to the
475beginning of the next line.
473@kindex M-S-@key{RET} 476@kindex M-S-@key{RET}
474@item M-S-@key{RET} 477@item M-S-@key{RET}
475Insert new TODO entry with same level as current heading. 478Insert new TODO entry with same level as current heading.
@@ -632,6 +635,9 @@ Items can be folded just like headline levels if you set the variable
632given by the indentation of the bullet/number. However, items are 635given by the indentation of the bullet/number. However, items are
633always subortinate to real headlines, the hierarchies remain 636always subortinate to real headlines, the hierarchies remain
634completely separated. 637completely separated.
638@kindex M-@key{RET}
639@item M-@key{RET}
640Insert new item at current level. With prefix arg, for a new heading.
635@kindex M-S-@key{up} 641@kindex M-S-@key{up}
636@kindex M-S-@key{down} 642@kindex M-S-@key{down}
637@item M-S-@key{up} 643@item M-S-@key{up}
diff --git a/man/pgg.texi b/man/pgg.texi
index 2475cf56817..9096be419d2 100644
--- a/man/pgg.texi
+++ b/man/pgg.texi
@@ -177,9 +177,8 @@ obtained from the passphrase cache or user.
177 177
178@deffn Command pgg-verify-region start end &optional signature fetch 178@deffn Command pgg-verify-region start end &optional signature fetch
179Verify the current region between @var{start} and @var{end}. If the 179Verify the current region between @var{start} and @var{end}. If the
180optional third argument @var{signature} is non-@code{nil}, or the function 180optional third argument @var{signature} is non-@code{nil}, it is treated
181is called interactively, it is treated as the detached signature of the 181as the detached signature file of the current region.
182current region.
183 182
184If the optional 4th argument @var{fetch} is non-@code{nil}, or the 183If the optional 4th argument @var{fetch} is non-@code{nil}, or the
185function is called interactively, we attempt to fetch the signer's 184function is called interactively, we attempt to fetch the signer's
@@ -204,22 +203,18 @@ considerably. For example, if you are using GnuPG, you know you can
204select cipher algorithm from 3DES, CAST5, BLOWFISH, and so on, but on 203select cipher algorithm from 3DES, CAST5, BLOWFISH, and so on, but on
205the other hand the version 2 of PGP only supports IDEA. 204the other hand the version 2 of PGP only supports IDEA.
206 205
207By default, if the variable @code{pgg-scheme} is not set, PGG searches the 206Which implementation is used is controlled by the @code{pgg-scheme}
208registered scheme for an implementation of the requested service 207variable. If it is @code{nil} (the default), the value of the
209associated with the named algorithm. If there are no match, PGG uses 208@code{pgg-default-scheme} variable will be used instead.
210@code{pgg-default-scheme}. In other words, there are two options to
211control which command is used to process the incoming PGP armors. One
212is for encrypting and signing, the other is for decrypting and
213verifying.
214 209
215@defvar pgg-scheme 210@defvar pgg-scheme
216Force specify the scheme of PGP implementation for decrypting and verifying. 211Force specify the scheme of PGP implementation. The value can be set to
217The value can be @code{gpg}, @code{pgp}, and @code{pgp5}. 212@code{gpg}, @code{pgp}, and @code{pgp5}. The default is @code{nil}.
218@end defvar 213@end defvar
219 214
220@defvar pgg-default-scheme 215@defvar pgg-default-scheme
221Force specify the scheme of PGP implementation for encrypting and signing. 216The default scheme of PGP implementation. The value should be one of
222The value can be @code{gpg}, @code{pgp}, and @code{pgp5}. 217@code{gpg}, @code{pgp}, and @code{pgp5}. The default is @code{gpg}.
223@end defvar 218@end defvar
224 219
225@node Caching passphrase 220@node Caching passphrase
diff --git a/nt/ChangeLog b/nt/ChangeLog
index ca1f8d94c46..dc8888b2c87 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,8 @@
12005-12-09 Eli Zaretskii <eliz@gnu.org>
2
3 * INSTALL: Add explanation of how to debug with GDB starting from
4 the Emacs Abort dialog.
5
12005-11-26 Chong Yidong <cyd@stupidchicken.com> 62005-11-26 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * emacs.rc: Use new icons. 8 * emacs.rc: Use new icons.
diff --git a/nt/INSTALL b/nt/INSTALL
index 2fb673d47d2..d756585ce20 100644
--- a/nt/INSTALL
+++ b/nt/INSTALL
@@ -243,7 +243,19 @@
243 243
244 You should be able to debug Emacs using the debugger that is 244 You should be able to debug Emacs using the debugger that is
245 appropriate for the compiler you used, namely DevStudio or Windbg if 245 appropriate for the compiler you used, namely DevStudio or Windbg if
246 compiled with MSVC, or gdb if compiled with gcc. 246 compiled with MSVC, or GDB if compiled with GCC.
247
248 When Emacs aborts due to a fatal internal error, Emacs on Windows
249 pops up an Emacs Abort Dialog asking you whether you want to debug
250 Emacs or terminate it. If Emacs was built with MSVC, click YES
251 twice, and Windbg or the DevStudio debugger will start up
252 automatically. If Emacs was built with GCC, first start GDB and
253 attach it to the Emacs process with the "gdb -p EMACS-PID" command,
254 where EMACS-PID is the Emacs process ID (which you can see in the
255 Windows Task Manager), type the "continue" command inside GDB, and
256 only then click YES on the abort dialog. This will pass control to
257 the debugger, and you will be able to debug the cause of the fatal
258 error.
247 259
248 Emacs functions implemented in C use a naming convention that reflects 260 Emacs functions implemented in C use a naming convention that reflects
249 their names in lisp. The names of the C routines are the lisp names 261 their names in lisp. The names of the C routines are the lisp names
@@ -254,17 +266,18 @@
254 easily set breakpoints or examine familiar lisp variables by name. 266 easily set breakpoints or examine familiar lisp variables by name.
255 267
256 Since Emacs data is often in the form of a lisp object, and the 268 Since Emacs data is often in the form of a lisp object, and the
257 Lisp_Object type is difficult to examine manually in the MSVC 269 Lisp_Object type is difficult to examine manually in a debugger,
258 debugger, Emacs provides a helper routine called debug_print that 270 Emacs provides a helper routine called debug_print that prints out a
259 prints out a readable representation of a Lisp_Object. (If you are 271 readable representation of a Lisp_Object. If you are using GDB,
260 using gdb, there is a .gdbinit file in the src directory which 272 there is a .gdbinit file in the src directory which provides
261 provides definitions that are useful for examining lisp objects. The 273 definitions that are useful for examining lisp objects. Therefore,
262 following tips are mainly of interest when using MSVC.) The output 274 the following tips are mainly of interest when using MSVC.
263 from debug_print is sent to stderr, and to the debugger via the 275
264 OutputDebugString routine. The output sent to stderr should be 276 The output from debug_print is sent to stderr, and to the debugger
265 displayed in the console window that was opened when the emacs.exe 277 via the OutputDebugString routine. The output sent to stderr should
266 executable was started. The output sent to the debugger should be 278 be displayed in the console window that was opened when the
267 displayed in its "Debug" output window. 279 emacs.exe executable was started. The output sent to the debugger
280 should be displayed in its "Debug" output window.
268 281
269 When you are in the process of debugging Emacs and you would like to 282 When you are in the process of debugging Emacs and you would like to
270 examine the contents of a Lisp_Object variable, popup the QuickWatch 283 examine the contents of a Lisp_Object variable, popup the QuickWatch
diff --git a/src/ChangeLog b/src/ChangeLog
index 4fa4093631f..4994e7e8d6a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,100 @@
12005-12-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * emacs.c (main) [MAC_OS8]: Undo previous change.
4
5 * macselect.c (syms_of_macselect) <mac-apple-event-map>:
6 Initialize to nil. Keymap is now created in lisp/term/mac-win.el.
7
82005-12-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9
10 * Makefile.in (macselect.o): Depend on keymap.h.
11
12 * emacs.c (main) [MAC_OS8]: Call syms_of_keymap before
13 syms_of_macselect.
14
15 * image.c (init_image) [MAC_OS]: Don't call EnterMovies.
16 [!HAVE_GIF && MAC_OS] (gif_load): Call EnterMovies.
17
18 * keyboard.c (Qmac_apple_event) [MAC_OS]: New variable.
19 (syms_of_keyboard) [MAC_OS]: Initialize it.
20 (make_lispy_event) [MAC_OS]: Build lisp event for MAC_APPLE_EVENT.
21
22 * mac.c (Qundecoded_file_name): New variable.
23 (syms_of_mac): Initialize it.
24 (mac_aelist_to_lisp, mac_aedesc_to_lisp): New functions.
25 [TARGET_API_MAC_CARBON] (create_apple_event_from_event_ref): New
26 function.
27 (Fmac_coerce_ae_data): New defun.
28 (syms_of_mac): Defsubr it.
29
30 * macselect.c: Include keymap.h.
31 (mac_ready_for_apple_events): New variable.
32 (Vmac_apple_event_map, Qmac_apple_event_class)
33 (Qmac_apple_event_id): New variables.
34 (syms_of_macselect): Initialize them.
35 (Qundefined, mac_store_apple_event): Add externs.
36 (struct apple_event_binding): New struct.
37 (find_event_binding_fun, find_event_binding)
38 (mac_find_apple_event_spec, defer_apple_events)
39 (mac_handle_apple_event, init_apple_event_handler)
40 (copy_scrap_flavor_data): New functions.
41 (Fmac_process_deferred_apple_events): New defun.
42 (syms_of_macselect): Defsubr it.
43 (mac_store_services_event): Fix extern.
44 (mac_handle_service_event): Don't allocate Lisp objects during
45 asynchronous input processing. Use mac_store_services_event
46 instead of mac_store_application_menu_event.
47
48 * macterm.c (Qmac_ready_for_drag_n_drop, Qapplication, Qabout)
49 (Qpreferences): Remove variables.
50 (syms_of_macterm) : Don't initialize them.
51 (Qhicommand) [USE_CARBON_EVENTS]: New variable.
52 (syms_of_macterm) [USE_CARBON_EVENTS]: Initialize it.
53 (init_required_apple_events, do_ae_open_application)
54 (do_ae_print_documents, do_ae_open_documents)
55 (do_ae_quit_application): Remove functions and prototypes.
56 (mac_ready_for_apple_events, Qundefined, init_apple_event_handler)
57 (mac_find_apple_event_spec): Add externs.
58 (mac_store_application_menu_event): Remove function.
59 (mac_store_apple_event, mac_make_lispy_event_code): New functions.
60 (mac_handle_command_event): Create Apple event from Carbon event.
61 Use mac_store_apple_event instead of mac_store_application_menu_event.
62 [MAC_OSX] (mac_store_services_event): Likewise.
63 (struct SelectionRange, SelectionRange): Remove struct and typedef.
64 [MAC_OS8] (main): Call init_apple_event_handler instead of
65 init_required_apple_events.
66 (mac_initialize) [MAC_OSX]: Likewise.
67 [!USE_CARBON_EVENTS] (mac_wait_next_event): Use
68 mac_ready_for_apple_events instead of Qmac_ready_for_drag_n_drop.
69
70 * macterm.h (mac_make_lispy_event_code, mac_aedesc_to_lisp): Add
71 externs.
72 (create_apple_event_from_event_ref) [TARGET_API_MAC_CARBON]: Likewise.
73 (Fmac_get_preference): Add EXFUN.
74
75 * termhooks.h (enum event_kind) [MAC_OS]: Add new MAC_APPLE_EVENT
76 event.
77
782005-12-09 Richard M. Stallman <rms@gnu.org>
79
80 * xfns.c (Fx_create_frame): Reinstate previous change.
81
822005-12-09 Eli Zaretskii <eliz@gnu.org>
83
84 * w32fns.c (w32_abort) [__GNUC__]: Add instructions for attaching
85 GDB to the abort dialog.
86
872005-12-09 Kyotaro HORIGUCHI <horiguti@meadowy.org> (tiny change)
88
89 * indent.c (Fvertical_motion): Force move if starting on
90 stretch glyph.
91
922005-12-08 Richard M. Stallman <rms@gnu.org>
93
94 * lread.c (read_escape) <\s>: Don't treat strings specially.
95
96 * xfns.c (Fx_create_frame): Comment out previous change.
97
12005-12-07 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu> 982005-12-07 L$,1 q(Brentey K,Aa(Broly <lorentey@elte.hu>
2 99
3 * xfns.c (Fx_create_frame): Initialize Vdefault_minibuffer_frame, 100 * xfns.c (Fx_create_frame): Initialize Vdefault_minibuffer_frame,
diff --git a/src/Makefile.in b/src/Makefile.in
index 7c9203d11ff..2799b3ff46b 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1261,7 +1261,7 @@ macterm.o: blockinput.h atimer.h systime.h syssignal.h macterm.h macgui.h \
1261 frame.h charset.h ccl.h dispextern.h fontset.h termhooks.h termopts.h \ 1261 frame.h charset.h ccl.h dispextern.h fontset.h termhooks.h termopts.h \
1262 termchar.h gnu.h disptab.h buffer.h window.h keyboard.h $(INTERVAL_SRC) \ 1262 termchar.h gnu.h disptab.h buffer.h window.h keyboard.h $(INTERVAL_SRC) \
1263 process.h coding.h $(config_h) 1263 process.h coding.h $(config_h)
1264macselect.o: blockinput.h macterm.h macgui.h frame.h $(config_h) 1264macselect.o: blockinput.h macterm.h macgui.h frame.h keymap.h $(config_h)
1265 1265
1266${emacsapp}Contents/Resources/English.lproj: 1266${emacsapp}Contents/Resources/English.lproj:
1267 mkdir -p $@ 1267 mkdir -p $@
diff --git a/src/image.c b/src/image.c
index d020b2ac394..8a6d40ae34f 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7778,6 +7778,9 @@ gif_load (f, img)
7778 specified_file = image_spec_value (img->spec, QCfile, NULL); 7778 specified_file = image_spec_value (img->spec, QCfile, NULL);
7779 specified_data = image_spec_value (img->spec, QCdata, NULL); 7779 specified_data = image_spec_value (img->spec, QCdata, NULL);
7780 7780
7781 /* Animated gifs use QuickTime Movie Toolbox. So initialize it here. */
7782 EnterMovies ();
7783
7781 if (NILP (specified_data)) 7784 if (NILP (specified_data))
7782 { 7785 {
7783 /* Read from a file */ 7786 /* Read from a file */
@@ -8500,14 +8503,9 @@ meaning don't clear the cache. */);
8500void 8503void
8501init_image () 8504init_image ()
8502{ 8505{
8503#ifdef MAC_OS 8506#if defined (MAC_OSX) && TARGET_API_MAC_CARBON
8504 /* Animated gifs use QuickTime Movie Toolbox. So initialize it here. */
8505 if (!inhibit_window_system)
8506 EnterMovies ();
8507#ifdef MAC_OSX
8508 init_image_func_pointer (); 8507 init_image_func_pointer ();
8509#endif 8508#endif
8510#endif
8511} 8509}
8512 8510
8513/* arch-tag: 123c2a5e-14a8-4c53-ab95-af47d7db49b9 8511/* arch-tag: 123c2a5e-14a8-4c53-ab95-af47d7db49b9
diff --git a/src/indent.c b/src/indent.c
index 68544e8059d..6ca15c67345 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2076,7 +2076,7 @@ whether or not it is currently displayed in some window. */)
2076 { 2076 {
2077 int it_start; 2077 int it_start;
2078 int oselective; 2078 int oselective;
2079 int start_on_image_p; 2079 int start_on_image_or_stretch_p;
2080 2080
2081 SET_TEXT_POS (pt, PT, PT_BYTE); 2081 SET_TEXT_POS (pt, PT, PT_BYTE);
2082 start_display (&it, w, pt); 2082 start_display (&it, w, pt);
@@ -2088,7 +2088,8 @@ whether or not it is currently displayed in some window. */)
2088 while the end position is really at some X > 0, the same X that 2088 while the end position is really at some X > 0, the same X that
2089 PT had. */ 2089 PT had. */
2090 it_start = IT_CHARPOS (it); 2090 it_start = IT_CHARPOS (it);
2091 start_on_image_p = (it.method == GET_FROM_IMAGE); 2091 start_on_image_or_stretch_p = (it.method == GET_FROM_IMAGE
2092 || it.method == GET_FROM_STRETCH);
2092 reseat_at_previous_visible_line_start (&it); 2093 reseat_at_previous_visible_line_start (&it);
2093 it.current_x = it.hpos = 0; 2094 it.current_x = it.hpos = 0;
2094 /* Temporarily disable selective display so we don't move too far */ 2095 /* Temporarily disable selective display so we don't move too far */
@@ -2099,9 +2100,10 @@ whether or not it is currently displayed in some window. */)
2099 2100
2100 /* Move back if we got too far. This may happen if 2101 /* Move back if we got too far. This may happen if
2101 truncate-lines is on and PT is beyond right margin. 2102 truncate-lines is on and PT is beyond right margin.
2102 It may also happen if it_start is on an image -- 2103 It may also happen if it_start is on an image or a stretch
2103 in that case, don't go back. */ 2104 glyph -- in that case, don't go back. */
2104 if (IT_CHARPOS (it) > it_start && XINT (lines) > 0 && !start_on_image_p) 2105 if (IT_CHARPOS (it) > it_start && XINT (lines) > 0
2106 && !start_on_image_or_stretch_p)
2105 move_it_by_lines (&it, -1, 0); 2107 move_it_by_lines (&it, -1, 0);
2106 2108
2107 it.vpos = 0; 2109 it.vpos = 0;
diff --git a/src/keyboard.c b/src/keyboard.c
index 7a918608dd7..51b59432214 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -514,6 +514,9 @@ Lisp_Object Qlanguage_change;
514#endif 514#endif
515Lisp_Object Qdrag_n_drop; 515Lisp_Object Qdrag_n_drop;
516Lisp_Object Qsave_session; 516Lisp_Object Qsave_session;
517#ifdef MAC_OS
518Lisp_Object Qmac_apple_event;
519#endif
517 520
518/* Lisp_Object Qmouse_movement; - also an event header */ 521/* Lisp_Object Qmouse_movement; - also an event header */
519 522
@@ -5915,6 +5918,20 @@ make_lispy_event (event)
5915 case SAVE_SESSION_EVENT: 5918 case SAVE_SESSION_EVENT:
5916 return Qsave_session; 5919 return Qsave_session;
5917 5920
5921#ifdef MAC_OS
5922 case MAC_APPLE_EVENT:
5923 {
5924 Lisp_Object spec[2];
5925
5926 spec[0] = event->x;
5927 spec[1] = event->y;
5928 return Fcons (Qmac_apple_event,
5929 Fcons (Fvector (2, spec),
5930 Fcons (mac_make_lispy_event_code (event->code),
5931 Qnil)));
5932 }
5933#endif
5934
5918 /* The 'kind' field of the event is something we don't recognize. */ 5935 /* The 'kind' field of the event is something we don't recognize. */
5919 default: 5936 default:
5920 abort (); 5937 abort ();
@@ -11074,6 +11091,11 @@ syms_of_keyboard ()
11074 Qsave_session = intern ("save-session"); 11091 Qsave_session = intern ("save-session");
11075 staticpro (&Qsave_session); 11092 staticpro (&Qsave_session);
11076 11093
11094#ifdef MAC_OS
11095 Qmac_apple_event = intern ("mac-apple-event");
11096 staticpro (&Qmac_apple_event);
11097#endif
11098
11077 Qusr1_signal = intern ("usr1-signal"); 11099 Qusr1_signal = intern ("usr1-signal");
11078 staticpro (&Qusr1_signal); 11100 staticpro (&Qusr1_signal);
11079 Qusr2_signal = intern ("usr2-signal"); 11101 Qusr2_signal = intern ("usr2-signal");
diff --git a/src/lread.c b/src/lread.c
index 234fbe6e395..e6f1987a50b 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1739,13 +1739,12 @@ read_escape (readcharfun, stringp, byterep)
1739 return c | alt_modifier; 1739 return c | alt_modifier;
1740 1740
1741 case 's': 1741 case 's':
1742 if (stringp)
1743 return ' ';
1744 c = READCHAR; 1742 c = READCHAR;
1745 if (c != '-') { 1743 if (c != '-')
1746 UNREAD (c); 1744 {
1747 return ' '; 1745 UNREAD (c);
1748 } 1746 return ' ';
1747 }
1749 c = READCHAR; 1748 c = READCHAR;
1750 if (c == '\\') 1749 if (c == '\\')
1751 c = read_escape (readcharfun, 0, byterep); 1750 c = read_escape (readcharfun, 0, byterep);
diff --git a/src/mac.c b/src/mac.c
index 76ba3d41798..1d306c429d7 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -259,6 +259,216 @@ posix_to_mac_pathname (const char *ufn, char *mfn, int mfnbuflen)
259 259
260 260
261/*********************************************************************** 261/***********************************************************************
262 Conversions on Apple event objects
263 ***********************************************************************/
264
265static Lisp_Object Qundecoded_file_name;
266
267static Lisp_Object
268mac_aelist_to_lisp (desc_list)
269 AEDescList *desc_list;
270{
271 OSErr err;
272 long count;
273 Lisp_Object result, elem;
274 DescType desc_type;
275 Size size;
276 AEKeyword keyword;
277 AEDesc desc;
278
279 err = AECountItems (desc_list, &count);
280 if (err != noErr)
281 return Qnil;
282 result = Qnil;
283 while (count > 0)
284 {
285 err = AESizeOfNthItem (desc_list, count, &desc_type, &size);
286 if (err == noErr)
287 switch (desc_type)
288 {
289 case typeAEList:
290 case typeAERecord:
291 case typeAppleEvent:
292 err = AEGetNthDesc (desc_list, count, typeWildCard,
293 &keyword, &desc);
294 if (err != noErr)
295 break;
296 elem = mac_aelist_to_lisp (&desc);
297 AEDisposeDesc (&desc);
298 break;
299
300 default:
301 if (desc_type == typeNull)
302 elem = Qnil;
303 else
304 {
305 elem = make_uninit_string (size);
306 err = AEGetNthPtr (desc_list, count, typeWildCard, &keyword,
307 &desc_type, SDATA (elem), size, &size);
308 }
309 if (err != noErr)
310 break;
311 desc_type = EndianU32_NtoB (desc_type);
312 elem = Fcons (make_unibyte_string ((char *) &desc_type, 4), elem);
313 break;
314 }
315
316 if (err != noErr)
317 elem = Qnil;
318 else if (desc_list->descriptorType != typeAEList)
319 {
320 keyword = EndianU32_NtoB (keyword);
321 elem = Fcons (make_unibyte_string ((char *) &keyword, 4), elem);
322 }
323
324 result = Fcons (elem, result);
325 count--;
326 }
327
328 desc_type = EndianU32_NtoB (desc_list->descriptorType);
329 return Fcons (make_unibyte_string ((char *) &desc_type, 4), result);
330}
331
332Lisp_Object
333mac_aedesc_to_lisp (desc)
334 AEDesc *desc;
335{
336 OSErr err;
337 DescType desc_type = desc->descriptorType;
338 Lisp_Object result;
339
340 switch (desc_type)
341 {
342 case typeNull:
343 result = Qnil;
344 break;
345
346 case typeAEList:
347 case typeAERecord:
348 case typeAppleEvent:
349 return mac_aelist_to_lisp (desc);
350#if 0
351 /* The following one is much simpler, but creates and disposes
352 of Apple event descriptors many times. */
353 {
354 long count;
355 Lisp_Object elem;
356 AEKeyword keyword;
357 AEDesc desc1;
358
359 err = AECountItems (desc, &count);
360 if (err != noErr)
361 break;
362 result = Qnil;
363 while (count > 0)
364 {
365 err = AEGetNthDesc (desc, count, typeWildCard, &keyword, &desc1);
366 if (err != noErr)
367 break;
368 elem = mac_aedesc_to_lisp (&desc1);
369 AEDisposeDesc (&desc1);
370 if (desc_type != typeAEList)
371 {
372 keyword = EndianU32_NtoB (keyword);
373 elem = Fcons (make_unibyte_string ((char *) &keyword, 4), elem);
374 }
375 result = Fcons (elem, result);
376 count--;
377 }
378 }
379#endif
380 break;
381
382 default:
383#if TARGET_API_MAC_CARBON
384 result = make_uninit_string (AEGetDescDataSize (desc));
385 err = AEGetDescData (desc, SDATA (result), SBYTES (result));
386#else
387 result = make_uninit_string (GetHandleSize (desc->dataHandle));
388 memcpy (SDATA (result), *(desc->dataHandle), SBYTES (result));
389#endif
390 break;
391 }
392
393 if (err != noErr)
394 return Qnil;
395
396 desc_type = EndianU32_NtoB (desc_type);
397 return Fcons (make_unibyte_string ((char *) &desc_type, 4), result);
398}
399
400#if TARGET_API_MAC_CARBON
401OSErr
402create_apple_event_from_event_ref (event, num_params, names,
403 types, sizes, result)
404 EventRef event;
405 UInt32 num_params;
406 EventParamName *names;
407 EventParamType *types;
408 UInt32 *sizes;
409 AppleEvent *result;
410{
411 OSErr err;
412 static const ProcessSerialNumber psn = {0, kCurrentProcess};
413 AEAddressDesc address_desc;
414 UInt32 i;
415 CFStringRef string;
416 CFDataRef data;
417 char *buf;
418
419 err = AECreateDesc (typeProcessSerialNumber, &psn,
420 sizeof (ProcessSerialNumber), &address_desc);
421 if (err == noErr)
422 {
423 err = AECreateAppleEvent (0, 0, /* Dummy class and ID. */
424 &address_desc, /* NULL is not allowed
425 on Mac OS Classic. */
426 kAutoGenerateReturnID,
427 kAnyTransactionID, result);
428 AEDisposeDesc (&address_desc);
429 }
430 if (err != noErr)
431 return err;
432
433 for (i = 0; i < num_params; i++)
434 switch (types[i])
435 {
436#ifdef MAC_OSX
437 case typeCFStringRef:
438 err = GetEventParameter (event, names[i], typeCFStringRef, NULL,
439 sizeof (CFStringRef), NULL, &string);
440 if (err != noErr)
441 break;
442 data = CFStringCreateExternalRepresentation (NULL, string,
443 kCFStringEncodingUTF8,
444 '?');
445 if (data == NULL)
446 break;
447 /* typeUTF8Text is not available on Mac OS X 10.1. */
448 AEPutParamPtr (result, names[i], 'utf8',
449 CFDataGetBytePtr (data), CFDataGetLength (data));
450 CFRelease (data);
451 break;
452#endif
453
454 default:
455 buf = xmalloc (sizes[i]);
456 if (buf == NULL)
457 break;
458 err = GetEventParameter (event, names[i], types[i], NULL,
459 sizes[i], NULL, buf);
460 if (err == noErr)
461 AEPutParamPtr (result, names[i], types[i], buf, sizes[i]);
462 xfree (buf);
463 break;
464 }
465
466 return noErr;
467}
468#endif
469
470
471/***********************************************************************
262 Conversion between Lisp and Core Foundation objects 472 Conversion between Lisp and Core Foundation objects
263 ***********************************************************************/ 473 ***********************************************************************/
264 474
@@ -3887,6 +4097,116 @@ DEFUN ("posix-file-name-to-mac", Fposix_file_name_to_mac,
3887} 4097}
3888 4098
3889 4099
4100DEFUN ("mac-coerce-ae-data", Fmac_coerce_ae_data, Smac_coerce_ae_data, 3, 3, 0,
4101 doc: /* Coerce Apple event data SRC-DATA of type SRC-TYPE to DST-TYPE.
4102Each type should be a string of length 4 or the symbol
4103`undecoded-file-name'. */)
4104 (src_type, src_data, dst_type)
4105 Lisp_Object src_type, src_data, dst_type;
4106{
4107 OSErr err;
4108 Lisp_Object result = Qnil;
4109 DescType src_desc_type, dst_desc_type;
4110 AEDesc dst_desc;
4111#ifdef MAC_OSX
4112 FSRef fref;
4113#else
4114 FSSpec fs;
4115#endif
4116
4117 CHECK_STRING (src_data);
4118 if (EQ (src_type, Qundecoded_file_name))
4119 {
4120#ifdef MAC_OSX
4121 src_desc_type = typeFileURL;
4122#else
4123 src_desc_type = typeFSS;
4124#endif
4125 }
4126 else
4127 src_desc_type = mac_get_code_from_arg (src_type, 0);
4128
4129 if (EQ (dst_type, Qundecoded_file_name))
4130 {
4131#ifdef MAC_OSX
4132 dst_desc_type = typeFSRef;
4133#else
4134 dst_desc_type = typeFSS;
4135#endif
4136 }
4137 else
4138 dst_desc_type = mac_get_code_from_arg (dst_type, 0);
4139
4140 BLOCK_INPUT;
4141 if (EQ (src_type, Qundecoded_file_name))
4142 {
4143#ifdef MAC_OSX
4144 CFStringRef str;
4145 CFURLRef url = NULL;
4146 CFDataRef data = NULL;
4147
4148 str = cfstring_create_with_utf8_cstring (SDATA (src_data));
4149 if (str)
4150 {
4151 url = CFURLCreateWithFileSystemPath (NULL, str,
4152 kCFURLPOSIXPathStyle, false);
4153 CFRelease (str);
4154 }
4155 if (url)
4156 {
4157 data = CFURLCreateData (NULL, url, kCFStringEncodingUTF8, true);
4158 CFRelease (url);
4159 }
4160 if (data)
4161 err = AECoercePtr (src_desc_type, CFDataGetBytePtr (data),
4162 CFDataGetLength (data),
4163 dst_desc_type, &dst_desc);
4164 else
4165 err = memFullErr;
4166#else
4167 err = posix_pathname_to_fsspec (SDATA (src_data), &fs);
4168 if (err == noErr)
4169 AECoercePtr (src_desc_type, &fs, sizeof (FSSpec),
4170 dst_desc_type, &dst_desc);
4171#endif
4172 }
4173 else
4174 err = AECoercePtr (src_desc_type, SDATA (src_data), SBYTES (src_data),
4175 dst_desc_type, &dst_desc);
4176
4177 if (err == noErr)
4178 {
4179 if (EQ (dst_type, Qundecoded_file_name))
4180 {
4181 char file_name[MAXPATHLEN];
4182
4183#ifdef MAC_OSX
4184 err = AEGetDescData (&dst_desc, &fref, sizeof (FSRef));
4185 if (err == noErr)
4186 err = FSRefMakePath (&fref, file_name, sizeof (file_name));
4187#else
4188#if TARGET_API_MAC_CARBON
4189 err = AEGetDescData (&dst_desc, &fs, sizeof (FSSpec));
4190#else
4191 memcpy (&fs, *(dst_desc.dataHandle), sizeof (FSSpec));
4192#endif
4193 if (err == noErr)
4194 err = fsspec_to_posix_pathname (&fs, file_name,
4195 sizeof (file_name) - 1);
4196#endif
4197 if (err == noErr)
4198 result = make_unibyte_string (file_name, strlen (file_name));
4199 }
4200 else
4201 result = Fcdr (mac_aedesc_to_lisp (&dst_desc));
4202 AEDisposeDesc (&dst_desc);
4203 }
4204 UNBLOCK_INPUT;
4205
4206 return result;
4207}
4208
4209
3890#if TARGET_API_MAC_CARBON 4210#if TARGET_API_MAC_CARBON
3891static Lisp_Object Qxml, Qmime_charset; 4211static Lisp_Object Qxml, Qmime_charset;
3892static Lisp_Object QNFD, QNFKD, QNFC, QNFKC, QHFS_plus_D, QHFS_plus_C; 4212static Lisp_Object QNFD, QNFKD, QNFC, QNFKC, QHFS_plus_D, QHFS_plus_C;
@@ -4676,6 +4996,9 @@ init_mac_osx_environment ()
4676void 4996void
4677syms_of_mac () 4997syms_of_mac ()
4678{ 4998{
4999 Qundecoded_file_name = intern ("undecoded-file-name");
5000 staticpro (&Qundecoded_file_name);
5001
4679#if TARGET_API_MAC_CARBON 5002#if TARGET_API_MAC_CARBON
4680 Qstring = intern ("string"); staticpro (&Qstring); 5003 Qstring = intern ("string"); staticpro (&Qstring);
4681 Qnumber = intern ("number"); staticpro (&Qnumber); 5004 Qnumber = intern ("number"); staticpro (&Qnumber);
@@ -4699,6 +5022,7 @@ syms_of_mac ()
4699 QHFS_plus_C = intern ("HFS+C"); staticpro (&QHFS_plus_C); 5022 QHFS_plus_C = intern ("HFS+C"); staticpro (&QHFS_plus_C);
4700#endif 5023#endif
4701 5024
5025 defsubr (&Smac_coerce_ae_data);
4702#if TARGET_API_MAC_CARBON 5026#if TARGET_API_MAC_CARBON
4703 defsubr (&Smac_get_preference); 5027 defsubr (&Smac_get_preference);
4704 defsubr (&Smac_code_convert_string); 5028 defsubr (&Smac_code_convert_string);
diff --git a/src/macselect.c b/src/macselect.c
index 63221ba3a90..066892adce0 100644
--- a/src/macselect.c
+++ b/src/macselect.c
@@ -23,6 +23,7 @@ Boston, MA 02110-1301, USA. */
23#include "lisp.h" 23#include "lisp.h"
24#include "macterm.h" 24#include "macterm.h"
25#include "blockinput.h" 25#include "blockinput.h"
26#include "keymap.h"
26 27
27#if !TARGET_API_MAC_CARBON 28#if !TARGET_API_MAC_CARBON
28#include <Endian.h> 29#include <Endian.h>
@@ -908,6 +909,253 @@ and t is the same as `SECONDARY'. */)
908} 909}
909 910
910 911
912int mac_ready_for_apple_events = 0;
913static Lisp_Object Vmac_apple_event_map;
914static Lisp_Object Qmac_apple_event_class, Qmac_apple_event_id;
915static struct
916{
917 AppleEvent *buf;
918 int size, count;
919} deferred_apple_events;
920extern Lisp_Object Qundefined;
921extern OSErr mac_store_apple_event P_ ((Lisp_Object, Lisp_Object,
922 const AEDesc *));
923
924struct apple_event_binding
925{
926 UInt32 code; /* Apple event class or ID. */
927 Lisp_Object key, binding;
928};
929
930static void
931find_event_binding_fun (key, binding, args, data)
932 Lisp_Object key, binding, args;
933 void *data;
934{
935 struct apple_event_binding *event_binding =
936 (struct apple_event_binding *)data;
937 Lisp_Object code_string;
938
939 if (!SYMBOLP (key))
940 return;
941 code_string = Fget (key, args);
942 if (STRINGP (code_string) && SBYTES (code_string) == 4
943 && (EndianU32_BtoN (*((UInt32 *) SDATA (code_string)))
944 == event_binding->code))
945 {
946 event_binding->key = key;
947 event_binding->binding = binding;
948 }
949}
950
951static void
952find_event_binding (keymap, event_binding, class_p)
953 Lisp_Object keymap;
954 struct apple_event_binding *event_binding;
955 int class_p;
956{
957 if (event_binding->code == 0)
958 event_binding->binding =
959 access_keymap (keymap, event_binding->key, 0, 1, 0);
960 else
961 {
962 event_binding->binding = Qnil;
963 map_keymap (keymap, find_event_binding_fun,
964 class_p ? Qmac_apple_event_class : Qmac_apple_event_id,
965 event_binding, 0);
966 }
967}
968
969void
970mac_find_apple_event_spec (class, id, class_key, id_key, binding)
971 AEEventClass class;
972 AEEventID id;
973 Lisp_Object *class_key, *id_key, *binding;
974{
975 struct apple_event_binding event_binding;
976 Lisp_Object keymap;
977
978 *binding = Qnil;
979
980 keymap = get_keymap (Vmac_apple_event_map, 0, 0);
981 if (NILP (keymap))
982 return;
983
984 event_binding.code = class;
985 event_binding.key = *class_key;
986 event_binding.binding = Qnil;
987 find_event_binding (keymap, &event_binding, 1);
988 *class_key = event_binding.key;
989 keymap = get_keymap (event_binding.binding, 0, 0);
990 if (NILP (keymap))
991 return;
992
993 event_binding.code = id;
994 event_binding.key = *id_key;
995 event_binding.binding = Qnil;
996 find_event_binding (keymap, &event_binding, 0);
997 *id_key = event_binding.key;
998 *binding = event_binding.binding;
999}
1000
1001static OSErr
1002defer_apple_events (apple_event, reply)
1003 const AppleEvent *apple_event, *reply;
1004{
1005 OSErr err;
1006
1007 err = AESuspendTheCurrentEvent (apple_event);
1008
1009 /* Mac OS 10.3 Xcode manual says AESuspendTheCurrentEvent makes
1010 copies of the Apple event and the reply, but Mac OS 10.4 Xcode
1011 manual says it doesn't. Anyway we create copies of them and save
1012 it in `deferred_apple_events'. */
1013 if (err == noErr)
1014 {
1015 if (deferred_apple_events.buf == NULL)
1016 {
1017 deferred_apple_events.size = 16;
1018 deferred_apple_events.count = 0;
1019 deferred_apple_events.buf =
1020 xmalloc (sizeof (AppleEvent) * deferred_apple_events.size);
1021 if (deferred_apple_events.buf == NULL)
1022 err = memFullErr;
1023 }
1024 else if (deferred_apple_events.count == deferred_apple_events.size)
1025 {
1026 AppleEvent *newbuf;
1027
1028 deferred_apple_events.size *= 2;
1029 newbuf = xrealloc (deferred_apple_events.buf,
1030 sizeof (AppleEvent) * deferred_apple_events.size);
1031 if (newbuf)
1032 deferred_apple_events.buf = newbuf;
1033 else
1034 err = memFullErr;
1035 }
1036 }
1037
1038 if (err == noErr)
1039 {
1040 int count = deferred_apple_events.count;
1041
1042 AEDuplicateDesc (apple_event, deferred_apple_events.buf + count);
1043 AEDuplicateDesc (reply, deferred_apple_events.buf + count + 1);
1044 deferred_apple_events.count += 2;
1045 }
1046
1047 return err;
1048}
1049
1050static pascal OSErr
1051mac_handle_apple_event (apple_event, reply, refcon)
1052 const AppleEvent *apple_event;
1053 AppleEvent *reply;
1054 SInt32 refcon;
1055{
1056 OSErr err;
1057 AEEventClass event_class;
1058 AEEventID event_id;
1059 Lisp_Object class_key, id_key, binding;
1060
1061 /* We can't handle an Apple event that requests a reply, but this
1062 seems to be too restrictive. */
1063#if 0
1064 if (reply->descriptorType != typeNull)
1065 return errAEEventNotHandled;
1066#endif
1067
1068 if (!mac_ready_for_apple_events)
1069 {
1070 err = defer_apple_events (apple_event, reply);
1071 if (err != noErr)
1072 return errAEEventNotHandled;
1073 return noErr;
1074 }
1075
1076 err = AEGetAttributePtr (apple_event, keyEventClassAttr, typeType, NULL,
1077 &event_class, sizeof (AEEventClass), NULL);
1078 if (err == noErr)
1079 err = AEGetAttributePtr (apple_event, keyEventIDAttr, typeType, NULL,
1080 &event_id, sizeof (AEEventID), NULL);
1081 if (err == noErr)
1082 {
1083 mac_find_apple_event_spec (event_class, event_id,
1084 &class_key, &id_key, &binding);
1085 if (!NILP (binding) && !EQ (binding, Qundefined))
1086 {
1087 if (INTEGERP (binding))
1088 return XINT (binding);
1089 err = mac_store_apple_event (class_key, id_key, apple_event);
1090 if (err == noErr)
1091 return noErr;
1092 }
1093 }
1094 return errAEEventNotHandled;
1095}
1096
1097void
1098init_apple_event_handler ()
1099{
1100 OSErr err;
1101 long result;
1102
1103 /* Make sure we have Apple events before starting. */
1104 err = Gestalt (gestaltAppleEventsAttr, &result);
1105 if (err != noErr)
1106 abort ();
1107
1108 if (!(result & (1 << gestaltAppleEventsPresent)))
1109 abort ();
1110
1111 err = AEInstallEventHandler (typeWildCard, typeWildCard,
1112#if TARGET_API_MAC_CARBON
1113 NewAEEventHandlerUPP (mac_handle_apple_event),
1114#else
1115 NewAEEventHandlerProc (mac_handle_apple_event),
1116#endif
1117 0L, false);
1118 if (err != noErr)
1119 abort ();
1120}
1121
1122DEFUN ("mac-process-deferred-apple-events", Fmac_process_deferred_apple_events, Smac_process_deferred_apple_events, 0, 0, 0,
1123 doc: /* Process Apple events that are deferred at the startup time. */)
1124 ()
1125{
1126 OSErr err;
1127 Lisp_Object result = Qnil;
1128 long i, count;
1129 AppleEvent apple_event, reply;
1130 AEKeyword keyword;
1131
1132 if (mac_ready_for_apple_events)
1133 return Qnil;
1134
1135 BLOCK_INPUT;
1136 mac_ready_for_apple_events = 1;
1137 if (deferred_apple_events.buf)
1138 {
1139 for (i = 0; i < deferred_apple_events.count; i += 2)
1140 {
1141 AEResumeTheCurrentEvent (deferred_apple_events.buf + i,
1142 deferred_apple_events.buf + i + 1,
1143 ((AEEventHandlerUPP)
1144 kAEUseStandardDispatch), 0);
1145 AEDisposeDesc (deferred_apple_events.buf + i);
1146 AEDisposeDesc (deferred_apple_events.buf + i + 1);
1147 }
1148 xfree (deferred_apple_events.buf);
1149 bzero (&deferred_apple_events, sizeof (deferred_apple_events));
1150
1151 result = Qt;
1152 }
1153 UNBLOCK_INPUT;
1154
1155 return result;
1156}
1157
1158
911#ifdef MAC_OSX 1159#ifdef MAC_OSX
912void 1160void
913init_service_handler () 1161init_service_handler ()
@@ -920,7 +1168,56 @@ init_service_handler ()
920 GetEventTypeCount (specs), specs, NULL, NULL); 1168 GetEventTypeCount (specs), specs, NULL, NULL);
921} 1169}
922 1170
923extern void mac_store_services_event P_ ((EventRef)); 1171extern OSErr mac_store_services_event P_ ((EventRef));
1172
1173static OSStatus
1174copy_scrap_flavor_data (from_scrap, to_scrap, flavor_type)
1175 ScrapRef from_scrap, to_scrap;
1176 ScrapFlavorType flavor_type;
1177{
1178 OSStatus err;
1179 Size size, size_allocated;
1180 char *buf = NULL;
1181
1182 err = GetScrapFlavorSize (from_scrap, flavor_type, &size);
1183 if (err == noErr)
1184 buf = xmalloc (size);
1185 while (buf)
1186 {
1187 size_allocated = size;
1188 err = GetScrapFlavorData (from_scrap, flavor_type, &size, buf);
1189 if (err != noErr)
1190 {
1191 xfree (buf);
1192 buf = NULL;
1193 }
1194 else if (size_allocated < size)
1195 {
1196 char *newbuf = xrealloc (buf, size);
1197
1198 if (newbuf)
1199 buf = newbuf;
1200 else
1201 {
1202 xfree (buf);
1203 buf = NULL;
1204 }
1205 }
1206 else
1207 break;
1208 }
1209 if (err == noErr)
1210 if (buf == NULL)
1211 err = memFullErr;
1212 else
1213 {
1214 err = PutScrapFlavor (to_scrap, flavor_type, kScrapFlavorMaskNone,
1215 size, buf);
1216 xfree (buf);
1217 }
1218
1219 return err;
1220}
924 1221
925static OSStatus 1222static OSStatus
926mac_handle_service_event (call_ref, event, data) 1223mac_handle_service_event (call_ref, event, data)
@@ -929,7 +1226,12 @@ mac_handle_service_event (call_ref, event, data)
929 void *data; 1226 void *data;
930{ 1227{
931 OSStatus err = noErr; 1228 OSStatus err = noErr;
932 ScrapRef cur_scrap; 1229 ScrapRef cur_scrap, specific_scrap;
1230 UInt32 event_kind = GetEventKind (event);
1231 CFMutableArrayRef copy_types, paste_types;
1232 CFStringRef type;
1233 Lisp_Object rest;
1234 ScrapFlavorType flavor_type;
933 1235
934 /* Check if Vmac_services_selection is a valid selection that has a 1236 /* Check if Vmac_services_selection is a valid selection that has a
935 corresponding scrap. */ 1237 corresponding scrap. */
@@ -940,86 +1242,103 @@ mac_handle_service_event (call_ref, event, data)
940 if (!(err == noErr && cur_scrap)) 1242 if (!(err == noErr && cur_scrap))
941 return eventNotHandledErr; 1243 return eventNotHandledErr;
942 1244
943 switch (GetEventKind (event)) 1245 switch (event_kind)
944 { 1246 {
945 case kEventServiceGetTypes: 1247 case kEventServiceGetTypes:
946 { 1248 /* Set paste types. */
947 CFMutableArrayRef copy_types, paste_types; 1249 err = GetEventParameter (event, kEventParamServicePasteTypes,
948 CFStringRef type; 1250 typeCFMutableArrayRef, NULL,
949 Lisp_Object rest; 1251 sizeof (CFMutableArrayRef), NULL,
950 ScrapFlavorType flavor_type; 1252 &paste_types);
951 1253 if (err != noErr)
952 /* Set paste types. */ 1254 break;
953 err = GetEventParameter (event, kEventParamServicePasteTypes, 1255
954 typeCFMutableArrayRef, NULL, 1256 for (rest = Vselection_converter_alist; CONSP (rest);
955 sizeof (CFMutableArrayRef), NULL, 1257 rest = XCDR (rest))
956 &paste_types); 1258 if (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))
957 if (err == noErr) 1259 && (flavor_type =
958 for (rest = Vselection_converter_alist; CONSP (rest); 1260 get_flavor_type_from_symbol (XCAR (XCAR (rest)))))
959 rest = XCDR (rest)) 1261 {
960 if (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest))) 1262 type = CreateTypeStringWithOSType (flavor_type);
961 && (flavor_type = 1263 if (type)
962 get_flavor_type_from_symbol (XCAR (XCAR (rest)))))
963 { 1264 {
964 type = CreateTypeStringWithOSType (flavor_type); 1265 CFArrayAppendValue (paste_types, type);
965 if (type) 1266 CFRelease (type);
966 {
967 CFArrayAppendValue (paste_types, type);
968 CFRelease (type);
969 }
970 } 1267 }
1268 }
971 1269
972 /* Set copy types. */ 1270 /* Set copy types. */
973 err = GetEventParameter (event, kEventParamServiceCopyTypes, 1271 err = GetEventParameter (event, kEventParamServiceCopyTypes,
974 typeCFMutableArrayRef, NULL, 1272 typeCFMutableArrayRef, NULL,
975 sizeof (CFMutableArrayRef), NULL, 1273 sizeof (CFMutableArrayRef), NULL,
976 &copy_types); 1274 &copy_types);
977 if (err == noErr 1275 if (err != noErr)
978 && !NILP (Fx_selection_owner_p (Vmac_services_selection))) 1276 break;
979 for (rest = get_scrap_target_type_list (cur_scrap); 1277
980 CONSP (rest) && SYMBOLP (XCAR (rest)); rest = XCDR (rest)) 1278 if (NILP (Fx_selection_owner_p (Vmac_services_selection)))
981 { 1279 break;
982 flavor_type = get_flavor_type_from_symbol (XCAR (rest)); 1280 else
983 if (flavor_type) 1281 goto copy_all_flavors;
984 {
985 type = CreateTypeStringWithOSType (flavor_type);
986 if (type)
987 {
988 CFArrayAppendValue (copy_types, type);
989 CFRelease (type);
990 }
991 }
992 }
993 }
994 break;
995 1282
996 case kEventServiceCopy: 1283 case kEventServiceCopy:
997 { 1284 err = GetEventParameter (event, kEventParamScrapRef,
998 ScrapRef specific_scrap; 1285 typeScrapRef, NULL,
999 Lisp_Object rest, data; 1286 sizeof (ScrapRef), NULL, &specific_scrap);
1000 1287 if (err != noErr
1001 err = GetEventParameter (event, kEventParamScrapRef, 1288 || NILP (Fx_selection_owner_p (Vmac_services_selection)))
1002 typeScrapRef, NULL, 1289 {
1003 sizeof (ScrapRef), NULL, &specific_scrap);
1004 if (err == noErr
1005 && !NILP (Fx_selection_owner_p (Vmac_services_selection)))
1006 for (rest = get_scrap_target_type_list (cur_scrap);
1007 CONSP (rest) && SYMBOLP (XCAR (rest)); rest = XCDR (rest))
1008 {
1009 data = get_scrap_string (cur_scrap, XCAR (rest));
1010 if (STRINGP (data))
1011 err = put_scrap_string (specific_scrap, XCAR (rest), data);
1012 }
1013 else
1014 err = eventNotHandledErr; 1290 err = eventNotHandledErr;
1291 break;
1292 }
1293
1294 copy_all_flavors:
1295 {
1296 UInt32 count, i;
1297 ScrapFlavorInfo *flavor_info = NULL;
1298 ScrapFlavorFlags flags;
1299
1300 err = GetScrapFlavorCount (cur_scrap, &count);
1301 if (err == noErr)
1302 flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count);
1303 if (flavor_info)
1304 {
1305 err = GetScrapFlavorInfoList (cur_scrap, &count, flavor_info);
1306 if (err != noErr)
1307 {
1308 xfree (flavor_info);
1309 flavor_info = NULL;
1310 }
1311 }
1312 if (flavor_info == NULL)
1313 break;
1314
1315 for (i = 0; i < count; i++)
1316 {
1317 flavor_type = flavor_info[i].flavorType;
1318 err = GetScrapFlavorFlags (cur_scrap, flavor_type, &flags);
1319 if (err == noErr && !(flags & kScrapFlavorMaskSenderOnly))
1320 {
1321 if (event_kind == kEventServiceCopy)
1322 err = copy_scrap_flavor_data (cur_scrap, specific_scrap,
1323 flavor_type);
1324 else /* event_kind == kEventServiceGetTypes */
1325 {
1326 type = CreateTypeStringWithOSType (flavor_type);
1327 if (type)
1328 {
1329 CFArrayAppendValue (copy_types, type);
1330 CFRelease (type);
1331 }
1332 }
1333 }
1334 }
1335 xfree (flavor_info);
1015 } 1336 }
1016 break; 1337 break;
1017 1338
1018 case kEventServicePaste: 1339 case kEventServicePaste:
1019 case kEventServicePerform: 1340 case kEventServicePerform:
1020 { 1341 {
1021 ScrapRef specific_scrap;
1022 Lisp_Object rest, data;
1023 int data_exists_p = 0; 1342 int data_exists_p = 0;
1024 1343
1025 err = GetEventParameter (event, kEventParamScrapRef, typeScrapRef, 1344 err = GetEventParameter (event, kEventParamScrapRef, typeScrapRef,
@@ -1033,25 +1352,24 @@ mac_handle_service_event (call_ref, event, data)
1033 { 1352 {
1034 if (! (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest))))) 1353 if (! (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))))
1035 continue; 1354 continue;
1036 data = get_scrap_string (specific_scrap, XCAR (XCAR (rest))); 1355 flavor_type = get_flavor_type_from_symbol (XCAR (XCAR (rest)));
1037 if (STRINGP (data)) 1356 if (flavor_type == 0)
1038 { 1357 continue;
1039 err = put_scrap_string (cur_scrap, XCAR (XCAR (rest)), 1358 err = copy_scrap_flavor_data (specific_scrap, cur_scrap,
1040 data); 1359 flavor_type);
1041 if (err != noErr) 1360 if (err == noErr)
1042 break; 1361 data_exists_p = 1;
1043 data_exists_p = 1;
1044 }
1045 } 1362 }
1046 if (err == noErr) 1363 if (!data_exists_p)
1047 if (data_exists_p) 1364 err = eventNotHandledErr;
1048 mac_store_application_menu_event (event); 1365 else
1049 else 1366 err = mac_store_services_event (event);
1050 err = eventNotHandledErr;
1051 } 1367 }
1052 break; 1368 break;
1053 } 1369 }
1054 1370
1371 if (err != noErr)
1372 err = eventNotHandledErr;
1055 return err; 1373 return err;
1056} 1374}
1057#endif 1375#endif
@@ -1065,6 +1383,7 @@ syms_of_macselect ()
1065 defsubr (&Sx_disown_selection_internal); 1383 defsubr (&Sx_disown_selection_internal);
1066 defsubr (&Sx_selection_owner_p); 1384 defsubr (&Sx_selection_owner_p);
1067 defsubr (&Sx_selection_exists_p); 1385 defsubr (&Sx_selection_exists_p);
1386 defsubr (&Smac_process_deferred_apple_events);
1068 1387
1069 Vselection_alist = Qnil; 1388 Vselection_alist = Qnil;
1070 staticpro (&Vselection_alist); 1389 staticpro (&Vselection_alist);
@@ -1106,6 +1425,10 @@ next communication only. After the communication, this variable is
1106set to nil. */); 1425set to nil. */);
1107 Vnext_selection_coding_system = Qnil; 1426 Vnext_selection_coding_system = Qnil;
1108 1427
1428 DEFVAR_LISP ("mac-apple-event-map", &Vmac_apple_event_map,
1429 doc: /* Keymap for Apple events handled by Emacs. */);
1430 Vmac_apple_event_map = Qnil;
1431
1109#ifdef MAC_OSX 1432#ifdef MAC_OSX
1110 DEFVAR_LISP ("mac-services-selection", &Vmac_services_selection, 1433 DEFVAR_LISP ("mac-services-selection", &Vmac_services_selection,
1111 doc: /* Selection name for communication via Services menu. */); 1434 doc: /* Selection name for communication via Services menu. */);
@@ -1125,6 +1448,12 @@ set to nil. */);
1125 1448
1126 Qmac_ostype = intern ("mac-ostype"); 1449 Qmac_ostype = intern ("mac-ostype");
1127 staticpro (&Qmac_ostype); 1450 staticpro (&Qmac_ostype);
1451
1452 Qmac_apple_event_class = intern ("mac-apple-event-class");
1453 staticpro (&Qmac_apple_event_class);
1454
1455 Qmac_apple_event_id = intern ("mac-apple-event-id");
1456 staticpro (&Qmac_apple_event_id);
1128} 1457}
1129 1458
1130/* arch-tag: f3c91ad8-99e0-4bd6-9eef-251b2f848732 1459/* arch-tag: f3c91ad8-99e0-4bd6-9eef-251b2f848732
diff --git a/src/macterm.c b/src/macterm.c
index 2976a84e190..ae2942c4cf9 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -622,7 +622,7 @@ atsu_get_text_layout_with_text_ptr (text, text_length, style, text_layout)
622 ByteCount sizes[] = {sizeof (ATSLineLayoutOptions)}; 622 ByteCount sizes[] = {sizeof (ATSLineLayoutOptions)};
623 static ATSLineLayoutOptions line_layout = 623 static ATSLineLayoutOptions line_layout =
624#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 624#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
625 kATSLineDisableAllLayoutOperations | kATSLineUseDeviceMetrics 625 kATSLineDisableAllLayoutOperations | kATSLineUseDeviceMetrics
626#else 626#else
627 kATSLineIsDisplayOnly | kATSLineFractDisable 627 kATSLineIsDisplayOnly | kATSLineFractDisable
628#endif 628#endif
@@ -8127,20 +8127,18 @@ Lisp_Object Vmac_pass_control_to_system;
8127 Carbon/Apple event handlers. */ 8127 Carbon/Apple event handlers. */
8128static struct input_event *read_socket_inev = NULL; 8128static struct input_event *read_socket_inev = NULL;
8129 8129
8130/* Set in term/mac-win.el to indicate that event loop can now generate
8131 drag and drop events. */
8132Lisp_Object Qmac_ready_for_drag_n_drop;
8133
8134Point saved_menu_event_location; 8130Point saved_menu_event_location;
8135 8131
8136/* Apple Events */ 8132/* Apple Events */
8137static void init_required_apple_events (void); 8133#if USE_CARBON_EVENTS
8138static pascal OSErr 8134static Lisp_Object Qhicommand;
8139do_ae_open_application (const AppleEvent *, AppleEvent *, long); 8135#endif
8140static pascal OSErr 8136extern int mac_ready_for_apple_events;
8141do_ae_print_documents (const AppleEvent *, AppleEvent *, long); 8137extern Lisp_Object Qundefined;
8142static pascal OSErr do_ae_open_documents (AppleEvent *, AppleEvent *, long); 8138extern void init_apple_event_handler P_ ((void));
8143static pascal OSErr do_ae_quit_application (AppleEvent *, AppleEvent *, long); 8139extern void mac_find_apple_event_spec P_ ((AEEventClass, AEEventID,
8140 Lisp_Object *, Lisp_Object *,
8141 Lisp_Object *));
8144 8142
8145#if TARGET_API_MAC_CARBON 8143#if TARGET_API_MAC_CARBON
8146/* Drag and Drop */ 8144/* Drag and Drop */
@@ -8150,11 +8148,10 @@ static DragTrackingHandlerUPP mac_do_track_dragUPP = NULL;
8150static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL; 8148static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL;
8151#endif 8149#endif
8152 8150
8153static Lisp_Object Qapplication, Qabout;
8154#if USE_CARBON_EVENTS 8151#if USE_CARBON_EVENTS
8155#ifdef MAC_OSX 8152#ifdef MAC_OSX
8156extern void init_service_handler (); 8153extern void init_service_handler ();
8157static Lisp_Object Qpreferences, Qservices, Qpaste, Qperform; 8154static Lisp_Object Qservices, Qpaste, Qperform;
8158#endif 8155#endif
8159/* Window Event Handler */ 8156/* Window Event Handler */
8160static pascal OSStatus mac_handle_window_event (EventHandlerCallRef, 8157static pascal OSStatus mac_handle_window_event (EventHandlerCallRef,
@@ -8699,179 +8696,49 @@ do_zoom_window (WindowPtr w, int zoom_in_or_out)
8699 x_real_positions (f, &f->left_pos, &f->top_pos); 8696 x_real_positions (f, &f->left_pos, &f->top_pos);
8700} 8697}
8701 8698
8702/* Intialize AppleEvent dispatcher table for the required events. */ 8699OSErr
8703void 8700mac_store_apple_event (class, id, desc)
8704init_required_apple_events () 8701 Lisp_Object class, id;
8705{ 8702 const AEDesc *desc;
8706 OSErr err;
8707 long result;
8708
8709 /* Make sure we have apple events before starting. */
8710 err = Gestalt (gestaltAppleEventsAttr, &result);
8711 if (err != noErr)
8712 abort ();
8713
8714 if (!(result & (1 << gestaltAppleEventsPresent)))
8715 abort ();
8716
8717#if TARGET_API_MAC_CARBON
8718 err = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication,
8719 NewAEEventHandlerUPP
8720 ((AEEventHandlerProcPtr) do_ae_open_application),
8721 0L, false);
8722#else
8723 err = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication,
8724 NewAEEventHandlerProc
8725 ((AEEventHandlerProcPtr) do_ae_open_application),
8726 0L, false);
8727#endif
8728 if (err != noErr)
8729 abort ();
8730
8731#if TARGET_API_MAC_CARBON
8732 err = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
8733 NewAEEventHandlerUPP
8734 ((AEEventHandlerProcPtr) do_ae_open_documents),
8735 0L, false);
8736#else
8737 err = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
8738 NewAEEventHandlerProc
8739 ((AEEventHandlerProcPtr) do_ae_open_documents),
8740 0L, false);
8741#endif
8742 if (err != noErr)
8743 abort ();
8744
8745#if TARGET_API_MAC_CARBON
8746 err = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments,
8747 NewAEEventHandlerUPP
8748 ((AEEventHandlerProcPtr) do_ae_print_documents),
8749 0L, false);
8750#else
8751 err = AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments,
8752 NewAEEventHandlerProc
8753 ((AEEventHandlerProcPtr) do_ae_print_documents),
8754 0L, false);
8755#endif
8756 if (err != noErr)
8757 abort ();
8758
8759#if TARGET_API_MAC_CARBON
8760 err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,
8761 NewAEEventHandlerUPP
8762 ((AEEventHandlerProcPtr) do_ae_quit_application),
8763 0L, false);
8764#else
8765 err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,
8766 NewAEEventHandlerProc
8767 ((AEEventHandlerProcPtr) do_ae_quit_application),
8768 0L, false);
8769#endif
8770 if (err != noErr)
8771 abort ();
8772}
8773
8774void
8775mac_store_application_menu_event (event)
8776#if USE_CARBON_EVENTS
8777 EventRef event;
8778#else
8779 UInt32 event;
8780#endif
8781{ 8703{
8704 OSErr err = noErr;
8782 struct input_event buf; 8705 struct input_event buf;
8783 Lisp_Object frame, entry; 8706 AEDesc *desc_copy;
8784
8785 EVENT_INIT (buf);
8786
8787 XSETFRAME (frame, mac_focus_frame (&one_mac_display_info));
8788 buf.kind = MENU_BAR_EVENT;
8789 buf.frame_or_window = frame;
8790 buf.arg = frame;
8791 kbd_buffer_store_event (&buf);
8792
8793 buf.arg = Qapplication;
8794 kbd_buffer_store_event (&buf);
8795 8707
8796#if USE_CARBON_EVENTS 8708 desc_copy = xmalloc (sizeof (AEDesc));
8797 switch (GetEventClass (event)) 8709 if (desc_copy == NULL)
8710 err = memFullErr;
8711 else
8712 err = AEDuplicateDesc (desc, desc_copy);
8713 if (err == noErr)
8798 { 8714 {
8799#ifdef MAC_OSX 8715 EVENT_INIT (buf);
8800 case kEventClassService:
8801 buf.arg = Qservices;
8802 kbd_buffer_store_event (&buf);
8803 switch (GetEventKind (event))
8804 {
8805 case kEventServicePaste:
8806 entry = Qpaste;
8807 break;
8808 8716
8809 case kEventServicePerform: 8717 buf.kind = MAC_APPLE_EVENT;
8810 { 8718 buf.x = class;
8811 OSErr err; 8719 buf.y = id;
8812 CFStringRef message; 8720 buf.code = (int)desc_copy;
8813 8721 XSETFRAME (buf.frame_or_window,
8814 err = GetEventParameter (event, kEventParamServiceMessageName, 8722 mac_focus_frame (&one_mac_display_info));
8815 typeCFStringRef, NULL, 8723 buf.arg = Qnil;
8816 sizeof (CFStringRef), NULL, &message); 8724 kbd_buffer_store_event (&buf);
8817 buf.arg = Qperform; 8725 }
8818 kbd_buffer_store_event (&buf);
8819 if (err == noErr && message)
8820 entry = intern (SDATA (cfstring_to_lisp (message)));
8821 else
8822 entry = Qnil;
8823 }
8824 break;
8825 8726
8826 default: 8727 return err;
8827 abort (); 8728}
8828 }
8829 break;
8830#endif /* MAC_OSX */
8831 case kEventClassCommand:
8832 {
8833 HICommand command;
8834 8729
8835 GetEventParameter(event, kEventParamDirectObject, typeHICommand, 8730Lisp_Object
8836 NULL, sizeof (HICommand), NULL, &command); 8731mac_make_lispy_event_code (code)
8837 switch (command.commandID) 8732 int code;
8838 { 8733{
8839 case kHICommandAbout: 8734 AEDesc *desc = (AEDesc *)code;
8840 entry = Qabout; 8735 Lisp_Object obj;
8841 break;
8842#ifdef MAC_OSX
8843 case kHICommandPreferences:
8844 entry = Qpreferences;
8845 break;
8846#endif /* MAC_OSX */
8847 case kHICommandQuit:
8848 entry = Qquit;
8849 break;
8850 default:
8851 abort ();
8852 }
8853 }
8854 break;
8855 8736
8856 default: 8737 obj = mac_aedesc_to_lisp (desc);
8857 abort (); 8738 AEDisposeDesc (desc);
8858 } 8739 xfree (desc);
8859#else /* USE_CARBON_EVENTS */
8860 switch (event)
8861 {
8862 case kHICommandAbout:
8863 entry = Qabout;
8864 break;
8865 case kHICommandQuit:
8866 entry = Qquit;
8867 break;
8868 default:
8869 abort ();
8870 }
8871#endif
8872 8740
8873 buf.arg = entry; 8741 return obj;
8874 kbd_buffer_store_event (&buf);
8875} 8742}
8876 8743
8877#if USE_CARBON_EVENTS 8744#if USE_CARBON_EVENTS
@@ -8881,28 +8748,49 @@ mac_handle_command_event (next_handler, event, data)
8881 EventRef event; 8748 EventRef event;
8882 void *data; 8749 void *data;
8883{ 8750{
8751 OSStatus result;
8752 OSErr err;
8884 HICommand command; 8753 HICommand command;
8885 OSErr result; 8754 Lisp_Object class_key, id_key, binding;
8886 8755
8887 GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, 8756 result = CallNextEventHandler (next_handler, event);
8888 sizeof (HICommand), NULL, &command); 8757 if (result != eventNotHandledErr)
8758 return result;
8889 8759
8890 switch (command.commandID) 8760 GetEventParameter (event, kEventParamDirectObject, typeHICommand, NULL,
8891 { 8761 sizeof (HICommand), NULL, &command);
8892 case kHICommandAbout:
8893#ifdef MAC_OSX
8894 case kHICommandPreferences:
8895#endif /* MAC_OSX */
8896 result = CallNextEventHandler (next_handler, event);
8897 if (result != eventNotHandledErr)
8898 return result;
8899 8762
8900 mac_store_application_menu_event (event); 8763 if (command.commandID == 0)
8901 return noErr; 8764 return eventNotHandledErr;
8902 8765
8903 default: 8766 /* A HICommand event is mapped to an Apple event whose event class
8904 break; 8767 symbol is `hicommand' and event ID is its command ID. */
8905 } 8768 class_key = Qhicommand;
8769 mac_find_apple_event_spec (0, command.commandID,
8770 &class_key, &id_key, &binding);
8771 if (!NILP (binding) && !EQ (binding, Qundefined))
8772 if (INTEGERP (binding))
8773 return XINT (binding);
8774 else
8775 {
8776 AppleEvent apple_event;
8777 UInt32 modifiers;
8778 static EventParamName names[] = {kEventParamDirectObject,
8779 kEventParamKeyModifiers};
8780 static EventParamType types[] = {typeHICommand,
8781 typeUInt32};
8782 static UInt32 sizes[] = {sizeof (HICommand),
8783 sizeof (UInt32)};
8784 err = create_apple_event_from_event_ref (event, 2, names, types,
8785 sizes, &apple_event);
8786 if (err == noErr)
8787 {
8788 err = mac_store_apple_event (class_key, id_key, &apple_event);
8789 AEDisposeDesc (&apple_event);
8790 }
8791 if (err == noErr)
8792 return noErr;
8793 }
8906 8794
8907 return eventNotHandledErr; 8795 return eventNotHandledErr;
8908} 8796}
@@ -9064,6 +8952,52 @@ mac_handle_mouse_event (next_handler, event, data)
9064 8952
9065 return eventNotHandledErr; 8953 return eventNotHandledErr;
9066} 8954}
8955
8956#ifdef MAC_OSX
8957OSErr
8958mac_store_services_event (event)
8959 EventRef event;
8960{
8961 OSErr err;
8962 AppleEvent apple_event;
8963 Lisp_Object id_key;
8964
8965 switch (GetEventKind (event))
8966 {
8967 case kEventServicePaste:
8968 id_key = Qpaste;
8969 err = create_apple_event_from_event_ref (event, 0, NULL,
8970 NULL, NULL, &apple_event);
8971 break;
8972
8973 case kEventServicePerform:
8974 {
8975 static EventParamName names[] = {kEventParamServiceMessageName,
8976 kEventParamServiceUserData};
8977 static EventParamType types[] = {typeCFStringRef,
8978 typeCFStringRef};
8979 static UInt32 sizes[] = {sizeof (CFStringRef),
8980 sizeof (CFStringRef)};
8981
8982 id_key = Qperform;
8983 err = create_apple_event_from_event_ref (event, 2, names, types,
8984 sizes, &apple_event);
8985 }
8986 break;
8987
8988 default:
8989 abort ();
8990 }
8991
8992 if (err == noErr)
8993 {
8994 err = mac_store_apple_event (Qservices, id_key, &apple_event);
8995 AEDisposeDesc (&apple_event);
8996 }
8997
8998 return err;
8999}
9000#endif /* MAC_OSX */
9067#endif /* USE_CARBON_EVENTS */ 9001#endif /* USE_CARBON_EVENTS */
9068 9002
9069 9003
@@ -9122,159 +9056,6 @@ remove_window_handler (window)
9122#endif 9056#endif
9123} 9057}
9124 9058
9125/* Open Application Apple Event */
9126static pascal OSErr
9127do_ae_open_application(const AppleEvent *pae, AppleEvent *preply, long prefcon)
9128{
9129 return noErr;
9130}
9131
9132
9133/* Called when we receive an AppleEvent with an ID of
9134 "kAEOpenDocuments". This routine gets the direct parameter,
9135 extracts the FSSpecs in it, and puts their names on a list. */
9136#pragma options align=mac68k
9137typedef struct SelectionRange {
9138 short unused1; // 0 (not used)
9139 short lineNum; // line to select (<0 to specify range)
9140 long startRange; // start of selection range (if line < 0)
9141 long endRange; // end of selection range (if line < 0)
9142 long unused2; // 0 (not used)
9143 long theDate; // modification date/time
9144} SelectionRange;
9145#pragma options align=reset
9146
9147static pascal OSErr
9148do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon)
9149{
9150 OSErr err, err2;
9151 AEDesc the_desc;
9152 AEKeyword keyword;
9153 DescType actual_type;
9154 Size actual_size;
9155 SelectionRange position;
9156 Lisp_Object file_list = Qnil;
9157
9158 xassert (read_socket_inev);
9159
9160 err = AEGetParamDesc (message, keyDirectObject, typeAEList, &the_desc);
9161 if (err != noErr)
9162 goto descriptor_error_exit;
9163
9164 err = AEGetParamPtr (message, keyAEPosition, typeChar, &actual_type, &position, sizeof(SelectionRange), &actual_size);
9165 if (err == noErr)
9166 file_list = Fcons (list3 (make_number (position.lineNum + 1),
9167 make_number (position.startRange + 1),
9168 make_number (position.endRange + 1)),
9169 file_list);
9170
9171 /* Check to see that we got all of the required parameters from the
9172 event descriptor. For an 'odoc' event this should just be the
9173 file list. */
9174 err = AEGetAttributePtr(message, keyMissedKeywordAttr, typeWildCard,
9175 &actual_type, (Ptr) &keyword,
9176 sizeof (keyword), &actual_size);
9177 /* No error means that we found some unused parameters.
9178 errAEDescNotFound means that there are no more parameters. If we
9179 get an error code other than that, flag it. */
9180 if ((err == noErr) || (err != errAEDescNotFound))
9181 {
9182 err = errAEEventNotHandled;
9183 goto error_exit;
9184 }
9185 err = noErr;
9186
9187 /* Got all the parameters we need. Now, go through the direct
9188 object list and parse it up. */
9189 {
9190 long num_files_to_open;
9191
9192 err = AECountItems (&the_desc, &num_files_to_open);
9193 if (err == noErr)
9194 {
9195 int i;
9196
9197 /* AE file list is one based so just use that for indexing here. */
9198 for (i = 1; i <= num_files_to_open; i++)
9199 {
9200 char unix_path_name[MAXPATHLEN];
9201#ifdef MAC_OSX
9202 FSRef fref;
9203
9204 err = AEGetNthPtr (&the_desc, i, typeFSRef, &keyword,
9205 &actual_type, &fref, sizeof (FSRef),
9206 &actual_size);
9207 if (err != noErr || actual_type != typeFSRef)
9208 continue;
9209
9210 if (FSRefMakePath (&fref, unix_path_name, sizeof (unix_path_name))
9211 == noErr)
9212#else
9213 FSSpec fs;
9214
9215 err = AEGetNthPtr(&the_desc, i, typeFSS, &keyword, &actual_type,
9216 (Ptr) &fs, sizeof (fs), &actual_size);
9217 if (err != noErr) continue;
9218
9219 if (fsspec_to_posix_pathname (&fs, unix_path_name,
9220 sizeof (unix_path_name) - 1) == noErr)
9221#endif
9222 /* x-dnd functions expect undecoded filenames. */
9223 file_list = Fcons (make_unibyte_string (unix_path_name,
9224 strlen (unix_path_name)),
9225 file_list);
9226 }
9227 }
9228
9229 /* Build a DRAG_N_DROP_EVENT type event as is done in
9230 constuct_drag_n_drop in w32term.c. */
9231 if (!NILP (file_list))
9232 {
9233 struct frame *f = mac_focus_frame (&one_mac_display_info);
9234 WindowPtr wp;
9235 Lisp_Object frame;
9236
9237 read_socket_inev->kind = DRAG_N_DROP_EVENT;
9238 read_socket_inev->code = 0;
9239 read_socket_inev->modifiers = 0;
9240
9241 XSETINT (read_socket_inev->x, 0);
9242 XSETINT (read_socket_inev->y, 0);
9243
9244 XSETFRAME (frame, f);
9245 read_socket_inev->frame_or_window = Fcons (frame, file_list);
9246
9247#if 0
9248 /* Regardless of whether Emacs was suspended or in the
9249 foreground, ask it to redraw its entire screen. Otherwise
9250 parts of the screen can be left in an inconsistent
9251 state. */
9252 wp = FRAME_MAC_WINDOW (f);
9253 if (wp)
9254#if TARGET_API_MAC_CARBON
9255 {
9256 Rect r;
9257
9258 GetWindowPortBounds (wp, &r);
9259 InvalWindowRect (wp, &r);
9260 }
9261#else /* not TARGET_API_MAC_CARBON */
9262 InvalRect (&(wp->portRect));
9263#endif /* not TARGET_API_MAC_CARBON */
9264#endif
9265 }
9266 }
9267
9268error_exit:
9269 /* Nuke the coerced file list in any case */
9270 err2 = AEDisposeDesc(&the_desc);
9271
9272descriptor_error_exit:
9273 /* InvalRect(&(gFrontMacWindowP->mWP->portRect)); */
9274 return err;
9275}
9276
9277
9278#if TARGET_API_MAC_CARBON 9059#if TARGET_API_MAC_CARBON
9279static pascal OSErr 9060static pascal OSErr
9280mac_do_track_drag (DragTrackingMessage message, WindowPtr window, 9061mac_do_track_drag (DragTrackingMessage message, WindowPtr window,
@@ -9429,44 +9210,6 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
9429#endif 9210#endif
9430 9211
9431 9212
9432/* Print Document Apple Event */
9433static pascal OSErr
9434do_ae_print_documents (const AppleEvent *pAE, AppleEvent *reply, long refcon)
9435{
9436 return errAEEventNotHandled;
9437}
9438
9439
9440static pascal OSErr
9441do_ae_quit_application (AppleEvent* message, AppleEvent *reply, long refcon)
9442{
9443#if USE_CARBON_EVENTS
9444 OSErr err;
9445 EventRef event = NULL;
9446 static const HICommand quit_command = {kEventAttributeNone, kHICommandQuit};
9447
9448 err = CreateEvent (NULL, kEventClassCommand, kEventCommandProcess, 0,
9449 kEventAttributeUserEvent, &event);
9450 if (err == noErr)
9451 err = SetEventParameter (event, kEventParamDirectObject, typeHICommand,
9452 sizeof (HICommand), &quit_command);
9453 if (err == noErr)
9454 mac_store_application_menu_event (event);
9455 if (event)
9456 ReleaseEvent (event);
9457
9458 if (err == noErr)
9459 return noErr;
9460 else
9461 return errAEEventNotHandled;
9462#else
9463 mac_store_application_menu_event (kHICommandQuit);
9464
9465 return noErr;
9466#endif
9467}
9468
9469
9470#if __profile__ 9213#if __profile__
9471void 9214void
9472profiler_exit_proc () 9215profiler_exit_proc ()
@@ -9520,7 +9263,7 @@ main (void)
9520 9263
9521 initialize_applescript (); 9264 initialize_applescript ();
9522 9265
9523 init_required_apple_events (); 9266 init_apple_event_handler ();
9524 9267
9525 { 9268 {
9526 char **argv; 9269 char **argv;
@@ -9724,7 +9467,7 @@ mac_wait_next_event (er, sleep_time, dequeue)
9724 mouse_region = NewRgn (); 9467 mouse_region = NewRgn ();
9725 9468
9726 event_mask = everyEvent; 9469 event_mask = everyEvent;
9727 if (NILP (Fboundp (Qmac_ready_for_drag_n_drop))) 9470 if (!mac_ready_for_apple_events)
9728 event_mask -= highLevelEventMask; 9471 event_mask -= highLevelEventMask;
9729 9472
9730 current_tick = TickCount (); 9473 current_tick = TickCount ();
@@ -10892,7 +10635,6 @@ mac_initialize ()
10892 BLOCK_INPUT; 10635 BLOCK_INPUT;
10893 10636
10894#if TARGET_API_MAC_CARBON 10637#if TARGET_API_MAC_CARBON
10895 init_required_apple_events ();
10896 10638
10897#if USE_CARBON_EVENTS 10639#if USE_CARBON_EVENTS
10898#ifdef MAC_OSX 10640#ifdef MAC_OSX
@@ -10907,6 +10649,8 @@ mac_initialize ()
10907#endif /* USE_CARBON_EVENTS */ 10649#endif /* USE_CARBON_EVENTS */
10908 10650
10909#ifdef MAC_OSX 10651#ifdef MAC_OSX
10652 init_apple_event_handler ();
10653
10910 if (!inhibit_window_system) 10654 if (!inhibit_window_system)
10911 MakeMeTheFrontProcess (); 10655 MakeMeTheFrontProcess ();
10912#endif 10656#endif
@@ -10937,15 +10681,14 @@ syms_of_macterm ()
10937 Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier)); 10681 Fput (Qhyper, Qmodifier_value, make_number (hyper_modifier));
10938 Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); 10682 Fput (Qsuper, Qmodifier_value, make_number (super_modifier));
10939 10683
10940 Qapplication = intern ("application"); staticpro (&Qapplication); 10684#if USE_CARBON_EVENTS
10941 Qabout = intern ("about"); staticpro (&Qabout); 10685 Qhicommand = intern ("hicommand"); staticpro (&Qhicommand);
10942 10686#ifdef MAC_OSX
10943#if USE_CARBON_EVENTS && defined (MAC_OSX)
10944 Qpreferences = intern ("preferences"); staticpro (&Qpreferences);
10945 Qservices = intern ("services"); staticpro (&Qservices); 10687 Qservices = intern ("services"); staticpro (&Qservices);
10946 Qpaste = intern ("paste"); staticpro (&Qpaste); 10688 Qpaste = intern ("paste"); staticpro (&Qpaste);
10947 Qperform = intern ("perform"); staticpro (&Qperform); 10689 Qperform = intern ("perform"); staticpro (&Qperform);
10948#endif 10690#endif
10691#endif
10949 10692
10950#ifdef MAC_OSX 10693#ifdef MAC_OSX
10951 Fprovide (intern ("mac-carbon"), Qnil); 10694 Fprovide (intern ("mac-carbon"), Qnil);
@@ -10954,9 +10697,6 @@ syms_of_macterm ()
10954 staticpro (&Qreverse); 10697 staticpro (&Qreverse);
10955 Qreverse = intern ("reverse"); 10698 Qreverse = intern ("reverse");
10956 10699
10957 staticpro (&Qmac_ready_for_drag_n_drop);
10958 Qmac_ready_for_drag_n_drop = intern ("mac-ready-for-drag-n-drop");
10959
10960 staticpro (&x_display_name_list); 10700 staticpro (&x_display_name_list);
10961 x_display_name_list = Qnil; 10701 x_display_name_list = Qnil;
10962 10702
diff --git a/src/macterm.h b/src/macterm.h
index 214037c3346..916a461f67e 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -79,7 +79,7 @@ struct mac_display_info
79 /* Number of planes on this screen. */ 79 /* Number of planes on this screen. */
80 int n_planes; 80 int n_planes;
81 81
82 /* Whether the screen supports color */ 82 /* Whether the screen supports color */
83 int color_p; 83 int color_p;
84 84
85 /* Dimensions of this screen. */ 85 /* Dimensions of this screen. */
@@ -564,6 +564,7 @@ extern void mac_clear_area P_ ((struct frame *, int, int,
564extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *)); 564extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *));
565extern OSErr install_window_handler P_ ((WindowPtr)); 565extern OSErr install_window_handler P_ ((WindowPtr));
566extern void remove_window_handler P_ ((WindowPtr)); 566extern void remove_window_handler P_ ((WindowPtr));
567extern Lisp_Object mac_make_lispy_event_code P_ ((int));
567 568
568#define FONT_TYPE_FOR_UNIBYTE(font, ch) 0 569#define FONT_TYPE_FOR_UNIBYTE(font, ch) 0
569#define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0 570#define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0
@@ -577,7 +578,12 @@ extern void x_clear_frame_selections P_ ((struct frame *));
577extern OSErr posix_pathname_to_fsspec P_ ((const char *, FSSpec *)); 578extern OSErr posix_pathname_to_fsspec P_ ((const char *, FSSpec *));
578extern OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *, int)); 579extern OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *, int));
579extern void mac_clear_font_name_table P_ ((void)); 580extern void mac_clear_font_name_table P_ ((void));
581extern Lisp_Object mac_aedesc_to_lisp P_ ((AEDesc *));
580#if TARGET_API_MAC_CARBON 582#if TARGET_API_MAC_CARBON
583extern OSErr create_apple_event_from_event_ref P_ ((EventRef, UInt32,
584 EventParamName *,
585 EventParamType *,
586 UInt32 *, AppleEvent *));
581extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *)); 587extern CFStringRef cfstring_create_with_utf8_cstring P_ ((const char *));
582extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object)); 588extern CFStringRef cfstring_create_with_string P_ ((Lisp_Object));
583extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef)); 589extern Lisp_Object cfdata_to_lisp P_ ((CFDataRef));
@@ -592,6 +598,7 @@ extern Lisp_Object cfproperty_list_to_lisp P_ ((CFPropertyListRef, int, int));
592extern void xrm_merge_string_database P_ ((XrmDatabase, char *)); 598extern void xrm_merge_string_database P_ ((XrmDatabase, char *));
593extern Lisp_Object xrm_get_resource P_ ((XrmDatabase, char *, char *)); 599extern Lisp_Object xrm_get_resource P_ ((XrmDatabase, char *, char *));
594extern XrmDatabase xrm_get_preference_database P_ ((char *)); 600extern XrmDatabase xrm_get_preference_database P_ ((char *));
601EXFUN (Fmac_get_preference, 4);
595 602
596/* arch-tag: 6b4ca125-5bef-476d-8ee8-31ed808b7e79 603/* arch-tag: 6b4ca125-5bef-476d-8ee8-31ed808b7e79
597 (do not change this comment) */ 604 (do not change this comment) */
diff --git a/src/termhooks.h b/src/termhooks.h
index 3fea7c366fb..cb68c9e2c27 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -129,7 +129,7 @@ enum event_kind
129 by MS-Windows scroll bar controls. */ 129 by MS-Windows scroll bar controls. */
130#endif 130#endif
131 SELECTION_REQUEST_EVENT, /* Another X client wants a selection from us. 131 SELECTION_REQUEST_EVENT, /* Another X client wants a selection from us.
132 See `struct selection_event'. */ 132 See `struct selection_input_event'. */
133 SELECTION_CLEAR_EVENT, /* Another X client cleared our selection. */ 133 SELECTION_CLEAR_EVENT, /* Another X client cleared our selection. */
134 BUFFER_SWITCH_EVENT, /* A process filter has switched buffers. */ 134 BUFFER_SWITCH_EVENT, /* A process filter has switched buffers. */
135 DELETE_WINDOW_EVENT, /* An X client said "delete this window". */ 135 DELETE_WINDOW_EVENT, /* An X client said "delete this window". */
@@ -177,12 +177,22 @@ enum event_kind
177 177
178 /* Queued from XTread_socket when session manager sends 178 /* Queued from XTread_socket when session manager sends
179 save yourself before shutdown. */ 179 save yourself before shutdown. */
180 SAVE_SESSION_EVENT 180 SAVE_SESSION_EVENT,
181
182#ifdef MAC_OS
183 /* Generated when an Apple event, a HICommand event, or a Services
184 menu event is received and the corresponding handler is
185 registered. Members `x' and `y' are for the event class and ID
186 symbols, respectively. Member `code' points to the Apple event
187 descriptor. Parameters for Non-Apple events are converted to
188 those in Apple events. */
189 MAC_APPLE_EVENT
190#endif
181}; 191};
182 192
183/* If a struct input_event has a kind which is SELECTION_REQUEST_EVENT 193/* If a struct input_event has a kind which is SELECTION_REQUEST_EVENT
184 or SELECTION_CLEAR_EVENT, then its contents are really described 194 or SELECTION_CLEAR_EVENT, then its contents are really described
185 by `struct selection_event'; see xterm.h. */ 195 by `struct selection_input_event'; see xterm.h. */
186 196
187/* The keyboard input buffer is an array of these structures. Each one 197/* The keyboard input buffer is an array of these structures. Each one
188 represents some sort of input event - a keystroke, a mouse click, or 198 represents some sort of input event - a keystroke, a mouse click, or
@@ -208,7 +218,7 @@ struct input_event
208 unsigned long timestamp; 218 unsigned long timestamp;
209 219
210 /* This is padding just to put the frame_or_window field 220 /* This is padding just to put the frame_or_window field
211 past the size of struct selection_event. */ 221 past the size of struct selection_input_event. */
212 int *padding[2]; 222 int *padding[2];
213 223
214 /* This field is copied into a vector while the event is in the queue, 224 /* This field is copied into a vector while the event is in the queue,
diff --git a/src/w32fns.c b/src/w32fns.c
index 6fc6c860808..d1e4e49bb03 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -8939,8 +8939,12 @@ w32_abort()
8939 button = MessageBox (NULL, 8939 button = MessageBox (NULL,
8940 "A fatal error has occurred!\n\n" 8940 "A fatal error has occurred!\n\n"
8941 "Would you like to attach a debugger?\n\n" 8941 "Would you like to attach a debugger?\n\n"
8942 "Select YES to debug, NO to abort Emacs", 8942 "Select YES to debug, NO to abort Emacs"
8943 "Emacs Abort Dialog", 8943#if __GNUC__
8944 "\n\n(type \"gdb -p <emacs-PID>\" and\n"
8945 "\"continue\" inside GDB before clicking YES.)"
8946#endif
8947 , "Emacs Abort Dialog",
8944 MB_ICONEXCLAMATION | MB_TASKMODAL 8948 MB_ICONEXCLAMATION | MB_TASKMODAL
8945 | MB_SETFOREGROUND | MB_YESNO); 8949 | MB_SETFOREGROUND | MB_YESNO);
8946 switch (button) 8950 switch (button)