aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2005-01-16 03:40:12 +0000
committerMiles Bader2005-01-16 03:40:12 +0000
commit54c4c5465ff6dcf158fc47b5894a688ec356f900 (patch)
tree7fd504f98080bd7c498874d3662ef67086a09b66
parentd570d39f949427c4a5041375529c3748d72c6e3c (diff)
parent42187e99f8adc31d93d027b9017160731aab8972 (diff)
downloademacs-54c4c5465ff6dcf158fc47b5894a688ec356f900.tar.gz
emacs-54c4c5465ff6dcf158fc47b5894a688ec356f900.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-2
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-83 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-84 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-3 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-4 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-5 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-6 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-11 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-12 Remove "-face" suffix from lazy-highlight face name * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-13 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-16 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-18 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-21 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-22 <no summary provided> * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-23 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-39 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-40 Fix regressions from latest reftex update * miles@gnu.org--gnu-2005/gnus--rel--5.10--base-0 tag of miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-82 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-1 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-2 Merge from miles@gnu.org--gnu-2004 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-3 Merge from emacs--cvs-trunk--0
-rw-r--r--admin/FOR-RELEASE74
-rw-r--r--etc/ChangeLog13
-rw-r--r--etc/MORE.STUFF69
-rw-r--r--etc/NEWS90
-rw-r--r--etc/TUTORIAL.nl1050
-rw-r--r--lisp/ChangeLog559
-rw-r--r--lisp/add-log.el4
-rw-r--r--lisp/battery.el17
-rw-r--r--lisp/calc/calc-embed.el6
-rw-r--r--lisp/calc/calc-ext.el78
-rw-r--r--lisp/calc/calc-help.el18
-rw-r--r--lisp/calc/calc-mode.el11
-rw-r--r--lisp/calc/calc-prog.el51
-rw-r--r--lisp/calc/calc-sel.el3
-rw-r--r--lisp/calc/calc-units.el2
-rw-r--r--lisp/calc/calc-yank.el23
-rw-r--r--lisp/calc/calc.el370
-rw-r--r--lisp/cus-edit.el73
-rw-r--r--lisp/cus-face.el1
-rw-r--r--lisp/custom.el44
-rw-r--r--lisp/desktop.el127
-rw-r--r--lisp/ebuff-menu.el4
-rw-r--r--lisp/electric.el20
-rw-r--r--lisp/emacs-lisp/autoload.el4
-rw-r--r--lisp/emacs-lisp/elint.el2
-rw-r--r--lisp/emacs-lisp/find-func.el189
-rw-r--r--lisp/emacs-lisp/lisp-mnt.el7
-rw-r--r--lisp/emacs-lisp/lisp-mode.el3
-rw-r--r--lisp/emacs-lisp/re-builder.el8
-rw-r--r--lisp/facemenu.el113
-rw-r--r--lisp/files.el197
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/spam.el14
-rw-r--r--lisp/help-fns.el21
-rw-r--r--lisp/help-macro.el2
-rw-r--r--lisp/imenu.el18
-rw-r--r--lisp/info-look.el11
-rw-r--r--lisp/info.el57
-rw-r--r--lisp/isearch.el240
-rw-r--r--lisp/loadhist.el21
-rw-r--r--lisp/mail/mailabbrev.el24
-rw-r--r--lisp/mail/rmail.el305
-rw-r--r--lisp/man.el87
-rw-r--r--lisp/mouse.el64
-rw-r--r--lisp/progmodes/ebrowse.el18
-rw-r--r--lisp/progmodes/hideshow.el3
-rw-r--r--lisp/progmodes/perl-mode.el8
-rw-r--r--lisp/progmodes/sh-script.el82
-rw-r--r--lisp/replace.el53
-rw-r--r--lisp/simple.el28
-rw-r--r--lisp/startup.el6
-rw-r--r--lisp/textmodes/ispell.el51
-rw-r--r--lisp/textmodes/org.el599
-rw-r--r--lisp/textmodes/reftex-auc.el4
-rw-r--r--lisp/textmodes/reftex-cite.el147
-rw-r--r--lisp/textmodes/reftex-dcr.el4
-rw-r--r--lisp/textmodes/reftex-global.el4
-rw-r--r--lisp/textmodes/reftex-index.el45
-rw-r--r--lisp/textmodes/reftex-parse.el4
-rw-r--r--lisp/textmodes/reftex-ref.el97
-rw-r--r--lisp/textmodes/reftex-sel.el18
-rw-r--r--lisp/textmodes/reftex-toc.el5
-rw-r--r--lisp/textmodes/reftex-vars.el108
-rw-r--r--lisp/textmodes/reftex.el19
-rw-r--r--lisp/textmodes/sgml-mode.el52
-rw-r--r--lisp/toolbar/README2
-rw-r--r--lisp/toolbar/back_arrow.pbmbin0 -> 185 bytes
-rw-r--r--lisp/toolbar/back_arrow.xpm57
-rw-r--r--lisp/toolbar/fwd_arrow.pbmbin0 -> 185 bytes
-rw-r--r--lisp/toolbar/fwd_arrow.xpm70
-rw-r--r--lisp/toolbar/lc-back_arrow.xpm33
-rw-r--r--lisp/toolbar/lc-fwd_arrow.xpm32
-rw-r--r--lisp/type-break.el30
-rw-r--r--lisp/uniquify.el18
-rw-r--r--lisp/url/ChangeLog10
-rw-r--r--lisp/url/url-http.el4
-rw-r--r--lisp/url/url.el42
-rw-r--r--lisp/vc-arch.el6
-rw-r--r--lisp/vc-cvs.el4
-rw-r--r--lisp/vc-mcvs.el4
-rw-r--r--lisp/vc-svn.el9
-rw-r--r--lisp/vc.el22
-rw-r--r--lisp/woman.el3
-rw-r--r--lisp/xt-mouse.el52
-rw-r--r--lispref/ChangeLog54
-rw-r--r--lispref/commands.texi5
-rw-r--r--lispref/display.texi17
-rw-r--r--lispref/keymaps.texi72
-rw-r--r--lispref/modes.texi31
-rw-r--r--lispref/os.texi3
-rw-r--r--lispref/text.texi122
-rw-r--r--man/ChangeLog78
-rw-r--r--man/calc.texi200
-rw-r--r--man/commands.texi12
-rw-r--r--man/custom.texi17
-rw-r--r--man/display.texi6
-rw-r--r--man/faq.texi2
-rw-r--r--man/message.texi19
-rw-r--r--man/org.texi36
-rw-r--r--man/programs.texi93
-rw-r--r--man/reftex.texi1817
-rw-r--r--man/rmail.texi213
-rw-r--r--man/search.texi17
-rw-r--r--man/widget.texi7
-rw-r--r--src/ChangeLog209
-rw-r--r--src/alloc.c50
-rw-r--r--src/dispextern.h4
-rw-r--r--src/fns.c6
-rw-r--r--src/fringe.c39
-rw-r--r--src/gtkutil.c32
-rw-r--r--src/keyboard.c24
-rw-r--r--src/keymap.c11
-rw-r--r--src/macfns.c95
-rw-r--r--src/macterm.c208
-rw-r--r--src/macterm.h2
-rw-r--r--src/term.c4
-rw-r--r--src/w32bdf.c5
-rw-r--r--src/w32fns.c22
-rw-r--r--src/w32term.c10
-rw-r--r--src/window.c8
-rw-r--r--src/xdisp.c272
-rw-r--r--src/xfaces.c63
-rw-r--r--src/xmenu.c14
-rw-r--r--src/xselect.c10
-rw-r--r--src/xterm.h2
125 files changed, 6621 insertions, 3142 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index 797e0d6c277..daaeb27b80e 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -11,6 +11,9 @@ To be done by Sergey Poznyakoff <gray@Mirddin.farlep.net>.
11gracefully if something isn't supported over Tramp. 11gracefully if something isn't supported over Tramp.
12To be done by Andre Spiegel <spiegel@gnu.org>. 12To be done by Andre Spiegel <spiegel@gnu.org>.
13 13
14** define-minor-mode should not put :require into defcustom.
15See msg from rms to emacs-devel on 21 Dec.
16
14* FATAL ERRORS 17* FATAL ERRORS
15 18
16** Investigate face cache related crash. 19** Investigate face cache related crash.
@@ -32,6 +35,9 @@ invalid pointer from string_free_list.
32 35
33** Fix up url-ldap.el. 36** Fix up url-ldap.el.
34 37
38** url/*.el has lots of `(declare (special ...))' which
39are meaningless. What's that trying to do?
40
35* BUGS 41* BUGS
36 42
37** Incomplete overlay mouse-face highlight bug (Ralf Angeli, Oct 18) 43** Incomplete overlay mouse-face highlight bug (Ralf Angeli, Oct 18)
@@ -62,42 +68,6 @@ further.
62I think in the near future we will see more of this problem, so it might be 68I think in the near future we will see more of this problem, so it might be
63time to make anfe-ftp more intelligent. 69time to make anfe-ftp more intelligent.
64 70
65** Bug in url-http-parse-headers, reported in
66From: Vivek Dasmohapatra <vivek@zeus.com>
67Date: Tue, 28 Sep 2004 16:13:13 +0100
68
69Fetching a url with url-retrieve can reult in an anrbitrary buffer
70being killed if a 401 (or possibly a 407) result is encountered:
71
72url-http-parse-headers calls url-http-handle-authentication,
73which can call url-retrieve.
74
75This results in the current buffer being killed, and a new http buffer
76being generated. However, when the old http buffer is killed, emacs
77picks the top buffer from the list as the new current buffer, so by the
78time we get to the end of url-http-parse-headers, _that_ buffer is marked
79as dead even though it is not necessarily a url buffer, so next time the
80url libraries reap their dead buffers, an innocent bystander buffer is
81killed instead (and an obsolete http buffer may be left lying around too).
82
83A possible fix (which I am currently using) is to call set-buffer
84on the return value of url-http-parse-headers:
85
86 (case url-http-response-status
87 (401
88 ;; The request requires user authentication. The response
89 ;; MUST include a WWW-Authenticate header field containing a
90 ;; challenge applicable to the requested resource. The
91 ;; client MAY repeat the request with a suitable
92 ;; Authorization header field.
93 (url-mark-buffer-as-dead (current-buffer))
94 (set-buffer (url-http-handle-authentication nil)))
95etc ....
96
97which makes sure that it is the right http buffer that is current when
98we come to mark the http buffers as dead.
99
100
101 71
102* GTK RELATED BUGS 72* GTK RELATED BUGS
103 73
@@ -183,22 +153,6 @@ interrupting I can get a backtrace, here's an example:
183Update: Maybe only reveals itself when compiled with GTK+ 153Update: Maybe only reveals itself when compiled with GTK+
184 154
185 155
186** line-spacing and Electric-pop-up-window
187
188From: SAITO Takuya <tabmore@rivo.mediatti.net>
189Date: Mon, 31 May 2004 02:08:10 +0900 (JST)
190
191Electric-pop-up-window does not work well
192if truncate long lines disabled and/or
193`line-spacing' is set to positive integer.
194
195For example, start emacs -Q --line-spacing 1, and type M-` .
196Then, the last line of *Completions* buffer is not visible.
197
198fit-window-to-buffer works well for me, so I guess
199Electric-pop-up-window can use it.
200
201
202** Partial highlighting of wrapped overlay 156** Partial highlighting of wrapped overlay
203 157
204From: Ralf Angeli <angeli@iwi.uni-sb.de> 158From: Ralf Angeli <angeli@iwi.uni-sb.de>
@@ -245,9 +199,10 @@ set.
245 199
246** Check the Emacs manual. 200** Check the Emacs manual.
247 201
248Each manual section should be proof-read by at least two people. 202Each manual section should be checked for factual correctness
249After each file name, on the same line or the following line, come the 203regarding recent changes by at least two people. After each file
250names of the people who have checked it. 204name, on the same line or the following line, come the names of the
205people who have checked it.
251 206
252 207
253SECTION READERS 208SECTION READERS
@@ -283,7 +238,7 @@ man/msdog.texi
283man/mule.texi "Luc Teirlinck" 238man/mule.texi "Luc Teirlinck"
284man/m-x.texi "Luc Teirlinck" 239man/m-x.texi "Luc Teirlinck"
285man/picture.texi 240man/picture.texi
286man/programs.texi 241man/programs.texi "Stephen Eglen"
287man/regs.texi "Luc Teirlinck" 242man/regs.texi "Luc Teirlinck"
288man/rmail.texi 243man/rmail.texi
289man/screen.texi "Luc Teirlinck" 244man/screen.texi "Luc Teirlinck"
@@ -296,9 +251,10 @@ man/xresources.texi
296 251
297** Check the Emacs Lisp manual. 252** Check the Emacs Lisp manual.
298 253
299Each manual section should be proof-read by at least two people. 254Each manual section should be checked for factual correctness
300After each file name, on the same line or the following line, come the 255regarding recent changes by at least two people. After each file
301names of the people who have checked it. 256name, on the same line or the following line, come the names of the
257people who have checked it.
302 258
303SECTION READERS 259SECTION READERS
304---------------------------------- 260----------------------------------
diff --git a/etc/ChangeLog b/etc/ChangeLog
index f0123a8b90d..b9e9fa20a6e 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,16 @@
12005-01-15 Frederik Fouvry <fouvry@CoLi.Uni-SB.DE>
2
3 * TUTORIAL.nl: Correct translation and the Dutch text (typos).
4 More consistent use of terminology.
5
62005-01-13 Cheng Gao <chenggao@gmail.com>
7
8 * MORE.STUFF: Add entries of some well known and widely used packages.
9
102005-01-07 Lars Hansen <larsh@math.ku.dk>
11
12 * NEWS: Describe desktop package lazy restore feature.
13
12004-12-21 Richard M. Stallman <rms@gnu.org> 142004-12-21 Richard M. Stallman <rms@gnu.org>
2 15
3 * DISTRIB: Don't say "freeware". 16 * DISTRIB: Don't say "freeware".
diff --git a/etc/MORE.STUFF b/etc/MORE.STUFF
index ad3f607c26a..c2dce4bfd63 100644
--- a/etc/MORE.STUFF
+++ b/etc/MORE.STUFF
@@ -34,7 +34,7 @@ The Emacs Wiki has an area for storing elisp files
34 34
35You might find bug-fixes or enhancements in these places. 35You might find bug-fixes or enhancements in these places.
36 36
37 * Ada: <URL:http://libre.act-europe.fr/adamode> 37 * Ada-mode: <URL:http://libre.act-europe.fr/adamode>
38 38
39 * Battery and Info Look: <URL:ftp://ftp.ul.bawue.de/pub/purple/emacs> 39 * Battery and Info Look: <URL:ftp://ftp.ul.bawue.de/pub/purple/emacs>
40 40
@@ -80,6 +80,8 @@ You might find bug-fixes or enhancements in these places.
80 80
81 * Iswitchb: <URL:http://www.anc.ed.ac.uk/%7Estephen/emacs/iswitchb.el> 81 * Iswitchb: <URL:http://www.anc.ed.ac.uk/%7Estephen/emacs/iswitchb.el>
82 82
83 * MH-E: <URL:http://mh-e.sourceforge.net/>
84
83 * PC Selection: <URL:ftp://ftp.thp.uni-duisburg.de/pub/source/elisp/> 85 * PC Selection: <URL:ftp://ftp.thp.uni-duisburg.de/pub/source/elisp/>
84 86
85 * PS mode: <URL:http://odur.let.rug.nl/%7Ekleiweg/postscript/> 87 * PS mode: <URL:http://odur.let.rug.nl/%7Ekleiweg/postscript/>
@@ -133,6 +135,12 @@ Several are for Debian GNU/Linux in particular.
133 emacs-mule, say by adding `("\\.bbdb\\'" . emacs-mule)' to 135 emacs-mule, say by adding `("\\.bbdb\\'" . emacs-mule)' to
134 `file-coding-system-alist' for non-ASCII characters.] 136 `file-coding-system-alist' for non-ASCII characters.]
135 137
138 * Boxquote: <URL:http://www.davep.org/emacs/>
139
140 * CEDET: Collection of Emacs Development Environment Tools, including
141 EIEIO, Semantic, Speedbar, EDE, and COGRE:
142 <URL:http://cedet.sourceforge.net/>
143
136 * CJK-emacs: Converting MULE-encoded text to TeX: 144 * CJK-emacs: Converting MULE-encoded text to TeX:
137 <URL:ftp://ctan.tug.org/tex-archive/language/chinese/CJK/> and 145 <URL:ftp://ctan.tug.org/tex-archive/language/chinese/CJK/> and
138 mirrors of the `CTAN' TeX archives. 146 mirrors of the `CTAN' TeX archives.
@@ -140,14 +148,13 @@ Several are for Debian GNU/Linux in particular.
140 * Dismal: spreadsheet: 148 * Dismal: spreadsheet:
141 <URL:http://acs.ist.psu.edu/dismal/dismal.html> 149 <URL:http://acs.ist.psu.edu/dismal/dismal.html>
142 150
151 * ECB: Emacs Code Browser: <URL:http://ecb.sourceforge.net/>
152
143 * EDB: database: <URL:http://www.glug.org/people/ttn/software/edb/> 153 * EDB: database: <URL:http://www.glug.org/people/ttn/software/edb/>
144 154
145 * Ee: categorizing information manager: 155 * Ee: categorizing information manager:
146 <URL:http://www.jurta.org/emacs/ee/> 156 <URL:http://www.jurta.org/emacs/ee/>
147 157
148 * EIEIO (object system), ETalk (interface to Internet talk):
149 <URL:http://cedet.sourceforge.net/eieio.shtml>
150
151 * EFS: enhanced version of ange-ftp: 158 * EFS: enhanced version of ange-ftp:
152 <URL:http://www-uk.hpl.hp.com/people/ange/efs> 159 <URL:http://www-uk.hpl.hp.com/people/ange/efs>
153 Version 1.16 is said not to work properly with Emacs 20. 160 Version 1.16 is said not to work properly with Emacs 20.
@@ -156,12 +163,25 @@ Several are for Debian GNU/Linux in particular.
156 From GNU distribution mirrors. (Much of this functionality is now 163 From GNU distribution mirrors. (Much of this functionality is now
157 in Emacs.) 164 in Emacs.)
158 165
166 * EMacro: <URL:http://emacro.sourceforge.net/>
167 EMacro is a portable configuration file that configures itself.
168
159 * Emacs statistical system (ESS): statistical programming within Emacs 169 * Emacs statistical system (ESS): statistical programming within Emacs
160 <URL:http://ess.r-project.org> 170 <URL:http://ess.r-project.org>
161 171
162 * Emacspeak -- A Speech Output Subsystem For Emacs: 172 * Emacspeak -- A Speech Output Subsystem For Emacs:
163 <URL:http://emacspeak.sourceforge.net/> 173 <URL:http://emacspeak.sourceforge.net/>
164 174
175 * Emacs-w3m : <URL:http://emacs-w3m.namazu.org/>
176 A simple Emacs interface to w3m, which is a text-mode
177 WWW browser
178
179 * Emacs Wiki Mode: <URL:http://mwolson.org/projects/EmacsWiki.html>
180 A wiki-like publishing tool and personal information manager
181
182 * ERC: IRC client:
183 <URL:http://www.emacswiki.org/cgi-bin/wiki?EmacsIRCClient>
184
165 * Gnuserv: 185 * Gnuserv:
166 <URL:ftp://ftp.splode.com/pub/users/friedman/packages/fgnuserv-1.0.tar.gz> 186 <URL:ftp://ftp.splode.com/pub/users/friedman/packages/fgnuserv-1.0.tar.gz>
167 Enhanced emacsclient/emacsserver. See also 187 Enhanced emacsclient/emacsserver. See also
@@ -184,14 +204,29 @@ Several are for Debian GNU/Linux in particular.
184 Provides an interactive environment for manipulating an inferior 204 Provides an interactive environment for manipulating an inferior
185 process running some form of Lisp. 205 process running some form of Lisp.
186 206
187 * JDE: <URL:http://jdee.sunsite.dk/> 207 * JDEE: <URL:http://jdee.sunsite.dk/>
188 Provides a Java development environment for Emacs. 208 Provides a Java development environment for Emacs.
189 209
190 * Mailcrypt: 210 * Mailcrypt:
191 <URL:http://www.pobox.com/%7Elbudney/linux/software/mailcrypt.html> 211 <URL:http://mailcrypt.sourceforge.net/>
192 PGP and GPG support. PGP isn't free software, but GPG, the GNU 212 PGP and GPG support. PGP isn't free software, but GPG, the GNU
193 Privacy Guard, is a free replacement <URL:http://www.gnupg.org/>. 213 Privacy Guard, is a free replacement <URL:http://www.gnupg.org/>.
194 214
215 * Mew: <URL:http://www.mew.org/>
216 A MIME mail reader for Emacs/XEmacs.
217
218 * MMM Mode: <URL:http://mmm-mode.sourceforge.net/>
219 MMM Mode is an emacs add-on package providing a minor mode that
220 allows Multiple Major Modes to coexist in one buffer.
221
222 * nXML Mode: New mode for XML:
223 <URL:http://www.thaiopensource.com/nxml-mode/>
224 nXML mode is an addon for GNU Emacs, which makes GNU Emacs into a
225 powerful XML editor.
226
227 * Planner Mode:
228 <URL:http://sacha.free.net.ph/notebook/wiki/PlannerMode.php>
229
195 * Pointers to MIME packages: 230 * Pointers to MIME packages:
196 <URL:http://bmrc.berkeley.edu/%7Etrey/emacs/mime.html> 231 <URL:http://bmrc.berkeley.edu/%7Etrey/emacs/mime.html>
197 232
@@ -201,6 +236,18 @@ Several are for Debian GNU/Linux in particular.
201 * PSGML: <URL:http://www.lysator.liu.se/projects/about_psgml.html> 236 * PSGML: <URL:http://www.lysator.liu.se/projects/about_psgml.html>
202 DTD-aware serious SGML/XML editing. 237 DTD-aware serious SGML/XML editing.
203 238
239 * Quack: <URL:http://www.neilvandyke.org/quack/>
240 Quack enhances Emacs support for Scheme
241
242 * Remember:
243 <URL:http://sacha.free.net.ph/notebook/wiki/RememberEl.php>
244
245 * Session: <URL:http://emacs-session.sourceforge.net/>
246 Session Management for Emacs.
247
248 * SLIME: The Superior Lisp Interaction Mode for Emacs:
249 <URL:http://common-lisp.net/project/slime/>
250
204 * Tamago: Chinese/Japanese/Korean input method 251 * Tamago: Chinese/Japanese/Korean input method
205 <URL:ftp://m17n.org/pub/tamago/> 252 <URL:ftp://m17n.org/pub/tamago/>
206 Emacs Lisp package to provide input methods for CJK characters. 253 Emacs Lisp package to provide input methods for CJK characters.
@@ -209,6 +256,8 @@ Several are for Debian GNU/Linux in particular.
209 Wnn6, 256 Wnn6,
210 SJ3 Ver.2 257 SJ3 Ver.2
211 258
259 * Tiny Tools: <URL:http://tiny-tools.sourceforge.net/>
260
212 * VM (View Mail): <URL:http://www.wonderworks.com/vm/> Alternative 261 * VM (View Mail): <URL:http://www.wonderworks.com/vm/> Alternative
213 mail reader. There is a VM newsgroup: <URL:news:gnu.emacs.vm.info> 262 mail reader. There is a VM newsgroup: <URL:news:gnu.emacs.vm.info>
214 263
@@ -217,6 +266,14 @@ Several are for Debian GNU/Linux in particular.
217 <URL:news://sunsite.auc.dk/emacs.w3> and a W3 development mail 266 <URL:news://sunsite.auc.dk/emacs.w3> and a W3 development mail
218 list/newsgroup <URL:news://sunsite.auc.dk/emacs.w3.dev>. 267 list/newsgroup <URL:news://sunsite.auc.dk/emacs.w3.dev>.
219 268
269 * Wanderlust: <URL:http://www.gohome.org/wl/>
270 Yet Another Message Interface on Emacsen. Wanderlust is a mail/news
271 reader supporting IMAP4rev1 for emacsen.
272
273 * WhizzyTex: <URL:http://pauillac.inria.fr/whizzytex/>
274 WhizzyTeX provides a minor mode for Emacs or XEmacs, a (bash)
275 shell-script daemon and some LaTeX macros.
276
220 * X-Symbol: <URL:http://x-symbol.sf.net/> 277 * X-Symbol: <URL:http://x-symbol.sf.net/>
221 Quasi-WYSIWYG editing of TeX & al. (It will be improved to take 278 Quasi-WYSIWYG editing of TeX & al. (It will be improved to take
222 better advantage of Emacs 21 features.) 279 better advantage of Emacs 21 features.)
diff --git a/etc/NEWS b/etc/NEWS
index ee8b01a5999..d293b79ab13 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1,5 +1,6 @@
1GNU Emacs NEWS -- history of user-visible changes. 2003-05-21 1GNU Emacs NEWS -- history of user-visible changes. 2003-05-21
2Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 2Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
3 Free Software Foundation, Inc.
3See the end for copying conditions. 4See the end for copying conditions.
4 5
5Please send Emacs bug reports to bug-gnu-emacs@gnu.org. 6Please send Emacs bug reports to bug-gnu-emacs@gnu.org.
@@ -173,6 +174,21 @@ types any more. Add -DUSE_LISP_UNION_TYPE if you want union types.
173 174
174* Changes in Emacs 21.4 175* Changes in Emacs 21.4
175 176
177** Control characters and escape glyphs are now shown in the new
178escape-glyph face.
179
180** Non-breaking space and hyphens are now prefixed with an escape
181character, unless the new user variable `show-nonbreak-escape' is set
182to nil.
183
184---
185** The type-break package now allows `type-break-file-name' to be nil
186and if so, doesn't store any data across sessions. This is handy if
187you don't want the .type-break file in your home directory or are
188annoyed by the need for interaction when you kill Emacs.
189
190** display-battery has been replaced by display-battery-mode.
191
176** calculator.el now has radix grouping mode, which is available when 192** calculator.el now has radix grouping mode, which is available when
177`calculator-output-radix' is non-nil. In this mode a separator 193`calculator-output-radix' is non-nil. In this mode a separator
178character is used every few digits, making it easier to see byte 194character is used every few digits, making it easier to see byte
@@ -266,6 +282,9 @@ existing values. For example:
266will start up Emacs on an initial frame of 100x20 with red background, 282will start up Emacs on an initial frame of 100x20 with red background,
267irrespective of geometry or background setting on the Windows registry. 283irrespective of geometry or background setting on the Windows registry.
268 284
285** The terminal emulation code in term.el has been improved, it can
286run most curses applications now.
287
269** New features in evaluation commands 288** New features in evaluation commands
270 289
271+++ 290+++
@@ -467,20 +486,30 @@ saving.
467*** Buffers are saved in the desktop file in the same order as that in the 486*** Buffers are saved in the desktop file in the same order as that in the
468buffer list. 487buffer list.
469 488
489*** The desktop package can be customized to restore only some buffers immediately,
490remaining buffers are restored lazily (when Emacs is idle).
491
470*** New commands: 492*** New commands:
471 - desktop-revert reverts to the last loaded desktop. 493 - desktop-revert reverts to the last loaded desktop.
472 - desktop-change-dir kills current desktop and loads a new. 494 - desktop-change-dir kills current desktop and loads a new.
473 - desktop-save-in-desktop-dir saves desktop in the directory from which 495 - desktop-save-in-desktop-dir saves desktop in the directory from which
474 it was loaded. 496 it was loaded.
497 - desktop-lazy-complete runs the desktop load to completion.
498 - desktop-lazy-abort aborts lazy loading of the desktop.
475 499
476*** New customizable variables: 500*** New customizable variables:
477 - desktop-save. Determins whether the desktop should be saved when it is 501 - desktop-save. Determins whether the desktop should be saved when it is
478 killed. 502 killed.
479 - desktop-file-name-format. 503 - desktop-file-name-format. Format in which desktop file names should be saved.
480 - desktop-path. List of directories in which to lookup the desktop file. 504 - desktop-path. List of directories in which to lookup the desktop file.
481 - desktop-locals-to-save. 505 - desktop-locals-to-save. List of local variables to save.
482 - desktop-globals-to-clear. 506 - desktop-globals-to-clear. List of global variables that `desktop-clear' will clear.
483 - desktop-clear-preserve-buffers-regexp. 507 - desktop-clear-preserve-buffers-regexp. Regexp identifying buffers that `desktop-clear'
508 should not delete.
509 - desktop-restore-eager. Number of buffers to restore immediately. Remaining buffers are
510 restored lazily (when Emacs is idle).
511 - desktop-lazy-verbose. Verbose reporting of lazily created buffers.
512 - desktop-lazy-idle-delay. Idle delay before starting to create buffers.
484 513
485*** New command line option --no-desktop 514*** New command line option --no-desktop
486 515
@@ -697,11 +726,6 @@ too. If you want to use just plain `*' as a wildcard, type `*""'; the
697doublequotes make no difference in the shell, but they prevent 726doublequotes make no difference in the shell, but they prevent
698special treatment in `dired-do-shell-command'. 727special treatment in `dired-do-shell-command'.
699 728
700+++
701*** Dired's v command now runs external viewers to view certain
702types of files. The variable `dired-view-command-alist' controls
703what external viewers to use and when.
704
705*** In Dired, the w command now copies the current line's file name 729*** In Dired, the w command now copies the current line's file name
706into the kill ring. With a zero prefix arg, copies absolute file names. 730into the kill ring. With a zero prefix arg, copies absolute file names.
707 731
@@ -737,7 +761,7 @@ multiple files, and C-x d passes it to `dired'.
737** Info mode: 761** Info mode:
738 762
739*** A numeric prefix argument of `info' selects an Info buffer 763*** A numeric prefix argument of `info' selects an Info buffer
740with the number appended to the *info* buffer name. 764with the number appended to the *info* buffer name (e.g. "*info*<2>").
741 765
742*** Regexp isearch (C-M-s and C-M-r) can search through multiple nodes. 766*** Regexp isearch (C-M-s and C-M-r) can search through multiple nodes.
743Failed isearch wraps to the top/final node. 767Failed isearch wraps to the top/final node.
@@ -746,6 +770,10 @@ Failed isearch wraps to the top/final node.
746`Info-search-backward', and `Info-search-next' which repeats the last 770`Info-search-backward', and `Info-search-next' which repeats the last
747search without prompting for a new search string. 771search without prompting for a new search string.
748 772
773*** New command `Info-history-forward' (bound to r and new toolbar icon)
774moves forward in history to the node you returned from after using
775`Info-history-back' (renamed from `Info-last').
776
749*** New command `Info-history' (bound to L) displays a menu of visited nodes. 777*** New command `Info-history' (bound to L) displays a menu of visited nodes.
750 778
751*** New command `Info-toc' (bound to T) creates a node with table of contents 779*** New command `Info-toc' (bound to T) creates a node with table of contents
@@ -1905,7 +1933,7 @@ c-require-final-newline. That is a list of modes, and only those
1905modes set require-final-newline. By default that's C, C++ and 1933modes set require-final-newline. By default that's C, C++ and
1906Objective-C. 1934Objective-C.
1907 1935
1908The specified modes set require-final-newline based on 1936The specified modes set require-final-newline based on
1909mode-require-final-newline, as usual. 1937mode-require-final-newline, as usual.
1910 1938
1911*** Format change for syntactic context elements. 1939*** Format change for syntactic context elements.
@@ -2168,6 +2196,14 @@ displays a buffer menu. This option turns the buffer menu off.
2168--- 2196---
2169** Rmail now displays 5-digit message ids in its summary buffer. 2197** Rmail now displays 5-digit message ids in its summary buffer.
2170 2198
2199+++
2200** Support for `movemail' from GNU mailutils was added to Rmail.
2201This version of `movemail' allows to read mail from a wide range of
2202mailbox formats, including remote POP3 and IMAP4 mailboxes with or
2203without TLS encryption. If GNU mailutils is installed on the system
2204and its version of `movemail' can be found in exec-path, it will be
2205used instead of the native one.
2206
2171--- 2207---
2172** On MS Windows, the "system caret" now follows the cursor. 2208** On MS Windows, the "system caret" now follows the cursor.
2173This enables Emacs to work better with programs that need to track 2209This enables Emacs to work better with programs that need to track
@@ -2501,6 +2537,13 @@ timing measurements of code (including the garbage collection component).
2501** `cfengine-mode' is a major mode for editing GNU Cfengine 2537** `cfengine-mode' is a major mode for editing GNU Cfengine
2502configuration files. 2538configuration files.
2503 2539
2540* Incompatible Lisp Changes in Emacs 21.4
2541
2542+++
2543** Mode line display ignores text properties as well as the
2544:propertize and :eval forms in the value of a variable whose
2545`risky-local-variable' property is nil.
2546
2504* Lisp Changes in Emacs 21.4 2547* Lisp Changes in Emacs 21.4
2505 2548
2506+++ 2549+++
@@ -2687,7 +2730,7 @@ specified number of evenly sized slices (rows x columns).
2687A newline may now have line-height and line-spacing text or overlay 2730A newline may now have line-height and line-spacing text or overlay
2688properties that control the height of the corresponding display row. 2731properties that control the height of the corresponding display row.
2689 2732
2690If the line-height property value is 0, the newline does not 2733If the line-height property value is t, the newline does not
2691contribute to the height of the display row; instead the height of the 2734contribute to the height of the display row; instead the height of the
2692newline glyph is reduced. Also, a line-spacing property on this 2735newline glyph is reduced. Also, a line-spacing property on this
2693newline is ignored. This can be used to tile small images or image 2736newline is ignored. This can be used to tile small images or image
@@ -2701,10 +2744,19 @@ If the line-height property value is a float, the minimum line height
2701is calculated by multiplying the default frame line height by the 2744is calculated by multiplying the default frame line height by the
2702given value. 2745given value.
2703 2746
2704If the line-height property value is a cons (RATIO . FACE), the 2747If the line-height property value is a cons (FACE . RATIO), the
2705minimum line height is calculated as RATIO * height of named FACE. 2748minimum line height is calculated as RATIO * height of named FACE.
2706RATIO is int or float. If FACE is t, it specifies the current face. 2749RATIO is int or float. If FACE is t, it specifies the current face.
2707 2750
2751If the line-height property value is a cons (nil . RATIO), the line
2752height is calculated as RATIO * actual height of the line's contents.
2753
2754If the line-height value is a cons (HEIGHT . TOTAL), HEIGHT specifies
2755the line height as described above, while TOTAL is any of the forms
2756described above and specifies the total height of the line, causing a
2757varying number of pixels to be inserted after the line to make it line
2758exactly that many pixels high.
2759
2708If the line-spacing property value is an positive integer, the value 2760If the line-spacing property value is an positive integer, the value
2709is used as additional pixels to insert after the display line; this 2761is used as additional pixels to insert after the display line; this
2710overrides the default frame line-spacing and any buffer local value of 2762overrides the default frame line-spacing and any buffer local value of
@@ -2713,11 +2765,6 @@ the line-spacing variable.
2713If the line-spacing property may be a float or cons, the line spacing 2765If the line-spacing property may be a float or cons, the line spacing
2714is calculated as specified above for the line-height property. 2766is calculated as specified above for the line-height property.
2715 2767
2716If the line-spacing value is a cons (total . SPACING) where SPACING is
2717any of the forms described above, the value of SPACING is used as the
2718total height of the line, i.e. a varying number of pixels are inserted
2719after each line to make each line exactly that many pixels high.
2720
2721** The buffer local line-spacing variable may now have a float value, 2768** The buffer local line-spacing variable may now have a float value,
2722which is used as a height relative to the default frame line height. 2769which is used as a height relative to the default frame line height.
2723 2770
@@ -3925,11 +3972,6 @@ Reference manual for more detailed documentation.
3925used to add text properties to mode-line elements. 3972used to add text properties to mode-line elements.
3926 3973
3927+++ 3974+++
3928** Mode line display ignores text properties as well as the
3929:propertize and :eval forms in the value of a variable whose
3930`risky-local-variable' property is nil.
3931
3932+++
3933** The new `%i' and `%I' constructs for `mode-line-format' can be used 3975** The new `%i' and `%I' constructs for `mode-line-format' can be used
3934to display the size of the accessible part of the buffer on the mode 3976to display the size of the accessible part of the buffer on the mode
3935line. 3977line.
diff --git a/etc/TUTORIAL.nl b/etc/TUTORIAL.nl
index 989f8334fd1..d02ddce4eb2 100644
--- a/etc/TUTORIAL.nl
+++ b/etc/TUTORIAL.nl
@@ -1,35 +1,35 @@
1Copyright (c) 1985 Free Software Foundation, Inc; Zie de voorwaarden onderaan. 1Copyright (c) 1985, 2004, 2005 Free Software Foundation, Inc; Zie de voorwaarden onderaan.
2Je leest nu de Emacs uitleg, zoals vertaald door Pieter Schoenmakers. 2Je leest nu de Emacs-inleiding, zoals vertaald door Pieter Schoenmakers.
3 3
4De meeste Emacs commando's gebruiken de CONTROL toets (soms CTRL of CTL 4De meeste Emacs-commando's gebruiken de CONTROL-toets (soms CTRL of CTL
5genaamd) en/of de META toets (soms genaamd EDIT of ALT). In plaats van 5genaamd) en/of de META-toets (soms genaamd EDIT of ALT). In plaats van
6steeds de volledige naam te noemen, gebruiken we de volgende afkortingen: 6steeds de volledige naam te noemen, gebruiken we de volgende afkortingen:
7 7
8 C-<chr> betekent: houd de CONTROL toets ingedrukt en type de toets <chr> 8 C-<ltr> betekent: houd de CONTROL-toets ingedrukt en tik de toets <ltr>
9 Dus C-f wordt: houd de CONTROL toets ingedrukt en type f. 9 Dus C-f wordt: houd de CONTROL-toets ingedrukt en tik f.
10 M-<chr> betekent: houd de META, EDIT of ALT toets ingedrukt en type de 10 M-<ltr> betekent: houd de META-, EDIT- of ALT-toets ingedrukt en tik de
11 toets <chr>. Als er geen toets META, EDIT of ALT is, kun je ook 11 toets <chr>. Als er geen toets META, EDIT of ALT is, kun je ook
12 eerst de ESC toets typen, gevolgd door <chr>. We refereren aan 12 eerst de ESC-toets tikken, gevolgd door <ltr>. We verwijzen naar
13 de ESC toets als <ESC>. 13 de ESC toets als <ESC>.
14 14
15BELANGRIJK: om Emacs te verlaten, type C-x C-c (twee tekens). 15BELANGRIJK: om Emacs te verlaten, tik C-x C-c (twee tekens).
16De tekens ">>" tegen de linker kantlijn nodigen je uit om een 16De tekens ">>" tegen de linkerkantlijn nodigen je uit om een
17bepaald commando te proberen. Bijvoorbeeld: 17bepaald commando te proberen. Bijvoorbeeld:
18<<Blank lines inserted here by startup of help-with-tutorial>> 18<<Blank lines inserted here by startup of help-with-tutorial>>
19>> Type nu C-v (volgend scherm) om naar het volgende scherm te gaan. 19>> Tik nu C-v (volgend scherm) om naar het volgende scherm te gaan.
20 (Geef nu het commando door de control toets ingedrukt te houden 20 (Geef nu het commando door de CONTROL-toets ingedrukt te houden
21 terwijl je de v typt.) 21 terwijl je de v tikt.)
22 Vanaf nu moet je dit steeds herhalen als je klaar bent met het 22 Vanaf nu moet je dit steeds herhalen als je klaar bent met het
23 lezen van een scherm. 23 lezen van een scherm.
24 24
25Merk op dat er een tweeregelige overlap is als je van een scherm naar 25Merk op dat er een overlapping van twee regels is als je van een scherm naar
26het volgende scherm gaat; dit zorgt voor continuïteit bij het lezen van 26het volgende gaat; dat zorgt voor continuïteit bij het lezen van
27de tekst. 27de tekst.
28 28
29Het eerste wat je moet weten is hoe je naar verschillende plaatsen in de 29Het eerste wat je moet weten, is hoe je je naar verschillende plaatsen in de
30tekst kunt bewegen. Je weet al hoe je een scherm vooruit moet gaan: met 30tekst kan bewegen. Je weet al hoe je een scherm vooruit moet gaan: met
31C-v. Om een scherm terug te gaan, type M-v (houd de META toets ingedrukt 31C-v. Om een scherm terug te gaan, tik je M-v (houd de META-toets ingedrukt
32en type v, of type <ESC>v als je geen META, EDIT of ALT toets hebt). 32en tik v, of tik <ESC>-v als je geen META, EDIT of ALT toets hebt).
33 33
34>> Probeer nu een paar keer M-v, steeds gevolgd door C-v. 34>> Probeer nu een paar keer M-v, steeds gevolgd door C-v.
35 35
@@ -43,22 +43,24 @@ De volgende commando's zijn handig om volledige schermen te bekijken:
43 M-v ga een scherm terug 43 M-v ga een scherm terug
44 C-l maak het scherm schoon en teken alle tekst 44 C-l maak het scherm schoon en teken alle tekst
45 opnieuw, waarbij de regel waarop de cursor 45 opnieuw, waarbij de regel waarop de cursor
46 staat op het midden van het scherm terecht 46 staat, op het midden van het scherm terecht
47 komt. (C-l is control-L, niet control-1.) 47 komt. (C-l is CONTROL-L, niet CONTROL-1.)
48 48
49>> Kijk waar de cursor is en onthoud de tekst in zijn omgeving. 49>> Kijk waar de cursor staat, en onthoud de tekst errond.
50 Type C-l. 50 Tik C-l.
51 Zoek de cursor en merk op dat 'ie nog steeds bij dezelfde tekst staat. 51 Zoek de cursor en merk op dat hij nog steeds bij dezelfde tekst staat.
52 52
53 53
54* BASISCOMMANDO'S CURSORBEWEGINGEN 54* BASISCOMMANDO'S CURSORBEWEGINGEN
55---------------------------------- 55----------------------------------
56 56
57Het is handig om per scherm te bewegen, maar hoe beweeg je nu 57Het is handig om je per scherm te bewegen, maar hoe beweeg je je nu
58naar een specifieke plaats op het scherm? 58naar een specifieke plaats op het scherm?
59 59
60Er is een aantal manieren waarop je dit kunt doen. De basismanier is 60Er is een aantal manieren waarop je dit kan doen. Je kan de
61m.b.v de commando's C-p, C-b, C-f en C-n. Elk van deze commando's 61pijltjestoetsen gebruiken, maar het is efficïenter om je handen in de
62standaardhouding te laten, en de commando's C-p, C-b, C-f en C-n te
63gebruiken. Elk van deze commando's
62verplaatst de cursor precies een regel of teken in een bepaalde richting 64verplaatst de cursor precies een regel of teken in een bepaalde richting
63op het scherm. Hier volgt een figuur met de vier commando's en de 65op het scherm. Hier volgt een figuur met de vier commando's en de
64richting waarin ze de cursor bewegen: 66richting waarin ze de cursor bewegen:
@@ -71,85 +73,86 @@ richting waarin ze de cursor bewegen:
71 : 73 :
72 volgende regel, C-n 74 volgende regel, C-n
73 75
74>> Verplaats, m.b.v. C-n of C-p, de cursor naar de middelste regel van 76>> Verplaats, met C-n of C-p, de cursor naar de middelste regel van
75 de figuur. Type dan C-l om de hele figuur in het midden van het 77 de figuur. Tik dan C-l om de hele figuur in het midden van het
76 centrum te plaatsen. 78 centrum te plaatsen.
77 79
78Met een beetje kennis van het Engels zijn deze commando's gemakkelijk te 80Met een beetje kennis van het Engels zijn deze commando's gemakkelijk te
79onthouden: de P komt van previous (vorige), de N van next (volgende), de 81onthouden: de p komt van "previous" (vorige), de n van "next" (volgende), de
80B van backward (achteruit) en de F van forward (vooruit). Dit zijn de 82b van "backward" (achteruit) en de f van "forward" (vooruit). Dit zijn de
81basiscommando's om de cursor te bewegen, dus je zult ze CONTINUE 83basiscommando's om de cursor te bewegen, dus je zult ze VOORTDUREND
82gebruiken: Het is slim als je ze nu leert te gebruiken. 84gebruiken: het is vooruitziend als je ze nu leert te gebruiken.
83 85
84>> Type een paar keer C-n om de cursor op deze regel te krijgen. 86>> Tik een paar keer C-n om de cursor op deze regel te krijgen.
85 87
86>> Beweeg binnen de regel met C-f (herhaaldelijk) en terug omhoog met C-p 88>> Beweeg je binnen de regel met C-f (herhaaldelijk) en terug omhoog met C-p.
87 Let op wat C-p doet als de cursor midden in een regel staat. 89 Let op wat C-p doet als de cursor midden in een regel staat.
88 90
89Elke regel eindigt met een Newline teken (het Engelse `new line' betekent 91Elke regel eindigt met een Newline-teken (het Engelse "new line" betekent
90`nieuwe regel'); dit teken scheidt elke regel van de volgende. De laatste 92"nieuwe regel"); dit teken scheidt elke regel van de volgende. De laatste
91regel in een bestand moet eigenlijk ook met een Newline eindigen (maar dat 93regel in een bestand zou eigenlijk ook met een Newline moeten eindigen (maar dat
92is niet noodzakelijk voor Emacs ). 94is niet noodzakelijk voor Emacs).
93 95
94>> Type het commando C-b terwijl de cursor aan het begin van een regel 96>> Probeer C-b aan het begin van een regel.
95 staat. De cursor zal naar het eind van de vorige regel bewegen, 97 De cursor zal zich naar het eind van de vorige regel bewegen,
96 omdat je achteruit over het Newline teken gaat. 98 omdat je achteruit over het Newline teken gaat.
97 99
98Net als C-b kan ook C-f over Newline tekens heen bewegen. 100Net als C-b kan ook C-f zich over Newline-tekens heen bewegen.
99 101
100>> Type nog een aantal keren het commando C-b, zodat je door krijgt waar de 102>> Tik nog een aantal keren het commando C-b, zodat je een gevoel krijgt waar de
101 cursor is. 103 cursor is.
102 Type dan enkele keren C-f om de cursor terug naar het einde van de regel 104 Tik dan enkele keren C-f om de cursor terug naar het einde van de regel
103 te bewegen. 105 te bewegen.
104 Een C-f commnado beweegt de cursor dan naar de volgende regel. 106 Een verder C-f commando beweegt de cursor dan naar de volgende regel.
105 107
106Wanneer je de cursor voorbij het begin of het einde van het scherm beweegt 108Wanneer je de cursor voorbij het begin of het einde van het scherm beweegt,
107zal de tekst over het scherm heen schuiven. Dit heet `scrollen', of 109zal de tekst over het scherm heen schuiven. Dit heet "scrollen", of
108`schuiven' in goed Nederlands. Door te scrollen zorgt Emacs ervoor dat de 110"schuiven" in goed Nederlands. Door te scrollen zorgt Emacs ervoor dat de
109cursor de gewenste beweging kan doen zonder dat de cursor van het scherm 111cursor de gewenste beweging kan maken zonder dat de cursor van het scherm
110af beweegt. 112af beweegt.
111 113
112>> Probeer de cursor voorbij de onderkant van het scherm te bewegen met 114>> Probeer de cursor voorbij de onderkant van het scherm te bewegen met
113 C-n en zie wat er gebeurt. 115 C-n en zie wat er gebeurt.
114 116
115Als beweging op letterteken te langzaam gaat, kun je de cursor ook per 117Als de beweging per teken te langzaam gaat, kan je de cursor ook per
116woord bewegen. M-f (Meta-f) beweegt de cursor een woord vooruit en M-b 118woord bewegen. M-f (META-f) beweegt de cursor een woord vooruit en M-b
117een woord achteruit. 119een woord achteruit.
118 120
119>> Type enkele keren M-f en M-b. 121>> Tik enkele keren M-f en M-b.
120 122
121Als je midden in een woord staat beweegt M-f de cursor naar het eind van 123Als je midden in een woord staat, beweegt M-f de cursor naar het eind van
122het woord. Als je op een witte ruimte tussen woorden staat beweegt M-f de 124het woord. Als je op een witte ruimte tussen twee woorden staat, beweegt M-f de
123cursor naar het eind van het volgende woord. Het commando M-b beweegt 125cursor naar het eind van het volgende woord. Het commando M-b beweegt
124analoog, de andere kant op. 126de cursor analoog de andere kant op.
125 127
126>> Type enkele keren M-f en M-b en daar tussendoor enkele keren C-f en C-b, 128>> Tik enkele keren M-f en M-b en daar tussendoor een paar maal C-f en C-b,
127 zodat je ziet wat M-f en M-b doen vanaf bepaalde plaatsen in een 129 zodat je ziet wat M-f en M-b doen vanaf bepaalde plaatsen in een
128 woord en tussen twee woorden. 130 woord en tussen twee woorden.
129 131
130Merk op dat er een analogie zit tussen enerzijds C-f en C-b en 132Merk op dat er een analogie bestaat tussen enerzijds C-f en C-b en
131anderzijds M-f en M-b. Het is bij veel commando's zo dat Meta tekens 133anderzijds M-f en M-b. Het is bij veel commando's zo dat META-tekens
132gebruikt worden om iets te doen in eenheden van de taal (woorden, 134gebruikt worden om iets te doen in eenheden van de taal (woorden,
133zinnen, alinea's) terwijl Control tekens te maken hebben met dingen die 135zinnen, alinea's) terwijl Control-tekens te maken hebben met dingen die
134los staan van wat je aan het editten bent (tekens, regels, etc). 136los staan van wat je aan het editeren bent (tekens, regels, enz.).
135 137
136Deze analogie gaat ook op voor regels en zinnen: C-a en C-e bewegen de 138Deze analogie gaat ook op voor regels en zinnen: C-a en C-e bewegen de
137cursor naar het begin of eind van een regel, terwijl met M-a, 139cursor naar het begin of eind van een regel, terwijl met M-a,
138respectievelijk M-e, de cursor naar het begin of eind van een zin gaat. 140respectievelijk M-e, de cursor naar het begin, respectievelijk het eind,
141van een zin gaat.
139 142
140>> Type enkele keren C-a en dan enkele keren C-e. 143>> Tik enkele keren C-a, en dan een enkele keren C-e.
141 Type enkele keren M-a en dan enkele keren M-e. 144 Tik een paar maal M-a, en dan enkele keren M-e.
142 145
143Zie hoe herhaalde C-a commando's niets doen, terwijl herhaalde M-a 146Bemerk hoe herhaalde C-a commando's niets doen, terwijl herhaalde M-a
144commando's steeds een zin terug bewegen. Alhoewel ze niet volledig 147commando's de cursor steeds een zin achteruit bewegen. Alhoewel ze niet volledig
145overeenkomen is het gedrag van allebei niet onnatuurlijk. 148overeenkomen, is het gedrag van beide heel natuurlijk.
146 149
147De plaats van de cursor in de tekst wordt `punt' genoemd (zonder 150De plaats van de cursor in de tekst wordt "punt" genoemd (zonder
148lidwoord, `point' in het Engels). Anders gezegd: de cursor laat op het 151lidwoord, "point" in het Engels). Anders gezegd: de cursor laat op het
149scherm de plek zien waarop punt in de tekst staat. 152scherm de plek zien waar punt in de tekst staat.
150 153
151Nu volgt een samenvatting van eenvoudige cursorbewegingsoperaties, 154Nu volgt een samenvatting van eenvoudige cursorbewegingen,
152inclusief die commando's die per woord of zin bewegen: 155met inbegrip van de commando's die de cursor per woord of zin bewegen:
153 156
154 C-f ga een teken vooruit 157 C-f ga een teken vooruit
155 C-b ga een teken achteruit 158 C-b ga een teken achteruit
@@ -167,439 +170,444 @@ inclusief die commando's die per woord of zin bewegen:
167 M-e ga vooruit naar het eind van de zin 170 M-e ga vooruit naar het eind van de zin
168 171
169>> Probeer al deze commando's een paar keer als oefening. 172>> Probeer al deze commando's een paar keer als oefening.
170 Deze commando's worden het frequentst gebruikt. 173 Deze commando's worden het vaakst gebruikt.
171 174
172Er zijn nog twee belangrijk cursorbewegingsoperaties: M-< 175Er zijn nog twee belangrijke cursorbewegingen: M-<
173(Meta kleiner-dan) beweegt de cursor naar het begin van het bestand, 176(META kleiner-dan) beweegt de cursor naar het begin van het bestand,
174en M-> (Meta groter-dan) beweegt de cursor naar het eind. 177en M-> (META groter-dan) beweegt hem naar het eind.
175 178
176Op de meeste toetsenborden zit de '<' boven de komma, zodat je de Shift 179Op de meeste toetsenborden zit de '<' boven de komma, zodat je de
177toets (ook wel bekend als de hoofdlettertoets) moet gebruiken om het '<' 180Shift-toets (ook wel bekend als de hoofdlettertoets) moet gebruiken om het
178teken in te typen. Op deze toetsenborden moet je ook de shift gebruiken 181'<'-teken in te tikken. Op deze toetsenborden moet je ook de shift
179om M-< in te typen: zonder shift zou je M-, (Meta komma) typen. 182gebruiken om M-< in te tikken: zonder shift zou je M-, (META komma) tikken.
180 183
181>> Type nu M-< om naar het begin van dit bestand te gaan. 184>> Tik nu M-< om naar het begin van dit bestand te gaan.
182 Gebruik daarna C-v om hier weer terug te komen. 185 Gebruik daarna C-v om hier weer terug te komen.
183 186
184>> Type nu M-> om naar het eind van het bestand te springen. 187>> Tik nu M-> om naar het eind van het bestand te springen.
185 Gebruik daarna M-v om hier weer terug te komen. 188 Gebruik daarna M-v om hier weer terug te komen.
186 189
187Als je toetsenbord pijltjestoetsen heeft kun je ook die gebruiken om de 190Als je toetsenbord pijltjestoetsen heeft, kan je die ook gebruiken om de
188cursor te verplaatsen. We raden je aan om C-b, C-f, C-n en C-p op zijn 191cursor te verplaatsen. We raden je aan om C-b, C-f, C-n en C-p
189minst te leren, om drie redenen. Ten eerste werken ze op alle 192te leren, om drie redenen. Ten eerste werken ze op alle
190toetsenborden, ook die zonder pijltjestoetsen. Ten tweede zul je merken 193toetsenborden, ook die zonder pijltjestoetsen. Ten tweede zul je merken
191dat, wanneer je eenmaal wat ervaring hebt opgedaan in het omgaan met 194dat wanneer je eenmaal wat ervaring hebt opgedaan in de omgang met
192Emacs, het gebruik van deze CTRL tekens sneller gaat dan het werken met 195Emacs, het gebruik van de CTRL-tekens sneller is dan werken met de
193pijltjestoetsen (omdat je handen in de typehouding kunnen blijven). Ten 196pijltjestoetsen (omdat je handen in de normale tikpositie kunnen blijven). Ten
194derde, als je eenmaal gewend bent aan deze commando's met CTRL tekens, 197derde, als je eenmaal gewend bent aan deze commando's met CTRL-tekens,
195kun je makkelijk andere geavanceerde cursorbewegingscommando's leren. 198kan je makkelijk andere gevorderde cursorbewegingscommando's leren.
196 199
197De meeste Emacs commando's accepteren een numeriek argument. Voor de 200De meeste Emacs-commando's accepteren een numeriek argument. Voor de
198meeste commando's is dit argument het aantal keren dat het commando 201meeste commando's is dit argument het aantal keren dat het commando
199herhaald moet worden. Je geeft dit numerieke argument aan, dat vooraf 202herhaald moet worden. Je geeft dit numerieke argument aan met C-u en
200gegaan wordt door het commando C-u, de cijfers van het getal te typen. 203vervolgens de cijfers van het getal, vóór het commando.
201Als je toetsenbord een META (of EDIT of ALT) toets heeft, is er ook 204Als je toetsenbord een META- (of EDIT- of ALT-) toets hebt, is er ook
202een andere manier om het getal aan te geven: type de cijfers terwijl 205een andere manier om het getal aan te geven: tik de cijfers terwijl
203je de META toets ingedrukt houdt. We raden je aan de C-u manier te 206je de META toets ingedrukt houdt. We raden je aan de C-u manier te
204leren omdat die werkt op elk willekeurig toetsenbord. 207leren omdat die beschikbaar is op elke terminal.
205 208
206Bijvoorbeeld, C-u 8 C-f beweegt de cursor 8 plaatsen naar voren. 209Bijvoorbeeld, C-u 8 C-f beweegt de cursor 8 plaatsen naar voren.
207 210
208>> Probeer eens om met C-n of C-p en één numeriek argument de cursor 211>> Probeer eens om met C-n of C-p en een numeriek argument de cursor
209 met slechts een commando naar een regel in de buurt van deze zin te 212 met slechts een commando naar een regel in de buurt van deze zin te
210 bewegen. 213 bewegen.
211 214
212Voor de meeste commando's is het numerieke argument het aantal keren dat 215Voor de meeste commando's is het numerieke argument het aantal keren dat
213het commando herhaald moet worden. Voor sommige commando's betekent het 216het commando herhaald moet worden. Voor sommige commando's betekent het
214echter iets anders, en C-v en M-v vallen hier ook onder. Met een numeriek 217echter iets anders. Verschillende commando's (die je totnogtoe niet
218geleerd hebt) gebruiken het als een vlag -- de aanwezigheid van een
219prefix-argument, ongeacht zijn waarde, maakt dat het commando iets anders
220doet.
221
222C-v en M-v vormen een andere uitzondering. Met een numeriek
215argument verschuiven deze commando's de tekst het aangegeven aantal regels 223argument verschuiven deze commando's de tekst het aangegeven aantal regels
216in plaats van (bijna) een heel scherm. Bijvoorbeeld, C-u 4 C-v verschuift 224in plaats van (bijna) een heel scherm. Bijvoorbeeld, C-u 4 C-v verschuift
217de tekst 4 regels. 225de tekst 4 regels.
218 226
219>> Probeer nu C-u 8 C-v. 227>> Probeer nu C-u 8 C-v.
220 228
221Als het goed is is de tekst daarmee 8 regels opgeschoven. Als je weer 229Daarmee zou je tekst 8 regels opgeschoven moeten zijn. Als je terug
222terug omlaag wil scrollen kun je een argument aan M-v geven. 230omlaag wil scrollen, kan je M-v een argument geven.
223 231
224Als je een windowing systeem gebruikt, zoals X Windows, dan zou je een 232Als je een scherm met vensters gebruikt, zoals X Windows of MS-Windows,
225lange rechthoek moeten zien aan de linkerkant van het Emacs window. Deze 233zou je een grote rechthoek moeten zien aan de linkerkant van het
226rechthoek heet een scrollbar (misschien is `verschuifbalk' een goede 234Emacs-venster. Deze rechthoek heet een schuifbalk ("scrollbar"). Je kan
227vertaling). Je kunt de tekst scrollen door met de muis in de scrollbar te 235de tekst scrollen door met de muis in de schuifbalk te klikken.
228klikken.
229 236
230>> Klik met de middelste muisknop bovenaan het donkere gebied in de 237>> Klik met de middelste muisknop bovenaan het heldere gebied in de
231 scrollbar. Dit zou de tekst moeten scrollen naar een positie die 238 schuifbalk. Dit zou de tekst moeten verschuiven naar een positie die
232 afhankelijk is van hoe hoog of laag je klikt. 239 afhankelijk is van hoe hoog of laag je klikt.
233 240
234>> Beweeg de muis heen en weer terwijl je de middelste muisknop ingedrukt 241>> Beweeg de muis op en neer terwijl je de middelste muisknop ingedrukt
235 houdt. Je zult zien dat de tekst met de muis mee heen en weer scrollt. 242 houdt. Je zal zien dat de tekst met de muis mee heen en weer scrollt.
236 243
237 244
238* ALS EMACS HANGT 245* ALS EMACS HANGT
239----------------- 246-----------------
240 247
241Als Emacs niet meer op commando's reageert kun je haar veilig onderbreken 248Als Emacs niet meer op commando's reageert, kan je het veilig onderbreken
242door C-g te typen. Je kunt C-g gebruiken om een commando te stoppen als 249door C-g te tikken. Je kan C-g gebruiken om een commando te stoppen als
243het te lang duurt om het uit te voeren. 250het te lang duurt om uit te voeren.
244 251
245Je kunt C-g ook gebruiken om een numeriek argument weg te gooien of 252Je kan C-g ook gebruiken om een numeriek argument te verwijderen of om het
246om het begin van een commando dat je niet wilt afmaken te vergeten. 253begin van een commando dat je niet wilt afmaken, te verwijderen.
247 254
248>> Type nu C-u 100 om een numeriek argument te maken met de waarde 100, en 255>> Tik nu C-u 100 om een numeriek argument te maken met de waarde 100, en
249 type dan C-g. Type vervolgens C-f. Als het goed is is de cursor maar 256 tik dan C-g. Tik vervolgens C-f. Het zou de cursor maar
250 één positie verplaatst, omdat je het argument weggegooid hebt met C-g. 257 één positie mogen verplaatsen, omdat je het argument verwijderd hebt met C-g.
251 258
252Als je per ongeluk een <ESC> typt kun je dat ongedaan maken met het 259Als je per ongeluk een <ESC> tikt, kan je dat ongedaan maken met het
253commando C-g. 260commando C-g.
254 261
255 262
256* ONMOGELIJKE COMMANDO'S 263* ONMOGELIJKE COMMANDO'S
257------------------------ 264------------------------
258 265
259Sommige Emacs commando's zijn onmogelijk gemaakt zodat beginnende 266Sommige Emacs-commando's zijn uitgeschakeld zodat beginnende gebruikers ze
260gebruikers ze niet per ongeluk kunnen uitvoeren. 267niet per ongeluk kunnen uitvoeren.
261 268
262Als je één van de onmogelijke commando's intypt laat Emacs uitleg zien 269Als je een van de uitgeschakelde commando's intikt, laat Emacs uitleg zien
263over het commando dat je gegeven hebt en vraagt of je het werkelijk uit 270over het commando dat je gegeven hebt, en vraagt of je het werkelijk wil
264wilt voeren. 271uitvoeren.
265 272
266Wanneer je het commando echt wilt uitvoeren, type dan Spatie (de 273Wanneer je het commando echt wil uitvoeren, tik dan Spatie (de
267spatiebalk) als antwoord op de vraag. Normaliter wil je het commando niet 274spatiebalk) als antwoord op de vraag. Normaal wil je het commando niet
268uitvoeren en beantwoord je de vraag met "n" (van `no' of `nee'). 275uitvoeren en beantwoord je de vraag met "n" (van "no" of "nee").
269 276
270>> Type C-x C-l (een onmogelijk commando), 277>> Tik C-x C-l (een uitgeschakeld commando),
271 en type dan n als antwoord op de vraag. 278 en tik dan n als antwoord op de vraag.
272 279
273 280
274* VENSTERS 281* VENSTERS
275---------- 282----------
276 283
277Emacs kan meerdere vensters laten zien, elk venster met zijn eigen tekst. 284Emacs kan meerdere vensters laten zien, elk venster met zijn eigen tekst.
278We zullen later uitleggen hoe je met meerdere vensters om kunt gaan. Op 285We zullen later uitleggen hoe je met meerdere vensters om kan gaan. Op
279dit moment willen we slechts uitleggen hoe je van extra vensters af kunt 286dit moment willen we slechts uitleggen hoe je van extra vensters af kunt
280komen en terug kunt keren naar simpelweg editten met 1 venster. Het is 287komen en terug kan keren naar eenvoudig editeren met één venster. Het is
281eenvoudig: 288eenvoudig:
282 289
283 C-x 1 een enkel venster (i.e. gooi alle andere vensters weg) 290 C-x 1 een enkel venster (dat wil zeggen: verwijder alle andere vensters)
284 291
285Het commando is Control-x gevolgd door het cijfer 1. C-x 1 vergroot het 292Het commando is CONTROL-x gevolgd door het cijfer 1. C-x 1 vergroot het
286venster waar de cursor in staat tot het hele scherm. Alle andere vensters 293venster waar de cursor in staat tot het hele scherm. Alle andere vensters
287worden weggegooid. 294worden verwijderd.
288 295
289>> Zet de cursor op deze regel en type C-u 0 C-l. 296>> Zet de cursor op deze regel en tik C-u 0 C-l.
290>> Type nu Control-h k Control-f. 297>> Tik nu Control-h k Control-f.
291 Zie hoe dit venster kleiner wordt, terwijl een nieuw venster verschijnt 298 Zie hoe dit venster kleiner is geworden, terwijl een nieuw venster verschijnt
292 om de documentatie van het Control-f commando te laten zien. 299 om de documentatie van het Control-f commando te laten zien.
293 300
294>> Type nu C-x 1 en zie het documentatievenster verdwijnen. 301>> Tik nu C-x 1 en zie het documentatievenster verdwijnen.
295 302
296 303
297* TOEVOEGEN EN WEGHALEN 304* TOEVOEGEN EN WEGHALEN
298----------------------- 305-----------------------
299 306
300Als je tekst toe wilt voegen type je die eenvoudigweg in. Tekens die je 307Als je tekst toe wil voegen, tik je die eenvoudigweg in. Tekens die je
301kunt zien, zoals A, 7, *, en dergelijke, worden door Emacs als tekst 308kan zien, zoals A, 7, * en dergelijke, worden door Emacs als tekst
302geïnterpreteerd en meteen aan de tekst. Type <Return> (de `volgende regel' 309geïnterpreteerd en meteen aan de tekst toegevoegd. Tik <Return> (de
303toets) om een Newline toe te voegen en dus een nieuwe regel te beginnen. 310"volgende regel"-toets) om een Newline toe te voegen en dus een nieuwe
311regel te beginnen.
304 312
305Je kunt het laatste teken dat je intypte weghalen door <Delback> te typen. 313Je kan het laatste teken dat je hebt ingetikt weghalen door <Delback> te tikken.
306<Delback> is een toets op het toetsenbord--dezelfde toets die je normaal 314<Delback> is een toets op het toetsenbord -- dezelfde toets die je normaal
307gesproken gebruikt, buiten Emacs, om het laatst ingetypte teken te wissen. 315gesproken gebruikt, buiten Emacs, om het laatst ingetikte teken te wissen.
308Het is meestal een grote toets, een paar rijen boven de <Return> toets, 316Het is meestal een grote toets, een paar rijen boven de <Return>-toets,
309waar "Delete", "Del" of "Backspace" op staat. 317waar "Delete", "Del" of "Backspace" op staat.
310 318
311Als er op die grote toets "Backspace" staat, dan is dat degene die je 319Als er op die grote toets "Backspace" staat, dan is dat degene die je
312gebruikt voor <Delback>. Er kan op een andere plaats ook nog een andere 320gebruikt voor <Delback>. Er kan op een andere plaats ook nog een andere
313toets zijn waarop "Delete" staat, maar dat is niet <Delback>. 321toets zijn waarop "Delete" staat, maar dat is niet <Delback>.
314 322
315In het algemeen haalt <Delback> het teken dat juist voor de cursorpositie 323In het algemeen haalt <Delback> het teken weg dat juist voor de cursorpositie
316staat weg. 324staat.
317 325
318>> Probeer dit nu: type een paar letters en haal ze weer weg door een paar 326>> Probeer dit nu: tik een paar letters en haal ze weer weg door een paar
319 keer op <Delback> te drukken. Maak je niet druk over het feit dat dit 327 keer op <Delback> te drukken. Maak je niet druk over het feit dat dit
320 bestand verandert; je zult niets veranderen aan de originele versie van 328 bestand verandert; je zal niets veranderen aan de originele versie van
321 deze uitleg. Je zit slechts je eigen kopie te wijzigen. 329 deze inleiding. Je zit slechts je eigen kopie te wijzigen.
322 330
323Als een regel tekst te lang wordt om de regel op het scherm te laten 331Als een regel tekst te lang wordt om helemaal op het scherm getoond
324zien dan gaat de regel verder op een volgende schermregel. Een backslash 332te worden, dan gaat hij verder op de volgende schermregel. Een backslash
325("\") in de rechtermarge laat dan zien dat de regel op de volgende 333("\") in de rechtermarge (of, als je een scherm met vensters
326schermregel verder gaat. 334gebruikt, een kleine gebogen pijl) laat dan zien dat de regel op de
335volgende schermregel verder gaat.
327 336
328>> Voeg nu tekst toe totdat je de rechter kantlijn raakt, en blijf 337>> Voeg nu tekst toe totdat je de rechter kantlijn raakt, en blijf
329 toevoegen. Je zult zien dat er een vervolgregel verschijnt. 338 toevoegen. Je zal zien dat er een vervolgregel verschijnt.
330 339
331>> Type weer enkele keren <Delback> om zoveel tekens weg te halen tot 340>> Tik weer enkele keren <Delback> om zoveel tekens weg te halen tot
332 de regel weer op een schermregel past. De vervolgregel zal verdwijnen. 341 de regel weer op een schermregel past. De vervolgregel zal verdwijnen.
333 342
334Je kunt een Newline weggooien als elk ander teken. Als je een Newline 343Je kan een Newline zoals elk ander teken verwijderen. Als je een Newline
335weggooit voeg je de twee regels waar de Newline tussen staat samen tot een 344verwijdert, voeg je de twee regels waar de Newline tussen staat samen tot een
336enkele regel. Als de regel die het resultaat is van deze operatie niet op 345enkele regel. Als de regel die het resultaat is van deze operatie niet op
337een schermregel past zal hij getoond worden met een vervolgregel. 346een schermregel past, zal hij getoond worden met een vervolgregel.
338 347
339>> Beweeg de cursor naar het begin van een regel en type <Delback>. Dit 348>> Beweeg de cursor naar het begin van een regel en tik <Delback>. Dit
340 voegt de huidige en vorige regel samen. 349 voegt de huidige en vorige regel samen.
341 350
342>> Type <Return> om de Newline die je net weggooide weer toe te voegen. 351>> Tik <Return> om de Newline die je net verwijderd hebt weer toe te voegen.
343 352
344Je herinnert je dat je bij de meeste Emacs commando's het aantal keren dat 353Je herinnert je dat je bij de meeste Emacs-commando's het aantal keren op kan
345iets herhaald moet worden, op kunt geven. Dit geldt ook voor gewone tekens. 354geven, dat ze herhaald moeten worden. Dit geldt ook voor gewone tekens.
346Als je een gewoon teken herhaalt wordt dat teken herhaaldelijk toegevoegd. 355Als je een gewoon teken herhaalt, wordt dat teken herhaaldelijk toegevoegd.
347 356
348>> Probeer dat nu: type C-u 8 * om ******** toe te voegen. 357>> Probeer dat nu: tik C-u 8 * om ******** toe te voegen.
349 358
350Je hebt nu de basismanier geleerd om iets in Emacs te typen en fouten te 359Je hebt nu de eenvoudigste manier geleerd om iets in Emacs te tikken en fouten te
351corrigeren. Je kunt tekst ook per woord of regel weggooien. Hier volgt 360verbeteren. Je kan tekst ook per woord of regel verwijderen. Hier volgt
352een samenvatting van de commando's om tekst te verwijderen: 361een samenvatting van de commando's om tekst te verwijderen:
353 362
354 <Delback> haal het teken weg dat voor de cursor staat 363 <Delback> haal het teken weg dat voor de cursor staat
355 C-d haal het teken weg dat achter de cursor staat 364 C-d haal het teken weg dat achter de cursor staat
356 365
357 M-<Delback> gooi het woord weg dat voor de cursor staat 366 M-<Delback> verwijder het woord dat voor de cursor staat
358 M-d gooi het woord weg dat achter de cursor staat 367 M-d verwijder het woord dat achter de cursor staat
359 368
360 C-k gooi alles weg van de cursor tot het eind van de regel 369 C-k verwijder alles van de cursor tot het eind van de regel
361 M-k gooi alles weg van de cursor tot het eind van de zin 370 M-k verwijder alles van de cursor tot het eind van de zin
362 371
363Merk op dat <Delback> en C-d met M-<Delback> en M-d de analogie die begon 372Merk op dat <Delback> en C-d, met M-<Delback> en M-d de analogie verder
364met C-f en M-f verder trekken (waarbij we voor het gemak even vergeten dat 373trekken, die begon met C-f en M-f (waarbij we voor het gemak even vergeten dat
365<Delback> niet echt een control teken is). C-k en M-k lijken enigzins op 374<Delback> niet echt een control teken is). C-k en M-k lijken enigzins op
366C-e en M-e in hun relatie tot regels en zinnen. 375C-e en M-e in hun relatie tot regels en zinnen.
367 376
368Als je meer dan een enkel teken tegelijk weghaalt bewaart Emacs de tekst 377Als je meer dan een enkel teken tegelijk weghaalt, bewaart Emacs de tekst
369die je weggooit zodat je hem weer terug kunt halen. Weggegooide tekst 378die je verwijdert, zodat je hem weer terug kan halen. Verwijderde tekst
370terughalen heet "yanken". Je kunt weggegooide tekst terugbrengen op de 379terughalen heet "yanken". Je kan verwijderde tekst terugbrengen op de
371plaats waar je hem hebt weggegooid of op een andere plaats in de tekst. 380plaats waar je hem hebt verwijderd of op een andere plaats in de tekst.
372Je kunt ook meerdere keren yanken om er meedere kopieën van te maken. Het 381Je kan ook meerdere keren yanken om er meedere kopieën van te maken. Het
373yank-commando is C-y. 382yank-commando is C-y.
374 383
375Merk op dat er een verschil is tussen het weghalen en weggooien van iets: 384Merk op dat er een verschil is tussen iets weghalen en iets verwijderen:
376iets dat je hebt weggooid kun je terugbrengen, maar iets dat je hebt 385iets dat je hebt verwijderd, kan je terugbrengen, maar iets dat je hebt
377weggehaald niet. (In het Engels is het verschil tussen `killing' en 386weggehaald niet. (In het Engels is het verschil tussen "killing" en
378`deleting' duidelijker dan tussen de Nederlandse vertaling `weggooien' en 387"deleting" duidelijker dan tussen de Nederlandse vertalingen "verwijderen" en
379`weghalen'.) In het algemeen geldt dat de commando's die meer tekst dan 388"weghalen".) In het algemeen geldt dat de commando's die meer tekst dan
380een enkel teken, Newline of spatie verwijderen deze tekst bewaren zodat die 389een enkel teken, Newline of spatie verwijderen, deze tekst bewaren zodat hij
381geyankt kan worden, terwijl dat niet geldt voor commando's die slechts een 390geyankt kan worden, terwijl dat niet geldt voor commando's die slechts een
382enkel teken weghalen. 391enkel teken weghalen.
383 392
384>> Zet de cursor op het begin van een regel die niet leeg is. 393>> Zet de cursor op het begin van een regel die niet leeg is.
385 Type C-k om de tekst op die regel weg te gooien. 394 Tik C-k om de tekst op die regel te verwijderen.
386>> Type C-k een tweede keer. Nu gooit dit commando het Newline teken 395>> Tik C-k een tweede keer. Nu verwijdert dit commando het Newline-teken.
387 weg.
388 396
389Merk op hoe een enkel C-k commando de inhoud van een regel weggooit, een 397Merk op hoe een enkel C-k commando de inhoud van een regel verwijdert, een
390tweede C-k commando de regel zelf zodat alle volgende regels een regel 398tweede C-k commando de regel zelf zodat alle volgende regels een regel
391omhoog komen. Het numerieke argument is voor C-k bijzonder: het aangegeven 399omhoog komen. Het numerieke argument is voor C-k bijzonder: het aangegeven
392aantal regels zal worden weggegooid, inclusief de inhoud. Dit is meer dan 400aantal regels zal worden verwijderd, inclusief de inhoud. Dit is meer dan
393simpelweg herhaling: C-u 2 C-k gooit twee regels weg, terwijl tweemaal 401simpelweg herhaling: C-u 2 C-k verwijdert twee regels, terwijl tweemaal
394C-k typen dat niet doet. 402C-k tikken dat niet doet.
395 403
396Om de laatst weggegooide tekst terug te halen naar de plaats waar de 404Om de laatst verwijderde tekst terug te halen naar de plaats waar de
397cursor nu op staat (te yanken), type C-y. 405cursor nu op staat (te yanken), tik C-y.
398 406
399>> Probeer het nu: type C-y om de tekst te yanken. 407>> Probeer het nu: tik C-y om de tekst te yanken.
400 408
401Het is alsof je met C-y iets uit de prullenbak haalt wat je net had 409Het is alsof je met C-y iets uit de prullenbak haalt wat je net had
402weggegooid. Merk op dat verschillende C-k's achter elkaar alle regels 410verwijderd. Merk op dat verschillende C-k's achter elkaar alle regels
403die weggegooid worden bij elkaar bewaart zodat een enkele C-y die regels 411die verwijderd worden, bij elkaar bewaart zodat een enkele C-y die regels
404in een keer terugbrengt. 412in een keer terugbrengt.
405 413
406>> Probeer het nu: type C-k een paar keer. 414>> Probeer het nu: tik C-k een paar keer.
407 415
408Om de weggegooide tekst terug te halen: 416Om de verwijderde tekst terug te halen:
409 417
410>> Type C-y. Beweeg de cursor enkele regels naar beneden en type weer C-y. 418>> Tik C-y. Beweeg de cursor enkele regels naar beneden en tik weer C-y.
411 Je ziet nu hoe je tekst kunt kopiëren. 419 Je ziet nu hoe je tekst kan kopiëren.
412 420
413Wat nu te doen als je tekst terug wilt brengen, maar je hebt intussen al 421Wat moet je doen als je wat tekst terug wilt brengen, maar je intussen
414iets anders weggegooid? C-y zou datgene terugbrengen wat je het 422al iets anders verwijderd hebt? C-y zou datgene terugbrengen wat je het
415recentst hebt weggegooid. Gelukkig is de voorgaande tekst niet verloren 423recentst hebt verwijderd. Gelukkig is de voorgaande tekst niet verloren
416gegaan. Je kunt die tekst terughalen met M-y. Nadat je C-y hebt getypt 424gegaan. Je kunt die tekst terughalen met M-y. Nadat je C-y hebt getikt
417om de recentst weggegooide tekst terug te halen, vervangt M-y die tekst 425om de recentst weggegooide tekst terug te halen, vervangt M-y die tekst
418met de tekst die je daarvoor had weggegooid. Je kunt M-y herhalen om 426met de tekst die je daarvoor had weggegooid. Je kunt M-y herhalen om
419tekst terug te halen die je reeds langer geleden hebt weggegooid. Als 427tekst terug te halen die je al langer geleden hebt weggegooid. Als
420je de tekst te pakken hebt die je zocht hoef je niets te doen om die 428je de tekst te pakken hebt die je zocht, hoef je niets te doen om die
421daar te houden. Je kunt gewoon verder werken en de teruggehaalde tekst 429daar te houden. Je kan gewoon verder werken en de teruggehaalde tekst
422met rust laten. 430met rust laten.
423 431
424Als je M-y vaak genoeg typt kom je terug waar je begon, bij de recentst 432Als je M-y vaak genoeg tikt kom je terug waar je begon, bij de laatst
425weggegooide tekst. 433verwijderde tekst.
426 434
427>> Gooi een regel weg, beweeg de cursor wat, en gooi nog een regel weg. 435>> Verwijder een regel, beweeg de cursor wat, en verwijder nog een regel.
428 Type C-y om de tweede regel die je weggooide terug te halen. 436 Tik C-y om de tweede regel die je verwijderde, terug te halen.
429 Type nog een M-y en die regel wordt vervangen door de eerste regel 437 Tik nog een M-y en die regel wordt vervangen door de eerste regel
430 die je weggooide. 438 die je verwijderde.
431 Type nog enkele keren M-y en zie wat er langs komt. Herhaal dit tot de 439 Tik nog enkele keren M-y en zie wat er langs komt. Herhaal dit tot de
432 tweede regel weer langs komt, en dan nog een paar keer. 440 tweede regel weer langs komt, en dan nog een paar keer.
433 Je kunt ook experimenteren met positieve en negatieve argumenten aan 441 Je kan ook experimenteren met positieve en negatieve argumenten bij
434 M-y. 442 M-y.
435 443
436 444
437* HERSTELLEN 445* HERSTELLEN
438------------ 446------------
439 447
440Als je de tekst veranderd hebt en als je daar toch niet tevreden mee bent, 448Als je de tekst veranderd hebt en je daar toch niet tevreden mee bent,
441dan kun je de verandering ongedaan maken met het herstel commando, C-x u. 449dan kan je de verandering ongedaan maken met het herstelcommando, C-x u.
442 450
443Normaal gesproken herstelt C-x u de veranderingen die het gevolg zijn van 451Normaal gesproken herstelt C-x u de veranderingen die het gevolg zijn van
444een enkel commando; door herhaaldelijk C-x u te typen, worden steeds 452een enkel commando; door herhaaldelijk C-x u te tikken, worden steeds
445eerdere commando's hersteld. 453eerdere commando's hersteld.
446 454
447Er zijn echter twee uitzonderingen: commando's die de tekst niet wijzigen, 455Er zijn echter twee uitzonderingen: commando's die de tekst niet wijzigen,
448zoals cursorbewegingen, worden overgeslagen, en commando's die simpelweg 456zoals cursorbewegingen, worden overgeslagen, en commando's die simpelweg
449de ingetypte letter aan de tekst toevoegen worden meestal gegroepeerd 457het ingetikte teken aan de tekst toevoegen, worden meestal gegroepeerd
450in groepjes van maximaal 20 tekens, zodat je minder vaak het commando 458in groepjes van maximaal 20 tekens, zodat je minder vaak het commando
451C-x u hoeft te typen om het toevoegen van tekst te herstellen. 459C-x u hoeft te tikken om teksttoevoegingen te herstellen.
452 460
453>> Gooi deze regel weg met C-k; met C-x u zou hij weer moeten verschijnen. 461>> Gooi deze regel weg met C-k; met C-x u zou hij weer moeten verschijnen.
454 462
455C-_ is een alternatief voor C-x u. Het levert exact hetzelfde resultaat 463C-_ is een alternatief voor C-x u. Het levert exact hetzelfde resultaat
456op, maar het is makkelijker om dat een paar keer achter elkaar te typen. 464op, maar is makkelijker om een paar keer achter elkaar te tikken. Een
457Een nadeel van C-_ is dat op sommige toetsenborden het intypen ervan 465nadeel van C-_ is dat op sommige toetsenborden het intikken ervan niet
458niet triviaal is. Dat is ook de reden voor het alternatief, C-x u. Op 466gebruiksvriendelijk is. Dat is ook de reden voor het alternatief, C-x u.
459sommige terminals kun je C-_ typen door te doen alsof je C-/ typt. 467Op sommige terminals kan je C-_ tikken door "/" te tikken terwijl je de
468CONTROL-toets ingedrukt houdt.
460 469
461Een numeriek argument aan C-_ of C-x u duidt het aantal herhalingen aan. 470Een numeriek argument bij C-_ of C-x u duidt het aantal herhalingen aan.
462 471
463 472
464* BESTANDEN 473* BESTANDEN
465----------- 474-----------
466 475
467Om een tekst die je gemaakt of veranderd hebt op te slaan moet je de 476Om een tekst die je gemaakt of veranderd hebt op te slaan, moet je de tekst
468tekst in een bestand bewaren (`to save a file' in het Engels). Als je 477in een bestand stoppen ("to save a file" in het Engels). Als je dat niet
469dat niet doet ben je die veranderingen kwijt op het moment dat je uit 478doet, ben je die veranderingen kwijt op het moment dat je Emacs verlaat.
470Emacs gaat. Je kunt een bestand veranderen door het bestand te `bezoeken'. 479Je kan een bestand veranderen door het bestand te "bezoeken". (Ook wel
471(Ook wel `vinden'; `finding' of `visiting' in het Engels.) 480"vinden"; "finding" of "visiting" in het Engels.)
472 481
473Het bezoeken van een bestand betekent dat je de inhoud van dat bestand 482Een bestand bezoeken betekent dat je de inhoud van dat bestand in
474in Emacs ziet. Het lijkt er dan op alsof je het bestand aan het 483Emacs ziet. Het lijkt er dan op alsof je het bestand aan het veranderen
475veranderen bent. Echter, deze veranderingen zijn slechts tijdelijk 484bent. Deze veranderingen zijn echter slechts tijdelijk zolang je het
476zolang je het bestand niet bewaart. Op deze manier kun je nooit per 485bestand niet opslaat. Op deze manier kan je nooit per ongeluk een half
477ongeluk een half gewijzigd bestand op het systeem achterlaten. Zelfs 486gewijzigd bestand op het systeem achterlaten. Zelfs als je het bestand
478als je het bestand bewaart, zorgt Emacs ervoor dat het originele 487opslaat, zorgt Emacs ervoor dat het originele bestand onder een gewijzigde
479bestand onder een gewijzigde naam nog steeds beschikbaar is, voor het 488naam nog steeds beschikbaar is, voor het geval je later besluit dat de
480geval je later besluit dat de veranderingen toch niet zo'n goed plan 489veranderingen toch niet zo goed waren.
481waren. 490
482 491Bij de onderkant van het scherm zie je een regel die begint en
483In de buurt van de onderkant van het scherm zie je een regel die begint en
484eindigt met streepjes, met aan het begin "--:-- TUTORIAL.nl" of iets 492eindigt met streepjes, met aan het begin "--:-- TUTORIAL.nl" of iets
485dergelijks. Dit deel van het scherm laat normaal de naam van het bestand 493dergelijks. Dit deel van het scherm laat normaal de naam van het bestand
486zien dat je op dat moment bezoekt. Op dit moment bezoek je een bestand 494zien dat je op dat moment bezoekt. Op dit moment bezoek je een bestand
487dat "TUTORIAL.nl" heet; het is je eigen kopie van de Nederlandstalige 495dat "TUTORIAL.nl" heet; het is je eigen kopie van de Nederlandstalige
488Emacs uitleg (`tutorial' in het Engels). Als je in Emacs een bestand 496Emacs-inleiding ("tutorial" in het Engels). Als je in Emacs een bestand
489bezoekt dan staat de naam van het bestand altijd op deze plaats. 497bezoekt dan staat de naam van het bestand altijd op deze plaats.
490 498
491De commando's om een bestand te bezoeken of te bewaren zijn anders dan de 499De commando's om een bestand te bezoeken of op te slaan zijn anders dan de
492commando's die je tot nu toe geleerd hebt; ze bestaan namelijk uit twee 500commando's die je tot nu toe geleerd hebt; ze bestaan namelijk uit twee
493tekens. Beide commando's beginnen met het teken Control-x. Er zijn een 501tekens. Beide commando's beginnen met het teken Control-x. Er zijn een
494heleboel commando's die met Control-x beginnen. Veel van die commando's 502heleboel commando's die met Control-x beginnen. Veel van die commando's
495hebben te maken met bestanden, buffers, en daaraan gerelateerde zaken. 503hebben te maken met bestanden, buffers, en gelijkaardige dingen.
496Dergelijke commando's bestaan uit twee, drie of vier tekens. 504Dergelijke commando's bestaan uit twee, drie of vier tekens.
497 505
498Nog iets bijzonders aan het commando om een bestand te bezoeken is dat 506Nog iets bijzonders aan het commando om een bestand te bezoeken, is dat je
499je aan moet geven welk bestand je wilt. Dit heet dat het commando "een 507aan moet geven welk bestand je wil. Dit heet dat het commando "een
500argument van de gebruiker vraagt"; in dit geval de naam van het bestand. 508argument van de gebruiker vraagt"; in dit geval de naam van het bestand.
501Nadat je het commando 509Nadat je het commando
502 510
503 C-x C-f bezoek bestand (met de f van `find file') 511 C-x C-f bezoek bestand (met de f van "find file")
504 512
505hebt getypt vraagt Emacs om de naam van het bestand. De naam die je 513hebt getikt vraagt Emacs om de naam van het bestand. De naam die je
506intypt verschijnt op de onderste regel van het scherm. Wanneer die regel 514intikt verschijnt op de onderste regel van het scherm. Wanneer die regel
507voor dit soort invoer gebruikt wordt, heet ze de minibuffer. Je kunt de 515voor dit soort invoer gebruikt wordt, heet hij de minibuffer. Je kan gewone
508gebruikelijke Emacs commando's gebruiken om de filename in te typen. 516Emacs commando's gebruiken om de bestandsnaam te veranderen.
509 517
510Tijdens het invoeren van de naam van het bestand (of willekeurig wat 518Tijdens het invoeren van de bestandsnaam (of om het even welke
511voor minibuffer invoer) kun je het commando afbreken met C-g. 519invoer in de minibuffer) kan je het commando afbreken met C-g.
512 520
513>> Type C-x C-f gevolgd door C-g. Dit commando breekt de minibuffer af en 521>> Tik C-x C-f gevolgd door C-g. Dit commando breekt de minibuffer af en
514 ook het C-x C-f commando dat van de minibuffer gebruik maakte. 522 ook het C-x C-f commando dat van de minibuffer gebruik maakte.
515 Netto resultaat is dat je geen bestand bezoekt. 523 Het resultaat is dat je geen bestand bezoekt.
516 524
517Als je de naam van een bestand hebt ingevoerd, type dan <Return> om het 525Als je de naam van een bestand hebt ingevoerd, tik dan <Return> om het
518af te sluiten. Hierna gaat het C-x C-f commando aan het werk en haalt 526commando af te sluiten. Hierna gaat het C-x C-f commando aan het werk en haalt
519het bestand op dat je aangegeven hebt. Als het C-x C-f commando daarmee 527het bestand op dat je aangegeven hebt. Als het C-x C-f commando daarmee
520klaar is,verdwijnt de minibuffer. 528klaar is, verdwijnt de minibuffer.
521 529
522Na korte tijd verschijnt de inhoud van het bestand op het scherm en kun 530Na korte tijd verschijnt de inhoud van het bestand op het scherm en kan
523je de inhoud wijzigen. Als je de wijzigingen op wilt slaan, type dan het 531je de inhoud wijzigen. Als je de wijzigingen op wilt slaan, tik dan het
524commando 532commando
525 533
526 C-x C-s bewaar bestand (met de s van `save file') 534 C-x C-s sla bestand op (met de s van "save file")
527 535
528Dit commando bewaart de tekst zoals Emacs die nu heeft in het bestand. 536Dit commando slaat de tekst zoals Emacs die nu heeft in het bestand op.
529De eerstekeer dat je dit doet bewaart Emacs het originele bestand onder een 537De eerste keer dat je dit doet, slaat Emacs het originele bestand onder een
530andere naam zodat het nog niet verloren is. De nieuwe naam bestaat uit de 538andere naam op, zodat het niet verloren gaat. De nieuwe naam bestaat uit de
531oude naam gevolgd door een "~". 539oude bestandsnaam gevolgd door een "~".
532 540
533Als Emacs klaar is het bestand te bewaren laat ze de naam van het bestand 541Als Emacs het bestand heeft opgeslagen, laat het de naam van het
534zien. Het is een goede gewoonte een bestand redelijk vaak te bewaren 542bestand zien. Het is een goede gewoonte een bestand regelmatig te op te slaan
535zodat er niet teveel werk verloren gaat als het systeem hangt of crasht. 543zodat er niet teveel werk verloren gaat als het systeem hangt of crasht.
536 544
537>> Type C-x C-s, om je kopie van deze uitleg te bewaren. Als het goed is 545>> Tik C-x C-s, om je kopie van deze inleiding op te slaan. Als het goed is
538 verschijnt "Wrote ...TUTORIAL" op de onderste schermregel. 546 verschijnt "Wrote ...TUTORIAL" op de onderste schermregel.
539 547
540OPMERKING: Op sommige systemen gebeurt er helemaal niets als je C-x C-s 548OPMERKING: Op sommige systemen gebeurt er helemaal niets als je C-x C-s
541typt, en daarna ook niets meer. Dit komt door een eigenschap van de 549tikt, en daarna ook niets meer. Dit komt door een eigenschap van de
542machine waarop je werkt die te maken heeft met `flow control'. Met C-s 550machine waarop je werkt die te maken heeft met "flow control". Met C-s
543stopt de `flow' en komt niets meer van wat je typt bij Emacs terecht. Om 551stopt de "flow" en komt niets meer van wat je tikt bij Emacs terecht. Om
544deze situatie te herstellen, type C-q. Lees daarna de "Spontaneous Entry 552deze situatie te herstellen, tik C-q. Lees daarna het hoofdstuk
545to Incremental Search" sectie in het Emacs handboek over hoe om te gaan 553"Spontaneous Entry to Incremental Search" in het Emacs-handboek over hoe
546met deze situatie. 554je moet omgaan met deze situatie.
547 555
548Je kunt een bestaand bestand bezoeken, om het te bekijken of het te 556Je kan een bestaand bestand bezoeken om het te bekijken of het te
549wijzigen. Je kunt ook een bestand bezoeken dat nog niet bestaat. Dit is 557wijzigen. Je kan ook een bestand bezoeken dat nog niet bestaat. Dit is
550dé manier om met Emacs een nieuw bestand te maken: bezoek het bestand, dat 558de manier om met Emacs een nieuw bestand te maken: bezoek het bestand, dat
551initieel leeg zal zijn, en voeg tekst toe. Zodra je de tekst bewaart 559eerst leeg zal zijn, en voeg tekst toe. Zodra je de tekst opslaat, wordt
552wordt het bestand werkelijk gecreëerd, met de tekst als inhoud. Vanaf dat 560het bestand werkelijk gecreëerd, met de tekst als inhoud. Vanaf dat
553moment ben je dus bezig met een bestaand bestand. 561moment ben je dus bezig met een bestaand bestand.
554 562
555 563
556* BUFFERS 564* BUFFERS
557--------- 565---------
558 566
559Als je een tweede bestand bezoekt met C-x C-f blijft het eerste bestand 567Als je een tweede bestand bezoekt met C-x C-f, blijft het eerste bestand
560gewoon in Emacs. Je kunt naar dat bestand terug door het gewoon nog een 568gewoon in Emacs. Je kan naar dat bestand terug door het gewoon nog een
561keer te bezoeken met C-x C-f. Op deze manier kun je een behoorlijk aantal 569keer te bezoeken met C-x C-f. Op deze manier kan je een behoorlijk aantal
562bestanden in Emacs krijgen. 570bestanden in Emacs krijgen.
563 571
564>> Creëer een bestand dat "foo" heet door te typen: C-f C-f foo 572>> Creëer een bestand dat "foo" heet door te tikken: C-f C-f foo
565 <Return>. Voeg hieraan wat tekst toe en bewaar "foo" 573 <Return>. Voeg hieraan wat tekst toe, wijzig hem, en sla "foo" op
566 door C-x C-s te typen. Type hierna C-x C-f TUTORIAL <Return> om 574 door C-x C-s te tikken. Tik hierna C-x C-f TUTORIAL <Return> om
567 weer hier, in de uitleg, terug te komen. 575 weer hier, in de inleiding, terug te komen.
568 576
569Emacs bewaart intern de tekst van elk bestand in een ding dat een "buffer" 577Emacs bewaart intern de tekst van elk bestand in een ding dat een "buffer"
570genoemd wordt. Als je een bestand bezoekt wordt er een nieuwe buffer 578genoemd wordt. Als je een bestand bezoekt wordt er een nieuwe buffer
571gemaakt. Om een lijst van de huidige buffers te zien, type 579gemaakt. Om een lijst van de huidige buffers te zien, tik
572 580
573 C-x C-b laat de bufferlijst zien 581 C-x C-b laat de bufferlijst zien
574 582
575>> Probeer C-x C-b nu. 583>> Probeer C-x C-b nu.
576 584
577Zie dat elke buffer een naam heeft en mogelijk ook een bestandsnaam; dit 585Bemerk dat elke buffer een naam heeft en mogelijk ook een bestandsnaam; dit
578is de naam van het bestand waarmee de buffer overeenkomt. Sommige buffers 586is de naam van het bestand waarmee de buffer overeenkomt. Sommige buffers
579hebben niets met een bestand te maken. Bijvoorbeeld, de buffer die 587hebben niets met een bestand te maken. Bijvoorbeeld, de buffer die
580"*Buffer List*" heet heeft geen bestand. Die buffer is de buffer die de 588"*Buffer List*" heet heeft geen bestand. Die buffer is de buffer die de
581lijst bevat die door C-x C-b gemaakt wordt. ALLE tekst die je in een 589lijst bevat die door C-x C-b gemaakt wordt. ALLE tekst die je in een
582Emacs venster ziet is altijd onderdeel van een of andere buffer. 590Emacs venster ziet is altijd onderdeel van een of andere buffer.
583 591
584>> Type C-x 1 om de bufferlijst te verwijderen. 592>> Tik C-x 1 om de bufferlijst te verwijderen.
585 593
586Als je de tekst van het ene bestand verandert en dan een ander bestand 594Als je de tekst van het ene bestand verandert en dan een ander bestand
587bezoekt dan wordt het eerste bestand niet bewaard. De wijzigingen blijven 595bezoekt, wordt het eerste bestand niet opgeslagen. De wijzigingen blijven
588in Emacs, in de buffer die bij het bestand hoort. Het creëren of 596in Emacs, in de buffer die bij het bestand hoort. Het creëren of
589modificeren van de buffer van het tweede bestand heeft geen effect op de 597veranderen van de buffer van het tweede bestand heeft geen effect op de
590eerste buffer. Dit is erg nuttig, maar betekent ook dat er een eenvoudige 598eerste buffer. Dit is erg nuttig, maar betekent ook dat er een eenvoudige
591manier nodig is om het eerste bestand te bewaren. Het zou erg vervelend 599manier nodig is om het eerste bestand te bewaren. Het zou erg vervelend
592zijn om er eerst naar terug te moeten gaan met C-x C-f om het dan te 600zijn om er eerst naar terug te moeten gaan met C-x C-f om het dan te
593kunnen bewaren met C-x C-s. Dus hebben we het commando: 601kunnen bewaren met C-x C-s. Dus hebben we het commando:
594 602
595 C-x s bewaar een paar buffers 603 C-x s sla een paar buffers op
596 604
597C-x s vraagt voor elke buffer die veranderingen heeft die nog niet 605C-x s vraagt voor elke buffer die veranderingen heeft die nog niet
598opgeslagen zijn, of je de buffer wilt bewaren. 606opgeslagen zijn, of je de buffer wilt bewaren.
599 607
600>> Voeg wat tekst toe en type C-x s. 608>> Voeg wat tekst toe en tik C-x s.
601 Emacs vraagt nu of je de buffer die TUTORIAL.nl heet wilt bewaren. 609 Emacs vraagt nu of je de buffer die TUTORIAL.nl heet wilt bewaren.
602 Beantwoord deze vraag positief door een "y" in te typen (de y van 610 Beantwoord deze vraag positief door een "y" in te tikken (de y van
603 "yes", Engels voor "ja"). 611 "yes", Engels voor "ja").
604 612
605 613
@@ -609,28 +617,28 @@ opgeslagen zijn, of je de buffer wilt bewaren.
609Er zijn veel meer Emacs commando's dan er op de toetsen van het 617Er zijn veel meer Emacs commando's dan er op de toetsen van het
610toetsenbord passen, zelfs als we hun aantal kunnen vergroten door de 618toetsenbord passen, zelfs als we hun aantal kunnen vergroten door de
611control of meta toets te gebruiken. Emacs lost dit probleem op met het X 619control of meta toets te gebruiken. Emacs lost dit probleem op met het X
612commando (met de X van eXtensie of uitbreiding). Het X commando komt in 620commando (met de X van eXtensie of uitbreiding). Het X commando komt voor in
613twee smaken voor: 621twee smaken:
614 622
615 C-x teken eXtensie; wordt gevolgd door een teken 623 C-x Tekenuitbreiding. Bevolgd door een teken.
616 M-x genaamd commando eXtensie; wordt gevolgd door een naam. 624 M-x Commando-naam-uitbreiding. Wordt gevolgd door een naam.
617 625
618Deze commando's zijn in het algemeen nuttig, maar worden minder gebruikt 626Deze commando's zijn in het algemeen nuttig, maar worden minder gebruikt
619dan de commando's die tot nu toe uitgelegd zijn. Je hebt al twee van deze 627dan de commando's die je tot nu toe al geleerd hebt. Je hebt al twee van deze
620commando's gezien: C-x C-f om een bestand te bezoeken, en C-x C-s om het 628commando's gezien: C-x C-f om een bestand te bezoeken, en C-x C-s om het
621te bewaren. Een ander voorbeeld is het commando om Emacs te verlaten: dit 629te bewaren. Een ander voorbeeld is het commando om Emacs te verlaten: dit
622is C-x C-c. (Maak je geen zorgen over het verloren gaan van veranderingen 630is C-x C-c. (Maak je geen zorgen over het verloren gaan van veranderingen
623die niet bewaard zijn; C-x C-c vraagt of je veranderde buffers wilt 631die niet opgeslagen zijn; C-x C-c vraagt of je veranderde buffers wilt
624bewaren voordat Emacs daadwerkelijk eindigt.) 632bewaren voordat Emacs helemaal eindigt.)
625 633
626C-z is het commando om Emacs *tijdelijk* te verlaten, zodat je daarna weer 634C-z is het commando om Emacs *tijdelijk* te verlaten, zodat je daarna weer
627terug kunt keren in dezelfde Emacs sessie. 635terug kan keren in dezelfde Emacs-sessie.
628 636
629Op systemen die deze mogelijkheid bieden, zet C-z Emacs stil: je komt weer 637Op systemen die deze mogelijkheid bieden, zet C-z Emacs stil: je komt weer
630terug in de shell, maar Emacs is nog aanwezig. In de meeste shells kun je 638terug in de shell, maar Emacs is nog aanwezig. In de meeste shells kan je
631Emacs weer activeren met het "fg" commando, of met "%emacs". 639Emacs weer activeren met het "fg" commando, of met "%emacs".
632 640
633Op systemen die niet de mogelijkheid bieden om programma's stil te zetten 641Op systemen die niet de mogelijkheid bieden om programma's stil te zetten,
634creëert C-z een subshell onder Emacs om je zo in de gelegenheid te 642creëert C-z een subshell onder Emacs om je zo in de gelegenheid te
635stellen andere programma's uit te voeren en daarna weer in Emacs terug te 643stellen andere programma's uit te voeren en daarna weer in Emacs terug te
636keren; Emacs wordt dus niet werkelijk verlaten. In dit geval is het 644keren; Emacs wordt dus niet werkelijk verlaten. In dit geval is het
@@ -639,7 +647,7 @@ Emacs terug te keren.
639 647
640Het moment om C-x C-c te gebruiken is wanneer je uit gaat loggen. Het is 648Het moment om C-x C-c te gebruiken is wanneer je uit gaat loggen. Het is
641ook het juiste commando om Emacs te beëindigen wanneer Emacs opgestart 649ook het juiste commando om Emacs te beëindigen wanneer Emacs opgestart
642was door een mail programma of iets dergelijks, aangezien die misschien 650was door een mail-programma of iets dergelijks, aangezien die misschien
643niet met een stilgezette Emacs om kunnen gaan. Normaal gezien is het 651niet met een stilgezette Emacs om kunnen gaan. Normaal gezien is het
644echter beter Emacs stil te zetten met C-z dan om Emacs te verlaten, 652echter beter Emacs stil te zetten met C-z dan om Emacs te verlaten,
645behalve als je uit wilt loggen natuurlijk. 653behalve als je uit wilt loggen natuurlijk.
@@ -648,278 +656,278 @@ Er bestaan vele C-x commando's. Hier is een lijst van degene die je nu al
648kent: 656kent:
649 657
650 C-x C-f bezoek bestand 658 C-x C-f bezoek bestand
651 C-x C-s bewaar bestand 659 C-x C-s sla bestand op
652 C-x C-b laat bufferlijst zien 660 C-x C-b laat bufferlijst zien
653 C-x C-c verlaat Emacs 661 C-x C-c verlaat Emacs
654 C-x u herstel 662 C-x u herstel
655 663
656Commando's waaraan een uitgebreid commando wordt toegevoegd, worden nog 664Commando-naam-bevelen worden nog minder vaak gebruikt, of alleen onder bepaalde omstandigheden.
657minder vaak gebruikt, of worden alleen onder bepaalde omstandigheden gebruikt.
658Een voorbeeld is het commando replace-string, dat in de hele tekst een string 665Een voorbeeld is het commando replace-string, dat in de hele tekst een string
659vervangt door een andere string (`to replace' betekent `vervangen'). 666vervangt door een andere string ("to replace" betekent "vervangen").
660Als je M-x typt echoot Emacs onderaan het scherm `M-x' en moet je de naam van 667Als je M-x tikt, toont Emacs onderaan het scherm "M-x" en moet je de naam van
661het commando intypen, in dit geval "replace-string". Als je gewoon 668het commando intikken, in dit geval "replace-string". Als je gewoon
662"repl s<TAB>" typt maakt Emacs de naam zelf af. Beëindig het commando 669"repl s<TAB>" tikt maakt Emacs de naam zelf af. Beëindig het commando
663met <Return>. 670met <Return>.
664 671
665Het replace-string commando heeft twee argumenten nodig: de string die 672Het replace-string commando heeft twee argumenten nodig: de string die
666vervangen moet worden en de string waarmee die vervangen moet worden. 673vervangen moet worden en de string waarmee die vervangen moet worden.
667Je sluit elk argument af met <Return>. 674Je sluit elk argument af met <Return>.
668 675
669>> Plaats de cursor op de lege regel twee regels onder deze. 676>> Plaats de cursor op de lege regel twee regels onder deze regel.
670 Type dan M-x repl s<Return>gewijzigd<Return>veranderd<Return>. 677 Tik dan M-x repl s<Return>gewijzigd<Return>veranderd<Return>.
671 678
672 Zie hoe deze regel daardoor gewijzigd is. Je hebt elke keer dat het woord 679 Zie hoe deze regel daardoor gewijzigd is. Je hebt elk voorkomen van
673"g-e-w-i-j-z-i-g-d" voor kwam, vervangen door "veranderd"; beginnend op 680 het woord g-e-w-i-j-z-i-g-d vervangen door "veranderd"; te beginnen op
674 de plek waar de cursor staat. 681 de plek waar de cursor staat.
675 682
676 683
677* AUTOMATISCH BEWAREN 684* AUTOMATISCH BEWAREN
678--------------------- 685---------------------
679 686
680Als je een bestand veranderd hebt maar het nog niet bewaard hebt, zouden 687Als je een bestand veranderd hebt maar het nog niet opgeslagen hebt, zouden
681de veranderingen verloren kunnen gaan als het systeem zou hangen of 688de veranderingen verloren kunnen gaan als het systeem zou hangen of
682herstarten. Om je hiertegen te beschermen bewaart Emacs om de zoveel tijd 689herstarten. Om je hiertegen te beschermen, slaat Emacs regelmatig
683de veranderde tekst automatisch. De naam van het bestand waarin de tekst 690de veranderde tekst automatisch op. De naam van het bestand waarin de
684automatisch bewaard wordt begint en eindigt met een #. Bijvoorbeeld, als 691tekst automatisch wordt opgeslagen begint en eindigt met een #.
685je het bestand "hello.c" aan het bewerken bent dan wordt de tekst 692Bijvoorbeeld, als je het bestand "hello.c" aan het editeren bent, wordt
686automatisch bewaard in een bestand dat "#hello.c#" heet. Zodra je het 693de tekst automatisch opgeslagen in een bestand dat "#hello.c#" heet. Zodra
687bestand werkelijk bewaart, wordt het automatisch bewaarde bestand weer 694je het bestand werkelijk opslaat, wordt het automatisch opgeslagen bestand
688weggegooid. 695verwijderd.
689 696
690Als de computer crasht kun je de automatisch bewaarde tekst terugkrijgen 697Als de computer crasht, kan je de automatisch opgeslagen tekst terugkrijgen
691door de file normaal te bezoeken (de originele file, niet de automatisch 698door het bestand gewoon te bezoeken (het originele bestand, niet het automatisch
692bewaarde), gevolgd door M-x recover file<Return>. Als Emacs vraagt om 699opgeslagen), gevolgd door M-x recover-file<Return>. Als Emacs vraagt om
693bevestiging, antwoord dan:"yes<Return>", en de automatisch bewaarde 700bevestiging, antwoord dan met yes<Return> en de automatisch opgeslagen
694informatie wordt teruggehaald. 701informatie wordt teruggehaald.
695 702
696 703
697* ECHO GEBIED 704* ECHO-GEBIED
698------------- 705-------------
699 706
700Als je een commando langzaam intypt echoot Emacs de tekens aan de 707Als je een commando langzaam intikt, toont Emacs de tekens aan de
701onderkant van het scherm, in een deel dat het "echo gebied" genoemd wordt. 708onderkant van het scherm in een deel dat het "echo-gebied" genoemd wordt.
702Dit gebied omvat de onderste regel van het scherm. 709Dit gebied omvat de onderste regel van het scherm.
703 710
704 711
705* MODE-REGEL 712* MODUS-REGEL
706------------ 713-------------
707 714
708De regel direct boven het echo gebied heet de "mode-regel". De mode-regel 715De regel direct boven het echo gebied heet de "modusregel". De modusregel
709ziet er ongeveer zo uit: 716ziet er ongeveer zo uit:
710 717
711--**-Emacs: TUTORIAL.nl (Fundamental)--68%------------------------ 718--**-Emacs: TUTORIAL.nl (Fundamental)--68%------------------------
712 719
713Deze regel geeft interessante informatie over Emacs en de tekst die 720Deze regel geeft interessante informatie over Emacs en de tekst die
714je aan het bewerken bent. 721je aan het editeren bent.
715 722
716Je weet al wat de bestandsnaam betekent: het is de naam van het bestand 723Je weet al wat de bestandsnaam betekent: het is de naam van het bestand
717dat je bezoekt. -NN%-- geeft je huidige positie in de tekst aan: NN 724dat je bezoekt. -NN%-- geeft je huidige positie in de tekst aan: NN
718procent van de tekst bevindt zich boven het scherm. Als het bestand vanaf 725procent van de tekst bevindt zich boven het scherm. Als het bestand vanaf
719het begin op het scherm staat, staat er --Top-- in plaats van --00%--. 726het begin op het scherm staat, staat er --Top-- in plaats van --00%--.
720Als het laatste stuk tekst op het scherm staat, zal er --Bot-- staan (van 727Als het laatste stuk tekst op het scherm staat, zal er --Bot-- staan (van
721`bottom', `onderkant' in het Nederlands). Als de tekst zo klein is dat die 728"bottom", "onderkant" in het Nederlands). Als de tekst zo klein is dat hij
722volledig op het scherm past staat --All-- in de mode-regel. 729volledig op het scherm past staat --All-- in de modus-regel.
723 730
724De sterretjes aan het begin betekenen dat je de tekst gemodificeerd hebt. 731De sterretjes aan het begin betekenen dat je de tekst veranderd hebt.
725Direct na het bezoeken of bewaren staan er gewoon streepjes. 732Direct na het bezoeken of opslaan staan er gewoon streepjes.
726 733
727In de mode-regel staat tussen haakjes in welke mode je aan het werken 734In de modusregel staat tussen haakjes in welke modus je aan het werken
728bent. Tenzij een andere mode gewenst is, zit je in de "Fundamental" mode 735bent. De standaardmodus is de "Fundamental" modus, die je nu gebruikt
729zoals nu (`fundamental' is `basis' in het Nederlands). Een dergelijke 736("fundamental" is "basis" in het Nederlands). Een dergelijke
730mode heet een hoofdmode (`major mode' in het Engels). 737modus heet een hoofdmodus ("major mode" in het Engels).
731 738
732Emacs heeft verschillende hoofdmodes. Sommige daarvan zijn bedoeld voor 739Emacs heeft verschillende hoofdmodi. Sommige daarvan zijn bedoeld voor
733het bewerken van verschillende talen of soorten tekst, zoals bijvoorbeeld 740het editeren van verschillende talen of soorten tekst, zoals bijvoorbeeld
734Lisp mode, Text mode, etc. Op elk moment is er altijd precies een mode 741Lisp modus, Text modus, etc. Op elk moment is er altijd precies een modus
735actief, en de naam daarvan staat in de mode-regel, op de plaats waar nu 742actief, en de naam daarvan staat in de modusregel, op de plaats waar nu
736"Fundamental" staat. 743"Fundamental" staat.
737 744
738Het komt voor dat sommige commado's zich in verschillende modes anders 745Elke hoofdmodus zorgt ervoor dat sommige commando's zich anders gedragen.
739gedragen. Zo bestaat er een commando om een commentaar in een programma te 746Zo bestaat er een commando om een commentaar in een programma te tikken, en
740typen, en aangezien elke programmeertaal een ander idee heeft over hoe 747aangezien elke programmeertaal een ander idee heeft over hoe commentaar
741commentaar eruit moet zien, moet elke hoofdmode op een andere manier het 748eruit moet zien, moet elke hoofdmodus op een andere manier het commentaar
742commentaar beginnen. Elke hoofdmode is de naam van een uitgebreid commando, 749beginnen. Elke hoofdmodus is de naam van een uitgebreid commando, en met
743en met dat commando schakel je om naar die hoofdmode. Zo is bijvoorbeeld 750dat commando schakel je om naar die hoofdmodus. Zo is bijvoorbeeld
744M-x fundamental-mode het commando om naar de basismode om te schakelen. 751M-x fundamental-mode het commando om naar de basismodus om te schakelen.
745 752
746Als je Nederlandse of Engelse tekst wil gaan bewerken, zoals bijvoorbeeld 753Als je Nederlandse of Engelse tekst wil gaan editeren, zoals bijvoorbeeld
747dit bestand, kun je beter "text mode" gebruiken, de mode om tekst in een 754dit bestand, kan je beter "Text mode" gebruiken, de modus om tekst in een
748gewone taal te bewerken: 755gewone taal te editeren:
749 756
750>> Type M-x text-mode<Return>. 757>> Tik M-x text-mode<Return>.
751 758
752Wees gerust; geen van de commando's die je geleerd hebt zorgen voor 759Wees gerust; geen van de commando's die je geleerd hebt zorgen voor
753grondige veranderingen in Emacs. Een van de dingen die je kunt merken is 760grondige veranderingen in Emacs. Een van de dingen die je kan merken, is
754bijvoorbeeld dat M-f en M-b nu apostrofs als onderdeel van een woord 761bijvoorbeeld dat M-f en M-b nu apostrofs als onderdeel van een woord
755beschouwen. In de vorige, Fundamental, mode behandelen M-f en M-b de 762beschouwen. In de vorige modus (Fundamental) behandelen M-f en M-b de
756apostrof als ruimte tussen twee woorden. 763apostrof als ruimte tussen twee woorden.
757 764
758Het is gebruikelijk dat hoofdmodes dergelijke subtiele verschillen hebben. 765Het is gebruikelijk dat hoofdmodi dergelijke subtiele verschillen hebben.
759De meeste commando's doen dus min of meer hetzelfde in elke hoofdmode. 766De meeste commando's doen dus min of meer hetzelfde in elke hoofdmodus.
760 767
761Met het commando C-h m kun je de documentatie over de huidige hoofdmode 768Met het commando C-h m kan je de documentatie over de huidige hoofdmodus
762lezen. 769lezen.
763 770
764>> Gebruik C-u C-v een paar keer om deze zin in de buurt van de bovenkant 771>> Gebruik C-u C-v een paar keer om deze zin in de buurt van de bovenkant
765 van het scherm te krijgen. 772 van het scherm te krijgen.
766>> Type C-h m om te zien hoe Text mode verschilt van Fundamental mode. 773>> Tik C-h m om te zien hoe de tekstmodus verschilt van de basismodus.
767>> Type C-x 1 om de documentatie van het scherm te verwijderen. 774>> Tik C-x 1 om de documentatie van het scherm te verwijderen.
768 775
769Hoofdmodes heten hoofdmodes omdat er ook bijmodes zijn. Bijmodes zijn 776Hoofdmodi heten zo omdat er ook bijmodi zijn. Bijmodi zijn
770geen alternatieven voor hoofdmodes; het zijn slechts kleine modificaties 777geen alternatieven voor hoofdmodi; het zijn slechts kleine aanpassingen
771daarvan. Elke bijmode kan aan- of uitgezet worden, onafhankelijk van 778daarvan. Elke bijmodus kan aan- of uitgezet worden, onafhankelijk van
772andere bijmodes en onafhankelijk van de hoofdmode. Je kunt dus nul, een, 779andere bijmodi en onafhankelijk van de hoofdmodus. Het is dus mogelijk geen bijmodi, één bijmodus
773of willekeurig veel minor modes gebruiken. 780of een willekeurige combinatie van bijmodi te gebruiken.
774 781
775Een nuttige bijmode voor het bewerken van tekst in een natuurlijke taal, 782Een nuttige bijmodus voor het editeren van tekst in een natuurlijke taal,
776zoals Nederlands, is Auto Fill mode (`auto fill' betekent automatisch 783zoals het Nederlands, is Auto Fill modus ("auto fill" betekent automatisch
777uitvullen). Wanneer deze mode aanstaat breekt Emacs automatisch een regel 784uitvullen). Wanneer deze modus aanstaat, breekt Emacs automatisch een
778tussen twee woorden af als de regel anders te lang zou worden. 785regel tussen twee woorden af als de regel te lang wordt.
779 786
780Je kunt Auto Fill mode aanzetten met M-x auto-fill-mode<Return>. Als deze 787Je kan Auto Fill modus aanzetten met M-x auto-fill-mode<Return>. Als deze
781mode al aanstaat, kun je hem uitzetten met M-x auto-fill-mode<Return>. 788modus al aanstaat, kan je hem uitzetten met M-x auto-fill-mode<Return>.
782Als de mode uitstaat zet dit commando de mode aan; als ze aanstaat zet dit 789Als de modus uitstaat, zet dit commando de modus aan; als ze aanstaat, zet
783commando de mode uit. Het commando zet de mode steeds aan en uit zet (`to 790dit commando de modus uit. We zeggen dat het commando de modus "schakelt"
784toggle' in het Engels). 791("to toggle" in het Engels).
785 792
786>> Type nu M-x auto-fill-mode<Return>. Type nu vele malen asdf op een 793>> Tik nu M-x auto-fill-mode<Return>. Tik nu vele malen "asdf " op een
787 regel zodat je kunt zien dat de regel in tweeën gesplitst wordt. Er 794 regel zodat je kan zien dat de regel in tweeën gesplitst wordt. Er
788 moeten wel spaties tussen de woorden staan, omdat de Auto Fill mode 795 moeten wel spaties tussen de woorden staan, omdat de Auto Fill modus
789 alleen op spaties de regel afbreekt. 796 de regel alleen op spaties breekt.
790 797
791De rechter kantlijn staat meestal op 70 tekens, maar die kun je veranderen 798De rechterkantlijn staat meestal op 70 tekens, maar die kan je veranderen
792met het C-x f commando. Dit commando accepteert een numeriek argument 799met het C-x f commando. Dit commando accepteert een numeriek argument
793om de gewenste kantlijn te verkrijgen. 800om de gewenste kantlijn te verkrijgen.
794 801
795>> Type C-x f met 20 als argument (C-u 20 C-x f). 802>> Tik C-x f met 20 als argument (C-u 20 C-x f).
796 Type wat tekst en zie dat Emacs de regels afbreekt bij 20 tekens. 803 Tik wat tekst en zie dat Emacs de regels afbreekt bij 20 tekens.
797 Zet de kantlijn nu terug op 70, dus met C-u 70 C-x f. 804 Zet de kantlijn nu terug op 70, dus met met C-u 70 C-x f.
798 805
799Als je de tekst midden in een regel verandert vult Auto Fill mode 806Als je de tekst midden in een regel verandert vult Auto Fill modus
800de regel niet opnieuw. 807de regel niet opnieuw.
801Om een alinea opnieuw te vullen, type M-q (Meta-q) terwijl de 808Om een alinea opnieuw te vullen, tik M-q (META-q) terwijl de
802cursor in de alinea staat. 809cursor in de alinea staat.
803 810
804>> Plaats de cursor in de voorgaande alinea en type M-q. 811>> Plaats de cursor in de voorgaande alinea en tik M-q.
805 812
806 813
807* ZOEKEN 814* ZOEKEN
808-------- 815--------
809 816
810Emacs kan strings zoeken (een string is een rij tekens), zowel volgend op 817Emacs kan tekenreeksen ("strings") zoeken, zowel volgend op
811de cursorpositie, als eraan voorafgaand. Het zoeken van een string 818de cursorpositie, als eraan voorafgaand. Het zoeken naar een string
812verplaatst de cursor naar de volgende plaats waar de gezochte string 819verplaatst de cursor naar de volgende plaats waar de gezochte string
813voorkomt. 820voorkomt.
814 821
815Het zoekcommando van Emacs is anders dan de zoekcommando's van de meeste 822Het zoekcommando van Emacs is anders dan de zoekcommando's van de meeste
816tekstverwerkers; het zoekt incrementeel. Dit betekent dat het zoeken 823tekstverwerkers; het zoekt incrementeel. Dit betekent dat het zoeken
817gebeurt tijdens het intypen van de gezochte string. 824gebeurt tijdens het intikken van de gezochte string.
818 825
819Het commando om vooruit zoeken te starten is C-s (met de `s' van `to 826Het commando om het voorwaarts zoeken te starten is C-s (met de "s" van "to
820search', i.e. zoeken); C-r start het zoeken achteruit (met de `r' van 827search", zoeken); C-r start het achterwaarts zoeken (met de "r" van
821`reverse' of achteruit). WACHT nog even met ze te proberen. 828"reverse" of achteruit). MAAR WACHT! Probeer ze nu nog niet.
822 829
823Als je C-s typt verschijnt de string "I-search" in het echo gebied. Dit 830Als je C-s tikt verschijnt de string "I-search" in het echo-gebied. Dit
824betekent dat Emacs bezig is met een `incremental search' (incrementele 831betekent dat Emacs bezig is met een "incremental search" (incrementele
825zoekopdracht) en wacht op het intypen van de zoekstring. <RET> beëindigt 832zoekopdracht) en wacht op het intikken van de zoekstring. <RET> beëindigt
826het zoeken. 833het zoeken.
827 834
828>> Type nu C-s om het zoeken te starten. Type nu, LANGZAAM, één letter per 835>> Tik nu C-s om het zoeken te starten. Tik nu, LANGZAAM, één letter per
829 keer, het woord `cursor', met een pauze na elke letter zodat je kunt 836 keer, het woord "cursor", met een pauze na elke letter zodat je kan
830 zien wat er met de cursor gebeurt. Je hebt nu eenmaal naar het woord 837 zien wat er met de cursor gebeurt. Je hebt nu eenmaal naar het woord
831 `cursor' gezocht. 838 "cursor" gezocht.
832>> Type nogmaals C-s, om het volgende woord `cursor' te zoeken 839>> Tik nogmaals C-s, om naar het volgende voorkomen van het woord "cursor" te
833>> Type nu viermaal <Delback> en let op de cursorbewegingen. 840 zoeken.
834>> Type <RET> om het zoeken te beëindigen. 841>> Tik nu viermaal <Delback> en let op de cursorbewegingen.
842>> Tik <RET> om het zoeken te beëindigen.
835 843
836Zag je wat er gebeurde? Tijdens incrementeel zoeken probeert Emacs naar 844Zag je wat er gebeurde? Tijdens incrementeel zoeken probeert Emacs naar
837de eerste plek te gaan waar de string staat die je tot dan toe getypt 845de eerste plek te gaan waar de string staat die je tot dan toe getikt
838hebt. Om naar de volgende plek te gaan, type je C-s nog een keer. Als er 846hebt. Om naar de volgende plek te gaan, tik je C-s nog een keer. Als er
839geen volgende plek is gevonden piept Emacs en vertelt je dat de zoekopdracht 847geen volgende plek is gevonden, biept Emacs en vertelt je dat de zoekopdracht
840is beëindigd. (`failing' in het Engels); met C-g kun je het zoeken afbreken. 848niets gevonden heeft ("is failing" in het Engels). C-g zou het zoeken ook afbreken.
841 849
842Als je tijdens incrementeel zoeken <Delback> typt, zul je zien dat het 850Als je tijdens incrementeel zoeken <Delback> tikt, zal je zien dat het
843laatste teken dat je in de zoekstring typte weggehaald wordt en dat het 851laatste teken dat je aan de zoekstring toegevoegd hebt, weggehaald wordt en dat het
844zoeken teruggaat naar de voorgaande plaats. Als je bijvoorbeeld begint 852zoeken teruggaat naar de voorgaande plaats. Als je bijvoorbeeld begint
845met zoeken en je typt een "c" dan ga je naar de plaats waar de "c" het 853met zoeken en je tikt een "c", dan ga je naar de plaats waar de "c" het
846eerst voorkomt. Type je vervolgens een "u" dan gaat de cursor naar de 854eerst voorkomt. Tik je vervolgens een "u", dan gaat de cursor naar de
847plaats waar de string "cu" het eerst voorkomt". Als je nu <Delback> typt, dan 855plaats waar de string "cu" het eerst voorkomt. Als je nu <Delback> tikt, dan
848wordt de "u" van de zoekstring afgehaald en gaat de cursor terug naar de 856wordt de "u" van de zoekstring afgehaald, en gaat de cursor terug naar de
849plaats waar hij stond voordat je de "u" intypte, i.e. de plaats waar "c" het 857plaats waar hij stond voordat je de "u" intikte, namelijk daar waar "c" het
850eerst voorkomt. 858eerst voorkwam.
851 859
852Als je tijdens een zoekoperatie een control- of meta-teken intypt dan 860Als je tijdens een zoekoperatie een CONTROL- of META-teken intikt, dan
853wordt het zoeken beëindigd. Er zijn een paar uitzonderingen, namelijk 861wordt het zoeken beëindigd. Er zijn een paar uitzonderingen, namelijk
854tekens die tijdens zoeken een speciale betekenis hebben, zoals C-s en C-r. 862tekens die tijdens zoeken een speciale betekenis hebben, zoals C-s en C-r.
855 863
856Met C-s begin je te zoeken naar de plaats waar de zoekstring voor het eerst 864Met C-s begin je te zoeken naar de plaats waar de zoekstring voor het eerst
857voorkomt NA de huidige cursorpositie. Als je iets wilt zoeken dat eerder in 865voorkomt NA de huidige cursorpositie. Als je iets wilt zoeken dat eerder in
858de tekst moet voorkomen, gebruik dan C-r i.p.v. C-s. Alles wat we nu weten 866de tekst moet voorkomen, gebruik dan C-r in plaats van C-s. Alles wat we nu weten
859over C-s geldt ook voor C-r, alleen de zoekrichting is omgedraaid. 867over C-s geldt ook voor C-r, alleen is de zoekrichting omgedraaid.
860 868
861 869
862* MEERDERE VENSTERS 870* MEERDERE VENSTERS
863------------------- 871-------------------
864 872
865Een van Emacs' aardige eigenschappen is dat je meerdere vensters op het 873Een van Emacs' aardige eigenschappen is dat je meerdere vensters op het
866scherm kunt laten zien. 874scherm kan laten zien.
867 875
868>> Zet de cursor op deze regel en type C-u 0 C-l. 876>> Zet de cursor op deze regel en tik C-u 0 C-l.
869 877
870>> Type C-x 2 om het scherm in twee vensters op te splitsen. 878>> Tik C-x 2 om het scherm in twee vensters op te splitsen.
871 Beide vensters laten deze uitleg zien; de cursor blijft in het 879 Beide vensters laten deze inleiding zien; de cursor blijft in het
872 bovenste venster. 880 bovenste venster.
873 881
874>> Type C-M-v om de tekst in het onderste venster te verschuiven. 882>> Tik C-M-v om de tekst in het onderste venster te verschuiven.
875 (Als je geen Meta toets hebt, type dan ESC C-v.) 883 (Als je geen META-toets hebt, tik dan ESC C-v.)
876 884
877>> Type C-x o (met de `o' van `other'; `ander' in het Nederlands) 885>> Tik C-x o (met de o van "other"; "ander" in het Nederlands)
878 om de cursor naar het andere venster te verplaatsen. 886 om de cursor naar het andere venster te verplaatsen.
879 887
880>> Verschuif de tekst in het onderste venster, m.b.v. C-v en M-v. 888>> Verschuif de tekst in het onderste venster, met C-v en M-v.
881 Zorg ervoor dat je deze uitleg in het bovenste venster leest. 889 Zorg ervoor dat je deze inleiding in het bovenste venster leest.
882 890
883>> Type weer C-x o om de cursor weer in het bovenste venster 891>> Tik weer C-x o om de cursor weer in het bovenste venster
884 te zetten. De cursor staat weer precies op de plaats waar 892 te zetten. De cursor staat weer precies op de plaats waar
885 hij stond toen je het venster verliet. 893 hij stond toen je het venster verliet.
886 894
887Je kunt C-x o blijven gebruiken om van venster naar venster te gaan. Elk 895Je kan C-x o blijven gebruiken om van venster naar venster te gaan. Elk
888venster heeft zijn eigen cursorpositie; de cursor is altijd maar zichtbaar 896venster heeft zijn eigen cursorpositie; de cursor is altijd enkel zichtbaar
889in een daarvan. Alle normale commando's hebben betrekking op het venster 897in een daarvan. Alle normale commando's hebben betrekking op het venster
890waarin de cursor staat. Dit venster is het `geselecteerde venster' 898waarin de cursor staat. Dit venster is het "geselecteerde venster"
891(`selected window' in het Engels). 899("selected window" in het Engels).
892 900
893Het C-M-v commando is erg nuttig wanneer je tekst aan het bewerken bent in 901Het C-M-v commando is erg nuttig wanneer je tekst aan het editeren bent in
894het ene venster, terwijl je het andere venster als referentie gebruikt. 902het ene venster, terwijl je het andere venster als referentie gebruikt.
895Je kunt de cursor dan altijd in het venster houden waarin je bezig bent, 903Je kan de cursor dan altijd in het venster houden waarin je bezig bent,
896terwijl je met C-M-v door de tekst in het andere venster loopt. 904terwijl je met C-M-v door de tekst in het andere venster loopt.
897 905
898C-M-v is een voorbeeld van een CONTROL-META teken. Als je een echte META 906C-M-v is een voorbeeld van een CONTROL-META teken. Als je een echte
899toets hebt kun je C-M-v intypen door zowel CTRL als META ingedrukt te 907META-toets hebt kan je C-M-v intikken door zowel CTRL als META ingedrukt te
900houden terwijl je v typt. Het maakt niet uit in welke volgorde je de CTRL 908houden terwijl je v tikt. Het maakt niet uit in welke volgorde je CTRL en
901en META indrukt; het gaat erom welke toetsen ingedrukt zijn terwijl je typt. 909META indrukt; het gaat erom welke toetsen ingedrukt zijn terwijl je tikt.
902 910
903Als je geen echte META toets hebt kun je ESC gebruiken; de volgorde maakt 911Als je geen echte META-toets hebt kan je ESC gebruiken; de volgorde is dan
904dan wel uit. Je moet dan ESC typen, gevolgd door CTRL-v; CTRL-ESC v zal 912wel belangrijk. Je moet dan eerst ESC tikken, gevolgd door CTRL-v;
905niet werken. Dit komt doordat ESC zelf een teken is, terwijl CTRL en META 913CTRL-ESC v zal niet werken. Dit komt doordat ESC zelf een teken is,
906dat niet zijn. 914terwijl CTRL en META dat niet zijn.
907 915
908>> Type C-x 1 (in het bovenste venster) om het onderste venster te laten 916>> Tik C-x 1 (in het bovenste venster) om het onderste venster te laten
909 verdwijnen. 917 verdwijnen.
910 918
911(Als je C-x 1 typt in het onderste venster laat je het bovenste 919(Als je C-x 1 tikt in het onderste venster laat je het bovenste
912verdwijnen. C-x 1 betekent zoveel als `ik wil maar 1 venster, 920verdwijnen. C-x 1 betekent zoveel als "ik wil maar 1 venster,
913en wel dat venster waar de cursor nu in staat.') 921en wel dat venster waar de cursor nu in staat.")
914 922
915Hier is nog een manier om twee venster te krijgen die elk een andere tekst 923Hier is nog een manier om twee venster te krijgen die elk een andere tekst
916laten zien: 924laten zien:
917 925
918>> Type C-x 4 C-f gevolgd door de naam van een van je bestanden, gevolgd 926>> Tik C-x 4 C-f gevolgd door de naam van een van je bestanden, gevolgd
919 door <Return>. Het opgegeven bestand zal in het onderste venster 927 door <Return>. Het opgegeven bestand zal in het onderste venster
920 verschijnen, en de cursor zal in dat venster staan. 928 verschijnen, en de cursor zal in dat venster staan.
921 929
922>> Type C-x o om terug naar het bovenste venster te gaan, en C-x 1 om 930>> Tik C-x o om terug naar het bovenste venster te gaan, en C-x 1 om
923 het onderste venster te laten verdwijnen. 931 het onderste venster te laten verdwijnen.
924 932
925 933
@@ -927,15 +935,15 @@ laten zien:
927------------------------------ 935------------------------------
928 936
929Soms kom je in Emacs in een recursief bewerkingsniveau terecht (Engels: 937Soms kom je in Emacs in een recursief bewerkingsniveau terecht (Engels:
930`recursive editing level'). Dit is te zien in de moderegel aan de rechte 938"recursive editing level"). Dit is te zien in de modusregel aan de vierkante
931haken die om de haakjes van de naam van de hoofdmode staan. Dan staat er 939haken die om de haakjes van de naam van de hoofdmodus staan. Dan staat er
932bijvoorbeeld [(Fundamental)] in plaats van (Fundamental). 940bijvoorbeeld [(Fundamental)] in plaats van (Fundamental).
933 941
934Type ESC ESC ESC Om uit een recursief bewerkingsniveau te komen. Dit is 942Tik ESC ESC ESC Om uit een recursief bewerkingsniveau te komen. Dit is
935een generiek `ontsnappingscommando'. Je kunt het ook gebruiken om extra 943een algemeen "ontsnappingscommando". Je kan het ook gebruiken om extra
936vensters weg te gooien of om uit de minibuffer te komen. 944vensters te verwijderen of om uit de minibuffer te komen.
937 945
938>> Type M-x om in een minibuffer te komen, en type dan ESC ESC ESC 946>> Tik M-x om in een minibuffer te komen, en tik dan ESC ESC ESC
939 om er weer uit te komen. 947 om er weer uit te komen.
940 948
941C-g is niet bruikbaar om uit een recursief bewerkingsniveau te komen. De 949C-g is niet bruikbaar om uit een recursief bewerkingsniveau te komen. De
@@ -946,127 +954,127 @@ het recursieve bewerkingsniveau.
946* MEER INFORMATIE 954* MEER INFORMATIE
947----------------- 955-----------------
948 956
949We hebben geprobeerd je met deze uitleg precies genoeg informatie te geven 957We hebben geprobeerd je met deze inleiding precies genoeg informatie te leveren
950om met Emacs te beginnen. De mogelijkheden van Emacs zijn zo legio dat 958om met Emacs te beginnen werken. De mogelijkheden van Emacs zijn zo groot dat
951het onmogelijk is nu alles uit te leggen. Emacs heeft zoveel nuttige 959het onmogelijk is nu alles uit te leggen. Het kan zijn dat je meer over
952mogelijkheden dat je er meer over zou kunnen willen leren. Emacs heeft 960Emacs wil leren omdat het zoveel nuttige mogelijkheden heeft. Emacs heeft
953commando's om documentatie te laten zien over Emacs commando's. Deze 961commando's om documentatie te laten zien over Emacs commando's. Deze
954`helpcommando's' beginnen allemaal met C-h: `het Hulpteken'. 962"helpcommando's" beginnen allemaal met C-h: "het Hulpteken".
955 963
956Om hulp te krijgen, type C-h, gevolgd door een teken om aan te duiden 964Om hulp te krijgen tik je C-h, gevolgd door een teken om aan te duiden
957welke hulp je wilt. Als je het echt niet meer weet, type C-h ? en Emacs 965welke hulp je wilt. Als je het echt niet meer weet, tik C-h ? en Emacs
958vertelt welke hulp het allemaal te bieden heeft. Als je C-h hebt getypt 966vertelt welke hulp het allemaal te bieden heeft. Als je C-h hebt getikt
959maar van gedachten veranderd bent, type je gewoon C-g om het af te breken. 967maar van gedachten veranderd bent, tik je gewoon C-g om het af te breken.
960 968
961(Op sommige computers is de betekenis van C-h veranderd. Dat is een 969(In sommige installaties wordt de betekenis van C-h veranderd. Dat is geen goed
962slecht plan, zeker als die verandering op alle gebruikers invloed heeft, 970idee, zeker als die verandering op alle gebruikers invloed heeft, en is
963en is dus een geldige reden om je beklag te doen bij de systeembeheerder 971een geldige reden om je beklag te doen bij de systeembeheerder of de
964of helpdesk. Als C-h intussen niet een bericht onderaan het scherm laat 972helpdesk. Als C-h intussen niet een bericht onderaan het scherm laat zien
965zien over mogelijke hulp, probeer dan de F1 toets (functietoets 1) of 973over mogelijke hulp, probeer dan de F1 toets (functietoets 1) of gebruik
966gebruik M-x help RET.) 974M-x help RET.)
967 975
968De eenvoudigste hulp is C-h c. Type C-h, het teken `c' en een teken of 976De eenvoudigste hulp is C-h c. Tik C-h, het teken "c" en een teken of
969uitgebreid commando, en Emacs laat een zeer korte beschrijving van het 977uitgebreid commando, en Emacs laat een zeer korte beschrijving van het
970commando zien. 978commando zien.
971 979
972>> Type C-h c Control-p. 980>> Tik C-h c Control-p.
973 De beschrijving die getoond wordt zou zoiets moeten zijn als 981 De beschrijving die getoond wordt zou zoiets moeten zijn als
974 982
975 C-p runs the command previous-line 983 C-p runs the command previous-line
976 984
977 (Nederlands: C-p voert het commando previous-line uit.) 985 (Nederlands: C-p voert het commando previous-line uit.)
978 986
979Dit commando vertelt je `de naam van de functie'. Functies worden vooral 987Dit commando vertelt je "de naam van de functie". Functies worden vooral
980gebruikt om Emacs uit te breiden of aan de wensen van de gebruiker aan te 988gebruikt om Emacs uit te breiden of aan de wensen van de gebruiker aan te
981passen. Aangezien functienamen gekozen zijn om aan te geven wat de 989passen. Aangezien functienamen gekozen zijn om aan te geven wat de
982functie doet, zijn ze ook geschikt als erg korte documentatie; genoeg om 990functie doet, zijn ze ook geschikt als heel korte documentatie; genoeg om
983je te herinneren aan wat de commando's die je al geleerd hebt betekenen. 991je te herinneren aan wat de commando's die je al geleerd hebt betekenen.
984 992
985Uitgebreide commando's zoals C-x C-s en (als je geen META, EDIT or ALT 993Uitgebreide commando's zoals C-x C-s en (als je geen META-, EDIT- of
986toets hebt) <ESC> v kunnen ook getypt worden na C-h c. 994ALT-toets hebt) <ESC> v kunnen ook getikt worden na C-h c.
987 995
988Om meer informatie over een commando te krijgen, type C-h k in plaats van 996Om meer informatie over een commando te krijgen, tik C-h k in plaats van
989C-h c. 997C-h c.
990 998
991>> Type C-h k Control-p. 999>> Tik C-h k C-p.
992 1000
993Dit laat de documentatie van de functie zien, inclusief de naam van de 1001Dit laat de documentatie van de functie, inclusief de naam van de functie,
994functies, in een apart venster. Als je klaar bent met lezen, type C-x 1 1002in een apart venster zien. Als je klaar bent met lezen, tik C-x 1 om van
995om van dat venster af te komen. Je hoeft dat natuurlijk niet meteen te 1003dat venster af te komen. Je hoeft dat natuurlijk niet meteen te doen. Je
996doen. Je kunt ook eerst wat anders doen voordat je C-x 1 typt. 1004kan ook eerst wat anders doen voordat je C-x 1 tikt.
997 1005
998Hier zijn nog wat nuttige mogelijkheden van C-h: 1006Hier zijn nog wat nuttige mogelijkheden van C-h:
999 1007
1000 C-h f Beschrijf een functie. Je moet de naam van de functie 1008 C-h f Beschrijf een functie. Je moet de naam van de functie
1001 intypen. 1009 intikken.
1002 1010
1003>> Type C-h f previous-line<Return> 1011>> Tik C-h f previous-line<Return>
1004 Dit laat alle informatie zien die Emacs heeft over de functie die het 1012 Dit laat alle informatie zien die Emacs heeft over de functie die het
1005 C-p commando implementeert. 1013 C-p commando implementeert.
1006 1014
1007 C-h a Commando Apropos. Type een woord in en Emacs zal een 1015 C-h a Commando Apropos. Tik een woord in en Emacs zal een
1008 lijst van alle commando's laten zien waarin dat woord 1016 lijst van alle commando's laten zien waarin dat woord
1009 voorkomt. Al deze commando's kunnen aangeroepen worden 1017 voorkomt. Al deze commando's kunnen aangeroepen worden
1010 met M-x. Bij sommige commando's staat met welke tekens 1018 met M-x. Bij sommige commando's staat met welke tekens
1011 dit commando direct uitgevoerd kan worden. 1019 dit commando direct uitgevoerd kan worden.
1012 1020
1013>> Type C-h a file<Return>. 1021>> Tik C-h a file<Return>.
1014 1022
1015Dit laat in een ander venster alle M-x commando's zien met `file' in hun 1023Dit laat in een ander venster alle M-x commando's zien met "file" in hun
1016naam. Je zult teken-commando's zien als C-x C-f naast de overeenkomende 1024naam. Je zal teken-commando's zien als C-x C-f naast de overeenkomende
1017commandonaam zoals find-file. 1025commandonaam zoals find-file.
1018 1026
1019>> Type C-M-v herhaaldelijk om de tekst in het hulpvenster te verschuiven. 1027>> Tik C-M-v herhaaldelijk om de tekst in het hulpvenster te verschuiven.
1020 1028
1021>> Type C-x 1 om het hulpvenster weg te gooien. 1029>> Tik C-x 1 om het hulpvenster te verwijderen.
1022 1030
1023 1031
1024* CONCLUSIE 1032* CONCLUSIE
1025----------- 1033-----------
1026 1034
1027Denk eraan dat je met C-x C-c gebruikt om Emacs te verlaten. Om tijdelijk 1035Denk eraan dat je met C-x C-c gebruikt om Emacs te verlaten. Om tijdelijk
1028een shell te krijgen en daarna weer in Emacs terug te komen, type C-x. 1036een shell te krijgen en daarna weer in Emacs terug te komen, tik C-z.
1029 1037
1030De bedoeling van deze uitleg is dat ze begrijpelijk is voor alle nieuwe 1038De bedoeling van deze inleiding is dat ze begrijpelijk is voor alle nieuwe
1031Emacs gebruikers. Als je dus iets onduidelijks bent tegengekomen blijf 1039Emacs-gebruikers. Als je dus iets onduidelijks bent tegengekomen, blijf
1032dan niet zitten en maak jezelf geen verwijten. Klaag erover! 1040dan niet zitten en maak jezelf geen verwijten. Doe je beklag!
1033 1041
1034 1042
1035* KOPIËREN 1043* KOPIËREN
1036----------- 1044-----------
1037 1045
1038(De Engelse versie van) deze uitleg is voorafgegaan door een lange reeks 1046(De Engelse versie van) deze inleiding is voorafgegaan door een lange reeks
1039van Emacs tutorials, die begon met de uitleg die Stuart Cracraft schreef 1047van Emacs-inleidingen, die begon met de inleiding die Stuart Cracraft schreef
1040voor de originele Emacs. Deze Nederlandse vertaling is gemaakt door 1048voor de originele Emacs. Deze Nederlandse vertaling is gemaakt door
1041Pieter Schoenmakers <tiggr@ics.ele.tue.nl> op basis van de GNU Emacs 20.2 1049Pieter Schoenmakers <tiggr@ics.ele.tue.nl> op basis van de GNU Emacs 20.2
1042TUTORIAL. 1050TUTORIAL, en verbeterd en verbeterd door Frederik Fouvry.
1043 1051
1044(Wat nu volgt is een vertaling naar het Nederlands van de condities voor 1052(Wat nu volgt is een vertaling naar het Nederlands van de condities voor
1045gebruik en verspreiding van deze uitleg. Deze vertaling is niet 1053gebruik en verspreiding van deze inleiding. Deze vertaling is niet
1046gecontroleerd door een jurist. Er kunnen derhalve geen rechten aan de 1054gecontroleerd door een jurist. Er kunnen derhalve geen rechten aan de
1047vertaling worden ontleend, en de vertaling wordt gevolgd door het Engelse 1055vertaling worden ontleend, en de vertaling wordt gevolgd door het Engelse
1048origineel.) 1056origineel.)
1049 1057
1050Deze versie van de uitleg valt onder copyright, net als GNU Emacs. 1058Deze versie van de inleiding valt onder copyright, net als GNU Emacs.
1051Je mag deze uitleg distribueren onder bepaalde condities: 1059Je mag deze inleiding verdelen onder bepaalde voorwaarden:
1052 1060
1053Copyright (c) 1985, 1996, 1997 Free Software Foundation 1061Copyright (c) 1985, 1996, 1997 Free Software Foundation
1054 1062
1055 Iedereen mag letterlijke kopieën van dit document, zowel ontvangen als 1063 Iedereen mag letterlijke kopieën van dit document, zowel ontvangen als
1056 verspreiden, op elke medium, vooropgesteld dat de copyrightmelding en 1064 verspreiden, op elk medium, vooropgesteld dat de copyrightvermelding en
1057 toestemmingsmelding niet aangetast worden en dat de verspreider aan de 1065 de toestemmingsmelding niet veranderd worden en dat de verspreider aan de
1058 ontvanger dezelfde distributierechten verleent als aan hem verleend 1066 ontvanger dezelfde distributierechten verleent als aan hem verleend
1059 door deze melding. 1067 worden door deze melding.
1060 1068
1061 Toestemming wordt verleend om gemodificeerde versies van dit document, 1069 Toestemming wordt verleend om veranderde versies van dit document,
1062 of delen daarvan, te verspreiden, onder bovenstaande condities, 1070 of delen daarvan, te verspreiden, onder bovenstaande voorwaarden,
1063 vooropgesteld dat ze ook duidelijk melding maken van degene die als 1071 vooropgesteld dat ze ook duidelijk vermelden wie als
1064 laatste modificaties doorgevoerd heeft. 1072 laatste veranderingen aangebracht heeft.
1065 1073
1066De condities voor het kopiëren van Emacs zelf zijn complexer dan dit, 1074De condities voor het kopiëren van Emacs zelf zijn ingewikkelder dan dit,
1067maar gebaseerd op dezelfde gedachte. Lees het bestand COPYING en geef 1075maar gebaseerd op dezelfde gedachte. Lees het bestand COPYING en geef
1068vervolgens kopieën van Emacs aan al je vrienden. Help bij het uitroeien 1076vervolgens kopieën van Emacs aan al je vrienden. Help bij het uitroeien
1069van softwarebeschermingspolitiek (`software eigendom') door vrije software 1077van softwarebeschermingspolitiek ("eigendom") door vrije software
1070te gebruiken, te schrijven en te delen! 1078te gebruiken, te schrijven en te delen!
1071 1079
1072(Engels origineel van de copyrightmelding en condities: 1080(Engels origineel van de copyrightmelding en condities:
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1df649e2d5b..fa3006178b1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,13 +1,558 @@
12005-01-01 Jay Belanger <belanger@truman.edu> 12005-01-15 Richard M. Stallman <rms@gnu.org>
2
3 * emacs-lisp/lisp-mnt.el (lm-with-file): Use Lisp mode in temp buffer.
4 In non-temp buffer, switch syntax table temporarily.
5
6 * emacs-lisp/lisp-mode.el (indent-pp-sexp): Doc fix.
7
8 * replace.el (occur-accumulate-lines, occur-engine): Avoid warnings.
9
10 * tar-mode.el (tar-extract): Bind buffer-undo-list to t.
11
12 * imenu.el (imenu--split-menu): Copy menulist before sorting.
13 (imenu--generic-function): Use START, not BEG, as pos of definition.
14
15 * simple.el (just-one-space): Argument specifies number of spaces.
16
17 * simple.el (eval-expression-print-format): Avoid warning
18 about edebug-active.
19
202005-01-15 "James R. Van Zandt" <jrvz@comcast.net> (Tiny change)
21
22 * progmodes/sh-script.el: Code copied from make-mode.el
23 with small changes,
24 (sh-mode-map): Bind C-c C-\.
25 (sh-backslash-column, sh-backslash-align): New variables.
26 (sh-backslash-region, sh-append-backslash): New functions.
27
282005-01-15 Sergey Poznyakoff <gray@Mirddin.farlep.net>
29
30 * mail/rmail.el: Updated to work with movemail from GNU Mailutils
31 (rmail-pop-password, rmail-pop-password-required): Moved to
32 rmail-obsolete group.
33 (rmail-set-pop-password): Renamed to rmail-set-remote-password.
34 All callers updated.
35 (rmail-get-pop-password): Renamed to rmail-get-remote-password.
36 Take an argument specifying whether it is POP or IMAP mailbox we
37 are using. All callers updated.
38 (rmail-pop-password-error): Renamed to
39 rmail-remote-password-error. Added mailutils-specific error
40 message.
41 (rmail-movemail-search-path)
42 (rmail-movemail-variant-in-use): New variables.
43 (rmail-remote-password, rmail-remote-password-required): New
44 customization variables.
45 (rmail-probe,rmail-autodetect, rmail-movemail-variant-p): New
46 functions.
47 (rmail-parse-url): New function.
48 (rmail-get-new-mail, rmail-insert-inbox-text): Updated for use
49 with GNU mailutils movemail.
50
512005-01-15 Kevin Ryde <user42@zip.com.au>
52
53 * info-look.el (c-mode/symbol): Add ^` to prefix, and change
54 suffix to space, $ or '$, to correctly position point when going
55 to @table style constants like DBL_MAX.
56
572005-01-15 Jorgen Schaefer <forcer@forcix.cx> (tiny change)
58
59 * type-break.el (type-break-mode, type-break-file-time)
60 (type-break-file-keystroke-count, type-break-choose-file): Don't
61 store data in or load data from the file if type-break-file-name
62 is nil.
63 (type-break-file-name): Doc update as per the above.
64
652005-01-15 Stephen Eglen <S.J.Eglen@damtp.cam.ac.uk> (tiny change)
66
67 * woman.el (woman-dired-define-key-maybe): If KEY is undefined,
68 lookup-key might return nil; handle that.
69
702005-01-15 Alan Mackenzie <acm@muc.de>
71
72 * ebrowse.el (ebrowse-class-in-tree): Return the tail of the tree
73 rather than the element found, thus enabling the tree to be
74 setcar'd.
2 75
3 * calc-yank.el (calc-edit-mode): Change default header. 762005-01-14 Carsten Dominik <dominik@science.uva.nl>
4 77
5 * calc-store.el (calc-edit-variable): Change title to match new 78 * textmodes/org.el (org-show-following-heading): New option.
6 header. 79 (org-show-hierarchy-above): Use `org-show-following-heading'.
80 (org-cycle): Documentation fix.
81
82 * textmodes/org.el (orgtbl-optimized): New option
83 (orgtbl-mode): New command, a minor mode.
84 (orgtbl-mode-map): New variable.
85 (turn-on-orgtbl, orgtbl-mode, orgtbl-make-binding)
86 (orgtbl-error, orgtbl-self-insert-command)
87 (orgtbl-delete-backward-char, orgtbl-delete-char): New functions.
88
89 * textmodes/org.el (org-mode): `org-table-may-need-update' is now
90 a local variable in each org-mode buffer.
91
92 * textmodes/org.el (org-set-regexps-and-options): Renamed from
93 `org-set-regexps'. Added checking for STARTUP keyword.
94 (org-get-current-options): Added STARTUP options.
95 (org-table-insert-row): Mode mode intelligent about when
96 realignment is needed.
97 (org-self-insert-command, org-delete-backward-char,
98 org-delete-char): New commands.
99 (org-enable-table-editor): new default value `optimized'.
100 (org-table-blank-field): Support blanking regions if active.
101
102
1032005-01-14 Carsten Dominik <dominik@science.uva.nl>
104
105 * textmodes/reftex-cite.el (reftex-bib-sort-year): Catch the case
106 if the year is not given.
107
108 * textmodes/reftex-ref.el (reftex-replace-prefix-escapes): Added
109 new escapes %m and %M, fixed bug with %F by adding
110 save-match-data.
111 (reftex-reference): Removed ?. from list of spaces.
112 (reftex-label-info): Added automatic label prefix recognition
113
114 * textmodes/reftex-index.el (reftex-index-next-phrase): Added
115 slave parameter to call of `reftex-index-this-phrase'
116 (reftex-index-this-phrase): New optional argument
117 (reftex-index-region-phrases): Added slave parameter to call of
118 `reftex-index-this-phrase'
119 (reftex-display-index): New argument redo
120 (reftex-index-rescan): Added 'redo to arguments of
121 `reftex-display-index'
122 (reftex-index-Rescan, reftex-index-revert)
123 (reftex-index-switch-index-tag): Added 'redo to arguments of
124 `reftex-display-index'
125 (reftex-index-make-phrase-regexp): Fixed bug with case-sensitive
126 indexing. Fixed bug with matching is there is a quote before or
127 after the word.
128
129 * textmodes/reftex-cite.el (reftex-all-used-citation-keys): Fix
130 bug when collecting citation keys in lines with comments.
131 (reftex-citation): Prefix argument no longer rescans the document,
132 but forces prompting for optional arguments of cite macros.
133 (reftex-do-citation): Prompting for optional arguments
134 implemented.
135
136 * textmodes/reftex-vars.el (reftex-cite-format-builtin): Added
137 optional arguments to most cite commands.
138 (reftex-cite-cleanup-optional-args): New option
139 (reftex-cite-prompt-optional-args): New option.
140 (reftex-trust-label-prefix): New option
141
142 * textmodes/reftex-toc.el (reftex-toc-find-section): Added
143 push-mark before changing the position in the buffer.
144
145 * textmodes/reftex.el (reftex-prefix-to-typekey-alist): New
146 variable
147 (reftex-compile-variables): Compute reftex-prefix-to-typekey-alist
148
1492005-01-14 Nick Roberts <nickrob@snap.net.nz>
150
151 * xt-mouse.el (xterm-mouse-event): Compute window co-ordinates
152 more carefully.
153
1542005-01-13 Stefan Monnier <monnier@iro.umontreal.ca>
155
156 * textmodes/sgml-mode.el (sgml-fill-nobreak): New fun.
157 (sgml-mode): Use it.
158 (sgml-get-context): Better keep track of implicitly closed tags.
159
1602005-01-13 Kenichi Handa <handa@m17n.org>
161
162 * textmodes/ispell.el: These changes are to fix misalignment error
163 caused by equivalent characters of different Emacs charsets.
164 (ispell-unified-chars-table): New variable.
165 (ispell-get-decoded-string): New function.
166 (ispell-get-casechars, ispell-get-not-casechars)
167 (ispell-get-otherchars): Call ispell-get-decoded-string.
168
1692005-01-12 Johan Bockg,Ae(Brd <bojohan@users.sourceforge.net>
170
171 * custom.el (custom-declare-variable): Just put symbol instead
172 of (defvar . symbol) in `current-load-list'.
173
1742005-01-12 Reiner Steib <Reiner.Steib@gmx.de>
175
176 * emacs-lisp/elint.el: Fixed typo in Commentary section.
177
1782005-01-12 Jay Belanger <belanger@truman.edu>
179
180 * calc/calc-help.el (calc-describe-key): Use temporary info buffer
181 to create a Calc summary.
182
1832005-01-12 Kim F. Storm <storm@cua.dk>
184
185 * mouse.el (mouse-on-link-p): Change functionality and doc
186 string to comply with latest description in lisp ref.
187
1882005-01-12 Nick Roberts <nickrob@snap.net.nz>
189
190 * xt-mouse.el (xterm-mouse-translate, xterm-mouse-event):
191 Enable mouse clicks on mode-line, header-line and margin.
192 (event-type): Give mouse event symbols an 'event-kind property
193 with value 'mouse-click.
194
1952005-01-12 Juri Linkov <juri@jurta.org>
196
197 * facemenu.el (list-colors-display): Add new arg buffer-name.
198 Use it. Fix docstring. Replace code for identifying duplicate
199 colors by the name with call to `list-colors-duplicates' which
200 identifies duplicate colors by the value unless the color
201 is one of special Windows colors. Set truncate-lines to t.
202 Print sorted duplicate color names on each line. Indent to 22
203 \(the longest color name in rgb.txt) instead of 20. Optimize.
204 (list-colors-duplicates): New function.
205 (facemenu-color-name-equal): Delete function.
206
207 * facemenu.el (list-colors-print): New function created from code
208 in list-colors-display. Print #RRGGBB at the window right edge.
209 (list-colors-display): When temp-buffer-show-function is not
210 defined, call list-colors-print from temp-buffer-show-hook
211 to get the right value of window-width in list-colors-print
212 after the buffer is displayed.
213
214 * simple.el (pop-mark): Move deactivate-mark out of conditional
215 part to deactivate the active mark regardless of the state of the
216 mark ring.
217
218 * desktop.el (desktop-save): Add `mode: emacs-lisp' to the local
219 variables line in desktop files.
220
2212005-01-12 Juri Linkov <juri@jurta.org>
222
223 * isearch.el (search-highlight, isearch, isearch-lazy-highlight):
224 Bring together isearch highlight related options.
225 (lazy-highlight): Replace group `replace' by `matching'.
226 (lazy-highlight-cleanup, lazy-highlight-initial-delay)
227 (lazy-highlight-interval, lazy-highlight-max-at-a-time)
228 (lazy-highlight): Add aliases to old names isearch-lazy-highlight-...
229 and declare them obsolete.
230 (lazy-highlight-face): Rename from isearch-lazy-highlight-face.
231 (isearch-faces): Remove defgroup.
232 (isearch-overlay, isearch-highlight, isearch-dehighlight):
233 Move isearch highlighting code closer to lazy highlighting code.
234
235 * replace.el (query-replace-lazy-highlight): Add lazy-highlight group.
236 (query-replace-highlight, query-replace-lazy-highlight)
237 (query-replace): Move definitions to the beginning of the file.
238
2392005-01-11 Juri Linkov <juri@jurta.org>
240
241 * toolbar/back_arrow.xpm, toolbar/back_arrow.pbm,
242 * toolbar/lc-back_arrow.xpm, toolbar/lc-fwd_arrow.xpm,
243 * toolbar/fwd_arrow.xpm, toolbar/fwd_arrow.pbm: New icons.
244
245 * info.el (Info-history-forward): New variable.
246 (Info-select-node): Reset Info-history-forward to nil.
247 (Info-last): Turn into defalias.
248 (Info-history-back): Rename from Info-last.
249 Add current node to Info-history-forward.
250 (Info-history-forward): New fun.
251 (Info-mode-map): Replace Info-last by Info-history-back.
252 Bind Info-history-forward to "r".
253 (Info-mode-menu): Replace Info-last by Info-history-back.
254 Fix menu item text. Add menu item for Info-history-forward.
255 (info-tool-bar-map): Replace Info-last by Info-history-back.
256 Replace its icon "undo" by "back_arrow". Add icon "fwd_arrow"
257 for Info-history-forward.
258 (Info-mode): Replace Info-last by Info-history-back in docstring.
259 Add local variable Info-history-forward.
260 (Info-goto-emacs-command-node): Replace Info-last by Info-history-back.
261
2622005-01-11 Stefan Monnier <monnier@iro.umontreal.ca>
263
264 * mouse.el (mouse-drag-mode-line-1, mouse-drag-vertical-line)
265 (mouse-drag-region, mouse-drag-region-1, mouse-drag-secondary):
266 Ignore select-window events rather than fiddle with
267 mouse-autoselect-window.
268
2692005-01-11 Matthew Mundell <matt@mundell.ukfsn.org>
270
271 * type-break.el (type-break-mode): Fix previous change.
272
2732005-01-10 Jay Belanger <belanger@truman.edu>
274
275 * calc/calc-ext.el (calc-reset): Reset when inside embedded
276 calculator; only reset when point is inside a calculator.
277 Don't adjust the window height if the window takes up the whole height
278 of the frame.
279
2802005-01-10 Thien-Thi Nguyen <ttn@gnu.org>
281
282 * ebuff-menu.el (Electric-buffer-menu-mode):
283 Preserve value of buffer-local var header-line-format.
284
2852005-01-09 Jay Belanger <belanger@truman.edu>
286
287 * calc/calc.el (calc-mode-var-list-restore-saved-values):
288 Make sure settings file exists before accessing it.
289
290 * calc/calc-embed.el (calc-embedded-subst):
291 Replace math-multi-subst-rec, which is only supposed to be called
292 by math-multi-subst, by math-multi-subst.
293
2942005-01-09 Andre Spiegel <spiegel@gnu.org>
295
296 * vc.el (vc-allow-async-revert): New user option.
297 (vc-disable-async-diff): New internal variable.
298 (vc-revert-buffer): Use them to disable asynchronous diff.
299
300 * vc-cvs.el, vc-arch.el, vc-svn.el, vc-mcvs.el (vc-cvs-diff)
301 (vc-arch-diff, vc-svn-diff, vc-mcvs-diff): Don't diff
302 asynchronously if vc-disable-async-diff is t.
303
3042005-01-09 Jay Belanger <belanger@truman.edu>
305
306 * calc/calc.el (defcalcmodevar): New macro.
307 (calc-mode-var-list-restore-default-values)
308 (calc-mode-var-list-restore-saved-values): New functions.
309 (calc-mode-var-list): Use defcalcmodevar to define it.
310 (calc-always-load-extensions, calc-line-numbering)
311 (calc-line-breaking, calc-display-just, calc-display-origin)
312 (calc-number-radix, calc-leading-zeros, calc-group-digits)
313 (calc-group-char, calc-point-char, calc-frac-format)
314 (calc-prefer-frac, calc-hms-format, calc-date-format)
315 (calc-float-format, calc-full-float-format, calc-complex-format)
316 (calc-complex-mode, calc-infinite-mode, calc-display-strings)
317 (calc-matrix-just, calc-break-vectors, calc-full-vectors)
318 (calc-full-trail-vectors, calc-vector-commas, calc-vector-brackets)
319 (calc-matrix-brackets, calc-language, calc-language-option)
320 (calc-left-label, calc-right-label, calc-word-size)
321 (calc-previous-modulo, calc-simplify-mode, calc-auto-recompute)
322 (calc-display-raw, calc-internal-prec, calc-angle-mode)
323 (calc-algebraic-mode, calc-incomplete-algebraic-mode)
324 (calc-symbolic-mode, calc-matrix-mode, calc-shift-prefix)
325 (calc-window-height, calc-display-trail, calc-show-selections)
326 (calc-use-selections, calc-assoc-selections)
327 (calc-display-working-message, calc-auto-why, calc-timing)
328 (calc-mode-save-mode, calc-standard-date-formats, calc-autorange-units)
329 (calc-was-keypad-mode, calc-full-mode, calc-user-parse-tables)
330 (calc-gnuplot-default-device, calc-gnuplot-default-output)
331 (calc-gnuplot-print-device, calc-gnuplot-print-output)
332 (calc-gnuplot-geometry, calc-graph-default-resolution)
333 (calc-graph-default-resolution-3d, calc-invocation-macro)
334 (calc-show-banner): Use defcalcmodevar to declare them and set
335 their default values.
336
337 * calc/calc-ext.el (calc-reset): Restore saved values of variables
338 instead of default values (but restore default values if there is
339 an argument of 0).
340
3412005-01-09 David Kastrup <dak@gnu.org>
342
343 * desktop.el (desktop-restore-eager): Fix typo in type.
344
3452005-01-08 Richard M. Stallman <rms@gnu.org>
346
347 * cus-edit.el (customize): Delete :link.
348
3492005-01-08 Jay Belanger <belanger@truman.edu>
350
351 * calc/calc.el (calc-mode): Remove the extension from the
352 `calc-settings-file' file name when loading it.
353
3542005-01-08 Kim F. Storm <storm@cua.dk>
355
356 * info.el (Info-mode-map, Info-next-link-keymap)
357 (Info-prev-link-keymap, Info-up-link-keymap):
358 Map follow-link to mouse-face.
359 (Info-fontify-node): Add "mouse-2: " prefix to tooltip.
360
3612005-01-08 Jay Belanger <belanger@truman.edu>
362
363 * calc/calc.el (calc-settings-file): Change default value.
364 Suggested by cgw in a comment in calc-mode.el.
365
366 * calc/calc-mode.el (calc-settings-file-name):
367 Compare calc-settings-file to user-init-file instead of ~/.emacs.
368 Replace ~/.emacs in a prompt by calc-settings-file.
369
3702005-01-07 Lars Hansen <larsh@math.ku.dk>
371
372 * desktop.el (desktop-restore-eager, desktop-lazy-verbose)
373 (desktop-lazy-idle-delay): New customizable variables.
374 (desktop-buffer-args-list): New variable.
375 (desktop-append-buffer-args): New function.
376 (desktop-save): Call desktop-append-buffer-args for some buffers.
377 (desktop-lazy-create-buffer): New function.
378 (desktop-idle-create-buffers): New function.
379 (desktop-read): Add message about buffers to restore lazily.
380 (desktop-lazy-abort): New command.
381 (desktop-clear): Call desktop-lazy-abort.
382 (desktop-lazy-complete): New command.
7 383
8 * calc/calc-prog.el (calc-edit-user-syntax): Change title to edit 3842005-01-06 Richard M. Stallman <rms@gnu.org>
385
386 * emacs-lisp/find-func.el (find-face-definition):
387 Rename from find-face.
388
3892005-01-06 Kim F. Storm <storm@cua.dk>
390
391 * simple.el (completion-list-mode-map): Map follow-link to mouse-face.
392
393 * man.el (Man-xref-man-page, Man-xref-header-file)
394 (Man-xref-normal-file): Add follow-link property.
395
3962005-01-06 Jay Belanger <belanger@truman.edu>
397
398 * calc/calc-units.el: Make sure the proper macro definitions are
399 available when compiling.
400
4012005-01-06 Juri Linkov <juri@jurta.org>
402
403 * isearch.el (isearch-lazy-highlight-update):
404 Rename `isearch-lazy-highlight-interval' to `lazy-highlight-interval'.
405
4062005-01-06 Miles Bader <miles@gnu.org>
407
408 * isearch.el (lazy-highlight): Rename from `lazy-highlight-face'.
409 (isearch-lazy-highlight-face): Use new name.
410
4112005-01-05 Stefan Monnier <monnier@iro.umontreal.ca>
412
413 * uniquify.el (uniquify-rationalize-file-buffer-names):
414 Re-add an interactive spec.
415 (uniquify-rationalize-file-buffer-names): Fix corner case when renaming
416 to the same name.
417
418 * isearch.el (isearch-dehighlight): Remove unused arg `totally'.
419 (isearch-update, isearch-done): Adjust calls accordingly.
420
4212005-01-05 Richard M. Stallman <rms@gnu.org>
422
423 * custom.el (custom-set-variables, custom-theme-set-variables):
424 Clarify documentation.
425
426 * emacs-lisp/find-func.el (find-variable)
427 (find-variable-other-window, find-variable-other-frame):
428 Fix the TYPE args to find-function-read and find-function-do-it.
429 (find-function): Doc fix.
430 (find-function-at-point): Replace function-at-point alias.
431
4322005-01-04 Richard M. Stallman <rms@gnu.org>
433
434 * cus-face.el (custom-declare-face):
435 Record defface in current-load-list.
436
437 * help-fns.el (variable-at-point): New arg ANY-SYMBOL.
438
439 * emacs-lisp/find-func.el: Doc fixes.
440 (find-face-regexp): New variable.
441 (find-function-regexp-alist): New variable.
442 (find-function-C-source): Third arg is now TYPE.
443 (find-function-search-for-symbol): Handle general TYPE.
444 (find-function-read, find-function-do-it): Handle general TYPE.
445 (find-definition-noselect, find-face): New functions.
446 (function-at-point): Alias deleted.
447
4482005-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
449
450 * battery.el (display-battery-mode): Rename from display-battery.
451 Handle the case where it gets turned off.
452
4532005-01-04 Richard M. Stallman <rms@gnu.org>
454
455 * cus-edit.el (customize): Make :link point to user doc.
456
457 * man.el (Man-fontify-manpage): Turn off undo generation.
458
459 * add-log.el (change-log-font-lock-keywords): Don't match just "From".
460
4612005-01-04 Andreas Schwab <schwab@suse.de>
462
463 * files.el (insert-directory): Only look for error lines in
464 inserted text. Don't move too far after processing --dired markers.
465
4662005-01-04 Richard M. Stallman <rms@gnu.org>
467
468 * mail/mailabbrev.el (sendmail-pre-abbrev-expand-hook):
469 Don't expand if the character is @, period, dash, etc.
470 (define-mail-abbrev): Quote names that contain problem characters.
471
4722005-01-04 Thien-Thi Nguyen <ttn@gnu.org>
473
474 * progmodes/hideshow.el: No longer require `cl'; `dolist' is standard.
475
4762005-01-03 Richard M. Stallman <rms@gnu.org>
477
478 * replace.el (replace-dehighlight): Use lazy-highlight-cleanup.
479 (query-replace-highlight, query-replace-lazy-highlight)
480 (query-replace): Definitions moved up. Doc fix.
481
4822005-01-03 Richard M. Stallman <rms@gnu.org>
483
484 * isearch.el (lazy-highlight): Group renamed from isearch-lazy-...
485 (lazy-highlight-cleanup, lazy-highlight-initial-delay)
486 (lazy-highlight-interval, lazy-highlight-max-at-a-time)
487 (lazy-highlight-face): Rename from isearch-lazy-...
488 Change all references to them.
489
4902005-01-03 Luc Teirlinck <teirllm@auburn.edu>
491
492 * cus-edit.el (custom-file): Doc fix for defcustom.
493 (custom-file): The function no longer sets the variable
494 `custom-file' to its return value.
495
496 * startup.el (command-line): No longer load `custom-file'.
497
4982005-01-03 Stefan Monnier <monnier@iro.umontreal.ca>
499
500 * emacs-lisp/find-func.el (find-variable-regexp): Avoid defface.
501
502 * progmodes/perl-mode.el (perl-nochange, perl-calculate-indent):
503 Don't confuse module-prefixed identifiers for labels.
504 Reported by Juan-Leon Lahoz Garcia <juanleon1@gmail.com>.
505
5062005-01-02 Richard M. Stallman <rms@gnu.org>
507
508 * files.el (basic-save-buffer-1): Fix previous change.
509
510 * loadhist.el (file-loadhist-lookup): New function.
511 (file-provides, file-requires): Use it.
512
513 * electric.el (Electric-pop-up-window): Use fit-window-to-buffer
514 instead of calculating the right size.
515
5162005-01-02 Karl Chen <quarl@cs.berkeley.edu> (tiny change)
517
518 * vc-svn.el (vc-svn-diff): Stay local if possible.
519
5202005-01-02 Stefan <monnier@iro.umontreal.ca>
521
522 * vc-arch.el (vc-arch-workfile-version): Handle the empty-branch case.
523
524 * files.el (hack-local-variables): Fix last change.
525
5262005-01-02 Jay Belanger <belanger@truman.edu>
527
528 * calc/calc-yank.el (calc-edit-top): New variable.
529 (calc-edit-mode): Set calc-edit-top to be the beginning of the edited
530 object. Change header properties.
531 (calc-edit-finish, calc-edit-finish-stack-object)
532 (calc-edit-show-buffer): Use calc-edit-top to find the beginning of the
533 edited object.
534 * calc/calc-sel.el (calc-finish-selection-edit): Use calc-edit-top
535 for the beginning of the edited object.
536 * calc/calc-embed.el (calc-embedded-finish-edit): Use calc-edit-top
537 for the beginning of the edited object.
538 * calc/calc-prog.el (calc-edit-macro-finish-edit)
539 (calc-finish-formula-edit, calc-macro-repeats)
540 (calc-edit-macro-adjust-buffer, calc-edit-format-macro-buffer)
541 (calc-edit-macro-pre-finish-edit): Use calc-edit-top for the
542 beginning of the edited object.
543 (calc-user-define-edit): Change the header for editing macros.
544 Remove unnecessary variable.
545
5462005-01-01 Jay Belanger <belanger@truman.edu>
547
548 * calc/calc-yank.el (calc-edit-mode): Change default header.
549 (calc-edit-finish, calc-show-edit-buffer): Adjust to handle new header.
550 * calc/calc-store.el (calc-edit-variable): Change title to match new
551 header.
552 * calc/calc-prog.el (calc-edit-user-syntax): Change title in edit
9 mode to match new header. 553 mode to match new header.
10 (calc-user-define-edit): Change titles to include names of commands. 554 (calc-user-define-edit): Change titles to include names of commands.
555 (calc-finish-formula-edit): Adjust to handle new header.
11 (calc-finish-macro-edit): Remove. 556 (calc-finish-macro-edit): Remove.
12 (calc-edit-macro-repeats, calc-edit-macro-adjust-buffer) 557 (calc-edit-macro-repeats, calc-edit-macro-adjust-buffer)
13 (calc-edit-macro-command, calc-edit-macro-command-type) 558 (calc-edit-macro-command, calc-edit-macro-command-type)
@@ -2944,7 +3489,7 @@
2944 * menu-bar.el (menu-bar-files-menu): Make "Open File..." call 3489 * menu-bar.el (menu-bar-files-menu): Make "Open File..." call
2945 find-file-existing. Add "New File..." that calls find-file. 3490 find-file-existing. Add "New File..." that calls find-file.
2946 3491
2947 * diropen.pbm diropen.xpm: New files. 3492 * diropen.pbm, diropen.xpm: New files.
2948 3493
2949 * toolbar/tool-bar.el (tool-bar-setup): Tool bar item dired uses 3494 * toolbar/tool-bar.el (tool-bar-setup): Tool bar item dired uses
2950 icon diropen. New tool bar item find-file-existing uses icon open. 3495 icon diropen. New tool bar item find-file-existing uses icon open.
@@ -4044,7 +4589,7 @@
4044 (dired-move-to-end-of-filename): Make the " -> " search more specific. 4589 (dired-move-to-end-of-filename): Make the " -> " search more specific.
4045 (dired-buffers-for-dir): Remove unused var `pattern'. 4590 (dired-buffers-for-dir): Remove unused var `pattern'.
4046 4591
40472004-09-28 Matthew Mundell <matt@mundell.ukfsn.org> (tiny change) 45922004-09-28 Matthew Mundell <matt@mundell.ukfsn.org>
4048 4593
4049 * calendar/diary-lib.el (list-diary-entries): Save diary buffer 4594 * calendar/diary-lib.el (list-diary-entries): Save diary buffer
4050 from diary display excursion. Store diary buffer's point for 4595 from diary display excursion. Store diary buffer's point for
diff --git a/lisp/add-log.el b/lisp/add-log.el
index 14a32e580c8..50be95d265a 100644
--- a/lisp/add-log.el
+++ b/lisp/add-log.el
@@ -248,7 +248,9 @@ Note: The search is conducted only within 10%, at the beginning of the file."
248 ("<\\([^>\n]+\\)>\\(:\\| (\\)" (1 'change-log-function-face)) 248 ("<\\([^>\n]+\\)>\\(:\\| (\\)" (1 'change-log-function-face))
249 ;; 249 ;;
250 ;; Acknowledgements. 250 ;; Acknowledgements.
251 ("\\(^\t\\| \\)\\(From\\|Patch\\(es\\)? by\\|Report\\(ed by\\| from\\)\\|Suggest\\(ed by\\|ion from\\)\\)" 251 ;; Don't include plain "From" because that is vague;
252 ;; we want to encourage people to say something more specific.
253 ("\\(^\t\\| \\)\\(Patch\\(es\\)? by\\|Report\\(ed by\\| from\\)\\|Suggest\\(ed by\\|ion from\\)\\)"
252 2 'change-log-acknowledgement-face)) 254 2 'change-log-acknowledgement-face))
253 "Additional expressions to highlight in Change Log mode.") 255 "Additional expressions to highlight in Change Log mode.")
254 256
diff --git a/lisp/battery.el b/lisp/battery.el
index b8790450735..69bd68bb0b9 100644
--- a/lisp/battery.el
+++ b/lisp/battery.el
@@ -1,6 +1,6 @@
1;;; battery.el --- display battery status information 1;;; battery.el --- display battery status information
2 2
3;; Copyright (C) 1997, 1998, 2000, 2001, 2003, 2004 3;; Copyright (C) 1997, 1998, 2000, 2001, 2003, 2004, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Ralph Schleicher <rs@nunatak.allgaeu.org> 6;; Author: Ralph Schleicher <rs@nunatak.allgaeu.org>
@@ -108,20 +108,23 @@ The text being displayed in the echo area is controlled by the variables
108 "Battery status not available"))) 108 "Battery status not available")))
109 109
110;;;###autoload 110;;;###autoload
111(defun display-battery () 111(define-minor-mode display-battery-mode
112 "Display battery status information in the mode line. 112 "Display battery status information in the mode line.
113The text being displayed in the mode line is controlled by the variables 113The text being displayed in the mode line is controlled by the variables
114`battery-mode-line-format' and `battery-status-function'. 114`battery-mode-line-format' and `battery-status-function'.
115The mode line will be updated automatically every `battery-update-interval' 115The mode line will be updated automatically every `battery-update-interval'
116seconds." 116seconds."
117 (interactive) 117 :global t
118 (setq battery-mode-line-string "") 118 (setq battery-mode-line-string "")
119 (or global-mode-string (setq global-mode-string '(""))) 119 (or global-mode-string (setq global-mode-string '("")))
120 (add-to-list 'global-mode-string 'battery-mode-line-string t)
121 (and battery-update-timer (cancel-timer battery-update-timer)) 120 (and battery-update-timer (cancel-timer battery-update-timer))
122 (setq battery-update-timer (run-at-time nil battery-update-interval 121 (if (not display-battery-mode)
123 'battery-update-handler)) 122 (setq global-mode-string
124 (battery-update)) 123 (delq 'battery-mode-line-string global-mode-string))
124 (add-to-list 'global-mode-string 'battery-mode-line-string t)
125 (setq battery-update-timer (run-at-time nil battery-update-interval
126 'battery-update-handler))
127 (battery-update)))
125 128
126(defun battery-update-handler () 129(defun battery-update-handler ()
127 (battery-update) 130 (battery-update)
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index 067d233bf4a..db1acfcb145 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -308,10 +308,10 @@ This is not required to be present for user-written mode annotations.")
308 (calc-show-edit-buffer)) 308 (calc-show-edit-buffer))
309 309
310(defvar calc-original-buffer) 310(defvar calc-original-buffer)
311 311(defvar calc-edit-top)
312(defun calc-embedded-finish-edit (info) 312(defun calc-embedded-finish-edit (info)
313 (let ((buf (current-buffer)) 313 (let ((buf (current-buffer))
314 (str (buffer-substring (point) (point-max))) 314 (str (buffer-substring calc-edit-top (point-max)))
315 (start (point)) 315 (start (point))
316 pos) 316 pos)
317 (switch-to-buffer calc-original-buffer) 317 (switch-to-buffer calc-original-buffer)
@@ -885,7 +885,7 @@ The command \\[yank] can retrieve it from there."
885 (list 'calcFunc-assign 885 (list 'calcFunc-assign
886 (nth 1 x) 886 (nth 1 x)
887 (calc-embedded-subst (nth 2 x))) 887 (calc-embedded-subst (nth 2 x)))
888 (calc-normalize (math-evaluate-expr-rec (math-multi-subst-rec x)))))) 888 (calc-normalize (math-evaluate-expr-rec (math-multi-subst x nil nil))))))
889 889
890(defun calc-embedded-eval-get-var (var base) 890(defun calc-embedded-eval-get-var (var base)
891 (let ((entry base) 891 (let ((entry base)
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 89588b4ea74..280c3ca634b 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -1240,36 +1240,54 @@ calc-kill calc-kill-region calc-yank))))
1240 1240
1241(defun calc-reset (arg) 1241(defun calc-reset (arg)
1242 (interactive "P") 1242 (interactive "P")
1243 (save-excursion 1243 (setq arg (if arg (prefix-numeric-value arg) nil))
1244 (or (eq major-mode 'calc-mode) 1244 (cond
1245 (calc-create-buffer)) 1245 ((and
1246 (if calc-embedded-info 1246 calc-embedded-info
1247 (calc-embedded nil)) 1247 (equal (aref calc-embedded-info 0) (current-buffer))
1248 (or arg 1248 (<= (point) (aref calc-embedded-info 5))
1249 (setq calc-stack nil)) 1249 (>= (point) (aref calc-embedded-info 4)))
1250 (setq calc-undo-list nil 1250 (let ((cbuf (aref calc-embedded-info 1))
1251 calc-redo-list nil) 1251 (calc-embedded-quiet t))
1252 (let (calc-stack calc-user-parse-tables calc-standard-date-formats 1252 (save-window-excursion
1253 calc-invocation-macro) 1253 (calc-embedded nil)
1254 (mapcar (function (lambda (v) (set v nil))) calc-local-var-list) 1254 (set-buffer cbuf)
1255 (mapcar (function (lambda (v) (set (car v) (nth 1 v)))) 1255 (calc-reset arg))
1256 calc-mode-var-list)) 1256 (calc-embedded nil)))
1257 (calc-set-language nil nil t) 1257 ((eq major-mode 'calc-mode)
1258 (calc-mode) 1258 (save-excursion
1259 (calc-flush-caches t) 1259 (unless (and arg (> (abs arg) 0))
1260 (run-hooks 'calc-reset-hook)) 1260 (setq calc-stack nil))
1261 (calc-wrapper 1261 (setq calc-undo-list nil
1262 (let ((win (get-buffer-window (current-buffer)))) 1262 calc-redo-list nil)
1263 (calc-realign 0) 1263 (let (calc-stack calc-user-parse-tables calc-standard-date-formats
1264 (if win 1264 calc-invocation-macro)
1265 (let ((height (- (window-height win) 2))) 1265 (mapcar (function (lambda (v) (set v nil))) calc-local-var-list)
1266 (set-window-point win (point)) 1266 (if (and arg (<= arg 0))
1267 (or (= height calc-window-height) 1267 (calc-mode-var-list-restore-default-values)
1268 (let ((swin (selected-window))) 1268 (calc-mode-var-list-restore-saved-values)))
1269 (select-window win) 1269 (calc-set-language nil nil t)
1270 (enlarge-window (- calc-window-height height)) 1270 (calc-mode)
1271 (select-window swin))))))) 1271 (calc-flush-caches t)
1272 (message "(Calculator reset)")) 1272 (run-hooks 'calc-reset-hook))
1273 (calc-wrapper
1274 (let ((win (get-buffer-window (current-buffer))))
1275 (calc-realign 0)
1276 ;; Adjust the window height if the window is visible, but doesn't
1277 ;; take up the whole height of the frame.
1278 (if (and
1279 win
1280 (< (window-height win) (1- (frame-height))))
1281 (let ((height (- (window-height win) 2)))
1282 (set-window-point win (point))
1283 (or (= height calc-window-height)
1284 (let ((swin (selected-window)))
1285 (select-window win)
1286 (enlarge-window (- calc-window-height height))
1287 (select-window swin)))))))
1288 (message "(Calculator reset)"))
1289 (t
1290 (message "(Not inside a Calc buffer)"))))
1273 1291
1274;; What a pain; scroll-left behaves differently when called non-interactively. 1292;; What a pain; scroll-left behaves differently when called non-interactively.
1275(defun calc-scroll-left (n) 1293(defun calc-scroll-left (n)
diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el
index 087c42d295c..eb0cba79cd8 100644
--- a/lisp/calc/calc-help.el
+++ b/lisp/calc/calc-help.el
@@ -178,15 +178,15 @@ C-w Describe how there is no warranty for Calc."
178 (if (= (buffer-size) 0) 178 (if (= (buffer-size) 0)
179 (progn 179 (progn
180 (message "Reading Calc summary from manual...") 180 (message "Reading Calc summary from manual...")
181 (save-window-excursion 181 (require 'info nil t)
182 (save-excursion 182 (with-temp-buffer
183 (calc-info-goto-node "Summary") 183 (Info-mode)
184 (goto-char (point-min)) 184 (Info-goto-node "(Calc)Summary")
185 (forward-line 1) 185 (goto-char (point-min))
186 (copy-to-buffer "*Calc Summary*" 186 (forward-line 1)
187 (point) (point-max)) 187 (copy-to-buffer "*Calc Summary*"
188 (if Info-history 188 (point) (point-max)))
189 (Info-last)))))) 189 (setq buffer-read-only t)))
190 (goto-char (point-min)) 190 (goto-char (point-min))
191 (setq case-fold-search nil) 191 (setq case-fold-search nil)
192 (re-search-forward "^\\(.*\\)\\[\\.\\. a b") 192 (re-search-forward "^\\(.*\\)\\[\\.\\. a b")
diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el
index dfc488d49dd..389b52385b6 100644
--- a/lisp/calc/calc-mode.el
+++ b/lisp/calc/calc-mode.el
@@ -309,25 +309,22 @@
309(defun calc-settings-file-name (name &optional arg) 309(defun calc-settings-file-name (name &optional arg)
310 (interactive 310 (interactive
311 (list (read-file-name (format "Settings file name (normally %s): " 311 (list (read-file-name (format "Settings file name (normally %s): "
312 (abbreviate-file-name (or user-init-file 312 (abbreviate-file-name calc-settings-file)))
313 "~/.emacs"))))
314 current-prefix-arg)) 313 current-prefix-arg))
315 (calc-wrapper 314 (calc-wrapper
316 (setq arg (if arg (prefix-numeric-value arg) 0)) 315 (setq arg (if arg (prefix-numeric-value arg) 0))
317 (if (equal name "") 316 (if (string-equal (file-name-nondirectory name) "")
318 (message "Calc settings file is \"%s\"" calc-settings-file) 317 (message "Calc settings file is \"%s\"" calc-settings-file)
319 (if (< (math-abs arg) 2) 318 (if (< (math-abs arg) 2)
320 (let ((list calc-mode-var-list)) 319 (let ((list calc-mode-var-list))
321 (while list 320 (while list
322 (set (car (car list)) (nth 1 (car list))) 321 (set (car (car list)) (nth 1 (car list)))
323 (setq list (cdr list))))) 322 (setq list (cdr list)))))
324 ;; FIXME: we should use ~/.calc or so in order to avoid
325 ;; reexecuting ~/.emacs (it's not always idempotent) -cgw 2001.11.12
326 (setq calc-settings-file name) 323 (setq calc-settings-file name)
327 (or (and 324 (or (and
328 calc-settings-file 325 calc-settings-file
329 (string-match "\\.emacs" calc-settings-file) 326 (equal user-init-file calc-settings-file)
330 (> arg 0)) 327 (> arg 0))
331 (< arg 0) 328 (< arg 0)
332 (load name t) 329 (load name t)
333 (message "New file"))))) 330 (message "New file")))))
diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el
index b171010e220..b4901b5f8a0 100644
--- a/lisp/calc/calc-prog.el
+++ b/lisp/calc/calc-prog.el
@@ -684,21 +684,16 @@
684 (eq (car-safe (nth 3 cmd)) 'calc-execute-kbd-macro))) 684 (eq (car-safe (nth 3 cmd)) 'calc-execute-kbd-macro)))
685 (let* ((mac (elt (nth 1 (nth 3 cmd)) 1)) 685 (let* ((mac (elt (nth 1 (nth 3 cmd)) 1))
686 (str (edmacro-format-keys mac t)) 686 (str (edmacro-format-keys mac t))
687 (macbeg)
688 (kys (nth 3 (nth 3 cmd)))) 687 (kys (nth 3 (nth 3 cmd))))
689 (calc-edit-mode 688 (calc-edit-mode
690 (list 'calc-edit-macro-finish-edit cmdname kys) 689 (list 'calc-edit-macro-finish-edit cmdname kys)
691 t (format "Editing keyboard macro (%s, bound to %s).\n" 690 t (format (concat
692 cmdname kys)) 691 "Editing keyboard macro (%s, bound to %s).\n"
693 (goto-char (point-max)) 692 "Original keys: %s \n")
694 (insert "Original keys: " (elt (nth 1 (nth 3 cmd)) 0) "\n" ) 693 cmdname kys (elt (nth 1 (nth 3 cmd)) 0)))
695 (setq macbeg (point))
696 (insert str "\n") 694 (insert str "\n")
697 (calc-edit-format-macro-buffer) 695 (calc-edit-format-macro-buffer)
698 (calc-show-edit-buffer) 696 (calc-show-edit-buffer)))
699 (goto-char (point-min))
700 (search-forward "Original")
701 (forward-line 2)))
702 (t (let* ((func (calc-stack-command-p cmd)) 697 (t (let* ((func (calc-stack-command-p cmd))
703 (defn (and func 698 (defn (and func
704 (symbolp func) 699 (symbolp func)
@@ -714,18 +709,16 @@
714 nil 709 nil
715 (format "Editing formula (%s, %s, bound to %s).\n" 710 (format "Editing formula (%s, %s, bound to %s).\n"
716 intcmd algcmd kys)) 711 intcmd algcmd kys))
717 (insert (math-showing-full-precision 712 (insert (math-showing-full-precision
718 (math-format-nice-expr defn (frame-width))) 713 (math-format-nice-expr defn (frame-width)))
719 "\n")) 714 "\n"))
720 (calc-show-edit-buffer) 715 (calc-show-edit-buffer))
721 (goto-char (point-min))
722 (forward-line 2))
723 (error "That command's definition cannot be edited"))))))) 716 (error "That command's definition cannot be edited")))))))
724 717
725;; Formatting the macro buffer 718;; Formatting the macro buffer
726 719
727(defun calc-edit-macro-repeats () 720(defun calc-edit-macro-repeats ()
728 (goto-char (point-min)) 721 (goto-char calc-edit-top)
729 (while 722 (while
730 (re-search-forward "^\\([0-9]+\\)\\*" nil t) 723 (re-search-forward "^\\([0-9]+\\)\\*" nil t)
731 (setq num (string-to-int (match-string 1))) 724 (setq num (string-to-int (match-string 1)))
@@ -738,10 +731,10 @@
738 731
739(defun calc-edit-macro-adjust-buffer () 732(defun calc-edit-macro-adjust-buffer ()
740 (calc-edit-macro-repeats) 733 (calc-edit-macro-repeats)
741 (goto-char (point-min)) 734 (goto-char calc-edit-top)
742 (while (re-search-forward "^RET$" nil t) 735 (while (re-search-forward "^RET$" nil t)
743 (delete-char 1)) 736 (delete-char 1))
744 (goto-char (point-min)) 737 (goto-char calc-edit-top)
745 (while (and (re-search-forward "^$" nil t) 738 (while (and (re-search-forward "^$" nil t)
746 (not (= (point) (point-max)))) 739 (not (= (point) (point-max))))
747 (delete-char 1))) 740 (delete-char 1)))
@@ -869,11 +862,7 @@
869(defun calc-edit-format-macro-buffer () 862(defun calc-edit-format-macro-buffer ()
870 "Rewrite the Calc macro editing buffer." 863 "Rewrite the Calc macro editing buffer."
871 (calc-edit-macro-adjust-buffer) 864 (calc-edit-macro-adjust-buffer)
872 (goto-char (point-min)) 865 (goto-char calc-edit-top)
873 (search-forward "Original keys:")
874 (forward-line 1)
875 (insert "\n")
876 (skip-chars-forward " \t\n")
877 (let ((type (calc-edit-macro-command-type))) 866 (let ((type (calc-edit-macro-command-type)))
878 (while (not (string-equal type "")) 867 (while (not (string-equal type ""))
879 (cond 868 (cond
@@ -913,27 +902,25 @@
913 (calc-edit-macro-combine-var-name)) 902 (calc-edit-macro-combine-var-name))
914 (t (forward-line 1))) 903 (t (forward-line 1)))
915 (setq type (calc-edit-macro-command-type)))) 904 (setq type (calc-edit-macro-command-type))))
916 (goto-char (point-min))) 905 (goto-char calc-edit-top))
917 906
918;; Finish editing the macro 907;; Finish editing the macro
919 908
920(defun calc-edit-macro-pre-finish-edit () 909(defun calc-edit-macro-pre-finish-edit ()
921 (goto-char (point-min)) 910 (goto-char calc-edit-top)
922 (while (re-search-forward "\\(^\\| \\)RET\\($\\|\t\\| \\)" nil t) 911 (while (re-search-forward "\\(^\\| \\)RET\\($\\|\t\\| \\)" nil t)
923 (search-backward "RET") 912 (search-backward "RET")
924 (delete-char 3) 913 (delete-char 3)
925 (insert "<return>"))) 914 (insert "<return>")))
926 915
916(defvar calc-edit-top)
927(defun calc-edit-macro-finish-edit (cmdname key) 917(defun calc-edit-macro-finish-edit (cmdname key)
928 "Finish editing a Calc macro. 918 "Finish editing a Calc macro.
929Redefine the corresponding command." 919Redefine the corresponding command."
930 (interactive) 920 (interactive)
931 (let ((cmd (intern cmdname))) 921 (let ((cmd (intern cmdname)))
932 (calc-edit-macro-pre-finish-edit) 922 (calc-edit-macro-pre-finish-edit)
933 (goto-char (point-max)) 923 (let* ((str (buffer-substring calc-edit-top (point-max)))
934 (re-search-backward "^Original keys:")
935 (forward-line 1)
936 (let* ((str (buffer-substring (point) (point-max)))
937 (mac (edmacro-parse-keys str t))) 924 (mac (edmacro-parse-keys str t)))
938 (if (= (length mac) 0) 925 (if (= (length mac) 0)
939 (fmakunbound cmd) 926 (fmakunbound cmd)
@@ -946,10 +933,8 @@ Redefine the corresponding command."
946 'arg key))))))) 933 'arg key)))))))
947 934
948(defun calc-finish-formula-edit (func) 935(defun calc-finish-formula-edit (func)
949 (goto-char (point-min))
950 (forward-line 2)
951 (let ((buf (current-buffer)) 936 (let ((buf (current-buffer))
952 (str (buffer-substring (point) (point-max))) 937 (str (buffer-substring calc-edit-top (point-max)))
953 (start (point)) 938 (start (point))
954 (body (calc-valid-formula-func func))) 939 (body (calc-valid-formula-func func)))
955 (set-buffer calc-original-buffer) 940 (set-buffer calc-original-buffer)
diff --git a/lisp/calc/calc-sel.el b/lisp/calc/calc-sel.el
index 7b45814f1e7..4ae0df5d3ba 100644
--- a/lisp/calc/calc-sel.el
+++ b/lisp/calc/calc-sel.el
@@ -677,10 +677,11 @@
677;; The variable calc-edit-disp-trail is local to calc-edit-finish, 677;; The variable calc-edit-disp-trail is local to calc-edit-finish,
678;; in calc-yank.el. 678;; in calc-yank.el.
679(defvar calc-edit-disp-trail) 679(defvar calc-edit-disp-trail)
680(defvar calc-edit-top)
680 681
681(defun calc-finish-selection-edit (num sel reselect) 682(defun calc-finish-selection-edit (num sel reselect)
682 (let ((buf (current-buffer)) 683 (let ((buf (current-buffer))
683 (str (buffer-substring (point) (point-max))) 684 (str (buffer-substring calc-edit-top (point-max)))
684 (start (point))) 685 (start (point)))
685 (switch-to-buffer calc-original-buffer) 686 (switch-to-buffer calc-original-buffer)
686 (let ((val (math-read-expr str))) 687 (let ((val (math-read-expr str)))
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el
index d473b02c0a6..e8a3abfe958 100644
--- a/lisp/calc/calc-units.el
+++ b/lisp/calc/calc-units.el
@@ -30,6 +30,8 @@
30 30
31(require 'calc-ext) 31(require 'calc-ext)
32(require 'calc-macs) 32(require 'calc-macs)
33(eval-when-compile
34 (require 'calc-alg))
33 35
34;;; Units operations. 36;;; Units operations.
35 37
diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el
index 4c7d41e0f76..53d5946e073 100644
--- a/lisp/calc/calc-yank.el
+++ b/lisp/calc/calc-yank.el
@@ -430,6 +430,7 @@
430(defvar calc-edit-handler) 430(defvar calc-edit-handler)
431(defvar calc-restore-trail) 431(defvar calc-restore-trail)
432(defvar calc-allow-ret) 432(defvar calc-allow-ret)
433(defvar calc-edit-top)
433 434
434(defun calc-edit-mode (&optional handler allow-ret title) 435(defun calc-edit-mode (&optional handler allow-ret title)
435 "Calculator editing mode. Press RET, LFD, or C-c C-c to finish. 436 "Calculator editing mode. Press RET, LFD, or C-c C-c to finish.
@@ -464,10 +465,15 @@ To cancel the edit, simply kill the *Calc Edit* buffer."
464 (let ((calc-edit-handler nil)) 465 (let ((calc-edit-handler nil))
465 (calc-edit-finish t)) 466 (calc-edit-finish t))
466 (message "(Cancelled)")) t t) 467 (message "(Cancelled)")) t t)
467 (insert (or title title "Calc Edit Mode. ") 468 (insert (propertize
468 "Press `C-c C-c'" 469 (concat
469 (if allow-ret "" " or RET") 470 (or title title "Calc Edit Mode. ")
470 " to finish, `C-x k RET' to cancel.\n"))) 471 "Press `C-c C-c'"
472 (if allow-ret "" " or RET")
473 " to finish, `C-x k RET' to cancel.\n\n")
474 'font-lock-face 'italic 'read-only t 'rear-nonsticky t 'front-sticky t))
475 (make-local-variable 'calc-edit-top)
476 (setq calc-edit-top (point))))
471(put 'calc-edit-mode 'mode-class 'special) 477(put 'calc-edit-mode 'mode-class 'special)
472 478
473(defun calc-show-edit-buffer () 479(defun calc-show-edit-buffer ()
@@ -484,8 +490,7 @@ To cancel the edit, simply kill the *Calc Edit* buffer."
484 (if win 490 (if win
485 (delete-window win)))) 491 (delete-window win))))
486 (set-buffer-modified-p nil) 492 (set-buffer-modified-p nil)
487 (goto-char (point-min)) 493 (goto-char calc-edit-top)))
488 (forward-line 1)))
489 494
490(defun calc-edit-return () 495(defun calc-edit-return ()
491 (interactive) 496 (interactive)
@@ -519,9 +524,7 @@ To cancel the edit, simply kill the *Calc Edit* buffer."
519 (set-buffer original) 524 (set-buffer original)
520 (not (eq major-mode 'calc-mode)))) 525 (not (eq major-mode 'calc-mode))))
521 (error "Original calculator buffer has been corrupted"))) 526 (error "Original calculator buffer has been corrupted")))
522 (goto-char (point-min)) 527 (goto-char calc-edit-top)
523 (when (looking-at "Calc Edit\\|Editing ")
524 (forward-line 1))
525 (if (buffer-modified-p) 528 (if (buffer-modified-p)
526 (eval calc-edit-handler)) 529 (eval calc-edit-handler))
527 (if one-window 530 (if one-window
@@ -546,7 +549,7 @@ To cancel the edit, simply kill the *Calc Edit* buffer."
546 549
547(defun calc-finish-stack-edit (num) 550(defun calc-finish-stack-edit (num)
548 (let ((buf (current-buffer)) 551 (let ((buf (current-buffer))
549 (str (buffer-substring (point) (point-max))) 552 (str (buffer-substring calc-edit-top (point-max)))
550 (start (point)) 553 (start (point))
551 pos) 554 pos)
552 (if (and (integerp num) (> num 1)) 555 (if (and (integerp num) (> num 1))
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index f93c2e899b5..a578a8666b8 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -206,8 +206,8 @@
206(require 'calc-macs) 206(require 'calc-macs)
207 207
208;;;###autoload 208;;;###autoload
209(defvar calc-settings-file user-init-file 209(defvar calc-settings-file (convert-standard-filename "~/.calc.el")
210 "*File in which to record permanent settings; default is `user-init-file'.") 210 "*File in which to record permanent settings.")
211 211
212(defvar calc-bug-address "belanger@truman.edu" 212(defvar calc-bug-address "belanger@truman.edu"
213 "Address of the author of Calc, for use by `report-calc-bug'.") 213 "Address of the author of Calc, for use by `report-calc-bug'.")
@@ -241,128 +241,102 @@ scientific notation in calc-mode.")
241(defvar calc-loaded-settings-file nil 241(defvar calc-loaded-settings-file nil
242 "t if `calc-settings-file' has been loaded yet.") 242 "t if `calc-settings-file' has been loaded yet.")
243 243
244(defvar calc-always-load-extensions) 244
245(defvar calc-line-numbering) 245(defvar calc-mode-var-list '()
246(defvar calc-line-breaking) 246 "List of variables used in customizing GNU Calc.")
247(defvar calc-display-just) 247
248(defvar calc-display-origin) 248(defmacro defcalcmodevar (var defval &optional doc)
249(defvar calc-number-radix) 249 `(progn
250(defvar calc-leading-zeros) 250 (defvar ,var ,defval ,doc)
251(defvar calc-group-digits) 251 (add-to-list 'calc-mode-var-list (list (quote ,var) ,defval))))
252(defvar calc-group-char) 252
253(defvar calc-point-char) 253(defun calc-mode-var-list-restore-default-values ()
254(defvar calc-frac-format) 254 (mapcar (function (lambda (v) (set (car v) (nth 1 v))))
255(defvar calc-prefer-frac) 255 calc-mode-var-list))
256(defvar calc-hms-format) 256
257(defvar calc-date-format) 257(defun calc-mode-var-list-restore-saved-values ()
258(defvar calc-float-format) 258 (let ((newvarlist '()))
259(defvar calc-full-float-format) 259 (save-excursion
260(defvar calc-complex-format) 260 (let (pos
261(defvar calc-complex-mode) 261 (file (substitute-in-file-name calc-settings-file)))
262(defvar calc-infinite-mode) 262 (when (and
263(defvar calc-display-strings) 263 (file-regular-p file)
264(defvar calc-matrix-just) 264 (set-buffer (find-file-noselect file))
265(defvar calc-break-vectors) 265 (goto-char (point-min))
266(defvar calc-full-vectors) 266 (search-forward ";;; Mode settings stored by Calc" nil t)
267(defvar calc-full-trail-vectors) 267 (progn
268(defvar calc-vector-commas) 268 (forward-line 1)
269(defvar calc-vector-brackets) 269 (setq pos (point))
270(defvar calc-matrix-brackets) 270 (search-forward "\n;;; End of mode settings" nil t)))
271(defvar calc-language) 271 (beginning-of-line)
272(defvar calc-language-option) 272 (calc-mode-var-list-restore-default-values)
273(defvar calc-left-label) 273 (eval-region pos (point))
274(defvar calc-right-label) 274 (let ((varlist calc-mode-var-list))
275(defvar calc-word-size) 275 (while varlist
276(defvar calc-previous-modulo) 276 (let ((var (car varlist)))
277(defvar calc-simplify-mode) 277 (setq newvarlist
278(defvar calc-auto-recompute) 278 (cons (list (car var) (symbol-value (car var)))
279(defvar calc-display-raw) 279 newvarlist)))
280(defvar calc-internal-prec) 280 (setq varlist (cdr varlist)))))))
281(defvar calc-angle-mode) 281 (if newvarlist
282(defvar calc-algebraic-mode) 282 (mapcar (function (lambda (v) (set (car v) (nth 1 v))))
283(defvar calc-incomplete-algebraic-mode) 283 newvarlist)
284(defvar calc-symbolic-mode) 284 (calc-mode-var-list-restore-default-values))))
285(defvar calc-matrix-mode) 285
286(defvar calc-shift-prefix) 286(defcalcmodevar calc-always-load-extensions nil
287(defvar calc-window-height) 287 "If non-nil, load the calc-ext module automatically when calc is loaded.")
288(defvar calc-display-trail) 288
289(defvar calc-show-selections) 289(defcalcmodevar calc-line-numbering t
290(defvar calc-use-selections) 290 "If non-nil, display line numbers in Calculator stack.")
291(defvar calc-assoc-selections) 291
292(defvar calc-display-working-message) 292(defcalcmodevar calc-line-breaking t
293(defvar calc-auto-why) 293 "If non-nil, break long values across multiple lines in Calculator stack.")
294(defvar calc-timing) 294
295(defvar calc-mode-save-mode) 295(defcalcmodevar calc-display-just nil
296(defvar calc-standard-date-formats) 296 "If nil, stack display is left-justified.
297(defvar calc-autorange-units)
298(defvar calc-was-keypad-mode)
299(defvar calc-full-mode)
300(defvar calc-user-parse-tables)
301(defvar calc-gnuplot-default-device)
302(defvar calc-gnuplot-default-output)
303(defvar calc-gnuplot-print-device)
304(defvar calc-gnuplot-print-output)
305(defvar calc-gnuplot-geometry)
306(defvar calc-graph-default-resolution)
307(defvar calc-graph-default-resolution-3d)
308(defvar calc-invocation-macro)
309(defvar calc-show-banner)
310
311(defconst calc-mode-var-list '(
312 (calc-always-load-extensions nil
313 "If non-nil, load the calc-ext module automatically when calc is loaded.")
314
315 (calc-line-numbering t
316 "If non-nil, display line numbers in Calculator stack.")
317
318 (calc-line-breaking t
319 "If non-nil, break long values across multiple lines in Calculator stack.")
320
321 (calc-display-just nil
322 "If nil, stack display is left-justified.
323If `right', stack display is right-justified. 297If `right', stack display is right-justified.
324If `center', stack display is centered.") 298If `center', stack display is centered.")
325 299
326 (calc-display-origin nil 300(defcalcmodevar calc-display-origin nil
327 "Horizontal origin of displayed stack entries. 301 "Horizontal origin of displayed stack entries.
328In left-justified mode, this is effectively indentation. (Default 0). 302In left-justified mode, this is effectively indentation. (Default 0).
329In right-justified mode, this is effectively window width. 303In right-justified mode, this is effectively window width.
330In centered mode, center of stack entry is placed here.") 304In centered mode, center of stack entry is placed here.")
331 305
332 (calc-number-radix 10 306(defcalcmodevar calc-number-radix 10
333 "Radix for entry and display of numbers in calc-mode, 2-36.") 307 "Radix for entry and display of numbers in calc-mode, 2-36.")
334 308
335 (calc-leading-zeros nil 309(defcalcmodevar calc-leading-zeros nil
336 "If non-nil, leading zeros are provided to pad integers to calc-word-size.") 310 "If non-nil, leading zeros are provided to pad integers to calc-word-size.")
337 311
338 (calc-group-digits nil 312(defcalcmodevar calc-group-digits nil
339 "If non-nil, group digits in large displayed integers by inserting spaces. 313 "If non-nil, group digits in large displayed integers by inserting spaces.
340If an integer, group that many digits at a time. 314If an integer, group that many digits at a time.
341If t, use 4 for binary and hex, 3 otherwise.") 315If t, use 4 for binary and hex, 3 otherwise.")
342 316
343 (calc-group-char "," 317(defcalcmodevar calc-group-char ","
344 "The character (in the form of a string) to be used for grouping digits. 318 "The character (in the form of a string) to be used for grouping digits.
345This is used only when calc-group-digits mode is on.") 319This is used only when calc-group-digits mode is on.")
346 320
347 (calc-point-char "." 321(defcalcmodevar calc-point-char "."
348 "The character (in the form of a string) to be used as a decimal point.") 322 "The character (in the form of a string) to be used as a decimal point.")
349 323
350 (calc-frac-format (":" nil) 324(defcalcmodevar calc-frac-format '(":" nil)
351 "Format of displayed fractions; a string of one or two of \":\" or \"/\".") 325 "Format of displayed fractions; a string of one or two of \":\" or \"/\".")
352 326
353 (calc-prefer-frac nil 327(defcalcmodevar calc-prefer-frac nil
354 "If non-nil, prefer fractional over floating-point results.") 328 "If non-nil, prefer fractional over floating-point results.")
355 329
356 (calc-hms-format "%s@ %s' %s\"" 330(defcalcmodevar calc-hms-format "%s@ %s' %s\""
357 "Format of displayed hours-minutes-seconds angles, a format string. 331 "Format of displayed hours-minutes-seconds angles, a format string.
358String must contain three %s marks for hours, minutes, seconds respectively.") 332String must contain three %s marks for hours, minutes, seconds respectively.")
359 333
360 (calc-date-format ((H ":" mm C SS pp " ") 334(defcalcmodevar calc-date-format '((H ":" mm C SS pp " ")
361 Www " " Mmm " " D ", " YYYY) 335 Www " " Mmm " " D ", " YYYY)
362 "Format of displayed date forms.") 336 "Format of displayed date forms.")
363 337
364 (calc-float-format (float 0) 338(defcalcmodevar calc-float-format '(float 0)
365 "Format to use for display of floating-point numbers in calc-mode. 339 "Format to use for display of floating-point numbers in calc-mode.
366Must be a list of one of the following forms: 340Must be a list of one of the following forms:
367 (float 0) Floating point format, display full precision. 341 (float 0) Floating point format, display full precision.
368 (float N) N > 0: Floating point format, at most N significant figures. 342 (float N) N > 0: Floating point format, at most N significant figures.
@@ -375,54 +349,54 @@ Must be a list of one of the following forms:
375 (eng N) N > 0: Engineering notation, N significant figures. 349 (eng N) N > 0: Engineering notation, N significant figures.
376 (eng -N) -N < 0: Engineering notation, calc-internal-prec - N figs.") 350 (eng -N) -N < 0: Engineering notation, calc-internal-prec - N figs.")
377 351
378 (calc-full-float-format (float 0) 352(defcalcmodevar calc-full-float-format '(float 0)
379 "Format to use when full precision must be displayed.") 353 "Format to use when full precision must be displayed.")
380 354
381 (calc-complex-format nil 355(defcalcmodevar calc-complex-format nil
382 "Format to use for display of complex numbers in calc-mode. Must be one of: 356 "Format to use for display of complex numbers in calc-mode. Must be one of:
383 nil Use (x, y) form. 357 nil Use (x, y) form.
384 i Use x + yi form. 358 i Use x + yi form.
385 j Use x + yj form.") 359 j Use x + yj form.")
386 360
387 (calc-complex-mode cplx 361(defcalcmodevar calc-complex-mode 'cplx
388 "Preferred form, either `cplx' or `polar', for complex numbers.") 362 "Preferred form, either `cplx' or `polar', for complex numbers.")
389 363
390 (calc-infinite-mode nil 364(defcalcmodevar calc-infinite-mode nil
391 "If nil, 1 / 0 is left unsimplified. 365 "If nil, 1 / 0 is left unsimplified.
392If 0, 1 / 0 is changed to inf (zeros are considered positive). 366If 0, 1 / 0 is changed to inf (zeros are considered positive).
393Otherwise, 1 / 0 is changed to uinf (undirected infinity).") 367Otherwise, 1 / 0 is changed to uinf (undirected infinity).")
394 368
395 (calc-display-strings nil 369(defcalcmodevar calc-display-strings nil
396 "If non-nil, display vectors of byte-sized integers as strings.") 370 "If non-nil, display vectors of byte-sized integers as strings.")
397 371
398 (calc-matrix-just center 372(defcalcmodevar calc-matrix-just 'center
399 "If nil, vector elements are left-justified. 373 "If nil, vector elements are left-justified.
400If `right', vector elements are right-justified. 374If `right', vector elements are right-justified.
401If `center', vector elements are centered.") 375If `center', vector elements are centered.")
402 376
403 (calc-break-vectors nil 377(defcalcmodevar calc-break-vectors nil
404 "If non-nil, display vectors one element per line.") 378 "If non-nil, display vectors one element per line.")
405 379
406 (calc-full-vectors t 380(defcalcmodevar calc-full-vectors t
407 "If non-nil, display long vectors in full. If nil, use abbreviated form.") 381 "If non-nil, display long vectors in full. If nil, use abbreviated form.")
408 382
409 (calc-full-trail-vectors t 383(defcalcmodevar calc-full-trail-vectors t
410 "If non-nil, display long vectors in full in the trail.") 384 "If non-nil, display long vectors in full in the trail.")
411 385
412 (calc-vector-commas "," 386(defcalcmodevar calc-vector-commas ","
413 "If non-nil, separate elements of displayed vectors with this string.") 387 "If non-nil, separate elements of displayed vectors with this string.")
414 388
415 (calc-vector-brackets "[]" 389(defcalcmodevar calc-vector-brackets "[]"
416 "If non-nil, surround displayed vectors with these characters.") 390 "If non-nil, surround displayed vectors with these characters.")
417 391
418 (calc-matrix-brackets (R O) 392(defcalcmodevar calc-matrix-brackets '(R O)
419 "A list of code-letter symbols that control \"big\" matrix display. 393 "A list of code-letter symbols that control \"big\" matrix display.
420If `R' is present, display inner brackets for matrices. 394If `R' is present, display inner brackets for matrices.
421If `O' is present, display outer brackets for matrices (above/below). 395If `O' is present, display outer brackets for matrices (above/below).
422If `C' is present, display outer brackets for matrices (centered).") 396If `C' is present, display outer brackets for matrices (centered).")
423 397
424 (calc-language nil 398(defcalcmodevar calc-language nil
425 "Language or format for entry and display of stack values. Must be one of: 399 "Language or format for entry and display of stack values. Must be one of:
426 nil Use standard Calc notation. 400 nil Use standard Calc notation.
427 flat Use standard Calc notation, one-line format. 401 flat Use standard Calc notation, one-line format.
428 big Display formulas in 2-d notation (enter w/std notation). 402 big Display formulas in 2-d notation (enter w/std notation).
@@ -435,23 +409,23 @@ If `C' is present, display outer brackets for matrices (centered).")
435 math Use Mathematica(tm) notation. 409 math Use Mathematica(tm) notation.
436 maple Use Maple notation.") 410 maple Use Maple notation.")
437 411
438 (calc-language-option nil 412(defcalcmodevar calc-language-option nil
439 "Numeric prefix argument for the command that set `calc-language'.") 413 "Numeric prefix argument for the command that set `calc-language'.")
440 414
441 (calc-left-label "" 415(defcalcmodevar calc-left-label ""
442 "Label to display at left of formula.") 416 "Label to display at left of formula.")
443 417
444 (calc-right-label "" 418(defcalcmodevar calc-right-label ""
445 "Label to display at right of formula.") 419 "Label to display at right of formula.")
446 420
447 (calc-word-size 32 421(defcalcmodevar calc-word-size 32
448 "Minimum number of bits per word, if any, for binary operations in calc-mode.") 422 "Minimum number of bits per word, if any, for binary operations in calc-mode.")
449 423
450 (calc-previous-modulo nil 424(defcalcmodevar calc-previous-modulo nil
451 "Most recently used value of M in a modulo form.") 425 "Most recently used value of M in a modulo form.")
452 426
453 (calc-simplify-mode nil 427(defcalcmodevar calc-simplify-mode nil
454 "Type of simplification applied to results. 428 "Type of simplification applied to results.
455If `none', results are not simplified when pushed on the stack. 429If `none', results are not simplified when pushed on the stack.
456If `num', functions are simplified only when args are constant. 430If `num', functions are simplified only when args are constant.
457If nil, only fast simplifications are applied. 431If nil, only fast simplifications are applied.
@@ -460,69 +434,69 @@ If `alg', `math-simplify' is applied.
460If `ext', `math-simplify-extended' is applied. 434If `ext', `math-simplify-extended' is applied.
461If `units', `math-simplify-units' is applied.") 435If `units', `math-simplify-units' is applied.")
462 436
463 (calc-auto-recompute t 437(defcalcmodevar calc-auto-recompute t
464 "If non-nil, recompute evalto's automatically when necessary.") 438 "If non-nil, recompute evalto's automatically when necessary.")
465 439
466 (calc-display-raw nil 440(defcalcmodevar calc-display-raw nil
467 "If non-nil, display shows unformatted Lisp exprs. (For debugging)") 441 "If non-nil, display shows unformatted Lisp exprs.(defcalcmodevar For debugging)")
468 442
469 (calc-internal-prec 12 443(defcalcmodevar calc-internal-prec 12
470 "Number of digits of internal precision for calc-mode calculations.") 444 "Number of digits of internal precision for calc-mode calculations.")
471 445
472 (calc-angle-mode deg 446(defcalcmodevar calc-angle-mode 'deg
473 "If deg, angles are in degrees; if rad, angles are in radians. 447 "If deg, angles are in degrees; if rad, angles are in radians.
474If hms, angles are in degrees-minutes-seconds.") 448If hms, angles are in degrees-minutes-seconds.")
475 449
476 (calc-algebraic-mode nil 450(defcalcmodevar calc-algebraic-mode nil
477 "If non-nil, numeric entry accepts whole algebraic expressions. 451 "If non-nil, numeric entry accepts whole algebraic expressions.
478If nil, algebraic expressions must be preceded by \"'\".") 452If nil, algebraic expressions must be preceded by \"'\".")
479 453
480 (calc-incomplete-algebraic-mode nil 454(defcalcmodevar calc-incomplete-algebraic-mode nil
481 "Like calc-algebraic-mode except only affects ( and [ keys.") 455 "Like calc-algebraic-mode except only affects ( and [ keys.")
482 456
483 (calc-symbolic-mode nil 457(defcalcmodevar calc-symbolic-mode nil
484 "If non-nil, inexact numeric computations like sqrt(2) are postponed. 458 "If non-nil, inexact numeric computations like sqrt(2) are postponed.
485If nil, computations on numbers always yield numbers where possible.") 459If nil, computations on numbers always yield numbers where possible.")
486 460
487 (calc-matrix-mode nil 461(defcalcmodevar calc-matrix-mode nil
488 "If `matrix', variables are assumed to be matrix-valued. 462 "If `matrix', variables are assumed to be matrix-valued.
489If a number, variables are assumed to be NxN matrices. 463If a number, variables are assumed to be NxN matrices.
490If `scalar', variables are assumed to be scalar-valued. 464If `scalar', variables are assumed to be scalar-valued.
491If nil, symbolic math routines make no assumptions about variables.") 465If nil, symbolic math routines make no assumptions about variables.")
492 466
493 (calc-shift-prefix nil 467(defcalcmodevar calc-shift-prefix nil
494 "If non-nil, shifted letter keys are prefix keys rather than normal meanings.") 468 "If non-nil, shifted letter keys are prefix keys rather than normal meanings.")
495 469
496 (calc-window-height 7 470(defcalcmodevar calc-window-height 7
497 "Initial height of Calculator window.") 471 "Initial height of Calculator window.")
498 472
499 (calc-display-trail t 473(defcalcmodevar calc-display-trail t
500 "If non-nil, M-x calc creates a window to display Calculator trail.") 474 "If non-nil, M-x calc creates a window to display Calculator trail.")
501 475
502 (calc-show-selections t 476(defcalcmodevar calc-show-selections t
503 "If non-nil, selected sub-formulas are shown by obscuring rest of formula. 477 "If non-nil, selected sub-formulas are shown by obscuring rest of formula.
504If nil, selected sub-formulas are highlighted by obscuring the sub-formulas.") 478If nil, selected sub-formulas are highlighted by obscuring the sub-formulas.")
505 479
506 (calc-use-selections t 480(defcalcmodevar calc-use-selections t
507 "If non-nil, commands operate only on selected portions of formulas. 481 "If non-nil, commands operate only on selected portions of formulas.
508If nil, selections displayed but ignored.") 482If nil, selections displayed but ignored.")
509 483
510 (calc-assoc-selections t 484(defcalcmodevar calc-assoc-selections t
511 "If non-nil, selection hides deep structure of associative formulas.") 485 "If non-nil, selection hides deep structure of associative formulas.")
512 486
513 (calc-display-working-message lots 487(defcalcmodevar calc-display-working-message 'lots
514 "If non-nil, display \"Working...\" for potentially slow Calculator commands.") 488 "If non-nil, display \"Working...\" for potentially slow Calculator commands.")
515 489
516 (calc-auto-why maybe 490(defcalcmodevar calc-auto-why 'maybe
517 "If non-nil, automatically execute a \"why\" command to explain odd results.") 491 "If non-nil, automatically execute a \"why\" command to explain odd results.")
518 492
519 (calc-timing nil 493(defcalcmodevar calc-timing nil
520 "If non-nil, display timing information on each slow command.") 494 "If non-nil, display timing information on each slow command.")
521 495
522 (calc-mode-save-mode local) 496(defcalcmodevar calc-mode-save-mode 'local)
523 497
524 (calc-standard-date-formats 498(defcalcmodevar calc-standard-date-formats
525 ("N" 499 '("N"
526 "<H:mm:SSpp >Www Mmm D, YYYY" 500 "<H:mm:SSpp >Www Mmm D, YYYY"
527 "D Mmm YYYY<, h:mm:SS>" 501 "D Mmm YYYY<, h:mm:SS>"
528 "Www Mmm BD< hh:mm:ss> YYYY" 502 "Www Mmm BD< hh:mm:ss> YYYY"
@@ -533,40 +507,32 @@ If nil, selections displayed but ignored.")
533 "j<, h:mm:SS>" 507 "j<, h:mm:SS>"
534 "YYddd< hh:mm:ss>")) 508 "YYddd< hh:mm:ss>"))
535 509
536 (calc-autorange-units nil) 510(defcalcmodevar calc-autorange-units nil)
537 511
538 (calc-was-keypad-mode nil) 512(defcalcmodevar calc-was-keypad-mode nil)
539 513
540 (calc-full-mode nil) 514(defcalcmodevar calc-full-mode nil)
541 515
542 (calc-user-parse-tables nil) 516(defcalcmodevar calc-user-parse-tables nil)
543 517
544 (calc-gnuplot-default-device "default") 518(defcalcmodevar calc-gnuplot-default-device "default")
545 519
546 (calc-gnuplot-default-output "STDOUT") 520(defcalcmodevar calc-gnuplot-default-output "STDOUT")
547 521
548 (calc-gnuplot-print-device "postscript") 522(defcalcmodevar calc-gnuplot-print-device "postscript")
549 523
550 (calc-gnuplot-print-output "auto") 524(defcalcmodevar calc-gnuplot-print-output "auto")
551 525
552 (calc-gnuplot-geometry nil) 526(defcalcmodevar calc-gnuplot-geometry nil)
553 527
554 (calc-graph-default-resolution 15) 528(defcalcmodevar calc-graph-default-resolution 15)
555 529
556 (calc-graph-default-resolution-3d 5) 530(defcalcmodevar calc-graph-default-resolution-3d 5)
557 531
558 (calc-invocation-macro nil) 532(defcalcmodevar calc-invocation-macro nil)
559
560 (calc-show-banner t
561 "*If non-nil, show a friendly greeting above the stack."))
562 "List of variables (and default values) used in customizing GNU Calc.")
563 533
564(mapcar (function (lambda (v) 534(defcalcmodevar calc-show-banner t
565 (or (boundp (car v)) 535 "*If non-nil, show a friendly greeting above the stack.")
566 (set (car v) (nth 1 v)))
567 (if (nth 2 v)
568 (put (car v) 'variable-documentation (nth 2 v)))))
569 calc-mode-var-list)
570 536
571(defconst calc-local-var-list '(calc-stack 537(defconst calc-local-var-list '(calc-stack
572 calc-stack-top 538 calc-stack-top
@@ -1028,7 +994,7 @@ Notations: 3.14e6 3.14 * 10^6
1028 (equal calc-settings-file user-init-file) 994 (equal calc-settings-file user-init-file)
1029 (progn 995 (progn
1030 (setq calc-loaded-settings-file t) 996 (setq calc-loaded-settings-file t)
1031 (load calc-settings-file t))) ; t = missing-ok 997 (load (file-name-sans-extension calc-settings-file) t))) ; t = missing-ok
1032 (let ((p command-line-args)) 998 (let ((p command-line-args))
1033 (while p 999 (while p
1034 (and (equal (car p) "-f") 1000 (and (equal (car p) "-f")
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 5f3ffc6f8bf..8a60163181a 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -243,7 +243,6 @@
243 243
244(defgroup customize '((widgets custom-group)) 244(defgroup customize '((widgets custom-group))
245 "Customization of the Customization support." 245 "Customization of the Customization support."
246 :link '(custom-manual "(elisp)Customization")
247 :prefix "custom-" 246 :prefix "custom-"
248 :group 'help) 247 :group 'help)
249 248
@@ -3699,35 +3698,57 @@ The default is nil, which means to use your init file
3699as specified by `user-init-file'. If the value is not nil, 3698as specified by `user-init-file'. If the value is not nil,
3700it should be an absolute file name. 3699it should be an absolute file name.
3701 3700
3702To make this feature work, you'll need to put something in your 3701You can set this option through Custom, if you carefully read the
3703init file to specify the value of `custom-file'. Just 3702last paragraph below. However, usually it is simpler to write
3704customizing the variable won't suffice, because Emacs won't know 3703something like the following in your init file:
3705which file to load unless the init file sets `custom-file'. 3704
3706 3705\(setq custom-file \"~/.emacs-custom.el\")
3707When you change this variable, look in the previous custom file 3706\(load custom-file)
3708\(usually your init file) for the forms `(custom-set-variables ...)' 3707
3709and `(custom-set-faces ...)', and copy them (whichever ones you find) 3708Note that both lines are necessary: the first line tells Custom to
3710to the new custom file. This will preserve your existing customizations." 3709save all customizations in this file, but does not load it.
3711 :type '(choice (const :tag "Your Emacs init file" nil) file) 3710
3711When you change this variable outside Custom, look in the
3712previous custom file \(usually your init file) for the
3713forms `(custom-set-variables ...)' and `(custom-set-faces ...)',
3714and copy them (whichever ones you find) to the new custom file.
3715This will preserve your existing customizations.
3716
3717If you save this option using Custom, Custom will write all
3718currently saved customizations, including the new one for this
3719option itself, into the file you specify, overwriting any
3720`custom-set-variables' and `custom-set-faces' forms already
3721present in that file. It will not delete any customizations from
3722the old custom file. You should do that manually if that is what you
3723want. You also have to put something like `\(load \"CUSTOM-FILE\")
3724in your init file, where CUSTOM-FILE is the actual name of the
3725file. Otherwise, Emacs will not load the file when it starts up,
3726and hence will not set `custom-file' to that file either."
3727 :type '(choice (const :tag "Your Emacs init file" nil)
3728 (file :format "%t:%v%d"
3729 :doc
3730 "Please read entire docstring below before setting \
3731this through Custom.
3732Click om \"More\" \(or position point there and press RETURN)
3733if only the first line of the docstring is shown."))
3712 :group 'customize) 3734 :group 'customize)
3713 3735
3714(defun custom-file () 3736(defun custom-file ()
3715 "Return the file name for saving customizations." 3737 "Return the file name for saving customizations."
3716 (setq custom-file 3738 (or custom-file
3717 (or custom-file 3739 (let ((user-init-file user-init-file)
3718 (let ((user-init-file user-init-file) 3740 (default-init-file
3719 (default-init-file 3741 (if (eq system-type 'ms-dos) "~/_emacs" "~/.emacs")))
3720 (if (eq system-type 'ms-dos) "~/_emacs" "~/.emacs"))) 3742 (when (null user-init-file)
3721 (when (null user-init-file) 3743 (if (or (file-exists-p default-init-file)
3722 (if (or (file-exists-p default-init-file) 3744 (and (eq system-type 'windows-nt)
3723 (and (eq system-type 'windows-nt) 3745 (file-exists-p "~/_emacs")))
3724 (file-exists-p "~/_emacs"))) 3746 ;; Started with -q, i.e. the file containing
3725 ;; Started with -q, i.e. the file containing 3747 ;; Custom settings hasn't been read. Saving
3726 ;; Custom settings hasn't been read. Saving 3748 ;; settings there would overwrite other settings.
3727 ;; settings there would overwrite other settings. 3749 (error "Saving settings from \"emacs -q\" would overwrite existing customizations"))
3728 (error "Saving settings from \"emacs -q\" would overwrite existing customizations")) 3750 (setq user-init-file default-init-file))
3729 (setq user-init-file default-init-file)) 3751 user-init-file)))
3730 user-init-file))))
3731 3752
3732(defun custom-save-delete (symbol) 3753(defun custom-save-delete (symbol)
3733 "Visit `custom-file' and delete all calls to SYMBOL from it. 3754 "Visit `custom-file' and delete all calls to SYMBOL from it.
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index 0f3f6018cfc..33c8c995a4c 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -50,6 +50,7 @@
50 (make-face-x-resource-internal face)))) 50 (make-face-x-resource-internal face))))
51 ;; Don't record SPEC until we see it causes no errors. 51 ;; Don't record SPEC until we see it causes no errors.
52 (put face 'face-defface-spec spec) 52 (put face 'face-defface-spec spec)
53 (push (cons 'defface face) current-load-list)
53 (when (and doc (null (face-documentation face))) 54 (when (and doc (null (face-documentation face)))
54 (set-face-documentation face (purecopy doc))) 55 (set-face-documentation face (purecopy doc)))
55 (custom-handle-all-keywords face args 'custom-face) 56 (custom-handle-all-keywords face args 'custom-face)
diff --git a/lisp/custom.el b/lisp/custom.el
index 2ddd7ceb943..e7aba88f72a 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -168,7 +168,7 @@ set to nil, as the value is no longer rogue."
168 ;; Do the actual initialization. 168 ;; Do the actual initialization.
169 (unless custom-dont-initialize 169 (unless custom-dont-initialize
170 (funcall initialize symbol default))) 170 (funcall initialize symbol default)))
171 (push (cons 'defvar symbol) current-load-list) 171 (push symbol current-load-list)
172 (run-hooks 'custom-define-hook) 172 (run-hooks 'custom-define-hook)
173 symbol) 173 symbol)
174 174
@@ -710,44 +710,46 @@ in every Customization buffer.")
710(put 'custom-local-buffer 'permanent-local t) 710(put 'custom-local-buffer 'permanent-local t)
711 711
712(defun custom-set-variables (&rest args) 712(defun custom-set-variables (&rest args)
713 "Initialize variables according to user preferences. 713 "Install user customizations of variable values specified in ARGS.
714The settings are registered as theme `user'. 714These settings are registered as theme `user'.
715The arguments should each be a list of the form: 715The arguments should each be a list of the form:
716 716
717 (SYMBOL VALUE [NOW [REQUEST [COMMENT]]]) 717 (SYMBOL EXP [NOW [REQUEST [COMMENT]]])
718 718
719The unevaluated VALUE is stored as the saved value for SYMBOL. 719This stores EXP (without evaluating it) as the saved value for SYMBOL.
720If NOW is present and non-nil, VALUE is also evaluated and bound as 720If NOW is present and non-nil, then also evaluate EXP and set
721the default value for the SYMBOL. 721the default value for the SYMBOL to the value of EXP.
722 722
723REQUEST is a list of features we must 'require for SYMBOL. 723REQUEST is a list of features we must require in order to
724handle SYMBOL properly.
724COMMENT is a comment string about SYMBOL." 725COMMENT is a comment string about SYMBOL."
725 (apply 'custom-theme-set-variables 'user args)) 726 (apply 'custom-theme-set-variables 'user args))
726 727
727(defun custom-theme-set-variables (theme &rest args) 728(defun custom-theme-set-variables (theme &rest args)
728 "Initialize variables according to settings specified by args. 729 "Initialize variables for theme THEME according to settings in ARGS.
729Records the settings as belonging to THEME. 730Each of the arguments in ARGS should be a list of this form:
730 731
731The arguments should be a list where each entry has the form: 732 (SYMBOL EXP [NOW [REQUEST [COMMENT]]])
732 733
733 (SYMBOL VALUE [NOW [REQUEST [COMMENT]]]) 734This stores EXP (without evaluating it) as the saved value for SYMBOL.
735If NOW is present and non-nil, then also evaluate EXP and set
736the default value for the SYMBOL to the value of EXP.
734 737
735The unevaluated VALUE is stored as the saved value for SYMBOL. 738REQUEST is a list of features we must require in order to
736If NOW is present and non-nil, VALUE is also evaluated and bound as 739handle SYMBOL properly.
737the default value for the SYMBOL.
738REQUEST is a list of features we must 'require for SYMBOL.
739COMMENT is a comment string about SYMBOL. 740COMMENT is a comment string about SYMBOL.
740 741
741Several properties of THEME and SYMBOL are used in the process: 742Several properties of THEME and SYMBOL are used in the process:
742 743
743If THEME property `theme-immediate' is non-nil, this is equivalent of 744If THEME's property `theme-immediate' is non-nil, this is equivalent of
744providing the NOW argument to all symbols in the argument list: SYMBOL 745providing the NOW argument to all symbols in the argument list:
745is bound to the evaluated VALUE. The only difference is SYMBOL property 746evaluate each EXP and set the corresponding SYMBOL. However,
747there's a difference in the handling of SYMBOL's property
746`force-value': if NOW is non-nil, SYMBOL's property `force-value' is set to 748`force-value': if NOW is non-nil, SYMBOL's property `force-value' is set to
747the symbol `rogue', else if THEME's property `theme-immediate' is non-nil, 749the symbol `rogue', else if THEME's property `theme-immediate' is non-nil,
748FACE's property `force-face' is set to the symbol `immediate'. 750SYMBOL's property `force-value' is set to the symbol `immediate'.
749 751
750VALUE itself is saved unevaluated as SYMBOL property `saved-value' and 752EXP itself is saved unevaluated as SYMBOL property `saved-value' and
751in SYMBOL's list property `theme-value' \(using `custom-push-theme')." 753in SYMBOL's list property `theme-value' \(using `custom-push-theme')."
752 (custom-check-theme theme) 754 (custom-check-theme theme)
753 (let ((immediate (get theme 'theme-immediate))) 755 (let ((immediate (get theme 'theme-immediate)))
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 50ee9d03b7e..163122a2d14 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1,6 +1,6 @@
1;;; desktop.el --- save partial status of Emacs when killed 1;;; desktop.el --- save partial status of Emacs when killed
2 2
3;; Copyright (C) 1993, 1994, 1995, 1997, 2000, 2001 3;; Copyright (C) 1993, 1994, 1995, 1997, 2000, 2001, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Morten Welinder <terra@diku.dk> 6;; Author: Morten Welinder <terra@diku.dk>
@@ -198,7 +198,7 @@ Feature: Saving `kill-ring' implies saving `kill-ring-yank-pointer'."
198 search-ring-yank-pointer 198 search-ring-yank-pointer
199 regexp-search-ring 199 regexp-search-ring
200 regexp-search-ring-yank-pointer) 200 regexp-search-ring-yank-pointer)
201 "List of global variables to clear by `desktop-clear'. 201 "List of global variables that `desktop-clear' will clear.
202An element may be variable name (a symbol) or a cons cell of the form 202An element may be variable name (a symbol) or a cons cell of the form
203\(VAR . FORM). Symbols are set to nil and for cons cells VAR is set 203\(VAR . FORM). Symbols are set to nil and for cons cells VAR is set
204to the value obtained by evaluateing FORM." 204to the value obtained by evaluateing FORM."
@@ -267,6 +267,27 @@ Possible values are:
267 :group 'desktop 267 :group 'desktop
268 :version "21.4") 268 :version "21.4")
269 269
270(defcustom desktop-restore-eager t
271 "Number of buffers to restore immediately.
272Remaining buffers are restored lazily (when Emacs is idle).
273If value is t, all buffers are restored immediately."
274 :type '(choice (const t) integer)
275 :group 'desktop
276 :version "21.4")
277
278(defcustom desktop-lazy-verbose t
279 "Verbose reporting of lazily created buffers."
280 :type 'boolean
281 :group 'desktop
282 :version "21.4")
283
284(defcustom desktop-lazy-idle-delay 5
285 "Idle delay before starting to create buffers.
286See `desktop-restore-eager'."
287 :type 'integer
288 :group 'desktop
289 :version "21.4")
290
270;;;###autoload 291;;;###autoload
271(defvar desktop-save-buffer nil 292(defvar desktop-save-buffer nil
272 "When non-nil, save buffer status in desktop file. 293 "When non-nil, save buffer status in desktop file.
@@ -365,6 +386,7 @@ This kills all buffers except for internal ones and those matching
365`desktop-clear-preserve-buffers'. Furthermore, it clears the 386`desktop-clear-preserve-buffers'. Furthermore, it clears the
366variables listed in `desktop-globals-to-clear'." 387variables listed in `desktop-globals-to-clear'."
367 (interactive) 388 (interactive)
389 (desktop-lazy-abort)
368 (dolist (var desktop-globals-to-clear) 390 (dolist (var desktop-globals-to-clear)
369 (if (symbolp var) 391 (if (symbolp var)
370 (eval `(setq-default ,var nil)) 392 (eval `(setq-default ,var nil))
@@ -625,12 +647,13 @@ See also `desktop-base-file-name'."
625 (setq locals (cdr locals))) 647 (setq locals (cdr locals)))
626 ll))) 648 ll)))
627 (buffer-list))) 649 (buffer-list)))
650 (eager desktop-restore-eager)
628 (buf (get-buffer-create "*desktop*"))) 651 (buf (get-buffer-create "*desktop*")))
629 (set-buffer buf) 652 (set-buffer buf)
630 (erase-buffer) 653 (erase-buffer)
631 654
632 (insert 655 (insert
633 ";; -*- coding: utf-8-emacs; -*-\n" 656 ";; -*- mode: emacs-lisp; coding: utf-8-emacs; -*-\n"
634 desktop-header 657 desktop-header
635 ";; Created " (current-time-string) "\n" 658 ";; Created " (current-time-string) "\n"
636 ";; Desktop file format version " desktop-file-version "\n" 659 ";; Desktop file format version " desktop-file-version "\n"
@@ -645,14 +668,21 @@ See also `desktop-base-file-name'."
645 668
646 (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n") 669 (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n")
647 (mapc #'(lambda (l) 670 (mapc #'(lambda (l)
648 (if (apply 'desktop-save-buffer-p l) 671 (when (apply 'desktop-save-buffer-p l)
649 (progn 672 (insert "("
650 (insert "(desktop-create-buffer " desktop-file-version) 673 (if (or (not (integerp eager))
651 (mapc #'(lambda (e) 674 (unless (zerop eager)
652 (insert "\n " (desktop-value-to-string e))) 675 (setq eager (1- eager))
653 l) 676 t))
654 (insert ")\n\n")))) 677 "desktop-create-buffer"
655 info) 678 "desktop-append-buffer-args")
679 " "
680 desktop-file-version)
681 (mapc #'(lambda (e)
682 (insert "\n " (desktop-value-to-string e)))
683 l)
684 (insert ")\n\n")))
685 info)
656 (setq default-directory dirname) 686 (setq default-directory dirname)
657 (when (file-exists-p filename) (delete-file filename)) 687 (when (file-exists-p filename) (delete-file filename))
658 (let ((coding-system-for-write 'utf-8-emacs)) 688 (let ((coding-system-for-write 'utf-8-emacs))
@@ -670,6 +700,11 @@ This function also sets `desktop-dirname' to nil."
670 (when (file-exists-p filename) 700 (when (file-exists-p filename)
671 (delete-file filename))))) 701 (delete-file filename)))))
672 702
703(defvar desktop-buffer-args-list nil
704 "List of args for `desktop-create-buffer'.")
705
706(defvar desktop-lazy-timer nil)
707
673;; ---------------------------------------------------------------------------- 708;; ----------------------------------------------------------------------------
674;;;###autoload 709;;;###autoload
675(defun desktop-read (&optional dirname) 710(defun desktop-read (&optional dirname)
@@ -706,6 +741,7 @@ It returns t if a desktop file was loaded, nil otherwise."
706 (let ((desktop-first-buffer nil) 741 (let ((desktop-first-buffer nil)
707 (desktop-buffer-ok-count 0) 742 (desktop-buffer-ok-count 0)
708 (desktop-buffer-fail-count 0)) 743 (desktop-buffer-fail-count 0))
744 (setq desktop-lazy-timer nil)
709 ;; Evaluate desktop buffer. 745 ;; Evaluate desktop buffer.
710 (load (expand-file-name desktop-base-file-name desktop-dirname) t t t) 746 (load (expand-file-name desktop-base-file-name desktop-dirname) t t t)
711 ;; `desktop-create-buffer' puts buffers at end of the buffer list. 747 ;; `desktop-create-buffer' puts buffers at end of the buffer list.
@@ -717,11 +753,15 @@ It returns t if a desktop file was loaded, nil otherwise."
717 (run-hooks 'desktop-delay-hook) 753 (run-hooks 'desktop-delay-hook)
718 (setq desktop-delay-hook nil) 754 (setq desktop-delay-hook nil)
719 (run-hooks 'desktop-after-read-hook) 755 (run-hooks 'desktop-after-read-hook)
720 (message "Desktop: %d buffer%s restored%s." 756 (message "Desktop: %d buffer%s restored%s%s."
721 desktop-buffer-ok-count 757 desktop-buffer-ok-count
722 (if (= 1 desktop-buffer-ok-count) "" "s") 758 (if (= 1 desktop-buffer-ok-count) "" "s")
723 (if (< 0 desktop-buffer-fail-count) 759 (if (< 0 desktop-buffer-fail-count)
724 (format ", %d failed to restore" desktop-buffer-fail-count) 760 (format ", %d failed to restore" desktop-buffer-fail-count)
761 "")
762 (if desktop-buffer-args-list
763 (format ", %d to restore lazily"
764 (length desktop-buffer-args-list))
725 "")) 765 ""))
726 t) 766 t)
727 ;; No desktop file found. 767 ;; No desktop file found.
@@ -917,6 +957,69 @@ directory DIRNAME."
917 (cons 'case-replace cr) 957 (cons 'case-replace cr)
918 (cons 'overwrite-mode (car mim))))) 958 (cons 'overwrite-mode (car mim)))))
919 959
960(defun desktop-append-buffer-args (&rest args)
961 "Append ARGS at end of `desktop-buffer-args-list'
962ARGS must be an argument list for `desktop-create-buffer'."
963 (setq desktop-buffer-args-list (nconc desktop-buffer-args-list (list args)))
964 (unless desktop-lazy-timer
965 (setq desktop-lazy-timer
966 (run-with-idle-timer desktop-lazy-idle-delay t 'desktop-idle-create-buffers))))
967
968(defun desktop-lazy-create-buffer ()
969 "Pop args from `desktop-buffer-args-list', create buffer and bury it."
970 (when desktop-buffer-args-list
971 (let* ((remaining (length desktop-buffer-args-list))
972 (args (pop desktop-buffer-args-list))
973 (buffer-name (nth 2 args))
974 (msg (format "Desktop lazily opening %s (%s remaining)..."
975 buffer-name remaining)))
976 (when desktop-lazy-verbose
977 (message msg))
978 (let ((desktop-first-buffer nil)
979 (desktop-buffer-ok-count 0)
980 (desktop-buffer-fail-count 0))
981 (apply 'desktop-create-buffer args)
982 (run-hooks 'desktop-delay-hook)
983 (setq desktop-delay-hook nil)
984 (bury-buffer (get-buffer buffer-name))
985 (when desktop-lazy-verbose
986 (message "%s%s" msg (if (> desktop-buffer-ok-count 0) "done" "failed")))))))
987
988(defun desktop-idle-create-buffers ()
989 "Create buffers until the user does something, then stop.
990If there are no buffers left to create, kill the timer."
991 (let ((repeat 1))
992 (while (and repeat desktop-buffer-args-list)
993 (save-window-excursion
994 (desktop-lazy-create-buffer))
995 (setq repeat (sit-for 0.2))
996 (unless desktop-buffer-args-list
997 (cancel-timer desktop-lazy-timer)
998 (setq desktop-lazy-timer nil)
999 (message "Lazy desktop load complete")
1000 (sit-for 3)
1001 (message "")))))
1002
1003(defun desktop-lazy-complete ()
1004 "Run the desktop load to completion."
1005 (interactive)
1006 (let ((desktop-lazy-verbose t))
1007 (while desktop-buffer-args-list
1008 (save-window-excursion
1009 (desktop-lazy-create-buffer)))
1010 (message "Lazy desktop load complete")))
1011
1012(defun desktop-lazy-abort ()
1013 "Abort lazy loading of the desktop."
1014 (interactive)
1015 (when desktop-lazy-timer
1016 (cancel-timer desktop-lazy-timer)
1017 (setq desktop-lazy-timer nil))
1018 (when desktop-buffer-args-list
1019 (setq desktop-buffer-args-list nil)
1020 (when (interactive-p)
1021 (message "Lazy desktop load aborted"))))
1022
920;; ---------------------------------------------------------------------------- 1023;; ----------------------------------------------------------------------------
921;; When `desktop-save-mode' is non-nil and "--no-desktop" is not specified on the 1024;; When `desktop-save-mode' is non-nil and "--no-desktop" is not specified on the
922;; command line, we do the rest of what it takes to use desktop, but do it 1025;; command line, we do the rest of what it takes to use desktop, but do it
diff --git a/lisp/ebuff-menu.el b/lisp/ebuff-menu.el
index 2bfbace4c4b..bfac2afe6e9 100644
--- a/lisp/ebuff-menu.el
+++ b/lisp/ebuff-menu.el
@@ -149,7 +149,9 @@ Letters do not insert themselves; instead, they are commands.
149 149
150Entry to this mode via command `electric-buffer-list' calls the value of 150Entry to this mode via command `electric-buffer-list' calls the value of
151`electric-buffer-menu-mode-hook'." 151`electric-buffer-menu-mode-hook'."
152 (kill-all-local-variables) 152 (let ((saved header-line-format))
153 (kill-all-local-variables)
154 (setq header-line-format saved))
153 (use-local-map electric-buffer-menu-mode-map) 155 (use-local-map electric-buffer-menu-mode-map)
154 (setq mode-name "Electric Buffer Menu") 156 (setq mode-name "Electric Buffer Menu")
155 (setq mode-line-buffer-identification "Electric Buffer List") 157 (setq mode-line-buffer-identification "Electric Buffer List")
diff --git a/lisp/electric.el b/lisp/electric.el
index 3d2bf140c8c..18a4d8388c5 100644
--- a/lisp/electric.el
+++ b/lisp/electric.el
@@ -144,31 +144,17 @@
144 (buf (get-buffer buffer)) 144 (buf (get-buffer buffer))
145 (one-window (one-window-p t)) 145 (one-window (one-window-p t))
146 (pop-up-windows t) 146 (pop-up-windows t)
147 (pop-up-frames nil) 147 (pop-up-frames nil))
148 (target-height)
149 (lines))
150 (if (not buf) 148 (if (not buf)
151 (error "Buffer %s does not exist" buffer) 149 (error "Buffer %s does not exist" buffer)
152 (with-current-buffer buf
153 (setq lines (count-lines (point-min) (point-max)))
154 (setq target-height
155 (min (max (if max-height (min max-height (1+ lines)) (1+ lines))
156 window-min-height)
157 (save-window-excursion
158 (delete-other-windows)
159 (1- (window-height (selected-window)))))))
160 (cond ((and (eq (window-buffer win) buf)) 150 (cond ((and (eq (window-buffer win) buf))
161 (select-window win)) 151 (select-window win))
162 (one-window 152 (one-window
163 (pop-to-buffer buffer) 153 (pop-to-buffer buffer)
164 (setq win (selected-window)) 154 (setq win (selected-window)))
165 (enlarge-window (- target-height (window-height win))))
166 (t 155 (t
167 (switch-to-buffer buf))) 156 (switch-to-buffer buf)))
168 (if (and (not max-height) 157 (fit-window-to-buffer win max-height)
169 (> target-height (window-height (selected-window))))
170 (progn (goto-char (window-start win))
171 (enlarge-window (- target-height (window-height win)))))
172 (goto-char (point-min)) 158 (goto-char (point-min))
173 win))) 159 win)))
174 160
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 196786e9179..0a75a43827e 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -135,7 +135,7 @@ or macro definition or a defcustom)."
135 135
136 136
137(defun autoload-trim-file-name (file) 137(defun autoload-trim-file-name (file)
138 ;; Returns a relative pathname of FILE 138 ;; Returns a relative file path for FILE
139 ;; starting from the directory that loaddefs.el is in. 139 ;; starting from the directory that loaddefs.el is in.
140 ;; That is normally a directory in load-path, 140 ;; That is normally a directory in load-path,
141 ;; which means Emacs will be able to find FILE when it looks. 141 ;; which means Emacs will be able to find FILE when it looks.
@@ -273,7 +273,7 @@ are used."
273 output-end) 273 output-end)
274 274
275 ;; If the autoload section we create here uses an absolute 275 ;; If the autoload section we create here uses an absolute
276 ;; pathname for FILE in its header, and then Emacs is installed 276 ;; file name for FILE in its header, and then Emacs is installed
277 ;; under a different path on another system, 277 ;; under a different path on another system,
278 ;; `update-autoloads-here' won't be able to find the files to be 278 ;; `update-autoloads-here' won't be able to find the files to be
279 ;; autoloaded. So, if FILE is in the same directory or a 279 ;; autoloaded. So, if FILE is in the same directory or a
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el
index 9454bfc9da3..d4967a7cd06 100644
--- a/lisp/emacs-lisp/elint.el
+++ b/lisp/emacs-lisp/elint.el
@@ -29,7 +29,7 @@
29;; mispellings and undefined variables, although it can also catch 29;; mispellings and undefined variables, although it can also catch
30;; function calls with the wrong number of arguments. 30;; function calls with the wrong number of arguments.
31 31
32;; Before using, call `elint-initialize' to set up som argument 32;; Before using, call `elint-initialize' to set up some argument
33;; data. This takes a while. Then call elint-current-buffer or 33;; data. This takes a while. Then call elint-current-buffer or
34;; elint-defun to lint a buffer or a defun. 34;; elint-defun to lint a buffer or a defun.
35 35
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index a70adb4d423..7e2ac5aa883 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -1,6 +1,6 @@
1;;; find-func.el --- find the definition of the Emacs Lisp function near point 1;;; find-func.el --- find the definition of the Emacs Lisp function near point
2 2
3;; Copyright (C) 1997, 1999, 2001, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 1997, 1999, 2001, 2004, 2005 Free Software Foundation, Inc.
4 4
5;; Author: Jens Petersen <petersen@kurims.kyoto-u.ac.jp> 5;; Author: Jens Petersen <petersen@kurims.kyoto-u.ac.jp>
6;; Maintainer: petersen@kurims.kyoto-u.ac.jp 6;; Maintainer: petersen@kurims.kyoto-u.ac.jp
@@ -76,16 +76,37 @@ Please send improvements and fixes to the maintainer."
76 :version "21.1") 76 :version "21.1")
77 77
78(defcustom find-variable-regexp 78(defcustom find-variable-regexp
79 (concat"^\\s-*(def[^umag]\\(\\w\\|\\s_\\)+\\*?" find-function-space-re "%s\\(\\s-\\|$\\)") 79 (concat"^\\s-*(def[^fumag]\\(\\w\\|\\s_\\)+\\*?" find-function-space-re "%s\\(\\s-\\|$\\)")
80 "The regexp used by `find-variable' to search for a variable definition. 80 "The regexp used by `find-variable' to search for a variable definition.
81It should match right up to the variable name. The default value 81Note it must contain a `%s' at the place where `format'
82avoids `defun', `defmacro', `defalias', `defadvice', `defgroup'. 82should insert the variable name. The default value
83avoids `defun', `defmacro', `defalias', `defadvice', `defgroup', `defface'.
83 84
84Please send improvements and fixes to the maintainer." 85Please send improvements and fixes to the maintainer."
85 :type 'regexp 86 :type 'regexp
86 :group 'find-function 87 :group 'find-function
87 :version "21.1") 88 :version "21.1")
88 89
90(defcustom find-face-regexp
91 (concat"^\\s-*(defface" find-function-space-re "%s\\(\\s-\\|$\\)")
92 "The regexp used by `find-face' to search for a face definition.
93Note it must contain a `%s' at the place where `format'
94should insert the face name.
95
96Please send improvements and fixes to the maintainer."
97 :type 'regexp
98 :group 'find-function
99 :version "21.4")
100
101(defvar find-function-regexp-alist
102 '((nil . find-function-regexp)
103 (defvar . find-variable-regexp)
104 (defface . find-face-regexp))
105 "Alist mapping definition types into regexp variables.
106Each regexp variable's value should actually be a format string
107to be used to substitute the desired symbol name into the regexp.")
108(put 'find-function-regexp-alist 'risky-local-variable t)
109
89(defcustom find-function-source-path nil 110(defcustom find-function-source-path nil
90 "The default list of directories where `find-function' searches. 111 "The default list of directories where `find-function' searches.
91 112
@@ -136,9 +157,9 @@ See the functions `find-function' and `find-variable'."
136If nil, do not try to find the source code of functions and variables 157If nil, do not try to find the source code of functions and variables
137defined in C.") 158defined in C.")
138 159
139(defun find-function-C-source (fun-or-var file variable-p) 160(defun find-function-C-source (fun-or-var file type)
140 "Find the source location where SUBR-OR-VAR is defined in FILE. 161 "Find the source location where SUBR-OR-VAR is defined in FILE.
141VARIABLE-P should be non-nil for a variable or nil for a subroutine." 162TYPE should be nil to find a function, or `defvar' to find a variable."
142 (unless find-function-C-source-directory 163 (unless find-function-C-source-directory
143 (setq find-function-C-source-directory 164 (setq find-function-C-source-directory
144 (read-directory-name "Emacs C source dir: " nil nil t))) 165 (read-directory-name "Emacs C source dir: " nil nil t)))
@@ -146,12 +167,12 @@ VARIABLE-P should be non-nil for a variable or nil for a subroutine."
146 (unless (file-readable-p file) 167 (unless (file-readable-p file)
147 (error "The C source file %s is not available" 168 (error "The C source file %s is not available"
148 (file-name-nondirectory file))) 169 (file-name-nondirectory file)))
149 (unless variable-p 170 (unless type
150 (setq fun-or-var (indirect-function fun-or-var))) 171 (setq fun-or-var (indirect-function fun-or-var)))
151 (with-current-buffer (find-file-noselect file) 172 (with-current-buffer (find-file-noselect file)
152 (goto-char (point-min)) 173 (goto-char (point-min))
153 (unless (re-search-forward 174 (unless (re-search-forward
154 (if variable-p 175 (if type
155 (concat "DEFVAR[A-Z_]*[ \t\n]*([ \t\n]*\"" 176 (concat "DEFVAR[A-Z_]*[ \t\n]*([ \t\n]*\""
156 (regexp-quote (symbol-name fun-or-var)) 177 (regexp-quote (symbol-name fun-or-var))
157 "\"") 178 "\"")
@@ -175,10 +196,12 @@ VARIABLE-P should be non-nil for a variable or nil for a subroutine."
175 (condition-case nil (switch-to-buffer buf) (error (pop-to-buffer buf))))) 196 (condition-case nil (switch-to-buffer buf) (error (pop-to-buffer buf)))))
176 197
177;;;###autoload 198;;;###autoload
178(defun find-function-search-for-symbol (symbol variable-p library) 199(defun find-function-search-for-symbol (symbol type library)
179 "Search for SYMBOL. 200 "Search for SYMBOL's definition of type TYPE in LIBRARY.
180If VARIABLE-P is nil, `find-function-regexp' is used, otherwise 201If TYPE is nil, look for a function definition.
181`find-variable-regexp' is used. The search is done in library LIBRARY." 202Otherwise, TYPE specifies the kind of definition,
203and it is interpreted via `find-function-regexp-alist'.
204The search is done in the source for library LIBRARY."
182 (if (null library) 205 (if (null library)
183 (error "Don't know where `%s' is defined" symbol)) 206 (error "Don't know where `%s' is defined" symbol))
184 ;; Some functions are defined as part of the construct 207 ;; Some functions are defined as part of the construct
@@ -186,14 +209,13 @@ If VARIABLE-P is nil, `find-function-regexp' is used, otherwise
186 (while (and (symbolp symbol) (get symbol 'definition-name)) 209 (while (and (symbolp symbol) (get symbol 'definition-name))
187 (setq symbol (get symbol 'definition-name))) 210 (setq symbol (get symbol 'definition-name)))
188 (if (string-match "\\`src/\\(.*\\.c\\)\\'" library) 211 (if (string-match "\\`src/\\(.*\\.c\\)\\'" library)
189 (find-function-C-source symbol (match-string 1 library) variable-p) 212 (find-function-C-source symbol (match-string 1 library) type)
190 (if (string-match "\\.el\\(c\\)\\'" library) 213 (if (string-match "\\.el\\(c\\)\\'" library)
191 (setq library (substring library 0 (match-beginning 1)))) 214 (setq library (substring library 0 (match-beginning 1))))
192 (let* ((filename (find-library-name library))) 215 (let* ((filename (find-library-name library))
216 (regexp-symbol (cdr (assq type find-function-regexp-alist))))
193 (with-current-buffer (find-file-noselect filename) 217 (with-current-buffer (find-file-noselect filename)
194 (let ((regexp (format (if variable-p 218 (let ((regexp (format (symbol-value regexp-symbol)
195 find-variable-regexp
196 find-function-regexp)
197 (regexp-quote (symbol-name symbol)))) 219 (regexp-quote (symbol-name symbol))))
198 (case-fold-search)) 220 (case-fold-search))
199 (with-syntax-table emacs-lisp-mode-syntax-table 221 (with-syntax-table emacs-lisp-mode-syntax-table
@@ -245,55 +267,53 @@ in `load-path'."
245 ((symbol-file function 'defun))))) 267 ((symbol-file function 'defun)))))
246 (find-function-search-for-symbol function nil library)))) 268 (find-function-search-for-symbol function nil library))))
247 269
248(defalias 'function-at-point 'function-called-at-point) 270(defun find-function-read (&optional type)
249
250(defun find-function-read (&optional variable-p)
251 "Read and return an interned symbol, defaulting to the one near point. 271 "Read and return an interned symbol, defaulting to the one near point.
252 272
253If the optional VARIABLE-P is nil, then a function is gotten 273If TYPE is nil, insist on a symbol with a function definition.
254defaulting to the value of the function `function-at-point', otherwise 274Otherwise TYPE should be `defvar' or `defface'.
255a variable is asked for, with the default coming from 275If TYPE is nil, defaults using `function-called-at-point',
256`variable-at-point'." 276otherwise uses `variable-at-point'."
257 (let ((symb (funcall (if variable-p 277 (let ((symb (if (null type)
258 'variable-at-point 278 (function-called-at-point)
259 'function-at-point))) 279 (if (eq type 'defvar)
280 (variable-at-point)
281 (variable-at-point t))))
282 (predicate (cdr (assq type '((nil . fboundp) (defvar . boundp)
283 (defface . facep)))))
284 (prompt (cdr (assq type '((nil . "function") (defvar . "variable")
285 (defface . "face")))))
260 (enable-recursive-minibuffers t) 286 (enable-recursive-minibuffers t)
261 val) 287 val)
262 (if (equal symb 0) 288 (if (equal symb 0)
263 (setq symb nil)) 289 (setq symb nil))
264 (setq val (if variable-p 290 (setq val (completing-read
265 (completing-read 291 (concat "Find "
266 (concat "Find variable" 292 prompt
267 (if symb 293 (if symb
268 (format " (default %s)" symb)) 294 (format " (default %s)" symb))
269 ": ") 295 ": ")
270 obarray 'boundp t nil) 296 obarray predicate t nil))
271 (completing-read
272 (concat "Find function"
273 (if symb
274 (format " (default %s)" symb))
275 ": ")
276 obarray 'fboundp t nil)))
277 (list (if (equal val "") 297 (list (if (equal val "")
278 symb 298 symb
279 (intern val))))) 299 (intern val)))))
280 300
281(defun find-function-do-it (symbol variable-p switch-fn) 301(defun find-function-do-it (symbol type switch-fn)
282 "Find Emacs Lisp SYMBOL in a buffer and display it. 302 "Find Emacs Lisp SYMBOL in a buffer and display it.
283If VARIABLE-P is nil, a function definition is searched for, otherwise 303TYPE is nil to search for a function definition,
284a variable definition is searched for. The start of a definition is 304or else `defvar' or `defface'.
285centered according to the variable `find-function-recenter-line'. 305
286See also `find-function-after-hook' It is displayed with function SWITCH-FN. 306The variable `find-function-recenter-line' controls how
307to recenter the display. SWITCH-FN is the function to call
308to display and select the buffer.
309See also `find-function-after-hook'.
287 310
288Point is saved in the buffer if it is one of the current buffers." 311Set mark before moving, if the buffer already existed."
289 (let* ((orig-point (point)) 312 (let* ((orig-point (point))
290 (orig-buf (window-buffer)) 313 (orig-buf (window-buffer))
291 (orig-buffers (buffer-list)) 314 (orig-buffers (buffer-list))
292 (buffer-point (save-excursion 315 (buffer-point (save-excursion
293 (funcall (if variable-p 316 (find-definition-noselect symbol type)))
294 'find-variable-noselect
295 'find-function-noselect)
296 symbol)))
297 (new-buf (car buffer-point)) 317 (new-buf (car buffer-point))
298 (new-point (cdr buffer-point))) 318 (new-point (cdr buffer-point)))
299 (when buffer-point 319 (when buffer-point
@@ -309,9 +329,9 @@ Point is saved in the buffer if it is one of the current buffers."
309 "Find the definition of the FUNCTION near point. 329 "Find the definition of the FUNCTION near point.
310 330
311Finds the Emacs Lisp library containing the definition of the function 331Finds the Emacs Lisp library containing the definition of the function
312near point (selected by `function-at-point') in a buffer and 332near point (selected by `function-called-at-point') in a buffer and
313places point before the definition. Point is saved in the buffer if 333places point before the definition.
314it is one of the current buffers. 334Set mark before moving, if the buffer already existed.
315 335
316The library where FUNCTION is defined is searched for in 336The library where FUNCTION is defined is searched for in
317`find-function-source-path', if non nil, otherwise in `load-path'. 337`find-function-source-path', if non nil, otherwise in `load-path'.
@@ -340,15 +360,15 @@ See `find-function' for more details."
340 "Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL. 360 "Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL.
341 361
342Finds the Emacs Lisp library containing the definition of SYMBOL 362Finds the Emacs Lisp library containing the definition of SYMBOL
343in a buffer and the point of the definition. The buffer is 363in a buffer, and the point of the definition. It does not switch
344not selected. 364to the buffer or display it.
345 365
346The library where VARIABLE is defined is searched for in FILE or 366The library where VARIABLE is defined is searched for in FILE or
347`find-function-source-path', if non nil, otherwise in `load-path'." 367`find-function-source-path', if non nil, otherwise in `load-path'."
348 (if (not variable) 368 (if (not variable)
349 (error "You didn't specify a variable")) 369 (error "You didn't specify a variable"))
350 (let ((library (or file (symbol-file variable 'defvar)))) 370 (let ((library (or file (symbol-file variable 'defvar))))
351 (find-function-search-for-symbol variable 'variable library))) 371 (find-function-search-for-symbol variable 'defvar library)))
352 372
353;;;###autoload 373;;;###autoload
354(defun find-variable (variable) 374(defun find-variable (variable)
@@ -356,35 +376,70 @@ The library where VARIABLE is defined is searched for in FILE or
356 376
357Finds the Emacs Lisp library containing the definition of the variable 377Finds the Emacs Lisp library containing the definition of the variable
358near point (selected by `variable-at-point') in a buffer and 378near point (selected by `variable-at-point') in a buffer and
359places point before the definition. Point is saved in the buffer if 379places point before the definition.
360it is one of the current buffers. 380
381Set mark before moving, if the buffer already existed.
361 382
362The library where VARIABLE is defined is searched for in 383The library where VARIABLE is defined is searched for in
363`find-function-source-path', if non nil, otherwise in `load-path'. 384`find-function-source-path', if non nil, otherwise in `load-path'.
364See also `find-function-recenter-line' and `find-function-after-hook'." 385See also `find-function-recenter-line' and `find-function-after-hook'."
365 (interactive (find-function-read 'variable)) 386 (interactive (find-function-read 'defvar))
366 (find-function-do-it variable t 'switch-to-buffer)) 387 (find-function-do-it variable 'defvar 'switch-to-buffer))
367 388
368;;;###autoload 389;;;###autoload
369(defun find-variable-other-window (variable) 390(defun find-variable-other-window (variable)
370 "Find, in another window, the definition of VARIABLE near point. 391 "Find, in another window, the definition of VARIABLE near point.
371 392
372See `find-variable' for more details." 393See `find-variable' for more details."
373 (interactive (find-function-read 'variable)) 394 (interactive (find-function-read 'defvar))
374 (find-function-do-it variable t 'switch-to-buffer-other-window)) 395 (find-function-do-it variable 'defvar 'switch-to-buffer-other-window))
375 396
376;;;###autoload 397;;;###autoload
377(defun find-variable-other-frame (variable) 398(defun find-variable-other-frame (variable)
378 "Find, in annother frame, the definition of VARIABLE near point. 399 "Find, in annother frame, the definition of VARIABLE near point.
379 400
380See `find-variable' for more details." 401See `find-variable' for more details."
381 (interactive (find-function-read 'variable)) 402 (interactive (find-function-read 'defvar))
382 (find-function-do-it variable t 'switch-to-buffer-other-frame)) 403 (find-function-do-it variable 'defvar 'switch-to-buffer-other-frame))
404
405;;;###autoload
406(defun find-definition-noselect (symbol type &optional file)
407 "Return a pair `(BUFFER . POINT)' pointing to the definition of SYMBOL.
408TYPE says what type of definition: nil for a function,
409`defvar' or `defface' for a variable or face. This functoin
410does not switch to the buffer or display it.
411
412The library where SYMBOL is defined is searched for in FILE or
413`find-function-source-path', if non nil, otherwise in `load-path'."
414 (if (not symbol)
415 (error "You didn't specify a symbol"))
416 (if (null type)
417 (find-function-noselect symbol)
418 (let ((library (or file (symbol-file symbol type))))
419 (find-function-search-for-symbol symbol type library))))
420
421;; For symmetry, this should be called find-face; but some programs
422;; assume that, if that name is defined, it means something else.
423;;;###autoload
424(defun find-face-definition (face)
425 "Find the definition of FACE. FACE defaults to the name near point.
426
427Finds the Emacs Lisp library containing the definition of the face
428near point (selected by `variable-at-point') in a buffer and
429places point before the definition.
430
431Set mark before moving, if the buffer already existed.
432
433The library where FACE is defined is searched for in
434`find-function-source-path', if non nil, otherwise in `load-path'.
435See also `find-function-recenter-line' and `find-function-after-hook'."
436 (interactive (find-function-read 'defface))
437 (find-function-do-it face 'defface 'switch-to-buffer))
383 438
384;;;###autoload 439;;;###autoload
385(defun find-function-on-key (key) 440(defun find-function-on-key (key)
386 "Find the function that KEY invokes. KEY is a string. 441 "Find the function that KEY invokes. KEY is a string.
387Point is saved if FUNCTION is in the current buffer." 442Set mark before moving, if the buffer already existed."
388 (interactive "kFind function on key: ") 443 (interactive "kFind function on key: ")
389 (let (defn) 444 (let (defn)
390 (save-excursion 445 (save-excursion
@@ -412,7 +467,7 @@ Point is saved if FUNCTION is in the current buffer."
412(defun find-function-at-point () 467(defun find-function-at-point ()
413 "Find directly the function at point in the other window." 468 "Find directly the function at point in the other window."
414 (interactive) 469 (interactive)
415 (let ((symb (function-at-point))) 470 (let ((symb (function-called-at-point)))
416 (when symb 471 (when symb
417 (find-function-other-window symb)))) 472 (find-function-other-window symb))))
418 473
@@ -437,5 +492,5 @@ Point is saved if FUNCTION is in the current buffer."
437 492
438(provide 'find-func) 493(provide 'find-func)
439 494
440;;; arch-tag: 43ecd81c-74dc-4d9a-8f63-a61e55670d64 495;; arch-tag: 43ecd81c-74dc-4d9a-8f63-a61e55670d64
441;;; find-func.el ends here 496;;; find-func.el ends here
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index 671f3c8ce2a..701da1c4dec 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -304,9 +304,14 @@ If FILE is nil, execute BODY in the current buffer."
304 (if ,filesym 304 (if ,filesym
305 (with-temp-buffer 305 (with-temp-buffer
306 (insert-file-contents ,filesym) 306 (insert-file-contents ,filesym)
307 (lisp-mode)
307 ,@body) 308 ,@body)
308 (save-excursion 309 (save-excursion
309 ,@body))))) 310 ;; Switching major modes is too drastic, so just switch
311 ;; temporarily to the Lisp mode syntax table.
312 (with-syntax-table lisp-mode-syntax-table
313 ,@body))))))
314
310(put 'lm-with-file 'lisp-indent-function 1) 315(put 'lm-with-file 'lisp-indent-function 1)
311(put 'lm-with-file 'edebug-form-spec t) 316(put 'lm-with-file 'edebug-form-spec t)
312 317
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index f4364c38e8d..f181f3683f0 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1125,7 +1125,8 @@ ENDPOS is encountered."
1125 (set-marker endmark nil)))) 1125 (set-marker endmark nil))))
1126 1126
1127(defun indent-pp-sexp (&optional arg) 1127(defun indent-pp-sexp (&optional arg)
1128 "Indent each line of the list or, with prefix ARG, pretty-printify the list." 1128 "Indent each line of the list starting just after point, or prettyprint it.
1129A prefix argument specifies pretty-printing."
1129 (interactive "P") 1130 (interactive "P")
1130 (if arg 1131 (if arg
1131 (save-excursion 1132 (save-excursion
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index 77a12167c30..019a45213c8 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -1,6 +1,6 @@
1;;; re-builder.el --- building Regexps with visual feedback 1;;; re-builder.el --- building Regexps with visual feedback
2 2
3;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
4 4
5;; Author: Detlev Zundel <dzu@gnu.org> 5;; Author: Detlev Zundel <dzu@gnu.org>
6;; Keywords: matching, lisp, tools 6;; Keywords: matching, lisp, tools
@@ -61,12 +61,12 @@
61;; even the auto updates go all the way. Forcing an update overrides 61;; even the auto updates go all the way. Forcing an update overrides
62;; this limit allowing an easy way to see all matches. 62;; this limit allowing an easy way to see all matches.
63 63
64;; Currently `re-builder' understands four different forms of input, 64;; Currently `re-builder' understands five different forms of input,
65;; namely `read', `string', `sregex' and `lisp-re' syntax. Read 65;; namely `read', `string', `rx', `sregex' and `lisp-re' syntax. Read
66;; syntax and string syntax are both delimited by `"'s and behave 66;; syntax and string syntax are both delimited by `"'s and behave
67;; according to their name. With the `string' syntax there's no need 67;; according to their name. With the `string' syntax there's no need
68;; to escape the backslashes and double quotes simplifying the editing 68;; to escape the backslashes and double quotes simplifying the editing
69;; somewhat. The other two allow editing of symbolic regular 69;; somewhat. The other three allow editing of symbolic regular
70;; expressions supported by the packages of the same name. (`lisp-re' 70;; expressions supported by the packages of the same name. (`lisp-re'
71;; is a package by me and its support may go away as it is nearly the 71;; is a package by me and its support may go away as it is nearly the
72;; same as the `sregex' package in Emacs) 72;; same as the `sregex' package in Emacs)
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index c6cce457fe6..127b8fe608b 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -471,50 +471,81 @@ These special properties include `invisible', `intangible' and `read-only'."
471 col))) 471 col)))
472 472
473;;;###autoload 473;;;###autoload
474(defun list-colors-display (&optional list) 474(defun list-colors-display (&optional list buffer-name)
475 "Display names of defined colors, and show what they look like. 475 "Display names of defined colors, and show what they look like.
476If the optional argument LIST is non-nil, it should be a list of 476If the optional argument LIST is non-nil, it should be a list of
477colors to display. Otherwise, this command computes a list 477colors to display. Otherwise, this command computes a list of
478of colors that the current display can handle." 478colors that the current display can handle. If the optional
479argument BUFFER-NAME is nil, it defaults to *Colors*."
479 (interactive) 480 (interactive)
480 (when (and (null list) (> (display-color-cells) 0)) 481 (when (and (null list) (> (display-color-cells) 0))
481 (setq list (defined-colors)) 482 (setq list (list-colors-duplicates (defined-colors)))
482 ;; Delete duplicate colors.
483
484 ;; Identify duplicate colors by the name rather than the color
485 ;; value. For example, on MS-Windows, logical colors are added to
486 ;; the list that might have the same value but have different
487 ;; names and meanings. For example, `SystemMenuText' (the color
488 ;; w32 uses for the text in menu entries) and `SystemWindowText'
489 ;; (the default color w32 uses for the text in windows and
490 ;; dialogs) may be the same display color and be adjacent in the
491 ;; list. Detecting duplicates by name insures that both of these
492 ;; colors remain despite identical color values.
493 (let ((l list))
494 (while (cdr l)
495 (if (facemenu-color-name-equal (car l) (car (cdr l)))
496 (setcdr l (cdr (cdr l)))
497 (setq l (cdr l)))))
498 (when (memq (display-visual-class) '(gray-scale pseudo-color direct-color)) 483 (when (memq (display-visual-class) '(gray-scale pseudo-color direct-color))
499 ;; Don't show more than what the display can handle. 484 ;; Don't show more than what the display can handle.
500 (let ((lc (nthcdr (1- (display-color-cells)) list))) 485 (let ((lc (nthcdr (1- (display-color-cells)) list)))
501 (if lc 486 (if lc
502 (setcdr lc nil))))) 487 (setcdr lc nil)))))
503 (with-output-to-temp-buffer "*Colors*" 488 (with-output-to-temp-buffer (or buffer-name "*Colors*")
504 (save-excursion 489 (save-excursion
505 (set-buffer standard-output) 490 (set-buffer standard-output)
506 (let (s) 491 (setq truncate-lines t)
507 (while list 492 (if temp-buffer-show-function
508 (setq s (point)) 493 (list-colors-print list)
509 (insert (car list)) 494 ;; Call list-colors-print from temp-buffer-show-hook
510 (indent-to 20) 495 ;; to get the right value of window-width in list-colors-print
511 (put-text-property s (point) 'face 496 ;; after the buffer is displayed.
512 (cons 'background-color (car list))) 497 (add-hook 'temp-buffer-show-hook
513 (setq s (point)) 498 (lambda () (list-colors-print list)) nil t)))))
514 (insert " " (car list) "\n") 499
515 (put-text-property s (point) 'face 500(defun list-colors-print (list)
516 (cons 'foreground-color (car list))) 501 (dolist (color list)
517 (setq list (cdr list))))))) 502 (if (consp color)
503 (if (cdr color)
504 (setq color (sort color (lambda (a b)
505 (string< (downcase a)
506 (downcase b))))))
507 (setq color (list color)))
508 (put-text-property
509 (prog1 (point)
510 (insert (car color))
511 (indent-to 22))
512 (point)
513 'face (cons 'background-color (car color)))
514 (put-text-property
515 (prog1 (point)
516 (insert " " (if (cdr color)
517 (mapconcat 'identity (cdr color) ", ")
518 (car color)))
519 (indent-to (max (- (window-width) 8) 44))
520 (insert (apply 'format " #%02x%02x%02x"
521 (mapcar (lambda (c) (lsh c -8))
522 (color-values (car color)))))
523
524 (insert "\n"))
525 (point)
526 'face (cons 'foreground-color (car color))))
527 (goto-char (point-min)))
528
529(defun list-colors-duplicates (&optional list)
530 "Return a list of colors with grouped duplicate colors.
531If a color has no duplicates, then the element of the returned list
532has the form '(COLOR-NAME). The element of the returned list with
533duplicate colors has the form '(COLOR-NAME DUPLICATE-COLOR-NAME ...).
534This function uses the predicate `facemenu-color-equal' to compare
535color names. If the optional argument LIST is non-nil, it should
536be a list of colors to display. Otherwise, this function uses
537a list of colors that the current display can handle."
538 (let* ((list (mapcar 'list (or list (defined-colors))))
539 (l list))
540 (while (cdr l)
541 (if (and (facemenu-color-equal (car (car l)) (car (car (cdr l))))
542 (not (and (boundp 'w32-default-color-map)
543 (not (assoc (car (car l)) w32-default-color-map)))))
544 (progn
545 (setcdr (car l) (cons (car (car (cdr l))) (cdr (car l))))
546 (setcdr l (cdr (cdr l))))
547 (setq l (cdr l))))
548 list))
518 549
519(defun facemenu-color-equal (a b) 550(defun facemenu-color-equal (a b)
520 "Return t if colors A and B are the same color. 551 "Return t if colors A and B are the same color.
@@ -525,22 +556,6 @@ determine the correct answer."
525 (cond ((equal a b) t) 556 (cond ((equal a b) t)
526 ((equal (color-values a) (color-values b))))) 557 ((equal (color-values a) (color-values b)))))
527 558
528(defun facemenu-color-name-equal (a b)
529 "Return t if colors A and B are the same color.
530A and B should be strings naming colors. These names are
531downcased, stripped of spaces and the string `grey' is turned
532into `gray'. This accommodates alternative spellings of colors
533found commonly in the list. It returns nil if the colors differ."
534 (progn
535 (setq a (replace-regexp-in-string "grey" "gray"
536 (replace-regexp-in-string " " ""
537 (downcase a)))
538 b (replace-regexp-in-string "grey" "gray"
539 (replace-regexp-in-string " " ""
540 (downcase b))))
541
542 (equal a b)))
543
544(defun facemenu-add-face (face &optional start end) 559(defun facemenu-add-face (face &optional start end)
545 "Add FACE to text between START and END. 560 "Add FACE to text between START and END.
546If START is nil or START to END is empty, add FACE to next typed character 561If START is nil or START to END is empty, add FACE to next typed character
diff --git a/lisp/files.el b/lisp/files.el
index cfee975066d..cdaa7a5adb8 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1856,8 +1856,14 @@ mode function to use. FUNCTION will be called, unless it is nil.
1856 1856
1857If the element has the form (REGEXP FUNCTION NON-NIL), then after 1857If the element has the form (REGEXP FUNCTION NON-NIL), then after
1858calling FUNCTION (if it's not nil), we delete the suffix that matched 1858calling FUNCTION (if it's not nil), we delete the suffix that matched
1859REGEXP and search the list again for another match.") 1859REGEXP and search the list again for another match.
1860 1860
1861If the file name matches `inhibit-first-line-modes-regexps',
1862then `auto-mode-alist' is not processed.
1863
1864See also `interpreter-mode-alist', which detects executable script modes
1865based on the interpreters they specify to run,
1866and `magic-mode-alist', which determines modes based on file contents.")
1861 1867
1862(defvar interpreter-mode-alist 1868(defvar interpreter-mode-alist
1863 ;; Note: The entries for the modes defined in cc-mode.el (awk-mode 1869 ;; Note: The entries for the modes defined in cc-mode.el (awk-mode
@@ -1902,11 +1908,13 @@ REGEXP and search the list again for another match.")
1902 ("guile" . scheme-mode) 1908 ("guile" . scheme-mode)
1903 ("clisp" . lisp-mode))) 1909 ("clisp" . lisp-mode)))
1904 "Alist mapping interpreter names to major modes. 1910 "Alist mapping interpreter names to major modes.
1905This alist applies to files whose first line starts with `#!'. 1911This is used for files whose first lines match `auto-mode-interpreter-regexp'.
1906Each element looks like (INTERPRETER . MODE). 1912Each element looks like (INTERPRETER . MODE).
1907The car of each element is compared with 1913The car of each element is compared with
1908the name of the interpreter specified in the first line. 1914the name of the interpreter specified in the first line.
1909If it matches, mode MODE is selected.") 1915If it matches, mode MODE is selected.
1916
1917See also `auto-mode-alist'.")
1910 1918
1911(defvar inhibit-first-line-modes-regexps '("\\.tar\\'" "\\.tgz\\'") 1919(defvar inhibit-first-line-modes-regexps '("\\.tar\\'" "\\.tgz\\'")
1912 "List of regexps; if one matches a file name, don't look for `-*-'.") 1920 "List of regexps; if one matches a file name, don't look for `-*-'.")
@@ -1935,12 +1943,14 @@ with that interpreter in `interpreter-mode-alist'.")
1935 (concat "\\(?:<\\?xml\\s +[^>]*>\\)?\\s *<" 1943 (concat "\\(?:<\\?xml\\s +[^>]*>\\)?\\s *<"
1936 comment-re "*" 1944 comment-re "*"
1937 "\\(?:!DOCTYPE\\s +[^>]*>\\s *<\\s *" comment-re "*\\)?" 1945 "\\(?:!DOCTYPE\\s +[^>]*>\\s *<\\s *" comment-re "*\\)?"
1938 "[Hh][Tt][Mm][Ll]")) . html-mode) 1946 "[Hh][Tt][Mm][Ll]"))
1947 . html-mode)
1939 ;; These two must come after html, because they are more general: 1948 ;; These two must come after html, because they are more general:
1940 ("<\\?xml " . xml-mode) 1949 ("<\\?xml " . xml-mode)
1941 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)") 1950 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
1942 (comment-re (concat "\\(?:!--" incomment-re "*-->\\s *<\\)"))) 1951 (comment-re (concat "\\(?:!--" incomment-re "*-->\\s *<\\)")))
1943 (concat "\\s *<" comment-re "*!DOCTYPE ")) . sgml-mode) 1952 (concat "\\s *<" comment-re "*!DOCTYPE "))
1953 . sgml-mode)
1944 ("%![^V]" . ps-mode) 1954 ("%![^V]" . ps-mode)
1945 ("# xmcd " . conf-unix-mode)) 1955 ("# xmcd " . conf-unix-mode))
1946 "Alist of buffer beginnings vs. corresponding major mode functions. 1956 "Alist of buffer beginnings vs. corresponding major mode functions.
@@ -2202,86 +2212,86 @@ is specified, returning t if it is specified."
2202 (save-excursion 2212 (save-excursion
2203 (goto-char (point-max)) 2213 (goto-char (point-max))
2204 (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move) 2214 (search-backward "\n\^L" (max (- (point-max) 3000) (point-min)) 'move)
2205 (if (let ((case-fold-search t)) 2215 (when (let ((case-fold-search t))
2206 (and (search-forward "Local Variables:" nil t) 2216 (and (search-forward "Local Variables:" nil t)
2207 (or (eq enable-local-variables t) 2217 (or (eq enable-local-variables t)
2208 mode-only 2218 mode-only
2209 (and enable-local-variables 2219 (and enable-local-variables
2210 (save-window-excursion 2220 (save-window-excursion
2211 (switch-to-buffer (current-buffer)) 2221 (switch-to-buffer (current-buffer))
2212 (save-excursion 2222 (save-excursion
2213 (beginning-of-line) 2223 (beginning-of-line)
2214 (set-window-start (selected-window) (point))) 2224 (set-window-start (selected-window) (point)))
2215 (y-or-n-p (format "Set local variables as specified at end of %s? " 2225 (y-or-n-p (format "Set local variables as specified at end of %s? "
2216 (if buffer-file-name 2226 (if buffer-file-name
2217 (file-name-nondirectory 2227 (file-name-nondirectory
2218 buffer-file-name) 2228 buffer-file-name)
2219 (concat "buffer " 2229 (concat "buffer "
2220 (buffer-name)))))))))) 2230 (buffer-name))))))))))
2221 (skip-chars-forward " \t") 2231 (skip-chars-forward " \t")
2222 (let ((enable-local-eval enable-local-eval) 2232 (let ((enable-local-eval enable-local-eval)
2223 ;; suffix is what comes after "local variables:" in its line. 2233 ;; suffix is what comes after "local variables:" in its line.
2224 (suffix 2234 (suffix
2225 (concat 2235 (concat
2226 (regexp-quote (buffer-substring (point) (line-end-position))) 2236 (regexp-quote (buffer-substring (point) (line-end-position)))
2227 "$")) 2237 "$"))
2228 ;; prefix is what comes before "local variables:" in its line. 2238 ;; prefix is what comes before "local variables:" in its line.
2229 (prefix 2239 (prefix
2230 (concat "^" (regexp-quote 2240 (concat "^" (regexp-quote
2231 (buffer-substring (line-beginning-position) 2241 (buffer-substring (line-beginning-position)
2232 (match-beginning 0))))) 2242 (match-beginning 0)))))
2233 beg) 2243 beg)
2234 2244
2235 (forward-line 1) 2245 (forward-line 1)
2236 (let ((startpos (point)) 2246 (let ((startpos (point))
2237 endpos 2247 endpos
2238 (thisbuf (current-buffer))) 2248 (thisbuf (current-buffer)))
2239 (save-excursion 2249 (save-excursion
2240 (if (not (re-search-forward 2250 (if (not (re-search-forward
2241 (concat prefix "[ \t]*End:[ \t]*" suffix) 2251 (concat prefix "[ \t]*End:[ \t]*" suffix)
2242 nil t)) 2252 nil t))
2243 (error "Local variables list is not properly terminated")) 2253 (error "Local variables list is not properly terminated"))
2244 (beginning-of-line) 2254 (beginning-of-line)
2245 (setq endpos (point))) 2255 (setq endpos (point)))
2246 2256
2247 (with-temp-buffer 2257 (with-temp-buffer
2248 (insert-buffer-substring thisbuf startpos endpos) 2258 (insert-buffer-substring thisbuf startpos endpos)
2249 (goto-char (point-min)) 2259 (goto-char (point-min))
2250 (subst-char-in-region (point) (point-max) ?\^m ?\n) 2260 (subst-char-in-region (point) (point-max) ?\^m ?\n)
2251 (while (not (eobp)) 2261 (while (not (eobp))
2252 ;; Discard the prefix. 2262 ;; Discard the prefix.
2253 (if (looking-at prefix) 2263 (if (looking-at prefix)
2254 (delete-region (point) (match-end 0)) 2264 (delete-region (point) (match-end 0))
2255 (error "Local variables entry is missing the prefix")) 2265 (error "Local variables entry is missing the prefix"))
2256 (end-of-line) 2266 (end-of-line)
2257 ;; Discard the suffix. 2267 ;; Discard the suffix.
2258 (if (looking-back suffix) 2268 (if (looking-back suffix)
2259 (delete-region (match-beginning 0) (point)) 2269 (delete-region (match-beginning 0) (point))
2260 (error "Local variables entry is missing the suffix")) 2270 (error "Local variables entry is missing the suffix"))
2261 (forward-line 1)) 2271 (forward-line 1))
2262 (goto-char (point-min)) 2272 (goto-char (point-min))
2263 2273
2264 (while (not (eobp)) 2274 (while (not (eobp))
2265 ;; Find the variable name; strip whitespace. 2275 ;; Find the variable name; strip whitespace.
2266 (skip-chars-forward " \t") 2276 (skip-chars-forward " \t")
2267 (setq beg (point)) 2277 (setq beg (point))
2268 (skip-chars-forward "^:\n") 2278 (skip-chars-forward "^:\n")
2269 (if (eolp) (error "Missing colon in local variables entry")) 2279 (if (eolp) (error "Missing colon in local variables entry"))
2270 (skip-chars-backward " \t") 2280 (skip-chars-backward " \t")
2271 (let* ((str (buffer-substring beg (point))) 2281 (let* ((str (buffer-substring beg (point)))
2272 (var (read str)) 2282 (var (read str))
2273 val) 2283 val)
2274 ;; Read the variable value. 2284 ;; Read the variable value.
2275 (skip-chars-forward "^:") 2285 (skip-chars-forward "^:")
2276 (forward-char 1) 2286 (forward-char 1)
2277 (setq val (read (current-buffer))) 2287 (setq val (read (current-buffer)))
2278 (if mode-only 2288 (if mode-only
2279 (if (eq var 'mode) 2289 (if (eq var 'mode)
2280 (setq mode-specified t)) 2290 (setq mode-specified t))
2281 ;; Set the variable. "Variables" mode and eval are funny. 2291 ;; Set the variable. "Variables" mode and eval are funny.
2282 (with-current-buffer thisbuf 2292 (with-current-buffer thisbuf
2283 (hack-one-local-variable var val)))) 2293 (hack-one-local-variable var val))))
2284 (forward-line 1))))))) 2294 (forward-line 1)))))))
2285 (unless mode-only 2295 (unless mode-only
2286 (run-hooks 'hack-local-variables-hook)) 2296 (run-hooks 'hack-local-variables-hook))
2287 mode-specified)) 2297 mode-specified))
@@ -3264,11 +3274,12 @@ Before and after saving the buffer, this function runs
3264;; but inhibited if one of write-file-functions returns non-nil. 3274;; but inhibited if one of write-file-functions returns non-nil.
3265;; It returns a value (MODES . BACKUPNAME), like backup-buffer. 3275;; It returns a value (MODES . BACKUPNAME), like backup-buffer.
3266(defun basic-save-buffer-1 () 3276(defun basic-save-buffer-1 ()
3267 (if save-buffer-coding-system 3277 (prog1
3268 (let ((coding-system-for-write save-buffer-coding-system)) 3278 (if save-buffer-coding-system
3279 (let ((coding-system-for-write save-buffer-coding-system))
3280 (basic-save-buffer-2))
3269 (basic-save-buffer-2)) 3281 (basic-save-buffer-2))
3270 (basic-save-buffer-2)) 3282 (setq buffer-file-coding-system-explicit last-coding-system-used)))
3271 (setq buffer-file-coding-system-explicit last-coding-system-used))
3272 3283
3273;; This returns a value (MODES . BACKUPNAME), like backup-buffer. 3284;; This returns a value (MODES . BACKUPNAME), like backup-buffer.
3274(defun basic-save-buffer-2 () 3285(defun basic-save-buffer-2 ()
@@ -4549,7 +4560,7 @@ normally equivalent short `-D' option is just passed on to
4549 error-lines) 4560 error-lines)
4550 ;; Find all the lines that are error messages, 4561 ;; Find all the lines that are error messages,
4551 ;; and record the bounds of each one. 4562 ;; and record the bounds of each one.
4552 (goto-char (point-min)) 4563 (goto-char beg)
4553 (while (< (point) linebeg) 4564 (while (< (point) linebeg)
4554 (or (eql (following-char) ?\s) 4565 (or (eql (following-char) ?\s)
4555 (push (list (point) (line-end-position)) error-lines)) 4566 (push (list (point) (line-end-position)) error-lines))
@@ -4575,11 +4586,9 @@ normally equivalent short `-D' option is just passed on to
4575 (end-of-line)))) 4586 (end-of-line))))
4576 (goto-char end) 4587 (goto-char end)
4577 (beginning-of-line) 4588 (beginning-of-line)
4578 (delete-region (point) (progn (forward-line 2) (point)))) 4589 (delete-region (point) (progn (forward-line 1) (point))))
4579 (forward-line 1)
4580 (if (looking-at "//DIRED-OPTIONS//") 4590 (if (looking-at "//DIRED-OPTIONS//")
4581 (delete-region (point) (progn (forward-line 1) (point))) 4591 (delete-region (point) (progn (forward-line 1) (point))))))
4582 (forward-line 1))))
4583 4592
4584 ;; Now decode what read if necessary. 4593 ;; Now decode what read if necessary.
4585 (let ((coding (or coding-system-for-read 4594 (let ((coding (or coding-system-for-read
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 46a1449ce79..4eee8bcbbfc 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12005-01-05 Reiner Steib <Reiner.Steib@gmx.de>
2
3 * spam.el (spam-face): New face. Don't use `gnus-splash-face'
4 which is unreadable in some setups.
5
12004-12-27 Simon Josefsson <jas@extundo.com> 62004-12-27 Simon Josefsson <jas@extundo.com>
2 7
3 * mm-bodies.el (mm-body-encoding): Don't permit 7-bit to be used 8 * mm-bodies.el (mm-body-encoding): Don't permit 7-bit to be used
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index a0b28340717..9a55ba9f318 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -298,7 +298,19 @@ All unmarked article in such group receive the spam mark on group entry."
298 :type '(radio (const nil) regexp) 298 :type '(radio (const nil) regexp)
299 :group 'spam) 299 :group 'spam)
300 300
301(defcustom spam-face 'gnus-splash-face 301(defface spam-face
302 '((((class color) (type tty) (background dark))
303 (:foreground "gray80" :background "gray50"))
304 (((class color) (type tty) (background light))
305 (:foreground "gray50" :background "gray80"))
306 (((class color) (background dark))
307 (:foreground "ivory2"))
308 (((class color) (background light))
309 (:foreground "ivory4"))
310 (t :inverse-video t))
311 "Face for spam-marked articles.")
312
313(defcustom spam-face 'spam-face
302 "Face for spam-marked articles." 314 "Face for spam-marked articles."
303 :type 'face 315 :type 'face
304 :group 'spam) 316 :group 'spam)
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 522c1e2c19d..9acadaa2fa6 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -216,6 +216,14 @@ ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"."
216 (intern (upcase name)))))) 216 (intern (upcase name))))))
217 arglist))) 217 arglist)))
218 218
219;;; Could be this, if we make symbol-file do the work below.
220;;; (defun help-C-file-name (subr-or-var kind)
221;;; "Return the name of the C file where SUBR-OR-VAR is defined.
222;;; KIND should be `var' for a variable or `subr' for a subroutine."
223;;; (symbol-file (if (symbolp subr-or-var) subr-or-var
224;;; (subr-name subr-or-var))
225;;; (if (eq kind 'var) 'defvar 'defun)))
226
219(defun help-C-file-name (subr-or-var kind) 227(defun help-C-file-name (subr-or-var kind)
220 "Return the name of the C file where SUBR-OR-VAR is defined. 228 "Return the name of the C file where SUBR-OR-VAR is defined.
221KIND should be `var' for a variable or `subr' for a subroutine." 229KIND should be `var' for a variable or `subr' for a subroutine."
@@ -231,8 +239,8 @@ KIND should be `var' for a variable or `subr' for a subroutine."
231 (let ((file (catch 'loop 239 (let ((file (catch 'loop
232 (while t 240 (while t
233 (let ((pnt (search-forward (concat "" name "\n")))) 241 (let ((pnt (search-forward (concat "" name "\n"))))
234 (re-search-backward "S\\(.*\\)") 242 (re-search-backward "S\\(.*\\)")
235 (let ((file (match-string 1))) 243 (let ((file (match-string 1)))
236 (if (member file build-files) 244 (if (member file build-files)
237 (throw 'loop file) 245 (throw 'loop file)
238 (goto-char pnt)))))))) 246 (goto-char pnt))))))))
@@ -463,9 +471,10 @@ face (according to `face-differs-from-default-p')."
463;; Variables 471;; Variables
464 472
465;;;###autoload 473;;;###autoload
466(defun variable-at-point () 474(defun variable-at-point (&optional any-symbol)
467 "Return the bound variable symbol found around point. 475 "Return the bound variable symbol found around point.
468Return 0 if there is no such symbol." 476Return 0 if there is no such symbol.
477If ANY-SYMBOL is non-nil, don't insist the symbol be bound."
469 (or (condition-case () 478 (or (condition-case ()
470 (with-syntax-table emacs-lisp-mode-syntax-table 479 (with-syntax-table emacs-lisp-mode-syntax-table
471 (save-excursion 480 (save-excursion
@@ -479,12 +488,12 @@ Return 0 if there is no such symbol."
479 (error nil)) 488 (error nil))
480 (let* ((str (find-tag-default)) 489 (let* ((str (find-tag-default))
481 (sym (if str (intern-soft str)))) 490 (sym (if str (intern-soft str))))
482 (if (and sym (boundp sym)) 491 (if (and sym (or any-symbol (boundp sym)))
483 sym 492 sym
484 (save-match-data 493 (save-match-data
485 (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str)) 494 (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str))
486 (setq sym (intern-soft (match-string 1 str))) 495 (setq sym (intern-soft (match-string 1 str)))
487 (and (boundp sym) sym))))) 496 (and (or any-symbol (boundp sym)) sym)))))
488 0)) 497 0))
489 498
490;;;###autoload 499;;;###autoload
diff --git a/lisp/help-macro.el b/lisp/help-macro.el
index a36eed86d01..3a7cf0898cb 100644
--- a/lisp/help-macro.el
+++ b/lisp/help-macro.el
@@ -121,7 +121,7 @@ and then returns."
121 (if three-step-help 121 (if three-step-help
122 (progn 122 (progn
123 (setq key (let ((overriding-local-map local-map)) 123 (setq key (let ((overriding-local-map local-map))
124 (read-key-sequence nil))) 124 (read-key-sequence nil)))
125 ;; Make the HELP key translate to C-h. 125 ;; Make the HELP key translate to C-h.
126 (if (lookup-key function-key-map key) 126 (if (lookup-key function-key-map key)
127 (setq key (lookup-key function-key-map key))) 127 (setq key (lookup-key function-key-map key)))
diff --git a/lisp/imenu.el b/lisp/imenu.el
index af617498b07..6ee72a88bc4 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -532,7 +532,7 @@ A nested sub-alist element looks like (INDEX-NAME SUB-ALIST).")
532 (push item keep-at-top) 532 (push item keep-at-top)
533 (setq menulist (delq item menulist)))) 533 (setq menulist (delq item menulist))))
534 (if imenu-sort-function 534 (if imenu-sort-function
535 (setq menulist (sort menulist imenu-sort-function))) 535 (setq menulist (sort (copy-sequence menulist) imenu-sort-function)))
536 (if (> (length menulist) imenu-max-items) 536 (if (> (length menulist) imenu-max-items)
537 (setq menulist 537 (setq menulist
538 (mapcar 538 (mapcar
@@ -817,32 +817,30 @@ depending on PATTERNS."
817 (setq start (point)) 817 (setq start (point))
818 (goto-char (match-end index)) 818 (goto-char (match-end index))
819 (setq beg (match-beginning index)) 819 (setq beg (match-beginning index))
820 (goto-char beg) 820 ;; Go to the start of the match.
821 ;; That's the official position of this definition.
822 (goto-char start)
821 (imenu-progress-message prev-pos nil t) 823 (imenu-progress-message prev-pos nil t)
822 ;; Add this sort of submenu only when we've found an 824 ;; Add this sort of submenu only when we've found an
823 ;; item for it, avoiding empty, duff menus. 825 ;; item for it, avoiding empty, duff menus.
824 (unless (assoc menu-title index-alist) 826 (unless (assoc menu-title index-alist)
825 (push (list menu-title) index-alist)) 827 (push (list menu-title) index-alist))
826 (if imenu-use-markers 828 (if imenu-use-markers
827 (setq beg (copy-marker beg))) 829 (setq start (copy-marker start)))
828 (let ((item 830 (let ((item
829 (if function 831 (if function
830 (nconc (list (match-string-no-properties index) 832 (nconc (list (match-string-no-properties index)
831 beg function) 833 start function)
832 rest) 834 rest)
833 (cons (match-string-no-properties index) 835 (cons (match-string-no-properties index)
834 beg))) 836 start)))
835 ;; This is the desired submenu, 837 ;; This is the desired submenu,
836 ;; starting with its title (or nil). 838 ;; starting with its title (or nil).
837 (menu (assoc menu-title index-alist))) 839 (menu (assoc menu-title index-alist)))
838 ;; Insert the item unless it is already present. 840 ;; Insert the item unless it is already present.
839 (unless (member item (cdr menu)) 841 (unless (member item (cdr menu))
840 (setcdr menu 842 (setcdr menu
841 (cons item (cdr menu))))) 843 (cons item (cdr menu))))))))
842 ;; Move to the start of the entire match,
843 ;; to ensure we keep moving backwards
844 ;; as long as the match is nonempty.
845 (goto-char start))))
846 (set-syntax-table old-table))) 844 (set-syntax-table old-table)))
847 (imenu-progress-message prev-pos 100 t) 845 (imenu-progress-message prev-pos 100 t)
848 ;; Sort each submenu by position. 846 ;; Sort each submenu by position.
diff --git a/lisp/info-look.el b/lisp/info-look.el
index bc886f0320c..4fc2c6b4c63 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -1,7 +1,7 @@
1;;; info-look.el --- major-mode-sensitive Info index lookup facility 1;;; info-look.el --- major-mode-sensitive Info index lookup facility
2;; An older version of this was known as libc.el. 2;; An older version of this was known as libc.el.
3 3
4;; Copyright (C) 1995,96,97,98,99,2001,03,04 Free Software Foundation, Inc. 4;; Copyright (C) 1995,96,97,98,99,2001,03,04,05 Free Software Foundation, Inc.
5 5
6;; Author: Ralph Schleicher <rs@nunatak.allgaeu.org> 6;; Author: Ralph Schleicher <rs@nunatak.allgaeu.org>
7;; (did not show signs of life (Nov 2001) -stef) 7;; (did not show signs of life (Nov 2001) -stef)
@@ -634,8 +634,15 @@ Return nil if there is nothing appropriate in the buffer near point."
634 :regexp "\\(struct \\|union \\|enum \\)?[_a-zA-Z][_a-zA-Z0-9]*" 634 :regexp "\\(struct \\|union \\|enum \\)?[_a-zA-Z][_a-zA-Z0-9]*"
635 :doc-spec '(("(libc)Function Index" nil 635 :doc-spec '(("(libc)Function Index" nil
636 "^[ \t]+-+ \\(Function\\|Macro\\): .*\\<" "\\>") 636 "^[ \t]+-+ \\(Function\\|Macro\\): .*\\<" "\\>")
637 ;; prefix/suffix has to match things like
638 ;; " -- Macro: int F_DUPFD"
639 ;; " -- Variable: char * tzname [2]"
640 ;; "`DBL_MAX'" (texinfo @table)
641 ;; suffix "\\>" is not used because that sends DBL_MAX to
642 ;; DBL_MAX_EXP ("_" is a non-word char)
637 ("(libc)Variable Index" nil 643 ("(libc)Variable Index" nil
638 "^[ \t]+-+ \\(Variable\\|Macro\\): .*\\<" "\\>") 644 "^\\([ \t]+-+ \\(Variable\\|Macro\\): .*\\<\\|`\\)"
645 "\\( \\|'?$\\)")
639 ("(libc)Type Index" nil 646 ("(libc)Type Index" nil
640 "^[ \t]+-+ Data Type: \\<" "\\>") 647 "^[ \t]+-+ Data Type: \\<" "\\>")
641 ("(termcap)Var Index" nil 648 ("(termcap)Var Index" nil
diff --git a/lisp/info.el b/lisp/info.el
index 750f302d422..4fcbdeb6330 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -47,6 +47,10 @@
47 "Stack of info nodes user has visited. 47 "Stack of info nodes user has visited.
48Each element of list is a list (FILENAME NODENAME BUFFERPOS).") 48Each element of list is a list (FILENAME NODENAME BUFFERPOS).")
49 49
50(defvar Info-history-forward nil
51 "Stack of info nodes user has visited with `Info-history-back' command.
52Each element of list is a list (FILENAME NODENAME BUFFERPOS).")
53
50(defvar Info-history-list nil 54(defvar Info-history-list nil
51 "List of all info nodes user has visited. 55 "List of all info nodes user has visited.
52Each element of list is a list (FILENAME NODENAME).") 56Each element of list is a list (FILENAME NODENAME).")
@@ -1295,7 +1299,8 @@ any double quotes or backslashes must be escaped (\\\",\\\\)."
1295 ;; Add a new unique history item to full history list 1299 ;; Add a new unique history item to full history list
1296 (let ((new-history (list Info-current-file Info-current-node))) 1300 (let ((new-history (list Info-current-file Info-current-node)))
1297 (setq Info-history-list 1301 (setq Info-history-list
1298 (cons new-history (delete new-history Info-history-list)))) 1302 (cons new-history (delete new-history Info-history-list)))
1303 (setq Info-history-forward nil))
1299 (if (not (eq Info-fontify-maximum-menu-size nil)) 1304 (if (not (eq Info-fontify-maximum-menu-size nil))
1300 (Info-fontify-node)) 1305 (Info-fontify-node))
1301 (Info-display-images-node) 1306 (Info-display-images-node)
@@ -1731,18 +1736,38 @@ If SAME-FILE is non-nil, do not move to a different Info file."
1731 (goto-char p) 1736 (goto-char p)
1732 (Info-restore-point Info-history)))) 1737 (Info-restore-point Info-history))))
1733 1738
1734(defun Info-last () 1739(defun Info-history-back ()
1735 "Go back to the last node visited." 1740 "Go back in the history to the last node visited."
1736 (interactive) 1741 (interactive)
1737 (or Info-history 1742 (or Info-history
1738 (error "This is the first Info node you looked at")) 1743 (error "This is the first Info node you looked at"))
1739 (let (filename nodename opoint) 1744 (let ((history-forward
1745 (cons (list Info-current-file Info-current-node (point))
1746 Info-history-forward))
1747 filename nodename opoint)
1740 (setq filename (car (car Info-history))) 1748 (setq filename (car (car Info-history)))
1741 (setq nodename (car (cdr (car Info-history)))) 1749 (setq nodename (car (cdr (car Info-history))))
1742 (setq opoint (car (cdr (cdr (car Info-history))))) 1750 (setq opoint (car (cdr (cdr (car Info-history)))))
1743 (setq Info-history (cdr Info-history)) 1751 (setq Info-history (cdr Info-history))
1744 (Info-find-node filename nodename) 1752 (Info-find-node filename nodename)
1745 (setq Info-history (cdr Info-history)) 1753 (setq Info-history (cdr Info-history))
1754 (setq Info-history-forward history-forward)
1755 (goto-char opoint)))
1756
1757(defalias 'Info-last 'Info-history-back)
1758
1759(defun Info-history-forward ()
1760 "Go forward in the history of visited nodes."
1761 (interactive)
1762 (or Info-history-forward
1763 (error "This is the last Info node you looked at"))
1764 (let ((history-forward (cdr Info-history-forward))
1765 filename nodename opoint)
1766 (setq filename (car (car Info-history-forward)))
1767 (setq nodename (car (cdr (car Info-history-forward))))
1768 (setq opoint (car (cdr (cdr (car Info-history-forward)))))
1769 (Info-find-node filename nodename)
1770 (setq Info-history-forward history-forward)
1746 (goto-char opoint))) 1771 (goto-char opoint)))
1747 1772
1748;;;###autoload 1773;;;###autoload
@@ -2894,12 +2919,13 @@ if point is in a menu item description, follow that menu item."
2894 (define-key Info-mode-map "g" 'Info-goto-node) 2919 (define-key Info-mode-map "g" 'Info-goto-node)
2895 (define-key Info-mode-map "h" 'Info-help) 2920 (define-key Info-mode-map "h" 'Info-help)
2896 (define-key Info-mode-map "i" 'Info-index) 2921 (define-key Info-mode-map "i" 'Info-index)
2897 (define-key Info-mode-map "l" 'Info-last) 2922 (define-key Info-mode-map "l" 'Info-history-back)
2898 (define-key Info-mode-map "L" 'Info-history) 2923 (define-key Info-mode-map "L" 'Info-history)
2899 (define-key Info-mode-map "m" 'Info-menu) 2924 (define-key Info-mode-map "m" 'Info-menu)
2900 (define-key Info-mode-map "n" 'Info-next) 2925 (define-key Info-mode-map "n" 'Info-next)
2901 (define-key Info-mode-map "p" 'Info-prev) 2926 (define-key Info-mode-map "p" 'Info-prev)
2902 (define-key Info-mode-map "q" 'Info-exit) 2927 (define-key Info-mode-map "q" 'Info-exit)
2928 (define-key Info-mode-map "r" 'Info-history-forward)
2903 (define-key Info-mode-map "s" 'Info-search) 2929 (define-key Info-mode-map "s" 'Info-search)
2904 (define-key Info-mode-map "S" 'Info-search-case-sensitively) 2930 (define-key Info-mode-map "S" 'Info-search-case-sensitively)
2905 ;; For consistency with Rmail. 2931 ;; For consistency with Rmail.
@@ -2913,6 +2939,7 @@ if point is in a menu item description, follow that menu item."
2913 (define-key Info-mode-map "," 'Info-index-next) 2939 (define-key Info-mode-map "," 'Info-index-next)
2914 (define-key Info-mode-map "\177" 'Info-scroll-down) 2940 (define-key Info-mode-map "\177" 'Info-scroll-down)
2915 (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node) 2941 (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node)
2942 (define-key Info-mode-map [follow-link] 'mouse-face)
2916 ) 2943 )
2917 2944
2918(defun Info-check-pointer (item) 2945(defun Info-check-pointer (item)
@@ -2951,8 +2978,10 @@ if point is in a menu item description, follow that menu item."
2951 :help "Search for another occurrence of regular expression"] 2978 :help "Search for another occurrence of regular expression"]
2952 ["Go to Node..." Info-goto-node 2979 ["Go to Node..." Info-goto-node
2953 :help "Go to a named node"] 2980 :help "Go to a named node"]
2954 ["Last" Info-last :active Info-history 2981 ["Back in history" Info-history-back :active Info-history
2955 :help "Go to the last node you were at"] 2982 :help "Go back in history to the last node you were at"]
2983 ["Forward in history" Info-history-forward :active Info-history-forward
2984 :help "Go forward in history"]
2956 ["History" Info-history :active Info-history-list 2985 ["History" Info-history :active Info-history-list
2957 :help "Go to menu of visited nodes"] 2986 :help "Go to menu of visited nodes"]
2958 ["Table of Contents" Info-toc 2987 ["Table of Contents" Info-toc
@@ -2980,7 +3009,8 @@ if point is in a menu item description, follow that menu item."
2980 (tool-bar-local-item-from-menu 'Info-prev "left_arrow" map Info-mode-map) 3009 (tool-bar-local-item-from-menu 'Info-prev "left_arrow" map Info-mode-map)
2981 (tool-bar-local-item-from-menu 'Info-next "right_arrow" map Info-mode-map) 3010 (tool-bar-local-item-from-menu 'Info-next "right_arrow" map Info-mode-map)
2982 (tool-bar-local-item-from-menu 'Info-up "up_arrow" map Info-mode-map) 3011 (tool-bar-local-item-from-menu 'Info-up "up_arrow" map Info-mode-map)
2983 (tool-bar-local-item-from-menu 'Info-last "undo" map Info-mode-map) 3012 (tool-bar-local-item-from-menu 'Info-history-back "back_arrow" map Info-mode-map)
3013 (tool-bar-local-item-from-menu 'Info-history-forward "fwd_arrow" map Info-mode-map)
2984 (tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map) 3014 (tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map)
2985 (tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map) 3015 (tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map)
2986 (tool-bar-local-item-from-menu 'Info-goto-node "jump_to" map Info-mode-map) 3016 (tool-bar-local-item-from-menu 'Info-goto-node "jump_to" map Info-mode-map)
@@ -3100,7 +3130,8 @@ Selecting other nodes:
3100 Picking a menu item causes another node to be selected. 3130 Picking a menu item causes another node to be selected.
3101\\[Info-directory] Go to the Info directory node. 3131\\[Info-directory] Go to the Info directory node.
3102\\[Info-follow-reference] Follow a cross reference. Reads name of reference. 3132\\[Info-follow-reference] Follow a cross reference. Reads name of reference.
3103\\[Info-last] Move to the last node you were at. 3133\\[Info-history-back] Move back in history to the last node you were at.
3134\\[Info-history-forward] Move forward in history to the node you returned from after using \\[Info-history-back].
3104\\[Info-history] Go to menu of visited nodes. 3135\\[Info-history] Go to menu of visited nodes.
3105\\[Info-toc] Go to table of contents of the current Info file. 3136\\[Info-toc] Go to table of contents of the current Info file.
3106\\[Info-top-node] Go to the Top node of this file. 3137\\[Info-top-node] Go to the Top node of this file.
@@ -3157,6 +3188,7 @@ Advanced commands:
3157 (make-local-variable 'Info-tag-table-buffer) 3188 (make-local-variable 'Info-tag-table-buffer)
3158 (setq Info-tag-table-buffer nil) 3189 (setq Info-tag-table-buffer nil)
3159 (make-local-variable 'Info-history) 3190 (make-local-variable 'Info-history)
3191 (make-local-variable 'Info-history-forward)
3160 (make-local-variable 'Info-index-alternatives) 3192 (make-local-variable 'Info-index-alternatives)
3161 (setq header-line-format 3193 (setq header-line-format
3162 (if Info-use-header-line 3194 (if Info-use-header-line
@@ -3368,7 +3400,7 @@ COMMAND must be a symbol or string."
3368 (message "Found %d other entr%s. Use %s to see %s." 3400 (message "Found %d other entr%s. Use %s to see %s."
3369 (1- num-matches) 3401 (1- num-matches)
3370 (if (> num-matches 2) "ies" "y") 3402 (if (> num-matches 2) "ies" "y")
3371 (substitute-command-keys "\\[Info-last]") 3403 (substitute-command-keys "\\[Info-history-back]")
3372 (if (> num-matches 2) "them" "it"))))) 3404 (if (> num-matches 2) "them" "it")))))
3373 (error "Couldn't find documentation for %s" command)))) 3405 (error "Couldn't find documentation for %s" command))))
3374 3406
@@ -3453,6 +3485,7 @@ Preserve text properties."
3453 (define-key keymap [header-line mouse-2] 'Info-next) 3485 (define-key keymap [header-line mouse-2] 'Info-next)
3454 (define-key keymap [header-line down-mouse-1] 'ignore) 3486 (define-key keymap [header-line down-mouse-1] 'ignore)
3455 (define-key keymap [mouse-2] 'Info-next) 3487 (define-key keymap [mouse-2] 'Info-next)
3488 (define-key keymap [follow-link] 'mouse-face)
3456 keymap) 3489 keymap)
3457 "Keymap to put on the Next link in the text or the header line.") 3490 "Keymap to put on the Next link in the text or the header line.")
3458 3491
@@ -3462,6 +3495,7 @@ Preserve text properties."
3462 (define-key keymap [header-line mouse-2] 'Info-prev) 3495 (define-key keymap [header-line mouse-2] 'Info-prev)
3463 (define-key keymap [header-line down-mouse-1] 'ignore) 3496 (define-key keymap [header-line down-mouse-1] 'ignore)
3464 (define-key keymap [mouse-2] 'Info-prev) 3497 (define-key keymap [mouse-2] 'Info-prev)
3498 (define-key keymap [follow-link] 'mouse-face)
3465 keymap) 3499 keymap)
3466 "Keymap to put on the Prev link in the text or the header line.") 3500 "Keymap to put on the Prev link in the text or the header line.")
3467 3501
@@ -3472,6 +3506,7 @@ Preserve text properties."
3472 (define-key keymap [header-line mouse-2] 'Info-up) 3506 (define-key keymap [header-line mouse-2] 'Info-up)
3473 (define-key keymap [header-line down-mouse-1] 'ignore) 3507 (define-key keymap [header-line down-mouse-1] 'ignore)
3474 (define-key keymap [mouse-2] 'Info-up) 3508 (define-key keymap [mouse-2] 'Info-up)
3509 (define-key keymap [follow-link] 'mouse-face)
3475 keymap) 3510 keymap)
3476 "Keymap to put on the Up link in the text or the header line.") 3511 "Keymap to put on the Up link in the text or the header line.")
3477 3512
@@ -3506,7 +3541,7 @@ Preserve text properties."
3506 (put-text-property tbeg nend 'mouse-face 'highlight) 3541 (put-text-property tbeg nend 'mouse-face 'highlight)
3507 (put-text-property tbeg nend 3542 (put-text-property tbeg nend
3508 'help-echo 3543 'help-echo
3509 (concat "Go to node " 3544 (concat "mouse-2: Go to node "
3510 (buffer-substring nbeg nend))) 3545 (buffer-substring nbeg nend)))
3511 ;; Always set up the text property keymap. 3546 ;; Always set up the text property keymap.
3512 ;; It will either be used in the buffer 3547 ;; It will either be used in the buffer
diff --git a/lisp/isearch.el b/lisp/isearch.el
index fb31c3a2587..7702707c6ac 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1,7 +1,7 @@
1;;; isearch.el --- incremental search minor mode 1;;; isearch.el --- incremental search minor mode
2 2
3;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1999, 3;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1999,
4;; 2000, 2001, 2003, 2004 Free Software Foundation, Inc. 4;; 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
5 5
6;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu> 6;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
7;; Maintainer: FSF 7;; Maintainer: FSF
@@ -120,11 +120,6 @@ a tab, a carriage return (control-M), a newline, and `]+'."
120 :type 'regexp 120 :type 'regexp
121 :group 'isearch) 121 :group 'isearch)
122 122
123(defcustom search-highlight t
124 "*Non-nil means incremental search highlights the current match."
125 :type 'boolean
126 :group 'isearch)
127
128(defcustom search-invisible 'open 123(defcustom search-invisible 'open
129 "If t incremental search can match hidden text. 124 "If t incremental search can match hidden text.
130nil means don't match invisible text. 125nil means don't match invisible text.
@@ -199,6 +194,98 @@ Default value, nil, means edit the string instead."
199 :type 'boolean 194 :type 'boolean
200 :group 'isearch) 195 :group 'isearch)
201 196
197;;; isearch highlight customization.
198
199(defcustom search-highlight t
200 "*Non-nil means incremental search highlights the current match."
201 :type 'boolean
202 :group 'isearch)
203
204(defface isearch
205 '((((class color) (min-colors 88) (background light))
206 ;; The background must not be too dark, for that means
207 ;; the character is hard to see when the cursor is there.
208 (:background "magenta2" :foreground "lightskyblue1"))
209 (((class color) (min-colors 88) (background dark))
210 (:background "palevioletred2" :foreground "brown4"))
211 (((class color) (min-colors 16))
212 (:background "magenta4" :foreground "cyan1"))
213 (((class color) (min-colors 8))
214 (:background "magenta4" :foreground "cyan1"))
215 (t (:inverse-video t)))
216 "Face for highlighting Isearch matches."
217 :group 'isearch)
218(defvar isearch 'isearch)
219
220(defcustom isearch-lazy-highlight t
221 "*Controls the lazy-highlighting during incremental search.
222When non-nil, all text in the buffer matching the current search
223string is highlighted lazily (see `lazy-highlight-initial-delay'
224and `lazy-highlight-interval')."
225 :type 'boolean
226 :group 'lazy-highlight
227 :group 'isearch)
228
229;;; Lazy highlight customization.
230
231(defgroup lazy-highlight nil
232 "Lazy highlighting feature for matching strings."
233 :prefix "lazy-highlight-"
234 :version "21.1"
235 :group 'isearch
236 :group 'matching)
237
238(defcustom lazy-highlight-cleanup t
239 "*Controls whether to remove extra highlighting after a search.
240If this is nil, extra highlighting can be \"manually\" removed with
241\\[isearch-lazy-highlight-cleanup]."
242 :type 'boolean
243 :group 'lazy-highlight)
244(defvaralias 'isearch-lazy-highlight-cleanup 'lazy-highlight-cleanup)
245(make-obsolete-variable 'isearch-lazy-highlight-cleanup 'lazy-highlight-cleanup)
246
247(defcustom lazy-highlight-initial-delay 0.25
248 "*Seconds to wait before beginning to lazily highlight all matches."
249 :type 'number
250 :group 'lazy-highlight)
251(defvaralias 'isearch-lazy-highlight-initial-delay 'lazy-highlight-initial-delay)
252(make-obsolete-variable 'isearch-lazy-highlight-initial-delay 'lazy-highlight-initial-delay)
253
254(defcustom lazy-highlight-interval 0 ; 0.0625
255 "*Seconds between lazily highlighting successive matches."
256 :type 'number
257 :group 'lazy-highlight)
258(defvaralias 'isearch-lazy-highlight-interval 'lazy-highlight-interval)
259(make-obsolete-variable 'isearch-lazy-highlight-interval 'lazy-highlight-interval)
260
261(defcustom lazy-highlight-max-at-a-time 20
262 "*Maximum matches to highlight at a time (for `lazy-highlight').
263Larger values may reduce isearch's responsiveness to user input;
264smaller values make matches highlight slowly.
265A value of nil means highlight all matches."
266 :type '(choice (const :tag "All" nil)
267 (integer :tag "Some"))
268 :group 'lazy-highlight)
269(defvaralias 'isearch-lazy-highlight-max-at-a-time 'lazy-highlight-max-at-a-time)
270(make-obsolete-variable 'isearch-lazy-highlight-max-at-a-time 'lazy-highlight-max-at-a-time)
271
272(defface lazy-highlight
273 '((((class color) (min-colors 88) (background light))
274 (:background "paleturquoise"))
275 (((class color) (min-colors 88) (background dark))
276 (:background "paleturquoise4"))
277 (((class color) (min-colors 16))
278 (:background "turquoise3"))
279 (((class color) (min-colors 8))
280 (:background "turquoise3"))
281 (t (:underline t)))
282 "Face for lazy highlighting of matches other than the current one."
283 :group 'lazy-highlight)
284(put 'isearch-lazy-highlight-face 'face-alias 'lazy-highlight)
285(defvar lazy-highlight-face 'lazy-highlight)
286(defvaralias 'isearch-lazy-highlight-face 'lazy-highlight-face)
287(make-obsolete-variable 'isearch-lazy-highlight-face 'lazy-highlight-face)
288
202;; Define isearch-mode keymap. 289;; Define isearch-mode keymap.
203 290
204(defvar isearch-mode-map 291(defvar isearch-mode-map
@@ -644,7 +731,7 @@ is treated as a regexp. See \\[isearch-forward] for more info."
644 (if (< isearch-other-end (point)) ; isearch-forward? 731 (if (< isearch-other-end (point)) ; isearch-forward?
645 (isearch-highlight isearch-other-end (point)) 732 (isearch-highlight isearch-other-end (point))
646 (isearch-highlight (point) isearch-other-end)) 733 (isearch-highlight (point) isearch-other-end))
647 (isearch-dehighlight nil)) 734 (isearch-dehighlight))
648 )) 735 ))
649 (setq ;; quit-flag nil not for isearch-mode 736 (setq ;; quit-flag nil not for isearch-mode
650 isearch-adjusted nil 737 isearch-adjusted nil
@@ -672,8 +759,8 @@ is treated as a regexp. See \\[isearch-forward] for more info."
672 (setq overriding-terminal-local-map nil) 759 (setq overriding-terminal-local-map nil)
673 ;; (setq pre-command-hook isearch-old-pre-command-hook) ; for lemacs 760 ;; (setq pre-command-hook isearch-old-pre-command-hook) ; for lemacs
674 (setq minibuffer-message-timeout isearch-original-minibuffer-message-timeout) 761 (setq minibuffer-message-timeout isearch-original-minibuffer-message-timeout)
675 (isearch-dehighlight t) 762 (isearch-dehighlight)
676 (isearch-lazy-highlight-cleanup isearch-lazy-highlight-cleanup) 763 (isearch-lazy-highlight-cleanup lazy-highlight-cleanup)
677 (let ((found-start (window-start (selected-window))) 764 (let ((found-start (window-start (selected-window)))
678 (found-point (point))) 765 (found-point (point)))
679 (if isearch-window-configuration 766 (if isearch-window-configuration
@@ -2142,31 +2229,8 @@ Can be changed via `isearch-search-fun-function' for special needs."
2142 (setq isearch-hidden t))))))) 2229 (setq isearch-hidden t)))))))
2143 2230
2144 2231
2145;; Highlighting
2146
2147(defvar isearch-overlay nil)
2148
2149(defun isearch-highlight (beg end)
2150 (unless (null search-highlight)
2151 (cond (isearch-overlay
2152 ;; Overlay already exists, just move it.
2153 (move-overlay isearch-overlay beg end (current-buffer)))
2154
2155 (t
2156 ;; Overlay doesn't exist, create it.
2157 (setq isearch-overlay (make-overlay beg end))
2158 (overlay-put isearch-overlay 'face isearch)
2159 (overlay-put isearch-overlay 'priority 1) ;higher than lazy overlays
2160 ))))
2161
2162(defun isearch-dehighlight (totally)
2163 (when isearch-overlay
2164 (delete-overlay isearch-overlay)))
2165
2166
2167;; General utilities 2232;; General utilities
2168 2233
2169
2170(defun isearch-no-upper-case-p (string regexp-flag) 2234(defun isearch-no-upper-case-p (string regexp-flag)
2171 "Return t if there are no upper case chars in STRING. 2235 "Return t if there are no upper case chars in STRING.
2172If REGEXP-FLAG is non-nil, disregard letters preceded by `\\' (but not `\\\\') 2236If REGEXP-FLAG is non-nil, disregard letters preceded by `\\' (but not `\\\\')
@@ -2198,12 +2262,33 @@ since they have special meaning in a regexp."
2198 (append char-or-events unread-command-events))) 2262 (append char-or-events unread-command-events)))
2199 2263
2200 2264
2265;; Highlighting
2266
2267(defvar isearch-overlay nil)
2268
2269(defun isearch-highlight (beg end)
2270 (unless (null search-highlight)
2271 (cond (isearch-overlay
2272 ;; Overlay already exists, just move it.
2273 (move-overlay isearch-overlay beg end (current-buffer)))
2274
2275 (t
2276 ;; Overlay doesn't exist, create it.
2277 (setq isearch-overlay (make-overlay beg end))
2278 (overlay-put isearch-overlay 'face isearch)
2279 (overlay-put isearch-overlay 'priority 1) ;higher than lazy overlays
2280 ))))
2281
2282(defun isearch-dehighlight ()
2283 (when isearch-overlay
2284 (delete-overlay isearch-overlay)))
2285
2201;; isearch-lazy-highlight feature 2286;; isearch-lazy-highlight feature
2202;; by Bob Glickstein <http://www.zanshin.com/~bobg/> 2287;; by Bob Glickstein <http://www.zanshin.com/~bobg/>
2203 2288
2204;; When active, *every* match for the current search string is 2289;; When active, *every* match for the current search string is
2205;; highlighted: the current one using the normal isearch match color 2290;; highlighted: the current one using the normal isearch match color
2206;; and all the others using `isearch-lazy-highlight-face'. The extra 2291;; and all the others using `isearch-lazy-highlight'. The extra
2207;; highlighting makes it easier to anticipate where the cursor will 2292;; highlighting makes it easier to anticipate where the cursor will
2208;; land each time you press C-s or C-r to repeat a pending search. 2293;; land each time you press C-s or C-r to repeat a pending search.
2209;; Highlighting of these additional matches happens in a deferred 2294;; Highlighting of these additional matches happens in a deferred
@@ -2223,81 +2308,6 @@ since they have special meaning in a regexp."
2223;; - the variable `isearch-invalid-regexp' is expected to be true 2308;; - the variable `isearch-invalid-regexp' is expected to be true
2224;; iff `isearch-string' is an invalid regexp. 2309;; iff `isearch-string' is an invalid regexp.
2225 2310
2226(defgroup isearch-lazy-highlight nil
2227 "Lazy highlighting feature for incremental search."
2228 :prefix "isearch-lazy-highlight-"
2229 :version "21.1"
2230 :group 'isearch)
2231
2232(defcustom isearch-lazy-highlight t
2233 "*Controls the lazy-highlighting during incremental searches.
2234When non-nil, all text in the buffer matching the current search
2235string is highlighted lazily (see `isearch-lazy-highlight-initial-delay'
2236and `isearch-lazy-highlight-interval')."
2237 :type 'boolean
2238 :group 'isearch-lazy-highlight)
2239
2240(defcustom isearch-lazy-highlight-cleanup t
2241 "*Controls whether to remove extra highlighting after a search.
2242If this is nil, extra highlighting can be \"manually\" removed with
2243\\[isearch-lazy-highlight-cleanup]."
2244 :type 'boolean
2245 :group 'isearch-lazy-highlight)
2246
2247(defcustom isearch-lazy-highlight-initial-delay 0.25
2248 "*Seconds to wait before beginning to lazily highlight all matches."
2249 :type 'number
2250 :group 'isearch-lazy-highlight)
2251
2252(defcustom isearch-lazy-highlight-interval 0 ; 0.0625
2253 "*Seconds between lazily highlighting successive matches."
2254 :type 'number
2255 :group 'isearch-lazy-highlight)
2256
2257(defcustom isearch-lazy-highlight-max-at-a-time 20
2258 "*Maximum matches to highlight at a time (for `isearch-lazy-highlight').
2259Larger values may reduce isearch's responsiveness to user input;
2260smaller values make matches highlight slowly.
2261A value of nil means highlight all matches."
2262 :type '(choice (const :tag "All" nil)
2263 (integer :tag "Some"))
2264 :group 'isearch-lazy-highlight)
2265
2266(defgroup isearch-faces nil
2267 "Lazy highlighting feature for incremental search."
2268 :version "21.1"
2269 :group 'isearch)
2270
2271(defface isearch
2272 '((((class color) (min-colors 88) (background light))
2273 ;; The background must not be too dark, for that means
2274 ;; the character is hard to see when the cursor is there.
2275 (:background "magenta2" :foreground "lightskyblue1"))
2276 (((class color) (min-colors 88) (background dark))
2277 (:background "palevioletred2" :foreground "brown4"))
2278 (((class color) (min-colors 16))
2279 (:background "magenta4" :foreground "cyan1"))
2280 (((class color) (min-colors 8))
2281 (:background "magenta4" :foreground "cyan1"))
2282 (t (:inverse-video t)))
2283 "Face for highlighting Isearch matches."
2284 :group 'isearch-faces)
2285(defvar isearch 'isearch)
2286
2287(defface isearch-lazy-highlight-face
2288 '((((class color) (min-colors 88) (background light))
2289 (:background "paleturquoise"))
2290 (((class color) (min-colors 88) (background dark))
2291 (:background "paleturquoise4"))
2292 (((class color) (min-colors 16))
2293 (:background "turquoise3"))
2294 (((class color) (min-colors 8))
2295 (:background "turquoise3"))
2296 (t (:underline t)))
2297 "Face for lazy highlighting of Isearch matches other than the current one."
2298 :group 'isearch-faces)
2299(defvar isearch-lazy-highlight-face 'isearch-lazy-highlight-face)
2300
2301(defvar isearch-lazy-highlight-overlays nil) 2311(defvar isearch-lazy-highlight-overlays nil)
2302(defvar isearch-lazy-highlight-wrapped nil) 2312(defvar isearch-lazy-highlight-wrapped nil)
2303(defvar isearch-lazy-highlight-start nil) 2313(defvar isearch-lazy-highlight-start nil)
@@ -2312,11 +2322,11 @@ A value of nil means highlight all matches."
2312 2322
2313(defun isearch-lazy-highlight-cleanup (&optional force) 2323(defun isearch-lazy-highlight-cleanup (&optional force)
2314 "Stop lazy highlighting and remove extra highlighting from current buffer. 2324 "Stop lazy highlighting and remove extra highlighting from current buffer.
2315FORCE non-nil means do it whether or not `isearch-lazy-highlight-cleanup' 2325FORCE non-nil means do it whether or not `lazy-highlight-cleanup'
2316is nil. This function is called when exiting an incremental search if 2326is nil. This function is called when exiting an incremental search if
2317`isearch-lazy-highlight-cleanup' is non-nil." 2327`lazy-highlight-cleanup' is non-nil."
2318 (interactive '(t)) 2328 (interactive '(t))
2319 (if (or force isearch-lazy-highlight-cleanup) 2329 (if (or force lazy-highlight-cleanup)
2320 (while isearch-lazy-highlight-overlays 2330 (while isearch-lazy-highlight-overlays
2321 (delete-overlay (car isearch-lazy-highlight-overlays)) 2331 (delete-overlay (car isearch-lazy-highlight-overlays))
2322 (setq isearch-lazy-highlight-overlays 2332 (setq isearch-lazy-highlight-overlays
@@ -2326,7 +2336,7 @@ is nil. This function is called when exiting an incremental search if
2326 (setq isearch-lazy-highlight-timer nil))) 2336 (setq isearch-lazy-highlight-timer nil)))
2327 2337
2328(defun isearch-lazy-highlight-new-loop () 2338(defun isearch-lazy-highlight-new-loop ()
2329 "Cleanup any previous `isearch-lazy-highlight' loop and begin a new one. 2339 "Cleanup any previous `lazy-highlight' loop and begin a new one.
2330This happens when `isearch-update' is invoked (which can cause the 2340This happens when `isearch-update' is invoked (which can cause the
2331search string to change or the window to scroll)." 2341search string to change or the window to scroll)."
2332 (when (and (null executing-kbd-macro) 2342 (when (and (null executing-kbd-macro)
@@ -2357,7 +2367,7 @@ search string to change or the window to scroll)."
2357 isearch-lazy-highlight-wrapped nil) 2367 isearch-lazy-highlight-wrapped nil)
2358 (unless (equal isearch-string "") 2368 (unless (equal isearch-string "")
2359 (setq isearch-lazy-highlight-timer 2369 (setq isearch-lazy-highlight-timer
2360 (run-with-idle-timer isearch-lazy-highlight-initial-delay nil 2370 (run-with-idle-timer lazy-highlight-initial-delay nil
2361 'isearch-lazy-highlight-update)))))) 2371 'isearch-lazy-highlight-update))))))
2362 2372
2363(defun isearch-lazy-highlight-search () 2373(defun isearch-lazy-highlight-search ()
@@ -2378,7 +2388,7 @@ Attempt to do the search exactly the way the pending isearch would."
2378 2388
2379(defun isearch-lazy-highlight-update () 2389(defun isearch-lazy-highlight-update ()
2380 "Update highlighting of other matches for current search." 2390 "Update highlighting of other matches for current search."
2381 (let ((max isearch-lazy-highlight-max-at-a-time) 2391 (let ((max lazy-highlight-max-at-a-time)
2382 (looping t) 2392 (looping t)
2383 nomore) 2393 nomore)
2384 (with-local-quit 2394 (with-local-quit
@@ -2437,7 +2447,7 @@ Attempt to do the search exactly the way the pending isearch would."
2437 (goto-char (window-end))))))) 2447 (goto-char (window-end)))))))
2438 (unless nomore 2448 (unless nomore
2439 (setq isearch-lazy-highlight-timer 2449 (setq isearch-lazy-highlight-timer
2440 (run-at-time isearch-lazy-highlight-interval nil 2450 (run-at-time lazy-highlight-interval nil
2441 'isearch-lazy-highlight-update))))))))) 2451 'isearch-lazy-highlight-update)))))))))
2442 2452
2443(defun isearch-resume (search regexp word forward message case-fold) 2453(defun isearch-resume (search regexp word forward message case-fold)
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index 8cbe1d80cd3..76ef87ee845 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -51,9 +51,26 @@ a buffer with no associated file, or an `eval-region', return nil."
51 (error "%S is not a currently loaded feature" feature) 51 (error "%S is not a currently loaded feature" feature)
52 (car (feature-symbols feature)))) 52 (car (feature-symbols feature))))
53 53
54(defun file-loadhist-lookup (file)
55 "Return the `load-history' element for FILE."
56 ;; First look for FILE as given.
57 (let ((symbols (assoc file load-history)))
58 ;; Try converting a library name to an absolute file name.
59 (and (null symbols)
60 (let ((absname (find-library-name file)))
61 (if (not (equal absname file))
62 (setq symbols (cdr (assoc absname load-history))))))
63 ;; Try converting an absolute file name to a library name.
64 (and (null symbols) (string-match "[.]el\\'" file)
65 (let ((libname (file-name-nondirectory file)))
66 (string-match "[.]el\\'" libname)
67 (setq libname (substring libname 0 (match-beginning 0)))
68 (setq symbols (cdr (assoc libname load-history)))))
69 symbols))
70
54(defun file-provides (file) 71(defun file-provides (file)
55 "Return the list of features provided by FILE." 72 "Return the list of features provided by FILE."
56 (let ((symbols (cdr (assoc file load-history))) 73 (let ((symbols (file-loadhist-lookup file))
57 provides) 74 provides)
58 (mapc (lambda (x) 75 (mapc (lambda (x)
59 (if (and (consp x) (eq (car x) 'provide)) 76 (if (and (consp x) (eq (car x) 'provide))
@@ -63,7 +80,7 @@ a buffer with no associated file, or an `eval-region', return nil."
63 80
64(defun file-requires (file) 81(defun file-requires (file)
65 "Return the list of features required by FILE." 82 "Return the list of features required by FILE."
66 (let ((symbols (cdr (assoc file load-history))) 83 (let ((symbols (file-loadhist-lookup file))
67 requires) 84 requires)
68 (mapc (lambda (x) 85 (mapc (lambda (x)
69 (if (and (consp x) (eq (car x) 'require)) 86 (if (and (consp x) (eq (car x) 'require))
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index 1b94f179f94..2f973cdfbb9 100644
--- a/lisp/mail/mailabbrev.el
+++ b/lisp/mail/mailabbrev.el
@@ -305,10 +305,19 @@ If DEFINITION contains multiple addresses, separate them with commas."
305 end (string-match "\"[ \t,]*" definition start)) 305 end (string-match "\"[ \t,]*" definition start))
306 (setq end (string-match "[ \t,]+" definition start))) 306 (setq end (string-match "[ \t,]+" definition start)))
307 (setq end (string-match "[ \t\n,]*,[ \t\n,]*" definition start))) 307 (setq end (string-match "[ \t\n,]*,[ \t\n,]*" definition start)))
308 (setq result (cons (substring definition start end) result)) 308 (let ((tem (substring definition start end)))
309 (setq start (and end 309 ;; Advance the loop past this address.
310 (/= (match-end 0) L) 310 (setq start (and end
311 (match-end 0)))) 311 (/= (match-end 0) L)
312 (match-end 0)))
313 ;; If the full name contains a problem character, quote it.
314 (when (string-match "\\(.+?\\)[ \t]*\\(<.*>\\)" tem)
315 (if (string-match "[^- !#$%&'*+/0-9=?A-Za-z^_`{|}~]"
316 (match-string 1 tem))
317 (setq tem (replace-regexp-in-string
318 "\\(.+?\\)[ \t]*\\(<.*>\\)" "\"\\1\" \\2"
319 tem))))
320 (push tem result)))
312 (setq definition (mapconcat (function identity) 321 (setq definition (mapconcat (function identity)
313 (nreverse result) 322 (nreverse result)
314 mail-alias-separator-string))) 323 mail-alias-separator-string)))
@@ -485,7 +494,9 @@ of a mail alias. The value is set up, buffer-local, when first needed.")
485 ;; the usual syntax table. 494 ;; the usual syntax table.
486 495
487 (or (and (integerp last-command-char) 496 (or (and (integerp last-command-char)
488 (eq (char-syntax last-command-char) ?_)) 497 (or (eq (char-syntax last-command-char) ?_)
498 ;; Don't expand on @.
499 (memq last-command-char '(?@ ?. ?% ?! ?_ ?-))))
489 (let ((pre-abbrev-expand-hook nil)) ; That's us; don't loop. 500 (let ((pre-abbrev-expand-hook nil)) ; That's us; don't loop.
490 ;; Use this table so that abbrevs can have hyphens in them. 501 ;; Use this table so that abbrevs can have hyphens in them.
491 (set-syntax-table mail-abbrev-syntax-table) 502 (set-syntax-table mail-abbrev-syntax-table)
@@ -610,7 +621,8 @@ Don't use this command in Lisp programs!
610 (interactive "P") 621 (interactive "P")
611 (if (looking-at "[ \t]*\n") (expand-abbrev)) 622 (if (looking-at "[ \t]*\n") (expand-abbrev))
612 (setq this-command 'end-of-buffer) 623 (setq this-command 'end-of-buffer)
613 (end-of-buffer arg)) 624 (with-no-warnings
625 (end-of-buffer arg)))
614 626
615(eval-after-load "sendmail" 627(eval-after-load "sendmail"
616 '(progn 628 '(progn
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index fddbc4d1c6b..c97f048a940 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1,6 +1,6 @@
1;;; rmail.el --- main code of "RMAIL" mail reader for Emacs 1;;; rmail.el --- main code of "RMAIL" mail reader for Emacs
2 2
3;; Copyright (C) 1985,86,87,88,93,94,95,96,97,98,2000, 01, 2004 3;; Copyright (C) 1985,86,87,88,93,94,95,96,97,98,2000,01,2004,2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -91,6 +91,9 @@
91 :prefix "rmail-edit-" 91 :prefix "rmail-edit-"
92 :group 'rmail) 92 :group 'rmail)
93 93
94(defgroup rmail-obsolete nil
95 "Rmail obsolete customization variables."
96 :group 'rmail)
94 97
95(defcustom rmail-movemail-program nil 98(defcustom rmail-movemail-program nil
96 "If non-nil, name of program for fetching new mail." 99 "If non-nil, name of program for fetching new mail."
@@ -98,15 +101,46 @@
98 :type '(choice (const nil) string)) 101 :type '(choice (const nil) string))
99 102
100(defcustom rmail-pop-password nil 103(defcustom rmail-pop-password nil
101 "*Password to use when reading mail from a POP server, if required." 104 "*Password to use when reading mail from POP server. Please, use rmail-remote-password instead."
102 :type '(choice (string :tag "Password") 105 :type '(choice (string :tag "Password")
103 (const :tag "Not Required" nil)) 106 (const :tag "Not Required" nil))
104 :group 'rmail-retrieve) 107 :group 'rmail-obsolete)
105 108
106(defcustom rmail-pop-password-required nil 109(defcustom rmail-pop-password-required nil
107 "*Non-nil if a password is required when reading mail using POP." 110 "*Non-nil if a password is required when reading mail from a POP server. Please, use rmail-remote-password-required instead."
108 :type 'boolean 111 :type 'boolean
109 :group 'rmail-retrieve) 112 :group 'rmail-obsolete)
113
114(defcustom rmail-remote-password nil
115 "*Password to use when reading mail from a remote server. This setting is ignored for mailboxes whose URL already contains a password."
116 :type '(choice (string :tag "Password")
117 (const :tag "Not Required" nil))
118 :set-after '(rmail-pop-password)
119 :set #'(lambda (symbol value)
120 (set-default symbol
121 (if (and (not value)
122 (boundp 'rmail-pop-password)
123 rmail-pop-password)
124 rmail-pop-password
125 value))
126 (setq rmail-pop-password nil))
127 :group 'rmail-retrieve
128 :version "21.3.50.1")
129
130(defcustom rmail-remote-password-required nil
131 "*Non-nil if a password is required when reading mail from a remote server."
132 :type 'boolean
133 :set-after '(rmail-pop-password-required)
134 :set #'(lambda (symbol value)
135 (set-default symbol
136 (if (and (not value)
137 (boundp 'rmail-pop-password-required)
138 rmail-pop-password-required)
139 rmail-pop-password-required
140 value))
141 (setq rmail-pop-password-required nil))
142 :group 'rmail-retrieve
143 :version "21.3.50.1")
110 144
111(defcustom rmail-movemail-flags nil 145(defcustom rmail-movemail-flags nil
112 "*List of flags to pass to movemail. 146 "*List of flags to pass to movemail.
@@ -116,13 +150,14 @@ or `-k' to enable Kerberos authentication."
116 :group 'rmail-retrieve 150 :group 'rmail-retrieve
117 :version "20.3") 151 :version "20.3")
118 152
119(defvar rmail-pop-password-error "invalid usercode or password\\| 153(defvar rmail-remote-password-error "invalid usercode or password\\|
120unknown user name or bad password" 154unknown user name or bad password\\|Authentication failed\\|MU_ERR_AUTH_FAILURE"
121 "Regular expression matching incorrect-password POP server error messages. 155 "Regular expression matching incorrect-password POP or IMAP server error
156messages.
122If you get an incorrect-password error that this expression does not match, 157If you get an incorrect-password error that this expression does not match,
123please report it with \\[report-emacs-bug].") 158please report it with \\[report-emacs-bug].")
124 159
125(defvar rmail-encoded-pop-password nil) 160(defvar rmail-encoded-remote-password nil)
126 161
127(defcustom rmail-preserve-inbox nil 162(defcustom rmail-preserve-inbox nil
128 "*Non-nil if incoming mail should be left in the user's inbox, 163 "*Non-nil if incoming mail should be left in the user's inbox,
@@ -130,6 +165,67 @@ rather than deleted, after it is retrieved."
130 :type 'boolean 165 :type 'boolean
131 :group 'rmail-retrieve) 166 :group 'rmail-retrieve)
132 167
168(defcustom rmail-movemail-search-path nil
169 "*List of directories to search for movemail (in addition to `exec-path')."
170 :group 'rmail-retrieve
171 :type '(repeat (directory)))
172
173(defun rmail-probe (prog)
174 "Determine what flavor of movemail PROG is by executing it with --version
175command line option and analyzing its output."
176 (with-temp-buffer
177 (let ((tbuf (current-buffer)))
178 (buffer-disable-undo tbuf)
179 (call-process prog nil tbuf nil "--version")
180 (if (not (buffer-modified-p tbuf))
181 ;; Should not happen...
182 nil
183 (goto-char (point-min))
184 (cond
185 ((looking-at ".*movemail: invalid option")
186 'emacs) ;; Possibly...
187 ((looking-at "movemail (GNU Mailutils .*)")
188 'mailutils)
189 (t
190 ;; FIXME:
191 'emacs))))))
192
193(defun rmail-autodetect ()
194 "Determine and return the flavor of `movemail' program in use. If
195rmail-movemail-program is set, use it. Otherwise, look for `movemail'
196in the path constructed by appending rmail-movemail-search-path,
197exec-path and exec-directory."
198 (if rmail-movemail-program
199 (rmail-probe rmail-movemail-program)
200 (catch 'scan
201 (dolist (dir (append rmail-movemail-search-path exec-path
202 (list exec-directory)))
203 (when (and dir (file-accessible-directory-p dir))
204 (let ((progname (expand-file-name "movemail" dir)))
205 (when (and (not (file-directory-p progname))
206 (file-executable-p progname))
207 (let ((x (rmail-probe progname)))
208 (when x
209 (setq rmail-movemail-program progname)
210 (throw 'scan x))))))))))
211
212(defvar rmail-movemail-variant-in-use nil
213 "The movemail variant currently in use. Known variants are:
214
215 `emacs' Means any implementation, compatible with the native Emacs one.
216 This is the default;
217 `mailutils' Means GNU mailutils implementation, capable of handling full
218mail URLs as the source mailbox;")
219
220;;;###autoload
221(defun rmail-movemail-variant-p (&rest variants)
222 "Return t if the current movemail variant is any of VARIANTS.
223Currently known variants are 'emacs and 'mailutils."
224 (when (not rmail-movemail-variant-in-use)
225 ;; Autodetect
226 (setq rmail-movemail-variant-in-use (rmail-autodetect)))
227 (not (null (member rmail-movemail-variant-in-use variants))))
228
133;;;###autoload 229;;;###autoload
134(defcustom rmail-dont-reply-to-names nil "\ 230(defcustom rmail-dont-reply-to-names nil "\
135*A regexp specifying addresses to prune from a reply message. 231*A regexp specifying addresses to prune from a reply message.
@@ -1516,6 +1612,40 @@ It returns t if it got any new messages."
1516 ;; Don't leave the buffer screwed up if we get a disk-full error. 1612 ;; Don't leave the buffer screwed up if we get a disk-full error.
1517 (or found (rmail-show-message))))) 1613 (or found (rmail-show-message)))))
1518 1614
1615(defun rmail-parse-url (file)
1616 "Parse the supplied URL. Return (list MAILBOX-NAME REMOTE PASSWORD GOT-PASSWORD)
1617WHERE MAILBOX-NAME is the name of the mailbox suitable as argument to the
1618actual version of `movemail', REMOTE is non-nil if MAILBOX-NAME refers to
1619a remote mailbox, PASSWORD is the password if it should be
1620supplied as a separate argument to `movemail' or nil otherwise, GOT-PASSWORD
1621is non-nil if the user has supplied the password interactively.
1622"
1623 (if (string-match "^\\([^:]+\\)://\\(\\([^:@]+\\)\\(:\\([^@]+\\)\\)?@\\)?.*" file)
1624 (let (got-password supplied-password
1625 (proto (match-string 1 file))
1626 (user (match-string 3 file))
1627 (pass (match-string 5 file))
1628 (host (substring file (or (match-end 2)
1629 (+ 3 (match-end 1))))))
1630 (if (not pass)
1631 (when rmail-remote-password-required
1632 (setq got-password (not (rmail-have-password)))
1633 (setq supplied-password (rmail-get-remote-password
1634 (string-equal proto "imap")))))
1635
1636 (if (rmail-movemail-variant-p 'emacs)
1637 (if (string-equal proto "pop")
1638 (list (concat "po:" user ":" host)
1639 t
1640 (or pass supplied-password)
1641 got-password)
1642 (error "Emacs movemail does not support %s protocol" proto))
1643 (list file
1644 (or (string-equal proto "pop") (string-equal proto "imap"))
1645 supplied-password
1646 got-password)))
1647 (list file nil nil nil)))
1648
1519(defun rmail-insert-inbox-text (files renamep) 1649(defun rmail-insert-inbox-text (files renamep)
1520 ;; Detect a locked file now, so that we avoid moving mail 1650 ;; Detect a locked file now, so that we avoid moving mail
1521 ;; out of the real inbox file. (That could scare people.) 1651 ;; out of the real inbox file. (That could scare people.)
@@ -1524,10 +1654,15 @@ It returns t if it got any new messages."
1524 (file-name-nondirectory buffer-file-name))) 1654 (file-name-nondirectory buffer-file-name)))
1525 (let (file tofile delete-files movemail popmail got-password password) 1655 (let (file tofile delete-files movemail popmail got-password password)
1526 (while files 1656 (while files
1527 ;; Handle POP mailbox names specially; don't expand as filenames 1657 ;; Handle remote mailbox names specially; don't expand as filenames
1528 ;; in case the userid contains a directory separator. 1658 ;; in case the userid contains a directory separator.
1529 (setq file (car files)) 1659 (setq file (car files))
1530 (setq popmail (string-match "^po:" file)) 1660 (let ((url-data (rmail-parse-url file)))
1661 (setq file (nth 0 url-data))
1662 (setq popmail (nth 1 url-data))
1663 (setq password (nth 2 url-data))
1664 (setq got-password (nth 3 url-data)))
1665
1531 (if popmail 1666 (if popmail
1532 (setq renamep t) 1667 (setq renamep t)
1533 (setq file (file-truename 1668 (setq file (file-truename
@@ -1535,7 +1670,12 @@ It returns t if it got any new messages."
1535 (setq tofile (expand-file-name 1670 (setq tofile (expand-file-name
1536 ;; Generate name to move to from inbox name, 1671 ;; Generate name to move to from inbox name,
1537 ;; in case of multiple inboxes that need moving. 1672 ;; in case of multiple inboxes that need moving.
1538 (concat ".newmail-" (file-name-nondirectory file)) 1673 (concat ".newmail-"
1674 (file-name-nondirectory
1675 (if (memq system-type '(windows-nt cygwin))
1676 ;; cannot have "po:" in file name
1677 (substring file 3)
1678 file)))
1539 ;; Use the directory of this rmail file 1679 ;; Use the directory of this rmail file
1540 ;; because it's a nuisance to use the homedir 1680 ;; because it's a nuisance to use the homedir
1541 ;; if that is on a full disk and this rmail 1681 ;; if that is on a full disk and this rmail
@@ -1560,18 +1700,7 @@ It returns t if it got any new messages."
1560 (setq file (expand-file-name (user-login-name) 1700 (setq file (expand-file-name (user-login-name)
1561 file))))) 1701 file)))))
1562 (cond (popmail 1702 (cond (popmail
1563 (if rmail-pop-password-required 1703 (message "Getting mail from the remote server ..."))
1564 (progn (setq got-password (not (rmail-have-password)))
1565 (setq password (rmail-get-pop-password))))
1566 (if (memq system-type '(windows-nt cygwin))
1567 ;; cannot have "po:" in file name
1568 (setq tofile
1569 (expand-file-name
1570 (concat ".newmail-pop-"
1571 (file-name-nondirectory (substring file 3)))
1572 (file-name-directory
1573 (expand-file-name buffer-file-name)))))
1574 (message "Getting mail from post office ..."))
1575 ((and (file-exists-p tofile) 1704 ((and (file-exists-p tofile)
1576 (/= 0 (nth 7 (file-attributes tofile)))) 1705 (/= 0 (nth 7 (file-attributes tofile))))
1577 (message "Getting mail from %s..." tofile)) 1706 (message "Getting mail from %s..." tofile))
@@ -1603,50 +1732,59 @@ It returns t if it got any new messages."
1603 (write-region (point) (point) file) 1732 (write-region (point) (point) file)
1604 (file-error nil)))) 1733 (file-error nil))))
1605 (t 1734 (t
1606 (let ((errors nil)) 1735 (with-temp-buffer
1607 (unwind-protect 1736 (let ((errors (current-buffer)))
1608 (save-excursion 1737 (buffer-disable-undo errors)
1609 (setq errors (generate-new-buffer " *rmail loss*")) 1738 (let ((args
1610 (buffer-disable-undo errors) 1739 (append
1611 (let ((args 1740 (list (or rmail-movemail-program
1612 (append 1741 (expand-file-name "movemail"
1613 (list (or rmail-movemail-program 1742 exec-directory))
1614 (expand-file-name "movemail" 1743 nil errors nil)
1615 exec-directory)) 1744 (if rmail-preserve-inbox
1616 nil errors nil) 1745 (list "-p")
1617 (if rmail-preserve-inbox 1746 nil)
1618 (list "-p") 1747 (if (rmail-movemail-variant-p 'mailutils)
1619 nil) 1748 (append (list "--emacs") rmail-movemail-flags)
1620 rmail-movemail-flags 1749 rmail-movemail-flags)
1621 (list file tofile) 1750 (list file tofile)
1622 (if password (list password) nil)))) 1751 (if password (list password) nil))))
1623 (apply 'call-process args)) 1752 (apply 'call-process args))
1624 (if (not (buffer-modified-p errors)) 1753 (if (not (buffer-modified-p errors))
1625 ;; No output => movemail won 1754 ;; No output => movemail won
1626 nil 1755 nil
1627 (set-buffer errors) 1756 (set-buffer errors)
1628 (subst-char-in-region (point-min) (point-max) 1757 (subst-char-in-region (point-min) (point-max)
1629 ?\n ?\ ) 1758 ?\n ?\ )
1630 (goto-char (point-max)) 1759 (goto-char (point-max))
1631 (skip-chars-backward " \t") 1760 (skip-chars-backward " \t")
1632 (delete-region (point) (point-max)) 1761 (delete-region (point) (point-max))
1633 (goto-char (point-min)) 1762 (goto-char (point-min))
1634 (if (looking-at "movemail: ") 1763 (if (looking-at "movemail: ")
1635 (delete-region (point-min) (match-end 0))) 1764 (delete-region (point-min) (match-end 0)))
1636 (beep t) 1765 (beep t)
1637 (message "movemail: %s" 1766 ;; If we just read the password, most likely it is
1638 (buffer-substring (point-min) 1767 ;; wrong. Otherwise, see if there is a specific
1639 (point-max))) 1768 ;; reason to think that the problem is a wrong passwd.
1640 ;; If we just read the password, most likely it is 1769 (if (or got-password
1641 ;; wrong. Otherwise, see if there is a specific 1770 (re-search-forward rmail-remote-password-error
1642 ;; reason to think that the problem is a wrong passwd. 1771 nil t))
1643 (if (or got-password 1772 (rmail-set-remote-password nil))
1644 (re-search-forward rmail-pop-password-error 1773
1645 nil t)) 1774 ;; If using Mailutils, remove initial error code
1646 (rmail-set-pop-password nil)) 1775 ;; abbreviation
1647 (sit-for 3) 1776 (when (rmail-movemail-variant-p 'mailutils)
1648 nil)) 1777 (goto-char (point-min))
1649 (if errors (kill-buffer errors)))))) 1778 (when (looking-at "[A-Z][A-Z0-9_]*:")
1779 (delete-region (point-min) (match-end 0))))
1780
1781 (message "movemail: %s"
1782 (buffer-substring (point-min)
1783 (point-max)))
1784
1785 (sit-for 3)
1786 nil)))))
1787
1650 ;; At this point, TOFILE contains the name to read: 1788 ;; At this point, TOFILE contains the name to read:
1651 ;; Either the alternate name (if we renamed) 1789 ;; Either the alternate name (if we renamed)
1652 ;; or the actual inbox (if not renaming). 1790 ;; or the actual inbox (if not renaming).
@@ -3834,27 +3972,30 @@ TEXT and INDENT are not used."
3834; nor is it meant to be. 3972; nor is it meant to be.
3835 3973
3836;;;###autoload 3974;;;###autoload
3837(defun rmail-set-pop-password (password) 3975(defun rmail-set-remote-password (password)
3838 "Set PASSWORD to be used for retrieving mail from a POP server." 3976 "Set PASSWORD to be used for retrieving mail from a POP or IMAP server."
3839 (interactive "sPassword: ") 3977 (interactive "sPassword: ")
3840 (if password 3978 (if password
3841 (setq rmail-encoded-pop-password 3979 (setq rmail-encoded-remote-password
3842 (rmail-encode-string password (emacs-pid))) 3980 (rmail-encode-string password (emacs-pid)))
3843 (setq rmail-pop-password nil) 3981 (setq rmail-remote-password nil)
3844 (setq rmail-encoded-pop-password nil))) 3982 (setq rmail-encoded-remote-password nil)))
3845 3983
3846(defun rmail-get-pop-password () 3984(defun rmail-get-remote-password (imap)
3847 "Get the password for retrieving mail from a POP server. If none 3985 "Get the password for retrieving mail from a POP or IMAP server. If none
3848has been set, then prompt the user for one." 3986has been set, then prompt the user for one."
3849 (if (not rmail-encoded-pop-password) 3987 (when (not rmail-encoded-remote-password)
3850 (progn (if (not rmail-pop-password) 3988 (if (not rmail-remote-password)
3851 (setq rmail-pop-password (read-passwd "POP password: "))) 3989 (setq rmail-remote-password
3852 (rmail-set-pop-password rmail-pop-password) 3990 (read-passwd (if imap
3853 (setq rmail-pop-password nil))) 3991 "IMAP password: "
3854 (rmail-encode-string rmail-encoded-pop-password (emacs-pid))) 3992 "POP password: "))))
3993 (rmail-set-remote-password rmail-remote-password)
3994 (setq rmail-remote-password nil))
3995 (rmail-encode-string rmail-encoded-remote-password (emacs-pid)))
3855 3996
3856(defun rmail-have-password () 3997(defun rmail-have-password ()
3857 (or rmail-pop-password rmail-encoded-pop-password)) 3998 (or rmail-remote-password rmail-encoded-remote-password))
3858 3999
3859(defun rmail-encode-string (string mask) 4000(defun rmail-encode-string (string mask)
3860 "Encode STRING with integer MASK, by taking the exclusive OR of the 4001 "Encode STRING with integer MASK, by taking the exclusive OR of the
diff --git a/lisp/man.el b/lisp/man.el
index 735805f1bba..e9503ca883a 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -415,13 +415,15 @@ Otherwise, the value is whatever the function
415;; buttons 415;; buttons
416(define-button-type 'Man-xref-man-page 416(define-button-type 'Man-xref-man-page
417 'action (lambda (button) (man-follow (button-label button))) 417 'action (lambda (button) (man-follow (button-label button)))
418 'help-echo "RET, mouse-2: display this man page") 418 'follow-link t
419 'help-echo "mouse-2, RET: display this man page")
419 420
420(define-button-type 'Man-xref-header-file 421(define-button-type 'Man-xref-header-file
421 'action (lambda (button) 422 'action (lambda (button)
422 (let ((w (button-get button 'Man-target-string))) 423 (let ((w (button-get button 'Man-target-string)))
423 (unless (Man-view-header-file w) 424 (unless (Man-view-header-file w)
424 (error "Cannot find header file: %s" w)))) 425 (error "Cannot find header file: %s" w))))
426 'follow-link t
425 'help-echo "mouse-2: display this header file") 427 'help-echo "mouse-2: display this header file")
426 428
427(define-button-type 'Man-xref-normal-file 429(define-button-type 'Man-xref-normal-file
@@ -433,6 +435,7 @@ Otherwise, the value is whatever the function
433 (view-file f) 435 (view-file f)
434 (error "Cannot read a file: %s" f)) 436 (error "Cannot read a file: %s" f))
435 (error "Cannot find a file: %s" f)))) 437 (error "Cannot find a file: %s" f))))
438 'follow-link t
436 'help-echo "mouse-2: display this file") 439 'help-echo "mouse-2: display this file")
437 440
438 441
@@ -822,6 +825,7 @@ Same for the ANSI bold and normal escape sequences."
822 (goto-char (point-min)) 825 (goto-char (point-min))
823 ;; Fontify ANSI escapes. 826 ;; Fontify ANSI escapes.
824 (let ((faces nil) 827 (let ((faces nil)
828 (buffer-undo-list t)
825 (start (point))) 829 (start (point)))
826 ;; http://www.isthe.com/chongo/tech/comp/ansi_escapes.html 830 ;; http://www.isthe.com/chongo/tech/comp/ansi_escapes.html
827 ;; suggests many codes, but we only handle: 831 ;; suggests many codes, but we only handle:
@@ -853,46 +857,47 @@ Same for the ANSI bold and normal escape sequences."
853 (delete-region (match-beginning 0) (match-end 0)) 857 (delete-region (match-beginning 0) (match-end 0))
854 (setq start (point)))) 858 (setq start (point))))
855 ;; Other highlighting. 859 ;; Other highlighting.
856 (if (< (buffer-size) (position-bytes (point-max))) 860 (let ((buffer-undo-list t))
857 ;; Multibyte characters exist. 861 (if (< (buffer-size) (position-bytes (point-max)))
858 (progn 862 ;; Multibyte characters exist.
859 (goto-char (point-min)) 863 (progn
860 (while (search-forward "__\b\b" nil t) 864 (goto-char (point-min))
861 (backward-delete-char 4) 865 (while (search-forward "__\b\b" nil t)
862 (put-text-property (point) (1+ (point)) 'face Man-underline-face)) 866 (backward-delete-char 4)
863 (goto-char (point-min)) 867 (put-text-property (point) (1+ (point)) 'face Man-underline-face))
864 (while (search-forward "\b\b__" nil t) 868 (goto-char (point-min))
865 (backward-delete-char 4) 869 (while (search-forward "\b\b__" nil t)
866 (put-text-property (1- (point)) (point) 'face Man-underline-face)))) 870 (backward-delete-char 4)
867 (goto-char (point-min)) 871 (put-text-property (1- (point)) (point) 'face Man-underline-face))))
868 (while (search-forward "_\b" nil t) 872 (goto-char (point-min))
869 (backward-delete-char 2) 873 (while (search-forward "_\b" nil t)
870 (put-text-property (point) (1+ (point)) 'face Man-underline-face)) 874 (backward-delete-char 2)
871 (goto-char (point-min)) 875 (put-text-property (point) (1+ (point)) 'face Man-underline-face))
872 (while (search-forward "\b_" nil t) 876 (goto-char (point-min))
873 (backward-delete-char 2) 877 (while (search-forward "\b_" nil t)
874 (put-text-property (1- (point)) (point) 'face Man-underline-face)) 878 (backward-delete-char 2)
875 (goto-char (point-min)) 879 (put-text-property (1- (point)) (point) 'face Man-underline-face))
876 (while (re-search-forward "\\(.\\)\\(\b+\\1\\)+" nil t) 880 (goto-char (point-min))
877 (replace-match "\\1") 881 (while (re-search-forward "\\(.\\)\\(\b+\\1\\)+" nil t)
878 (put-text-property (1- (point)) (point) 'face Man-overstrike-face)) 882 (replace-match "\\1")
879 (goto-char (point-min)) 883 (put-text-property (1- (point)) (point) 'face Man-overstrike-face))
880 (while (re-search-forward "o\b\\+\\|\\+\bo" nil t) 884 (goto-char (point-min))
881 (replace-match "o") 885 (while (re-search-forward "o\b\\+\\|\\+\bo" nil t)
882 (put-text-property (1- (point)) (point) 'face 'bold)) 886 (replace-match "o")
883 (goto-char (point-min)) 887 (put-text-property (1- (point)) (point) 'face 'bold))
884 (while (re-search-forward "[-|]\\(\b[-|]\\)+" nil t) 888 (goto-char (point-min))
885 (replace-match "+") 889 (while (re-search-forward "[-|]\\(\b[-|]\\)+" nil t)
886 (put-text-property (1- (point)) (point) 'face 'bold)) 890 (replace-match "+")
887 (goto-char (point-min)) 891 (put-text-property (1- (point)) (point) 'face 'bold))
888 ;; Try to recognize common forms of cross references. 892 (goto-char (point-min))
889 (Man-highlight-references) 893 ;; Try to recognize common forms of cross references.
890 (Man-softhyphen-to-minus) 894 (Man-highlight-references)
891 (goto-char (point-min)) 895 (Man-softhyphen-to-minus)
892 (while (re-search-forward Man-heading-regexp nil t) 896 (goto-char (point-min))
893 (put-text-property (match-beginning 0) 897 (while (re-search-forward Man-heading-regexp nil t)
894 (match-end 0) 898 (put-text-property (match-beginning 0)
895 'face Man-overstrike-face)) 899 (match-end 0)
900 'face Man-overstrike-face)))
896 (message "%s man page formatted" Man-arguments)) 901 (message "%s man page formatted" Man-arguments))
897 902
898(defun Man-highlight-references () 903(defun Man-highlight-references ()
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 63e0f6c9d91..7d94b678ca2 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -1,6 +1,6 @@
1;;; mouse.el --- window system-independent mouse support 1;;; mouse.el --- window system-independent mouse support
2 2
3;; Copyright (C) 1993, 94, 95, 1999, 2000, 2001, 2002, 2003, 2004 3;; Copyright (C) 1993, 94, 95, 1999, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -397,7 +397,6 @@ MODE-LINE-P non-nil means dragging a mode line; nil means a header line."
397 (start-nwindows (count-windows t)) 397 (start-nwindows (count-windows t))
398 (old-selected-window (selected-window)) 398 (old-selected-window (selected-window))
399 (minibuffer (frame-parameter nil 'minibuffer)) 399 (minibuffer (frame-parameter nil 'minibuffer))
400 (mouse-autoselect-window nil)
401 should-enlarge-minibuffer event mouse y top bot edges wconfig growth) 400 should-enlarge-minibuffer event mouse y top bot edges wconfig growth)
402 (track-mouse 401 (track-mouse
403 (progn 402 (progn
@@ -435,7 +434,7 @@ MODE-LINE-P non-nil means dragging a mode line; nil means a header line."
435 (cond ((integerp event) 434 (cond ((integerp event)
436 (setq done t)) 435 (setq done t))
437 436
438 ((eq (car event) 'switch-frame) 437 ((memq (car event) '(switch-frame select-window))
439 nil) 438 nil)
440 439
441 ((not (memq (car event) '(mouse-movement scroll-bar-movement))) 440 ((not (memq (car event) '(mouse-movement scroll-bar-movement)))
@@ -582,7 +581,7 @@ resized by dragging their header-line."
582 ;; unknown event. 581 ;; unknown event.
583 (cond ((integerp event) 582 (cond ((integerp event)
584 (setq done t)) 583 (setq done t))
585 ((eq (car event) 'switch-frame) 584 ((memq (car event) '(switch-frame select-window))
586 nil) 585 nil)
587 ((not (memq (car event) 586 ((not (memq (car event)
588 '(mouse-movement scroll-bar-movement))) 587 '(mouse-movement scroll-bar-movement)))
@@ -754,11 +753,11 @@ remains active. Otherwise, it remains until the next input event.
754 753
755If the click is in the echo area, display the `*Messages*' buffer." 754If the click is in the echo area, display the `*Messages*' buffer."
756 (interactive "e") 755 (interactive "e")
757 (let ((w (posn-window (event-start start-event))) 756 (let ((w (posn-window (event-start start-event))))
758 (mouse-autoselect-window nil)) 757 (if (and (window-minibuffer-p w)
759 (if (not (or (not (window-minibuffer-p w)) 758 (not (minibuffer-window-active-p w)))
760 (minibuffer-window-active-p w)))
761 (save-excursion 759 (save-excursion
760 ;; Swallow the up-event.
762 (read-event) 761 (read-event)
763 (set-buffer "*Messages*") 762 (set-buffer "*Messages*")
764 (goto-char (point-max)) 763 (goto-char (point-max))
@@ -773,21 +772,24 @@ If the click is in the echo area, display the `*Messages*' buffer."
773 772
774A clickable link is identified by one of the following methods: 773A clickable link is identified by one of the following methods:
775 774
7761) If the character at POS has a non-nil `follow-link' text or 775- If the character at POS has a non-nil `follow-link' text or
777overlay property, the value of that property is returned. 776overlay property, use the value of that property determines what
777to do.
778 778
7792) If there is a local key-binding or a keybinding at position 779- If there is a local key-binding or a keybinding at position POS
780POS for the `follow-link' event, the binding of that event 780for the `follow-link' event, the binding of that event determines
781determines whether POS is inside a link: 781what to do.
782 782
783- If the binding is `mouse-face', POS is inside a link if there 783The resulting value determine whether POS is inside a link:
784
785- If the value is `mouse-face', POS is inside a link if there
784is a non-nil `mouse-face' property at POS. Return t in this case. 786is a non-nil `mouse-face' property at POS. Return t in this case.
785 787
786- If the binding is a function, FUNC, POS is inside a link if 788- If the value is a function, FUNC, POS is inside a link if
787the call \(FUNC POS) returns non-nil. Return the return value 789the call \(FUNC POS) returns non-nil. Return the return value
788from that call. 790from that call.
789 791
790- Otherwise, return the binding of the `follow-link' binding. 792- Otherwise, return the value itself.
791 793
792The return value is interpreted as follows: 794The return value is interpreted as follows:
793 795
@@ -801,16 +803,17 @@ click is the local or global binding of that event.
801 803
802- Otherwise, the mouse-1 event is translated into a mouse-2 event 804- Otherwise, the mouse-1 event is translated into a mouse-2 event
803at the same position." 805at the same position."
804 (or (get-char-property pos 'follow-link) 806 (let ((action
805 (save-excursion 807 (or (get-char-property pos 'follow-link)
806 (goto-char pos) 808 (save-excursion
807 (let ((b (key-binding [follow-link] nil t))) 809 (goto-char pos)
808 (cond 810 (key-binding [follow-link] nil t)))))
809 ((eq b 'mouse-face) 811 (cond
810 (and (get-char-property pos 'mouse-face) t)) 812 ((eq action 'mouse-face)
811 ((functionp b) 813 (and (get-char-property pos 'mouse-face) t))
812 (funcall b pos)) 814 ((functionp action)
813 (t b)))))) 815 (funcall action pos))
816 (t action))))
814 817
815(defun mouse-drag-region-1 (start-event) 818(defun mouse-drag-region-1 (start-event)
816 (mouse-minibuffer-check start-event) 819 (mouse-minibuffer-check start-event)
@@ -858,8 +861,8 @@ at the same position."
858 (while (progn 861 (while (progn
859 (setq event (read-event)) 862 (setq event (read-event))
860 (or (mouse-movement-p event) 863 (or (mouse-movement-p event)
861 (eq (car-safe event) 'switch-frame))) 864 (memq (car-safe event) '(switch-frame select-window))))
862 (if (eq (car-safe event) 'switch-frame) 865 (if (memq (car-safe event) '(switch-frame select-window))
863 nil 866 nil
864 (setq end (event-end event) 867 (setq end (event-end event)
865 end-point (posn-point end)) 868 end-point (posn-point end))
@@ -1153,6 +1156,7 @@ If MODE is 2 then do the same for lines."
1153 (move-overlay mouse-drag-overlay (point) (mark t))) 1156 (move-overlay mouse-drag-overlay (point) (mark t)))
1154 (catch 'mouse-show-mark 1157 (catch 'mouse-show-mark
1155 ;; In this loop, execute scroll bar and switch-frame events. 1158 ;; In this loop, execute scroll bar and switch-frame events.
1159 ;; Should we similarly handle `select-window' events? --Stef
1156 ;; Also ignore down-events that are undefined. 1160 ;; Also ignore down-events that are undefined.
1157 (while (progn (setq event (read-event)) 1161 (while (progn (setq event (read-event))
1158 (setq events (append events (list event))) 1162 (setq events (append events (list event)))
@@ -1476,9 +1480,9 @@ The function returns a non-nil value if it creates a secondary selection."
1476 (while (progn 1480 (while (progn
1477 (setq event (read-event)) 1481 (setq event (read-event))
1478 (or (mouse-movement-p event) 1482 (or (mouse-movement-p event)
1479 (eq (car-safe event) 'switch-frame))) 1483 (memq (car-safe event) '(switch-frame select-window))))
1480 1484
1481 (if (eq (car-safe event) 'switch-frame) 1485 (if (memq (car-safe event) '(switch-frame select-window))
1482 nil 1486 nil
1483 (setq end (event-end event) 1487 (setq end (event-end event)
1484 end-point (posn-point end)) 1488 end-point (posn-point end))
diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el
index 478ce403b31..bf11ea28514 100644
--- a/lisp/progmodes/ebrowse.el
+++ b/lisp/progmodes/ebrowse.el
@@ -780,16 +780,16 @@ The class tree is found in the buffer-local variable `ebrowse--tree-obarray'."
780 780
781(defun ebrowse-class-in-tree (class tree) 781(defun ebrowse-class-in-tree (class tree)
782 "Search for a class with name CLASS in TREE. 782 "Search for a class with name CLASS in TREE.
783Return the class found, if any. This function is used during the load 783If CLASS is found, return the tail of TREE starting at CLASS. This function
784phase where classes appended to a file replace older class 784is used during the load phase where classes appended to a file replace older
785information." 785class information."
786 (let ((tclass (ebrowse-ts-class class)) 786 (let ((tclass (ebrowse-ts-class class))
787 found) 787 found)
788 (while (and tree (not found)) 788 (while (and tree (not found))
789 (let ((root (car tree))) 789 (let ((root-ptr tree))
790 (when (string= (ebrowse-qualified-class-name (ebrowse-ts-class root)) 790 (when (string= (ebrowse-qualified-class-name (ebrowse-ts-class (car root-ptr)))
791 (ebrowse-qualified-class-name tclass)) 791 (ebrowse-qualified-class-name tclass))
792 (setq found root)) 792 (setq found root-ptr))
793 (setq tree (cdr tree)))) 793 (setq tree (cdr tree))))
794 found)) 794 found))
795 795
@@ -903,10 +903,10 @@ and TREE is a list of `ebrowse-ts' structures forming the class tree."
903 (let ((gc-cons-threshold 2000000)) 903 (let ((gc-cons-threshold 2000000))
904 (while (not (progn (skip-chars-forward " \t\n\r") (eobp))) 904 (while (not (progn (skip-chars-forward " \t\n\r") (eobp)))
905 (let* ((root (read (current-buffer))) 905 (let* ((root (read (current-buffer)))
906 (old-root (ebrowse-class-in-tree root tree))) 906 (old-root-ptr (ebrowse-class-in-tree root tree)))
907 (ebrowse-show-progress "Reading data" (null tree)) 907 (ebrowse-show-progress "Reading data" (null tree))
908 (if old-root 908 (if old-root-ptr
909 (setf (car old-root) root) 909 (setcar old-root-ptr root)
910 (push root tree))))) 910 (push root tree)))))
911 (garbage-collect) 911 (garbage-collect)
912 (list header tree))) 912 (list header tree)))
diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el
index 07fcda385ef..d4229cf44c6 100644
--- a/lisp/progmodes/hideshow.el
+++ b/lisp/progmodes/hideshow.el
@@ -5,7 +5,7 @@
5;; Author: Thien-Thi Nguyen <ttn@gnu.org> 5;; Author: Thien-Thi Nguyen <ttn@gnu.org>
6;; Dan Nicolaescu <dann@ics.uci.edu> 6;; Dan Nicolaescu <dann@ics.uci.edu>
7;; Keywords: C C++ java lisp tools editing comments blocks hiding outlines 7;; Keywords: C C++ java lisp tools editing comments blocks hiding outlines
8;; Maintainer-Version: 5.58.2.3 8;; Maintainer-Version: 5.58.2.4
9;; Time-of-Day-Author-Most-Likely-to-be-Recalcitrant: early morning 9;; Time-of-Day-Author-Most-Likely-to-be-Recalcitrant: early morning
10 10
11;; This file is part of GNU Emacs. 11;; This file is part of GNU Emacs.
@@ -233,7 +233,6 @@
233;;; Code: 233;;; Code:
234 234
235(require 'easymenu) 235(require 'easymenu)
236(eval-when-compile (require 'cl))
237 236
238;;--------------------------------------------------------------------------- 237;;---------------------------------------------------------------------------
239;; user-configurable variables 238;; user-configurable variables
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 49d3d46acbc..4b2941bd966 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -1,6 +1,6 @@
1;;; perl-mode.el --- Perl code editing commands for GNU Emacs 1;;; perl-mode.el --- Perl code editing commands for GNU Emacs
2 2
3;; Copyright (C) 1990, 1994, 2003 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1994, 2003, 2005 Free Software Foundation, Inc.
4 4
5;; Author: William F. Mann 5;; Author: William F. Mann
6;; Maintainer: FSF 6;; Maintainer: FSF
@@ -408,7 +408,7 @@ existing comment, moves to end-of-line, or if at end-of-line already,
408create a new comment." 408create a new comment."
409 :type 'boolean) 409 :type 'boolean)
410 410
411(defcustom perl-nochange ";?#\\|\f\\|\\s(\\|\\(\\w\\|\\s_\\)+:" 411(defcustom perl-nochange ";?#\\|\f\\|\\s(\\|\\(\\w\\|\\s_\\)+:[^:]"
412 "*Lines starting with this regular expression are not auto-indented." 412 "*Lines starting with this regular expression are not auto-indented."
413 :type 'regexp) 413 :type 'regexp)
414 414
@@ -769,7 +769,7 @@ Optional argument PARSE-START should be the position of `beginning-of-defun'."
769 (skip-chars-forward " \t\f\n") 769 (skip-chars-forward " \t\f\n")
770 (cond ((looking-at ";?#") 770 (cond ((looking-at ";?#")
771 (forward-line 1) t) 771 (forward-line 1) t)
772 ((looking-at "\\(\\w\\|\\s_\\)+:") 772 ((looking-at "\\(\\w\\|\\s_\\)+:[^:]")
773 (save-excursion 773 (save-excursion
774 (end-of-line) 774 (end-of-line)
775 (setq colon-line-end (point))) 775 (setq colon-line-end (point)))
@@ -929,5 +929,5 @@ With argument, repeat that many times; negative args move backward."
929 929
930(provide 'perl-mode) 930(provide 'perl-mode)
931 931
932;;; arch-tag: 8c7ff68d-15f3-46a2-ade2-b7c41f176826 932;; arch-tag: 8c7ff68d-15f3-46a2-ade2-b7c41f176826
933;;; perl-mode.el ends here 933;;; perl-mode.el ends here
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 387e1232dc0..a1e868a3926 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -448,6 +448,7 @@ This is buffer-local in every such buffer.")
448 (define-key map "\C-c=" 'sh-set-indent) 448 (define-key map "\C-c=" 'sh-set-indent)
449 (define-key map "\C-c<" 'sh-learn-line-indent) 449 (define-key map "\C-c<" 'sh-learn-line-indent)
450 (define-key map "\C-c>" 'sh-learn-buffer-indent) 450 (define-key map "\C-c>" 'sh-learn-buffer-indent)
451 (define-key map "\C-c\C-\\" 'sh-backslash-region)
451 452
452 (define-key map "=" 'sh-assignment) 453 (define-key map "=" 'sh-assignment)
453 (define-key map "\C-c+" 'sh-add) 454 (define-key map "\C-c+" 'sh-add)
@@ -1183,6 +1184,16 @@ This is for the rc shell."
1183 :type `(choice ,@ sh-number-or-symbol-list) 1184 :type `(choice ,@ sh-number-or-symbol-list)
1184 :group 'sh-indentation) 1185 :group 'sh-indentation)
1185 1186
1187(defcustom sh-backslash-column 48
1188 "*Column in which `sh-backslash-region' inserts backslashes."
1189 :type 'integer
1190 :group 'sh)
1191
1192(defcustom sh-backslash-align t
1193 "*If non-nil, `sh-backslash-region' will align backslashes."
1194 :type 'boolean
1195 :group 'sh)
1196
1186;; Internal use - not designed to be changed by the user: 1197;; Internal use - not designed to be changed by the user:
1187 1198
1188(defun sh-mkword-regexpr (word) 1199(defun sh-mkword-regexpr (word)
@@ -3547,6 +3558,77 @@ The document is bounded by `sh-here-document-word'."
3547 (if (re-search-forward sh-end-of-command nil t) 3558 (if (re-search-forward sh-end-of-command nil t)
3548 (goto-char (match-end 1)))) 3559 (goto-char (match-end 1))))
3549 3560
3561;; Backslashification. Stolen from make-mode.el.
3562
3563(defun sh-backslash-region (from to delete-flag)
3564 "Insert, align, or delete end-of-line backslashes on the lines in the region.
3565With no argument, inserts backslashes and aligns existing backslashes.
3566With an argument, deletes the backslashes.
3567
3568This function does not modify the last line of the region if the region ends
3569right at the start of the following line; it does not modify blank lines
3570at the start of the region. So you can put the region around an entire
3571shell command and conveniently use this command."
3572 (interactive "r\nP")
3573 (save-excursion
3574 (goto-char from)
3575 (let ((column sh-backslash-column)
3576 (endmark (make-marker)))
3577 (move-marker endmark to)
3578 ;; Compute the smallest column number past the ends of all the lines.
3579 (if sh-backslash-align
3580 (progn
3581 (if (not delete-flag)
3582 (while (< (point) to)
3583 (end-of-line)
3584 (if (= (preceding-char) ?\\)
3585 (progn (forward-char -1)
3586 (skip-chars-backward " \t")))
3587 (setq column (max column (1+ (current-column))))
3588 (forward-line 1)))
3589 ;; Adjust upward to a tab column, if that doesn't push
3590 ;; past the margin.
3591 (if (> (% column tab-width) 0)
3592 (let ((adjusted (* (/ (+ column tab-width -1) tab-width)
3593 tab-width)))
3594 (if (< adjusted (window-width))
3595 (setq column adjusted))))))
3596 ;; Don't modify blank lines at start of region.
3597 (goto-char from)
3598 (while (and (< (point) endmark) (eolp))
3599 (forward-line 1))
3600 ;; Add or remove backslashes on all the lines.
3601 (while (and (< (point) endmark)
3602 ;; Don't backslashify the last line
3603 ;; if the region ends right at the start of the next line.
3604 (save-excursion
3605 (forward-line 1)
3606 (< (point) endmark)))
3607 (if (not delete-flag)
3608 (sh-append-backslash column)
3609 (sh-delete-backslash))
3610 (forward-line 1))
3611 (move-marker endmark nil))))
3612
3613(defun sh-append-backslash (column)
3614 (end-of-line)
3615 ;; Note that "\\\\" is needed to get one backslash.
3616 (if (= (preceding-char) ?\\)
3617 (progn (forward-char -1)
3618 (delete-horizontal-space)
3619 (indent-to column (if sh-backslash-align nil 1)))
3620 (indent-to column (if sh-backslash-align nil 1))
3621 (insert "\\")))
3622
3623(defun sh-delete-backslash ()
3624 (end-of-line)
3625 (or (bolp)
3626 (progn
3627 (forward-char -1)
3628 (if (looking-at "\\\\")
3629 (delete-region (1+ (point))
3630 (progn (skip-chars-backward " \t") (point)))))))
3631
3550(provide 'sh-script) 3632(provide 'sh-script)
3551 3633
3552;;; arch-tag: eccd8b72-f337-4fc2-ae86-18155a69d937 3634;;; arch-tag: eccd8b72-f337-4fc2-ae86-18155a69d937
diff --git a/lisp/replace.el b/lisp/replace.el
index 8820a768006..82b2a993fdb 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -64,6 +64,27 @@ strings or patterns."
64 :group 'matching 64 :group 'matching
65 :version "21.4") 65 :version "21.4")
66 66
67(defcustom query-replace-highlight t
68 "*Non-nil means to highlight matches during query replacement."
69 :type 'boolean
70 :group 'matching)
71
72(defcustom query-replace-lazy-highlight t
73 "*Controls the lazy-highlighting during query replacements.
74When non-nil, all text in the buffer matching the current match
75is highlighted lazily using isearch lazy highlighting (see
76`lazy-highlight-initial-delay' and `lazy-highlight-interval')."
77 :type 'boolean
78 :group 'lazy-highlight
79 :group 'matching
80 :version "21.4")
81
82(defface query-replace
83 '((t (:inherit isearch)))
84 "Face for highlighting query replacement matches."
85 :group 'matching
86 :version "21.4")
87
67(defun query-replace-descr (string) 88(defun query-replace-descr (string)
68 (mapconcat 'isearch-text-char-description string "")) 89 (mapconcat 'isearch-text-char-description string ""))
69 90
@@ -802,9 +823,10 @@ If the value is nil, don't highlight the buffer names specially."
802 (setq count (+ count (if forwardp -1 1))) 823 (setq count (+ count (if forwardp -1 1)))
803 (setq beg (line-beginning-position) 824 (setq beg (line-beginning-position)
804 end (line-end-position)) 825 end (line-end-position))
805 (if (and keep-props (boundp 'jit-lock-mode) jit-lock-mode 826 (if (and keep-props (if (boundp 'jit-lock-mode) jit-lock-mode)
806 (text-property-not-all beg end 'fontified t)) 827 (text-property-not-all beg end 'fontified t))
807 (jit-lock-fontify-now beg end)) 828 (if (fboundp 'jit-lock-fontify-now)
829 (jit-lock-fontify-now beg end)))
808 (push 830 (push
809 (funcall (if keep-props 831 (funcall (if keep-props
810 #'buffer-substring 832 #'buffer-substring
@@ -1008,9 +1030,11 @@ See also `multi-occur'."
1008 endpt (line-end-position))) 1030 endpt (line-end-position)))
1009 (setq marker (make-marker)) 1031 (setq marker (make-marker))
1010 (set-marker marker matchbeg) 1032 (set-marker marker matchbeg)
1011 (if (and keep-props (boundp 'jit-lock-mode) jit-lock-mode 1033 (if (and keep-props
1034 (if (boundp 'jit-lock-mode) jit-lock-mode)
1012 (text-property-not-all begpt endpt 'fontified t)) 1035 (text-property-not-all begpt endpt 'fontified t))
1013 (jit-lock-fontify-now begpt endpt)) 1036 (if (fboundp 'jit-lock-fontify-now)
1037 (jit-lock-fontify-now begpt endpt)))
1014 (setq curstring (buffer-substring begpt endpt)) 1038 (setq curstring (buffer-substring begpt endpt))
1015 ;; Depropertize the string, and maybe 1039 ;; Depropertize the string, and maybe
1016 ;; highlight the matches 1040 ;; highlight the matches
@@ -1258,27 +1282,6 @@ passed in. If LITERAL is set, no checking is done, anyway."
1258 (replace-match newtext fixedcase literal) 1282 (replace-match newtext fixedcase literal)
1259 noedit) 1283 noedit)
1260 1284
1261(defcustom query-replace-highlight t
1262 "*Non-nil means to highlight matches during query replacement."
1263 :type 'boolean
1264 :group 'matching)
1265
1266(defcustom query-replace-lazy-highlight t
1267 "*Controls the lazy-highlighting during query replacements.
1268When non-nil, all text in the buffer matching the current match
1269is highlighted lazily using isearch lazy highlighting (see
1270`isearch-lazy-highlight-initial-delay' and
1271`isearch-lazy-highlight-interval')."
1272 :type 'boolean
1273 :group 'matching
1274 :version "21.4")
1275
1276(defface query-replace
1277 '((t (:inherit isearch)))
1278 "Face for highlighting query replacement matches."
1279 :group 'matching
1280 :version "21.4")
1281
1282(defun perform-replace (from-string replacements 1285(defun perform-replace (from-string replacements
1283 query-flag regexp-flag delimited-flag 1286 query-flag regexp-flag delimited-flag
1284 &optional repeat-count map start end) 1287 &optional repeat-count map start end)
diff --git a/lisp/simple.el b/lisp/simple.el
index 2baacc01531..77bdb47e250 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -647,15 +647,16 @@ If BACKWARD-ONLY is non-nil, only delete spaces before point."
647 (skip-chars-backward " \t") 647 (skip-chars-backward " \t")
648 (constrain-to-field nil orig-pos))))) 648 (constrain-to-field nil orig-pos)))))
649 649
650(defun just-one-space () 650(defun just-one-space (n)
651 "Delete all spaces and tabs around point, leaving one space." 651 "Delete all spaces and tabs around point, leaving one space (or N spaces)."
652 (interactive "*") 652 (interactive "*p")
653 (let ((orig-pos (point))) 653 (let ((orig-pos (point)))
654 (skip-chars-backward " \t") 654 (skip-chars-backward " \t")
655 (constrain-to-field nil orig-pos) 655 (constrain-to-field nil orig-pos)
656 (if (= (following-char) ? ) 656 (dotimes (i n)
657 (forward-char 1) 657 (if (= (following-char) ?\ )
658 (insert ? )) 658 (forward-char 1)
659 (insert ?\ )))
659 (delete-region 660 (delete-region
660 (point) 661 (point)
661 (progn 662 (progn
@@ -899,7 +900,7 @@ display the result of expression evaluation."
899 (if (and (integerp value) 900 (if (and (integerp value)
900 (or (not (memq this-command '(eval-last-sexp eval-print-last-sexp))) 901 (or (not (memq this-command '(eval-last-sexp eval-print-last-sexp)))
901 (eq this-command last-command) 902 (eq this-command last-command)
902 (and (boundp 'edebug-active) edebug-active))) 903 (if (boundp 'edebug-active) edebug-active)))
903 (let ((char-string 904 (let ((char-string
904 (if (or (and (boundp 'edebug-active) edebug-active) 905 (if (or (and (boundp 'edebug-active) edebug-active)
905 (memq this-command '(eval-last-sexp eval-print-last-sexp))) 906 (memq this-command '(eval-last-sexp eval-print-last-sexp)))
@@ -3008,10 +3009,10 @@ Does not set point. Does nothing if mark ring is empty."
3008 (when mark-ring 3009 (when mark-ring
3009 (setq mark-ring (nconc mark-ring (list (copy-marker (mark-marker))))) 3010 (setq mark-ring (nconc mark-ring (list (copy-marker (mark-marker)))))
3010 (set-marker (mark-marker) (+ 0 (car mark-ring)) (current-buffer)) 3011 (set-marker (mark-marker) (+ 0 (car mark-ring)) (current-buffer))
3011 (deactivate-mark)
3012 (move-marker (car mark-ring) nil) 3012 (move-marker (car mark-ring) nil)
3013 (if (null (mark t)) (ding)) 3013 (if (null (mark t)) (ding))
3014 (setq mark-ring (cdr mark-ring)))) 3014 (setq mark-ring (cdr mark-ring)))
3015 (deactivate-mark))
3015 3016
3016(defalias 'exchange-dot-and-mark 'exchange-point-and-mark) 3017(defalias 'exchange-dot-and-mark 'exchange-point-and-mark)
3017(defun exchange-point-and-mark (&optional arg) 3018(defun exchange-point-and-mark (&optional arg)
@@ -3590,7 +3591,7 @@ With argument, do this that many times."
3590The place mark goes is the same place \\[forward-word] would 3591The place mark goes is the same place \\[forward-word] would
3591move to with the same argument. 3592move to with the same argument.
3592Interactively, if this command is repeated 3593Interactively, if this command is repeated
3593or (in Transient Mark mode) if the mark is active, 3594or (in Transient Mark mode) if the mark is active,
3594it marks the next ARG words after the ones already marked." 3595it marks the next ARG words after the ones already marked."
3595 (interactive "P\np") 3596 (interactive "P\np")
3596 (cond ((and allow-extend 3597 (cond ((and allow-extend
@@ -4115,7 +4116,7 @@ specification for `play-sound'."
4115 (play-sound sound))) 4116 (play-sound sound)))
4116 4117
4117(define-key global-map "\e\e\e" 'keyboard-escape-quit) 4118(define-key global-map "\e\e\e" 'keyboard-escape-quit)
4118 4119
4119(defcustom read-mail-command 'rmail 4120(defcustom read-mail-command 'rmail
4120 "*Your preference for a mail reading package. 4121 "*Your preference for a mail reading package.
4121This is used by some keybindings which support reading mail. 4122This is used by some keybindings which support reading mail.
@@ -4257,7 +4258,7 @@ Each action has the form (FUNCTION . ARGS)."
4257 (list nil nil nil current-prefix-arg)) 4258 (list nil nil nil current-prefix-arg))
4258 (compose-mail to subject other-headers continue 4259 (compose-mail to subject other-headers continue
4259 'switch-to-buffer-other-frame yank-action send-actions)) 4260 'switch-to-buffer-other-frame yank-action send-actions))
4260 4261
4261(defvar set-variable-value-history nil 4262(defvar set-variable-value-history nil
4262 "History of values entered with `set-variable'.") 4263 "History of values entered with `set-variable'.")
4263 4264
@@ -4320,7 +4321,7 @@ With a prefix argument, set VARIABLE to VALUE buffer-locally."
4320 ;; Force a thorough redisplay for the case that the variable 4321 ;; Force a thorough redisplay for the case that the variable
4321 ;; has an effect on the display, like `tab-width' has. 4322 ;; has an effect on the display, like `tab-width' has.
4322 (force-mode-line-update)) 4323 (force-mode-line-update))
4323 4324
4324;; Define the major mode for lists of completions. 4325;; Define the major mode for lists of completions.
4325 4326
4326(defvar completion-list-mode-map nil 4327(defvar completion-list-mode-map nil
@@ -4328,6 +4329,7 @@ With a prefix argument, set VARIABLE to VALUE buffer-locally."
4328(or completion-list-mode-map 4329(or completion-list-mode-map
4329 (let ((map (make-sparse-keymap))) 4330 (let ((map (make-sparse-keymap)))
4330 (define-key map [mouse-2] 'mouse-choose-completion) 4331 (define-key map [mouse-2] 'mouse-choose-completion)
4332 (define-key map [follow-link] 'mouse-face)
4331 (define-key map [down-mouse-2] nil) 4333 (define-key map [down-mouse-2] nil)
4332 (define-key map "\C-m" 'choose-completion) 4334 (define-key map "\C-m" 'choose-completion)
4333 (define-key map "\e\e\e" 'delete-completion-window) 4335 (define-key map "\e\e\e" 'delete-completion-window)
diff --git a/lisp/startup.el b/lisp/startup.el
index e806dba7716..9dc60f4705f 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -871,12 +871,6 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
871 (sit-for 1)) 871 (sit-for 1))
872 (setq user-init-file source)))) 872 (setq user-init-file source))))
873 873
874 (when (stringp custom-file)
875 (unless (assoc custom-file load-history)
876 ;; If the .emacs file has set `custom-file' but hasn't
877 ;; loaded the file yet, let's load it.
878 (load custom-file t t)))
879
880 (unless inhibit-default-init 874 (unless inhibit-default-init
881 (let ((inhibit-startup-message nil)) 875 (let ((inhibit-startup-message nil))
882 ;; Users are supposed to be told their rights. 876 ;; Users are supposed to be told their rights.
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index f3a7616bfd6..0c4aeb1bd24 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -1074,15 +1074,54 @@ Protects against bogus binding of `enable-multibyte-characters' in XEmacs."
1074 (decode-coding-string str (ispell-get-coding-system)) 1074 (decode-coding-string str (ispell-get-coding-system))
1075 str)) 1075 str))
1076 1076
1077(put 'ispell-unified-chars-table 'char-table-extra-slots 0)
1078
1079;; Char-table that maps an Unicode character (charset:
1080;; latin-iso8859-1, mule-unicode-0100-24ff, mule-unicode-2500-34ff) to
1081;; a string in which all equivalent characters are listed.
1082
1083(defconst ispell-unified-chars-table
1084 (let ((table (make-char-table 'ispell-unified-chars-table)))
1085 (map-char-table
1086 #'(lambda (c v)
1087 (if (and v (/= c v))
1088 (let ((unified (or (aref table v) (string v))))
1089 (aset table v (concat unified (string c))))))
1090 ucs-mule-8859-to-mule-unicode)
1091 table))
1092
1093;; Return a string decoded from Nth element of the current dictionary
1094;; while splice equivalent characters into the string. This splicing
1095;; is done only if the string is a regular expression of the form
1096;; "[...]" because, otherwise, splicing will result in incorrect
1097;; regular expression matching.
1098
1099(defun ispell-get-decoded-string (n)
1100 (let* ((slot (assoc ispell-dictionary ispell-dictionary-alist))
1101 (str (nth n slot)))
1102 (when (and (> (length str) 0)
1103 (not (multibyte-string-p str)))
1104 (setq str (ispell-decode-string str))
1105 (if (and (= (aref str 0) ?\[)
1106 (eq (string-match "\\]" str) (1- (length str))))
1107 (setq str
1108 (string-as-multibyte
1109 (mapconcat
1110 #'(lambda (c)
1111 (let ((unichar (aref ucs-mule-8859-to-mule-unicode c)))
1112 (if unichar
1113 (aref ispell-unified-chars-table unichar)
1114 (string c))))
1115 str ""))))
1116 (setcar (nthcdr n slot) str))
1117 str))
1118
1077(defun ispell-get-casechars () 1119(defun ispell-get-casechars ()
1078 (ispell-decode-string 1120 (ispell-get-decoded-string 1))
1079 (nth 1 (assoc ispell-dictionary ispell-dictionary-alist))))
1080(defun ispell-get-not-casechars () 1121(defun ispell-get-not-casechars ()
1081 (ispell-decode-string 1122 (ispell-get-decoded-string 2))
1082 (nth 2 (assoc ispell-dictionary ispell-dictionary-alist))))
1083(defun ispell-get-otherchars () 1123(defun ispell-get-otherchars ()
1084 (ispell-decode-string 1124 (ispell-get-decoded-string 3))
1085 (nth 3 (assoc ispell-dictionary ispell-dictionary-alist))))
1086(defun ispell-get-many-otherchars-p () 1125(defun ispell-get-many-otherchars-p ()
1087 (nth 4 (assoc ispell-dictionary ispell-dictionary-alist))) 1126 (nth 4 (assoc ispell-dictionary ispell-dictionary-alist)))
1088(defun ispell-get-ispell-args () 1127(defun ispell-get-ispell-args ()
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index fc1ffb329d9..80ff7637365 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -1,11 +1,11 @@
1;; org.el --- Outline-based notes management and organizer 1;; org.el --- Outline-based notes management and organizer
2 2;; Carstens outline-mode for keeping track of everything.
3;; Copyright (c) 2003, 2004 Free Software Foundation 3;; Copyright (c) 2003, 2004 Free Software Foundation
4 4
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.03 8;; Version: 3.04
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
@@ -23,9 +23,7 @@
23;; along with GNU Emacs; see the file COPYING. If not, write to the 23;; along with GNU Emacs; see the file COPYING. If not, write to the
24;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 24;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25;; Boston, MA 02111-1307, USA. 25;; Boston, MA 02111-1307, USA.
26
27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
28;; Carsten's outline-mode for keeping track of everything.
29;; 27;;
30;;; Commentary: 28;;; Commentary:
31;; 29;;
@@ -59,6 +57,8 @@
59;; (autoload 'org-diary "org" "Diary entries from Org mode") 57;; (autoload 'org-diary "org" "Diary entries from Org mode")
60;; (autoload 'org-agenda "org" "Multi-file agenda from Org mode" t) 58;; (autoload 'org-agenda "org" "Multi-file agenda from Org mode" t)
61;; (autoload 'org-store-link "org" "Store a link to the current location" t) 59;; (autoload 'org-store-link "org" "Store a link to the current location" t)
60;; (autoload 'orgtbl-mode "org" "Org tables as a minor mode" t)
61;; (autoload 'turn-on-orgtbl "org" "Org tables as a minor mode")
62;; (add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) 62;; (add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
63;; (define-key global-map "\C-cl" 'org-store-link) 63;; (define-key global-map "\C-cl" 'org-store-link)
64;; (define-key global-map "\C-ca" 'org-agenda) 64;; (define-key global-map "\C-ca" 'org-agenda)
@@ -79,9 +79,18 @@
79;; 79;;
80;; Changes: 80;; Changes:
81;; ------- 81;; -------
82;; Version 3.04
83;; - Table editor optimized to need fewer realignments, and to keep
84;; table shape when typing in fields.
85;; - A new minor mode, orgtbl-mode, introduces the Org-mode table editor
86;; into arbitrary major modes.
87;; - Fixed bug with realignment in XEmacs.
88;; - Startup options can be set with special #+STARTUP line.
89;; - Heading following a match in org-occur can be suppressed.
90;;
82;; Version 3.03 91;; Version 3.03
83;; - Copyright transfer to the FSF. 92;; - Copyright transfer to the FSF.
84;; - Effect of C-u and C-u C-u in org-timeline interchanged. 93;; - Effect of C-u and C-u C-u in org-timeline swapped.
85;; - Timeline now always contains today, and `.' jumps to it. 94;; - Timeline now always contains today, and `.' jumps to it.
86;; - Table editor: 95;; - Table editor:
87;; - cut and paste of regtangular regions in tables 96;; - cut and paste of regtangular regions in tables
@@ -204,7 +213,7 @@
204 213
205;;; Customization variables 214;;; Customization variables
206 215
207(defvar org-version "3.03" 216(defvar org-version "3.04"
208 "The version number of the file org.el.") 217 "The version number of the file org.el.")
209(defun org-version (arg) 218(defun org-version (arg)
210 (interactive "P") 219 (interactive "P")
@@ -402,11 +411,11 @@ lisp variable `state'."
402 "Matches the SCHEDULED keyword together with a time stamp.") 411 "Matches the SCHEDULED keyword together with a time stamp.")
403(make-variable-buffer-local 'org-scheduled-time-regexp) 412(make-variable-buffer-local 'org-scheduled-time-regexp)
404 413
405(defun org-set-regexps () 414(defun org-set-regexps-and-options ()
406 "Precompute regular expressions for current buffer." 415 "Precompute regular expressions for current buffer."
407 (when (eq major-mode 'org-mode) 416 (when (eq major-mode 'org-mode)
408 (let ((re (org-make-options-regexp 417 (let ((re (org-make-options-regexp
409 '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO"))) 418 '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO" "STARTUP")))
410 (splitre "[ \t]+") 419 (splitre "[ \t]+")
411 kwds int key value cat) 420 kwds int key value cat)
412 (save-restriction 421 (save-restriction
@@ -426,7 +435,17 @@ lisp variable `state'."
426 kwds (append kwds (org-split-string value splitre)))) 435 kwds (append kwds (org-split-string value splitre))))
427 ((equal key "TYP_TODO") 436 ((equal key "TYP_TODO")
428 (setq int 'type 437 (setq int 'type
429 kwds (append kwds (org-split-string value splitre))))) 438 kwds (append kwds (org-split-string value splitre))))
439 ((equal key "STARTUP")
440 (let ((opts (org-split-string value splitre))
441 (set '(("fold" org-startup-folded t)
442 ("nofold" org-startup-folded nil)
443 ("dlcheck" org-startup-with-deadline-check t)
444 ("nodlcheck" org-startup-with-deadline-check nil)))
445 l var val)
446 (while (setq l (assoc (pop opts) set))
447 (setq var (nth 1 l) val (nth 2 l))
448 (set (make-local-variable var) val)))))
430 ))) 449 )))
431 (and cat (set (make-local-variable 'org-category) cat)) 450 (and cat (set (make-local-variable 'org-category) cat))
432 (and kwds (set (make-local-variable 'org-todo-keywords) kwds)) 451 (and kwds (set (make-local-variable 'org-todo-keywords) kwds))
@@ -465,8 +484,6 @@ lisp variable `state'."
465 (concat "\\<" org-scheduled-string " *<\\([^>]+\\)>")) 484 (concat "\\<" org-scheduled-string " *<\\([^>]+\\)>"))
466 (org-set-font-lock-defaults))) 485 (org-set-font-lock-defaults)))
467 486
468;(add-hook 'hack-local-variables-hook 'org-set-regexps)
469
470(defgroup org-time nil 487(defgroup org-time nil
471 "Options concerning time stamps and deadlines in Org-mode." 488 "Options concerning time stamps and deadlines in Org-mode."
472 :tag "Org Time" 489 :tag "Org Time"
@@ -540,7 +557,7 @@ When nil, always start on the current day."
540 :type 'number) 557 :type 'number)
541 558
542(defcustom org-agenda-include-all-todo t 559(defcustom org-agenda-include-all-todo t
543 "Non-nil means, the multifile agenda will always contain alm TODO entries. 560 "Non-nil means, the multifile agenda will always contain all TODO entries.
544When nil, date-less entries will only be shown if `org-agenda' is called 561When nil, date-less entries will only be shown if `org-agenda' is called
545with a prefix argument. 562with a prefix argument.
546When non-nil, the TODO entries will be listed at the top of the agenda, before 563When non-nil, the TODO entries will be listed at the top of the agenda, before
@@ -639,6 +656,18 @@ t Everywhere except in headlines"
639 "Formats for `format-time-string' which are used for time stamps. 656 "Formats for `format-time-string' which are used for time stamps.
640It is not recommended to change this constant.") 657It is not recommended to change this constant.")
641 658
659(defcustom org-show-following-heading t
660 "Non-nil means, show heading following match in `org-occur'.
661When doing an `org-occur' it is useful to show the headline which
662follows the match, even if they do not match the regexp. This makes it
663easier to edit directly inside the sparse tree. However, if you use
664org-occur mainly as an overview, the following headlines are
665unnecessary clutter."
666 :group 'org-structure
667 :type 'boolean)
668
669
670
642(defgroup org-link nil 671(defgroup org-link nil
643 "Options concerning links in Org-mode." 672 "Options concerning links in Org-mode."
644 :tag "Org Link" 673 :tag "Org Link"
@@ -845,11 +874,34 @@ When nil, new notes will be filed to the end of a file or entry."
845 :tag "Org Table" 874 :tag "Org Table"
846 :group 'org) 875 :group 'org)
847 876
848(defcustom org-enable-table-editor t 877(defcustom org-enable-table-editor 'optimized
849 "Non-nil means, lines starting with \"|\" are handled by the table editor. 878 "Non-nil means, lines starting with \"|\" are handled by the table editor.
850When nil, such lines will be treated like ordinary lines." 879When nil, such lines will be treated like ordinary lines.
880
881When equal to the symbol `optimized', the table editor will be optimized to
882do the following
883- Use automatic overwrite mode in front of whitespace in table fields.
884 This make the structure of the table stay in tact as long as the edited
885 field does not exceed the column width.
886- Minimize the number of realigns. Normally, the table is aligned each time
887 TAB or RET are pressed to move to another field. With optimization this
888 happens only if changes to a field might have changed the column width.
889Optimization requires replacing the functions `self-insert-command',
890`delete-char', and `backward-delete-char' in Org-mode buffers, with a
891slight (in fact: unnoticable) speed impact for normal typing. Org-mode is
892very good at guessing when a re-align will be necessary, but you can always
893force one with `C-c C-c'.
894
895I you would like to use the optimized version in Org-mode, but the un-optimized
896version in OrgTbl-mode, see the variable `orgtbl-optimized'.
897
898This variable can be used to turn on and off the table editor during a session,
899but in order to toggle optimization, a restart is required."
851 :group 'org-table 900 :group 'org-table
852 :type 'boolean) 901 :type '(choice
902 (const :tag "off" nil)
903 (const :tag "on" t)
904 (const :tag "on, optimized" optimized)))
853 905
854(defcustom org-table-default-size "5x2" 906(defcustom org-table-default-size "5x2"
855 "The default size for newly created tables, Columns x Rows." 907 "The default size for newly created tables, Columns x Rows."
@@ -1295,6 +1347,8 @@ Otherwise, the buffer will just be saved to a file and stay hidden."
1295(eval-when-compile 1347(eval-when-compile
1296 (defvar zmacs-regions) 1348 (defvar zmacs-regions)
1297 (defvar org-transient-mark-mode) 1349 (defvar org-transient-mark-mode)
1350 (defvar org-old-auto-fill-inhibit-regexp)
1351 (defvar orgtbl-mode-menu)
1298 (defvar org-html-entities) 1352 (defvar org-html-entities)
1299 (defvar org-goto-start-pos) 1353 (defvar org-goto-start-pos)
1300 (defvar org-cursor-color) 1354 (defvar org-cursor-color)
@@ -1351,7 +1405,7 @@ messages (Gnus), BBDB entries, and any files related to the project.
1351For printing and sharing of notes, an Org-mode file (or a part of it) 1405For printing and sharing of notes, an Org-mode file (or a part of it)
1352can be exported as a well-structured ASCII or HTML file. 1406can be exported as a well-structured ASCII or HTML file.
1353 1407
1354+ The following commands are available: 1408The following commands are available:
1355 1409
1356\\{org-mode-map}" 1410\\{org-mode-map}"
1357 (interactive "P") 1411 (interactive "P")
@@ -1363,10 +1417,12 @@ can be exported as a well-structured ASCII or HTML file.
1363 (org-install-agenda-files-menu) 1417 (org-install-agenda-files-menu)
1364 (setq outline-regexp "\\*+") 1418 (setq outline-regexp "\\*+")
1365 (if org-startup-truncated (setq truncate-lines t)) 1419 (if org-startup-truncated (setq truncate-lines t))
1366 (org-set-regexps) 1420 (org-set-regexps-and-options)
1367 (set (make-local-variable 'font-lock-unfontify-region-function) 1421 (set (make-local-variable 'font-lock-unfontify-region-function)
1368 'org-unfontify-region) 1422 'org-unfontify-region)
1369 ;; Activate before-change-function 1423 ;; Activate before-change-function
1424 (set (make-local-variable 'org-table-may-need-update) t)
1425 (make-local-hook 'before-change-functions) ;; needed for XEmacs
1370 (add-hook 'before-change-functions 'org-before-change-function nil 1426 (add-hook 'before-change-functions 'org-before-change-function nil
1371 'local) 1427 'local)
1372 ;; Inhibit auto-fill for headers, tables and fixed-width lines. 1428 ;; Inhibit auto-fill for headers, tables and fixed-width lines.
@@ -1507,7 +1563,7 @@ can be exported as a well-structured ASCII or HTML file.
1507(defvar org-cycle-global-status nil) 1563(defvar org-cycle-global-status nil)
1508(defvar org-cycle-subtree-status nil) 1564(defvar org-cycle-subtree-status nil)
1509(defun org-cycle (&optional arg) 1565(defun org-cycle (&optional arg)
1510 "Visibility cycling for outline(-minor)-mode. 1566 "Visibility cycling for org-mode.
1511 1567
1512- When this function is called with a prefix argument, rotate the entire 1568- When this function is called with a prefix argument, rotate the entire
1513 buffer through 3 states (global cycling) 1569 buffer through 3 states (global cycling)
@@ -1540,7 +1596,9 @@ can be exported as a well-structured ASCII or HTML file.
1540 ((org-at-table-p 'any) 1596 ((org-at-table-p 'any)
1541 ;; Enter the table or move to the next field in the table 1597 ;; Enter the table or move to the next field in the table
1542 (or (org-table-recognize-table.el) 1598 (or (org-table-recognize-table.el)
1543 (org-table-next-field))) 1599 (progn
1600 (org-table-justify-field-maybe)
1601 (org-table-next-field))))
1544 1602
1545 (arg ;; Global cycling 1603 (arg ;; Global cycling
1546 1604
@@ -1765,9 +1823,9 @@ or nil."
1765(defvar org-ignore-region nil 1823(defvar org-ignore-region nil
1766 "To temporary disable the active region.") 1824 "To temporary disable the active region.")
1767 1825
1768(defun org-insert-heading () 1826(defun org-insert-heading (arg)
1769 "Insert a new heading with same depth at point." 1827 "Insert a new heading with same depth at point."
1770 (interactive) 1828 (interactive "P")
1771 (let* ((head (save-excursion 1829 (let* ((head (save-excursion
1772 (condition-case nil 1830 (condition-case nil
1773 (org-back-to-heading) 1831 (org-back-to-heading)
@@ -2271,14 +2329,14 @@ that the match should indeed be shown."
2271 (message "%d match(es) for regexp %s" cnt regexp)) 2329 (message "%d match(es) for regexp %s" cnt regexp))
2272 cnt)) 2330 cnt))
2273 2331
2274
2275(defun org-show-hierarchy-above () 2332(defun org-show-hierarchy-above ()
2276 "Make sure point and the headings hierarchy above is visible." 2333 "Make sure point and the headings hierarchy above is visible."
2277 (if (org-on-heading-p t) 2334 (if (org-on-heading-p t)
2278 (org-flag-heading nil) ; only show the heading 2335 (org-flag-heading nil) ; only show the heading
2279 (org-show-hidden-entry)) ; show entire entry 2336 (org-show-hidden-entry)) ; show entire entry
2280 (save-excursion 2337 (save-excursion
2281 (and (outline-next-heading) 2338 (and org-show-following-heading
2339 (outline-next-heading)
2282 (org-flag-heading nil))) ; show the next heading 2340 (org-flag-heading nil))) ; show the next heading
2283 (save-excursion ; show all higher headings 2341 (save-excursion ; show all higher headings
2284 (while (condition-case nil 2342 (while (condition-case nil
@@ -2361,7 +2419,7 @@ Otherwise, only the date will be included. All parts of a date not
2361specified by the user will be filled in from the current date/time. 2419specified by the user will be filled in from the current date/time.
2362So if you press just return without typing anything, the time stamp 2420So if you press just return without typing anything, the time stamp
2363will represent the current date/time. If there is already a timestamp 2421will represent the current date/time. If there is already a timestamp
2364at the cursoe, it will be modified." 2422at the cursor, it will be modified."
2365 (interactive "P") 2423 (interactive "P")
2366 (let ((fmt (if arg (cdr org-time-stamp-formats) 2424 (let ((fmt (if arg (cdr org-time-stamp-formats)
2367 (car org-time-stamp-formats))) 2425 (car org-time-stamp-formats)))
@@ -2798,7 +2856,11 @@ If there is already a time stamp at the cursor position, update it."
2798 2856
2799;;;###autoload 2857;;;###autoload
2800(defun org-agenda-mode () 2858(defun org-agenda-mode ()
2801 "Mode for time-sorted view on action items in Org-mode files." 2859 "Mode for time-sorted view on action items in Org-mode files.
2860
2861The following commands are available:
2862
2863\\{org-agenda-mode-map}"
2802 (interactive) 2864 (interactive)
2803 (kill-all-local-variables) 2865 (kill-all-local-variables)
2804 (setq major-mode 'org-agenda-mode) 2866 (setq major-mode 'org-agenda-mode)
@@ -3118,7 +3180,7 @@ NDAYS defaults to `org-agenda-ndays'."
3118(defun org-check-agenda-file (file) 3180(defun org-check-agenda-file (file)
3119 "Make sure FILE exists. If not, ask user what to do." 3181 "Make sure FILE exists. If not, ask user what to do."
3120 ;; FIXME: this does not correctly change the menus 3182 ;; FIXME: this does not correctly change the menus
3121 ;; Could be fixed by explicitly going to the buffer, maybe. 3183 ;; Could probably be fixed by explicitly going to the buffer.
3122 (when (not (file-exists-p file)) 3184 (when (not (file-exists-p file))
3123 (message "non-existent file %s. [R]emove from agenda-files or [A]bort?" 3185 (message "non-existent file %s. [R]emove from agenda-files or [A]bort?"
3124 file) 3186 file)
@@ -4507,7 +4569,6 @@ RET at beg-of-buf -> Append to file as level 2 headline
4507RET on headline -> Store as sublevel entry to current headline 4569RET on headline -> Store as sublevel entry to current headline
4508<left>/<right> -> before/after current headline, same headings level") 4570<left>/<right> -> before/after current headline, same headings level")
4509 4571
4510;; FIXME: Document C-u C-c C-c
4511;;;###autoload 4572;;;###autoload
4512(defun org-remember-handler () 4573(defun org-remember-handler ()
4513 "Store stuff from remember.el into an org file. 4574 "Store stuff from remember.el into an org file.
@@ -4796,6 +4857,21 @@ Such a file can be imported into a spreadsheet program like Excel."
4796 (save-buffer)) 4857 (save-buffer))
4797 (kill-buffer buf))) 4858 (kill-buffer buf)))
4798 4859
4860(defvar org-table-aligned-begin-marker (make-marker)
4861 "Marker at the beginning of the table last aligned.
4862Used to check if cursor still is in that table, to minimize realignment.")
4863(defvar org-table-aligned-end-marker (make-marker)
4864 "Marker at the end of the table last aligned.
4865Used to check if cursor still is in that table, to minimize realignment.")
4866(defvar org-table-last-alignment nil
4867 "List of flags for flushright alignment, from the last re-algnment.
4868This is being used to correctly align a single field after TAB or RET.")
4869;; FIXME: The following is currently not used.
4870(defvar org-table-last-column-widths nil
4871 "List of max width of ffields in each column.
4872This is being used to correctly align a single field after TAB or RET.")
4873
4874
4799(defun org-table-align (&optional arg) 4875(defun org-table-align (&optional arg)
4800 "Align the table at point by aligning all vertical bars." 4876 "Align the table at point by aligning all vertical bars."
4801 (interactive "P") 4877 (interactive "P")
@@ -4866,6 +4942,8 @@ Such a file can be imported into a spreadsheet program like Excel."
4866 (push (>= frac org-table-number-fraction) typenums)) 4942 (push (>= frac org-table-number-fraction) typenums))
4867 (setq lengths (nreverse lengths) 4943 (setq lengths (nreverse lengths)
4868 typenums (nreverse typenums)) 4944 typenums (nreverse typenums))
4945 (setq org-table-last-alignment typenums
4946 org-table-last-column-widths lengths)
4869 ;; Compute the formats needed for output of the table 4947 ;; Compute the formats needed for output of the table
4870 (setq rfmt (concat indent "|") hfmt (concat indent "|")) 4948 (setq rfmt (concat indent "|") hfmt (concat indent "|"))
4871 (while (setq l (pop lengths)) 4949 (while (setq l (pop lengths))
@@ -4884,13 +4962,14 @@ Such a file can be imported into a spreadsheet program like Excel."
4884 ;; Replace the old one 4962 ;; Replace the old one
4885 (delete-region beg end) 4963 (delete-region beg end)
4886 (move-marker end nil) 4964 (move-marker end nil)
4965 (move-marker org-table-aligned-begin-marker (point))
4887 (insert new) 4966 (insert new)
4967 (move-marker org-table-aligned-end-marker (point))
4888 ;; Try to move to the old location (approximately) 4968 ;; Try to move to the old location (approximately)
4889 (goto-line linepos) 4969 (goto-line linepos)
4890 (set-window-start (selected-window) winstart 'noforce) 4970 (set-window-start (selected-window) winstart 'noforce)
4891 (org-table-goto-column colpos) 4971 (org-table-goto-column colpos)
4892 (setq org-table-may-need-update nil) 4972 (setq org-table-may-need-update nil)
4893 ;; (message "Aligning table...done")
4894 (if (org-in-invisibility-spec-p '(org-table)) 4973 (if (org-in-invisibility-spec-p '(org-table))
4895 (org-table-add-invisible-to-vertical-lines)) 4974 (org-table-add-invisible-to-vertical-lines))
4896 )) 4975 ))
@@ -4920,6 +4999,35 @@ With argument TABLE-TYPE, go to the end of a table.el-type table."
4920 (goto-char (match-beginning 0))) 4999 (goto-char (match-beginning 0)))
4921 (point-marker))) 5000 (point-marker)))
4922 5001
5002(defun org-table-justify-field-maybe ()
5003 "Justify the current field, text to left, number to right."
5004 (cond
5005 (org-table-may-need-update) ; Realignment will happen anyway, don't bother
5006 ((org-at-table-hline-p)
5007 ;; This is pretty stupid, but I don't know how to deal with hlines
5008 (setq org-table-may-need-update t))
5009 ((or (not (equal (marker-buffer org-table-aligned-begin-marker)
5010 (current-buffer)))
5011 (< (point) org-table-aligned-begin-marker)
5012 (>= (point) org-table-aligned-end-marker))
5013 ;; This is not the same table, force a full re-align
5014 (setq org-table-may-need-update t))
5015 (t ;; realign the current field, based on previous full realign
5016 (let* ((pos (point)) s org-table-may-need-update
5017 (col (org-table-current-column))
5018 (num (nth (1- col) org-table-last-alignment))
5019 l f)
5020 (when (> col 0)
5021 (skip-chars-backward "^|\n")
5022 (if (looking-at " *\\([^|\n]*?\\) *|")
5023 (progn
5024 (setq s (match-string 1)
5025 l (max 1 (- (match-end 0) (match-beginning 0) 3)))
5026 (setq f (format (if num " %%%ds |" " %%-%ds |") l))
5027 (replace-match (format f s t t)))
5028 (setq org-table-may-need-update t))
5029 (goto-char pos))))))
5030
4923(defun org-table-next-field (&optional arg) 5031(defun org-table-next-field (&optional arg)
4924 "Go to the next field in the current table. 5032 "Go to the next field in the current table.
4925Before doing so, re-align the table if necessary." 5033Before doing so, re-align the table if necessary."
@@ -5013,18 +5121,21 @@ I.e. not on a hline or before the first or after the last column?"
5013 (error "Not in table data field"))) 5121 (error "Not in table data field")))
5014 5122
5015(defun org-table-blank-field () 5123(defun org-table-blank-field ()
5016 "Blank the current table field." 5124 "Blank the current table field or active region."
5017 (interactive) 5125 (interactive)
5018 (org-table-check-inside-data-field) 5126 (org-table-check-inside-data-field)
5019 (skip-chars-backward "^|") 5127 (if (and (interactive-p) (org-region-active-p))
5020 (backward-char 1) 5128 (let (org-table-clip)
5021 (if (looking-at "|[^|]+") 5129 (org-table-cut-region))
5022 (let* ((pos (match-beginning 0)) 5130 (skip-chars-backward "^|")
5023 (match (match-string 0)) 5131 (backward-char 1)
5024 (len (length match))) 5132 (if (looking-at "|[^|]+")
5025 (replace-match (concat "|" (make-string (1- len) ?\ ))) 5133 (let* ((pos (match-beginning 0))
5026 (goto-char (+ 2 pos)) 5134 (match (match-string 0))
5027 (substring match 1)))) 5135 (len (length match)))
5136 (replace-match (concat "|" (make-string (1- len) ?\ )))
5137 (goto-char (+ 2 pos))
5138 (substring match 1)))))
5028 5139
5029(defun org-table-get-field (&optional n replace) 5140(defun org-table-get-field (&optional n replace)
5030 "Return the value of the field in column N of current row. 5141 "Return the value of the field in column N of current row.
@@ -5199,6 +5310,15 @@ However, when FORCE is non-nil, create new columns if necessary."
5199 (org-table-goto-column colpos)) 5310 (org-table-goto-column colpos))
5200 (org-table-align)) 5311 (org-table-align))
5201 5312
5313(defun org-table-move-column-right ()
5314 "Move column to the right."
5315 (interactive)
5316 (org-table-move-column nil))
5317(defun org-table-move-column-left ()
5318 "Move column to the left."
5319 (interactive)
5320 (org-table-move-column 'left))
5321
5202(defun org-table-move-column (&optional left) 5322(defun org-table-move-column (&optional left)
5203 "Move the current column to the right. With arg LEFT, move to the left." 5323 "Move the current column to the right. With arg LEFT, move to the left."
5204 (interactive "P") 5324 (interactive "P")
@@ -5230,6 +5350,15 @@ However, when FORCE is non-nil, create new columns if necessary."
5230 (org-table-goto-column colpos)) 5350 (org-table-goto-column colpos))
5231 (org-table-align)) 5351 (org-table-align))
5232 5352
5353(defun org-table-move-row-down ()
5354 "Move table row down."
5355 (interactive)
5356 (org-table-move-row nil))
5357(defun org-table-move-row-up ()
5358 "Move table row down."
5359 (interactive)
5360 (org-table-move-row 'up))
5361
5233(defun org-table-move-row (&optional up) 5362(defun org-table-move-row (&optional up)
5234 "Move the current table line down. With arg UP, move it up." 5363 "Move the current table line down. With arg UP, move it up."
5235 (interactive "P") 5364 (interactive "P")
@@ -5263,11 +5392,12 @@ With prefix ARG, insert below the current line."
5263 (setq line (mapcar (lambda (x) (if (member x '(?| ?+)) ?| ?\ )) line)) 5392 (setq line (mapcar (lambda (x) (if (member x '(?| ?+)) ?| ?\ )) line))
5264 (setq line (mapcar (lambda (x) (if (equal x ?|) ?| ?\ )) line))) 5393 (setq line (mapcar (lambda (x) (if (equal x ?|) ?| ?\ )) line)))
5265 (beginning-of-line (if arg 2 1)) 5394 (beginning-of-line (if arg 2 1))
5266 (apply 'insert line) 5395 (let (org-table-may-need-update)
5267 (insert "\n") 5396 (apply 'insert-before-markers line)
5397 (insert-before-markers "\n"))
5268 (beginning-of-line 0) 5398 (beginning-of-line 0)
5269 (re-search-forward "| ?" (point-at-eol) t) 5399 (re-search-forward "| ?" (point-at-eol) t)
5270 (org-table-align))) 5400 (and org-table-may-need-update (org-table-align))))
5271 5401
5272(defun org-table-insert-hline (&optional arg) 5402(defun org-table-insert-hline (&optional arg)
5273 "Insert a horizontal-line below the current line into the table. 5403 "Insert a horizontal-line below the current line into the table.
@@ -5788,6 +5918,271 @@ separator line)."
5788 (setq ndown 0))) 5918 (setq ndown 0)))
5789 (org-table-align))) 5919 (org-table-align)))
5790 5920
5921;;; The orgtbl minor mode
5922
5923;; Define a minor mode which can be used in other modes in order to
5924;; integrate the org-mode table editor.
5925
5926;; This is really a hack, because the org-mode table editor uses several
5927;; keys which normally belong to the major mode, for example the TAB and
5928;; RET keys. Here is how it works: The minor mode defines all the keys
5929;; necessary to operate the table editor, but wraps the commands into a
5930;; function which tests if the cursor is currently inside a table. If that
5931;; is the case, the table editor command is executed. However, when any of
5932;; those keys is used outside a table, the function uses `key-binding' to
5933;; look up if the key has an associated command in another currently active
5934;; keymap (minor modes, major mode, global), and executes that command.
5935;; There might be problems if any of the keys used by the table editor is
5936;; otherwise used as a prefix key.
5937
5938;; Another challenge is that the key binding for TAB can be tab or \C-i,
5939;; likewise the binding for RET can be return or \C-m. Orgtbl-mode
5940;; addresses this by checking explicitly for both bindings.
5941
5942;; The optimized version (see variable `orgtbl-optimized') takes over
5943;; all keys which are bound to `self-insert-command' in the *global map*.
5944;; Some modes bind other commands to simple characters, for example
5945;; AUCTeX binds the double quote to `Tex-insert-quote'. With orgtbl-mode
5946;; active, this binding is ignored inside tables and replaced with a
5947;; modified self-insert.
5948
5949(defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
5950 "Non-nil means, use the optimized table editor version for orgtbl-mode.
5951In the optimized version, the table editor takes over all simple keys that
5952normally just insert a character. In tables, the characters are inserted
5953in a way to minimize disturbing the table structure (i.e. in overwrite mode
5954for empty fields). Outside tables, the correct binding of the keys is
5955restored.
5956
5957The default for this option is t if the optimized version is also used in
5958Org-mode. See the variable `org-enable-table-editor' for details. Changing
5959this variable requires a restart of Emacs to become effective."
5960 :group 'org-table
5961 :type 'boolean)
5962
5963(defvar orgtbl-mode nil
5964 "Variable controlling orgtbl-mode, a minor mode enabling the org-mode
5965table editor iin arbitrary modes.")
5966(make-variable-buffer-local 'orgtbl-mode)
5967
5968(defvar orgtbl-mode-map (make-sparse-keymap)
5969 "Keymap for orgtbl-mode.")
5970
5971;;;###autoload
5972(defun turn-on-orgtbl ()
5973 "Unconditionally turn on orgtbl-mode."
5974 (orgtbl-mode 1))
5975
5976;;;###autoload
5977(defun orgtbl-mode (&optional arg)
5978 "The org-mode table editor as a minor mode for use in other modes."
5979 (interactive)
5980 (setq orgtbl-mode
5981 (if arg (> (prefix-numeric-value arg) 0) (not orgtbl-mode)))
5982 (if orgtbl-mode
5983 (progn
5984 (set (make-local-variable (quote org-table-may-need-update)) t)
5985 (make-local-hook (quote before-change-functions))
5986 (add-hook 'before-change-functions 'org-before-change-function
5987 nil 'local)
5988 (set (make-local-variable 'org-old-auto-fill-inhibit-regexp)
5989 auto-fill-inhibit-regexp)
5990 (set (make-local-variable 'auto-fill-inhibit-regexp)
5991 (if auto-fill-inhibit-regexp
5992 (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp)
5993 "[ \t]*|"))
5994 (easy-menu-add orgtbl-mode-menu)
5995 (run-hooks (quote orgtbl-mode-hook)))
5996 (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp)
5997 (remove-hook 'before-change-functions 'org-before-change-function t)
5998 (easy-menu-remove orgtbl-mode-menu)
5999 (force-mode-line-update 'all)))
6000
6001;; Install it as a minor mode.
6002(put 'orgtbl-mode :included t)
6003(put 'orgtbl-mode :menu-tag "Org Table Mode")
6004(add-minor-mode 'orgtbl-mode " OrgTbl" orgtbl-mode-map)
6005
6006(defun orgtbl-make-binding (fun &rest keys)
6007 "Create a function for binding in the table minor mode."
6008 (list 'lambda '(arg) '(interactive "p")
6009 (list 'if
6010 '(org-at-table-p)
6011 (list 'call-interactively (list 'quote fun))
6012 (list 'let '(orgtbl-mode)
6013 (list 'call-interactively
6014 (append '(or)
6015 (mapcar (lambda (k)
6016 (list 'key-binding k))
6017 keys)
6018 '('orgtbl-error)))))))
6019
6020(defun orgtbl-error ()
6021 "Error when there is no default binding for a table key."
6022 (interactive)
6023 (error "This key is has no function outside tables"))
6024
6025;; Keybindings for the minor mode
6026(let ((bindings
6027 '(([(meta shift left)] org-table-delete-column)
6028 ([(meta left)] org-table-move-column-left)
6029 ([(meta right)] org-table-move-column-right)
6030 ([(meta shift right)] org-table-insert-column)
6031 ([(meta shift up)] org-table-kill-row)
6032 ([(meta shift down)] org-table-insert-row)
6033 ([(meta up)] org-table-move-row-up)
6034 ([(meta down)] org-table-move-row-down)
6035 ("\C-c\C-w" org-table-cut-region)
6036 ("\C-c\M-w" org-table-copy-region)
6037 ("\C-c\C-y" org-table-paste-rectangle)
6038 ("\C-c-" org-table-insert-hline)
6039 ([(shift tab)] org-table-previous-field)
6040 ("\C-c\C-c" org-table-align)
6041 ([(return)] org-table-next-row)
6042 ([(shift return)] org-table-copy-from-above)
6043 ([(meta return)] org-table-wrap-region)
6044 ("\C-c\C-q" org-table-wrap-region)
6045 ("\C-c?" org-table-current-column)
6046 ("\C-c " org-table-blank-field)
6047 ("\C-c+" org-table-sum)
6048 ("\C-c|" org-table-toggle-vline-visibility)
6049 ("\C-c=" org-table-eval-formula)))
6050 elt key fun cmd)
6051 (while (setq elt (pop bindings))
6052 (setq key (car elt)
6053 fun (nth 1 elt)
6054 cmd (orgtbl-make-binding fun key))
6055 (define-key orgtbl-mode-map key cmd)))
6056
6057;; Special treatment needed for TAB and RET
6058;(define-key orgtbl-mode-map [(return)]
6059; (orgtbl-make-binding 'org-table-next-row [(return)] "\C-m"))
6060;(define-key orgtbl-mode-map "\C-m"
6061; (orgtbl-make-binding 'org-table-next-row "\C-m" [(return)]))
6062;(define-key orgtbl-mode-map [(tab)]
6063; (orgtbl-make-binding 'org-table-next-field [(tab)] "\C-i"))
6064;(define-key orgtbl-mode-map "\C-i"
6065; (orgtbl-make-binding 'org-table-next-field "\C-i" [(tab)]))
6066
6067(define-key orgtbl-mode-map [(return)]
6068 (orgtbl-make-binding 'orgtbl-ret [(return)] "\C-m"))
6069(define-key orgtbl-mode-map "\C-m"
6070 (orgtbl-make-binding 'orgtbl-ret "\C-m" [(return)]))
6071(define-key orgtbl-mode-map [(tab)]
6072 (orgtbl-make-binding 'orgtbl-tab [(tab)] "\C-i"))
6073(define-key orgtbl-mode-map "\C-i"
6074 (orgtbl-make-binding 'orgtbl-tab "\C-i" [(tab)]))
6075
6076(when orgtbl-optimized
6077 ;; If the user wants maximum table support, we need to hijack
6078 ;; some standard editing functions
6079 (substitute-key-definition 'self-insert-command 'orgtbl-self-insert-command
6080 orgtbl-mode-map global-map)
6081 (substitute-key-definition 'delete-char 'orgtbl-delete-char
6082 orgtbl-mode-map global-map)
6083 (substitute-key-definition 'delete-backward-char 'orgtbl-delete-backward-char
6084 orgtbl-mode-map global-map)
6085 (define-key org-mode-map "|" 'self-insert-command))
6086
6087(defun orgtbl-tab ()
6088 "Justification and field motion for orgtbl-mode."
6089 (interactive)
6090 (org-table-justify-field-maybe)
6091 (org-table-next-field))
6092
6093(defun orgtbl-ret ()
6094 "Justification and field motion for orgtbl-mode."
6095 (interactive)
6096 (org-table-justify-field-maybe)
6097 (org-table-next-row))
6098
6099(defun orgtbl-self-insert-command (N)
6100 "Like `self-insert-command', use overwrite-mode for whitespace in tables.
6101If the cursor is in a table looking at whitespace, the whitespace is
6102overwritten, and the table is not marked as requiring realignment."
6103 (interactive "p")
6104 (if (and (org-at-table-p)
6105 (eq N 1)
6106 (looking-at "[^|\n]* +|"))
6107 (let (org-table-may-need-update (pos (point)))
6108 (goto-char (1- (match-end 0)))
6109 (delete-backward-char 1)
6110 (goto-char (match-beginning 0))
6111 (self-insert-command N))
6112 (setq org-table-may-need-update t)
6113 (let (orgtbl-mode)
6114 (call-interactively (key-binding (vector last-input-event))))))
6115
6116(defun orgtbl-delete-backward-char (N)
6117 "Like `delete-backward-char', insert whitespace at field end in tables.
6118When deleting backwards, in tables this function will insert whitespace in
6119front of the next \"|\" separator, to keep the table aligned. The table will
6120still be marked for re-alignment, because a narrow field may lead to a
6121reduced column width."
6122 (interactive "p")
6123 (if (and (org-at-table-p)
6124 (eq N 1)
6125 (looking-at ".*?|"))
6126 (let ((pos (point)))
6127 (backward-delete-char N)
6128 (skip-chars-forward "^|")
6129 (insert " ")
6130 (goto-char (1- pos)))
6131 (message "%s" last-input-event) (sit-for 1)
6132 (delete-backward-char N)))
6133
6134(defun orgtbl-delete-char (N)
6135 "Like `delete-char', but insert whitespace at field end in tables.
6136When deleting characters, in tables this function will insert whitespace in
6137front of the next \"|\" separator, to keep the table aligned. The table
6138will still be marked for re-alignment, because a narrow field may lead to
6139a reduced column width."
6140 (interactive "p")
6141 (if (and (org-at-table-p)
6142 (eq N 1))
6143 (if (looking-at ".*?|")
6144 (let ((pos (point)))
6145 (replace-match (concat
6146 (substring (match-string 0) 1 -1)
6147 " |"))
6148 (goto-char pos)))
6149 (delete-char N)))
6150
6151(easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu"
6152 '("Tbl"
6153 ["Align" org-ctrl-c-ctrl-c :active (org-at-table-p) :keys "C-c C-c"]
6154 ["Next field" org-cycle :active (org-at-table-p) :keys "TAB"]
6155 ["Previous Field" org-shifttab :active (org-at-table-p) :keys "S-TAB"]
6156 ["Next row" org-return :active (org-at-table-p) :keys "RET"]
6157 "--"
6158 ["Blank field" org-table-blank-field :active (org-at-table-p) :keys "C-c SPC"]
6159 ["Copy field from above"
6160 org-table-copy-from-above :active (org-at-table-p) :keys "S-RET"]
6161 "--"
6162 ("Column"
6163 ["Move column left" org-metaleft :active (org-at-table-p) :keys "M-<left>"]
6164 ["Move column right" org-metaright :active (org-at-table-p) :keys "M-<right>"]
6165 ["Delete column" org-shiftmetaleft :active (org-at-table-p) :keys "M-S-<left>"]
6166 ["Insert column" org-shiftmetaright :active (org-at-table-p) :keys "M-S-<right>"])
6167 ("Row"
6168 ["Move row up" org-metaup :active (org-at-table-p) :keys "M-<up>"]
6169 ["Move row down" org-metadown :active (org-at-table-p) :keys "M-<down>"]
6170 ["Delete row" org-shiftmetaup :active (org-at-table-p) :keys "M-S-<up>"]
6171 ["Insert row" org-shiftmetadown :active (org-at-table-p) :keys "M-S-<down>"]
6172 "--"
6173 ["Insert hline" org-table-insert-hline :active (org-at-table-p) :keys "C-c -"])
6174 ("Rectangle"
6175 ["Copy rectangle" org-copy-special :active (org-at-table-p) :keys "C-c M-w"]
6176 ["Cut rectangle" org-cut-special :active (org-at-table-p) :keys "C-c C-w"]
6177 ["Paste rectangle" org-paste-special :active (org-at-table-p) :keys "C-c C-y"]
6178 ["Fill rectangle" org-table-wrap-region :active (org-at-table-p) :keys "C-c C-q"])
6179 "--"
6180 ["Which column?" org-table-current-column :active (org-at-table-p) :keys "C-c ?"]
6181 ["Sum column/rectangle" org-table-sum
6182 :active (or (org-at-table-p) (org-region-active-p)) :keys "C-c +"]
6183 ["Eval formula" org-table-eval-formula :active (org-at-table-p) :keys "C-c ="]
6184 ))
6185
5791;;; Exporting 6186;;; Exporting
5792 6187
5793(defconst org-level-max 20) 6188(defconst org-level-max 20)
@@ -6300,6 +6695,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
6300#+CATEGORY: %s 6695#+CATEGORY: %s
6301#+SEQ_TODO: %s 6696#+SEQ_TODO: %s
6302#+TYP_TODO: %s 6697#+TYP_TODO: %s
6698#+STARTUP: %s %s
6303" 6699"
6304 (buffer-name) (user-full-name) user-mail-address org-export-default-language 6700 (buffer-name) (user-full-name) user-mail-address org-export-default-language
6305 org-export-headline-levels 6701 org-export-headline-levels
@@ -6318,7 +6714,10 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
6318 "TODO FEEDBACK VERIFY DONE") 6714 "TODO FEEDBACK VERIFY DONE")
6319 (if (equal org-todo-interpretation 'type) 6715 (if (equal org-todo-interpretation 'type)
6320 (mapconcat 'identity org-todo-keywords " ") 6716 (mapconcat 'identity org-todo-keywords " ")
6321 "Me Jason Marie DONE"))) 6717 "Me Jason Marie DONE")
6718 (if org-startup-folded "fold" "nofold")
6719 (if org-startup-with-deadline-check "dlcheck" "nodlcheck")
6720 ))
6322 6721
6323(defun org-insert-export-options-template () 6722(defun org-insert-export-options-template ()
6324 "Insert into the buffer a template with information for exporting." 6723 "Insert into the buffer a template with information for exporting."
@@ -7025,6 +7424,7 @@ When LEVEL is non-nil, increase section numbers on that level."
7025(define-key org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c) 7424(define-key org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c)
7026(define-key org-mode-map [(return)] 'org-return) 7425(define-key org-mode-map [(return)] 'org-return)
7027(define-key org-mode-map [(shift return)] 'org-table-copy-from-above) 7426(define-key org-mode-map [(shift return)] 'org-table-copy-from-above)
7427(define-key org-mode-map [(meta return)] 'org-meta-return)
7028(define-key org-mode-map [(control up)] 'org-move-line-up) 7428(define-key org-mode-map [(control up)] 'org-move-line-up)
7029(define-key org-mode-map [(control down)] 'org-move-line-down) 7429(define-key org-mode-map [(control down)] 'org-move-line-down)
7030(define-key org-mode-map "\C-c?" 'org-table-current-column) 7430(define-key org-mode-map "\C-c?" 'org-table-current-column)
@@ -7041,6 +7441,105 @@ When LEVEL is non-nil, increase section numbers on that level."
7041(define-key org-mode-map "\C-c\C-xh" 'org-export-as-html) 7441(define-key org-mode-map "\C-c\C-xh" 'org-export-as-html)
7042(define-key org-mode-map "\C-c\C-x\C-h" 'org-export-as-html-and-open) 7442(define-key org-mode-map "\C-c\C-x\C-h" 'org-export-as-html-and-open)
7043 7443
7444
7445;; FIXME: Do we really need to save match data in these commands?
7446;; I would like to remove it in order to minimize impact.
7447;; Self-insert already does not preserve it. How much resources does this take???
7448
7449(defsubst org-table-p ()
7450 (if (and (eq major-mode 'org-mode) font-lock-mode)
7451 (eq (get-text-property (point) 'face) 'org-table-face)
7452 (save-match-data (org-at-table-p))))
7453
7454(defun org-self-insert-command (N)
7455 "Like `self-insert-command', use overwrite-mode for whitespace in tables.
7456If the cursor is in a table looking at whitespace, the whitespace is
7457overwritten, and the table is not marked as requiring realignment."
7458 (interactive "p")
7459 (if (and (org-table-p)
7460 (eq N 1)
7461 (looking-at "[^|\n]* +|"))
7462 (let (org-table-may-need-update (pos (point)))
7463 (goto-char (1- (match-end 0)))
7464 (delete-backward-char 1)
7465 (goto-char (match-beginning 0))
7466 (self-insert-command N))
7467 (setq org-table-may-need-update t)
7468 (self-insert-command N)))
7469
7470;; FIXME:
7471;; The following two functions might still be optimized to trigger
7472;; re-alignment less frequently. Right now they raise the flag each time
7473;; (through before-change-functions). Here is how this could be minimized:
7474;; Basically, check if the non-white field width before deletion is
7475;; equal to the column width. If yes, the delete should trigger a
7476;; re-align. I have not implemented this so far because it is not so
7477;; easy, requires grabbing the field etc. So it may finally have some
7478;; impact on typing performance which we don't want.
7479
7480;; The defsubst is only a draft, untested...
7481
7482;; Maybe it is not so important to get rid of realigns - maybe the most
7483;; important aspect is to keep the table look noce as long as possible,
7484;; which is already achieved...
7485
7486;(defsubst org-check-delete-triggers-realign ()
7487; (let ((pos (point)))
7488; (skip-chars-backward "^|\n")
7489; (and (looking-at " *\\(.*?\\) *|")
7490; (= (nth (1- (org-table-current-column))
7491; org-table-last-column-widths)
7492; (- (match-end 1) (match-beginning 1)))
7493; (setq org-table-may-need-update t))))
7494
7495(defun org-delete-backward-char (N)
7496 "Like `delete-backward-char', insert whitespace at field end in tables.
7497When deleting backwards, in tables this function will insert whitespace in
7498front of the next \"|\" separator, to keep the table aligned. The table will
7499still be marked for re-alignment, because a narrow field may lead to a
7500reduced column width."
7501 (interactive "p")
7502 (if (and (org-table-p)
7503 (eq N 1)
7504 (looking-at ".*?|"))
7505 (let ((pos (point)))
7506 (backward-delete-char N)
7507 (skip-chars-forward "^|")
7508 (insert " ")
7509 (goto-char (1- pos)))
7510 (backward-delete-char N)))
7511
7512(defun org-delete-char (N)
7513 "Like `delete-char', but insert whitespace at field end in tables.
7514When deleting characters, in tables this function will insert whitespace in
7515front of the next \"|\" separator, to keep the table aligned. The table
7516will still be marked for re-alignment, because a narrow field may lead to
7517a reduced column width."
7518 (interactive "p")
7519 (if (and (org-table-p)
7520 (eq N 1))
7521 (if (looking-at ".*?|")
7522 (let ((pos (point)))
7523 (replace-match (concat
7524 (substring (match-string 0) 1 -1)
7525 " |"))
7526 (goto-char pos)))
7527 (delete-char N)))
7528
7529;; How to do this: Measure non-white length of current string
7530;; If equal to column width, we should realign.
7531
7532(when (eq org-enable-table-editor 'optimized)
7533 ;; If the user wants maximum table support, we need to hijack
7534 ;; some standard editing functions
7535 (substitute-key-definition 'self-insert-command 'org-self-insert-command
7536 org-mode-map global-map)
7537 (substitute-key-definition 'delete-char 'org-delete-char
7538 org-mode-map global-map)
7539 (substitute-key-definition 'delete-backward-char 'org-delete-backward-char
7540 org-mode-map global-map)
7541 (define-key org-mode-map "|" 'self-insert-command))
7542
7044(defun org-shiftcursor-error () 7543(defun org-shiftcursor-error ()
7045 "Throw an error because Shift-Cursor command was applied in wrong context." 7544 "Throw an error because Shift-Cursor command was applied in wrong context."
7046 (error "This command is only active in tables and on headlines.")) 7545 (error "This command is only active in tables and on headlines."))
@@ -7173,9 +7672,18 @@ the automatic table editor has been turned off."
7173 "Call `org-table-next-row' or `newline'." 7672 "Call `org-table-next-row' or `newline'."
7174 (interactive "P") 7673 (interactive "P")
7175 (cond 7674 (cond
7176 ((org-at-table-p) (org-table-next-row)) 7675 ((org-at-table-p)
7676 (org-table-justify-field-maybe)
7677 (org-table-next-row))
7177 (t (newline)))) 7678 (t (newline))))
7178 7679
7680(defun org-meta-return (&optional arg)
7681 "Call `org-insert-heading' or `org-table-wrap-region'."
7682 (interactive "P")
7683 (cond
7684 ((org-at-table-p)
7685 (org-table-wrap-region arg))
7686 (t (org-insert-heading arg))))
7179 7687
7180;;; Menu entries 7688;;; Menu entries
7181 7689
@@ -7245,7 +7753,7 @@ the automatic table editor has been turned off."
7245 ["Check Deadlines this file" org-check-deadlines t] 7753 ["Check Deadlines this file" org-check-deadlines t]
7246 ["Timeline current file" org-timeline t] 7754 ["Timeline current file" org-timeline t]
7247 "--" 7755 "--"
7248 ["Adenda (multifile)" org-agenda-overview t]) 7756 ["Adenda (multifile)" org-agenda t])
7249 ("File List for Agenda") 7757 ("File List for Agenda")
7250 "--" 7758 "--"
7251 ("Hyperlinks" 7759 ("Hyperlinks"
@@ -7586,6 +8094,7 @@ When ENTRY is non-nil, show the entire entry."
7586 8094
7587(run-hooks 'org-load-hook) 8095(run-hooks 'org-load-hook)
7588 8096
8097;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
8098
7589;;; org.el ends here 8099;;; org.el ends here
7590 8100
7591;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
diff --git a/lisp/textmodes/reftex-auc.el b/lisp/textmodes/reftex-auc.el
index 534e4e7b27b..93cd0757b4e 100644
--- a/lisp/textmodes/reftex-auc.el
+++ b/lisp/textmodes/reftex-auc.el
@@ -1,8 +1,8 @@
1;;; reftex-auc.el --- RefTeX's interface to AUCTeX 1;;; reftex-auc.el --- RefTeX's interface to AUCTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.21 5;; Version: 4.26
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
diff --git a/lisp/textmodes/reftex-cite.el b/lisp/textmodes/reftex-cite.el
index e25464c798d..6369f9637db 100644
--- a/lisp/textmodes/reftex-cite.el
+++ b/lisp/textmodes/reftex-cite.el
@@ -1,8 +1,8 @@
1;;; reftex-cite.el --- creating citations with RefTeX 1;;; reftex-cite.el --- creating citations with RefTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.21 5;; Version: 4.26
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
@@ -49,11 +49,11 @@
49 TAB Enter citation key with completion. 49 TAB Enter citation key with completion.
50 RET Accept current entry (also on mouse-2) and create \\cite macro. 50 RET Accept current entry (also on mouse-2) and create \\cite macro.
51 m / u Mark/Unmark the entry. 51 m / u Mark/Unmark the entry.
52 e / E Create BibTeX file with all (marked/unmarked) entries
52 a / A Put all (marked) entries into one/many \\cite commands.") 53 a / A Put all (marked) entries into one/many \\cite commands.")
53 54
54;; Find bibtex files 55;; Find bibtex files
55 56
56
57(defmacro reftex-with-special-syntax-for-bib (&rest body) 57(defmacro reftex-with-special-syntax-for-bib (&rest body)
58 `(let ((saved-syntax (syntax-table))) 58 `(let ((saved-syntax (syntax-table)))
59 (unwind-protect 59 (unwind-protect
@@ -311,8 +311,8 @@
311 (not (stringp (car al1)))))) 311 (not (stringp (car al1))))))
312 312
313(defun reftex-bib-sort-year (e1 e2) 313(defun reftex-bib-sort-year (e1 e2)
314 (< (string-to-int (cdr (assoc "year" e1))) 314 (< (string-to-int (or (cdr (assoc "year" e1)) "0"))
315 (string-to-int (cdr (assoc "year" e2))))) 315 (string-to-int (or (cdr (assoc "year" e2)) "0"))))
316 316
317(defun reftex-bib-sort-year-reverse (e1 e2) 317(defun reftex-bib-sort-year-reverse (e1 e2)
318 (> (string-to-int (or (cdr (assoc "year" e1)) "0")) 318 (> (string-to-int (or (cdr (assoc "year" e1)) "0"))
@@ -597,12 +597,13 @@ to `reftex-cite-format' and inserted into the buffer.
597 597
598If NO-INSERT is non-nil, nothing is inserted, only the selected key returned. 598If NO-INSERT is non-nil, nothing is inserted, only the selected key returned.
599 599
600FORAT-KEY can be used to pre-select a citation format. 600FORMAT-KEY can be used to pre-select a citation format.
601 601
602When called with one or two `C-u' prefixes, first rescans the document. 602When called with a `C-u' prefix, prompt for optional arguments in
603When called with a numeric prefix, make that many citations. When 603cite macros. When called with a numeric prefix, make that many
604called with point inside the braces of a `\\cite' command, it will 604citations. When called with point inside the braces of a `\\cite'
605add another key, ignoring the value of `reftex-cite-format'. 605command, it will add another key, ignoring the value of
606`reftex-cite-format'.
606 607
607The regular expression uses an expanded syntax: && is interpreted as `and'. 608The regular expression uses an expanded syntax: && is interpreted as `and'.
608Thus, `aaaa&&bbb' matches entries which contain both `aaaa' and `bbb'. 609Thus, `aaaa&&bbb' matches entries which contain both `aaaa' and `bbb'.
@@ -618,7 +619,7 @@ While entering the regexp, completion on knows citation keys is possible.
618 ;; Thus look for the scanning info only if in reftex-mode. 619 ;; Thus look for the scanning info only if in reftex-mode.
619 620
620 (when reftex-mode 621 (when reftex-mode
621 (reftex-access-scan-info current-prefix-arg)) 622 (reftex-access-scan-info nil))
622 623
623 ;; Call reftex-do-citation, but protected 624 ;; Call reftex-do-citation, but protected
624 (unwind-protect 625 (unwind-protect
@@ -629,11 +630,14 @@ While entering the regexp, completion on knows citation keys is possible.
629 ;; This really does the work of reftex-citation. 630 ;; This really does the work of reftex-citation.
630 631
631 (let* ((format (reftex-figure-out-cite-format arg no-insert format-key)) 632 (let* ((format (reftex-figure-out-cite-format arg no-insert format-key))
633 (start 0)
632 (docstruct-symbol reftex-docstruct-symbol) 634 (docstruct-symbol reftex-docstruct-symbol)
633 (selected-entries (reftex-offer-bib-menu)) 635 (selected-entries (reftex-offer-bib-menu))
634 (insert-entries selected-entries) 636 (insert-entries selected-entries)
635 entry string cite-view) 637 entry string cite-view)
636 638
639 (when (stringp selected-entries)
640 (error selected-entries))
637 (unless selected-entries (error "Quit")) 641 (unless selected-entries (error "Quit"))
638 642
639 (if (stringp selected-entries) 643 (if (stringp selected-entries)
@@ -646,6 +650,7 @@ While entering the regexp, completion on knows citation keys is possible.
646 650
647 (when (eq (car selected-entries) 'concat) 651 (when (eq (car selected-entries) 'concat)
648 ;; All keys go into a single command - we need to trick a little 652 ;; All keys go into a single command - we need to trick a little
653 ;; FIXME: Unfortunately, this meens that commenting does not work right.
649 (pop selected-entries) 654 (pop selected-entries)
650 (let ((concat-keys (mapconcat 'car selected-entries ","))) 655 (let ((concat-keys (mapconcat 'car selected-entries ",")))
651 (setq insert-entries 656 (setq insert-entries
@@ -663,6 +668,24 @@ While entering the regexp, completion on knows citation keys is possible.
663 (reftex-get-bib-field "&key" entry) 668 (reftex-get-bib-field "&key" entry)
664 format) 669 format)
665 (reftex-format-citation entry format))) 670 (reftex-format-citation entry format)))
671 (when (or (eq reftex-cite-prompt-optional-args t)
672 (and reftex-cite-prompt-optional-args
673 (equal arg '(4))))
674 (let ((start 0) (nth 0) value)
675 (while (setq start (string-match "\\[\\]" string start))
676 (setq value (read-string (format "Optional argument %d: "
677 (setq nth (1+ nth)))))
678 (setq string (replace-match (concat "[" value "]") t t string))
679 (setq start (1+ start)))))
680 ;; Should we cleanup empty optional arguments?
681 ;; if the first is empty, it can be removed. If the second is empty,
682 ;; it has to go.
683 (when reftex-cite-cleanup-optional-args
684 (cond
685 ((string-match "\\[\\]\\(\\[[a-zA-Z0-9., ]+\\]\\)" string)
686 (setq string (replace-match "\\1" nil nil string)))
687 ((string-match "\\[\\]\\[\\]" string)
688 (setq string (replace-match "" t t string)))))
666 (insert string)) 689 (insert string))
667 690
668 ;; Reposition cursor? 691 ;; Reposition cursor?
@@ -842,6 +865,17 @@ While entering the regexp, completion on knows citation keys is possible.
842 (mapcar 'car (nreverse reftex-select-marked)) 865 (mapcar 'car (nreverse reftex-select-marked))
843 found-list))) 866 found-list)))
844 (throw 'done t)) 867 (throw 'done t))
868 ((eq key ?e)
869 ;; Take all (marked), and push the symbol 'concat
870 (reftex-extract-bib-file found-list reftex-select-marked)
871 (setq selected-entries "BibTeX database file created")
872 (throw 'done t))
873 ((eq key ?E)
874 ;; Take all (marked), and push the symbol 'concat
875 (reftex-extract-bib-file found-list reftex-select-marked
876 'complement)
877 (setq selected-entries "BibTeX database file created")
878 (throw 'done t))
845 ((or (eq key ?\C-m) 879 ((or (eq key ?\C-m)
846 (eq key 'return)) 880 (eq key 'return))
847 ;; Take selected 881 ;; Take selected
@@ -882,6 +916,29 @@ While entering the regexp, completion on knows citation keys is possible.
882 (ding) 916 (ding)
883 found-list))) 917 found-list)))
884 918
919(defun reftex-extract-bib-file (all &optional marked complement)
920 ;; Limit FOUND-LIST with more regular expressions
921 (let ((file (read-file-name "File to create: ")))
922 (find-file-other-window file)
923 (if (> (buffer-size) 0)
924 (unless (yes-or-no-p
925 (format "Overwrite non-empty file %s? " file))
926 (error "Abort")))
927 (erase-buffer)
928 (setq all (delq nil
929 (mapcar
930 (lambda (x)
931 (if marked
932 (if (or (and (assoc x marked) (not complement))
933 (and (not (assoc x marked)) complement))
934 (cdr (assoc "&entry" x))
935 nil)
936 (cdr (assoc "&entry" x))))
937 all)))
938 (insert (mapconcat 'identity all "\n\n"))
939 (save-buffer)
940 (goto-char (point-min))))
941
885(defun reftex-insert-bib-matches (list) 942(defun reftex-insert-bib-matches (list)
886 ;; Insert the bib matches and number them correctly 943 ;; Insert the bib matches and number them correctly
887 (let ((mouse-face 944 (let ((mouse-face
@@ -1043,5 +1100,73 @@ While entering the regexp, completion on knows citation keys is possible.
1043 1100
1044 (select-window win))) 1101 (select-window win)))
1045 1102
1103;;; Global BibTeX file
1104(defun reftex-all-used-citation-keys ()
1105 (reftex-access-scan-info)
1106 (let ((files (reftex-all-document-files)) file keys kkk kk k)
1107 (save-excursion
1108 (while (setq file (pop files))
1109 (set-buffer (reftex-get-file-buffer-force file 'mark))
1110 (save-excursion
1111 (save-restriction
1112 (widen)
1113 (goto-char (point-min))
1114 (while (re-search-forward "^[^%\n\r]*\\\\\\(bibentry\\|[a-zA-Z]*cite[a-zA-Z]*\\)\\(\\[[^\\]]*\\]\\)?{\\([^}]+\\)}" nil t)
1115 (setq kk (match-string-no-properties 3))
1116 (while (string-match "%.*\n?" kk)
1117 (setq kk (replace-match "" t t kk)))
1118 (setq kk (split-string kk "[, \t\r\n]+"))
1119 (while (setq k (pop kk))
1120 (or (member k keys)
1121 (setq keys (cons k keys)))))))))
1122 (reftex-kill-temporary-buffers)
1123 keys))
1124
1125(defun reftex-create-bibtex-file (bibfile)
1126 "Create a new BibTeX database file with all entries referenced in document.
1127The command prompts for a filename and writes the collected entries to
1128that file. Only entries referenced in the current document with
1129any \\cite-like macros are used.
1130The sequence in the new file is the same as it was in the old database."
1131 (interactive "FNew BibTeX file: ")
1132 (let ((keys (reftex-all-used-citation-keys))
1133 (files (reftex-get-bibfile-list))
1134 file key entries beg end entry)
1135 (save-excursion
1136 (while (setq file (pop files))
1137 (set-buffer (reftex-get-file-buffer-force file 'mark))
1138 (reftex-with-special-syntax-for-bib
1139 (save-excursion
1140 (save-restriction
1141 (widen)
1142 (goto-char (point-min))
1143 (while (re-search-forward
1144 "^[ \t]*@[a-zA-Z]+[ \t]*{\\([^ \t\r\n]+\\),"
1145 nil t)
1146 (setq key (match-string 1)
1147 beg (match-beginning 0)
1148 end (progn
1149 (goto-char (match-beginning 1))
1150 (condition-case nil
1151 (up-list 1)
1152 (error (goto-char (match-end 0))))
1153 (point)))
1154 (when (member key keys)
1155 (setq entry (buffer-substring beg end)
1156 entries (cons entry entries)
1157 keys (delete key keys)))))))))
1158 (find-file-other-window bibfile)
1159 (if (> (buffer-size) 0)
1160 (unless (yes-or-no-p
1161 (format "Overwrite non-empty file %s? " bibfile))
1162 (error "Abort")))
1163 (erase-buffer)
1164 (insert (mapconcat 'identity (reverse entries) "\n\n"))
1165 (goto-char (point-min))
1166 (save-buffer)
1167 (message "%d entries extracted and copied to new database"
1168 (length entries))))
1169
1170
1046;;; arch-tag: d53d0a5a-ab32-4b52-a846-2a7c3527cd89 1171;;; arch-tag: d53d0a5a-ab32-4b52-a846-2a7c3527cd89
1047;;; reftex-cite.el ends here 1172;;; reftex-cite.el ends here
diff --git a/lisp/textmodes/reftex-dcr.el b/lisp/textmodes/reftex-dcr.el
index dc47a5e7564..e832465cf17 100644
--- a/lisp/textmodes/reftex-dcr.el
+++ b/lisp/textmodes/reftex-dcr.el
@@ -1,8 +1,8 @@
1;;; reftex-dcr.el --- viewing cross references and citations with RefTeX 1;;; reftex-dcr.el --- viewing cross references and citations with RefTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.21 5;; Version: 4.26
6;; 6;;
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-global.el b/lisp/textmodes/reftex-global.el
index 84b4c7c67f5..d4d91b476e9 100644
--- a/lisp/textmodes/reftex-global.el
+++ b/lisp/textmodes/reftex-global.el
@@ -1,8 +1,8 @@
1;;; reftex-global.el --- operations on entire documents with RefTeX 1;;; reftex-global.el --- operations on entire documents with RefTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.21 5;; Version: 4.26
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el
index 71b3b624770..cb02f2e056f 100644
--- a/lisp/textmodes/reftex-index.el
+++ b/lisp/textmodes/reftex-index.el
@@ -1,8 +1,8 @@
1;;; reftex-index.el --- index support with RefTeX 1;;; reftex-index.el --- index support with RefTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.21 5;; Version: 4.26
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
@@ -360,7 +360,7 @@ _ ^ Add/Remove parent key (to make this item a subitem).
360 (reftex-highlight 0 (match-beginning 0) (match-end 0) (current-buffer))) 360 (reftex-highlight 0 (match-beginning 0) (match-end 0) (current-buffer)))
361 match)) 361 match))
362 362
363(defun reftex-display-index (&optional tag overriding-restriction 363(defun reftex-display-index (&optional tag overriding-restriction redo
364 &rest locations) 364 &rest locations)
365 "Display a buffer with an index compiled from the current document. 365 "Display a buffer with an index compiled from the current document.
366When the document has multiple indices, first prompts for the correct one. 366When the document has multiple indices, first prompts for the correct one.
@@ -387,7 +387,7 @@ With prefix 3, restrict index to region."
387 (calling-file (buffer-file-name)) 387 (calling-file (buffer-file-name))
388 (restriction 388 (restriction
389 (or overriding-restriction 389 (or overriding-restriction
390 (and (interactive-p) 390 (and (not redo)
391 (reftex-get-restriction current-prefix-arg docstruct)))) 391 (reftex-get-restriction current-prefix-arg docstruct))))
392 (locations 392 (locations
393 ;; See if we are on an index macro as initial position 393 ;; See if we are on an index macro as initial position
@@ -427,7 +427,7 @@ With prefix 3, restrict index to region."
427 (if restriction 427 (if restriction
428 (setq reftex-index-restriction-indicator (car restriction) 428 (setq reftex-index-restriction-indicator (car restriction)
429 reftex-index-restriction-data (cdr restriction)) 429 reftex-index-restriction-data (cdr restriction))
430 (if (interactive-p) 430 (if (not redo)
431 (setq reftex-index-restriction-indicator nil 431 (setq reftex-index-restriction-indicator nil
432 reftex-index-restriction-data nil))) 432 reftex-index-restriction-data nil)))
433 (when (= (buffer-size) 0) 433 (when (= (buffer-size) 0)
@@ -703,7 +703,7 @@ The function will go to the section where the entry at point was defined."
703 (error "Don't know which file to rescan. Try `C-u r'") 703 (error "Don't know which file to rescan. Try `C-u r'")
704 (switch-to-buffer (reftex-get-file-buffer-force file)) 704 (switch-to-buffer (reftex-get-file-buffer-force file))
705 (setq current-prefix-arg '(4)) 705 (setq current-prefix-arg '(4))
706 (reftex-display-index index-tag nil line))) 706 (reftex-display-index index-tag nil 'redo line)))
707 (reftex-index-Rescan)) 707 (reftex-index-Rescan))
708 (reftex-kill-temporary-buffers))) 708 (reftex-kill-temporary-buffers)))
709(defun reftex-index-Rescan (&rest ignore) 709(defun reftex-index-Rescan (&rest ignore)
@@ -714,7 +714,7 @@ The function will go to the section where the entry at point was defined."
714 (switch-to-buffer 714 (switch-to-buffer
715 (reftex-get-file-buffer-force reftex-last-index-file)) 715 (reftex-get-file-buffer-force reftex-last-index-file))
716 (setq current-prefix-arg '(16)) 716 (setq current-prefix-arg '(16))
717 (reftex-display-index index-tag nil line))) 717 (reftex-display-index index-tag nil 'redo line)))
718(defun reftex-index-revert (&rest ignore) 718(defun reftex-index-revert (&rest ignore)
719 "Regenerate the *Index* from the internal lists. No reparsing os done." 719 "Regenerate the *Index* from the internal lists. No reparsing os done."
720 (interactive) 720 (interactive)
@@ -727,14 +727,14 @@ The function will go to the section where the entry at point was defined."
727 (reftex-erase-buffer buf) 727 (reftex-erase-buffer buf)
728 (setq current-prefix-arg nil 728 (setq current-prefix-arg nil
729 reftex-last-follow-point 1) 729 reftex-last-follow-point 1)
730 (reftex-display-index index-tag nil data line))) 730 (reftex-display-index index-tag nil 'redo data line)))
731(defun reftex-index-switch-index-tag (&rest ignore) 731(defun reftex-index-switch-index-tag (&rest ignore)
732 "Switch to a different index of the same document." 732 "Switch to a different index of the same document."
733 (interactive) 733 (interactive)
734 (switch-to-buffer 734 (switch-to-buffer
735 (reftex-get-file-buffer-force reftex-last-index-file)) 735 (reftex-get-file-buffer-force reftex-last-index-file))
736 (setq current-prefix-arg nil) 736 (setq current-prefix-arg nil)
737 (reftex-display-index)) 737 (reftex-display-index nil nil 'redo))
738 738
739(defun reftex-index-restrict-to-section (&optional force) 739(defun reftex-index-restrict-to-section (&optional force)
740 "Restrict index to entries defined in same document sect. as entry at point." 740 "Restrict index to entries defined in same document sect. as entry at point."
@@ -1352,23 +1352,23 @@ Here are all local bindings.
1352 (if (re-search-forward reftex-index-phrases-phrase-regexp12 nil t) 1352 (if (re-search-forward reftex-index-phrases-phrase-regexp12 nil t)
1353 (progn 1353 (progn
1354 (goto-char (match-beginning 0)) 1354 (goto-char (match-beginning 0))
1355 (reftex-index-this-phrase)) 1355 (reftex-index-this-phrase 'slave))
1356 (error "No more phrase lines after point")))) 1356 (error "No more phrase lines after point"))))
1357 1357
1358(defun reftex-index-this-phrase () 1358(defun reftex-index-this-phrase (&optional slave)
1359 "Index the phrase in the current line. 1359 "Index the phrase in the current line.
1360Does a global search and replace in the entire document. At each 1360Does a global search and replace in the entire document. At each
1361match, the user will be asked to confirm the replacement." 1361match, the user will be asked to confirm the replacement."
1362 (interactive) 1362 (interactive)
1363 (if (interactive-p) (reftex-index-phrases-parse-header t)) 1363 (if (not slave) (reftex-index-phrases-parse-header t))
1364 (save-excursion 1364 (save-excursion
1365 (beginning-of-line) 1365 (beginning-of-line)
1366 (cond ((looking-at reftex-index-phrases-comment-regexp) 1366 (cond ((looking-at reftex-index-phrases-comment-regexp)
1367 (if (interactive-p) (error "Comment line"))) 1367 (if (not slave) (error "Comment line")))
1368 ((looking-at "^[ \t]*$") 1368 ((looking-at "^[ \t]*$")
1369 (if (interactive-p) (error "Empty line"))) 1369 (if (not slave) (error "Empty line")))
1370 ((looking-at reftex-index-phrases-macrodef-regexp) 1370 ((looking-at reftex-index-phrases-macrodef-regexp)
1371 (if (interactive-p) (error "Macro definition line"))) 1371 (if (not slave) (error "Macro definition line")))
1372 ((looking-at reftex-index-phrases-phrase-regexp12) 1372 ((looking-at reftex-index-phrases-phrase-regexp12)
1373 ;; This is a phrase 1373 ;; This is a phrase
1374 (let* ((char (if (not (equal (match-string 1) "")) 1374 (let* ((char (if (not (equal (match-string 1) ""))
@@ -1429,7 +1429,7 @@ Calls `reftex-index-this-phrase' on each line in the region."
1429 (goto-char beg) 1429 (goto-char beg)
1430 (while (not (or (eobp) 1430 (while (not (or (eobp)
1431 (>= (point) end))) 1431 (>= (point) end)))
1432 (save-excursion (reftex-index-this-phrase)) 1432 (save-excursion (reftex-index-this-phrase 'slave))
1433 (beginning-of-line 2))) 1433 (beginning-of-line 2)))
1434 1434
1435(defun reftex-index-phrases-parse-header (&optional get-files) 1435(defun reftex-index-phrases-parse-header (&optional get-files)
@@ -1736,12 +1736,15 @@ With optional arg ALLOW-NEWLINE, allow single newline between words."
1736 "\\([ \t]*\\(\n[ \t]*\\)?\\|[ \t]\\)" 1736 "\\([ \t]*\\(\n[ \t]*\\)?\\|[ \t]\\)"
1737 "\\([ \t]+\\)"))) 1737 "\\([ \t]+\\)")))
1738 (concat (if (and as-words (string-match "\\`\\w" (car words))) 1738 (concat (if (and as-words (string-match "\\`\\w" (car words)))
1739 "\\<" "") 1739 "\\(\\<\\|[`']\\)" "")
1740 (mapconcat (lambda (w) (regexp-quote (downcase w))) 1740 (mapconcat (lambda (w) (regexp-quote
1741 (if reftex-index-phrases-case-fold-search
1742 (downcase w)
1743 w)))
1741 words space-re) 1744 words space-re)
1742 (if (and as-words 1745 (if (and as-words
1743 (string-match "\\w\\'" (nth (1- (length words)) words))) 1746 (string-match "\\w\\'" (nth (1- (length words)) words)))
1744 "\\>" "")))) 1747 "\\(\\>\\|'\\)" ""))))
1745 1748
1746(defun reftex-index-simplify-phrase (phrase) 1749(defun reftex-index-simplify-phrase (phrase)
1747 "Make phrase single spaces and single line." 1750 "Make phrase single spaces and single line."
@@ -1825,6 +1828,8 @@ both ends."
1825 (unwind-protect 1828 (unwind-protect
1826 (while (re-search-forward re nil t) 1829 (while (re-search-forward re nil t)
1827 (catch 'next-match 1830 (catch 'next-match
1831 (if (reftex-in-comment)
1832 (throw 'next-match nil))
1828 (if (and (fboundp reftex-index-verify-function) 1833 (if (and (fboundp reftex-index-verify-function)
1829 (not (funcall reftex-index-verify-function))) 1834 (not (funcall reftex-index-verify-function)))
1830 (throw 'next-match nil)) 1835 (throw 'next-match nil))
@@ -1925,7 +1930,7 @@ both ends."
1925 (reftex-unhighlight 0)))) 1930 (reftex-unhighlight 0))))
1926 1931
1927(defun reftex-index-phrase-match-is-indexed (beg end) 1932(defun reftex-index-phrase-match-is-indexed (beg end)
1928 ;; CHeck if match is in an argument of an index macro, or if an 1933 ;; Check if match is in an argument of an index macro, or if an
1929 ;; index macro is directly attached to the match. 1934 ;; index macro is directly attached to the match.
1930 (save-excursion 1935 (save-excursion
1931 (goto-char end) 1936 (goto-char end)
diff --git a/lisp/textmodes/reftex-parse.el b/lisp/textmodes/reftex-parse.el
index 534775bf5a5..630c7101725 100644
--- a/lisp/textmodes/reftex-parse.el
+++ b/lisp/textmodes/reftex-parse.el
@@ -1,8 +1,8 @@
1;;; reftex-parse.el --- parser functions for RefTeX 1;;; reftex-parse.el --- parser functions for RefTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.21 5;; Version: 4.26
6;; 6;;
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index 2d4935aedde..43095e2d684 100644
--- a/lisp/textmodes/reftex-ref.el
+++ b/lisp/textmodes/reftex-ref.el
@@ -1,8 +1,8 @@
1;;; reftex-ref.el --- code to create labels and references with RefTeX 1;;; reftex-ref.el --- code to create labels and references with RefTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.21 5;; Version: 4.26
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
@@ -96,14 +96,27 @@ If optional BOUND is an integer, limit backward searches to that point."
96 96
97(defun reftex-label-info (label &optional file bound derive env-or-mac) 97(defun reftex-label-info (label &optional file bound derive env-or-mac)
98 ;; Return info list on LABEL at point. 98 ;; Return info list on LABEL at point.
99 (let* ((env-or-mac (or env-or-mac (reftex-label-location bound))) 99 (let* ((prefix (if (string-match "^[a-zA-Z0-9]+:" label)
100 (typekey (nth 1 (assoc env-or-mac reftex-env-or-mac-alist))) 100 (match-string 0 label)))
101 (typekey (cdr (assoc prefix reftex-prefix-to-typekey-alist)))
101 (file (or file (buffer-file-name))) 102 (file (or file (buffer-file-name)))
102 (parse (nth 2 (assoc env-or-mac reftex-env-or-mac-alist))) 103 (trust reftex-trust-label-prefix)
103 (text (reftex-short-context env-or-mac parse reftex-location-start
104 derive))
105 (in-comment (reftex-in-comment))) 104 (in-comment (reftex-in-comment)))
106 (list label typekey text file in-comment))) 105 (if (and typekey
106 (cond ((eq trust t) t)
107 ((null trust) nil)
108 ((stringp trust) (string-match trust typekey))
109 ((listp trust) (member typekey trust))
110 (t nil)))
111 (list label typekey
112 (reftex-nicify-text (reftex-context-substring))
113 file in-comment)
114 (let* ((env-or-mac (or env-or-mac (reftex-label-location bound)))
115 (typekey (nth 1 (assoc env-or-mac reftex-env-or-mac-alist)))
116 (parse (nth 2 (assoc env-or-mac reftex-env-or-mac-alist)))
117 (text (reftex-short-context env-or-mac parse reftex-location-start
118 derive)))
119 (list label typekey text file in-comment)))))
107 120
108;;; Creating labels --------------------------------------------------------- 121;;; Creating labels ---------------------------------------------------------
109 122
@@ -296,35 +309,43 @@ also applies `reftex-translate-to-ascii-function' to the string."
296 (while (string-match "\\%\\([a-zA-Z]\\)" prefix num) 309 (while (string-match "\\%\\([a-zA-Z]\\)" prefix num)
297 (setq letter (match-string 1 prefix)) 310 (setq letter (match-string 1 prefix))
298 (setq replace 311 (setq replace
299 (cond 312 (save-match-data
300 ((equal letter "f") 313 (cond
301 (file-name-sans-extension 314 ((equal letter "f")
302 (file-name-nondirectory (buffer-file-name)))) 315 (file-name-sans-extension
303 ((equal letter "F") 316 (file-name-nondirectory (buffer-file-name))))
304 (let ((masterdir (file-name-directory (reftex-TeX-master-file))) 317 ((equal letter "F")
305 (file (file-name-sans-extension (buffer-file-name)))) 318 (let ((masterdir (file-name-directory (reftex-TeX-master-file)))
306 (if (string-match (concat "\\`" (regexp-quote masterdir)) 319 (file (file-name-sans-extension (buffer-file-name))))
307 file) 320 (if (string-match (concat "\\`" (regexp-quote masterdir))
308 (substring file (length masterdir)) 321 file)
309 file))) 322 (substring file (length masterdir))
310 ((equal letter "u") 323 file)))
311 (or (user-login-name) "")) 324 ((equal letter "m")
312 ((equal letter "S") 325 (file-name-sans-extension
313 (let* (macro level-exp level) 326 (file-name-nondirectory (reftex-TeX-master-file))))
314 (save-excursion 327 ((equal letter "M")
315 (save-match-data 328 (file-name-nondirectory
316 (when (re-search-backward reftex-section-regexp nil t) 329 (substring (file-name-directory (reftex-TeX-master-file))
317 (setq macro (reftex-match-string 2) 330 0 -1)))
318 level-exp (cdr (assoc macro reftex-section-levels-all)) 331 ((equal letter "u")
319 level (if (symbolp level-exp) 332 (or (user-login-name) ""))
320 (abs (save-match-data 333 ((equal letter "S")
321 (funcall level-exp))) 334 (let* (macro level-exp level)
322 (abs level-exp)))) 335 (save-excursion
323 (cdr (or (assoc macro reftex-section-prefixes) 336 (save-match-data
324 (assoc level reftex-section-prefixes) 337 (when (re-search-backward reftex-section-regexp nil t)
325 (assq t reftex-section-prefixes) 338 (setq macro (reftex-match-string 2)
326 (list t "sec:"))))))) 339 level-exp (cdr (assoc macro reftex-section-levels-all))
327 (t ""))) 340 level (if (symbolp level-exp)
341 (abs (save-match-data
342 (funcall level-exp)))
343 (abs level-exp))))
344 (cdr (or (assoc macro reftex-section-prefixes)
345 (assoc level reftex-section-prefixes)
346 (assq t reftex-section-prefixes)
347 (list t "sec:")))))))
348 (t ""))))
328 (setq num (1- (+ (match-beginning 1) (length replace))) 349 (setq num (1- (+ (match-beginning 1) (length replace)))
329 prefix (replace-match replace nil nil prefix))) 350 prefix (replace-match replace nil nil prefix)))
330 prefix))) 351 prefix)))
@@ -449,7 +470,7 @@ When called with 2 C-u prefix args, disable magic word recognition."
449 470
450 ;; remove ~ if we do already have a space 471 ;; remove ~ if we do already have a space
451 (when (and (= ?~ (string-to-char form)) 472 (when (and (= ?~ (string-to-char form))
452 (member (preceding-char) '(?\ ?\t ?\n ?. ?~))) 473 (member (preceding-char) '(?\ ?\t ?\n ?~)))
453 (setq form (substring form 1))) 474 (setq form (substring form 1)))
454 ;; do we have a special format? 475 ;; do we have a special format?
455 (setq reftex-format-ref-function 476 (setq reftex-format-ref-function
diff --git a/lisp/textmodes/reftex-sel.el b/lisp/textmodes/reftex-sel.el
index 3074e83b681..8b0ebb2ca2b 100644
--- a/lisp/textmodes/reftex-sel.el
+++ b/lisp/textmodes/reftex-sel.el
@@ -1,8 +1,8 @@
1;;; reftex-sel.el --- the selection modes for RefTeX 1;;; reftex-sel.el --- the selection modes for RefTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.21 5;; Version: 4.26
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
@@ -607,13 +607,11 @@ Useful for large TOC's."
607 (setq ovl (make-overlay boe eoe)) 607 (setq ovl (make-overlay boe eoe))
608 (push (list data ovl separator) reftex-select-marked) 608 (push (list data ovl separator) reftex-select-marked)
609 (overlay-put ovl 'face reftex-select-mark-face) 609 (overlay-put ovl 'face reftex-select-mark-face)
610 (if (featurep 'xemacs) 610 (overlay-put ovl 'before-string
611 ;; before-string property is broken in Emacs 611 (if separator
612 (overlay-put ovl 'before-string 612 (format "*%c%d* " separator
613 (if separator 613 (length reftex-select-marked))
614 (format "*%c%d* " separator 614 (format "*%d* " (length reftex-select-marked))))
615 (length reftex-select-marked))
616 (format "*%d* " (length reftex-select-marked)))))
617 (message "Entry has mark no. %d" (length reftex-select-marked)))) 615 (message "Entry has mark no. %d" (length reftex-select-marked))))
618 616
619(defun reftex-select-mark-comma () 617(defun reftex-select-mark-comma ()
@@ -725,7 +723,7 @@ Useful for large TOC's."
725 (define-key reftex-select-label-map (car x) (cdr x))) 723 (define-key reftex-select-label-map (car x) (cdr x)))
726 724
727;; Specific bindings in reftex-select-bib-map 725;; Specific bindings in reftex-select-bib-map
728(loop for key across "grRaA" do 726(loop for key across "grRaAeE" do
729 (define-key reftex-select-bib-map (vector (list key)) 727 (define-key reftex-select-bib-map (vector (list key))
730 (list 'lambda '() 728 (list 'lambda '()
731 "Press `?' during selection to find out about this key." 729 "Press `?' during selection to find out about this key."
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index 8d217f08dfb..ed9746f8a69 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -2,7 +2,7 @@
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.21 5;; Version: 4.26
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
@@ -868,6 +868,7 @@ label prefix determines the wording of a reference."
868 ((and (markerp marker) (marker-buffer marker)) 868 ((and (markerp marker) (marker-buffer marker))
869 ;; Buffer is still live and we have the marker. Should be easy. 869 ;; Buffer is still live and we have the marker. Should be easy.
870 (switch-to-buffer-other-window (marker-buffer marker)) 870 (switch-to-buffer-other-window (marker-buffer marker))
871 (push-mark nil)
871 (goto-char (marker-position marker)) 872 (goto-char (marker-position marker))
872 (or (looking-at (regexp-quote literal)) 873 (or (looking-at (regexp-quote literal))
873 (looking-at (reftex-make-regexp-allow-for-ctrl-m literal)) 874 (looking-at (reftex-make-regexp-allow-for-ctrl-m literal))
@@ -1088,4 +1089,4 @@ always show the current section in connection with the option
1088 1089
1089 1090
1090;;; arch-tag: 92400ce2-0b86-4c89-a606-4ed71acea17e 1091;;; arch-tag: 92400ce2-0b86-4c89-a606-4ed71acea17e
1091;;; reftex-toc.el ends here \ No newline at end of file 1092;;; reftex-toc.el ends here
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index 53357342c51..a7c0cb1c1ad 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -1,8 +1,8 @@
1;;; reftex-vars.el --- configuration variables for RefTeX 1;;; reftex-vars.el --- configuration variables for RefTeX
2;; Copyright (c) 1997, 1998, 1999, 2003 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2003, 2004 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.21 5;; Version: 4.26
6 6
7;; This file is part of GNU Emacs. 7;; This file is part of GNU Emacs.
8 8
@@ -128,13 +128,13 @@ distribution. Mixed-case symbols are convenience aliases.")
128 128
129(defconst reftex-cite-format-builtin 129(defconst reftex-cite-format-builtin
130 '((default "Default macro \\cite{%l}" 130 '((default "Default macro \\cite{%l}"
131 "\\cite{%l}") 131 "\\cite[]{%l}")
132 (natbib "The Natbib package" 132 (natbib "The Natbib package"
133 ((?\C-m . "\\cite{%l}") 133 ((?\C-m . "\\cite[][]{%l}")
134 (?t . "\\citet{%l}") 134 (?t . "\\citet[][]{%l}")
135 (?T . "\\citet*{%l}") 135 (?T . "\\citet*[][]{%l}")
136 (?p . "\\citep{%l}") 136 (?p . "\\citep[][]{%l}")
137 (?P . "\\citep*{%l}") 137 (?P . "\\citep*[][]{%l}")
138 (?e . "\\citep[e.g.][]{%l}") 138 (?e . "\\citep[e.g.][]{%l}")
139 (?s . "\\citep[see][]{%l}") 139 (?s . "\\citep[see][]{%l}")
140 (?a . "\\citeauthor{%l}") 140 (?a . "\\citeauthor{%l}")
@@ -157,8 +157,8 @@ distribution. Mixed-case symbols are convenience aliases.")
157 (bibentry "The Bibentry package" 157 (bibentry "The Bibentry package"
158 "\\bibentry{%l}") 158 "\\bibentry{%l}")
159 (harvard "The Harvard package" 159 (harvard "The Harvard package"
160 ((?\C-m . "\\cite{%l}") 160 ((?\C-m . "\\cite[]{%l}")
161 (?p . "\\cite{%l}") 161 (?p . "\\cite[]{%l}")
162 (?t . "\\citeasnoun{%l}") 162 (?t . "\\citeasnoun{%l}")
163 (?n . "\\citeasnoun{%l}") 163 (?n . "\\citeasnoun{%l}")
164 (?s . "\\possessivecite{%l}") 164 (?s . "\\possessivecite{%l}")
@@ -166,17 +166,17 @@ distribution. Mixed-case symbols are convenience aliases.")
166 (?y . "\\citeyear{%l}") 166 (?y . "\\citeyear{%l}")
167 (?a . "\\citename{%l}"))) 167 (?a . "\\citename{%l}")))
168 (chicago "The Chicago package" 168 (chicago "The Chicago package"
169 ((?\C-m . "\\cite{%l}") 169 ((?\C-m . "\\cite[]{%l}")
170 (?t . "\\citeN{%l}") 170 (?t . "\\citeN[]{%l}")
171 (?T . "\\shortciteN{%l}") 171 (?T . "\\shortciteN{%l}")
172 (?p . "\\cite{%l}") 172 (?p . "\\cite[]{%l}")
173 (?P . "\\shortcite{%l}") 173 (?P . "\\shortcite{%l}")
174 (?a . "\\citeA{%l}") 174 (?a . "\\citeA{%l}")
175 (?A . "\\shortciteA{%l}") 175 (?A . "\\shortciteA{%l}")
176 (?y . "\\citeyear{%l}"))) 176 (?y . "\\citeyear{%l}")))
177 (astron "The Astron package" 177 (astron "The Astron package"
178 ((?\C-m . "\\cite{%l}") 178 ((?\C-m . "\\cite[]{%l}")
179 (?p . "\\cite{%l}" ) 179 (?p . "\\cite[]{%l}" )
180 (?t . "%2a (\\cite{%l})"))) 180 (?t . "%2a (\\cite{%l})")))
181 (author-year "Do-it-yourself Author-year" 181 (author-year "Do-it-yourself Author-year"
182 ((?\C-m . "\\cite{%l}") 182 ((?\C-m . "\\cite{%l}")
@@ -484,6 +484,8 @@ LABEL-PREFIX
484 empty string. The prefix may contain the following `%' escapes: 484 empty string. The prefix may contain the following `%' escapes:
485 %f Current file name with directory and extension stripped. 485 %f Current file name with directory and extension stripped.
486 %F Current file name relative to directory of master file. 486 %F Current file name relative to directory of master file.
487 %m Master file name, directory and extension stripped.
488 %M Directory name (without path) where master file is located.
487 %u User login name, on systems which support this. 489 %u User login name, on systems which support this.
488 %S A section prefix derived with variable `reftex-section-prefixes'. 490 %S A section prefix derived with variable `reftex-section-prefixes'.
489 491
@@ -631,6 +633,43 @@ the final regular expression - so %s will be replaced with the environment
631or macro." 633or macro."
632 :group 'reftex-defining-label-environments 634 :group 'reftex-defining-label-environments
633 :type '(repeat (cons (symbol) (regexp)))) 635 :type '(repeat (cons (symbol) (regexp))))
636
637(defcustom reftex-trust-label-prefix nil
638 "Non-nil means, trust the label prefix when determining label type.
639It is customary to use special label prefixes to distinguish different label
640types. The label prefixes have no syntactic meaning in LaTeX (unless
641special packages like fancyref) are being used. RefTeX can and by
642default does parse around each label to detect the correct label type,
643but this process can be slow when a document contains thousands of
644labels. If you use label prefixes consistently, you may speed up
645document parsing by setting this variable to a non-nil value. RefTeX
646will then compare the label prefix with the prefixes found in
647`reftex-label-alist' and derive the correct label type in this way.
648Possible values for this option are:
649
650t This means to trust any label prefixes found.
651regexp If a regexp, only prefixes matched by the regexp are trusted.
652list List of accepted prefixes, as strings. The colon is part of
653 the prefix, e.g. (\"fn:\" \"eqn:\" \"item:\").
654nil Never trust a label prefix.
655
656The only disadvantage of using this feature is that the label context
657displayed in the label selection buffer along with each label is
658simply some text after the label definition. This is no problem if you
659place labels keeping this in mind (e.g. *before* the equation, *at
660the beginning* of a fig/tab caption ...). Anyway, it is probably best
661to use the regexp or the list value types to fine-tune this feature.
662For example, if your document contains thousands of footnotes with
663labels fn:xxx, you may want to set this variable to the value \"^fn:$\" or
664\(\"fn:\"). Then RefTeX will still do extensive parsing for any
665non-footnote labels."
666 :group 'reftex-defining-label-environments
667 :type '(choice
668 (const :tag "Always" t)
669 (const :tag "Never" nil)
670 (regexp)
671 (repeat :tag "List"
672 (string :tag "prefix (with colon)"))))
634 673
635(defcustom reftex-special-environment-functions nil 674(defcustom reftex-special-environment-functions nil
636 "List of functions to be called when trying to figure out current environment. 675 "List of functions to be called when trying to figure out current environment.
@@ -1010,6 +1049,9 @@ display, and for (setq reftex-comment-citations t).
1010%< as a special operator kills punctuation and space around it after the 1049%< as a special operator kills punctuation and space around it after the
1011string has been formatted. 1050string has been formatted.
1012 1051
1052A pair of square brackets indicates an optional argument, and RefTeX
1053will prompt for the values of these arguments.
1054
1013Beware that all this only works with BibTeX database files. When 1055Beware that all this only works with BibTeX database files. When
1014citations are made from the \\bibitems in an explicit thebibliography 1056citations are made from the \\bibitems in an explicit thebibliography
1015environment, only %l is available. 1057environment, only %l is available.
@@ -1042,6 +1084,42 @@ E.g.: (setq reftex-cite-format 'natbib)"
1042 (cons (character :tag "Key character" ?\r) 1084 (cons (character :tag "Key character" ?\r)
1043 (string :tag "Format string" ""))))) 1085 (string :tag "Format string" "")))))
1044 1086
1087(defcustom reftex-cite-prompt-optional-args 'maybe
1088 "*Non-nil means, prompt for empty optional arguments in cite macros.
1089When an entry in `reftex-cite-format' ist given with square brackets to
1090indicate optional arguments (for example \\cite[][]{%l}), RefTeX can
1091prompt for values. Possible values are:
1092
1093nil Never prompt for optional arguments
1094t Always prompt
1095maybe Prompt only if `reftex-citation' was called with C-u prefix arg
1096
1097Unnecessary empty optional arguments are removed before insertion into
1098the buffer. See `reftex-cite-cleanup-optional-args'."
1099 :group 'reftex-citation-support
1100 :type '(choice
1101 (const :tag "Always" t)
1102 (const :tag "When called with prefix arg" maybe)
1103 (const :tag "Never" nil)))
1104
1105(defcustom reftex-cite-cleanup-optional-args t
1106 "*Non-nil means, remove unnecessary empty optional arguments in cite macros.
1107The cite macros provided by some packages (for example
1108natbib) allow specifying two optional arguments, one for a prefix to
1109the citation, and a second for a postfix. When only one optional
1110argument is given, it is interpreted as postfix. When this option is
1111t, RefTeX removes unnecessary empty optional arguments from the cite
1112macro before insertion. For example, it will change
1113 \\cite[][]{Jones} -> \\cite{Jones}
1114 \\cite[][Chapter 1]{Jones} -> \\cite[Chapter 1]{Jones}
1115 \\cite[see][]{Jones} -> \\cite[see][]{Jones}
1116 \\cite[see][Chapter 1]{Jones} -> \\cite{Jones}
1117Is is possible that other packages have other conventions about which
1118optional argument is interpreted how - that is why this cleaning up
1119can be turned off."
1120 :group 'reftex-citation-support
1121 :type 'boolean)
1122
1045(defcustom reftex-comment-citations nil 1123(defcustom reftex-comment-citations nil
1046 "*Non-nil means add a comment for each citation describing the full entry. 1124 "*Non-nil means add a comment for each citation describing the full entry.
1047The comment is formatted according to `reftex-cite-comment-format'." 1125The comment is formatted according to `reftex-cite-comment-format'."
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index c00400a7b96..e177805e9c4 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -1,8 +1,8 @@
1;;; reftex.el --- minor mode for doing \label, \ref, \cite, \index in LaTeX 1;;; reftex.el --- minor mode for doing \label, \ref, \cite, \index in LaTeX
2;; Copyright (c) 1997, 1998, 1999, 2000, 2003 Free Software Foundation, Inc. 2;; Copyright (c) 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
3 3
4;; Author: Carsten Dominik <dominik@science.uva.nl> 4;; Author: Carsten Dominik <dominik@science.uva.nl>
5;; Version: 4.21 5;; Version: 4.26
6;; Keywords: tex 6;; Keywords: tex
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
@@ -300,7 +300,7 @@
300;;; Define the formal stuff for a minor mode named RefTeX. 300;;; Define the formal stuff for a minor mode named RefTeX.
301;;; 301;;;
302 302
303(defconst reftex-version "RefTeX version 4.21" 303(defconst reftex-version "RefTeX version 4.26"
304 "Version string for RefTeX.") 304 "Version string for RefTeX.")
305 305
306(defvar reftex-mode nil 306(defvar reftex-mode nil
@@ -669,6 +669,8 @@ the label information is recompiled on next use."
669 669
670;; Alist relating magic words to a label type. 670;; Alist relating magic words to a label type.
671(defvar reftex-words-to-typekey-alist nil) 671(defvar reftex-words-to-typekey-alist nil)
672;; Alist relating label prefixes to a label type.
673(defvar reftex-prefix-to-typekey-alist nil)
672 674
673;; The last list-of-labels entry used in a reference. 675;; The last list-of-labels entry used in a reference.
674(defvar reftex-last-used-reference (list nil nil nil nil)) 676(defvar reftex-last-used-reference (list nil nil nil nil))
@@ -750,6 +752,7 @@ the label information is recompiled on next use."
750 reftex-typekey-to-format-alist 752 reftex-typekey-to-format-alist
751 reftex-typekey-to-prefix-alist 753 reftex-typekey-to-prefix-alist
752 reftex-words-to-typekey-alist 754 reftex-words-to-typekey-alist
755 reftex-prefix-to-typekey-alist
753 reftex-type-query-prompt 756 reftex-type-query-prompt
754 reftex-type-query-help 757 reftex-type-query-help
755 758
@@ -904,6 +907,8 @@ This enforces rescanning the buffer on next use."
904 macro verify repeat nindex tag key toc-level toc-levels) 907 macro verify repeat nindex tag key toc-level toc-levels)
905 908
906 (setq reftex-words-to-typekey-alist nil 909 (setq reftex-words-to-typekey-alist nil
910 reftex-prefix-to-typekey-alist
911 '(("sec:" . "s") ("cha:" . "s") ("chap:" . "s"))
907 reftex-typekey-list nil 912 reftex-typekey-list nil
908 reftex-typekey-to-format-alist nil 913 reftex-typekey-to-format-alist nil
909 reftex-typekey-to-prefix-alist nil 914 reftex-typekey-to-prefix-alist nil
@@ -946,6 +951,10 @@ This enforces rescanning the buffer on next use."
946 (if typekey 951 (if typekey
947 (add-to-list 'reftex-typekey-list typekey)) 952 (add-to-list 'reftex-typekey-list typekey))
948 (if (and typekey prefix 953 (if (and typekey prefix
954 (not (assoc prefix reftex-prefix-to-typekey-alist)))
955 (add-to-list 'reftex-prefix-to-typekey-alist
956 (cons prefix typekey)))
957 (if (and typekey prefix
949 (not (assoc typekey reftex-typekey-to-prefix-alist))) 958 (not (assoc typekey reftex-typekey-to-prefix-alist)))
950 (add-to-list 'reftex-typekey-to-prefix-alist 959 (add-to-list 'reftex-typekey-to-prefix-alist
951 (cons typekey prefix))) 960 (cons typekey prefix)))
@@ -1676,6 +1685,7 @@ When DIE is non-nil, throw an error if file not found."
1676 "Make a citation using BibTeX database files." t) 1685 "Make a citation using BibTeX database files." t)
1677(autoload 'reftex-default-bibliography "reftex-cite") 1686(autoload 'reftex-default-bibliography "reftex-cite")
1678(autoload 'reftex-bib-or-thebib "reftex-cite") 1687(autoload 'reftex-bib-or-thebib "reftex-cite")
1688(autoload 'reftex-create-bibtex-file "reftex-cite")
1679 1689
1680;;; ========================================================================= 1690;;; =========================================================================
1681;;; 1691;;;
@@ -2439,6 +2449,7 @@ IGNORE-WORDS List of words which should be removed from the string."
2439 ["Restore from File" (reftex-access-parse-file 'restore) t]) 2449 ["Restore from File" (reftex-access-parse-file 'restore) t])
2440 ("Global Actions" 2450 ("Global Actions"
2441 ["Search Whole Document" reftex-search-document t] 2451 ["Search Whole Document" reftex-search-document t]
2452 ["Search Again" tags-loop-continue t]
2442 ["Replace in Document" reftex-query-replace-document t] 2453 ["Replace in Document" reftex-query-replace-document t]
2443 ["Grep on Document" reftex-grep-document t] 2454 ["Grep on Document" reftex-grep-document t]
2444 "--" 2455 "--"
@@ -2447,6 +2458,8 @@ IGNORE-WORDS List of words which should be removed from the string."
2447 ["Change Label and Refs" reftex-change-label t] 2458 ["Change Label and Refs" reftex-change-label t]
2448 ["Renumber Simple Labels" reftex-renumber-simple-labels t] 2459 ["Renumber Simple Labels" reftex-renumber-simple-labels t]
2449 "--" 2460 "--"
2461 ["Create BibTeX File" reftex-create-bibtex-file t]
2462 "--"
2450 ["Create TAGS File" reftex-create-tags-file t] 2463 ["Create TAGS File" reftex-create-tags-file t]
2451 "--" 2464 "--"
2452 ["Save Document" reftex-save-all-document-buffers t]) 2465 ["Save Document" reftex-save-all-document-buffers t])
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index 6da9cc23aaa..b1a1b70397a 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -1,6 +1,6 @@
1;;; sgml-mode.el --- SGML- and HTML-editing modes 1;;; sgml-mode.el --- SGML- and HTML-editing modes
2 2
3;; Copyright (C) 1992, 1995, 1996, 1998, 2001, 2002, 2003, 2004 3;; Copyright (C) 1992, 1995, 1996, 1998, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: James Clark <jjc@jclark.com> 6;; Author: James Clark <jjc@jclark.com>
@@ -392,6 +392,14 @@ Otherwise, it is set to be buffer-local when the file has
392 (concat "<" face ">")) 392 (concat "<" face ">"))
393 (error "Face not configured for %s mode" mode-name))) 393 (error "Face not configured for %s mode" mode-name)))
394 394
395(defun sgml-fill-nobreak ()
396 ;; Don't break between a tag name and its first argument.
397 (save-excursion
398 (skip-chars-backward " \t")
399 (and (not (zerop (skip-syntax-backward "w_")))
400 (skip-chars-backward "/?!")
401 (eq (char-before) ?<))))
402
395;;;###autoload 403;;;###autoload
396(define-derived-mode sgml-mode text-mode "SGML" 404(define-derived-mode sgml-mode text-mode "SGML"
397 "Major mode for editing SGML documents. 405 "Major mode for editing SGML documents.
@@ -422,6 +430,7 @@ Do \\[describe-key] on the following bindings to discover what they do.
422 (set (make-local-variable 'paragraph-separate) 430 (set (make-local-variable 'paragraph-separate)
423 (concat paragraph-start "$")) 431 (concat paragraph-start "$"))
424 (set (make-local-variable 'adaptive-fill-regexp) "[ \t]*") 432 (set (make-local-variable 'adaptive-fill-regexp) "[ \t]*")
433 (add-hook 'fill-nobreak-predicate 'sgml-fill-nobreak nil t)
425 (set (make-local-variable 'indent-line-function) 'sgml-indent-line) 434 (set (make-local-variable 'indent-line-function) 'sgml-indent-line)
426 (set (make-local-variable 'comment-start) "<!-- ") 435 (set (make-local-variable 'comment-start) "<!-- ")
427 (set (make-local-variable 'comment-end) " -->") 436 (set (make-local-variable 'comment-end) " -->")
@@ -1138,17 +1147,19 @@ immediately enclosing the current position.
1138Point is assumed to be outside of any tag. If we discover that it's 1147Point is assumed to be outside of any tag. If we discover that it's
1139not the case, the first tag returned is the one inside which we are." 1148not the case, the first tag returned is the one inside which we are."
1140 (let ((here (point)) 1149 (let ((here (point))
1150 (stack nil)
1141 (ignore nil) 1151 (ignore nil)
1142 (context nil) 1152 (context nil)
1143 tag-info) 1153 tag-info)
1144 ;; CONTEXT keeps track of the tag-stack 1154 ;; CONTEXT keeps track of the tag-stack
1145 ;; IGNORE keeps track of the nesting level of point relative to the 1155 ;; STACK keeps track of the end tags we've seen (and thus the start-tags
1146 ;; first (outermost) tag on the context. This is the list of 1156 ;; we'll have to ignore) when skipping over matching open..close pairs.
1147 ;; enclosing start-tags we'll have to ignore. 1157 ;; IGNORE is a list of tags that can be ignored because they have been
1158 ;; closed implicitly.
1148 (skip-chars-backward " \t\n") ; Make sure we're not at indentation. 1159 (skip-chars-backward " \t\n") ; Make sure we're not at indentation.
1149 (while 1160 (while
1150 (and (not (eq until 'now)) 1161 (and (not (eq until 'now))
1151 (or ignore 1162 (or stack
1152 (not (if until (eq until 'empty) context)) 1163 (not (if until (eq until 'empty) context))
1153 (not (sgml-at-indentation-p)) 1164 (not (sgml-at-indentation-p))
1154 (and context 1165 (and context
@@ -1172,24 +1183,25 @@ not the case, the first tag returned is the one inside which we are."
1172 ;; start-tag 1183 ;; start-tag
1173 ((eq (sgml-tag-type tag-info) 'open) 1184 ((eq (sgml-tag-type tag-info) 'open)
1174 (cond 1185 (cond
1175 ((null ignore) 1186 ((null stack)
1176 (if (and context 1187 (if (member-ignore-case (sgml-tag-name tag-info) ignore)
1177 (sgml-unclosed-tag-p (sgml-tag-name tag-info))
1178 (eq t (compare-strings
1179 (sgml-tag-name tag-info) nil nil
1180 (sgml-tag-name (car context)) nil nil t)))
1181 ;; There was an implicit end-tag. 1188 ;; There was an implicit end-tag.
1182 nil 1189 nil
1183 (push tag-info context))) 1190 (push tag-info context)
1191 ;; We're changing context so the tags implicitly closed inside
1192 ;; the previous context aren't implicitly closed here any more.
1193 ;; [ Well, actually it depends, but we don't have the info about
1194 ;; when it doesn't and when it does. --Stef ]
1195 (setq ignore nil)))
1184 ((eq t (compare-strings (sgml-tag-name tag-info) nil nil 1196 ((eq t (compare-strings (sgml-tag-name tag-info) nil nil
1185 (car ignore) nil nil t)) 1197 (car stack) nil nil t))
1186 (setq ignore (cdr ignore))) 1198 (setq stack (cdr stack)))
1187 (t 1199 (t
1188 ;; The open and close tags don't match. 1200 ;; The open and close tags don't match.
1189 (if (not sgml-xml-mode) 1201 (if (not sgml-xml-mode)
1190 (unless (sgml-unclosed-tag-p (sgml-tag-name tag-info)) 1202 (unless (sgml-unclosed-tag-p (sgml-tag-name tag-info))
1191 (message "Unclosed tag <%s>" (sgml-tag-name tag-info)) 1203 (message "Unclosed tag <%s>" (sgml-tag-name tag-info))
1192 (let ((tmp ignore)) 1204 (let ((tmp stack))
1193 ;; We could just assume that the tag is simply not closed 1205 ;; We could just assume that the tag is simply not closed
1194 ;; but it's a bad assumption when tags *are* closed but 1206 ;; but it's a bad assumption when tags *are* closed but
1195 ;; not properly nested. 1207 ;; not properly nested.
@@ -1200,13 +1212,19 @@ not the case, the first tag returned is the one inside which we are."
1200 (setq tmp (cdr tmp))) 1212 (setq tmp (cdr tmp)))
1201 (if (cdr tmp) (setcdr tmp (cddr tmp))))) 1213 (if (cdr tmp) (setcdr tmp (cddr tmp)))))
1202 (message "Unmatched tags <%s> and </%s>" 1214 (message "Unmatched tags <%s> and </%s>"
1203 (sgml-tag-name tag-info) (pop ignore)))))) 1215 (sgml-tag-name tag-info) (pop stack)))))
1216
1217 (if (and (null stack) (sgml-unclosed-tag-p (sgml-tag-name tag-info)))
1218 ;; This is a top-level open of an implicitly closed tag, so any
1219 ;; occurrence of such an open tag at the same level can be ignored
1220 ;; because it's been implicitly closed.
1221 (push (sgml-tag-name tag-info) ignore)))
1204 1222
1205 ;; end-tag 1223 ;; end-tag
1206 ((eq (sgml-tag-type tag-info) 'close) 1224 ((eq (sgml-tag-type tag-info) 'close)
1207 (if (sgml-empty-tag-p (sgml-tag-name tag-info)) 1225 (if (sgml-empty-tag-p (sgml-tag-name tag-info))
1208 (message "Spurious </%s>: empty tag" (sgml-tag-name tag-info)) 1226 (message "Spurious </%s>: empty tag" (sgml-tag-name tag-info))
1209 (push (sgml-tag-name tag-info) ignore))) 1227 (push (sgml-tag-name tag-info) stack)))
1210 )) 1228 ))
1211 1229
1212 ;; return context 1230 ;; return context
diff --git a/lisp/toolbar/README b/lisp/toolbar/README
index f7c8cb033b4..4bf1700dd91 100644
--- a/lisp/toolbar/README
+++ b/lisp/toolbar/README
@@ -5,4 +5,6 @@ The following icons are from GTK+ 2.x:
5 paste.xpm preferences.xpm print.xpm right_arrow.xpm save.xpm 5 paste.xpm preferences.xpm print.xpm right_arrow.xpm save.xpm
6 saveas.xpm search.xpm spell.xpm undo.xpm up_arrow.xpm 6 saveas.xpm search.xpm spell.xpm undo.xpm up_arrow.xpm
7 7
8 back_arrow.xpm and fwd_arrow.xpm are slightly modified undo and redo.
9
8They are not part of Emacs, but distributed and used by Emacs. 10They are not part of Emacs, but distributed and used by Emacs.
diff --git a/lisp/toolbar/back_arrow.pbm b/lisp/toolbar/back_arrow.pbm
new file mode 100644
index 00000000000..7f9b8975d2f
--- /dev/null
+++ b/lisp/toolbar/back_arrow.pbm
Binary files differ
diff --git a/lisp/toolbar/back_arrow.xpm b/lisp/toolbar/back_arrow.xpm
new file mode 100644
index 00000000000..b9b13613d81
--- /dev/null
+++ b/lisp/toolbar/back_arrow.xpm
@@ -0,0 +1,57 @@
1/* XPM */
2static char *back_arrow_xpm[] = {
3"24 24 30 1",
4" c #000000",
5". c #53692A",
6"X c #59702D",
7"o c #657255",
8"O c #6D7A5B",
9"+ c #6D8839",
10"@ c #7C9B40",
11"# c #748261",
12"$ c #7F8E6B",
13"% c #818F71",
14"& c #879772",
15"* c #8C9A7F",
16"= c #85A24D",
17"- c #8BA859",
18"; c #92AD62",
19": c #95A77E",
20"> c #98AF74",
21", c #9BB572",
22"< c #9BAA87",
23"1 c #9CAF84",
24"2 c #A4B690",
25"3 c #A8BCA6",
26"4 c #ADBDA0",
27"5 c #AFC394",
28"6 c #BAD09D",
29"7 c #B5C3A9",
30"8 c #BED2A3",
31"9 c #D5E1C6",
32"0 c #FFFFFF",
33"q c None",
34"qqqqqqqqqqqqqqqqqqqqqqqq",
35"qqqqqqqqqqqqqqqqqqqqqqqq",
36"qqqqqqqqqqqqqqqqqqqqqqqq",
37"qqqqqqqqqq qqqqqqqqqqqqq",
38"qqqqqqqqq qqqqqqqqqqqqq",
39"qqqqqqqq 9 qqqqqqqqqqqqq",
40"qqqqqqq 96 qqqqqqqqqq",
41"qqqqqq 968664% qqqqqqqqq",
42"qqqqq 966666663 qqqqqqqq",
43"qqqq <666666666* qqqqqqq",
44"qqqqq X@@@@@@;67 qqqqqq",
45"qqqqqq .@@@@@@=6$ qqqqqq",
46"qqqqqqq .@ X@,2 qqqqqq",
47"qqqqqqqq X q +-6 qqqqqq",
48"qqqqqqqqq qq @6 qqqqqq",
49"qqqqqqqqqq qqq -: qqqqqq",
50"qqqqqqqqqqqqqq >o qqqqqq",
51"qqqqqqqqqqqqqq 5 qqqqqqq",
52"qqqqqqqqqqqqq 1O qqqqqqq",
53"qqqqqqqqqqqq &# qqqqqqqq",
54"qqqqqqqqqqqqq qqqqqqqqq",
55"qqqqqqqqqqqqqqqqqqqqqqqq",
56"qqqqqqqqqqqqqqqqqqqqqqqq",
57"qqqqqqqqqqqqqqqqqqqqqqqq"};
diff --git a/lisp/toolbar/fwd_arrow.pbm b/lisp/toolbar/fwd_arrow.pbm
new file mode 100644
index 00000000000..e08e6fa35db
--- /dev/null
+++ b/lisp/toolbar/fwd_arrow.pbm
Binary files differ
diff --git a/lisp/toolbar/fwd_arrow.xpm b/lisp/toolbar/fwd_arrow.xpm
new file mode 100644
index 00000000000..5e7c5602ea1
--- /dev/null
+++ b/lisp/toolbar/fwd_arrow.xpm
@@ -0,0 +1,70 @@
1/* XPM */
2static char *fwd_arrow_xpm[] = {
3"24 24 43 1",
4" c #000000",
5". c #53692A",
6"X c #59702D",
7"o c #657255",
8"O c #6D7A5B",
9"+ c #6D8839",
10"@ c #7C9B40",
11"# c #748261",
12"$ c #7F8E6B",
13"% c #818F71",
14"& c #879772",
15"* c #8C9A7F",
16"= c #85A24D",
17"- c #8BA859",
18"; c #92AD62",
19": c #95A77E",
20"> c #98AF74",
21", c #9BB572",
22"< c #919889",
23"1 c #92998C",
24"2 c #939A8D",
25"3 c #99A28F",
26"4 c #9BAA87",
27"5 c #9CAF84",
28"6 c #A4B690",
29"7 c #A8BCA6",
30"8 c #ADBDA0",
31"9 c #AFC394",
32"0 c #BAD09D",
33"q c #B5C3A9",
34"w c #BED2A3",
35"e c #BFD3A6",
36"r c #C2D5AA",
37"t c #C5D7AE",
38"y c #C8D9B2",
39"u c #CDDCBC",
40"i c #D1DFBE",
41"p c #D2E0BF",
42"a c #D3E0C1",
43"s c #D4E0C5",
44"d c #D5E1C6",
45"f c #FFFFFF",
46"g c None",
47"gggggggggggggggggggggggg",
48"gggggggggggggggggggggggg",
49"gggggggggggggggggggggggg",
50"ggggggggggggg gggggggggg",
51"ggggggggggggg ggggggggg",
52"ggggggggggggg 2 gggggggg",
53"gggggggggg 02 ggggggg",
54"ggggggggg &6riw03 gggggg",
55"gggggggg 7suat000< ggggg",
56"ggggggg *saie000004 gggg",
57"gggggg qs;@@@@@@X ggggg",
58"gggggg $y=@@@@@@. gggggg",
59"gggggg 6,@X @. ggggggg",
60"gggggg 0@+ g X gggggggg",
61"gggggg 0@ gg ggggggggg",
62"gggggg :- ggg gggggggggg",
63"gggggg o> gggggggggggggg",
64"ggggggg 9 gggggggggggggg",
65"ggggggg O5 ggggggggggggg",
66"gggggggg #& gggggggggggg",
67"ggggggggg ggggggggggggg",
68"gggggggggggggggggggggggg",
69"gggggggggggggggggggggggg",
70"gggggggggggggggggggggggg"};
diff --git a/lisp/toolbar/lc-back_arrow.xpm b/lisp/toolbar/lc-back_arrow.xpm
new file mode 100644
index 00000000000..05a797c7a65
--- /dev/null
+++ b/lisp/toolbar/lc-back_arrow.xpm
@@ -0,0 +1,33 @@
1/* XPM */
2static char *back_arrow_xpm[] = {
3"24 24 6 1",
4" c #000000",
5". c #000100",
6"X c #6B6B66",
7"o c #87AF85",
8"O c #FFFFFF",
9"+ c None",
10"++++++++++++++++++++++++",
11"++++++++++++++++++++++++",
12"++++++++++++++++++++++++",
13"++++++++++ +++++++++++++",
14"+++++++++ .+++++++++++++",
15"++++++++ O.+++++++++++++",
16"+++++++ Oo . ++++++++++",
17"++++++ Ooooooo +++++++++",
18"+++++ Ooooooooo ++++++++",
19"++++ ooooooooooo.+++++++",
20"+++++ oooooooooo..++++++",
21"++++++.oooooooooo.++++++",
22"+++++++.oo.. oooo.++++++",
23"++++++++.o.+ ooo.++++++",
24"+++++++++..++..oo.++++++",
25"++++++++++.+++.oo.++++++",
26"++++++++++++++.oo.++++++",
27"++++++++++++++.o.+++++++",
28"+++++++++++++.oX.+++++++",
29"++++++++++++.oo.++++++++",
30"+++++++++++++..+++++++++",
31"++++++++++++++++++++++++",
32"++++++++++++++++++++++++",
33"++++++++++++++++++++++++"};
diff --git a/lisp/toolbar/lc-fwd_arrow.xpm b/lisp/toolbar/lc-fwd_arrow.xpm
new file mode 100644
index 00000000000..284b8c9bee7
--- /dev/null
+++ b/lisp/toolbar/lc-fwd_arrow.xpm
@@ -0,0 +1,32 @@
1/* XPM */
2static char *fwd_arrow_xpm[] = {
3"24 24 5 1",
4" c #000000",
5". c #000100",
6"X c #87AF85",
7"o c #FFFFFF",
8"O c None",
9"OOOOOOOOOOOOOOOOOOOOOOOO",
10"OOOOOOOOOOOOOOOOOOOOOOOO",
11"OOOOOOOOOOOOOOOOOOOOOOOO",
12"OOOOOOOOOOOOO OOOOOOOOOO",
13"OOOOOOOOOOOOO OOOOOOOOO",
14"OOOOOOOOOOOOO X OOOOOOOO",
15"OOOOOOOOOO . XX.OOOOOOO",
16"OOOOOOOOO oXXXXXX.OOOOOO",
17"OOOOOOOO.oXXXXXXXX.OOOOO",
18"OOOOOOO.oXXXXXXXXXX.OOOO",
19"OOOOOO..XXXXXXXXXX.OOOOO",
20"OOOOOO.XXXXXXXXXX.OOOOOO",
21"OOOOOO.XXXX. XX.OOOOOOO",
22"OOOOOO.XXX..O X OOOOOOOO",
23"OOOOOO.XX..OO. OOOOOOOOO",
24"OOOOOO.XX.OOO.OOOOOOOOOO",
25"OOOOOO.XX.OOOOOOOOOOOOOO",
26"OOOOOOO.X.OOOOOOOOOOOOOO",
27"OOOOOOO.XX.OOOOOOOOOOOOO",
28"OOOOOOOO.XX.OOOOOOOOOOOO",
29"OOOOOOOOO..OOOOOOOOOOOOO",
30"OOOOOOOOOOOOOOOOOOOOOOOO",
31"OOOOOOOOOOOOOOOOOOOOOOOO",
32"OOOOOOOOOOOOOOOOOOOOOOOO"};
diff --git a/lisp/type-break.el b/lisp/type-break.el
index b51a74ea37e..3a0b8b5adcc 100644
--- a/lisp/type-break.el
+++ b/lisp/type-break.el
@@ -229,7 +229,8 @@ key is pressed."
229 :group 'type-break) 229 :group 'type-break)
230 230
231(defcustom type-break-file-name (convert-standard-filename "~/.type-break") 231(defcustom type-break-file-name (convert-standard-filename "~/.type-break")
232 "*Name of file used to save state across sessions." 232 "*Name of file used to save state across sessions.
233If this is nil, no data will be saved across sessions."
233 :type 'file 234 :type 'file
234 :group 'type-break) 235 :group 'type-break)
235 236
@@ -389,6 +390,9 @@ problems."
389 (and (interactive-p) 390 (and (interactive-p)
390 (message "Type Break mode is already enabled"))) 391 (message "Type Break mode is already enabled")))
391 (type-break-mode 392 (type-break-mode
393 (with-current-buffer (find-file-noselect type-break-file-name 'nowarn)
394 (setq buffer-save-without-query t))
395
392 (or global-mode-string 396 (or global-mode-string
393 (setq global-mode-string '(""))) 397 (setq global-mode-string '("")))
394 (or (assq 'type-break-mode-line-message-mode 398 (or (assq 'type-break-mode-line-message-mode
@@ -399,7 +403,9 @@ problems."
399 (type-break-keystroke-reset) 403 (type-break-keystroke-reset)
400 (type-break-mode-line-countdown-or-break nil) 404 (type-break-mode-line-countdown-or-break nil)
401 405
402 (setq type-break-time-last-break (type-break-get-previous-time)) 406 (setq type-break-time-last-break
407 (or (type-break-get-previous-time)
408 (current-time)))
403 409
404 ;; schedule according to break time from session file 410 ;; schedule according to break time from session file
405 (type-break-schedule 411 (type-break-schedule
@@ -431,12 +437,12 @@ problems."
431 (type-break-mode-line-countdown-or-break nil) 437 (type-break-mode-line-countdown-or-break nil)
432 (type-break-cancel-schedule) 438 (type-break-cancel-schedule)
433 (do-auto-save) 439 (do-auto-save)
434 (with-current-buffer (find-file-noselect type-break-file-name 440 (when type-break-file-name
435 'nowarn) 441 (with-current-buffer (find-file-noselect type-break-file-name
436 (setq buffer-save-without-query t) 442 'nowarn)
437 (set-buffer-modified-p nil) 443 (set-buffer-modified-p nil)
438 (unlock-buffer) 444 (unlock-buffer)
439 (kill-this-buffer)) 445 (kill-this-buffer)))
440 (and (interactive-p) 446 (and (interactive-p)
441 (message "Type Break mode is disabled"))))) 447 (message "Type Break mode is disabled")))))
442 type-break-mode) 448 type-break-mode)
@@ -496,7 +502,8 @@ variable of the same name."
496 502
497(defun type-break-file-time (&optional time) 503(defun type-break-file-time (&optional time)
498 "File break time in `type-break-file-name', unless the file is locked." 504 "File break time in `type-break-file-name', unless the file is locked."
499 (if (not (stringp (file-locked-p type-break-file-name))) 505 (if (and type-break-file-name
506 (not (stringp (file-locked-p type-break-file-name))))
500 (with-current-buffer (find-file-noselect type-break-file-name 507 (with-current-buffer (find-file-noselect type-break-file-name
501 'nowarn) 508 'nowarn)
502 (let ((inhibit-read-only t)) 509 (let ((inhibit-read-only t))
@@ -507,7 +514,8 @@ variable of the same name."
507 514
508(defun type-break-file-keystroke-count () 515(defun type-break-file-keystroke-count ()
509 "File keystroke count in `type-break-file-name', unless the file is locked." 516 "File keystroke count in `type-break-file-name', unless the file is locked."
510 (if (not (stringp (file-locked-p type-break-file-name))) 517 (if (and type-break-file-name
518 (not (stringp (file-locked-p type-break-file-name))))
511 ;; Prevent deactivation of the mark in some other buffer. 519 ;; Prevent deactivation of the mark in some other buffer.
512 (let (deactivate-mark) 520 (let (deactivate-mark)
513 (with-current-buffer (find-file-noselect type-break-file-name 521 (with-current-buffer (find-file-noselect type-break-file-name
@@ -534,6 +542,8 @@ return TIME, else return nil."
534(defun type-break-choose-file () 542(defun type-break-choose-file ()
535 "Return file to read from." 543 "Return file to read from."
536 (cond 544 (cond
545 ((not type-break-file-name)
546 nil)
537 ((and (file-exists-p type-break-auto-save-file-name) 547 ((and (file-exists-p type-break-auto-save-file-name)
538 (file-readable-p type-break-auto-save-file-name)) 548 (file-readable-p type-break-auto-save-file-name))
539 type-break-auto-save-file-name) 549 type-break-auto-save-file-name)
diff --git a/lisp/uniquify.el b/lisp/uniquify.el
index b2da7971167..ea9094da78a 100644
--- a/lisp/uniquify.el
+++ b/lisp/uniquify.el
@@ -1,6 +1,7 @@
1;;; uniquify.el --- unique buffer names dependent on file name 1;;; uniquify.el --- unique buffer names dependent on file name
2 2
3;; Copyright (c) 1989,95,96,97,2001,2003 Free Software Foundation, Inc. 3;; Copyright (c) 1989, 1995, 1996, 1997, 2001, 2003, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Dick King <king@reasoning.com> 6;; Author: Dick King <king@reasoning.com>
6;; Maintainer: FSF 7;; Maintainer: FSF
@@ -187,9 +188,16 @@ It actually holds the list of `uniquify-item's corresponding to the conflict.")
187If `uniquify-min-dir-content' > 0, always pulls that many 188If `uniquify-min-dir-content' > 0, always pulls that many
188file name elements. 189file name elements.
189Arguments BASE, DIRNAME, and NEWBUF specify the new buffer that causes 190Arguments BASE, DIRNAME, and NEWBUF specify the new buffer that causes
190this rationaliztion." 191this rationalization."
191 (if (null dirname) 192 (interactive
192 (with-current-buffer newbuf (setq uniquify-managed nil)) 193 (list (if uniquify-managed
194 (uniquify-item-base (car uniquify-managed)) (buffer-name))
195 (uniquify-buffer-file-name (current-buffer))
196 (current-buffer)))
197 ;; Make sure we don't get confused by outdated uniquify-managed info in
198 ;; this buffer.
199 (with-current-buffer newbuf (setq uniquify-managed nil))
200 (when dirname
193 (setq dirname (expand-file-name (directory-file-name dirname))) 201 (setq dirname (expand-file-name (directory-file-name dirname)))
194 (let ((fix-list (list (uniquify-make-item base dirname newbuf))) 202 (let ((fix-list (list (uniquify-make-item base dirname newbuf)))
195 items) 203 items)
@@ -457,5 +465,5 @@ For use on `kill-buffer-hook'."
457 465
458(provide 'uniquify) 466(provide 'uniquify)
459 467
460;;; arch-tag: e763faa3-56c9-4903-8eb8-26e1c45a0065 468;; arch-tag: e763faa3-56c9-4903-8eb8-26e1c45a0065
461;;; uniquify.el ends here 469;;; uniquify.el ends here
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 9bb5ef1c3e5..19f39265251 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,13 @@
12005-01-13 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * url.el (url-retrieve-synchronously): Use accept-process-output rather
4 than sit-for.
5
62005-01-03 Klaus Straubinger <ksnetz@arcor.de> (tiny change)
7
8 * url-http.el (url-http-handle-authentication):
9 Don't kill the current buffer.
10
12004-12-11 Stefan Monnier <monnier@iro.umontreal.ca> 112004-12-11 Stefan Monnier <monnier@iro.umontreal.ca>
2 12
3 * url-handlers.el: Don't `require' everything eagerly. 13 * url-handlers.el: Don't `require' everything eagerly.
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 8a7269e6bea..2608a85963a 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -322,8 +322,8 @@ This allows us to use `mail-fetch-field', etc."
322 (let ((url-request-method url-http-method) 322 (let ((url-request-method url-http-method)
323 (url-request-data url-http-data) 323 (url-request-data url-http-data)
324 (url-request-extra-headers url-http-extra-headers)) 324 (url-request-extra-headers url-http-extra-headers))
325 (url-retrieve url url-callback-function url-callback-arguments)))) 325 (url-retrieve url url-callback-function
326 (kill-buffer (current-buffer))))) 326 url-callback-arguments)))))))
327 327
328(defun url-http-parse-response () 328(defun url-http-parse-response ()
329 "Parse just the response code." 329 "Parse just the response code."
diff --git a/lisp/url/url.el b/lisp/url/url.el
index f94e965129a..a9fd46bc23a 100644
--- a/lisp/url/url.el
+++ b/lisp/url/url.el
@@ -1,6 +1,7 @@
1;;; url.el --- Uniform Resource Locator retrieval tool 1;;; url.el --- Uniform Resource Locator retrieval tool
2 2
3;; Copyright (c) 1996,1997,1998,1999,2001,2004 Free Software Foundation, Inc. 3;; Copyright (c) 1996, 1997, 1998, 1999, 2001, 2004, 2005
4;; Free Software Foundation, Inc.
4 5
5;; Author: Bill Perry <wmperry@gnu.org> 6;; Author: Bill Perry <wmperry@gnu.org>
6;; Keywords: comm, data, processes, hypermedia 7;; Keywords: comm, data, processes, hypermedia
@@ -169,26 +170,25 @@ no further processing). URL is either a string or a parsed URL."
169 (url-debug 'retrieval "Synchronous fetching done (%S)" (current-buffer)) 170 (url-debug 'retrieval "Synchronous fetching done (%S)" (current-buffer))
170 (setq retrieval-done t 171 (setq retrieval-done t
171 asynch-buffer (current-buffer))))) 172 asynch-buffer (current-buffer)))))
172 (if (not asynch-buffer) 173 (let ((proc (and asynch-buffer (get-buffer-process asynch-buffer))))
173 ;; We do not need to do anything, it was a mailto or something 174 (if (null proc)
174 ;; similar that takes processing completely outside of the URL 175 ;; We do not need to do anything, it was a mailto or something
175 ;; package. 176 ;; similar that takes processing completely outside of the URL
176 nil 177 ;; package.
177 (while (not retrieval-done) 178 nil
178 (url-debug 'retrieval "Spinning in url-retrieve-synchronously: %S (%S)" 179 (while (not retrieval-done)
179 retrieval-done asynch-buffer) 180 (url-debug 'retrieval
180 ;; Quoth Stef: 181 "Spinning in url-retrieve-synchronously: %S (%S)"
181 ;; It turns out that the problem seems to be that the (sit-for 182 retrieval-done asynch-buffer)
182 ;; 0.1) below doesn't actually process the data: instead it 183 ;; We used to use `sit-for' here, but in some cases it wouldn't
183 ;; returns immediately because there is keyboard input 184 ;; work because apparently pending keyboard input would always
184 ;; waiting, so we end up spinning endlessly waiting for the 185 ;; interrupt it before it got a chance to handle process input.
185 ;; process to finish while not letting it finish. 186 ;; `sleep-for' was tried but it lead to other forms of
186 187 ;; hanging. --Stef
187 ;; However, raman claims that it blocks Emacs with Emacspeak 188 (unless (accept-process-output proc)
188 ;; for unexplained reasons. Put back for his benefit until 189 ;; accept-process-output returned nil, maybe because the process
189 ;; someone can understand it. 190 ;; exited (and may have been replaced with another).
190 ;; (sleep-for 0.1) 191 (setq proc (get-buffer-process asynch-buffer)))))
191 (sit-for 0.1))
192 asynch-buffer))) 192 asynch-buffer)))
193 193
194(defun url-mm-callback (&rest ignored) 194(defun url-mm-callback (&rest ignored)
diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el
index 70dbdcc85f2..b821928c539 100644
--- a/lisp/vc-arch.el
+++ b/lisp/vc-arch.el
@@ -1,6 +1,6 @@
1;;; vc-arch.el --- VC backend for the Arch version-control system 1;;; vc-arch.el --- VC backend for the Arch version-control system
2 2
3;; Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004 3;; Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: FSF (see vc.el for full credits) 6;; Author: FSF (see vc.el for full credits)
@@ -270,7 +270,7 @@ Return non-nil if FILE is unchanged."
270(defun vc-arch-workfile-version (file) 270(defun vc-arch-workfile-version (file)
271 (let* ((root (expand-file-name "{arch}" (vc-arch-root file))) 271 (let* ((root (expand-file-name "{arch}" (vc-arch-root file)))
272 (defbranch (vc-arch-default-version file))) 272 (defbranch (vc-arch-default-version file)))
273 (when (and defbranch (string-match "\\`\\(.+@[^/\n]+\\)/\\(\\(\\(.*\\)--.*\\)--.*\\)\\'" defbranch)) 273 (when (and defbranch (string-match "\\`\\(.+@[^/\n]+\\)/\\(\\(\\(.*?\\)\\(?:--.*\\)?\\)--.*\\)\\'" defbranch))
274 (let* ((archive (match-string 1 defbranch)) 274 (let* ((archive (match-string 1 defbranch))
275 (category (match-string 4 defbranch)) 275 (category (match-string 4 defbranch))
276 (branch (match-string 3 defbranch)) 276 (branch (match-string 3 defbranch))
@@ -377,7 +377,7 @@ Return non-nil if FILE is unchanged."
377 (setq newvers nil)) 377 (setq newvers nil))
378 (if newvers 378 (if newvers
379 (error "Diffing specific revisions not implemented.") 379 (error "Diffing specific revisions not implemented.")
380 (let* ((async (fboundp 'start-process)) 380 (let* ((async (and (not vc-disable-async-diff) (fboundp 'start-process)))
381 ;; Run the command from the root dir. 381 ;; Run the command from the root dir.
382 (default-directory (vc-arch-root file)) 382 (default-directory (vc-arch-root file))
383 (status 383 (status
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el
index 22346cab68c..2bca3fb90b1 100644
--- a/lisp/vc-cvs.el
+++ b/lisp/vc-cvs.el
@@ -548,7 +548,9 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
548 (append (vc-switches nil 'diff) '("/dev/null"))) 548 (append (vc-switches nil 'diff) '("/dev/null")))
549 ;; Even if it's empty, it's locally modified. 549 ;; Even if it's empty, it's locally modified.
550 1) 550 1)
551 (let* ((async (and (vc-stay-local-p file) (fboundp 'start-process))) 551 (let* ((async (and (not vc-disable-async-diff)
552 (vc-stay-local-p file)
553 (fboundp 'start-process)))
552 (status (apply 'vc-cvs-command (or buffer "*vc-diff*") 554 (status (apply 'vc-cvs-command (or buffer "*vc-diff*")
553 (if async 'async 1) 555 (if async 'async 1)
554 file "diff" 556 file "diff"
diff --git a/lisp/vc-mcvs.el b/lisp/vc-mcvs.el
index ea577489239..aca8bcd66f0 100644
--- a/lisp/vc-mcvs.el
+++ b/lisp/vc-mcvs.el
@@ -446,7 +446,9 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
446 (append (vc-switches nil 'diff) '("/dev/null"))) 446 (append (vc-switches nil 'diff) '("/dev/null")))
447 ;; Even if it's empty, it's locally modified. 447 ;; Even if it's empty, it's locally modified.
448 1) 448 1)
449 (let* ((async (and (vc-stay-local-p file) (fboundp 'start-process))) 449 (let* ((async (and (not vc-disable-async-diff)
450 (vc-stay-local-p file)
451 (fboundp 'start-process)))
450 ;; Run the command from the root dir so that `mcvs filt' returns 452 ;; Run the command from the root dir so that `mcvs filt' returns
451 ;; valid relative names. 453 ;; valid relative names.
452 (default-directory (vc-mcvs-root file)) 454 (default-directory (vc-mcvs-root file))
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index cbb951d60b7..f783066b39b 100644
--- a/lisp/vc-svn.el
+++ b/lisp/vc-svn.el
@@ -1,6 +1,6 @@
1;;; vc-svn.el --- non-resident support for Subversion version-control 1;;; vc-svn.el --- non-resident support for Subversion version-control
2 2
3;; Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004 3;; Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: FSF (see vc.el for full credits) 6;; Author: FSF (see vc.el for full credits)
@@ -352,6 +352,10 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
352(defun vc-svn-diff (file &optional oldvers newvers buffer) 352(defun vc-svn-diff (file &optional oldvers newvers buffer)
353 "Get a difference report using SVN between two versions of FILE." 353 "Get a difference report using SVN between two versions of FILE."
354 (unless buffer (setq buffer "*vc-diff*")) 354 (unless buffer (setq buffer "*vc-diff*"))
355 (if (and oldvers (equal oldvers (vc-workfile-version file)))
356 ;; Use nil rather than the current revision because svn handles it
357 ;; better (i.e. locally).
358 (setq oldvers nil))
355 (if (string= (vc-workfile-version file) "0") 359 (if (string= (vc-workfile-version file) "0")
356 ;; This file is added but not yet committed; there is no master file. 360 ;; This file is added but not yet committed; there is no master file.
357 (if (or oldvers newvers) 361 (if (or oldvers newvers)
@@ -368,7 +372,8 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
368 (if vc-svn-diff-switches 372 (if vc-svn-diff-switches
369 (vc-switches 'SVN 'diff) 373 (vc-switches 'SVN 'diff)
370 (list "-x" (mapconcat 'identity (vc-switches nil 'diff) " ")))) 374 (list "-x" (mapconcat 'identity (vc-switches nil 'diff) " "))))
371 (async (and (vc-stay-local-p file) 375 (async (and (not vc-disable-async-diff)
376 (vc-stay-local-p file)
372 (or oldvers newvers) ; Svn diffs those locally. 377 (or oldvers newvers) ; Svn diffs those locally.
373 (fboundp 'start-process)))) 378 (fboundp 'start-process))))
374 (apply 'vc-svn-command buffer 379 (apply 'vc-svn-command buffer
diff --git a/lisp/vc.el b/lisp/vc.el
index 64de0351922..4a26b88c0e3 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -152,7 +152,7 @@
152;; have such a brief-comparison feature, the default implementation of 152;; have such a brief-comparison feature, the default implementation of
153;; this function can be used, which delegates to a full 153;; this function can be used, which delegates to a full
154;; vc-BACKEND-diff. (Note that vc-BACKEND-diff must not run 154;; vc-BACKEND-diff. (Note that vc-BACKEND-diff must not run
155;; asynchronously in this case.) 155;; asynchronously in this case, see variable `vc-disable-async-diff'.)
156;; 156;;
157;; - mode-line-string (file) 157;; - mode-line-string (file)
158;; 158;;
@@ -566,6 +566,15 @@ specific to any particular backend."
566 :group 'vc 566 :group 'vc
567 :version "21.1") 567 :version "21.1")
568 568
569(defcustom vc-allow-async-revert nil
570 "*Specifies whether the diff during \\[vc-revert-buffer] may be asynchronous.
571Enabling this option means that you can confirm a revert operation even
572if the local changes in the file have not been found and displayed yet."
573 :type '(choice (const :tag "No" nil)
574 (const :tag "Yes" t))
575 :group 'vc
576 :version "21.4")
577
569;;;###autoload 578;;;###autoload
570(defcustom vc-checkout-hook nil 579(defcustom vc-checkout-hook nil
571 "*Normal hook (list of functions) run after checking out a file. 580 "*Normal hook (list of functions) run after checking out a file.
@@ -714,6 +723,11 @@ The keys are \(BUFFER . BACKEND\). See also `vc-annotate-get-backend'.")
714(defvar vc-parent-buffer-name nil) 723(defvar vc-parent-buffer-name nil)
715(put 'vc-parent-buffer-name 'permanent-local t) 724(put 'vc-parent-buffer-name 'permanent-local t)
716 725
726(defvar vc-disable-async-diff nil
727 "VC sets this to t locally to disable some async diff operations.
728Backends that offer asynchronous diffs should respect this variable
729in their implementation of vc-BACKEND-diff.")
730
717(defvar vc-log-file) 731(defvar vc-log-file)
718(defvar vc-log-version) 732(defvar vc-log-version)
719 733
@@ -2435,11 +2449,13 @@ changes found in the master file; use \\[universal-argument] \\[vc-next-action]
2435 (unless (yes-or-no-p "File seems up-to-date. Revert anyway? ") 2449 (unless (yes-or-no-p "File seems up-to-date. Revert anyway? ")
2436 (error "Revert canceled"))) 2450 (error "Revert canceled")))
2437 (unless (vc-workfile-unchanged-p file) 2451 (unless (vc-workfile-unchanged-p file)
2452 (message "Finding changes...")
2438 ;; vc-diff selects the new window, which is not what we want: 2453 ;; vc-diff selects the new window, which is not what we want:
2439 ;; if the new window is on another frame, that'd require the user 2454 ;; if the new window is on another frame, that'd require the user
2440 ;; moving her mouse to answer the yes-or-no-p question. 2455 ;; moving her mouse to answer the yes-or-no-p question.
2441 (let ((win (save-selected-window 2456 (let* ((vc-disable-async-diff (not vc-allow-async-revert))
2442 (setq status (vc-diff nil t)) (selected-window)))) 2457 (win (save-selected-window
2458 (setq status (vc-diff nil t)) (selected-window))))
2443 (vc-exec-after `(message nil)) 2459 (vc-exec-after `(message nil))
2444 (when status 2460 (when status
2445 (unwind-protect 2461 (unwind-protect
diff --git a/lisp/woman.el b/lisp/woman.el
index 610590a2972..e4b29374a05 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -1491,7 +1491,8 @@ Also make each path-info component into a list.
1491 1491
1492(defsubst woman-dired-define-key-maybe (key) 1492(defsubst woman-dired-define-key-maybe (key)
1493 "If KEY is undefined in Dired, bind it to command `woman-dired-find-file'." 1493 "If KEY is undefined in Dired, bind it to command `woman-dired-find-file'."
1494 (if (eq (lookup-key dired-mode-map key) 'undefined) 1494 (if (or (eq (lookup-key dired-mode-map key) 'undefined)
1495 (null (lookup-key dired-mode-map key)))
1495 (woman-dired-define-key key))) 1496 (woman-dired-define-key key)))
1496 1497
1497(defun woman-dired-define-keys () 1498(defun woman-dired-define-keys ()
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index 19b58475a93..5709834ab91 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -43,14 +43,17 @@
43 43
44;; Support multi-click -- somehow. 44;; Support multi-click -- somehow.
45 45
46;; Clicking on the mode-line does not work, although it should.
47
48;;; Code: 46;;; Code:
49 47
50(define-key function-key-map "\e[M" 'xterm-mouse-translate) 48(define-key function-key-map "\e[M" 'xterm-mouse-translate)
51 49
52(defvar xterm-mouse-last) 50(defvar xterm-mouse-last)
53 51
52;; Mouse events symbols must have an 'event-kind property with
53;; the value 'mouse-click.
54(dolist (event-type '(mouse-1 mouse-2 mouse-3))
55 (put event-type 'event-kind 'mouse-click))
56
54(defun xterm-mouse-translate (event) 57(defun xterm-mouse-translate (event)
55 "Read a click and release event from XTerm." 58 "Read a click and release event from XTerm."
56 (save-excursion 59 (save-excursion
@@ -78,7 +81,7 @@
78 (click-where (nth 1 click-data))) 81 (click-where (nth 1 click-data)))
79 (if (memq down-binding '(nil ignore)) 82 (if (memq down-binding '(nil ignore))
80 (if (and (symbolp click-where) 83 (if (and (symbolp click-where)
81 (not (eq 'menu-bar click-where))) 84 (consp click-where))
82 (vector (list click-where click-data) click) 85 (vector (list click-where click-data) click)
83 (vector click)) 86 (vector click))
84 (setq unread-command-events 87 (setq unread-command-events
@@ -92,10 +95,9 @@
92 0 95 0
93 (list (intern (format "drag-mouse-%d" 96 (list (intern (format "drag-mouse-%d"
94 (+ 1 xterm-mouse-last))) 97 (+ 1 xterm-mouse-last)))
95 down-data click-data)) 98 down-data click-data)))))
96 )))
97 (if (and (symbolp down-where) 99 (if (and (symbolp down-where)
98 (not (eq 'menu-bar down-where))) 100 (consp down-where))
99 (vector (list down-where down-data) down) 101 (vector (list down-where down-data) down)
100 (vector down)))))))) 102 (vector down))))))))
101 103
@@ -124,30 +126,6 @@
124 (let* ((type (- (xterm-mouse-event-read) #o40)) 126 (let* ((type (- (xterm-mouse-event-read) #o40))
125 (x (- (xterm-mouse-event-read) #o40 1)) 127 (x (- (xterm-mouse-event-read) #o40 1))
126 (y (- (xterm-mouse-event-read) #o40 1)) 128 (y (- (xterm-mouse-event-read) #o40 1))
127 (point (cons x y))
128 (window (window-at x y))
129 (where (if window
130 (coordinates-in-window-p point window)
131 'menu-bar))
132 (pos (if (consp where)
133 (progn
134 (select-window window)
135 (goto-char (window-start window))
136 (move-to-window-line (-
137 (cdr where)
138 (if (or header-line-format
139 default-header-line-format)
140 1
141 0)))
142 (move-to-column (- (+ (car where) (current-column)
143 (if (string-match "\\` \\*Minibuf"
144 (buffer-name))
145 (- (minibuffer-prompt-width))
146 0)
147 (max 0 (1- (window-hscroll))))
148 left-margin-width))
149 (point))
150 where))
151 (mouse (intern 129 (mouse (intern
152 ;; For buttons > 3, the release-event looks 130 ;; For buttons > 3, the release-event looks
153 ;; differently (see xc/programs/xterm/button.c, 131 ;; differently (see xc/programs/xterm/button.c,
@@ -159,12 +137,18 @@
159 (format "mouse-%d" (+ 1 xterm-mouse-last))) 137 (format "mouse-%d" (+ 1 xterm-mouse-last)))
160 (t 138 (t
161 (setq xterm-mouse-last type) 139 (setq xterm-mouse-last type)
162 (format "down-mouse-%d" (+ 1 type))))))) 140 (format "down-mouse-%d" (+ 1 type))))))
141 (w (window-at x y))
142 (ltrb (window-edges w))
143 (left (nth 0 ltrb))
144 (top (nth 1 ltrb)))
145
163 (setq xterm-mouse-x x 146 (setq xterm-mouse-x x
164 xterm-mouse-y y) 147 xterm-mouse-y y)
165 (list mouse 148 (if w
166 (list window pos point 149 (list mouse (posn-at-x-y (- x left) (- y top) w))
167 (/ (nth 2 (current-time)) 1000))))) 150 (list mouse
151 (append (list nil 'menu-bar) (nthcdr 2 (posn-at-x-y x y w)))))))
168 152
169;;;###autoload 153;;;###autoload
170(define-minor-mode xterm-mouse-mode 154(define-minor-mode xterm-mouse-mode
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index baddbd958fa..635ca735e55 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,57 @@
12005-01-14 Kim F. Storm <storm@cua.dk>
2
3 * commands.texi (Accessing Events): Add WHOLE arg to posn-at-x-y.
4
5 * text.texi (Links and Mouse-1): Fix string and vector item.
6
72005-01-13 Richard M. Stallman <rms@gnu.org>
8
9 * keymaps.texi (Active Keymaps): Rewrite the text, and update the
10 descriptions of overriding-local-map and overriding-terminal-local-map.
11
12 * text.texi (Links and Mouse-1): Clarify text.
13
142005-01-13 Kim F. Storm <storm@cua.dk>
15
16 * modes.texi (Emulating Mode Line): Update format-mode-line entry.
17
182005-01-13 Francis Litterio <franl@world.std.com> (tiny change)
19
20 * keymaps.texi (Active Keymaps): Fix overriding-local-map description.
21
222005-01-12 Kim F. Storm <storm@cua.dk>
23
24 * text.texi (Links and Mouse-1): Rename section from Enabling
25 Mouse-1 to Following Links. Change xrefs.
26 Add examples for define-button-type and define-widget.
27
28 * display.texi (Button Properties, Button Buffer Commands):
29 Clarify mouse-1 and follow-link functionality.
30
312005-01-12 Richard M. Stallman <rms@gnu.org>
32
33 * text.texi (Enabling Mouse-1 to Follow Links): Redo prev. change.
34
35 * display.texi (Beeping): Fix Texinfo usage.
36
37 * modes.texi (Emulating Mode Line): Doc FACE arg in format-header-line.
38
392005-01-11 Kim F. Storm <storm@cua.dk>
40
41 * display.texi (Button Properties, Button Buffer Commands):
42 Mention mouse-1 binding. Add follow-link keyword.
43
44 * text.texi (Text Properties): Add "Enable Mouse-1" to submenu.
45 (Enabling Mouse-1 to Follow Links): New subsection.
46
472005-01-06 Richard M. Stallman <rms@gnu.org>
48
49 * text.texi (Special Properties): Minor change.
50
51 * os.texi (Timers): Clarify previous change.
52
53 * modes.texi (Emulating Mode Line): format-mode-line requires 1 arg.
54
12005-01-01 Luc Teirlinck <teirllm@auburn.edu> 552005-01-01 Luc Teirlinck <teirllm@auburn.edu>
2 56
3 * display.texi (Face Attributes): Correct xref to renamed node. 57 * display.texi (Face Attributes): Correct xref to renamed node.
diff --git a/lispref/commands.texi b/lispref/commands.texi
index fb0eabe272b..b1bc552db36 100644
--- a/lispref/commands.texi
+++ b/lispref/commands.texi
@@ -1843,12 +1843,15 @@ This function returns a position list for position @var{pos} in
1843@var{window}. 1843@var{window}.
1844@end defun 1844@end defun
1845 1845
1846@defun posn-at-x-y x y &optional frame-or-window 1846@defun posn-at-x-y x y &optional frame-or-window whole
1847This function returns position information corresponding to pixel 1847This function returns position information corresponding to pixel
1848coordinates @var{x} and @var{y} in a specified frame or window, 1848coordinates @var{x} and @var{y} in a specified frame or window,
1849@var{frame-or-window}, which defaults to the selected window. 1849@var{frame-or-window}, which defaults to the selected window.
1850The coordinates @var{x} and @var{y} are relative to the 1850The coordinates @var{x} and @var{y} are relative to the
1851frame or window used. 1851frame or window used.
1852If @var{whole} is @code{nil}, the coordinates are relative
1853to the window text area, otherwise they are relative to
1854the entire window area including scroll bars, margins and fringes.
1852@end defun 1855@end defun
1853 1856
1854 These functions are useful for decoding scroll bar events. 1857 These functions are useful for decoding scroll bar events.
diff --git a/lispref/display.texi b/lispref/display.texi
index 344b00e7455..375db424122 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -3788,10 +3788,12 @@ background color.
3788 The functions @code{create-image}, @code{defimage} and 3788 The functions @code{create-image}, @code{defimage} and
3789@code{find-image} provide convenient ways to create image descriptors. 3789@code{find-image} provide convenient ways to create image descriptors.
3790 3790
3791@defun create-image file &optional type &rest props 3791@defun create-image file-or-data &optional type data-p &rest props
3792@tindex create-image 3792@tindex create-image
3793This function creates and returns an image descriptor which uses the 3793This function creates and returns an image descriptor which uses the
3794data in @var{file}. 3794data in @var{file-or-data}. @var{file-or-data} can be a file name or
3795a string containing the image data; @var{data-p} should be @code{nil}
3796for the former case, non-@code{nil} for the latter case.
3795 3797
3796The optional argument @var{type} is a symbol specifying the image type. 3798The optional argument @var{type} is a symbol specifying the image type.
3797If @var{type} is omitted or @code{nil}, @code{create-image} tries to 3799If @var{type} is omitted or @code{nil}, @code{create-image} tries to
@@ -3802,7 +3804,7 @@ The remaining arguments, @var{props}, specify additional image
3802properties---for example, 3804properties---for example,
3803 3805
3804@example 3806@example
3805(create-image "foo.xpm" 'xpm :heuristic-mask t) 3807(create-image "foo.xpm" 'xpm nil :heuristic-mask t)
3806@end example 3808@end example
3807 3809
3808The function returns @code{nil} if images of this type are not 3810The function returns @code{nil} if images of this type are not
@@ -4063,6 +4065,11 @@ usually specified using the @code{:type} keyword argument.
4063A string displayed by the Emacs tool-tip help system; by default, 4065A string displayed by the Emacs tool-tip help system; by default,
4064@code{"mouse-2, RET: Push this button"}. 4066@code{"mouse-2, RET: Push this button"}.
4065 4067
4068@item follow-link
4069@kindex follow-link @r{(button property)}
4070The follow-link property, defining how a @key{Mouse-1} click behaves
4071on this button, @xref{Links and Mouse-1}.
4072
4066@item button 4073@item button
4067@kindex button @r{(button property)} 4074@kindex button @r{(button property)}
4068All buttons have a non-@code{nil} @code{button} property, which may be useful 4075All buttons have a non-@code{nil} @code{button} property, which may be useful
@@ -4242,6 +4249,10 @@ available in the keymap stored in @code{button-buffer-map}; a mode
4242which uses buttons may want to use @code{button-buffer-map} as a 4249which uses buttons may want to use @code{button-buffer-map} as a
4243parent keymap for its keymap. 4250parent keymap for its keymap.
4244 4251
4252If the button has a non-@code{nil} @code{follow-link} property, and
4253@var{mouse-1-click-follows-link} is set, a @key{Mouse-1} click will
4254also activate the @code{push-button} command.
4255
4245@deffn Command push-button &optional pos use-mouse-action 4256@deffn Command push-button &optional pos use-mouse-action
4246@tindex push-button 4257@tindex push-button
4247Perform the action specified by a button at location @var{pos}. 4258Perform the action specified by a button at location @var{pos}.
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi
index 089d29fc4ee..b3ae0d8808e 100644
--- a/lispref/keymaps.texi
+++ b/lispref/keymaps.texi
@@ -532,41 +532,46 @@ string for the keymap. The prompt string should be given for menu keymaps
532@cindex global keymap 532@cindex global keymap
533@cindex local keymap 533@cindex local keymap
534 534
535 Emacs normally contains many keymaps; at any given time, just a few of 535 Emacs normally contains many keymaps; at any given time, just a few
536them are @dfn{active} in that they participate in the interpretation 536of them are @dfn{active} in that they participate in the
537of user input. These are the global keymap, the current buffer's 537interpretation of user input. All the active keymaps are used
538local keymap, and the keymaps of any enabled minor modes. 538together to determine what command to execute when a key is entered.
539Emacs searches these keymaps one by one, in a standard order, until it
540finds a binding in one of the keymaps. (Searching a single keymap for a
541binding is called @dfn{key lookup}; see @ref{Key Lookup}.)
542
543 Normally the active keymaps are the @code{keymap} property keymap,
544the keymaps of any enabled minor modes, the current buffer's local
545keymap, and the global keymap, in that order. Therefore, Emacs
546searches for each input key sequence in all these keymaps.
539 547
540 The @dfn{global keymap} holds the bindings of keys that are defined 548 The @dfn{global keymap} holds the bindings of keys that are defined
541regardless of the current buffer, such as @kbd{C-f}. The variable 549regardless of the current buffer, such as @kbd{C-f}. The variable
542@code{global-map} holds this keymap, which is always active. 550@code{global-map} holds this keymap, which is always active.
543 551
544 Each buffer may have another keymap, its @dfn{local keymap}, which may 552 Each buffer may have another keymap, its @dfn{local keymap}, which
545contain new or overriding definitions for keys. The current buffer's 553may contain new or overriding definitions for keys. The current
546local keymap is always active except when @code{overriding-local-map} 554buffer's local keymap is always active except when
547overrides it. Text properties can specify an alternative local map for 555@code{overriding-local-map} overrides it. The @code{local-map} text
548certain parts of the buffer; see @ref{Special Properties}. 556or overlay property can specify an alternative local keymap for certain
557parts of the buffer; see @ref{Special Properties}.
549 558
550 Each minor mode can have a keymap; if it does, the keymap is active 559 Each minor mode can have a keymap; if it does, the keymap is active
551when the minor mode is enabled. 560when the minor mode is enabled. Modes for emulation can specify
552 561additional active keymaps through the variable
553 The variable @code{overriding-local-map}, if non-@code{nil}, specifies 562@code{emulation-mode-map-alists}.
554another local keymap that overrides the buffer's local map and all the 563
555minor mode keymaps. Modes for emulation can specify additional 564 The highest precedence normal keymap comes from the @code{keymap}
556active keymaps through the variable @code{emulation-mode-map-alists}. 565text or overlay property. If that is non-@code{nil}, it is the first
557 566keymap to be processed, in normal circumstances.
558 All the active keymaps are used together to determine what command to 567
559execute when a key is entered. Emacs searches these maps one by one, in 568 However, there are also special circumstances, ways programs can
560order of decreasing precedence, until it finds a binding in one of the 569substitute other keymaps for some of those. The variable
561maps. The procedure for searching a single keymap is called @dfn{key 570@code{overriding-local-map}, if non-@code{nil}, specifies a keymap
562lookup}; see @ref{Key Lookup}. 571that replaces all the usual active keymaps except the global keymap.
563 572Another way to do this is with @code{overriding-terminal-local-map};
564 Normally, Emacs first searches for the key in the minor mode maps, in 573it operates on a per-terminal basis. These variables are documented
565the order specified by @code{minor-mode-map-alist}; if they do not 574below.
566supply a binding for the key, Emacs searches the local map; if that too
567has no binding, Emacs then searches the global map. However, if
568@code{overriding-local-map} is non-@code{nil}, Emacs searches that map
569first, before the global map.
570 575
571@cindex major mode keymap 576@cindex major mode keymap
572 Since every buffer that uses the same major mode normally uses the 577 Since every buffer that uses the same major mode normally uses the
@@ -575,7 +580,7 @@ change to the local keymap of a buffer (using @code{local-set-key}, for
575example) is seen also in the other buffers that share that keymap. 580example) is seen also in the other buffers that share that keymap.
576 581
577 The local keymaps that are used for Lisp mode and some other major 582 The local keymaps that are used for Lisp mode and some other major
578modes exist even if they have not yet been used. These local maps are 583modes exist even if they have not yet been used. These local keymaps are
579the values of variables such as @code{lisp-mode-map}. For most major 584the values of variables such as @code{lisp-mode-map}. For most major
580modes, which are less frequently used, the local keymap is constructed 585modes, which are less frequently used, the local keymap is constructed
581only when the mode is used for the first time in a session. 586only when the mode is used for the first time in a session.
@@ -594,7 +599,7 @@ keyboard input to commands. The global keymap is normally this keymap.
594The default global keymap is a full keymap that binds 599The default global keymap is a full keymap that binds
595@code{self-insert-command} to all of the printing characters. 600@code{self-insert-command} to all of the printing characters.
596 601
597It is normal practice to change the bindings in the global map, but you 602It is normal practice to change the bindings in the global keymap, but you
598should not assign this variable any value other than the keymap it starts 603should not assign this variable any value other than the keymap it starts
599out with. 604out with.
600@end defvar 605@end defvar
@@ -701,10 +706,9 @@ all buffers.
701 706
702@defvar overriding-local-map 707@defvar overriding-local-map
703If non-@code{nil}, this variable holds a keymap to use instead of the 708If non-@code{nil}, this variable holds a keymap to use instead of the
704buffer's local keymap, text property or overlay keymaps, and instead 709buffer's local keymap, any text property or overlay keymaps, and any
705of all the minor mode keymaps. This keymap, if any, overrides all 710minor mode keymaps. This keymap, if specified, overrides all other
706other maps that would have been active, except for the current global 711maps that would have been active, except for the current global map.
707map.
708@end defvar 712@end defvar
709 713
710@defvar overriding-terminal-local-map 714@defvar overriding-terminal-local-map
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 2abb8a9c0d9..24cf95d6985 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -1736,24 +1736,29 @@ It is normally @code{nil}, so that ordinary buffers have no header line.
1736the text that would appear in a mode line or header line 1736the text that would appear in a mode line or header line
1737based on certain mode-line specification. 1737based on certain mode-line specification.
1738 1738
1739@defun format-mode-line &optional format window no-props buffer 1739@defun format-mode-line format &optional face window buffer
1740This function formats a line of text according to @var{format} as if 1740This function formats a line of text according to @var{format} as if
1741it were generating the mode line for @var{window}, but instead of 1741it were generating the mode line for @var{window}, but instead of
1742displaying the text in the mode line or the header line, it returns 1742displaying the text in the mode line or the header line, it returns
1743the text as a string. 1743the text as a string. The argument @var{window} defaults to the
1744 1744selected window. If @var{buffer} is non-@code{nil}, all the
1745If @var{format} is @code{nil}, that means to use 1745information used is taken from @var{buffer}; by default, it comes from
1746@code{mode-line-format} and return the text that would appear in the 1746@var{window}'s buffer.
1747mode line. If @var{format} is @code{t}, that means to use
1748@code{header-line-format} so as to return the text that would appear
1749in the header line (@code{""} if the window has no header line).
1750The argument @var{window} defaults to the selected window.
1751 1747
1752The value string normally has text properties that correspond to the 1748The value string normally has text properties that correspond to the
1753faces, keymaps, etc., that the mode line would have. If 1749faces, keymaps, etc., that the mode line would have. And any character
1754@var{no-props} is non-@code{nil}, the value has no text properties. 1750for which no @code{face} property is specified gets a default
1755If @var{buffer} is non-@code{nil}, all the information used is taken 1751value which is usually @var{face}. (If @var{face} is @code{t},
1756from @var{buffer}; by default,it comes from @var{window}'s buffer. 1752that stands for either @code{mode-line} if @var{window} is selected,
1753otherwise @code{mode-line-inactive}.)
1754
1755However, if @var{face} is an integer, the value has no text properties.
1756
1757For example, @code{(format-mode-line header-line-format)} returns the
1758text that would appear in the selected window's header line (@code{""}
1759if it has no header line). @code{(format-mode-line header-line-format
1760'header-line)} returns the same text, with each character
1761carrying the face that it will have in the header line itself.
1757@end defun 1762@end defun
1758 1763
1759@node Imenu 1764@node Imenu
diff --git a/lispref/os.texi b/lispref/os.texi
index ebc27224c96..0a6e0aa3642 100644
--- a/lispref/os.texi
+++ b/lispref/os.texi
@@ -1371,7 +1371,8 @@ to be annoying.
1371 It is usually a bad idea for timer functions to alter buffer 1371 It is usually a bad idea for timer functions to alter buffer
1372contents. When they do, they usually should call @code{undo-boundary} 1372contents. When they do, they usually should call @code{undo-boundary}
1373both before and after changing the buffer, to separate the timer's 1373both before and after changing the buffer, to separate the timer's
1374changes from user commands' changes. 1374changes from user commands' changes and prevent a single undo entry
1375from growing to be quite large.
1375 1376
1376@deffn Command run-at-time time repeat function &rest args 1377@deffn Command run-at-time time repeat function &rest args
1377This sets up a timer that calls the function @var{function} with 1378This sets up a timer that calls the function @var{function} with
diff --git a/lispref/text.texi b/lispref/text.texi
index 1daad58ee7f..338be03baf1 100644
--- a/lispref/text.texi
+++ b/lispref/text.texi
@@ -2431,6 +2431,7 @@ along with the characters; this includes such diverse functions as
2431 only when text is examined. 2431 only when text is examined.
2432* Clickable Text:: Using text properties to make regions of text 2432* Clickable Text:: Using text properties to make regions of text
2433 do something when you click on them. 2433 do something when you click on them.
2434* Links and Mouse-1:: How to make @key{Mouse-1} follow a link.
2434* Fields:: The @code{field} property defines 2435* Fields:: The @code{field} property defines
2435 fields within the buffer. 2436 fields within the buffer.
2436* Not Intervals:: Why text properties do not use 2437* Not Intervals:: Why text properties do not use
@@ -2826,7 +2827,7 @@ then each element can be any of these possibilities;
2826A face name (a symbol or string). 2827A face name (a symbol or string).
2827 2828
2828@item 2829@item
2829Starting in Emacs 21, a property list of face attributes. This has the 2830A property list of face attributes. This has the
2830form (@var{keyword} @var{value} @dots{}), where each @var{keyword} is a 2831form (@var{keyword} @var{value} @dots{}), where each @var{keyword} is a
2831face attribute name and @var{value} is a meaningful value for that 2832face attribute name and @var{value} is a meaningful value for that
2832attribute. With this feature, you do not need to create a face each 2833attribute. With this feature, you do not need to create a face each
@@ -3388,6 +3389,125 @@ clickable pieces of text. Also, the major mode definition (or the
3388global definition) remains available for the rest of the text in the 3389global definition) remains available for the rest of the text in the
3389buffer. 3390buffer.
3390 3391
3392@node Links and Mouse-1
3393@subsection Links and Mouse-1
3394@cindex follow links
3395@cindex mouse-1
3396
3397 The normal Emacs command for activating text in read-only buffers is
3398@key{Mouse-2}, which includes following textual links. However, most
3399graphical applications use @key{Mouse-1} for following links. For
3400compatibility, @key{Mouse-1} follows links in Emacs too, when you
3401click on a link quickly without moving the mouse. The user can
3402customize this behaviour through the variable
3403@code{mouse-1-click-follows-link}.
3404
3405 To define text as a link at the Lisp level, you should bind the
3406@code{mouse-2} event to a command to follow the link. Then, to indicate that
3407@key{Mouse-1} should also follow the link, you should specify a
3408@code{follow-link} condition either as a text property or as a key
3409binding:
3410
3411@table @asis
3412@item @code{follow-link} property
3413If the clickable text has a non-@code{nil} @code{follow-link} text or overlay
3414property, that specifies the condition.
3415
3416@item @code{follow-link} event
3417If there is a binding for the @code{follow-link} event, either on the
3418clickable text or in the local keymap, the binding is the condition.
3419@end table
3420
3421 Regardless of how you set the @code{follow-link} condition, its
3422value is used as follows to determine whether the given position is
3423inside a link, and (if so) to compute an @dfn{action code} saying how
3424@key{Mouse-1} should handle the link.
3425
3426@table @asis
3427@item @code{mouse-face}
3428If the condition is @code{mouse-face}, a position is inside a link if
3429there is a non-@code{nil} @code{mouse-face} property at that position.
3430The action code is always @code{t}.
3431
3432For example, here is how Info mode handles @key{Mouse-1}:
3433
3434@example
3435(define-key Info-mode-map [follow-link] 'mouse-face)
3436@end example
3437
3438@item a function
3439If the condition is a valid function, @var{func}, then a position
3440@var{pos} is inside a link if @code{(@var{func} @var{pos})} evaluates
3441to non-@code{nil}. The value returned by @var{func} serves as the
3442action code.
3443
3444For example, here is how pcvs enables @key{Mouse-1} to follow links on
3445file names only:
3446
3447@example
3448(define-key map [follow-link]
3449 (lambda (pos)
3450 (if (eq (get-char-property pos 'face) 'cvs-filename-face) t)))
3451@end example
3452
3453@item anything else
3454If the condition value is anything else, then the position is inside a
3455link and the condition itself is the action code. Clearly you should
3456only specify this kind of condition on the text that constitutes a
3457link.
3458@end table
3459
3460@noindent
3461The action code tells @key{Mouse-1} how to follow the link:
3462
3463@table @asis
3464@item a string or vector
3465If the action code is a string or vector, the @key{Mouse-1} event is
3466translated into the first element of the string or vector; i.e., the
3467action of the @key{Mouse-1} click is the local or global binding of
3468that character or symbol. Thus, if the action code is @code{"foo"},
3469@key{Mouse-1} translates into @kbd{f}. If it is @code{[foo]},
3470@key{Mouse-1} translates into @key{foo}.
3471
3472@item anything else
3473For any other non-@code{nil} action code, the @code{mouse-1} event is
3474translated into a @code{mouse-2} event at the same position.
3475@end table
3476
3477 To define @key{Mouse-1} to activate a button defined with
3478@code{define-button-type}, give the button a @code{follow-link}
3479property with a value as specified above to determine how to follow
3480the link. For example, here is how Help mode handles @key{Mouse-1}:
3481
3482@smallexample
3483(define-button-type 'help-xref
3484 'follow-link t
3485 'action #'help-button-action)
3486@end smallexample
3487
3488 To define @key{Mouse-1} on a widget defined with
3489@code{define-widget}, give the widget a @code{:follow-link} property
3490with a value as specified above to determine how to follow the link.
3491
3492For example, here is how the @code{link} widget specifies that
3493a @key{Mouse-1} click shall be translated to @key{RET}:
3494
3495@smallexample
3496(define-widget 'link 'item
3497 "An embedded link."
3498 :button-prefix 'widget-link-prefix
3499 :button-suffix 'widget-link-suffix
3500 :follow-link "\C-m"
3501 :help-echo "Follow the link."
3502 :format "%[%t%]")
3503@end smallexample
3504
3505@defun mouse-on-link-p pos
3506@tindex mouse-on-link-p
3507This function returns non-@code{nil} if position @var{pos} in the
3508current buffer is on a link.
3509@end defun
3510
3391@node Fields 3511@node Fields
3392@subsection Defining and Using Fields 3512@subsection Defining and Using Fields
3393@cindex fields 3513@cindex fields
diff --git a/man/ChangeLog b/man/ChangeLog
index 5da39a2a4c8..0f4646e0d73 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,74 @@
12005-01-15 Sergey Poznyakoff <gray@Mirddin.farlep.net>
2
3 * man/rmail.texi: Document support for GNU mailutils in rmail.el.
4
52005-01-13 Richard M. Stallman <rms@gnu.org>
6
7 * commands.texi (Commands): Clarification.
8
92005-01-11 Richard M. Stallman <rms@gnu.org>
10
11 * programs.texi (Multi-line Indent): Fix previous change.
12 (Fortran Autofill): Simplify description of fortran-auto-fill-mode.
13
142005-01-11 Kim F. Storm <storm@cua.dk>
15
16 * widget.texi (Basic Types): Add :follow-link keyword.
17
182005-01-09 Jay Belanger <belanger@truman.edu>
19
20 * calc.texi (Basic Commands): Describe new behavior of calc-reset.
21
222005-01-08 Richard M. Stallman <rms@gnu.org>
23
24 * display.texi (Faces): isearch-lazy-highlight-face renamed to
25 lazy-highlight.
26
27 * search.texi (Query Replace): Mention faces query-replace
28 and lazy-highlight.
29 (Incremental Search): Update isearch highlighting info.
30
312005-01-08 Jay Belanger <belanger@truman.edu>
32
33 * calc.texi: Change throughout to reflect new default value of
34 calc-settings-file.
35
362005-01-06 Katsumi Yamaoka <yamaoka@jpl.org>
37
38 * message.texi (Reply): `message-reply-to-function' should return
39 a list. Suggested by ARISAWA Akihiro <ari@mbf.ocn.co.jp>.
40
412005-01-06 Hiroshi Fujishima <pooh@nature.tsukuba.ac.jp> (tiny change)
42
43 * faq.texi (Changing load-path): Fix typo.
44
452005-01-05 Jay Belanger <belanger@truman.edu>
46
47 * calc.texi (Programming Tutorial): Replace kbd command by
48 appropriate characters for a keyboard macro.
49
502005-01-04 Jay Belanger <belanger@truman.edu>
51
52 * calc.texi (Basic Tutorial, Programming Tutorial): Remove caveats
53 for Lucid Emacs.
54 (Programming Tutorial): Mention that the user needs to be in the
55 right mode to compute some functions.
56
572005-01-04 Richard M. Stallman <rms@gnu.org>
58
59 * custom.texi (Saving Customizations): Minor improvement.
60
612005-01-04 Jay Belanger <belanger@truman.edu>
62
63 * calc.texi (Rewrite rules): Remove an exercise (on 0^0) which is
64 no longer applicable.
65
662005-01-03 Luc Teirlinck <teirllm@auburn.edu>
67
68 * custom.texi (Saving Customizations): Emacs no longer loads
69 `custom-file' after .emacs. No longer mention customizing through
70 Custom.
71
12005-01-01 Jay Belanger <belanger@truman.edu> 722005-01-01 Jay Belanger <belanger@truman.edu>
2 73
3 * calc.texi (Programming Tutorial): Changed description of how to 74 * calc.texi (Programming Tutorial): Changed description of how to
@@ -50,10 +121,6 @@
50 * basic.texi (Moving Point): C-e now runs move-end-of-line. 121 * basic.texi (Moving Point): C-e now runs move-end-of-line.
51 (Undo): Doc undo-outer-limit. 122 (Undo): Doc undo-outer-limit.
52 123
532004-12-11 Richard M. Stallman <rms@gnu.org>
54
55 * Makefile.in (MAKEINFO): Add --force.
56
572004-12-20 Jay Belanger <belanger@truman.edu> 1242004-12-20 Jay Belanger <belanger@truman.edu>
58 125
59 * calc.texi (Types Tutorial): Emphasize that you can't divide by 126 * calc.texi (Types Tutorial): Emphasize that you can't divide by
@@ -79,7 +146,6 @@
79 the standard "The GNU Emacs Manual" in fifth argument of @xref's. 146 the standard "The GNU Emacs Manual" in fifth argument of @xref's.
80 (Dealing with HTTP documents): @inforef->@xref. 147 (Dealing with HTTP documents): @inforef->@xref.
81 148
82>>>>>>> 1.412
832004-12-15 Juri Linkov <juri@jurta.org> 1492004-12-15 Juri Linkov <juri@jurta.org>
84 150
85 * mark.texi (Transient Mark, Mark Ring): M-< and other 151 * mark.texi (Transient Mark, Mark Ring): M-< and other
@@ -96,7 +162,6 @@
96 162
97 * calc.texi: Fix some TeX definitions. 163 * calc.texi: Fix some TeX definitions.
98 164
99>>>>>>> 1.407
1002004-12-12 Juri Linkov <juri@jurta.org> 1652004-12-12 Juri Linkov <juri@jurta.org>
101 166
102 * misc.texi (FFAP): Add C-x C-r, C-x C-v, C-x C-d, 167 * misc.texi (FFAP): Add C-x C-r, C-x C-v, C-x C-d,
@@ -110,7 +175,6 @@
110 * mark.texi (Marking Objects): Marking commands also extend the 175 * mark.texi (Marking Objects): Marking commands also extend the
111 region when mark is active in Transient Mark mode. 176 region when mark is active in Transient Mark mode.
112 177
113>>>>>>> 1.403
1142004-12-09 Luc Teirlinck <teirllm@auburn.edu> 1782004-12-09 Luc Teirlinck <teirllm@auburn.edu>
115 179
116 * reftex.texi (Imprint): Remove erroneous @value's. 180 * reftex.texi (Imprint): Remove erroneous @value's.
diff --git a/man/calc.texi b/man/calc.texi
index 2036c40d84f..84934dfedda 100644
--- a/man/calc.texi
+++ b/man/calc.texi
@@ -2331,9 +2331,8 @@ key. If you type a prefix key by accident, you can press @kbd{C-g}
2331to cancel it. (In fact, you can press @kbd{C-g} to cancel almost 2331to cancel it. (In fact, you can press @kbd{C-g} to cancel almost
2332anything in Emacs.) To get help on a prefix key, press that key 2332anything in Emacs.) To get help on a prefix key, press that key
2333followed by @kbd{?}. Some prefixes have several lines of help, 2333followed by @kbd{?}. Some prefixes have several lines of help,
2334so you need to press @kbd{?} repeatedly to see them all. This may 2334so you need to press @kbd{?} repeatedly to see them all.
2335not work under Lucid Emacs, but you can also type @kbd{h h} to 2335You can also type @kbd{h h} to see all the help at once.
2336see all the help at once.
2337 2336
2338Try pressing @kbd{t ?} now. You will see a line of the form, 2337Try pressing @kbd{t ?} now. You will see a line of the form,
2339 2338
@@ -5859,15 +5858,7 @@ is one or more non-sum terms separated by @samp{+} or @samp{-} signs,
5859so that @expr{2 - 3 (x + y) + x y} is a sum of three terms.) 5858so that @expr{2 - 3 (x + y) + x y} is a sum of three terms.)
5860@xref{Rewrites Answer 5, 5}. (@bullet{}) 5859@xref{Rewrites Answer 5, 5}. (@bullet{})
5861 5860
5862(@bullet{}) @strong{Exercise 6.} Calc considers the form @expr{0^0} 5861(@bullet{}) @strong{Exercise 6.} A Taylor series for a function is an
5863to be ``indeterminate,'' and leaves it unevaluated (assuming Infinite
5864mode is not enabled). Some people prefer to define @expr{0^0 = 1},
5865so that the identity @expr{x^0 = 1} can safely be used for all @expr{x}.
5866Find a way to make Calc follow this convention. What happens if you
5867now type @kbd{m i} to turn on Infinite mode?
5868@xref{Rewrites Answer 6, 6}. (@bullet{})
5869
5870(@bullet{}) @strong{Exercise 7.} A Taylor series for a function is an
5871infinite series that exactly equals the value of that function at 5862infinite series that exactly equals the value of that function at
5872values of @expr{x} near zero. 5863values of @expr{x} near zero.
5873 5864
@@ -5913,9 +5904,12 @@ on the stack, we want to be able to type @kbd{*} and get the result
5913rearranged or if @kbd{a s} needs to be typed after rewriting. (This one 5904rearranged or if @kbd{a s} needs to be typed after rewriting. (This one
5914is rather tricky; the solution at the end of this chapter uses 6 rewrite 5905is rather tricky; the solution at the end of this chapter uses 6 rewrite
5915rules. Hint: The @samp{constant(x)} condition tests whether @samp{x} is 5906rules. Hint: The @samp{constant(x)} condition tests whether @samp{x} is
5916a number.) @xref{Rewrites Answer 7, 7}. (@bullet{}) 5907a number.) @xref{Rewrites Answer 6, 6}. (@bullet{})
5908
5909Just for kicks, try adding the rule @code{2+3 := 6} to @code{EvalRules}.
5910What happens? (Be sure to remove this rule afterward, or you might get
5911a nasty surprise when you use Calc to balance your checkbook!)
5917 5912
5918@c [fix-ref Rewrite Rules]
5919@xref{Rewrite Rules}, for the whole story on rewrite rules. 5913@xref{Rewrite Rules}, for the whole story on rewrite rules.
5920 5914
5921@node Programming Tutorial, Answers to Exercises, Algebra Tutorial, Tutorial 5915@node Programming Tutorial, Answers to Exercises, Algebra Tutorial, Tutorial
@@ -5929,9 +5923,6 @@ system. But Lisp and rewrite rules take a while to master, and often
5929all you want to do is define a new function or repeat a command a few 5923all you want to do is define a new function or repeat a command a few
5930times. Calc has features that allow you to do these things easily. 5924times. Calc has features that allow you to do these things easily.
5931 5925
5932(Note that the programming commands relating to user-defined keys
5933are not yet supported under Lucid Emacs 19.)
5934
5935One very limited form of programming is defining your own functions. 5926One very limited form of programming is defining your own functions.
5936Calc's @kbd{Z F} command allows you to define a function name and 5927Calc's @kbd{Z F} command allows you to define a function name and
5937key sequence to correspond to any formula. Programming commands use 5928key sequence to correspond to any formula. Programming commands use
@@ -5993,8 +5984,9 @@ which in algebraic notation is written like @samp{ninteg(f(t), t, 0, x)}
5993with any integrand @samp{f(t)}. Define a @kbd{z s} command and 5984with any integrand @samp{f(t)}. Define a @kbd{z s} command and
5994@code{Si} function that implement this. You will need to edit the 5985@code{Si} function that implement this. You will need to edit the
5995default argument list a bit. As a test, @samp{Si(1)} should return 5986default argument list a bit. As a test, @samp{Si(1)} should return
59960.946083. (Hint: @code{ninteg} will run a lot faster if you reduce 59870.946083. (If you don't get this answer, you might want to check that
5997the precision to, say, six digits beforehand.) 5988Calc is in Radians mode. Also, @code{ninteg} will run a lot faster if
5989you reduce the precision to, say, six digits beforehand.)
5998@xref{Programming Answer 1, 1}. (@bullet{}) 5990@xref{Programming Answer 1, 1}. (@bullet{})
5999 5991
6000The simplest way to do real ``programming'' of Emacs is to define a 5992The simplest way to do real ``programming'' of Emacs is to define a
@@ -6404,7 +6396,7 @@ one end of the text below, then type @kbd{M-# m} at the other.
6404@example 6396@example
6405@group 6397@group
6406Z ` 0 t 1 6398Z ` 0 t 1
6407 1 @key{TAB} 6399 1 TAB
6408 Z ( & s + 1 1 Z ) 6400 Z ( & s + 1 1 Z )
6409 r 1 6401 r 1
6410Z ' 6402Z '
@@ -6643,8 +6635,7 @@ This section includes answers to all the exercises in the Calc tutorial.
6643* Rewrites Answer 3:: Rewriting opt(a) + opt(b) x 6635* Rewrites Answer 3:: Rewriting opt(a) + opt(b) x
6644* Rewrites Answer 4:: Sequence of integers 6636* Rewrites Answer 4:: Sequence of integers
6645* Rewrites Answer 5:: Number of terms in sum 6637* Rewrites Answer 5:: Number of terms in sum
6646* Rewrites Answer 6:: Defining 0^0 = 1 6638* Rewrites Answer 6:: Truncated Taylor series
6647* Rewrites Answer 7:: Truncated Taylor series
6648* Programming Answer 1:: Fresnel's C(x) 6639* Programming Answer 1:: Fresnel's C(x)
6649* Programming Answer 2:: Negate third stack element 6640* Programming Answer 2:: Negate third stack element
6650* Programming Answer 3:: Compute sin(x) / x, etc. 6641* Programming Answer 3:: Compute sin(x) / x, etc.
@@ -9094,48 +9085,9 @@ Here we have taken advantage of the fact that earlier rules always
9094match before later rules; @samp{nterms(x)} will only be tried if we 9085match before later rules; @samp{nterms(x)} will only be tried if we
9095already know that @samp{x} is not a sum. 9086already know that @samp{x} is not a sum.
9096 9087
9097@node Rewrites Answer 6, Rewrites Answer 7, Rewrites Answer 5, Answers to Exercises 9088@node Rewrites Answer 6, Programming Answer 1, Rewrites Answer 5, Answers to Exercises
9098@subsection Rewrites Tutorial Exercise 6 9089@subsection Rewrites Tutorial Exercise 6
9099 9090
9100Just put the rule @samp{0^0 := 1} into @code{EvalRules}. For example,
9101before making this definition we have:
9102
9103@smallexample
9104@group
91052: [-2, -1, 0, 1, 2] 1: [1, 1, 0^0, 1, 1]
91061: 0 .
9107 .
9108
9109 v x 5 @key{RET} 3 - 0 V M ^
9110@end group
9111@end smallexample
9112
9113@noindent
9114But then:
9115
9116@smallexample
9117@group
91182: [-2, -1, 0, 1, 2] 1: [1, 1, 1, 1, 1]
91191: 0 .
9120 .
9121
9122 U ' 0^0:=1 @key{RET} s t EvalRules @key{RET} V M ^
9123@end group
9124@end smallexample
9125
9126Perhaps more surprisingly, this rule still works with Infinite mode
9127turned on. Calc tries @code{EvalRules} before any built-in rules for
9128a function. This allows you to override the default behavior of any
9129Calc feature: Even though Calc now wants to evaluate @expr{0^0} to
9130@code{nan}, your rule gets there first and evaluates it to 1 instead.
9131
9132Just for kicks, try adding the rule @code{2+3 := 6} to @code{EvalRules}.
9133What happens? (Be sure to remove this rule afterward, or you might get
9134a nasty surprise when you use Calc to balance your checkbook!)
9135
9136@node Rewrites Answer 7, Programming Answer 1, Rewrites Answer 6, Answers to Exercises
9137@subsection Rewrites Tutorial Exercise 7
9138
9139@noindent 9091@noindent
9140Here is a rule set that will do the job: 9092Here is a rule set that will do the job:
9141 9093
@@ -9208,7 +9160,7 @@ for a way to do this in Calc, although for something as involved as
9208this it would probably be better to write the formatting routine 9160this it would probably be better to write the formatting routine
9209in Lisp.) 9161in Lisp.)
9210 9162
9211@node Programming Answer 1, Programming Answer 2, Rewrites Answer 7, Answers to Exercises 9163@node Programming Answer 1, Programming Answer 2, Rewrites Answer 6, Answers to Exercises
9212@subsection Programming Tutorial Exercise 1 9164@subsection Programming Tutorial Exercise 1
9213 9165
9214@noindent 9166@noindent
@@ -10029,11 +9981,16 @@ height of the Calc window.
10029@kindex M-# 0 9981@kindex M-# 0
10030@pindex calc-reset 9982@pindex calc-reset
10031The @kbd{M-# 0} command (@code{calc-reset}; that's @kbd{M-#} followed 9983The @kbd{M-# 0} command (@code{calc-reset}; that's @kbd{M-#} followed
10032by a zero) resets the Calculator to its default state. This clears 9984by a zero) resets the Calculator to its initial state. This clears
10033the stack, resets all the modes, clears the caches (@pxref{Caches}), 9985the stack, resets all the modes to their initial values (the values
10034and so on. (It does @emph{not} erase the values of any variables.) 9986that were saved with @kbd{m m} (@code{calc-save-modes})), clears the
10035With a numeric prefix argument, @kbd{M-# 0} preserves the contents 9987caches (@pxref{Caches}), and so on. (It does @emph{not} erase the
10036of the stack but resets everything else. 9988values of any variables.) With an argument of 0, Calc will be reset to
9989its default state; namely, the modes will be given their default values.
9990With a positive prefix argument, @kbd{M-# 0} preserves the contents of
9991the stack but resets everything else to its initial state; with a
9992negative prefix argument, @kbd{M-# 0} preserves the contents of the
9993stack but resets everything else to its default state.
10037 9994
10038@pindex calc-version 9995@pindex calc-version
10039The @kbd{M-x calc-version} command displays the current version number 9996The @kbd{M-x calc-version} command displays the current version number
@@ -12295,16 +12252,18 @@ the @emph{appearance} or @emph{interpretation} of the stack's contents.
12295@cindex Continuous memory 12252@cindex Continuous memory
12296@cindex Saving mode settings 12253@cindex Saving mode settings
12297@cindex Permanent mode settings 12254@cindex Permanent mode settings
12298@cindex @file{.emacs} file, mode settings 12255@cindex Calc init file, mode settings
12299You can save all of the current mode settings in your @file{.emacs} file 12256You can save all of the current mode settings in your Calc init file
12300with the @kbd{m m} (@code{calc-save-modes}) command. This will cause 12257(the file given by the variable @code{calc-settings-file}, typically
12301Emacs to reestablish these modes each time it starts up. The modes saved 12258@file{~/.calc.el}) with the @kbd{m m} (@code{calc-save-modes}) command.
12302in the file include everything controlled by the @kbd{m} and @kbd{d} 12259This will cause Emacs to reestablish these modes each time it starts up.
12303prefix keys, the current precision and binary word size, whether or not 12260The modes saved in the file include everything controlled by the @kbd{m}
12304the trail is displayed, the current height of the Calc window, and more. 12261and @kbd{d} prefix keys, the current precision and binary word size,
12305The current interface (used when you type @kbd{M-# M-#}) is also saved. 12262whether or not the trail is displayed, the current height of the Calc
12306If there were already saved mode settings in the file, they are replaced. 12263window, and more. The current interface (used when you type @kbd{M-#
12307Otherwise, the new mode information is appended to the end of the file. 12264M-#}) is also saved. If there were already saved mode settings in the
12265file, they are replaced. Otherwise, the new mode information is
12266appended to the end of the file.
12308 12267
12309@kindex m R 12268@kindex m R
12310@pindex calc-mode-record-mode 12269@pindex calc-mode-record-mode
@@ -12316,22 +12275,22 @@ options are available; @pxref{Mode Settings in Embedded Mode}.
12316@kindex m F 12275@kindex m F
12317@pindex calc-settings-file-name 12276@pindex calc-settings-file-name
12318The @kbd{m F} (@code{calc-settings-file-name}) command allows you to 12277The @kbd{m F} (@code{calc-settings-file-name}) command allows you to
12319choose a different place than your @file{.emacs} file for @kbd{m m}, 12278choose a different file than the current value of @code{calc-settings-file}
12320@kbd{Z P}, and similar commands to save permanent information. 12279for @kbd{m m}, @kbd{Z P}, and similar commands to save permanent information.
12321You are prompted for a file name. All Calc modes are then reset to 12280You are prompted for a file name. All Calc modes are then reset to
12322their default values, then settings from the file you named are loaded 12281their default values, then settings from the file you named are loaded
12323if this file exists, and this file becomes the one that Calc will 12282if this file exists, and this file becomes the one that Calc will
12324use in the future for commands like @kbd{m m}. The default settings 12283use in the future for commands like @kbd{m m}. The default settings
12325file name is @file{~/.emacs}. You can see the current file name by 12284file name is @file{~/.calc.el}. You can see the current file name by
12326giving a blank response to the @kbd{m F} prompt. See also the 12285giving a blank response to the @kbd{m F} prompt. See also the
12327discussion of the @code{calc-settings-file} variable; @pxref{Installation}. 12286discussion of the @code{calc-settings-file} variable; @pxref{Installation}.
12328 12287
12329If the file name you give contains the string @samp{.emacs} anywhere 12288If the file name you give is your user init file (typically
12330inside it, @kbd{m F} will not automatically load the new file. This 12289@file{~/.emacs}), @kbd{m F} will not automatically load the new file. This
12331is because you are presumably switching to your @file{~/.emacs} file, 12290is because your user init file may contain other things you don't want
12332which may contain other things you don't want to reread. You can give 12291to reread. You can give
12333a numeric prefix argument of 1 to @kbd{m F} to force it to read the 12292a numeric prefix argument of 1 to @kbd{m F} to force it to read the
12334file no matter what its name. Conversely, an argument of @mathit{-1} tells 12293file no matter what. Conversely, an argument of @mathit{-1} tells
12335@kbd{m F} @emph{not} to read the new file. An argument of 2 or @mathit{-2} 12294@kbd{m F} @emph{not} to read the new file. An argument of 2 or @mathit{-2}
12336tells @kbd{m F} not to reset the modes to their defaults beforehand, 12295tells @kbd{m F} not to reset the modes to their defaults beforehand,
12337which is useful if you intend your new file to have a variant of the 12296which is useful if you intend your new file to have a variant of the
@@ -15920,7 +15879,7 @@ No line breaking (@kbd{d b}).
15920Selections show deep structure (@kbd{j b}; @pxref{Making Selections}). 15879Selections show deep structure (@kbd{j b}; @pxref{Making Selections}).
15921 15880
15922@item Save 15881@item Save
15923Record modes in @file{~/.emacs} (@kbd{m R}; @pxref{General Mode Commands}). 15882Record modes in @file{~/.calc.el} (@kbd{m R}; @pxref{General Mode Commands}).
15924 15883
15925@item Local 15884@item Local
15926Record modes in Embedded buffer (@kbd{m R}). 15885Record modes in Embedded buffer (@kbd{m R}).
@@ -27807,13 +27766,14 @@ possible to create user-defined temperature units.
27807 27766
27808@kindex u p 27767@kindex u p
27809@pindex calc-permanent-units 27768@pindex calc-permanent-units
27810@cindex @file{.emacs} file, user-defined units 27769@cindex Calc init file, user-defined units
27811The @kbd{u p} (@code{calc-permanent-units}) command stores the user-defined 27770The @kbd{u p} (@code{calc-permanent-units}) command stores the user-defined
27812units in your @file{.emacs} file, so that the units will still be 27771units in your Calc init file (the file given by the variable
27813available in subsequent Emacs sessions. If there was already a set of 27772@code{calc-settings-file}, typically @file{~/.calc.el}), so that the
27814user-defined units in your @file{.emacs} file, it is replaced by the 27773units will still be available in subsequent Emacs sessions. If there
27815new set. (@xref{General Mode Commands}, for a way to tell Calc to use 27774was already a set of user-defined units in your Calc init file, it
27816a different file instead of @file{.emacs}.) 27775is replaced by the new set. (@xref{General Mode Commands}, for a way to
27776tell Calc to use a different file for the Calc init file.)
27817 27777
27818@node Store and Recall, Graphics, Units, Top 27778@node Store and Recall, Graphics, Units, Top
27819@chapter Storing and Recalling 27779@chapter Storing and Recalling
@@ -28198,14 +28158,15 @@ names rather than prompting for the variable name.
28198@pindex calc-permanent-variable 28158@pindex calc-permanent-variable
28199@cindex Storing variables 28159@cindex Storing variables
28200@cindex Permanent variables 28160@cindex Permanent variables
28201@cindex @file{.emacs} file, variables 28161@cindex Calc init file, variables
28202The @kbd{s p} (@code{calc-permanent-variable}) command saves a 28162The @kbd{s p} (@code{calc-permanent-variable}) command saves a
28203variable's value permanently in your @file{.emacs} file, so that its 28163variable's value permanently in your Calc init file (the file given by
28204value will still be available in future Emacs sessions. You can 28164the variable @code{calc-settings-file}, typically @file{~/.calc.el}), so
28205re-execute @w{@kbd{s p}} later on to update the saved value, but the 28165that its value will still be available in future Emacs sessions. You
28206only way to remove a saved variable is to edit your @file{.emacs} file 28166can re-execute @w{@kbd{s p}} later on to update the saved value, but the
28167only way to remove a saved variable is to edit your calc init file
28207by hand. (@xref{General Mode Commands}, for a way to tell Calc to 28168by hand. (@xref{General Mode Commands}, for a way to tell Calc to
28208use a different file instead of @file{.emacs}.) 28169use a different file for the Calc init file.)
28209 28170
28210If you do not specify the name of a variable to save (i.e., 28171If you do not specify the name of a variable to save (i.e.,
28211@kbd{s p @key{RET}}), all Calc variables with defined values 28172@kbd{s p @key{RET}}), all Calc variables with defined values
@@ -28224,7 +28185,7 @@ the values of all Calc variables into a specified buffer.
28224The variables are written with the prefix @code{var-} in the form of 28185The variables are written with the prefix @code{var-} in the form of
28225Lisp @code{setq} commands 28186Lisp @code{setq} commands
28226which store the values in string form. You can place these commands 28187which store the values in string form. You can place these commands
28227in your @file{.emacs} buffer if you wish, though in this case it 28188in your Calc init file (or @file{.emacs}) if you wish, though in this case it
28228would be easier to use @kbd{s p @key{RET}}. (Note that @kbd{s i} 28189would be easier to use @kbd{s p @key{RET}}. (Note that @kbd{s i}
28229omits the same set of variables as @w{@kbd{s p @key{RET}}}; the difference 28190omits the same set of variables as @w{@kbd{s p @key{RET}}}; the difference
28230is that @kbd{s i} will store the variables in any buffer, and it also 28191is that @kbd{s i} will store the variables in any buffer, and it also
@@ -28411,7 +28372,7 @@ Software Foundation's machine @samp{prep.ai.mit.edu}.)
28411@vindex calc-gnuplot-name 28372@vindex calc-gnuplot-name
28412If you have GNUPLOT installed on your system but Calc is unable to 28373If you have GNUPLOT installed on your system but Calc is unable to
28413find it, you may need to set the @code{calc-gnuplot-name} variable 28374find it, you may need to set the @code{calc-gnuplot-name} variable
28414in your @file{.emacs} file. You may also need to set some Lisp 28375in your Calc init file or @file{.emacs}. You may also need to set some Lisp
28415variables to show Calc how to run GNUPLOT on your system; these 28376variables to show Calc how to run GNUPLOT on your system; these
28416are described under @kbd{g D} and @kbd{g O} below. If you are 28377are described under @kbd{g D} and @kbd{g O} below. If you are
28417using the X window system, Calc will configure GNUPLOT for you 28378using the X window system, Calc will configure GNUPLOT for you
@@ -30466,7 +30427,8 @@ on it in order to get it to notice the new annotation.
30466 30427
30467Two more mode-recording modes selectable by @kbd{m R} are @code{Save} 30428Two more mode-recording modes selectable by @kbd{m R} are @code{Save}
30468(which works even outside of Embedded mode), in which mode settings 30429(which works even outside of Embedded mode), in which mode settings
30469are recorded permanently in your Emacs startup file @file{~/.emacs} 30430are recorded permanently in your Calc init file (the file given by the
30431variable @code{calc-settings-file}, typically @file{~/.calc.el})
30470rather than by annotating the current document, and no-recording 30432rather than by annotating the current document, and no-recording
30471mode (where there is no symbol like @code{Save} or @code{Local} in 30433mode (where there is no symbol like @code{Save} or @code{Local} in
30472the mode line), in which mode-changing commands do not leave any 30434the mode line), in which mode-changing commands do not leave any
@@ -30482,8 +30444,8 @@ for @code{Save} have no effect.
30482You can modify Embedded mode's behavior by setting various Lisp 30444You can modify Embedded mode's behavior by setting various Lisp
30483variables described here. Use @kbd{M-x set-variable} or 30445variables described here. Use @kbd{M-x set-variable} or
30484@kbd{M-x edit-options} to adjust a variable on the fly, or 30446@kbd{M-x edit-options} to adjust a variable on the fly, or
30485put a suitable @code{setq} statement in your @file{~/.emacs} 30447put a suitable @code{setq} statement in your Calc init file (or
30486file to set a variable permanently. (Another possibility would 30448@file{~/.emacs}) to set a variable permanently. (Another possibility would
30487be to use a file-local variable annotation at the end of the 30449be to use a file-local variable annotation at the end of the
30488file; @pxref{File Variables, , Local Variables in Files, emacs, the 30450file; @pxref{File Variables, , Local Variables in Files, emacs, the
30489Emacs manual}.) 30451Emacs manual}.)
@@ -30721,15 +30683,16 @@ key we defined above.
30721@pindex calc-user-define-permanent 30683@pindex calc-user-define-permanent
30722@cindex Storing user definitions 30684@cindex Storing user definitions
30723@cindex Permanent user definitions 30685@cindex Permanent user definitions
30724@cindex @file{.emacs} file, user-defined commands 30686@cindex Calc init file, user-defined commands
30725The @kbd{Z P} (@code{calc-user-define-permanent}) command makes a key 30687The @kbd{Z P} (@code{calc-user-define-permanent}) command makes a key
30726binding permanent so that it will remain in effect even in future Emacs 30688binding permanent so that it will remain in effect even in future Emacs
30727sessions. (It does this by adding a suitable bit of Lisp code into 30689sessions. (It does this by adding a suitable bit of Lisp code into
30728your @file{.emacs} file.) For example, @kbd{Z P s} would register 30690your Calc init file; that is, the file given by the variable
30729our @code{sincos} command permanently. If you later wish to unregister 30691@code{calc-settings-file}, typically @file{~/.calc.el}.) For example,
30730this command you must edit your @file{.emacs} file by hand. 30692@kbd{Z P s} would register our @code{sincos} command permanently. If
30731(@xref{General Mode Commands}, for a way to tell Calc to use a 30693you later wish to unregister this command you must edit your Calc init
30732different file instead of @file{.emacs}.) 30694file by hand. (@xref{General Mode Commands}, for a way to tell Calc to
30695use a different file for the Calc init file.)
30733 30696
30734The @kbd{Z P} command also saves the user definition, if any, for the 30697The @kbd{Z P} command also saves the user definition, if any, for the
30735command bound to the key. After @kbd{Z F} and @kbd{Z C}, a given user 30698command bound to the key. After @kbd{Z F} and @kbd{Z C}, a given user
@@ -31444,12 +31407,17 @@ step of @code{myfact} could have been written
31444:"n * myfact(n-1)" 31407:"n * myfact(n-1)"
31445@end example 31408@end example
31446 31409
31410A good place to put your @code{defmath} commands is your Calc init file
31411(the file given by @code{calc-settings-file}, typically
31412@file{~/.calc.el}), which will not be loaded until Calc starts.
31447If a file named @file{.emacs} exists in your home directory, Emacs reads 31413If a file named @file{.emacs} exists in your home directory, Emacs reads
31448and executes the Lisp forms in this file as it starts up. While it may 31414and executes the Lisp forms in this file as it starts up. While it may
31449seem like a good idea to put your favorite @code{defmath} commands here, 31415seem reasonable to put your favorite @code{defmath} commands there,
31450this has the unfortunate side-effect that parts of the Calculator must be 31416this has the unfortunate side-effect that parts of the Calculator must be
31451loaded in to process the @code{defmath} commands whether or not you will 31417loaded in to process the @code{defmath} commands whether or not you will
31452actually use the Calculator! A better effect can be had by writing 31418actually use the Calculator! If you want to put the @code{defmath}
31419commands there (for example, if you redefine @code{calc-settings-file}
31420to be @file{.emacs}), a better effect can be had by writing
31453 31421
31454@example 31422@example
31455(put 'calc-define 'thing '(progn 31423(put 'calc-define 'thing '(progn
@@ -34402,7 +34370,7 @@ text. (In fact it may still have leftover text from a previous
34402@defvar calc-mode-save-hook 34370@defvar calc-mode-save-hook
34403This hook is called by the @code{calc-save-modes} command, 34371This hook is called by the @code{calc-save-modes} command,
34404after Calc's own mode features have been inserted into the 34372after Calc's own mode features have been inserted into the
34405@file{.emacs} buffer and just before the ``End of mode settings'' 34373Calc init file and just before the ``End of mode settings''
34406message is inserted. 34374message is inserted.
34407@end defvar 34375@end defvar
34408 34376
@@ -34545,8 +34513,8 @@ the same side, best if you plan to be binding single-sided pages.
34545Another variable you might want to set is @code{calc-settings-file}, 34513Another variable you might want to set is @code{calc-settings-file},
34546which holds the file name in which commands like @kbd{m m} and @kbd{Z P} 34514which holds the file name in which commands like @kbd{m m} and @kbd{Z P}
34547store ``permanent'' definitions. The default value for this variable 34515store ``permanent'' definitions. The default value for this variable
34548is @code{"~/.emacs"}. If @code{calc-settings-file} does not contain 34516is @code{"~/.calc.el"}. If @code{calc-settings-file} is not your user
34549@code{".emacs"} as a substring, and if the variable 34517init file (typically @file{~/.emacs}) and if the variable
34550@code{calc-loaded-settings-file} is @code{nil}, then Calc will 34518@code{calc-loaded-settings-file} is @code{nil}, then Calc will
34551automatically load your settings file (if it exists) the first time 34519automatically load your settings file (if it exists) the first time
34552Calc is invoked. 34520Calc is invoked.
@@ -35893,7 +35861,7 @@ as Calc variables. Add a @samp{var-} prefix to get the name of the
35893corresponding Lisp variable. 35861corresponding Lisp variable.
35894 35862
35895The remaining variables are Lisp variables suitable for @code{setq}ing 35863The remaining variables are Lisp variables suitable for @code{setq}ing
35896in your @file{.emacs} file. 35864in your Calc init file or @file{.emacs} file.
35897 35865
35898@printindex vr 35866@printindex vr
35899 35867
diff --git a/man/commands.texi b/man/commands.texi
index 54ec50acfe8..cc8537c1271 100644
--- a/man/commands.texi
+++ b/man/commands.texi
@@ -222,13 +222,15 @@ this effect @emph{because} it is bound to that command. If you rebind
222forward by words instead. Rebinding keys is a common method of 222forward by words instead. Rebinding keys is a common method of
223customization.@refill 223customization.@refill
224 224
225 In the rest of this manual, we usually ignore this subtlety to keep 225 In the rest of this manual, we usually ignore this distinction to
226things simple. To give the information needed for customization, we 226keep things simple. We will often speak of keys like @kbd{C-n} as
227state the name of the command which really does the work in parentheses 227commands, even though strictly speaking a key is bound to some
228command. To give the information needed for customization, we state
229the name of the command which really does the work in parentheses
228after mentioning the key that runs it. For example, we will say that 230after mentioning the key that runs it. For example, we will say that
229``The command @kbd{C-n} (@code{next-line}) moves point vertically 231``The command @kbd{C-n} (@code{next-line}) moves point vertically
230down,'' meaning that @code{next-line} is a command that moves vertically 232down,'' meaning that @code{next-line} is a command that moves
231down, and @kbd{C-n} is a key that is normally bound to it. 233vertically down, and @kbd{C-n} is a key that is normally bound to it.
232 234
233 While we are on the subject of information for customization only, 235 While we are on the subject of information for customization only,
234it's a good time to tell you about @dfn{variables}. Often the 236it's a good time to tell you about @dfn{variables}. Often the
diff --git a/man/custom.texi b/man/custom.texi
index 840711369ef..bbde8b4aaf5 100644
--- a/man/custom.texi
+++ b/man/custom.texi
@@ -487,21 +487,12 @@ set, saved or reset.
487 The customization buffer normally saves customizations in 487 The customization buffer normally saves customizations in
488@file{~/.emacs}. If you wish, you can save customizations in another 488@file{~/.emacs}. If you wish, you can save customizations in another
489file instead. To make this work, your @file{~/.emacs} should set 489file instead. To make this work, your @file{~/.emacs} should set
490@code{custom-file} to the name of that file. If you are using Emacs 490@code{custom-file} to the name of that file. Then you should load the
491version 21.4 or later, Emacs loads the file right after your 491file by calling @code{load}. For example:
492@file{.emacs} if you did not load it already. In earlier versions,
493you have to load the file in your @file{~/emacs}. If you customize
494@code{custom-file} through the @samp{Customize} interface, you still
495need to load it in your @file{.emacs}, but there is no need to set
496it. For example:
497 492
498@example 493@example
499;; @r{if not set through the @samp{Customize} interface:} 494(setq custom-file "~/.emacs-custom.el")
500(setq custom-file "~/.emacs-custom") 495(load custom-file)
501
502;; @r{in Emacs versions before 21.4 or if set through}
503;; @r{the @samp{Customize} interface.}
504(load "~/.emacs-custom")
505@end example 496@end example
506 497
507 You can also use @code{custom-file} to specify different 498 You can also use @code{custom-file} to specify different
diff --git a/man/display.texi b/man/display.texi
index 4194e626d72..0e39360d38a 100644
--- a/man/display.texi
+++ b/man/display.texi
@@ -120,9 +120,9 @@ This face is used for highlighting portions of text, in various modes.
120For example, mouse-sensitive text is highlighted using this face. 120For example, mouse-sensitive text is highlighted using this face.
121@item isearch 121@item isearch
122This face is used for highlighting Isearch matches. 122This face is used for highlighting Isearch matches.
123@item isearch-lazy-highlight-face 123@item lazy-highlight
124This face is used for lazy highlighting of Isearch matches other than 124This face is used for lazy highlighting of Isearch and Query Replace
125the current one. 125matches other than the current one.
126@item region 126@item region
127This face is used for displaying a selected region (when Transient Mark 127This face is used for displaying a selected region (when Transient Mark
128mode is enabled---see below). 128mode is enabled---see below).
diff --git a/man/faq.texi b/man/faq.texi
index 6ca849d7b1e..b2a8b40155f 100644
--- a/man/faq.texi
+++ b/man/faq.texi
@@ -1583,7 +1583,7 @@ directory @var{/dir/subdir} to the load path like this:
1583To do this relative to your home directory: 1583To do this relative to your home directory:
1584 1584
1585@lisp 1585@lisp
1586(setq load-path (cons "~/mysubdir/" load-path) 1586(setq load-path (cons "~/mysubdir/" load-path))
1587@end lisp 1587@end lisp
1588 1588
1589@node Using an already running Emacs process, Compiler error messages, Changing load-path, Common requests 1589@node Using an already running Emacs process, Compiler error messages, Changing load-path, Common requests
diff --git a/man/message.texi b/man/message.texi
index 4d4f7af2a07..5e488b0e7cf 100644
--- a/man/message.texi
+++ b/man/message.texi
@@ -146,16 +146,15 @@ If you want the replies to go to the @code{Sender} instead of the
146This function will be called narrowed to the head of the article that is 146This function will be called narrowed to the head of the article that is
147being replied to. 147being replied to.
148 148
149As you can see, this function should return a string if it has an 149As you can see, this function should return a list. In this case, it
150opinion as to what the To header should be. If it does not, it should 150returns @code{((To . "Whom"))} if it has an opinion as to what the To
151just return @code{nil}, and the normal methods for determining the To 151header should be. If it does not, it should just return @code{nil}, and
152header will be used. 152the normal methods for determining the To header will be used.
153 153
154This function can also return a list. In that case, each list element 154Each list element should be a cons, where the @sc{car} should be the
155should be a cons, where the @sc{car} should be the name of a header 155name of a header (e.g. @code{Cc}) and the @sc{cdr} should be the header
156(e.g. @code{Cc}) and the @sc{cdr} should be the header value 156value (e.g. @samp{larsi@@ifi.uio.no}). All these headers will be
157(e.g. @samp{larsi@@ifi.uio.no}). All these headers will be inserted into 157inserted into the head of the outgoing mail.
158the head of the outgoing mail.
159 158
160 159
161@node Wide Reply 160@node Wide Reply
diff --git a/man/org.texi b/man/org.texi
index c35784e2580..d461e9c1020 100644
--- a/man/org.texi
+++ b/man/org.texi
@@ -3,7 +3,7 @@
3@setfilename ../info/org 3@setfilename ../info/org
4@settitle Org Mode Manual 4@settitle Org Mode Manual
5 5
6@set VERSION 3.03 6@set VERSION 3.04
7@set DATE December 2004 7@set DATE December 2004
8 8
9@dircategory Emacs 9@dircategory Emacs
@@ -119,6 +119,7 @@ Tables
119 119
120* Built-in table editor:: Simple tables 120* Built-in table editor:: Simple tables
121* table.el:: Complex tables 121* table.el:: Complex tables
122* orgtbl-mode:: The table editor as minor mode
122 123
123Hyperlinks 124Hyperlinks
124 125
@@ -202,6 +203,17 @@ different levels and in different ways, for example
202@r{@bullet{} as a full agenda and planner with deadlines and work scheduling} 203@r{@bullet{} as a full agenda and planner with deadlines and work scheduling}
203@end example 204@end example
204 205
206The Org-mode table editor can be used integrated into any major mode
207by activating the minor Ortbl-mode.
208
209There is a website for Org-mode which provides links to the newest
210version of Org-mode, as well as additional information, screen shots
211and example files. This page is located at
212@uref{http://www.astro.uva.nl/~dominik/Tools/org/}.
213
214
215@page
216
205@node Installation, , Summary, Introduction 217@node Installation, , Summary, Introduction
206@section Installation 218@section Installation
207@cindex installation 219@cindex installation
@@ -223,12 +235,13 @@ Then copy the following lines into @file{.emacs}. The last two lines
223define @emph{global} keys for the commands @command{org-store-link} 235define @emph{global} keys for the commands @command{org-store-link}
224and @command{org-agenda} - please choose suitable keys yourself. 236and @command{org-agenda} - please choose suitable keys yourself.
225 237
226@c FIXME: autoloads not necessary when part of emacs
227@lisp 238@lisp
228(autoload 'org-mode "org" "Org mode" t) 239(autoload 'org-mode "org" "Org mode" t)
229(autoload 'org-diary "org" "Diary entries from Org mode") 240(autoload 'org-diary "org" "Diary entries from Org mode")
230(autoload 'org-agenda "org" "Multi-file agenda from Org mode" t) 241(autoload 'org-agenda "org" "Multi-file agenda from Org mode" t)
231(autoload 'org-store-link "org" "Store a link to the current location" t) 242(autoload 'org-store-link "org" "Store a link to the current location" t)
243(autoload 'orgtbl-mode "org" "Org tables as a minor mode" t)
244(autoload 'turn-on-orgtbl "org" "Org tables as a minor mode")
232(add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) 245(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
233(define-key global-map "\C-cl" 'org-store-link) 246(define-key global-map "\C-cl" 'org-store-link)
234(define-key global-map "\C-ca" 'org-agenda) 247(define-key global-map "\C-ca" 'org-agenda)
@@ -656,6 +669,7 @@ with the Emacs table.el package.
656@menu 669@menu
657* Built-in table editor:: Simple tables 670* Built-in table editor:: Simple tables
658* table.el:: Complex tables 671* table.el:: Complex tables
672* orgtbl-mode:: The table editor as minor mode
659@end menu 673@end menu
660 674
661@node Built-in table editor, table.el, Tables, Tables 675@node Built-in table editor, table.el, Tables, Tables
@@ -855,7 +869,7 @@ it off with
855@noindent The only table command which then still works is 869@noindent The only table command which then still works is
856@kbd{C-c C-c} to do a manual re-align. 870@kbd{C-c C-c} to do a manual re-align.
857 871
858@node table.el, , Built-in table editor, Tables 872@node table.el, orgtbl-mode, Built-in table editor, Tables
859@section The @file{table.el} package 873@section The @file{table.el} package
860@kindex C-c C-c 874@kindex C-c C-c
861@cindex table editor, table.el 875@cindex table editor, table.el
@@ -879,6 +893,20 @@ format. See the documentation string of the command
879possible. 893possible.
880@end table 894@end table
881 895
896@node orgtbl-mode, , table.el, Tables
897@section The Orgtbl minor mode
898@cindex orgtbl-mode
899@cindex Minor mode for tables
900
901If you like the intuitive way the Org-mode table editor works, you
902might want to use it also in other modes like text-mode or mail-mode.
903The minor mode Orgtbl-mode make this possible. You can always toggle
904the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
905example in mail mode, use
906@lisp
907(add-hook 'mail-mode-hook 'turn-on-orgtbl)
908@end lisp
909
882@node Hyperlinks, Timestamps, Tables, Top 910@node Hyperlinks, Timestamps, Tables, Top
883@chapter Hyperlinks 911@chapter Hyperlinks
884@cindex hyperlinks 912@cindex hyperlinks
@@ -1084,7 +1112,7 @@ example:
1084@cindex deadline 1112@cindex deadline
1085If a time stamp is preceded by the word @samp{DEADLINE:}, the task 1113If a time stamp is preceded by the word @samp{DEADLINE:}, the task
1086(most likely a TODO item) is supposed to be finished on that date, and 1114(most likely a TODO item) is supposed to be finished on that date, and
1087it will be listed then In addition, the compilation for the 1115it will be listed then. In addition, the compilation for the
1088@emph{current day} will carry a warning about the approaching or 1116@emph{current day} will carry a warning about the approaching or
1089missed deadline, starting @code{org-deadline-warning-days} before the 1117missed deadline, starting @code{org-deadline-warning-days} before the
1090due date, and continuing until the entry is marked DONE. An example: 1118due date, and continuing until the entry is marked DONE. An example:
diff --git a/man/programs.texi b/man/programs.texi
index abe0083b39e..b48a55777a5 100644
--- a/man/programs.texi
+++ b/man/programs.texi
@@ -17,10 +17,10 @@ Find or move over top-level definitions (@pxref{Defuns}).
17Apply the usual indentation conventions of the language 17Apply the usual indentation conventions of the language
18(@pxref{Program Indent}). 18(@pxref{Program Indent}).
19@item 19@item
20Insert, kill or align comments (@pxref{Comments}).
21@item
22Balance parentheses (@pxref{Parentheses}). 20Balance parentheses (@pxref{Parentheses}).
23@item 21@item
22Insert, kill or align comments (@pxref{Comments}).
23@item
24Highlight program syntax (@pxref{Font Lock}). 24Highlight program syntax (@pxref{Font Lock}).
25@end itemize 25@end itemize
26 26
@@ -81,7 +81,7 @@ and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}.
81@cindex PostScript mode 81@cindex PostScript mode
82 The existing programming language major modes include Lisp, Scheme (a 82 The existing programming language major modes include Lisp, Scheme (a
83variant of Lisp) and the Scheme-based DSSSL expression language, Ada, 83variant of Lisp) and the Scheme-based DSSSL expression language, Ada,
84AWK, C, C++, Delphi (Object Pascal), Fortran (free format and fixed 84ASM, AWK, C, C++, Delphi (Object Pascal), Fortran (free format and fixed
85format), Icon, IDL (CORBA), IDLWAVE, Java, Metafont (@TeX{}'s 85format), Icon, IDL (CORBA), IDLWAVE, Java, Metafont (@TeX{}'s
86companion for font creation), Modula2, Objective-C, Octave, Pascal, 86companion for font creation), Modula2, Objective-C, Octave, Pascal,
87Perl, Pike, PostScript, Prolog, Simula, Tcl, and VHDL. There is 87Perl, Pike, PostScript, Prolog, Simula, Tcl, and VHDL. There is
@@ -316,11 +316,11 @@ buffer.
316@vindex which-func-modes 316@vindex which-func-modes
317 To enable (or disable) Which Function mode, use the command @kbd{M-x 317 To enable (or disable) Which Function mode, use the command @kbd{M-x
318which-function-mode}. This command is global; it applies to all 318which-function-mode}. This command is global; it applies to all
319buffers, both existing ones and those yet to be created. However, 319buffers, both existing ones and those yet to be created. However, it
320it only takes effect in certain major modes, those listed in the value of 320takes effect only in certain major modes, those listed in the value of
321@code{which-func-modes}. If the value is @code{t}, then Which 321@code{which-func-modes}. If the value is @code{t}, then Which Function
322Function mode applies to all major modes that know how to support 322mode applies to all major modes that know how to support it---in other
323it---in other words, all the major modes that support Imenu. 323words, all the major modes that support Imenu.
324 324
325@node Program Indent 325@node Program Indent
326@section Indentation for Programs 326@section Indentation for Programs
@@ -365,7 +365,7 @@ This key, if the keyboard has it, is another way to enter @kbd{C-j}.
365 The basic indentation command is @key{TAB}, which gives the current line 365 The basic indentation command is @key{TAB}, which gives the current line
366the correct indentation as determined from the previous lines. The 366the correct indentation as determined from the previous lines. The
367function that @key{TAB} runs depends on the major mode; it is 367function that @key{TAB} runs depends on the major mode; it is
368@code{indent-for-tab-command} 368@code{lisp-indent-line}
369in Lisp mode, @code{c-indent-command} in C mode, etc. These functions 369in Lisp mode, @code{c-indent-command} in C mode, etc. These functions
370understand the syntax and conventions of different languages, but they all do 370understand the syntax and conventions of different languages, but they all do
371conceptually the same job: @key{TAB} in any programming-language major mode 371conceptually the same job: @key{TAB} in any programming-language major mode
@@ -411,7 +411,7 @@ you have several commands available.
411 411
412@table @kbd 412@table @kbd
413@item C-M-q 413@item C-M-q
414Reindent all the lines within one parenthetical grouping(@code{indent-sexp}). 414Reindent all the lines within one parenthetical grouping (@code{indent-pp-sexp}).
415@item C-M-\ 415@item C-M-\
416Reindent all lines in the region (@code{indent-region}). 416Reindent all lines in the region (@code{indent-region}).
417@item C-u @key{TAB} 417@item C-u @key{TAB}
@@ -423,12 +423,12 @@ lines that start inside comments and strings.
423@end table 423@end table
424 424
425@kindex C-M-q 425@kindex C-M-q
426@findex indent-sexp 426@findex indent-pp-sexp
427 You can reindent the contents of a single parenthetical grouping by 427 You can reindent the contents of a single parenthetical grouping by
428positioning point before the beginning of it and typing @kbd{C-M-q} 428positioning point before the beginning of it and typing @kbd{C-M-q}
429(@code{indent-sexp} in Lisp mode, @code{c-indent-exp} in C mode; also 429(@code{indent-pp-sexp} in Lisp mode, @code{c-indent-exp} in C mode; also
430bound to other suitable commands in other modes). The indentation of 430bound to other suitable commands in other modes). The indentation of
431the line where the grouping starts is not changed; therefore, this 431the line where the grouping starts is not changed; therefore this
432changes only the relative indentation within the grouping, not its 432changes only the relative indentation within the grouping, not its
433overall indentation. To correct that as well, type @key{TAB} first. 433overall indentation. To correct that as well, type @key{TAB} first.
434 434
@@ -455,6 +455,7 @@ to them.
455region sideways, like @code{indent-rigidly} does (@pxref{Indentation 455region sideways, like @code{indent-rigidly} does (@pxref{Indentation
456Commands}). It doesn't alter the indentation of lines that start 456Commands}). It doesn't alter the indentation of lines that start
457inside a string, unless the region also starts inside that string. 457inside a string, unless the region also starts inside that string.
458The prefix arg specifies the number of columns to indent.
458 459
459@node Lisp Indent 460@node Lisp Indent
460@subsection Customizing Lisp Indentation 461@subsection Customizing Lisp Indentation
@@ -638,7 +639,7 @@ expression in Lisp.}.
638@item C-M-f 639@item C-M-f
639Move forward over a balanced expression (@code{forward-sexp}). 640Move forward over a balanced expression (@code{forward-sexp}).
640@item C-M-b 641@item C-M-b
641Move backward over a balanced expression(@code{backward-sexp}). 642Move backward over a balanced expression (@code{backward-sexp}).
642@item C-M-k 643@item C-M-k
643Kill balanced expression forward (@code{kill-sexp}). 644Kill balanced expression forward (@code{kill-sexp}).
644@item C-M-t 645@item C-M-t
@@ -746,7 +747,7 @@ groupings are lists.
746@item C-M-n 747@item C-M-n
747Move forward over a parenthetical group (@code{forward-list}). 748Move forward over a parenthetical group (@code{forward-list}).
748@item C-M-p 749@item C-M-p
749Move backward over a parenthetical group(@code{backward-list}). 750Move backward over a parenthetical group (@code{backward-list}).
750@item C-M-u 751@item C-M-u
751Move up in parenthesis structure (@code{backward-up-list}). 752Move up in parenthesis structure (@code{backward-up-list}).
752@item C-M-d 753@item C-M-d
@@ -797,8 +798,9 @@ as in @samp{[x)}---a warning message is displayed in the echo area.
797@vindex blink-matching-paren 798@vindex blink-matching-paren
798@vindex blink-matching-paren-distance 799@vindex blink-matching-paren-distance
799@vindex blink-matching-delay 800@vindex blink-matching-delay
800 Three variables control parenthesis match display. 801 Three variables control parenthesis match display:
801@code{blink-matching-paren} turns the feature on or off: @code{nil} 802
803 @code{blink-matching-paren} turns the feature on or off: @code{nil}
802disables it, but the default is @code{t} to enable match display. 804disables it, but the default is @code{t} to enable match display.
803 805
804 @code{blink-matching-delay} says how many seconds to leave the 806 @code{blink-matching-delay} says how many seconds to leave the
@@ -1142,7 +1144,7 @@ for ``w/o (without) man,'' since it doesn't use the @code{man}
1142program.}. Unlike @kbd{M-x man}, it does not run any external 1144program.}. Unlike @kbd{M-x man}, it does not run any external
1143programs to format and display the man pages; instead it does the job 1145programs to format and display the man pages; instead it does the job
1144in Emacs Lisp, so it works on systems such as MS-Windows, where the 1146in Emacs Lisp, so it works on systems such as MS-Windows, where the
1145@code{man} program (and the other programs it uses) are not generally 1147@code{man} program (and other programs it uses) are not generally
1146available. 1148available.
1147 1149
1148 @kbd{M-x woman} prompts for a name of a manual page, and provides 1150 @kbd{M-x woman} prompts for a name of a manual page, and provides
@@ -1220,8 +1222,9 @@ v} uses the symbol name around or adjacent to point as its default.
1220mode constantly displays in the echo area the argument list for the 1222mode constantly displays in the echo area the argument list for the
1221function being called at point. (In other words, it finds the 1223function being called at point. (In other words, it finds the
1222function call that point is contained in, and displays the argument 1224function call that point is contained in, and displays the argument
1223list of that function.) Eldoc mode applies in Emacs Lisp and Lisp 1225list of that function.) If point is over a documented variable, it
1224Interaction modes only. Use the command @kbd{M-x eldoc-mode} to 1226shows the variable's docstring. Eldoc mode applies in Emacs Lisp and
1227Lisp Interaction modes only. Use the command @kbd{M-x eldoc-mode} to
1225enable or disable this feature. 1228enable or disable this feature.
1226 1229
1227@node Hideshow 1230@node Hideshow
@@ -1259,9 +1262,9 @@ Hide the current block (@code{hs-hide-block}).
1259@item C-c @@ C-s 1262@item C-c @@ C-s
1260Show the current block (@code{hs-show-block}). 1263Show the current block (@code{hs-show-block}).
1261@item C-c @@ C-c 1264@item C-c @@ C-c
1262Either hide or show the current block (@code{hs-toggle-hiding}) 1265Either hide or show the current block (@code{hs-toggle-hiding}).
1263@item S-Mouse-2 1266@item S-Mouse-2
1264Either hide or show the block you click on (@code{hs-mouse-toggle-hiding}) 1267Either hide or show the block you click on (@code{hs-mouse-toggle-hiding}).
1265@item C-c @@ C-M-h 1268@item C-c @@ C-M-h
1266Hide all top-level blocks (@code{hs-hide-all}). 1269Hide all top-level blocks (@code{hs-hide-all}).
1267@item C-c @@ C-M-s 1270@item C-c @@ C-M-s
@@ -1282,7 +1285,7 @@ Non-@code{nil} says that @kbd{hs-hide-all} should hide comments too.
1282 1285
1283@item hs-isearch-open 1286@item hs-isearch-open
1284Specifies what kind of hidden blocks to open in Isearch mode. 1287Specifies what kind of hidden blocks to open in Isearch mode.
1285The value should be one of these four symbols. 1288The value should be one of these four symbols:
1286 1289
1287@table @code 1290@table @code
1288@item code 1291@item code
@@ -1735,8 +1738,8 @@ click on @samp{[A]pply these settings} (or go to that buffer and type
1735@findex c-show-syntactic-information 1738@findex c-show-syntactic-information
1736@kindex C-c C-s @r{(C mode)} 1739@kindex C-c C-s @r{(C mode)}
1737Display the syntactic information about the current source line 1740Display the syntactic information about the current source line
1738(@code{c-show-syntactic-information}). This is the information that 1741(@code{c-show-syntactic-information}). This information directs how
1739directs how the line is indented. 1742the line is indented.
1740 1743
1741@item M-x cwarn-mode 1744@item M-x cwarn-mode
1742@itemx M-x global-cwarn-mode 1745@itemx M-x global-cwarn-mode
@@ -1958,16 +1961,15 @@ through 4. (Columns always count from 0 in GNU Emacs.)
1958 Line numbers of four digits or less are normally indented one space. 1961 Line numbers of four digits or less are normally indented one space.
1959The variable @code{fortran-line-number-indent} controls this; it 1962The variable @code{fortran-line-number-indent} controls this; it
1960specifies the maximum indentation a line number can have. Line numbers 1963specifies the maximum indentation a line number can have. Line numbers
1961are indented to right-justify them to end in column 4 unless that would 1964are right-justified to end in column 4 unless that would require more
1962require more than this maximum indentation. The default value of the 1965than this maximum indentation. The default value of the variable is 1.
1963variable is 1.
1964 1966
1965@vindex fortran-electric-line-number 1967@vindex fortran-electric-line-number
1966 Simply inserting a line number is enough to indent it according to 1968 Simply inserting a line number is enough to indent it according to
1967these rules. As each digit is inserted, the indentation is recomputed. 1969these rules. As each digit is inserted, the indentation is recomputed.
1968To turn off this feature, set the variable 1970To turn off this feature, set the variable
1969@code{fortran-electric-line-number} to @code{nil}. Then inserting line 1971@code{fortran-electric-line-number} to @code{nil}.
1970numbers is like inserting anything else. 1972
1971 1973
1972@node ForIndent Conv 1974@node ForIndent Conv
1973@subsubsection Syntactic Conventions 1975@subsubsection Syntactic Conventions
@@ -2064,7 +2066,7 @@ unless you have said in advance to do so. To do this, set the variable
2064 2066
2065@table @kbd 2067@table @kbd
2066@item M-; 2068@item M-;
2067Align comment or insert new comment (@code{fortran-comment-indent}). 2069Align comment or insert new comment (@code{fortran-indent-comment}).
2068 2070
2069@item C-x ; 2071@item C-x ;
2070Applies to nonstandard @samp{!} comments only. 2072Applies to nonstandard @samp{!} comments only.
@@ -2075,7 +2077,7 @@ into real code (@code{fortran-comment-region}).
2075@end table 2077@end table
2076 2078
2077 @kbd{M-;} in Fortran mode is redefined as the command 2079 @kbd{M-;} in Fortran mode is redefined as the command
2078@code{fortran-comment-indent}. Like the usual @kbd{M-;} command, this 2080@code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this
2079recognizes any kind of existing comment and aligns its text appropriately; 2081recognizes any kind of existing comment and aligns its text appropriately;
2080if there is no existing comment, a comment is inserted and aligned. But 2082if there is no existing comment, a comment is inserted and aligned. But
2081inserting and aligning comments are not the same in Fortran mode as in 2083inserting and aligning comments are not the same in Fortran mode as in
@@ -2111,7 +2113,7 @@ Align the text as if it were a line of code, but with an additional
2111@code{fortran-comment-line-extra-indent} columns of indentation. 2113@code{fortran-comment-line-extra-indent} columns of indentation.
2112 2114
2113@item nil 2115@item nil
2114Don't move text in full-line comments automatically at all. 2116Don't move text in full-line comments automatically.
2115@end table 2117@end table
2116 2118
2117@vindex fortran-comment-indent-char 2119@vindex fortran-comment-indent-char
@@ -2165,14 +2167,11 @@ splitting happens when you type @key{SPC}, @key{RET}, or @key{TAB}, and
2165also in the Fortran indentation commands. 2167also in the Fortran indentation commands.
2166 2168
2167@findex fortran-auto-fill-mode 2169@findex fortran-auto-fill-mode
2168 @kbd{M-x fortran-auto-fill-mode} turns Fortran Auto Fill mode on if it 2170 @kbd{M-x fortran-auto-fill-mode} toggles Fortran Auto Fill mode,
2169was off, or off if it was on. This command works the same as @kbd{M-x 2171which is a variant of normal Auto Fill mode (@pxref{Filling}) designed
2170auto-fill-mode} does for normal Auto Fill mode (@pxref{Filling}). A 2172for Fortran programs. Fortran Auto Fill mode is a buffer-local minor
2171positive numeric argument turns Fortran Auto Fill mode on, and a 2173mode (@pxref{Minor Modes}). When Fortran Auto Fill mode is in effect,
2172negative argument turns it off. You can see when Fortran Auto Fill mode 2174the word @samp{Fill} appears in the mode line inside the parentheses.
2173is in effect by the presence of the word @samp{Fill} in the mode line,
2174inside the parentheses. Fortran Auto Fill mode is a minor mode, turned
2175on or off for each buffer individually. @xref{Minor Modes}.
2176 2175
2177@vindex fortran-break-before-delimiters 2176@vindex fortran-break-before-delimiters
2178 Fortran Auto Fill mode breaks lines at spaces or delimiters when the 2177 Fortran Auto Fill mode breaks lines at spaces or delimiters when the
@@ -2183,8 +2182,7 @@ The line break comes after the delimiter if the variable
2183@code{fortran-break-before-delimiters} is @code{nil}. Otherwise (and by 2182@code{fortran-break-before-delimiters} is @code{nil}. Otherwise (and by
2184default), the break comes before the delimiter. 2183default), the break comes before the delimiter.
2185 2184
2186 By default, Fortran Auto Fill mode is not enabled. If you want this 2185 To enable this mode permanently, add a hook function to
2187feature turned on permanently, add a hook function to
2188@code{fortran-mode-hook} to execute @code{(fortran-auto-fill-mode 1)}. 2186@code{fortran-mode-hook} to execute @code{(fortran-auto-fill-mode 1)}.
2189@xref{Hooks}. 2187@xref{Hooks}.
2190 2188
@@ -2223,12 +2221,13 @@ Fortran.
2223 2221
2224@vindex fortran-column-ruler-fixed 2222@vindex fortran-column-ruler-fixed
2225@vindex fortran-column-ruler-tabs 2223@vindex fortran-column-ruler-tabs
2226 The text used to display the column ruler depends on the value of 2224 The text used to display the column ruler depends on the value of the
2227the variable @code{indent-tabs-mode}. If @code{indent-tabs-mode} is 2225variable @code{indent-tabs-mode}. If @code{indent-tabs-mode} is
2228@code{nil}, then the value of the variable 2226@code{nil}, then the value of the variable
2229@code{fortran-column-ruler-fixed} is used as the column ruler. 2227@code{fortran-column-ruler-fixed} is used as the column ruler.
2230Otherwise, the variable @code{fortran-column-ruler-tab} is displayed. 2228Otherwise, the value of the variable @code{fortran-column-ruler-tab} is
2231By changing these variables, you can change the column ruler display. 2229displayed. By changing these variables, you can change the column ruler
2230display.
2232 2231
2233@kindex C-c C-w @r{(Fortran mode)} 2232@kindex C-c C-w @r{(Fortran mode)}
2234@findex fortran-window-create-momentarily 2233@findex fortran-window-create-momentarily
diff --git a/man/reftex.texi b/man/reftex.texi
index 9ce77b35dc2..21090caf2ea 100644
--- a/man/reftex.texi
+++ b/man/reftex.texi
@@ -5,9 +5,17 @@
5@synindex ky cp 5@synindex ky cp
6@syncodeindex vr cp 6@syncodeindex vr cp
7@syncodeindex fn cp 7@syncodeindex fn cp
8@set VERSION 4.19 8
9@set EDITION 4.19 9@c Version and Contact Info
10@set DATE August 2002 10@set VERSION 4.24
11@set EDITION 4.24
12@set DATE August 2004
13@set AUCTEXSITE @uref{http://www.nongnu.org/auctex/,AUCTeX distribution site}
14@set MAINTAINERSITE @uref{http://www.astro.uva.nl/~dominik/Tools/,maintainers webpage}
15@set MAINTAINER Carsten Dominik
16@set MAINTAINEREMAIL @email{dominik@@science.uva.nl}
17@set MAINTAINERCONTACT @uref{mailto:dominik@@science.uva.nl,contact the maintainer}
18@set XEMACSFTP @uref{ftp://ftp.xemacs.org/pub/xemacs/packages/,XEmacs ftp site}.
11@c %**end of header 19@c %**end of header
12 20
13@copying 21@copying
@@ -15,7 +23,7 @@ This file documents @b{Ref@TeX{}}, a package to do labels, references,
15citations and indices for LaTeX documents with Emacs. 23citations and indices for LaTeX documents with Emacs.
16 24
17This is edition @value{EDITION} of the @b{Ref@TeX{}} User Manual for 25This is edition @value{EDITION} of the @b{Ref@TeX{}} User Manual for
18@b{Ref@TeX{}} @value{VERSION}. 26@b{Ref@TeX{}} @value{VERSION}
19 27
20Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. 28Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
21 29
@@ -73,13 +81,13 @@ license to the document, as described in section 6 of the license.
73@node Top,,,(dir) 81@node Top,,,(dir)
74 82
75@b{Ref@TeX{}} is a package for managing Labels, References, 83@b{Ref@TeX{}} is a package for managing Labels, References,
76Citations and index entries with GNU Emacs.@refill 84Citations and index entries with GNU Emacs.
77 85
78Don't be discouraged by the size of this manual, which covers 86Don't be discouraged by the size of this manual, which covers
79@b{Ref@TeX{}} in great depth. All you need to know to use 87@b{Ref@TeX{}} in great depth. All you need to know to use
80@b{Ref@TeX{}} can be summarized on two pages (@pxref{RefTeX in a 88@b{Ref@TeX{}} can be summarized on two pages (@pxref{RefTeX in a
81Nutshell}). You can go back later to other parts of this document when 89Nutshell}). You can go back later to other parts of this document when
82needed.@refill 90needed.
83 91
84@menu 92@menu
85* Introduction:: Quick-Start information. 93* Introduction:: Quick-Start information.
@@ -145,6 +153,7 @@ Citations
145* Citation Info:: View the corresponding database entry. 153* Citation Info:: View the corresponding database entry.
146* Chapterbib and Bibunits:: Multiple bibliographies in a Document. 154* Chapterbib and Bibunits:: Multiple bibliographies in a Document.
147* Citations Outside LaTeX:: How to make citations in Emails etc. 155* Citations Outside LaTeX:: How to make citations in Emails etc.
156* BibTeX Database Subsets:: Extract parts of a big database.
148 157
149Index Support 158Index Support
150 159
@@ -196,7 +205,7 @@ and @code{\index}. Using these macros usually requires looking up
196different parts of the document and searching through BibTeX database 205different parts of the document and searching through BibTeX database
197files. @b{Ref@TeX{}} automates these time--consuming tasks almost 206files. @b{Ref@TeX{}} automates these time--consuming tasks almost
198entirely. It also provides functions to display the structure of a 207entirely. It also provides functions to display the structure of a
199document and to move around in this structure quickly.@refill 208document and to move around in this structure quickly.
200 209
201@iftex 210@iftex
202Don't be discouraged by the size of this manual, which covers @b{Ref@TeX{}} 211Don't be discouraged by the size of this manual, which covers @b{Ref@TeX{}}
@@ -217,17 +226,15 @@ reports or suggestions.
217@section Installation 226@section Installation
218@cindex Installation 227@cindex Installation
219 228
220@b{Ref@TeX{}} is bundled and pre--installed with Emacs since version 20.2. 229@b{Ref@TeX{}} is bundled and pre--installed with Emacs since version
221It was also bundled and pre--installed with XEmacs 19.16--20.x. XEmacs 23020.2. It was also bundled and pre--installed with XEmacs 19.16--20.x.
22221.x users want to install the corresponding plug-in package which is 231XEmacs 21.x users want to install the corresponding plug-in package
223available from the 232which is available from the @value{XEMACSFTP}. See the XEmacs 21.x
224@uref{ftp://ftp.xemacs.org/pub/xemacs/packages/,XEmacs ftp site}. See 233documentation on package installation for details.
225the XEmacs 21.x documentation on package installation for
226details.@refill
227 234
228Users of earlier Emacs distributions (including Emacs 19) can get a copy 235Users of earlier Emacs distributions (including Emacs 19) can get a copy
229of the @b{Ref@TeX{}} distribution from the maintainers web-page. 236of the @b{Ref@TeX{}} distribution from the maintainers web-page.
230@xref{Imprint}, for more information.@refill 237@xref{Imprint}, for more information.
231 238
232@section Environment 239@section Environment
233@cindex Finding files 240@cindex Finding files
@@ -254,7 +261,7 @@ read @ref{Finding Files}.
254@vindex latex-mode-hook 261@vindex latex-mode-hook
255To turn @b{Ref@TeX{}} Mode on and off in a particular buffer, use 262To turn @b{Ref@TeX{}} Mode on and off in a particular buffer, use
256@kbd{M-x reftex-mode}. To turn on @b{Ref@TeX{}} Mode for all LaTeX 263@kbd{M-x reftex-mode}. To turn on @b{Ref@TeX{}} Mode for all LaTeX
257files, add the following lines to your @file{.emacs} file:@refill 264files, add the following lines to your @file{.emacs} file:
258 265
259@example 266@example
260(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode 267(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode
@@ -275,7 +282,7 @@ files, add the following lines to your @file{.emacs} file:@refill
275a table of contents of the document. This buffer can display sections, 282a table of contents of the document. This buffer can display sections,
276labels and index entries defined in the document. From the buffer, you 283labels and index entries defined in the document. From the buffer, you
277can jump quickly to every part of your document. Press @kbd{?} to get 284can jump quickly to every part of your document. Press @kbd{?} to get
278help.@refill 285help.
279 286
280@item 287@item
281@b{Labels and References}@* @b{Ref@TeX{}} helps to create unique labels 288@b{Labels and References}@* @b{Ref@TeX{}} helps to create unique labels
@@ -283,7 +290,7 @@ and to find the correct key for references quickly. It distinguishes
283labels for different environments, knows about all standard 290labels for different environments, knows about all standard
284environments (and many others), and can be configured to recognize any 291environments (and many others), and can be configured to recognize any
285additional labeled environments you have defined yourself (variable 292additional labeled environments you have defined yourself (variable
286@code{reftex-label-alist}).@refill 293@code{reftex-label-alist}).
287 294
288@itemize @bullet 295@itemize @bullet
289@item 296@item
@@ -297,18 +304,18 @@ derive a label from context (default for section labels)
297prompt for a label string (default for figures and tables) or 304prompt for a label string (default for figures and tables) or
298@item 305@item
299insert a simple label made of a prefix and a number (all other 306insert a simple label made of a prefix and a number (all other
300environments)@refill 307environments)
301@end itemize 308@end itemize
302@noindent 309@noindent
303Which labels are created how is configurable with the variable 310Which labels are created how is configurable with the variable
304@code{reftex-insert-label-flags}.@refill 311@code{reftex-insert-label-flags}.
305 312
306@item 313@item
307@b{Referencing Labels}@* To make a reference, type @kbd{C-c )} 314@b{Referencing Labels}@* To make a reference, type @kbd{C-c )}
308(@code{reftex-reference}). This shows an outline of the document with 315(@code{reftex-reference}). This shows an outline of the document with
309all labels of a certain type (figure, equation,...) and some label 316all labels of a certain type (figure, equation,...) and some label
310context. Selecting a label inserts a @code{\ref@{@var{label}@}} macro 317context. Selecting a label inserts a @code{\ref@{@var{label}@}} macro
311into the original buffer.@refill 318into the original buffer.
312@end itemize 319@end itemize
313 320
314@item 321@item
@@ -319,7 +326,7 @@ specified in the @code{\bibliography} command) and pull out a list of
319matches for you to choose from. The list is @emph{formatted} and 326matches for you to choose from. The list is @emph{formatted} and
320sorted. The selected article is referenced as @samp{\cite@{@var{key}@}} 327sorted. The selected article is referenced as @samp{\cite@{@var{key}@}}
321(see the variable @code{reftex-cite-format} if you want to insert 328(see the variable @code{reftex-cite-format} if you want to insert
322different macros).@refill 329different macros).
323 330
324@item 331@item
325@b{Index Support}@* 332@b{Index Support}@*
@@ -328,7 +335,7 @@ entries into an alphabetically sorted @file{*Index*} buffer which you
328can use to check and edit the entries. @b{Ref@TeX{}} knows about the 335can use to check and edit the entries. @b{Ref@TeX{}} knows about the
329standard index macros and can be configured to recognize any additional 336standard index macros and can be configured to recognize any additional
330macros you have defined (@code{reftex-index-macros}). Multiple indices 337macros you have defined (@code{reftex-index-macros}). Multiple indices
331are supported.@refill 338are supported.
332 339
333@itemize @bullet 340@itemize @bullet
334@item 341@item
@@ -337,20 +344,20 @@ To index the current selection or the word at point, type @kbd{C-c /}
337(@code{reftex-index-selection-or-word}). The default macro 344(@code{reftex-index-selection-or-word}). The default macro
338@code{reftex-index-default-macro} will be used. For a more complex entry 345@code{reftex-index-default-macro} will be used. For a more complex entry
339type @kbd{C-c <} (@code{reftex-index}), select any of the index macros 346type @kbd{C-c <} (@code{reftex-index}), select any of the index macros
340and enter the arguments with completion.@refill 347and enter the arguments with completion.
341 348
342@item 349@item
343@b{The Index Phrases File (Delayed Indexing)}@* 350@b{The Index Phrases File (Delayed Indexing)}@*
344Type @kbd{C-c \} (@code{reftex-index-phrase-selection-or-word}) to add 351Type @kbd{C-c \} (@code{reftex-index-phrase-selection-or-word}) to add
345the current word or selection to a special @emph{index phrase file}. 352the current word or selection to a special @emph{index phrase file}.
346@b{Ref@TeX{}} can later search the document for occurrences of these 353@b{Ref@TeX{}} can later search the document for occurrences of these
347phrases and let you interactively index the matches.@refill 354phrases and let you interactively index the matches.
348 355
349@item 356@item
350@b{Displaying and Editing the Index}@* 357@b{Displaying and Editing the Index}@*
351To display the compiled index in a special buffer, type @kbd{C-c >} 358To display the compiled index in a special buffer, type @kbd{C-c >}
352(@code{reftex-display-index}). From that buffer you can check and edit 359(@code{reftex-display-index}). From that buffer you can check and edit
353all entries.@refill 360all entries.
354@end itemize 361@end itemize
355 362
356@page 363@page
@@ -360,10 +367,10 @@ When point is on the @var{key} argument of a cross--referencing macro
360@code{\index}, and variations) or inside a BibTeX database entry, you 367@code{\index}, and variations) or inside a BibTeX database entry, you
361can press @kbd{C-c &} (@code{reftex-view-crossref}) to display 368can press @kbd{C-c &} (@code{reftex-view-crossref}) to display
362corresponding locations in the document and associated BibTeX database 369corresponding locations in the document and associated BibTeX database
363files.@refill @* 370files. @*
364When the enclosing macro is @code{\cite} or @code{\ref} and no other 371When the enclosing macro is @code{\cite} or @code{\ref} and no other
365message occupies the echo area, information about the citation or label 372message occupies the echo area, information about the citation or label
366will automatically be displayed in the echo area.@refill 373will automatically be displayed in the echo area.
367 374
368@item 375@item
369@b{Multifile Documents}@* 376@b{Multifile Documents}@*
@@ -371,7 +378,7 @@ Multifile Documents are fully supported. The included files must have a
371file variable @code{TeX-master} or @code{tex-main-file} pointing to the 378file variable @code{TeX-master} or @code{tex-main-file} pointing to the
372master file. @b{Ref@TeX{}} provides cross-referencing information from 379master file. @b{Ref@TeX{}} provides cross-referencing information from
373all parts of the document, and across document borders 380all parts of the document, and across document borders
374(@file{xr.sty}).@refill 381(@file{xr.sty}).
375 382
376@item 383@item
377@b{Document Parsing}@* @b{Ref@TeX{}} needs to parse the document in 384@b{Document Parsing}@* @b{Ref@TeX{}} needs to parse the document in
@@ -380,14 +387,14 @@ once and updates its list internally when @code{reftex-label} and
380@code{reftex-index} are used. To enforce reparsing, call any of the 387@code{reftex-index} are used. To enforce reparsing, call any of the
381commands described above with a raw @kbd{C-u} prefix, or press the 388commands described above with a raw @kbd{C-u} prefix, or press the
382@kbd{r} key in the label selection buffer, the table of contents 389@kbd{r} key in the label selection buffer, the table of contents
383buffer, or the index buffer.@refill 390buffer, or the index buffer.
384 391
385@item 392@item
386@b{AUCTeX} @* If your major LaTeX mode is AUCTeX, @b{Ref@TeX{}} can 393@b{AUCTeX} @* If your major LaTeX mode is AUCTeX, @b{Ref@TeX{}} can
387cooperate with it (see variable @code{reftex-plug-into-AUCTeX}). AUCTeX 394cooperate with it (see variable @code{reftex-plug-into-AUCTeX}). AUCTeX
388contains style files which trigger appropriate settings in 395contains style files which trigger appropriate settings in
389@b{Ref@TeX{}}, so that for many of the popular LaTeX packages no 396@b{Ref@TeX{}}, so that for many of the popular LaTeX packages no
390additional customizations will be necessary.@refill 397additional customizations will be necessary.
391 398
392@item 399@item
393@b{Useful Settings}@* 400@b{Useful Settings}@*
@@ -397,7 +404,7 @@ To integrate RefTeX with AUCTeX, use
397@end lisp 404@end lisp
398 405
399To make your own LaTeX macro definitions known to @b{Ref@TeX{}}, 406To make your own LaTeX macro definitions known to @b{Ref@TeX{}},
400customize the variables@refill 407customize the variables
401@example 408@example
402@code{reftex-label-alist} @r{(for label macros/environments)} 409@code{reftex-label-alist} @r{(for label macros/environments)}
403@code{reftex-section-levels} @r{(for sectioning commands)} 410@code{reftex-section-levels} @r{(for sectioning commands)}
@@ -407,7 +414,7 @@ customize the variables@refill
407@end example 414@end example
408If you have a large number of macros defined, you may want to write 415If you have a large number of macros defined, you may want to write
409an AUCTeX style file to support them with both AUCTeX and 416an AUCTeX style file to support them with both AUCTeX and
410@b{Ref@TeX{}}.@refill 417@b{Ref@TeX{}}.
411 418
412@item @b{Where Next?}@* Go ahead and use @b{Ref@TeX{}}. Use its menus 419@item @b{Where Next?}@* Go ahead and use @b{Ref@TeX{}}. Use its menus
413until you have picked up the key bindings. For an overview of what you 420until you have picked up the key bindings. For an overview of what you
@@ -415,12 +422,13 @@ can do in each of the different special buffers, press @kbd{?}. Read
415the manual if you get stuck, of if you are curious what else might be 422the manual if you get stuck, of if you are curious what else might be
416available. The first part of the manual explains in 423available. The first part of the manual explains in
417a tutorial way how to use and customize @b{Ref@TeX{}}. The second 424a tutorial way how to use and customize @b{Ref@TeX{}}. The second
418part is a command and variable reference.@refill 425part is a command and variable reference.
419@end enumerate 426@end enumerate
420 427
421@node Table of Contents, Labels and References, Introduction, Top 428@node Table of Contents, Labels and References, Introduction, Top
422@chapter Table of Contents 429@chapter Table of Contents
423@cindex @file{*toc*} buffer 430@cindex @file{*toc*} buffer
431@cindex Structure editing
424@cindex Table of contents buffer 432@cindex Table of contents buffer
425@findex reftex-toc 433@findex reftex-toc
426@kindex C-c = 434@kindex C-c =
@@ -429,16 +437,16 @@ Pressing the keys @kbd{C-c =} pops up a buffer showing the table of
429contents of the document. By default, this @file{*toc*} buffer shows 437contents of the document. By default, this @file{*toc*} buffer shows
430only the sections of a document. Using the @kbd{l} and @kbd{i} keys you 438only the sections of a document. Using the @kbd{l} and @kbd{i} keys you
431can display all labels and index entries defined in the document as 439can display all labels and index entries defined in the document as
432well.@refill 440well.
433 441
434With the cursor in any of the lines denoting a location in the 442With the cursor in any of the lines denoting a location in the
435document, simple key strokes will display the corresponding part in 443document, simple key strokes will display the corresponding part in
436another window, jump to that location, or perform other actions.@refill 444another window, jump to that location, or perform other actions.
437 445
438@kindex ? 446@kindex ?
439Here is a list of special commands in the @file{*toc*} buffer. A 447Here is a list of special commands in the @file{*toc*} buffer. A
440summary of this information is always available by pressing 448summary of this information is always available by pressing
441@kbd{?}.@refill 449@kbd{?}.
442 450
443@table @kbd 451@table @kbd
444 452
@@ -458,19 +466,19 @@ Goto previous entry in the table of context.
458 466
459@item C-c C-n 467@item C-c C-n
460Goto next section heading. Useful when many labels and index entries 468Goto next section heading. Useful when many labels and index entries
461separate section headings.@refill 469separate section headings.
462 470
463@item C-c C-p 471@item C-c C-p
464Goto previous section heading. 472Goto previous section heading.
465 473
466@item N z 474@item N z
467Jump to section N, using the prefix arg. For example, @kbd{3 z} jumps 475Jump to section N, using the prefix arg. For example, @kbd{3 z} jumps
468to section 3.@refill 476to section 3.
469 477
470@tablesubheading{Access to document locations} 478@tablesubheading{Access to document locations}
471@item @key{SPC} 479@item @key{SPC}
472Show the corresponding location in another window. This command does 480Show the corresponding location in another window. This command does
473@emph{not} select that other window.@refill 481@emph{not} select that other window.
474 482
475@item @key{TAB} 483@item @key{TAB}
476Goto the location in another window. 484Goto the location in another window.
@@ -478,13 +486,13 @@ Goto the location in another window.
478@item @key{RET} 486@item @key{RET}
479Go to the location and hide the @file{*toc*} buffer. This will restore 487Go to the location and hide the @file{*toc*} buffer. This will restore
480the window configuration before @code{reftex-toc} (@kbd{C-c =}) was 488the window configuration before @code{reftex-toc} (@kbd{C-c =}) was
481called.@refill 489called.
482 490
483@item mouse-2 491@item mouse-2
484@vindex reftex-highlight-selection 492@vindex reftex-highlight-selection
485Clicking with mouse button 2 on a line has the same effect as @key{RET}. 493Clicking with mouse button 2 on a line has the same effect as @key{RET}.
486See also variable @code{reftex-highlight-selection}, @ref{Options 494See also variable @code{reftex-highlight-selection}, @ref{Options
487(Fontification)}.@refill 495(Fontification)}.
488 496
489@item f 497@item f
490@vindex reftex-toc-follow-mode 498@vindex reftex-toc-follow-mode
@@ -496,21 +504,47 @@ cursor motion. The default for this flag can be set with the variable
496@code{reftex-toc-follow-mode}. Note that only context in files already 504@code{reftex-toc-follow-mode}. Note that only context in files already
497visited is shown. @b{Ref@TeX{}} will not visit a file just for follow 505visited is shown. @b{Ref@TeX{}} will not visit a file just for follow
498mode. See, however, the variable 506mode. See, however, the variable
499@code{reftex-revisit-to-follow}.@refill 507@code{reftex-revisit-to-follow}.
500 508
501@item . 509@item .
502Show calling point in another window. This is the point from where 510Show calling point in another window. This is the point from where
503@code{reftex-toc} was last called. 511@code{reftex-toc} was last called.
504 512
505@page 513@page
514@tablesubheading{Promotion and Demotion}
515
516@item <
517Promote the current section. This will convert @code{\section} to
518@code{\chapter}, @code{\subsection} to @code{\section} etc. If there is
519an active region, all sections in the region will be promoted, including
520the one at point. To avoid mistakes, @b{Ref@TeX{}} requires a fresh
521document scan before executing this command - if necessary, it will
522automatically do this scan and ask the user to repeat the promotion
523command.
524
525@item >
526Demote the current section. This is the opposite of promotion. It will
527convert @code{\chapter} to @code{\section} etc. If there is an active
528region, all sections in the region will be demoted, including the one at
529point.
530
531@item M-%
532Rename the label at point. While generally not recommended, this can be
533useful when a package like @file{fancyref} is used where the label
534prefix determines the wording of a reference. After a
535promotion/demotion it may be necessary to change a few labels from
536@samp{sec:xyz} to @samp{cha:xyz} or vice versa. This command can be
537used to do this - it launches a query replace to rename the definition
538and all references of a label.
539
506@tablesubheading{Exiting} 540@tablesubheading{Exiting}
507@item q 541@item q
508Hide the @file{*toc*} buffer, return to the position where 542Hide the @file{*toc*} buffer, return to the position where
509@code{reftex-toc} was last called.@refill 543@code{reftex-toc} was last called.
510 544
511@item k 545@item k
512Kill the @file{*toc*} buffer, return to the position where 546Kill the @file{*toc*} buffer, return to the position where
513@code{reftex-toc} was last called.@refill 547@code{reftex-toc} was last called.
514 548
515@item C-c > 549@item C-c >
516Switch to the @file{*Index*} buffer of this document. With prefix 550Switch to the @file{*Index*} buffer of this document. With prefix
@@ -527,13 +561,13 @@ arg (e.g @kbd{3 t}), ignore all toc entries with level greater than
527@var{arg} (3 in this case). Chapters are level 1, sections are level 2. 561@var{arg} (3 in this case). Chapters are level 1, sections are level 2.
528The mode line @samp{T<>} indicator shows the current value. The default 562The mode line @samp{T<>} indicator shows the current value. The default
529depth can be configured with the variable 563depth can be configured with the variable
530@code{reftex-toc-max-level}.@refill 564@code{reftex-toc-max-level}.
531 565
532@item F 566@item F
533@vindex reftex-toc-include-file-boundaries 567@vindex reftex-toc-include-file-boundaries
534Toggle the display of the file borders of a multifile document in the 568Toggle the display of the file borders of a multifile document in the
535@file{*toc*} buffer. The default for this flag can be set with the 569@file{*toc*} buffer. The default for this flag can be set with the
536variable @code{reftex-toc-include-file-boundaries}.@refill 570variable @code{reftex-toc-include-file-boundaries}.
537 571
538@item l 572@item l
539@vindex reftex-toc-include-labels 573@vindex reftex-toc-include-labels
@@ -542,7 +576,7 @@ for this flag can be set with the variable
542@code{reftex-toc-include-labels}. When called with a prefix argument, 576@code{reftex-toc-include-labels}. When called with a prefix argument,
543@b{Ref@TeX{}} will prompt for a label type and include only labels of 577@b{Ref@TeX{}} will prompt for a label type and include only labels of
544the selected type in the @file{*toc*} buffer. The mode line @samp{L<>} 578the selected type in the @file{*toc*} buffer. The mode line @samp{L<>}
545indicator shows which labels are included.@refill 579indicator shows which labels are included.
546 580
547@item i 581@item i
548@vindex reftex-toc-include-index-entries 582@vindex reftex-toc-include-index-entries
@@ -551,47 +585,57 @@ default for this flag can be set with the variable
551@code{reftex-toc-include-index-entries}. When called with a prefix 585@code{reftex-toc-include-index-entries}. When called with a prefix
552argument, @b{Ref@TeX{}} will prompt for a specific index and include 586argument, @b{Ref@TeX{}} will prompt for a specific index and include
553only entries in the selected index in the @file{*toc*} buffer. The mode 587only entries in the selected index in the @file{*toc*} buffer. The mode
554line @samp{I<>} indicator shows which index is used.@refill 588line @samp{I<>} indicator shows which index is used.
555 589
556@item c 590@item c
557@vindex reftex-toc-include-context 591@vindex reftex-toc-include-context
558Toggle the display of label and index context in the @file{*toc*} 592Toggle the display of label and index context in the @file{*toc*}
559buffer. The default for this flag can be set with the variable 593buffer. The default for this flag can be set with the variable
560@code{reftex-toc-include-context}.@refill 594@code{reftex-toc-include-context}.
561 595
562@tablesubheading{Updating the buffer} 596@tablesubheading{Updating the buffer}
563 597
564@item g 598@item g
565Rebuild the @file{*toc*} buffer. This does @emph{not} rescan the 599Rebuild the @file{*toc*} buffer. This does @emph{not} rescan the
566document.@refill 600document.
567 601
568@item r 602@item r
569@vindex reftex-enable-partial-scans 603@vindex reftex-enable-partial-scans
570Reparse the LaTeX document and rebuild the @file{*toc*} buffer. When 604Reparse the LaTeX document and rebuild the @file{*toc*} buffer. When
571@code{reftex-enable-partial-scans} is non-@code{nil}, rescan only the file this 605@code{reftex-enable-partial-scans} is non-@code{nil}, rescan only the file this
572location is defined in, not the entire document.@refill 606location is defined in, not the entire document.
573 607
574@item C-u r 608@item C-u r
575Reparse the @emph{entire} LaTeX document and rebuild the @file{*toc*} 609Reparse the @emph{entire} LaTeX document and rebuild the @file{*toc*}
576buffer.@refill 610buffer.
577 611
578@item x 612@item x
579Switch to the @file{*toc*} buffer of an external document. When the 613Switch to the @file{*toc*} buffer of an external document. When the
580current document is using the @code{xr} package (@pxref{xr (LaTeX 614current document is using the @code{xr} package (@pxref{xr (LaTeX
581package)}), @b{Ref@TeX{}} will switch to one of the external 615package)}), @b{Ref@TeX{}} will switch to one of the external
582documents.@refill 616documents.
617
618
619@tablesubheading{Automatic recentering}
620
621@item d
622Toggle the display of a dedicated frame displaying just the @file{*toc*}
623buffer. Follow mode and visiting locations will not work that frame,
624but automatic recentering will make this frame always show your current
625editing location in the document (see below).
583 626
584@item a 627@item a
585Toggle the automatic recentering of the @file{*toc*} buffer. When this 628Toggle the automatic recentering of the @file{*toc*} buffer. When this
586option is on, moving around in the document will cause the @file{*toc*} 629option is on, moving around in the document will cause the @file{*toc*}
587to always highlight the current section. This can be enabled by default 630to always highlight the current section. By default, this option is
588with the variable @code{reftex-auto-recenter-toc}. 631active while the dedicated @file{*TOC*} frame exists. See also the
632variable @code{reftex-auto-recenter-toc}.
589 633
590@end table 634@end table
591 635
592@vindex reftex-toc-map 636@vindex reftex-toc-map
593In order to define additional commands for the @file{*toc*} buffer, the 637In order to define additional commands for the @file{*toc*} buffer, the
594keymap @code{reftex-toc-map} may be used.@refill 638keymap @code{reftex-toc-map} may be used.
595 639
596@findex reftex-toc-recenter 640@findex reftex-toc-recenter
597@vindex reftex-auto-recenter-toc 641@vindex reftex-auto-recenter-toc
@@ -605,13 +649,15 @@ section from which @code{reftex-toc} was called will be highlighted.
605The command @kbd{C-c -} (@code{reftex-toc-recenter}) will only redisplay 649The command @kbd{C-c -} (@code{reftex-toc-recenter}) will only redisplay
606the @file{*toc*} buffer and highlight the correct line without actually 650the @file{*toc*} buffer and highlight the correct line without actually
607selecting the @file{*toc*} window. This can be useful to quickly find 651selecting the @file{*toc*} window. This can be useful to quickly find
608out where in the document you currently are. If you want the TOC buffer 652out where in the document you currently are. You can also automate this
609to show the current section automatically whenever you stop typing, try 653by asking RefTeX to keep track of your current editing position in the
654TOC. The TOC window will then be updated whenever you stop typing for
655more than @code{reftex-idle-time} seconds. By default this works only
656with the dedicated @file{*TOC*} frame. But you can also force automatic
657recentering of the TOC window on the current frame with
610@lisp 658@lisp
611(setq reftex-auto-recenter-toc t) 659(setq reftex-auto-recenter-toc t)
612@end lisp 660@end lisp
613When this is turned on, the toc buffer will be recentered whenever Emacs
614is idle for more than @code{reftex-idle-time} seconds.
615 661
616 662
617@cindex Sectioning commands 663@cindex Sectioning commands
@@ -641,17 +687,17 @@ document. When writing a document, any part of it can be marked with a
641label, like @samp{\label@{mark@}}. LaTeX records the current value of a 687label, like @samp{\label@{mark@}}. LaTeX records the current value of a
642certain counter when a label is defined. Later references to this label 688certain counter when a label is defined. Later references to this label
643(like @samp{\ref@{mark@}}) will produce the recorded value of the 689(like @samp{\ref@{mark@}}) will produce the recorded value of the
644counter.@refill 690counter.
645 691
646Labels can be used to mark sections, figures, tables, equations, 692Labels can be used to mark sections, figures, tables, equations,
647footnotes, items in enumerate lists etc. LaTeX is context sensitive in 693footnotes, items in enumerate lists etc. LaTeX is context sensitive in
648doing this: A label defined in a figure environment automatically 694doing this: A label defined in a figure environment automatically
649records the figure counter, not the section counter.@refill 695records the figure counter, not the section counter.
650 696
651Several different environments can share a common counter and therefore 697Several different environments can share a common counter and therefore
652a common label category. E.g. labels in both @code{equation} and 698a common label category. E.g. labels in both @code{equation} and
653@code{eqnarray} environments record the value of the same counter - the 699@code{eqnarray} environments record the value of the same counter - the
654equation counter.@refill 700equation counter.
655 701
656@menu 702@menu
657* Creating Labels:: 703* Creating Labels::
@@ -677,7 +723,7 @@ In order to create a label in a LaTeX document, press @kbd{C-c (}
677and will figure out the environment it currently is in and adapt the 723and will figure out the environment it currently is in and adapt the
678label to that environment. A label usually consists of a short prefix 724label to that environment. A label usually consists of a short prefix
679indicating the type of the label and a unique mark. @b{Ref@TeX{}} has 725indicating the type of the label and a unique mark. @b{Ref@TeX{}} has
6803 different modes to create this mark.@refill 7263 different modes to create this mark.
681 727
682@enumerate 728@enumerate
683@item 729@item
@@ -698,7 +744,7 @@ change things: @code{reftex-translate-to-ascii-function},
698where the section heading is used to construct a label. In fact, 744where the section heading is used to construct a label. In fact,
699@b{Ref@TeX{}}'s default settings use this method only for section 745@b{Ref@TeX{}}'s default settings use this method only for section
700labels. You will be asked to confirm the derived label, or edit 746labels. You will be asked to confirm the derived label, or edit
701it.@refill 747it.
702 748
703@item 749@item
704We may also use a simple unique number to identify a label. This is 750We may also use a simple unique number to identify a label. This is
@@ -709,7 +755,7 @@ tends to write documents with many equations and finds it impossible
709to come up with good names for each of them. These simple labels are 755to come up with good names for each of them. These simple labels are
710inserted without query, and are therefore very fast. Good descriptive 756inserted without query, and are therefore very fast. Good descriptive
711names are not really necessary as @b{Ref@TeX{}} will provide context to 757names are not really necessary as @b{Ref@TeX{}} will provide context to
712reference a label (@pxref{Referencing Labels}).@refill 758reference a label (@pxref{Referencing Labels}).
713 759
714@item 760@item
715The third method is to ask the user for a label. This is most 761The third method is to ask the user for a label. This is most
@@ -719,13 +765,13 @@ tables. Of course, one can enter the label directly by typing the full
719@samp{\label@{mark@}}. The advantage of using @code{reftex-label} 765@samp{\label@{mark@}}. The advantage of using @code{reftex-label}
720anyway is that @b{Ref@TeX{}} will know that a new label has been defined. 766anyway is that @b{Ref@TeX{}} will know that a new label has been defined.
721It will then not be necessary to rescan the document in order to access 767It will then not be necessary to rescan the document in order to access
722this label later.@refill 768this label later.
723@end enumerate 769@end enumerate
724 770
725@vindex reftex-insert-label-flags 771@vindex reftex-insert-label-flags
726If you want to change the way certain labels are created, check out the 772If you want to change the way certain labels are created, check out the
727variable @code{reftex-insert-label-flags} (@pxref{Options (Creating 773variable @code{reftex-insert-label-flags} (@pxref{Options (Creating
728Labels)}).@refill 774Labels)}).
729 775
730If you are using AUCTeX to write your LaTeX documents, you can 776If you are using AUCTeX to write your LaTeX documents, you can
731set it up to delegate the creation of labels to 777set it up to delegate the creation of labels to
@@ -741,16 +787,25 @@ set it up to delegate the creation of labels to
741@kindex C-c ) 787@kindex C-c )
742@findex reftex-reference 788@findex reftex-reference
743 789
790@vindex reftex-trust-label-prefix
791@b{Ref@TeX{}} scans the document in order to find all labels. To make
792referencing labels easier, it assigns to each label a category, the
793@emph{label type} (for example section, table, figure, equation, etc.).
794In order to determine the label type, RefTeX parses around each label
795to see in what kind of environments it is located. You can speed up
796the parsing by using type-specific prefixes for labels and configuring
797the variable @code{reftex-trust-label-prefix}.
798
744Referencing Labels is really at the heart of @b{Ref@TeX{}}. Press @kbd{C-c 799Referencing Labels is really at the heart of @b{Ref@TeX{}}. Press @kbd{C-c
745)} in order to reference a label (reftex-reference). This will start a 800)} in order to reference a label (reftex-reference). This will start a
746selection process and finally insert the complete @samp{\ref@{label@}} 801selection process and finally insert the complete @samp{\ref@{label@}}
747into the buffer.@refill 802into the buffer.
748 803
749First, @b{Ref@TeX{}} will determine the label category which is required. 804First, @b{Ref@TeX{}} will determine the label category which is required.
750Often that can be figured out from context. For example, if you 805Often that can be figured out from context. For example, if you
751write @samp{As shown in eq.} and the press @kbd{C-c )}, @b{Ref@TeX{}} knows 806write @samp{As shown in eq.} and the press @kbd{C-c )}, @b{Ref@TeX{}} knows
752that an equation label is going to be referenced. If it cannot figure 807that an equation label is going to be referenced. If it cannot figure
753out what label category is needed, it will query for one.@refill 808out what label category is needed, it will query for one.
754 809
755You will then be presented with a label selection menu. This is a 810You will then be presented with a label selection menu. This is a
756special buffer which contains an outline of the document along with all 811special buffer which contains an outline of the document along with all
@@ -759,7 +814,7 @@ there will be one line of context of the label definition, which is some
759text in the buffer near the label definition. Usually this is 814text in the buffer near the label definition. Usually this is
760sufficient to identify the label. If you are unsure about a certain 815sufficient to identify the label. If you are unsure about a certain
761label, pressing @key{SPC} will show the label definition point in 816label, pressing @key{SPC} will show the label definition point in
762another window.@refill 817another window.
763 818
764In order to reference a label, move to cursor to the correct label and 819In order to reference a label, move to cursor to the correct label and
765press @key{RET}. You can also reference several labels with a single 820press @key{RET}. You can also reference several labels with a single
@@ -769,7 +824,7 @@ key (see below).
769@kindex ? 824@kindex ?
770Here is a list of special commands in the selection buffer. A summary 825Here is a list of special commands in the selection buffer. A summary
771of this information is always available from the selection process by 826of this information is always available from the selection process by
772pressing @kbd{?}.@refill 827pressing @kbd{?}.
773 828
774 829
775 830
@@ -790,7 +845,7 @@ Go to previous label.
790 845
791@item b 846@item b
792Jump back to the position where you last left the selection buffer. 847Jump back to the position where you last left the selection buffer.
793Normally this should get you back to the last referenced label.@refill 848Normally this should get you back to the last referenced label.
794 849
795@item C-c C-n 850@item C-c C-n
796Goto next section heading. 851Goto next section heading.
@@ -800,12 +855,12 @@ Goto previous section heading.
800 855
801@item N z 856@item N z
802Jump to section N, using the prefix arg. For example @kbd{3 z} jumps to 857Jump to section N, using the prefix arg. For example @kbd{3 z} jumps to
803section 3.@refill 858section 3.
804 859
805@tablesubheading{Displaying Context} 860@tablesubheading{Displaying Context}
806@item @key{SPC} 861@item @key{SPC}
807Show the surroundings of the definition of the current label in another 862Show the surroundings of the definition of the current label in another
808window. See also the @kbd{f} key.@refill 863window. See also the @kbd{f} key.
809 864
810@item f 865@item f
811@vindex reftex-revisit-to-follow 866@vindex reftex-revisit-to-follow
@@ -814,23 +869,23 @@ always display the full context of the current label. This is similar
814to pressing @key{SPC} after each cursor motion. Note that only context 869to pressing @key{SPC} after each cursor motion. Note that only context
815in files already visited is shown. @b{RefTeX} will not visit a file 870in files already visited is shown. @b{RefTeX} will not visit a file
816just for follow mode. See, however, the variable 871just for follow mode. See, however, the variable
817@code{reftex-revisit-to-follow}.@refill 872@code{reftex-revisit-to-follow}.
818 873
819@item . 874@item .
820Show insertion point in another window. This is the point from where you 875Show insertion point in another window. This is the point from where you
821called @code{reftex-reference}.@refill 876called @code{reftex-reference}.
822 877
823@tablesubheading{Selecting a label and creating the reference} 878@tablesubheading{Selecting a label and creating the reference}
824@item @key{RET} 879@item @key{RET}
825Insert a reference to the label at point into the buffer from which the 880Insert a reference to the label at point into the buffer from which the
826selection process was started. When entries have been marked, @key{RET} 881selection process was started. When entries have been marked, @key{RET}
827references all marked labels.@refill 882references all marked labels.
828 883
829@item mouse-2 884@item mouse-2
830@vindex reftex-highlight-selection 885@vindex reftex-highlight-selection
831Clicking with mouse button 2 on a label will accept it like @key{RET} 886Clicking with mouse button 2 on a label will accept it like @key{RET}
832would. See also variable @code{reftex-highlight-selection}, @ref{Options 887would. See also variable @code{reftex-highlight-selection}, @ref{Options
833(Misc)}.@refill 888(Misc)}.
834 889
835@vindex reftex-multiref-punctuation 890@vindex reftex-multiref-punctuation
836@item m - + , 891@item m - + ,
@@ -853,11 +908,11 @@ Unmark a marked entry.
853@item a 908@item a
854Accept the marked entries and put all labels as a comma-separated list 909Accept the marked entries and put all labels as a comma-separated list
855into one @emph{single} @code{\ref} macro. Some packages like 910into one @emph{single} @code{\ref} macro. Some packages like
856@file{saferef.sty} support multiple references in this way.@refill 911@file{saferef.sty} support multiple references in this way.
857 912
858@item l 913@item l
859Use the last referenced label(s) again. This is equivalent to moving to 914Use the last referenced label(s) again. This is equivalent to moving to
860that label and pressing @key{RET}.@refill 915that label and pressing @key{RET}.
861 916
862@item @key{TAB} 917@item @key{TAB}
863Enter a label with completion. This may also be a label which does not 918Enter a label with completion. This may also be a label which does not
@@ -871,7 +926,7 @@ Toggle between @code{\ref} and @code{\vref} macro for references. The
871@code{\vref} macro is defined in the @code{varioref} LaTeX package. 926@code{\vref} macro is defined in the @code{varioref} LaTeX package.
872With this key you can force @b{Ref@TeX{}} to insert a @code{\vref} 927With this key you can force @b{Ref@TeX{}} to insert a @code{\vref}
873macro. The current state of this flag is displayed by the @samp{S<>} 928macro. The current state of this flag is displayed by the @samp{S<>}
874indicator in the mode line of the selection buffer.@refill 929indicator in the mode line of the selection buffer.
875 930
876@item V 931@item V
877@cindex @code{fancyref}, LaTeX package 932@cindex @code{fancyref}, LaTeX package
@@ -889,7 +944,7 @@ selection buffer.
889 944
890@item q 945@item q
891Exit the selection process without inserting any reference into the 946Exit the selection process without inserting any reference into the
892buffer.@refill 947buffer.
893 948
894@tablesubheading{Controlling what gets displayed} 949@tablesubheading{Controlling what gets displayed}
895@vindex reftex-label-menu-flags 950@vindex reftex-label-menu-flags
@@ -898,30 +953,30 @@ The defaults for the following flags can be configured with the variable
898 953
899@item c 954@item c
900Toggle the display of the one-line label definition context in the 955Toggle the display of the one-line label definition context in the
901selection buffer.@refill 956selection buffer.
902 957
903@item F 958@item F
904Toggle the display of the file borders of a multifile document in the 959Toggle the display of the file borders of a multifile document in the
905selection buffer.@refill 960selection buffer.
906 961
907@item t 962@item t
908Toggle the display of the table of contents in the selection buffer. 963Toggle the display of the table of contents in the selection buffer.
909With prefix @var{arg}, change the maximum level of toc entries displayed 964With prefix @var{arg}, change the maximum level of toc entries displayed
910to @var{arg}. Chapters are level 1, section are level 2.@refill 965to @var{arg}. Chapters are level 1, section are level 2.
911 966
912@item # 967@item #
913Toggle the display of a label counter in the selection buffer.@refill 968Toggle the display of a label counter in the selection buffer.
914 969
915@item % 970@item %
916Toggle the display of labels hidden in comments in the selection 971Toggle the display of labels hidden in comments in the selection
917buffers. Sometimes, you may have commented out parts of your document. 972buffers. Sometimes, you may have commented out parts of your document.
918If these parts contain label definitions, @b{Ref@TeX{}} can still display 973If these parts contain label definitions, @b{Ref@TeX{}} can still display
919and reference these labels.@refill 974and reference these labels.
920 975
921@tablesubheading{Updating the buffer} 976@tablesubheading{Updating the buffer}
922@item g 977@item g
923Update the menu. This will rebuilt the menu from the internal label 978Update the menu. This will rebuilt the menu from the internal label
924list, but not reparse the document (see @kbd{r}).@refill 979list, but not reparse the document (see @kbd{r}).
925 980
926@item r 981@item r
927@vindex reftex-enable-partial-scans 982@vindex reftex-enable-partial-scans
@@ -929,27 +984,27 @@ Reparse the document to update the information on all labels and rebuild
929the menu. If the variable @code{reftex-enable-partial-scans} is 984the menu. If the variable @code{reftex-enable-partial-scans} is
930non-@code{nil} and your document is a multifile document, this will 985non-@code{nil} and your document is a multifile document, this will
931reparse only a part of the document (the file in which the label at 986reparse only a part of the document (the file in which the label at
932point was defined).@refill 987point was defined).
933 988
934@item C-u r 989@item C-u r
935Reparse the @emph{entire} document. 990Reparse the @emph{entire} document.
936 991
937@item s 992@item s
938Switch the label category. After prompting for another label category, 993Switch the label category. After prompting for another label category,
939a menu for that category will be shown.@refill 994a menu for that category will be shown.
940 995
941@item x 996@item x
942Reference a label from an external document. With the LaTeX package 997Reference a label from an external document. With the LaTeX package
943@code{xr} it is possible to reference labels defined in another 998@code{xr} it is possible to reference labels defined in another
944document. This key will switch to the label menu of an external 999document. This key will switch to the label menu of an external
945document and let you select a label from there (@pxref{xr (LaTeX 1000document and let you select a label from there (@pxref{xr (LaTeX
946package),,xr}).@refill 1001package),,xr}).
947 1002
948@end table 1003@end table
949 1004
950@vindex reftex-select-label-map 1005@vindex reftex-select-label-map
951In order to define additional commands for the selection process, the 1006In order to define additional commands for the selection process, the
952keymap @code{reftex-select-label-map} may be used.@refill 1007keymap @code{reftex-select-label-map} may be used.
953 1008
954@node Builtin Label Environments, Defining Label Environments, Referencing Labels, Labels and References 1009@node Builtin Label Environments, Defining Label Environments, Referencing Labels, Labels and References
955@section Builtin Label Environments 1010@section Builtin Label Environments
@@ -963,7 +1018,7 @@ keymap @code{reftex-select-label-map} may be used.@refill
963with a label (i.e. which carry their own counters). By default, @b{Ref@TeX{}} 1018with a label (i.e. which carry their own counters). By default, @b{Ref@TeX{}}
964recognizes all labeled environments and macros discussed in @cite{The 1019recognizes all labeled environments and macros discussed in @cite{The
965LaTeX Companion by Goossens, Mittelbach & Samarin, Addison-Wesley 1020LaTeX Companion by Goossens, Mittelbach & Samarin, Addison-Wesley
9661994.}. These are:@refill 10211994.}. These are:
967 1022
968@itemize @minus 1023@itemize @minus
969@item 1024@item
@@ -979,7 +1034,7 @@ LaTeX Companion by Goossens, Mittelbach & Samarin, Addison-Wesley
979@cindex LaTeX core 1034@cindex LaTeX core
980@code{figure}, @code{figure*}, @code{table}, @code{table*}, @code{equation}, 1035@code{figure}, @code{figure*}, @code{table}, @code{table*}, @code{equation},
981@code{eqnarray}, @code{enumerate}, the @code{\footnote} macro (this is 1036@code{eqnarray}, @code{enumerate}, the @code{\footnote} macro (this is
982the LaTeX core stuff)@refill 1037the LaTeX core stuff)
983@item 1038@item
984@cindex AMS-LaTeX 1039@cindex AMS-LaTeX
985@cindex @code{amsmath}, LaTeX package 1040@cindex @code{amsmath}, LaTeX package
@@ -994,7 +1049,7 @@ the LaTeX core stuff)@refill
994@cindex @code{subequations}, AMS-LaTeX environment 1049@cindex @code{subequations}, AMS-LaTeX environment
995@code{align}, @code{gather}, @code{multline}, @code{flalign}, 1050@code{align}, @code{gather}, @code{multline}, @code{flalign},
996@code{alignat}, @code{xalignat}, @code{xxalignat}, @code{subequations} 1051@code{alignat}, @code{xalignat}, @code{xxalignat}, @code{subequations}
997(from AMS-LaTeX's @file{amsmath.sty} package)@refill 1052(from AMS-LaTeX's @file{amsmath.sty} package)
998@item 1053@item
999@cindex @code{endnote}, LaTeX package 1054@cindex @code{endnote}, LaTeX package
1000@cindex LaTeX packages, @code{endnote} 1055@cindex LaTeX packages, @code{endnote}
@@ -1039,7 +1094,7 @@ the @code{\endnote} macro (from @file{endnotes.sty})
1039@cindex @code{subfigure}, LaTeX environment 1094@cindex @code{subfigure}, LaTeX environment
1040@cindex @code{subfigure*}, LaTeX environment 1095@cindex @code{subfigure*}, LaTeX environment
1041@code{subfigure}, @code{subfigure*}, the @code{\subfigure} macro 1096@code{subfigure}, @code{subfigure*}, the @code{\subfigure} macro
1042(@file{subfigure.sty})@refill 1097(@file{subfigure.sty})
1043@item 1098@item
1044@cindex @code{supertab}, LaTeX package 1099@cindex @code{supertab}, LaTeX package
1045@cindex LaTeX packages, @code{supertab} 1100@cindex LaTeX packages, @code{supertab}
@@ -1054,7 +1109,7 @@ the @code{\endnote} macro (from @file{endnotes.sty})
1054 1109
1055If you want to use other labeled environments, defined with 1110If you want to use other labeled environments, defined with
1056@code{\newtheorem}, @b{Ref@TeX{}} needs to be configured to recognize 1111@code{\newtheorem}, @b{Ref@TeX{}} needs to be configured to recognize
1057them (@pxref{Defining Label Environments}).@refill 1112them (@pxref{Defining Label Environments}).
1058 1113
1059@node Defining Label Environments, Reference Info, Builtin Label Environments, Labels and References 1114@node Defining Label Environments, Reference Info, Builtin Label Environments, Labels and References
1060@section Defining Label Environments 1115@section Defining Label Environments
@@ -1077,7 +1132,7 @@ Here we will discuss a few examples, in order to make things clearer.
1077It can also be instructive to look at the constant 1132It can also be instructive to look at the constant
1078@code{reftex-label-alist-builtin} which contains the entries for 1133@code{reftex-label-alist-builtin} which contains the entries for
1079all the builtin environments and macros (@pxref{Builtin Label 1134all the builtin environments and macros (@pxref{Builtin Label
1080Environments}).@refill 1135Environments}).
1081 1136
1082@menu 1137@menu
1083* Theorem and Axiom:: Defined with @code{\newenvironment}. 1138* Theorem and Axiom:: Defined with @code{\newenvironment}.
@@ -1096,7 +1151,7 @@ Environments}).@refill
1096@cindex @code{\newtheorem} 1151@cindex @code{\newtheorem}
1097 1152
1098Suppose you are using @code{\newtheorem} in LaTeX in order to define two 1153Suppose you are using @code{\newtheorem} in LaTeX in order to define two
1099new environments, @code{theorem} and @code{axiom}@refill 1154new environments, @code{theorem} and @code{axiom}
1100 1155
1101@example 1156@example
1102\newtheorem@{axiom@}@{Axiom@} 1157\newtheorem@{axiom@}@{Axiom@}
@@ -1128,7 +1183,7 @@ The type indicator characters @code{?a} and @code{?h} are used for
1128prompts when @b{Ref@TeX{}} queries for a label type. @code{?h} 1183prompts when @b{Ref@TeX{}} queries for a label type. @code{?h}
1129was chosen for @code{theorem} since @code{?t} is already taken by 1184was chosen for @code{theorem} since @code{?t} is already taken by
1130@code{table}. Note that also @code{?s}, @code{?f}, @code{?e}, 1185@code{table}. Note that also @code{?s}, @code{?f}, @code{?e},
1131@code{?i}, @code{?n} are already used for standard environments.@refill 1186@code{?i}, @code{?n} are already used for standard environments.
1132 1187
1133@noindent 1188@noindent
1134The labels for Axioms and Theorems will have the prefixes @samp{ax:} and 1189The labels for Axioms and Theorems will have the prefixes @samp{ax:} and
@@ -1149,28 +1204,28 @@ labels for the new environments.
1149 1204
1150@noindent 1205@noindent
1151The @samp{~\ref@{%s@}} is a format string indicating how to insert 1206The @samp{~\ref@{%s@}} is a format string indicating how to insert
1152references to these labels.@refill 1207references to these labels.
1153 1208
1154@noindent 1209@noindent
1155The next item indicates how to grab context of the label definition.@refill 1210The next item indicates how to grab context of the label definition.
1156@itemize @minus 1211@itemize @minus
1157@item 1212@item
1158@code{t} means to get it from a default location (from the beginning of 1213@code{t} means to get it from a default location (from the beginning of
1159a @code{\macro} or after the @code{\begin} statement). @code{t} is 1214a @code{\macro} or after the @code{\begin} statement). @code{t} is
1160@emph{not} a good choice for eqnarray and similar environments.@refill 1215@emph{not} a good choice for eqnarray and similar environments.
1161@item 1216@item
1162@code{nil} means to use the text right after the label definition.@refill 1217@code{nil} means to use the text right after the label definition.
1163@item 1218@item
1164For more complex ways of getting context, see the variable 1219For more complex ways of getting context, see the variable
1165@code{reftex-label-alist} (@ref{Options (Defining Label 1220@code{reftex-label-alist} (@ref{Options (Defining Label
1166Environments)}).@refill 1221Environments)}).
1167@end itemize 1222@end itemize
1168 1223
1169The following list of strings is used to guess the correct label type 1224The following list of strings is used to guess the correct label type
1170from the word before point when creating a reference. E.g. if you 1225from the word before point when creating a reference. E.g. if you
1171write: @samp{As we have shown in Theorem} and then press @kbd{C-c )}, 1226write: @samp{As we have shown in Theorem} and then press @kbd{C-c )},
1172@b{Ref@TeX{}} will know that you are looking for a theorem label and 1227@b{Ref@TeX{}} will know that you are looking for a theorem label and
1173restrict the menu to only these labels without even asking.@refill 1228restrict the menu to only these labels without even asking.
1174 1229
1175The final item in each entry is the level at which the environment 1230The final item in each entry is the level at which the environment
1176should produce entries in the table of context buffer. If the number is 1231should produce entries in the table of context buffer. If the number is
@@ -1178,11 +1233,11 @@ positive, the environment will produce numbered entries (like
1178@code{\section}), if it is negative the entries will be unnumbered (like 1233@code{\section}), if it is negative the entries will be unnumbered (like
1179@code{\section*}). Use this only for environments which structure the 1234@code{\section*}). Use this only for environments which structure the
1180document similar to sectioning commands. For everything else, omit the 1235document similar to sectioning commands. For everything else, omit the
1181item.@refill 1236item.
1182 1237
1183To do the same configuration with @code{customize}, you need to click on 1238To do the same configuration with @code{customize}, you need to click on
1184the @code{[INS]} button twice to create two templates and fill them in 1239the @code{[INS]} button twice to create two templates and fill them in
1185like this:@refill 1240like this:
1186 1241
1187@example 1242@example
1188Reftex Label Alist: [Hide] 1243Reftex Label Alist: [Hide]
@@ -1218,7 +1273,7 @@ the new environments to work, you might want to add the letters @samp{a}
1218and @samp{h} to some of the flags in the variables 1273and @samp{h} to some of the flags in the variables
1219@code{reftex-insert-label-flags} (@pxref{Options (Creating Labels)}) 1274@code{reftex-insert-label-flags} (@pxref{Options (Creating Labels)})
1220and @code{reftex-label-menu-flags} (@pxref{Options (Referencing 1275and @code{reftex-label-menu-flags} (@pxref{Options (Referencing
1221Labels)}).@refill 1276Labels)}).
1222 1277
1223 1278
1224@node Quick Equation, Figure Wrapper, Theorem and Axiom , Defining Label Environments 1279@node Quick Equation, Figure Wrapper, Theorem and Axiom , Defining Label Environments
@@ -1252,7 +1307,7 @@ The first element in this list is now the macro with empty braces as an
1252an equation label, the different @code{nil} elements indicate to use the 1307an equation label, the different @code{nil} elements indicate to use the
1253default values for equations. The @samp{1} as the fifth element 1308default values for equations. The @samp{1} as the fifth element
1254indicates that the context of the label definition should be the 1st 1309indicates that the context of the label definition should be the 1st
1255argument of the macro.@refill 1310argument of the macro.
1256 1311
1257Here is again how this would look in the customization buffer: 1312Here is again how this would look in the customization buffer:
1258 1313
@@ -1295,7 +1350,7 @@ which would be called like
1295 1350
1296Now we need to tell @b{Ref@TeX{}} that the 4th argument of the 1351Now we need to tell @b{Ref@TeX{}} that the 4th argument of the
1297@code{\myfig} macro @emph{is itself} a figure label, and where to find 1352@code{\myfig} macro @emph{is itself} a figure label, and where to find
1298the context.@refill 1353the context.
1299 1354
1300@lisp 1355@lisp
1301(setq reftex-label-alist 1356(setq reftex-label-alist
@@ -1308,12 +1363,12 @@ indicates that this is a figure label which will be listed together with
1308labels from normal figure environments. The @code{nil} entries for 1363labels from normal figure environments. The @code{nil} entries for
1309prefix and reference format mean to use the defaults for figure labels. 1364prefix and reference format mean to use the defaults for figure labels.
1310The @samp{3} for the context method means to grab the 3rd macro argument 1365The @samp{3} for the context method means to grab the 3rd macro argument
1311- the caption.@refill 1366- the caption.
1312 1367
1313As a side effect of this configuration, @code{reftex-label} will now 1368As a side effect of this configuration, @code{reftex-label} will now
1314insert the required naked label (without the @code{\label} macro) when 1369insert the required naked label (without the @code{\label} macro) when
1315point is directly after the opening parenthesis of a @code{\myfig} macro 1370point is directly after the opening parenthesis of a @code{\myfig} macro
1316argument.@refill 1371argument.
1317 1372
1318Again, here the configuration in the customization buffer: 1373Again, here the configuration in the customization buffer:
1319 1374
@@ -1341,7 +1396,7 @@ want to add some magic words, for another language. Changing only the
1341information associated with a label category is done by giving 1396information associated with a label category is done by giving
1342@code{nil} for the environment name and then specify the items you want 1397@code{nil} for the environment name and then specify the items you want
1343to define. Here is an example which adds German magic words to all 1398to define. Here is an example which adds German magic words to all
1344predefined label categories.@refill 1399predefined label categories.
1345 1400
1346@lisp 1401@lisp
1347(setq reftex-label-alist 1402(setq reftex-label-alist
@@ -1370,7 +1425,7 @@ do this:
1370@end lisp 1425@end lisp
1371 1426
1372@b{Ref@TeX{}} has also a predefined symbol for this special purpose. The 1427@b{Ref@TeX{}} has also a predefined symbol for this special purpose. The
1373following is equivalent to the line above.@refill 1428following is equivalent to the line above.
1374 1429
1375@lisp 1430@lisp
1376(setq reftex-label-alist '(AMSTeX)) 1431(setq reftex-label-alist '(AMSTeX))
@@ -1378,7 +1433,7 @@ following is equivalent to the line above.@refill
1378 1433
1379Note that this is automatically done by the @file{amsmath.el} style file 1434Note that this is automatically done by the @file{amsmath.el} style file
1380of AUCTeX (@pxref{Style Files}) - so if you use AUCTeX, 1435of AUCTeX (@pxref{Style Files}) - so if you use AUCTeX,
1381this configuration will not be necessary.@refill 1436this configuration will not be necessary.
1382 1437
1383@node Non-Standard Environments, Putting it Together, Using \eqref, Defining Label Environments 1438@node Non-Standard Environments, Putting it Together, Using \eqref, Defining Label Environments
1384@subsection Non-standard Environments 1439@subsection Non-standard Environments
@@ -1397,7 +1452,7 @@ it must return a buffer position indicating the start of this
1397environment. The return value must be @code{nil} on failure to detect 1452environment. The return value must be @code{nil} on failure to detect
1398the environment. The function is called with one argument @var{bound}. 1453the environment. The function is called with one argument @var{bound}.
1399If non-@code{nil}, @var{bound} is a boundary for backwards searches 1454If non-@code{nil}, @var{bound} is a boundary for backwards searches
1400which should be observed. We will discuss two examples.@refill 1455which should be observed. We will discuss two examples.
1401 1456
1402@cindex LaTeX commands, abbreviated 1457@cindex LaTeX commands, abbreviated
1403 1458
@@ -1409,7 +1464,7 @@ to search backward for these macros. When the first match is
1409@code{\be}, point is in this environment and the function must return 1464@code{\be}, point is in this environment and the function must return
1410the beginning of the match. To avoid scanning too far, we can also look 1465the beginning of the match. To avoid scanning too far, we can also look
1411for empty lines which cannot occur inside an equation environment. 1466for empty lines which cannot occur inside an equation environment.
1412Here is the setup:@refill 1467Here is the setup:
1413 1468
1414@lisp 1469@lisp
1415;; Setup entry in reftex-label-alist, using all defaults for equations 1470;; Setup entry in reftex-label-alist, using all defaults for equations
@@ -1429,7 +1484,7 @@ Here is the setup:@refill
1429@cindex LaTeX packages, @code{linguex} 1484@cindex LaTeX packages, @code{linguex}
1430A more complex example is the @file{linguex.sty} package which defines 1485A more complex example is the @file{linguex.sty} package which defines
1431list macros @samp{\ex.}, @samp{\a.}, @samp{\b.} etc. for lists which are 1486list macros @samp{\ex.}, @samp{\a.}, @samp{\b.} etc. for lists which are
1432terminated by @samp{\z.} or by an empty line.@refill 1487terminated by @samp{\z.} or by an empty line.
1433 1488
1434@example 1489@example
1435\ex. \label@{ex:12@} Some text in an exotic language ... 1490\ex. \label@{ex:12@} Some text in an exotic language ...
@@ -1519,7 +1574,7 @@ message.
1519@b{Ref@TeX{}} can also display the label definition corresponding to a 1574@b{Ref@TeX{}} can also display the label definition corresponding to a
1520@code{\ref} macro, or all reference locations corresponding to a 1575@code{\ref} macro, or all reference locations corresponding to a
1521@code{\label} macro. @xref{Viewing Cross-References}, for more 1576@code{\label} macro. @xref{Viewing Cross-References}, for more
1522information.@refill 1577information.
1523 1578
1524@node xr (LaTeX package), varioref (LaTeX package), Reference Info, Labels and References 1579@node xr (LaTeX package), varioref (LaTeX package), Reference Info, Labels and References
1525@section @code{xr}: Cross-Document References 1580@section @code{xr}: Cross-Document References
@@ -1532,7 +1587,7 @@ information.@refill
1532 1587
1533The LaTeX package @code{xr} makes it possible to create references to 1588The LaTeX package @code{xr} makes it possible to create references to
1534labels defined in external documents. The preamble of a document using 1589labels defined in external documents. The preamble of a document using
1535@code{xr} will contain something like this:@refill 1590@code{xr} will contain something like this:
1536 1591
1537@example 1592@example
1538\usepackage@{xr@} 1593\usepackage@{xr@}
@@ -1543,18 +1598,18 @@ labels defined in external documents. The preamble of a document using
1543@noindent 1598@noindent
1544and we can make references to any labels defined in these 1599and we can make references to any labels defined in these
1545external documents by using the prefixes @samp{V1-} and @samp{V3-}, 1600external documents by using the prefixes @samp{V1-} and @samp{V3-},
1546respectively.@refill 1601respectively.
1547 1602
1548@b{Ref@TeX{}} can be used to create such references as well. Start the 1603@b{Ref@TeX{}} can be used to create such references as well. Start the
1549referencing process normally, by pressing @kbd{C-c )}. Select a label 1604referencing process normally, by pressing @kbd{C-c )}. Select a label
1550type if necessary. When you see the label selection buffer, pressing 1605type if necessary. When you see the label selection buffer, pressing
1551@kbd{x} will switch to the label selection buffer of one of the external 1606@kbd{x} will switch to the label selection buffer of one of the external
1552documents. You may then select a label as before and @b{Ref@TeX{}} will 1607documents. You may then select a label as before and @b{Ref@TeX{}} will
1553insert it along with the required prefix.@refill 1608insert it along with the required prefix.
1554 1609
1555For this kind of inter-document cross-references, saving of parsing 1610For this kind of inter-document cross-references, saving of parsing
1556information and the use of multiple selection buffers can mean a large 1611information and the use of multiple selection buffers can mean a large
1557speed-up (@pxref{Optimizations}).@refill 1612speed-up (@pxref{Optimizations}).
1558 1613
1559@node varioref (LaTeX package), fancyref (LaTeX package), xr (LaTeX package), Labels and References 1614@node varioref (LaTeX package), fancyref (LaTeX package), xr (LaTeX package), Labels and References
1560@section @code{varioref}: Variable Page References 1615@section @code{varioref}: Variable Page References
@@ -1572,7 +1627,7 @@ always use @code{\vref}, you may want to make it the default by
1572customizing the variable @code{reftex-vref-is-default}. If this 1627customizing the variable @code{reftex-vref-is-default}. If this
1573toggling seems too inconvenient, you can also use the command 1628toggling seems too inconvenient, you can also use the command
1574@code{reftex-varioref-vref}@footnote{bind it to @kbd{C-c v}.}. 1629@code{reftex-varioref-vref}@footnote{bind it to @kbd{C-c v}.}.
1575Or use AUCTeX to create your macros (@pxref{AUCTeX}).@refill 1630Or use AUCTeX to create your macros (@pxref{AUCTeX}).
1576 1631
1577@node fancyref (LaTeX package), , varioref (LaTeX package), Labels and References 1632@node fancyref (LaTeX package), , varioref (LaTeX package), Labels and References
1578@section @code{fancyref}: Fancy Cross References 1633@section @code{fancyref}: Fancy Cross References
@@ -1594,7 +1649,7 @@ shows the current status of this switch. If this cycling seems
1594inconvenient, you can also use the commands @code{reftex-fancyref-fref} 1649inconvenient, you can also use the commands @code{reftex-fancyref-fref}
1595and @code{reftex-fancyref-Fref}@footnote{bind them to @kbd{C-c 1650and @code{reftex-fancyref-Fref}@footnote{bind them to @kbd{C-c
1596f} and @kbd{C-c F}.}. Or use AUCTeX to create your macros 1651f} and @kbd{C-c F}.}. Or use AUCTeX to create your macros
1597(@pxref{AUCTeX}).@refill 1652(@pxref{AUCTeX}).
1598 1653
1599@node Citations, Index Support, Labels and References, Top 1654@node Citations, Index Support, Labels and References, Top
1600@chapter Citations 1655@chapter Citations
@@ -1605,7 +1660,7 @@ Citations in LaTeX are done with the @code{\cite} macro or variations of
1605it. The argument of the macro is a citation key which identifies an 1660it. The argument of the macro is a citation key which identifies an
1606article or book in either a BibTeX database file or in an explicit 1661article or book in either a BibTeX database file or in an explicit
1607@code{thebibliography} environment in the document. @b{Ref@TeX{}}'s 1662@code{thebibliography} environment in the document. @b{Ref@TeX{}}'s
1608support for citations helps to select the correct key quickly.@refill 1663support for citations helps to select the correct key quickly.
1609 1664
1610@menu 1665@menu
1611* Creating Citations:: How to create them. 1666* Creating Citations:: How to create them.
@@ -1613,6 +1668,7 @@ support for citations helps to select the correct key quickly.@refill
1613* Citation Info:: View the corresponding database entry. 1668* Citation Info:: View the corresponding database entry.
1614* Chapterbib and Bibunits:: Multiple bibliographies in a Document. 1669* Chapterbib and Bibunits:: Multiple bibliographies in a Document.
1615* Citations Outside LaTeX:: How to make citations in Emails etc. 1670* Citations Outside LaTeX:: How to make citations in Emails etc.
1671* BibTeX Database Subsets:: Extract parts of a big database.
1616@end menu 1672@end menu
1617 1673
1618@node Creating Citations, Citation Styles, , Citations 1674@node Creating Citations, Citation Styles, , Citations
@@ -1628,7 +1684,7 @@ In order to create a citation, press @kbd{C-c [}. @b{Ref@TeX{}} then
1628prompts for a regular expression which will be used to search through 1684prompts for a regular expression which will be used to search through
1629the database and present the list of matches to choose from in a 1685the database and present the list of matches to choose from in a
1630selection process similar to that for selecting labels 1686selection process similar to that for selecting labels
1631(@pxref{Referencing Labels}).@refill 1687(@pxref{Referencing Labels}).
1632 1688
1633The regular expression uses an extended syntax: @samp{&&} defines a 1689The regular expression uses an extended syntax: @samp{&&} defines a
1634logic @code{and} for regular expressions. For example 1690logic @code{and} for regular expressions. For example
@@ -1638,7 +1694,7 @@ Einstein. When entering the regular expression, you can complete on
1638known citation keys. RefTeX also offers a default when prompting for a 1694known citation keys. RefTeX also offers a default when prompting for a
1639regular expression. This default is the word before the cursor or the 1695regular expression. This default is the word before the cursor or the
1640word before the current @samp{\cite} command. Sometimes this may be a 1696word before the current @samp{\cite} command. Sometimes this may be a
1641good search key.@refill 1697good search key.
1642 1698
1643@cindex @code{\bibliography} 1699@cindex @code{\bibliography}
1644@cindex @code{thebibliography}, LaTeX environment 1700@cindex @code{thebibliography}, LaTeX environment
@@ -1653,12 +1709,12 @@ If you do not use BibTeX, but the document contains an explicit
1653information from there. Note that in this case the information 1709information from there. Note that in this case the information
1654presented in the selection buffer will just be a copy of relevant 1710presented in the selection buffer will just be a copy of relevant
1655@code{\bibitem} entries, not the structured listing available with 1711@code{\bibitem} entries, not the structured listing available with
1656BibTeX database files.@refill 1712BibTeX database files.
1657 1713
1658@kindex ? 1714@kindex ?
1659In the selection buffer, the following keys provide special commands. A 1715In the selection buffer, the following keys provide special commands. A
1660summary of this information is always available from the selection 1716summary of this information is always available from the selection
1661process by pressing @kbd{?}.@refill 1717process by pressing @kbd{?}.
1662 1718
1663@table @kbd 1719@table @kbd
1664@tablesubheading{General} 1720@tablesubheading{General}
@@ -1678,24 +1734,24 @@ Go to previous article.
1678@tablesubheading{Access to full database entries} 1734@tablesubheading{Access to full database entries}
1679@item @key{SPC} 1735@item @key{SPC}
1680Show the database entry corresponding to the article at point, in 1736Show the database entry corresponding to the article at point, in
1681another window. See also the @kbd{f} key.@refill 1737another window. See also the @kbd{f} key.
1682 1738
1683@item f 1739@item f
1684Toggle follow mode. When follow mode is active, the other window will 1740Toggle follow mode. When follow mode is active, the other window will
1685always display the full database entry of the current article. This is 1741always display the full database entry of the current article. This is
1686equivalent to pressing @key{SPC} after each cursor motion. With BibTeX 1742equivalent to pressing @key{SPC} after each cursor motion. With BibTeX
1687entries, follow mode can be rather slow.@refill 1743entries, follow mode can be rather slow.
1688 1744
1689@tablesubheading{Selecting entries and creating the citation} 1745@tablesubheading{Selecting entries and creating the citation}
1690@item @key{RET} 1746@item @key{RET}
1691Insert a citation referencing the article at point into the buffer from 1747Insert a citation referencing the article at point into the buffer from
1692which the selection process was started.@refill 1748which the selection process was started.
1693 1749
1694@item mouse-2 1750@item mouse-2
1695@vindex reftex-highlight-selection 1751@vindex reftex-highlight-selection
1696Clicking with mouse button 2 on a citation will accept it like @key{RET} 1752Clicking with mouse button 2 on a citation will accept it like @key{RET}
1697would. See also variable @code{reftex-highlight-selection}, @ref{Options 1753would. See also variable @code{reftex-highlight-selection}, @ref{Options
1698(Misc)}.@refill 1754(Misc)}.
1699 1755
1700@item m 1756@item m
1701Mark the current entry. When one or several entries are marked, 1757Mark the current entry. When one or several entries are marked,
@@ -1707,11 +1763,21 @@ Unmark a marked entry.
1707 1763
1708@item a 1764@item a
1709Accept all (marked) entries in the selection buffer and create a single 1765Accept all (marked) entries in the selection buffer and create a single
1710@code{\cite} macro referring to them.@refill 1766@code{\cite} macro referring to them.
1711 1767
1712@item A 1768@item A
1713Accept all (marked) entries in the selection buffer and create a 1769Accept all (marked) entries in the selection buffer and create a
1714separate @code{\cite} macro for each of it.@refill 1770separate @code{\cite} macro for each of it.
1771
1772@item e
1773Create a new BibTeX database file which contains all @i{marked} entries
1774in the selection buffer. If no entries are marked, all entries are
1775selected.
1776
1777@item E
1778Create a new BibTeX database file which contains all @i{unmarked}
1779entries in the selection buffer. If no entries are marked, all entries
1780are selected.
1715 1781
1716@item @key{TAB} 1782@item @key{TAB}
1717Enter a citation key with completion. This may also be a key which does 1783Enter a citation key with completion. This may also be a key which does
@@ -1719,30 +1785,30 @@ not yet exist.
1719 1785
1720@item . 1786@item .
1721Show insertion point in another window. This is the point from where you 1787Show insertion point in another window. This is the point from where you
1722called @code{reftex-citation}.@refill 1788called @code{reftex-citation}.
1723 1789
1724@tablesubheading{Exiting} 1790@tablesubheading{Exiting}
1725@item q 1791@item q
1726Exit the selection process without inserting a citation into the 1792Exit the selection process without inserting a citation into the
1727buffer.@refill 1793buffer.
1728 1794
1729@tablesubheading{Updating the buffer} 1795@tablesubheading{Updating the buffer}
1730 1796
1731@item g 1797@item g
1732Start over with a new regular expression. The full database will be 1798Start over with a new regular expression. The full database will be
1733rescanned with the new expression (see also @kbd{r}).@refill 1799rescanned with the new expression (see also @kbd{r}).
1734 1800
1735@c FIXME: Should we use something else here? r is usually rescan! 1801@c FIXME: Should we use something else here? r is usually rescan!
1736@item r 1802@item r
1737Refine the current selection with another regular expression. This will 1803Refine the current selection with another regular expression. This will
1738@emph{not} rescan the entire database, but just the already selected 1804@emph{not} rescan the entire database, but just the already selected
1739entries.@refill 1805entries.
1740 1806
1741@end table 1807@end table
1742 1808
1743@vindex reftex-select-bib-map 1809@vindex reftex-select-bib-map
1744In order to define additional commands for this selection process, the 1810In order to define additional commands for this selection process, the
1745keymap @code{reftex-select-bib-map} may be used.@refill 1811keymap @code{reftex-select-bib-map} may be used.
1746 1812
1747@node Citation Styles, Citation Info, Creating Citations, Citations 1813@node Citation Styles, Citation Info, Creating Citations, Citations
1748@section Citation Styles 1814@section Citation Styles
@@ -1782,11 +1848,15 @@ SELECT A CITATION FORMAT
1782[y] \citeyear@{%l@} 1848[y] \citeyear@{%l@}
1783@end example 1849@end example
1784 1850
1851@vindex reftex-cite-prompt-optional-args
1852If cite formats contain empty paris of square brackets, RefTeX can
1853will prompt for values of these optional arguments if you call the
1854@code{reftex-citation} command with a @kbd{C-u} prefix.
1785Following the most generic of these packages, @code{natbib}, the builtin 1855Following the most generic of these packages, @code{natbib}, the builtin
1786citation packages always accept the @kbd{t} key for a @emph{textual} 1856citation packages always accept the @kbd{t} key for a @emph{textual}
1787citation (like: @code{Jones et al. (1997) have shown...}) as well as 1857citation (like: @code{Jones et al. (1997) have shown...}) as well as
1788the @kbd{p} key for a parenthetical citation (like: @code{As shown 1858the @kbd{p} key for a parenthetical citation (like: @code{As shown
1789earlier (Jones et al, 1997)}).@refill 1859earlier (Jones et al, 1997)}).
1790 1860
1791To make one of these styles the default, customize the variable 1861To make one of these styles the default, customize the variable
1792@code{reftex-cite-format} or put into @file{.emacs}: 1862@code{reftex-cite-format} or put into @file{.emacs}:
@@ -1798,7 +1868,7 @@ To make one of these styles the default, customize the variable
1798You can also use AUCTeX style files to automatically set the 1868You can also use AUCTeX style files to automatically set the
1799citation style based on the @code{usepackage} commands in a given 1869citation style based on the @code{usepackage} commands in a given
1800document. @xref{Style Files}, for information on how to set up the style 1870document. @xref{Style Files}, for information on how to set up the style
1801files correctly.@refill 1871files correctly.
1802 1872
1803@node Citation Info, Chapterbib and Bibunits, Citation Styles, Citations, Top 1873@node Citation Info, Chapterbib and Bibunits, Citation Styles, Citations, Top
1804@section Citation Info 1874@section Citation Info
@@ -1819,7 +1889,7 @@ only displayed if the echo area is not occupied by a different message.
1819@b{Ref@TeX{}} can also display the @code{\bibitem} or BibTeX database 1889@b{Ref@TeX{}} can also display the @code{\bibitem} or BibTeX database
1820entry corresponding to a @code{\cite} macro, or all citation locations 1890entry corresponding to a @code{\cite} macro, or all citation locations
1821corresponding to a @code{\bibitem} or BibTeX database entry. 1891corresponding to a @code{\bibitem} or BibTeX database entry.
1822@xref{Viewing Cross-References}.@refill 1892@xref{Viewing Cross-References}.
1823 1893
1824@node Chapterbib and Bibunits, Citations Outside LaTeX, Citation Info, Citations 1894@node Chapterbib and Bibunits, Citations Outside LaTeX, Citation Info, Citations
1825@section Chapterbib and Bibunits 1895@section Chapterbib and Bibunits
@@ -1836,7 +1906,7 @@ separate file (as it is required for @code{chapterbib} anyway). Then
1836you have multiple bibliographies within a @emph{single file}, this may 1906you have multiple bibliographies within a @emph{single file}, this may
1837or may not be the case. 1907or may not be the case.
1838 1908
1839@node Citations Outside LaTeX, , Chapterbib and Bibunits, Citations 1909@node Citations Outside LaTeX, BibTeX Database Subsets, Chapterbib and Bibunits, Citations
1840@section Citations outside LaTeX 1910@section Citations outside LaTeX
1841@cindex Citations outside LaTeX 1911@cindex Citations outside LaTeX
1842@vindex reftex-default-bibliography 1912@vindex reftex-default-bibliography
@@ -1850,7 +1920,7 @@ Setting the variable @code{reftex-cite-format} to the symbol
1850@code{locally} does a decent job of putting all relevant information 1920@code{locally} does a decent job of putting all relevant information
1851about a citation directly into the buffer. Here is the lisp code to add 1921about a citation directly into the buffer. Here is the lisp code to add
1852the @kbd{C-c [} binding to the mail buffer. It also provides a local 1922the @kbd{C-c [} binding to the mail buffer. It also provides a local
1853binding for @code{reftex-cite-format}.@refill 1923binding for @code{reftex-cite-format}.
1854 1924
1855@lisp 1925@lisp
1856(add-hook 'mail-setup-hook 1926(add-hook 'mail-setup-hook
@@ -1861,6 +1931,34 @@ binding for @code{reftex-cite-format}.@refill
1861 (reftex-citation)))))) 1931 (reftex-citation))))))
1862@end lisp 1932@end lisp
1863 1933
1934@node BibTeX Database Subsets, , Citations Outside LaTeX, Citations
1935@section Database Subsets
1936@cindex BibTeX database subsets
1937@findex reftex-create-bibtex-file
1938
1939@b{Ref@TeX{}} offers two ways to create a new BibTeX database file.
1940
1941The first option produces a file which contains only the entries
1942actually referenced in the current document. This can be useful if
1943the database in only meant for a single document and you want to clean
1944it of old and unused ballast. It can also be useful while writing a
1945document together with collaborators, in order to avoid sending around
1946the entire (possibly very large) database. To create the file, use
1947@kbd{M-x reftex-create-bibtex-file}, also available from the menu
1948under @code{Ref->Global Actions->Create Bibtex File}. The command will
1949prompt for a BibTeX file name and write the extracted entries to that
1950file.
1951
1952The second option makes use of the selection process started by the
1953command @kbd{C-c [} (@pxref{Creating Citations}). This command uses a
1954regular expression to select entries, and lists them in a formatted
1955selection buffer. After pressing the @kbd{e} key (mnemonics: Export),
1956the command will prompt for the name of a new BibTeX file and write
1957the selected entries to that file. You can also first mark some
1958entries in the selection buffer with the @kbd{m} key and then export
1959either the @i{marked} entries (with the @kbd{e} key) or the
1960@i{unmarked} entries (with the @kbd{E} key).
1961
1864@node Index Support, Viewing Cross-References, Citations, Top 1962@node Index Support, Viewing Cross-References, Citations, Top
1865@chapter Index Support 1963@chapter Index Support
1866@cindex Index Support 1964@cindex Index Support
@@ -1875,7 +1973,7 @@ Index entries are created with the @code{\index@{@var{entry}@}} macro.
1875All entries defined in a document are written out to the @file{.aux} 1973All entries defined in a document are written out to the @file{.aux}
1876file. A separate tool must be used to convert this information into a 1974file. A separate tool must be used to convert this information into a
1877nicely formatted index. Tools used with LaTeX include @code{MakeIndex} 1975nicely formatted index. Tools used with LaTeX include @code{MakeIndex}
1878and @code{xindy}.@refill 1976and @code{xindy}.
1879 1977
1880Indexing is a very difficult task. It must follow strict conventions to 1978Indexing is a very difficult task. It must follow strict conventions to
1881make the index consistent and complete. There are basically two 1979make the index consistent and complete. There are basically two
@@ -1893,7 +1991,7 @@ to define special purpose macros which define an item and at the same
1893time make an index entry, possibly with special formatting to make the 1991time make an index entry, possibly with special formatting to make the
1894reference page in the index bold or underlined. To make @b{Ref@TeX{}} 1992reference page in the index bold or underlined. To make @b{Ref@TeX{}}
1895support for indexing possible, these special macros must be added to 1993support for indexing possible, these special macros must be added to
1896@b{Ref@TeX{}}'s configuration (@pxref{Defining Index Macros}).@refill 1994@b{Ref@TeX{}}'s configuration (@pxref{Defining Index Macros}).
1897 1995
1898@item 1996@item
1899The rest of the index is often just a collection of where in the 1997The rest of the index is often just a collection of where in the
@@ -1901,7 +1999,7 @@ document certain words or phrases are being used. This part is
1901difficult to develop along with the document, because consistent entries 1999difficult to develop along with the document, because consistent entries
1902for each occurrence are needed and are best selected when the document 2000for each occurrence are needed and are best selected when the document
1903is ready. @b{Ref@TeX{}} supports this with an @emph{index phrases file} 2001is ready. @b{Ref@TeX{}} supports this with an @emph{index phrases file}
1904which collects phrases and helps indexing the phrases globally.@refill 2002which collects phrases and helps indexing the phrases globally.
1905@end enumerate 2003@end enumerate
1906 2004
1907Before you start, you need to make sure that @b{Ref@TeX{}} knows about 2005Before you start, you need to make sure that @b{Ref@TeX{}} knows about
@@ -1913,7 +2011,7 @@ argument, and @b{Ref@TeX{}} needs to be configured for those. A
1913sufficiently new version of AUCTeX (9.10c or later) will do this 2011sufficiently new version of AUCTeX (9.10c or later) will do this
1914automatically. If you really don't use AUCTeX (you should!), this 2012automatically. If you really don't use AUCTeX (you should!), this
1915configuration needs to be done by hand with the menu (@code{Ref->Index 2013configuration needs to be done by hand with the menu (@code{Ref->Index
1916Style}), or globally for all your documents with@refill 2014Style}), or globally for all your documents with
1917 2015
1918@lisp 2016@lisp
1919(setq reftex-index-macros '(multind)) @r{or} 2017(setq reftex-index-macros '(multind)) @r{or}
@@ -1957,7 +2055,7 @@ available index macros and for its arguments. Completion will be
1957available for the index entry and, if applicable, the index tag. The 2055available for the index entry and, if applicable, the index tag. The
1958index tag is a string identifying one of multiple indices. With the 2056index tag is a string identifying one of multiple indices. With the
1959@file{multind} and @file{index} packages, this tag is the first argument 2057@file{multind} and @file{index} packages, this tag is the first argument
1960to the redefined @code{\index} macro.@refill 2058to the redefined @code{\index} macro.
1961 2059
1962@node The Index Phrases File, Displaying and Editing the Index, Creating Index Entries, Index Support 2060@node The Index Phrases File, Displaying and Editing the Index, Creating Index Entries, Index Support
1963@section The Index Phrases File 2061@section The Index Phrases File
@@ -1977,7 +2075,7 @@ of the available index macros. This list is initialized from
1977@code{reftex-index-macros} (@pxref{Defining Index Macros}). You can 2075@code{reftex-index-macros} (@pxref{Defining Index Macros}). You can
1978edit the header as needed, but if you define new LaTeX indexing macros, 2076edit the header as needed, but if you define new LaTeX indexing macros,
1979don't forget to add them to @code{reftex-index-macros} as well. Here is 2077don't forget to add them to @code{reftex-index-macros} as well. Here is
1980a phrase file header example:@refill 2078a phrase file header example:
1981 2079
1982@example 2080@example
1983% -*- mode: reftex-index-phrases -*- 2081% -*- mode: reftex-index-phrases -*-
@@ -1999,7 +2097,7 @@ indicates if @var{word} is indexed by the macro as
1999@samp{\index@{@var{word}@}@var{word}} (@var{repeat} = @code{t}). In the 2097@samp{\index@{@var{word}@}@var{word}} (@var{repeat} = @code{t}). In the
2000above example it is assumed that the macro @code{\index*@{@var{word}@}} 2098above example it is assumed that the macro @code{\index*@{@var{word}@}}
2001already typesets its argument in the text, so that it is unnecessary to 2099already typesets its argument in the text, so that it is unnecessary to
2002repeat @var{word} outside the macro.@refill 2100repeat @var{word} outside the macro.
2003 2101
2004@menu 2102@menu
2005* Collecting Phrases:: Collecting from document or external. 2103* Collecting Phrases:: Collecting from document or external.
@@ -2049,7 +2147,7 @@ index entries, separate the different index arguments with @samp{ &&
2049able to choose at each match between several different index arguments, 2147able to choose at each match between several different index arguments,
2050separate them with @samp{ || }@footnote{@samp{||} with optional spaces, 2148separate them with @samp{ || }@footnote{@samp{||} with optional spaces,
2051see @code{reftex-index-phrases-logical-or-regexp}.}. Here is an 2149see @code{reftex-index-phrases-logical-or-regexp}.}. Here is an
2052example:@refill 2150example:
2053 2151
2054@example 2152@example
2055%-------------------------------------------------------------------- 2153%--------------------------------------------------------------------
@@ -2071,7 +2169,7 @@ occurrence of @samp{Mars} you will be able choose between indexing it as
2071a subitem of @samp{Planets}, @samp{Gods} or @samp{Chocolate Bars}. 2169a subitem of @samp{Planets}, @samp{Gods} or @samp{Chocolate Bars}.
2072Finally, every occurrence of @samp{Pluto} will be indexed as 2170Finally, every occurrence of @samp{Pluto} will be indexed as
2073@samp{\index@{Planets!Pluto@}\index@{Kuiper Belt Objects!Pluto@}Pluto} 2171@samp{\index@{Planets!Pluto@}\index@{Kuiper Belt Objects!Pluto@}Pluto}
2074and will therefore create two different index entries.@refill 2172and will therefore create two different index entries.
2075 2173
2076@node Consistency Checks, Global Indexing, Collecting Phrases, The Index Phrases File 2174@node Consistency Checks, Global Indexing, Collecting Phrases, The Index Phrases File
2077@subsection Consistency Checks 2175@subsection Consistency Checks
@@ -2087,13 +2185,13 @@ alphabetically - this is done with the command @kbd{C-c C-s}
2087buffer alphabetically by search phrase. If you want to group certain 2185buffer alphabetically by search phrase. If you want to group certain
2088phrases and only sort within the groups, insert empty lines between the 2186phrases and only sort within the groups, insert empty lines between the
2089groups. Sorting will only change the sequence of phrases within each 2187groups. Sorting will only change the sequence of phrases within each
2090group (see the variable @code{reftex-index-phrases-sort-in-blocks}).@refill 2188group (see the variable @code{reftex-index-phrases-sort-in-blocks}).
2091 2189
2092@kindex C-c C-i 2190@kindex C-c C-i
2093A useful command is @kbd{C-c C-i} (@code{reftex-index-phrases-info}) 2191A useful command is @kbd{C-c C-i} (@code{reftex-index-phrases-info})
2094which lists information about the phrase at point, including an example 2192which lists information about the phrase at point, including an example
2095of how the index entry will look like and the number of expected matches 2193of how the index entry will look like and the number of expected matches
2096in the document.@refill 2194in the document.
2097 2195
2098@kindex C-c C-t 2196@kindex C-c C-t
2099Another important check is to find out if there are double or 2197Another important check is to find out if there are double or
@@ -2104,7 +2202,7 @@ second phrase will not match because of the index macro inserted before
2104(@code{reftex-index-find-next-conflict-phrase}) finds the next phrase in 2202(@code{reftex-index-find-next-conflict-phrase}) finds the next phrase in
2105the buffer which is either duplicate or a subphrase of another phrase. 2203the buffer which is either duplicate or a subphrase of another phrase.
2106In order to check the whole buffer like this, start at the beginning and 2204In order to check the whole buffer like this, start at the beginning and
2107execute this command repeatedly.@refill 2205execute this command repeatedly.
2108 2206
2109@node Global Indexing, , Consistency Checks, The Index Phrases File 2207@node Global Indexing, , Consistency Checks, The Index Phrases File
2110@subsection Global Indexing 2208@subsection Global Indexing
@@ -2119,13 +2217,13 @@ There are several commands which start indexing: @kbd{C-c C-x} acts on
2119the current phrase line, @kbd{C-c C-r} on all lines in the current 2217the current phrase line, @kbd{C-c C-r} on all lines in the current
2120region and @kbd{C-c C-a} on all phrase lines in the buffer. It is 2218region and @kbd{C-c C-a} on all phrase lines in the buffer. It is
2121probably good to do indexing in small chunks since your concentration 2219probably good to do indexing in small chunks since your concentration
2122may not last long enough to do everything in one go.@refill 2220may not last long enough to do everything in one go.
2123 2221
2124@b{Ref@TeX{}} will start at the first phrase line and search the phrase 2222@b{Ref@TeX{}} will start at the first phrase line and search the phrase
2125globally in the whole document. At each match it will stop, compute the 2223globally in the whole document. At each match it will stop, compute the
2126replacement string and offer you the following choices@footnote{Windows 2224replacement string and offer you the following choices@footnote{Windows
2127users: Restrict yourself to the described keys during indexing. Pressing 2225users: Restrict yourself to the described keys during indexing. Pressing
2128@key{Help} at the indexing prompt can apparently hang Emacs.}:@refill 2226@key{Help} at the indexing prompt can apparently hang Emacs.}:
2129 2227
2130@table @kbd 2228@table @kbd
2131@item y 2229@item y
@@ -2177,7 +2275,7 @@ this match is already indexed. A match is considered indexed if it is
2177either the argument of an index macro, or if an index macro is directly 2275either the argument of an index macro, or if an index macro is directly
2178(without whitespace separation) before or after the match. Index macros 2276(without whitespace separation) before or after the match. Index macros
2179are those configured in @code{reftex-index-macros}. Intended for 2277are those configured in @code{reftex-index-macros}. Intended for
2180re-indexing a documents after changes have been made.@refill 2278re-indexing a documents after changes have been made.
2181@end table 2279@end table
2182 2280
2183Even though indexing should be the last thing you do to a document, you 2281Even though indexing should be the last thing you do to a document, you
@@ -2185,7 +2283,7 @@ are bound to make changes afterwards. Indexing then has to be applied
2185to the changed regions. The command 2283to the changed regions. The command
2186@code{reftex-index-phrases-apply-to-region} is designed for this 2284@code{reftex-index-phrases-apply-to-region} is designed for this
2187purpose. When called from a LaTeX document with active region, it will 2285purpose. When called from a LaTeX document with active region, it will
2188apply @code{reftex-index-all-phrases} to the current region.@refill 2286apply @code{reftex-index-all-phrases} to the current region.
2189 2287
2190@node Displaying and Editing the Index, Builtin Index Macros, The Index Phrases File, Index Support 2288@node Displaying and Editing the Index, Builtin Index Macros, The Index Phrases File, Index Support
2191@section Displaying and Editing the Index 2289@section Displaying and Editing the Index
@@ -2201,7 +2299,7 @@ In order to compile and display the index, press @kbd{C-c >}. If the
2201document uses multiple indices, @b{Ref@TeX{}} will ask you to select 2299document uses multiple indices, @b{Ref@TeX{}} will ask you to select
2202one. Then, all index entries will be sorted alphabetically and 2300one. Then, all index entries will be sorted alphabetically and
2203displayed in a special buffer, the @file{*Index*} buffer. From that 2301displayed in a special buffer, the @file{*Index*} buffer. From that
2204buffer you can check and edit each entry.@refill 2302buffer you can check and edit each entry.
2205 2303
2206The index can be restricted to the current section or the region. Then 2304The index can be restricted to the current section or the region. Then
2207only entries in that part of the document will go into the compiled 2305only entries in that part of the document will go into the compiled
@@ -2210,7 +2308,7 @@ index. To restrict to the current section, use a numeric prefix
2210region, make the region active and use a numeric prefix @samp{3} (press 2308region, make the region active and use a numeric prefix @samp{3} (press
2211@kbd{C-u 3 C-c >}). From within the @file{*Index*} buffer the 2309@kbd{C-u 3 C-c >}). From within the @file{*Index*} buffer the
2212restriction can be moved from one section to the next by pressing the 2310restriction can be moved from one section to the next by pressing the
2213@kbd{<} and @kbd{>} keys.@refill 2311@kbd{<} and @kbd{>} keys.
2214 2312
2215One caveat: @b{Ref@TeX{}} finds the definition point of an index entry 2313One caveat: @b{Ref@TeX{}} finds the definition point of an index entry
2216by searching near the buffer position where it had found to macro during 2314by searching near the buffer position where it had found to macro during
@@ -2220,12 +2318,12 @@ rescan the buffer to ensure the correspondence between the
2220@file{*Index*} buffer and the definition locations. It is therefore 2318@file{*Index*} buffer and the definition locations. It is therefore
2221advisable to rescan the document (with @kbd{r} or @kbd{C-u r}) 2319advisable to rescan the document (with @kbd{r} or @kbd{C-u r})
2222frequently while editing the index from the @file{*Index*} 2320frequently while editing the index from the @file{*Index*}
2223buffer.@refill 2321buffer.
2224 2322
2225@kindex ? 2323@kindex ?
2226Here is a list of special commands available in the @file{*Index*} buffer. A 2324Here is a list of special commands available in the @file{*Index*} buffer. A
2227summary of this information is always available by pressing 2325summary of this information is always available by pressing
2228@kbd{?}.@refill 2326@kbd{?}.
2229 2327
2230@table @kbd 2328@table @kbd
2231@tablesubheading{General} 2329@tablesubheading{General}
@@ -2240,23 +2338,23 @@ Prefix argument.
2240Pressing any capital letter will jump to the corresponding section in 2338Pressing any capital letter will jump to the corresponding section in
2241the @file{*Index*} buffer. The exclamation mark is special and jumps to 2339the @file{*Index*} buffer. The exclamation mark is special and jumps to
2242the first entries alphabetically sorted below @samp{A}. These are 2340the first entries alphabetically sorted below @samp{A}. These are
2243usually non-alphanumeric characters.@refill 2341usually non-alphanumeric characters.
2244@item n 2342@item n
2245Go to next entry.@refill 2343Go to next entry.
2246@item p 2344@item p
2247Go to previous entry.@refill 2345Go to previous entry.
2248 2346
2249@tablesubheading{Access to document locations} 2347@tablesubheading{Access to document locations}
2250@item @key{SPC} 2348@item @key{SPC}
2251Show the place in the document where this index entry is defined.@refill 2349Show the place in the document where this index entry is defined.
2252 2350
2253@item @key{TAB} 2351@item @key{TAB}
2254Go to the definition of the current index entry in another 2352Go to the definition of the current index entry in another
2255window.@refill 2353window.
2256 2354
2257@item @key{RET} 2355@item @key{RET}
2258Go to the definition of the current index entry and hide the 2356Go to the definition of the current index entry and hide the
2259@file{*Index*} buffer window.@refill 2357@file{*Index*} buffer window.
2260 2358
2261@item f 2359@item f
2262@vindex reftex-index-follow-mode 2360@vindex reftex-index-follow-mode
@@ -2268,20 +2366,20 @@ cursor motion. The default for this flag can be set with the variable
2268@code{reftex-index-follow-mode}. Note that only context in files 2366@code{reftex-index-follow-mode}. Note that only context in files
2269already visited is shown. @b{Ref@TeX{}} will not visit a file just for 2367already visited is shown. @b{Ref@TeX{}} will not visit a file just for
2270follow mode. See, however, the variable 2368follow mode. See, however, the variable
2271@code{reftex-revisit-to-follow}.@refill 2369@code{reftex-revisit-to-follow}.
2272 2370
2273@tablesubheading{Entry editing} 2371@tablesubheading{Entry editing}
2274@item e 2372@item e
2275Edit the current index entry. In the minibuffer, you can edit the 2373Edit the current index entry. In the minibuffer, you can edit the
2276index macro which defines this entry.@refill 2374index macro which defines this entry.
2277 2375
2278@item C-k 2376@item C-k
2279Kill the index entry. Currently not implemented because I don't know 2377Kill the index entry. Currently not implemented because I don't know
2280how to implement an @code{undo} function for this.@refill 2378how to implement an @code{undo} function for this.
2281 2379
2282@item * 2380@item *
2283Edit the @var{key} part of the entry. This is the initial part of the 2381Edit the @var{key} part of the entry. This is the initial part of the
2284entry which determines the location of the entry in the index.@refill 2382entry which determines the location of the entry in the index.
2285 2383
2286@item | 2384@item |
2287Edit the @var{attribute} part of the entry. This is the part after the 2385Edit the @var{attribute} part of the entry. This is the part after the
@@ -2289,82 +2387,82 @@ vertical bar. With @code{MakeIndex}, this part is an encapsulating
2289macro. With @code{xindy}, it is called @emph{attribute} and is a 2387macro. With @code{xindy}, it is called @emph{attribute} and is a
2290property of the index entry that can lead to special formatting. When 2388property of the index entry that can lead to special formatting. When
2291called with @kbd{C-u} prefix, kill the entire @var{attribute} 2389called with @kbd{C-u} prefix, kill the entire @var{attribute}
2292part.@refill 2390part.
2293 2391
2294@item @@ 2392@item @@
2295Edit the @var{visual} part of the entry. This is the part after the 2393Edit the @var{visual} part of the entry. This is the part after the
2296@samp{@@} which is used by @code{MakeIndex} to change the visual 2394@samp{@@} which is used by @code{MakeIndex} to change the visual
2297appearance of the entry in the index. When called with @kbd{C-u} 2395appearance of the entry in the index. When called with @kbd{C-u}
2298prefix, kill the entire @var{visual} part.@refill 2396prefix, kill the entire @var{visual} part.
2299 2397
2300@item ( 2398@item (
2301Toggle the beginning of page range property @samp{|(} of the 2399Toggle the beginning of page range property @samp{|(} of the
2302entry.@refill 2400entry.
2303 2401
2304@item ) 2402@item )
2305Toggle the end of page range property @samp{|)} of the entry.@refill 2403Toggle the end of page range property @samp{|)} of the entry.
2306 2404
2307@item _ 2405@item _
2308Make the current entry a subentry. This command will prompt for the 2406Make the current entry a subentry. This command will prompt for the
2309superordinate entry and insert it.@refill 2407superordinate entry and insert it.
2310 2408
2311@item ^ 2409@item ^
2312Remove the highest superordinate entry. If the current entry is a 2410Remove the highest superordinate entry. If the current entry is a
2313subitem (@samp{aaa!bbb!ccc}), this function moves it up the hierarchy 2411subitem (@samp{aaa!bbb!ccc}), this function moves it up the hierarchy
2314(@samp{bbb!ccc}).@refill 2412(@samp{bbb!ccc}).
2315 2413
2316@tablesubheading{Exiting} 2414@tablesubheading{Exiting}
2317@item q 2415@item q
2318Hide the @file{*Index*} buffer.@refill 2416Hide the @file{*Index*} buffer.
2319 2417
2320@item k 2418@item k
2321Kill the @file{*Index*} buffer.@refill 2419Kill the @file{*Index*} buffer.
2322 2420
2323@item C-c = 2421@item C-c =
2324Switch to the Table of Contents buffer of this document.@refill 2422Switch to the Table of Contents buffer of this document.
2325 2423
2326@tablesubheading{Controlling what gets displayed} 2424@tablesubheading{Controlling what gets displayed}
2327@item c 2425@item c
2328@vindex reftex-index-include-context 2426@vindex reftex-index-include-context
2329Toggle the display of short context in the @file{*Index*} buffer. The 2427Toggle the display of short context in the @file{*Index*} buffer. The
2330default for this flag can be set with the variable 2428default for this flag can be set with the variable
2331@code{reftex-index-include-context}.@refill 2429@code{reftex-index-include-context}.
2332 2430
2333@item @} 2431@item @}
2334Restrict the index to a single document section. The corresponding 2432Restrict the index to a single document section. The corresponding
2335section number will be displayed in the @code{R<>} indicator in the 2433section number will be displayed in the @code{R<>} indicator in the
2336mode line and in the header of the @file{*Index*} buffer.@refill 2434mode line and in the header of the @file{*Index*} buffer.
2337 2435
2338@item @{ 2436@item @{
2339Widen the index to contain all entries of the document.@refill 2437Widen the index to contain all entries of the document.
2340 2438
2341@item < 2439@item <
2342When the index is currently restricted, move the restriction to the 2440When the index is currently restricted, move the restriction to the
2343previous section.@refill 2441previous section.
2344 2442
2345@item > 2443@item >
2346When the index is currently restricted, move the restriction to the 2444When the index is currently restricted, move the restriction to the
2347next section.@refill 2445next section.
2348 2446
2349@tablesubheading{Updating the buffer} 2447@tablesubheading{Updating the buffer}
2350@item g 2448@item g
2351Rebuild the @file{*Index*} buffer. This does @emph{not} rescan the 2449Rebuild the @file{*Index*} buffer. This does @emph{not} rescan the
2352document. However, it sorts the entries again, so that edited entries 2450document. However, it sorts the entries again, so that edited entries
2353will move to the correct position.@refill 2451will move to the correct position.
2354 2452
2355@item r 2453@item r
2356@vindex reftex-enable-partial-scans 2454@vindex reftex-enable-partial-scans
2357Reparse the LaTeX document and rebuild the @file{*Index*} buffer. When 2455Reparse the LaTeX document and rebuild the @file{*Index*} buffer. When
2358@code{reftex-enable-partial-scans} is non-@code{nil}, rescan only the file this 2456@code{reftex-enable-partial-scans} is non-@code{nil}, rescan only the file this
2359location is defined in, not the entire document.@refill 2457location is defined in, not the entire document.
2360 2458
2361@item C-u r 2459@item C-u r
2362Reparse the @emph{entire} LaTeX document and rebuild the @file{*Index*} 2460Reparse the @emph{entire} LaTeX document and rebuild the @file{*Index*}
2363buffer.@refill 2461buffer.
2364 2462
2365@item s 2463@item s
2366Switch to a different index (for documents with multiple 2464Switch to a different index (for documents with multiple
2367indices).@refill 2465indices).
2368@end table 2466@end table
2369 2467
2370 2468
@@ -2481,7 +2579,7 @@ This would be done like this
2481which specifies that the macro identified with the character @code{?x} (the 2579which specifies that the macro identified with the character @code{?x} (the
2482@code{\ix} macro) should be used for indexing phrases and words already 2580@code{\ix} macro) should be used for indexing phrases and words already
2483in the buffer with @kbd{C-c /} (@code{reftex-index-selection-or-word}). 2581in the buffer with @kbd{C-c /} (@code{reftex-index-selection-or-word}).
2484The index tag is "idx".@refill 2582The index tag is "idx".
2485 2583
2486@node Viewing Cross-References, RefTeXs Menu, Index Support, Top 2584@node Viewing Cross-References, RefTeXs Menu, Index Support, Top
2487@chapter Viewing Cross--References 2585@chapter Viewing Cross--References
@@ -2495,13 +2593,13 @@ if two document locations are linked, @b{Ref@TeX{}} can display the
2495matching location(s) in another window. The @code{\label} and @code{\ref} 2593matching location(s) in another window. The @code{\label} and @code{\ref}
2496macros are one way of establishing such a link. Also, a @code{\cite} 2594macros are one way of establishing such a link. Also, a @code{\cite}
2497macro is linked to the corresponding @code{\bibitem} macro or a BibTeX 2595macro is linked to the corresponding @code{\bibitem} macro or a BibTeX
2498database entry.@refill 2596database entry.
2499 2597
2500The feature is invoked by pressing @kbd{C-c &} 2598The feature is invoked by pressing @kbd{C-c &}
2501(@code{reftex-view-crossref}) while point is on the @var{key} argument 2599(@code{reftex-view-crossref}) while point is on the @var{key} argument
2502of a macro involved in cross--referencing. You can also click with 2600of a macro involved in cross--referencing. You can also click with
2503@kbd{S-mouse-2} on the macro argument. Here is what will happen for 2601@kbd{S-mouse-2} on the macro argument. Here is what will happen for
2504individual classes of macros:@refill 2602individual classes of macros:
2505 2603
2506@table @asis 2604@table @asis
2507 2605
@@ -2512,7 +2610,7 @@ variants@footnote{all macros that start with @samp{ref} or end with
2512@samp{ref} or @samp{refrange}} of the @code{\ref} macro are active for 2610@samp{ref} or @samp{refrange}} of the @code{\ref} macro are active for
2513cross--reference display. This works also for labels defined in an 2611cross--reference display. This works also for labels defined in an
2514external document when the current document refers to them through the 2612external document when the current document refers to them through the
2515@code{xr} interface (@pxref{xr (LaTeX package)}).@refill 2613@code{xr} interface (@pxref{xr (LaTeX package)}).
2516 2614
2517@item @code{\label} 2615@item @code{\label}
2518@cindex @code{\label} 2616@cindex @code{\label}
@@ -2521,20 +2619,20 @@ Display a document location which references this label. Pressing
2521@kbd{C-c &} several times moves through the entire document and finds 2619@kbd{C-c &} several times moves through the entire document and finds
2522all locations. Not only the @code{\label} macro but also other macros 2620all locations. Not only the @code{\label} macro but also other macros
2523with label arguments (as configured with @code{reftex-label-alist}) are 2621with label arguments (as configured with @code{reftex-label-alist}) are
2524active for cross--reference display.@refill 2622active for cross--reference display.
2525 2623
2526@item @code{\cite} 2624@item @code{\cite}
2527@cindex @code{\cite} 2625@cindex @code{\cite}
2528Display the corresponding BibTeX database entry or @code{\bibitem}. 2626Display the corresponding BibTeX database entry or @code{\bibitem}.
2529All usual variants@footnote{all macros that either start or end with 2627All usual variants@footnote{all macros that either start or end with
2530@samp{cite}} of the @code{\cite} macro are active for cross--reference 2628@samp{cite}} of the @code{\cite} macro are active for cross--reference
2531display.@refill 2629display.
2532 2630
2533@item @code{\bibitem} 2631@item @code{\bibitem}
2534@cindex @code{\bibitem} 2632@cindex @code{\bibitem}
2535Display a document location which cites this article. Pressing 2633Display a document location which cites this article. Pressing
2536@kbd{C-c &} several times moves through the entire document and finds 2634@kbd{C-c &} several times moves through the entire document and finds
2537all locations.@refill 2635all locations.
2538 2636
2539@item BibTeX 2637@item BibTeX
2540@cindex BibTeX buffer, viewing cite locations from 2638@cindex BibTeX buffer, viewing cite locations from
@@ -2544,14 +2642,14 @@ document where the database entry at point is cited will be displayed.
2544On first use, @b{Ref@TeX{}} will prompt for a buffer which belongs to 2642On first use, @b{Ref@TeX{}} will prompt for a buffer which belongs to
2545the document you want to search. Subsequent calls will use the same 2643the document you want to search. Subsequent calls will use the same
2546document, until you break this link with a prefix argument to @kbd{C-c 2644document, until you break this link with a prefix argument to @kbd{C-c
2547&}.@refill 2645&}.
2548 2646
2549@item @code{\index} 2647@item @code{\index}
2550@cindex @code{\index} 2648@cindex @code{\index}
2551Display other locations in the document which are marked by an index 2649Display other locations in the document which are marked by an index
2552macro with the same key argument. Along with the standard @code{\index} 2650macro with the same key argument. Along with the standard @code{\index}
2553and @code{\glossary} macros, all macros configured in 2651and @code{\glossary} macros, all macros configured in
2554@code{reftex-index-macros} will be recognized.@refill 2652@code{reftex-index-macros} will be recognized.
2555@end table 2653@end table
2556 2654
2557@vindex reftex-view-crossref-extra 2655@vindex reftex-view-crossref-extra
@@ -2572,7 +2670,7 @@ in the variable @code{reftex-view-crossref-extra}.
2572which support this. From this menu you can access all of 2670which support this. From this menu you can access all of
2573@b{Ref@TeX{}}'s commands and a few of its options. There is also a 2671@b{Ref@TeX{}}'s commands and a few of its options. There is also a
2574@code{Customize} submenu which can be used to access @b{Ref@TeX{}}'s 2672@code{Customize} submenu which can be used to access @b{Ref@TeX{}}'s
2575entire set of options.@refill 2673entire set of options.
2576 2674
2577@node Key Bindings, Faces, RefTeXs Menu, Top 2675@node Key Bindings, Faces, RefTeXs Menu, Top
2578@section Default Key Bindings 2676@section Default Key Bindings
@@ -2609,10 +2707,10 @@ Here is a summary of the available key bindings.
2609 2707
2610Note that the @kbd{S-mouse-2} binding is only provided if this key is 2708Note that the @kbd{S-mouse-2} binding is only provided if this key is
2611not already used by some other package. @b{Ref@TeX{}} will not override an 2709not already used by some other package. @b{Ref@TeX{}} will not override an
2612existing binding to @kbd{S-mouse-2}.@refill 2710existing binding to @kbd{S-mouse-2}.
2613 2711
2614Personally, I also bind some functions in the users @kbd{C-c} map for 2712Personally, I also bind some functions in the users @kbd{C-c} map for
2615easier access.@refill 2713easier access.
2616 2714
2617@c FIXME: Do we need bindings for the Index macros here as well? 2715@c FIXME: Do we need bindings for the Index macros here as well?
2618@c C-c i C-c I or so???? 2716@c C-c i C-c I or so????
@@ -2658,7 +2756,7 @@ the ones defined in @file{font-lock.el}. Therefore, @b{Ref@TeX{}} will
2658use faces only when @code{font-lock} is loaded. This seems to be 2756use faces only when @code{font-lock} is loaded. This seems to be
2659reasonable because people who like faces will very likely have it 2757reasonable because people who like faces will very likely have it
2660loaded. If you wish to turn off fontification or change the involved 2758loaded. If you wish to turn off fontification or change the involved
2661faces, see @ref{Options (Fontification)}.@refill 2759faces, see @ref{Options (Fontification)}.
2662 2760
2663@node Multifile Documents, Language Support, AUCTeX, Top 2761@node Multifile Documents, Language Support, AUCTeX, Top
2664@section Multifile Documents 2762@section Multifile Documents
@@ -2666,7 +2764,7 @@ faces, see @ref{Options (Fontification)}.@refill
2666@cindex Documents, spread over files 2764@cindex Documents, spread over files
2667 2765
2668The following is relevant when working with documents spread over many 2766The following is relevant when working with documents spread over many
2669files:@refill 2767files:
2670 2768
2671@itemize @bullet 2769@itemize @bullet
2672@item 2770@item
@@ -2674,7 +2772,7 @@ files:@refill
2674several (multifile) documents at the same time without conflicts. 2772several (multifile) documents at the same time without conflicts.
2675@b{Ref@TeX{}} provides functions to run @code{grep}, @code{search} and 2773@b{Ref@TeX{}} provides functions to run @code{grep}, @code{search} and
2676@code{query-replace} on all files which are part of a multifile 2774@code{query-replace} on all files which are part of a multifile
2677document.@refill 2775document.
2678 2776
2679@item 2777@item
2680@vindex tex-main-file 2778@vindex tex-main-file
@@ -2683,7 +2781,7 @@ All files belonging to a multifile document should define a File
2683Variable (@code{TeX-master} for AUCTeX or @code{tex-main-file} for the 2781Variable (@code{TeX-master} for AUCTeX or @code{tex-main-file} for the
2684standard Emacs LaTeX mode) containing the name of the master file. For 2782standard Emacs LaTeX mode) containing the name of the master file. For
2685example, to set the file variable @code{TeX-master}, include something 2783example, to set the file variable @code{TeX-master}, include something
2686like the following at the end of each TeX file:@refill 2784like the following at the end of each TeX file:
2687 2785
2688@example 2786@example
2689%%% Local Variables: *** 2787%%% Local Variables: ***
@@ -2703,14 +2801,14 @@ this comment automatically. For more details see the documentation of
2703the AUCTeX (@pxref{Multifile,,,auctex, The AUC TeX User Manual}), the 2801the AUCTeX (@pxref{Multifile,,,auctex, The AUC TeX User Manual}), the
2704documentation about the Emacs (La)TeX mode (@pxref{TeX Print,,,emacs, 2802documentation about the Emacs (La)TeX mode (@pxref{TeX Print,,,emacs,
2705The GNU Emacs Manual}) and the Emacs documentation on File Variables 2803The GNU Emacs Manual}) and the Emacs documentation on File Variables
2706(@pxref{File Variables,,,emacs, The GNU Emacs Manual}).@refill 2804(@pxref{File Variables,,,emacs, The GNU Emacs Manual}).
2707 2805
2708@item 2806@item
2709The context of a label definition must be found in the same file as the 2807The context of a label definition must be found in the same file as the
2710label itself in order to be processed correctly by @b{Ref@TeX{}}. The only 2808label itself in order to be processed correctly by @b{Ref@TeX{}}. The only
2711exception is that section labels referring to a section statement 2809exception is that section labels referring to a section statement
2712outside the current file can still use that section title as 2810outside the current file can still use that section title as
2713context.@refill 2811context.
2714@end itemize 2812@end itemize
2715 2813
2716@node Language Support, Finding Files, Multifile Documents, Top 2814@node Language Support, Finding Files, Multifile Documents, Top
@@ -2853,7 +2951,7 @@ books, where some of it still might be useful.}
2853Implementing the principle of least surprises, the default settings of 2951Implementing the principle of least surprises, the default settings of
2854@b{Ref@TeX{}} ensure a safe ride for beginners and casual users. However, 2952@b{Ref@TeX{}} ensure a safe ride for beginners and casual users. However,
2855when using @b{Ref@TeX{}} for a large project and/or on a small computer, 2953when using @b{Ref@TeX{}} for a large project and/or on a small computer,
2856there are ways to improve speed or memory usage.@refill 2954there are ways to improve speed or memory usage.
2857 2955
2858@itemize @bullet 2956@itemize @bullet
2859@item 2957@item
@@ -2887,7 +2985,7 @@ table-of-contents buffer will only prompt scanning of the file in which
2887the label or section macro near the cursor was defined. Re-parsing of 2985the label or section macro near the cursor was defined. Re-parsing of
2888the entire document is still available by using @kbd{C-u C-u} as a 2986the entire document is still available by using @kbd{C-u C-u} as a
2889prefix, or the capital @kbd{R} key in the menus. To use this feature, 2987prefix, or the capital @kbd{R} key in the menus. To use this feature,
2890try@refill 2988try
2891 2989
2892@vindex reftex-enable-partial-scans 2990@vindex reftex-enable-partial-scans
2893@lisp 2991@lisp
@@ -2906,7 +3004,7 @@ for storing information about a document with master file
2906@file{MASTER.tex}. It is written automatically when you kill a buffer 3004@file{MASTER.tex}. It is written automatically when you kill a buffer
2907in @code{reftex-mode} or when you exit Emacs. The information is 3005in @code{reftex-mode} or when you exit Emacs. The information is
2908restored when you begin working with a document in a new editing 3006restored when you begin working with a document in a new editing
2909session. To use this feature, put into @file{.emacs}:@refill 3007session. To use this feature, put into @file{.emacs}:
2910 3008
2911@vindex reftex-save-parse-info 3009@vindex reftex-save-parse-info
2912@lisp 3010@lisp
@@ -2914,6 +3012,25 @@ session. To use this feature, put into @file{.emacs}:@refill
2914@end lisp 3012@end lisp
2915 3013
2916@item 3014@item
3015@b{Identifying label types by prefix}@*
3016@cindex Parse information, saving to a file
3017@vindex reftex-trust-label-prefix
3018@b{Ref@TeX{}} normally parses around each label to check in which
3019environment this label is located, in order to assign a label type to
3020the label. If your document contains thousands of labels, document
3021parsing will take considerable time. If you have been using label prefixes
3022like tab: and fn: consistently, you can tell @b{Ref@TeX{}} to get the
3023label type directly from the prefix, without additional parsing. This
3024will be faster and also allow labels to end up in the correct category
3025if for some reason it is not possible to derive the correct type from
3026context. For example, to enable this feature for footnote and
3027equation labels, use
3028
3029@lisp
3030(setq reftex-trust-label-prefix '("fn:" "eq:"))
3031@end lisp
3032
3033@item
2917@b{Automatic Document Scans}@* 3034@b{Automatic Document Scans}@*
2918@cindex Automatic document scans 3035@cindex Automatic document scans
2919@cindex Document scanning, automatic 3036@cindex Document scanning, automatic
@@ -2927,7 +3044,7 @@ document. If this gets into your way, it can be turned off with
2927 3044
2928@b{Ref@TeX{}} will then occasionally annotate new labels in the selection 3045@b{Ref@TeX{}} will then occasionally annotate new labels in the selection
2929buffer, saying that their position in the label list in uncertain. A 3046buffer, saying that their position in the label list in uncertain. A
2930manual document scan will fix this.@refill 3047manual document scan will fix this.
2931 3048
2932@item 3049@item
2933@b{Multiple Selection Buffers}@* 3050@b{Multiple Selection Buffers}@*
@@ -2941,7 +3058,7 @@ from one selection to the next. These buffers are updated automatically
2941only when a new label has been added in the buffers category with 3058only when a new label has been added in the buffers category with
2942@code{reftex-label}. Updating the buffer takes as long as recreating it 3059@code{reftex-label}. Updating the buffer takes as long as recreating it
2943- so the time saving is limited to cases where no new labels of that 3060- so the time saving is limited to cases where no new labels of that
2944category have been added. To turn on this feature, use@refill 3061category have been added. To turn on this feature, use
2945 3062
2946@vindex reftex-use-multiple-selection-buffers 3063@vindex reftex-use-multiple-selection-buffers
2947@lisp 3064@lisp
@@ -2953,7 +3070,7 @@ category have been added. To turn on this feature, use@refill
2953You can also inhibit the automatic updating entirely. Then the 3070You can also inhibit the automatic updating entirely. Then the
2954selection buffer will always pop up very fast, but may not contain the 3071selection buffer will always pop up very fast, but may not contain the
2955most recently defined labels. You can always update the buffer by hand, 3072most recently defined labels. You can always update the buffer by hand,
2956with the @kbd{g} key. To get this behavior, use instead@refill 3073with the @kbd{g} key. To get this behavior, use instead
2957 3074
2958@vindex reftex-auto-update-selection-buffers 3075@vindex reftex-auto-update-selection-buffers
2959@lisp 3076@lisp
@@ -2984,8 +3101,7 @@ AUCTeX is without doubt the best major mode for editing TeX and LaTeX
2984files with Emacs (@pxref{Top,AUCTeX,,auctex, The AUCTeX User Manual}). 3101files with Emacs (@pxref{Top,AUCTeX,,auctex, The AUCTeX User Manual}).
2985If AUCTeX is not part of your Emacs distribution, you can get 3102If AUCTeX is not part of your Emacs distribution, you can get
2986it@footnote{XEmacs 21.x users may want to install the corresponding 3103it@footnote{XEmacs 21.x users may want to install the corresponding
2987XEmacs package.} by ftp from the 3104XEmacs package.} by ftp from the @value{AUCTEXSITE}.
2988@uref{ftp://ftp.gnu.org/pub/gnu/auctex,AUCTeX distribution site}.
2989 3105
2990@menu 3106@menu
2991* AUCTeX-RefTeX Interface:: How both packages work together 3107* AUCTeX-RefTeX Interface:: How both packages work together
@@ -3002,7 +3118,7 @@ using @b{Ref@TeX{}}'s commands directly, you can then also use them
3002indirectly as part of the AUCTeX 3118indirectly as part of the AUCTeX
3003environment@footnote{@b{Ref@TeX{}} 4.0 and AUCTeX 9.10c will be 3119environment@footnote{@b{Ref@TeX{}} 4.0 and AUCTeX 9.10c will be
3004needed for all of this to work. Parts of it work also with earlier 3120needed for all of this to work. Parts of it work also with earlier
3005versions.}. The interface is turned on with@refill 3121versions.}. The interface is turned on with
3006 3122
3007@lisp 3123@lisp
3008(setq reftex-plug-into-AUCTeX t) 3124(setq reftex-plug-into-AUCTeX t)
@@ -3046,7 +3162,7 @@ will offer its default label which is derived from the section title.
3046@item 3162@item
3047@b{AUCTeX tells @b{Ref@TeX{}} about new sections}@* 3163@b{AUCTeX tells @b{Ref@TeX{}} about new sections}@*
3048When creating a new section with @kbd{C-c C-s}, @b{Ref@TeX{}} will not 3164When creating a new section with @kbd{C-c C-s}, @b{Ref@TeX{}} will not
3049have to rescan the buffer in order to see it.@refill 3165have to rescan the buffer in order to see it.
3050 3166
3051@item 3167@item
3052@findex reftex-arg-label 3168@findex reftex-arg-label
@@ -3070,7 +3186,7 @@ old functionality when you later decide to turn off the interface.} and
3070supplies the macro arguments with @b{Ref@TeX{}'s} mechanisms. For 3186supplies the macro arguments with @b{Ref@TeX{}'s} mechanisms. For
3071example, when you type @kbd{C-c @key{RET} ref @key{RET}}, @b{Ref@TeX{}} 3187example, when you type @kbd{C-c @key{RET} ref @key{RET}}, @b{Ref@TeX{}}
3072will supply its label selection process (@pxref{Referencing 3188will supply its label selection process (@pxref{Referencing
3073Labels}).@refill 3189Labels}).
3074 3190
3075@item 3191@item
3076@b{@b{Ref@TeX{}} tells AUCTeX about new labels, citation-- and index keys}@* 3192@b{@b{Ref@TeX{}} tells AUCTeX about new labels, citation-- and index keys}@*
@@ -3088,16 +3204,16 @@ commands of a document (@pxref{Style Files,,,auctex}). Support for
3088defines macros or environments connected with labels, citations, or the 3204defines macros or environments connected with labels, citations, or the
3089index. Many style files (e.g. @file{amsmath.el} or @file{natbib.el}) 3205index. Many style files (e.g. @file{amsmath.el} or @file{natbib.el})
3090distributed with AUCTeX already support @b{Ref@TeX{}} in this 3206distributed with AUCTeX already support @b{Ref@TeX{}} in this
3091way.@refill 3207way.
3092 3208
3093Before calling a @b{Ref@TeX{}} function, the style hook should always 3209Before calling a @b{Ref@TeX{}} function, the style hook should always
3094test for the availability of the function, so that the style file will 3210test for the availability of the function, so that the style file will
3095also work for people who do not use @b{Ref@TeX{}}. @refill 3211also work for people who do not use @b{Ref@TeX{}}.
3096 3212
3097Additions made with style files in the way described below remain local 3213Additions made with style files in the way described below remain local
3098to the current document. For example, if one package uses AMSTeX, the 3214to the current document. For example, if one package uses AMSTeX, the
3099style file will make @b{Ref@TeX{}} switch over to @code{\eqref}, but 3215style file will make @b{Ref@TeX{}} switch over to @code{\eqref}, but
3100this will not affect other documents.@refill 3216this will not affect other documents.
3101 3217
3102@findex reftex-add-label-environments 3218@findex reftex-add-label-environments
3103@findex reftex-add-to-label-alist 3219@findex reftex-add-to-label-alist
@@ -3107,7 +3223,7 @@ function @code{reftex-add-to-label-alist} which is still available as an
3107alias for compatibility.} which defines additions to 3223alias for compatibility.} which defines additions to
3108@code{reftex-label-alist}. The argument taken by this function must have 3224@code{reftex-label-alist}. The argument taken by this function must have
3109the same format as @code{reftex-label-alist}. The @file{amsmath.el} 3225the same format as @code{reftex-label-alist}. The @file{amsmath.el}
3110style file of AUCTeX for example contains the following:@refill 3226style file of AUCTeX for example contains the following:
3111 3227
3112@lisp 3228@lisp
3113@group 3229@group
@@ -3121,7 +3237,7 @@ style file of AUCTeX for example contains the following:@refill
3121@noindent 3237@noindent
3122@findex LaTeX-add-environments, @r{AUCTeX} 3238@findex LaTeX-add-environments, @r{AUCTeX}
3123while a package @code{myprop} defining a @code{proposition} environment 3239while a package @code{myprop} defining a @code{proposition} environment
3124with @code{\newtheorem} might use@refill 3240with @code{\newtheorem} might use
3125 3241
3126@lisp 3242@lisp
3127@group 3243@group
@@ -3139,7 +3255,7 @@ with @code{\newtheorem} might use@refill
3139Similarly, a style hook may contain a call to 3255Similarly, a style hook may contain a call to
3140@code{reftex-set-cite-format} to set the citation format. The style 3256@code{reftex-set-cite-format} to set the citation format. The style
3141file @file{natbib.el} for the Natbib citation style does switch 3257file @file{natbib.el} for the Natbib citation style does switch
3142@b{Ref@TeX{}}'s citation format like this:@refill 3258@b{Ref@TeX{}}'s citation format like this:
3143 3259
3144@lisp 3260@lisp
3145(TeX-add-style-hook "natbib" 3261(TeX-add-style-hook "natbib"
@@ -3210,14 +3326,14 @@ support for that: @code{reftex-view-crossref} (bound to @kbd{C-c
3210highlighting is provided (among other things) by Peter S. Galbraith's 3326highlighting is provided (among other things) by Peter S. Galbraith's
3211@file{bib-cite.el}. There is some overlap in the functionalities of 3327@file{bib-cite.el}. There is some overlap in the functionalities of
3212Bib-cite and @b{Ref@TeX{}}. Bib-cite.el comes bundled with 3328Bib-cite and @b{Ref@TeX{}}. Bib-cite.el comes bundled with
3213AUCTeX.@refill 3329AUCTeX.
3214 3330
3215Bib-cite version 3.06 and later can be configured so that bib-cite's 3331Bib-cite version 3.06 and later can be configured so that bib-cite's
3216mouse functions use @b{Ref@TeX{}} for displaying references and citations. 3332mouse functions use @b{Ref@TeX{}} for displaying references and citations.
3217This can be useful in particular when working with the LaTeX @code{xr} 3333This can be useful in particular when working with the LaTeX @code{xr}
3218package or with an explicit @code{thebibliography} environment (rather 3334package or with an explicit @code{thebibliography} environment (rather
3219than BibTeX). Bib-cite cannot handle those, but @b{Ref@TeX{}} does. To 3335than BibTeX). Bib-cite cannot handle those, but @b{Ref@TeX{}} does. To
3220make use of this feature, try@refill 3336make use of this feature, try
3221 3337
3222@vindex bib-cite-use-reftex-view-crossref 3338@vindex bib-cite-use-reftex-view-crossref
3223@lisp 3339@lisp
@@ -3234,13 +3350,13 @@ make use of this feature, try@refill
3234@b{LaTeX commands}@* 3350@b{LaTeX commands}@*
3235@cindex LaTeX commands, not found 3351@cindex LaTeX commands, not found
3236@code{\input}, @code{\include}, and @code{\section} (etc.) statements 3352@code{\input}, @code{\include}, and @code{\section} (etc.) statements
3237have to be first on a line (except for white space).@refill 3353have to be first on a line (except for white space).
3238 3354
3239@item 3355@item
3240@b{Commented regions}@* 3356@b{Commented regions}@*
3241@cindex Labels, commented out 3357@cindex Labels, commented out
3242@b{Ref@TeX{}} sees also labels in regions commented out and will refuse to 3358@b{Ref@TeX{}} sees also labels in regions commented out and will refuse to
3243make duplicates of such labels. This is considered to be a feature.@refill 3359make duplicates of such labels. This is considered to be a feature.
3244 3360
3245@item 3361@item
3246@b{Wrong section numbers}@* 3362@b{Wrong section numbers}@*
@@ -3248,7 +3364,7 @@ make duplicates of such labels. This is considered to be a feature.@refill
3248@vindex reftex-enable-partial-scans 3364@vindex reftex-enable-partial-scans
3249When using partial scans (@code{reftex-enable-partial-scans}), the section 3365When using partial scans (@code{reftex-enable-partial-scans}), the section
3250numbers in the table of contents may eventually become wrong. A full 3366numbers in the table of contents may eventually become wrong. A full
3251scan will fix this.@refill 3367scan will fix this.
3252 3368
3253@item 3369@item
3254@b{Local settings}@* 3370@b{Local settings}@*
@@ -3263,7 +3379,7 @@ documents, you should use AUCTeX and set up style files with calls to
3263@code{reftex-add-label-environments}, @code{reftex-set-cite-format}, 3379@code{reftex-add-label-environments}, @code{reftex-set-cite-format},
3264@code{reftex-add-index-macros}, and @code{reftex-add-section-levels}. 3380@code{reftex-add-index-macros}, and @code{reftex-add-section-levels}.
3265Settings made with these functions remain local to the current 3381Settings made with these functions remain local to the current
3266document. @xref{AUCTeX}.@refill 3382document. @xref{AUCTeX}.
3267 3383
3268@item 3384@item
3269@b{Funny display in selection buffer}@* 3385@b{Funny display in selection buffer}@*
@@ -3282,21 +3398,21 @@ literally for speed reasons. Then both short context and section
3282headings may look different from what you usually see on your screen. 3398headings may look different from what you usually see on your screen.
3283In rare cases @code{reftex-toc} may have problems to jump to an affected 3399In rare cases @code{reftex-toc} may have problems to jump to an affected
3284section heading. There are three possible ways to deal with 3400section heading. There are three possible ways to deal with
3285this:@refill 3401this:
3286@itemize @minus 3402@itemize @minus
3287@item 3403@item
3288@vindex reftex-keep-temporary-buffers 3404@vindex reftex-keep-temporary-buffers
3289@code{(setq reftex-keep-temporary-buffers t)}@* 3405@code{(setq reftex-keep-temporary-buffers t)}@*
3290This implies that @b{Ref@TeX{}} will load all parts of a multifile 3406This implies that @b{Ref@TeX{}} will load all parts of a multifile
3291document into Emacs (i.e. there won't be any temporary buffers).@refill 3407document into Emacs (i.e. there won't be any temporary buffers).
3292@item 3408@item
3293@vindex reftex-initialize-temporary-buffers 3409@vindex reftex-initialize-temporary-buffers
3294@code{(setq reftex-initialize-temporary-buffers t)}@* 3410@code{(setq reftex-initialize-temporary-buffers t)}@*
3295This means full initialization of temporary buffers. It involves 3411This means full initialization of temporary buffers. It involves
3296a penalty when the same unvisited file is used for lookup often.@refill 3412a penalty when the same unvisited file is used for lookup often.
3297@item 3413@item
3298Set @code{reftex-initialize-temporary-buffers} to a list of hook 3414Set @code{reftex-initialize-temporary-buffers} to a list of hook
3299functions doing a minimal initialization.@refill 3415functions doing a minimal initialization.
3300@end itemize 3416@end itemize
3301@vindex reftex-refontify-context 3417@vindex reftex-refontify-context
3302See also the variable @code{reftex-refontify-context}. 3418See also the variable @code{reftex-refontify-context}.
@@ -3332,7 +3448,7 @@ The first line is just a normal configuration for a macro. For the
3332argument (which really is a second argument to the macro @code{\begin}) 3448argument (which really is a second argument to the macro @code{\begin})
3333as a label of type @code{?p}. Argument count for this macro starts only 3449as a label of type @code{?p}. Argument count for this macro starts only
3334after the @samp{@{step+@}}, also when specifying how to get 3450after the @samp{@{step+@}}, also when specifying how to get
3335context.@refill 3451context.
3336 3452
3337@item 3453@item
3338@b{Idle timers in XEmacs}@* 3454@b{Idle timers in XEmacs}@*
@@ -3352,7 +3468,7 @@ this bug gets fixed, a real idle timer can be requested with
3352@cindex Key bindings, problems with Viper mode 3468@cindex Key bindings, problems with Viper mode
3353@findex viper-harness-minor-mode 3469@findex viper-harness-minor-mode
3354With @i{Viper} mode prior to Vipers version 3.01, you need to protect 3470With @i{Viper} mode prior to Vipers version 3.01, you need to protect
3355@b{Ref@TeX{}}'s keymaps with@refill 3471@b{Ref@TeX{}}'s keymaps with
3356 3472
3357@lisp 3473@lisp
3358(viper-harness-minor-mode "reftex") 3474(viper-harness-minor-mode "reftex")
@@ -3373,19 +3489,19 @@ With @i{Viper} mode prior to Vipers version 3.01, you need to protect
3373 3489
3374@b{Ref@TeX{}} was written by @i{Carsten Dominik} 3490@b{Ref@TeX{}} was written by @i{Carsten Dominik}
3375@email{dominik@@science.uva.nl}, with contributions by @i{Stephen 3491@email{dominik@@science.uva.nl}, with contributions by @i{Stephen
3376Eglen}. @b{Ref@TeX{}} is currently maintained by @refill 3492Eglen}. @b{Ref@TeX{}} is currently maintained by
3377 3493
3378@noindent 3494@noindent
3379Carsten Dominik @email{dominik@@science.uva.nl} 3495Carsten Dominik <dominik@@science.uva.nl>
3380 3496
3381If you have questions about @b{Ref@TeX{}}, there are several Usenet 3497If you have questions about @b{Ref@TeX{}}, there are several Usenet
3382groups which have competent readers: @code{comp.emacs}, 3498groups which have competent readers: @code{comp.emacs},
3383@code{gnu.emacs.help}, @code{comp.emacs.xemacs}, @code{comp.text.tex}. 3499@code{gnu.emacs.help}, @code{comp.emacs.xemacs}, @code{comp.text.tex},
3384You can also write directly to the maintainer. 3500@code{de.comp.text.tex}. You can also write directly to the
3501maintainer.
3385 3502
3386If you find a bug in @b{Ref@TeX{}} or its documentation, or if you want 3503If you find a bug in @b{Ref@TeX{}} or its documentation, or if you want
3387to contribute code or ideas, please 3504to contribute code or ideas, please @value{MAINTAINERCONTACT}. Remember
3388@uref{mailto:dominik@@science.uva.nl,contact the maintainer}. Remember
3389to provide all necessary information such as version numbers of Emacs 3505to provide all necessary information such as version numbers of Emacs
3390and @b{Ref@TeX{}}, and the relevant part of your configuration in 3506and @b{Ref@TeX{}}, and the relevant part of your configuration in
3391@file{.emacs}. When reporting a bug which throws an exception, please 3507@file{.emacs}. When reporting a bug which throws an exception, please
@@ -3394,31 +3510,30 @@ include a backtrace if you know how to produce one.
3394@b{Ref@TeX{}} is bundled and pre-installed with Emacs since version 20.2. 3510@b{Ref@TeX{}} is bundled and pre-installed with Emacs since version 20.2.
3395It was also bundled and pre-installed with XEmacs 19.16--20.x. XEmacs 3511It was also bundled and pre-installed with XEmacs 19.16--20.x. XEmacs
339621.x users want to install the corresponding plugin package which is 351221.x users want to install the corresponding plugin package which is
3397available from the XEmacs @code{ftp} site. See the XEmacs 21.x 3513available from the @value{XEMACSFTP}. See the XEmacs 21.x
3398documentation on package installation for details.@refill 3514documentation on package installation for details.
3399 3515
3400Users of earlier Emacs distributions (including Emacs 19) can get a 3516Users of earlier Emacs distributions (including Emacs 19) can get a
3401@b{Ref@TeX{}} distribution from the 3517@b{Ref@TeX{}} distribution from the @value{MAINTAINERSITE}. Note that
3402@uref{http://www.strw.leidenuniv.nl/~dominik/Tools/,maintainers 3518the Emacs 19 version supports many but not all features described in
3403webpage}. Note that the Emacs 19 version supports many but not all 3519this manual.
3404features described in this manual.@refill
3405 3520
3406Thanks to the people on the Net who have used @b{Ref@TeX{}} and helped 3521Thanks to the people on the Net who have used @b{Ref@TeX{}} and helped
3407developing it with their reports. In particular thanks to @i{Fran 3522developing it with their reports. In particular thanks to @i{Fran
3408Burstall, Alastair Burt, Lars Clausen, Soren Dayton, Stephen Eglen, Karl 3523Burstall, Alastair Burt, Lars Clausen, Soren Dayton, Stephen Eglen, Karl
3409Eichwalder, Erik Frik, Erik Frisk, Peter Galbraith, Kai Grossjohann, 3524Eichwalder, Erik Frisk, Peter Galbraith, Kai Grossjohann, Frank Harrell,
3410Frank Harrell, Stephan Heuel, Alan Ho, Lute Kamstra, Dieter Kraft, 3525Peter Heslin, Stephan Heuel, Alan Ho, Lute Kamstra, Dieter Kraft, David
3411Adrian Lanz, Rory Molinari, Stefan Monnier, Laurent Mugnier, Sudeep 3526Kastrup, Adrian Lanz, Rory Molinari, Stefan Monnier, Laurent Mugnier,
3412Kumar Palat, Daniel Polani, Alan Shutko, Robin Socha, Richard Stanton, 3527Sudeep Kumar Palat, Daniel Polani, Alan Shutko, Robin Socha, Richard
3413Allan Strand, Jan Vroonhof, Christoph Wedler, Alan Williams, Roland 3528Stanton, Allan Strand, Jan Vroonhof, Christoph Wedler, Alan Williams,
3414Winkler, Eli Zaretskii}.@refill 3529Roland Winkler, Hans-Christoph Wirth, Eli Zaretskii}.
3415 3530
3416The @code{view-crossref} feature was inspired by @i{Peter Galbraith's} 3531The @code{view-crossref} feature was inspired by @i{Peter Galbraith's}
3417@file{bib-cite.el}.@refill 3532@file{bib-cite.el}.
3418 3533
3419Finally thanks to @i{Uwe Bolick} who first got me (some years ago) into 3534Finally thanks to @i{Uwe Bolick} who first got me interested in
3420supporting LaTeX labels and references with an editor (which was 3535supporting LaTeX labels and references with an editor (which was
3421MicroEmacs at the time).@refill 3536MicroEmacs at the time).
3422 3537
3423@node Commands, Options, Imprint, Top 3538@node Commands, Options, Imprint, Top
3424@chapter Commands 3539@chapter Commands
@@ -3431,7 +3546,7 @@ menu. See @xref{Key Bindings}.
3431 3546
3432@deffn Command reftex-toc 3547@deffn Command reftex-toc
3433Show the table of contents for the current document. When called with 3548Show the table of contents for the current document. When called with
3434one ore two @kbd{C-u} prefixes, rescan the document first.@refill 3549one ore two @kbd{C-u} prefixes, rescan the document first.
3435@end deffn 3550@end deffn
3436 3551
3437@deffn Command reftex-label 3552@deffn Command reftex-label
@@ -3450,17 +3565,17 @@ expression, scans the buffers with BibTeX entries (taken from the
3450@code{\bibliography} command or a @code{thebibliography} environment) 3565@code{\bibliography} command or a @code{thebibliography} environment)
3451and offers the matching entries for selection. The selected entry is 3566and offers the matching entries for selection. The selected entry is
3452formatted according to @code{reftex-cite-format} and inserted into the 3567formatted according to @code{reftex-cite-format} and inserted into the
3453buffer.@refill @* 3568buffer. @*
3454When called with one or two @kbd{C-u} prefixes, first rescans the 3569When called with a @kbd{C-u} prefixe, prompt for optional arguments in
3455document. When called with a numeric prefix, make that many citations. 3570cite macros. When called with a numeric prefix, make that many citations.
3456When called with point inside the braces of a @code{\cite} command, it 3571When called with point inside the braces of a @code{\cite} command, it
3457will add another key, ignoring the value of 3572will add another key, ignoring the value of
3458@code{reftex-cite-format}.@refill @* 3573@code{reftex-cite-format}. @*
3459The regular expression uses an expanded syntax: @samp{&&} is interpreted 3574The regular expression uses an expanded syntax: @samp{&&} is interpreted
3460as @code{and}. Thus, @samp{aaaa&&bbb} matches entries which contain 3575as @code{and}. Thus, @samp{aaaa&&bbb} matches entries which contain
3461both @samp{aaaa} and @samp{bbb}. While entering the regexp, completion 3576both @samp{aaaa} and @samp{bbb}. While entering the regexp, completion
3462on knows citation keys is possible. @samp{=} is a good regular 3577on knows citation keys is possible. @samp{=} is a good regular
3463expression to match all entries in all files.@refill 3578expression to match all entries in all files.
3464@end deffn 3579@end deffn
3465 3580
3466@deffn Command reftex-index 3581@deffn Command reftex-index
@@ -3468,7 +3583,7 @@ Query for an index macro and insert it along with its arguments. The
3468index macros available are those defined in @code{reftex-index-macro} or 3583index macros available are those defined in @code{reftex-index-macro} or
3469by a call to @code{reftex-add-index-macros}, typically from an AUCTeX 3584by a call to @code{reftex-add-index-macros}, typically from an AUCTeX
3470style file. @b{Ref@TeX{}} provides completion for the index tag and the 3585style file. @b{Ref@TeX{}} provides completion for the index tag and the
3471index key, and will prompt for other arguments.@refill 3586index key, and will prompt for other arguments.
3472@end deffn 3587@end deffn
3473 3588
3474@deffn Command reftex-index-selection-or-word 3589@deffn Command reftex-index-selection-or-word
@@ -3480,7 +3595,7 @@ user have a chance to edit the index entry. When called with 2
3480@kbd{C-u} as prefix, also ask for the index macro and other stuff. When 3595@kbd{C-u} as prefix, also ask for the index macro and other stuff. When
3481called inside TeX math mode as determined by the @file{texmathp.el} 3596called inside TeX math mode as determined by the @file{texmathp.el}
3482library which is part of AUCTeX, the string is first processed with the 3597library which is part of AUCTeX, the string is first processed with the
3483@code{reftex-index-math-format}, which see.@refill 3598@code{reftex-index-math-format}, which see.
3484@end deffn 3599@end deffn
3485 3600
3486@deffn Command reftex-index-phrase-selection-or-word 3601@deffn Command reftex-index-phrase-selection-or-word
@@ -3507,7 +3622,7 @@ When the document has multiple indices, first prompts for the correct one.
3507When index support is turned off, offer to turn it on. 3622When index support is turned off, offer to turn it on.
3508With one or two @kbd{C-u} prefixes, rescan document first. 3623With one or two @kbd{C-u} prefixes, rescan document first.
3509With prefix 2, restrict index to current document section. 3624With prefix 2, restrict index to current document section.
3510With prefix 3, restrict index to active region.@refill 3625With prefix 3, restrict index to active region.
3511@end deffn 3626@end deffn
3512 3627
3513@deffn Command reftex-view-crossref 3628@deffn Command reftex-view-crossref
@@ -3532,25 +3647,25 @@ this function several times find successive citation locations.
3532@deffn Command reftex-create-tags-file 3647@deffn Command reftex-create-tags-file
3533Create TAGS file by running @code{etags} on the current document. The 3648Create TAGS file by running @code{etags} on the current document. The
3534TAGS file is also immediately visited with 3649TAGS file is also immediately visited with
3535@code{visit-tags-table}.@refill 3650@code{visit-tags-table}.
3536@end deffn 3651@end deffn
3537 3652
3538@deffn Command reftex-grep-document 3653@deffn Command reftex-grep-document
3539Run grep query through all files related to this document. 3654Run grep query through all files related to this document.
3540With prefix arg, force to rescan document. 3655With prefix arg, force to rescan document.
3541No active TAGS table is required.@refill 3656No active TAGS table is required.
3542@end deffn 3657@end deffn
3543 3658
3544@deffn Command reftex-search-document 3659@deffn Command reftex-search-document
3545Regexp search through all files of the current document. 3660Regexp search through all files of the current document.
3546Starts always in the master file. Stops when a match is found. 3661Starts always in the master file. Stops when a match is found.
3547No active TAGS table is required.@refill 3662No active TAGS table is required.
3548@end deffn 3663@end deffn
3549 3664
3550@deffn Command reftex-query-replace-document 3665@deffn Command reftex-query-replace-document
3551Run a query-replace-regexp of @var{from} with @var{to} over the entire 3666Run a query-replace-regexp of @var{from} with @var{to} over the entire
3552document. With prefix arg, replace only word-delimited matches. No 3667document. With prefix arg, replace only word-delimited matches. No
3553active TAGS table is required.@refill 3668active TAGS table is required.
3554@end deffn 3669@end deffn
3555 3670
3556@deffn Command reftex-goto-label 3671@deffn Command reftex-goto-label
@@ -3563,7 +3678,7 @@ another window.
3563@deffn Command reftex-change-label 3678@deffn Command reftex-change-label
3564Query replace @var{from} with @var{to} in all @code{\label} and 3679Query replace @var{from} with @var{to} in all @code{\label} and
3565@code{\ref} commands. Works on the entire multifile document. No 3680@code{\ref} commands. Works on the entire multifile document. No
3566active TAGS table is required.@refill 3681active TAGS table is required.
3567@end deffn 3682@end deffn
3568 3683
3569@deffn Command reftex-renumber-simple-labels 3684@deffn Command reftex-renumber-simple-labels
@@ -3575,11 +3690,19 @@ labels will be changed as well. For this, @b{Ref@TeX{}} looks at the
3575arguments of any macros which either start or end with the string 3690arguments of any macros which either start or end with the string
3576@samp{ref}. This command should be used with care, in particular in 3691@samp{ref}. This command should be used with care, in particular in
3577multifile documents. You should not use it if another document refers 3692multifile documents. You should not use it if another document refers
3578to this one with the @code{xr} package.@refill 3693to this one with the @code{xr} package.
3579@end deffn 3694@end deffn
3580 3695
3581@deffn Command reftex-find-duplicate-labels 3696@deffn Command reftex-find-duplicate-labels
3582Produce a list of all duplicate labels in the document.@refill 3697Produce a list of all duplicate labels in the document.
3698@end deffn
3699
3700@deffn Command reftex-create-bibtex-file
3701Create a new BibTeX database file with all entries referenced in document.
3702The command prompts for a filename and writes the collected entries to
3703that file. Only entries referenced in the current document with
3704any @code{\cite}-like macros are used.
3705The sequence in the new file is the same as it was in the old database.
3583@end deffn 3706@end deffn
3584 3707
3585@deffn Command reftex-customize 3708@deffn Command reftex-customize
@@ -3607,7 +3730,7 @@ Here is a complete list of @b{Ref@TeX{}}'s configuration variables. All
3607variables have customize support - so if you are not familiar with Emacs 3730variables have customize support - so if you are not familiar with Emacs
3608Lisp (and even if you are) you might find it more comfortable to use 3731Lisp (and even if you are) you might find it more comfortable to use
3609@code{customize} to look at and change these variables. @kbd{M-x 3732@code{customize} to look at and change these variables. @kbd{M-x
3610reftex-customize} will get you there.@refill 3733reftex-customize} will get you there.
3611 3734
3612@menu 3735@menu
3613* Options (Table of Contents):: 3736* Options (Table of Contents)::
@@ -3643,16 +3766,21 @@ Standard LaTeX needs 7, default is 12.
3643Commands and levels used for defining sections in the document. The 3766Commands and levels used for defining sections in the document. The
3644@code{car} of each cons cell is the name of the section macro. The 3767@code{car} of each cons cell is the name of the section macro. The
3645@code{cdr} is a number indicating its level. A negative level means the 3768@code{cdr} is a number indicating its level. A negative level means the
3646same as the positive value, but the section will never get a 3769same as the positive value, but the section will never get a number.
3647number. The @code{cdr} may also be a function which then has to return 3770The @code{cdr} may also be a function which then has to return the
3648the level.@refill 3771level. This list is also used for promotion and demption of sectioning
3772commands. If you are using a document class which has several sets of
3773sectioning commands, promotion only works correctly if this list is
3774sorted first by set, then within each set by level. The promotion
3775commands always select the nearest entry with the correct new level.
3776
3649@end defopt 3777@end defopt
3650 3778
3651@defopt reftex-toc-max-level 3779@defopt reftex-toc-max-level
3652The maximum level of toc entries which will be included in the TOC. 3780The maximum level of toc entries which will be included in the TOC.
3653Section headings with a bigger level will be ignored. In RefTeX, 3781Section headings with a bigger level will be ignored. In RefTeX,
3654chapters are level 1, sections level 2 etc. This variable can be 3782chapters are level 1, sections level 2 etc. This variable can be
3655changed from within the @file{*toc*} buffer with the @kbd{t} key.@refill 3783changed from within the @file{*toc*} buffer with the @kbd{t} key.
3656@end defopt 3784@end defopt
3657 3785
3658@defopt reftex-part-resets-chapter 3786@defopt reftex-part-resets-chapter
@@ -3664,11 +3792,21 @@ chapter counter and also do not show up in chapter numbers.
3664@end defopt 3792@end defopt
3665 3793
3666@defopt reftex-auto-recenter-toc 3794@defopt reftex-auto-recenter-toc
3667Non-@code{nil} means, initially turn automatic recentering of toc on. 3795Non-@code{nil} means, turn automatic recentering of @file{*TOC*} window on.
3668When active, the @file{*TOC*} buffer will always show the section you 3796When active, the @file{*TOC*} window will always show the section you
3669are currently working in. Recentering happens whenever Emacs is idle 3797are currently working in. Recentering happens whenever Emacs is idle for
3670for more than `reftex-idle-time' seconds. 3798more than @code{reftex-idle-time} seconds.
3671This feature can be turned on and off from the menu 3799
3800Value @code{t} means, turn on immediately when RefTeX gets started. Then,
3801recentering will work for any toc window created during the session.
3802
3803Value @code{frame} (the default) means, turn automatic recentering on
3804only while the dedicated TOC frame does exist, and do the recentering
3805only in that frame. So when creating that frame (with @kbd{d} key in an
3806ordinary TOC window), the automatic recentering is turned on. When the
3807frame gets destroyed, automatic recentering is turned off again.
3808
3809This feature can be turned on and off from the menu
3672(Ref->Options). 3810(Ref->Options).
3673@end defopt 3811@end defopt
3674 3812
@@ -3677,10 +3815,8 @@ Non-@code{nil} means, create TOC window by splitting window
3677horizontally. The default is to split vertically. 3815horizontally. The default is to split vertically.
3678@end defopt 3816@end defopt
3679 3817
3680@defopt reftex-toc-split-windows-horizontally-fraction 3818@defopt reftex-toc-split-windows-fraction
3681Fraction of the horizontal width of the frame to be used for TOC window. 3819Fraction of the width or height of the frame to be used for TOC window.
3682Only relevant when @code{reftex-toc-split-windows-horizontally} is
3683non-@code{nil}.
3684@end defopt 3820@end defopt
3685 3821
3686@defopt reftex-toc-keep-other-windows 3822@defopt reftex-toc-keep-other-windows
@@ -3688,19 +3824,19 @@ Non-@code{nil} means, split the selected window to display the
3688@file{*toc*} buffer. This helps to keep the window configuration, but 3824@file{*toc*} buffer. This helps to keep the window configuration, but
3689makes the @file{*toc*} small. When @code{nil}, all other windows except 3825makes the @file{*toc*} small. When @code{nil}, all other windows except
3690the selected one will be deleted, so that the @file{*toc*} window fills 3826the selected one will be deleted, so that the @file{*toc*} window fills
3691half the frame.@refill 3827half the frame.
3692@end defopt 3828@end defopt
3693 3829
3694@defopt reftex-toc-include-file-boundaries 3830@defopt reftex-toc-include-file-boundaries
3695Non-@code{nil} means, include file boundaries in @file{*toc*} buffer. 3831Non-@code{nil} means, include file boundaries in @file{*toc*} buffer.
3696This flag can be toggled from within the @file{*toc*} buffer with the 3832This flag can be toggled from within the @file{*toc*} buffer with the
3697@kbd{i} key.@refill 3833@kbd{i} key.
3698@end defopt 3834@end defopt
3699 3835
3700@defopt reftex-toc-include-labels 3836@defopt reftex-toc-include-labels
3701Non-@code{nil} means, include labels in @file{*toc*} buffer. This flag 3837Non-@code{nil} means, include labels in @file{*toc*} buffer. This flag
3702can be toggled from within the @file{*toc*} buffer with the @kbd{l} 3838can be toggled from within the @file{*toc*} buffer with the @kbd{l}
3703key.@refill 3839key.
3704@end defopt 3840@end defopt
3705 3841
3706@defopt reftex-toc-include-index-entries 3842@defopt reftex-toc-include-index-entries
@@ -3713,7 +3849,7 @@ This flag can be toggled from within the @file{*toc*} buffer with the
3713Non-@code{nil} means, include context with labels in the @file{*toc*} 3849Non-@code{nil} means, include context with labels in the @file{*toc*}
3714buffer. Context will only be shown if the labels are visible as well. 3850buffer. Context will only be shown if the labels are visible as well.
3715This flag can be toggled from within the @file{*toc*} buffer with the 3851This flag can be toggled from within the @file{*toc*} buffer with the
3716@kbd{c} key.@refill 3852@kbd{c} key.
3717@end defopt 3853@end defopt
3718 3854
3719@defopt reftex-toc-follow-mode 3855@defopt reftex-toc-follow-mode
@@ -3721,17 +3857,17 @@ Non-@code{nil} means, point in @file{*toc*} buffer (the
3721table-of-contents buffer) will cause other window to follow. The other 3857table-of-contents buffer) will cause other window to follow. The other
3722window will show the corresponding part of the document. This flag can 3858window will show the corresponding part of the document. This flag can
3723be toggled from within the @file{*toc*} buffer with the @kbd{f} 3859be toggled from within the @file{*toc*} buffer with the @kbd{f}
3724key.@refill 3860key.
3725@end defopt 3861@end defopt
3726 3862
3727@deffn {Normal Hook} reftex-toc-mode-hook 3863@deffn {Normal Hook} reftex-toc-mode-hook
3728Normal hook which is run when a @file{*toc*} buffer is 3864Normal hook which is run when a @file{*toc*} buffer is
3729created.@refill 3865created.
3730@end deffn 3866@end deffn
3731 3867
3732@deffn Keymap reftex-toc-map 3868@deffn Keymap reftex-toc-map
3733The keymap which is active in the @file{*toc*} buffer. 3869The keymap which is active in the @file{*toc*} buffer.
3734(@pxref{Table of Contents}).@refill 3870(@pxref{Table of Contents}).
3735@end deffn 3871@end deffn
3736 3872
3737@node Options (Defining Label Environments), Options (Creating Labels), Options (Table of Contents), Options 3873@node Options (Defining Label Environments), Options (Creating Labels), Options (Table of Contents), Options
@@ -3742,7 +3878,7 @@ The keymap which is active in the @file{*toc*} buffer.
3742@defopt reftex-default-label-alist-entries 3878@defopt reftex-default-label-alist-entries
3743Default label alist specifications. It is a list of symbols with 3879Default label alist specifications. It is a list of symbols with
3744associations in the constant @code{reftex-label-alist-builtin}. 3880associations in the constant @code{reftex-label-alist-builtin}.
3745@code{LaTeX} should always be the last entry.@refill 3881@code{LaTeX} should always be the last entry.
3746@end defopt 3882@end defopt
3747 3883
3748@defopt reftex-label-alist 3884@defopt reftex-label-alist
@@ -3750,7 +3886,7 @@ Set this variable to define additions and changes to the defaults in
3750@code{reftex-default-label-alist-entries}. The only things you 3886@code{reftex-default-label-alist-entries}. The only things you
3751@emph{must not} change is that @code{?s} is the type indicator for 3887@emph{must not} change is that @code{?s} is the type indicator for
3752section labels, and @key{SPC} for the @code{any} label type. These are 3888section labels, and @key{SPC} for the @code{any} label type. These are
3753hard-coded at other places in the code.@refill 3889hard-coded at other places in the code.
3754 3890
3755The value of the variable must be a list of items. Each item is a list 3891The value of the variable must be a list of items. Each item is a list
3756itself and has the following structure: 3892itself and has the following structure:
@@ -3763,7 +3899,7 @@ itself and has the following structure:
3763Each list entry describes either an environment carrying a counter for 3899Each list entry describes either an environment carrying a counter for
3764use with @code{\label} and @code{\ref}, or a LaTeX macro defining a 3900use with @code{\label} and @code{\ref}, or a LaTeX macro defining a
3765label as (or inside) one of its arguments. The elements of each list 3901label as (or inside) one of its arguments. The elements of each list
3766entry are:@refill 3902entry are:
3767 3903
3768@table @asis 3904@table @asis
3769@item @var{env-or-macro} 3905@item @var{env-or-macro}
@@ -3772,10 +3908,10 @@ Name of the environment (like @samp{table}) or macro (like
3772@samp{\myfig[]@{@}@{@}@{*@}@{@}}. Use square brackets for optional 3908@samp{\myfig[]@{@}@{@}@{*@}@{@}}. Use square brackets for optional
3773arguments, a star to mark the label argument, if any. The macro does 3909arguments, a star to mark the label argument, if any. The macro does
3774not have to have a label argument - you could also use 3910not have to have a label argument - you could also use
3775@samp{\label@{...@}} inside one of its arguments.@refill 3911@samp{\label@{...@}} inside one of its arguments.
3776 3912
3777Special names: @code{section} for section labels, @code{any} to define a 3913Special names: @code{section} for section labels, @code{any} to define a
3778group which contains all labels.@refill 3914group which contains all labels.
3779 3915
3780This may also be a function to do local parsing and identify point to be 3916This may also be a function to do local parsing and identify point to be
3781in a non-standard label environment. The function must take an 3917in a non-standard label environment. The function must take an
@@ -3783,11 +3919,11 @@ argument @var{bound} and limit backward searches to this value. It
3783should return either nil or a cons cell @code{(@var{function} 3919should return either nil or a cons cell @code{(@var{function}
3784. @var{position})} with the function symbol and the position where the 3920. @var{position})} with the function symbol and the position where the
3785special environment starts. See the Info documentation for an 3921special environment starts. See the Info documentation for an
3786example.@refill 3922example.
3787 3923
3788Finally this may also be @code{nil} if the entry is only meant to change 3924Finally this may also be @code{nil} if the entry is only meant to change
3789some settings associated with the type indicator character (see 3925some settings associated with the type indicator character (see
3790below).@refill 3926below).
3791 3927
3792@item @var{type-key} 3928@item @var{type-key}
3793Type indicator character, like @code{?t}, must be a printable ASCII 3929Type indicator character, like @code{?t}, must be a printable ASCII
@@ -3798,35 +3934,37 @@ list, to cover cases in which different environments carry the same
3798label type (like @code{equation} and @code{eqnarray}). If the type 3934label type (like @code{equation} and @code{eqnarray}). If the type
3799indicator is @code{nil} and the macro has a label argument @samp{@{*@}}, 3935indicator is @code{nil} and the macro has a label argument @samp{@{*@}},
3800the macro defines neutral labels just like @code{\label}. In this case 3936the macro defines neutral labels just like @code{\label}. In this case
3801the reminder of this entry is ignored.@refill 3937the reminder of this entry is ignored.
3802 3938
3803@item @var{label-prefix} 3939@item @var{label-prefix}
3804Label prefix string, like @samp{tab:}. The prefix is a short string 3940Label prefix string, like @samp{tab:}. The prefix is a short string
3805used as the start of a label. It may be the empty string. The prefix 3941used as the start of a label. It may be the empty string. The prefix
3806may contain the following @samp{%} escapes:@refill 3942may contain the following @samp{%} escapes:
3807 3943
3808@example 3944@example
3809%f Current file name, directory and extension stripped. 3945%f Current file name, directory and extension stripped.
3810%F Current file name relative to master file directory. 3946%F Current file name relative to master file directory.
3947%m Master file name, directory and extension stripped.
3948%M Directory name (without path) where master file is located.
3811%u User login name, on systems which support this. 3949%u User login name, on systems which support this.
3812%S A section prefix derived with variable @code{reftex-section-prefixes}. 3950%S A section prefix derived with variable @code{reftex-section-prefixes}.
3813@end example 3951@end example
3814 3952
3815@noindent 3953@noindent
3816Example: In a file @file{intro.tex}, @samp{eq:%f:} will become 3954Example: In a file @file{intro.tex}, @samp{eq:%f:} will become
3817@samp{eq:intro:}.@refill 3955@samp{eq:intro:}.
3818 3956
3819@item @var{reference-format} 3957@item @var{reference-format}
3820Format string for reference insert in buffer. @samp{%s} will be 3958Format string for reference insert in buffer. @samp{%s} will be
3821replaced by the label. When the format starts with @samp{~}, this 3959replaced by the label. When the format starts with @samp{~}, this
3822@samp{~} will only be inserted when the character before point is 3960@samp{~} will only be inserted when the character before point is
3823@emph{not} a whitespace.@refill 3961@emph{not} a whitespace.
3824 3962
3825@item @var{context-method} 3963@item @var{context-method}
3826Indication on how to find the short context. 3964Indication on how to find the short context.
3827@itemize @minus 3965@itemize @minus
3828@item 3966@item
3829If @code{nil}, use the text following the @samp{\label@{...@}} macro.@refill 3967If @code{nil}, use the text following the @samp{\label@{...@}} macro.
3830@item 3968@item
3831If @code{t}, use 3969If @code{t}, use
3832@itemize @minus 3970@itemize @minus
@@ -3835,32 +3973,32 @@ the section heading for section labels.
3835@item 3973@item
3836text following the @samp{\begin@{...@}} statement of environments (not 3974text following the @samp{\begin@{...@}} statement of environments (not
3837a good choice for environments like eqnarray or enumerate, where one has 3975a good choice for environments like eqnarray or enumerate, where one has
3838several labels in a single environment).@refill 3976several labels in a single environment).
3839@item 3977@item
3840text after the macro name (starting with the first arg) for 3978text after the macro name (starting with the first arg) for
3841macros.@refill 3979macros.
3842@end itemize 3980@end itemize
3843@item 3981@item
3844If an integer, use the nth argument of the macro. As a special case, 3982If an integer, use the nth argument of the macro. As a special case,
38451000 means to get text after the last macro argument.@refill 39831000 means to get text after the last macro argument.
3846@item 3984@item
3847If a string, use as regexp to search @emph{backward} from the label. 3985If a string, use as regexp to search @emph{backward} from the label.
3848Context is then the text following the end of the match. E.g. putting 3986Context is then the text following the end of the match. E.g. putting
3849this to @samp{\\caption[[@{]} will use the caption in a figure or table 3987this to @samp{\\caption[[@{]} will use the caption in a figure or table
3850environment. @samp{\\begin@{eqnarray@}\|\\\\} works for 3988environment. @samp{\\begin@{eqnarray@}\|\\\\} works for
3851eqnarrays.@refill 3989eqnarrays.
3852@item 3990@item
3853If any of @code{caption}, @code{item}, @code{eqnarray-like}, 3991If any of @code{caption}, @code{item}, @code{eqnarray-like},
3854@code{alignat-like}, this symbol will internally be translated into an 3992@code{alignat-like}, this symbol will internally be translated into an
3855appropriate regexp (see also the variable 3993appropriate regexp (see also the variable
3856@code{reftex-default-context-regexps}).@refill 3994@code{reftex-default-context-regexps}).
3857@item 3995@item
3858If a function, call this function with the name of the environment/macro 3996If a function, call this function with the name of the environment/macro
3859as argument. On call, point will be just after the @code{\label} macro. 3997as argument. On call, point will be just after the @code{\label} macro.
3860The function is expected to return a suitable context string. It should 3998The function is expected to return a suitable context string. It should
3861throw an exception (error) when failing to find context. As an example, 3999throw an exception (error) when failing to find context. As an example,
3862here is a function returning the 10 chars following the label macro as 4000here is a function returning the 10 chars following the label macro as
3863context:@refill 4001context:
3864 4002
3865@example 4003@example
3866(defun my-context-function (env-or-mac) 4004(defun my-context-function (env-or-mac)
@@ -3875,7 +4013,7 @@ menu, and to derive a label string. If you want to use a different
3875method for each of these, specify them as a dotted pair. 4013method for each of these, specify them as a dotted pair.
3876E.g. @code{(nil . t)} uses the text after the label (@code{nil}) for 4014E.g. @code{(nil . t)} uses the text after the label (@code{nil}) for
3877display, and text from the default position (@code{t}) to derive a label 4015display, and text from the default position (@code{t}) to derive a label
3878string. This is actually used for section labels.@refill 4016string. This is actually used for section labels.
3879 4017
3880@item @var{magic-word-list} 4018@item @var{magic-word-list}
3881List of magic words which identify a reference to be of this type. If 4019List of magic words which identify a reference to be of this type. If
@@ -3883,7 +4021,7 @@ the word before point is equal to one of these words when calling
3883@code{reftex-reference}, the label list offered will be automatically 4021@code{reftex-reference}, the label list offered will be automatically
3884restricted to labels of the correct type. If the first element of this 4022restricted to labels of the correct type. If the first element of this
3885word--list is the symbol `regexp', the strings are interpreted as regular 4023word--list is the symbol `regexp', the strings are interpreted as regular
3886expressions.@refill 4024expressions.
3887 4025
3888@item @var{toc-level} 4026@item @var{toc-level}
3889The integer level at which this environment should be added to the table 4027The integer level at which this environment should be added to the table
@@ -3892,11 +4030,11 @@ will number the entries mixed with the sectioning commands of the same
3892level. A negative value will make unnumbered entries. Useful only for 4030level. A negative value will make unnumbered entries. Useful only for
3893theorem-like environments which structure the document. Will be ignored 4031theorem-like environments which structure the document. Will be ignored
3894for macros. When omitted or @code{nil}, no TOC entries will be 4032for macros. When omitted or @code{nil}, no TOC entries will be
3895made.@refill 4033made.
3896@end table 4034@end table
3897 4035
3898If the type indicator characters of two or more entries are the same, 4036If the type indicator characters of two or more entries are the same,
3899@b{Ref@TeX{}} will use@refill 4037@b{Ref@TeX{}} will use
3900@itemize @minus 4038@itemize @minus
3901@item 4039@item
3902the first non-@code{nil} format and prefix 4040the first non-@code{nil} format and prefix
@@ -3907,7 +4045,7 @@ the magic words of all involved entries.
3907Any list entry may also be a symbol. If that has an association in 4045Any list entry may also be a symbol. If that has an association in
3908@code{reftex-label-alist-builtin}, the @code{cddr} of that association is 4046@code{reftex-label-alist-builtin}, the @code{cddr} of that association is
3909spliced into the list. However, builtin defaults should normally be set 4047spliced into the list. However, builtin defaults should normally be set
3910with the variable @code{reftex-default-label-alist-entries}.@refill 4048with the variable @code{reftex-default-label-alist-entries}.
3911@end defopt 4049@end defopt
3912 4050
3913@defopt reftex-section-prefixes 4051@defopt reftex-section-prefixes
@@ -3924,7 +4062,39 @@ names like @samp{chapter}, integer section levels (as given in
3924Alist with default regular expressions for finding context. The emacs 4062Alist with default regular expressions for finding context. The emacs
3925lisp form @w{@code{(format regexp (regexp-quote environment))}} is used 4063lisp form @w{@code{(format regexp (regexp-quote environment))}} is used
3926to calculate the final regular expression - so @samp{%s} will be 4064to calculate the final regular expression - so @samp{%s} will be
3927replaced with the environment or macro.@refill 4065replaced with the environment or macro.
4066@end defopt
4067
4068@defopt reftex-trust-label-prefix
4069Non-@code{nil} means, trust the label prefix when determining label type.
4070It is customary to use special label prefixes to distinguish different label
4071types. The label prefixes have no syntactic meaning in LaTeX (unless
4072special packages like fancyref) are being used. RefTeX can and by
4073default does parse around each label to detect the correct label type,
4074but this process can be slow when a document contains thousands of
4075labels. If you use label prefixes consistently, you may speed up
4076document parsing by setting this variable to a non-nil value. RefTeX
4077will then compare the label prefix with the prefixes found in
4078`reftex-label-alist' and derive the correct label type in this way.
4079Possible values for this option are:
4080
4081@example
4082t @r{This means to trust any label prefixes found.}
4083regexp @r{If a regexp, only prefixes matched by the regexp are trusted.}
4084list @r{List of accepted prefixes, as strings. The colon is part of}
4085 @r{the prefix, e.g. ("fn:" "eqn:" "item:").}
4086nil @r{Never trust a label prefix.}
4087@end example
4088The only disadvantage of using this feature is that the label context
4089displayed in the label selection buffer along with each label is
4090simply some text after the label definition. This is no problem if you
4091place labels keeping this in mind (e.g. @i{before} the equation, @i{at
4092the beginning} of a fig/tab caption ...). Anyway, it is probably best
4093to use the regexp or the list value types to fine-tune this feature.
4094For example, if your document contains thousands of footnotes with
4095labels fn:xxx, you may want to set this variable to the value "^fn:$" or
4096("fn:"). Then RefTeX will still do extensive parsing for any
4097non-footnote labels.
3928@end defopt 4098@end defopt
3929 4099
3930@node Options (Creating Labels), Options (Referencing Labels), Options (Defining Label Environments), Options 4100@node Options (Creating Labels), Options (Referencing Labels), Options (Defining Label Environments), Options
@@ -3945,14 +4115,14 @@ the section heading. The conversion of the context to a legal label is
3945governed by the specifications given in 4115governed by the specifications given in
3946@code{reftex-derive-label-parameters}. If @var{derive} is @code{nil}, 4116@code{reftex-derive-label-parameters}. If @var{derive} is @code{nil},
3947the default label will consist of the prefix and a unique number, like 4117the default label will consist of the prefix and a unique number, like
3948@samp{eq:23}.@refill 4118@samp{eq:23}.
3949 4119
3950If @var{prompt} is @code{t}, the user will be prompted for a label 4120If @var{prompt} is @code{t}, the user will be prompted for a label
3951string. When @var{prompt} is @code{nil}, the default label will be 4121string. When @var{prompt} is @code{nil}, the default label will be
3952inserted without query.@refill 4122inserted without query.
3953 4123
3954So the combination of @var{derive} and @var{prompt} controls label 4124So the combination of @var{derive} and @var{prompt} controls label
3955insertion. Here is a table describing all four possibilities:@refill 4125insertion. Here is a table describing all four possibilities:
3956 4126
3957@example 4127@example
3958@group 4128@group
@@ -3970,12 +4140,12 @@ letters indicating the label types for which it should be true. Thus,
3970the combination may be set differently for each label type. The default 4140the combination may be set differently for each label type. The default
3971settings @samp{"s"} and @samp{"sft"} mean: Derive section labels from 4141settings @samp{"s"} and @samp{"sft"} mean: Derive section labels from
3972headings (with confirmation). Prompt for figure and table labels. Use 4142headings (with confirmation). Prompt for figure and table labels. Use
3973simple labels without confirmation for everything else.@refill 4143simple labels without confirmation for everything else.
3974 4144
3975The available label types are: @code{s} (section), @code{f} (figure), 4145The available label types are: @code{s} (section), @code{f} (figure),
3976@code{t} (table), @code{i} (item), @code{e} (equation), @code{n} 4146@code{t} (table), @code{i} (item), @code{e} (equation), @code{n}
3977(footnote), @code{N} (endnote) plus any definitions in 4147(footnote), @code{N} (endnote) plus any definitions in
3978@code{reftex-label-alist}.@refill 4148@code{reftex-label-alist}.
3979@end defopt 4149@end defopt
3980 4150
3981@deffn Hook reftex-format-label-function 4151@deffn Hook reftex-format-label-function
@@ -3983,13 +4153,13 @@ If non-@code{nil}, should be a function which produces the string to
3983insert as a label definition. The function will be called with two 4153insert as a label definition. The function will be called with two
3984arguments, the @var{label} and the @var{default-format} (usually 4154arguments, the @var{label} and the @var{default-format} (usually
3985@samp{\label@{%s@}}). It should return the string to insert into the 4155@samp{\label@{%s@}}). It should return the string to insert into the
3986buffer.@refill 4156buffer.
3987@end deffn 4157@end deffn
3988 4158
3989@deffn Hook reftex-string-to-label-function 4159@deffn Hook reftex-string-to-label-function
3990Function to turn an arbitrary string into a legal label. 4160Function to turn an arbitrary string into a legal label.
3991@b{Ref@TeX{}}'s default function uses the variable 4161@b{Ref@TeX{}}'s default function uses the variable
3992@code{reftex-derive-label-parameters}.@refill 4162@code{reftex-derive-label-parameters}.
3993@end deffn 4163@end deffn
3994 4164
3995@deffn Hook reftex-translate-to-ascii-function 4165@deffn Hook reftex-translate-to-ascii-function
@@ -3998,12 +4168,12 @@ derive a label from it. The intended application is to convert ISO or
3998Mule characters into something legal in labels. The default function 4168Mule characters into something legal in labels. The default function
3999@code{reftex-latin1-to-ascii} removes the accents from Latin-1 4169@code{reftex-latin1-to-ascii} removes the accents from Latin-1
4000characters. X-Symbol (>=2.6) sets this variable to the much more 4170characters. X-Symbol (>=2.6) sets this variable to the much more
4001general @code{x-symbol-translate-to-ascii}.@refill 4171general @code{x-symbol-translate-to-ascii}.
4002@end deffn 4172@end deffn
4003 4173
4004@defopt reftex-derive-label-parameters 4174@defopt reftex-derive-label-parameters
4005Parameters for converting a string into a label. This variable is a 4175Parameters for converting a string into a label. This variable is a
4006list of the following items:@refill 4176list of the following items:
4007@table @asis 4177@table @asis
4008@item @var{nwords} 4178@item @var{nwords}
4009Number of words to use. 4179Number of words to use.
@@ -4030,16 +4200,16 @@ Regexp matching characters not legal in labels.
4030@end defopt 4200@end defopt
4031 4201
4032@defopt reftex-abbrev-parameters 4202@defopt reftex-abbrev-parameters
4033Parameters for abbreviation of words. A list of four parameters.@refill 4203Parameters for abbreviation of words. A list of four parameters.
4034@table @asis 4204@table @asis
4035@item @var{min-chars} 4205@item @var{min-chars}
4036Minimum number of characters remaining after abbreviation. 4206Minimum number of characters remaining after abbreviation.
4037@item @var{min-kill} 4207@item @var{min-kill}
4038Minimum number of characters to remove when abbreviating words.@refill 4208Minimum number of characters to remove when abbreviating words.
4039@item @var{before} 4209@item @var{before}
4040Character class before abbrev point in word.@refill 4210Character class before abbrev point in word.
4041@item @var{after} 4211@item @var{after}
4042Character class after abbrev point in word.@refill 4212Character class after abbrev point in word.
4043@end table 4213@end table
4044@end defopt 4214@end defopt
4045 4215
@@ -4052,21 +4222,21 @@ Character class after abbrev point in word.@refill
4052List of flags governing the label menu makeup. The flags are: 4222List of flags governing the label menu makeup. The flags are:
4053@table @asis 4223@table @asis
4054@item @var{table-of-contents} 4224@item @var{table-of-contents}
4055Show the labels embedded in a table of context.@refill 4225Show the labels embedded in a table of context.
4056@item @var{section-numbers} 4226@item @var{section-numbers}
4057Include section numbers (like 4.1.3) in table of contents.@refill 4227Include section numbers (like 4.1.3) in table of contents.
4058@item @var{counters} 4228@item @var{counters}
4059Show counters. This just numbers the labels in the menu.@refill 4229Show counters. This just numbers the labels in the menu.
4060@item @var{no-context} 4230@item @var{no-context}
4061Non-@code{nil} means do @emph{not} show the short context.@refill 4231Non-@code{nil} means do @emph{not} show the short context.
4062@item @var{follow} 4232@item @var{follow}
4063Follow full context in other window.@refill 4233Follow full context in other window.
4064@item @var{show-commented} 4234@item @var{show-commented}
4065Show labels from regions which are commented out.@refill 4235Show labels from regions which are commented out.
4066@item @var{match-everywhere} 4236@item @var{match-everywhere}
4067Obsolete flag.@refill 4237Obsolete flag.
4068@item @var{show-files} 4238@item @var{show-files}
4069Show begin and end of included files.@refill 4239Show begin and end of included files.
4070@end table 4240@end table
4071 4241
4072Each of these flags can be set to @code{t} or @code{nil}, or to a string 4242Each of these flags can be set to @code{t} or @code{nil}, or to a string
@@ -4074,15 +4244,15 @@ of type letters indicating the label types for which it should be true.
4074These strings work like character classes in regular expressions. Thus, 4244These strings work like character classes in regular expressions. Thus,
4075setting one of the flags to @samp{"sf"} makes the flag true for section 4245setting one of the flags to @samp{"sf"} makes the flag true for section
4076and figure labels, @code{nil} for everything else. Setting it to 4246and figure labels, @code{nil} for everything else. Setting it to
4077@samp{"^sf"} makes it the other way round.@refill 4247@samp{"^sf"} makes it the other way round.
4078 4248
4079The available label types are: @code{s} (section), @code{f} (figure), 4249The available label types are: @code{s} (section), @code{f} (figure),
4080@code{t} (table), @code{i} (item), @code{e} (equation), @code{n} 4250@code{t} (table), @code{i} (item), @code{e} (equation), @code{n}
4081(footnote), plus any definitions in @code{reftex-label-alist}.@refill 4251(footnote), plus any definitions in @code{reftex-label-alist}.
4082 4252
4083Most options can also be switched from the label menu itself - so if you 4253Most options can also be switched from the label menu itself - so if you
4084decide here to not have a table of contents in the label menu, you can 4254decide here to not have a table of contents in the label menu, you can
4085still get one interactively during selection from the label menu.@refill 4255still get one interactively during selection from the label menu.
4086@end defopt 4256@end defopt
4087 4257
4088@defopt reftex-multiref-punctuation 4258@defopt reftex-multiref-punctuation
@@ -4092,7 +4262,7 @@ associates the 3 marking characters @samp{,-+} with prefix strings to be
4092inserted into the buffer before the corresponding @code{\ref} macro. 4262inserted into the buffer before the corresponding @code{\ref} macro.
4093This is used to string together whole reference sets, like 4263This is used to string together whole reference sets, like
4094@samp{eqs. 1,2,3-5,6 and 7} in a single call to 4264@samp{eqs. 1,2,3-5,6 and 7} in a single call to
4095@code{reftex-reference}.@refill 4265@code{reftex-reference}.
4096@end defopt 4266@end defopt
4097 4267
4098@defopt reftex-vref-is-default 4268@defopt reftex-vref-is-default
@@ -4102,7 +4272,7 @@ macro between @code{\ref} and @code{\vref}. The value of this variable
4102determines the default which is active when entering the selection 4272determines the default which is active when entering the selection
4103process. Instead of @code{nil} or @code{t}, this may also be a string 4273process. Instead of @code{nil} or @code{t}, this may also be a string
4104of type letters indicating the label types for which it should be 4274of type letters indicating the label types for which it should be
4105true.@refill 4275true.
4106@end defopt 4276@end defopt
4107 4277
4108@defopt reftex-fref-is-default 4278@defopt reftex-fref-is-default
@@ -4123,11 +4293,11 @@ special commands to insert @code{\vref} and @code{\fref} references, so
4123even if you set this, your setting will be ignored by the special 4293even if you set this, your setting will be ignored by the special
4124commands. The function will be called with two arguments, the 4294commands. The function will be called with two arguments, the
4125@var{label} and the @var{default-format} (usually @samp{~\ref@{%s@}}). 4295@var{label} and the @var{default-format} (usually @samp{~\ref@{%s@}}).
4126It should return the string to insert into the buffer.@refill 4296It should return the string to insert into the buffer.
4127@end deffn 4297@end deffn
4128 4298
4129@defopt reftex-level-indent 4299@defopt reftex-level-indent
4130Number of spaces to be used for indentation per section level.@refill 4300Number of spaces to be used for indentation per section level.
4131@end defopt 4301@end defopt
4132 4302
4133@defopt reftex-guess-label-type 4303@defopt reftex-guess-label-type
@@ -4137,29 +4307,29 @@ cursor and compare it with the magic words given in
4137@code{reftex-label-alist}. When it finds a match, @b{Ref@TeX{}} will 4307@code{reftex-label-alist}. When it finds a match, @b{Ref@TeX{}} will
4138immediately offer the correct label menu - otherwise it will prompt you 4308immediately offer the correct label menu - otherwise it will prompt you
4139for a label type. If you set this variable to @code{nil}, @b{Ref@TeX{}} 4309for a label type. If you set this variable to @code{nil}, @b{Ref@TeX{}}
4140will always prompt for a label type.@refill 4310will always prompt for a label type.
4141@end defopt 4311@end defopt
4142 4312
4143@deffn {Normal Hook} reftex-display-copied-context-hook 4313@deffn {Normal Hook} reftex-display-copied-context-hook
4144Normal Hook which is run before context is displayed anywhere. Designed 4314Normal Hook which is run before context is displayed anywhere. Designed
4145for @w{@code{X-Symbol}}, but may have other uses as well.@refill 4315for @w{@code{X-Symbol}}, but may have other uses as well.
4146@end deffn 4316@end deffn
4147 4317
4148@deffn Hook reftex-pre-refontification-functions 4318@deffn Hook reftex-pre-refontification-functions
4149@code{X-Symbol} specific hook. Probably not useful for other purposes. 4319@code{X-Symbol} specific hook. Probably not useful for other purposes.
4150The functions get two arguments, the buffer from where the command 4320The functions get two arguments, the buffer from where the command
4151started and a symbol indicating in what context the hook is 4321started and a symbol indicating in what context the hook is
4152called.@refill 4322called.
4153@end deffn 4323@end deffn
4154 4324
4155@deffn {Normal Hook} reftex-select-label-mode-hook 4325@deffn {Normal Hook} reftex-select-label-mode-hook
4156Normal hook which is run when a selection buffer enters 4326Normal hook which is run when a selection buffer enters
4157@code{reftex-select-label-mode}.@refill 4327@code{reftex-select-label-mode}.
4158@end deffn 4328@end deffn
4159 4329
4160@deffn Keymap reftex-select-label-map 4330@deffn Keymap reftex-select-label-map
4161The keymap which is active in the labels selection process 4331The keymap which is active in the labels selection process
4162(@pxref{Referencing Labels}).@refill 4332(@pxref{Referencing Labels}).
4163@end deffn 4333@end deffn
4164 4334
4165@node Options (Creating Citations), Options (Index Support), Options (Referencing Labels), Options 4335@node Options (Creating Citations), Options (Index Support), Options (Referencing Labels), Options
@@ -4176,7 +4346,7 @@ List of regular expressions to exclude files in
4176@code{\\bibliography@{..@}}. File names matched by any of these regexps 4346@code{\\bibliography@{..@}}. File names matched by any of these regexps
4177will not be parsed. Intended for files which contain only 4347will not be parsed. Intended for files which contain only
4178@code{@@string} macro definitions and the like, which are ignored by 4348@code{@@string} macro definitions and the like, which are ignored by
4179@b{Ref@TeX{}} anyway.@refill 4349@b{Ref@TeX{}} anyway.
4180@end defopt 4350@end defopt
4181 4351
4182@defopt reftex-default-bibliography 4352@defopt reftex-default-bibliography
@@ -4185,12 +4355,12 @@ When @code{reftex-citation} is called from a document with neither
4185a @samp{\bibliography@{...@}} statement nor a @code{thebibliography} 4355a @samp{\bibliography@{...@}} statement nor a @code{thebibliography}
4186environment, @b{Ref@TeX{}} will scan these files instead. Intended for 4356environment, @b{Ref@TeX{}} will scan these files instead. Intended for
4187using @code{reftex-citation} in non-LaTeX files. The files will be 4357using @code{reftex-citation} in non-LaTeX files. The files will be
4188searched along the BIBINPUTS or TEXBIB path.@refill 4358searched along the BIBINPUTS or TEXBIB path.
4189@end defopt 4359@end defopt
4190 4360
4191@defopt reftex-sort-bibtex-matches 4361@defopt reftex-sort-bibtex-matches
4192Sorting of the entries found in BibTeX databases by reftex-citation. 4362Sorting of the entries found in BibTeX databases by reftex-citation.
4193Possible values:@refill 4363Possible values:
4194@example 4364@example
4195nil @r{Do not sort entries.} 4365nil @r{Do not sort entries.}
4196author @r{Sort entries by author name.} 4366author @r{Sort entries by author name.}
@@ -4203,10 +4373,10 @@ reverse-year @r{Sort entries by decreasing year.}
4203The format of citations to be inserted into the buffer. It can be a 4373The format of citations to be inserted into the buffer. It can be a
4204string, an alist or a symbol. In the simplest case this is just the string 4374string, an alist or a symbol. In the simplest case this is just the string
4205@samp{\cite@{%l@}}, which is also the default. See the definition of 4375@samp{\cite@{%l@}}, which is also the default. See the definition of
4206@code{reftex-cite-format-builtin} for more complex examples.@refill 4376@code{reftex-cite-format-builtin} for more complex examples.
4207 4377
4208If @code{reftex-cite-format} is a string, it will be used as the format. 4378If @code{reftex-cite-format} is a string, it will be used as the format.
4209In the format, the following percent escapes will be expanded.@refill 4379In the format, the following percent escapes will be expanded.
4210 4380
4211@table @code 4381@table @code
4212@item %l 4382@item %l
@@ -4219,7 +4389,7 @@ Like %a, but abbreviate more than 2 authors like Jones et al.
4219First author name only. 4389First author name only.
4220@item %e 4390@item %e
4221Works like @samp{%a}, but on list of editor names. (@samp{%2e} and 4391Works like @samp{%a}, but on list of editor names. (@samp{%2e} and
4222@samp{%E} work a well).@refill 4392@samp{%E} work a well).
4223@end table 4393@end table
4224 4394
4225It is also possible to access all other BibTeX database fields: 4395It is also possible to access all other BibTeX database fields:
@@ -4235,52 +4405,72 @@ It is also possible to access all other BibTeX database fields:
4235 4405
4236@noindent 4406@noindent
4237Usually, only @samp{%l} is needed. The other stuff is mainly for the 4407Usually, only @samp{%l} is needed. The other stuff is mainly for the
4238echo area display, and for @code{(setq reftex-comment-citations t)}.@refill 4408echo area display, and for @code{(setq reftex-comment-citations t)}.
4239 4409
4240@samp{%<} as a special operator kills punctuation and space around it 4410@samp{%<} as a special operator kills punctuation and space around it
4241after the string has been formatted.@refill 4411after the string has been formatted.
4412
4413A pair of square brackets indicates an optional argument, and RefTeX
4414will prompt for the values of these arguments.
4242 4415
4243Beware that all this only works with BibTeX database files. When 4416Beware that all this only works with BibTeX database files. When
4244citations are made from the @code{\bibitems} in an explicit 4417citations are made from the @code{\bibitems} in an explicit
4245@code{thebibliography} environment, only @samp{%l} is available.@refill 4418@code{thebibliography} environment, only @samp{%l} is available.
4246 4419
4247If @code{reftex-cite-format} is an alist of characters and strings, the 4420If @code{reftex-cite-format} is an alist of characters and strings, the
4248user will be prompted for a character to select one of the possible 4421user will be prompted for a character to select one of the possible
4249format strings.@refill 4422format strings.
4250 4423
4251In order to configure this variable, you can either set 4424In order to configure this variable, you can either set
4252@code{reftex-cite-format} directly yourself or set it to the 4425@code{reftex-cite-format} directly yourself or set it to the
4253@emph{symbol} of one of the predefined styles. The predefined symbols 4426@emph{symbol} of one of the predefined styles. The predefined symbols
4254are those which have an association in the constant 4427are those which have an association in the constant
4255@code{reftex-cite-format-builtin}) E.g.: @code{(setq reftex-cite-format 4428@code{reftex-cite-format-builtin}) E.g.: @code{(setq reftex-cite-format
4256'natbib)}.@refill 4429'natbib)}.
4257@end defopt 4430@end defopt
4258 4431
4259@deffn Hook reftex-format-cite-function 4432@deffn Hook reftex-format-cite-function
4260
4261If non-@code{nil}, should be a function which produces the string to 4433If non-@code{nil}, should be a function which produces the string to
4262insert as a citation. Note that the citation format can also be changed 4434insert as a citation. Note that the citation format can also be changed
4263with the variable @code{reftex-cite-format}. The function will be 4435with the variable @code{reftex-cite-format}. The function will be
4264called with two arguments, the @var{citation-key} and the 4436called with two arguments, the @var{citation-key} and the
4265@var{default-format} (taken from @code{reftex-cite-format}). It should 4437@var{default-format} (taken from @code{reftex-cite-format}). It should
4266return the string to insert into the buffer.@refill 4438return the string to insert into the buffer.
4267@end deffn 4439@end deffn
4268 4440
4441@defopt reftex-cite-prompt-optional-args
4442Non-@code{nil} means, prompt for empty optional arguments in cite macros.
4443When an entry in @code{reftex-cite-format} ist given with square brackets to
4444indicate optional arguments (for example @samp{\\cite[][]@{%l@}}), RefTeX can
4445prompt for values. Possible values are:
4446@example
4447nil @r{Never prompt for optional arguments}
4448t @r{Always prompt}
4449maybe @r{Prompt only if @code{reftex-citation} was called with C-u prefix arg}@end example
4450Unnecessary empty optional arguments are removed before insertion into
4451the buffer. See @code{reftex-cite-cleanup-optional-args}.
4452@end defopt
4453
4454@defopt reftex-cite-cleanup-optional-args
4455Non-@code{nil} means, remove empty optional arguments from cite macros
4456if possible.
4457@end defopt
4458
4269@defopt reftex-comment-citations 4459@defopt reftex-comment-citations
4270Non-@code{nil} means add a comment for each citation describing the full 4460Non-@code{nil} means add a comment for each citation describing the full
4271entry. The comment is formatted according to 4461entry. The comment is formatted according to
4272@code{reftex-cite-comment-format}.@refill 4462@code{reftex-cite-comment-format}.
4273@end defopt 4463@end defopt
4274 4464
4275@defopt reftex-cite-comment-format 4465@defopt reftex-cite-comment-format
4276Citation format used for commented citations. Must @emph{not} contain 4466Citation format used for commented citations. Must @emph{not} contain
4277@samp{%l}. See the variable @code{reftex-cite-format} for possible 4467@samp{%l}. See the variable @code{reftex-cite-format} for possible
4278percent escapes.@refill 4468percent escapes.
4279@end defopt 4469@end defopt
4280 4470
4281@defopt reftex-cite-punctuation 4471@defopt reftex-cite-punctuation
4282Punctuation for formatting of name lists in citations. This is a list 4472Punctuation for formatting of name lists in citations. This is a list
4283of 3 strings.@refill 4473of 3 strings.
4284@enumerate 4474@enumerate
4285@item 4475@item
4286normal names separator, like @samp{, } in Jones, Brown and Miller 4476normal names separator, like @samp{, } in Jones, Brown and Miller
@@ -4294,12 +4484,12 @@ Jones @{\it et al.@}
4294 4484
4295@deffn {Normal Hook} reftex-select-bib-mode-hook 4485@deffn {Normal Hook} reftex-select-bib-mode-hook
4296Normal hook which is run when a selection buffer enters 4486Normal hook which is run when a selection buffer enters
4297@code{reftex-select-bib-mode}.@refill 4487@code{reftex-select-bib-mode}.
4298@end deffn 4488@end deffn
4299 4489
4300@deffn Keymap reftex-select-bib-map 4490@deffn Keymap reftex-select-bib-map
4301The keymap which is active in the citation-key selection process 4491The keymap which is active in the citation-key selection process
4302(@pxref{Creating Citations}).@refill 4492(@pxref{Creating Citations}).
4303@end deffn 4493@end deffn
4304 4494
4305@node Options (Index Support), Options (Viewing Cross-References), Options (Creating Citations), Options 4495@node Options (Index Support), Options (Viewing Cross-References), Options (Creating Citations), Options
@@ -4313,7 +4503,7 @@ is resource intensive and the internal structure holding the parsed
4313information can become quite big. Therefore it can be turned off. When 4503information can become quite big. Therefore it can be turned off. When
4314this is @code{nil} and you execute a command which requires index 4504this is @code{nil} and you execute a command which requires index
4315support, you will be asked for confirmation to turn it on and rescan the 4505support, you will be asked for confirmation to turn it on and rescan the
4316document.@refill 4506document.
4317@end defopt 4507@end defopt
4318 4508
4319@defopt reftex-index-special-chars 4509@defopt reftex-index-special-chars
@@ -4331,35 +4521,35 @@ is
4331 4521
4332@var{macro} is the macro. Arguments should be denoted by empty braces, 4522@var{macro} is the macro. Arguments should be denoted by empty braces,
4333as for example in @samp{\index[]@{*@}}. Use square brackets to denote 4523as for example in @samp{\index[]@{*@}}. Use square brackets to denote
4334optional arguments. The star marks where the index key is.@refill 4524optional arguments. The star marks where the index key is.
4335 4525
4336@var{index-tag} is a short name of the index. @samp{idx} and @samp{glo} 4526@var{index-tag} is a short name of the index. @samp{idx} and @samp{glo}
4337are reserved for the default index and the glossary. Other indices can 4527are reserved for the default index and the glossary. Other indices can
4338be defined as well. If this is an integer, the Nth argument of the 4528be defined as well. If this is an integer, the Nth argument of the
4339macro holds the index tag.@refill 4529macro holds the index tag.
4340 4530
4341@var{key} is a character which is used to identify the macro for input 4531@var{key} is a character which is used to identify the macro for input
4342with @code{reftex-index}. @samp{?i}, @samp{?I}, and @samp{?g} are 4532with @code{reftex-index}. @samp{?i}, @samp{?I}, and @samp{?g} are
4343reserved for default index and glossary.@refill 4533reserved for default index and glossary.
4344 4534
4345@var{prefix} can be a prefix which is added to the @var{key} part of the 4535@var{prefix} can be a prefix which is added to the @var{key} part of the
4346index entry. If you have a macro 4536index entry. If you have a macro
4347@code{\newcommand@{\molec@}[1]@{#1\index@{Molecules!#1@}}, this prefix 4537@code{\newcommand@{\molec@}[1]@{#1\index@{Molecules!#1@}}, this prefix
4348should be @samp{Molecules!}.@refill 4538should be @samp{Molecules!}.
4349 4539
4350@var{exclude} can be a function. If this function exists and returns a 4540@var{exclude} can be a function. If this function exists and returns a
4351non-@code{nil} value, the index entry at point is ignored. This was 4541non-@code{nil} value, the index entry at point is ignored. This was
4352implemented to support the (deprecated) @samp{^} and @samp{_} shortcuts 4542implemented to support the (deprecated) @samp{^} and @samp{_} shortcuts
4353in the LaTeX2e @code{index} package.@refill 4543in the LaTeX2e @code{index} package.
4354 4544
4355@var{repeat}, if non-@code{nil}, means the index macro does not typeset 4545@var{repeat}, if non-@code{nil}, means the index macro does not typeset
4356the entry in the text, so that the text has to be repeated outside the 4546the entry in the text, so that the text has to be repeated outside the
4357index macro. Needed for @code{reftex-index-selection-or-word} and for 4547index macro. Needed for @code{reftex-index-selection-or-word} and for
4358indexing from the phrase buffer.@refill 4548indexing from the phrase buffer.
4359 4549
4360The final entry may also be a symbol. It must have an association in 4550The final entry may also be a symbol. It must have an association in
4361the variable @code{reftex-index-macros-builtin} to specify the main 4551the variable @code{reftex-index-macros-builtin} to specify the main
4362indexing package you are using. Legal values are currently@refill 4552indexing package you are using. Legal values are currently
4363@example 4553@example
4364default @r{The LaTeX default - unnecessary to specify this one} 4554default @r{The LaTeX default - unnecessary to specify this one}
4365multind @r{The multind.sty package} 4555multind @r{The multind.sty package}
@@ -4383,7 +4573,7 @@ This is a list with @code{(@var{macro-key} @var{default-tag})}.
4383@var{tag} argument. When this is @code{nil} and a @var{tag} is needed, 4573@var{tag} argument. When this is @code{nil} and a @var{tag} is needed,
4384@b{Ref@TeX{}} will ask for it. When this is the empty string and the 4574@b{Ref@TeX{}} will ask for it. When this is the empty string and the
4385TAG argument of the index macro is optional, the TAG argument will be 4575TAG argument of the index macro is optional, the TAG argument will be
4386omitted.@refill 4576omitted.
4387@end defopt 4577@end defopt
4388 4578
4389@defopt reftex-index-default-tag 4579@defopt reftex-index-default-tag
@@ -4391,7 +4581,7 @@ Default index tag. When working with multiple indexes, RefTeX queries
4391for an index tag when creating index entries or displaying a specific 4581for an index tag when creating index entries or displaying a specific
4392index. This variable controls the default offered for these queries. 4582index. This variable controls the default offered for these queries.
4393The default can be selected with @key{RET} during selection or 4583The default can be selected with @key{RET} during selection or
4394completion. Legal values of this variable are:@refill 4584completion. Legal values of this variable are:
4395@example 4585@example
4396nil @r{Do not provide a default index} 4586nil @r{Do not provide a default index}
4397"tag" @r{The default index tag given as a string, e.g. "idx"} 4587"tag" @r{The default index tag given as a string, e.g. "idx"}
@@ -4405,7 +4595,7 @@ Format of index entries when copied from inside math mode. When
4405the index key copied from the buffer is processed with this format 4595the index key copied from the buffer is processed with this format
4406string through the @code{format} function. This can be used to add the 4596string through the @code{format} function. This can be used to add the
4407math delimiters (e.g. @samp{$}) to the string. Requires the 4597math delimiters (e.g. @samp{$}) to the string. Requires the
4408@file{texmathp.el} library which is part of AUCTeX.@refill 4598@file{texmathp.el} library which is part of AUCTeX.
4409@end defopt 4599@end defopt
4410 4600
4411@defopt reftex-index-phrase-file-extension 4601@defopt reftex-index-phrase-file-extension
@@ -4420,7 +4610,7 @@ this operator, each part will generate an index macro. So each match of
4420the search phrase will produce @emph{several} different index entries. 4610the search phrase will produce @emph{several} different index entries.
4421Make sure this does no match things which are not separators. This 4611Make sure this does no match things which are not separators. This
4422logical @samp{and} has higher priority than the logical @samp{or} 4612logical @samp{and} has higher priority than the logical @samp{or}
4423specified in @code{reftex-index-phrases-logical-or-regexp}.@refill 4613specified in @code{reftex-index-phrases-logical-or-regexp}.
4424@end defopt 4614@end defopt
4425 4615
4426@defopt reftex-index-phrases-logical-or-regexp 4616@defopt reftex-index-phrases-logical-or-regexp
@@ -4431,7 +4621,7 @@ match of the search phrase. The first index arg will be the default. A
4431number key @kbd{1}--@kbd{9} must be pressed to switch to another. Make 4621number key @kbd{1}--@kbd{9} must be pressed to switch to another. Make
4432sure this does no match things which are not separators. The logical 4622sure this does no match things which are not separators. The logical
4433@samp{and} specified in @code{reftex-index-phrases-logical-or-regexp} 4623@samp{and} specified in @code{reftex-index-phrases-logical-or-regexp}
4434has higher priority than this logical @samp{or}.@refill 4624has higher priority than this logical @samp{or}.
4435@end defopt 4625@end defopt
4436 4626
4437@defopt reftex-index-phrases-search-whole-words 4627@defopt reftex-index-phrases-search-whole-words
@@ -4443,7 +4633,7 @@ at one of these points, no word boundary is required there.
4443 4633
4444@defopt reftex-index-phrases-case-fold-search 4634@defopt reftex-index-phrases-case-fold-search
4445Non-@code{nil} means, searching for index phrases will ignore 4635Non-@code{nil} means, searching for index phrases will ignore
4446case.@refill 4636case.
4447@end defopt 4637@end defopt
4448 4638
4449@defopt reftex-index-verify-function 4639@defopt reftex-index-verify-function
@@ -4459,7 +4649,7 @@ particular when indexing an already processed document again, this
4459will even be the norm. When this variable is non-@code{nil}, 4649will even be the norm. When this variable is non-@code{nil},
4460@b{Ref@TeX{}} checks if the match is an index macro argument, or if an 4650@b{Ref@TeX{}} checks if the match is an index macro argument, or if an
4461index macro is directly before or after the phrase. If that is the 4651index macro is directly before or after the phrase. If that is the
4462case, that match will be ignored.@refill 4652case, that match will be ignored.
4463@end defopt 4653@end defopt
4464 4654
4465@defopt reftex-index-phrases-wrap-long-lines 4655@defopt reftex-index-phrases-wrap-long-lines
@@ -4468,7 +4658,7 @@ Inserting indexing commands in a line makes the line longer - often
4468so long that it does not fit onto the screen. When this variable is 4658so long that it does not fit onto the screen. When this variable is
4469non-@code{nil}, newlines will be added as necessary before and/or after the 4659non-@code{nil}, newlines will be added as necessary before and/or after the
4470indexing command to keep lines short. However, the matched text 4660indexing command to keep lines short. However, the matched text
4471phrase and its index command will always end up on a single line.@refill 4661phrase and its index command will always end up on a single line.
4472@end defopt 4662@end defopt
4473 4663
4474@defopt reftex-index-phrases-sort-prefers-entry 4664@defopt reftex-index-phrases-sort-prefers-entry
@@ -4476,7 +4666,7 @@ Non-@code{nil} means when sorting phrase lines, the explicit index entry
4476is used. Phrase lines in the phrases buffer contain a search phrase, and 4666is used. Phrase lines in the phrases buffer contain a search phrase, and
4477sorting is normally based on these. Some phrase lines also have 4667sorting is normally based on these. Some phrase lines also have
4478an explicit index argument specified. When this variable is 4668an explicit index argument specified. When this variable is
4479non-@code{nil}, the index argument will be used for sorting.@refill 4669non-@code{nil}, the index argument will be used for sorting.
4480@end defopt 4670@end defopt
4481 4671
4482@defopt reftex-index-phrases-sort-in-blocks 4672@defopt reftex-index-phrases-sort-in-blocks
@@ -4491,7 +4681,7 @@ Keymap for the Index Phrases buffer.
4491 4681
4492@defopt reftex-index-phrases-mode-hook 4682@defopt reftex-index-phrases-mode-hook
4493Normal hook which is run when a buffer is put into 4683Normal hook which is run when a buffer is put into
4494@code{reftex-index-phrases-mode}.@refill 4684@code{reftex-index-phrases-mode}.
4495@end defopt 4685@end defopt
4496 4686
4497@defopt reftex-index-section-letters 4687@defopt reftex-index-section-letters
@@ -4501,7 +4691,7 @@ significant, the index will be sorted by whatever the sort function
4501thinks is correct. In addition to these letters, @b{Ref@TeX{}} will 4691thinks is correct. In addition to these letters, @b{Ref@TeX{}} will
4502create a group @samp{!} which contains all entries sorted below the 4692create a group @samp{!} which contains all entries sorted below the
4503lowest specified letter. In the @file{*Index*} buffer, pressing any of 4693lowest specified letter. In the @file{*Index*} buffer, pressing any of
4504these capital letters or @kbd{!} will jump to that section.@refill 4694these capital letters or @kbd{!} will jump to that section.
4505@end defopt 4695@end defopt
4506 4696
4507@defopt reftex-index-include-context 4697@defopt reftex-index-include-context
@@ -4519,7 +4709,7 @@ buffer with the @kbd{f} key.
4519 4709
4520@deffn Keymap reftex-index-map 4710@deffn Keymap reftex-index-map
4521The keymap which is active in the @file{*Index*} buffer 4711The keymap which is active in the @file{*Index*} buffer
4522(@pxref{Index Support}).@refill 4712(@pxref{Index Support}).
4523@end deffn 4713@end deffn
4524 4714
4525@node Options (Viewing Cross-References), Options (Finding Files), Options (Index Support), Options 4715@node Options (Viewing Cross-References), Options (Finding Files), Options (Index Support), Options
@@ -4552,18 +4742,18 @@ message is being displayed, the echo area will display information about
4552that cross reference. You can also set the variable to the symbol 4742that cross reference. You can also set the variable to the symbol
4553@code{window}. In this case a small temporary window is used for the 4743@code{window}. In this case a small temporary window is used for the
4554display. This feature can be turned on and off from the menu 4744display. This feature can be turned on and off from the menu
4555(Ref->Options).@refill 4745(Ref->Options).
4556@end defopt 4746@end defopt
4557 4747
4558@defopt reftex-idle-time 4748@defopt reftex-idle-time
4559Time (secs) Emacs has to be idle before automatic crossref display 4749Time (secs) Emacs has to be idle before automatic crossref display
4560or toc recentering is done.@refill 4750or toc recentering is done.
4561@end defopt 4751@end defopt
4562 4752
4563@defopt reftex-cite-view-format 4753@defopt reftex-cite-view-format
4564Citation format used to display citation info in the message area. See 4754Citation format used to display citation info in the message area. See
4565the variable @code{reftex-cite-format} for possible percent 4755the variable @code{reftex-cite-format} for possible percent
4566escapes.@refill 4756escapes.
4567@end defopt 4757@end defopt
4568 4758
4569@defopt reftex-revisit-to-echo 4759@defopt reftex-revisit-to-echo
@@ -4571,7 +4761,7 @@ Non-@code{nil} means, automatic citation display will revisit files if
4571necessary. When nil, citation display in echo area will only be active 4761necessary. When nil, citation display in echo area will only be active
4572for cached echo strings (see @code{reftex-cache-cite-echo}), or for 4762for cached echo strings (see @code{reftex-cache-cite-echo}), or for
4573BibTeX database files which are already visited by a live associated 4763BibTeX database files which are already visited by a live associated
4574buffers.@refill 4764buffers.
4575@end defopt 4765@end defopt
4576 4766
4577@defopt reftex-cache-cite-echo 4767@defopt reftex-cache-cite-echo
@@ -4588,11 +4778,11 @@ scans. In order to clear it, use @kbd{M-x reftex-reset-mode}.
4588 4778
4589@defopt reftex-texpath-environment-variables 4779@defopt reftex-texpath-environment-variables
4590List of specifications how to retrieve the search path for TeX files. 4780List of specifications how to retrieve the search path for TeX files.
4591Several entries are possible.@refill 4781Several entries are possible.
4592@itemize @minus 4782@itemize @minus
4593@item 4783@item
4594If an element is the name of an environment variable, its content is 4784If an element is the name of an environment variable, its content is
4595used.@refill 4785used.
4596@item 4786@item
4597If an element starts with an exclamation mark, it is used as a command 4787If an element starts with an exclamation mark, it is used as a command
4598to retrieve the path. A typical command with the kpathsearch library 4788to retrieve the path. A typical command with the kpathsearch library
@@ -4607,11 +4797,11 @@ be expanded recursively. See also @code{reftex-use-external-file-finders}.
4607 4797
4608@defopt reftex-bibpath-environment-variables 4798@defopt reftex-bibpath-environment-variables
4609List of specifications how to retrieve the search path for BibTeX 4799List of specifications how to retrieve the search path for BibTeX
4610files. Several entries are possible.@refill 4800files. Several entries are possible.
4611@itemize @minus 4801@itemize @minus
4612@item 4802@item
4613If an element is the name of an environment variable, its content is 4803If an element is the name of an environment variable, its content is
4614used.@refill 4804used.
4615@item 4805@item
4616If an element starts with an exclamation mark, it is used as a command 4806If an element starts with an exclamation mark, it is used as a command
4617to retrieve the path. A typical command with the kpathsearch library 4807to retrieve the path. A typical command with the kpathsearch library
@@ -4634,7 +4824,7 @@ This is a list of items, each item is like:
4634@var{other-ext}: @r{Any number of other legal extensions for this file type.} 4824@var{other-ext}: @r{Any number of other legal extensions for this file type.}
4635@end example 4825@end example
4636When a files is searched and it does not have any of the legal extensions, 4826When a files is searched and it does not have any of the legal extensions,
4637we try the default extension first, and then the naked file name.@refill 4827we try the default extension first, and then the naked file name.
4638@end defopt 4828@end defopt
4639 4829
4640@defopt reftex-search-unrecursed-path-first 4830@defopt reftex-search-unrecursed-path-first
@@ -4645,7 +4835,7 @@ option is @code{nil}, the subdirectories of @samp{./} are searched
4645before @samp{/tex/}. This is mainly for speed - most of the time the 4835before @samp{/tex/}. This is mainly for speed - most of the time the
4646recursive path is for the system files and not for the user files. Set 4836recursive path is for the system files and not for the user files. Set
4647this to @code{nil} if the default makes @b{Ref@TeX{}} finding files with 4837this to @code{nil} if the default makes @b{Ref@TeX{}} finding files with
4648equal names in wrong sequence.@refill 4838equal names in wrong sequence.
4649@end defopt 4839@end defopt
4650 4840
4651@defopt reftex-use-external-file-finders 4841@defopt reftex-use-external-file-finders
@@ -4667,7 +4857,7 @@ string containing the external program to use with any arguments.
4667@code{%f} will be replaced by the name of the file to be found. Note 4857@code{%f} will be replaced by the name of the file to be found. Note
4668that these commands will be executed directly, not via a shell. Only 4858that these commands will be executed directly, not via a shell. Only
4669relevant when @code{reftex-use-external-file-finders} is 4859relevant when @code{reftex-use-external-file-finders} is
4670non-@code{nil}.@refill 4860non-@code{nil}.
4671@end defopt 4861@end defopt
4672 4862
4673@page 4863@page
@@ -4679,17 +4869,17 @@ non-@code{nil}.@refill
4679@defopt reftex-keep-temporary-buffers 4869@defopt reftex-keep-temporary-buffers
4680Non-@code{nil} means, keep buffers created for parsing and lookup. 4870Non-@code{nil} means, keep buffers created for parsing and lookup.
4681@b{Ref@TeX{}} sometimes needs to visit files related to the current 4871@b{Ref@TeX{}} sometimes needs to visit files related to the current
4682document. We distinguish files visited for@refill 4872document. We distinguish files visited for
4683@table @asis 4873@table @asis
4684@item PARSING 4874@item PARSING
4685Parts of a multifile document loaded when (re)-parsing the 4875Parts of a multifile document loaded when (re)-parsing the
4686document.@refill 4876document.
4687@item LOOKUP 4877@item LOOKUP
4688BibTeX database files and TeX files loaded to find a reference, to 4878BibTeX database files and TeX files loaded to find a reference, to
4689display label context, etc.@refill 4879display label context, etc.
4690@end table 4880@end table
4691The created buffers can be kept for later use, or be thrown away 4881The created buffers can be kept for later use, or be thrown away
4692immediately after use, depending on the value of this variable:@refill 4882immediately after use, depending on the value of this variable:
4693 4883
4694@table @code 4884@table @code
4695@item nil 4885@item nil
@@ -4698,13 +4888,13 @@ Throw away as much as possible.
4698Keep everything. 4888Keep everything.
4699@item 1 4889@item 1
4700Throw away buffers created for parsing, but keep the ones created for 4890Throw away buffers created for parsing, but keep the ones created for
4701lookup.@refill 4891lookup.
4702@end table 4892@end table
4703 4893
4704If a buffer is to be kept, the file is visited normally (which is 4894If a buffer is to be kept, the file is visited normally (which is
4705potentially slow but will happen only once). If a buffer is to be thrown 4895potentially slow but will happen only once). If a buffer is to be thrown
4706away, the initialization of the buffer depends upon the variable 4896away, the initialization of the buffer depends upon the variable
4707@code{reftex-initialize-temporary-buffers}.@refill 4897@code{reftex-initialize-temporary-buffers}.
4708@end defopt 4898@end defopt
4709 4899
4710@defopt reftex-initialize-temporary-buffers 4900@defopt reftex-initialize-temporary-buffers
@@ -4713,7 +4903,7 @@ temporarily. When @code{nil}, @b{Ref@TeX{}} may turn off find-file hooks and
4713other stuff to briefly visit a file. When @code{t}, the full default 4903other stuff to briefly visit a file. When @code{t}, the full default
4714initializations are done (@code{find-file-hook} etc.). Instead of 4904initializations are done (@code{find-file-hook} etc.). Instead of
4715@code{t} or @code{nil}, this variable may also be a list of hook 4905@code{t} or @code{nil}, this variable may also be a list of hook
4716functions to do a minimal initialization.@refill 4906functions to do a minimal initialization.
4717@end defopt 4907@end defopt
4718 4908
4719@defopt reftex-no-include-regexps 4909@defopt reftex-no-include-regexps
@@ -4731,7 +4921,7 @@ commands, or with the @kbd{r} key in menus. When this option is
4731or the file associated with the label or section heading near point in a 4921or the file associated with the label or section heading near point in a
4732menu. Requesting re-parsing of an entire multifile document then 4922menu. Requesting re-parsing of an entire multifile document then
4733requires a @kbd{C-u C-u} prefix or the capital @kbd{R} key in 4923requires a @kbd{C-u C-u} prefix or the capital @kbd{R} key in
4734menus.@refill 4924menus.
4735@end defopt 4925@end defopt
4736 4926
4737@defopt reftex-save-parse-info 4927@defopt reftex-save-parse-info
@@ -4742,10 +4932,10 @@ used to save the information. When this variable is @code{t},
4742@item 4932@item
4743accessing the parsing information for the first time in an editing 4933accessing the parsing information for the first time in an editing
4744session will read that file (if available) instead of parsing the 4934session will read that file (if available) instead of parsing the
4745document.@refill 4935document.
4746@item 4936@item
4747exiting Emacs or killing a buffer in reftex-mode will cause a new 4937exiting Emacs or killing a buffer in reftex-mode will cause a new
4748version of the file to be written.@refill 4938version of the file to be written.
4749@end itemize 4939@end itemize
4750@end defopt 4940@end defopt
4751 4941
@@ -4766,7 +4956,7 @@ type. These buffers are kept from one selection to the next and need
4766not to be created for each use - so the menu generally comes up faster. 4956not to be created for each use - so the menu generally comes up faster.
4767The selection buffers will be erased (and therefore updated) 4957The selection buffers will be erased (and therefore updated)
4768automatically when new labels in its category are added. See the 4958automatically when new labels in its category are added. See the
4769variable @code{reftex-auto-update-selection-buffers}.@refill 4959variable @code{reftex-auto-update-selection-buffers}.
4770@end defopt 4960@end defopt
4771 4961
4772@defopt reftex-auto-update-selection-buffers 4962@defopt reftex-auto-update-selection-buffers
@@ -4777,7 +4967,7 @@ force an update upon next use. When @code{nil}, the buffers are left
4777alone and have to be updated by hand, with the @kbd{g} key from the 4967alone and have to be updated by hand, with the @kbd{g} key from the
4778label selection process. The value of this variable will only have any 4968label selection process. The value of this variable will only have any
4779effect when @code{reftex-use-multiple-selection-buffers} is 4969effect when @code{reftex-use-multiple-selection-buffers} is
4780non-@code{nil}.@refill 4970non-@code{nil}.
4781@end defopt 4971@end defopt
4782 4972
4783@node Options (Fontification), Options (Misc), Options (Optimizations), Options 4973@node Options (Fontification), Options (Misc), Options (Optimizations), Options
@@ -4789,13 +4979,13 @@ non-@code{nil}.@refill
4789Non-@code{nil} means, use fonts in label menu and on-the-fly help. 4979Non-@code{nil} means, use fonts in label menu and on-the-fly help.
4790Font-lock must be loaded as well to actually get fontified 4980Font-lock must be loaded as well to actually get fontified
4791display. After changing this option, a rescan may be necessary to 4981display. After changing this option, a rescan may be necessary to
4792activate it.@refill 4982activate it.
4793@end defopt 4983@end defopt
4794 4984
4795@defopt reftex-refontify-context 4985@defopt reftex-refontify-context
4796Non-@code{nil} means, re-fontify the context in the label menu with 4986Non-@code{nil} means, re-fontify the context in the label menu with
4797font-lock. This slightly slows down the creation of the label menu. It 4987font-lock. This slightly slows down the creation of the label menu. It
4798is only necessary when you definitely want the context fontified.@refill 4988is only necessary when you definitely want the context fontified.
4799 4989
4800This option may have 3 different values: 4990This option may have 3 different values:
4801@table @code 4991@table @code
@@ -4805,9 +4995,9 @@ Never refontify.
4805Always refontify. 4995Always refontify.
4806@item 1 4996@item 1
4807Refontify when necessary, e.g. with old versions of the x-symbol 4997Refontify when necessary, e.g. with old versions of the x-symbol
4808package.@refill 4998package.
4809@end table 4999@end table
4810The option is ignored when @code{reftex-use-fonts} is @code{nil}.@refill 5000The option is ignored when @code{reftex-use-fonts} is @code{nil}.
4811@end defopt 5001@end defopt
4812 5002
4813@defopt reftex-highlight-selection 5003@defopt reftex-highlight-selection
@@ -4817,7 +5007,7 @@ Non-@code{nil} means, highlight selected text in selection and
4817keys in the selection and @file{*toc*} buffers act on. However, if you 5007keys in the selection and @file{*toc*} buffers act on. However, if you
4818mainly use the mouse to select an item, you may find it nice to have 5008mainly use the mouse to select an item, you may find it nice to have
4819mouse-triggered highlighting @emph{instead} or @emph{as well}. The 5009mouse-triggered highlighting @emph{instead} or @emph{as well}. The
4820variable may have one of these values:@refill 5010variable may have one of these values:
4821 5011
4822@example 5012@example
4823nil @r{No highlighting.} 5013nil @r{No highlighting.}
@@ -4827,16 +5017,16 @@ both @r{Both cursor and mouse trigger highlighting.}
4827@end example 5017@end example
4828 5018
4829Changing this variable requires to rebuild the selection and *toc* 5019Changing this variable requires to rebuild the selection and *toc*
4830buffers to become effective (keys @kbd{g} or @kbd{r}).@refill 5020buffers to become effective (keys @kbd{g} or @kbd{r}).
4831@end defopt 5021@end defopt
4832 5022
4833@defopt reftex-cursor-selected-face 5023@defopt reftex-cursor-selected-face
4834Face name to highlight cursor selected item in toc and selection buffers. 5024Face name to highlight cursor selected item in toc and selection buffers.
4835See also the variable @code{reftex-highlight-selection}.@refill 5025See also the variable @code{reftex-highlight-selection}.
4836@end defopt 5026@end defopt
4837@defopt reftex-mouse-selected-face 5027@defopt reftex-mouse-selected-face
4838Face name to highlight mouse selected item in toc and selection buffers. 5028Face name to highlight mouse selected item in toc and selection buffers.
4839See also the variable @code{reftex-highlight-selection}.@refill 5029See also the variable @code{reftex-highlight-selection}.
4840@end defopt 5030@end defopt
4841@defopt reftex-file-boundary-face 5031@defopt reftex-file-boundary-face
4842Face name for file boundaries in selection buffer. 5032Face name for file boundaries in selection buffer.
@@ -4885,13 +5075,13 @@ Face name for index entries.
4885@defopt reftex-extra-bindings 5075@defopt reftex-extra-bindings
4886Non-@code{nil} means, make additional key bindings on startup. These 5076Non-@code{nil} means, make additional key bindings on startup. These
4887extra bindings are located in the users @samp{C-c letter} 5077extra bindings are located in the users @samp{C-c letter}
4888map. @xref{Key Bindings}.@refill 5078map. @xref{Key Bindings}.
4889@end defopt 5079@end defopt
4890 5080
4891@defopt reftex-plug-into-AUCTeX 5081@defopt reftex-plug-into-AUCTeX
4892Plug-in flags for AUCTeX interface. This variable is a list of 5082Plug-in flags for AUCTeX interface. This variable is a list of
48935 boolean flags. When a flag is non-@code{nil}, @b{Ref@TeX{}} 50835 boolean flags. When a flag is non-@code{nil}, @b{Ref@TeX{}}
4894will@refill 5084will
4895 5085
4896@example 5086@example
4897- supply labels in new sections and environments (flag 1) 5087- supply labels in new sections and environments (flag 1)
@@ -4920,7 +5110,7 @@ Non-@code{nil} means, allow arguments of macros to be detached by
4920whitespace. When this is @code{t}, the @samp{aaa} in @w{@samp{\bbb 5110whitespace. When this is @code{t}, the @samp{aaa} in @w{@samp{\bbb
4921[xxx] @{aaa@}}} will be considered an argument of @code{\bb}. Note that 5111[xxx] @{aaa@}}} will be considered an argument of @code{\bb}. Note that
4922this will be the case even if @code{\bb} is defined with zero or one 5112this will be the case even if @code{\bb} is defined with zero or one
4923argument.@refill 5113argument.
4924@end defopt 5114@end defopt
4925 5115
4926@node Keymaps and Hooks, Changes, Options, Top 5116@node Keymaps and Hooks, Changes, Options, Top
@@ -4938,14 +5128,14 @@ Normal hook which is being run when loading @file{reftex.el}.
4938@end deffn 5128@end deffn
4939 5129
4940@deffn {Normal Hook} reftex-mode-hook 5130@deffn {Normal Hook} reftex-mode-hook
4941Normal hook which is being run when turning on @b{Ref@TeX{}} mode.@refill 5131Normal hook which is being run when turning on @b{Ref@TeX{}} mode.
4942@end deffn 5132@end deffn
4943 5133
4944Furthermore, the 4 modes used for referencing labels, creating 5134Furthermore, the 4 modes used for referencing labels, creating
4945citations, the table of contents buffer and the phrases buffer have 5135citations, the table of contents buffer and the phrases buffer have
4946their own keymaps and mode hooks. See the respective sections. There 5136their own keymaps and mode hooks. See the respective sections. There
4947are many more hooks which are described in the relevant sections about 5137are many more hooks which are described in the relevant sections about
4948options for a specific part of @b{Ref@TeX{}}.@refill 5138options for a specific part of @b{Ref@TeX{}}.
4949 5139
4950@node Changes, , Keymaps and Hooks, Top 5140@node Changes, , Keymaps and Hooks, Top
4951@chapter Changes 5141@chapter Changes
@@ -4953,296 +5143,396 @@ options for a specific part of @b{Ref@TeX{}}.@refill
4953 5143
4954Here is a list of recent changes to @b{Ref@TeX{}}. 5144Here is a list of recent changes to @b{Ref@TeX{}}.
4955 5145
4956@ignore 5146@noindent @b{Version 4.26}
4957@noindent @b{Version 1.00}
4958@itemize @bullet 5147@itemize @bullet
4959@item 5148@item
4960released on 7 Jan 1997. 5149Bug fixes only.
4961@end itemize 5150@end itemize
4962 5151
4963@noindent @b{Version 1.04} 5152@noindent @b{Version 4.25}
4964@itemize @bullet 5153@itemize @bullet
4965@item 5154@item
4966Macros as wrappers, AMSTeX support, delayed context parsing for 5155Fixed bug with @samp{%F} in a label prefix. Added new escapes
4967new labels.@refill 5156@samp{%m} and @samp{%M} for mater file name and master directory.
4968@end itemize 5157@end itemize
4969 5158
4970@noindent @b{Version 1.05} 5159@noindent @b{Version 4.24}
4971@itemize @bullet 5160@itemize @bullet
4972@item 5161@item
4973XEmacs port. 5162Inserting citation commands now prompts for optional arguments
5163when called with a prefix argument. Related new options are
5164@code{reftex-cite-prompt-optional-args} and
5165@code{reftex-cite-cleanup-optional-args}.
5166@item
5167New option @code{reftex-trust-label-prefix}. Configure this variable
5168if you'd like RefTeX to base its classification of labels on prefixes.
5169This can speed-up document parsing, but may in some cases reduce the
5170quality of the context used by RefTeX to describe a label.
5171@item
5172Fixed bug in @code{reftex-create-bibtex-file} when @code{reftex-comment-citations}
5173is non-nil.
5174@item
5175Fixed bugs in indexing: Case-sensitive search, quotes before and/or
5176after words. Disabbled indexing in comment lines.
4974@end itemize 5177@end itemize
4975 5178
4976@noindent @b{Version 1.07} 5179@noindent @b{Version 4.22}
4977@itemize @bullet 5180@itemize @bullet
5181@item
5182New command @code{reftex-create-bibtex-file} to create a new database
5183with all entries referenced in the current document.
4978@item 5184@item
4979@b{Ref@TeX{}} gets its own menu. 5185New keys @kbd{e} and @kbd{E} allow to produce a BibTeX database file
5186from entries marked in a citation selection buffer.
4980@end itemize 5187@end itemize
4981 5188
4982@noindent @b{Version 1.09} 5189@noindent @b{Version 4.21}
5190@itemize @bullet
5191@item
5192Renaming labels from the toc buffer with key @kbd{M-%}.
5193@end itemize
5194
5195@noindent @b{Version 4.20}
4983@itemize @bullet 5196@itemize @bullet
4984@item 5197@item
4985Support for @code{tex-main-file}, an analogue for 5198Structure editing capabilities. The command keys @kbd{<} and @kbd{>} in
4986@code{TeX-master}.@refill 5199the TOC buffer promote/demote the section at point or all sections in
5200the current region.
4987@item 5201@item
4988MS-DOS support. 5202New option @code{reftex-toc-split-windows-fraction} to set the size of
5203the window used by the TOC. This makes the old variable
5204@code{reftex-toc-split-windows-horizontally-fraction} obsolete.
5205@item
5206A dedicated frame can show the TOC with the current section
5207always automatically highlighted. The frame is created and
5208deleted from the toc buffer with the @kbd{d} key.
4989@end itemize 5209@end itemize
4990 5210
4991@noindent @b{Version 2.00} 5211@noindent @b{Version 4.19}
4992@itemize @bullet 5212@itemize @bullet
4993@item 5213@item
4994Labels can be derived from context (default for sections). 5214New command `reftex-toc-recenter' (@kbd{C-c -}) which shows the current
5215section in the TOC buffer without selecting the TOC window.
4995@item 5216@item
4996Configuration of label insertion and label referencing revised. 5217Recentering happens automatically in idle time when the option
5218@code{reftex-auto-recenter-toc} is turned on.
4997@item 5219@item
4998Crossref fields in BibTeX database entries. 5220Fixed several bugs related to automatic cursor positioning in the TOC
5221buffer.
4999@item 5222@item
5000@code{reftex-toc} introduced (thanks to Stephen Eglen). 5223The highlight in the TOC buffer stays when the focus moves to a
5224different window.
5225@item
5226New command `reftex-goto-label'.
5227@item
5228Part numbers are no longer included in chapter numbers, and a new
5229part does not reset the chapter counter. See new option
5230@code{reftex-part-resets-chapter}.
5001@end itemize 5231@end itemize
5002 5232
5003@noindent @b{Version 2.03} 5233@noindent @b{Version 4.18}
5004@itemize @bullet 5234@itemize @bullet
5005@item 5235@item
5006@code{figure*}, @code{table*}, @code{sidewaysfigure/table} added to 5236@code{reftex-citation} uses the word before the cursor as a default
5007default environments.@refill 5237search string.
5008@item 5238@item
5009@code{reftex-bibfile-ignore-list} introduced (thanks to Rory Molinari). 5239Simplified several regular expressions for speed.
5010@item 5240@item
5011New functions @code{reftex-arg-label}, @code{reftex-arg-ref}, 5241Better support for chapterbib.
5012@code{reftex-arg-cite}.@refill 5242@end itemize
5243
5244@noindent @b{Version 4.17}
5245@itemize @bullet
5013@item 5246@item
5014Emacs/XEmacs compatibility reworked. XEmacs 19.15 now is 5247The toc window can be split off horizontally. See new options
5015required.@refill 5248@code{reftex-toc-split-windows-horizontally},
5249@code{reftex-toc-split-windows-horizontally-fraction}.
5016@item 5250@item
5017@code{reftex-add-to-label-alist} (to be called from AUCTeX style 5251It is possible to specify a function which verifies an index match
5018files).@refill 5252during global indexing. See new option @code{reftex-index-verify-function}.
5019@item 5253@item
5020Finding context with a hook function. 5254The macros which input a file in LaTeX (like \input, \include) can
5255be configured. See new option @code{reftex-include-file-commands}.
5021@item 5256@item
5022Sorting BibTeX entries (new variable: 5257The macros which specify the bibliography file (like \bibliography) can
5023@code{reftex-sort-bibtex-matches}). 5258be configured. See new option @code{reftex-bibliography-commands}.
5259@item
5260The regular expression used to search for the \bibliography macro has
5261been relaxed to allow for @samp{@{\bibliography@{...@}@}} needed by
5262chapterbib.
5263@item
5264Small bug fixes.
5024@end itemize 5265@end itemize
5025 5266
5026@noindent @b{Version 2.05} 5267@noindent @b{Version 4.15}
5027@itemize @bullet 5268@itemize @bullet
5028@item 5269@item
5029Support for @file{custom.el}. 5270Fixed bug with parsing of BibTeX files, when fields contain quotes or
5271unmatched parenthesis.
5030@item 5272@item
5031New function @code{reftex-grep-document} (thanks to Stephen Eglen). 5273Small bug fixes.
5274@item
5275Improved interaction with Emacs LaTeX mode.
5032@end itemize 5276@end itemize
5033 5277
5034@noindent @b{Version 2.07} 5278@noindent @b{Version 4.12}
5035@itemize @bullet 5279@itemize @bullet
5036@item 5280@item
5037New functions @code{reftex-search-document}, 5281Support for @file{bibentry} citation style.
5038@code{reftex-query-replace-document}.
5039@end itemize 5282@end itemize
5040 5283
5041@noindent @b{Version 2.11} 5284@noindent @b{Version 4.11}
5042@itemize @bullet 5285@itemize @bullet
5043@item 5286@item
5044Submitted for inclusion to Emacs and XEmacs. 5287Fixed bug which would parse @samp{\Section} just like @samp{\section}.
5045@end itemize 5288@end itemize
5046 5289
5047@noindent @b{Version 2.14} 5290@noindent @b{Version 4.10}
5048@itemize @bullet 5291@itemize @bullet
5049@item 5292@item
5050Variable @code{reftex-plug-into-AUCTeX} simplifies cooperation with 5293Renamed @file{reftex-vcr.el} to @file{reftex-dcr.el} because of conflict
5051AUCTeX.@refill 5294with @file{reftex-vars.el} on DOS machines.
5295@item
5296New options @code{reftex-parse-file-extension} and
5297@code{reftex-index-phrase-file-extension}.
5052@end itemize 5298@end itemize
5053 5299
5054@noindent @b{Version 2.17} 5300@noindent [.....]
5301@ignore
5302@noindent @b{Version 4.09}
5055@itemize @bullet 5303@itemize @bullet
5056@item 5304@item
5057Label prefix expands % escapes with current file name and other stuff. 5305New option @code{reftex-toc-max-level} to limit the depth of the toc.
5306New key binding @kbd{t} in the @file{*toc*} buffer to change this
5307setting.
5058@item 5308@item
5059Citation format now with % escapes. This is not backward 5309RefTeX maintains an @file{Index Phrases} file in which phrases can be
5060compatible!@refill 5310collected. When the document is ready, RefTeX can search all
5311these phrases and assist indexing all matches.
5061@item 5312@item
5062TEXINPUTS variable recognized when looking for input files. 5313The variables @code{reftex-index-macros} and
5314@code{reftex-index-default-macro} have changed their syntax slightly.
5315The @var{repeat} parameter has move from the latter to the former.
5316Also calls to @code{reftex-add-index-macros} from AUCTeX style files
5317need to be adapted.
5063@item 5318@item
5064Context can be the nth argument of a macro.@refill 5319The variable @code{reftex-section-levels} no longer contains the
5320default stuff which has been moved to a constant.
5065@item 5321@item
5066Searching in the select buffer is now possible (@kbd{C-s} and 5322Environments like theorems can be placed into the TOC by putting
5067@kbd{C-r}).@refill 5323entries for @samp{"begin@{theorem@}"} in
5324@code{reftex-setion-levels}.
5325@end itemize
5326
5327@noindent @b{Version 4.06}
5328@itemize @bullet
5068@item 5329@item
5069Display and derive-label can use two different context methods. 5330@code{reftex-section-levels} can contain a function to compute the level
5331of a sectioning command.
5070@item 5332@item
5071AMSmath @code{xalignat} and @code{xxalignat} added. 5333Multiple @code{thebibliography} environments recognized.
5072@end itemize 5334@end itemize
5073 5335
5074@noindent @b{Version 3.00} 5336@noindent @b{Version 4.04}
5075@itemize @bullet 5337@itemize @bullet
5076@item 5338@item
5077@b{Ref@TeX{}} should work better for very large projects: 5339New option @code{reftex-index-default-tag} implements a default for queries.
5340@end itemize
5341
5342@noindent @b{Version 4.02}
5343@itemize @bullet
5078@item 5344@item
5079The new parser works without creating a master buffer. 5345macros ending in @samp{refrange} are considered to contain references.
5080@item 5346@item
5081Rescanning can be limited to a part of a multifile document. 5347Index entries made with @code{reftex-index-selection-or-word} in TeX
5348math mode automatically get enclosing @samp{$} to preserve math mode. See
5349new option @code{reftex-index-math-format}. Requires AUCTeX.
5350@end itemize
5351
5352@noindent @b{Version 4.01}
5353@itemize @bullet
5082@item 5354@item
5083Information from the parser can be stored in a file. 5355New command @code{reftex-index-globally} to index a word in many
5356places in the document. Also available from the index buffer with
5357@kbd{&}.
5084@item 5358@item
5085@b{Ref@TeX{}} can deal with macros having a naked label as an argument. 5359The first item in a @code{reftex-label-alist} entry may now also be a parser
5360function to do non-standard parsing.
5086@item 5361@item
5087Macros may have white space and newlines between arguments. 5362@code{reftex-auto-view-crossref} no longer interferes with
5363@code{pop-up-frames} (patch from Stefan Monnier).
5364@end itemize
5365
5366@noindent @b{Version 4.00}
5367@itemize @bullet
5088@item 5368@item
5089Multiple identical section headings no longer confuse 5369RefTeX has been split into several smaller files which are autoloaded on
5090@code{reftex-toc}.@refill 5370demand.
5091@item 5371@item
5092@b{Ref@TeX{}} should work correctly in combination with buffer-altering 5372Index support, along with many new options.
5093packages like outline, folding, x-symbol, iso-cvt, isotex, etc.@refill
5094@item 5373@item
5095All labeled environments discussed in @emph{The LaTeX Companion} by 5374The selection of keys for @code{\ref} and @code{\cite} now allows to
5096Goossens, Mittelbach & Samarin, Addison-Wesley 1994) are part of 5375select multiple items by marking entries with the @kbd{m} key.
5097@b{Ref@TeX{}}'s defaults.@refill 5376@item
5377Fancyref support.
5098@end itemize 5378@end itemize
5099 5379
5100@noindent @b{Version 3.03} 5380@noindent @b{Version 3.43}
5101@itemize @bullet 5381@itemize @bullet
5102@item 5382@item
5103Support for the LaTeX package @code{xr}, for inter-document 5383Viewing cross-references generalized. Now works on @code{\label},
5104references.@refill 5384@code{\ref}, @code{\cite}, @code{\bibitem}, @code{\index}, variations of
5385these, and from BibTeX buffers.
5105@item 5386@item
5106A few (minor) Mule-related changes. 5387New option @code{reftex-view-crossref-extra}.
5107@item 5388@item
5108Fixed bug which could cause @emph{huge} @file{.rel} files. 5389Support for the additional sectioning commands @code{\addchap} and
5390@code{\addsec} which are defined in the LaTeX KOMA-Script classes.
5109@item 5391@item
5110Search for input and @file{.bib} files with recursive path definitions. 5392Files in @code{reftex-default-bibliography} will be searched along
5393@code{BIBINPUTS} path.
5394@item
5395Reading a parse file now checks consistency.
5111@end itemize 5396@end itemize
5112 5397
5113@noindent @b{Version 3.04} 5398@noindent @b{Version 3.42}
5114@itemize @bullet 5399@itemize @bullet
5115@item 5400@item
5116Fixed BUG in the @emph{xr} support. 5401File search further refined. New option @code{reftex-file-extensions}.
5402@item
5403@file{*toc*} buffer can show the file boundaries of a multifile
5404document, all labels and associated context. New keys @kbd{i}, @kbd{l},
5405and @kbd{c}. New options @code{reftex-toc-include-labels},
5406@code{reftex-toc-include-context},
5407@code{reftex-toc-include-file-boundaries}.
5117@end itemize 5408@end itemize
5118 5409
5119@noindent @b{Version 3.05} 5410@noindent @b{Version 3.41}
5120@itemize @bullet 5411@itemize @bullet
5121@item 5412@item
5122Compatibility code now first checks for XEmacs feature. 5413New options @code{reftex-texpath-environment-variables},
5414@code{reftex-use-external-file-finders},
5415@code{reftex-external-file-finders},
5416@code{reftex-search-unrecursed-path-first}.
5417@item
5418@emph{kpathsearch} support. See new options and
5419@code{reftex-bibpath-environment-variables}.
5123@end itemize 5420@end itemize
5124 5421
5125@noindent @b{Version 3.07} 5422@noindent @b{Version 3.38}
5126@itemize @bullet 5423@itemize @bullet
5127@item 5424@item
5128@code{Ref} menu improved. 5425@code{reftex-view-crossref} no longer moves to find a macro. Point has
5426to be on the macro argument.
5129@end itemize 5427@end itemize
5130 5428
5131@noindent @b{Version 3.10} 5429@noindent @b{Version 3.36}
5132@itemize @bullet 5430@itemize @bullet
5133@item 5431@item
5134Fixed a bug which made reftex 3.07 fail on [X]Emacs version 19. 5432New value @code{window} for option @code{reftex-auto-view-crossref}.
5135@item
5136Removed unimportant code which caused OS/2 Emacs to crash.
5137@item
5138All customization variables now accessible from menu.
5139@end itemize 5433@end itemize
5140 5434
5141@noindent @b{Version 3.11} 5435@noindent @b{Version 3.35}
5142@itemize @bullet 5436@itemize @bullet
5143@item 5437@item
5144Fixed bug which led to naked label in (e.g.) footnotes. 5438ISO 8859 Latin-1 chars are converted to ASCII to derive better labels.
5145@item 5439This takes back the related changes in 3.34 for safety reasons.
5146Added scroll-other-window functions to RefTeX-Select.
5147@end itemize 5440@end itemize
5148 5441
5149@noindent @b{Version 3.12} 5442@noindent @b{Version 3.34}
5150@itemize @bullet 5443@itemize @bullet
5151@item 5444@item
5152There are 3 new keymaps for customization: @code{reftex-toc-map}, 5445Additional flag in @code{reftex-derive-label-parameters} do make only
5153@code{reftex-select-label-map}, @code{reftex-select-bib-map}. 5446lowercase labels (default @code{t}).
5154@item 5447@item
5155Refontification uses more standard font-lock stuff. 5448All @file{.rel} files have a final newline to avoid queries.
5156@item 5449@item
5157When no BibTeX database files are specified, citations can also use 5450Single byte representations of accented European letters (ISO-8859-1)
5158@code{\bibitem} entries from a @code{thebibliography} environment.@refill 5451are now legal in labels.
5159@end itemize 5452@end itemize
5160 5453
5161@noindent @b{Version 3.14} 5454@noindent @b{Version 3.33}
5162@itemize @bullet 5455@itemize @bullet
5163@item 5456@item
5164Selection buffers can be kept between selections: this is faster. 5457Multiple selection buffers are now hidden buffers (they start with a
5165See new variable @code{reftex-use-multiple-selection-buffers}.@refill 5458SPACE).
5166@item
5167Prefix interpretation of reftex-view-crossref changed.
5168@item 5459@item
5169Support for the @code{varioref} package (@kbd{v} key in selection 5460Fixed bug with file search when TEXINPUTS environment variable is empty.
5170buffer).@refill
5171@end itemize 5461@end itemize
5172 5462
5173@noindent @b{Version 3.16} 5463@noindent @b{Version 3.30}
5174@itemize @bullet 5464@itemize @bullet
5175@item 5465@item
5176New hooks @code{reftex-format-label-function}, 5466In @code{reftex-citation}, the regular expression used to scan BibTeX
5177@code{reftex-format-ref-function}, @code{reftex-format-cite-function}.@refill 5467files can be specified using completion on known citation keys.
5178@item
5179TeXInfo documentation completed.
5180@item 5468@item
5181Some restrictions in Label inserting and referencing removed. 5469New keys @kbd{a} and @kbd{A} in BibTeX selection process to cite @emph{all}
5470entries.
5182@item 5471@item
5183New variable @code{reftex-default-bibliography}. 5472New command @code{reftex-renumber-simple-labels} to renumber simple
5473labels like @samp{eq:13} sequentially through a document.
5184@end itemize 5474@end itemize
5185 5475
5186@noindent @b{Version 3.17} 5476@noindent @b{Version 3.28}
5187@itemize @bullet 5477@itemize @bullet
5188@item 5478@item
5189Additional bindings in selection and @file{*toc*} buffers. @kbd{g} 5479Auto view crossref for XEmacs uses @code{post-command-hook} to restart the
5190redefined. 5480timer, since itimer restart is not reliable.
5191@item
5192New command @code{reftex-save-all-document-buffers}.
5193@item
5194Magic word matching made more intelligent.
5195@item
5196Selection process can switch to completion (with @key{TAB}).
5197@item 5481@item
5198@code{\appendix} is now recognized and influences section numbering. 5482Option @code{reftex-bibfile-ignore-list} renamed to @code{-regexps}.
5199@item 5483@item
5200File commentary shortened considerably (use Info documentation). 5484Expansion of recursive tex and bib path rewritten.
5201@item 5485@item
5202New option @code{reftex-no-include-regexps} to skip some include files. 5486Fixed problem where @b{Ref@TeX{}} did not scan unsaved buffers.
5203@item 5487@item
5204New option @code{reftex-revisit-to-follow}. 5488Fixed bug with section numbering after *-red sections.
5205@end itemize 5489@end itemize
5206 5490
5207@noindent @b{Version 3.18} 5491@noindent @b{Version 3.27}
5208@itemize @bullet 5492@itemize @bullet
5209@item 5493@item
5210The selection now uses a recursive edit, much like minibuffer input. 5494Macros can define @emph{neutral} labels, just like @code{\label}
5211This removes all restrictions during selection. E.g. you can now 5495itself.
5212switch buffers at will, use the mouse etc.@refill
5213@item
5214New option @code{reftex-highlight-selection}.
5215@item
5216@kbd{mouse-2} can be used to select in selection and @file{*toc*}
5217buffers.@refill
5218@item
5219Fixed some problems regarding the interaction with VIPER mode.
5220@item
5221Follow-mode is now only used after point motion.
5222@item 5496@item
5223@b{Ref@TeX{}} now finally does not fontify temporary files anymore. 5497New option @code{reftex-allow-detached-macro-args}, default @code{nil}!
5224@end itemize 5498@end itemize
5225 5499
5226@noindent @b{Version 3.19} 5500@noindent @b{Version 3.26}
5227@itemize @bullet 5501@itemize @bullet
5228@item 5502@item
5229Fixed bug with AUCTeX @code{TeX-master}. 5503[X]Emacs 19 no longer supported. Use 3.22 for Emacs 19.
5504@item
5505New hooks @code{reftex-translate-to-ascii-function},
5506@code{reftex-string-to-label-function}.
5507@item
5508Made sure automatic crossref display will not visit/scan files.
5230@end itemize 5509@end itemize
5231 5510
5232@noindent @b{Version 3.21} 5511@noindent @b{Version 3.25}
5233@itemize @bullet 5512@itemize @bullet
5234@item 5513@item
5235New options for all faces used by @b{Ref@TeX{}}. They're in the 5514Echoing of citation info caches the info for displayed entries.
5236customization group @code{reftex-fontification-configurations}.@refill 5515New option @code{reftex-cache-cite-echo}.
5516@item
5517@kbd{M-x reftex-reset-mode} now also removes the file with parsing
5518info.
5519@item
5520Default of @code{reftex-revisit-to-follow} changed to nil.
5237@end itemize 5521@end itemize
5238 5522
5239@noindent @b{Version 3.22} 5523@noindent @b{Version 3.24}
5240@itemize @bullet 5524@itemize @bullet
5241@item 5525@item
5242Fixed bug with empty context strings. 5526New option @code{reftex-revisit-to-echo}.
5243@item 5527@item
5244@code{reftex-mouse-view-crossref} is now bound by default at 5528Interface with X-Symbol (>=2.6) is now complete and stable.
5245@kbd{S-mouse-2}.@refill 5529@item
5530Adapted to new outline, which uses overlays.
5531@item
5532File names in @code{\bibliography} may now have the @code{.bib}
5533extension.
5534@item
5535Fixed Bug with parsing "single file" from master file buffer.
5246@end itemize 5536@end itemize
5247 5537
5248@noindent @b{Version 3.23} 5538@noindent @b{Version 3.23}
@@ -5278,311 +5568,302 @@ Fixed bug with syntax table and context refontification.
5278Safety-net for name change of @code{font-lock-reference-face}. 5568Safety-net for name change of @code{font-lock-reference-face}.
5279@end itemize 5569@end itemize
5280 5570
5281@noindent @b{Version 3.24} 5571@noindent @b{Version 3.22}
5282@itemize @bullet 5572@itemize @bullet
5283@item 5573@item
5284New option @code{reftex-revisit-to-echo}. 5574Fixed bug with empty context strings.
5285@item
5286Interface with X-Symbol (>=2.6) is now complete and stable.
5287@item
5288Adapted to new outline, which uses overlays.
5289@item
5290File names in @code{\bibliography} may now have the @code{.bib}
5291extension.@refill
5292@item 5575@item
5293Fixed Bug with parsing "single file" from master file buffer. 5576@code{reftex-mouse-view-crossref} is now bound by default at
5577@kbd{S-mouse-2}.
5294@end itemize 5578@end itemize
5295 5579
5296@noindent @b{Version 3.25} 5580@noindent @b{Version 3.21}
5297@itemize @bullet 5581@itemize @bullet
5298@item 5582@item
5299Echoing of citation info caches the info for displayed entries. 5583New options for all faces used by @b{Ref@TeX{}}. They're in the
5300New option @code{reftex-cache-cite-echo}.@refill 5584customization group @code{reftex-fontification-configurations}.
5301@item
5302@kbd{M-x reftex-reset-mode} now also removes the file with parsing
5303info.@refill
5304@item
5305Default of @code{reftex-revisit-to-follow} changed to nil.
5306@end itemize 5585@end itemize
5307 5586
5308@noindent @b{Version 3.26} 5587@noindent @b{Version 3.19}
5309@itemize @bullet 5588@itemize @bullet
5310@item 5589@item
5311[X]Emacs 19 no longer supported. Use 3.22 for Emacs 19. 5590Fixed bug with AUCTeX @code{TeX-master}.
5312@item
5313New hooks @code{reftex-translate-to-ascii-function},
5314@code{reftex-string-to-label-function}.@refill
5315@item
5316Made sure automatic crossref display will not visit/scan files.
5317@end itemize 5591@end itemize
5318 5592
5319@noindent @b{Version 3.27} 5593@noindent @b{Version 3.18}
5320@itemize @bullet 5594@itemize @bullet
5321@item 5595@item
5322Macros can define @emph{neutral} labels, just like @code{\label} 5596The selection now uses a recursive edit, much like minibuffer input.
5323itself.@refill 5597This removes all restrictions during selection. E.g. you can now
5598switch buffers at will, use the mouse etc.
5324@item 5599@item
5325New option @code{reftex-allow-detached-macro-args}, default @code{nil}! 5600New option @code{reftex-highlight-selection}.
5601@item
5602@kbd{mouse-2} can be used to select in selection and @file{*toc*}
5603buffers.
5604@item
5605Fixed some problems regarding the interaction with VIPER mode.
5606@item
5607Follow-mode is now only used after point motion.
5608@item
5609@b{Ref@TeX{}} now finally does not fontify temporary files anymore.
5326@end itemize 5610@end itemize
5327 5611
5328@noindent @b{Version 3.28} 5612@noindent @b{Version 3.17}
5329@itemize @bullet 5613@itemize @bullet
5330@item 5614@item
5331Auto view crossref for XEmacs uses @code{post-command-hook} to restart the 5615Additional bindings in selection and @file{*toc*} buffers. @kbd{g}
5332timer, since itimer restart is not reliable.@refill 5616redefined.
5333@item 5617@item
5334Option @code{reftex-bibfile-ignore-list} renamed to @code{-regexps}. 5618New command @code{reftex-save-all-document-buffers}.
5335@item 5619@item
5336Expansion of recursive tex and bib path rewritten. 5620Magic word matching made more intelligent.
5337@item 5621@item
5338Fixed problem where @b{Ref@TeX{}} did not scan unsaved buffers. 5622Selection process can switch to completion (with @key{TAB}).
5339@item 5623@item
5340Fixed bug with section numbering after *-red sections. 5624@code{\appendix} is now recognized and influences section numbering.
5625@item
5626File commentary shortened considerably (use Info documentation).
5627@item
5628New option @code{reftex-no-include-regexps} to skip some include files.
5629@item
5630New option @code{reftex-revisit-to-follow}.
5341@end itemize 5631@end itemize
5342 5632
5343@noindent @b{Version 3.30} 5633@noindent @b{Version 3.16}
5344@itemize @bullet 5634@itemize @bullet
5345@item 5635@item
5346In @code{reftex-citation}, the regular expression used to scan BibTeX 5636New hooks @code{reftex-format-label-function},
5347files can be specified using completion on known citation keys. 5637@code{reftex-format-ref-function}, @code{reftex-format-cite-function}.
5348@item 5638@item
5349New keys @kbd{a} and @kbd{A} in BibTeX selection process to cite @emph{all} 5639TeXInfo documentation completed.
5350entries.
5351@item 5640@item
5352New command @code{reftex-renumber-simple-labels} to renumber simple 5641Some restrictions in Label inserting and referencing removed.
5353labels like @samp{eq:13} sequentially through a document. 5642@item
5643New variable @code{reftex-default-bibliography}.
5354@end itemize 5644@end itemize
5355@noindent @b{Version 3.33} 5645
5646@noindent @b{Version 3.14}
5356@itemize @bullet 5647@itemize @bullet
5357@item 5648@item
5358Multiple selection buffers are now hidden buffers (they start with a 5649Selection buffers can be kept between selections: this is faster.
5359SPACE). 5650See new variable @code{reftex-use-multiple-selection-buffers}.
5360@item 5651@item
5361Fixed bug with file search when TEXINPUTS environment variable is empty. 5652Prefix interpretation of reftex-view-crossref changed.
5653@item
5654Support for the @code{varioref} package (@kbd{v} key in selection
5655buffer).
5362@end itemize 5656@end itemize
5363@noindent @b{Version 3.34} 5657
5658@noindent @b{Version 3.12}
5364@itemize @bullet 5659@itemize @bullet
5365@item 5660@item
5366Additional flag in @code{reftex-derive-label-parameters} do make only 5661There are 3 new keymaps for customization: @code{reftex-toc-map},
5367lowercase labels (default @code{t}). 5662@code{reftex-select-label-map}, @code{reftex-select-bib-map}.
5368@item 5663@item
5369All @file{.rel} files have a final newline to avoid queries. 5664Refontification uses more standard font-lock stuff.
5370@item 5665@item
5371Single byte representations of accented European letters (ISO-8859-1) 5666When no BibTeX database files are specified, citations can also use
5372are now legal in labels. 5667@code{\bibitem} entries from a @code{thebibliography} environment.
5373@end itemize 5668@end itemize
5374@noindent @b{Version 3.35} 5669
5670@noindent @b{Version 3.11}
5375@itemize @bullet 5671@itemize @bullet
5376@item 5672@item
5377ISO 8859 Latin-1 chars are converted to ASCII to derive better labels. 5673Fixed bug which led to naked label in (e.g.) footnotes.
5378This takes back the related changes in 3.34 for safety reasons.@refill 5674@item
5675Added scroll-other-window functions to RefTeX-Select.
5379@end itemize 5676@end itemize
5380@noindent @b{Version 3.36} 5677
5678@noindent @b{Version 3.10}
5381@itemize @bullet 5679@itemize @bullet
5382@item 5680@item
5383New value @code{window} for option @code{reftex-auto-view-crossref}. 5681Fixed a bug which made reftex 3.07 fail on [X]Emacs version 19.
5682@item
5683Removed unimportant code which caused OS/2 Emacs to crash.
5684@item
5685All customization variables now accessible from menu.
5384@end itemize 5686@end itemize
5385@noindent @b{Version 3.38} 5687
5688@noindent @b{Version 3.07}
5386@itemize @bullet 5689@itemize @bullet
5387@item 5690@item
5388@code{reftex-view-crossref} no longer moves to find a macro. Point has 5691@code{Ref} menu improved.
5389to be on the macro argument.
5390@end itemize 5692@end itemize
5391@noindent @b{Version 3.41} 5693
5694@noindent @b{Version 3.05}
5392@itemize @bullet 5695@itemize @bullet
5393@item 5696@item
5394New options @code{reftex-texpath-environment-variables}, 5697Compatibility code now first checks for XEmacs feature.
5395@code{reftex-use-external-file-finders},
5396@code{reftex-external-file-finders},
5397@code{reftex-search-unrecursed-path-first}.
5398@item
5399@emph{kpathsearch} support. See new options and
5400@code{reftex-bibpath-environment-variables}.
5401@end itemize 5698@end itemize
5402@noindent @b{Version 3.42} 5699
5700@noindent @b{Version 3.04}
5403@itemize @bullet 5701@itemize @bullet
5404@item 5702@item
5405File search further refined. New option @code{reftex-file-extensions}. 5703Fixed BUG in the @emph{xr} support.
5406@item
5407@file{*toc*} buffer can show the file boundaries of a multifile
5408document, all labels and associated context. New keys @kbd{i}, @kbd{l},
5409and @kbd{c}. New options @code{reftex-toc-include-labels},
5410@code{reftex-toc-include-context},
5411@code{reftex-toc-include-file-boundaries}. @refill
5412@end itemize 5704@end itemize
5413@noindent @b{Version 3.43} 5705
5706@noindent @b{Version 3.03}
5414@itemize @bullet 5707@itemize @bullet
5415@item 5708@item
5416Viewing cross-references generalized. Now works on @code{\label}, 5709Support for the LaTeX package @code{xr}, for inter-document
5417@code{\ref}, @code{\cite}, @code{\bibitem}, @code{\index}, variations of 5710references.
5418these, and from BibTeX buffers.@refill
5419@item
5420New option @code{reftex-view-crossref-extra}.@refill
5421@item 5711@item
5422Support for the additional sectioning commands @code{\addchap} and 5712A few (minor) Mule-related changes.
5423@code{\addsec} which are defined in the LaTeX KOMA-Script classes.@refill
5424@item 5713@item
5425Files in @code{reftex-default-bibliography} will be searched along 5714Fixed bug which could cause @emph{huge} @file{.rel} files.
5426@code{BIBINPUTS} path.@refill
5427@item 5715@item
5428Reading a parse file now checks consistency. 5716Search for input and @file{.bib} files with recursive path definitions.
5429@end itemize 5717@end itemize
5430@noindent @b{Version 4.00} 5718
5719@noindent @b{Version 3.00}
5431@itemize @bullet 5720@itemize @bullet
5432@item 5721@item
5433RefTeX has been split into several smaller files which are autoloaded on 5722@b{Ref@TeX{}} should work better for very large projects:
5434demand.
5435@item
5436Index support, along with many new options.
5437@item 5723@item
5438The selection of keys for @code{\ref} and @code{\cite} now allows to 5724The new parser works without creating a master buffer.
5439select multiple items by marking entries with the @kbd{m} key.
5440@item 5725@item
5441Fancyref support. 5726Rescanning can be limited to a part of a multifile document.
5442@end itemize
5443@noindent @b{Version 4.01}
5444@itemize @bullet
5445@item 5727@item
5446New command @code{reftex-index-globally} to index a word in many 5728Information from the parser can be stored in a file.
5447places in the document. Also available from the index buffer with
5448@kbd{&}.
5449@item 5729@item
5450The first item in a @code{reftex-label-alist} entry may now also be a parser 5730@b{Ref@TeX{}} can deal with macros having a naked label as an argument.
5451function to do non-standard parsing.
5452@item 5731@item
5453@code{reftex-auto-view-crossref} no longer interferes with 5732Macros may have white space and newlines between arguments.
5454@code{pop-up-frames} (patch from Stefan Monnier).
5455@end itemize
5456@noindent @b{Version 4.02}
5457@itemize @bullet
5458@item 5733@item
5459macros ending in @samp{refrange} are considered to contain references. 5734Multiple identical section headings no longer confuse
5735@code{reftex-toc}.
5460@item 5736@item
5461Index entries made with @code{reftex-index-selection-or-word} in TeX 5737@b{Ref@TeX{}} should work correctly in combination with buffer-altering
5462math mode automatically get enclosing @samp{$} to preserve math mode. See 5738packages like outline, folding, x-symbol, iso-cvt, isotex, etc.
5463new option @code{reftex-index-math-format}. Requires AUCTeX.
5464@end itemize
5465@noindent @b{Version 4.04}
5466@itemize @bullet
5467@item 5739@item
5468New option @code{reftex-index-default-tag} implements a default for queries. 5740All labeled environments discussed in @emph{The LaTeX Companion} by
5741Goossens, Mittelbach & Samarin, Addison-Wesley 1994) are part of
5742@b{Ref@TeX{}}'s defaults.
5469@end itemize 5743@end itemize
5470@noindent @b{Version 4.06} 5744
5745@noindent @b{Version 2.17}
5471@itemize @bullet 5746@itemize @bullet
5472@item 5747@item
5473@code{reftex-section-levels} can contain a function to compute the level 5748Label prefix expands % escapes with current file name and other stuff.
5474of a sectioning command.
5475@item 5749@item
5476Multiple @code{thebibliography} environments recognized. 5750Citation format now with % escapes. This is not backward
5477@end itemize 5751compatible!
5478@noindent @b{Version 4.09}
5479@itemize @bullet
5480@item 5752@item
5481New option @code{reftex-toc-max-level} to limit the depth of the toc. 5753TEXINPUTS variable recognized when looking for input files.
5482New key binding @kbd{t} in the @file{*toc*} buffer to change this
5483setting.@refill
5484@item 5754@item
5485RefTeX maintains an @file{Index Phrases} file in which phrases can be 5755Context can be the nth argument of a macro.
5486collected. When the document is ready, RefTeX can search all
5487these phrases and assist indexing all matches.@refill
5488@item 5756@item
5489The variables @code{reftex-index-macros} and 5757Searching in the select buffer is now possible (@kbd{C-s} and
5490@code{reftex-index-default-macro} have changed their syntax slightly. 5758@kbd{C-r}).
5491The @var{repeat} parameter has move from the latter to the former.
5492Also calls to @code{reftex-add-index-macros} from AUCTeX style files
5493need to be adapted.@refill
5494@item 5759@item
5495The variable @code{reftex-section-levels} no longer contains the 5760Display and derive-label can use two different context methods.
5496default stuff which has been moved to a constant.@refill
5497@item 5761@item
5498Environments like theorems can be placed into the TOC by putting 5762AMSmath @code{xalignat} and @code{xxalignat} added.
5499entries for @samp{"begin@{theorem@}"} in
5500@code{reftex-setion-levels}.@refill
5501@end itemize 5763@end itemize
5502@noindent @b{Version 4.10} 5764
5765@noindent @b{Version 2.14}
5503@itemize @bullet 5766@itemize @bullet
5504@item 5767@item
5505Renamed @file{reftex-vcr.el} to @file{reftex-dcr.el} because of conflict 5768Variable @code{reftex-plug-into-AUCTeX} simplifies cooperation with
5506with @file{reftex-vars.el} on DOS machines. 5769AUCTeX.
5507@item
5508New options @code{reftex-parse-file-extension} and
5509@code{reftex-index-phrase-file-extension}.
5510@end itemize 5770@end itemize
5511@noindent @b{Version 4.11} 5771
5772@noindent @b{Version 2.11}
5512@itemize @bullet 5773@itemize @bullet
5513@item 5774@item
5514Fixed bug which would parse @samp{\Section} just like @samp{\section}. 5775Submitted for inclusion to Emacs and XEmacs.
5515@end itemize 5776@end itemize
5516@noindent @b{Version 4.12} 5777
5778@noindent @b{Version 2.07}
5517@itemize @bullet 5779@itemize @bullet
5518@item 5780@item
5519Support for @file{bibentry} citation style. 5781New functions @code{reftex-search-document},
5782@code{reftex-query-replace-document}.
5520@end itemize 5783@end itemize
5521@noindent @b{Version 4.15} 5784
5785@noindent @b{Version 2.05}
5522@itemize @bullet 5786@itemize @bullet
5523@item 5787@item
5524Fixed bug with parsing of BibTeX files, when fields contain quotes or 5788Support for @file{custom.el}.
5525unmatched parenthesis.
5526@item
5527Small bug fixes.
5528@item 5789@item
5529Improved interaction with Emacs LaTeX mode. 5790New function @code{reftex-grep-document} (thanks to Stephen Eglen).
5530@end itemize 5791@end itemize
5531@end ignore 5792
5532@noindent @b{Version 4.17} 5793@noindent @b{Version 2.03}
5533@itemize @bullet 5794@itemize @bullet
5534@item 5795@item
5535The toc window can be split off horizontally. See new options 5796@code{figure*}, @code{table*}, @code{sidewaysfigure/table} added to
5536@code{reftex-toc-split-windows-horizontally}, 5797default environments.
5537@code{reftex-toc-split-windows-horizontally-fraction}.
5538@item 5798@item
5539It is possible to specify a function which verifies an index match 5799@code{reftex-bibfile-ignore-list} introduced (thanks to Rory Molinari).
5540during global indexing. See new option @code{reftex-index-verify-function}.
5541@item 5800@item
5542The macros which input a file in LaTeX (like \input, \include) can 5801New functions @code{reftex-arg-label}, @code{reftex-arg-ref},
5543be configured. See new option @code{reftex-include-file-commands}. 5802@code{reftex-arg-cite}.
5544@item 5803@item
5545The macros which specify the bibliography file (like \bibliography) can 5804Emacs/XEmacs compatibility reworked. XEmacs 19.15 now is
5546be configured. See new option @code{reftex-bibliography-commands}. 5805required.
5547@item 5806@item
5548The regular expression used to search for the \bibliography macro has 5807@code{reftex-add-to-label-alist} (to be called from AUCTeX style
5549been relaxed to allow for @samp{@{\bibliography@{...@}@}} needed by 5808files).
5550chapterbib.
5551@item 5809@item
5552Small bug fixes. 5810Finding context with a hook function.
5811@item
5812Sorting BibTeX entries (new variable:
5813@code{reftex-sort-bibtex-matches}).
5553@end itemize 5814@end itemize
5554@noindent @b{Version 4.18} 5815
5816@noindent @b{Version 2.00}
5555@itemize @bullet 5817@itemize @bullet
5556@item 5818@item
5557@code{reftex-citation} uses the word before the cursor as a default 5819Labels can be derived from context (default for sections).
5558search string.
5559@item 5820@item
5560Simplified several regular expressions for speed. 5821Configuration of label insertion and label referencing revised.
5561@item 5822@item
5562Better support for chapterbib. 5823Crossref fields in BibTeX database entries.
5824@item
5825@code{reftex-toc} introduced (thanks to Stephen Eglen).
5563@end itemize 5826@end itemize
5564@noindent @b{Version 4.19} 5827
5828@noindent @b{Version 1.09}
5565@itemize @bullet 5829@itemize @bullet
5566@item 5830@item
5567New command `reftex-toc-recenter' (@kbd{C-c -}) which shows the current 5831Support for @code{tex-main-file}, an analogue for
5568section in the TOC buffer without selecting the TOC window. 5832@code{TeX-master}.
5569@item 5833@item
5570Recentering happens automatically in idle time when the option 5834MS-DOS support.
5571@code{reftex-auto-recenter-toc} is turned on. 5835@end itemize
5836
5837@noindent @b{Version 1.07}
5838@itemize @bullet
5572@item 5839@item
5573Fixed several bugs related to automatic cursor positioning in the TOC 5840@b{Ref@TeX{}} gets its own menu.
5574buffer. 5841@end itemize
5842
5843@noindent @b{Version 1.05}
5844@itemize @bullet
5575@item 5845@item
5576The highlight in the TOC buffer stays when the focus moves to a 5846XEmacs port.
5577different window. 5847@end itemize
5848
5849@noindent @b{Version 1.04}
5850@itemize @bullet
5578@item 5851@item
5579New command `reftex-goto-label'. 5852Macros as wrappers, AMSTeX support, delayed context parsing for
5853new labels.
5854@end itemize
5855@end ignore
5856
5857@noindent @b{Version 1.00}
5858@itemize @bullet
5580@item 5859@item
5581Part numbers are no longer included in chapter numbers, and a new 5860released on 7 Jan 1997.
5582part does not reset the chapter counter. See new option
5583@code{reftex-part-resets-chapter}.
5584@end itemize 5861@end itemize
5585 5862
5863
5864
5865
5866
5586@node Index, , , Top 5867@node Index, , , Top
5587@unnumbered Index 5868@unnumbered Index
5588@printindex cp 5869@printindex cp
diff --git a/man/rmail.texi b/man/rmail.texi
index 23eef5abec8..3cfa1802a88 100644
--- a/man/rmail.texi
+++ b/man/rmail.texi
@@ -37,7 +37,10 @@ visiting a proper Rmail file.
37* Digest: Rmail Digest. Extracting the messages from a digest message. 37* Digest: Rmail Digest. Extracting the messages from a digest message.
38* Out of Rmail:: Converting an Rmail file to mailbox format. 38* Out of Rmail:: Converting an Rmail file to mailbox format.
39* Rot13: Rmail Rot13. Reading messages encoded in the rot13 code. 39* Rot13: Rmail Rot13. Reading messages encoded in the rot13 code.
40* Movemail: Movemail. More details of fetching new mail. 40* Movemail:: More details of fetching new mail.
41* Remote Mailboxes:: Retrieving Mail from Remote Mailboxes.
42* Other Mailbox Formats:: Retrieving Mail from Local Mailboxes in
43 Various Formats
41@end menu 44@end menu
42 45
43@node Rmail Basics 46@node Rmail Basics
@@ -1152,9 +1155,115 @@ rot13-other-window}. This displays the current buffer in another window
1152which applies the code when displaying the text. 1155which applies the code when displaying the text.
1153 1156
1154@node Movemail 1157@node Movemail
1155@section @code{movemail} and POP 1158@section @code{movemail} program
1156@cindex @code{movemail} program 1159@cindex @code{movemail} program
1157 1160
1161 When invoked for the first time, Rmail attempts to locate
1162@code{movemail} program and determine its version. There are
1163two versions of @code{movemail} program: the native one, shipped with
1164GNU Emacs (we will refer to it as @samp{emacs version}) and the one
1165coming from GNU mailutils (@xref{movemail,,,mailutils,GNU mailutils},
1166we will refer to it as @samp{mailutils version}). Both versions are
1167compatible with each other in the sense that they support the same
1168command line syntax and the same basic subset of options. However,
1169the @samp{mailutils} version offers a much richer set of
1170features.
1171
1172The @samp{Emacs version} of @code{movemail} is able to retrieve mail from usual
1173UNIX mailbox formats and from remote mailboxes using the POP3 protocol.
1174
1175The @samp{Mailutils version} is able to handle a wide set of mailbox
1176formats, such as plain UNIX mailboxes, @code{maildir} and @code{MH}
1177mailboxes, etc. It is able to retrieve remote mail using POP3 or IMAP4
1178protocol. In the latter case, @code{mailutils movemail} can be
1179instructed to retrieve mail using a TLS encrypted channel.
1180
1181The @samp{Mailutils movemail} accepts mailbox argument in the @acronym{URL}
1182form. The detailed description of mailbox @acronym{URL}s can be found
1183in @ref{URL,,,mailutils,Mailbox URL Formats}. In short, a
1184@acronym{URL} is:
1185
1186@smallexample
1187@var{proto}://[@var{user}[:@var{password}]@@]@var{host-or-file-name}
1188@end smallexample
1189
1190@noindent
1191where square brackets denote optional elements.
1192
1193@table @var
1194@item proto
1195Specifies the @dfn{mailbox protocol}, or @dfn{format} to
1196use. The exact semantics of the rest of @acronym{URL} elements depends
1197on the actual value of @var{proto}.
1198
1199@item user
1200User name to access the remote mailbox.
1201
1202@item password
1203User password to access the remote mailbox.
1204
1205@item host-or-file-name
1206Hostname of the remote server for remote mailboxes or file name of a
1207local mailbox.
1208@end table
1209
1210@var{Proto} can be one of:
1211
1212@table @asis
1213@item mbox
1214Usual UNIX mailbox format. In this case, neither @var{user} nor
1215@var{pass} are used, and @var{host-or-file-name} denotes the file name of
1216the mailbox file, e.g., @code{mbox://var/spool/mail/smith}.
1217
1218@item mh
1219A local mailbox in the @acronym{MH} format. @var{User} and
1220@var{pass} are not used. @var{Host-or-file-name} denotes the name of
1221@acronym{MH} folder, e.g., @code{mh://Mail/inbox}.
1222
1223@item maildir
1224A local mailbox in the @acronym{maildir} format. @var{User} and
1225@var{pass} are not used, and @var{host-or-file-name} denotes the name of
1226@code{maildir} mailbox, e.g., @code{maildir://mail/inbox}.
1227
1228@item file
1229Any local mailbox format. Its actual format is detected automatically
1230by @code{movemail}.
1231
1232@item pop
1233A remote mailbox to be accessed via POP3 protocol. @var{User}
1234specifies the remote user name to use, @var{pass} may be used to
1235specify the user password, @var{host-or-file-name} is the name or IP
1236address of the remote mail server to connect to; e.g.,
1237@code{pop://smith:guessme@@remote.server.net}.
1238
1239@item imap
1240A remote mailbox to be accessed via IMAP4 protocol. @var{User}
1241specifies the remote user name to use, @var{pass} may be used to
1242specify the user password, @var{host-or-file-name} is the name or IP
1243address of the remote mail server to connect to;
1244e.g., @code{imap://smith:guessme@@remote.server.net}.
1245@end table
1246
1247Alternatively, the mailbox may be specified as a file name of the
1248mailbox to use. This is equivalent to specifying the @samp{file} protocol:
1249
1250@smallexample
1251/var/spool/mail/user @equiv{} file://var/spool/mail/user
1252@end smallexample
1253
1254@vindex rmail-movemail-program
1255@vindex rmail-movemail-search-path
1256 To determine which version of @code{movemail} is being used, Rmail
1257examines the value of @code{rmail-movemail-program} variable. If it
1258is set, its value is used as a full path to the @code{movemail} binary.
1259Otherwise, Rmail searches for @code{movemail} in the list of directories
1260constructed by appending the values of @code{rmail-movemail-search-path} and
1261@code{exec-path} to @code{exec-directory}.
1262
1263@node Remote Mailboxes
1264@section Retrieving Mail from Remote Mailboxes
1265@pindex movemail
1266
1158@vindex rmail-preserve-inbox 1267@vindex rmail-preserve-inbox
1159 When getting new mail, Rmail first copies the new mail from the inbox 1268 When getting new mail, Rmail first copies the new mail from the inbox
1160file to the Rmail file; then it saves the Rmail file; then it truncates 1269file to the Rmail file; then it saves the Rmail file; then it truncates
@@ -1175,7 +1284,6 @@ file. If there is a crash at the wrong time, this file continues to
1175exist, and Rmail will use it again the next time it gets new mail from 1284exist, and Rmail will use it again the next time it gets new mail from
1176that inbox. 1285that inbox.
1177 1286
1178@pindex movemail
1179 If Rmail is unable to convert the data in 1287 If Rmail is unable to convert the data in
1180@file{~/.newmail-@var{inboxname}} into Babyl format, it renames the file 1288@file{~/.newmail-@var{inboxname}} into Babyl format, it renames the file
1181to @file{~/RMAILOSE.@var{n}} (@var{n} is an integer chosen to make the 1289to @file{~/RMAILOSE.@var{n}} (@var{n} is an integer chosen to make the
@@ -1186,30 +1294,72 @@ You should look at the file, find whatever message confuses Rmail
1186the corrected file. 1294the corrected file.
1187 1295
1188 Some sites use a method called POP for accessing users' inbox data 1296 Some sites use a method called POP for accessing users' inbox data
1189instead of storing the data in inbox files. @code{movemail} can work 1297instead of storing the data in inbox files. The @code{Emacs
1190with POP if you compile it with the macro @code{MAIL_USE_POP} defined. 1298movemail} can work with POP if you compile it with the macro
1191(You can achieve that by specifying @samp{--with-pop} when you run 1299@code{MAIL_USE_POP} defined. (You can achieve that by specifying
1192@code{configure} during the installation of Emacs.) 1300@samp{--with-pop} when you run @code{configure} during the
1193@code{movemail} only works with POP3, not with older 1301installation of Emacs.)
1302
1303The @code{Mailutils movemail} by default supports POP, unless configured
1304with @samp{--disable-pop} option.
1305
1306Both versions of @code{movemail} only work with POP3, not with older
1194versions of POP. 1307versions of POP.
1195 1308
1196@cindex @env{MAILHOST} environment variable 1309@cindex @env{MAILHOST} environment variable
1197@cindex POP inboxes 1310@cindex POP mailboxes
1198 Assuming you have compiled and installed @code{movemail} 1311 No matter which flavor of @code{movemail} you use, you can specify
1199appropriately, you can specify a POP inbox by using a ``file name'' of 1312POP inbox by using POP @dfn{URL} (@pxref{Movemail}). A POP
1200the form @samp{po:@var{username}}, in the inbox list of an Rmail file. 1313@acronym{URL} is a ``file name'' of the form
1201@code{movemail} handles such a name by opening a connection to the POP 1314@samp{pop://@var{username}@@@var{hostname}}, where
1202server. The @env{MAILHOST} environment variable specifies the machine 1315@var{hostname} is the host name or IP address of the remote mail
1203to look for the server on; alternatively, you can specify the POP server 1316server and @var{username} is the user name on that server.
1204host name as part of the mailbox name using the syntax 1317Additionally, you may specify the password in the mailbox @acronym{URL}:
1205@samp{po:@var{username}:@var{hostname}}. 1318@samp{pop://@var{username}:@var{password}@@@var{hostname}}. In this
1206 1319case, @var{password} takes preference over the one set by
1320@code{rmail-remote-password}. This is especially useful if you have
1321several remote mailboxes with different passwords.
1322
1323 For backward compatibility Rmail also supports two alternative ways
1324of specifying remote POP mailboxes. Specifying inbox name in the form
1325@samp{po:@var{username}:@var{hostname}} is equivalent to
1326@samp{pop://@var{username}@@@var{hostname}}. Alternatively, you may set
1327a ``file name'' of @samp{po:@var{username}} in the inbox list of an
1328Rmail file. @code{Movemail} will handle such a name by opening a
1329connection to the POP server. The @env{MAILHOST} environment variable
1330will in this case specify the machine to look for the server on.
1331
1332@cindex IMAP mailboxes
1333 Another method for accessing remote mailboxes is IMAP. This method is
1334supported only by the @code{mailutils movemail}. To specify an IMAP
1335mailbox in the inbox list, use the following mailbox @acronym{URL}:
1336@samp{imap://@var{username}[:@var{password}]@@@var{hostname}}. The
1337@var{password} part is optional, as descrbed above.
1338
1339@vindex rmail-remote-password
1340@vindex rmail-remote-password-required
1207@vindex rmail-pop-password 1341@vindex rmail-pop-password
1208@vindex rmail-pop-password-required 1342@vindex rmail-pop-password-required
1209 Accessing mail via POP may require a password. If the variable 1343 Accessing a remote mailbox may require a password. Rmail uses the
1210@code{rmail-pop-password} is non-@code{nil}, it specifies the password 1344following algorithm to retrieve it:
1211to use for POP. Alternatively, if @code{rmail-pop-password-required} is 1345
1212non-@code{nil}, then Rmail asks you for the password to use. 1346@enumerate
1347@item
1348If the @var{password} is present in mailbox URL (see above), it is
1349used.
1350@item
1351If the variable @code{rmail-remote-password} is non-@code{nil}, its
1352value is used.
1353@item
1354Otherwise, if @code{rmail-remote-password-required} is non-@code{nil},
1355then Rmail will ask you for the password to use.
1356@item
1357Otherwise, Rmail assumes no password is required.
1358@end enumerate
1359
1360 For compatibility with previous versions, @code{rmail-pop-password}
1361and @code{rmail-pop-password-required} may be used instead of
1362@code{rmail-remote-password} and @code{rmail-remote-password-required}.
1213 1363
1214@vindex rmail-movemail-flags 1364@vindex rmail-movemail-flags
1215 If you need to pass additional command-line flags to @code{movemail}, 1365 If you need to pass additional command-line flags to @code{movemail},
@@ -1231,6 +1381,25 @@ received, you can tell @code{movemail} to reverse the order of
1231downloaded messages by adding the @samp{-r} flag to 1381downloaded messages by adding the @samp{-r} flag to
1232@code{rmail-movemail-flags}. 1382@code{rmail-movemail-flags}.
1233 1383
1384@cindex TLS encryption (Rmail)
1385 @code{Mailutils movemail} supports TLS encryption. If you wish to
1386use it, add the @samp{--tls} flag to @code{rmail-movemail-flags}.
1387
1388@node Other Mailbox Formats
1389@section Retrieving Mail from Local Mailboxes in Various Formats
1390
1391 If your incoming mail is stored on a local machine in a format other
1392than UNIX mailbox, you will need the @code{mailutils movemail} to retrieve
1393it. @xref{Movemail}, for the detailed description of @code{movemail}
1394versions.
1395
1396 For example, to retrieve mail from a @code{maildir} inbox located in
1397@file{/var/spool/mail/in}, you would set the following in Rmail inbox list:
1398
1399@smallexample
1400maildir://var/spool/mail/in
1401@end smallexample
1402
1234@ignore 1403@ignore
1235 arch-tag: 034965f6-38df-47a2-a9f1-b8bc8ab37e23 1404 arch-tag: 034965f6-38df-47a2-a9f1-b8bc8ab37e23
1236@end ignore 1405@end ignore
diff --git a/man/search.texi b/man/search.texi
index 2cc273fd4a4..1e4d9ea53c6 100644
--- a/man/search.texi
+++ b/man/search.texi
@@ -219,7 +219,8 @@ activating it, and does so only if the mark is not already active.
219 219
220 @kbd{M-%} typed in incremental search invokes @code{query-replace} 220 @kbd{M-%} typed in incremental search invokes @code{query-replace}
221or @code{query-replace-regexp} (depending on search mode) with the 221or @code{query-replace-regexp} (depending on search mode) with the
222current search string used as the string to replace. 222current search string used as the string to replace. @xref{Query
223Replace}.
223 224
224@cindex lazy search highlighting 225@cindex lazy search highlighting
225@vindex isearch-lazy-highlight 226@vindex isearch-lazy-highlight
@@ -231,11 +232,11 @@ other matches helps indicate which match is the current one.
231If you don't like this feature, you can turn it off by setting 232If you don't like this feature, you can turn it off by setting
232@code{isearch-lazy-highlight} to @code{nil}. 233@code{isearch-lazy-highlight} to @code{nil}.
233 234
234@vindex isearch-lazy-highlight-face
235@cindex faces for highlighting search matches 235@cindex faces for highlighting search matches
236 You can control how this highlighting looks by customizing the faces 236 You can control how this highlighting looks by customizing the faces
237@code{isearch} (used for the current match) and 237@code{isearch} (used for the current match) and @code{lazy-highlight}
238@code{isearch-lazy-highlight-face} (for all the other matches). 238(for all the other matches). The latter is also used for other matches
239inside @code{query-replace}.
239 240
240@vindex isearch-mode-map 241@vindex isearch-mode-map
241 To customize the special characters that incremental search understands, 242 To customize the special characters that incremental search understands,
@@ -1153,6 +1154,14 @@ word-delimiter characters.
1153@kindex C-M-% 1154@kindex C-M-%
1154@findex query-replace-regexp 1155@findex query-replace-regexp
1155 @kbd{C-M-%} performs regexp search and replace (@code{query-replace-regexp}). 1156 @kbd{C-M-%} performs regexp search and replace (@code{query-replace-regexp}).
1157It works like @code{replace-regexp} except that it queries
1158like @code{query-replace}.
1159
1160@cindex faces for highlighting query replace
1161 These commands highlight the current match using the face
1162@code{query-replace}. They highlight other matches using
1163@code{lazy-highlight} just like incremental search (@pxref{Incremental
1164Search}).
1156 1165
1157 The characters you can type when you are shown a match for the string 1166 The characters you can type when you are shown a match for the string
1158or regexp are: 1167or regexp are:
diff --git a/man/widget.texi b/man/widget.texi
index 7e1d920cc62..497d2ca5a69 100644
--- a/man/widget.texi
+++ b/man/widget.texi
@@ -10,7 +10,7 @@
10@c %**end of header 10@c %**end of header
11 11
12@copying 12@copying
13Copyright @copyright{} 2000, 2002, 2003 Free Software Foundation, Inc. 13Copyright @copyright{} 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
14 14
15@quotation 15@quotation
16Permission is granted to copy, distribute and/or modify this document 16Permission is granted to copy, distribute and/or modify this document
@@ -593,6 +593,11 @@ is either a string to display, a function of one argument, the widget,
593which should return a string to display, or a form that evaluates to 593which should return a string to display, or a form that evaluates to
594such a string. 594such a string.
595 595
596@vindex follow-link@r{ keyword}
597@item :follow-link
598Specifies how to interpret a @key{mouse-1} click on the widget.
599@xref{Enabling Mouse-1 to Follow Links,,, elisp, the Emacs Lisp Reference Manual}.
600
596@vindex indent@r{ keyword} 601@vindex indent@r{ keyword}
597@item :indent 602@item :indent
598An integer indicating the absolute number of spaces to indent children 603An integer indicating the absolute number of spaces to indent children
diff --git a/src/ChangeLog b/src/ChangeLog
index e2da7ae1a5f..18bd89e9dda 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,206 @@
12005-01-15 Steven Tamm <steventamm@mac.com>
2
3 * macterm.c (Vmac_use_core_graphics): defined for
4 mac-allow-anti-aliasing
5 (syms_of_macterm): Added mac-allow-anti-aliasing
6 (mac_draw_string_common): Use core graphics text rendering if
7 mac-allow-anti-aliasing is enabled.
8
9 * macfns.c (Fx_file_dialog): Save As dialog includes only the
10 file name in the text box.
11
122005-01-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13
14 * macfns.c (x_set_foreground_color, x_set_background_color): Sync
15 with xfns.c.
16 (mac_window, x_create_tip_frame): Use XSetWindowBackground.
17 * macterm.c (XSetBackground, XSetWindowBackground): New functions.
18 * macterm.h (XSetBackground, XSetWindowBackground): Add externs.
19
202005-01-14 Kim F. Storm <storm@cua.dk>
21
22 * keyboard.c (Fposn_at_x_y): Add optional arg WHOLE.
23
242005-01-13 Richard M. Stallman <rms@gnu.org>
25
26 * keymap.c (Fcurrent_active_maps): Ignore Voverriding_local_map
27 if Voverriding_terminal_local_map is non-nil.
28
29 * keyboard.c (syms_of_keyboard): Doc fix.
30
312005-01-13 Kim F. Storm <storm@cua.dk>
32
33 * xdisp.c (Fformat_mode_line): Fix last change. Remove NO_PROPS arg
34 (specify 0 for FACE instead). Reorder arg list. Doc fix.
35
362005-01-12 Richard M. Stallman <rms@gnu.org>
37
38 * xdisp.c (Fformat_mode_line): New arg FACE specifies a default
39 face property for characters that don't specify one.
40
41 * fns.c (Frequire): Record in load-history unconditionally.
42
432005-01-10 Kim F. Storm <storm@cua.dk>
44
45 * dispextern.h (merge_faces): Rename from merge_into_realized_face.
46
47 * xfaces.c (merge_faces): Rename from merge_into_realized_face.
48 Callers changed.
49 Add support to merge with lisp face id too (if face_name is t).
50
51 * xdisp.c (get_next_display_element, next_element_from_display_vector):
52 Don't lookup lface_id from display table glyphs here; instead use
53 merge_faces to merge the lisp face id into current face.
54
552005-01-09 Kim F. Storm <storm@cua.dk>
56
57 * dispextern.h (struct it): New member dpvec_face_id.
58 (merge_into_realized_face): Add prototype.
59
60 * xfaces.c (merge_into_realized_face): New function. Used to
61 merge escape-glyph face or face from display table into current face.
62
63 * xdisp.c (Vshow_nonbreak_escape): New lisp var.
64 (syms_of_xdisp): DEFVAR_LISP it.
65 (escape_glyph_face): Remove var.
66 (redisplay_window): Don't initialize it.
67 (setup_for_ellipsis, get_next_display_element):
68 Set it->dpvec_face_id to -1.
69 (get_next_display_element): Test Vshow_nonbreak_escape.
70 Do not setup escape_glyph_face.
71 Properly merge escape-glyph face or face from display table with
72 current face for escape and control characters. Set
73 it->dpvec_face_id to relevant face id instead of adding it to each
74 element of display vector.
75 (next_element_from_display_vector): If it->dpvec_face_id is set,
76 use that instead of lface_id from glyph itself.
77
782005-01-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
79
80 * xterm.h (struct x_output): New member, toolbar_detached.
81
82 * gtkutil.c (xg_create_frame_widgets): Set initial tool bar height to
83 38.
84 (xg_tool_bar_detach_callback): Set toolbar_detached to 1.
85 (xg_tool_bar_attach_callback): Set toolbar_detached to 0.
86 (xg_create_tool_bar): Initialize toolbar_detached.
87 (update_frame_tool_bar): Only set FRAME_TOOLBAR_HEIGHT (f) if
88 toolbar_detached is zero.
89
902005-01-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
91
92 * xmenu.c (create_and_show_popup_menu): Pass zero as button to
93 gtk_menu_popup if not for_click, so callbacks for the menu are called.
94
95 * gtkutil.c (xg_gtk_scroll_destroy, xg_create_scroll_bar)
96 (xg_tool_bar_callback, xg_tool_bar_help_callback)
97 (update_frame_tool_bar): Cast to EMACS_INT to avoid compiler
98 warning.
99
100 * xselect.c (x_get_foreign_selection, x_fill_property_data)
101 (Fx_get_atom_name, Fx_send_client_event): Replace XFLOAT with
102 XFLOAT_DATA to get extract number from Lisp object.
103
1042005-01-07 Kim F. Storm <storm@cua.dk>
105
106 * xdisp.c (set_iterator_to_next): Fix 2004-12-13 change.
107 Set stop_charpos to current charpos instead of 0.
108
1092005-01-06 Nick Roberts <nickrob@snap.net.nz>
110
111 * xdisp.c (Fformat_mode_line): First arg now required.
112
1132005-01-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
114
115 * macterm.c (XLoadQueryFont): Correctly handle 0 size
116 font widths that are returned from some Japanese fonts.
117
1182005-01-06 Kim F. Storm <storm@cua.dk>
119
120 * fringe.c (fringe_faces): Change to Lisp_Object pointer.
121 (draw_fringe_bitmap_1): Lookup user defined fringe faces here.
122 (destroy_fringe_bitmap): Set fringe_faces element to nil.
123 (Fdefine_fringe_bitmap, init_fringe): Change allocation of
124 fringe_faces array and init elements to nil.
125 (Fset_fringe_bitmap_face): Set fringe_faces to face name instead of
126 non-persistent face id.
127 (mark_fringe_data): New function for GC.
128
129 * alloc.c (mark_fringe_data): Declare extern.
130 (Fgarbage_collect): Call mark_fringe_data.
131
132 * alloc.c (overrun_check_free): Invalidate freed memory if
133 XMALLOC_CLEAR_FREE_MEMORY is defined.
134
1352005-01-05 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
136
137 * macfns.c: Include sys/param.h.
138 [TARGET_API_MAC_CARBON] (mac_nav_event_callback): New declaration
139 and function.
140 [TARGET_API_MAC_CARBON] (Fx_file_dialog): Use MAXPATHLEN for size
141 of filename string. Set event callback function when creating
142 dialog boxes. Add code conversions for filenames. Don't dispose
143 apple event descriptor record if failed to create it.
144
145 * macterm.c: Include sys/param.h.
146 [USE_CARBON_EVENTS] (mac_handle_window_event): Add handler for
147 kEventWindowUpdate.
148 (install_window_handler) [USE_CARBON_EVENTS]: Register it.
149 (do_ae_open_documents) [TARGET_API_MAC_CARBON]: Get FSRef instead
150 of FSSpec from apple event descriptor record.
151 (do_ae_open_documents) [TARGET_API_MAC_CARBON]: Use MAXPATHLEN for
152 size of filename string.
153 [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Likewise.
154 [TARGET_API_MAC_CARBON] (mac_do_receive_drag): Return error when a
155 file dialog is in action.
156 [TARGET_API_MAC_CARBON] (mac_do_track_drag): Likewise. Reject
157 only when there are no filename items. Set background color
158 before (un)highlighting the window below the dragged items.
159 (XTread_socket) [!USE_CARBON_EVENTS]: Don't call do_window_update.
160
1612005-01-05 Romain Francoise <romain@orebokech.com>
162
163 * term.c (encode_terminal_code): Fix buffer size computation.
164
1652005-01-04 Richard M. Stallman <rms@gnu.org>
166
167 * xdisp.c (Fformat_mode_line): Doc fix.
168
1692005-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
170
171 * alloc.c (refill_memory_reserve): Move.
172 (emacs_blocked_free, emacs_blocked_malloc, emacs_blocked_realloc)
173 (reset_malloc_hooks, uninterrupt_malloc) [SYNC_INPUT]: Don't define.
174
1752005-01-03 Richard M. Stallman <rms@gnu.org>
176
177 * window.c (window_scroll_pixel_based): Don't correct preserve_y
178 for CURRENT_HEADER_LINE_HEIGHT when moving backwards.
179
1802005-01-03 Jason Rumney <jasonr@gnu.org>
181
182 * w32bdf.c (w32_load_bdf_font): Set fontp->average_width and
183 fontp->space_width to FONT_WIDTH so they are valid.
184
185 * w32fns.c (w32_load_system_font): Set FONT_WIDTH to maximum, not
186 average width. Set fontp->average_width and fontp->space_width to
187 their appropriate values.
188
189 * w32term.c (x_new_font): Set FRAME_COLUMN_WIDTH to
190 fontp->average_width, not FONT_WIDTH. Set FRAME_SPACE_WIDTH to
191 fontp->space_width.
192
1932005-01-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
194
195 * macterm.c (x_new_font): Set FRAME_SPACE_WIDTH.
196 (x_font_min_bounds, XLoadQueryFont): Use the correct font width
197 metrics for max and min bounds.
198 (x_load_font): Correctly calculate average font width metrics.
199
2002005-01-02 Richard M. Stallman <rms@gnu.org>
201
202 * alloc.c (Fgarbage_collect): Don't truncate_undo_list on dead buffers.
203
12004-12-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 2042004-12-31 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2 205
3 * xterm.c (handle_one_xevent): Clear area in expose event for GTK. 206 * xterm.c (handle_one_xevent): Clear area in expose event for GTK.
@@ -48,7 +251,7 @@
48 251
49 * xterm.c (x_new_font): Set FRAME_COLUMN_WIDTH to 252 * xterm.c (x_new_font): Set FRAME_COLUMN_WIDTH to
50 fontp->average_width, not FONT_WIDTH. Set FRAME_SPACE_WIDTH to 253 fontp->average_width, not FONT_WIDTH. Set FRAME_SPACE_WIDTH to
51 fontp-?space_width.. 254 fontp->space_width.
52 (x_load_font): Calculate fontp->space_width and 255 (x_load_font): Calculate fontp->space_width and
53 fontp->average_width. 256 fontp->average_width.
54 (x_term_init): Initialize dpyinfo->Xatom_AVERAGE_WIDTH. 257 (x_term_init): Initialize dpyinfo->Xatom_AVERAGE_WIDTH.
@@ -298,6 +501,10 @@
298 * gtkutil.c (xg_initialize): Install bindings for C-g so that 501 * gtkutil.c (xg_initialize): Install bindings for C-g so that
299 dialogs and menus pop down. 502 dialogs and menus pop down.
300 503
5042004-12-27 Kenichi Handa <handa@m17n.org>
505
506 * coding.c (code_convert_region): Fix calculation of `ratio'.
507
3012004-12-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 5082004-12-25 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
302 509
303 * gtkutil.c (update_frame_tool_bar): Make the value of 510 * gtkutil.c (update_frame_tool_bar): Make the value of
diff --git a/src/alloc.c b/src/alloc.c
index 6c393e9213b..998f736b9c5 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -103,7 +103,7 @@ extern __malloc_size_t __malloc_extra_blocks;
103 that the backend handles concurrent access to malloc within its own threads 103 that the backend handles concurrent access to malloc within its own threads
104 but Emacs code running in the main thread is not included in that control). 104 but Emacs code running in the main thread is not included in that control).
105 105
106 When UNBLOCK_INPUT is called, revoke_input_signal may be called. If this 106 When UNBLOCK_INPUT is called, reinvoke_input_signal may be called. If this
107 happens in one of the backend threads we will have two threads that tries 107 happens in one of the backend threads we will have two threads that tries
108 to run Emacs code at once, and the code is not prepared for that. 108 to run Emacs code at once, and the code is not prepared for that.
109 To prevent that, we only call BLOCK/UNBLOCK from the main thread. */ 109 To prevent that, we only call BLOCK/UNBLOCK from the main thread. */
@@ -309,6 +309,7 @@ static void mark_glyph_matrix P_ ((struct glyph_matrix *));
309static void mark_face_cache P_ ((struct face_cache *)); 309static void mark_face_cache P_ ((struct face_cache *));
310 310
311#ifdef HAVE_WINDOW_SYSTEM 311#ifdef HAVE_WINDOW_SYSTEM
312extern void mark_fringe_data P_ ((void));
312static void mark_image P_ ((struct image *)); 313static void mark_image P_ ((struct image *));
313static void mark_image_cache P_ ((struct frame *)); 314static void mark_image_cache P_ ((struct frame *));
314#endif /* HAVE_WINDOW_SYSTEM */ 315#endif /* HAVE_WINDOW_SYSTEM */
@@ -704,9 +705,14 @@ overrun_check_free (block)
704 val + osize, 705 val + osize,
705 XMALLOC_OVERRUN_CHECK_SIZE)) 706 XMALLOC_OVERRUN_CHECK_SIZE))
706 abort (); 707 abort ();
708#ifdef XMALLOC_CLEAR_FREE_MEMORY
709 val -= XMALLOC_OVERRUN_CHECK_SIZE;
710 memset (val, 0xff, osize + XMALLOC_OVERRUN_CHECK_SIZE*2);
711#else
707 bzero (val + osize, XMALLOC_OVERRUN_CHECK_SIZE); 712 bzero (val + osize, XMALLOC_OVERRUN_CHECK_SIZE);
708 val -= XMALLOC_OVERRUN_CHECK_SIZE; 713 val -= XMALLOC_OVERRUN_CHECK_SIZE;
709 bzero (val, XMALLOC_OVERRUN_CHECK_SIZE); 714 bzero (val, XMALLOC_OVERRUN_CHECK_SIZE);
715#endif
710 } 716 }
711 717
712 free (val); 718 free (val);
@@ -1113,17 +1119,34 @@ allocate_buffer ()
1113} 1119}
1114 1120
1115 1121
1122#ifndef SYSTEM_MALLOC
1123
1124/* If we released our reserve (due to running out of memory),
1125 and we have a fair amount free once again,
1126 try to set aside another reserve in case we run out once more.
1127
1128 This is called when a relocatable block is freed in ralloc.c. */
1129
1130void
1131refill_memory_reserve ()
1132{
1133 if (spare_memory == 0)
1134 spare_memory = (char *) malloc ((size_t) SPARE_MEMORY);
1135}
1136
1137
1116/* Arranging to disable input signals while we're in malloc. 1138/* Arranging to disable input signals while we're in malloc.
1117 1139
1118 This only works with GNU malloc. To help out systems which can't 1140 This only works with GNU malloc. To help out systems which can't
1119 use GNU malloc, all the calls to malloc, realloc, and free 1141 use GNU malloc, all the calls to malloc, realloc, and free
1120 elsewhere in the code should be inside a BLOCK_INPUT/UNBLOCK_INPUT 1142 elsewhere in the code should be inside a BLOCK_INPUT/UNBLOCK_INPUT
1121 pairs; unfortunately, we have no idea what C library functions 1143 pair; unfortunately, we have no idea what C library functions
1122 might call malloc, so we can't really protect them unless you're 1144 might call malloc, so we can't really protect them unless you're
1123 using GNU malloc. Fortunately, most of the major operating systems 1145 using GNU malloc. Fortunately, most of the major operating systems
1124 can use GNU malloc. */ 1146 can use GNU malloc. */
1125 1147
1126#ifndef SYSTEM_MALLOC 1148#ifndef SYNC_INPUT
1149
1127#ifndef DOUG_LEA_MALLOC 1150#ifndef DOUG_LEA_MALLOC
1128extern void * (*__malloc_hook) P_ ((size_t)); 1151extern void * (*__malloc_hook) P_ ((size_t));
1129extern void * (*__realloc_hook) P_ ((void *, size_t)); 1152extern void * (*__realloc_hook) P_ ((void *, size_t));
@@ -1182,20 +1205,6 @@ emacs_blocked_free (ptr)
1182} 1205}
1183 1206
1184 1207
1185/* If we released our reserve (due to running out of memory),
1186 and we have a fair amount free once again,
1187 try to set aside another reserve in case we run out once more.
1188
1189 This is called when a relocatable block is freed in ralloc.c. */
1190
1191void
1192refill_memory_reserve ()
1193{
1194 if (spare_memory == 0)
1195 spare_memory = (char *) malloc ((size_t) SPARE_MEMORY);
1196}
1197
1198
1199/* This function is the malloc hook that Emacs uses. */ 1208/* This function is the malloc hook that Emacs uses. */
1200 1209
1201static void * 1210static void *
@@ -1347,6 +1356,7 @@ uninterrupt_malloc ()
1347 __realloc_hook = emacs_blocked_realloc; 1356 __realloc_hook = emacs_blocked_realloc;
1348} 1357}
1349 1358
1359#endif /* not SYNC_INPUT */
1350#endif /* not SYSTEM_MALLOC */ 1360#endif /* not SYSTEM_MALLOC */
1351 1361
1352 1362
@@ -4640,7 +4650,7 @@ returns nil, because real GC can't be done. */)
4640 turned off in that buffer. Calling truncate_undo_list on 4650 turned off in that buffer. Calling truncate_undo_list on
4641 Qt tends to return NULL, which effectively turns undo back on. 4651 Qt tends to return NULL, which effectively turns undo back on.
4642 So don't call truncate_undo_list if undo_list is Qt. */ 4652 So don't call truncate_undo_list if undo_list is Qt. */
4643 if (! EQ (nextb->undo_list, Qt)) 4653 if (! NILP (nextb->name) && ! EQ (nextb->undo_list, Qt))
4644 truncate_undo_list (nextb); 4654 truncate_undo_list (nextb);
4645 4655
4646 /* Shrink buffer gaps, but skip indirect and dead buffers. */ 4656 /* Shrink buffer gaps, but skip indirect and dead buffers. */
@@ -4752,6 +4762,10 @@ returns nil, because real GC can't be done. */)
4752 } 4762 }
4753 mark_backtrace (); 4763 mark_backtrace ();
4754 4764
4765#ifdef HAVE_WINDOW_SYSTEM
4766 mark_fringe_data ();
4767#endif
4768
4755#if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES 4769#if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
4756 mark_stack (); 4770 mark_stack ();
4757#endif 4771#endif
diff --git a/src/dispextern.h b/src/dispextern.h
index bc63455083b..8a24551260d 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1841,6 +1841,9 @@ struct it
1841 means that no such character is involved. */ 1841 means that no such character is involved. */
1842 int dpvec_char_len; 1842 int dpvec_char_len;
1843 1843
1844 /* Face id to use for all characters in display vector. -1 if unused. */
1845 int dpvec_face_id;
1846
1844 /* Face id of the iterator saved in case a glyph from dpvec contains 1847 /* Face id of the iterator saved in case a glyph from dpvec contains
1845 a face. The face is restored when all glyphs from dpvec have 1848 a face. The face is restored when all glyphs from dpvec have
1846 been delivered. */ 1849 been delivered. */
@@ -2755,6 +2758,7 @@ int face_at_buffer_position P_ ((struct window *, int, int, int, int *,
2755 int, int)); 2758 int, int));
2756int face_at_string_position P_ ((struct window *, Lisp_Object, int, int, int, 2759int face_at_string_position P_ ((struct window *, Lisp_Object, int, int, int,
2757 int, int *, enum face_id, int)); 2760 int, int *, enum face_id, int));
2761int merge_faces P_ ((struct frame *, Lisp_Object, int, int));
2758int compute_char_face P_ ((struct frame *, int, Lisp_Object)); 2762int compute_char_face P_ ((struct frame *, int, Lisp_Object));
2759void free_all_realized_faces P_ ((Lisp_Object)); 2763void free_all_realized_faces P_ ((Lisp_Object));
2760void free_realized_face P_ ((struct frame *, struct face *)); 2764void free_realized_face P_ ((struct frame *, struct face *));
diff --git a/src/fns.c b/src/fns.c
index 1d23318fcd7..542d0344fcb 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2906,6 +2906,10 @@ The normal messages at start and end of loading FILENAME are suppressed. */)
2906 2906
2907 CHECK_SYMBOL (feature); 2907 CHECK_SYMBOL (feature);
2908 2908
2909 /* Record the presence of `require' in this file
2910 even if the feature specified is already loaded. */
2911 LOADHIST_ATTACH (Fcons (Qrequire, feature));
2912
2909 tem = Fmemq (feature, Vfeatures); 2913 tem = Fmemq (feature, Vfeatures);
2910 2914
2911 if (NILP (tem)) 2915 if (NILP (tem))
@@ -2913,8 +2917,6 @@ The normal messages at start and end of loading FILENAME are suppressed. */)
2913 int count = SPECPDL_INDEX (); 2917 int count = SPECPDL_INDEX ();
2914 int nesting = 0; 2918 int nesting = 0;
2915 2919
2916 LOADHIST_ATTACH (Fcons (Qrequire, feature));
2917
2918 /* This is to make sure that loadup.el gives a clear picture 2920 /* This is to make sure that loadup.el gives a clear picture
2919 of what files are preloaded and when. */ 2921 of what files are preloaded and when. */
2920 if (! NILP (Vpurify_flag)) 2922 if (! NILP (Vpurify_flag))
diff --git a/src/fringe.c b/src/fringe.c
index 52273af13ef..0373a736038 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -446,7 +446,7 @@ struct fringe_bitmap standard_bitmaps[MAX_STANDARD_FRINGE_BITMAPS] =
446}; 446};
447 447
448static struct fringe_bitmap **fringe_bitmaps; 448static struct fringe_bitmap **fringe_bitmaps;
449static unsigned *fringe_faces; 449static Lisp_Object *fringe_faces;
450static int max_fringe_bitmaps; 450static int max_fringe_bitmaps;
451 451
452static int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS; 452static int max_used_fringe_bitmap = MAX_STANDARD_FRINGE_BITMAPS;
@@ -547,7 +547,13 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
547 } 547 }
548 548
549 if (face_id == DEFAULT_FACE_ID) 549 if (face_id == DEFAULT_FACE_ID)
550 face_id = fringe_faces[which]; 550 {
551 Lisp_Object face;
552
553 if ((face = fringe_faces[which], NILP (face))
554 || (face_id = lookup_named_face (f, face, 'A', 1), face_id < 0))
555 face_id = FRINGE_FACE_ID;
556 }
551 557
552 fb = fringe_bitmaps[which]; 558 fb = fringe_bitmaps[which];
553 if (fb == NULL) 559 if (fb == NULL)
@@ -574,7 +580,8 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
574 580
575 if (p.face == NULL) 581 if (p.face == NULL)
576 { 582 {
577 /* Why does this happen? ++kfs */ 583 /* This could happen after clearing face cache.
584 But it shouldn't happen anymore. ++kfs */
578 return; 585 return;
579 } 586 }
580 587
@@ -1073,7 +1080,7 @@ destroy_fringe_bitmap (n)
1073{ 1080{
1074 struct fringe_bitmap **fbp; 1081 struct fringe_bitmap **fbp;
1075 1082
1076 fringe_faces[n] = FRINGE_FACE_ID; 1083 fringe_faces[n] = Qnil;
1077 1084
1078 fbp = &fringe_bitmaps[n]; 1085 fbp = &fringe_bitmaps[n];
1079 if (*fbp && (*fbp)->dynamic) 1086 if (*fbp && (*fbp)->dynamic)
@@ -1294,12 +1301,12 @@ If BITMAP already exists, the existing definition is replaced. */)
1294 = ((struct fringe_bitmap **) 1301 = ((struct fringe_bitmap **)
1295 xrealloc (fringe_bitmaps, max_fringe_bitmaps * sizeof (struct fringe_bitmap *))); 1302 xrealloc (fringe_bitmaps, max_fringe_bitmaps * sizeof (struct fringe_bitmap *)));
1296 fringe_faces 1303 fringe_faces
1297 = (unsigned *) xrealloc (fringe_faces, max_fringe_bitmaps * sizeof (unsigned)); 1304 = (unsigned *) xrealloc (fringe_faces, max_fringe_bitmaps * sizeof (Lisp_Object));
1298 1305
1299 for (; i < max_fringe_bitmaps; i++) 1306 for (; i < max_fringe_bitmaps; i++)
1300 { 1307 {
1301 fringe_bitmaps[i] = NULL; 1308 fringe_bitmaps[i] = NULL;
1302 fringe_faces[i] = FRINGE_FACE_ID; 1309 fringe_faces[i] = Qnil;
1303 } 1310 }
1304 } 1311 }
1305 } 1312 }
@@ -1357,10 +1364,8 @@ If FACE is nil, reset face to default fringe face. */)
1357 if (face_id < 0) 1364 if (face_id < 0)
1358 error ("No such face"); 1365 error ("No such face");
1359 } 1366 }
1360 else
1361 face_id = FRINGE_FACE_ID;
1362 1367
1363 fringe_faces[n] = face_id; 1368 fringe_faces[n] = face;
1364 1369
1365 return Qnil; 1370 return Qnil;
1366} 1371}
@@ -1434,6 +1439,18 @@ You must (require 'fringe) to use fringe bitmap symbols in your programs." */);
1434 Vfringe_bitmaps = Qnil; 1439 Vfringe_bitmaps = Qnil;
1435} 1440}
1436 1441
1442/* Garbage collection hook */
1443
1444void
1445mark_fringe_data ()
1446{
1447 int i;
1448
1449 for (i = 0; i < max_fringe_bitmaps; i++)
1450 if (!NILP (fringe_faces[i]))
1451 mark_object (fringe_faces[i]);
1452}
1453
1437/* Initialize this module when Emacs starts. */ 1454/* Initialize this module when Emacs starts. */
1438 1455
1439void 1456void
@@ -1455,12 +1472,12 @@ init_fringe ()
1455 fringe_bitmaps 1472 fringe_bitmaps
1456 = (struct fringe_bitmap **) xmalloc (max_fringe_bitmaps * sizeof (struct fringe_bitmap *)); 1473 = (struct fringe_bitmap **) xmalloc (max_fringe_bitmaps * sizeof (struct fringe_bitmap *));
1457 fringe_faces 1474 fringe_faces
1458 = (unsigned *) xmalloc (max_fringe_bitmaps * sizeof (unsigned)); 1475 = (unsigned *) xmalloc (max_fringe_bitmaps * sizeof (Lisp_Object));
1459 1476
1460 for (i = 0; i < max_fringe_bitmaps; i++) 1477 for (i = 0; i < max_fringe_bitmaps; i++)
1461 { 1478 {
1462 fringe_bitmaps[i] = NULL; 1479 fringe_bitmaps[i] = NULL;
1463 fringe_faces[i] = FRINGE_FACE_ID; 1480 fringe_faces[i] = Qnil;
1464 } 1481 }
1465} 1482}
1466 1483
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 22919230a65..39d5e768dda 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -756,7 +756,7 @@ xg_create_frame_widgets (f)
756 So we cheat a bit by setting a height that is what it will have 756 So we cheat a bit by setting a height that is what it will have
757 later on when tool bar items are added. */ 757 later on when tool bar items are added. */
758 if (FRAME_EXTERNAL_TOOL_BAR (f) && f->n_tool_bar_items == 0) 758 if (FRAME_EXTERNAL_TOOL_BAR (f) && f->n_tool_bar_items == 0)
759 FRAME_TOOLBAR_HEIGHT (f) = 34; 759 FRAME_TOOLBAR_HEIGHT (f) = 38;
760 760
761 761
762 /* We don't want this widget double buffered, because we draw on it 762 /* We don't want this widget double buffered, because we draw on it
@@ -2850,7 +2850,7 @@ xg_gtk_scroll_destroy (widget, data)
2850 gpointer data; 2850 gpointer data;
2851{ 2851{
2852 gpointer p; 2852 gpointer p;
2853 int id = (int)data; 2853 int id = (int) (EMACS_INT) data; /* The EMACS_INT cast avoids a warning. */
2854 2854
2855 p = g_object_get_data (G_OBJECT (widget), XG_LAST_SB_DATA); 2855 p = g_object_get_data (G_OBJECT (widget), XG_LAST_SB_DATA);
2856 if (p) xfree (p); 2856 if (p) xfree (p);
@@ -2920,10 +2920,11 @@ xg_create_scroll_bar (f, bar, scroll_callback, scroll_bar_name)
2920 "value-changed", 2920 "value-changed",
2921 scroll_callback, 2921 scroll_callback,
2922 (gpointer) bar); 2922 (gpointer) bar);
2923 /* The EMACS_INT cast avoids a warning. */
2923 g_signal_connect (G_OBJECT (wscroll), 2924 g_signal_connect (G_OBJECT (wscroll),
2924 "destroy", 2925 "destroy",
2925 G_CALLBACK (xg_gtk_scroll_destroy), 2926 G_CALLBACK (xg_gtk_scroll_destroy),
2926 (gpointer) scroll_id); 2927 (gpointer) (EMACS_INT) scroll_id);
2927 2928
2928 /* Connect to button press and button release to detect if any scroll bar 2929 /* Connect to button press and button release to detect if any scroll bar
2929 has the pointer. */ 2930 has the pointer. */
@@ -3112,7 +3113,8 @@ xg_tool_bar_callback (w, client_data)
3112 GtkWidget *w; 3113 GtkWidget *w;
3113 gpointer client_data; 3114 gpointer client_data;
3114{ 3115{
3115 int idx = (int)client_data; 3116 /* The EMACS_INT cast avoids a warning. */
3117 int idx = (int) (EMACS_INT) client_data;
3116 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); 3118 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA);
3117 Lisp_Object key, frame; 3119 Lisp_Object key, frame;
3118 struct input_event event; 3120 struct input_event event;
@@ -3154,6 +3156,8 @@ xg_tool_bar_detach_callback (wbox, w, client_data)
3154 3156
3155 if (f) 3157 if (f)
3156 { 3158 {
3159 FRAME_X_OUTPUT (f)->toolbar_detached = 1;
3160
3157 /* When detaching a tool bar, not everything dissapear. There are 3161 /* When detaching a tool bar, not everything dissapear. There are
3158 a few pixels left that are used to drop the tool bar back into 3162 a few pixels left that are used to drop the tool bar back into
3159 place. */ 3163 place. */
@@ -3185,11 +3189,13 @@ xg_tool_bar_attach_callback (wbox, w, client_data)
3185 { 3189 {
3186 GtkRequisition req; 3190 GtkRequisition req;
3187 3191
3192 FRAME_X_OUTPUT (f)->toolbar_detached = 0;
3193
3188 gtk_widget_size_request (w, &req); 3194 gtk_widget_size_request (w, &req);
3189 FRAME_TOOLBAR_HEIGHT (f) = req.height; 3195 FRAME_TOOLBAR_HEIGHT (f) = req.height;
3190 3196
3191 /* The height has changed, resize outer widget and set columns 3197 /* The height has changed, resize outer widget and set columns
3192 rows to what we had before detaching the tool bar. */ 3198 rows to what we had before attaching the tool bar. */
3193 xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f)); 3199 xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
3194 } 3200 }
3195} 3201}
@@ -3209,7 +3215,8 @@ xg_tool_bar_help_callback (w, event, client_data)
3209 GdkEventCrossing *event; 3215 GdkEventCrossing *event;
3210 gpointer client_data; 3216 gpointer client_data;
3211{ 3217{
3212 int idx = (int)client_data; 3218 /* The EMACS_INT cast avoids a warning. */
3219 int idx = (int) (EMACS_INT) client_data;
3213 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); 3220 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA);
3214 Lisp_Object help, frame; 3221 Lisp_Object help, frame;
3215 3222
@@ -3302,6 +3309,8 @@ xg_create_tool_bar (f)
3302 3309
3303 x->toolbar_widget = gtk_toolbar_new (); 3310 x->toolbar_widget = gtk_toolbar_new ();
3304 x->handlebox_widget = gtk_handle_box_new (); 3311 x->handlebox_widget = gtk_handle_box_new ();
3312 x->toolbar_detached = 0;
3313
3305 gtk_container_add (GTK_CONTAINER (x->handlebox_widget), 3314 gtk_container_add (GTK_CONTAINER (x->handlebox_widget),
3306 x->toolbar_widget); 3315 x->toolbar_widget);
3307 3316
@@ -3452,11 +3461,12 @@ update_frame_tool_bar (f)
3452 3461
3453 gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin); 3462 gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin);
3454 3463
3464 /* The EMACS_INT cast avoids a warning. */
3455 gtk_toolbar_append_item (GTK_TOOLBAR (x->toolbar_widget), 3465 gtk_toolbar_append_item (GTK_TOOLBAR (x->toolbar_widget),
3456 0, 0, 0, 3466 0, 0, 0,
3457 w, 3467 w,
3458 GTK_SIGNAL_FUNC (xg_tool_bar_callback), 3468 GTK_SIGNAL_FUNC (xg_tool_bar_callback),
3459 (gpointer)i); 3469 (gpointer) (EMACS_INT) i);
3460 3470
3461 /* Save the image so we can see if an update is needed when 3471 /* Save the image so we can see if an update is needed when
3462 this function is called again. */ 3472 this function is called again. */
@@ -3486,14 +3496,15 @@ update_frame_tool_bar (f)
3486 rather than the GtkButton specific signals "enter" and 3496 rather than the GtkButton specific signals "enter" and
3487 "leave", so we can have only one callback. The event 3497 "leave", so we can have only one callback. The event
3488 will tell us what kind of event it is. */ 3498 will tell us what kind of event it is. */
3499 /* The EMACS_INT cast avoids a warning. */
3489 g_signal_connect (G_OBJECT (w), 3500 g_signal_connect (G_OBJECT (w),
3490 "enter-notify-event", 3501 "enter-notify-event",
3491 G_CALLBACK (xg_tool_bar_help_callback), 3502 G_CALLBACK (xg_tool_bar_help_callback),
3492 (gpointer)i); 3503 (gpointer) (EMACS_INT) i);
3493 g_signal_connect (G_OBJECT (w), 3504 g_signal_connect (G_OBJECT (w),
3494 "leave-notify-event", 3505 "leave-notify-event",
3495 G_CALLBACK (xg_tool_bar_help_callback), 3506 G_CALLBACK (xg_tool_bar_help_callback),
3496 (gpointer)i); 3507 (gpointer) (EMACS_INT) i);
3497 } 3508 }
3498 } 3509 }
3499 else 3510 else
@@ -3532,7 +3543,8 @@ update_frame_tool_bar (f)
3532 } 3543 }
3533 3544
3534 gtk_widget_size_request (x->toolbar_widget, &new_req); 3545 gtk_widget_size_request (x->toolbar_widget, &new_req);
3535 if (old_req.height != new_req.height) 3546 if (old_req.height != new_req.height
3547 && ! FRAME_X_OUTPUT (f)->toolbar_detached)
3536 { 3548 {
3537 FRAME_TOOLBAR_HEIGHT (f) = new_req.height; 3549 FRAME_TOOLBAR_HEIGHT (f) = new_req.height;
3538 xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f)); 3550 xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
diff --git a/src/keyboard.c b/src/keyboard.c
index 29e65d3acda..7efea38121e 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -6845,7 +6845,7 @@ input_available_signal (signo)
6845#else 6845#else
6846 SIGNAL_THREAD_CHECK (signo); 6846 SIGNAL_THREAD_CHECK (signo);
6847#endif 6847#endif
6848 6848
6849 if (input_available_clear_time) 6849 if (input_available_clear_time)
6850 EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); 6850 EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0);
6851 6851
@@ -10516,17 +10516,19 @@ The elements of this list correspond to the arguments of
10516 return Flist (sizeof (val) / sizeof (val[0]), val); 10516 return Flist (sizeof (val) / sizeof (val[0]), val);
10517} 10517}
10518 10518
10519DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 3, 0, 10519DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 4, 0,
10520 doc: /* Return position information for pixel coordinates X and Y. 10520 doc: /* Return position information for pixel coordinates X and Y.
10521By default, X and Y are relative to text area of the selected window. 10521By default, X and Y are relative to text area of the selected window.
10522Optional third arg FRAME_OR_WINDOW non-nil specifies frame or window. 10522Optional third arg FRAME_OR_WINDOW non-nil specifies frame or window.
10523If optional fourth arg WHOLE is non-nil, X is relative to the left
10524edge of the window.
10523 10525
10524The return value is similar to a mouse click position: 10526The return value is similar to a mouse click position:
10525 (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW) 10527 (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW)
10526 IMAGE (DX . DY) (WIDTH . HEIGHT)) 10528 IMAGE (DX . DY) (WIDTH . HEIGHT))
10527The `posn-' functions access elements of such lists. */) 10529The `posn-' functions access elements of such lists. */)
10528 (x, y, frame_or_window) 10530 (x, y, frame_or_window, whole)
10529 Lisp_Object x, y, frame_or_window; 10531 Lisp_Object x, y, frame_or_window, whole;
10530{ 10532{
10531 if (NILP (frame_or_window)) 10533 if (NILP (frame_or_window))
10532 frame_or_window = selected_window; 10534 frame_or_window = selected_window;
@@ -10539,7 +10541,10 @@ The `posn-' functions access elements of such lists. */)
10539 10541
10540 w = XWINDOW (frame_or_window); 10542 w = XWINDOW (frame_or_window);
10541 XSETINT (x, (WINDOW_TO_FRAME_PIXEL_X (w, XINT (x)) 10543 XSETINT (x, (WINDOW_TO_FRAME_PIXEL_X (w, XINT (x))
10542 + window_box_left_offset (w, TEXT_AREA))); 10544 + (NILP (whole)
10545 ? window_box_left_offset (w, TEXT_AREA)
10546 : - (WINDOW_LEFT_SCROLL_BAR_COLS (w)
10547 * WINDOW_FRAME_COLUMN_WIDTH (w)))));
10543 XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y))); 10548 XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y)));
10544 frame_or_window = w->frame; 10549 frame_or_window = w->frame;
10545 } 10550 }
@@ -10567,7 +10572,7 @@ The `posn-' functions access elements of such lists. */)
10567 10572
10568 tem = Fpos_visible_in_window_p (pos, window, Qt); 10573 tem = Fpos_visible_in_window_p (pos, window, Qt);
10569 if (!NILP (tem)) 10574 if (!NILP (tem))
10570 tem = Fposn_at_x_y (XCAR (tem), XCAR (XCDR (tem)), window); 10575 tem = Fposn_at_x_y (XCAR (tem), XCAR (XCDR (tem)), window, Qnil);
10571 return tem; 10576 return tem;
10572} 10577}
10573 10578
@@ -11267,14 +11272,15 @@ The elements of the list are event types that may have menu bar bindings. */);
11267 doc: /* Per-terminal keymap that overrides all other local keymaps. 11272 doc: /* Per-terminal keymap that overrides all other local keymaps.
11268If this variable is non-nil, it is used as a keymap instead of the 11273If this variable is non-nil, it is used as a keymap instead of the
11269buffer's local map, and the minor mode keymaps and text property keymaps. 11274buffer's local map, and the minor mode keymaps and text property keymaps.
11270It also overrides `overriding-local-map'. 11275It also replaces `overriding-local-map'.
11276
11271This variable is intended to let commands such as `universal-argument' 11277This variable is intended to let commands such as `universal-argument'
11272set up a different keymap for reading the next command. */); 11278set up a different keymap for reading the next command. */);
11273 11279
11274 DEFVAR_LISP ("overriding-local-map", &Voverriding_local_map, 11280 DEFVAR_LISP ("overriding-local-map", &Voverriding_local_map,
11275 doc: /* Keymap that overrides all other local keymaps. 11281 doc: /* Keymap that overrides all other local keymaps.
11276If this variable is non-nil, it is used as a keymap instead of the 11282If this variable is non-nil, it is used as a keymap--replacing the
11277buffer's local map, and the minor mode keymaps and text property keymaps. */); 11283buffer's local map, the minor mode keymaps, and char property keymaps. */);
11278 Voverriding_local_map = Qnil; 11284 Voverriding_local_map = Qnil;
11279 11285
11280 DEFVAR_LISP ("overriding-local-map-menu-flag", &Voverriding_local_map_menu_flag, 11286 DEFVAR_LISP ("overriding-local-map-menu-flag", &Voverriding_local_map_menu_flag,
diff --git a/src/keymap.c b/src/keymap.c
index 5a7c8b19123..ea0b1843b85 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1519,10 +1519,13 @@ OLP if non-nil indicates that we should obey `overriding-local-map' and
1519 1519
1520 if (!NILP (olp)) 1520 if (!NILP (olp))
1521 { 1521 {
1522 if (!NILP (Voverriding_local_map))
1523 keymaps = Fcons (Voverriding_local_map, keymaps);
1524 if (!NILP (current_kboard->Voverriding_terminal_local_map)) 1522 if (!NILP (current_kboard->Voverriding_terminal_local_map))
1525 keymaps = Fcons (current_kboard->Voverriding_terminal_local_map, keymaps); 1523 keymaps = Fcons (current_kboard->Voverriding_terminal_local_map, keymaps);
1524 /* The doc said that overriding-terminal-local-map should
1525 override overriding-local-map. The code used them both,
1526 but it seems clearer to use just one. rms, jan 2005. */
1527 else if (!NILP (Voverriding_local_map))
1528 keymaps = Fcons (Voverriding_local_map, keymaps);
1526 } 1529 }
1527 if (NILP (XCDR (keymaps))) 1530 if (NILP (XCDR (keymaps)))
1528 { 1531 {
@@ -1530,16 +1533,20 @@ OLP if non-nil indicates that we should obey `overriding-local-map' and
1530 Lisp_Object *maps; 1533 Lisp_Object *maps;
1531 int nmaps, i; 1534 int nmaps, i;
1532 1535
1536 /* This usually returns the buffer's local map,
1537 but that can be overridden by a `local-map' property. */
1533 local = get_local_map (PT, current_buffer, Qlocal_map); 1538 local = get_local_map (PT, current_buffer, Qlocal_map);
1534 if (!NILP (local)) 1539 if (!NILP (local))
1535 keymaps = Fcons (local, keymaps); 1540 keymaps = Fcons (local, keymaps);
1536 1541
1542 /* Now put all the minor mode keymaps on the list. */
1537 nmaps = current_minor_maps (0, &maps); 1543 nmaps = current_minor_maps (0, &maps);
1538 1544
1539 for (i = --nmaps; i >= 0; i--) 1545 for (i = --nmaps; i >= 0; i--)
1540 if (!NILP (maps[i])) 1546 if (!NILP (maps[i]))
1541 keymaps = Fcons (maps[i], keymaps); 1547 keymaps = Fcons (maps[i], keymaps);
1542 1548
1549 /* This returns nil unless there is a `keymap' property. */
1543 local = get_local_map (PT, current_buffer, Qkeymap); 1550 local = get_local_map (PT, current_buffer, Qkeymap);
1544 if (!NILP (local)) 1551 if (!NILP (local))
1545 keymaps = Fcons (local, keymaps); 1552 keymaps = Fcons (local, keymaps);
diff --git a/src/macfns.c b/src/macfns.c
index f40e8354f35..33da9091575 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -55,6 +55,7 @@ static unsigned char gray_bits[] = {
55#include <ctype.h> 55#include <ctype.h>
56#include <sys/types.h> 56#include <sys/types.h>
57#include <sys/stat.h> 57#include <sys/stat.h>
58#include <sys/param.h>
58 59
59#include <stdlib.h> 60#include <stdlib.h>
60#include <string.h> 61#include <string.h>
@@ -1384,6 +1385,7 @@ x_set_foreground_color (f, arg, oldval)
1384 struct frame *f; 1385 struct frame *f;
1385 Lisp_Object arg, oldval; 1386 Lisp_Object arg, oldval;
1386{ 1387{
1388 struct mac_output *mac = f->output_data.mac;
1387 unsigned long fg, old_fg; 1389 unsigned long fg, old_fg;
1388 1390
1389 fg = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); 1391 fg = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
@@ -1392,10 +1394,28 @@ x_set_foreground_color (f, arg, oldval)
1392 1394
1393 if (FRAME_MAC_WINDOW (f) != 0) 1395 if (FRAME_MAC_WINDOW (f) != 0)
1394 { 1396 {
1397 Display *dpy = FRAME_MAC_DISPLAY (f);
1398
1399 BLOCK_INPUT;
1400 XSetForeground (dpy, mac->normal_gc, fg);
1401 XSetBackground (dpy, mac->reverse_gc, fg);
1402
1403 if (mac->cursor_pixel == old_fg)
1404 {
1405 unload_color (f, mac->cursor_pixel);
1406 mac->cursor_pixel = fg;
1407 XSetBackground (dpy, mac->cursor_gc, mac->cursor_pixel);
1408 }
1409
1410 UNBLOCK_INPUT;
1411
1395 update_face_from_frame_parameter (f, Qforeground_color, arg); 1412 update_face_from_frame_parameter (f, Qforeground_color, arg);
1413
1396 if (FRAME_VISIBLE_P (f)) 1414 if (FRAME_VISIBLE_P (f))
1397 redraw_frame (f); 1415 redraw_frame (f);
1398 } 1416 }
1417
1418 unload_color (f, old_fg);
1399} 1419}
1400 1420
1401void 1421void
@@ -1403,11 +1423,24 @@ x_set_background_color (f, arg, oldval)
1403 struct frame *f; 1423 struct frame *f;
1404 Lisp_Object arg, oldval; 1424 Lisp_Object arg, oldval;
1405{ 1425{
1406 FRAME_BACKGROUND_PIXEL (f) 1426 struct mac_output *mac = f->output_data.mac;
1407 = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f)); 1427 unsigned long bg;
1428
1429 bg = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f));
1430 unload_color (f, FRAME_BACKGROUND_PIXEL (f));
1431 FRAME_BACKGROUND_PIXEL (f) = bg;
1408 1432
1409 if (FRAME_MAC_WINDOW (f) != 0) 1433 if (FRAME_MAC_WINDOW (f) != 0)
1410 { 1434 {
1435 Display *dpy = FRAME_MAC_DISPLAY (f);
1436
1437 BLOCK_INPUT;
1438 XSetBackground (dpy, mac->normal_gc, bg);
1439 XSetForeground (dpy, mac->reverse_gc, bg);
1440 XSetWindowBackground (dpy, FRAME_MAC_WINDOW (f), bg);
1441 XSetForeground (dpy, mac->cursor_gc, bg);
1442
1443 UNBLOCK_INPUT;
1411 update_face_from_frame_parameter (f, Qbackground_color, arg); 1444 update_face_from_frame_parameter (f, Qbackground_color, arg);
1412 1445
1413 if (FRAME_VISIBLE_P (f)) 1446 if (FRAME_VISIBLE_P (f))
@@ -2296,6 +2329,10 @@ mac_window (f)
2296 /* so that update events can find this mac_output struct */ 2329 /* so that update events can find this mac_output struct */
2297 f->output_data.mac->mFP = f; /* point back to emacs frame */ 2330 f->output_data.mac->mFP = f; /* point back to emacs frame */
2298 2331
2332 if (FRAME_MAC_WINDOW (f))
2333 XSetWindowBackground (FRAME_MAC_DISPLAY(f), FRAME_MAC_WINDOW (f),
2334 FRAME_BACKGROUND_PIXEL (f));
2335
2299 validate_x_resource_name (); 2336 validate_x_resource_name ();
2300 2337
2301 /* x_set_name normally ignores requests to set the name if the 2338 /* x_set_name normally ignores requests to set the name if the
@@ -3855,6 +3892,8 @@ x_create_tip_frame (dpyinfo, parms, text)
3855#endif 3892#endif
3856 { 3893 {
3857 FRAME_MAC_WINDOW (f) = tip_window; 3894 FRAME_MAC_WINDOW (f) = tip_window;
3895 XSetWindowBackground (FRAME_MAC_DISPLAY(f), tip_window,
3896 FRAME_BACKGROUND_PIXEL (f));
3858 SetWRefCon (tip_window, (long) f->output_data.mac); 3897 SetWRefCon (tip_window, (long) f->output_data.mac);
3859 /* so that update events can find this mac_output struct */ 3898 /* so that update events can find this mac_output struct */
3860 f->output_data.mac->mFP = f; 3899 f->output_data.mac->mFP = f;
@@ -4237,6 +4276,9 @@ Value is t if tooltip was open, nil otherwise. */)
4237 File selection dialog 4276 File selection dialog
4238 ***********************************************************************/ 4277 ***********************************************************************/
4239 4278
4279static pascal void mac_nav_event_callback P_ ((NavEventCallbackMessage,
4280 NavCBRecPtr, void *));
4281
4240/** 4282/**
4241 There is a relatively standard way to do this using applescript to run 4283 There is a relatively standard way to do this using applescript to run
4242 a (choose file) method. However, this doesn't do "the right thing" 4284 a (choose file) method. However, this doesn't do "the right thing"
@@ -4261,8 +4303,9 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
4261 Lisp_Object file = Qnil; 4303 Lisp_Object file = Qnil;
4262 int count = SPECPDL_INDEX (); 4304 int count = SPECPDL_INDEX ();
4263 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6; 4305 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
4264 char filename[1001]; 4306 char filename[MAXPATHLEN];
4265 int default_filter_index = 1; /* 1: All Files, 2: Directories only */ 4307 int default_filter_index = 1; /* 1: All Files, 2: Directories only */
4308 static NavEventUPP mac_nav_event_callbackUPP = NULL;
4266 4309
4267 GCPRO6 (prompt, dir, default_filename, mustmatch, file, only_dir_p); 4310 GCPRO6 (prompt, dir, default_filename, mustmatch, file, only_dir_p);
4268 CHECK_STRING (prompt); 4311 CHECK_STRING (prompt);
@@ -4290,16 +4333,20 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
4290 options.optionFlags |= kNavSelectAllReadableItem; 4333 options.optionFlags |= kNavSelectAllReadableItem;
4291 if (!NILP(prompt)) 4334 if (!NILP(prompt))
4292 { 4335 {
4293 message = cfstring_create_with_utf8_cstring (SDATA (prompt)); 4336 message =
4337 cfstring_create_with_utf8_cstring (SDATA (ENCODE_UTF_8 (prompt)));
4294 options.message = message; 4338 options.message = message;
4295 } 4339 }
4296 /* Don't set the application, let it use default. 4340 /* Don't set the application, let it use default.
4297 options.clientName = CFSTR ("Emacs"); 4341 options.clientName = CFSTR ("Emacs");
4298 */ 4342 */
4299 4343
4344 if (mac_nav_event_callbackUPP == NULL)
4345 mac_nav_event_callbackUPP = NewNavEventUPP (mac_nav_event_callback);
4346
4300 if (!NILP (only_dir_p)) 4347 if (!NILP (only_dir_p))
4301 status = NavCreateChooseFolderDialog(&options, NULL, NULL, NULL, 4348 status = NavCreateChooseFolderDialog(&options, mac_nav_event_callbackUPP,
4302 &dialogRef); 4349 NULL, NULL, &dialogRef);
4303 else if (NILP (mustmatch)) 4350 else if (NILP (mustmatch))
4304 { 4351 {
4305 /* This is a save dialog */ 4352 /* This is a save dialog */
@@ -4309,21 +4356,26 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
4309 4356
4310 if (!NILP(default_filename)) 4357 if (!NILP(default_filename))
4311 { 4358 {
4312 saveName = 4359 Lisp_Object utf8 = ENCODE_UTF_8 (default_filename);
4313 cfstring_create_with_utf8_cstring (SDATA (default_filename)); 4360 char *begPtr = SDATA(utf8);
4361 char *filePtr = begPtr + SBYTES(utf8);
4362 while (filePtr != begPtr && !IS_DIRECTORY_SEP(filePtr[-1]))
4363 filePtr--;
4364 saveName = cfstring_create_with_utf8_cstring (filePtr);
4314 options.saveFileName = saveName; 4365 options.saveFileName = saveName;
4315 options.optionFlags |= kNavSelectDefaultLocation; 4366 options.optionFlags |= kNavSelectDefaultLocation;
4316 } 4367 }
4317 status = NavCreatePutFileDialog(&options, 4368 status = NavCreatePutFileDialog(&options,
4318 'TEXT', kNavGenericSignature, 4369 'TEXT', kNavGenericSignature,
4319 NULL, NULL, &dialogRef); 4370 mac_nav_event_callbackUPP, NULL,
4371 &dialogRef);
4320 } 4372 }
4321 else 4373 else
4322 { 4374 {
4323 /* This is an open dialog*/ 4375 /* This is an open dialog*/
4324 status = NavCreateChooseFileDialog(&options, fileTypes, 4376 status = NavCreateChooseFileDialog(&options, fileTypes,
4325 NULL, NULL, NULL, NULL, 4377 mac_nav_event_callbackUPP, NULL,
4326 &dialogRef); 4378 NULL, NULL, &dialogRef);
4327 } 4379 }
4328 4380
4329 /* Set the default location and continue*/ 4381 /* Set the default location and continue*/
@@ -4331,13 +4383,13 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
4331 if (!NILP(dir)) { 4383 if (!NILP(dir)) {
4332 FSRef defLoc; 4384 FSRef defLoc;
4333 AEDesc defLocAed; 4385 AEDesc defLocAed;
4334 status = FSPathMakeRef(SDATA(dir), &defLoc, NULL); 4386 status = FSPathMakeRef(SDATA(ENCODE_FILE(dir)), &defLoc, NULL);
4335 if (status == noErr) 4387 if (status == noErr)
4336 { 4388 {
4337 AECreateDesc(typeFSRef, &defLoc, sizeof(FSRef), &defLocAed); 4389 AECreateDesc(typeFSRef, &defLoc, sizeof(FSRef), &defLocAed);
4338 NavCustomControl(dialogRef, kNavCtlSetLocation, (void*) &defLocAed); 4390 NavCustomControl(dialogRef, kNavCtlSetLocation, (void*) &defLocAed);
4391 AEDisposeDesc(&defLocAed);
4339 } 4392 }
4340 AEDisposeDesc(&defLocAed);
4341 } 4393 }
4342 4394
4343 status = NavDialogRun(dialogRef); 4395 status = NavDialogRun(dialogRef);
@@ -4363,7 +4415,7 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
4363 status = NavDialogGetReply(dialogRef, &reply); 4415 status = NavDialogGetReply(dialogRef, &reply);
4364 AECoerceDesc(&reply.selection, typeFSRef, &aed); 4416 AECoerceDesc(&reply.selection, typeFSRef, &aed);
4365 AEGetDescData(&aed, (void *) &fsRef, sizeof (FSRef)); 4417 AEGetDescData(&aed, (void *) &fsRef, sizeof (FSRef));
4366 FSRefMakePath(&fsRef, (UInt8 *) filename, 1000); 4418 FSRefMakePath(&fsRef, (UInt8 *) filename, sizeof (filename));
4367 AEDisposeDesc(&aed); 4419 AEDisposeDesc(&aed);
4368 if (reply.saveFileName) 4420 if (reply.saveFileName)
4369 { 4421 {
@@ -4372,9 +4424,11 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
4372 if (len && filename[len-1] != '/') 4424 if (len && filename[len-1] != '/')
4373 filename[len++] = '/'; 4425 filename[len++] = '/';
4374 CFStringGetCString(reply.saveFileName, filename+len, 4426 CFStringGetCString(reply.saveFileName, filename+len,
4375 1000-len, kCFStringEncodingUTF8); 4427 sizeof (filename) - len,
4428 kCFStringEncodingUTF8);
4376 } 4429 }
4377 file = DECODE_FILE(build_string (filename)); 4430 file = DECODE_FILE (make_unibyte_string (filename,
4431 strlen (filename)));
4378 NavDisposeReply(&reply); 4432 NavDisposeReply(&reply);
4379 } 4433 }
4380 break; 4434 break;
@@ -4400,6 +4454,15 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
4400} 4454}
4401 4455
4402 4456
4457/* Need to register some event callback function for enabling drag and
4458 drop in Navigation Service dialogs. */
4459static pascal void
4460mac_nav_event_callback (selector, parms, data)
4461 NavEventCallbackMessage selector;
4462 NavCBRecPtr parms;
4463 void *data ;
4464{
4465}
4403#endif 4466#endif
4404 4467
4405/*********************************************************************** 4468/***********************************************************************
diff --git a/src/macterm.c b/src/macterm.c
index 353a1734258..d35a210e4c6 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -69,6 +69,7 @@ Boston, MA 02111-1307, USA. */
69#include <errno.h> 69#include <errno.h>
70#include <setjmp.h> 70#include <setjmp.h>
71#include <sys/stat.h> 71#include <sys/stat.h>
72#include <sys/param.h>
72 73
73#include "keyboard.h" 74#include "keyboard.h"
74#include "frame.h" 75#include "frame.h"
@@ -102,6 +103,10 @@ Boston, MA 02111-1307, USA. */
102 103
103Lisp_Object Vx_toolkit_scroll_bars; 104Lisp_Object Vx_toolkit_scroll_bars;
104 105
106/* If Non-nil, the text will be rendered using Core Graphics text rendering which may anti-alias the text. */
107Lisp_Object Vmac_use_core_graphics;
108
109
105/* Non-zero means that a HELP_EVENT has been generated since Emacs 110/* Non-zero means that a HELP_EVENT has been generated since Emacs
106 start. */ 111 start. */
107 112
@@ -726,6 +731,13 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode,
726 int nchars, mode, bytes_per_char; 731 int nchars, mode, bytes_per_char;
727{ 732{
728 SetPortWindowPort (w); 733 SetPortWindowPort (w);
734#ifdef MAC_OSX
735 UInt32 textFlags, savedFlags;
736 if (!NILP(Vmac_use_core_graphics)) {
737 textFlags = kQDUseCGTextRendering;
738 savedFlags = SwapQDTextFlags(textFlags);
739 }
740#endif
729 741
730 mac_set_colors (gc); 742 mac_set_colors (gc);
731 743
@@ -736,6 +748,10 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode,
736 748
737 MoveTo (x, y); 749 MoveTo (x, y);
738 DrawText (buf, 0, nchars * bytes_per_char); 750 DrawText (buf, 0, nchars * bytes_per_char);
751#ifdef MAC_OSX
752 if (!NILP(Vmac_use_core_graphics))
753 SwapQDTextFlags(savedFlags);
754#endif
739} 755}
740 756
741 757
@@ -1092,6 +1108,62 @@ XSetForeground (display, gc, color)
1092} 1108}
1093 1109
1094 1110
1111/* Mac replacement for XSetBackground. */
1112
1113void
1114XSetBackground (display, gc, color)
1115 Display *display;
1116 GC gc;
1117 unsigned long color;
1118{
1119 gc->background = color;
1120}
1121
1122
1123/* Mac replacement for XSetWindowBackground. */
1124
1125void
1126XSetWindowBackground (display, w, color)
1127 Display *display;
1128 WindowPtr w;
1129 unsigned long color;
1130{
1131#if !TARGET_API_MAC_CARBON
1132 AuxWinHandle aw_handle;
1133 CTabHandle ctab_handle;
1134 ColorSpecPtr ct_table;
1135 short ct_size;
1136#endif
1137 RGBColor bg_color;
1138
1139 bg_color.red = RED16_FROM_ULONG (color);
1140 bg_color.green = GREEN16_FROM_ULONG (color);
1141 bg_color.blue = BLUE16_FROM_ULONG (color);
1142
1143#if TARGET_API_MAC_CARBON
1144 SetWindowContentColor (w, &bg_color);
1145#else
1146 if (GetAuxWin (w, &aw_handle))
1147 {
1148 ctab_handle = (*aw_handle)->awCTable;
1149 HandToHand ((Handle *) &ctab_handle);
1150 ct_table = (*ctab_handle)->ctTable;
1151 ct_size = (*ctab_handle)->ctSize;
1152 while (ct_size > -1)
1153 {
1154 if (ct_table->value == 0)
1155 {
1156 ct_table->rgb = bg_color;
1157 CTabChanged (ctab_handle);
1158 SetWinColor (w, (WCTabHandle) ctab_handle);
1159 }
1160 ct_size--;
1161 }
1162 }
1163#endif
1164}
1165
1166
1095/* Mac replacement for XSetFont. */ 1167/* Mac replacement for XSetFont. */
1096 1168
1097static void 1169static void
@@ -4963,7 +5035,8 @@ x_new_font (f, fontname)
4963 FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset; 5035 FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
4964 FRAME_FONTSET (f) = -1; 5036 FRAME_FONTSET (f) = -1;
4965 5037
4966 FRAME_COLUMN_WIDTH (f) = FONT_WIDTH (FRAME_FONT (f)); 5038 FRAME_COLUMN_WIDTH (f) = fontp->average_width;
5039 FRAME_SPACE_WIDTH (f) = fontp->space_width;
4967 FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (FRAME_FONT (f)); 5040 FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (FRAME_FONT (f));
4968 5041
4969 compute_fringe_widths (f, 1); 5042 compute_fringe_widths (f, 1);
@@ -6499,12 +6572,8 @@ x_font_min_bounds (font, w, h)
6499 MacFontStruct *font; 6572 MacFontStruct *font;
6500 int *w, *h; 6573 int *w, *h;
6501{ 6574{
6502 /*
6503 * TODO: Windows does not appear to offer min bound, only
6504 * average and maximum width, and maximum height.
6505 */
6506 *h = FONT_HEIGHT (font); 6575 *h = FONT_HEIGHT (font);
6507 *w = FONT_WIDTH (font); 6576 *w = font->min_bounds.width;
6508} 6577}
6509 6578
6510 6579
@@ -6732,17 +6801,28 @@ XLoadQueryFont (Display *dpy, char *fontname)
6732 font->per_char = (XCharStruct *) 6801 font->per_char = (XCharStruct *)
6733 xmalloc (sizeof (XCharStruct) * (0xff - 0x20 + 1)); 6802 xmalloc (sizeof (XCharStruct) * (0xff - 0x20 + 1));
6734 { 6803 {
6735 int c; 6804 int c, min_width, max_width;
6736 6805
6806 min_width = max_width = char_width;
6737 for (c = 0x20; c <= 0xff; c++) 6807 for (c = 0x20; c <= 0xff; c++)
6738 { 6808 {
6739 font->per_char[c - 0x20] = font->max_bounds; 6809 font->per_char[c - 0x20] = font->max_bounds;
6740 font->per_char[c - 0x20].width = 6810 char_width = CharWidth (c);
6741 font->per_char[c - 0x20].rbearing = CharWidth (c); 6811 font->per_char[c - 0x20].width = char_width;
6742 } 6812 font->per_char[c - 0x20].rbearing = char_width;
6813 /* Some Japanese fonts (in SJIS encoding) return 0 as the
6814 character width of 0x7f. */
6815 if (char_width > 0)
6816 {
6817 min_width = min (min_width, char_width);
6818 max_width = max (max_width, char_width);
6819 }
6820 }
6821 font->min_bounds.width = min_width;
6822 font->max_bounds.width = max_width;
6743 } 6823 }
6744 } 6824 }
6745 6825
6746 TextFont (old_fontnum); /* restore previous font number, size and face */ 6826 TextFont (old_fontnum); /* restore previous font number, size and face */
6747 TextSize (old_fontsize); 6827 TextSize (old_fontsize);
6748 TextFace (old_fontface); 6828 TextFace (old_fontface);
@@ -6847,6 +6927,35 @@ x_load_font (f, fontname, size)
6847 fontp->name = (char *) xmalloc (strlen (font->fontname) + 1); 6927 fontp->name = (char *) xmalloc (strlen (font->fontname) + 1);
6848 bcopy (font->fontname, fontp->name, strlen (font->fontname) + 1); 6928 bcopy (font->fontname, fontp->name, strlen (font->fontname) + 1);
6849 6929
6930 if (font->min_bounds.width == font->max_bounds.width)
6931 {
6932 /* Fixed width font. */
6933 fontp->average_width = fontp->space_width = font->min_bounds.width;
6934 }
6935 else
6936 {
6937 XChar2b char2b;
6938 XCharStruct *pcm;
6939
6940 char2b.byte1 = 0x00, char2b.byte2 = 0x20;
6941 pcm = mac_per_char_metric (font, &char2b, 0);
6942 if (pcm)
6943 fontp->space_width = pcm->width;
6944 else
6945 fontp->space_width = FONT_WIDTH (font);
6946
6947 if (pcm)
6948 {
6949 int width = pcm->width;
6950 for (char2b.byte2 = 33; char2b.byte2 <= 126; char2b.byte2++)
6951 if ((pcm = mac_per_char_metric (font, &char2b, 0)) != NULL)
6952 width += pcm->width;
6953 fontp->average_width = width / 95;
6954 }
6955 else
6956 fontp->average_width = FONT_WIDTH (font);
6957 }
6958
6850 fontp->full_name = fontp->name; 6959 fontp->full_name = fontp->name;
6851 6960
6852 fontp->size = font->max_bounds.width; 6961 fontp->size = font->max_bounds.width;
@@ -7861,6 +7970,14 @@ mac_handle_window_event (next_handler, event, data)
7861 7970
7862 switch (GetEventKind (event)) 7971 switch (GetEventKind (event))
7863 { 7972 {
7973 case kEventWindowUpdate:
7974 result = CallNextEventHandler (next_handler, event);
7975 if (result != eventNotHandledErr)
7976 return result;
7977
7978 do_window_update (wp);
7979 break;
7980
7864 case kEventWindowBoundsChanging: 7981 case kEventWindowBoundsChanging:
7865 result = CallNextEventHandler (next_handler, event); 7982 result = CallNextEventHandler (next_handler, event);
7866 if (result != eventNotHandledErr) 7983 if (result != eventNotHandledErr)
@@ -7918,7 +8035,8 @@ install_window_handler (window)
7918{ 8035{
7919 OSErr err = noErr; 8036 OSErr err = noErr;
7920#if USE_CARBON_EVENTS 8037#if USE_CARBON_EVENTS
7921 EventTypeSpec specs[] = {{kEventClassWindow, kEventWindowBoundsChanging}}; 8038 EventTypeSpec specs[] = {{kEventClassWindow, kEventWindowUpdate},
8039 {kEventClassWindow, kEventWindowBoundsChanging}};
7922 static EventHandlerUPP handle_window_event_UPP = NULL; 8040 static EventHandlerUPP handle_window_event_UPP = NULL;
7923 8041
7924 if (handle_window_event_UPP == NULL) 8042 if (handle_window_event_UPP == NULL)
@@ -8013,24 +8131,28 @@ do_ae_open_documents(AppleEvent *message, AppleEvent *reply, long refcon)
8013 int i; 8131 int i;
8014 8132
8015 /* AE file list is one based so just use that for indexing here. */ 8133 /* AE file list is one based so just use that for indexing here. */
8016 for (i = 1; (err == noErr) && (i <= num_files_to_open); i++) 8134 for (i = 1; i <= num_files_to_open; i++)
8017 { 8135 {
8018 FSSpec fs;
8019 Str255 path_name, unix_path_name;
8020#ifdef MAC_OSX 8136#ifdef MAC_OSX
8021 FSRef fref; 8137 FSRef fref;
8022#endif 8138 char unix_path_name[MAXPATHLEN];
8139
8140 err = AEGetNthPtr (&the_desc, i, typeFSRef, &keyword,
8141 &actual_type, &fref, sizeof (FSRef),
8142 &actual_size);
8143 if (err != noErr || actual_type != typeFSRef)
8144 continue;
8145
8146 if (FSRefMakePath (&fref, unix_path_name, sizeof (unix_path_name))
8147 == noErr)
8148#else
8149 FSSpec fs;
8150 Str255 path_name, unix_path_name;
8023 8151
8024 err = AEGetNthPtr(&the_desc, i, typeFSS, &keyword, &actual_type, 8152 err = AEGetNthPtr(&the_desc, i, typeFSS, &keyword, &actual_type,
8025 (Ptr) &fs, sizeof (fs), &actual_size); 8153 (Ptr) &fs, sizeof (fs), &actual_size);
8026 if (err != noErr) break; 8154 if (err != noErr) continue;
8027
8028#ifdef MAC_OSX
8029 err = FSpMakeFSRef (&fs, &fref);
8030 if (err != noErr) break;
8031 8155
8032 if (FSRefMakePath (&fref, unix_path_name, 255) == noErr)
8033#else
8034 if (path_from_vol_dir_name (path_name, 255, fs.vRefNum, fs.parID, 8156 if (path_from_vol_dir_name (path_name, 255, fs.vRefNum, fs.parID,
8035 fs.name) && 8157 fs.name) &&
8036 mac_to_posix_pathname (path_name, unix_path_name, 255)) 8158 mac_to_posix_pathname (path_name, unix_path_name, 255))
@@ -8066,18 +8188,21 @@ mac_do_track_drag (DragTrackingMessage message, WindowPtr window,
8066 FlavorFlags theFlags; 8188 FlavorFlags theFlags;
8067 OSErr result; 8189 OSErr result;
8068 8190
8191 if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
8192 return dragNotAcceptedErr;
8193
8069 switch (message) 8194 switch (message)
8070 { 8195 {
8071 case kDragTrackingEnterHandler: 8196 case kDragTrackingEnterHandler:
8072 CountDragItems (theDrag, &items); 8197 CountDragItems (theDrag, &items);
8073 can_accept = 1; 8198 can_accept = 0;
8074 for (index = 1; index <= items; index++) 8199 for (index = 1; index <= items; index++)
8075 { 8200 {
8076 GetDragItemReferenceNumber (theDrag, index, &theItem); 8201 GetDragItemReferenceNumber (theDrag, index, &theItem);
8077 result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags); 8202 result = GetFlavorFlags (theDrag, theItem, flavorTypeHFS, &theFlags);
8078 if (result != noErr) 8203 if (result == noErr)
8079 { 8204 {
8080 can_accept = 0; 8205 can_accept = 1;
8081 break; 8206 break;
8082 } 8207 }
8083 } 8208 }
@@ -8088,7 +8213,9 @@ mac_do_track_drag (DragTrackingMessage message, WindowPtr window,
8088 { 8213 {
8089 RgnHandle hilite_rgn = NewRgn (); 8214 RgnHandle hilite_rgn = NewRgn ();
8090 Rect r; 8215 Rect r;
8216 struct frame *f = mac_window_to_frame (window);
8091 8217
8218 mac_set_backcolor (FRAME_BACKGROUND_PIXEL (f));
8092 GetWindowPortBounds (window, &r); 8219 GetWindowPortBounds (window, &r);
8093 OffsetRect (&r, -r.left, -r.top); 8220 OffsetRect (&r, -r.left, -r.top);
8094 RectRgn (hilite_rgn, &r); 8221 RectRgn (hilite_rgn, &r);
@@ -8104,6 +8231,9 @@ mac_do_track_drag (DragTrackingMessage message, WindowPtr window,
8104 case kDragTrackingLeaveWindow: 8231 case kDragTrackingLeaveWindow:
8105 if (can_accept) 8232 if (can_accept)
8106 { 8233 {
8234 struct frame *f = mac_window_to_frame (window);
8235
8236 mac_set_backcolor (FRAME_BACKGROUND_PIXEL (f));
8107 HideDragHilite (theDrag); 8237 HideDragHilite (theDrag);
8108 SetThemeCursor (kThemeArrowCursor); 8238 SetThemeCursor (kThemeArrowCursor);
8109 } 8239 }
@@ -8127,9 +8257,11 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
8127 OSErr result; 8257 OSErr result;
8128 ItemReference theItem; 8258 ItemReference theItem;
8129 HFSFlavor data; 8259 HFSFlavor data;
8130 FSRef fref;
8131 Size size = sizeof (HFSFlavor); 8260 Size size = sizeof (HFSFlavor);
8132 8261
8262 if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
8263 return dragNotAcceptedErr;
8264
8133 drag_and_drop_file_list = Qnil; 8265 drag_and_drop_file_list = Qnil;
8134 GetDragMouse (theDrag, &mouse, 0L); 8266 GetDragMouse (theDrag, &mouse, 0L);
8135 CountDragItems (theDrag, &items); 8267 CountDragItems (theDrag, &items);
@@ -8141,11 +8273,11 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
8141 if (result == noErr) 8273 if (result == noErr)
8142 { 8274 {
8143#ifdef MAC_OSX 8275#ifdef MAC_OSX
8144 FSRef frref; 8276 FSRef fref;
8277 char unix_path_name[MAXPATHLEN];
8145#else 8278#else
8146 Str255 path_name; 8279 Str255 path_name, unix_path_name;
8147#endif 8280#endif
8148 Str255 unix_path_name;
8149 GetFlavorData (theDrag, theItem, flavorTypeHFS, &data, &size, 0L); 8281 GetFlavorData (theDrag, theItem, flavorTypeHFS, &data, &size, 0L);
8150#ifdef MAC_OSX 8282#ifdef MAC_OSX
8151 /* Use Carbon routines, otherwise it converts the file name 8283 /* Use Carbon routines, otherwise it converts the file name
@@ -8163,8 +8295,6 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon,
8163 strlen (unix_path_name)), 8295 strlen (unix_path_name)),
8164 drag_and_drop_file_list); 8296 drag_and_drop_file_list);
8165 } 8297 }
8166 else
8167 continue;
8168 } 8298 }
8169 /* If there are items in the list, construct an event and post it to 8299 /* If there are items in the list, construct an event and post it to
8170 the queue like an interrupt using kbd_buffer_store_event. */ 8300 the queue like an interrupt using kbd_buffer_store_event. */
@@ -8724,8 +8854,9 @@ XTread_socket (sd, expected, hold_quit)
8724 if (SendEventToEventTarget (eventRef, toolbox_dispatcher) 8854 if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
8725 != eventNotHandledErr) 8855 != eventNotHandledErr)
8726 break; 8856 break;
8727#endif 8857#else
8728 do_window_update ((WindowPtr) er.message); 8858 do_window_update ((WindowPtr) er.message);
8859#endif
8729 break; 8860 break;
8730 8861
8731 case osEvt: 8862 case osEvt:
@@ -9811,8 +9942,17 @@ Toolbox for processing before Emacs sees it. */);
9811 doc: /* If non-nil, the Mac \"Control\" key is passed on to the Mac 9942 doc: /* If non-nil, the Mac \"Control\" key is passed on to the Mac
9812Toolbox for processing before Emacs sees it. */); 9943Toolbox for processing before Emacs sees it. */);
9813 Vmac_pass_control_to_system = Qt; 9944 Vmac_pass_control_to_system = Qt;
9945
9946 DEFVAR_LISP ("mac-pass-control-to-system", &Vmac_pass_control_to_system,
9947 doc: /* If non-nil, the Mac \"Control\" key is passed on to the Mac
9948Toolbox for processing before Emacs sees it. */);
9949 Vmac_pass_control_to_system = Qt;
9814#endif 9950#endif
9815 9951
9952 DEFVAR_LISP ("mac-allow-anti-aliasing", &Vmac_use_core_graphics,
9953 doc: /* If non-nil, the text will be rendered using Core Graphics text rendering which may anti-alias the text. */);
9954 Vmac_use_core_graphics = Qnil;
9955
9816 DEFVAR_INT ("mac-keyboard-text-encoding", &mac_keyboard_text_encoding, 9956 DEFVAR_INT ("mac-keyboard-text-encoding", &mac_keyboard_text_encoding,
9817 doc: /* One of the Text Encoding Base constant values defined in the 9957 doc: /* One of the Text Encoding Base constant values defined in the
9818Basic Text Constants section of Inside Macintosh - Text Encoding 9958Basic Text Constants section of Inside Macintosh - Text Encoding
diff --git a/src/macterm.h b/src/macterm.h
index fd6b066af4c..f32b13000e6 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -602,6 +602,8 @@ extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowPtr, char *,
602 unsigned int)); 602 unsigned int));
603extern void XFreePixmap P_ ((Display *, Pixmap)); 603extern void XFreePixmap P_ ((Display *, Pixmap));
604extern void XSetForeground P_ ((Display *, GC, unsigned long)); 604extern void XSetForeground P_ ((Display *, GC, unsigned long));
605extern void XSetBackground P_ ((Display *, GC, unsigned long));
606extern void XSetWindowBackground P_ ((Display *, WindowPtr, unsigned long));
605extern void mac_draw_line_to_pixmap P_ ((Display *, Pixmap, GC, int, int, 607extern void mac_draw_line_to_pixmap P_ ((Display *, Pixmap, GC, int, int,
606 int, int)); 608 int, int));
607extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *)); 609extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *));
diff --git a/src/term.c b/src/term.c
index 6beac594ddf..d53ba74c781 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1,5 +1,5 @@
1/* Terminal control module for terminals described by TERMCAP 1/* Terminal control module for terminals described by TERMCAP
2 Copyright (C) 1985, 86, 87, 93, 94, 95, 98, 2000, 2001, 2002 2 Copyright (C) 1985, 86, 87, 93, 94, 95, 98, 2000, 2001, 2002, 2005
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -894,7 +894,7 @@ encode_terminal_code (src, src_len, coding)
894 if (! STRING_MULTIBYTE (string)) 894 if (! STRING_MULTIBYTE (string))
895 string = string_to_multibyte (string); 895 string = string_to_multibyte (string);
896 nbytes = buf - encode_terminal_src; 896 nbytes = buf - encode_terminal_src;
897 if (nbytes + SBYTES (string) < encode_terminal_src_size) 897 if (encode_terminal_src_size < nbytes + SBYTES (string))
898 { 898 {
899 encode_terminal_src_size = nbytes + SBYTES (string); 899 encode_terminal_src_size = nbytes + SBYTES (string);
900 encode_terminal_src = xrealloc (encode_terminal_src, 900 encode_terminal_src = xrealloc (encode_terminal_src,
diff --git a/src/w32bdf.c b/src/w32bdf.c
index a028d51d85a..5f073dc8478 100644
--- a/src/w32bdf.c
+++ b/src/w32bdf.c
@@ -774,7 +774,10 @@ struct font_info *w32_load_bdf_font (struct frame *f, char *fontname,
774 fontp->name = (char *) xmalloc (strlen (fontname) + 1); 774 fontp->name = (char *) xmalloc (strlen (fontname) + 1);
775 bcopy (fontname, fontp->name, strlen (fontname) + 1); 775 bcopy (fontname, fontp->name, strlen (fontname) + 1);
776 fontp->full_name = fontp->name; 776 fontp->full_name = fontp->name;
777 fontp->size = FONT_WIDTH (font); 777 /* FIXME: look at BDF spec to see if there are better ways of finding
778 average_width and space_width, hopefully that don't involve working out
779 the values for ourselves from the data. */
780 fontp->size = fontp->average_width = fontp->space_width = FONT_WIDTH (font);
778 fontp->height = FONT_HEIGHT (font); 781 fontp->height = FONT_HEIGHT (font);
779 782
780 /* The slot `encoding' specifies how to map a character 783 /* The slot `encoding' specifies how to map a character
diff --git a/src/w32fns.c b/src/w32fns.c
index df6228b09b1..e05c45c2a4e 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -65,6 +65,7 @@ extern double atof ();
65extern int w32_console_toggle_lock_key P_ ((int, Lisp_Object)); 65extern int w32_console_toggle_lock_key P_ ((int, Lisp_Object));
66extern void w32_menu_display_help P_ ((HWND, HMENU, UINT, UINT)); 66extern void w32_menu_display_help P_ ((HWND, HMENU, UINT, UINT));
67extern void w32_free_menu_strings P_ ((HWND)); 67extern void w32_free_menu_strings P_ ((HWND));
68extern XCharStruct *w32_per_char_metric P_ ((XFontStruct *, wchar_t *, int));
68 69
69extern int quit_char; 70extern int quit_char;
70 71
@@ -4545,7 +4546,7 @@ w32_load_system_font (f,fontname,size)
4545 /* Fill out details in lf according to the font that was 4546 /* Fill out details in lf according to the font that was
4546 actually loaded. */ 4547 actually loaded. */
4547 lf.lfHeight = font->tm.tmInternalLeading - font->tm.tmHeight; 4548 lf.lfHeight = font->tm.tmInternalLeading - font->tm.tmHeight;
4548 lf.lfWidth = font->tm.tmAveCharWidth; 4549 lf.lfWidth = font->tm.tmMaxCharWidth;
4549 lf.lfWeight = font->tm.tmWeight; 4550 lf.lfWeight = font->tm.tmWeight;
4550 lf.lfItalic = font->tm.tmItalic; 4551 lf.lfItalic = font->tm.tmItalic;
4551 lf.lfCharSet = font->tm.tmCharSet; 4552 lf.lfCharSet = font->tm.tmCharSet;
@@ -4593,6 +4594,25 @@ w32_load_system_font (f,fontname,size)
4593 fontp->name = (char *) xmalloc (strlen (fontname) + 1); 4594 fontp->name = (char *) xmalloc (strlen (fontname) + 1);
4594 bcopy (fontname, fontp->name, strlen (fontname) + 1); 4595 bcopy (fontname, fontp->name, strlen (fontname) + 1);
4595 4596
4597 if (lf.lfPitchAndFamily == FIXED_PITCH)
4598 {
4599 /* Fixed width font. */
4600 fontp->average_width = fontp->space_width = FONT_WIDTH (font);
4601 }
4602 else
4603 {
4604 wchar_t space = 32;
4605 XCharStruct* pcm;
4606 pcm = w32_per_char_metric (font, &space, ANSI_FONT);
4607 if (pcm)
4608 fontp->space_width = pcm->width;
4609 else
4610 fontp->space_width = FONT_WIDTH (font);
4611
4612 fontp->average_width = font->tm.tmAveCharWidth;
4613 }
4614
4615
4596 fontp->charset = -1; 4616 fontp->charset = -1;
4597 charset = xlfd_charset_of_font (fontname); 4617 charset = xlfd_charset_of_font (fontname);
4598 4618
diff --git a/src/w32term.c b/src/w32term.c
index 7208a8acf7e..9ed4eb3b64e 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -1,5 +1,5 @@
1/* Implementation of GUI terminal on the Microsoft W32 API. 1/* Implementation of GUI terminal on the Microsoft W32 API.
2 Copyright (C) 1989, 93, 94, 95, 96, 1997, 1998, 1999, 2000, 2001 2 Copyright (C) 1989, 93, 94, 95, 96, 1997, 1998, 1999, 2000, 2001, 2005
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -846,8 +846,7 @@ w32_reset_terminal_modes (void)
846 846
847/* Function prototypes of this page. */ 847/* Function prototypes of this page. */
848 848
849static XCharStruct *w32_per_char_metric P_ ((XFontStruct *, 849XCharStruct *w32_per_char_metric P_ ((XFontStruct *, wchar_t *, int));
850 wchar_t *, int));
851static int w32_encode_char P_ ((int, wchar_t *, struct font_info *, 850static int w32_encode_char P_ ((int, wchar_t *, struct font_info *,
852 struct charset *, int *)); 851 struct charset *, int *));
853 852
@@ -985,7 +984,7 @@ w32_native_per_char_metric (font, char2b, font_type, pcm)
985} 984}
986 985
987 986
988static XCharStruct * 987XCharStruct *
989w32_per_char_metric (font, char2b, font_type) 988w32_per_char_metric (font, char2b, font_type)
990 XFontStruct *font; 989 XFontStruct *font;
991 wchar_t *char2b; 990 wchar_t *char2b;
@@ -5446,7 +5445,8 @@ x_new_font (f, fontname)
5446 FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset; 5445 FRAME_BASELINE_OFFSET (f) = fontp->baseline_offset;
5447 FRAME_FONTSET (f) = -1; 5446 FRAME_FONTSET (f) = -1;
5448 5447
5449 FRAME_COLUMN_WIDTH (f) = FONT_WIDTH (FRAME_FONT (f)); 5448 FRAME_COLUMN_WIDTH (f) = fontp->average_width;
5449 FRAME_SPACE_WIDTH (f) = fontp->space_width;
5450 FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (FRAME_FONT (f)); 5450 FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (FRAME_FONT (f));
5451 5451
5452 compute_fringe_widths (f, 1); 5452 compute_fringe_widths (f, 1);
diff --git a/src/window.c b/src/window.c
index e0a8427668b..27aa8102290 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4688,7 +4688,8 @@ window_scroll_pixel_based (window, n, whole, noerror)
4688 ; 4688 ;
4689 else if (preserve_y >= 0) 4689 else if (preserve_y >= 0)
4690 { 4690 {
4691 /* If we have a header line, take account of it. */ 4691 /* If we have a header line, take account of it.
4692 This is necessary because we set it.current_y to 0, above. */
4692 if (WINDOW_WANTS_HEADER_LINE_P (w)) 4693 if (WINDOW_WANTS_HEADER_LINE_P (w))
4693 preserve_y -= CURRENT_HEADER_LINE_HEIGHT (w); 4694 preserve_y -= CURRENT_HEADER_LINE_HEIGHT (w);
4694 4695
@@ -4728,9 +4729,14 @@ window_scroll_pixel_based (window, n, whole, noerror)
4728 { 4729 {
4729 SET_TEXT_POS_FROM_MARKER (start, w->start); 4730 SET_TEXT_POS_FROM_MARKER (start, w->start);
4730 start_display (&it, w, start); 4731 start_display (&it, w, start);
4732#if 0 /* It's wrong to subtract this here
4733 because we called start_display again
4734 and did not alter it.current_y this time. */
4735
4731 /* If we have a header line, take account of it. */ 4736 /* If we have a header line, take account of it. */
4732 if (WINDOW_WANTS_HEADER_LINE_P (w)) 4737 if (WINDOW_WANTS_HEADER_LINE_P (w))
4733 preserve_y -= CURRENT_HEADER_LINE_HEIGHT (w); 4738 preserve_y -= CURRENT_HEADER_LINE_HEIGHT (w);
4739#endif
4734 4740
4735 move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y); 4741 move_it_to (&it, -1, -1, preserve_y, -1, MOVE_TO_Y);
4736 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); 4742 SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
diff --git a/src/xdisp.c b/src/xdisp.c
index 1ccdf147485..a8b8315e251 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1,6 +1,6 @@
1/* Display generation from window structure and buffer text. 1/* Display generation from window structure and buffer text.
2 Copyright (C) 1985,86,87,88,93,94,95,97,98,99,2000,01,02,03,04 2 Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1997, 1998, 1999,
3 Free Software Foundation, Inc. 3 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -319,6 +319,10 @@ extern Lisp_Object Qcursor;
319 319
320Lisp_Object Vshow_trailing_whitespace; 320Lisp_Object Vshow_trailing_whitespace;
321 321
322/* Non-nil means escape non-break space and hyphens. */
323
324Lisp_Object Vshow_nonbreak_escape;
325
322#ifdef HAVE_WINDOW_SYSTEM 326#ifdef HAVE_WINDOW_SYSTEM
323extern Lisp_Object Voverflow_newline_into_fringe; 327extern Lisp_Object Voverflow_newline_into_fringe;
324 328
@@ -346,7 +350,6 @@ Lisp_Object Qtrailing_whitespace;
346/* Name and number of the face used to highlight escape glyphs. */ 350/* Name and number of the face used to highlight escape glyphs. */
347 351
348Lisp_Object Qescape_glyph; 352Lisp_Object Qescape_glyph;
349int escape_glyph_face;
350 353
351/* The symbol `image' which is the car of the lists used to represent 354/* The symbol `image' which is the car of the lists used to represent
352 images in Lisp. */ 355 images in Lisp. */
@@ -3268,6 +3271,7 @@ setup_for_ellipsis (it, len)
3268 3271
3269 it->dpvec_char_len = len; 3272 it->dpvec_char_len = len;
3270 it->current.dpvec_index = 0; 3273 it->current.dpvec_index = 0;
3274 it->dpvec_face_id = -1;
3271 3275
3272 /* Remember the current face id in case glyphs specify faces. 3276 /* Remember the current face id in case glyphs specify faces.
3273 IT's face is restored in set_iterator_to_next. */ 3277 IT's face is restored in set_iterator_to_next. */
@@ -5007,6 +5011,7 @@ get_next_display_element (it)
5007 it->dpvec = v->contents; 5011 it->dpvec = v->contents;
5008 it->dpend = v->contents + v->size; 5012 it->dpend = v->contents + v->size;
5009 it->current.dpvec_index = 0; 5013 it->current.dpvec_index = 0;
5014 it->dpvec_face_id = -1;
5010 it->saved_face_id = it->face_id; 5015 it->saved_face_id = it->face_id;
5011 it->method = next_element_from_display_vector; 5016 it->method = next_element_from_display_vector;
5012 it->ellipsis_p = 0; 5017 it->ellipsis_p = 0;
@@ -5038,8 +5043,9 @@ get_next_display_element (it)
5038 || (it->c != '\n' && it->c != '\t')) 5043 || (it->c != '\n' && it->c != '\t'))
5039 : (it->multibyte_p 5044 : (it->multibyte_p
5040 ? (!CHAR_PRINTABLE_P (it->c) 5045 ? (!CHAR_PRINTABLE_P (it->c)
5041 || it->c == 0xA0 /* NO-BREAK SPACE */ 5046 || (!NILP (Vshow_nonbreak_escape)
5042 || it->c == 0xAD /* SOFT HYPHEN */) 5047 && (it->c == 0xA0 /* NO-BREAK SPACE */
5048 || it->c == 0xAD /* SOFT HYPHEN */)))
5043 : (it->c >= 127 5049 : (it->c >= 127
5044 && (! unibyte_display_via_language_environment 5050 && (! unibyte_display_via_language_environment
5045 || (UNIBYTE_CHAR_HAS_MULTIBYTE_P (it->c))))))) 5051 || (UNIBYTE_CHAR_HAS_MULTIBYTE_P (it->c)))))))
@@ -5051,21 +5057,8 @@ get_next_display_element (it)
5051 display. Then, set IT->dpvec to these glyphs. */ 5057 display. Then, set IT->dpvec to these glyphs. */
5052 GLYPH g; 5058 GLYPH g;
5053 int ctl_len; 5059 int ctl_len;
5054 int face_id = escape_glyph_face; 5060 int face_id, lface_id;
5055 5061 GLYPH escape_glyph;
5056 /* Find the face id if `escape-glyph' unless we recently did. */
5057 if (face_id < 0)
5058 {
5059 Lisp_Object tem = Fget (Qescape_glyph, Qface);
5060 if (INTEGERP (tem))
5061 face_id = XINT (tem);
5062 else
5063 face_id = 0;
5064 /* If there's overflow, use 0 instead. */
5065 if (FAST_GLYPH_FACE (FAST_MAKE_GLYPH (0, face_id)) != face_id)
5066 face_id = 0;
5067 escape_glyph_face = face_id;
5068 }
5069 5062
5070 if (it->c < 128 && it->ctl_arrow_p) 5063 if (it->c < 128 && it->ctl_arrow_p)
5071 { 5064 {
@@ -5073,62 +5066,83 @@ get_next_display_element (it)
5073 if (it->dp 5066 if (it->dp
5074 && INTEGERP (DISP_CTRL_GLYPH (it->dp)) 5067 && INTEGERP (DISP_CTRL_GLYPH (it->dp))
5075 && GLYPH_CHAR_VALID_P (XINT (DISP_CTRL_GLYPH (it->dp)))) 5068 && GLYPH_CHAR_VALID_P (XINT (DISP_CTRL_GLYPH (it->dp))))
5076 g = XINT (DISP_CTRL_GLYPH (it->dp)); 5069 {
5070 g = XINT (DISP_CTRL_GLYPH (it->dp));
5071 lface_id = FAST_GLYPH_FACE (g);
5072 if (lface_id)
5073 {
5074 g = FAST_GLYPH_CHAR (g);
5075 face_id = merge_faces (it->f, Qt, lface_id,
5076 it->face_id);
5077 }
5078 }
5077 else 5079 else
5078 g = FAST_MAKE_GLYPH ('^', face_id); 5080 {
5079 XSETINT (it->ctl_chars[0], g); 5081 /* Merge the escape-glyph face into the current face. */
5082 face_id = merge_faces (it->f, Qescape_glyph, 0,
5083 it->face_id);
5084 g = '^';
5085 }
5080 5086
5081 g = FAST_MAKE_GLYPH (it->c ^ 0100, face_id); 5087 XSETINT (it->ctl_chars[0], g);
5088 g = it->c ^ 0100;
5082 XSETINT (it->ctl_chars[1], g); 5089 XSETINT (it->ctl_chars[1], g);
5083 ctl_len = 2; 5090 ctl_len = 2;
5091 goto display_control;
5084 } 5092 }
5085 else if (it->c == 0xA0 || it->c == 0xAD) 5093
5094 if (it->dp
5095 && INTEGERP (DISP_ESCAPE_GLYPH (it->dp))
5096 && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp))))
5086 { 5097 {
5087 /* Set IT->ctl_chars[0] to the glyph for `\\'. */ 5098 escape_glyph = XFASTINT (DISP_ESCAPE_GLYPH (it->dp));
5088 if (it->dp 5099 lface_id = FAST_GLYPH_FACE (escape_glyph);
5089 && INTEGERP (DISP_ESCAPE_GLYPH (it->dp)) 5100 if (lface_id)
5090 && GLYPH_CHAR_VALID_P (XINT (DISP_ESCAPE_GLYPH (it->dp)))) 5101 {
5091 g = XINT (DISP_ESCAPE_GLYPH (it->dp)); 5102 escape_glyph = FAST_GLYPH_CHAR (escape_glyph);
5092 else 5103 face_id = merge_faces (it->f, Qt, lface_id,
5093 g = FAST_MAKE_GLYPH ('\\', face_id); 5104 it->face_id);
5094 XSETINT (it->ctl_chars[0], g); 5105 }
5106 }
5107 else
5108 {
5109 /* Merge the escape-glyph face into the current face. */
5110 face_id = merge_faces (it->f, Qescape_glyph, 0,
5111 it->face_id);
5112 escape_glyph = '\\';
5113 }
5095 5114
5096 g = FAST_MAKE_GLYPH (it->c == 0xAD ? '-' : ' ', face_id); 5115 if (it->c == 0xA0 || it->c == 0xAD)
5116 {
5117 XSETINT (it->ctl_chars[0], escape_glyph);
5118 g = it->c == 0xAD ? '-' : ' ';
5097 XSETINT (it->ctl_chars[1], g); 5119 XSETINT (it->ctl_chars[1], g);
5098 ctl_len = 2; 5120 ctl_len = 2;
5121 goto display_control;
5099 } 5122 }
5100 else
5101 {
5102 unsigned char str[MAX_MULTIBYTE_LENGTH];
5103 int len;
5104 int i;
5105 GLYPH escape_glyph;
5106 5123
5107 /* Set IT->ctl_chars[0] to the glyph for `\\'. */ 5124 {
5108 if (it->dp 5125 unsigned char str[MAX_MULTIBYTE_LENGTH];
5109 && INTEGERP (DISP_ESCAPE_GLYPH (it->dp)) 5126 int len;
5110 && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp)))) 5127 int i;
5111 escape_glyph = XFASTINT (DISP_ESCAPE_GLYPH (it->dp));
5112 else
5113 escape_glyph = FAST_MAKE_GLYPH ('\\', face_id);
5114 5128
5115 if (CHAR_BYTE8_P (it->c)) 5129 /* Set IT->ctl_chars[0] to the glyph for `\\'. */
5116 { 5130 if (CHAR_BYTE8_P (it->c))
5117 str[0] = CHAR_TO_BYTE8 (it->c); 5131 {
5118 len = 1; 5132 str[0] = CHAR_TO_BYTE8 (it->c);
5119 } 5133 len = 1;
5120 else if (it->c < 256) 5134 }
5121 { 5135 else if (it->c < 256)
5122 str[0] = it->c; 5136 {
5123 len = 1; 5137 str[0] = it->c;
5124 } 5138 len = 1;
5125 else 5139 }
5126 { 5140 else
5127 /* It's an invalid character, which 5141 {
5128 shouldn't happen actually, but due to 5142 /* It's an invalid character, which shouldn't
5129 bugs it may happen. Let's print the char 5143 happen actually, but due to bugs it may
5130 as is, there's not much meaningful we can 5144 happen. Let's print the char as is, there's
5131 do with it. */ 5145 not much meaningful we can do with it. */
5132 str[0] = it->c; 5146 str[0] = it->c;
5133 str[1] = it->c >> 8; 5147 str[1] = it->c >> 8;
5134 str[2] = it->c >> 16; 5148 str[2] = it->c >> 16;
@@ -5136,29 +5150,28 @@ get_next_display_element (it)
5136 len = 4; 5150 len = 4;
5137 } 5151 }
5138 5152
5139 for (i = 0; i < len; i++) 5153 for (i = 0; i < len; i++)
5140 { 5154 {
5141 XSETINT (it->ctl_chars[i * 4], escape_glyph); 5155 XSETINT (it->ctl_chars[i * 4], escape_glyph);
5142 /* Insert three more glyphs into IT->ctl_chars for 5156 /* Insert three more glyphs into IT->ctl_chars for
5143 the octal display of the character. */ 5157 the octal display of the character. */
5144 g = FAST_MAKE_GLYPH (((str[i] >> 6) & 7) + '0', 5158 g = ((str[i] >> 6) & 7) + '0';
5145 face_id); 5159 XSETINT (it->ctl_chars[i * 4 + 1], g);
5146 XSETINT (it->ctl_chars[i * 4 + 1], g); 5160 g = ((str[i] >> 3) & 7) + '0';
5147 g = FAST_MAKE_GLYPH (((str[i] >> 3) & 7) + '0', 5161 XSETINT (it->ctl_chars[i * 4 + 2], g);
5148 face_id); 5162 g = (str[i] & 7) + '0';
5149 XSETINT (it->ctl_chars[i * 4 + 2], g); 5163 XSETINT (it->ctl_chars[i * 4 + 3], g);
5150 g = FAST_MAKE_GLYPH ((str[i] & 7) + '0', 5164 }
5151 face_id); 5165 ctl_len = len * 4;
5152 XSETINT (it->ctl_chars[i * 4 + 3], g); 5166 }
5153 }
5154 ctl_len = len * 4;
5155 }
5156 5167
5168 display_control:
5157 /* Set up IT->dpvec and return first character from it. */ 5169 /* Set up IT->dpvec and return first character from it. */
5158 it->dpvec_char_len = it->len; 5170 it->dpvec_char_len = it->len;
5159 it->dpvec = it->ctl_chars; 5171 it->dpvec = it->ctl_chars;
5160 it->dpend = it->dpvec + ctl_len; 5172 it->dpend = it->dpvec + ctl_len;
5161 it->current.dpvec_index = 0; 5173 it->current.dpvec_index = 0;
5174 it->dpvec_face_id = face_id;
5162 it->saved_face_id = it->face_id; 5175 it->saved_face_id = it->face_id;
5163 it->method = next_element_from_display_vector; 5176 it->method = next_element_from_display_vector;
5164 it->ellipsis_p = 0; 5177 it->ellipsis_p = 0;
@@ -5288,9 +5301,6 @@ set_iterator_to_next (it, reseat_p)
5288 it->dpvec = NULL; 5301 it->dpvec = NULL;
5289 it->current.dpvec_index = -1; 5302 it->current.dpvec_index = -1;
5290 5303
5291 /* Recheck faces after display vector */
5292 it->stop_charpos = 0;
5293
5294 /* Skip over characters which were displayed via IT->dpvec. */ 5304 /* Skip over characters which were displayed via IT->dpvec. */
5295 if (it->dpvec_char_len < 0) 5305 if (it->dpvec_char_len < 0)
5296 reseat_at_next_visible_line_start (it, 1); 5306 reseat_at_next_visible_line_start (it, 1);
@@ -5299,6 +5309,9 @@ set_iterator_to_next (it, reseat_p)
5299 it->len = it->dpvec_char_len; 5309 it->len = it->dpvec_char_len;
5300 set_iterator_to_next (it, reseat_p); 5310 set_iterator_to_next (it, reseat_p);
5301 } 5311 }
5312
5313 /* Recheck faces after display vector */
5314 it->stop_charpos = IT_CHARPOS (*it);
5302 } 5315 }
5303 } 5316 }
5304 else if (it->method == next_element_from_string) 5317 else if (it->method == next_element_from_string)
@@ -5378,7 +5391,6 @@ next_element_from_display_vector (it)
5378 if (INTEGERP (*it->dpvec) 5391 if (INTEGERP (*it->dpvec)
5379 && GLYPH_CHAR_VALID_P (XFASTINT (*it->dpvec))) 5392 && GLYPH_CHAR_VALID_P (XFASTINT (*it->dpvec)))
5380 { 5393 {
5381 int lface_id;
5382 GLYPH g; 5394 GLYPH g;
5383 5395
5384 g = XFASTINT (it->dpvec[it->current.dpvec_index]); 5396 g = XFASTINT (it->dpvec[it->current.dpvec_index]);
@@ -5388,13 +5400,14 @@ next_element_from_display_vector (it)
5388 /* The entry may contain a face id to use. Such a face id is 5400 /* The entry may contain a face id to use. Such a face id is
5389 the id of a Lisp face, not a realized face. A face id of 5401 the id of a Lisp face, not a realized face. A face id of
5390 zero means no face is specified. */ 5402 zero means no face is specified. */
5391 lface_id = FAST_GLYPH_FACE (g); 5403 if (it->dpvec_face_id >= 0)
5392 if (lface_id) 5404 it->face_id = it->dpvec_face_id;
5405 else
5393 { 5406 {
5394 /* The function returns -1 if lface_id is invalid. */ 5407 int lface_id = FAST_GLYPH_FACE (g);
5395 int face_id = ascii_face_of_lisp_face (it->f, lface_id); 5408 if (lface_id > 0)
5396 if (face_id >= 0) 5409 it->face_id = merge_faces (it->f, Qt, lface_id,
5397 it->face_id = face_id; 5410 it->saved_face_id);
5398 } 5411 }
5399 } 5412 }
5400 else 5413 else
@@ -11766,9 +11779,6 @@ redisplay_window (window, just_this_one_p)
11766 *w->desired_matrix->method = 0; 11779 *w->desired_matrix->method = 0;
11767#endif 11780#endif
11768 11781
11769 /* Force this to be looked up again for each redisp of each window. */
11770 escape_glyph_face = -1;
11771
11772 specbind (Qinhibit_point_motion_hooks, Qt); 11782 specbind (Qinhibit_point_motion_hooks, Qt);
11773 11783
11774 reconsider_clip_changes (w, buffer); 11784 reconsider_clip_changes (w, buffer);
@@ -16071,22 +16081,30 @@ store_mode_line_string (string, lisp_string, copy_string, field_width, precision
16071 16081
16072 16082
16073DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line, 16083DEFUN ("format-mode-line", Fformat_mode_line, Sformat_mode_line,
16074 0, 4, 0, 16084 1, 4, 0,
16075 doc: /* Return the mode-line of selected window as a string. 16085 doc: /* Format a string out of a mode line format specification.
16076First optional arg FORMAT specifies a different format string (see 16086First arg FORMAT specifies the mode line format (see `mode-line-format'
16077`mode-line-format' for details) to use. If FORMAT is t, return 16087for details) to use.
16078the buffer's header-line. Second optional arg WINDOW specifies a 16088
16079different window to use as the context for the formatting. 16089Optional second arg FACE specifies the face property to put
16080If third optional arg NO-PROPS is non-nil, string is not propertized. 16090on all characters for which no face is specified.
16081Fourth optional arg BUFFER specifies which buffer to use. */) 16091t means whatever face the window's mode line currently uses
16082 (format, window, no_props, buffer) 16092\(either `mode-line' or `mode-line-inactive', depending).
16083 Lisp_Object format, window, no_props, buffer; 16093nil means the default is no face property.
16094If FACE is an integer, the value string has no text properties.
16095
16096Optional third and fourth args WINDOW and BUFFER specify the window
16097and buffer to use as the context for the formatting (defaults
16098are the selected window and the window's buffer). */)
16099 (format, face, window, buffer)
16100 Lisp_Object format, face, window, buffer;
16084{ 16101{
16085 struct it it; 16102 struct it it;
16086 int len; 16103 int len;
16087 struct window *w; 16104 struct window *w;
16088 struct buffer *old_buffer = NULL; 16105 struct buffer *old_buffer = NULL;
16089 enum face_id face_id = DEFAULT_FACE_ID; 16106 int face_id = -1;
16107 int no_props = INTEGERP (face);
16090 16108
16091 if (NILP (window)) 16109 if (NILP (window))
16092 window = selected_window; 16110 window = selected_window;
@@ -16095,37 +16113,37 @@ Fourth optional arg BUFFER specifies which buffer to use. */)
16095 16113
16096 if (NILP (buffer)) 16114 if (NILP (buffer))
16097 buffer = w->buffer; 16115 buffer = w->buffer;
16098
16099 CHECK_BUFFER (buffer); 16116 CHECK_BUFFER (buffer);
16100 16117
16101 if (XBUFFER (buffer) != current_buffer) 16118 if (NILP (format))
16119 return build_string ("");
16120
16121 if (no_props)
16122 face = Qnil;
16123
16124 if (!NILP (face))
16102 { 16125 {
16103 old_buffer = current_buffer; 16126 if (EQ (face, Qt))
16104 set_buffer_internal_1 (XBUFFER (buffer)); 16127 face = (EQ (window, selected_window) ? Qmode_line : Qmode_line_inactive);
16128 face_id = lookup_named_face (XFRAME (WINDOW_FRAME (w)), face, 0, 0);
16105 } 16129 }
16106 16130
16107 if (NILP (format) || EQ (format, Qt)) 16131 if (face_id < 0)
16132 face_id = DEFAULT_FACE_ID;
16133
16134 if (XBUFFER (buffer) != current_buffer)
16108 { 16135 {
16109 face_id = (NILP (format) 16136 old_buffer = current_buffer;
16110 ? CURRENT_MODE_LINE_FACE_ID (w) 16137 set_buffer_internal_1 (XBUFFER (buffer));
16111 : HEADER_LINE_FACE_ID);
16112 format = (NILP (format)
16113 ? current_buffer->mode_line_format
16114 : current_buffer->header_line_format);
16115 } 16138 }
16116 16139
16117 init_iterator (&it, w, -1, -1, NULL, face_id); 16140 init_iterator (&it, w, -1, -1, NULL, face_id);
16118 16141
16119 if (NILP (no_props)) 16142 if (!no_props)
16120 { 16143 {
16121 mode_line_string_face 16144 mode_line_string_face = face;
16122 = (face_id == MODE_LINE_FACE_ID ? Qmode_line
16123 : face_id == MODE_LINE_INACTIVE_FACE_ID ? Qmode_line_inactive
16124 : face_id == HEADER_LINE_FACE_ID ? Qheader_line : Qnil);
16125
16126 mode_line_string_face_prop 16145 mode_line_string_face_prop
16127 = (NILP (mode_line_string_face) ? Qnil 16146 = (NILP (face) ? Qnil : Fcons (Qface, Fcons (face, Qnil)));
16128 : Fcons (Qface, Fcons (mode_line_string_face, Qnil)));
16129 16147
16130 /* We need a dummy last element in mode_line_string_list to 16148 /* We need a dummy last element in mode_line_string_list to
16131 indicate we are building the propertized mode-line string. 16149 indicate we are building the propertized mode-line string.
@@ -16148,7 +16166,7 @@ Fourth optional arg BUFFER specifies which buffer to use. */)
16148 if (old_buffer) 16166 if (old_buffer)
16149 set_buffer_internal_1 (old_buffer); 16167 set_buffer_internal_1 (old_buffer);
16150 16168
16151 if (NILP (no_props)) 16169 if (!no_props)
16152 { 16170 {
16153 Lisp_Object str; 16171 Lisp_Object str;
16154 mode_line_string_list = Fnreverse (mode_line_string_list); 16172 mode_line_string_list = Fnreverse (mode_line_string_list);
@@ -22498,6 +22516,10 @@ wide as that tab on the display. */);
22498The face used for trailing whitespace is `trailing-whitespace'. */); 22516The face used for trailing whitespace is `trailing-whitespace'. */);
22499 Vshow_trailing_whitespace = Qnil; 22517 Vshow_trailing_whitespace = Qnil;
22500 22518
22519 DEFVAR_LISP ("show-nonbreak-escape", &Vshow_nonbreak_escape,
22520 doc: /* *Non-nil means display escape character before non-break space and hyphen. */);
22521 Vshow_nonbreak_escape = Qt;
22522
22501 DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer, 22523 DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer,
22502 doc: /* *The pointer shape to show in void text areas. 22524 doc: /* *The pointer shape to show in void text areas.
22503Nil means to show the text pointer. Other options are `arrow', `text', 22525Nil means to show the text pointer. Other options are `arrow', `text',
diff --git a/src/xfaces.c b/src/xfaces.c
index f866b448d49..468b31ce5d5 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -7881,6 +7881,69 @@ face_at_string_position (w, string, pos, bufpos, region_beg,
7881} 7881}
7882 7882
7883 7883
7884/* Merge a face into a realized face.
7885
7886 F is frame where faces are (to be) realized.
7887
7888 FACE_NAME is named face to merge.
7889
7890 If FACE_NAME is nil, FACE_ID is face_id of realized face to merge.
7891
7892 If FACE_NAME is t, FACE_ID is lface_id of face to merge.
7893
7894 BASE_FACE_ID is realized face to merge into.
7895
7896 Return new face id.
7897*/
7898
7899int
7900merge_faces (f, face_name, face_id, base_face_id)
7901 struct frame *f;
7902 Lisp_Object face_name;
7903 int face_id, base_face_id;
7904{
7905 Lisp_Object attrs[LFACE_VECTOR_SIZE];
7906 struct face *base_face;
7907
7908 base_face = FACE_FROM_ID (f, base_face_id);
7909 if (!base_face)
7910 return base_face_id;
7911
7912 if (EQ (face_name, Qt))
7913 {
7914 if (face_id < 0 || face_id >= lface_id_to_name_size)
7915 return base_face_id;
7916 face_name = lface_id_to_name[face_id];
7917 face_id = lookup_derived_face (f, face_name, 0, base_face_id);
7918 if (face_id >= 0)
7919 return face_id;
7920 return base_face_id;
7921 }
7922
7923 /* Begin with attributes from the base face. */
7924 bcopy (base_face->lface, attrs, sizeof attrs);
7925
7926 if (!NILP (face_name))
7927 {
7928 if (!merge_named_face (f, face_name, attrs, 0))
7929 return base_face_id;
7930 }
7931 else
7932 {
7933 struct face *face;
7934 if (face_id < 0)
7935 return base_face_id;
7936 face = FACE_FROM_ID (f, face_id);
7937 if (!face)
7938 return base_face_id;
7939 merge_face_vectors (f, face->lface, attrs, 0);
7940 }
7941
7942 /* Look up a realized face with the given face attributes,
7943 or realize a new one for ASCII characters. */
7944 return lookup_face (f, attrs, 0, NULL);
7945}
7946
7884 7947
7885/*********************************************************************** 7948/***********************************************************************
7886 Tests 7949 Tests
diff --git a/src/xmenu.c b/src/xmenu.c
index 83b8fe91e9e..850b8f4ddf4 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -2454,10 +2454,6 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click)
2454 G_CALLBACK (menu_highlight_callback)); 2454 G_CALLBACK (menu_highlight_callback));
2455 xg_crazy_callback_abort = 0; 2455 xg_crazy_callback_abort = 0;
2456 2456
2457 for (i = 0; i < 5; i++)
2458 if (FRAME_X_DISPLAY_INFO (f)->grabbed & (1 << i))
2459 break;
2460
2461 if (! for_click) 2457 if (! for_click)
2462 { 2458 {
2463 /* Not invoked by a click. pop up at x/y. */ 2459 /* Not invoked by a click. pop up at x/y. */
@@ -2470,8 +2466,16 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click)
2470 popup_x_y.x = x; 2466 popup_x_y.x = x;
2471 popup_x_y.y = y; 2467 popup_x_y.y = y;
2472 popup_x_y.f = f; 2468 popup_x_y.f = f;
2473 }
2474 2469
2470 i = 0; /* gtk_menu_popup needs this to be 0 for a non-button popup. */
2471 }
2472 else
2473 {
2474 for (i = 0; i < 5; i++)
2475 if (FRAME_X_DISPLAY_INFO (f)->grabbed & (1 << i))
2476 break;
2477 }
2478
2475 /* Display the menu. */ 2479 /* Display the menu. */
2476 gtk_widget_show_all (menu); 2480 gtk_widget_show_all (menu);
2477 gtk_menu_popup (GTK_MENU (menu), 0, 0, pos_func, &popup_x_y, i, 0); 2481 gtk_menu_popup (GTK_MENU (menu), 0, 0, pos_func, &popup_x_y, i, 0);
diff --git a/src/xselect.c b/src/xselect.c
index 38547ea6bbf..5dd63b9c735 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1383,7 +1383,7 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp)
1383 else if (INTEGERP (time_stamp)) 1383 else if (INTEGERP (time_stamp))
1384 requestor_time = (Time) XUINT (time_stamp); 1384 requestor_time = (Time) XUINT (time_stamp);
1385 else if (FLOATP (time_stamp)) 1385 else if (FLOATP (time_stamp))
1386 requestor_time = (Time) XFLOAT (time_stamp); 1386 requestor_time = (Time) XFLOAT_DATA (time_stamp);
1387 else 1387 else
1388 error ("TIME_STAMP must be cons or number"); 1388 error ("TIME_STAMP must be cons or number");
1389 } 1389 }
@@ -2468,7 +2468,7 @@ x_check_property_data (data)
2468 DPY is the display use to look up X atoms. 2468 DPY is the display use to look up X atoms.
2469 DATA is a Lisp list of values to be converted. 2469 DATA is a Lisp list of values to be converted.
2470 RET is the C array that contains the converted values. It is assumed 2470 RET is the C array that contains the converted values. It is assumed
2471 it is big enough to hol all values. 2471 it is big enough to hold all values.
2472 FORMAT is 8, 16 or 32 and gives the size in bits for each C value to 2472 FORMAT is 8, 16 or 32 and gives the size in bits for each C value to
2473 be stored in RET. */ 2473 be stored in RET. */
2474 2474
@@ -2492,7 +2492,7 @@ x_fill_property_data (dpy, data, ret, format)
2492 if (INTEGERP (o)) 2492 if (INTEGERP (o))
2493 val = (CARD32) XFASTINT (o); 2493 val = (CARD32) XFASTINT (o);
2494 else if (FLOATP (o)) 2494 else if (FLOATP (o))
2495 val = (CARD32) XFLOAT (o); 2495 val = (CARD32) XFLOAT_DATA (o);
2496 else if (CONSP (o)) 2496 else if (CONSP (o))
2497 val = (CARD32) cons_to_long (o); 2497 val = (CARD32) cons_to_long (o);
2498 else if (STRINGP (o)) 2498 else if (STRINGP (o))
@@ -2597,7 +2597,7 @@ If the value is 0 or the atom is not known, return the empty string. */)
2597 if (INTEGERP (value)) 2597 if (INTEGERP (value))
2598 atom = (Atom) XUINT (value); 2598 atom = (Atom) XUINT (value);
2599 else if (FLOATP (value)) 2599 else if (FLOATP (value))
2600 atom = (Atom) XFLOAT (value); 2600 atom = (Atom) XFLOAT_DATA (value);
2601 else if (CONSP (value)) 2601 else if (CONSP (value))
2602 atom = (Atom) cons_to_long (value); 2602 atom = (Atom) cons_to_long (value);
2603 else 2603 else
@@ -2729,7 +2729,7 @@ are ignored. */)
2729 else if (INTEGERP (dest)) 2729 else if (INTEGERP (dest))
2730 wdest = (Window) XFASTINT (dest); 2730 wdest = (Window) XFASTINT (dest);
2731 else if (FLOATP (dest)) 2731 else if (FLOATP (dest))
2732 wdest = (Window) XFLOAT (dest); 2732 wdest = (Window) XFLOAT_DATA (dest);
2733 else if (CONSP (dest)) 2733 else if (CONSP (dest))
2734 { 2734 {
2735 if (! NUMBERP (XCAR (dest)) || ! NUMBERP (XCDR (dest))) 2735 if (! NUMBERP (XCAR (dest)) || ! NUMBERP (XCDR (dest)))
diff --git a/src/xterm.h b/src/xterm.h
index e949fced7d8..cf2583981f0 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -502,6 +502,8 @@ struct x_output
502 GtkWidget *toolbar_widget; 502 GtkWidget *toolbar_widget;
503 /* The handle box that makes the tool bar detachable. */ 503 /* The handle box that makes the tool bar detachable. */
504 GtkWidget *handlebox_widget; 504 GtkWidget *handlebox_widget;
505 /* Non-zero if the tool bar is detached. */
506 int toolbar_detached;
505 507
506 /* The last size hints set. */ 508 /* The last size hints set. */
507 GdkGeometry size_hints; 509 GdkGeometry size_hints;