aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2006-04-17 08:41:12 +0000
committerMiles Bader2006-04-17 08:41:12 +0000
commitcfc2051d0ed5a268528a647ab0911a2f5cc451de (patch)
treecb622fe0b6c1ba8b97314fb80ba2fd8fad60a5a2
parentca49cf1703cc20d50653c32ca2f438c8819b78bd (diff)
parente4a89ccf738861d7b9c4f611185aa0f204c9c208 (diff)
downloademacs-cfc2051d0ed5a268528a647ab0911a2f5cc451de.tar.gz
emacs-cfc2051d0ed5a268528a647ab0911a2f5cc451de.zip
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-56
Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 204-225) - Update from CVS - Sync from erc--emacs--0 - Merge from gnus--rel--5.10 - Improve tq.el. - Update from CVS: src/puresize.h (PURESIZE_RATIO): Reduce to 10/6. * gnus--rel--5.10 (patch 81-85) - Update from CVS - Merge from emacs--devo--0
-rw-r--r--admin/FOR-RELEASE10
-rw-r--r--etc/ChangeLog18
-rw-r--r--etc/NEWS15
-rw-r--r--etc/PROBLEMS8
-rw-r--r--etc/TODO11
-rw-r--r--etc/orgcard.tex73
-rw-r--r--leim/Makefile.in2
-rw-r--r--leim/quail/croatian.el2
-rw-r--r--leim/quail/cyril-jis.el2
-rw-r--r--leim/quail/cyrillic.el2
-rw-r--r--leim/quail/hangul3.el2
-rw-r--r--leim/quail/hanja.el1
-rw-r--r--leim/quail/japanese.el1
-rw-r--r--leim/quail/latin-alt.el2
-rw-r--r--leim/quail/latin-ltx.el2
-rw-r--r--leim/quail/latin-post.el2
-rw-r--r--leim/quail/latin-pre.el4
-rw-r--r--leim/quail/pypunct-b5.el2
-rw-r--r--leim/quail/tibetan.el4
-rw-r--r--lisp/ChangeLog309
-rw-r--r--lisp/allout.el1
-rw-r--r--lisp/calendar/appt.el10
-rw-r--r--lisp/cus-edit.el62
-rw-r--r--lisp/custom.el79
-rw-r--r--lisp/emacs-lisp/bytecomp.el6
-rw-r--r--lisp/emacs-lisp/edebug.el14
-rw-r--r--lisp/emacs-lisp/find-func.el12
-rw-r--r--lisp/emacs-lisp/tq.el96
-rw-r--r--lisp/emulation/cua-base.el8
-rw-r--r--lisp/emulation/cua-gmrk.el4
-rw-r--r--lisp/emulation/cua-rect.el10
-rw-r--r--lisp/erc/ChangeLog20
-rw-r--r--lisp/erc/erc-backend.el14
-rw-r--r--lisp/erc/erc-ezbounce.el2
-rw-r--r--lisp/erc/erc-join.el4
-rw-r--r--lisp/erc/erc-netsplit.el5
-rw-r--r--lisp/erc/erc.el12
-rw-r--r--lisp/files.el55
-rw-r--r--lisp/finder.el2
-rw-r--r--lisp/gnus/ChangeLog56
-rw-r--r--lisp/gnus/flow-fill.el2
-rw-r--r--lisp/gnus/gnus-art.el33
-rw-r--r--lisp/gnus/gnus-sieve.el2
-rw-r--r--lisp/gnus/gnus-sum.el3
-rw-r--r--lisp/gnus/gnus-uu.el4
-rw-r--r--lisp/gnus/message.el3
-rw-r--r--lisp/gnus/mm-decode.el15
-rw-r--r--lisp/gnus/mm-extern.el24
-rw-r--r--lisp/gnus/nnslashdot.el2
-rw-r--r--lisp/gnus/rfc2047.el7
-rw-r--r--lisp/hexl.el74
-rw-r--r--lisp/international/mule-cmds.el4
-rw-r--r--lisp/loadhist.el22
-rw-r--r--lisp/mail/rmail.el4
-rw-r--r--lisp/mh-e/ChangeLog126
-rw-r--r--lisp/mh-e/mh-acros.el4
-rw-r--r--lisp/mh-e/mh-comp.el2
-rw-r--r--lisp/mh-e/mh-compat.el7
-rw-r--r--lisp/mh-e/mh-e.el334
-rw-r--r--lisp/mh-e/mh-folder.el9
-rw-r--r--lisp/mh-e/mh-funcs.el2
-rw-r--r--lisp/mh-e/mh-letter.el5
-rw-r--r--lisp/mh-e/mh-mime.el15
-rw-r--r--lisp/mh-e/mh-search.el14
-rw-r--r--lisp/mh-e/mh-seq.el4
-rw-r--r--lisp/mh-e/mh-show.el2
-rw-r--r--lisp/mh-e/mh-utils.el8
-rw-r--r--lisp/mh-e/mh-xface.el3
-rw-r--r--lisp/net/tramp.el16
-rw-r--r--lisp/newcomment.el14
-rw-r--r--lisp/pcvs-parse.el4
-rw-r--r--lisp/play/landmark.el26
-rw-r--r--lisp/progmodes/cc-langs.el3
-rw-r--r--lisp/progmodes/gdb-ui.el53
-rw-r--r--lisp/progmodes/perl-mode.el5
-rw-r--r--lisp/simple.el41
-rw-r--r--lisp/startup.el20
-rw-r--r--lisp/subr.el3
-rw-r--r--lisp/textmodes/bibtex.el84
-rw-r--r--lisp/textmodes/org.el4138
-rw-r--r--lisp/textmodes/picture.el8
-rw-r--r--lisp/time-stamp.el11
-rw-r--r--lisp/vc.el131
-rw-r--r--lispref/ChangeLog30
-rw-r--r--lispref/customize.texi41
-rw-r--r--lispref/os.texi5
-rw-r--r--lispref/processes.texi6
-rw-r--r--lispref/text.texi9
-rw-r--r--mac/ChangeLog4
-rw-r--r--mac/inc/config.h2
-rw-r--r--man/ChangeLog74
-rw-r--r--man/building.texi2
-rw-r--r--man/cmdargs.texi2
-rw-r--r--man/custom.texi7
-rw-r--r--man/emacs-xtra.texi1569
-rw-r--r--man/emacs.texi32
-rw-r--r--man/files.texi966
-rw-r--r--man/frames.texi2
-rw-r--r--man/gnu.texi2
-rw-r--r--man/gnus-faq.texi2
-rw-r--r--man/gnus.texi35
-rw-r--r--man/macos.texi2
-rw-r--r--man/msdog.texi682
-rw-r--r--man/mule.texi2
-rw-r--r--man/org.texi1494
-rw-r--r--man/search.texi14
-rw-r--r--man/sending.texi2
-rw-r--r--man/trouble.texi3
-rw-r--r--src/ChangeLog188
-rw-r--r--src/data.c7
-rw-r--r--src/dispnew.c2
-rw-r--r--src/fns.c6
-rw-r--r--src/image.c25
-rw-r--r--src/keyboard.c3
-rw-r--r--src/lisp.h40
-rw-r--r--src/mac.c54
-rw-r--r--src/macfns.c49
-rw-r--r--src/macmenu.c2
-rw-r--r--src/macselect.c74
-rw-r--r--src/macterm.c440
-rw-r--r--src/macterm.h28
-rw-r--r--src/print.c3
-rw-r--r--src/process.c14
-rw-r--r--src/puresize.h4
-rw-r--r--src/s/ms-w32.h9
-rw-r--r--src/search.c4
-rw-r--r--src/unexmacosx.c9
-rw-r--r--src/window.c20
-rw-r--r--src/xdisp.c35
-rw-r--r--src/xfaces.c10
-rw-r--r--src/xrdb.c2
131 files changed, 7239 insertions, 5013 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index b04273d274e..947922a4888 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -33,6 +33,10 @@ Assigned to Bill Wohler <wohler@newt.com>.
33 33
34* BUGS 34* BUGS
35 35
36** Stefan Monnier's March 20 bug report about 3d boxes in header line.
37
38** Is there a basic problem with cl-byte-compile-compiler-macro?
39
36** Markus Gritsch's report about Emacs looping on Windoze with the following 40** Markus Gritsch's report about Emacs looping on Windoze with the following
37.emacs file, and then reduce Emacs frame width to "something quite narrow": 41.emacs file, and then reduce Emacs frame width to "something quite narrow":
38 (setq-default truncate-lines t) 42 (setq-default truncate-lines t)
@@ -72,7 +76,7 @@ you're going to handle.
72DIRECTORY STATUS IN CHARGE 76DIRECTORY STATUS IN CHARGE
73--------- ------ --------- 77--------- ------ ---------
74etc (and subdirs) done Thien-Thi Nguyen (ttn(@gnu.org)) 78etc (and subdirs) done Thien-Thi Nguyen (ttn(@gnu.org))
75leim working Kenichi Handa 79leim done Kenichi Handa
76lib-src done ttn 80lib-src done ttn
77lisp done ttn 81lisp done ttn
78lisp/calc done Jay Belanger 82lisp/calc done Jay Belanger
@@ -81,8 +85,8 @@ lisp/emacs-lisp done ttn
81lisp/emulation done ttn 85lisp/emulation done ttn
82lisp/eshell done ttn 86lisp/eshell done ttn
83lisp/gnus done Romain Francoise 87lisp/gnus done Romain Francoise
84lisp/international working Kenichi Handa 88lisp/international done Kenichi Handa
85lisp/language working Kenichi Handa 89lisp/language done Kenichi Handa
86lisp/mail done ttn 90lisp/mail done ttn
87lisp/mh-e done Bill Wohler 91lisp/mh-e done Bill Wohler
88lisp/net done ttn 92lisp/net done ttn
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 95b24e50e2d..8673937f15b 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,21 @@
12006-04-12 Kenichi Handa <handa@m17n.org>
2
3 * PROBLEMS (C-SPC fails ...): Explicitly say fcitx in the header.
4
52006-04-11 Carsten Dominik <dominik@science.uva.nl>
6
7 * orgcard.tex: (section{Tables}): Document column narrowing.
8 (section{Links}): Document bracket links.
9
102006-04-11 Kenichi Handa <handa@m17n.org>
11
12 * PROBLEMS (C-SPC fails ...): Add description for fcitx.
13
142006-04-10 Bill Wohler <wohler@newt.com>
15
16 * NEWS: Add package-version keyword to `defcustom' and mention
17 associated variable `customize-package-emacs-version-alist'.
18
12006-04-07 Reiner Steib <Reiner.Steib@gmx.de> 192006-04-07 Reiner Steib <Reiner.Steib@gmx.de>
2 20
3 * NEWS: Add string-or-null-p. 21 * NEWS: Add string-or-null-p.
diff --git a/etc/NEWS b/etc/NEWS
index 351dfa47729..3ec9c17f692 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -3767,6 +3767,12 @@ variables, including buffer-local and frame-local variables.
3767** defcustom changes: 3767** defcustom changes:
3768 3768
3769+++ 3769+++
3770*** The package-version keyword has been added to provide
3771`customize-changed-options' functionality to packages in the future.
3772Developers who make use of this keyword must also update the new
3773variable `customize-package-emacs-version-alist'.
3774
3775+++
3770*** The new customization type `float' requires a floating point number. 3776*** The new customization type `float' requires a floating point number.
3771 3777
3772** String changes: 3778** String changes:
@@ -4036,6 +4042,12 @@ A file local variables list cannot specify a string with text
4036properties--any specified text properties are discarded. 4042properties--any specified text properties are discarded.
4037 4043
4038+++ 4044+++
4045*** The variable `enable-local-variables' controls how local variable
4046lists are handled. t, the default, specifies the standard querying
4047behavior. :safe means use only safe values, and ignore the rest.
4048nil means ignore them all. Anything else means always query.
4049
4050+++
4039*** The variable `safe-local-eval-forms' specifies a list of forms that 4051*** The variable `safe-local-eval-forms' specifies a list of forms that
4040are ok to evaluate when they appear in an `eval' local variables 4052are ok to evaluate when they appear in an `eval' local variables
4041specification. Normally Emacs asks for confirmation before evaluating 4053specification. Normally Emacs asks for confirmation before evaluating
@@ -10859,9 +10871,6 @@ SNMPv2 MIBs. It has entries on `auto-mode-alist'.
10859editing SQL files, and M-x sql-interactive-mode for interacting with 10871editing SQL files, and M-x sql-interactive-mode for interacting with
10860SQL interpreters. It has an entry on `auto-mode-alist'. 10872SQL interpreters. It has an entry on `auto-mode-alist'.
10861 10873
10862*** M-x highlight-changes-mode provides a minor mode displaying buffer
10863changes with a special face.
10864
10865*** ispell4.el has been deleted. It got in the way of ispell.el and 10874*** ispell4.el has been deleted. It got in the way of ispell.el and
10866this was hard to fix reliably. It has long been obsolete -- use 10875this was hard to fix reliably. It has long been obsolete -- use
10867Ispell 3.1 and ispell.el. 10876Ispell 3.1 and ispell.el.
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index afe0493d760..6435bd2e673 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -995,7 +995,7 @@ xmodmap command to the xdm setup script for that display.
995 995
996Use the shell command `xset bc' to make the old X Menu package work. 996Use the shell command `xset bc' to make the old X Menu package work.
997 997
998*** C-SPC fails to work on Fedora GNU/Linux. 998*** C-SPC fails to work on Fedora GNU/Linux (or with fcitx input method).
999 999
1000Fedora Core 4 steals the C-SPC key by default for the `iiimx' program 1000Fedora Core 4 steals the C-SPC key by default for the `iiimx' program
1001which is the input method for some languages. It blocks Emacs users 1001which is the input method for some languages. It blocks Emacs users
@@ -1009,6 +1009,12 @@ Another is to specify `Emacs*useXIM: false' in your X resources.
1009 1009
1010Another is to build Emacs with the `--without-xim' configure option. 1010Another is to build Emacs with the `--without-xim' configure option.
1011 1011
1012The same problem happens on any other system if you are using fcitx
1013(Chinese input method) which by default use C-SPC for toggling. If
1014you want to use fcitx with Emacs, you have two choices. Toggle fcitx
1015by another key (e.g. C-\) by modifying ~/.fcitx/config, or be
1016accustomed to use C-@ for `set-mark-command'.
1017
1012*** M-SPC seems to be ignored as input. 1018*** M-SPC seems to be ignored as input.
1013 1019
1014See if your X server is set up to use this as a command 1020See if your X server is set up to use this as a command
diff --git a/etc/TODO b/etc/TODO
index 3d8d0103471..137536f4ee0 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -9,10 +9,13 @@ to the FSF.
9 9
10* Small but important fixes needed in existing features: 10* Small but important fixes needed in existing features:
11 11
12** Distribute a bar cursor of width > 1 evenly between the two glyphs
13 on each side of the bar (what to do at the edges?).
14
12** Make vc-checkin avoid reverting the buffer if has not changed after 15** Make vc-checkin avoid reverting the buffer if has not changed after
13 the checkin. Comparing (md5 BUFFER) to (md5 FILE) should be enough. 16 the checkin. Comparing (md5 BUFFER) to (md5 FILE) should be enough.
14 17
15** Make vc-annotate show place the cursor in the annotate buffer at the 18** Make vc-annotate show place the cursor in the annotate buffer at the
16 same line as the current buffer. 19 same line as the current buffer.
17 20
18** buffer-offer-save should be a permanent local. 21** buffer-offer-save should be a permanent local.
@@ -69,7 +72,7 @@ to the FSF.
69** Redesign the load-history data structure so it can cope better 72** Redesign the load-history data structure so it can cope better
70 with evaluating definitions of the same function from different files, 73 with evaluating definitions of the same function from different files,
71 recording which file the latest definition came from. 74 recording which file the latest definition came from.
72 75
73* Important features: 76* Important features:
74 77
75** Provide user-friendly ways to list all available font families, 78** Provide user-friendly ways to list all available font families,
@@ -158,7 +161,7 @@ typically due to pilot errors and should thus be in debug-ignored-errors.
158** Emacs Lisp mode could put an overlay on the defun for every 161** Emacs Lisp mode could put an overlay on the defun for every
159 function that has advice. The overlay could have `after-text' like " 162 function that has advice. The overlay could have `after-text' like "
160 [Function has advice]". It might look like 163 [Function has advice]". It might look like
161 (defun foo [Function has advice] (x y) 164 (defun foo [Function has advice] (x y)
162 The overlay could also be a button that you could use to view the advice. 165 The overlay could also be a button that you could use to view the advice.
163 166
164** ange-ftp 167** ange-ftp
@@ -261,7 +264,7 @@ typically due to pilot errors and should thus be in debug-ignored-errors.
261** Highlight rectangles (`mouse-track-rectangle-p' in XEmacs). Already in CUA, 264** Highlight rectangles (`mouse-track-rectangle-p' in XEmacs). Already in CUA,
262 but it's a valuable feature worth making more general. 265 but it's a valuable feature worth making more general.
263 266
264** Support simultaneous tty and X frames. [See the multi-tty branch of Emacs 267** Support simultaneous tty and X frames. [See the multi-tty branch of Emacs
265 at http://lorentey.hu/project/emacs.] 268 at http://lorentey.hu/project/emacs.]
266 269
267** Provide MIME support for Rmail using the Gnus MIME library. [Maybe 270** Provide MIME support for Rmail using the Gnus MIME library. [Maybe
diff --git a/etc/orgcard.tex b/etc/orgcard.tex
index cca7e525d91..245354e85d3 100644
--- a/etc/orgcard.tex
+++ b/etc/orgcard.tex
@@ -1,4 +1,6 @@
1% Reference Card for Org Mode 4.10 1% Reference Card for Org Mode
2\def\orgversionnumber{4.23}
3\def\year{2006}
2% 4%
3%**start of header 5%**start of header
4\newcount\columnsperpage 6\newcount\columnsperpage
@@ -58,9 +60,6 @@
58% Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik 60% Thanks to Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
59% for their many good ideas. 61% for their many good ideas.
60 62
61\def\orgversionnumber{4.10}
62\def\year{2006}
63
64\def\shortcopyrightnotice{\vskip 1ex plus 2 fill 63\def\shortcopyrightnotice{\vskip 1ex plus 2 fill
65 \centerline{\small \copyright\ 2004, 2005, 2006\ Free Software Foundation, Inc. 64 \centerline{\small \copyright\ 2004, 2005, 2006\ Free Software Foundation, Inc.
66 Permissions on back. v\orgversionnumber}} 65 Permissions on back. v\orgversionnumber}}
@@ -367,10 +366,8 @@ To set archive location for current file, add a line like$^3$:
367\key{insert SCHEDULED timestamp}{C-c C-s} 366\key{insert SCHEDULED timestamp}{C-c C-s}
368\key{create sparse tree with all deadlines due}{C-c C-w} 367\key{create sparse tree with all deadlines due}{C-c C-w}
369\key{the time between 2 dates in a time range}{C-c C-y} 368\key{the time between 2 dates in a time range}{C-c C-y}
370\key{change timestamp at cursor by $-1$ day}{S-LEFT$^4$} 369\key{change timestamp at cursor by $\pm 1$ day}{S-RIGHT/LEFT$^4$}
371\key{change timestamp at cursor by $+1$ day}{S-RIGHT$^4$} 370\key{change year/month/day at cursor by $\pm 1$}{S-UP/DOWN$^4$}
372\key{change year/month/day at cursor by $-1$}{S-DOWN$^4$}
373\key{change year/month/day at cursor by $+1$}{S-UP$^4$}
374\key{access the calendar for the current date}{C-c >} 371\key{access the calendar for the current date}{C-c >}
375\key{insert timestamp matching date in calendar}{C-c <} 372\key{insert timestamp matching date in calendar}{C-c <}
376\key{access agenda for current date}{C-c C-o} 373\key{access agenda for current date}{C-c C-o}
@@ -386,6 +383,7 @@ To set archive location for current file, add a line like$^3$:
386\key{globally store link to the current location}{C-c l$^2$} 383\key{globally store link to the current location}{C-c l$^2$}
387\key{insert a link (TAB completes stored links)}{C-c C-l} 384\key{insert a link (TAB completes stored links)}{C-c C-l}
388\key{insert file link with file name completion}{C-u C-c C-l} 385\key{insert file link with file name completion}{C-u C-c C-l}
386\key{edit (also hidden part of) link at point}{C-c C-l}
389 387
390\key{open file links in emacs (\kbd{C-u} : in emacs)}{C-c C-o} 388\key{open file links in emacs (\kbd{C-u} : in emacs)}{C-c C-o}
391\key{open link at point (3: in emacs)}{mouse-2/3} 389\key{open link at point (3: in emacs)}{mouse-2/3}
@@ -399,24 +397,26 @@ To set archive location for current file, add a line like$^3$:
399\key{\kbd{<<<My Target>>>}}{\rm radio target$^3$} 397\key{\kbd{<<<My Target>>>}}{\rm radio target$^3$}
400\key{\kbd{[[*this text]]}}{\rm find headline} 398\key{\kbd{[[*this text]]}}{\rm find headline}
401\metax{\kbd{[[this text]]}}{\rm find target or text in buffer} 399\metax{\kbd{[[this text]]}}{\rm find target or text in buffer}
400\metax{\kbd{[[this text][description]]}}{\rm optional link text}
402 401
403{\bf External Links} 402{\bf External Links}
404 403
405\key{\kbd{<file:/home/dominik/img/mars.jpg>}}{\rm file, absolute} 404\key{\kbd{file:/home/dominik/img/mars.jpg}}{\rm file, absolute}
406\key{\kbd{<file:papers/last.pdf>}}{\rm file, relative} 405\key{\kbd{file:papers/last.pdf}}{\rm file, relative}
407\key{\kbd{<file:projects.org::*that text>}}{\rm find headline} 406\key{\kbd{file:projects.org::*that text}}{\rm find headline}
408\key{\kbd{<file:projects.org::find me>}}{\rm find tgt/string} 407\key{\kbd{file:projects.org::find me}}{\rm find tgt/string}
409\key{\kbd{<file:projects.org::/regexp/>}}{\rm regexp search} 408\key{\kbd{file:projects.org::/regexp/}}{\rm regexp search}
410\key{\kbd{<http://www.astro.uva.nl/~dominik>}}{\rm on the web} 409\key{\kbd{http://www.astro.uva.nl/~dominik}}{\rm on the web}
411\key{\kbd{<mailto:adent@galaxy.net>}}{\rm EMail address} 410\key{\kbd{mailto:adent@galaxy.net}}{\rm EMail address}
412\key{\kbd{<news:comp.emacs>}}{\rm Usenet group} 411\key{\kbd{news:comp.emacs}}{\rm Usenet group}
413\key{\kbd{<bbdb:Richard Stallman>}}{\rm BBDB person} 412\key{\kbd{bbdb:Richard Stallman}}{\rm BBDB person}
414\key{\kbd{<shell:ls *.org>}}{\rm shell command} 413\key{\kbd{shell:ls *.org}}{\rm shell command}
415\key{\kbd{<gnus:group>}}{\rm GNUS group} 414\key{\kbd{gnus:group}}{\rm GNUS group}
416\key{\kbd{<gnus:group\#id>}}{\rm GNUS message} 415\key{\kbd{gnus:group\#id}}{\rm GNUS message}
417\key{\kbd{<vm|wl|mhe|rmail:folder>}}{\rm Mail folder} 416\key{\kbd{vm|wl|mhe|rmail:folder}}{\rm Mail folder}
418\key{\kbd{<vm|wl|mhe|rmail:folder\#id>}}{\rm Mail message} 417\key{\kbd{vm|wl|mhe|rmail:folder\#id}}{\rm Mail message}
419%\key{\kbd{<vm://myself@some.where.org/folder\#id>}}{\rm VM remote} 418\metax{\kbd{[[external link][description]]}}{\rm optional link text}
419%\key{\kbd{vm://myself@some.where.org/folder\#id}}{\rm VM remote}
420 420
421\section{Tables} 421\section{Tables}
422 422
@@ -425,11 +425,10 @@ To set archive location for current file, add a line like$^3$:
425 425
426{\bf Creating a table} 426{\bf Creating a table}
427 427
428\metax{insert a new Org-mode table}{M-x org-table-create} 428%\metax{insert a new Org-mode table}{M-x org-table-create}
429\metax{... or just start typing, e.g.}{|Name|Phone|Age RET |- TAB} 429\metax{just start typing, e.g.}{|Name|Phone|Age RET |- TAB}
430\key{convert region to table}{C-c C-c} 430\key{convert region to table}{C-c |}
431\key{... separator at least 3 spaces}{C-3 C-c C-c} 431\key{... separator at least 3 spaces}{C-3 C-c |}
432%\key{... prompt for separator regexp}{C-u C-c C-c}
433 432
434{\bf Commands available inside tables} 433{\bf Commands available inside tables}
435 434
@@ -465,9 +464,7 @@ Outside of tables, the same keys may have other functionality.
465\key{paste rectangular region}{C-c C-x C-y} 464\key{paste rectangular region}{C-c C-x C-y}
466\key{fill paragraph across selected cells}{C-c C-q} 465\key{fill paragraph across selected cells}{C-c C-q}
467 466
468{\bf Calculations} 467{\bf Calculations} (in combination with Emacs \kbd{calc} package)
469
470These need the Emacs calc package installed.
471 468
472\key{set and eval column formula}{C-c =} 469\key{set and eval column formula}{C-c =}
473\key{set and eval named-field formula}{C-u C-c =} 470\key{set and eval named-field formula}{C-u C-c =}
@@ -475,8 +472,8 @@ These need the Emacs calc package installed.
475\key{re-apply all stored equations to current line}{C-c *} 472\key{re-apply all stored equations to current line}{C-c *}
476\key{re-apply all stored equations to entire table}{C-u C-c *} 473\key{re-apply all stored equations to entire table}{C-u C-c *}
477 474
478\kbd{TAB}, \kbd{RET} and \kbd{C-c C-c} trigger automatic recalculation 475%\kbd{TAB}, \kbd{RET} and \kbd{C-c C-c} trigger automatic recalculation
479in lines starting with: {\tt | \# |}. 476%in lines starting with: {\tt | \# |}.
480 477
481\key{rotate calculation mark through \# * ! \^ \_ \$}{C-\#} 478\key{rotate calculation mark through \# * ! \^ \_ \$}{C-\#}
482 479
@@ -484,9 +481,9 @@ in lines starting with: {\tt | \# |}.
484\key{sum numbers in current column/rectangle}{C-c +} 481\key{sum numbers in current column/rectangle}{C-c +}
485\key{copy down with increment}{S-RET$^4$} 482\key{copy down with increment}{S-RET$^4$}
486 483
487A formula can also be typed directly into into a field and will 484Formulas typed in field are executed by \kbd{TAB},
488executed by \kbd{TAB}, \kbd{RET} and \kbd{C-c C-c}. A leading \kbd{=} 485\kbd{RET} and \kbd{C-c C-c}. \kbd{=} introduces a column
489introduces a column formula, \kbd{:=} a named-field formula. 486formula, \kbd{:=} a named-field formula.
490 487
491\key{Example: Add Col1 and Col2}{=\$1+\$2} 488\key{Example: Add Col1 and Col2}{=\$1+\$2}
492\key{... with printf format specification}{=\$1+\$2;\%.2f} 489\key{... with printf format specification}{=\$1+\$2;\%.2f}
@@ -496,7 +493,9 @@ introduces a column formula, \kbd{:=} a named-field formula.
496 493
497{\bf Miscellaneous} 494{\bf Miscellaneous}
498 495
499\key{toggle visibility of vertical lines}{C-c |} 496\key{to limit column width to \kbd{N} characters, use}{...| <N> |...}
497\key{edit the current field in a separate window}{C-c `}
498\key{make current field fully visible}{C-u TAB}
500\metax{export as tab-separated file}{M-x org-table-export} 499\metax{export as tab-separated file}{M-x org-table-export}
501\metax{import tab-separated file}{M-x org-table-import} 500\metax{import tab-separated file}{M-x org-table-import}
502 501
diff --git a/leim/Makefile.in b/leim/Makefile.in
index 9e0364fd2d6..9459d6aae06 100644
--- a/leim/Makefile.in
+++ b/leim/Makefile.in
@@ -1,5 +1,5 @@
1# Makefile for leim subdirectory in GNU Emacs. 1# Makefile for leim subdirectory in GNU Emacs.
2# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 2# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
3# Free Software Foundation, Inc. 3# Free Software Foundation, Inc.
4# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 4# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
5# National Institute of Advanced Industrial Science and Technology (AIST) 5# National Institute of Advanced Industrial Science and Technology (AIST)
diff --git a/leim/quail/croatian.el b/leim/quail/croatian.el
index 09623077f3d..e6f7f4c341c 100644
--- a/leim/quail/croatian.el
+++ b/leim/quail/croatian.el
@@ -1,6 +1,6 @@
1;;; quail/croatian.el -- Quail package for inputing Croatian -*-coding: iso-8859-2;-*- 1;;; quail/croatian.el -- Quail package for inputing Croatian -*-coding: iso-8859-2;-*-
2 2
3;; Copyright (C) 2002 Free Software Foundation, Inc. 3;; Copyright (C) 2003 Free Software Foundation, Inc.
4 4
5;; Author: Hrvoje Nik¹iæ <hniksic@xemacs.org>, 5;; Author: Hrvoje Nik¹iæ <hniksic@xemacs.org>,
6;; modeled after czech.el by Milan Zamazal. 6;; modeled after czech.el by Milan Zamazal.
diff --git a/leim/quail/cyril-jis.el b/leim/quail/cyril-jis.el
index f594518bdbf..a7d91e7da73 100644
--- a/leim/quail/cyril-jis.el
+++ b/leim/quail/cyril-jis.el
@@ -1,7 +1,7 @@
1;;; cyril-jis.el --- Quail package for inputting JISX0208 Cyrillic letters 1;;; cyril-jis.el --- Quail package for inputting JISX0208 Cyrillic letters
2 2
3;; Copyright (C) 2001 Free Software Foundation, Inc. 3;; Copyright (C) 2001 Free Software Foundation, Inc.
4;; Copyright (C) 1997, 2005 4;; Copyright (C) 1997
5;; National Institute of Advanced Industrial Science and Technology (AIST) 5;; National Institute of Advanced Industrial Science and Technology (AIST)
6;; Registration Number H14PRO021 6;; Registration Number H14PRO021
7 7
diff --git a/leim/quail/cyrillic.el b/leim/quail/cyrillic.el
index 15723676a0e..a408919b26a 100644
--- a/leim/quail/cyrillic.el
+++ b/leim/quail/cyrillic.el
@@ -2,7 +2,7 @@
2 2
3;; Copyright (C) 1997, 1998, 2001, 2002, 2003, 2004, 2005 3;; Copyright (C) 1997, 1998, 2001, 2002, 2003, 2004, 2005
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5;; Copyright (C) 1997, 2005 5;; Copyright (C) 1997, 2003
6;; National Institute of Advanced Industrial Science and Technology (AIST) 6;; National Institute of Advanced Industrial Science and Technology (AIST)
7;; Registration Number H14PRO021 7;; Registration Number H14PRO021
8 8
diff --git a/leim/quail/hangul3.el b/leim/quail/hangul3.el
index 8cbfb061b9a..028ea6609ee 100644
--- a/leim/quail/hangul3.el
+++ b/leim/quail/hangul3.el
@@ -1,6 +1,6 @@
1;;; hangul3.el --- Quail package for inputting Korean Hangul characters -*-coding: iso-2022-7bit;-*- 1;;; hangul3.el --- Quail package for inputting Korean Hangul characters -*-coding: iso-2022-7bit;-*-
2 2
3;; Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1997, 1998, 2001, 2002 Free Software Foundation, Inc.
4;; Copyright (C) 1997, 2002 4;; Copyright (C) 1997, 2002
5;; National Institute of Advanced Industrial Science and Technology (AIST) 5;; National Institute of Advanced Industrial Science and Technology (AIST)
6;; Registration Number H14PRO021 6;; Registration Number H14PRO021
diff --git a/leim/quail/hanja.el b/leim/quail/hanja.el
index 7108e3b02f7..8d923bd534f 100644
--- a/leim/quail/hanja.el
+++ b/leim/quail/hanja.el
@@ -1,5 +1,6 @@
1;;; hanja.el --- Quail-package for Korean Hanja (KSC5601) -*-coding: iso-2022-7bit;-*- 1;;; hanja.el --- Quail-package for Korean Hanja (KSC5601) -*-coding: iso-2022-7bit;-*-
2 2
3;; Copyright (C) 1997 Free Software Foundation, Inc.
3;; Copyright (C) 1997 4;; Copyright (C) 1997
4;; National Institute of Advanced Industrial Science and Technology (AIST) 5;; National Institute of Advanced Industrial Science and Technology (AIST)
5;; Registration Number H14PRO021 6;; Registration Number H14PRO021
diff --git a/leim/quail/japanese.el b/leim/quail/japanese.el
index 974a68c0449..2961e1856f5 100644
--- a/leim/quail/japanese.el
+++ b/leim/quail/japanese.el
@@ -1,5 +1,6 @@
1;;; japanese.el --- Quail package for inputting Japanese -*-coding: iso-2022-7bit;-*- 1;;; japanese.el --- Quail package for inputting Japanese -*-coding: iso-2022-7bit;-*-
2 2
3;; Copyright (C) 2001 Free Software Foundation, Inc.
3;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2005 4;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2005
4;; National Institute of Advanced Industrial Science and Technology (AIST) 5;; National Institute of Advanced Industrial Science and Technology (AIST)
5;; Registration Number H14PRO021 6;; Registration Number H14PRO021
diff --git a/leim/quail/latin-alt.el b/leim/quail/latin-alt.el
index 3b9dc0518ae..f52467a5d64 100644
--- a/leim/quail/latin-alt.el
+++ b/leim/quail/latin-alt.el
@@ -1,7 +1,7 @@
1;;; latin-alt.el --- Quail package for inputting various European characters -*-coding: utf-8;-*- 1;;; latin-alt.el --- Quail package for inputting various European characters -*-coding: utf-8;-*-
2 2
3;; Copyright (C) 1997, 1998, 2001, 2002 Free Software Foundation, Inc. 3;; Copyright (C) 1997, 1998, 2001, 2002 Free Software Foundation, Inc.
4;; Copyright (C) 1997, 1999 4;; Copyright (C) 1999
5;; National Institute of Advanced Industrial Science and Technology (AIST) 5;; National Institute of Advanced Industrial Science and Technology (AIST)
6;; Registration Number H14PRO021 6;; Registration Number H14PRO021
7 7
diff --git a/leim/quail/latin-ltx.el b/leim/quail/latin-ltx.el
index 4bf9310abd7..9816cd42216 100644
--- a/leim/quail/latin-ltx.el
+++ b/leim/quail/latin-ltx.el
@@ -1,7 +1,7 @@
1;;; latin-ltx.el --- Quail package for TeX-style input -*-coding: utf-8;-*- 1;;; latin-ltx.el --- Quail package for TeX-style input -*-coding: utf-8;-*-
2 2
3;; Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
4;; Copyright (C) 2001 4;; Copyright (C) 2001, 2005
5;; National Institute of Advanced Industrial Science and Technology (AIST) 5;; National Institute of Advanced Industrial Science and Technology (AIST)
6;; Registration Number H14PRO021 6;; Registration Number H14PRO021
7 7
diff --git a/leim/quail/latin-post.el b/leim/quail/latin-post.el
index 1f4d2414a76..428910bcdd5 100644
--- a/leim/quail/latin-post.el
+++ b/leim/quail/latin-post.el
@@ -1,7 +1,7 @@
1;;; latin-post.el --- Quail packages for inputting various European characters -*-coding: utf-8;-*- 1;;; latin-post.el --- Quail packages for inputting various European characters -*-coding: utf-8;-*-
2 2
3;; Copyright (C) 1997, 1998, 2001, 2002 Free Software Foundation, Inc. 3;; Copyright (C) 1997, 1998, 2001, 2002 Free Software Foundation, Inc.
4;; Copyright (C) 1997 4;; Copyright (C) 1997, 1999
5;; National Institute of Advanced Industrial Science and Technology (AIST) 5;; National Institute of Advanced Industrial Science and Technology (AIST)
6;; Registration Number H14PRO021 6;; Registration Number H14PRO021
7;; Copyright (C) 2003 7;; Copyright (C) 2003
diff --git a/leim/quail/latin-pre.el b/leim/quail/latin-pre.el
index 80690c8ce1e..92ed76b5915 100644
--- a/leim/quail/latin-pre.el
+++ b/leim/quail/latin-pre.el
@@ -1,8 +1,8 @@
1;;; latin-pre.el --- Quail packages for inputting various European characters -*-coding: utf-8;-*- 1;;; latin-pre.el --- Quail packages for inputting various European characters -*-coding: utf-8;-*-
2 2
3;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 3;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5;; Copyright (C) 1997, 1999, 2005 5;; Copyright (C) 1997, 1998, 1999, 2000, 2005
6;; National Institute of Advanced Industrial Science and Technology (AIST) 6;; National Institute of Advanced Industrial Science and Technology (AIST)
7;; Registration Number H14PRO021 7;; Registration Number H14PRO021
8 8
diff --git a/leim/quail/pypunct-b5.el b/leim/quail/pypunct-b5.el
index ee053c67f13..f8fc747ba03 100644
--- a/leim/quail/pypunct-b5.el
+++ b/leim/quail/pypunct-b5.el
@@ -1,6 +1,6 @@
1;;; pypunct-b5.el --- Quail packages for Chinese (pinyin + extra symbols) -*-coding: iso-2022-7bit;-*- 1;;; pypunct-b5.el --- Quail packages for Chinese (pinyin + extra symbols) -*-coding: iso-2022-7bit;-*-
2 2
3;; Copyright (C) 1997, 2000 3;; Copyright (C) 1997, 2000, 2003
4;; National Institute of Advanced Industrial Science and Technology (AIST) 4;; National Institute of Advanced Industrial Science and Technology (AIST)
5;; Registration Number H14PRO021 5;; Registration Number H14PRO021
6 6
diff --git a/leim/quail/tibetan.el b/leim/quail/tibetan.el
index e9d998525c3..921b3732c6f 100644
--- a/leim/quail/tibetan.el
+++ b/leim/quail/tibetan.el
@@ -1,7 +1,7 @@
1;;; tibetan.el --- Quail package for inputting Tibetan characters -*-coding: iso-2022-7bit;-*- 1;;; tibetan.el --- Quail package for inputting Tibetan characters -*-coding: iso-2022-7bit;-*-
2 2
3;; Copyright (C) 1995 Free Software Foundation, Inc. 3;; Copyright (C) 1997 Free Software Foundation, Inc.
4;; Copyright (C) 1995, 1998, 1999, 2000 4;; Copyright (C) 1997, 1998, 1999, 2000
5;; National Institute of Advanced Industrial Science and Technology (AIST) 5;; National Institute of Advanced Industrial Science and Technology (AIST)
6;; Registration Number H14PRO021 6;; Registration Number H14PRO021
7 7
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e50e21a1a4b..002c1c6e8ef 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,282 @@
12006-04-16 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * newcomment.el (comment-add): New function.
4 (comment-region-default, comment-dwim): Use it.
5
62006-04-15 Michael Olson <mwolson@gnu.org>
7
8 * emacs-lisp/tq.el: Improve comments.
9 (tq-queue-head-question): New accessor function.
10 (tq-queue-head-regexp, tq-queue-head-closure, tq-queue-head-fn):
11 Update for modified queue structure.
12 (tq-queue-add): Accept `question' argument.
13 (tq-queue-pop): If a question is pending, send it.
14 (tq-enqueue): Accept new optional argument `delay-question'.
15 If this is non-nil, and at least one other question is pending a
16 response, queue the question rather than sending it immediately.
17
182006-04-15 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
19
20 * calendar/appt.el (appt-add): Check whether an appointment is
21 already present in appt-time-msg-list. Simplify code.
22
232006-04-14 Stefan Monnier <monnier@iro.umontreal.ca>
24
25 * progmodes/cc-langs.el (c-mode-menu):
26 Don't presume c-subword-mode is bound.
27
282006-04-13 Bill Wohler <wohler@newt.com>
29
30 * cus-edit.el (customize-package-emacs-version-alist): Update docstring.
31 (customize-package-emacs-version): Use cdr instead of cadr now
32 that alists use dotted pairs.
33
34 * custom.el (defcustom): Fix docstring for :package-version.
35
362006-04-13 Michael Albinus <michael.albinus@gmx.de>
37
38 * net/tramp.el (tramp-display-shell-command-buffer): New defvar.
39 (tramp-handle-shell-command): Display output buffer only when
40 `tramp-display-shell-command-buffer' is true.
41 (tramp-handle-process-file): Set `tramp-display-shell-command-buffer'.
42
432006-04-13 Carsten Dominik <dominik@science.uva.nl>
44
45 * textmodes/org.el (org-set-autofill-regexps): Set only the local
46 values of `adaptive-fill-regexp' and `adaptive-fill-function'.
47
482006-04-13 Romain Francoise <romain@orebokech.com>
49
50 * pcvs-parse.el (cvs-parse-table): Use `with-temp-buffer' to avoid
51 leaving temporary .cvsignore buffers behind.
52
532006-04-13 Carsten Dominik <dominik@science.uva.nl>
54
55 * textmodes/org.el: (org-set-regexps-and-options)
56 (org-get-current-options): Better names for the startup folding
57 options.
58
592006-04-13 Thien-Thi Nguyen <ttn@gnu.org>
60
61 * vc.el (vc-annotate): Arrange for point to end up at the same
62 line number as in the original, but only when using a new buffer.
63
642006-04-12 Davis Herring <herring@lanl.gov> (tiny change)
65
66 * files.el (hack-one-local-variable-eval-safep):
67 Recognize `edebug-form-spec' for `put', but only if it passes
68 `edebug-basic-spec'. Generalize `put' handling.
69
70 * emacs-lisp/edebug.el (edebug-basic-spec): New function for
71 vetting file-local form specs.
72
73 * allout.el (allout-layout): Autoload its `safe-local-variable'
74 property.
75
762006-04-13 Carsten Dominik <dominik@science.uva.nl>
77
78 * textmodes/org.el: (org-ctrl-c-ctrl-c): Improve documentation string.
79 (org-agenda-mouse-1-follows-link)
80 (org-mouse-1-follows-link): New options.
81 (org-format-agenda-item): Fix bug if TAGS is nil.
82 (org-agenda-get-scheduled): Quote `priority' symbol in plist.
83
842006-04-13 Nick Roberts <nickrob@snap.net.nz>
85
86 * progmodes/gdb-ui.el (gdb-set-gud-minor-mode-existing-buffers):
87 GDB 6.1+ gives full filename for "info sources" so use
88 file-name-nondirectory.
89
902006-04-12 Romain Francoise <romain@orebokech.com>
91
92 * subr.el (read-passwd): Bind `message-log-max' to nil.
93
942006-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
95
96 * progmodes/perl-mode.el (perl-indent-new-calculate):
97 Recompute parse-start after jumping backward by a whole sexp.
98
992006-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
100
101 * vc.el (vc-ensure-vc-buffer): Only change current-buffer, not the
102 window configuration.
103 (vc-annotate-display-select): Select the buffer so that current-buffer
104 (and selected-window) is the output buffer at the end of vc-annotate.
105
1062006-04-11 J.D. Smith <jdsmith@as.arizona.edu>
107
108 * vc.el (vc-annotate-color-map): Add custom TTY color map for
109 8-color terminals, to use all of the colors in a sensible order.
110 256-color terminals work well with the standard map.
111 (vc-annotate-lines): Only strip the first color character if it
112 is "#", to allow for terminal-style named colors.
113 (vc-annotate-warp-version): Pass buf to `goto-line' to ensure
114 the correct buffer is scrolled.
115
1162006-04-11 Richard Stallman <rms@gnu.org>
117
118 * emacs-lisp/bytecomp.el (byte-compile-file):
119 Bind enable-local-variables to :safe, and make normal-mode obey it.
120
121 * files.el (enable-local-variables): Allow value :safe.
122 (normal-mode): Doc fix.
123 (hack-local-variables): Implement enable-local-variables = :safe.
124 (hack-local-variables-confirm): Don't prevent quitting.
125
1262006-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
127
128 * loadhist.el (unload-feature): A bit of sanity check of
129 load-history entries. Cancel timer-vars before unbinding them.
130
131 * hexl.el (hexl-isearch-search-function): Fix regexp-building code to
132 quote special chars, and make the trick work on the hex part of the
133 buffer as well.
134 (hexl-mode, hexl-save-buffer, hexl-mode-exit)
135 (hexl-maybe-dehexlify-buffer): Use restore-buffer-modified-p.
136
137 * startup.el (normal-splash-screen): Fix last change so we don't wait
138 2 minutes if we don't show the splash screen.
139
1402006-04-11 Carsten Dominik <dominik@science.uva.nl>
141
142 * textmodes/org.el (org-export-plain-list-max-depth)
143 (org-table-spaces-around-separators)
144 (org-radio-targets, org-activate-camels)
145 (org-table-spaces-around-invisible-separators): Options removed.
146 (org-time-stamp-rounding-minutes, org-remember-templates)
147 (org-ellipsis, org-activate-links, org-descriptive-links):
148 New options.
149 (org-remember-apply-template, org-current-time)
150 (org-finish-edit-table-field)
151 (org-link-unescape, org-link-escape)
152 (org-string-width, org-table-clean-line, org-html-do-expand)
153 (org-edit-agenda-file-list, org-store-new-agenda-file-list)
154 (org-read-agenda-file-list): New functions.
155 (org-table-edit-field)
156 (org-table-create-or-convert-from-region): New commands
157 (org-table-toggle-vline-visibility): Command removed.
158 (org-table-convert-region): Made a command.
159 (orgtbl-deleta-backward-char,orgtbl-delete-char): Remove commands.
160 Replace with the normal org- functions.
161 (org-self-insert-command): Don't trigger realign unnecessarily
162 when blanking a field that is not full.
163 (org-mode): `Set buffer-invisibility-spec' for links.
164 (org-activate-links2): Hide link part and only show descriptive
165 part of the link.
166 (org-insert-link): Modify for new linking system.
167 (org-store-link): Store description separately, for use by
168 `org-insert-link'.
169 (org-table-align): Use `org-string-width'.
170 (defgroup): Completely new group structure for custom variables.
171 (org-agenda-files): Option: Single file name allowed. Function:
172 Optional argument unrestrited means ignore any restricitons.
173 (org-install-agenda-files-menu): Find a buffer in Org-mode before
174 trying to modify the menu. Use generalized access to
175 `org-agenda-files.'
176 (org-agenda-list, org-todo-list, org-cycle-agenda-files)
177 (org-agenda-file-to-front, org-remove-file, org-diary)
178 (org-tags-view, org-export-icalendar-all-agenda-files)
179 (org-export-icalendar-combine-agenda-files): Use generalized
180 access to `org-agenda-files'.
181 (org-remember-handler): Correctly preserve heading if present.
182 (org-table-insert-row, org-table-insert-hline): Deal with
183 invisible characters.
184
1852006-04-10 J.D. Smith <jdsmith@as.arizona.edu>
186
187 * vc.el (vc-annotate-display-mode): Made default 'fullscale.
188 (vc-annotate-color-map): New 18 element constant
189 value/saturation, rotating hue colormap, from red->blue.
190 (vc-annotate-mode-menu): "Default" -> "By Color Map Range".
191 (vc-annotate-display-select): Switch to annotate-mode elsewhere.
192 (vc-annotate): To avoid killing the required local variables,
193 set them before the end of `with-output-to-temp-buffer', and
194 after first switching to annotate-mode.
195 (vc-annotate-warp-version): Add buffer argument in goto-line to
196 ensure annotation, not source, is scrolled.
197
1982006-04-10 Bill Wohler <wohler@newt.com>
199
200 * custom.el (defcustom, custom-handle-keyword):
201 Add :package-version keyword.
202 (custom-add-package-version): New function. Sets value of new
203 property 'custom-package-version from :package-version keyword.
204 (defcustom): Create Common Keywords section in docstring.
205 (defface, defgroup): Replace definitions of a select few keywords
206 with a reference to the Common Keywords in defcustom.
207 (defcustom, defface, defgroup): Replace reference to Customization
208 chapter in manual with hyperlink.
209
210 * cus-edit.el (customize-package-emacs-version-alist):
211 New variable.
212 (customize-changed-options): Add check for custom-package-version.
213 (customize-package-emacs-version): New function to look up Emacs
214 version corresponding to the given package version.
215
216 * emacs-lisp/find-func.el (find-function-regexp): Allow dashes in
217 defun name, in similar fashion to find-variable-regexp.
218
2192006-04-10 Eli Zaretskii <eliz@gnu.org>
220
221 * international/mule-cmds.el (set-locale-environment): Fix last
222 change for when the locale's preferences don't specify any encoding.
223
2242006-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
225
226 * emacs-lisp/find-func.el (find-function-search-for-symbol): Fix regexp
227 so the defined var/fun doesn't need to be quoted.
228
2292006-04-10 Richard Stallman <rms@gnu.org>
230
231 * finder.el (finder-mode-map): Add n and p bindings.
232
2332006-04-10 Nick Roberts <nickrob@snap.net.nz>
234
235 * progmodes/gdb-ui.el (gdb-init-1): Re-initialise gdb-main-file to nil.
236 (gdb-get-version): Make it work for pre "interpreter mi" (GDB 5.3?).
237 (gdb-setup-windows): Put something in source window if we can't find
238 the source file.
239 (gdb-frame-handler): Make it work again with just assembly.
240 (gdb-data-list-register-values-handler): Make it work when there is
241 no stack.
242
2432006-04-09 Richard Stallman <rms@gnu.org>
244
245 * mail/rmail.el (rmail-mime-charset-pattern): Ignore format and delsp
246 specs while looking for charset.
247
248 * textmodes/picture.el (picture-mode-exit): Run picture-mode-exit-hook.
249
250 * play/landmark.el (lm-font-lock-face-O, lm-font-lock-face-X):
251 Make them faces.
252 (lm-font-lock-keywords): Update appropriately.
253
2542006-04-10 Kim F. Storm <storm@cua.dk>
255
256 * simple.el (filter-buffer-substring): Add NOPROPS arg, so
257 it can also replace buffer-substring-no-properties.
258
259 * emulation/cua-base.el (cua-delete-region, cua-paste)
260 (cua-repeat-replace-region): Use filter-buffer-substring.
261
262 * emulation/cua-gmrk.el (cua-copy-region-to-global-mark)
263 (cua-cut-region-to-global-mark): Likewise.
264
265 * emulation/cua-rect.el (cua--extract-rectangle)
266 (cua-incr-rectangle, cua--rectangle-aux-replace): Likewise.
267
2682006-04-09 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
269
270 * textmodes/bibtex.el (bibtex-entry-update): New optional arg
271 entry-type. Add field delimiters to numerical fields if they are
272 not present.
273
2742006-04-09 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de>
275
276 * textmodes/bibtex.el (bibtex-find-text-internal): Add new element
277 string-const to return value.
278 (bibtex-remove-delimiters): Use it.
279
12006-04-08 Stefan Monnier <monnier@iro.umontreal.ca> 2802006-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
2 281
3 * emacs-lisp/bytecomp.el (byte-compile-form): Don't call 282 * emacs-lisp/bytecomp.el (byte-compile-form): Don't call
@@ -57,12 +336,11 @@
57 (rcirc-multiline-minor-mode-map): New mode map. 336 (rcirc-multiline-minor-mode-map): New mode map.
58 (rcirc-edit-multiline): Put multiline-edit buffer in 337 (rcirc-edit-multiline): Put multiline-edit buffer in
59 rcirc-multiline-major-mode along with rcirc-multiline-minor-mode. 338 rcirc-multiline-major-mode along with rcirc-multiline-minor-mode.
60 (rcirc-print): Any line starting with an ignored nick will be 339 (rcirc-print): Ignore any line starting with an ignored nick.
61 ignored.
62 (rcirc-print): Decode using rcirc-decode-coding-system. 340 (rcirc-print): Decode using rcirc-decode-coding-system.
63 (rcirc-track-minor-mode): Update global-mode-string when disabling 341 (rcirc-track-minor-mode): Update global-mode-string when disabling
64 this mode. 342 this mode.
65 (minor-mode-alist): add LowPri indicator. 343 (minor-mode-alist): Add LowPri indicator.
66 (rcirc-toggle-low-priority): New function. 344 (rcirc-toggle-low-priority): New function.
67 (rcirc-last-non-irc-buffer): Prefix arg now no means switch to 345 (rcirc-last-non-irc-buffer): Prefix arg now no means switch to
68 next lowpriority buffer with activity. 346 next lowpriority buffer with activity.
@@ -95,8 +373,7 @@
95 373
962006-04-07 Reiner Steib <Reiner.Steib@gmx.de> 3742006-04-07 Reiner Steib <Reiner.Steib@gmx.de>
97 375
98 * pgg-gpg.el: Revert to revision 1.8 to allow the use of 376 * pgg-gpg.el: Revert to revision 1.8 to allow the use of gpg-agent.
99 gpg-agent.
100 377
1012006-04-07 Nick Roberts <nickrob@snap.net.nz> 3782006-04-07 Nick Roberts <nickrob@snap.net.nz>
102 379
@@ -109,21 +386,20 @@
109 386
110 * textmodes/paragraphs.el (sentence-end): Use string-or-null-p. 387 * textmodes/paragraphs.el (sentence-end): Use string-or-null-p.
111 388
112 * textmodes/ispell.el (ispell-local-dictionary): Use 389 * textmodes/ispell.el (ispell-local-dictionary): Use string-or-null-p.
113 string-or-null-p.
114 390
115 * files.el: Update comment about safe-local-variable declarations. 391 * files.el: Update comment about safe-local-variable declarations.
116 392
1172006-04-06 J.D. Smith <jdsmith@as.arizona.edu> 3932006-04-06 J.D. Smith <jdsmith@as.arizona.edu>
118 394
119 * progmodes/idlwave.el: Updated to IDLWAVE version 6.0. See 395 * progmodes/idlwave.el: Updated to IDLWAVE version 6.0.
120 idlwave.org. 396 See idlwave.org.
121 397
122 * progmodes/idlw-shell.el: Updated to IDLWAVE version 6.0. See 398 * progmodes/idlw-shell.el: Updated to IDLWAVE version 6.0.
123 idlwave.org. Includes code to obsolete idlw-rinfo.el. 399 See idlwave.org. Includes code to obsolete idlw-rinfo.el.
124 400
125 * progmodes/idlw-help.el: Updated to IDLWAVE version 6.0. See 401 * progmodes/idlw-help.el: Updated to IDLWAVE version 6.0.
126 idlwave.org. 402 See idlwave.org.
127 403
128 * progmodes/idlw-complete-structtag.el: Updated to IDLWAVE 404 * progmodes/idlw-complete-structtag.el: Updated to IDLWAVE
129 version 6.0 (minimal changes). See idlwave.org. 405 version 6.0 (minimal changes). See idlwave.org.
@@ -194,8 +470,8 @@
194 470
1952006-04-05 Daiki Ueno <ueno@unixuser.org> 4712006-04-05 Daiki Ueno <ueno@unixuser.org>
196 472
197 * pgg-gpg.el (pgg-gpg-encrypt-region, pgg-gpg-sign-region): Wait 473 * pgg-gpg.el (pgg-gpg-encrypt-region, pgg-gpg-sign-region):
198 for BEGIN_SIGNING too, new in GnuPG 1.4.3. 474 Wait for BEGIN_SIGNING too, new in GnuPG 1.4.3.
199 475
2002006-04-05 Kenichi Handa <handa@m17n.org> 4762006-04-05 Kenichi Handa <handa@m17n.org>
201 477
@@ -208,8 +484,7 @@
208 default-enable-multibyte-characters. This reverts the change from 484 default-enable-multibyte-characters. This reverts the change from
209 revision 6.17 which is no longer necessary because the passphrase 485 revision 6.17 which is no longer necessary because the passphrase
210 is sent separately now. GnuPG messages are unreadable under 486 is sent separately now. GnuPG messages are unreadable under
211 multibyte locales with default-enable-multibyte-characters set to 487 multibyte locales with default-enable-multibyte-characters set to nil.
212 nil.
213 488
2142006-04-04 Andreas Schwab <schwab@suse.de> 4892006-04-04 Andreas Schwab <schwab@suse.de>
215 490
diff --git a/lisp/allout.el b/lisp/allout.el
index 31ed3a791ea..66c4b8681db 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -666,6 +666,7 @@ the layout used for the allout.el source file.)
666`allout-layout' can additionally have the value `t', in which 666`allout-layout' can additionally have the value `t', in which
667case the value of `allout-default-layout' is used.") 667case the value of `allout-default-layout' is used.")
668(make-variable-buffer-local 'allout-layout) 668(make-variable-buffer-local 'allout-layout)
669;;;###autoload
669(put 'allout-layout 'safe-local-variable t) 670(put 'allout-layout 'safe-local-variable t)
670 671
671;;;_ : Topic header format 672;;;_ : Topic header format
diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el
index bce30a1de20..36934783b93 100644
--- a/lisp/calendar/appt.el
+++ b/lisp/calendar/appt.el
@@ -498,11 +498,11 @@ The time should be in either 24 hour format or am/pm format."
498 (interactive "sTime (hh:mm[am/pm]): \nsMessage: ") 498 (interactive "sTime (hh:mm[am/pm]): \nsMessage: ")
499 (unless (string-match appt-time-regexp new-appt-time) 499 (unless (string-match appt-time-regexp new-appt-time)
500 (error "Unacceptable time-string")) 500 (error "Unacceptable time-string"))
501 (let* ((appt-time-string (concat new-appt-time " " new-appt-msg)) 501 (let ((time-msg (list (list (appt-convert-time new-appt-time))
502 (appt-time (list (appt-convert-time new-appt-time))) 502 (concat new-appt-time " " new-appt-msg) t)))
503 (time-msg (list appt-time appt-time-string t))) 503 (unless (member time-msg appt-time-msg-list)
504 (setq appt-time-msg-list (nconc appt-time-msg-list (list time-msg))) 504 (setq appt-time-msg-list
505 (setq appt-time-msg-list (appt-sort-list appt-time-msg-list)))) 505 (appt-sort-list (nconc appt-time-msg-list (list time-msg)))))))
506 506
507;;;###autoload 507;;;###autoload
508(defun appt-delete () 508(defun appt-delete ()
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index e2275ce356d..e68d2eab293 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -786,7 +786,7 @@ when the action is chosen.")
786 (if (or (and (= 1 (length children)) 786 (if (or (and (= 1 (length children))
787 (memq (widget-type (car children)) 787 (memq (widget-type (car children))
788 '(custom-variable custom-face))) 788 '(custom-variable custom-face)))
789 (y-or-n-p "Reset all settings' buffer text to show current values? ")) 789 (y-or-n-p "Reset all settings' buffer text to show current values? "))
790 (mapc (lambda (widget) 790 (mapc (lambda (widget)
791 (if (memq (widget-get widget :custom-state) 791 (if (memq (widget-get widget :custom-state)
792 '(modified changed)) 792 '(modified changed))
@@ -1079,6 +1079,33 @@ Show the buffer in another window, but don't select it."
1079(defvar customize-changed-options-previous-release "21.1" 1079(defvar customize-changed-options-previous-release "21.1"
1080 "Version for `customize-changed-options' to refer back to by default.") 1080 "Version for `customize-changed-options' to refer back to by default.")
1081 1081
1082;; Packages will update this variable, so make it available.
1083;;;###autoload
1084(defvar customize-package-emacs-version-alist nil
1085 "Alist mapping versions of Emacs to versions of a package.
1086These package versions are listed in the :package-version
1087keyword used in `defcustom', `defgroup', and `defface'. Its
1088elements look like this:
1089
1090 (PACKAGE (PVERSION . EVERSION)...)
1091
1092For each PACKAGE, which is a symbol, there are one or more
1093elements that contain a package version PVERSION with an
1094associated Emacs version EVERSION. These versions are strings.
1095For example, the MH-E package updates this alist with the
1096following:
1097
1098 (add-to-list 'customize-package-emacs-version-alist
1099 '(MH-E (\"6.0\" . \"22.1\") (\"6.1\" . \"22.1\")
1100 (\"7.0\" . \"22.1\") (\"7.1\" . \"22.1\")
1101 (\"7.2\" . \"22.1\") (\"7.3\" . \"22.1\")
1102 (\"7.4\" . \"22.1\") (\"8.0\" . \"22.1\")))
1103
1104The value of PACKAGE needs to be unique and it needs to match the
1105PACKAGE value appearing in the :package-version keyword. Since
1106the user might see the value in a error message, a good choice is
1107the official name of the package, such as MH-E or Gnus.")
1108
1082;;;###autoload 1109;;;###autoload
1083(defalias 'customize-changed 'customize-changed-options) 1110(defalias 'customize-changed 'customize-changed-options)
1084 1111
@@ -1119,7 +1146,12 @@ that were added or redefined since that version."
1119 (let (found) 1146 (let (found)
1120 (mapatoms 1147 (mapatoms
1121 (lambda (symbol) 1148 (lambda (symbol)
1122 (let ((version (get symbol 'custom-version))) 1149 (let* ((package-version (get symbol 'custom-package-version))
1150 (version
1151 (or (and package-version
1152 (customize-package-emacs-version symbol
1153 package-version))
1154 (get symbol 'custom-version))))
1123 (if version 1155 (if version
1124 (when (customize-version-lessp since-version version) 1156 (when (customize-version-lessp since-version version)
1125 (if (or (get symbol 'custom-group) 1157 (if (or (get symbol 'custom-group)
@@ -1135,6 +1167,32 @@ that were added or redefined since that version."
1135 (error "No user option defaults have been changed since Emacs %s" 1167 (error "No user option defaults have been changed since Emacs %s"
1136 since-version)))) 1168 since-version))))
1137 1169
1170(defun customize-package-emacs-version (symbol package-version)
1171 "Return Emacs version of SYMBOL.
1172PACKAGE-VERSION has the form (PACKAGE . VERSION). The VERSION of
1173PACKAGE is looked up in the associated list
1174`customize-package-emacs-version-alist' to find the version of
1175Emacs that is associated with it."
1176 (let (package-versions emacs-version)
1177 ;; Use message instead of error since we want user to be able to
1178 ;; see the rest of the symbols even if a package author has
1179 ;; botched things up.
1180 (cond ((not (listp package-version))
1181 (message "Invalid package-version value for %s" symbol))
1182 ((setq package-versions (assq (car package-version)
1183 customize-package-emacs-version-alist))
1184 (setq emacs-version
1185 (cdr (assoc (cdr package-version) package-versions)))
1186 (unless emacs-version
1187 (message "%s version %s not found in %s" symbol
1188 (cdr package-version)
1189 "customize-package-emacs-version-alist")))
1190 (t
1191 (message "Package %s neglected to update %s"
1192 (car package-version)
1193 "customize-package-emacs-version-alist")))
1194 emacs-version))
1195
1138(defun customize-version-lessp (version1 version2) 1196(defun customize-version-lessp (version1 version2)
1139 ;; Why are the versions strings, and given that they are, why aren't 1197 ;; Why are the versions strings, and given that they are, why aren't
1140 ;; they converted to numbers and compared as such here? -- fx 1198 ;; they converted to numbers and compared as such here? -- fx
diff --git a/lisp/custom.el b/lisp/custom.el
index c67f3b06272..2ac1e23ac49 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -203,8 +203,27 @@ The following keywords are meaningful:
203 203
204:type VALUE should be a widget type for editing the symbol's value. 204:type VALUE should be a widget type for editing the symbol's value.
205:options VALUE should be a list of valid members of the widget type. 205:options VALUE should be a list of valid members of the widget type.
206:initialize
207 VALUE should be a function used to initialize the
208 variable. It takes two arguments, the symbol and value
209 given in the `defcustom' call. The default is
210 `custom-initialize-reset'.
211:set VALUE should be a function to set the value of the symbol.
212 It takes two arguments, the symbol to set and the value to
213 give it. The default choice of function is `custom-set-default'.
214:get VALUE should be a function to extract the value of symbol.
215 The function takes one argument, a symbol, and should return
216 the current value for that symbol. The default choice of function
217 is `custom-default-value'.
218:require
219 VALUE should be a feature symbol. If you save a value
220 for this option, then when your `.emacs' file loads the value,
221 it does (require VALUE) first.
222
223The following common keywords are also meaningful.
224
206:group VALUE should be a customization group. 225:group VALUE should be a customization group.
207 Add SYMBOL to that group. 226 Add SYMBOL (or FACE with `defface') to that group.
208:link LINK-DATA 227:link LINK-DATA
209 Include an external link after the documentation string for this 228 Include an external link after the documentation string for this
210 item. This is a sentence containing an active field which 229 item. This is a sentence containing an active field which
@@ -248,26 +267,19 @@ The following keywords are meaningful:
248 267
249 An item can have more than one external link; however, most items 268 An item can have more than one external link; however, most items
250 have none at all. 269 have none at all.
251:initialize
252 VALUE should be a function used to initialize the
253 variable. It takes two arguments, the symbol and value
254 given in the `defcustom' call. The default is
255 `custom-initialize-reset'.
256:set VALUE should be a function to set the value of the symbol.
257 It takes two arguments, the symbol to set and the value to
258 give it. The default choice of function is `custom-set-default'.
259:get VALUE should be a function to extract the value of symbol.
260 The function takes one argument, a symbol, and should return
261 the current value for that symbol. The default choice of function
262 is `custom-default-value'.
263:require
264 VALUE should be a feature symbol. If you save a value
265 for this option, then when your `.emacs' file loads the value,
266 it does (require VALUE) first.
267:version 270:version
268 VALUE should be a string specifying that the variable was 271 VALUE should be a string specifying that the variable was
269 first introduced, or its default value was changed, in Emacs 272 first introduced, or its default value was changed, in Emacs
270 version VERSION. 273 version VERSION.
274:package-version
275 VALUE should be a list with the form (PACKAGE . VERSION)
276 specifying that the variable was first introduced, or its
277 default value was changed, in PACKAGE version VERSION. This
278 keyword takes priority over :version. The PACKAGE and VERSION
279 must appear in the alist `customize-package-emacs-version-alist'.
280 Since PACKAGE must be unique and the user might see it in an
281 error message, a good choice is the official name of the
282 package, such as MH-E or Gnus.
271:tag LABEL 283:tag LABEL
272 Use LABEL, a string, instead of the item's name, to label the item 284 Use LABEL, a string, instead of the item's name, to label the item
273 in customization menus and buffers. 285 in customization menus and buffers.
@@ -286,8 +298,8 @@ to load a file defining variables with this form, or with
286_outside_ any bindings for these variables. \(`defvar' and 298_outside_ any bindings for these variables. \(`defvar' and
287`defconst' behave similarly in this respect.) 299`defconst' behave similarly in this respect.)
288 300
289Read the section about customization in the Emacs Lisp manual for more 301See Info node `(elisp) Customization' in the Emacs Lisp manual
290information." 302for more information."
291 (declare (doc-string 3)) 303 (declare (doc-string 3))
292 ;; It is better not to use backquote in this file, 304 ;; It is better not to use backquote in this file,
293 ;; because that makes a bootstrapping problem 305 ;; because that makes a bootstrapping problem
@@ -314,10 +326,8 @@ The remaining arguments should have the form
314 326
315 [KEYWORD VALUE]... 327 [KEYWORD VALUE]...
316 328
317The following KEYWORDs are defined: 329For a list of valid keywords, see the common keywords listed in
318 330`defcustom'.
319:group VALUE should be a customization group.
320 Add FACE to that group.
321 331
322SPEC should be an alist of the form ((DISPLAY ATTS)...). 332SPEC should be an alist of the form ((DISPLAY ATTS)...).
323 333
@@ -368,8 +378,8 @@ corresponding ITEMs. These are the defined REQ values:
368 the function `display-supports-face-attributes-p' for more 378 the function `display-supports-face-attributes-p' for more
369 information on exactly how testing is done. 379 information on exactly how testing is done.
370 380
371Read the section about customization in the Emacs Lisp manual for more 381See Info node `(elisp) Customization' in the Emacs Lisp manual
372information." 382for more information."
373 (declare (doc-string 3)) 383 (declare (doc-string 3))
374 ;; It is better not to use backquote in this file, 384 ;; It is better not to use backquote in this file,
375 ;; because that makes a bootstrapping problem 385 ;; because that makes a bootstrapping problem
@@ -426,16 +436,11 @@ The remaining arguments should have the form
426 436
427 [KEYWORD VALUE]... 437 [KEYWORD VALUE]...
428 438
429The following KEYWORDs are defined: 439For a list of valid keywords, see the common keywords listed in
430 440`defcustom'.
431:group VALUE should be a customization group.
432 Add SYMBOL to that group.
433 441
434:version VALUE should be a string specifying that the group was introduced 442See Info node `(elisp) Customization' in the Emacs Lisp manual
435 in Emacs version VERSION. 443for more information."
436
437Read the section about customization in the Emacs Lisp manual for more
438information."
439 (declare (doc-string 3)) 444 (declare (doc-string 3))
440 ;; It is better not to use backquote in this file, 445 ;; It is better not to use backquote in this file,
441 ;; because that makes a bootstrapping problem 446 ;; because that makes a bootstrapping problem
@@ -489,6 +494,8 @@ Fourth argument TYPE is the custom option type."
489 (custom-add-to-group value symbol type)) 494 (custom-add-to-group value symbol type))
490 ((eq keyword :version) 495 ((eq keyword :version)
491 (custom-add-version symbol value)) 496 (custom-add-version symbol value))
497 ((eq keyword :package-version)
498 (custom-add-package-version symbol value))
492 ((eq keyword :link) 499 ((eq keyword :link)
493 (custom-add-link symbol value)) 500 (custom-add-link symbol value))
494 ((eq keyword :load) 501 ((eq keyword :load)
@@ -540,6 +547,10 @@ For other custom types, this has no effect."
540 "To the custom option SYMBOL add the version VERSION." 547 "To the custom option SYMBOL add the version VERSION."
541 (put symbol 'custom-version (purecopy version))) 548 (put symbol 'custom-version (purecopy version)))
542 549
550(defun custom-add-package-version (symbol version)
551 "To the custom option SYMBOL add the package version VERSION."
552 (put symbol 'custom-package-version (purecopy version)))
553
543(defun custom-add-load (symbol load) 554(defun custom-add-load (symbol load)
544 "To the custom option SYMBOL add the dependency LOAD. 555 "To the custom option SYMBOL add the dependency LOAD.
545LOAD should be either a library file name, or a feature name." 556LOAD should be either a library file name, or a feature name."
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index f87300e8666..9c363a52627 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1650,8 +1650,12 @@ The value is non-nil if there were no errors, nil if errors."
1650 ;; If they change the file name, then change it for the output also. 1650 ;; If they change the file name, then change it for the output also.
1651 (let ((buffer-file-name filename) 1651 (let ((buffer-file-name filename)
1652 (default-major-mode 'emacs-lisp-mode) 1652 (default-major-mode 'emacs-lisp-mode)
1653 ;; Ignore unsafe local variables.
1654 ;; We only care about a few of them for our purposes.
1655 (enable-local-variables :safe)
1653 (enable-local-eval nil)) 1656 (enable-local-eval nil))
1654 (normal-mode) 1657 ;; Arg of t means don't alter enable-local-variables.
1658 (normal-mode t)
1655 (setq filename buffer-file-name)) 1659 (setq filename buffer-file-name))
1656 ;; Set the default directory, in case an eval-when-compile uses it. 1660 ;; Set the default directory, in case an eval-when-compile uses it.
1657 (setq default-directory (file-name-directory filename))) 1661 (setq default-directory (file-name-directory filename)))
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 444c310920d..d0be3a02f65 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -258,6 +258,20 @@ Both SYMBOL and SPEC are unevaluated. The SPEC can be 0, t, a symbol
258 edebug-form-spec 258 edebug-form-spec
259 )) 259 ))
260 260
261;;;###autoload
262(defun edebug-basic-spec (spec)
263 "Return t if SPEC uses only extant spec symbols.
264An extant spec symbol is a symbol that is not a function and has a
265`edebug-form-spec' property."
266 (cond ((listp spec)
267 (catch 'basic
268 (while spec
269 (unless (edebug-basic-spec (car spec)) (throw 'basic nil))
270 (setq spec (cdr spec)))
271 t))
272 ((symbolp spec)
273 (unless (functionp spec) (get spec 'edebug-form-spec)))))
274
261;;; Utilities 275;;; Utilities
262 276
263;; Define edebug-gensym - from old cl.el 277;; Define edebug-gensym - from old cl.el
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 4f961df0791..5d504586323 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -64,7 +64,7 @@
64 (concat 64 (concat
65 "^\\s-*(\\(def\\(ine-skeleton\\|ine-generic-mode\\|ine-derived-mode\\|\ 65 "^\\s-*(\\(def\\(ine-skeleton\\|ine-generic-mode\\|ine-derived-mode\\|\
66ine\\(?:-global\\)?-minor-mode\\|ine-compilation-mode\\|un-cvs-mode\\|\ 66ine\\(?:-global\\)?-minor-mode\\|ine-compilation-mode\\|un-cvs-mode\\|\
67foo\\|[^cfgv]\\w+\\*?\\)\\|easy-mmode-define-[a-z-]+\\|easy-menu-define\\|\ 67foo\\|[^cfgv]\\(\\w\\|\\s_\\)+\\*?\\)\\|easy-mmode-define-[a-z-]+\\|easy-menu-define\\|\
68menu-bar-make-toggle\\)" 68menu-bar-make-toggle\\)"
69 find-function-space-re 69 find-function-space-re
70 "\\('\\|\(quote \\)?%s\\(\\s-\\|$\\|\(\\|\)\\)") 70 "\\('\\|\(quote \\)?%s\\(\\s-\\|$\\|\(\\|\)\\)")
@@ -228,8 +228,16 @@ The search is done in the source for library LIBRARY."
228 (with-syntax-table emacs-lisp-mode-syntax-table 228 (with-syntax-table emacs-lisp-mode-syntax-table
229 (goto-char (point-min)) 229 (goto-char (point-min))
230 (if (or (re-search-forward regexp nil t) 230 (if (or (re-search-forward regexp nil t)
231 ;; `regexp' matches definitions using known forms like
232 ;; `defun', or `defvar'. But some functions/variables
233 ;; are defined using special macros (or functions), so
234 ;; if `regexp' can't find the definition, we look for
235 ;; something of the form "(SOMETHING <symbol> ...)".
236 ;; This fails to distinguish function definitions from
237 ;; variable declarations (or even uses thereof), but is
238 ;; a good pragmatic fallback.
231 (re-search-forward 239 (re-search-forward
232 (concat "^([^ ]+" find-function-space-re "['(]" 240 (concat "^([^ ]+" find-function-space-re "['(]?"
233 (regexp-quote (symbol-name symbol)) 241 (regexp-quote (symbol-name symbol))
234 "\\_>") 242 "\\_>")
235 nil t)) 243 nil t))
diff --git a/lisp/emacs-lisp/tq.el b/lisp/emacs-lisp/tq.el
index a4a22806d09..2126d7663fc 100644
--- a/lisp/emacs-lisp/tq.el
+++ b/lisp/emacs-lisp/tq.el
@@ -27,18 +27,56 @@
27 27
28;;; Commentary: 28;;; Commentary:
29 29
30;; manages receiving a stream asynchronously, 30;; This file manages receiving a stream asynchronously, parsing it
31;; parsing it into transactions, and then calling 31;; into transactions, and then calling the associated handler function
32;; handler functions 32;; upon the completion of each transaction.
33 33
34;; Our basic structure is the queue/process/buffer triple. Each entry 34;; Our basic structure is the queue/process/buffer triple. Each entry
35;; of the queue is a regexp/closure/function triple. We buffer 35;; of the queue part is a list of question, regexp, closure, and
36;; bytes from the process until we see the regexp at the head of the 36;; function that is consed to the last element.
37;; queue. Then we call the function with the closure and the 37
38;; collected bytes. 38;; A transaction queue may be created by calling `tq-create'.
39
40;; A request may be added to the queue by calling `tq-enqueue'. If
41;; the `delay-question' argument is non-nil, we will wait to send the
42;; question to the process until it has finished sending other input.
43;; Otherwise, once a request is enqueued, we send the given question
44;; immediately to the process.
45
46;; We then buffer bytes from the process until we see the regexp that
47;; was provided in the call to `tq-enqueue'. Then we call the
48;; provided function with the closure and the collected bytes. If we
49;; have indicated that the question from the next transaction was not
50;; sent immediately, send it at this point, awaiting the response.
39 51
40;;; Code: 52;;; Code:
41 53
54;;; Accessors
55
56;; This part looks like (queue . (process . buffer))
57(defun tq-queue (tq) (car tq))
58(defun tq-process (tq) (car (cdr tq)))
59(defun tq-buffer (tq) (cdr (cdr tq)))
60
61;; The structure of `queue' is as follows
62;; ((question regexp closure . fn)
63;; <other queue entries>)
64;; question: string to send to the process
65(defun tq-queue-head-question (tq) (car (car (tq-queue tq))))
66;; regexp: regular expression that matches the end of a response from
67;; the process
68(defun tq-queue-head-regexp (tq) (car (cdr (car (tq-queue tq)))))
69;; closure: additional data to pass to function
70(defun tq-queue-head-closure (tq) (car (cdr (cdr (car (tq-queue tq))))))
71;; fn: function to call upon receiving a complete response from the
72;; process
73(defun tq-queue-head-fn (tq) (cdr (cdr (cdr (car (tq-queue tq))))))
74
75;; Determine whether queue is empty
76(defun tq-queue-empty (tq) (not (tq-queue tq)))
77
78;;; Core functionality
79
42;;;###autoload 80;;;###autoload
43(defun tq-create (process) 81(defun tq-create (process)
44 "Create and return a transaction queue communicating with PROCESS. 82 "Create and return a transaction queue communicating with PROCESS.
@@ -54,33 +92,37 @@ to a tcp server on another machine."
54 (tq-filter ',tq string))) 92 (tq-filter ',tq string)))
55 tq)) 93 tq))
56 94
57;;; accessors 95(defun tq-queue-add (tq question re closure fn)
58(defun tq-queue (tq) (car tq))
59(defun tq-process (tq) (car (cdr tq)))
60(defun tq-buffer (tq) (cdr (cdr tq)))
61
62(defun tq-queue-add (tq re closure fn)
63 (setcar tq (nconc (tq-queue tq) 96 (setcar tq (nconc (tq-queue tq)
64 (cons (cons re (cons closure fn)) nil))) 97 (cons (cons question (cons re (cons closure fn))) nil)))
65 'ok) 98 'ok)
66 99
67(defun tq-queue-head-regexp (tq) (car (car (tq-queue tq)))) 100(defun tq-queue-pop (tq)
68(defun tq-queue-head-fn (tq) (cdr (cdr (car (tq-queue tq))))) 101 (setcar tq (cdr (car tq)))
69(defun tq-queue-head-closure (tq) (car (cdr (car (tq-queue tq))))) 102 (let ((question (tq-queue-head-question tq)))
70(defun tq-queue-empty (tq) (not (tq-queue tq))) 103 (when question
71(defun tq-queue-pop (tq) (setcar tq (cdr (car tq))) (null (car tq))) 104 (process-send-string (tq-process tq) question)))
105 (null (car tq)))
72 106
73 107(defun tq-enqueue (tq question regexp closure fn &optional delay-question)
74;;; must add to queue before sending!
75(defun tq-enqueue (tq question regexp closure fn)
76 "Add a transaction to transaction queue TQ. 108 "Add a transaction to transaction queue TQ.
77This sends the string QUESTION to the process that TQ communicates with. 109This sends the string QUESTION to the process that TQ communicates with.
78When the corresponding answer comes back, we call FN 110
79with two arguments: CLOSURE, and the answer to the question. 111When the corresponding answer comes back, we call FN with two
112arguments: CLOSURE, which may contain additional data that FN
113needs, and the answer to the question.
114
80REGEXP is a regular expression to match the entire answer; 115REGEXP is a regular expression to match the entire answer;
81that's how we tell where the answer ends." 116that's how we tell where the answer ends.
82 (tq-queue-add tq regexp closure fn) 117
83 (process-send-string (tq-process tq) question)) 118If DELAY-QUESTION is non-nil, delay sending this question until
119the process has finished replying to any previous questions.
120This produces more reliable results with some processes."
121 (let ((sendp (or (not delay-question)
122 (not (tq-queue-head-question tq)))))
123 (tq-queue-add tq (unless sendp question) regexp closure fn)
124 (when sendp
125 (process-send-string (tq-process tq) question))))
84 126
85(defun tq-close (tq) 127(defun tq-close (tq)
86 "Shut down transaction queue TQ, terminating the process." 128 "Shut down transaction queue TQ, terminating the process."
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index e7888dbdb0e..2d169e889cd 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -769,7 +769,7 @@ Save a copy in register 0 if `cua-delete-copy-to-register-0' is non-nil."
769 (let ((start (mark)) (end (point))) 769 (let ((start (mark)) (end (point)))
770 (or (<= start end) 770 (or (<= start end)
771 (setq start (prog1 end (setq end start)))) 771 (setq start (prog1 end (setq end start))))
772 (setq cua--last-deleted-region-text (buffer-substring start end)) 772 (setq cua--last-deleted-region-text (filter-buffer-substring start end))
773 (if cua-delete-copy-to-register-0 773 (if cua-delete-copy-to-register-0
774 (set-register ?0 cua--last-deleted-region-text)) 774 (set-register ?0 cua--last-deleted-region-text))
775 (delete-region start end) 775 (delete-region start end)
@@ -858,7 +858,7 @@ If global mark is active, copy from register or one character."
858 (if regtxt 858 (if regtxt
859 (cua--insert-at-global-mark regtxt) 859 (cua--insert-at-global-mark regtxt)
860 (when (not (eobp)) 860 (when (not (eobp))
861 (cua--insert-at-global-mark (buffer-substring (point) (+ (point) count))) 861 (cua--insert-at-global-mark (filter-buffer-substring (point) (+ (point) count)))
862 (forward-char count)))) 862 (forward-char count))))
863 (buffer-read-only 863 (buffer-read-only
864 (message "Cannot paste into a read-only buffer")) 864 (message "Cannot paste into a read-only buffer"))
@@ -875,7 +875,7 @@ If global mark is active, copy from register or one character."
875 (setq paste-lines (cua--delete-rectangle)) 875 (setq paste-lines (cua--delete-rectangle))
876 (if (= paste-lines 1) 876 (if (= paste-lines 1)
877 (setq paste-lines nil))) ;; paste all 877 (setq paste-lines nil))) ;; paste all
878 (if (string= (buffer-substring (point) (mark)) 878 (if (string= (filter-buffer-substring (point) (mark))
879 (car kill-ring)) 879 (car kill-ring))
880 (current-kill 1)) 880 (current-kill 1))
881 (cua-delete-region))) 881 (cua-delete-region)))
@@ -950,7 +950,7 @@ of text."
950 (setq s (car u) e (cdr u))))))) 950 (setq s (car u) e (cdr u)))))))
951 (setq cua--repeat-replace-text 951 (setq cua--repeat-replace-text
952 (cond ((and s e (<= s e) (= s (mark t))) 952 (cond ((and s e (<= s e) (= s (mark t)))
953 (buffer-substring-no-properties s e)) 953 (filter-buffer-substring s e nil t))
954 ((and (null s) (eq u elt)) ;; nothing inserted 954 ((and (null s) (eq u elt)) ;; nothing inserted
955 "") 955 "")
956 (t 956 (t
diff --git a/lisp/emulation/cua-gmrk.el b/lisp/emulation/cua-gmrk.el
index c3e6727ab65..842ee9ce0e3 100644
--- a/lisp/emulation/cua-gmrk.el
+++ b/lisp/emulation/cua-gmrk.el
@@ -143,7 +143,7 @@ With prefix argument, don't jump to global mark when cancelling it."
143 (let ((src-buf (current-buffer))) 143 (let ((src-buf (current-buffer)))
144 (save-excursion 144 (save-excursion
145 (if (equal (marker-buffer cua--global-mark-marker) src-buf) 145 (if (equal (marker-buffer cua--global-mark-marker) src-buf)
146 (let ((text (buffer-substring-no-properties start end))) 146 (let ((text (filter-buffer-substring start end nil t)))
147 (goto-char (marker-position cua--global-mark-marker)) 147 (goto-char (marker-position cua--global-mark-marker))
148 (insert text)) 148 (insert text))
149 (set-buffer (marker-buffer cua--global-mark-marker)) 149 (set-buffer (marker-buffer cua--global-mark-marker))
@@ -167,7 +167,7 @@ With prefix argument, don't jump to global mark when cancelling it."
167 (if (and (< start (marker-position cua--global-mark-marker)) 167 (if (and (< start (marker-position cua--global-mark-marker))
168 (< (marker-position cua--global-mark-marker) end)) 168 (< (marker-position cua--global-mark-marker) end))
169 (message "Can't move region into itself") 169 (message "Can't move region into itself")
170 (let ((text (buffer-substring-no-properties start end)) 170 (let ((text (filter-buffer-substring start end nil t))
171 (p1 (copy-marker start)) 171 (p1 (copy-marker start))
172 (p2 (copy-marker end))) 172 (p2 (copy-marker end)))
173 (goto-char (marker-position cua--global-mark-marker)) 173 (goto-char (marker-position cua--global-mark-marker))
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index 53056d667fb..43a66fd0e3e 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -631,7 +631,7 @@ If command is repeated at same position, delete the rectangle."
631 (if (not (cua--rectangle-virtual-edges)) 631 (if (not (cua--rectangle-virtual-edges))
632 (cua--rectangle-operation nil nil nil nil nil ; do not tabify 632 (cua--rectangle-operation nil nil nil nil nil ; do not tabify
633 '(lambda (s e l r) 633 '(lambda (s e l r)
634 (setq rect (cons (buffer-substring-no-properties s e) rect)))) 634 (setq rect (cons (filter-buffer-substring s e nil t) rect))))
635 (cua--rectangle-operation nil 1 nil nil nil ; do not tabify 635 (cua--rectangle-operation nil 1 nil nil nil ; do not tabify
636 '(lambda (s e l r v) 636 '(lambda (s e l r v)
637 (let ((copy t) (bs 0) (as 0) row) 637 (let ((copy t) (bs 0) (as 0) row)
@@ -649,7 +649,7 @@ If command is repeated at same position, delete the rectangle."
649 (setq as (- r (max (current-column) l)) 649 (setq as (- r (max (current-column) l))
650 e (point))) 650 e (point)))
651 (setq row (if (and copy (> e s)) 651 (setq row (if (and copy (> e s))
652 (buffer-substring-no-properties s e) 652 (filter-buffer-substring s e nil t)
653 "")) 653 ""))
654 (when (> bs 0) 654 (when (> bs 0)
655 (setq row (concat (make-string bs ?\s) row))) 655 (setq row (concat (make-string bs ?\s) row)))
@@ -1127,12 +1127,12 @@ The length of STRING need not be the same as the rectangle width."
1127 '(lambda (s e l r) 1127 '(lambda (s e l r)
1128 (cond 1128 (cond
1129 ((re-search-forward "0x\\([0-9a-fA-F]+\\)" e t) 1129 ((re-search-forward "0x\\([0-9a-fA-F]+\\)" e t)
1130 (let* ((txt (buffer-substring-no-properties (match-beginning 1) (match-end 1))) 1130 (let* ((txt (filter-buffer-substring (match-beginning 1) (match-end 1) nil t))
1131 (n (string-to-number txt 16)) 1131 (n (string-to-number txt 16))
1132 (fmt (format "0x%%0%dx" (length txt)))) 1132 (fmt (format "0x%%0%dx" (length txt))))
1133 (replace-match (format fmt (+ n increment))))) 1133 (replace-match (format fmt (+ n increment)))))
1134 ((re-search-forward "\\( *-?[0-9]+\\)" e t) 1134 ((re-search-forward "\\( *-?[0-9]+\\)" e t)
1135 (let* ((txt (buffer-substring-no-properties (match-beginning 1) (match-end 1))) 1135 (let* ((txt (filter-buffer-substring (match-beginning 1) (match-end 1) nil t))
1136 (prefix (if (= (aref txt 0) ?0) "0" "")) 1136 (prefix (if (= (aref txt 0) ?0) "0" ""))
1137 (n (string-to-number txt 10)) 1137 (n (string-to-number txt 10))
1138 (fmt (format "%%%s%dd" prefix (length txt)))) 1138 (fmt (format "%%%s%dd" prefix (length txt))))
@@ -1213,7 +1213,7 @@ The numbers are formatted according to the FORMAT string."
1213 (when replace 1213 (when replace
1214 (goto-char (point-min)) 1214 (goto-char (point-min))
1215 (while (not (eobp)) 1215 (while (not (eobp))
1216 (setq z (cons (buffer-substring (point) (line-end-position)) z)) 1216 (setq z (cons (filter-buffer-substring (point) (line-end-position)) z))
1217 (forward-line 1)))) 1217 (forward-line 1))))
1218 (if (not cua--debug) 1218 (if (not cua--debug)
1219 (kill-buffer auxbuf)) 1219 (kill-buffer auxbuf))
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 67799d73049..49b274b5149 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,23 @@
12006-04-05 Diane Murray <disumu@x3y2z1.net>
2
3 * erc.el (erc-cmd-SV): Removed the exclamation point. Show the
4 build date as it's shown in `emacs-version'.
5
6 * erc-capab.el (erc-capab-identify-add-prefix): Insert the prefix
7 with the same face property as the previous character.
8
92006-04-02 Michael Olson <mwolson@gnu.org>
10
11 * erc-backend.el, erc-ezbounce.el, erc-join.el, erc-netsplit.el,
12 erc.el: Make sure to include a newline inside of negated classes,
13 so that a newline is not matched.
14
152006-04-01 Michael Olson <mwolson@gnu.org>
16
17 * erc-backend.el (erc-server-connect-function): Don't try to
18 detect the existence of the `open-network-stream-nowait' function,
19 since I can't find it in Emacs21, XEmacs21, or Emacs22.
20
12006-03-26 Michael Olson <mwolson@gnu.org> 212006-03-26 Michael Olson <mwolson@gnu.org>
2 22
3 * erc.el (erc-header-line): New face that will be used to colorize 23 * erc.el (erc-header-line): New face that will be used to colorize
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index a99af9dea64..3ea0f74eed7 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -312,13 +312,7 @@ alist."
312 :type '(repeat (cons (string :tag "Target") 312 :type '(repeat (cons (string :tag "Target")
313 coding-system))) 313 coding-system)))
314 314
315(defcustom erc-server-connect-function 315(defcustom erc-server-connect-function 'open-network-stream
316 (if (and (fboundp 'open-network-stream-nowait)
317 ;; CVS Emacs claims to define open-network-stream-nowait on
318 ;; windows, however, it does, in fact, not work.
319 (not (memq system-type '(windows-nt cygwin ms-dos darwin))))
320 'open-network-stream-nowait
321 'open-network-stream)
322 "Function used to initiate a connection. 316 "Function used to initiate a connection.
323It should take same arguments as `open-network-stream' does." 317It should take same arguments as `open-network-stream' does."
324 :group 'erc-server 318 :group 'erc-server
@@ -762,10 +756,10 @@ PROCs `process-buffer' is `current-buffer' when this function is called."
762 (substring string 1 posn))) 756 (substring string 1 posn)))
763 757
764 (setf (erc-response.command msg) 758 (setf (erc-response.command msg)
765 (let* ((bposn (string-match "[^ ]" string posn)) 759 (let* ((bposn (string-match "[^ \n]" string posn))
766 (eposn (string-match " " string bposn))) 760 (eposn (string-match " " string bposn)))
767 (setq posn (and eposn 761 (setq posn (and eposn
768 (string-match "[^ ]" string eposn))) 762 (string-match "[^ \n]" string eposn)))
769 (substring string bposn eposn))) 763 (substring string bposn eposn)))
770 764
771 (while (and posn 765 (while (and posn
@@ -773,7 +767,7 @@ PROCs `process-buffer' is `current-buffer' when this function is called."
773 (push (let* ((bposn posn) 767 (push (let* ((bposn posn)
774 (eposn (string-match " " string bposn))) 768 (eposn (string-match " " string bposn)))
775 (setq posn (and eposn 769 (setq posn (and eposn
776 (string-match "[^ ]" string eposn))) 770 (string-match "[^ \n]" string eposn)))
777 (substring string bposn eposn)) 771 (substring string bposn eposn))
778 (erc-response.command-args msg))) 772 (erc-response.command-args msg)))
779 (when posn 773 (when posn
diff --git a/lisp/erc/erc-ezbounce.el b/lisp/erc/erc-ezbounce.el
index 48395bf1dab..d04fe782f7e 100644
--- a/lisp/erc/erc-ezbounce.el
+++ b/lisp/erc/erc-ezbounce.el
@@ -139,7 +139,7 @@ in the alist is `nil', prompt for the appropriate values."
139(defun erc-ezb-add-session (message) 139(defun erc-ezb-add-session (message)
140 "Add an EZBounce session to the session list." 140 "Add an EZBounce session to the session list."
141 (when (and erc-ezb-inside-session-listing 141 (when (and erc-ezb-inside-session-listing
142 (string-match "^\\([^ ]+\\) +\\([^ ]+\\) +\\([^ ]+\\) +\\([^ ]+\\)$" message)) 142 (string-match "^\\([^ \n]+\\) +\\([^ \n]+\\) +\\([^ \n]+\\) +\\([^ \n]+\\)$" message))
143 (let ((id (match-string 1 message)) 143 (let ((id (match-string 1 message))
144 (nick (match-string 2 message)) 144 (nick (match-string 2 message))
145 (to (match-string 3 message))) 145 (to (match-string 3 message)))
diff --git a/lisp/erc/erc-join.el b/lisp/erc/erc-join.el
index 0d2c1f98706..86b79c538f1 100644
--- a/lisp/erc/erc-join.el
+++ b/lisp/erc/erc-join.el
@@ -92,7 +92,7 @@ servers, presumably in the same domain."
92 (or erc-server-announced-name erc-session-server)))) 92 (or erc-server-announced-name erc-session-server))))
93 (when (erc-current-nick-p nick) 93 (when (erc-current-nick-p nick)
94 (when (and erc-autojoin-domain-only 94 (when (and erc-autojoin-domain-only
95 (string-match "[^.]+\\.\\([^.]+\\.[^.]+\\)$" server)) 95 (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" server))
96 (setq server (match-string 1 server))) 96 (setq server (match-string 1 server)))
97 (let ((elem (assoc server erc-autojoin-channels-alist))) 97 (let ((elem (assoc server erc-autojoin-channels-alist)))
98 (if elem 98 (if elem
@@ -115,7 +115,7 @@ servers, presumably in the same domain."
115 (or erc-server-announced-name erc-session-server)))) 115 (or erc-server-announced-name erc-session-server))))
116 (when (erc-current-nick-p nick) 116 (when (erc-current-nick-p nick)
117 (when (and erc-autojoin-domain-only 117 (when (and erc-autojoin-domain-only
118 (string-match "[^.]+\\.\\([^.]+\\.[^.]+\\)$" server)) 118 (string-match "[^.\n]+\\.\\([^.\n]+\\.[^.\n]+\\)$" server))
119 (setq server (match-string 1 server))) 119 (setq server (match-string 1 server)))
120 (let ((elem (assoc server erc-autojoin-channels-alist))) 120 (let ((elem (assoc server erc-autojoin-channels-alist)))
121 (when elem 121 (when elem
diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el
index a982b5e7c7e..72e7b8bbd7f 100644
--- a/lisp/erc/erc-netsplit.el
+++ b/lisp/erc/erc-netsplit.el
@@ -64,7 +64,8 @@ sever buffer."
64 :group 'erc-netsplit 64 :group 'erc-netsplit
65 :type 'boolean) 65 :type 'boolean)
66 66
67(defcustom erc-netsplit-regexp "^[^ @!\"]+\\.[^ @!]+ [^ @!]+\\.[^ @!\"]+$" 67(defcustom erc-netsplit-regexp
68 "^[^ @!\"\n]+\\.[^ @!\n]+ [^ @!\n]+\\.[^ @!\"\n]+$"
68 "This regular expression should match quit reasons produced 69 "This regular expression should match quit reasons produced
69by netsplits." 70by netsplits."
70 :group 'erc-netsplit 71 :group 'erc-netsplit
@@ -131,7 +132,7 @@ join from that split has been detected or not.")
131(defun erc-netsplit-MODE (proc parsed) 132(defun erc-netsplit-MODE (proc parsed)
132 "Hide mode changes from servers." 133 "Hide mode changes from servers."
133 ;; regexp matches things with a . in them, and no ! or @ in them. 134 ;; regexp matches things with a . in them, and no ! or @ in them.
134 (when (string-match "^[^@!]+\\.[^@!]+$" (erc-response.sender parsed)) 135 (when (string-match "^[^@!\n]+\\.[^@!\n]+$" (erc-response.sender parsed))
135 (and erc-netsplit-debug 136 (and erc-netsplit-debug
136 (erc-display-message 137 (erc-display-message
137 parsed 'notice (process-buffer proc) 138 parsed 'notice (process-buffer proc)
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 63aac8a625e..1baede01259 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -3132,7 +3132,7 @@ the message given by REASON."
3132 3132
3133(defun erc-cmd-SV () 3133(defun erc-cmd-SV ()
3134 "Say the current ERC and Emacs version into channel." 3134 "Say the current ERC and Emacs version into channel."
3135 (erc-send-message (format "I'm using ERC %s with %s %s (%s%s%s)!" 3135 (erc-send-message (format "I'm using ERC %s with %s %s (%s%s) of %s."
3136 erc-version-string 3136 erc-version-string
3137 (if (featurep 'xemacs) "XEmacs" "GNU Emacs") 3137 (if (featurep 'xemacs) "XEmacs" "GNU Emacs")
3138 emacs-version 3138 emacs-version
@@ -3155,7 +3155,7 @@ the message given by REASON."
3155 x-toolkit-scroll-bars))) 3155 x-toolkit-scroll-bars)))
3156 "") 3156 "")
3157 (if (featurep 'multi-tty) ", multi-tty" "")) 3157 (if (featurep 'multi-tty) ", multi-tty" ""))
3158 (concat ", built " erc-emacs-build-time))) 3158 erc-emacs-build-time))
3159 t) 3159 t)
3160 3160
3161(defun erc-cmd-SM () 3161(defun erc-cmd-SM ()
@@ -3490,7 +3490,7 @@ If FACE is non-nil, it will be used to propertize the prompt. If it is nil,
3490If `point' is at the beginning of a channel name, use that as default." 3490If `point' is at the beginning of a channel name, use that as default."
3491 (interactive 3491 (interactive
3492 (list 3492 (list
3493 (let ((chnl (if (looking-at "\\([&#+!][^ ]+\\)") (match-string 1) "")) 3493 (let ((chnl (if (looking-at "\\([&#+!][^ \n]+\\)") (match-string 1) ""))
3494 (table (when (erc-server-buffer-live-p) 3494 (table (when (erc-server-buffer-live-p)
3495 (set-buffer (process-buffer erc-server-process)) 3495 (set-buffer (process-buffer erc-server-process))
3496 erc-channel-list))) 3496 erc-channel-list)))
@@ -4734,12 +4734,12 @@ EmacsSpeak support."
4734 4734
4735Return a list of the three separate tokens." 4735Return a list of the three separate tokens."
4736 (cond 4736 (cond
4737 ((string-match "^\\([^!]*\\)!\\([^@]*\\)@\\(.*\\)$" string) 4737 ((string-match "^\\([^!\n]*\\)!\\([^@\n]*\\)@\\(.*\\)$" string)
4738 (list (match-string 1 string) 4738 (list (match-string 1 string)
4739 (match-string 2 string) 4739 (match-string 2 string)
4740 (match-string 3 string))) 4740 (match-string 3 string)))
4741 ;; Some bogus bouncers send Nick!(null), try to live with that. 4741 ;; Some bogus bouncers send Nick!(null), try to live with that.
4742 ((string-match "^\\([^!]*\\)!\\(.*\\)$" string) 4742 ((string-match "^\\([^!\n]*\\)!\\(.*\\)$" string)
4743 (list (match-string 1 string) 4743 (list (match-string 1 string)
4744 "" 4744 ""
4745 (match-string 2 string))) 4745 (match-string 2 string)))
@@ -5053,7 +5053,7 @@ user matches any regexp in `erc-ignore-reply-list'."
5053 "Return the addressed target in MSG. 5053 "Return the addressed target in MSG.
5054 5054
5055The addressed target is the string before the first colon in MSG." 5055The addressed target is the string before the first colon in MSG."
5056 (if (string-match "^\\([^: ]*\\):" msg) 5056 (if (string-match "^\\([^: \n]*\\):" msg)
5057 (match-string 1 msg) 5057 (match-string 1 msg)
5058 nil)) 5058 nil))
5059 5059
diff --git a/lisp/files.el b/lisp/files.el
index 3e4602643db..cd474e868d0 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -444,14 +444,19 @@ use `before-save-hook'.")
444 444
445(defcustom enable-local-variables t 445(defcustom enable-local-variables t
446 "*Control use of local variables in files you visit. 446 "*Control use of local variables in files you visit.
447The value can be t, nil or something else. 447The value can be t, nil, :safe, or something else.
448 448
449A value of t means file local variables specifications are obeyed 449A value of t means file local variables specifications are obeyed
450if all the specified variable values are safe; if any values are 450if all the specified variable values are safe; if any values are
451not safe, Emacs queries you, once, whether to set them all. 451not safe, Emacs queries you, once, whether to set them all.
452\(When you say yes to certain values, they are remembered as safe.)
453
454:safe means set the safe variables, and ignore the rest.
455nil means always ignore the file local variables.
452 456
453A value of nil means always ignore the file local variables.
454Any other value means always query you once whether to set them all. 457Any other value means always query you once whether to set them all.
458\(When you say yes to certain values, they are remembered as safe, but
459this has no effect when `enable-local-variables' is \"something else\".)
455 460
456This variable also controls use of major modes specified in 461This variable also controls use of major modes specified in
457a -*- line. 462a -*- line.
@@ -460,6 +465,7 @@ The command \\[normal-mode], when used interactively,
460always obeys file local variable specifications and the -*- line, 465always obeys file local variable specifications and the -*- line,
461and ignores this variable." 466and ignores this variable."
462 :type '(choice (const :tag "Obey" t) 467 :type '(choice (const :tag "Obey" t)
468 (const :tag "Safe Only" :safe)
463 (const :tag "Ignore" nil) 469 (const :tag "Ignore" nil)
464 (other :tag "Query" other)) 470 (other :tag "Query" other))
465 :group 'find-file) 471 :group 'find-file)
@@ -1779,8 +1785,7 @@ Uses the visited file name, the -*- line, and the local variables spec.
1779 1785
1780This function is called automatically from `find-file'. In that case, 1786This function is called automatically from `find-file'. In that case,
1781we may set up the file-specified mode and local variables, 1787we may set up the file-specified mode and local variables,
1782depending on the value of `enable-local-variables': if it is t, we do; 1788depending on the value of `enable-local-variables'.
1783if it is nil, we don't; otherwise, we query.
1784In addition, if `local-enable-local-variables' is nil, we do 1789In addition, if `local-enable-local-variables' is nil, we do
1785not set local variables (though we do notice a mode specified with -*-.) 1790not set local variables (though we do notice a mode specified with -*-.)
1786 1791
@@ -2413,8 +2418,7 @@ n -- to ignore the local variables list.")
2413 "" 2418 ""
2414 ", or C-v to scroll"))) 2419 ", or C-v to scroll")))
2415 (goto-char (point-min)) 2420 (goto-char (point-min))
2416 (let ((inhibit-quit t) 2421 (let ((cursor-in-echo-area t)
2417 (cursor-in-echo-area t)
2418 (exit-chars 2422 (exit-chars
2419 (if offer-save '(?! ?y ?n ?\s ?\C-g) '(?y ?n ?\s ?\C-g))) 2423 (if offer-save '(?! ?y ?n ?\s ?\C-g) '(?y ?n ?\s ?\C-g)))
2420 done) 2424 done)
@@ -2426,9 +2430,7 @@ n -- to ignore the local variables list.")
2426 (condition-case nil 2430 (condition-case nil
2427 (scroll-up) 2431 (scroll-up)
2428 (error (goto-char (point-min)))) 2432 (error (goto-char (point-min))))
2429 (setq done (memq (downcase char) exit-chars))))) 2433 (setq done (memq (downcase char) exit-chars))))))
2430 (if (= char ?\C-g)
2431 (setq quit-flag nil)))
2432 (setq char (downcase char)) 2434 (setq char (downcase char))
2433 (when (and offer-save (= char ?!) unsafe-vars) 2435 (when (and offer-save (= char ?!) unsafe-vars)
2434 (dolist (elt unsafe-vars) 2436 (dolist (elt unsafe-vars)
@@ -2616,13 +2618,22 @@ is specified, returning t if it is specified."
2616 (and (risky-local-variable-p var val) 2618 (and (risky-local-variable-p var val)
2617 (push elt risky-vars)) 2619 (push elt risky-vars))
2618 (push elt unsafe-vars)))) 2620 (push elt unsafe-vars))))
2619 (if (or (and (eq enable-local-variables t) 2621 (if (eq enable-local-variables :safe)
2620 (null unsafe-vars) 2622 ;; If caller wants only the safe variables,
2621 (null risky-vars)) 2623 ;; install only them.
2622 (hack-local-variables-confirm
2623 result unsafe-vars risky-vars))
2624 (dolist (elt result) 2624 (dolist (elt result)
2625 (hack-one-local-variable (car elt) (cdr elt))))) 2625 (unless (or (memq (car elt) unsafe-vars)
2626 (memq (car elt) risky-vars))
2627 (hack-one-local-variable (car elt) (cdr elt))))
2628 ;; Query, except in the case where all are known safe
2629 ;; if the user wants no quuery in that case.
2630 (if (or (and (eq enable-local-variables t)
2631 (null unsafe-vars)
2632 (null risky-vars))
2633 (hack-local-variables-confirm
2634 result unsafe-vars risky-vars))
2635 (dolist (elt result)
2636 (hack-one-local-variable (car elt) (cdr elt))))))
2626 (run-hooks 'hack-local-variables-hook)))))) 2637 (run-hooks 'hack-local-variables-hook))))))
2627 2638
2628(defun safe-local-variable-p (sym val) 2639(defun safe-local-variable-p (sym val)
@@ -2678,12 +2689,14 @@ It is dangerous if either of these conditions are met:
2678 (and (eq (car exp) 'put) 2689 (and (eq (car exp) 'put)
2679 (hack-one-local-variable-quotep (nth 1 exp)) 2690 (hack-one-local-variable-quotep (nth 1 exp))
2680 (hack-one-local-variable-quotep (nth 2 exp)) 2691 (hack-one-local-variable-quotep (nth 2 exp))
2681 (memq (nth 1 (nth 2 exp)) 2692 (let ((prop (nth 1 (nth 2 exp))) (val (nth 3 exp)))
2682 '(lisp-indent-hook)) 2693 (cond ((eq prop 'lisp-indent-hook)
2683 ;; Only allow safe values of lisp-indent-hook; 2694 ;; Only allow safe values of lisp-indent-hook;
2684 ;; not functions. 2695 ;; not functions.
2685 (or (numberp (nth 3 exp)) 2696 (or (numberp val) (equal val ''defun)))
2686 (equal (nth 3 exp) ''defun))) 2697 ((eq prop 'edebug-form-spec)
2698 ;; Only allow indirect form specs.
2699 (edebug-basic-spec val)))))
2687 ;; Allow expressions that the user requested. 2700 ;; Allow expressions that the user requested.
2688 (member exp safe-local-eval-forms) 2701 (member exp safe-local-eval-forms)
2689 ;; Certain functions can be allowed with safe arguments 2702 ;; Certain functions can be allowed with safe arguments
diff --git a/lisp/finder.el b/lisp/finder.el
index fc96381e8f7..1374e1f4e76 100644
--- a/lisp/finder.el
+++ b/lisp/finder.el
@@ -104,6 +104,8 @@
104 (define-key map [mouse-2] 'finder-mouse-select) 104 (define-key map [mouse-2] 'finder-mouse-select)
105 (define-key map "\C-m" 'finder-select) 105 (define-key map "\C-m" 'finder-select)
106 (define-key map "?" 'finder-summary) 106 (define-key map "?" 'finder-summary)
107 (define-key map "n" 'next-line)
108 (define-key map "p" 'previous-line)
107 (define-key map "q" 'finder-exit) 109 (define-key map "q" 'finder-exit)
108 (define-key map "d" 'finder-list-keywords) 110 (define-key map "d" 'finder-list-keywords)
109 map)) 111 map))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 0e077ce0b04..991d91a1112 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,59 @@
12006-04-12 Ralf Angeli <angeli@iwi.uni-sb.de>
2
3 * flow-fill.el (fill-flowed): Remove trailing space from blank
4 quoted lines.
5
62006-04-12 Reiner Steib <Reiner.Steib@gmx.de>
7
8 * gnus-art.el (gnus-article-mode): Set
9 cursor-in-non-selected-windows to nil.
10
112006-04-12 Katsumi Yamaoka <yamaoka@jpl.org>
12
13 * gnus-art.el (gnus-mime-view-part-as-charset): Ignore charset
14 that the part specifies.
15
16 * mm-decode.el (mm-display-part): Work with external parts and
17 usual parts similarly.
18
19 * mm-extern.el (mm-inline-external-body): Use mm-display-part
20 instead of gnus-display-mime.
21
22 * gnus-uu.el (gnus-uu-save-article): Put mml tags instead of part
23 tag to summarized topics part in order to encode non-ASCII text.
24
252006-04-11 Reiner Steib <Reiner.Steib@gmx.de>
26
27 * gnus-art.el (gnus-button-valid-localpart-regexp): Exclude `@'.
28
292006-04-11 Arne J,Ax(Brgensen <arne@arnested.dk>
30
31 * gnus-sieve.el (gnus-sieve-generate): Delete from the start of
32 the sieve region.
33
342006-04-11 Reiner Steib <Reiner.Steib@gmx.de>
35
36 * gnus.el: Gnus v5.10.8 is released.
37
382006-04-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
39
40 * nnslashdot.el (nnslashdot-retrieve-headers-1): Fix up to new
41 layout.
42
43 * rfc2047.el (rfc2047-decode-encoded-words): Don't message about
44 unknown charset.
45
46 * message.el (message-header-synonyms): Add Original-To to the
47 default.
48
49 * gnus-sum.el (gnus-get-newsgroup-headers-xover): group is an
50 optional parameter.
51
522006-04-07 Reiner Steib <Reiner.Steib@gmx.de>
53
54 * pgg-gpg.el: Revert to revision 7.15 to allow the use of
55 gpg-agent.
56
12006-04-06 Reiner Steib <Reiner.Steib@gmx.de> 572006-04-06 Reiner Steib <Reiner.Steib@gmx.de>
2 58
3 * gnus-fun.el (gnus): Require it for gnus-directory. 59 * gnus-fun.el (gnus): Require it for gnus-directory.
diff --git a/lisp/gnus/flow-fill.el b/lisp/gnus/flow-fill.el
index 98697439106..b47e9ba8365 100644
--- a/lisp/gnus/flow-fill.el
+++ b/lisp/gnus/flow-fill.el
@@ -114,7 +114,7 @@ RFC 2646 suggests 66 characters for readability."
114 (set-buffer (or (current-buffer) buffer)) 114 (set-buffer (or (current-buffer) buffer))
115 (goto-char (point-min)) 115 (goto-char (point-min))
116 ;; Remove space stuffing. 116 ;; Remove space stuffing.
117 (while (re-search-forward "^ " nil t) 117 (while (re-search-forward "^\\( \\|>+ $\\)" nil t)
118 (delete-char -1) 118 (delete-char -1)
119 (forward-line 1)) 119 (forward-line 1))
120 (goto-char (point-min)) 120 (goto-char (point-min))
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 69fe8159c10..7e3b843d500 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -3809,6 +3809,7 @@ commands:
3809 (make-local-variable 'gnus-article-ignored-charsets) 3809 (make-local-variable 'gnus-article-ignored-charsets)
3810 ;; Prevent recent Emacsen from displaying non-break space as "\ ". 3810 ;; Prevent recent Emacsen from displaying non-break space as "\ ".
3811 (set (make-local-variable 'nobreak-char-display) nil) 3811 (set (make-local-variable 'nobreak-char-display) nil)
3812 (setq cursor-in-non-selected-windows nil)
3812 (gnus-set-default-directory) 3813 (gnus-set-default-directory)
3813 (buffer-disable-undo) 3814 (buffer-disable-undo)
3814 (setq buffer-read-only t) 3815 (setq buffer-read-only t)
@@ -4477,19 +4478,29 @@ are decompressed."
4477specified charset." 4478specified charset."
4478 (interactive (list nil current-prefix-arg)) 4479 (interactive (list nil current-prefix-arg))
4479 (gnus-article-check-buffer) 4480 (gnus-article-check-buffer)
4480 (let* ((handle (or handle (get-text-property (point) 'gnus-data))) 4481 (let ((handle (or handle (get-text-property (point) 'gnus-data)))
4481 contents charset 4482 (fun (get-text-property (point) 'gnus-callback))
4482 (b (point)) 4483 (gnus-newsgroup-ignored-charsets 'gnus-all)
4483 (inhibit-read-only t)) 4484 gnus-newsgroup-charset type charset)
4484 (when handle 4485 (when handle
4485 (if (mm-handle-undisplayer handle) 4486 (if (mm-handle-undisplayer handle)
4486 (mm-remove-part handle)) 4487 (mm-remove-part handle))
4487 (let ((gnus-newsgroup-charset 4488 (when fun
4488 (or (cdr (assq arg 4489 (setq gnus-newsgroup-charset
4489 gnus-summary-show-article-charset-alist)) 4490 (or (cdr (assq arg gnus-summary-show-article-charset-alist))
4490 (mm-read-coding-system "Charset: "))) 4491 (mm-read-coding-system "Charset: ")))
4491 (gnus-newsgroup-ignored-charsets 'gnus-all)) 4492 ;; Strip the charset parameter from `handle'.
4492 (gnus-article-press-button))))) 4493 (setq type (mm-handle-type
4494 (if (equal (mm-handle-media-type handle)
4495 "message/external-body")
4496 (progn
4497 (unless (mm-handle-cache handle)
4498 (mm-extern-cache-contents handle))
4499 (mm-handle-cache handle))
4500 handle))
4501 charset (assq 'charset (cdr type)))
4502 (delq charset type)
4503 (funcall fun handle)))))
4493 4504
4494(defun gnus-mime-view-part-externally (&optional handle) 4505(defun gnus-mime-view-part-externally (&optional handle)
4495 "View the MIME part under point with an external viewer." 4506 "View the MIME part under point with an external viewer."
@@ -5972,7 +5983,7 @@ groups."
5972 5983
5973;; Regexp suggested by Felix Wiemann in <87oeuomcz9.fsf@news2.ososo.de> 5984;; Regexp suggested by Felix Wiemann in <87oeuomcz9.fsf@news2.ososo.de>
5974(defcustom gnus-button-valid-localpart-regexp 5985(defcustom gnus-button-valid-localpart-regexp
5975 "[a-z0-9$%(*-=?[_][^<>\")!;:,{}\n\t ]*" 5986 "[a-z0-9$%(*-=?[_][^<>\")!;:,{}\n\t @]*"
5976 "Regular expression that matches a localpart of mail addresses or MIDs." 5987 "Regular expression that matches a localpart of mail addresses or MIDs."
5977 :version "22.1" 5988 :version "22.1"
5978 :group 'gnus-article-buttons 5989 :group 'gnus-article-buttons
diff --git a/lisp/gnus/gnus-sieve.el b/lisp/gnus/gnus-sieve.el
index 99e8f6b4986..0e6c500d0f2 100644
--- a/lisp/gnus/gnus-sieve.el
+++ b/lisp/gnus/gnus-sieve.el
@@ -107,7 +107,7 @@ See the documentation for these variables and functions for details."
107 (find-file gnus-sieve-file) 107 (find-file gnus-sieve-file)
108 (goto-char (point-min)) 108 (goto-char (point-min))
109 (if (re-search-forward (regexp-quote gnus-sieve-region-start) nil t) 109 (if (re-search-forward (regexp-quote gnus-sieve-region-start) nil t)
110 (delete-region (match-end 0) 110 (delete-region (match-beginning 0)
111 (or (re-search-forward (regexp-quote 111 (or (re-search-forward (regexp-quote
112 gnus-sieve-region-end) nil t) 112 gnus-sieve-region-end) nil t)
113 (point))) 113 (point)))
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 4fc01a8fad3..bea7cb2445e 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -5962,7 +5962,8 @@ Return a list of headers that match SEQUENCE (see
5962 (allp (cond 5962 (allp (cond
5963 ((eq gnus-read-all-available-headers t) 5963 ((eq gnus-read-all-available-headers t)
5964 t) 5964 t)
5965 ((stringp gnus-read-all-available-headers) 5965 ((and (stringp gnus-read-all-available-headers)
5966 group)
5966 (string-match gnus-read-all-available-headers group)) 5967 (string-match gnus-read-all-available-headers group))
5967 (t 5968 (t
5968 nil))) 5969 nil)))
diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el
index e9756547167..46f810b2fbb 100644
--- a/lisp/gnus/gnus-uu.el
+++ b/lisp/gnus/gnus-uu.el
@@ -839,7 +839,9 @@ When called interactively, prompt for REGEXP."
839 "Date: %s\nFrom: %s\nSubject: %s Digest\n\n" 839 "Date: %s\nFrom: %s\nSubject: %s Digest\n\n"
840 (message-make-date) name name)) 840 (message-make-date) name name))
841 (when (and message-forward-as-mime gnus-uu-digest-buffer) 841 (when (and message-forward-as-mime gnus-uu-digest-buffer)
842 (insert "<#part type=message/rfc822>\nSubject: Topics\n\n")) 842 (insert
843 "<#mml type=message/rfc822>\nSubject: Topics\n\n<#/mml>\n")
844 (forward-line -1))
843 (insert "Topics:\n"))) 845 (insert "Topics:\n")))
844 (when (not (eq in-state 'end)) 846 (when (not (eq in-state 'end))
845 (setq state (list 'middle)))) 847 (setq state (list 'middle))))
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 236ec1bc23f..741b193f779 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -2749,7 +2749,8 @@ prefix FORCE is given."
2749 (message-carefully-insert-headers headers))) 2749 (message-carefully-insert-headers headers)))
2750 2750
2751(defcustom message-header-synonyms 2751(defcustom message-header-synonyms
2752 '((To Cc Bcc)) 2752 '((To Cc Bcc)
2753 (Original-To))
2753 "List of lists of header synonyms. 2754 "List of lists of header synonyms.
2754E.g., if this list contains a member list with elements `Cc' and `To', 2755E.g., if this list contains a member list with elements `Cc' and `To',
2755then `message-carefully-insert-headers' will not insert a `To' header 2756then `message-carefully-insert-headers' will not insert a `To' header
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 60cbb413473..5ee47a8ce26 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -672,7 +672,14 @@ external if displayed external."
672 (mailcap-parse-mailcaps) 672 (mailcap-parse-mailcaps)
673 (if (mm-handle-displayed-p handle) 673 (if (mm-handle-displayed-p handle)
674 (mm-remove-part handle) 674 (mm-remove-part handle)
675 (let* ((type (mm-handle-media-type handle)) 675 (let* ((ehandle (if (equal (mm-handle-media-type handle)
676 "message/external-body")
677 (progn
678 (unless (mm-handle-cache handle)
679 (mm-extern-cache-contents handle))
680 (mm-handle-cache handle))
681 handle))
682 (type (mm-handle-media-type ehandle))
676 (method (mailcap-mime-info type)) 683 (method (mailcap-mime-info type))
677 (filename (or (mail-content-type-get 684 (filename (or (mail-content-type-get
678 (mm-handle-disposition handle) 'filename) 685 (mm-handle-disposition handle) 'filename)
@@ -680,8 +687,8 @@ external if displayed external."
680 (mm-handle-type handle) 'name) 687 (mm-handle-type handle) 'name)
681 "<file>")) 688 "<file>"))
682 (external mm-enable-external)) 689 (external mm-enable-external))
683 (if (and (mm-inlinable-p handle) 690 (if (and (mm-inlinable-p ehandle)
684 (mm-inlined-p handle)) 691 (mm-inlined-p ehandle))
685 (progn 692 (progn
686 (forward-line 1) 693 (forward-line 1)
687 (mm-display-inline handle) 694 (mm-display-inline handle)
@@ -689,7 +696,7 @@ external if displayed external."
689 (when (or method 696 (when (or method
690 (not no-default)) 697 (not no-default))
691 (if (and (not method) 698 (if (and (not method)
692 (equal "text" (car (split-string type)))) 699 (equal "text" (car (split-string type "/"))))
693 (progn 700 (progn
694 (forward-line 1) 701 (forward-line 1)
695 (mm-insert-inline handle (mm-get-part handle)) 702 (mm-insert-inline handle (mm-get-part handle))
diff --git a/lisp/gnus/mm-extern.el b/lisp/gnus/mm-extern.el
index b736374f016..c574bd6156e 100644
--- a/lisp/gnus/mm-extern.el
+++ b/lisp/gnus/mm-extern.el
@@ -157,25 +157,11 @@ If NO-DISPLAY is nil, display it. Otherwise, do nothing after replacing."
157 (save-excursion 157 (save-excursion
158 (save-restriction 158 (save-restriction
159 (narrow-to-region (point) (point)) 159 (narrow-to-region (point) (point))
160 (let* ((type (regexp-quote 160 (mm-display-part (mm-handle-cache handle))))
161 (mm-handle-media-type (mm-handle-cache handle)))) 161 ;; Move undisplayer added to the cached handle to the parent.
162 ;; Force the part to be displayed (but if there is no 162 (mm-handle-set-undisplayer
163 ;; method to display, a user will be prompted to save). 163 handle (mm-handle-undisplayer (mm-handle-cache handle)))
164 ;; See `gnus-mime-display-single'. 164 (mm-handle-set-undisplayer (mm-handle-cache handle) nil)))
165 (mm-inline-override-types nil)
166 (mm-attachment-override-types
167 (cons type mm-attachment-override-types))
168 (mm-automatic-display (cons type mm-automatic-display))
169 (mm-automatic-external-display
170 (cons type mm-automatic-external-display))
171 ;; Suppress adding of button to the cached part.
172 (gnus-inhibit-mime-unbuttonizing nil))
173 (gnus-display-mime (mm-handle-cache handle)))
174 ;; Move undisplayer added to the cached handle to the parent.
175 (mm-handle-set-undisplayer
176 handle
177 (mm-handle-undisplayer (mm-handle-cache handle)))
178 (mm-handle-set-undisplayer (mm-handle-cache handle) nil)))))
179 165
180(provide 'mm-extern) 166(provide 'mm-extern)
181 167
diff --git a/lisp/gnus/nnslashdot.el b/lisp/gnus/nnslashdot.el
index 38468d7d194..66ce4d54472 100644
--- a/lisp/gnus/nnslashdot.el
+++ b/lisp/gnus/nnslashdot.el
@@ -142,7 +142,7 @@
142 (setq article (if (and article (< start article)) article start)) 142 (setq article (if (and article (< start article)) article start))
143 (goto-char point) 143 (goto-char point)
144 (while (re-search-forward 144 (while (re-search-forward
145 "<a name=\"\\([0-9]+\\)\">\\([^<]+\\)</a>.*\n.*score:\\([^)]+\\))" 145 "<a name=\"\\([0-9]+\\)\">\\([^<]+\\)</a>.*\n.*\n.*score:\\([^)]+\\))"
146 nil t) 146 nil t)
147 (setq cid (match-string 1) 147 (setq cid (match-string 1)
148 subject (match-string 2) 148 subject (match-string 2)
diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el
index 501a161e83e..f282795a0ab 100644
--- a/lisp/gnus/rfc2047.el
+++ b/lisp/gnus/rfc2047.el
@@ -851,11 +851,8 @@ ENCODED-WORD)."
851 (let (word charset cs encoding text rest) 851 (let (word charset cs encoding text rest)
852 (while words 852 (while words
853 (setq word (pop words)) 853 (setq word (pop words))
854 (if (and (or (setq cs (rfc2047-charset-to-coding-system 854 (if (and (setq cs (rfc2047-charset-to-coding-system
855 (setq charset (car word)))) 855 (setq charset (car word))))
856 (progn
857 (message "Unknown charset: %s" charset)
858 nil))
859 (condition-case code 856 (condition-case code
860 (cond ((char-equal ?B (nth 1 word)) 857 (cond ((char-equal ?B (nth 1 word))
861 (setq text (base64-decode-string 858 (setq text (base64-decode-string
diff --git a/lisp/hexl.el b/lisp/hexl.el
index bdece19f96b..1e724aa418a 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -38,7 +38,7 @@
38;; grouping. 38;; grouping.
39;; 39;;
40;; -iso in `hexl-options' will allow iso characters to display in the 40;; -iso in `hexl-options' will allow iso characters to display in the
41;; ASCII region of the screen (if your emacs supports this) instead of 41;; ASCII region of the screen (if your Emacs supports this) instead of
42;; changing them to dots. 42;; changing them to dots.
43 43
44;;; Code: 44;;; Code:
@@ -62,7 +62,7 @@ and \"-de\" when dehexlifying a buffer."
62 :group 'hexl) 62 :group 'hexl)
63 63
64(defcustom hexl-iso "" 64(defcustom hexl-iso ""
65 "If your emacs can handle ISO characters, this should be set to 65 "If your Emacs can handle ISO characters, this should be set to
66\"-iso\" otherwise it should be \"\"." 66\"-iso\" otherwise it should be \"\"."
67 :type 'string 67 :type 'string
68 :group 'hexl) 68 :group 'hexl)
@@ -229,7 +229,7 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
229 original-point)) 229 original-point))
230 (or (bolp) (setq original-point (1- original-point)))) 230 (or (bolp) (setq original-point (1- original-point))))
231 (hexlify-buffer) 231 (hexlify-buffer)
232 (set-buffer-modified-p modified)) 232 (restore-buffer-modified-p modified))
233 (make-local-variable 'hexl-max-address) 233 (make-local-variable 'hexl-max-address)
234 (setq hexl-max-address max-address) 234 (setq hexl-max-address max-address)
235 (condition-case nil 235 (condition-case nil
@@ -300,9 +300,16 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
300 (lambda (string &optional bound noerror count) 300 (lambda (string &optional bound noerror count)
301 (funcall 301 (funcall
302 (if isearch-forward 're-search-forward 're-search-backward) 302 (if isearch-forward 're-search-forward 're-search-backward)
303 (if (> (length string) 80) 303 (let ((textre
304 (regexp-quote string) 304 (if (> (length string) 80)
305 (mapconcat 'string string "\\(?:\n\\(?:[:a-f0-9]+ \\)+ \\)?")) 305 (regexp-quote string)
306 (mapconcat (lambda (c) (regexp-quote (string c))) string
307 "\\(?:\n\\(?:[:a-f0-9]+ \\)+ \\)?"))))
308 (if (string-match "\\` ?\\([a-f0-9]+ \\)*[a-f0-9]+ ?\\'" string)
309 (concat textre "\\|"
310 (mapconcat 'regexp-quote (split-string string " ")
311 " \\(?: .+\n[a-f0-9]+: \\)?"))
312 textre))
306 bound noerror count)) 313 bound noerror count))
307 (let ((isearch-search-fun-function nil)) 314 (let ((isearch-search-fun-function nil))
308 (isearch-search-fun)))) 315 (isearch-search-fun))))
@@ -318,34 +325,33 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
318 "Save a hexl format buffer as binary in visited file if modified." 325 "Save a hexl format buffer as binary in visited file if modified."
319 (interactive) 326 (interactive)
320 (if hexl-in-save-buffer nil 327 (if hexl-in-save-buffer nil
321 (set-buffer-modified-p (if (buffer-modified-p) 328 (restore-buffer-modified-p
322 (save-excursion 329 (if (buffer-modified-p)
323 (let ((buf (generate-new-buffer " hexl")) 330 (let ((buf (generate-new-buffer " hexl"))
324 (name (buffer-name)) 331 (name (buffer-name))
325 (file-name (buffer-file-name)) 332 (start (point-min))
326 (start (point-min)) 333 (end (point-max))
327 (end (point-max)) 334 modified)
328 modified) 335 (with-current-buffer buf
329 (set-buffer buf) 336 (insert-buffer-substring name start end)
330 (insert-buffer-substring name start end) 337 (set-buffer name)
331 (set-buffer name) 338 (dehexlify-buffer)
332 (dehexlify-buffer) 339 ;; Prevent infinite recursion.
333 ;; Prevent infinite recursion. 340 (let ((hexl-in-save-buffer t))
334 (let ((hexl-in-save-buffer t)) 341 (save-buffer))
335 (save-buffer)) 342 (setq modified (buffer-modified-p))
336 (setq modified (buffer-modified-p)) 343 (delete-region (point-min) (point-max))
337 (delete-region (point-min) (point-max)) 344 (insert-buffer-substring buf start end)
338 (insert-buffer-substring buf start end) 345 (kill-buffer buf)
339 (kill-buffer buf) 346 modified))
340 modified)) 347 (message "(No changes need to be saved)")
341 (message "(No changes need to be saved)") 348 nil))
342 nil))
343 ;; Return t to indicate we have saved t 349 ;; Return t to indicate we have saved t
344 t)) 350 t))
345 351
346;;;###autoload 352;;;###autoload
347(defun hexl-find-file (filename) 353(defun hexl-find-file (filename)
348 "Edit file FILENAME in hexl-mode. 354 "Edit file FILENAME in `hexl-mode'.
349Switch to a buffer visiting file FILENAME, creating one in none exists." 355Switch to a buffer visiting file FILENAME, creating one in none exists."
350 (interactive 356 (interactive
351 (list 357 (list
@@ -367,7 +373,7 @@ With arg, don't unhexlify buffer."
367 (original-point (1+ (hexl-current-address)))) 373 (original-point (1+ (hexl-current-address))))
368 (dehexlify-buffer) 374 (dehexlify-buffer)
369 (remove-hook 'write-contents-functions 'hexl-save-buffer t) 375 (remove-hook 'write-contents-functions 'hexl-save-buffer t)
370 (set-buffer-modified-p modified) 376 (restore-buffer-modified-p modified)
371 (goto-char original-point) 377 (goto-char original-point)
372 ;; Maybe adjust point for the removed CR characters. 378 ;; Maybe adjust point for the removed CR characters.
373 (when (eq (coding-system-eol-type buffer-file-coding-system) 1) 379 (when (eq (coding-system-eol-type buffer-file-coding-system) 1)
@@ -403,7 +409,7 @@ Ask the user for confirmation."
403 (original-point (1+ (hexl-current-address)))) 409 (original-point (1+ (hexl-current-address))))
404 (dehexlify-buffer) 410 (dehexlify-buffer)
405 (remove-hook 'write-contents-functions 'hexl-save-buffer t) 411 (remove-hook 'write-contents-functions 'hexl-save-buffer t)
406 (set-buffer-modified-p modified) 412 (restore-buffer-modified-p modified)
407 (goto-char original-point)))) 413 (goto-char original-point))))
408 414
409(defun hexl-current-address (&optional validate) 415(defun hexl-current-address (&optional validate)
@@ -917,14 +923,14 @@ Customize the variable `hexl-follow-ascii' to disable this feature."
917 ))))) 923 )))))
918 924
919(defun hexl-activate-ruler () 925(defun hexl-activate-ruler ()
920 "Activate `ruler-mode'" 926 "Activate `ruler-mode'."
921 (require 'ruler-mode) 927 (require 'ruler-mode)
922 (set (make-local-variable 'ruler-mode-ruler-function) 928 (set (make-local-variable 'ruler-mode-ruler-function)
923 'hexl-mode-ruler) 929 'hexl-mode-ruler)
924 (ruler-mode 1)) 930 (ruler-mode 1))
925 931
926(defun hexl-follow-line () 932(defun hexl-follow-line ()
927 "Activate `hl-line-mode'" 933 "Activate `hl-line-mode'."
928 (require 'frame) 934 (require 'frame)
929 (require 'hl-line) 935 (require 'hl-line)
930 (with-no-warnings 936 (with-no-warnings
@@ -1071,5 +1077,5 @@ This function is assumed to be used as call back function for `hl-line-mode'."
1071 1077
1072(provide 'hexl) 1078(provide 'hexl)
1073 1079
1074;;; arch-tag: d5a7aa8a-9bce-480b-bcff-6c4c7ca5ea4a 1080;; arch-tag: d5a7aa8a-9bce-480b-bcff-6c4c7ca5ea4a
1075;;; hexl.el ends here 1081;;; hexl.el ends here
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 8e0ad70e7ea..b0ad3cd5ec8 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2476,7 +2476,9 @@ See also `locale-charset-language-names', `locale-language-names',
2476 ;; If a specific EOL conversion was specified in the default 2476 ;; If a specific EOL conversion was specified in the default
2477 ;; buffer-file-coding-system, preserve it in the coding system 2477 ;; buffer-file-coding-system, preserve it in the coding system
2478 ;; we will be using from now on. 2478 ;; we will be using from now on.
2479 (if (memq default-eol-type '(0 1 2 unix dos mac)) 2479 (if (and (memq default-eol-type '(0 1 2 unix dos mac))
2480 coding-system
2481 (coding-system-p coding-system))
2480 (setq coding-system (coding-system-change-eol-conversion 2482 (setq coding-system (coding-system-change-eol-conversion
2481 coding-system default-eol-type))) 2483 coding-system default-eol-type)))
2482 2484
diff --git a/lisp/loadhist.el b/lisp/loadhist.el
index dc0e4bdc3a2..635059f93e5 100644
--- a/lisp/loadhist.el
+++ b/lisp/loadhist.el
@@ -32,6 +32,8 @@
32 32
33;;; Code: 33;;; Code:
34 34
35(eval-when-compile (require 'cl))
36
35(defun feature-symbols (feature) 37(defun feature-symbols (feature)
36 "Return the file and list of definitions associated with FEATURE. 38 "Return the file and list of definitions associated with FEATURE.
37The value is actually the element of `load-history' 39The value is actually the element of `load-history'
@@ -207,23 +209,29 @@ such as redefining an Emacs function."
207 (elp-restore-function elt)))) 209 (elp-restore-function elt))))
208 (dolist (x unload-hook-features-list) 210 (dolist (x unload-hook-features-list)
209 (if (consp x) 211 (if (consp x)
210 (cond 212 (case (car x)
211 ;; Remove any feature names that this file provided. 213 ;; Remove any feature names that this file provided.
212 ((eq (car x) 'provide) 214 (provide
213 (setq features (delq (cdr x) features))) 215 (setq features (delq (cdr x) features)))
214 ((eq (car x) 'defun) 216 (defun
215 (let ((fun (cdr x))) 217 (let ((fun (cdr x)))
216 (when (fboundp fun) 218 (when (fboundp fun)
217 (when (fboundp 'ad-unadvise) 219 (when (fboundp 'ad-unadvise)
218 (ad-unadvise fun)) 220 (ad-unadvise fun))
219 (fmakunbound fun)
220 (let ((aload (get fun 'autoload))) 221 (let ((aload (get fun 'autoload)))
221 (when aload 222 (if aload
222 (fset fun (cons 'autoload aload)))))))) 223 (fset fun (cons 'autoload aload))
224 (fmakunbound fun))))))
225 (require nil)
226 (t (message "Unexpected element %s in load-history" x)))
223 ;; Kill local values as much as possible. 227 ;; Kill local values as much as possible.
224 (dolist (buf (buffer-list)) 228 (dolist (buf (buffer-list))
225 (with-current-buffer buf 229 (with-current-buffer buf
230 (if (and (boundp x) (timerp (symbol-value x)))
231 (cancel-timer (symbol-value x)))
226 (kill-local-variable x))) 232 (kill-local-variable x)))
233 (if (and (boundp x) (timerp (symbol-value x)))
234 (cancel-timer (symbol-value x)))
227 ;; Get rid of the default binding if we can. 235 ;; Get rid of the default binding if we can.
228 (unless (local-variable-if-set-p x) 236 (unless (local-variable-if-set-p x)
229 (makunbound x)))) 237 (makunbound x))))
@@ -232,5 +240,5 @@ such as redefining an Emacs function."
232 240
233(provide 'loadhist) 241(provide 'loadhist)
234 242
235;;; arch-tag: 70bb846a-c413-4f01-bf88-78dba4ac0798 243;; arch-tag: 70bb846a-c413-4f01-bf88-78dba4ac0798
236;;; loadhist.el ends here 244;;; loadhist.el ends here
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index b8b5349c2a5..1be06fa7a3e 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -623,7 +623,9 @@ the variable `rmail-mime-feature'.")
623 623
624;;;###autoload 624;;;###autoload
625(defvar rmail-mime-charset-pattern 625(defvar rmail-mime-charset-pattern
626 "^content-type:[ ]*text/plain;[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?" 626 (concat "^content-type:[ ]*text/plain;"
627 "\\(?:[ \t\n]*\\(format\\|delsp\\)=\"?[-a-z0-9]+\"?;\\)*"
628 "[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?")
627 "Regexp to match MIME-charset specification in a header of message. 629 "Regexp to match MIME-charset specification in a header of message.
628The first parenthesized expression should match the MIME-charset name.") 630The first parenthesized expression should match the MIME-charset name.")
629 631
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index 6bf84517bde..e67cdd553d0 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,129 @@
12006-04-15 Bill Wohler <wohler@newt.com>
2
3 * mh-compat.el (mh-font-lock-add-keywords): Fix typo in docstring.
4
52006-04-14 Bill Wohler <wohler@newt.com>
6
7 * mh-funcs.el (view-exit-action): No need to wrap defvar with
8 eval-when-compile when shushing compiler.
9
10 * mh-mime.el (mh-identity-pgg-default-user-id): Ditto.
11
12 * mh-seq.el (view-exit-action): Ditto.
13
14 * mh-show.el (font-lock-auto-fontify): Ditto.
15
16 * mh-utils.el (mh-speed-flists-cache): Ditto
17
18 * mh-acros.el (struct, x, y): No need to wrap defvar with
19 eval-when-compile when shushing compiler, even when
20 mh-do-in-xemacs or another construct is used.
21
22 * mh-comp.el (sendmail-coding-system): Ditto.
23
24 * mh-e.el (mark-active): Ditto.
25
26 * mh-folder.el (desktop-save-buffer, font-lock-auto-fontify)
27 (image-load-path, font-lock-defaults): Ditto.
28
29 * mh-letter.el (image-load-path, font-lock-defaults): Ditto.
30
31 * mh-mime.el (dots, type, ov)
32 (mm-verify-function-alist, mm-decrypt-function-alist)
33 (pressed-details): Ditto.
34
35 * mh-search.el (pick-folder, mh-do-in-xemacs)
36 (mh-mairix-folder, mh-flists-search-folders)
37 (which-func-mode, mh-speed-flists-inhibit-flag): Ditto.
38
39 * mh-seq.el (tool-bar-mode): Ditto.
40
41 * mh-utils.el (completion-root-regexp)
42 (minibuffer-completing-file-name): Ditto.
43
44 * mh-xface.el (default-enable-multibyte-characters): Ditto.
45
46 * mh-compat.el (mh-font-lock-add-keywords): New alias for
47 font-lock-add-keywords. Returns nil on XEmacs.
48
49 * mh-e.el: Add MH-E function and variable keywords such as
50 mh-defun-compat and mh-defcustom to font-lock-keywords.
51
522006-04-13 Bill Wohler <wohler@newt.com>
53
54 * mh-e.el (customize-package-emacs-version-alist)
55 (mh-e, mh-alias, mh-folder, mh-folder-selection)
56 (mh-identity, mh-inc, mh-junk, mh-letter, mh-ranges)
57 (mh-scan-line-formats, mh-search, mh-sending-mail, )
58 (mh-sequences, mh-show, mh-speedbar, mh-thread, mh-tool-bar)
59 (mh-hooks, mh-faces, mh-alias-completion-ignore-case-flag)
60 (mh-alias-expand-aliases-flag, mh-alias-flash-on-comma)
61 (mh-alias-insert-file, mh-alias-insertion-location)
62 (mh-alias-local-users, mh-alias-local-users-prefix)
63 (mh-alias-passwd-gecos-comma-separator-flag)
64 (mh-new-messages-folders, mh-ticked-messages-folders)
65 (mh-large-folder, mh-recenter-summary-flag)
66 (mh-recursive-folders-flag, mh-sortm-args)
67 (mh-default-folder-for-message-function, )
68 (mh-default-folder-list, mh-default-folder-must-exist-flag)
69 (mh-default-folder-prefix, mh-identity-list)
70 (mh-auto-fields-list, mh-auto-fields-prompt-flag)
71 (mh-identity-default, mh-identity-handlers, mh-inc-prog)
72 (mh-inc-spool-list, mh-junk-background, mh-junk-disposition)
73 (mh-junk-program, mh-compose-insertion)
74 (mh-compose-skipped-header-fields)
75 (mh-compose-space-does-completion-flag)
76 (mh-delete-yanked-msg-window-flag)
77 (mh-extract-from-attribution-verb, mh-ins-buf-prefix)
78 (mh-letter-complete-function, mh-letter-fill-column)
79 (mh-mml-method-default, mh-signature-file-name)
80 (mh-signature-separator-flag, mh-x-face-file, )
81 (mh-yank-behavior, mh-interpret-number-as-range-flag)
82 (mh-adaptive-cmd-note-flag, mh-scan-format-file, mh-scan-prog)
83 (mh-search-program, mh-compose-forward-as-mime-flag)
84 (mh-compose-letter-function, mh-compose-prompt-flag)
85 (mh-forward-subject-format, mh-insert-x-mailer-flag)
86 (mh-redist-full-contents-flag, mh-reply-default-reply-to)
87 (mh-reply-show-message-flag, )
88 (mh-refile-preserves-sequences-flag, mh-tick-seq)
89 (mh-update-sequences-after-mh-show-flag)
90 (mh-bury-show-buffer-flag, mh-clean-message-header-flag)
91 (mh-decode-mime-flag, )
92 (mh-display-buttons-for-alternatives-flag)
93 (mh-display-buttons-for-inline-parts-flag)
94 (mh-do-not-confirm-flag, mh-fetch-x-image-url)
95 (mh-graphical-smileys-flag, mh-graphical-emphasis-flag)
96 (mh-highlight-citation-style, mh-invisible-header-fields)
97 (mh-invisible-header-fields-default, mh-lpr-command-format)
98 (mh-max-inline-image-height, mh-max-inline-image-width)
99 (mh-mhl-format-file, mh-mime-save-parts-default-directory)
100 (mh-print-background-flag, mh-show-maximum-size)
101 (mh-show-use-xface-flag, mh-store-default-directory)
102 (mh-summary-height, mh-speed-update-interval)
103 (mh-show-threads-flag, mh-tool-bar-search-function)
104 (mh-defcustom, mh-after-commands-processed-hook)
105 (mh-alias-reloaded-hook, mh-before-commands-processed-hook)
106 (mh-before-quit-hook, mh-before-send-letter-hook)
107 (mh-delete-msg-hook, mh-find-path-hook, mh-folder-mode-hook)
108 (mh-forward-hook, mh-inc-folder-hook, )
109 (mh-insert-signature-hook, )
110 (mh-kill-folder-suppress-prompt-hooks, mh-letter-mode-hook)
111 (mh-mh-to-mime-hook, mh-search-mode-hook, mh-quit-hook)
112 (mh-refile-msg-hook, mh-show-hook, mh-show-mode-hook)
113 (mh-unseen-updated-hook, mh-folder-address, mh-folder-body)
114 (mh-folder-cur-msg-number, mh-folder-date, mh-folder-deleted)
115 (mh-folder-followup, mh-folder-msg-number, mh-folder-refiled)
116 (mh-folder-sent-to-me-hint, mh-folder-sent-to-me-sender)
117 (mh-folder-subject, mh-folder-tick, mh-folder-to)
118 (mh-letter-header-field, mh-search-folder, mh-show-cc)
119 (mh-show-date, mh-show-from, mh-show-header, mh-show-pgg-bad)
120 (mh-show-pgg-good, mh-show-pgg-unknown, mh-show-signature)
121 (mh-show-subject, mh-show-to, mh-show-xface, )
122 (mh-speedbar-folder, mh-speedbar-folder-with-unseen-messages)
123 (mh-speedbar-selected-folder)
124 (mh-speedbar-selected-folder-with-unseen-messages): Use dotted
125 notation in :package-version keyword.
126
12006-04-07 Bill Wohler <wohler@newt.com> 1272006-04-07 Bill Wohler <wohler@newt.com>
2 128
3 * mh-e.el (mh-path, mh-variant): Define with mh-defcustom and add 129 * mh-e.el (mh-path, mh-variant): Define with mh-defcustom and add
diff --git a/lisp/mh-e/mh-acros.el b/lisp/mh-e/mh-acros.el
index 8f38abc56ee..41fadc1ec99 100644
--- a/lisp/mh-e/mh-acros.el
+++ b/lisp/mh-e/mh-acros.el
@@ -130,7 +130,9 @@ check if variable `transient-mark-mode' is active."
130 (boundp 'mark-active) mark-active)))) 130 (boundp 'mark-active) mark-active))))
131 131
132;; Shush compiler. 132;; Shush compiler.
133(eval-when-compile (mh-do-in-xemacs (defvar struct) (defvar x) (defvar y))) 133(defvar struct) ; XEmacs
134(defvar x) ; XEmacs
135(defvar y) ; XEmacs
134 136
135;;;###mh-autoload 137;;;###mh-autoload
136(defmacro mh-defstruct (name-spec &rest fields) 138(defmacro mh-defstruct (name-spec &rest fields)
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index 27806dc9ab9..b3c6ba12f57 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -215,7 +215,7 @@ ignored."
215 (setq other-headers (cdr other-headers))))) 215 (setq other-headers (cdr other-headers)))))
216 216
217;; Shush compiler. 217;; Shush compiler.
218(eval-when-compile (mh-do-in-xemacs (defvar sendmail-coding-system))) 218(defvar sendmail-coding-system) ; XEmacs
219 219
220;;;###autoload 220;;;###autoload
221(defun mh-send-letter (&optional arg) 221(defun mh-send-letter (&optional arg)
diff --git a/lisp/mh-e/mh-compat.el b/lisp/mh-e/mh-compat.el
index 256a8cfe831..560a7fd4709 100644
--- a/lisp/mh-e/mh-compat.el
+++ b/lisp/mh-e/mh-compat.el
@@ -40,7 +40,7 @@
40;; versions of Gnus. 40;; versions of Gnus.
41 41
42;; Items are listed alphabetically (except for mh-require which is 42;; Items are listed alphabetically (except for mh-require which is
43;; needed by a lesser character). 43;; needed sooner it would normally appear).
44 44
45(require 'mh-acros) 45(require 'mh-acros)
46 46
@@ -115,6 +115,11 @@ introduced in Emacs 22."
115 `(face-background ,face ,frame) 115 `(face-background ,face ,frame)
116 `(face-background ,face ,frame ,inherit))) 116 `(face-background ,face ,frame ,inherit)))
117 117
118(mh-defun-compat mh-font-lock-add-keywords font-lock-add-keywords
119 (mode keywords &optional how)
120 "XEmacs does not have `font-lock-add-keywords'.
121This function returns nil on that system.")
122
118(mh-defun-compat mh-image-load-path-for-library 123(mh-defun-compat mh-image-load-path-for-library
119 image-load-path-for-library (library image &optional path no-error) 124 image-load-path-for-library (library image &optional path no-error)
120 "Return a suitable search path for images used by LIBRARY. 125 "Return a suitable search path for images used by LIBRARY.
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index a2d0e85841b..6bf9458b459 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -109,6 +109,26 @@
109(require 'mh-buffers) 109(require 'mh-buffers)
110(require 'mh-compat) 110(require 'mh-compat)
111 111
112(mh-font-lock-add-keywords
113 'emacs-lisp-mode
114 (eval-when-compile
115 `((,(concat "(\\("
116 ;; Function declarations (use font-lock-function-name-face).
117 "\\(mh-def\\(un\\|macro\\)-compat\\)\\|"
118 ;; Variable declarations (use font-lock-variable-name-face).
119 "\\(mh-def\\(custom\\|face\\)\\)\\|"
120 ;; Group declarations (use font-lock-type-face).
121 "\\(mh-defgroup\\)"
122 "\\)\\>"
123 ;; Any whitespace and defined object.
124 "[ \t'\(]*"
125 "\\(setf[ \t]+\\sw+)\\|\\sw+\\)?")
126 (1 font-lock-keyword-face)
127 (7 (cond ((match-beginning 2) font-lock-function-name-face)
128 ((match-beginning 4) font-lock-variable-name-face)
129 (t font-lock-type-face))
130 nil t)))))
131
112 132
113 133
114;;; Global Variables 134;;; Global Variables
@@ -603,7 +623,7 @@ Output is expected to be shown to user, not parsed by MH-E."
603 (mh-exchange-point-and-mark-preserving-active-mark)) 623 (mh-exchange-point-and-mark-preserving-active-mark))
604 624
605;; Shush compiler. 625;; Shush compiler.
606(eval-when-compile (mh-do-in-xemacs (defvar mark-active))) 626(defvar mark-active) ; XEmacs
607 627
608(defun mh-exchange-point-and-mark-preserving-active-mark () 628(defun mh-exchange-point-and-mark-preserving-active-mark ()
609 "Put the mark where point is now, and point where the mark is now. 629 "Put the mark where point is now, and point where the mark is now.
@@ -989,9 +1009,9 @@ windows in the frame are removed."
989 1009
990(if (boundp 'customize-package-emacs-version-alist) 1010(if (boundp 'customize-package-emacs-version-alist)
991 (add-to-list 'customize-package-emacs-version-alist 1011 (add-to-list 'customize-package-emacs-version-alist
992 '(MH-E ("6.0" "22.1") ("6.1" "22.1") ("7.0" "22.1") 1012 '(MH-E ("6.0" . "22.1") ("6.1" . "22.1") ("7.0" . "22.1")
993 ("7.1" "22.1") ("7.2" "22.1") ("7.3" "22.1") 1013 ("7.1" . "22.1") ("7.2" . "22.1") ("7.3" . "22.1")
994 ("7.4" "22.1") ("8.0" "22.1")))) 1014 ("7.4" . "22.1") ("8.0" . "22.1"))))
995 1015
996 1016
997 1017
@@ -1003,126 +1023,126 @@ MH is the Rand Mail Handler. Other implementations include nmh
1003and GNU mailutils." 1023and GNU mailutils."
1004 :link '(custom-manual "(mh-e)Top") 1024 :link '(custom-manual "(mh-e)Top")
1005 :group 'mail 1025 :group 'mail
1006 :package-version '(MH-E "8.0")) 1026 :package-version '(MH-E . "8.0"))
1007 1027
1008(mh-defgroup mh-alias nil 1028(mh-defgroup mh-alias nil
1009 "Aliases." 1029 "Aliases."
1010 :link '(custom-manual "(mh-e)Aliases") 1030 :link '(custom-manual "(mh-e)Aliases")
1011 :prefix "mh-alias-" 1031 :prefix "mh-alias-"
1012 :group 'mh-e 1032 :group 'mh-e
1013 :package-version '(MH-E "7.1")) 1033 :package-version '(MH-E . "7.1"))
1014 1034
1015(mh-defgroup mh-folder nil 1035(mh-defgroup mh-folder nil
1016 "Organizing your mail with folders." 1036 "Organizing your mail with folders."
1017 :prefix "mh-" 1037 :prefix "mh-"
1018 :link '(custom-manual "(mh-e)Folders") 1038 :link '(custom-manual "(mh-e)Folders")
1019 :group 'mh-e 1039 :group 'mh-e
1020 :package-version '(MH-E "7.1")) 1040 :package-version '(MH-E . "7.1"))
1021 1041
1022(mh-defgroup mh-folder-selection nil 1042(mh-defgroup mh-folder-selection nil
1023 "Folder selection." 1043 "Folder selection."
1024 :prefix "mh-" 1044 :prefix "mh-"
1025 :link '(custom-manual "(mh-e)Folder Selection") 1045 :link '(custom-manual "(mh-e)Folder Selection")
1026 :group 'mh-e 1046 :group 'mh-e
1027 :package-version '(MH-E "8.0")) 1047 :package-version '(MH-E . "8.0"))
1028 1048
1029(mh-defgroup mh-identity nil 1049(mh-defgroup mh-identity nil
1030 "Identities." 1050 "Identities."
1031 :link '(custom-manual "(mh-e)Identities") 1051 :link '(custom-manual "(mh-e)Identities")
1032 :prefix "mh-identity-" 1052 :prefix "mh-identity-"
1033 :group 'mh-e 1053 :group 'mh-e
1034 :package-version '(MH-E "7.1")) 1054 :package-version '(MH-E . "7.1"))
1035 1055
1036(mh-defgroup mh-inc nil 1056(mh-defgroup mh-inc nil
1037 "Incorporating your mail." 1057 "Incorporating your mail."
1038 :prefix "mh-inc-" 1058 :prefix "mh-inc-"
1039 :link '(custom-manual "(mh-e)Incorporating Mail") 1059 :link '(custom-manual "(mh-e)Incorporating Mail")
1040 :group 'mh-e 1060 :group 'mh-e
1041 :package-version '(MH-E "8.0")) 1061 :package-version '(MH-E . "8.0"))
1042 1062
1043(mh-defgroup mh-junk nil 1063(mh-defgroup mh-junk nil
1044 "Dealing with junk mail." 1064 "Dealing with junk mail."
1045 :link '(custom-manual "(mh-e)Junk") 1065 :link '(custom-manual "(mh-e)Junk")
1046 :prefix "mh-junk-" 1066 :prefix "mh-junk-"
1047 :group 'mh-e 1067 :group 'mh-e
1048 :package-version '(MH-E "7.3")) 1068 :package-version '(MH-E . "7.3"))
1049 1069
1050(mh-defgroup mh-letter nil 1070(mh-defgroup mh-letter nil
1051 "Editing a draft." 1071 "Editing a draft."
1052 :prefix "mh-" 1072 :prefix "mh-"
1053 :link '(custom-manual "(mh-e)Editing Drafts") 1073 :link '(custom-manual "(mh-e)Editing Drafts")
1054 :group 'mh-e 1074 :group 'mh-e
1055 :package-version '(MH-E "7.1")) 1075 :package-version '(MH-E . "7.1"))
1056 1076
1057(mh-defgroup mh-ranges nil 1077(mh-defgroup mh-ranges nil
1058 "Ranges." 1078 "Ranges."
1059 :prefix "mh-" 1079 :prefix "mh-"
1060 :link '(custom-manual "(mh-e)Ranges") 1080 :link '(custom-manual "(mh-e)Ranges")
1061 :group 'mh-e 1081 :group 'mh-e
1062 :package-version '(MH-E "8.0")) 1082 :package-version '(MH-E . "8.0"))
1063 1083
1064(mh-defgroup mh-scan-line-formats nil 1084(mh-defgroup mh-scan-line-formats nil
1065 "Scan line formats." 1085 "Scan line formats."
1066 :link '(custom-manual "(mh-e)Scan Line Formats") 1086 :link '(custom-manual "(mh-e)Scan Line Formats")
1067 :prefix "mh-" 1087 :prefix "mh-"
1068 :group 'mh-e 1088 :group 'mh-e
1069 :package-version '(MH-E "8.0")) 1089 :package-version '(MH-E . "8.0"))
1070 1090
1071(mh-defgroup mh-search nil 1091(mh-defgroup mh-search nil
1072 "Searching." 1092 "Searching."
1073 :link '(custom-manual "(mh-e)Searching") 1093 :link '(custom-manual "(mh-e)Searching")
1074 :prefix "mh-search-" 1094 :prefix "mh-search-"
1075 :group 'mh-e 1095 :group 'mh-e
1076 :package-version '(MH-E "8.0")) 1096 :package-version '(MH-E . "8.0"))
1077 1097
1078(mh-defgroup mh-sending-mail nil 1098(mh-defgroup mh-sending-mail nil
1079 "Sending mail." 1099 "Sending mail."
1080 :prefix "mh-" 1100 :prefix "mh-"
1081 :link '(custom-manual "(mh-e)Sending Mail") 1101 :link '(custom-manual "(mh-e)Sending Mail")
1082 :group 'mh-e 1102 :group 'mh-e
1083 :package-version '(MH-E "8.0")) 1103 :package-version '(MH-E . "8.0"))
1084 1104
1085(mh-defgroup mh-sequences nil 1105(mh-defgroup mh-sequences nil
1086 "Sequences." 1106 "Sequences."
1087 :prefix "mh-" 1107 :prefix "mh-"
1088 :link '(custom-manual "(mh-e)Sequences") 1108 :link '(custom-manual "(mh-e)Sequences")
1089 :group 'mh-e 1109 :group 'mh-e
1090 :package-version '(MH-E "8.0")) 1110 :package-version '(MH-E . "8.0"))
1091 1111
1092(mh-defgroup mh-show nil 1112(mh-defgroup mh-show nil
1093 "Reading your mail." 1113 "Reading your mail."
1094 :prefix "mh-" 1114 :prefix "mh-"
1095 :link '(custom-manual "(mh-e)Reading Mail") 1115 :link '(custom-manual "(mh-e)Reading Mail")
1096 :group 'mh-e 1116 :group 'mh-e
1097 :package-version '(MH-E "7.1")) 1117 :package-version '(MH-E . "7.1"))
1098 1118
1099(mh-defgroup mh-speedbar nil 1119(mh-defgroup mh-speedbar nil
1100 "The speedbar." 1120 "The speedbar."
1101 :prefix "mh-speed-" 1121 :prefix "mh-speed-"
1102 :link '(custom-manual "(mh-e)Speedbar") 1122 :link '(custom-manual "(mh-e)Speedbar")
1103 :group 'mh-e 1123 :group 'mh-e
1104 :package-version '(MH-E "8.0")) 1124 :package-version '(MH-E . "8.0"))
1105 1125
1106(mh-defgroup mh-thread nil 1126(mh-defgroup mh-thread nil
1107 "Threading." 1127 "Threading."
1108 :prefix "mh-thread-" 1128 :prefix "mh-thread-"
1109 :link '(custom-manual "(mh-e)Threading") 1129 :link '(custom-manual "(mh-e)Threading")
1110 :group 'mh-e 1130 :group 'mh-e
1111 :package-version '(MH-E "8.0")) 1131 :package-version '(MH-E . "8.0"))
1112 1132
1113(mh-defgroup mh-tool-bar nil 1133(mh-defgroup mh-tool-bar nil
1114 "The tool bar" 1134 "The tool bar"
1115 :link '(custom-manual "(mh-e)Tool Bar") 1135 :link '(custom-manual "(mh-e)Tool Bar")
1116 :prefix "mh-" 1136 :prefix "mh-"
1117 :group 'mh-e 1137 :group 'mh-e
1118 :package-version '(MH-E "8.0")) 1138 :package-version '(MH-E . "8.0"))
1119 1139
1120(mh-defgroup mh-hooks nil 1140(mh-defgroup mh-hooks nil
1121 "MH-E hooks." 1141 "MH-E hooks."
1122 :link '(custom-manual "(mh-e)Top") 1142 :link '(custom-manual "(mh-e)Top")
1123 :prefix "mh-" 1143 :prefix "mh-"
1124 :group 'mh-e 1144 :group 'mh-e
1125 :package-version '(MH-E "7.1")) 1145 :package-version '(MH-E . "7.1"))
1126 1146
1127(mh-defgroup mh-faces nil 1147(mh-defgroup mh-faces nil
1128 "Faces used in MH-E." 1148 "Faces used in MH-E."
@@ -1130,7 +1150,7 @@ and GNU mailutils."
1130 :prefix "mh-" 1150 :prefix "mh-"
1131 :group 'faces 1151 :group 'faces
1132 :group 'mh-e 1152 :group 'mh-e
1133 :package-version '(MH-E "7.1")) 1153 :package-version '(MH-E . "7.1"))
1134 1154
1135 1155
1136 1156
@@ -1149,7 +1169,7 @@ used to segregate completion of your aliases. You might use
1149lowercase for mailing lists and uppercase for people." 1169lowercase for mailing lists and uppercase for people."
1150 :type 'boolean 1170 :type 'boolean
1151 :group 'mh-alias 1171 :group 'mh-alias
1152 :package-version '(MH-E "7.1")) 1172 :package-version '(MH-E . "7.1"))
1153 1173
1154(mh-defcustom mh-alias-expand-aliases-flag nil 1174(mh-defcustom mh-alias-expand-aliases-flag nil
1155 "*Non-nil means to expand aliases entered in the minibuffer. 1175 "*Non-nil means to expand aliases entered in the minibuffer.
@@ -1159,7 +1179,7 @@ expanded to the full address in the message draft. By default,
1159this expansion is not performed." 1179this expansion is not performed."
1160 :type 'boolean 1180 :type 'boolean
1161 :group 'mh-alias 1181 :group 'mh-alias
1162 :package-version '(MH-E "7.1")) 1182 :package-version '(MH-E . "7.1"))
1163 1183
1164(mh-defcustom mh-alias-flash-on-comma t 1184(mh-defcustom mh-alias-flash-on-comma t
1165 "*Specify whether to flash address or warn on translation. 1185 "*Specify whether to flash address or warn on translation.
@@ -1172,7 +1192,7 @@ does not display a warning if the alias is not found."
1172 (const :tag "Flash and Warn If No Alias" 1) 1192 (const :tag "Flash and Warn If No Alias" 1)
1173 (const :tag "Don't Flash Nor Warn If No Alias" nil)) 1193 (const :tag "Don't Flash Nor Warn If No Alias" nil))
1174 :group 'mh-alias 1194 :group 'mh-alias
1175 :package-version '(MH-E "7.1")) 1195 :package-version '(MH-E . "7.1"))
1176 1196
1177(mh-defcustom mh-alias-insert-file nil 1197(mh-defcustom mh-alias-insert-file nil
1178 "*Filename used to store a new MH-E alias. 1198 "*Filename used to store a new MH-E alias.
@@ -1186,7 +1206,7 @@ name, MH-E will prompt for one of them when MH-E adds an alias."
1186 (file :tag "Alias File") 1206 (file :tag "Alias File")
1187 (repeat :tag "List of Alias Files" file)) 1207 (repeat :tag "List of Alias Files" file))
1188 :group 'mh-alias 1208 :group 'mh-alias
1189 :package-version '(MH-E "7.1")) 1209 :package-version '(MH-E . "7.1"))
1190 1210
1191(mh-defcustom mh-alias-insertion-location 'sorted 1211(mh-defcustom mh-alias-insertion-location 'sorted
1192 "Specifies where new aliases are entered in alias files. 1212 "Specifies where new aliases are entered in alias files.
@@ -1198,7 +1218,7 @@ or \"Bottom\" of your alias file might be more appropriate."
1198 (const :tag "Top" top) 1218 (const :tag "Top" top)
1199 (const :tag "Bottom" bottom)) 1219 (const :tag "Bottom" bottom))
1200 :group 'mh-alias 1220 :group 'mh-alias
1201 :package-version '(MH-E "7.1")) 1221 :package-version '(MH-E . "7.1"))
1202 1222
1203(mh-defcustom mh-alias-local-users t 1223(mh-defcustom mh-alias-local-users t
1204 "*If on, local users are added to alias completion. 1224 "*If on, local users are added to alias completion.
@@ -1219,7 +1239,7 @@ password file. For example, use \"ypcat passwd\" to obtain the
1219NIS password file." 1239NIS password file."
1220 :type '(choice (boolean) (string)) 1240 :type '(choice (boolean) (string))
1221 :group 'mh-alias 1241 :group 'mh-alias
1222 :package-version '(MH-E "7.1")) 1242 :package-version '(MH-E . "7.1"))
1223 1243
1224(mh-defcustom mh-alias-local-users-prefix "local." 1244(mh-defcustom mh-alias-local-users-prefix "local."
1225 "*String prefixed to the real names of users from the password file. 1245 "*String prefixed to the real names of users from the password file.
@@ -1241,7 +1261,7 @@ turned off."
1241 :type '(choice (const :tag "Use Login" nil) 1261 :type '(choice (const :tag "Use Login" nil)
1242 (string)) 1262 (string))
1243 :group 'mh-alias 1263 :group 'mh-alias
1244 :package-version '(MH-E "7.4")) 1264 :package-version '(MH-E . "7.4"))
1245 1265
1246(mh-defcustom mh-alias-passwd-gecos-comma-separator-flag t 1266(mh-defcustom mh-alias-passwd-gecos-comma-separator-flag t
1247 "*Non-nil means the gecos field in the password file uses a comma separator. 1267 "*Non-nil means the gecos field in the password file uses a comma separator.
@@ -1253,7 +1273,7 @@ gecos field in your password file is not separated by commas and
1253whose contents may contain commas, you can turn this option off." 1273whose contents may contain commas, you can turn this option off."
1254 :type 'boolean 1274 :type 'boolean
1255 :group 'mh-alias 1275 :group 'mh-alias
1256 :package-version '(MH-E "7.4")) 1276 :package-version '(MH-E . "7.4"))
1257 1277
1258;;; Organizing Your Mail with Folders (:group 'mh-folder) 1278;;; Organizing Your Mail with Folders (:group 'mh-folder)
1259 1279
@@ -1270,7 +1290,7 @@ See also `mh-recursive-folders-flag'."
1270 (const :tag "All" nil) 1290 (const :tag "All" nil)
1271 (repeat :tag "Choose Folders" (string :tag "Folder"))) 1291 (repeat :tag "Choose Folders" (string :tag "Folder")))
1272 :group 'mh-folder 1292 :group 'mh-folder
1273 :package-version '(MH-E "8.0")) 1293 :package-version '(MH-E . "8.0"))
1274 1294
1275(mh-defcustom mh-ticked-messages-folders t 1295(mh-defcustom mh-ticked-messages-folders t
1276 "Folders searched for `mh-tick-seq'. 1296 "Folders searched for `mh-tick-seq'.
@@ -1285,7 +1305,7 @@ See also `mh-recursive-folders-flag'."
1285 (const :tag "All" nil) 1305 (const :tag "All" nil)
1286 (repeat :tag "Choose Folders" (string :tag "Folder"))) 1306 (repeat :tag "Choose Folders" (string :tag "Folder")))
1287 :group 'mh-folder 1307 :group 'mh-folder
1288 :package-version '(MH-E "8.0")) 1308 :package-version '(MH-E . "8.0"))
1289 1309
1290(mh-defcustom mh-large-folder 200 1310(mh-defcustom mh-large-folder 200
1291 "The number of messages that indicates a large folder. 1311 "The number of messages that indicates a large folder.
@@ -1297,7 +1317,7 @@ is not automatically threaded, if it is large. If set to nil all
1297folders are treated as if they are small." 1317folders are treated as if they are small."
1298 :type '(choice (const :tag "No Limit") integer) 1318 :type '(choice (const :tag "No Limit") integer)
1299 :group 'mh-folder 1319 :group 'mh-folder
1300 :package-version '(MH-E "7.0")) 1320 :package-version '(MH-E . "7.0"))
1301 1321
1302(mh-defcustom mh-recenter-summary-flag nil 1322(mh-defcustom mh-recenter-summary-flag nil
1303 "*Non-nil means to recenter the summary window. 1323 "*Non-nil means to recenter the summary window.
@@ -1306,13 +1326,13 @@ If this option is turned on, recenter the summary window when the
1306show window is toggled off." 1326show window is toggled off."
1307 :type 'boolean 1327 :type 'boolean
1308 :group 'mh-folder 1328 :group 'mh-folder
1309 :package-version '(MH-E "7.0")) 1329 :package-version '(MH-E . "7.0"))
1310 1330
1311(mh-defcustom mh-recursive-folders-flag nil 1331(mh-defcustom mh-recursive-folders-flag nil
1312 "*Non-nil means that commands which operate on folders do so recursively." 1332 "*Non-nil means that commands which operate on folders do so recursively."
1313 :type 'boolean 1333 :type 'boolean
1314 :group 'mh-folder 1334 :group 'mh-folder
1315 :package-version '(MH-E "7.0")) 1335 :package-version '(MH-E . "7.0"))
1316 1336
1317(mh-defcustom mh-sortm-args nil 1337(mh-defcustom mh-sortm-args nil
1318 "*Additional arguments for \"sortm\"\\<mh-folder-mode-map>. 1338 "*Additional arguments for \"sortm\"\\<mh-folder-mode-map>.
@@ -1324,7 +1344,7 @@ an alternate view. For example, \"'(\"-nolimit\" \"-textfield\"
1324\"subject\")\" is a useful setting." 1344\"subject\")\" is a useful setting."
1325 :type 'string 1345 :type 'string
1326 :group 'mh-folder 1346 :group 'mh-folder
1327 :package-version '(MH-E "8.0")) 1347 :package-version '(MH-E . "8.0"))
1328 1348
1329;;; Folder Selection (:group 'mh-folder-selection) 1349;;; Folder Selection (:group 'mh-folder-selection)
1330 1350
@@ -1338,7 +1358,7 @@ sign. It can also return nil so that the last folder name is used as
1338the default, or an empty string to suppress the default entirely." 1358the default, or an empty string to suppress the default entirely."
1339 :type 'function 1359 :type 'function
1340 :group 'mh-folder-selection 1360 :group 'mh-folder-selection
1341 :package-version '(MH-E "8.0")) 1361 :package-version '(MH-E . "8.0"))
1342 1362
1343(mh-defcustom mh-default-folder-list nil 1363(mh-defcustom mh-default-folder-list nil
1344 "*List of addresses and folders. 1364 "*List of addresses and folders.
@@ -1356,7 +1376,7 @@ for more information."
1356 (string :tag "Folder") 1376 (string :tag "Folder")
1357 (boolean :tag "Check Recipient"))) 1377 (boolean :tag "Check Recipient")))
1358 :group 'mh-folder-selection 1378 :group 'mh-folder-selection
1359 :package-version '(MH-E "7.2")) 1379 :package-version '(MH-E . "7.2"))
1360 1380
1361(mh-defcustom mh-default-folder-must-exist-flag t 1381(mh-defcustom mh-default-folder-must-exist-flag t
1362 "*Non-nil means guessed folder name must exist to be used. 1382 "*Non-nil means guessed folder name must exist to be used.
@@ -1370,7 +1390,7 @@ See `mh-prompt-for-refile-folder' and `mh-folder-from-address'
1370for more information." 1390for more information."
1371 :type 'boolean 1391 :type 'boolean
1372 :group 'mh-folder-selection 1392 :group 'mh-folder-selection
1373 :package-version '(MH-E "7.2")) 1393 :package-version '(MH-E . "7.2"))
1374 1394
1375(mh-defcustom mh-default-folder-prefix "" 1395(mh-defcustom mh-default-folder-prefix ""
1376 "*Prefix used for folder names generated from aliases. 1396 "*Prefix used for folder names generated from aliases.
@@ -1380,7 +1400,7 @@ See `mh-prompt-for-refile-folder' and `mh-folder-from-address'
1380for more information." 1400for more information."
1381 :type 'string 1401 :type 'string
1382 :group 'mh-folder-selection 1402 :group 'mh-folder-selection
1383 :package-version '(MH-E "7.2")) 1403 :package-version '(MH-E . "7.2"))
1384 1404
1385;;; Identities (:group 'mh-identity) 1405;;; Identities (:group 'mh-identity)
1386 1406
@@ -1458,7 +1478,7 @@ fashion."
1458 (set-default symbol value) 1478 (set-default symbol value)
1459 (mh-identity-make-menu-no-autoload)) 1479 (mh-identity-make-menu-no-autoload))
1460 :group 'mh-identity 1480 :group 'mh-identity
1461 :package-version '(MH-E "7.1")) 1481 :package-version '(MH-E . "7.1"))
1462 1482
1463(mh-defcustom mh-auto-fields-list nil 1483(mh-defcustom mh-auto-fields-list nil
1464 "List of recipients for which header lines are automatically inserted. 1484 "List of recipients for which header lines are automatically inserted.
@@ -1519,14 +1539,14 @@ as the result is undefined."
1519 (string :tag "Field") 1539 (string :tag "Field")
1520 (string :tag "Value")))))) 1540 (string :tag "Value"))))))
1521 :group 'mh-identity 1541 :group 'mh-identity
1522 :package-version '(MH-E "7.3")) 1542 :package-version '(MH-E . "7.3"))
1523 1543
1524(mh-defcustom mh-auto-fields-prompt-flag t 1544(mh-defcustom mh-auto-fields-prompt-flag t
1525 "*Non-nil means to prompt before sending if fields inserted. 1545 "*Non-nil means to prompt before sending if fields inserted.
1526See `mh-auto-fields-list'." 1546See `mh-auto-fields-list'."
1527 :type 'boolean 1547 :type 'boolean
1528 :group 'mh-identity 1548 :group 'mh-identity
1529 :package-version '(MH-E "8.0")) 1549 :package-version '(MH-E . "8.0"))
1530 1550
1531(mh-defcustom mh-identity-default nil 1551(mh-defcustom mh-identity-default nil
1532 "Default identity to use when `mh-letter-mode' is called. 1552 "Default identity to use when `mh-letter-mode' is called.
@@ -1537,7 +1557,7 @@ See `mh-identity-list'."
1537 (mapcar (function (lambda (arg) `(const ,arg))) 1557 (mapcar (function (lambda (arg) `(const ,arg)))
1538 (mapcar 'car mh-identity-list)))) 1558 (mapcar 'car mh-identity-list))))
1539 :group 'mh-identity 1559 :group 'mh-identity
1540 :package-version '(MH-E "7.1")) 1560 :package-version '(MH-E . "7.1"))
1541 1561
1542(mh-defcustom mh-identity-handlers 1562(mh-defcustom mh-identity-handlers
1543 '(("From" . mh-identity-handler-top) 1563 '(("From" . mh-identity-handler-top)
@@ -1571,7 +1591,7 @@ fields (for example, \":signature\"), and the ACTION 'remove or
1571containing the VALUE for the field is given." 1591containing the VALUE for the field is given."
1572 :type '(repeat (cons (string :tag "Field") function)) 1592 :type '(repeat (cons (string :tag "Field") function))
1573 :group 'mh-identity 1593 :group 'mh-identity
1574 :package-version '(MH-E "8.0")) 1594 :package-version '(MH-E . "8.0"))
1575 1595
1576;;; Incorporating Your Mail (:group 'mh-inc) 1596;;; Incorporating Your Mail (:group 'mh-inc)
1577 1597
@@ -1585,7 +1605,7 @@ to be in the `mh-progs' directory. You may also link a file to
1585several scan line format variables appropriately." 1605several scan line format variables appropriately."
1586 :type 'string 1606 :type 'string
1587 :group 'mh-inc 1607 :group 'mh-inc
1588 :package-version '(MH-E "6.0")) 1608 :package-version '(MH-E . "6.0"))
1589 1609
1590(eval-and-compile 1610(eval-and-compile
1591 (unless (fboundp 'mh-inc-spool-make-no-autoload) 1611 (unless (fboundp 'mh-inc-spool-make-no-autoload)
@@ -1635,7 +1655,7 @@ fashion."
1635 (set-default symbol value) 1655 (set-default symbol value)
1636 (mh-inc-spool-make-no-autoload)) 1656 (mh-inc-spool-make-no-autoload))
1637 :group 'mh-inc 1657 :group 'mh-inc
1638 :package-version '(MH-E "7.3")) 1658 :package-version '(MH-E . "7.3"))
1639 1659
1640;;; Dealing with Junk Mail (:group 'mh-junk) 1660;;; Dealing with Junk Mail (:group 'mh-junk)
1641 1661
@@ -1677,14 +1697,14 @@ you might try turning on this option."
1677 :type '(choice (const :tag "Off" nil) 1697 :type '(choice (const :tag "Off" nil)
1678 (const :tag "On" 0)) 1698 (const :tag "On" 0))
1679 :group 'mh-junk 1699 :group 'mh-junk
1680 :package-version '(MH-E "8.0")) 1700 :package-version '(MH-E . "8.0"))
1681 1701
1682(mh-defcustom mh-junk-disposition nil 1702(mh-defcustom mh-junk-disposition nil
1683 "Disposition of junk mail." 1703 "Disposition of junk mail."
1684 :type '(choice (const :tag "Delete Spam" nil) 1704 :type '(choice (const :tag "Delete Spam" nil)
1685 (string :tag "Spam Folder")) 1705 (string :tag "Spam Folder"))
1686 :group 'mh-junk 1706 :group 'mh-junk
1687 :package-version '(MH-E "8.0")) 1707 :package-version '(MH-E . "8.0"))
1688 1708
1689(mh-defcustom mh-junk-program nil 1709(mh-defcustom mh-junk-program nil
1690 "Spam program that MH-E should use. 1710 "Spam program that MH-E should use.
@@ -1700,7 +1720,7 @@ bogofilter, then you can set this option to \"Bogofilter\"."
1700 (const :tag "SpamProbe" spamprobe)) 1720 (const :tag "SpamProbe" spamprobe))
1701 :set 'mh-junk-choose 1721 :set 'mh-junk-choose
1702 :group 'mh-junk 1722 :group 'mh-junk
1703 :package-version '(MH-E "7.3")) 1723 :package-version '(MH-E . "7.3"))
1704 1724
1705;;; Editing a Draft (:group 'mh-letter) 1725;;; Editing a Draft (:group 'mh-letter)
1706 1726
@@ -1716,7 +1736,7 @@ MH-style directives are preferred."
1716 :type '(choice (const :tag "MML" mml) 1736 :type '(choice (const :tag "MML" mml)
1717 (const :tag "MH" mh)) 1737 (const :tag "MH" mh))
1718 :group 'mh-letter 1738 :group 'mh-letter
1719 :package-version '(MH-E "7.0")) 1739 :package-version '(MH-E . "7.0"))
1720 1740
1721(mh-defcustom mh-compose-skipped-header-fields 1741(mh-defcustom mh-compose-skipped-header-fields
1722 '("From" "Organization" "References" "In-Reply-To" 1742 '("From" "Organization" "References" "In-Reply-To"
@@ -1724,13 +1744,13 @@ MH-style directives are preferred."
1724 "List of header fields to skip over when navigating in draft." 1744 "List of header fields to skip over when navigating in draft."
1725 :type '(repeat (string :tag "Field")) 1745 :type '(repeat (string :tag "Field"))
1726 :group 'mh-letter 1746 :group 'mh-letter
1727 :package-version '(MH-E "7.4")) 1747 :package-version '(MH-E . "7.4"))
1728 1748
1729(mh-defcustom mh-compose-space-does-completion-flag nil 1749(mh-defcustom mh-compose-space-does-completion-flag nil
1730 "*Non-nil means \\<mh-letter-mode-map>\\[mh-letter-complete-or-space] does completion in message header." 1750 "*Non-nil means \\<mh-letter-mode-map>\\[mh-letter-complete-or-space] does completion in message header."
1731 :type 'boolean 1751 :type 'boolean
1732 :group 'mh-letter 1752 :group 'mh-letter
1733 :package-version '(MH-E "7.4")) 1753 :package-version '(MH-E . "7.4"))
1734 1754
1735(mh-defcustom mh-delete-yanked-msg-window-flag nil 1755(mh-defcustom mh-delete-yanked-msg-window-flag nil
1736 "*Non-nil means delete any window displaying the message. 1756 "*Non-nil means delete any window displaying the message.
@@ -1740,7 +1760,7 @@ yanking it with \\<mh-letter-mode-map>\\[mh-yank-cur-msg] to make
1740more room on your screen for your reply." 1760more room on your screen for your reply."
1741 :type 'boolean 1761 :type 'boolean
1742 :group 'mh-letter 1762 :group 'mh-letter
1743 :package-version '(MH-E "7.0")) 1763 :package-version '(MH-E . "7.0"))
1744 1764
1745(mh-defcustom mh-extract-from-attribution-verb "wrote:" 1765(mh-defcustom mh-extract-from-attribution-verb "wrote:"
1746 "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg]. 1766 "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
@@ -1754,7 +1774,7 @@ followed by the content of this option. This option can be set to
1754 (const "schrieb:") 1774 (const "schrieb:")
1755 (string :tag "Custom String")) 1775 (string :tag "Custom String"))
1756 :group 'mh-letter 1776 :group 'mh-letter
1757 :package-version '(MH-E "7.0")) 1777 :package-version '(MH-E . "7.0"))
1758 1778
1759(mh-defcustom mh-ins-buf-prefix "> " 1779(mh-defcustom mh-ins-buf-prefix "> "
1760 "*String to put before each line of a yanked or inserted message. 1780 "*String to put before each line of a yanked or inserted message.
@@ -1770,7 +1790,7 @@ flavors of `mh-yank-behavior' or you have added a
1770`mail-citation-hook'." 1790`mail-citation-hook'."
1771 :type 'string 1791 :type 'string
1772 :group 'mh-letter 1792 :group 'mh-letter
1773 :package-version '(MH-E "6.0")) 1793 :package-version '(MH-E . "6.0"))
1774 1794
1775(mh-defcustom mh-letter-complete-function 'ispell-complete-word 1795(mh-defcustom mh-letter-complete-function 'ispell-complete-word
1776 "*Function to call when completing outside of address or folder fields. 1796 "*Function to call when completing outside of address or folder fields.
@@ -1780,7 +1800,7 @@ In the body of the message,
1780which is set to \"ispell-complete-word\" by default." 1800which is set to \"ispell-complete-word\" by default."
1781 :type '(choice function (const nil)) 1801 :type '(choice function (const nil))
1782 :group 'mh-letter 1802 :group 'mh-letter
1783 :package-version '(MH-E "7.1")) 1803 :package-version '(MH-E . "7.1"))
1784 1804
1785(mh-defcustom mh-letter-fill-column 72 1805(mh-defcustom mh-letter-fill-column 72
1786 "*Fill column to use in MH Letter mode. 1806 "*Fill column to use in MH Letter mode.
@@ -1789,7 +1809,7 @@ By default, this option is 72 to allow others to quote your
1789message without line wrapping." 1809message without line wrapping."
1790 :type 'integer 1810 :type 'integer
1791 :group 'mh-letter 1811 :group 'mh-letter
1792 :package-version '(MH-E "6.0")) 1812 :package-version '(MH-E . "6.0"))
1793 1813
1794(mh-defcustom mh-mml-method-default (if mh-pgp-support-flag "pgpmime" "none") 1814(mh-defcustom mh-mml-method-default (if mh-pgp-support-flag "pgpmime" "none")
1795 "Default method to use in security tags. 1815 "Default method to use in security tags.
@@ -1812,7 +1832,7 @@ you write!"
1812 (const :tag "S/MIME" "smime") 1832 (const :tag "S/MIME" "smime")
1813 (const :tag "None" "none")) 1833 (const :tag "None" "none"))
1814 :group 'mh-letter 1834 :group 'mh-letter
1815 :package-version '(MH-E "8.0")) 1835 :package-version '(MH-E . "8.0"))
1816 1836
1817(mh-defcustom mh-signature-file-name "~/.signature" 1837(mh-defcustom mh-signature-file-name "~/.signature"
1818 "*Source of user's signature. 1838 "*Source of user's signature.
@@ -1835,7 +1855,7 @@ The signature is inserted into your message with the command
1835`mh-identity-list'." 1855`mh-identity-list'."
1836 :type 'file 1856 :type 'file
1837 :group 'mh-letter 1857 :group 'mh-letter
1838 :package-version '(MH-E "6.0")) 1858 :package-version '(MH-E . "6.0"))
1839 1859
1840(mh-defcustom mh-signature-separator-flag t 1860(mh-defcustom mh-signature-separator-flag t
1841 "*Non-nil means a signature separator should be inserted. 1861 "*Non-nil means a signature separator should be inserted.
@@ -1846,7 +1866,7 @@ the signature differently, and to suppress the signature when
1846replying or yanking a letter into a draft." 1866replying or yanking a letter into a draft."
1847 :type 'boolean 1867 :type 'boolean
1848 :group 'mh-letter 1868 :group 'mh-letter
1849 :package-version '(MH-E "8.0")) 1869 :package-version '(MH-E . "8.0"))
1850 1870
1851(mh-defcustom mh-x-face-file "~/.face" 1871(mh-defcustom mh-x-face-file "~/.face"
1852 "*File containing face header field to insert in outgoing mail. 1872 "*File containing face header field to insert in outgoing mail.
@@ -1875,7 +1895,7 @@ To prevent the setting of any of these header fields, either set
1875this option doesn't exist." 1895this option doesn't exist."
1876 :type 'file 1896 :type 'file
1877 :group 'mh-letter 1897 :group 'mh-letter
1878 :package-version '(MH-E "7.0")) 1898 :package-version '(MH-E . "7.0"))
1879 1899
1880(mh-defcustom mh-yank-behavior 'attribution 1900(mh-defcustom mh-yank-behavior 'attribution
1881 "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg]. 1901 "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg].
@@ -1920,7 +1940,7 @@ inserted."
1920 (const :tag "Body With Attribution, Automatically" 1940 (const :tag "Body With Attribution, Automatically"
1921 autoattrib)) 1941 autoattrib))
1922 :group 'mh-letter 1942 :group 'mh-letter
1923 :package-version '(MH-E "8.0")) 1943 :package-version '(MH-E . "8.0"))
1924 1944
1925;;; Ranges (:group 'mh-ranges) 1945;;; Ranges (:group 'mh-ranges)
1926 1946
@@ -1933,7 +1953,7 @@ option is on (which is the default). If you need to scan just the
1933message 200, then use the range \"200:200\"." 1953message 200, then use the range \"200:200\"."
1934 :type 'boolean 1954 :type 'boolean
1935 :group 'mh-ranges 1955 :group 'mh-ranges
1936 :package-version '(MH-E "7.4")) 1956 :package-version '(MH-E . "7.4"))
1937 1957
1938;;; Scan Line Formats (:group 'mh-scan-line-formats) 1958;;; Scan Line Formats (:group 'mh-scan-line-formats)
1939 1959
@@ -1960,7 +1980,7 @@ you would use \"(mh-set-cmd-note 4)\"."
1960 :type 'boolean 1980 :type 'boolean
1961 :group 'mh-scan-line-formats 1981 :group 'mh-scan-line-formats
1962 :set 'mh-adaptive-cmd-note-flag-check 1982 :set 'mh-adaptive-cmd-note-flag-check
1963 :package-version '(MH-E "7.0")) 1983 :package-version '(MH-E . "7.0"))
1964 1984
1965(defun mh-scan-format-file-check (symbol value) 1985(defun mh-scan-format-file-check (symbol value)
1966 "Check if desired setting is legal. 1986 "Check if desired setting is legal.
@@ -1999,7 +2019,7 @@ Emacs start with 0)."
1999 (file :tag "Specify a scan Format File")) 2019 (file :tag "Specify a scan Format File"))
2000 :group 'mh-scan-line-formats 2020 :group 'mh-scan-line-formats
2001 :set 'mh-scan-format-file-check 2021 :set 'mh-scan-format-file-check
2002 :package-version '(MH-E "6.0")) 2022 :package-version '(MH-E . "6.0"))
2003 2023
2004(defun mh-adaptive-cmd-note-flag-check (symbol value) 2024(defun mh-adaptive-cmd-note-flag-check (symbol value)
2005 "Check if desired setting is legal. 2025 "Check if desired setting is legal.
@@ -2022,7 +2042,7 @@ directory. You may link another program to `scan' (see
2022\"mh-profile(5)\") to produce a different type of listing." 2042\"mh-profile(5)\") to produce a different type of listing."
2023 :type 'string 2043 :type 'string
2024 :group 'mh-scan-line-formats 2044 :group 'mh-scan-line-formats
2025 :package-version '(MH-E "6.0")) 2045 :package-version '(MH-E . "6.0"))
2026(make-variable-buffer-local 'mh-scan-prog) 2046(make-variable-buffer-local 'mh-scan-prog)
2027 2047
2028;;; Searching (:group 'mh-search) 2048;;; Searching (:group 'mh-search)
@@ -2046,7 +2066,7 @@ MH-E can be found in the documentation of `mh-search'."
2046 (const :tag "pick" pick) 2066 (const :tag "pick" pick)
2047 (const :tag "grep" grep)) 2067 (const :tag "grep" grep))
2048 :group 'mh-search 2068 :group 'mh-search
2049 :package-version '(MH-E "8.0")) 2069 :package-version '(MH-E . "8.0"))
2050 2070
2051;;; Sending Mail (:group 'mh-sending-mail) 2071;;; Sending Mail (:group 'mh-sending-mail)
2052 2072
@@ -2064,7 +2084,7 @@ forwarded messages will always be included as attachments
2064regardless of the settings of this option." 2084regardless of the settings of this option."
2065 :type 'boolean 2085 :type 'boolean
2066 :group 'mh-sending-mail 2086 :group 'mh-sending-mail
2067 :package-version '(MH-E "8.0")) 2087 :package-version '(MH-E . "8.0"))
2068 2088
2069(mh-defcustom mh-compose-letter-function nil 2089(mh-defcustom mh-compose-letter-function nil
2070 "Invoked when starting a new draft. 2090 "Invoked when starting a new draft.
@@ -2076,13 +2096,13 @@ three arguments: the contents of the TO, SUBJECT, and CC header
2076fields." 2096fields."
2077 :type '(choice (const nil) function) 2097 :type '(choice (const nil) function)
2078 :group 'mh-sending-mail 2098 :group 'mh-sending-mail
2079 :package-version '(MH-E "6.0")) 2099 :package-version '(MH-E . "6.0"))
2080 2100
2081(mh-defcustom mh-compose-prompt-flag nil 2101(mh-defcustom mh-compose-prompt-flag nil
2082 "*Non-nil means prompt for header fields when composing a new draft." 2102 "*Non-nil means prompt for header fields when composing a new draft."
2083 :type 'boolean 2103 :type 'boolean
2084 :group 'mh-sending-mail 2104 :group 'mh-sending-mail
2085 :package-version '(MH-E "7.4")) 2105 :package-version '(MH-E . "7.4"))
2086 2106
2087(mh-defcustom mh-forward-subject-format "%s: %s" 2107(mh-defcustom mh-forward-subject-format "%s: %s"
2088 "*Format string for forwarded message subject. 2108 "*Format string for forwarded message subject.
@@ -2092,7 +2112,7 @@ first \"%s\" is replaced with the sender of the original message,
2092and the second one is replaced with the original \"Subject:\"." 2112and the second one is replaced with the original \"Subject:\"."
2093 :type 'string 2113 :type 'string
2094 :group 'mh-sending-mail 2114 :group 'mh-sending-mail
2095 :package-version '(MH-E "6.0")) 2115 :package-version '(MH-E . "6.0"))
2096 2116
2097(mh-defcustom mh-insert-x-mailer-flag t 2117(mh-defcustom mh-insert-x-mailer-flag t
2098 "*Non-nil means append an \"X-Mailer:\" header field to the header. 2118 "*Non-nil means append an \"X-Mailer:\" header field to the header.
@@ -2102,7 +2122,7 @@ are using. If you don't want to participate in our marketing, you
2102can turn this option off." 2122can turn this option off."
2103 :type 'boolean 2123 :type 'boolean
2104 :group 'mh-sending-mail 2124 :group 'mh-sending-mail
2105 :package-version '(MH-E "7.0")) 2125 :package-version '(MH-E . "7.0"))
2106 2126
2107(mh-defcustom mh-redist-full-contents-flag nil 2127(mh-defcustom mh-redist-full-contents-flag nil
2108 "*Non-nil means the \"dist\" command needs entire letter for redistribution. 2128 "*Non-nil means the \"dist\" command needs entire letter for redistribution.
@@ -2114,7 +2134,7 @@ find that MH will not allow you to redistribute a message that
2114has been redistributed before, turn off this option." 2134has been redistributed before, turn off this option."
2115 :type 'boolean 2135 :type 'boolean
2116 :group 'mh-sending-mail 2136 :group 'mh-sending-mail
2117 :package-version '(MH-E "8.0")) 2137 :package-version '(MH-E . "8.0"))
2118 2138
2119(mh-defcustom mh-reply-default-reply-to nil 2139(mh-defcustom mh-reply-default-reply-to nil
2120 "*Sets the person or persons to whom a reply will be sent. 2140 "*Sets the person or persons to whom a reply will be sent.
@@ -2130,7 +2150,7 @@ this option to \"cc\". Other choices include \"from\", \"to\", or
2130 (const "cc") 2150 (const "cc")
2131 (const "all")) 2151 (const "all"))
2132 :group 'mh-sending-mail 2152 :group 'mh-sending-mail
2133 :package-version '(MH-E "6.0")) 2153 :package-version '(MH-E . "6.0"))
2134 2154
2135(mh-defcustom mh-reply-show-message-flag t 2155(mh-defcustom mh-reply-show-message-flag t
2136 "*Non-nil means the MH-Show buffer is displayed when replying. 2156 "*Non-nil means the MH-Show buffer is displayed when replying.
@@ -2141,7 +2161,7 @@ MH-Show buffer by turning off this option.
2141See also `mh-reply'." 2161See also `mh-reply'."
2142 :type 'boolean 2162 :type 'boolean
2143 :group 'mh-sending-mail 2163 :group 'mh-sending-mail
2144 :package-version '(MH-E "7.0")) 2164 :package-version '(MH-E . "7.0"))
2145 2165
2146;;; Sequences (:group 'mh-sequences) 2166;;; Sequences (:group 'mh-sequences)
2147 2167
@@ -2158,7 +2178,7 @@ sequences in the destination folder. If this behavior is not
2158desired, then turn off this option." 2178desired, then turn off this option."
2159 :type 'boolean 2179 :type 'boolean
2160 :group 'mh-sequences 2180 :group 'mh-sequences
2161 :package-version '(MH-E "7.4")) 2181 :package-version '(MH-E . "7.4"))
2162 2182
2163(mh-defcustom mh-tick-seq 'tick 2183(mh-defcustom mh-tick-seq 'tick
2164 "The name of the MH sequence for ticked messages. 2184 "The name of the MH sequence for ticked messages.
@@ -2170,7 +2190,7 @@ there isn't much advantage to that."
2170 :type '(choice (const :tag "Disable Ticking" nil) 2190 :type '(choice (const :tag "Disable Ticking" nil)
2171 symbol) 2191 symbol)
2172 :group 'mh-sequences 2192 :group 'mh-sequences
2173 :package-version '(MH-E "7.3")) 2193 :package-version '(MH-E . "7.3"))
2174 2194
2175(mh-defcustom mh-update-sequences-after-mh-show-flag t 2195(mh-defcustom mh-update-sequences-after-mh-show-flag t
2176 "*Non-nil means flush MH sequences to disk after message is shown\\<mh-folder-mode-map>. 2196 "*Non-nil means flush MH sequences to disk after message is shown\\<mh-folder-mode-map>.
@@ -2185,7 +2205,7 @@ this option. You can then update the state manually with the
2185commands." 2205commands."
2186 :type 'boolean 2206 :type 'boolean
2187 :group 'mh-sequences 2207 :group 'mh-sequences
2188 :package-version '(MH-E "7.0")) 2208 :package-version '(MH-E . "7.0"))
2189 2209
2190;;; Reading Your Mail (:group 'mh-show) 2210;;; Reading Your Mail (:group 'mh-show)
2191 2211
@@ -2198,7 +2218,7 @@ because of its proximity to its associated MH-Folder buffer. Try
2198running \\[electric-buffer-list] to see what I mean." 2218running \\[electric-buffer-list] to see what I mean."
2199 :type 'boolean 2219 :type 'boolean
2200 :group 'mh-show 2220 :group 'mh-show
2201 :package-version '(MH-E "7.0")) 2221 :package-version '(MH-E . "7.0"))
2202 2222
2203(mh-defcustom mh-clean-message-header-flag t 2223(mh-defcustom mh-clean-message-header-flag t
2204 "*Non-nil means remove extraneous header fields. 2224 "*Non-nil means remove extraneous header fields.
@@ -2207,7 +2227,7 @@ See also `mh-invisible-header-fields-default' and
2207`mh-invisible-header-fields'." 2227`mh-invisible-header-fields'."
2208 :type 'boolean 2228 :type 'boolean
2209 :group 'mh-show 2229 :group 'mh-show
2210 :package-version '(MH-E "7.0")) 2230 :package-version '(MH-E . "7.0"))
2211 2231
2212(mh-defcustom mh-decode-mime-flag (not (not (locate-library "mm-decode"))) 2232(mh-defcustom mh-decode-mime-flag (not (not (locate-library "mm-decode")))
2213 "*Non-nil means attachments are handled\\<mh-folder-mode-map>. 2233 "*Non-nil means attachments are handled\\<mh-folder-mode-map>.
@@ -2225,7 +2245,7 @@ messages and other graphical widgets. See the options
2225`mh-graphical-smileys-flag' and `mh-graphical-emphasis-flag'." 2245`mh-graphical-smileys-flag' and `mh-graphical-emphasis-flag'."
2226 :type 'boolean 2246 :type 'boolean
2227 :group 'mh-show 2247 :group 'mh-show
2228 :package-version '(MH-E "7.0")) 2248 :package-version '(MH-E . "7.0"))
2229 2249
2230(mh-defcustom mh-display-buttons-for-alternatives-flag nil 2250(mh-defcustom mh-display-buttons-for-alternatives-flag nil
2231 "*Non-nil means display buttons for all alternative attachments. 2251 "*Non-nil means display buttons for all alternative attachments.
@@ -2237,7 +2257,7 @@ displayed. If this option is on, then the preferred part is shown
2237inline and buttons are shown for each of the other alternatives." 2257inline and buttons are shown for each of the other alternatives."
2238 :type 'boolean 2258 :type 'boolean
2239 :group 'mh-show 2259 :group 'mh-show
2240 :package-version '(MH-E "7.4")) 2260 :package-version '(MH-E . "7.4"))
2241 2261
2242(mh-defcustom mh-display-buttons-for-inline-parts-flag nil 2262(mh-defcustom mh-display-buttons-for-inline-parts-flag nil
2243 "*Non-nil means display buttons for all inline attachments\\<mh-folder-mode-map>. 2263 "*Non-nil means display buttons for all inline attachments\\<mh-folder-mode-map>.
@@ -2260,7 +2280,7 @@ MH-E cannot display all attachments inline however. It can display
2260text (including HTML) and images." 2280text (including HTML) and images."
2261 :type 'boolean 2281 :type 'boolean
2262 :group 'mh-show 2282 :group 'mh-show
2263 :package-version '(MH-E "7.0")) 2283 :package-version '(MH-E . "7.0"))
2264 2284
2265(mh-defcustom mh-do-not-confirm-flag nil 2285(mh-defcustom mh-do-not-confirm-flag nil
2266 "*Non-nil means non-reversible commands do not prompt for confirmation. 2286 "*Non-nil means non-reversible commands do not prompt for confirmation.
@@ -2272,7 +2292,7 @@ performed--which is usually desired but cannot be
2272retracted--without question." 2292retracted--without question."
2273 :type 'boolean 2293 :type 'boolean
2274 :group 'mh-show 2294 :group 'mh-show
2275 :package-version '(MH-E "7.0")) 2295 :package-version '(MH-E . "7.0"))
2276 2296
2277(mh-defcustom mh-fetch-x-image-url nil 2297(mh-defcustom mh-fetch-x-image-url nil
2278 "*Control fetching of \"X-Image-URL:\" header field image. 2298 "*Control fetching of \"X-Image-URL:\" header field image.
@@ -2308,7 +2328,7 @@ turned on."
2308 :type '(choice (const :tag "Ask Before Fetching" ask) 2328 :type '(choice (const :tag "Ask Before Fetching" ask)
2309 (const :tag "Never Fetch" nil)) 2329 (const :tag "Never Fetch" nil))
2310 :group 'mh-show 2330 :group 'mh-show
2311 :package-version '(MH-E "7.3")) 2331 :package-version '(MH-E . "7.3"))
2312 2332
2313(mh-defcustom mh-graphical-smileys-flag t 2333(mh-defcustom mh-graphical-smileys-flag t
2314 "*Non-nil means graphical smileys are displayed. 2334 "*Non-nil means graphical smileys are displayed.
@@ -2323,7 +2343,7 @@ This option is disabled if the option `mh-decode-mime-flag' is
2323turned off." 2343turned off."
2324 :type 'boolean 2344 :type 'boolean
2325 :group 'mh-show 2345 :group 'mh-show
2326 :package-version '(MH-E "7.0")) 2346 :package-version '(MH-E . "7.0"))
2327 2347
2328(mh-defcustom mh-graphical-emphasis-flag t 2348(mh-defcustom mh-graphical-emphasis-flag t
2329 "*Non-nil means graphical emphasis is displayed. 2349 "*Non-nil means graphical emphasis is displayed.
@@ -2340,7 +2360,7 @@ This option is disabled if the option `mh-decode-mime-flag' is
2340turned off." 2360turned off."
2341 :type 'boolean 2361 :type 'boolean
2342 :group 'mh-show 2362 :group 'mh-show
2343 :package-version '(MH-E "7.0")) 2363 :package-version '(MH-E . "7.0"))
2344 2364
2345(mh-defcustom mh-highlight-citation-style 'gnus 2365(mh-defcustom mh-highlight-citation-style 'gnus
2346 "Style for highlighting citations. 2366 "Style for highlighting citations.
@@ -2356,7 +2376,7 @@ of citations entirely, choose \"None\"."
2356 (const :tag "Monochrome" font-lock) 2376 (const :tag "Monochrome" font-lock)
2357 (const :tag "None" nil)) 2377 (const :tag "None" nil))
2358 :group 'mh-show 2378 :group 'mh-show
2359 :package-version '(MH-E "8.0")) 2379 :package-version '(MH-E . "8.0"))
2360 2380
2361;; Keep fields alphabetized. Mention source, if known. 2381;; Keep fields alphabetized. Mention source, if known.
2362(defvar mh-invisible-header-fields-internal 2382(defvar mh-invisible-header-fields-internal
@@ -2588,7 +2608,7 @@ See also `mh-clean-message-header-flag'."
2588 (set-default symbol value) 2608 (set-default symbol value)
2589 (mh-invisible-headers)) 2609 (mh-invisible-headers))
2590 :group 'mh-show 2610 :group 'mh-show
2591 :package-version '(MH-E "7.1")) 2611 :package-version '(MH-E . "7.1"))
2592 2612
2593(mh-defcustom mh-invisible-header-fields-default nil 2613(mh-defcustom mh-invisible-header-fields-default nil
2594 "*List of hidden header fields. 2614 "*List of hidden header fields.
@@ -2606,7 +2626,7 @@ See also `mh-clean-message-header-flag'."
2606 (set-default symbol value) 2626 (set-default symbol value)
2607 (mh-invisible-headers)) 2627 (mh-invisible-headers))
2608 :group 'mh-show 2628 :group 'mh-show
2609 :package-version '(MH-E "8.0")) 2629 :package-version '(MH-E . "8.0"))
2610 2630
2611(defvar mh-invisible-header-fields-compiled nil 2631(defvar mh-invisible-header-fields-compiled nil
2612 "*Regexp matching lines in a message header that are not to be shown. 2632 "*Regexp matching lines in a message header that are not to be shown.
@@ -2658,7 +2678,7 @@ This options is not used by the commands \\[mh-ps-print-msg] or
2658\\[mh-ps-print-msg-file]." 2678\\[mh-ps-print-msg-file]."
2659 :type 'string 2679 :type 'string
2660 :group 'mh-show 2680 :group 'mh-show
2661 :package-version '(MH-E "6.0")) 2681 :package-version '(MH-E . "6.0"))
2662 2682
2663(mh-defcustom mh-max-inline-image-height nil 2683(mh-defcustom mh-max-inline-image-height nil
2664 "*Maximum inline image height if \"Content-Disposition:\" is not present. 2684 "*Maximum inline image height if \"Content-Disposition:\" is not present.
@@ -2674,7 +2694,7 @@ a large number. The size of your screen is a good choice for
2674these numbers." 2694these numbers."
2675 :type '(choice (const nil) integer) 2695 :type '(choice (const nil) integer)
2676 :group 'mh-show 2696 :group 'mh-show
2677 :package-version '(MH-E "7.0")) 2697 :package-version '(MH-E . "7.0"))
2678 2698
2679(mh-defcustom mh-max-inline-image-width nil 2699(mh-defcustom mh-max-inline-image-width nil
2680 "*Maximum inline image width if \"Content-Disposition:\" is not present. 2700 "*Maximum inline image width if \"Content-Disposition:\" is not present.
@@ -2690,7 +2710,7 @@ a large number. The size of your screen is a good choice for
2690these numbers." 2710these numbers."
2691 :type '(choice (const nil) integer) 2711 :type '(choice (const nil) integer)
2692 :group 'mh-show 2712 :group 'mh-show
2693 :package-version '(MH-E "7.0")) 2713 :package-version '(MH-E . "7.0"))
2694 2714
2695(mh-defcustom mh-mhl-format-file nil 2715(mh-defcustom mh-mhl-format-file nil
2696 "*Specifies the format file to pass to the \"mhl\" program. 2716 "*Specifies the format file to pass to the \"mhl\" program.
@@ -2714,7 +2734,7 @@ file."
2714 (const :tag "Use Default mhl Format" t) 2734 (const :tag "Use Default mhl Format" t)
2715 (file :tag "Specify an mhl Format File")) 2735 (file :tag "Specify an mhl Format File"))
2716 :group 'mh-show 2736 :group 'mh-show
2717 :package-version '(MH-E "8.0")) 2737 :package-version '(MH-E . "8.0"))
2718 2738
2719(mh-defcustom mh-mime-save-parts-default-directory t 2739(mh-defcustom mh-mime-save-parts-default-directory t
2720 "Default directory to use for \\<mh-folder-mode-map>\\[mh-mime-save-parts]. 2740 "Default directory to use for \\<mh-folder-mode-map>\\[mh-mime-save-parts].
@@ -2730,7 +2750,7 @@ directory's name."
2730 (const :tag "Prompt Always" t) 2750 (const :tag "Prompt Always" t)
2731 directory) 2751 directory)
2732 :group 'mh-show 2752 :group 'mh-show
2733 :package-version '(MH-E "7.0")) 2753 :package-version '(MH-E . "7.0"))
2734 2754
2735(mh-defcustom mh-print-background-flag nil 2755(mh-defcustom mh-print-background-flag nil
2736 "*Non-nil means messages should be printed in the background\\<mh-folder-mode-map>. 2756 "*Non-nil means messages should be printed in the background\\<mh-folder-mode-map>.
@@ -2746,7 +2766,7 @@ This option is not used by the commands \\[mh-ps-print-msg] or
2746\\[mh-ps-print-msg-file]." 2766\\[mh-ps-print-msg-file]."
2747 :type 'boolean 2767 :type 'boolean
2748 :group 'mh-show 2768 :group 'mh-show
2749 :package-version '(MH-E "7.0")) 2769 :package-version '(MH-E . "7.0"))
2750 2770
2751(mh-defcustom mh-show-maximum-size 0 2771(mh-defcustom mh-show-maximum-size 0
2752 "*Maximum size of message (in bytes) to display automatically. 2772 "*Maximum size of message (in bytes) to display automatically.
@@ -2756,7 +2776,7 @@ which may be slow to load. The default value of 0 means that all
2756message are shown regardless of size." 2776message are shown regardless of size."
2757 :type 'integer 2777 :type 'integer
2758 :group 'mh-show 2778 :group 'mh-show
2759 :package-version '(MH-E "8.0")) 2779 :package-version '(MH-E . "8.0"))
2760 2780
2761(mh-defcustom mh-show-use-xface-flag (>= emacs-major-version 21) 2781(mh-defcustom mh-show-use-xface-flag (>= emacs-major-version 21)
2762 "*Non-nil means display face images in MH-show buffers. 2782 "*Non-nil means display face images in MH-show buffers.
@@ -2796,7 +2816,7 @@ The option `mh-fetch-x-image-url' controls the fetching of the
2796\"X-Image-URL:\" header field image." 2816\"X-Image-URL:\" header field image."
2797 :type 'boolean 2817 :type 'boolean
2798 :group 'mh-show 2818 :group 'mh-show
2799 :package-version '(MH-E "7.0")) 2819 :package-version '(MH-E . "7.0"))
2800 2820
2801(mh-defcustom mh-store-default-directory nil 2821(mh-defcustom mh-store-default-directory nil
2802 "*Default directory for \\<mh-folder-mode-map>\\[mh-store-msg]. 2822 "*Default directory for \\<mh-folder-mode-map>\\[mh-store-msg].
@@ -2808,7 +2828,7 @@ the content of these messages."
2808 :type '(choice (const :tag "Current" nil) 2828 :type '(choice (const :tag "Current" nil)
2809 directory) 2829 directory)
2810 :group 'mh-show 2830 :group 'mh-show
2811 :package-version '(MH-E "6.0")) 2831 :package-version '(MH-E . "6.0"))
2812 2832
2813(mh-defcustom mh-summary-height nil 2833(mh-defcustom mh-summary-height nil
2814 "*Number of lines in MH-Folder buffer (including the mode line). 2834 "*Number of lines in MH-Folder buffer (including the mode line).
@@ -2821,7 +2841,7 @@ lines you'd like to see."
2821 :type '(choice (const :tag "Automatic" nil) 2841 :type '(choice (const :tag "Automatic" nil)
2822 (integer :tag "Fixed Size")) 2842 (integer :tag "Fixed Size"))
2823 :group 'mh-show 2843 :group 'mh-show
2824 :package-version '(MH-E "7.4")) 2844 :package-version '(MH-E . "7.4"))
2825 2845
2826;;; The Speedbar (:group 'mh-speedbar) 2846;;; The Speedbar (:group 'mh-speedbar)
2827 2847
@@ -2830,7 +2850,7 @@ lines you'd like to see."
2830Set to 0 to disable automatic update." 2850Set to 0 to disable automatic update."
2831 :type 'integer 2851 :type 'integer
2832 :group 'mh-speedbar 2852 :group 'mh-speedbar
2833 :package-version '(MH-E "8.0")) 2853 :package-version '(MH-E . "8.0"))
2834 2854
2835;;; Threading (:group 'mh-thread) 2855;;; Threading (:group 'mh-thread)
2836 2856
@@ -2843,7 +2863,7 @@ threading will be done only if the number of messages being
2843threaded is less than `mh-large-folder'." 2863threaded is less than `mh-large-folder'."
2844 :type 'boolean 2864 :type 'boolean
2845 :group 'mh-thread 2865 :group 'mh-thread
2846 :package-version '(MH-E "7.1")) 2866 :package-version '(MH-E . "7.1"))
2847 2867
2848;;; The Tool Bar (:group 'mh-tool-bar) 2868;;; The Tool Bar (:group 'mh-tool-bar)
2849 2869
@@ -2859,7 +2879,7 @@ of your own choosing."
2859 :type '(choice (const mh-search) 2879 :type '(choice (const mh-search)
2860 (function :tag "Other Function")) 2880 (function :tag "Other Function"))
2861 :group 'mh-tool-bar 2881 :group 'mh-tool-bar
2862 :package-version '(MH-E "7.0")) 2882 :package-version '(MH-E . "7.0"))
2863 2883
2864;; XEmacs has a couple of extra customizations... 2884;; XEmacs has a couple of extra customizations...
2865(mh-do-in-xemacs 2885(mh-do-in-xemacs
@@ -2877,7 +2897,7 @@ won't be able to turn on this option."
2877 (not mh-xemacs-has-tool-bar-flag)) 2897 (not mh-xemacs-has-tool-bar-flag))
2878 (error "Tool bar not supported")) 2898 (error "Tool bar not supported"))
2879 (set-default symbol value)) 2899 (set-default symbol value))
2880 :package-version '(MH-E "7.3")) 2900 :package-version '(MH-E . "7.3"))
2881 2901
2882 (mh-defcustom mh-xemacs-tool-bar-position nil 2902 (mh-defcustom mh-xemacs-tool-bar-position nil
2883 "*Tool bar location. 2903 "*Tool bar location.
@@ -2895,7 +2915,7 @@ default tool bar."
2895 (const :tag "Left" :value left) 2915 (const :tag "Left" :value left)
2896 (const :tag "Right" :value right)) 2916 (const :tag "Right" :value right))
2897 :group 'mh-tool-bar 2917 :group 'mh-tool-bar
2898 :package-version '(MH-E "7.3"))) 2918 :package-version '(MH-E . "7.3")))
2899 2919
2900 2920
2901 2921
@@ -2911,14 +2931,14 @@ folder, which is also available in `mh-current-folder'."
2911 :type 'hook 2931 :type 'hook
2912 :group 'mh-hooks 2932 :group 'mh-hooks
2913 :group 'mh-folder 2933 :group 'mh-folder
2914 :package-version '(MH-E "8.0")) 2934 :package-version '(MH-E . "8.0"))
2915 2935
2916(mh-defcustom mh-alias-reloaded-hook nil 2936(mh-defcustom mh-alias-reloaded-hook nil
2917 "Hook run by `mh-alias-reload' after loading aliases." 2937 "Hook run by `mh-alias-reload' after loading aliases."
2918 :type 'hook 2938 :type 'hook
2919 :group 'mh-hooks 2939 :group 'mh-hooks
2920 :group 'mh-alias 2940 :group 'mh-alias
2921 :package-version '(MH-E "8.0")) 2941 :package-version '(MH-E . "8.0"))
2922 2942
2923(mh-defcustom mh-before-commands-processed-hook nil 2943(mh-defcustom mh-before-commands-processed-hook nil
2924 "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] before performing outstanding refile and delete requests. 2944 "Hook run by \\<mh-folder-mode-map>\\[mh-execute-commands] before performing outstanding refile and delete requests.
@@ -2929,7 +2949,7 @@ be made to the current folder, `mh-current-folder'."
2929 :type 'hook 2949 :type 'hook
2930 :group 'mh-hooks 2950 :group 'mh-hooks
2931 :group 'mh-folder 2951 :group 'mh-folder
2932 :package-version '(MH-E "8.0")) 2952 :package-version '(MH-E . "8.0"))
2933 2953
2934(mh-defcustom mh-before-quit-hook nil 2954(mh-defcustom mh-before-quit-hook nil
2935 "Hook run by \\<mh-folder-mode-map>\\[mh-quit] before quitting MH-E. 2955 "Hook run by \\<mh-folder-mode-map>\\[mh-quit] before quitting MH-E.
@@ -2942,7 +2962,7 @@ See also `mh-quit-hook'."
2942 :type 'hook 2962 :type 'hook
2943 :group 'mh-hooks 2963 :group 'mh-hooks
2944 :group 'mh-folder 2964 :group 'mh-folder
2945 :package-version '(MH-E "6.0")) 2965 :package-version '(MH-E . "6.0"))
2946 2966
2947(mh-defcustom mh-before-send-letter-hook nil 2967(mh-defcustom mh-before-send-letter-hook nil
2948 "Hook run at the beginning of the \\<mh-letter-mode-map>\\[mh-send-letter] command. 2968 "Hook run at the beginning of the \\<mh-letter-mode-map>\\[mh-send-letter] command.
@@ -2953,7 +2973,7 @@ before sending, add the `ispell-message' function."
2953 :options '(ispell-message) 2973 :options '(ispell-message)
2954 :group 'mh-hooks 2974 :group 'mh-hooks
2955 :group 'mh-letter 2975 :group 'mh-letter
2956 :package-version '(MH-E "6.0")) 2976 :package-version '(MH-E . "6.0"))
2957 2977
2958(mh-defcustom mh-delete-msg-hook nil 2978(mh-defcustom mh-delete-msg-hook nil
2959 "Hook run by \\<mh-letter-mode-map>\\[mh-delete-msg] after marking each message for deletion. 2979 "Hook run by \\<mh-letter-mode-map>\\[mh-delete-msg] after marking each message for deletion.
@@ -2963,7 +2983,7 @@ kept statistics on his mail usage."
2963 :type 'hook 2983 :type 'hook
2964 :group 'mh-hooks 2984 :group 'mh-hooks
2965 :group 'mh-show 2985 :group 'mh-show
2966 :package-version '(MH-E "6.0")) 2986 :package-version '(MH-E . "6.0"))
2967 2987
2968(mh-defcustom mh-find-path-hook nil 2988(mh-defcustom mh-find-path-hook nil
2969 "Hook run by `mh-find-path' after reading the user's MH profile. 2989 "Hook run by `mh-find-path' after reading the user's MH profile.
@@ -2974,28 +2994,28 @@ between MH and MH-E."
2974 :type 'hook 2994 :type 'hook
2975 :group 'mh-hooks 2995 :group 'mh-hooks
2976 :group 'mh-e 2996 :group 'mh-e
2977 :package-version '(MH-E "7.0")) 2997 :package-version '(MH-E . "7.0"))
2978 2998
2979(mh-defcustom mh-folder-mode-hook nil 2999(mh-defcustom mh-folder-mode-hook nil
2980 "Hook run by `mh-folder-mode' when visiting a new folder." 3000 "Hook run by `mh-folder-mode' when visiting a new folder."
2981 :type 'hook 3001 :type 'hook
2982 :group 'mh-hooks 3002 :group 'mh-hooks
2983 :group 'mh-folder 3003 :group 'mh-folder
2984 :package-version '(MH-E "6.0")) 3004 :package-version '(MH-E . "6.0"))
2985 3005
2986(mh-defcustom mh-forward-hook nil 3006(mh-defcustom mh-forward-hook nil
2987 "Hook run by `mh-forward' on a forwarded letter." 3007 "Hook run by `mh-forward' on a forwarded letter."
2988 :type 'hook 3008 :type 'hook
2989 :group 'mh-hooks 3009 :group 'mh-hooks
2990 :group 'mh-sending-mail 3010 :group 'mh-sending-mail
2991 :package-version '(MH-E "8.0")) 3011 :package-version '(MH-E . "8.0"))
2992 3012
2993(mh-defcustom mh-inc-folder-hook nil 3013(mh-defcustom mh-inc-folder-hook nil
2994 "Hook run by \\<mh-folder-mode-map>\\[mh-inc-folder] after incorporating mail into a folder." 3014 "Hook run by \\<mh-folder-mode-map>\\[mh-inc-folder] after incorporating mail into a folder."
2995 :type 'hook 3015 :type 'hook
2996 :group 'mh-hooks 3016 :group 'mh-hooks
2997 :group 'mh-inc 3017 :group 'mh-inc
2998 :package-version '(MH-E "6.0")) 3018 :package-version '(MH-E . "6.0"))
2999 3019
3000(mh-defcustom mh-insert-signature-hook nil 3020(mh-defcustom mh-insert-signature-hook nil
3001 "Hook run by \\<mh-letter-mode-map>\\[mh-insert-signature] after signature has been inserted. 3021 "Hook run by \\<mh-letter-mode-map>\\[mh-insert-signature] after signature has been inserted.
@@ -3006,7 +3026,7 @@ function used to insert the signature with
3006 :type 'hook 3026 :type 'hook
3007 :group 'mh-hooks 3027 :group 'mh-hooks
3008 :group 'mh-letter 3028 :group 'mh-letter
3009 :package-version '(MH-E "8.0")) 3029 :package-version '(MH-E . "8.0"))
3010 3030
3011(mh-defcustom mh-kill-folder-suppress-prompt-hooks '(mh-search-p) 3031(mh-defcustom mh-kill-folder-suppress-prompt-hooks '(mh-search-p)
3012 "Abnormal hook run at the beginning of \\<mh-folder-mode-map>\\[mh-kill-folder]. 3032 "Abnormal hook run at the beginning of \\<mh-folder-mode-map>\\[mh-kill-folder].
@@ -3024,7 +3044,7 @@ accident in the \"+inbox\" folder, you will not be happy."
3024 :type 'hook 3044 :type 'hook
3025 :group 'mh-hooks 3045 :group 'mh-hooks
3026 :group 'mh-folder 3046 :group 'mh-folder
3027 :package-version '(MH-E "7.4")) 3047 :package-version '(MH-E . "7.4"))
3028 3048
3029(mh-defcustom mh-letter-mode-hook nil 3049(mh-defcustom mh-letter-mode-hook nil
3030 "Hook run by `mh-letter-mode' on a new letter. 3050 "Hook run by `mh-letter-mode' on a new letter.
@@ -3037,14 +3057,14 @@ go."
3037 :type 'hook 3057 :type 'hook
3038 :group 'mh-hooks 3058 :group 'mh-hooks
3039 :group 'mh-sending-mail 3059 :group 'mh-sending-mail
3040 :package-version '(MH-E "6.0")) 3060 :package-version '(MH-E . "6.0"))
3041 3061
3042(mh-defcustom mh-mh-to-mime-hook nil 3062(mh-defcustom mh-mh-to-mime-hook nil
3043 "Hook run on the formatted letter by \\<mh-letter-mode-map>\\[mh-mh-to-mime]." 3063 "Hook run on the formatted letter by \\<mh-letter-mode-map>\\[mh-mh-to-mime]."
3044 :type 'hook 3064 :type 'hook
3045 :group 'mh-hooks 3065 :group 'mh-hooks
3046 :group 'mh-letter 3066 :group 'mh-letter
3047 :package-version '(MH-E "8.0")) 3067 :package-version '(MH-E . "8.0"))
3048 3068
3049(mh-defcustom mh-search-mode-hook nil 3069(mh-defcustom mh-search-mode-hook nil
3050 "Hook run upon entry to `mh-search-mode'\\<mh-folder-mode-map>. 3070 "Hook run upon entry to `mh-search-mode'\\<mh-folder-mode-map>.
@@ -3056,7 +3076,7 @@ This can be done with this hook which is called when
3056 :type 'hook 3076 :type 'hook
3057 :group 'mh-hooks 3077 :group 'mh-hooks
3058 :group 'mh-search 3078 :group 'mh-search
3059 :package-version '(MH-E "8.0")) 3079 :package-version '(MH-E . "8.0"))
3060 3080
3061(mh-defcustom mh-quit-hook nil 3081(mh-defcustom mh-quit-hook nil
3062 "Hook run by \\<mh-folder-mode-map>\\[mh-quit] after quitting MH-E. 3082 "Hook run by \\<mh-folder-mode-map>\\[mh-quit] after quitting MH-E.
@@ -3068,14 +3088,14 @@ See also `mh-before-quit-hook'."
3068 :type 'hook 3088 :type 'hook
3069 :group 'mh-hooks 3089 :group 'mh-hooks
3070 :group 'mh-folder 3090 :group 'mh-folder
3071 :package-version '(MH-E "6.0")) 3091 :package-version '(MH-E . "6.0"))
3072 3092
3073(mh-defcustom mh-refile-msg-hook nil 3093(mh-defcustom mh-refile-msg-hook nil
3074 "Hook run by \\<mh-folder-mode-map>\\[mh-refile-msg] after marking each message for refiling." 3094 "Hook run by \\<mh-folder-mode-map>\\[mh-refile-msg] after marking each message for refiling."
3075 :type 'hook 3095 :type 'hook
3076 :group 'mh-hooks 3096 :group 'mh-hooks
3077 :group 'mh-folder 3097 :group 'mh-folder
3078 :package-version '(MH-E "6.0")) 3098 :package-version '(MH-E . "6.0"))
3079 3099
3080(mh-defcustom mh-show-hook nil 3100(mh-defcustom mh-show-hook nil
3081 "Hook run after \\<mh-folder-mode-map>\\[mh-show] shows a message. 3101 "Hook run after \\<mh-folder-mode-map>\\[mh-show] shows a message.
@@ -3086,7 +3106,7 @@ used to affect the behavior of MH-E in general or when
3086 :type 'hook 3106 :type 'hook
3087 :group 'mh-hooks 3107 :group 'mh-hooks
3088 :group 'mh-show 3108 :group 'mh-show
3089 :package-version '(MH-E "6.0")) 3109 :package-version '(MH-E . "6.0"))
3090 3110
3091(mh-defcustom mh-show-mode-hook nil 3111(mh-defcustom mh-show-mode-hook nil
3092 "Hook run upon entry to `mh-show-mode'. 3112 "Hook run upon entry to `mh-show-mode'.
@@ -3097,7 +3117,7 @@ message's content. See `mh-show-hook'."
3097 :type 'hook 3117 :type 'hook
3098 :group 'mh-hooks 3118 :group 'mh-hooks
3099 :group 'mh-show 3119 :group 'mh-show
3100 :package-version '(MH-E "6.0")) 3120 :package-version '(MH-E . "6.0"))
3101 3121
3102(mh-defcustom mh-unseen-updated-hook nil 3122(mh-defcustom mh-unseen-updated-hook nil
3103 "Hook run after the unseen sequence has been updated. 3123 "Hook run after the unseen sequence has been updated.
@@ -3108,7 +3128,7 @@ sequence."
3108 :type 'hook 3128 :type 'hook
3109 :group 'mh-hooks 3129 :group 'mh-hooks
3110 :group 'mh-sequences 3130 :group 'mh-sequences
3111 :package-version '(MH-E "6.0")) 3131 :package-version '(MH-E . "6.0"))
3112 3132
3113 3133
3114 3134
@@ -3326,7 +3346,7 @@ specified colors."
3326 "Recipient face." 3346 "Recipient face."
3327 :group 'mh-faces 3347 :group 'mh-faces
3328 :group 'mh-folder 3348 :group 'mh-folder
3329 :package-version '(MH-E "8.0")) 3349 :package-version '(MH-E . "8.0"))
3330 3350
3331(mh-defface mh-folder-body 3351(mh-defface mh-folder-body
3332 (mh-face-data 'mh-folder-msg-number 3352 (mh-face-data 'mh-folder-msg-number
@@ -3337,7 +3357,7 @@ specified colors."
3337 "Body text face." 3357 "Body text face."
3338 :group 'mh-faces 3358 :group 'mh-faces
3339 :group 'mh-folder 3359 :group 'mh-folder
3340 :package-version '(MH-E "8.0")) 3360 :package-version '(MH-E . "8.0"))
3341 3361
3342(mh-defface mh-folder-cur-msg-number 3362(mh-defface mh-folder-cur-msg-number
3343 (mh-face-data 'mh-folder-msg-number 3363 (mh-face-data 'mh-folder-msg-number
@@ -3345,39 +3365,39 @@ specified colors."
3345 "Current message number face." 3365 "Current message number face."
3346 :group 'mh-faces 3366 :group 'mh-faces
3347 :group 'mh-folder 3367 :group 'mh-folder
3348 :package-version '(MH-E "8.0")) 3368 :package-version '(MH-E . "8.0"))
3349 3369
3350(mh-defface mh-folder-date 3370(mh-defface mh-folder-date
3351 (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-msg-number)))) 3371 (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-msg-number))))
3352 "Date face." 3372 "Date face."
3353 :group 'mh-faces 3373 :group 'mh-faces
3354 :group 'mh-folder 3374 :group 'mh-folder
3355 :package-version '(MH-E "8.0")) 3375 :package-version '(MH-E . "8.0"))
3356 3376
3357(mh-defface mh-folder-deleted 3377(mh-defface mh-folder-deleted
3358 (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-msg-number)))) 3378 (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-msg-number))))
3359 "Deleted message face." 3379 "Deleted message face."
3360 :group 'mh-faces 3380 :group 'mh-faces
3361 :group 'mh-folder 3381 :group 'mh-folder
3362 :package-version '(MH-E "8.0")) 3382 :package-version '(MH-E . "8.0"))
3363 3383
3364(mh-defface mh-folder-followup (mh-face-data 'mh-folder-followup) 3384(mh-defface mh-folder-followup (mh-face-data 'mh-folder-followup)
3365 "\"Re:\" face." 3385 "\"Re:\" face."
3366 :group 'mh-faces 3386 :group 'mh-faces
3367 :group 'mh-folder 3387 :group 'mh-folder
3368 :package-version '(MH-E "8.0")) 3388 :package-version '(MH-E . "8.0"))
3369 3389
3370(mh-defface mh-folder-msg-number (mh-face-data 'mh-folder-msg-number) 3390(mh-defface mh-folder-msg-number (mh-face-data 'mh-folder-msg-number)
3371 "Message number face." 3391 "Message number face."
3372 :group 'mh-faces 3392 :group 'mh-faces
3373 :group 'mh-folder 3393 :group 'mh-folder
3374 :package-version '(MH-E "8.0")) 3394 :package-version '(MH-E . "8.0"))
3375 3395
3376(mh-defface mh-folder-refiled (mh-face-data 'mh-folder-refiled) 3396(mh-defface mh-folder-refiled (mh-face-data 'mh-folder-refiled)
3377 "Refiled message face." 3397 "Refiled message face."
3378 :group 'mh-faces 3398 :group 'mh-faces
3379 :group 'mh-folder 3399 :group 'mh-folder
3380 :package-version '(MH-E "8.0")) 3400 :package-version '(MH-E . "8.0"))
3381 3401
3382(mh-defface mh-folder-sent-to-me-hint 3402(mh-defface mh-folder-sent-to-me-hint
3383 (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-date)))) 3403 (mh-face-data 'mh-folder-msg-number '((t (:inherit mh-folder-date))))
@@ -3387,7 +3407,7 @@ format `mh-scan-format-nmh' and the regular expression
3387`mh-scan-sent-to-me-sender-regexp'." 3407`mh-scan-sent-to-me-sender-regexp'."
3388 :group 'mh-faces 3408 :group 'mh-faces
3389 :group 'mh-folder 3409 :group 'mh-folder
3390 :package-version '(MH-E "8.0")) 3410 :package-version '(MH-E . "8.0"))
3391 3411
3392(mh-defface mh-folder-sent-to-me-sender 3412(mh-defface mh-folder-sent-to-me-sender
3393 (mh-face-data 'mh-folder-followup '((t (:inherit mh-folder-followup)))) 3413 (mh-face-data 'mh-folder-followup '((t (:inherit mh-folder-followup))))
@@ -3397,98 +3417,98 @@ format `mh-scan-format-nmh' and the regular expression
3397`mh-scan-sent-to-me-sender-regexp'." 3417`mh-scan-sent-to-me-sender-regexp'."
3398 :group 'mh-faces 3418 :group 'mh-faces
3399 :group 'mh-folder 3419 :group 'mh-folder
3400 :package-version '(MH-E "8.0")) 3420 :package-version '(MH-E . "8.0"))
3401 3421
3402(mh-defface mh-folder-subject (mh-face-data 'mh-folder-subject) 3422(mh-defface mh-folder-subject (mh-face-data 'mh-folder-subject)
3403 "Subject face." 3423 "Subject face."
3404 :group 'mh-faces 3424 :group 'mh-faces
3405 :group 'mh-folder 3425 :group 'mh-folder
3406 :package-version '(MH-E "8.0")) 3426 :package-version '(MH-E . "8.0"))
3407 3427
3408(mh-defface mh-folder-tick (mh-face-data 'mh-folder-tick) 3428(mh-defface mh-folder-tick (mh-face-data 'mh-folder-tick)
3409 "Ticked message face." 3429 "Ticked message face."
3410 :group 'mh-faces 3430 :group 'mh-faces
3411 :group 'mh-folder 3431 :group 'mh-folder
3412 :package-version '(MH-E "8.0")) 3432 :package-version '(MH-E . "8.0"))
3413 3433
3414(mh-defface mh-folder-to (mh-face-data 'mh-folder-to) 3434(mh-defface mh-folder-to (mh-face-data 'mh-folder-to)
3415 "\"To:\" face." 3435 "\"To:\" face."
3416 :group 'mh-faces 3436 :group 'mh-faces
3417 :group 'mh-folder 3437 :group 'mh-folder
3418 :package-version '(MH-E "8.0")) 3438 :package-version '(MH-E . "8.0"))
3419 3439
3420(mh-defface mh-letter-header-field (mh-face-data 'mh-letter-header-field) 3440(mh-defface mh-letter-header-field (mh-face-data 'mh-letter-header-field)
3421 "Editable header field value face in draft buffers." 3441 "Editable header field value face in draft buffers."
3422 :group 'mh-faces 3442 :group 'mh-faces
3423 :group 'mh-letter 3443 :group 'mh-letter
3424 :package-version '(MH-E "8.0")) 3444 :package-version '(MH-E . "8.0"))
3425 3445
3426(mh-defface mh-search-folder (mh-face-data 'mh-search-folder) 3446(mh-defface mh-search-folder (mh-face-data 'mh-search-folder)
3427 "Folder heading face in MH-Folder buffers created by searches." 3447 "Folder heading face in MH-Folder buffers created by searches."
3428 :group 'mh-faces 3448 :group 'mh-faces
3429 :group 'mh-search 3449 :group 'mh-search
3430 :package-version '(MH-E "8.0")) 3450 :package-version '(MH-E . "8.0"))
3431 3451
3432(mh-defface mh-show-cc (mh-face-data 'mh-show-cc) 3452(mh-defface mh-show-cc (mh-face-data 'mh-show-cc)
3433 "Face used to highlight \"cc:\" header fields." 3453 "Face used to highlight \"cc:\" header fields."
3434 :group 'mh-faces 3454 :group 'mh-faces
3435 :group 'mh-show 3455 :group 'mh-show
3436 :package-version '(MH-E "8.0")) 3456 :package-version '(MH-E . "8.0"))
3437 3457
3438(mh-defface mh-show-date (mh-face-data 'mh-show-date) 3458(mh-defface mh-show-date (mh-face-data 'mh-show-date)
3439 "Face used to highlight \"Date:\" header fields." 3459 "Face used to highlight \"Date:\" header fields."
3440 :group 'mh-faces 3460 :group 'mh-faces
3441 :group 'mh-show 3461 :group 'mh-show
3442 :package-version '(MH-E "8.0")) 3462 :package-version '(MH-E . "8.0"))
3443 3463
3444(mh-defface mh-show-from (mh-face-data 'mh-show-from) 3464(mh-defface mh-show-from (mh-face-data 'mh-show-from)
3445 "Face used to highlight \"From:\" header fields." 3465 "Face used to highlight \"From:\" header fields."
3446 :group 'mh-faces 3466 :group 'mh-faces
3447 :group 'mh-show 3467 :group 'mh-show
3448 :package-version '(MH-E "8.0")) 3468 :package-version '(MH-E . "8.0"))
3449 3469
3450(mh-defface mh-show-header (mh-face-data 'mh-show-header) 3470(mh-defface mh-show-header (mh-face-data 'mh-show-header)
3451 "Face used to deemphasize less interesting header fields." 3471 "Face used to deemphasize less interesting header fields."
3452 :group 'mh-faces 3472 :group 'mh-faces
3453 :group 'mh-show 3473 :group 'mh-show
3454 :package-version '(MH-E "8.0")) 3474 :package-version '(MH-E . "8.0"))
3455 3475
3456(mh-defface mh-show-pgg-bad (mh-face-data 'mh-show-pgg-bad) 3476(mh-defface mh-show-pgg-bad (mh-face-data 'mh-show-pgg-bad)
3457 "Bad PGG signature face." 3477 "Bad PGG signature face."
3458 :group 'mh-faces 3478 :group 'mh-faces
3459 :group 'mh-show 3479 :group 'mh-show
3460 :package-version '(MH-E "8.0")) 3480 :package-version '(MH-E . "8.0"))
3461 3481
3462(mh-defface mh-show-pgg-good (mh-face-data 'mh-show-pgg-good) 3482(mh-defface mh-show-pgg-good (mh-face-data 'mh-show-pgg-good)
3463 "Good PGG signature face." 3483 "Good PGG signature face."
3464 :group 'mh-faces 3484 :group 'mh-faces
3465 :group 'mh-show 3485 :group 'mh-show
3466 :package-version '(MH-E "8.0")) 3486 :package-version '(MH-E . "8.0"))
3467 3487
3468(mh-defface mh-show-pgg-unknown (mh-face-data 'mh-show-pgg-unknown) 3488(mh-defface mh-show-pgg-unknown (mh-face-data 'mh-show-pgg-unknown)
3469 "Unknown or untrusted PGG signature face." 3489 "Unknown or untrusted PGG signature face."
3470 :group 'mh-faces 3490 :group 'mh-faces
3471 :group 'mh-show 3491 :group 'mh-show
3472 :package-version '(MH-E "8.0")) 3492 :package-version '(MH-E . "8.0"))
3473 3493
3474(mh-defface mh-show-signature (mh-face-data 'mh-show-signature) 3494(mh-defface mh-show-signature (mh-face-data 'mh-show-signature)
3475 "Signature face." 3495 "Signature face."
3476 :group 'mh-faces 3496 :group 'mh-faces
3477 :group 'mh-show 3497 :group 'mh-show
3478 :package-version '(MH-E "8.0")) 3498 :package-version '(MH-E . "8.0"))
3479 3499
3480(mh-defface mh-show-subject 3500(mh-defface mh-show-subject
3481 (mh-face-data 'mh-folder-subject '((t (:inherit mh-folder-subject)))) 3501 (mh-face-data 'mh-folder-subject '((t (:inherit mh-folder-subject))))
3482 "Face used to highlight \"Subject:\" header fields." 3502 "Face used to highlight \"Subject:\" header fields."
3483 :group 'mh-faces 3503 :group 'mh-faces
3484 :group 'mh-show 3504 :group 'mh-show
3485 :package-version '(MH-E "8.0")) 3505 :package-version '(MH-E . "8.0"))
3486 3506
3487(mh-defface mh-show-to (mh-face-data 'mh-show-to) 3507(mh-defface mh-show-to (mh-face-data 'mh-show-to)
3488 "Face used to highlight \"To:\" header fields." 3508 "Face used to highlight \"To:\" header fields."
3489 :group 'mh-faces 3509 :group 'mh-faces
3490 :group 'mh-show 3510 :group 'mh-show
3491 :package-version '(MH-E "8.0")) 3511 :package-version '(MH-E . "8.0"))
3492 3512
3493(mh-defface mh-show-xface 3513(mh-defface mh-show-xface
3494 (mh-face-data 'mh-show-from '((t (:inherit (mh-show-from highlight))))) 3514 (mh-face-data 'mh-show-from '((t (:inherit (mh-show-from highlight)))))
@@ -3496,13 +3516,13 @@ format `mh-scan-format-nmh' and the regular expression
3496The background and foreground are used in the image." 3516The background and foreground are used in the image."
3497 :group 'mh-faces 3517 :group 'mh-faces
3498 :group 'mh-show 3518 :group 'mh-show
3499 :package-version '(MH-E "8.0")) 3519 :package-version '(MH-E . "8.0"))
3500 3520
3501(mh-defface mh-speedbar-folder (mh-face-data 'mh-speedbar-folder) 3521(mh-defface mh-speedbar-folder (mh-face-data 'mh-speedbar-folder)
3502 "Basic folder face." 3522 "Basic folder face."
3503 :group 'mh-faces 3523 :group 'mh-faces
3504 :group 'mh-speedbar 3524 :group 'mh-speedbar
3505 :package-version '(MH-E "8.0")) 3525 :package-version '(MH-E . "8.0"))
3506 3526
3507(mh-defface mh-speedbar-folder-with-unseen-messages 3527(mh-defface mh-speedbar-folder-with-unseen-messages
3508 (mh-face-data 'mh-speedbar-folder 3528 (mh-face-data 'mh-speedbar-folder
@@ -3510,14 +3530,14 @@ The background and foreground are used in the image."
3510 "Folder face when folder contains unread messages." 3530 "Folder face when folder contains unread messages."
3511 :group 'mh-faces 3531 :group 'mh-faces
3512 :group 'mh-speedbar 3532 :group 'mh-speedbar
3513 :package-version '(MH-E "8.0")) 3533 :package-version '(MH-E . "8.0"))
3514 3534
3515(mh-defface mh-speedbar-selected-folder 3535(mh-defface mh-speedbar-selected-folder
3516 (mh-face-data 'mh-speedbar-selected-folder) 3536 (mh-face-data 'mh-speedbar-selected-folder)
3517 "Selected folder face." 3537 "Selected folder face."
3518 :group 'mh-faces 3538 :group 'mh-faces
3519 :group 'mh-speedbar 3539 :group 'mh-speedbar
3520 :package-version '(MH-E "8.0")) 3540 :package-version '(MH-E . "8.0"))
3521 3541
3522(mh-defface mh-speedbar-selected-folder-with-unseen-messages 3542(mh-defface mh-speedbar-selected-folder-with-unseen-messages
3523 (mh-face-data 'mh-speedbar-selected-folder 3543 (mh-face-data 'mh-speedbar-selected-folder
@@ -3525,7 +3545,7 @@ The background and foreground are used in the image."
3525 "Selected folder face when folder contains unread messages." 3545 "Selected folder face when folder contains unread messages."
3526 :group 'mh-faces 3546 :group 'mh-faces
3527 :group 'mh-speedbar 3547 :group 'mh-speedbar
3528 :package-version '(MH-E "8.0")) 3548 :package-version '(MH-E . "8.0"))
3529 3549
3530;; Get rid of temporary functions and data structures. 3550;; Get rid of temporary functions and data structures.
3531(fmakunbound 'mh-defcustom) 3551(fmakunbound 'mh-defcustom)
diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el
index 8fb65051a86..8516856f14e 100644
--- a/lisp/mh-e/mh-folder.el
+++ b/lisp/mh-e/mh-folder.el
@@ -522,11 +522,10 @@ font-lock is done highlighting.")
522 (add-to-list 'which-func-modes 'mh-folder-mode)) 522 (add-to-list 'which-func-modes 'mh-folder-mode))
523 523
524;; Shush compiler. 524;; Shush compiler.
525(eval-when-compile 525(defvar desktop-save-buffer)
526 (defvar desktop-save-buffer) 526(defvar font-lock-auto-fontify)
527 (defvar font-lock-auto-fontify) 527(defvar image-load-path)
528 (defvar image-load-path) 528(defvar font-lock-defaults) ; XEmacs
529 (mh-do-in-xemacs (defvar font-lock-defaults)))
530 529
531(defvar mh-folder-buttons-init-flag nil) 530(defvar mh-folder-buttons-init-flag nil)
532 531
diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
index 84b04d51c35..e97533e5724 100644
--- a/lisp/mh-e/mh-funcs.el
+++ b/lisp/mh-e/mh-funcs.el
@@ -138,7 +138,7 @@ Display the results only if something went wrong."
138 (display-buffer mh-temp-buffer))) 138 (display-buffer mh-temp-buffer)))
139 139
140;; Shush compiler. 140;; Shush compiler.
141(eval-when-compile (defvar view-exit-action)) 141(defvar view-exit-action)
142 142
143;;;###mh-autoload 143;;;###mh-autoload
144(defun mh-list-folders () 144(defun mh-list-folders ()
diff --git a/lisp/mh-e/mh-letter.el b/lisp/mh-e/mh-letter.el
index 024c1875eac..2da824c34c2 100644
--- a/lisp/mh-e/mh-letter.el
+++ b/lisp/mh-e/mh-letter.el
@@ -278,9 +278,8 @@ searching for `mh-mail-header-separator' in the buffer."
278(defvar mh-letter-buttons-init-flag nil) 278(defvar mh-letter-buttons-init-flag nil)
279 279
280;; Shush compiler. 280;; Shush compiler.
281(eval-when-compile 281(defvar image-load-path)
282 (defvar image-load-path) 282(defvar font-lock-defaults) ; XEmacs
283 (mh-do-in-xemacs (defvar font-lock-defaults)))
284 283
285;; Ensure new buffers won't get this mode if default-major-mode is nil. 284;; Ensure new buffers won't get this mode if default-major-mode is nil.
286(put 'mh-letter-mode 'mode-class 'special) 285(put 'mh-letter-mode 'mode-class 'special)
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index d35e759bcd4..c05e867a2b4 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -825,7 +825,9 @@ being used to highlight the signature in a MIME part."
825;;; Button Display 825;;; Button Display
826 826
827;; Shush compiler. 827;; Shush compiler.
828(eval-when-compile (mh-do-in-xemacs (defvar dots) (defvar type) (defvar ov))) 828(defvar dots) ; XEmacs
829(defvar type) ; XEmacs
830(defvar ov) ; XEmacs
829 831
830(defun mh-insert-mime-button (handle index displayed) 832(defun mh-insert-mime-button (handle index displayed)
831 "Insert MIME button for HANDLE. 833 "Insert MIME button for HANDLE.
@@ -870,12 +872,9 @@ by commands like \"K v\" which operate on individual MIME parts."
870 (mh-funcall-if-exists overlay-put ov 'evaporate t)))) 872 (mh-funcall-if-exists overlay-put ov 'evaporate t))))
871 873
872;; Shush compiler. 874;; Shush compiler.
873(eval-when-compile 875(defvar mm-verify-function-alist) ; < Emacs 22
874 (when (< emacs-major-version 22) 876(defvar mm-decrypt-function-alist) ; < Emacs 22
875 (defvar mm-verify-function-alist) 877(defvar pressed-details) ; XEmacs
876 (defvar mm-decrypt-function-alist))
877 (mh-do-in-xemacs
878 (defvar pressed-details)))
879 878
880(defun mh-insert-mime-security-button (handle) 879(defun mh-insert-mime-security-button (handle)
881 "Display buttons for PGP message, HANDLE." 880 "Display buttons for PGP message, HANDLE."
@@ -1537,7 +1536,7 @@ a prefix argument NOCONFIRM."
1537 (after-find-file nil))) 1536 (after-find-file nil)))
1538 1537
1539;; Shush compiler. 1538;; Shush compiler.
1540(eval-when-compile (defvar mh-identity-pgg-default-user-id)) 1539(defvar mh-identity-pgg-default-user-id)
1541 1540
1542;;;###mh-autoload 1541;;;###mh-autoload
1543(defun mh-mml-secure-message-encrypt (method) 1542(defun mh-mml-secure-message-encrypt (method)
diff --git a/lisp/mh-e/mh-search.el b/lisp/mh-e/mh-search.el
index 17b63c91000..14891204fad 100644
--- a/lisp/mh-e/mh-search.el
+++ b/lisp/mh-e/mh-search.el
@@ -324,7 +324,7 @@ folder containing the index search results."
324 count (> (hash-table-count msg-hash) 0))))))) 324 count (> (hash-table-count msg-hash) 0)))))))
325 325
326;; Shush compiler. 326;; Shush compiler.
327(eval-when-compile (mh-do-in-xemacs (defvar pick-folder))) 327(defvar pick-folder) ; XEmacs
328 328
329(defun mh-search-folder (folder window-config) 329(defun mh-search-folder (folder window-config)
330 "Search FOLDER for messages matching a pattern. 330 "Search FOLDER for messages matching a pattern.
@@ -404,10 +404,8 @@ or nothing to search all folders."
404 (mh-index-sequenced-messages folders mh-tick-seq)) 404 (mh-index-sequenced-messages folders mh-tick-seq))
405 405
406;; Shush compiler. 406;; Shush compiler.
407(eval-when-compile 407(defvar mh-mairix-folder) ; XEmacs
408 (mh-do-in-xemacs 408(defvar mh-flists-search-folders) ; XEmacs
409 (defvar mh-mairix-folder)
410 (defvar mh-flists-search-folders)))
411 409
412;;;###mh-autoload 410;;;###mh-autoload
413(defun mh-index-sequenced-messages (folders sequence) 411(defun mh-index-sequenced-messages (folders sequence)
@@ -1414,9 +1412,7 @@ being the list of messages originally from that folder."
1414(mh-require 'which-func nil t) 1412(mh-require 'which-func nil t)
1415 1413
1416;; Shush compiler. 1414;; Shush compiler.
1417(eval-when-compile 1415(defvar which-func-mode) ; < Emacs 22, XEmacs
1418 (if (or mh-xemacs-flag (< emacs-major-version 22))
1419 (defvar which-func-mode)))
1420 1416
1421;;;###mh-autoload 1417;;;###mh-autoload
1422(defun mh-index-create-imenu-index () 1418(defun mh-index-create-imenu-index ()
@@ -1441,7 +1437,7 @@ being the list of messages originally from that folder."
1441 mh-index-data) 1437 mh-index-data)
1442 1438
1443;; Shush compiler 1439;; Shush compiler
1444(eval-when-compile (if mh-xemacs-flag (defvar mh-speed-flists-inhibit-flag))) 1440(defvar mh-speed-flists-inhibit-flag) ; XEmacs
1445 1441
1446;;;###mh-autoload 1442;;;###mh-autoload
1447(defun mh-index-execute-commands () 1443(defun mh-index-execute-commands ()
diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el
index a5732d00bc6..ae260692b74 100644
--- a/lisp/mh-e/mh-seq.el
+++ b/lisp/mh-e/mh-seq.el
@@ -134,7 +134,7 @@ you want to delete the messages, use \"\\[universal-argument]
134 (apply #'mh-speed-flists t folders-changed)))) 134 (apply #'mh-speed-flists t folders-changed))))
135 135
136;; Shush compiler. 136;; Shush compiler.
137(eval-when-compile (defvar view-exit-action)) 137(defvar view-exit-action)
138 138
139;;;###mh-autoload 139;;;###mh-autoload
140(defun mh-list-sequences () 140(defun mh-list-sequences ()
@@ -202,7 +202,7 @@ MESSAGE appears."
202 " ")))) 202 " "))))
203 203
204;; Shush compiler. 204;; Shush compiler.
205(eval-when-compile (mh-do-in-xemacs (defvar tool-bar-mode))) 205(defvar tool-bar-mode) ; XEmacs
206 206
207;;;###mh-autoload 207;;;###mh-autoload
208(defun mh-narrow-to-seq (sequence) 208(defun mh-narrow-to-seq (sequence)
diff --git a/lisp/mh-e/mh-show.el b/lisp/mh-e/mh-show.el
index d7b656d3462..fb6698467da 100644
--- a/lisp/mh-e/mh-show.el
+++ b/lisp/mh-e/mh-show.el
@@ -815,7 +815,7 @@ operation."
815(put 'mh-show-mode 'mode-class 'special) 815(put 'mh-show-mode 'mode-class 'special)
816 816
817;; Shush compiler. 817;; Shush compiler.
818(eval-when-compile (defvar font-lock-auto-fontify)) 818(defvar font-lock-auto-fontify)
819 819
820;;;###mh-autoload 820;;;###mh-autoload
821(define-derived-mode mh-show-mode text-mode "MH-Show" 821(define-derived-mode mh-show-mode text-mode "MH-Show"
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index e41ee0bcc4f..46aed35be7b 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -657,7 +657,7 @@ See `expand-file-name' for description of DEFAULT."
657(defvar mh-folder-hist nil) 657(defvar mh-folder-hist nil)
658 658
659;; Shush compiler. 659;; Shush compiler.
660(eval-when-compile (defvar mh-speed-flists-cache)) 660(defvar mh-speed-flists-cache)
661 661
662(defvar mh-allow-root-folder-flag nil 662(defvar mh-allow-root-folder-flag nil
663 "Non-nil means \"+\" is an acceptable folder name. 663 "Non-nil means \"+\" is an acceptable folder name.
@@ -718,10 +718,8 @@ and FLAG determines whether the completion is over."
718 (t (file-exists-p path)))))))) 718 (t (file-exists-p path))))))))
719 719
720;; Shush compiler. 720;; Shush compiler.
721(eval-when-compile 721(defvar completion-root-regexp) ; XEmacs
722 (mh-do-in-xemacs 722(defvar minibuffer-completing-file-name) ; XEmacs
723 (defvar completion-root-regexp)
724 (defvar minibuffer-completing-file-name)))
725 723
726(defun mh-folder-completing-read (prompt default allow-root-folder-flag) 724(defun mh-folder-completing-read (prompt default allow-root-folder-flag)
727 "Read folder name with PROMPT and default result DEFAULT. 725 "Read folder name with PROMPT and default result DEFAULT.
diff --git a/lisp/mh-e/mh-xface.el b/lisp/mh-e/mh-xface.el
index 58d175f5470..deb2cebad14 100644
--- a/lisp/mh-e/mh-xface.el
+++ b/lisp/mh-e/mh-xface.el
@@ -60,8 +60,7 @@
60 (funcall mh-show-xface-function))) 60 (funcall mh-show-xface-function)))
61 61
62;; Shush compiler. 62;; Shush compiler.
63(eval-when-compile 63(defvar default-enable-multibyte-characters) ; XEmacs
64 (mh-do-in-xemacs (defvar default-enable-multibyte-characters)))
65 64
66(defun mh-face-display-function () 65(defun mh-face-display-function ()
67 "Display a Face, X-Face, or X-Image-URL header field. 66 "Display a Face, X-Face, or X-Image-URL header field.
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 58f74133cd5..5abd3dd36e4 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3584,6 +3584,10 @@ the result will be a local, non-Tramp, filename."
3584 "Global variable keeping asynchronous process object. 3584 "Global variable keeping asynchronous process object.
3585Used in `tramp-handle-shell-command'") 3585Used in `tramp-handle-shell-command'")
3586 3586
3587(defvar tramp-display-shell-command-buffer t
3588 "Whether to display output buffer of `shell-command'.
3589This is necessary for handling DISPLAY of `process-file'.")
3590
3587(defun tramp-handle-shell-command (command &optional output-buffer error-buffer) 3591(defun tramp-handle-shell-command (command &optional output-buffer error-buffer)
3588 "Like `shell-command' for tramp files. 3592 "Like `shell-command' for tramp files.
3589This will break if COMMAND prints a newline, followed by the value of 3593This will break if COMMAND prints a newline, followed by the value of
@@ -3692,7 +3696,8 @@ This will break if COMMAND prints a newline, followed by the value of
3692 (skip-chars-forward "^ ") 3696 (skip-chars-forward "^ ")
3693 (setq status (read (current-buffer))))) 3697 (setq status (read (current-buffer)))))
3694 (unless (zerop (buffer-size)) 3698 (unless (zerop (buffer-size))
3695 (display-buffer output-buffer)) 3699 (when tramp-display-shell-command-buffer
3700 (display-buffer output-buffer)))
3696 status)) 3701 status))
3697 ;; The following is only executed if something strange was 3702 ;; The following is only executed if something strange was
3698 ;; happening. Emit a helpful message and do it anyway. 3703 ;; happening. Emit a helpful message and do it anyway.
@@ -3707,11 +3712,10 @@ This will break if COMMAND prints a newline, followed by the value of
3707 (when (and (numberp buffer) (zerop buffer)) 3712 (when (and (numberp buffer) (zerop buffer))
3708 (error "Implementation does not handle immediate return")) 3713 (error "Implementation does not handle immediate return"))
3709 (when (consp buffer) (error "Implementation does not handle error files")) 3714 (when (consp buffer) (error "Implementation does not handle error files"))
3710 (shell-command 3715 (let ((tramp-display-shell-command-buffer display))
3711 (mapconcat 'tramp-shell-quote-argument 3716 (shell-command
3712 (cons program args) 3717 (mapconcat 'tramp-shell-quote-argument (cons program args) " ")
3713 " ") 3718 buffer)))
3714 buffer))
3715 3719
3716;; File Editing. 3720;; File Editing.
3717 3721
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 5fa9ac09b0b..877d5c9f399 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -895,6 +895,11 @@ indentation to be kept as it was before narrowing."
895 (delete-char n) 895 (delete-char n)
896 (setq ,bindent (- ,bindent n))))))))))) 896 (setq ,bindent (- ,bindent n)))))))))))
897 897
898(defun comment-add (arg)
899 (if (and (null arg) (= (string-match "[ \t]*\\'" comment-start) 1))
900 comment-add
901 (1- (prefix-numeric-value arg))))
902
898(defun comment-region-internal (beg end cs ce 903(defun comment-region-internal (beg end cs ce
899 &optional ccs cce block lines indent) 904 &optional ccs cce block lines indent)
900 "Comment region BEG .. END. 905 "Comment region BEG .. END.
@@ -999,7 +1004,6 @@ The strings used as comment starts are built from
999 1004
1000(defun comment-region-default (beg end &optional arg) 1005(defun comment-region-default (beg end &optional arg)
1001 (let* ((numarg (prefix-numeric-value arg)) 1006 (let* ((numarg (prefix-numeric-value arg))
1002 (add comment-add)
1003 (style (cdr (assoc comment-style comment-styles))) 1007 (style (cdr (assoc comment-style comment-styles)))
1004 (lines (nth 2 style)) 1008 (lines (nth 2 style))
1005 (block (nth 1 style)) 1009 (block (nth 1 style))
@@ -1032,8 +1036,7 @@ The strings used as comment starts are built from
1032 ((consp arg) (uncomment-region beg end)) 1036 ((consp arg) (uncomment-region beg end))
1033 ((< numarg 0) (uncomment-region beg end (- numarg))) 1037 ((< numarg 0) (uncomment-region beg end (- numarg)))
1034 (t 1038 (t
1035 (setq numarg (if (and (null arg) (= (length comment-start) 1)) 1039 (setq numarg (comment-add arg))
1036 add (1- numarg)))
1037 (comment-region-internal 1040 (comment-region-internal
1038 beg end 1041 beg end
1039 (let ((s (comment-padright comment-start numarg))) 1042 (let ((s (comment-padright comment-start numarg)))
@@ -1091,9 +1094,8 @@ You can configure `comment-style' to change the way regions are commented."
1091 ;; FIXME: If there's no comment to kill on this line and ARG is 1094 ;; FIXME: If there's no comment to kill on this line and ARG is
1092 ;; specified, calling comment-kill is not very clever. 1095 ;; specified, calling comment-kill is not very clever.
1093 (if arg (comment-kill (and (integerp arg) arg)) (comment-indent)) 1096 (if arg (comment-kill (and (integerp arg) arg)) (comment-indent))
1094 (let ((add (if arg (prefix-numeric-value arg) 1097 (let ((add (comment-add arg)))
1095 (if (= (length comment-start) 1) comment-add 0)))) 1098 ;; Some modes insist on keeping column 0 comment in column 0
1096 ;; Some modes insist on keeping column 0 comment in column 0
1097 ;; so we need to move away from it before inserting the comment. 1099 ;; so we need to move away from it before inserting the comment.
1098 (indent-according-to-mode) 1100 (indent-according-to-mode)
1099 (insert (comment-padright comment-start add)) 1101 (insert (comment-padright comment-start add))
diff --git a/lisp/pcvs-parse.el b/lisp/pcvs-parse.el
index 2053d8f5bd5..892dc962767 100644
--- a/lisp/pcvs-parse.el
+++ b/lisp/pcvs-parse.el
@@ -271,8 +271,8 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'."
271 ;; on the current branch (either because it only exists in other 271 ;; on the current branch (either because it only exists in other
272 ;; branches, or because it's been removed). 272 ;; branches, or because it's been removed).
273 (if (ignore-errors 273 (if (ignore-errors
274 (with-current-buffer 274 (with-temp-buffer
275 (find-file-noselect (expand-file-name 275 (insert-file-contents (expand-file-name
276 ".cvsignore" (file-name-directory dir))) 276 ".cvsignore" (file-name-directory dir)))
277 (goto-char (point-min)) 277 (goto-char (point-min))
278 (re-search-forward 278 (re-search-forward
diff --git a/lisp/play/landmark.el b/lisp/play/landmark.el
index 63d7a9fe33a..7ec6f9bb187 100644
--- a/lisp/play/landmark.el
+++ b/lisp/play/landmark.el
@@ -211,22 +211,24 @@
211(defvar lm-emacs-won () 211(defvar lm-emacs-won ()
212 "*For making font-lock use the winner's face for the line.") 212 "*For making font-lock use the winner's face for the line.")
213 213
214(defvar lm-font-lock-face-O 214(defface lm-font-lock-face-O '((((class color)) :foreground "red")
215 (if (display-color-p) 215 (t :weight bold))
216 (list (facemenu-get-face 'fg:red) 'bold)) 216 "*Face to use for Emacs' O."
217 "*Face to use for Emacs' O.") 217 :version "22.1"
218 :group 'lm)
218 219
219(defvar lm-font-lock-face-X 220(defface lm-font-lock-face-X '((((class color)) :foreground "green")
220 (if (display-color-p) 221 (t :weight bold))
221 (list (facemenu-get-face 'fg:green) 'bold)) 222 "*Face to use for your X."
222 "*Face to use for your X.") 223 :version "22.1"
224 :group 'lm)
223 225
224(defvar lm-font-lock-keywords 226(defvar lm-font-lock-keywords
225 '(("O" . lm-font-lock-face-O) 227 '(("O" . 'lm-font-lock-face-O)
226 ("X" . lm-font-lock-face-X) 228 ("X" . 'lm-font-lock-face-X)
227 ("[-|/\\]" 0 (if lm-emacs-won 229 ("[-|/\\]" 0 (if lm-emacs-won
228 lm-font-lock-face-O 230 'lm-font-lock-face-O
229 lm-font-lock-face-X))) 231 'lm-font-lock-face-X)))
230 "*Font lock rules for Lm.") 232 "*Font lock rules for Lm.")
231 233
232(put 'lm-mode 'front-sticky 234(put 'lm-mode 'front-sticky
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index b02df16b4f5..8120094f606 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -267,7 +267,8 @@ the evaluated constant value at compile time."
267 ["Hungry delete" c-toggle-hungry-state 267 ["Hungry delete" c-toggle-hungry-state
268 :style toggle :selected c-hungry-delete-key] 268 :style toggle :selected c-hungry-delete-key]
269 ["Subword mode" c-subword-mode 269 ["Subword mode" c-subword-mode
270 :style toggle :selected c-subword-mode]))) 270 :style toggle :selected (and (boundp 'c-subword-mode)
271 c-subword-mode)])))
271 272
272 273
273;;; Syntax tables. 274;;; Syntax tables.
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 9f527d12f9f..d6854d091fe 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -417,7 +417,8 @@ With arg, use separate IO iff arg is positive."
417 (goto-char (point-min)) 417 (goto-char (point-min))
418 (when (search-forward "read in on demand:" nil t) 418 (when (search-forward "read in on demand:" nil t)
419 (while (re-search-forward gdb-source-file-regexp nil t) 419 (while (re-search-forward gdb-source-file-regexp nil t)
420 (push (or (match-string 1) (match-string 2)) gdb-source-file-list)) 420 (push (file-name-nondirectory (or (match-string 1) (match-string 2)))
421 gdb-source-file-list))
421 (dolist (buffer (buffer-list)) 422 (dolist (buffer (buffer-list))
422 (with-current-buffer buffer 423 (with-current-buffer buffer
423 (when (and buffer-file-name 424 (when (and buffer-file-name
@@ -524,6 +525,7 @@ With arg, use separate IO iff arg is positive."
524 gdb-frame-number nil 525 gdb-frame-number nil
525 gdb-var-list nil 526 gdb-var-list nil
526 gdb-force-update t 527 gdb-force-update t
528 gdb-main-file nil
527 gdb-first-post-prompt t 529 gdb-first-post-prompt t
528 gdb-prompting nil 530 gdb-prompting nil
529 gdb-input-queue nil 531 gdb-input-queue nil
@@ -580,8 +582,7 @@ With arg, use separate IO iff arg is positive."
580 582
581(defun gdb-get-version () 583(defun gdb-get-version ()
582 (goto-char (point-min)) 584 (goto-char (point-min))
583 (if (and (re-search-forward gdb-error-regexp nil t) 585 (if (re-search-forward "Undefined\\( mi\\)* command:" nil t)
584 (string-match ".*(missing implementation)" (match-string 1)))
585 (setq gdb-version "pre-6.4") 586 (setq gdb-version "pre-6.4")
586 (setq gdb-version "6.4+")) 587 (setq gdb-version "6.4+"))
587 (gdb-init-2)) 588 (gdb-init-2))
@@ -2746,7 +2747,11 @@ corresponding to the mode line clicked."
2746 (switch-to-buffer 2747 (switch-to-buffer
2747 (if gud-last-last-frame 2748 (if gud-last-last-frame
2748 (gud-find-file (car gud-last-last-frame)) 2749 (gud-find-file (car gud-last-last-frame))
2749 (gud-find-file gdb-main-file))) 2750 (if gdb-main-file
2751 (gud-find-file gdb-main-file)
2752 ;; Put buffer list in window if we
2753 ;; can't find a source file.
2754 (list-buffers-noselect))))
2750 (when gdb-use-separate-io-buffer 2755 (when gdb-use-separate-io-buffer
2751 (split-window-horizontally) 2756 (split-window-horizontally)
2752 (other-window 1) 2757 (other-window 1)
@@ -3139,19 +3144,18 @@ BUFFER nil or omitted means use the current buffer."
3139 (if (re-search-forward "Stack level \\([0-9]+\\)" nil t) 3144 (if (re-search-forward "Stack level \\([0-9]+\\)" nil t)
3140 (setq gdb-frame-number (match-string 1))) 3145 (setq gdb-frame-number (match-string 1)))
3141 (goto-char (point-min)) 3146 (goto-char (point-min))
3142 (if (re-search-forward 3147 (when (re-search-forward ".*=\\s-+0x0*\\(\\S-*\\)\\s-+in\\s-+\\(\\S-+?\\)\
3143 ".*=\\s-+0x0*\\(\\S-*\\)\\s-+in\\s-+\\(\\S-*?\\) (\\(\\S-*?\\):[0-9]+?);? " 3148\\(?: (\\(\\S-+?\\):[0-9]+?)\\)*;? "
3144 nil t) 3149 nil t)
3145 (progn 3150 (setq gdb-selected-frame (match-string 2))
3146 (setq gdb-selected-frame (match-string 2)) 3151 (if (gdb-get-buffer 'gdb-locals-buffer)
3147 (if (gdb-get-buffer 'gdb-locals-buffer) 3152 (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer)
3148 (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer) 3153 (setq mode-name (concat "Locals:" gdb-selected-frame))))
3149 (setq mode-name (concat "Locals:" gdb-selected-frame)))) 3154 (if (gdb-get-buffer 'gdb-assembler-buffer)
3150 (if (gdb-get-buffer 'gdb-assembler-buffer) 3155 (with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer)
3151 (with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer) 3156 (setq mode-name (concat "Machine:" gdb-selected-frame))))
3152 (setq mode-name (concat "Machine:" gdb-selected-frame)))) 3157 (setq gdb-frame-address (match-string 1))
3153 (setq gdb-frame-address (match-string 1)))) 3158 (if (and (match-string 3) gud-overlay-arrow-position)
3154 (if gud-overlay-arrow-position
3155 (let ((buffer (marker-buffer gud-overlay-arrow-position)) 3159 (let ((buffer (marker-buffer gud-overlay-arrow-position))
3156 (position (marker-position gud-overlay-arrow-position))) 3160 (position (marker-position gud-overlay-arrow-position)))
3157 (when (and buffer (string-equal (buffer-name buffer) (match-string 3))) 3161 (when (and buffer (string-equal (buffer-name buffer) (match-string 3)))
@@ -3160,9 +3164,9 @@ BUFFER nil or omitted means use the current buffer."
3160 (if (string-equal gdb-frame-number "0") 3164 (if (string-equal gdb-frame-number "0")
3161 nil 3165 nil
3162 '((overlay-arrow . hollow-right-triangle)))) 3166 '((overlay-arrow . hollow-right-triangle))))
3163 (set-marker gud-overlay-arrow-position position))))) 3167 (set-marker gud-overlay-arrow-position position))))))
3164 (goto-char (point-min)) 3168 (goto-char (point-min))
3165 (if (re-search-forward " source language \\(\\S-*\\)\." nil t) 3169 (if (re-search-forward " source language \\(\\S-+\\)\." nil t)
3166 (setq gdb-current-language (match-string 1))) 3170 (setq gdb-current-language (match-string 1)))
3167 (gdb-invalidate-assembler)) 3171 (gdb-invalidate-assembler))
3168 3172
@@ -3281,11 +3285,12 @@ in_scope=\"\\(.*?\\)\".*?}")
3281 gdb-pending-triggers)) 3285 gdb-pending-triggers))
3282 (goto-char (point-min)) 3286 (goto-char (point-min))
3283 (if (re-search-forward gdb-error-regexp nil t) 3287 (if (re-search-forward gdb-error-regexp nil t)
3284 (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) 3288 (let ((err (match-string 1)))
3285 (let ((buffer-read-only nil)) 3289 (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
3286 (erase-buffer) 3290 (let ((buffer-read-only nil))
3287 (insert (match-string 1)) 3291 (erase-buffer)
3288 (goto-char (point-min)))) 3292 (insert err)
3293 (goto-char (point-min)))))
3289 (let ((register-list (reverse gdb-register-names)) 3294 (let ((register-list (reverse gdb-register-names))
3290 (register nil) (register-string nil) (register-values nil)) 3295 (register nil) (register-string nil) (register-values nil))
3291 (goto-char (point-min)) 3296 (goto-char (point-min))
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index d448aec47b8..43b33aa39ae 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -721,7 +721,10 @@ changed by, or (parse-state) if line starts in a quoted string."
721 (save-excursion 721 (save-excursion
722 (forward-char 1) 722 (forward-char 1)
723 (forward-sexp -1) 723 (forward-sexp -1)
724 (perl-indent-new-calculate 'virtual nil parse-start))) 724 (perl-indent-new-calculate
725 ;; Recalculate the parsing-start, since we may have jumped
726 ;; dangerously close (typically in the case of nested functions).
727 'virtual nil (save-excursion (perl-beginning-of-function)))))
725 (and (and (= (following-char) ?{) 728 (and (and (= (following-char) ?{)
726 (save-excursion (forward-char) (perl-hanging-paren-p))) 729 (save-excursion (forward-char) (perl-hanging-paren-p)))
727 (+ (or default (perl-calculate-indent parse-start)) 730 (+ (or default (perl-calculate-indent parse-start))
diff --git a/lisp/simple.el b/lisp/simple.el
index 108ca8b10bd..36b2d8b8f21 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2332,7 +2332,7 @@ return value of `filter-buffer-substring'.
2332 2332
2333If this variable is nil, no filtering is performed.") 2333If this variable is nil, no filtering is performed.")
2334 2334
2335(defun filter-buffer-substring (beg end &optional delete) 2335(defun filter-buffer-substring (beg end &optional delete noprops)
2336 "Return the buffer substring between BEG and END, after filtering. 2336 "Return the buffer substring between BEG and END, after filtering.
2337The buffer substring is passed through each of the filter 2337The buffer substring is passed through each of the filter
2338functions in `buffer-substring-filters', and the value from the 2338functions in `buffer-substring-filters', and the value from the
@@ -2342,21 +2342,36 @@ is nil, the buffer substring is returned unaltered.
2342If DELETE is non-nil, the text between BEG and END is deleted 2342If DELETE is non-nil, the text between BEG and END is deleted
2343from the buffer. 2343from the buffer.
2344 2344
2345If NOPROPS is non-nil, final string returned does not include
2346text properties, while the string passed to the filters still
2347includes text properties from the buffer text.
2348
2345Point is temporarily set to BEG before calling 2349Point is temporarily set to BEG before calling
2346`buffer-substring-filters', in case the functions need to know 2350`buffer-substring-filters', in case the functions need to know
2347where the text came from. 2351where the text came from.
2348 2352
2349This function should be used instead of `buffer-substring' or 2353This function should be used instead of `buffer-substring',
2350`delete-and-extract-region' when you want to allow filtering to 2354`buffer-substring-no-properties', or `delete-and-extract-region'
2351take place. For example, major or minor modes can use 2355when you want to allow filtering to take place. For example,
2352`buffer-substring-filters' to extract characters that are special 2356major or minor modes can use `buffer-substring-filters' to
2353to a buffer, and should not be copied into other buffers." 2357extract characters that are special to a buffer, and should not
2354 (save-excursion 2358be copied into other buffers."
2355 (goto-char beg) 2359 (cond
2356 (let ((string (if delete (delete-and-extract-region beg end) 2360 ((or delete buffer-substring-filters)
2357 (buffer-substring beg end)))) 2361 (save-excursion
2358 (dolist (filter buffer-substring-filters string) 2362 (goto-char beg)
2359 (setq string (funcall filter string)))))) 2363 (let ((string (if delete (delete-and-extract-region beg end)
2364 (buffer-substring beg end))))
2365 (dolist (filter buffer-substring-filters)
2366 (setq string (funcall filter string)))
2367 (if noprops
2368 (set-text-properties 0 (length string) nil string))
2369 string)))
2370 (noprops
2371 (buffer-substring-no-properties beg end))
2372 (t
2373 (buffer-substring beg end))))
2374
2360 2375
2361;;;; Window system cut and paste hooks. 2376;;;; Window system cut and paste hooks.
2362 2377
@@ -3742,7 +3757,7 @@ If point reaches the beginning or end of buffer, it stops there.
3742To ignore intangibility, bind `inhibit-point-motion-hooks' to t." 3757To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
3743 (interactive "p") 3758 (interactive "p")
3744 (or arg (setq arg 1)) 3759 (or arg (setq arg 1))
3745 3760
3746 (let ((orig (point))) 3761 (let ((orig (point)))
3747 3762
3748 ;; Move by lines, if ARG is not 1 (the default). 3763 ;; Move by lines, if ARG is not 1 (the default).
diff --git a/lisp/startup.el b/lisp/startup.el
index 5641686e30e..c28fc728145 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -1538,17 +1538,15 @@ Type \\[describe-distribution] for information on getting the latest version."))
1538 ;; Display the input that we set up in the buffer. 1538 ;; Display the input that we set up in the buffer.
1539 (set-buffer-modified-p nil) 1539 (set-buffer-modified-p nil)
1540 (goto-char (point-min)) 1540 (goto-char (point-min))
1541 (save-window-excursion 1541 (if (or (window-minibuffer-p)
1542 (condition-case nil 1542 (window-dedicated-p (selected-window)))
1543 (switch-to-buffer (current-buffer)) 1543 ;; There's no point is using pop-to-buffer since creating
1544 ;; In case we're in a dedicated or minibuffer-only window. 1544 ;; a new frame will generate enough events that the
1545 (error 1545 ;; subsequent `sit-for' will immediately return anyway.
1546 ;; There's no point is using pop-to-buffer since creating 1546 nil ;; (pop-to-buffer (current-buffer))
1547 ;; a new frame will generate enough events that the 1547 (save-window-excursion
1548 ;; subsequent `sit-for' will immediately return anyway. 1548 (switch-to-buffer (current-buffer))
1549 ;; (pop-to-buffer (current-buffer)) 1549 (sit-for 120))))
1550 ))
1551 (sit-for 120)))
1552 ;; Unwind ... ensure splash buffer is killed 1550 ;; Unwind ... ensure splash buffer is killed
1553 (kill-buffer "GNU Emacs")))) 1551 (kill-buffer "GNU Emacs"))))
1554 1552
diff --git a/lisp/subr.el b/lisp/subr.el
index ddf79aaf706..5e18eaa5992 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1540,7 +1540,8 @@ by doing (clear-string STRING)."
1540 (let ((pass nil) 1540 (let ((pass nil)
1541 (c 0) 1541 (c 0)
1542 (echo-keystrokes 0) 1542 (echo-keystrokes 0)
1543 (cursor-in-echo-area t)) 1543 (cursor-in-echo-area t)
1544 (message-log-max nil))
1544 (add-text-properties 0 (length prompt) 1545 (add-text-properties 0 (length prompt)
1545 minibuffer-prompt-properties prompt) 1546 minibuffer-prompt-properties prompt)
1546 (while (progn (message "%s%s" 1547 (while (progn (message "%s%s"
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index daca0502454..ff1c1e48eb0 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -2856,25 +2856,45 @@ is non-nil."
2856 (bibtex-autofill-entry)) 2856 (bibtex-autofill-entry))
2857 (run-hooks 'bibtex-add-entry-hook))) 2857 (run-hooks 'bibtex-add-entry-hook)))
2858 2858
2859(defun bibtex-entry-update () 2859(defun bibtex-entry-update (&optional entry-type)
2860 "Update an existing BibTeX entry. 2860 "Update an existing BibTeX entry.
2861In the BibTeX entry at point, make new fields for those items that may occur 2861In the BibTeX entry at point, make new fields for those items that may occur
2862according to `bibtex-field-list', but are not yet present." 2862according to `bibtex-field-list', but are not yet present.
2863 (interactive) 2863Also, add field delimiters to numerical fields if they are not present.
2864If ENTRY-TYPE is non-nil, change first the entry type to ENTRY-TYPE.
2865When called interactively with a prefix arg, query for a value of ENTRY-TYPE."
2866 (interactive
2867 (list (if current-prefix-arg
2868 (let ((completion-ignore-case t))
2869 (completing-read "New entry type: " bibtex-entry-field-alist
2870 nil t nil 'bibtex-entry-type-history)))))
2864 (save-excursion 2871 (save-excursion
2865 (bibtex-beginning-of-entry) 2872 (bibtex-beginning-of-entry)
2866 ;; For inserting new fields, we use the fact that 2873 (when (looking-at bibtex-entry-maybe-empty-head)
2867 ;; `bibtex-parse-entry' moves point to the end of the last field. 2874 (goto-char (match-end 0))
2868 (let* ((fields-alist (bibtex-parse-entry)) 2875 (if entry-type
2869 (field-list (bibtex-field-list 2876 (save-excursion
2870 (cdr (assoc "=type=" fields-alist))))) 2877 (replace-match (concat "@" entry-type) nil nil nil 1))
2871 (skip-chars-backward " \t\n") 2878 (setq entry-type (bibtex-type-in-head)))
2872 (dolist (field (car field-list)) 2879 (let* ((field-list (bibtex-field-list entry-type))
2873 (unless (assoc-string (car field) fields-alist t) 2880 (required (copy-tree (car field-list)))
2874 (bibtex-make-field field))) 2881 (optional (copy-tree (cdr field-list)))
2875 (dolist (field (cdr field-list)) 2882 bounds)
2876 (unless (assoc-string (car field) fields-alist t) 2883 (while (setq bounds (bibtex-parse-field))
2877 (bibtex-make-optional-field field)))))) 2884 (let ((fname (bibtex-name-in-field bounds t))
2885 (end (copy-marker (bibtex-end-of-field bounds) t)))
2886 (setq required (delete (assoc-string fname required t) required)
2887 optional (delete (assoc-string fname optional t) optional))
2888 (when (string-match "\\`[0-9]+\\'"
2889 (bibtex-text-in-field-bounds bounds))
2890 (goto-char (bibtex-end-of-text-in-field bounds))
2891 (insert (bibtex-field-right-delimiter))
2892 (goto-char (bibtex-start-of-text-in-field bounds))
2893 (insert (bibtex-field-left-delimiter)))
2894 (goto-char end)))
2895 (skip-chars-backward " \t\n")
2896 (dolist (field required) (bibtex-make-field field))
2897 (dolist (field optional) (bibtex-make-optional-field field))))))
2878 2898
2879(defun bibtex-parse-entry (&optional content) 2899(defun bibtex-parse-entry (&optional content)
2880 "Parse entry at point, return an alist. 2900 "Parse entry at point, return an alist.
@@ -3613,17 +3633,20 @@ interactive calls."
3613 3633
3614(defun bibtex-find-text-internal (&optional noerror subfield comma) 3634(defun bibtex-find-text-internal (&optional noerror subfield comma)
3615 "Find text part of current BibTeX field or entry head. 3635 "Find text part of current BibTeX field or entry head.
3616Return list (NAME START-TEXT END-TEXT END) with field or entry name, 3636Return list (NAME START-TEXT END-TEXT END STRING-CONST) with field
3617start and end of text and end of field or entry head, or nil if not found. 3637or entry name, start and end of text, and end of field or entry head.
3618If optional arg NOERROR is non-nil, an error message is suppressed if text 3638STRING-CONST is a flag which is non-nil if current subfield delimited by #
3619is not found. If optional arg SUBFIELD is non-nil START-TEXT and END-TEXT 3639is a BibTeX string constant. Return value is nil if field or entry head
3620correspond to the current subfield delimited by #. 3640are not found.
3641If optional arg NOERROR is non-nil, an error message is suppressed
3642if text is not found. If optional arg SUBFIELD is non-nil START-TEXT
3643and END-TEXT correspond to the current subfield delimited by #.
3621Optional arg COMMA is as in `bibtex-enclosing-field'." 3644Optional arg COMMA is as in `bibtex-enclosing-field'."
3622 (save-excursion 3645 (save-excursion
3623 (let ((pnt (point)) 3646 (let ((pnt (point))
3624 (bounds (bibtex-enclosing-field comma t)) 3647 (bounds (bibtex-enclosing-field comma t))
3625 (case-fold-search t) 3648 (case-fold-search t)
3626 name start-text end-text end failure done no-sub) 3649 name start-text end-text end failure done no-sub string-const)
3627 (bibtex-beginning-of-entry) 3650 (bibtex-beginning-of-entry)
3628 (cond (bounds 3651 (cond (bounds
3629 (setq name (bibtex-name-in-field bounds t) 3652 (setq name (bibtex-name-in-field bounds t)
@@ -3667,9 +3690,11 @@ Optional arg COMMA is as in `bibtex-enclosing-field'."
3667 (goto-char start-text) 3690 (goto-char start-text)
3668 (while (not done) 3691 (while (not done)
3669 (if (or (prog1 (looking-at bibtex-field-const) 3692 (if (or (prog1 (looking-at bibtex-field-const)
3670 (setq end-text (match-end 0))) 3693 (setq end-text (match-end 0)
3694 string-const t))
3671 (prog1 (setq bounds (bibtex-parse-field-string)) 3695 (prog1 (setq bounds (bibtex-parse-field-string))
3672 (setq end-text (cdr bounds)))) 3696 (setq end-text (cdr bounds)
3697 string-const nil)))
3673 (progn 3698 (progn
3674 (if (and (<= start-text pnt) (<= pnt end-text)) 3699 (if (and (<= start-text pnt) (<= pnt end-text))
3675 (setq done t) 3700 (setq done t)
@@ -3678,7 +3703,7 @@ Optional arg COMMA is as in `bibtex-enclosing-field'."
3678 (setq start-text (goto-char (match-end 0))))) 3703 (setq start-text (goto-char (match-end 0)))))
3679 (setq done t failure t))))) 3704 (setq done t failure t)))))
3680 (cond ((not failure) 3705 (cond ((not failure)
3681 (list name start-text end-text end)) 3706 (list name start-text end-text end string-const))
3682 ((and no-sub (not noerror)) 3707 ((and no-sub (not noerror))
3683 (error "Not on text part of BibTeX field")) 3708 (error "Not on text part of BibTeX field"))
3684 ((not noerror) (error "Not on BibTeX field")))))) 3709 ((not noerror) (error "Not on BibTeX field"))))))
@@ -3712,13 +3737,10 @@ is as in `bibtex-enclosing-field'. It is t for interactive calls."
3712Optional arg COMMA is as in `bibtex-enclosing-field'. It is t for 3737Optional arg COMMA is as in `bibtex-enclosing-field'. It is t for
3713interactive calls." 3738interactive calls."
3714 (interactive (list t)) 3739 (interactive (list t))
3715 (let* ((bounds (bibtex-find-text-internal nil t comma)) 3740 (let ((bounds (bibtex-find-text-internal nil t comma)))
3716 (start (nth 1 bounds)) 3741 (unless (nth 4 bounds)
3717 (end (nth 2 bounds))) 3742 (delete-region (1- (nth 2 bounds)) (nth 2 bounds))
3718 (if (memq (char-before end) '(?\} ?\")) 3743 (delete-region (nth 1 bounds) (1+ (nth 1 bounds))))))
3719 (delete-region (1- end) end))
3720 (if (memq (char-after start) '(?\{ ?\"))
3721 (delete-region start (1+ start)))))
3722 3744
3723(defun bibtex-kill-field (&optional copy-only comma) 3745(defun bibtex-kill-field (&optional copy-only comma)
3724 "Kill the entire enclosing BibTeX field. 3746 "Kill the entire enclosing BibTeX field.
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index 5d1efeb6902..abefe6c623d 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -5,7 +5,7 @@
5;; Author: Carsten Dominik <dominik at science dot uva dot nl> 5;; Author: Carsten Dominik <dominik at science dot uva dot nl>
6;; Keywords: outlines, hypermedia, calendar, wp 6;; Keywords: outlines, hypermedia, calendar, wp
7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ 7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
8;; Version: 4.10 8;; Version: 4.23
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -81,6 +81,35 @@
81;; 81;;
82;; Changes since version 4.00: 82;; Changes since version 4.00:
83;; --------------------------- 83;; ---------------------------
84;; Version 4.23
85;; - Bug fixes.
86;;
87;; Version 4.22
88;; - Bug fixes.
89;; - In agenda buffer, mouse-1 no longer follows link.
90;; See `org-agenda-mouse-1-follows-link' and `org-mouse-1-follows-link'.
91;;
92;; Version 4.20
93;; - Links use now the [[link][description]] format by default.
94;; When inserting links, the user is prompted for a description.
95;; - If a link has a description, only the description is displayed
96;; the link part is hidden. Use C-c C-l to edit the link part.
97;; - TAGS are now bold, but in the same color as the headline.
98;; - The width of a table column can be limited by using a field "<N>".
99;; - New structure for the customization tree.
100;; - Bug fixes.
101;;
102;; Version 4.13
103;; - The list of agenda files can be maintainted in an external file.
104;; - Bug fixes.
105;;
106;; Version 4.12
107;; - Templates for remember buffer. Note that the remember setup changes.
108;; To set up templates, see `org-remember-templates'.
109;; - The time in new time stamps can be rounded, see new option
110;; `org-time-stamp-rounding-minutes'.
111;; - Bug fixes (there are *always* more bugs).
112;;
84;; Version 4.10 113;; Version 4.10
85;; - Bug fixes. 114;; - Bug fixes.
86;; 115;;
@@ -98,7 +127,7 @@
98;; - Leading stars in headlines can be hidden, so make the outline look 127;; - Leading stars in headlines can be hidden, so make the outline look
99;; cleaner. 128;; cleaner.
100;; - Mouse-1 can be used to follow links. 129;; - Mouse-1 can be used to follow links.
101;; 130;;
102;; Version 4.06 131;; Version 4.06
103;; - HTML exporter treats targeted internal links. 132;; - HTML exporter treats targeted internal links.
104;; - Bug fixes. 133;; - Bug fixes.
@@ -137,30 +166,35 @@
137;; 166;;
138;;; Code: 167;;; Code:
139 168
140(eval-when-compile (require 'cl) (require 'calendar)) 169(eval-when-compile
170 (require 'cl)
171 (require 'calendar))
141(require 'outline) 172(require 'outline)
142(require 'time-date) 173(require 'time-date)
143(require 'easymenu) 174(require 'easymenu)
144 175
145(defvar calc-embedded-close-formula) 176(defvar calc-embedded-close-formula) ; defined by the calc package
146(defvar calc-embedded-open-formula) 177(defvar calc-embedded-open-formula) ; defined by the calc package
147(defvar font-lock-unfontify-region-function) 178(defvar font-lock-unfontify-region-function) ; defined by font-lock.el
148 179
149;;; Customization variables 180;;; Customization variables
150 181
151(defvar org-version "4.10" 182(defvar org-version "4.23"
152 "The version number of the file org.el.") 183 "The version number of the file org.el.")
153(defun org-version () 184(defun org-version ()
154 (interactive) 185 (interactive)
155 (message "Org-mode version %s" org-version)) 186 (message "Org-mode version %s" org-version))
156 187
157;; The following two constants are for compatibility with different Emacs 188;; The following constant is for compatibility with different versions
158;; versions (Emacs versus XEmacs) and with different versions of outline.el. 189;; of outline.el.
159;; The compatibility code in org.el is based on these two constants.
160(defconst org-xemacs-p (featurep 'xemacs)
161 "Are we running XEmacs?")
162(defconst org-noutline-p (featurep 'noutline) 190(defconst org-noutline-p (featurep 'noutline)
163 "Are we using the new outline mode?") 191 "Are we using the new outline mode?")
192(defconst org-xemacs-p (featurep 'xemacs))
193(defconst org-format-transports-properties-p
194 (let ((x "a"))
195 (add-text-properties 0 1 '(test t) x)
196 (get-text-property 0 'test (format "%s" x)))
197 "Does format transport text properties?")
164 198
165(defgroup org nil 199(defgroup org nil
166 "Outline-based notes management and organizer." 200 "Outline-based notes management and organizer."
@@ -174,44 +208,6 @@
174 :tag "Org Startup" 208 :tag "Org Startup"
175 :group 'org) 209 :group 'org)
176 210
177(defcustom org-CUA-compatible nil
178 "Non-nil means use alternative key bindings for S-<cursor movement>.
179Org-mode used S-<cursor movement> for changing timestamps and priorities.
180S-<cursor movement> is also used for example by `CUA-mode' to select text.
181If you want to use Org-mode together with `CUA-mode', Org-mode needs to use
182alternative bindings. Setting this variable to t will replace the following
183keys both in Org-mode and in the Org-agenda buffer.
184
185S-RET -> C-S-RET
186S-up -> M-p
187S-down -> M-n
188S-left -> M--
189S-right -> M-+
190
191If you do not like the alternative keys, take a look at the variable
192`org-disputed-keys'.
193
194This option is only relevant at load-time of Org-mode. Changing it requires
195a restart of Emacs to become effective."
196 :group 'org-startup
197 :type 'boolean)
198
199(defvar org-disputed-keys
200 '((S-up [(shift up)] [(meta ?p)])
201 (S-down [(shift down)] [(meta ?n)])
202 (S-left [(shift left)] [(meta ?-)])
203 (S-right [(shift right)] [(meta ?+)])
204 (S-return [(shift return)] [(control shift return)]))
205 "Keys for which Org-mode and other modes compete.
206This is an alist, cars are symbols for lookup, 1st element is the default key,
207second element will be used when `org-CUA-compatible' is t.")
208
209(defun org-key (key)
210 "Select a key according to `org-CUA-compatible'."
211 (nth (if org-CUA-compatible 2 1)
212 (or (assq key org-disputed-keys)
213 (error "Invalid Key %s in `org-key'" key))))
214
215(defcustom org-startup-folded t 211(defcustom org-startup-folded t
216 "Non-nil means, entering Org-mode will switch to OVERVIEW. 212 "Non-nil means, entering Org-mode will switch to OVERVIEW.
217This can also be configured on a per-file basis by adding one of 213This can also be configured on a per-file basis by adding one of
@@ -233,6 +229,13 @@ uninteresting. Also tables look terrible when wrapped."
233 :group 'org-startup 229 :group 'org-startup
234 :type 'boolean) 230 :type 'boolean)
235 231
232(defcustom org-startup-align-all-tables nil
233 "Non-nil means, align all tables when visiting a file.
234This is useful when the column width in tables is forced with <N> cookies
235in table fields. Such tables will look correct only after the first re-align."
236 :group 'org-startup
237 :type 'boolean)
238
236(defcustom org-startup-with-deadline-check nil 239(defcustom org-startup-with-deadline-check nil
237 "Non-nil means, entering Org-mode will run the deadline check. 240 "Non-nil means, entering Org-mode will run the deadline check.
238This means, if you start editing an org file, you will get an 241This means, if you start editing an org file, you will get an
@@ -255,71 +258,61 @@ has been set."
255 :group 'org-startup 258 :group 'org-startup
256 :type 'boolean) 259 :type 'boolean)
257 260
258(defgroup org-keywords nil 261(defcustom org-CUA-compatible nil
259 "Options concerning TODO items in Org-mode." 262 "Non-nil means use alternative key bindings for S-<cursor movement>.
260 :tag "Org Keywords" 263Org-mode used S-<cursor movement> for changing timestamps and priorities.
261 :group 'org) 264S-<cursor movement> is also used for example by `CUA-mode' to select text.
265If you want to use Org-mode together with `CUA-mode', Org-mode needs to use
266alternative bindings. Setting this variable to t will replace the following
267keys both in Org-mode and in the Org-agenda buffer.
262 268
263(defcustom org-todo-keywords '("TODO" "DONE") 269S-RET -> C-S-RET
264 "List of TODO entry keywords. 270S-up -> M-p
265\\<org-mode-map>By default, this is '(\"TODO\" \"DONE\"). The last entry in the list is 271S-down -> M-n
266considered to mean that the entry is \"done\". All the other mean that 272S-left -> M--
267action is required, and will make the entry show up in todo lists, diaries 273S-right -> M-+
268etc.
269The command \\[org-todo] cycles an entry through these states, and an
270additional state where no keyword is present. For details about this
271cycling, see also the variable `org-todo-interpretation'
272Changes become only effective after restarting Emacs."
273 :group 'org-keywords
274 :type '(repeat (string :tag "Keyword")))
275 274
276(defcustom org-todo-interpretation 'sequence 275If you do not like the alternative keys, take a look at the variable
277 "Controls how TODO keywords are interpreted. 276`org-disputed-keys'.
278\\<org-mode-map>Possible values are `sequence' and `type'.
279This variable is only relevant if `org-todo-keywords' contains more than two
280states. There are two ways how these keywords can be used:
281
282- As a sequence in the process of working on a TODO item, for example
283 (setq org-todo-keywords '(\"TODO\" \"STARTED\" \"VERIFY\" \"DONE\")
284 org-todo-interpretation 'sequence)
285
286- As different types of TODO items, for example
287 (setq org-todo-keywords '(\"URGENT\" \"RELAXED\" \"REMIND\" \"FOR_TOM\" \"DONE\")
288 org-todo-interpretation 'type)
289
290When the states are interpreted as a sequence, \\[org-todo] always cycles
291to the next state, in order to walk through all different states. So with
292\\[org-todo], you turn an empty entry into the state TODO. When you started
293working on the item, you use \\[org-todo] again to switch it to \"STARTED\",
294later to VERIFY and finally to DONE.
295
296When the states are interpreted as types, \\[org-todo] still cycles through
297when it is called several times in direct succession, in order to initially
298select the type. However, if not called immediately after a previous
299\\[org-todo], it switches from each type directly to DONE. So with the
300above example, you could use `\\[org-todo] \\[org-todo]' to label an entry
301RELAXED. If you later return to this entry and press \\[org-todo] again,
302RELAXED will not be changed REMIND, but directly to DONE.
303
304You can create a large number of types. To initially select a
305type, it is then best to use \\[universal-argument] \\[org-todo] in order to specify the
306type with completion. Of course, you can also type the keyword
307directly into the buffer. M-TAB completes TODO keywords at the
308beginning of a headline."
309 :group 'org-keywords
310 :type '(choice (const sequence)
311 (const type)))
312 277
313(defcustom org-default-priority ?B 278This option is only relevant at load-time of Org-mode. Changing it requires
314 "The default priority of TODO items. 279a restart of Emacs to become effective."
315This is the priority an item get if no explicit priority is given." 280 :group 'org-startup
316 :group 'org-keywords 281 :type 'boolean)
317 :type 'character)
318 282
319(defcustom org-lowest-priority ?C 283(defvar org-disputed-keys
320 "The lowest priority of TODO items. A character like ?A, ?B etc." 284 '((S-up [(shift up)] [(meta ?p)])
321 :group 'org-keywords 285 (S-down [(shift down)] [(meta ?n)])
322 :type 'character) 286 (S-left [(shift left)] [(meta ?-)])
287 (S-right [(shift right)] [(meta ?+)])
288 (S-return [(shift return)] [(control shift return)]))
289 "Keys for which Org-mode and other modes compete.
290This is an alist, cars are symbols for lookup, 1st element is the default key,
291second element will be used when `org-CUA-compatible' is t.")
292
293(defun org-key (key)
294 "Select a key according to `org-CUA-compatible'."
295 (nth (if org-CUA-compatible 2 1)
296 (or (assq key org-disputed-keys)
297 (error "Invalid Key %s in `org-key'" key))))
298
299(defcustom org-ellipsis nil
300 "The ellipsis to use in the Org-mode outline.
301When nil, just use the standard three dots. When a string, use that instead,
302and just in Org-mode (which will then use its own display table).
303Changing this requires executing `M-x org-mode' in a buffer to become
304effective."
305 :group 'org-startup
306 :type '(choice (const :tag "Default" nil)
307 (string :tag "String" :value "...#")))
308
309(defvar org-display-table nil
310 "The display table for org-mode, in case `org-ellipsis' is non-nil.")
311
312(defgroup org-keywords nil
313 "Keywords in Org-mode."
314 :tag "Org Keywords"
315 :group 'org)
323 316
324(defcustom org-deadline-string "DEADLINE:" 317(defcustom org-deadline-string "DEADLINE:"
325 "String to mark deadline entries. 318 "String to mark deadline entries.
@@ -361,405 +354,22 @@ An entry can be toggled between QUOTE and normal with
361 :group 'org-keywords 354 :group 'org-keywords
362 :type 'string) 355 :type 'string)
363 356
364(defcustom org-after-todo-state-change-hook nil
365 "Hook which is run after the state of a TODO item was changed.
366The new state (a string with a TODO keyword, or nil) is available in the
367Lisp variable `state'."
368 :group 'org-keywords
369 :type 'hook)
370
371;; Variables for pre-computed regular expressions, all buffer local
372(defvar org-todo-kwd-priority-p nil
373 "Do TODO items have priorities?")
374(make-variable-buffer-local 'org-todo-kwd-priority-p)
375(defvar org-todo-kwd-max-priority nil
376 "Maximum priority of TODO items.")
377(make-variable-buffer-local 'org-todo-kwd-max-priority)
378(defvar org-ds-keyword-length 12
379 "Maximum length of the Deadline and SCHEDULED keywords.")
380(make-variable-buffer-local 'org-ds-keyword-length)
381(defvar org-done-string nil
382 "The last string in `org-todo-keywords', indicating an item is DONE.")
383(make-variable-buffer-local 'org-done-string)
384(defvar org-todo-regexp nil
385 "Matches any of the TODO state keywords.")
386(make-variable-buffer-local 'org-todo-regexp)
387(defvar org-not-done-regexp nil
388 "Matches any of the TODO state keywords except the last one.")
389(make-variable-buffer-local 'org-not-done-regexp)
390(defvar org-todo-line-regexp nil
391 "Matches a headline and puts TODO state into group 2 if present.")
392(make-variable-buffer-local 'org-todo-line-regexp)
393(defvar org-nl-done-regexp nil
394 "Matches newline followed by a headline with the DONE keyword.")
395(make-variable-buffer-local 'org-nl-done-regexp)
396(defvar org-looking-at-done-regexp nil
397 "Matches the DONE keyword a point.")
398(make-variable-buffer-local 'org-looking-at-done-regexp)
399(defvar org-deadline-regexp nil
400 "Matches the DEADLINE keyword.")
401(make-variable-buffer-local 'org-deadline-regexp)
402(defvar org-deadline-time-regexp nil
403 "Matches the DEADLINE keyword together with a time stamp.")
404(make-variable-buffer-local 'org-deadline-time-regexp)
405(defvar org-deadline-line-regexp nil
406 "Matches the DEADLINE keyword and the rest of the line.")
407(make-variable-buffer-local 'org-deadline-line-regexp)
408(defvar org-scheduled-regexp nil
409 "Matches the SCHEDULED keyword.")
410(make-variable-buffer-local 'org-scheduled-regexp)
411(defvar org-scheduled-time-regexp nil
412 "Matches the SCHEDULED keyword together with a time stamp.")
413(make-variable-buffer-local 'org-scheduled-time-regexp)
414
415(defvar org-category nil
416 "Variable used by org files to set a category for agenda display.
417Such files should use a file variable to set it, for example
418
419 -*- mode: org; org-category: \"ELisp\"
420
421or contain a special line
422
423#+CATEGORY: ELisp
424
425If the file does not specify a category, then file's base name
426is used instead.")
427(make-variable-buffer-local 'org-category)
428
429(defgroup org-time nil
430 "Options concerning time stamps and deadlines in Org-mode."
431 :tag "Org Time"
432 :group 'org)
433
434(defconst org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M>")
435 "Formats for `format-time-string' which are used for time stamps.
436It is not recommended to change this constant.")
437
438
439(defcustom org-deadline-warning-days 30
440 "No. of days before expiration during which a deadline becomes active.
441This variable governs the display in the org file."
442 :group 'org-time
443 :type 'number)
444
445(defcustom org-popup-calendar-for-date-prompt t
446 "Non-nil means, pop up a calendar when prompting for a date.
447In the calendar, the date can be selected with mouse-1. However, the
448minibuffer will also be active, and you can simply enter the date as well.
449When nil, only the minibuffer will be available."
450 :group 'org-time
451 :type 'boolean)
452
453(defcustom org-calendar-follow-timestamp-change t
454 "Non-nil means, make the calendar window follow timestamp changes.
455When a timestamp is modified and the calendar window is visible, it will be
456moved to the new date."
457 :group 'org-time
458 :type 'boolean)
459
460(defcustom org-log-done nil
461 "When set, insert a (non-active) time stamp when TODO entry is marked DONE.
462When the state of an entry is changed from nothing to TODO, remove a previous
463closing date."
464 :group 'org-time
465 :type 'boolean)
466
467(defgroup org-agenda nil
468 "Options concerning agenda display Org-mode."
469 :tag "Org Agenda"
470 :group 'org)
471
472(defcustom org-agenda-files nil
473 "A list of org files for agenda/diary display.
474Entries are added to this list with \\[org-agenda-file-to-front] and removed with
475\\[org-remove-file]. You can also use customize to edit the list."
476 :group 'org-agenda
477 :type '(repeat file))
478
479(defcustom org-agenda-custom-commands '(("w" todo "WAITING"))
480 "Custom commands for the agenda.
481These commands will be offered on the splash screen displayed by the
482agenda dispatcher \\[org-agenda]. Each entry is a list of 3 items:
483
484key The key (a single char as a string) to be associated with the command.
485type The command type, any of the following symbols:
486 todo Entries with a specific TODO keyword, in all agenda files.
487 tags Tags match in all agenda files.
488 todo-tree Sparse tree of specific TODO keyword in *current* file.
489 tags-tree Sparse tree with all tags matches in *current* file.
490 occur-tree Occur sparse tree for current file.
491match What to search for:
492 - a single keyword for TODO keyword searches
493 - a tags match expression for tags searches
494 - a regular expression for occur searches"
495 :group 'org-agenda
496 :type '(repeat
497 (list (string :tag "Key")
498 (choice :tag "Type"
499 (const :tag "Tags search in all agenda files" tags)
500 (const :tag "TODO keyword search in all agenda files" todo)
501 (const :tag "Tags sparse tree in current buffer" tags-tree)
502 (const :tag "TODO keyword tree in current buffer" todo-tree)
503 (const :tag "Occur tree in current buffer" occur-tree))
504 (string :tag "Match"))))
505
506(defcustom org-select-timeline-window t
507 "Non-nil means, after creating a timeline, move cursor into Timeline window.
508When nil, cursor will remain in the current window."
509 :group 'org-agenda
510 :type 'boolean)
511
512(defcustom org-select-agenda-window t
513 "Non-nil means, after creating an agenda, move cursor into Agenda window.
514When nil, cursor will remain in the current window."
515 :group 'org-agenda
516 :type 'boolean)
517
518(defcustom org-fit-agenda-window t
519 "Non-nil means, change window size of agenda to fit content."
520 :group 'org-agenda
521 :type 'boolean)
522
523(defcustom org-agenda-show-all-dates t
524 "Non-nil means, `org-agenda' shows every day in the selected range.
525When nil, only the days which actually have entries are shown."
526 :group 'org-agenda
527 :type 'boolean)
528
529;; FIXME: First day of month works only for current month because it would
530;; require a variable ndays treatment.
531(defcustom org-agenda-start-on-weekday 1
532 "Non-nil means, start the overview always on the specified weekday.
5330 Denotes Sunday, 1 denotes Monday etc.
534When nil, always start on the current day."
535 :group 'org-agenda
536 :type '(choice (const :tag "Today" nil)
537 (const :tag "First day of month" t)
538 (number :tag "Weekday No.")))
539
540(defcustom org-agenda-ndays 7
541 "Number of days to include in overview display."
542 :group 'org-agenda
543 :type 'number)
544
545(defcustom org-agenda-include-all-todo t
546 "Non-nil means, the agenda will always contain all TODO entries.
547When nil, date-less entries will only be shown if `org-agenda' is called
548with a prefix argument.
549When non-nil, the TODO entries will be listed at the top of the agenda, before
550the entries for specific days."
551 :group 'org-agenda
552 :type 'boolean)
553
554(defcustom org-agenda-include-diary nil
555 "If non-nil, include in the agenda entries from the Emacs Calendar's diary."
556 :group 'org-agenda
557 :type 'boolean)
558
559(defcustom org-calendar-to-agenda-key [?c]
560 "The key to be installed in `calendar-mode-map' for switching to the agenda.
561The command `org-calendar-goto-agenda' will be bound to this key. The
562default is the character `c' because then `c' can be used to switch back and
563forth between agenda and calendar."
564 :group 'org-agenda
565 :type 'sexp)
566
567(defcustom org-agenda-sorting-strategy '(time-up category-keep priority-down)
568 "Sorting structure for the agenda items of a single day.
569This is a list of symbols which will be used in sequence to determine
570if an entry should be listed before another entry. The following
571symbols are recognized:
572
573time-up Put entries with time-of-day indications first, early first
574time-down Put entries with time-of-day indications first, late first
575category-keep Keep the default order of categories, corresponding to the
576 sequence in `org-agenda-files'.
577category-up Sort alphabetically by category, A-Z.
578category-down Sort alphabetically by category, Z-A.
579priority-up Sort numerically by priority, high priority last.
580priority-down Sort numerically by priority, high priority first.
581
582The different possibilities will be tried in sequence, and testing stops
583if one comparison returns a \"not-equal\". For example, the default
584 '(time-up category-keep priority-down)
585means: Pull out all entries having a specified time of day and sort them,
586in order to make a time schedule for the current day the first thing in the
587agenda listing for the day. Of the entries without a time indication, keep
588the grouped in categories, don't sort the categories, but keep them in
589the sequence given in `org-agenda-files'. Within each category sort by
590priority.
591
592Leaving out `category-keep' would mean that items will be sorted across
593categories by priority."
594 :group 'org-agenda
595 :type '(repeat
596 (choice
597 (const time-up)
598 (const time-down)
599 (const category-keep)
600 (const category-up)
601 (const category-down)
602 (const priority-up)
603 (const priority-down))))
604
605(defcustom org-agenda-prefix-format " %-12:c%?-12t% s"
606 "Format specification for the prefix of items in the agenda buffer.
607This format works similar to a printf format, with the following meaning:
608
609 %c the category of the item, \"Diary\" for entries from the diary, or
610 as given by the CATEGORY keyword or derived from the file name.
611 %T the first tag of the item.
612 %t the time-of-day specification if one applies to the entry, in the
613 format HH:MM
614 %s Scheduling/Deadline information, a short string
615
616All specifiers work basically like the standard `%s' of printf, but may
617contain two additional characters: A question mark just after the `%' and
618a whitespace/punctuation character just before the final letter.
619
620If the first character after `%' is a question mark, the entire field
621will only be included if the corresponding value applies to the
622current entry. This is useful for fields which should have fixed
623width when present, but zero width when absent. For example,
624\"%?-12t\" will result in a 12 character time field if a time of the
625day is specified, but will completely disappear in entries which do
626not contain a time.
627
628If there is punctuation or whitespace character just before the final
629format letter, this character will be appended to the field value if
630the value is not empty. For example, the format \"%-12:c\" leads to
631\"Diary: \" if the category is \"Diary\". If the category were be
632empty, no additional colon would be interted.
633
634The default value of this option is \" %-12:c%?-12t% s\", meaning:
635- Indent the line with two space characters
636- Give the category in a 12 chars wide field, padded with whitespace on
637 the right (because of `-'). Append a colon if there is a category
638 (because of `:').
639- If there is a time-of-day, put it into a 12 chars wide field. If no
640 time, don't put in an empty field, just skip it (because of '?').
641- Finally, put the scheduling information and append a whitespace.
642
643As another example, if you don't want the time-of-day of entries in
644the prefix, you could use:
645
646 (setq org-agenda-prefix-format \" %-11:c% s\")
647
648See also the variables `org-agenda-remove-times-when-in-prefix' and
649`org-agenda-remove-tags-when-in-prefix'."
650 :type 'string
651 :group 'org-agenda)
652
653(defcustom org-timeline-prefix-format " % s"
654 "Like `org-agenda-prefix-format', but for the timeline of a single file."
655 :type 'string
656 :group 'org-agenda)
657
658(defvar org-prefix-format-compiled nil
659 "The compiled version of the most recently used prefix format.
660Depending on which command was used last, this may be the compiled version
661of `org-agenda-prefix-format' or `org-timeline-prefix-format'.")
662
663(defcustom org-agenda-use-time-grid t
664 "Non-nil means, show a time grid in the agenda schedule.
665A time grid is a set of lines for specific times (like every two hours between
6668:00 and 20:00). The items scheduled for a day at specific times are
667sorted in between these lines.
668For details about when the grid will be shown, and what it will look like, see
669the variable `org-agenda-time-grid'."
670 :group 'org-agenda
671 :type 'boolean)
672
673(defcustom org-agenda-time-grid
674 '((daily today require-timed)
675 "----------------"
676 (800 1000 1200 1400 1600 1800 2000))
677
678 "The settings for time grid for agenda display.
679This is a list of three items. The first item is again a list. It contains
680symbols specifying conditions when the grid should be displayed:
681
682 daily if the agenda shows a single day
683 weekly if the agenda shows an entire week
684 today show grid on current date, independent of daily/weekly display
685 require-timed show grid only if at least on item has a time specification
686
687The second item is a string which will be places behing the grid time.
688
689The third item is a list of integers, indicating the times that should have
690a grid line."
691 :group 'org-agenda
692 :type
693 '(list
694 (set :greedy t :tag "Grid Display Options"
695 (const :tag "Show grid in single day agenda display" daily)
696 (const :tag "Show grid in weekly agenda display" weekly)
697 (const :tag "Always show grid for today" today)
698 (const :tag "Show grid only if any timed entries are present"
699 require-timed)
700 (const :tag "Skip grid times already present in an entry"
701 remove-match))
702 (string :tag "Grid String")
703 (repeat :tag "Grid Times" (integer :tag "Time"))))
704
705(defcustom org-agenda-remove-times-when-in-prefix t
706 "Non-nil means, remove duplicate time specifications in agenda items.
707When the format `org-agenda-prefix-format' contains a `%t' specifier, a
708time-of-day specification in a headline or diary entry is extracted and
709placed into the prefix. If this option is non-nil, the original specification
710\(a timestamp or -range, or just a plain time(range) specification like
71111:30-4pm) will be removed for agenda display. This makes the agenda less
712cluttered.
713The option can be t or nil. It may also be the symbol `beg', indicating
714that the time should only be removed what it is located at the beginning of
715the headline/diary entry."
716 :group 'org-agenda
717 :type '(choice
718 (const :tag "Always" t)
719 (const :tag "Never" nil)
720 (const :tag "When at beginning of entry" beg)))
721
722(defcustom org-sort-agenda-notime-is-late t
723 "Non-nil means, items without time are considered late.
724This is only relevant for sorting. When t, items which have no explicit
725time like 15:30 will be considered as 24:01, i.e. later than any items which
726do have a time. When nil, the default time is before 0:00. You can use this
727option to decide if the schedule for today should come before or after timeless
728agenda entries."
729 :group 'org-agenda
730 :type 'boolean)
731
732(defcustom org-agenda-remove-tags-when-in-prefix nil
733 "Non-nil means, the tags from copy of headline in agenda.
734When this is the symbol `prefix', only remove tags when
735`org-agenda-prefix-format' contains a `%T' specifier."
736 :group 'org-agenda
737 :type '(choice
738 (const :tag "Always" t)
739 (const :tag "Never" nil)
740 (const :tag "When prefix format contains %T" prefix)))
741
742(defgroup org-structure nil 357(defgroup org-structure nil
743 "Options concerning structure editing in Org-mode." 358 "Options concerning the general structure of Org-mode files."
744 :tag "Org Structure" 359 :tag "Org Structure"
745 :group 'org) 360 :group 'org)
746 361
747(defcustom org-cycle-include-plain-lists nil 362(defgroup org-cycle nil
748 "Non-nil means, include plain lists into visibility cycling. 363 "Options concerning visibility cycling in Org-mode."
749This means that during cycling, plain list items will *temporarily* be 364 :tag "Org Cycle"
750interpreted as outline headlines with a level given by 1000+i where i is the 365 :group 'org-structure)
751indentation of the bullet. In all other operations, plain list items are
752not seen as headlines. For example, you cannot assign a TODO keyword to
753such an item."
754 :group 'org-structure
755 :type 'boolean)
756 366
757(defcustom org-cycle-emulate-tab t 367(defcustom org-cycle-emulate-tab t
758 "Where should `org-cycle' emulate TAB. 368 "Where should `org-cycle' emulate TAB.
759nil Never 369nil Never
760white Only in completely white lines 370white Only in completely white lines
761t Everywhere except in headlines" 371t Everywhere except in headlines"
762 :group 'org-structure 372 :group 'org-cycle
763 :type '(choice (const :tag "Never" nil) 373 :type '(choice (const :tag "Never" nil)
764 (const :tag "Only in completely white lines" white) 374 (const :tag "Only in completely white lines" white)
765 (const :tag "Everywhere except in headlines" t) 375 (const :tag "Everywhere except in headlines" t)
@@ -772,20 +382,58 @@ the new state that was set by the most recent `org-cycle' command. The
772argument is a symbol. After a global state change, it can have the values 382argument is a symbol. After a global state change, it can have the values
773`overview', `content', or `all'. After a local state change, it can have 383`overview', `content', or `all'. After a local state change, it can have
774the values `folded', `children', or `subtree'." 384the values `folded', `children', or `subtree'."
775 :group 'org-structure 385 :group 'org-cycle
776 :type 'hook) 386 :type 'hook)
777 387
388(defgroup org-edit-structure nil
389 "Options concerning structure editing in Org-mode."
390 :tag "Org Edit Structure"
391 :group 'org-structure)
392
393(defcustom org-odd-levels-only nil
394 "Non-nil means, skip even levels and only use odd levels for the outline.
395This has the effect that two stars are being added/taken away in
396promotion/demotion commands. It also influences how levels are
397handled by the exporters.
398Changing it requires restart of `font-lock-mode' to become effective
399for fontification also in regions already fontified."
400 :group 'org-edit-structure
401 :group 'org-font-lock
402 :type 'boolean)
403
404(defcustom org-adapt-indentation t
405 "Non-nil means, adapt indentation when promoting and demoting.
406When this is set and the *entire* text in an entry is indented, the
407indentation is increased by one space in a demotion command, and
408decreased by one in a promotion command. If any line in the entry
409body starts at column 0, indentation is not changed at all."
410 :group 'org-edit-structure
411 :type 'boolean)
412
413(defcustom org-enable-fixed-width-editor t
414 "Non-nil means, lines starting with \":\" are treated as fixed-width.
415This currently only means, they are never auto-wrapped.
416When nil, such lines will be treated like ordinary lines.
417See also the QUOTE keyword."
418 :group 'org-edit-structure
419 :type 'boolean)
420
421(defgroup org-sparse-trees nil
422 "Options concerning sparse trees in Org-mode."
423 :tag "Org Sparse Trees"
424 :group 'org-structure)
425
778(defcustom org-highlight-sparse-tree-matches t 426(defcustom org-highlight-sparse-tree-matches t
779 "Non-nil means, highlight all matches that define a sparse tree. 427 "Non-nil means, highlight all matches that define a sparse tree.
780The highlights will automatically disappear the next time the buffer is 428The highlights will automatically disappear the next time the buffer is
781changed by an edit command." 429changed by an edit command."
782 :group 'org-structure 430 :group 'org-sparse-trees
783 :type 'boolean) 431 :type 'boolean)
784 432
785(defcustom org-show-hierarchy-above t 433(defcustom org-show-hierarchy-above t
786 "Non-nil means, show full hierarchy when showing a spot in the tree. 434 "Non-nil means, show full hierarchy when showing a spot in the tree.
787Turning this off makes sparse trees more compact, but also less clear." 435Turning this off makes sparse trees more compact, but also less clear."
788 :group 'org-structure 436 :group 'org-sparse-trees
789 :type 'boolean) 437 :type 'boolean)
790 438
791(defcustom org-show-following-heading t 439(defcustom org-show-following-heading t
@@ -795,43 +443,39 @@ follows the match, even if they do not match the regexp. This makes it
795easier to edit directly inside the sparse tree. However, if you use 443easier to edit directly inside the sparse tree. However, if you use
796`org-occur' mainly as an overview, the following headlines are 444`org-occur' mainly as an overview, the following headlines are
797unnecessary clutter." 445unnecessary clutter."
798 :group 'org-structure 446 :group 'org-sparse-trees
799 :type 'boolean) 447 :type 'boolean)
800 448
801(defcustom org-occur-hook '(org-first-headline-recenter) 449(defcustom org-occur-hook '(org-first-headline-recenter)
802 "Hook that is run after `org-occur' has constructed a sparse tree. 450 "Hook that is run after `org-occur' has constructed a sparse tree.
803This can be used to recenter the window to show as much of the structure 451This can be used to recenter the window to show as much of the structure
804as possible." 452as possible."
805 :group 'org-structure 453 :group 'org-sparse-trees
806 :type 'hook) 454 :type 'hook)
807 455
808(defcustom org-odd-levels-only nil 456(defgroup org-plain-lists nil
809 "Non-nil means, skip even levels and only use odd levels for the outline. 457 "Options concerning plain lists in Org-mode."
810This has the effect that two stars are being added/taken away in 458 :tag "Org Plain lists"
811promotion/demotion commands. It also influences how levels are 459 :group 'org-structure)
812handled by the exporters.
813Changing it requires restart of `font-lock-mode' to become effective
814for fontification also in regions already fontified."
815 :group 'org-structure
816 :group 'org-font-lock
817 :type 'boolean)
818 460
819(defcustom org-adapt-indentation t 461(defcustom org-cycle-include-plain-lists nil
820 "Non-nil means, adapt indentation when promoting and demoting. 462 "Non-nil means, include plain lists into visibility cycling.
821When this is set and the *entire* text in an entry is indented, the 463This means that during cycling, plain list items will *temporarily* be
822indentation is increased by one space in a demotion command, and 464interpreted as outline headlines with a level given by 1000+i where i is the
823decreased by one in a promotion command. If any line in the entry 465indentation of the bullet. In all other operations, plain list items are
824body starts at column 0, indentation is not changed at all." 466not seen as headlines. For example, you cannot assign a TODO keyword to
825 :group 'org-structure 467such an item."
468 :group 'org-plain-lists
826 :type 'boolean) 469 :type 'boolean)
827 470
471
828(defcustom org-plain-list-ordered-item-terminator t 472(defcustom org-plain-list-ordered-item-terminator t
829 "The character that makes a line with leading number an ordered list item. 473 "The character that makes a line with leading number an ordered list item.
830Valid values are ?. and ?\). To get both terminators, use t. While 474Valid values are ?. and ?\). To get both terminators, use t. While
831?. may look nicer, it creates the danger that a line with leading 475?. may look nicer, it creates the danger that a line with leading
832number may be incorrectly interpreted as an item. ?\) therefore is 476number may be incorrectly interpreted as an item. ?\) therefore is
833the safe choice." 477the safe choice."
834 :group 'org-structure 478 :group 'org-plain-lists
835 :type '(choice (const :tag "dot like in \"2.\"" ?.) 479 :type '(choice (const :tag "dot like in \"2.\"" ?.)
836 (const :tag "paren like in \"2)\"" ?\)) 480 (const :tag "paren like in \"2)\"" ?\))
837 (const :tab "both" t))) 481 (const :tab "both" t)))
@@ -841,16 +485,13 @@ the safe choice."
841Renumbering happens when the sequence have been changed with 485Renumbering happens when the sequence have been changed with
842\\[org-shiftmetaup] or \\[org-shiftmetadown]. After other editing commands, 486\\[org-shiftmetaup] or \\[org-shiftmetadown]. After other editing commands,
843use \\[org-ctrl-c-ctrl-c] to trigger renumbering." 487use \\[org-ctrl-c-ctrl-c] to trigger renumbering."
844 :group 'org-structure 488 :group 'org-plain-lists
845 :type 'boolean) 489 :type 'boolean)
846 490
847(defcustom org-enable-fixed-width-editor t 491(defgroup org-archive nil
848 "Non-nil means, lines starting with \":\" are treated as fixed-width. 492 "Options concerning archiving in Org-mode."
849This currently only means, they are never auto-wrapped. 493 :tag "Org Archive"
850When nil, such lines will be treated like ordinary lines. 494 :group 'org-structure)
851See also the QUOTE keyword."
852 :group 'org-structure
853 :type 'boolean)
854 495
855(defcustom org-archive-location "%s_archive::" 496(defcustom org-archive-location "%s_archive::"
856 "The location where subtrees should be archived. 497 "The location where subtrees should be archived.
@@ -885,12 +526,12 @@ You may set this option on a per-file basis by adding to the buffer a
885line like 526line like
886 527
887#+ARCHIVE: basement::** Finished Tasks" 528#+ARCHIVE: basement::** Finished Tasks"
888 :group 'org-structure 529 :group 'org-archive
889 :type 'string) 530 :type 'string)
890 531
891(defcustom org-archive-mark-done t 532(defcustom org-archive-mark-done t
892 "Non-nil means, mark archived entries as DONE." 533 "Non-nil means, mark archived entries as DONE."
893 :group 'org-structure 534 :group 'org-archive
894 :type 'boolean) 535 :type 'boolean)
895 536
896(defcustom org-archive-stamp-time t 537(defcustom org-archive-stamp-time t
@@ -898,87 +539,250 @@ line like
898The time stamp will be added directly after the TODO state keyword in the 539The time stamp will be added directly after the TODO state keyword in the
899first line, so it is probably best to use this in combinations with 540first line, so it is probably best to use this in combinations with
900`org-archive-mark-done'." 541`org-archive-mark-done'."
901 :group 'org-structure 542 :group 'org-archive
902 :type 'boolean) 543 :type 'boolean)
903 544
904(defgroup org-tags nil 545(defgroup org-table nil
905 "Options concerning startup of Org-mode." 546 "Options concerning tables in Org-mode."
906 :tag "Org Tags" 547 :tag "Org Table"
907 :group 'org) 548 :group 'org)
908 549
909(defcustom org-tags-column 48 550(defcustom org-enable-table-editor 'optimized
910 "The column to which tags should be indented in a headline. 551 "Non-nil means, lines starting with \"|\" are handled by the table editor.
911If this number is positive, it specifies the column. If it is negative, 552When nil, such lines will be treated like ordinary lines.
912it means that the tags should be flushright to that column. For example,
913-79 works well for a normal 80 character screen."
914 :group 'org-tags
915 :type 'integer)
916 553
917(defcustom org-auto-align-tags t 554When equal to the symbol `optimized', the table editor will be optimized to
918 "Non-nil means, realign tags after pro/demotion of TODO state change. 555do the following:
919These operations change the length of a headline and therefore shift 556- Use automatic overwrite mode in front of whitespace in table fields.
920the tags around. With this options turned on, after each such operation 557 This make the structure of the table stay in tact as long as the edited
921the tags are again aligned to `org-tags-column'." 558 field does not exceed the column width.
922 :group 'org-tags 559- Minimize the number of realigns. Normally, the table is aligned each time
560 TAB or RET are pressed to move to another field. With optimization this
561 happens only if changes to a field might have changed the column width.
562Optimization requires replacing the functions `self-insert-command',
563`delete-char', and `backward-delete-char' in Org-mode buffers, with a
564slight (in fact: unnoticeable) speed impact for normal typing. Org-mode is
565very good at guessing when a re-align will be necessary, but you can always
566force one with \\[org-ctrl-c-ctrl-c].
567
568If you would like to use the optimized version in Org-mode, but the
569un-optimized version in OrgTbl-mode, see the variable `orgtbl-optimized'.
570
571This variable can be used to turn on and off the table editor during a session,
572but in order to toggle optimization, a restart is required.
573
574See also the variable `org-table-auto-blank-field'."
575 :group 'org-table
576 :type '(choice
577 (const :tag "off" nil)
578 (const :tag "on" t)
579 (const :tag "on, optimized" optimized)))
580
581(defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
582 "Non-nil means, use the optimized table editor version for `orgtbl-mode'.
583In the optimized version, the table editor takes over all simple keys that
584normally just insert a character. In tables, the characters are inserted
585in a way to minimize disturbing the table structure (i.e. in overwrite mode
586for empty fields). Outside tables, the correct binding of the keys is
587restored.
588
589The default for this option is t if the optimized version is also used in
590Org-mode. See the variable `org-enable-table-editor' for details. Changing
591this variable requires a restart of Emacs to become effective."
592 :group 'org-table
923 :type 'boolean) 593 :type 'boolean)
924 594
925(defcustom org-use-tag-inheritance t 595(defgroup org-table-settings nil
926 "Non-nil means, tags in levels apply also for sublevels. 596 "Settings for tables in Org-mode."
927When nil, only the tags directly given in a specific line apply there. 597 :tag "Org Table Settings"
928If you turn off this option, you very likely want to turn on the 598 :group 'org-table)
929companion option `org-tags-match-list-sublevels'." 599
930 :group 'org-tags 600(defcustom org-table-default-size "5x2"
601 "The default size for newly created tables, Columns x Rows."
602 :group 'org-table-settings
603 :type 'string)
604
605(defcustom org-table-number-regexp "^[<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*$"
606 "Regular expression for recognizing numbers in table columns.
607If a table column contains mostly numbers, it will be aligned to the
608right. If not, it will be aligned to the left.
609
610The default value of this option is a regular expression which allows
611anything which looks remotely like a number as used in scientific
612context. For example, all of the following will be considered a
613number:
614 12 12.2 2.4e-08 2x10^12 4.034+-0.02 2.7(10) >3.5
615
616Other options offered by the customize interface are more restrictive."
617 :group 'org-table-settings
618 :type '(choice
619 (const :tag "Positive Integers"
620 "^[0-9]+$")
621 (const :tag "Integers"
622 "^[-+]?[0-9]+$")
623 (const :tag "Floating Point Numbers"
624 "^[-+]?\\([0-9]*\\.[0-9]+\\|[0-9]+\\.[0-9]*\\)$")
625 (const :tag "Floating Point Number or Integer"
626 "^[-+]?\\([0-9]*\\.[0-9]+\\|[0-9]+\\.?[0-9]*\\)$")
627 (const :tag "Exponential, Floating point, Integer"
628 "^[-+]?[0-9.]+\\([eEdD][-+0-9]+\\)?$")
629 (const :tag "Very General Number-Like"
630 "^[<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*$")
631 (string :tag "Regexp:")))
632
633(defcustom org-table-number-fraction 0.5
634 "Fraction of numbers in a column required to make the column align right.
635In a column all non-white fields are considered. If at least this
636fraction of fields is matched by `org-table-number-fraction',
637alignment to the right border applies."
638 :group 'org-table-settings
639 :type 'number)
640
641(defgroup org-table-editing nil
642 "Bahavior of tables during editing in Org-mode."
643 :tag "Org Table Editing"
644 :group 'org-table)
645
646(defcustom org-table-automatic-realign t
647 "Non-nil means, automatically re-align table when pressing TAB or RETURN.
648When nil, aligning is only done with \\[org-table-align], or after column
649removal/insertion."
650 :group 'org-table-editing
931 :type 'boolean) 651 :type 'boolean)
932 652
933(defcustom org-tags-match-list-sublevels nil 653(defcustom org-table-limit-column-width t ;kw
934 "Non-nil means list also sublevels of headlines matching tag search. 654 "Non-nil means, allow to limit the width of table columns with <N> fields."
935Because of tag inheritance (see variable `org-use-tag-inheritance'), 655 :group 'org-table-editing
936the sublevels of a headline matching a tag search often also match 656 :type 'boolean)
937the same search. Listing all of them can create very long lists.
938Setting this variable to nil causes subtrees to be skipped.
939This option is off by default, because inheritance in on. If you turn
940inheritance off, you very likely want to turn this option on.
941 657
942As a special case, if the tag search is restricted to TODO items, the 658(defcustom org-table-auto-blank-field t
943value of this variable is ignored and sublevels are always checked, to 659 "Non-nil means, automatically blank table field when starting to type into it.
944make sure all corresponding TODO items find their way into the list." 660This only happens when typing immediately after a field motion
945 :group 'org-tags 661command (TAB, S-TAB or RET).
662Only relevant when `org-enable-table-editor' is equal to `optimized'."
663 :group 'org-table-editing
946 :type 'boolean) 664 :type 'boolean)
947 665
948(defvar org-tags-history nil 666(defcustom org-table-tab-jumps-over-hlines t
949 "History of minibuffer reads for tags.") 667 "Non-nil means, tab in the last column of a table with jump over a hline.
950(defvar org-last-tags-completion-table nil 668If a horizontal separator line is following the current line,
951 "The last used completion table for tags.") 669`org-table-next-field' can either create a new row before that line, or jump
670over the line. When this option is nil, a new line will be created before
671this line."
672 :group 'org-table-editing
673 :type 'boolean)
674
675(defcustom org-table-tab-recognizes-table.el t
676 "Non-nil means, TAB will automatically notice a table.el table.
677When it sees such a table, it moves point into it and - if necessary -
678calls `table-recognize-table'."
679 :group 'org-table-editing
680 :type 'boolean)
681
682(defgroup org-table-calculation nil
683 "Options concerning tables in Org-mode."
684 :tag "Org Table Calculation"
685 :group 'org-table)
686
687(defcustom org-table-copy-increment t
688 "Non-nil means, increment when copying current field with \\[org-table-copy-down]."
689 :group 'org-table-calculation
690 :type 'boolean)
691
692(defcustom org-calc-default-modes
693 '(calc-internal-prec 12
694 calc-float-format (float 5)
695 calc-angle-mode deg
696 calc-prefer-frac nil
697 calc-symbolic-mode nil
698 calc-date-format (YYYY "-" MM "-" DD " " Www (" " HH ":" mm))
699 calc-display-working-message t
700 )
701 "List with Calc mode settings for use in calc-eval for table formulas.
702The list must contain alternating symbols (Calc modes variables and values).
703Don't remove any of the default settings, just change the values. Org-mode
704relies on the variables to be present in the list."
705 :group 'org-table-calculation
706 :type 'plist)
707
708(defcustom org-table-formula-evaluate-inline t
709 "Non-nil means, TAB and RET evaluate a formula in current table field.
710If the current field starts with an equal sign, it is assumed to be a formula
711which should be evaluated as described in the manual and in the documentation
712string of the command `org-table-eval-formula'. This feature requires the
713Emacs calc package.
714When this variable is nil, formula calculation is only available through
715the command \\[org-table-eval-formula]."
716 :group 'org-table-calculation
717 :type 'boolean)
718
719
720(defcustom org-table-formula-use-constants t
721 "Non-nil means, interpret constants in formulas in tables.
722A constant looks like `$c' or `$Grav' and will be replaced before evaluation
723by the value given in `org-table-formula-constants', or by a value obtained
724from the `constants.el' package."
725 :group 'org-table-calculation
726 :type 'boolean)
727
728(defcustom org-table-formula-constants nil
729 "Alist with constant names and values, for use in table formulas.
730The car of each element is a name of a constant, without the `$' before it.
731The cdr is the value as a string. For example, if you'd like to use the
732speed of light in a formula, you would configure
733
734 (setq org-table-formula-constants '((\"c\" . \"299792458.\")))
735
736and then use it in an equation like `$1*$c'."
737 :group 'org-table-calculation
738 :type '(repeat
739 (cons (string :tag "name")
740 (string :tag "value"))))
741
742(defcustom org-table-formula-numbers-only nil
743 "Non-nil means, calculate only with numbers in table formulas.
744Then all input fields will be converted to a number, and the result
745must also be a number. When nil, calc's full potential is available
746in table calculations, including symbolics etc."
747 :group 'org-table-calculation
748 :type 'boolean)
749
750(defcustom org-table-allow-automatic-line-recalculation t
751 "Non-nil means, lines marked with |#| or |*| will be recomputed automatically.
752Automatically means, when TAB or RET or C-c C-c are pressed in the line."
753 :group 'org-table-calculation
754 :type 'boolean)
952 755
953(defgroup org-link nil 756(defgroup org-link nil
954 "Options concerning links in Org-mode." 757 "Options concerning links in Org-mode."
955 :tag "Org Link" 758 :tag "Org Link"
956 :group 'org) 759 :group 'org)
957 760
958(defcustom org-tab-follows-link nil 761(defcustom org-descriptive-links t
959 "Non-nil means, on links TAB will follow the link. 762 "Non-nil means, hide link part and only show description of bracket links.
960Needs to be set before org.el is loaded." 763Bracket links are like [[link][descritpion]]. This variable sets the initial
961 :group 'org-link 764state in new org-mode buffers. The setting can then be toggled on a
962 :type 'boolean) 765per-buffer basis from the Org->Hyperlinks menu."
963
964(defcustom org-return-follows-link nil
965 "Non-nil means, on links RET will follow the link.
966Needs to be set before org.el is loaded."
967 :group 'org-link 766 :group 'org-link
968 :type 'boolean) 767 :type 'boolean)
969 768
970(defcustom org-mark-ring-length 4 769(defcustom org-link-style 'bracket
971 "Number of different positions to be recorded in the ring 770 "The style of links to be inserted with \\[org-insert-link].
972Changing this requires a restart of Emacs to work correctly." 771Possible values are:
772bracket [[link][description]]. This is recommended
773plain Description \\n link. The old way, no longer recommended."
973 :group 'org-link 774 :group 'org-link
974 :type 'interger) 775 :type '(choice
776 (const :tag "Bracket (recommended)" bracket)
777 (const :tag "Plain (no longer recommended)" plain)))
975 778
976(defcustom org-link-format "<%s>" 779(defcustom org-link-format "%s"
977 "Default format for linkes in the buffer. 780 "Default format for external, URL-like linkes in the buffer.
978This is a format string for printf, %s will be replaced by the link text. 781This is a format string for printf, %s will be replaced by the link text.
979If you want to make sure that your link is always properly terminated, 782The recommended value is just \"%s\", since links will be protected by
980include angle brackets into this format, like \"<%s>\". Some people also 783enclosing them in double brackets. If you prefer plain links (see variable
981recommend an additional URL: prefix, so the format would be \"<URL:%s>\"." 784`org-link-style'), \"<%s>\" is useful. Some people also recommend an
785additional URL: prefix, so the format would be \"<URL:%s>\"."
982 :group 'org-link 786 :group 'org-link
983 :type '(choice 787 :type '(choice
984 (const :tag "\"%s\" (e.g. http://www.there.com)" "%s") 788 (const :tag "\"%s\" (e.g. http://www.there.com)" "%s")
@@ -986,28 +790,35 @@ recommend an additional URL: prefix, so the format would be \"<URL:%s>\"."
986 (const :tag "\"<URL:%s>\" (e.g. <URL:http://www.there.com>)" "<URL:%s>") 790 (const :tag "\"<URL:%s>\" (e.g. <URL:http://www.there.com>)" "<URL:%s>")
987 (string :tag "Other" :value "<%s>"))) 791 (string :tag "Other" :value "<%s>")))
988 792
989(defcustom org-allow-space-in-links t 793(defcustom org-activate-links '(bracket angle plain radio tag date)
990 "Non-nil means, file names in links may contain space characters. 794 "Types of links that should be activated in Org-mode files.
991When nil, it becomes possible to put several links into a line. 795This is a list of symbols, each leading to the activation of a certain link
992Note that in tables, a link never extends accross fields, so in a table 796type. In principle, it does not hurt to turn on most link types - there may
993it is always possible to put several links into a line. 797be a small gain when turning off unused link types. The types are:
994Changing this variable requires a restart of Emacs of become effective." 798
995 :group 'org-link 799bracket The recommended [[link][description]] or [[link]] links with hiding.
996 :type 'boolean) 800angular Links in angular brackes that may contain whitespace like
997 801 <bbdb:Carsten Dominik>.
998(defcustom org-radio-targets t 802plain Plain links in normal text, no whitespace, like http://google.com.
999 "Non-nil means activate text matching a link target. 803radio Text that is matched by a radio target, see manual for details.
1000Radio targets are strings in triple angular brackets, like <<<My Target>>>. 804tag Tag settings in a headline (link to tag search).
1001When this option is set, any occurrence of \"my target\" in normal text 805date Time stamps (link to calendar).
1002becomes a link." 806camel CamelCase words defining text searches.
807
808Changing this variable requires a restart of Emacs to become effective."
1003 :group 'org-link 809 :group 'org-link
1004 :type 'boolean) 810 :type '(set (const :tag "Double bracket links (new style)" bracket)
1005 811 (const :tag "Angular bracket links (old style)" angular)
1006(defcustom org-activate-camels nil 812 (const :tag "plain text links" plain)
1007 "Non-nil means, treat words in CamelCase as in-file links. 813 (const :tag "Radio target matches" radio)
1008Changing this requires restart of Emacs to become effective." 814 (const :tag "Tags" tag)
1009 :group 'org-link 815 (const :tag "Timestamps" date)
1010 :type 'boolean) 816 (const :tag "CamelCase words" camel)))
817
818(defgroup org-link-store nil
819 "Options concerning storing links in Org-mode"
820 :tag "Org Store Link"
821 :group 'org-link)
1011 822
1012(defcustom org-context-in-file-links t 823(defcustom org-context-in-file-links t
1013 "Non-nil means, file links from `org-store-link' contain context. 824 "Non-nil means, file links from `org-store-link' contain context.
@@ -1016,13 +827,14 @@ used to find the context when the link is activated by the command
1016`org-open-at-point'. 827`org-open-at-point'.
1017Using a prefix arg to the command \\[org-store-link] (`org-store-link') 828Using a prefix arg to the command \\[org-store-link] (`org-store-link')
1018negates this setting for the duration of the command." 829negates this setting for the duration of the command."
1019 :group 'org-link 830 :group 'org-link-store
1020 :type 'boolean) 831 :type 'boolean)
1021 832
1022(defcustom org-file-link-context-use-camel-case nil 833(defcustom org-file-link-context-use-camel-case nil
1023 "Non-nil means, use CamelCase to store a search context in a file link. 834 "Non-nil means, use CamelCase to store a search context in a file link.
1024When nil, the search string simply consists of the words of the string." 835When nil, the search string simply consists of the words of the string.
1025 :group 'org-link 836CamelCase is deprecated, and support for it may be dropped in the future."
837 :group 'org-link-store
1026 :type 'boolean) 838 :type 'boolean)
1027 839
1028(defcustom org-keep-stored-link-after-insertion nil 840(defcustom org-keep-stored-link-after-insertion nil
@@ -1035,9 +847,47 @@ Org-mode file (offering completion for all stored links). When this
1035option is nil, every link which has been inserted once using \\[org-insert-link] 847option is nil, every link which has been inserted once using \\[org-insert-link]
1036will be removed from the list, to make completing the unused links 848will be removed from the list, to make completing the unused links
1037more efficient." 849more efficient."
1038 :group 'org-link 850 :group 'org-link-store
1039 :type 'boolean) 851 :type 'boolean)
1040 852
853(defcustom org-usenet-links-prefer-google nil
854 "Non-nil means, `org-store-link' will create web links to Google groups.
855When nil, Gnus will be used for such links.
856Using a prefix arg to the command \\[org-store-link] (`org-store-link')
857negates this setting for the duration of the command."
858 :group 'org-link-store
859 :type 'boolean)
860
861(defgroup org-link-follow nil
862 "Options concerning following links in Org-mode"
863 :tag "Org Follow Link"
864 :group 'org-link)
865
866(defcustom org-tab-follows-link nil
867 "Non-nil means, on links TAB will follow the link.
868Needs to be set before org.el is loaded."
869 :group 'org-link-follow
870 :type 'boolean)
871
872(defcustom org-return-follows-link nil
873 "Non-nil means, on links RET will follow the link.
874Needs to be set before org.el is loaded."
875 :group 'org-link-follow
876 :type 'boolean)
877
878(defcustom org-mouse-1-follows-link t
879 "Non-nil means, mouse-1 on a link will follow the link.
880A longer mouse click will still set point. Does not wortk on XEmacs.
881Needs to be set before org.el is loaded."
882 :group 'org-link-follow
883 :type 'boolean)
884
885(defcustom org-mark-ring-length 4
886 "Number of different positions to be recorded in the ring
887Changing this requires a restart of Emacs to work correctly."
888 :group 'org-link-follow
889 :type 'interger)
890
1041(defcustom org-link-frame-setup 891(defcustom org-link-frame-setup
1042 '((vm . vm-visit-folder-other-frame) 892 '((vm . vm-visit-folder-other-frame)
1043 (gnus . gnus-other-frame) 893 (gnus . gnus-other-frame)
@@ -1059,7 +909,7 @@ For FILE, use any of
1059For the calendar, use the variable `calendar-setup'. 909For the calendar, use the variable `calendar-setup'.
1060For BBDB, it is currently only possible to display the matches in 910For BBDB, it is currently only possible to display the matches in
1061another window." 911another window."
1062 :group 'org-link 912 :group 'org-link-follow
1063 :type '(list 913 :type '(list
1064 (cons (const vm) 914 (cons (const vm)
1065 (choice 915 (choice
@@ -1076,25 +926,28 @@ another window."
1076 (const find-file-other-window) 926 (const find-file-other-window)
1077 (const find-file-other-frame))))) 927 (const find-file-other-frame)))))
1078 928
1079(defcustom org-usenet-links-prefer-google nil
1080 "Non-nil means, `org-store-link' will create web links to Google groups.
1081When nil, Gnus will be used for such links.
1082Using a prefix arg to the command \\[org-store-link] (`org-store-link')
1083negates this setting for the duration of the command."
1084 :group 'org-link
1085 :type 'boolean)
1086
1087(defcustom org-open-non-existing-files nil 929(defcustom org-open-non-existing-files nil
1088 "Non-nil means, `org-open-file' will open non-existing file. 930 "Non-nil means, `org-open-file' will open non-existing file.
1089When nil, an error will be generated." 931When nil, an error will be generated."
1090 :group 'org-link 932 :group 'org-link-follow
1091 :type 'boolean) 933 :type 'boolean)
1092 934
1093(defcustom org-confirm-shell-links t 935(defcustom org-confirm-shell-links 'yes-or-no-p
1094 "Non-nil means, ask for confirmation before executing shell links. 936 "Non-nil means, ask for confirmation before executing shell links.
1095The default is true, to keep new users from shooting into their own foot." 937Shell links can be dangerous, just thing about a link
1096 :group 'org-link 938
1097 :type 'boolean) 939 [[shell:rm -rf ~/*][Google Search]]
940
941This link would show up in your Org-mode document as \"Google Search\"
942but really it would remove your entire home directory. Dangerous indeed.
943Therefore I *definitely* advise agains setting this varaiable to nil.
944Just change it to `y-or-n-p' of you want to confirm with a single key press
945rather than having to type \"yes\"."
946 :group 'org-link-follow
947 :type '(choice
948 (const :tag "with yes-or-no (safer)" yes-or-no-p)
949 (const :tag "with y-or-n (faster)" y-or-n-p)
950 (const :tag "no confirmation (dangerous)" nil)))
1098 951
1099(defconst org-file-apps-defaults-gnu 952(defconst org-file-apps-defaults-gnu
1100 '((t . mailcap)) 953 '((t . mailcap))
@@ -1143,7 +996,7 @@ For more examples, see the system specific constants
1143`org-file-apps-defaults-macosx' 996`org-file-apps-defaults-macosx'
1144`org-file-apps-defaults-windowsnt' 997`org-file-apps-defaults-windowsnt'
1145`org-file-apps-defaults-gnu'." 998`org-file-apps-defaults-gnu'."
1146 :group 'org-link 999 :group 'org-link-follow
1147 :type '(repeat 1000 :type '(repeat
1148 (cons (choice :value "" 1001 (cons (choice :value ""
1149 (string :tag "Extension") 1002 (string :tag "Extension")
@@ -1156,11 +1009,11 @@ For more examples, see the system specific constants
1156 (sexp :tag "Lisp form"))))) 1009 (sexp :tag "Lisp form")))))
1157 1010
1158(defcustom org-mhe-search-all-folders nil 1011(defcustom org-mhe-search-all-folders nil
1159 "Non-nil means, that the search for the mh-message will be extended to 1012 "Non-nil means, that the search for the mh-message will be extended to
1160all folders if the message cannot be found in the folder given in the link. 1013all folders if the message cannot be found in the folder given in the link.
1161Searching all folders is very effective with one of the search engines 1014Searching all folders is very effective with one of the search engines
1162supported by MH-E, but will be slow with pick." 1015supported by MH-E, but will be slow with pick."
1163 :group 'org-link 1016 :group 'org-link-follow
1164 :type 'boolean) 1017 :type 'boolean)
1165 1018
1166(defgroup org-remember nil 1019(defgroup org-remember nil
@@ -1184,6 +1037,34 @@ the value of `remember-data-file'."
1184 (const :tag "Default from remember-data-file" nil) 1037 (const :tag "Default from remember-data-file" nil)
1185 file)) 1038 file))
1186 1039
1040(defcustom org-remember-templates nil
1041 "Templates for the creation of remember buffers.
1042When nil, just let remember make the buffer.
1043When not nil, this is a list of 3-element lists. In each entry, the first
1044element is a character, a unique key to select this template.
1045The second element is the template. The third element is optional and can
1046specify a destination file for remember items created with this template.
1047The default file is given by `org-default-notes-file'.
1048
1049The template specifies the structure of the remember buffer. It should have
1050a first line starting with a star, to act as the org-mode headline.
1051Furthermore, the following %-escapes will be replaced with content:
1052 %t time stamp, date only
1053 %T time stamp with date and time
1054 %u inactive time stamp, date only
1055 %U inactive time stamp with date and time
1056 %n user name
1057 %a annotation, normally the link created with org-store-link
1058 %i initial content, the region when remember is called with C-u.
1059 If %i is indented, the entire inserted text will be indented as well.
1060 %? This will be removed, and the cursor placed at this position."
1061 :group 'org-remember
1062 :type '(repeat :tag "enabled"
1063 (list :value (?a "\n" nil)
1064 (character :tag "Selection Key")
1065 (string :tag "Template")
1066 (file :tag "Destination file (optional)"))))
1067
1187(defcustom org-reverse-note-order nil 1068(defcustom org-reverse-note-order nil
1188 "Non-nil means, store new notes at the beginning of a file or entry. 1069 "Non-nil means, store new notes at the beginning of a file or entry.
1189When nil, new notes will be filed to the end of a file or entry." 1070When nil, new notes will be filed to the end of a file or entry."
@@ -1194,215 +1075,485 @@ When nil, new notes will be filed to the end of a file or entry."
1194 (repeat :tag "By file name regexp" 1075 (repeat :tag "By file name regexp"
1195 (cons regexp boolean)))) 1076 (cons regexp boolean))))
1196 1077
1197(defgroup org-table nil 1078(defgroup org-todo nil
1198 "Options concerning tables in Org-mode." 1079 "Options concerning TODO items in Org-mode."
1199 :tag "Org Table" 1080 :tag "Org TODO"
1200 :group 'org) 1081 :group 'org)
1201 1082
1202(defcustom org-enable-table-editor 'optimized 1083(defcustom org-todo-keywords '("TODO" "DONE")
1203 "Non-nil means, lines starting with \"|\" are handled by the table editor. 1084 "List of TODO entry keywords.
1204When nil, such lines will be treated like ordinary lines. 1085\\<org-mode-map>By default, this is '(\"TODO\" \"DONE\"). The last entry in the list is
1086considered to mean that the entry is \"done\". All the other mean that
1087action is required, and will make the entry show up in todo lists, diaries
1088etc.
1089The command \\[org-todo] cycles an entry through these states, and an
1090additional state where no keyword is present. For details about this
1091cycling, see also the variable `org-todo-interpretation'
1092Changes become only effective after restarting Emacs."
1093 :group 'org-todo
1094 :group 'org-keywords
1095 :type '(repeat (string :tag "Keyword")))
1205 1096
1206When equal to the symbol `optimized', the table editor will be optimized to 1097(defcustom org-todo-interpretation 'sequence
1207do the following: 1098 "Controls how TODO keywords are interpreted.
1208- Use automatic overwrite mode in front of whitespace in table fields. 1099This variable is only relevant if `org-todo-keywords' contains more than two
1209 This make the structure of the table stay in tact as long as the edited 1100states. \\<org-mode-map>Possible values are `sequence' and `type'.
1210 field does not exceed the column width. 1101
1211- Minimize the number of realigns. Normally, the table is aligned each time 1102When `sequence', \\[org-todo] will always switch to the next state in the
1212 TAB or RET are pressed to move to another field. With optimization this 1103`org-todo-keywords' list. When `type', \\[org-todo] only cycles from state
1213 happens only if changes to a field might have changed the column width. 1104to state when executed several times in direct succession. Otherwise, it
1214Optimization requires replacing the functions `self-insert-command', 1105switches directly to DONE from any state.
1215`delete-char', and `backward-delete-char' in Org-mode buffers, with a 1106See the manual for more information."
1216slight (in fact: unnoticeable) speed impact for normal typing. Org-mode is 1107 :group 'org-todo
1217very good at guessing when a re-align will be necessary, but you can always 1108 :group 'org-keywords
1218force one with \\[org-ctrl-c-ctrl-c]. 1109 :type '(choice (const sequence)
1110 (const type)))
1219 1111
1220If you would like to use the optimized version in Org-mode, but the 1112(defcustom org-after-todo-state-change-hook nil
1221un-optimized version in OrgTbl-mode, see the variable `orgtbl-optimized'. 1113 "Hook which is run after the state of a TODO item was changed.
1114The new state (a string with a TODO keyword, or nil) is available in the
1115Lisp variable `state'."
1116 :group 'org-todo
1117 :type 'hook)
1222 1118
1223This variable can be used to turn on and off the table editor during a session, 1119(defcustom org-log-done nil
1224but in order to toggle optimization, a restart is required. 1120 "When set, insert a (non-active) time stamp when TODO entry is marked DONE.
1121When the state of an entry is changed from nothing to TODO, remove a previous
1122closing date."
1123 :group 'org-todo
1124 :type 'boolean)
1225 1125
1226See also the variable `org-table-auto-blank-field'." 1126(defgroup org-priorities nil
1227 :group 'org-table 1127 "Keywords in Org-mode."
1228 :type '(choice 1128 :tag "Org Priorities"
1229 (const :tag "off" nil) 1129 :group 'org-todo)
1230 (const :tag "on" t)
1231 (const :tag "on, optimized" optimized)))
1232 1130
1233;; FIXME: We could have a third option which makes it jump only over the first 1131(defcustom org-default-priority ?B
1234;; hline in a table. 1132 "The default priority of TODO items.
1235(defcustom org-table-tab-jumps-over-hlines t 1133This is the priority an item get if no explicit priority is given."
1236 "Non-nil means, tab in the last column of a table with jump over a hline. 1134 :group 'org-priorities
1237If a horizontal separator line is following the current line, 1135 :type 'character)
1238`org-table-next-field' can either create a new row before that line, or jump 1136
1239over the line. When this option is nil, a new line will be created before 1137(defcustom org-lowest-priority ?C
1240this line." 1138 "The lowest priority of TODO items. A character like ?A, ?B etc."
1241 :group 'org-table 1139 :group 'org-priorities
1140 :type 'character)
1141
1142(defgroup org-time nil
1143 "Options concerning time stamps and deadlines in Org-mode."
1144 :tag "Org Time"
1145 :group 'org)
1146
1147(defconst org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a %H:%M>")
1148 "Formats for `format-time-string' which are used for time stamps.
1149It is not recommended to change this constant.")
1150
1151(defcustom org-time-stamp-rounding-minutes 0
1152 "Number of minutes to round time stamps to upon insertion.
1153When zero, insert the time unmodified. Useful rounding numbers
1154should be factors of 60, so for example 5, 10, 15.
1155When this is not zero, you can still force an exact time-stamp by using
1156a double prefix argument to a time-stamp command like `C-c .' or `C-c !'."
1157 :group 'org-time
1158 :type 'integer)
1159
1160(defcustom org-deadline-warning-days 30
1161 "No. of days before expiration during which a deadline becomes active.
1162This variable governs the display in the org file."
1163 :group 'org-time
1164 :type 'number)
1165
1166(defcustom org-popup-calendar-for-date-prompt t
1167 "Non-nil means, pop up a calendar when prompting for a date.
1168In the calendar, the date can be selected with mouse-1. However, the
1169minibuffer will also be active, and you can simply enter the date as well.
1170When nil, only the minibuffer will be available."
1171 :group 'org-time
1242 :type 'boolean) 1172 :type 'boolean)
1243 1173
1244(defcustom org-table-auto-blank-field t 1174(defcustom org-calendar-follow-timestamp-change t
1245 "Non-nil means, automatically blank table field when starting to type into it. 1175 "Non-nil means, make the calendar window follow timestamp changes.
1246This only happens when typing immediately after a field motion 1176When a timestamp is modified and the calendar window is visible, it will be
1247command (TAB, S-TAB or RET). 1177moved to the new date."
1248Only relevant when `org-enable-table-editor' is equal to `optimized'." 1178 :group 'org-time
1249 :group 'org-table
1250 :type 'boolean) 1179 :type 'boolean)
1251 1180
1252(defcustom org-table-default-size "5x2" 1181(defgroup org-tags nil
1253 "The default size for newly created tables, Columns x Rows." 1182 "Options concerning startup of Org-mode."
1254 :group 'org-table 1183 :tag "Org Tags"
1255 :type 'string) 1184 :group 'org)
1256 1185
1257(defcustom org-table-automatic-realign t 1186(defcustom org-tags-column 48
1258 "Non-nil means, automatically re-align table when pressing TAB or RETURN. 1187 "The column to which tags should be indented in a headline.
1259When nil, aligning is only done with \\[org-table-align], or after column 1188If this number is positive, it specifies the column. If it is negative,
1260removal/insertion." 1189it means that the tags should be flushright to that column. For example,
1261 :group 'org-table 1190-79 works well for a normal 80 character screen."
1191 :group 'org-tags
1192 :type 'integer)
1193
1194(defcustom org-auto-align-tags t
1195 "Non-nil means, realign tags after pro/demotion of TODO state change.
1196These operations change the length of a headline and therefore shift
1197the tags around. With this options turned on, after each such operation
1198the tags are again aligned to `org-tags-column'."
1199 :group 'org-tags
1262 :type 'boolean) 1200 :type 'boolean)
1263 1201
1264(defcustom org-table-spaces-around-separators '(1 . 1) 1202(defcustom org-use-tag-inheritance t
1265 "The number of spaces to be placed before and after separators." 1203 "Non-nil means, tags in levels apply also for sublevels.
1266 :group 'org-table 1204When nil, only the tags directly given in a specific line apply there.
1267 :type '(cons (number :tag "Before \"|\"") (number :tag " After \"|\""))) 1205If you turn off this option, you very likely want to turn on the
1206companion option `org-tags-match-list-sublevels'."
1207 :group 'org-tags
1208 :type 'boolean)
1268 1209
1269(defcustom org-table-spaces-around-invisible-separators '(1 . 2) 1210(defcustom org-tags-match-list-sublevels nil
1270 "The number of spaces to be placed before and after separators. 1211 "Non-nil means list also sublevels of headlines matching tag search.
1271This option applies when the column separators have been made invisible." 1212Because of tag inheritance (see variable `org-use-tag-inheritance'),
1272 :group 'org-table 1213the sublevels of a headline matching a tag search often also match
1273 :type '(cons (number :tag "Before \"|\"") (number :tag " After \"|\""))) 1214the same search. Listing all of them can create very long lists.
1215Setting this variable to nil causes subtrees of a match to be skipped.
1216This option is off by default, because inheritance in on. If you turn
1217inheritance off, you very likely want to turn this option on.
1274 1218
1275(defcustom org-table-number-regexp "^[<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*$" 1219As a special case, if the tag search is restricted to TODO items, the
1276 "Regular expression for recognizing numbers in table columns. 1220value of this variable is ignored and sublevels are always checked, to
1277If a table column contains mostly numbers, it will be aligned to the 1221make sure all corresponding TODO items find their way into the list."
1278right. If not, it will be aligned to the left. 1222 :group 'org-tags
1223 :type 'boolean)
1279 1224
1280The default value of this option is a regular expression which allows 1225(defvar org-tags-history nil
1281anything which looks remotely like a number as used in scientific 1226 "History of minibuffer reads for tags.")
1282context. For example, all of the following will be considered a 1227(defvar org-last-tags-completion-table nil
1283number: 1228 "The last used completion table for tags.")
1284 12 12.2 2.4e-08 2x10^12 4.034+-0.02 2.7(10) >3.5
1285 1229
1286Other options offered by the customize interface are more restrictive." 1230(defgroup org-agenda nil
1287 :group 'org-table 1231 "Options concerning agenda display Org-mode."
1232 :tag "Org Agenda"
1233 :group 'org)
1234
1235(defvar org-category nil
1236 "Variable used by org files to set a category for agenda display.
1237Such files should use a file variable to set it, for example
1238
1239 -*- mode: org; org-category: \"ELisp\"
1240
1241or contain a special line
1242
1243#+CATEGORY: ELisp
1244
1245If the file does not specify a category, then file's base name
1246is used instead.")
1247(make-variable-buffer-local 'org-category)
1248
1249(defcustom org-agenda-files nil
1250 "The files to be used for agenda display.
1251Entries may be added to this list with \\[org-agenda-file-to-front] and removed with
1252\\[org-remove-file]. You can also use customize to edit the list.
1253
1254If the value of the variable is not a list but a single file name, then
1255the list of agenda files is actually stored and maintained in that file, one
1256agenda file per line."
1257 :group 'org-agenda
1288 :type '(choice 1258 :type '(choice
1289 (const :tag "Positive Integers" 1259 (repeat :tag "List of files" file)
1290 "^[0-9]+$") 1260 (file :tag "Store list in a file\n" :value "~/.agenda_files")))
1291 (const :tag "Integers"
1292 "^[-+]?[0-9]+$")
1293 (const :tag "Floating Point Numbers"
1294 "^[-+]?\\([0-9]*\\.[0-9]+\\|[0-9]+\\.[0-9]*\\)$")
1295 (const :tag "Floating Point Number or Integer"
1296 "^[-+]?\\([0-9]*\\.[0-9]+\\|[0-9]+\\.?[0-9]*\\)$")
1297 (const :tag "Exponential, Floating point, Integer"
1298 "^[-+]?[0-9.]+\\([eEdD][-+0-9]+\\)?$")
1299 (const :tag "Very General Number-Like"
1300 "^[<>]?[-+^.0-9]*[0-9][-+^.0-9eEdDx()%]*$")
1301 (string :tag "Regexp:")))
1302 1261
1303(defcustom org-table-number-fraction 0.5 1262(defcustom org-agenda-custom-commands '(("w" todo "WAITING"))
1304 "Fraction of numbers in a column required to make the column align right. 1263 "Custom commands for the agenda.
1305In a column all non-white fields are considered. If at least this 1264These commands will be offered on the splash screen displayed by the
1306fraction of fields is matched by `org-table-number-fraction', 1265agenda dispatcher \\[org-agenda]. Each entry is a list of 3 items:
1307alignment to the right border applies."
1308 :group 'org-table
1309 :type 'number)
1310 1266
1311(defcustom org-export-highlight-first-table-line t 1267key The key (a single char as a string) to be associated with the command.
1312 "Non-nil means, highlight the first table line. 1268type The command type, any of the following symbols:
1313In HTML export, this means use <th> instead of <td>. 1269 todo Entries with a specific TODO keyword, in all agenda files.
1314In tables created with table.el, this applies to the first table line. 1270 tags Tags match in all agenda files.
1315In Org-mode tables, all lines before the first horizontal separator 1271 todo-tree Sparse tree of specific TODO keyword in *current* file.
1316line will be formatted with <th> tags." 1272 tags-tree Sparse tree with all tags matches in *current* file.
1317 :group 'org-table 1273 occur-tree Occur sparse tree for current file.
1274match What to search for:
1275 - a single keyword for TODO keyword searches
1276 - a tags match expression for tags searches
1277 - a regular expression for occur searches"
1278 :group 'org-agenda
1279 :type '(repeat
1280 (list (string :tag "Key")
1281 (choice :tag "Type"
1282 (const :tag "Tags search in all agenda files" tags)
1283 (const :tag "TODO keyword search in all agenda files" todo)
1284 (const :tag "Tags sparse tree in current buffer" tags-tree)
1285 (const :tag "TODO keyword tree in current buffer" todo-tree)
1286 (const :tag "Occur tree in current buffer" occur-tree))
1287 (string :tag "Match"))))
1288
1289(defcustom org-agenda-include-all-todo t
1290 "Non-nil means, the agenda will always contain all TODO entries.
1291When nil, date-less entries will only be shown if `org-agenda' is called
1292with a prefix argument.
1293When non-nil, the TODO entries will be listed at the top of the agenda, before
1294the entries for specific days."
1295 :group 'org-agenda
1318 :type 'boolean) 1296 :type 'boolean)
1319 1297
1320(defcustom org-table-tab-recognizes-table.el t 1298(defcustom org-agenda-include-diary nil
1321 "Non-nil means, TAB will automatically notice a table.el table. 1299 "If non-nil, include in the agenda entries from the Emacs Calendar's diary."
1322When it sees such a table, it moves point into it and - if necessary - 1300 :group 'org-agenda
1323calls `table-recognize-table'."
1324 :group 'org-table
1325 :type 'boolean) 1301 :type 'boolean)
1326 1302
1327(defgroup org-table-calculation nil 1303(defcustom org-calendar-to-agenda-key [?c]
1328 "Options concerning tables in Org-mode." 1304 "The key to be installed in `calendar-mode-map' for switching to the agenda.
1329 :tag "Org Table Calculation" 1305The command `org-calendar-goto-agenda' will be bound to this key. The
1330 :group 'org) 1306default is the character `c' because then `c' can be used to switch back and
1307forth between agenda and calendar."
1308 :group 'org-agenda
1309 :type 'sexp)
1331 1310
1332(defcustom org-table-copy-increment t 1311(defgroup org-agenda-window-setup nil
1333 "Non-nil means, increment when copying current field with \\[org-table-copy-down]." 1312 "Options concerning setting up the Agenda window in Org Mode."
1334 :group 'org-table-calculation 1313 :tag "Org Agenda Window Setup"
1314 :group 'org-agenda)
1315
1316(defcustom org-agenda-mouse-1-follows-link nil
1317 "Non-nil means, mouse-1 on a link will follow the link in the agenda.
1318A longer mouse click will still set point. Does not wortk on XEmacs.
1319Needs to be set before org.el is loaded."
1320 :group 'org-agenda-setup
1335 :type 'boolean) 1321 :type 'boolean)
1336 1322
1337(defcustom org-calc-default-modes 1323(defcustom org-select-timeline-window t
1338 '(calc-internal-prec 12 1324 "Non-nil means, after creating a timeline, move cursor into Timeline window.
1339 calc-float-format (float 5) 1325When nil, cursor will remain in the current window."
1340 calc-angle-mode deg 1326 :group 'org-agenda-setup
1341 calc-prefer-frac nil 1327 :type 'boolean)
1342 calc-symbolic-mode nil
1343 calc-date-format (YYYY "-" MM "-" DD " " Www (" " HH ":" mm))
1344 calc-display-working-message t
1345 )
1346 "List with Calc mode settings for use in calc-eval for table formulas.
1347The list must contain alternating symbols (Calc modes variables and values).
1348Don't remove any of the default settings, just change the values. Org-mode
1349relies on the variables to be present in the list."
1350 :group 'org-table-calculation
1351 :type 'plist)
1352 1328
1353(defcustom org-table-formula-evaluate-inline t 1329(defcustom org-select-agenda-window t
1354 "Non-nil means, TAB and RET evaluate a formula in current table field. 1330 "Non-nil means, after creating an agenda, move cursor into Agenda window.
1355If the current field starts with an equal sign, it is assumed to be a formula 1331When nil, cursor will remain in the current window."
1356which should be evaluated as described in the manual and in the documentation 1332 :group 'org-agenda-setup
1357string of the command `org-table-eval-formula'. This feature requires the
1358Emacs calc package.
1359When this variable is nil, formula calculation is only available through
1360the command \\[org-table-eval-formula]."
1361 :group 'org-table-calculation
1362 :type 'boolean) 1333 :type 'boolean)
1363 1334
1335(defcustom org-fit-agenda-window t
1336 "Non-nil means, change window size of agenda to fit content."
1337 :group 'org-agenda-setup
1338 :type 'boolean)
1364 1339
1365(defcustom org-table-formula-use-constants t 1340(defgroup org-agenda-display nil
1366 "Non-nil means, interpret constants in formulas in tables. 1341 "Options concerning what to display initially in Agenda."
1367A constant looks like `$c' or `$Grav' and will be replaced before evaluation 1342 :tag "Org Agenda Display"
1368by the value given in `org-table-formula-constants', or by a value obtained 1343 :group 'org-agenda)
1369from the `constants.el' package." 1344
1370 :group 'org-table-calculation 1345(defcustom org-agenda-show-all-dates t
1346 "Non-nil means, `org-agenda' shows every day in the selected range.
1347When nil, only the days which actually have entries are shown."
1348 :group 'org-agenda-display
1371 :type 'boolean) 1349 :type 'boolean)
1372 1350
1373(defcustom org-table-formula-constants nil 1351(defcustom org-agenda-start-on-weekday 1
1374 "Alist with constant names and values, for use in table formulas. 1352 "Non-nil means, start the overview always on the specified weekday.
1375The car of each element is a name of a constant, without the `$' before it. 13530 denotes Sunday, 1 denotes Monday etc.
1376The cdr is the value as a string. For example, if you'd like to use the 1354When nil, always start on the current day."
1377speed of light in a formula, you would configure 1355 :group 'org-agenda-display
1356 :type '(choice (const :tag "Today" nil)
1357 (number :tag "Weekday No.")))
1378 1358
1379 (setq org-table-formula-constants '((\"c\" . \"299792458.\"))) 1359(defcustom org-agenda-ndays 7
1360 "Number of days to include in overview display.
1361Should be 1 or 7."
1362 :group 'org-agenda-display
1363 :type 'number)
1380 1364
1381and then use it in an equation like `$1*$c'." 1365(defcustom org-agenda-use-time-grid t
1382 :group 'org-table-calculation 1366 "Non-nil means, show a time grid in the agenda schedule.
1367A time grid is a set of lines for specific times (like every two hours between
13688:00 and 20:00). The items scheduled for a day at specific times are
1369sorted in between these lines.
1370For details about when the grid will be shown, and what it will look like, see
1371the variable `org-agenda-time-grid'."
1372 :group 'org-agenda-display
1373 :type 'boolean)
1374
1375(defcustom org-agenda-time-grid
1376 '((daily today require-timed)
1377 "----------------"
1378 (800 1000 1200 1400 1600 1800 2000))
1379
1380 "The settings for time grid for agenda display.
1381This is a list of three items. The first item is again a list. It contains
1382symbols specifying conditions when the grid should be displayed:
1383
1384 daily if the agenda shows a single day
1385 weekly if the agenda shows an entire week
1386 today show grid on current date, independent of daily/weekly display
1387 require-timed show grid only if at least on item has a time specification
1388
1389The second item is a string which will be places behing the grid time.
1390
1391The third item is a list of integers, indicating the times that should have
1392a grid line."
1393 :group 'org-agenda-display
1394 :type
1395 '(list
1396 (set :greedy t :tag "Grid Display Options"
1397 (const :tag "Show grid in single day agenda display" daily)
1398 (const :tag "Show grid in weekly agenda display" weekly)
1399 (const :tag "Always show grid for today" today)
1400 (const :tag "Show grid only if any timed entries are present"
1401 require-timed)
1402 (const :tag "Skip grid times already present in an entry"
1403 remove-match))
1404 (string :tag "Grid String")
1405 (repeat :tag "Grid Times" (integer :tag "Time"))))
1406
1407(defcustom org-agenda-sorting-strategy '(time-up category-keep priority-down)
1408 "Sorting structure for the agenda items of a single day.
1409This is a list of symbols which will be used in sequence to determine
1410if an entry should be listed before another entry. The following
1411symbols are recognized:
1412
1413time-up Put entries with time-of-day indications first, early first
1414time-down Put entries with time-of-day indications first, late first
1415category-keep Keep the default order of categories, corresponding to the
1416 sequence in `org-agenda-files'.
1417category-up Sort alphabetically by category, A-Z.
1418category-down Sort alphabetically by category, Z-A.
1419priority-up Sort numerically by priority, high priority last.
1420priority-down Sort numerically by priority, high priority first.
1421
1422The different possibilities will be tried in sequence, and testing stops
1423if one comparison returns a \"not-equal\". For example, the default
1424 '(time-up category-keep priority-down)
1425means: Pull out all entries having a specified time of day and sort them,
1426in order to make a time schedule for the current day the first thing in the
1427agenda listing for the day. Of the entries without a time indication, keep
1428the grouped in categories, don't sort the categories, but keep them in
1429the sequence given in `org-agenda-files'. Within each category sort by
1430priority.
1431
1432Leaving out `category-keep' would mean that items will be sorted across
1433categories by priority."
1434 :group 'org-agenda-display
1383 :type '(repeat 1435 :type '(repeat
1384 (cons (string :tag "name") 1436 (choice
1385 (string :tag "value")))) 1437 (const time-up)
1438 (const time-down)
1439 (const category-keep)
1440 (const category-up)
1441 (const category-down)
1442 (const priority-up)
1443 (const priority-down))))
1386 1444
1387(defcustom org-table-formula-numbers-only nil 1445(defcustom org-sort-agenda-notime-is-late t
1388 "Non-nil means, calculate only with numbers in table formulas. 1446 "Non-nil means, items without time are considered late.
1389Then all input fields will be converted to a number, and the result 1447This is only relevant for sorting. When t, items which have no explicit
1390must also be a number. When nil, calc's full potential is available 1448time like 15:30 will be considered as 24:01, i.e. later than any items which
1391in table calculations, including symbolics etc." 1449do have a time. When nil, the default time is before 0:00. You can use this
1392 :group 'org-table-calculation 1450option to decide if the schedule for today should come before or after timeless
1451agenda entries."
1452 :group 'org-agenda-display
1393 :type 'boolean) 1453 :type 'boolean)
1394 1454
1395(defcustom org-table-allow-automatic-line-recalculation t 1455
1396 "Non-nil means, lines marked with |#| or |*| will be recomputed automatically. 1456(defgroup org-agenda-prefix nil
1397Automatically means, when TAB or RET or C-c C-c are pressed in the line." 1457 "Options concerning the entry prefix in the Org-mode agenda display."
1398 :group 'org-table-calculation 1458 :tag "Org Agenda Prefix"
1399 :type 'boolean) 1459 :group 'org-agenda)
1460
1461(defcustom org-agenda-prefix-format " %-12:c%?-12t% s"
1462 "Format specification for the prefix of items in the agenda buffer.
1463This format works similar to a printf format, with the following meaning:
1464
1465 %c the category of the item, \"Diary\" for entries from the diary, or
1466 as given by the CATEGORY keyword or derived from the file name.
1467 %T the first tag of the item.
1468 %t the time-of-day specification if one applies to the entry, in the
1469 format HH:MM
1470 %s Scheduling/Deadline information, a short string
1471
1472All specifiers work basically like the standard `%s' of printf, but may
1473contain two additional characters: A question mark just after the `%' and
1474a whitespace/punctuation character just before the final letter.
1475
1476If the first character after `%' is a question mark, the entire field
1477will only be included if the corresponding value applies to the
1478current entry. This is useful for fields which should have fixed
1479width when present, but zero width when absent. For example,
1480\"%?-12t\" will result in a 12 character time field if a time of the
1481day is specified, but will completely disappear in entries which do
1482not contain a time.
1483
1484If there is punctuation or whitespace character just before the final
1485format letter, this character will be appended to the field value if
1486the value is not empty. For example, the format \"%-12:c\" leads to
1487\"Diary: \" if the category is \"Diary\". If the category were be
1488empty, no additional colon would be interted.
1489
1490The default value of this option is \" %-12:c%?-12t% s\", meaning:
1491- Indent the line with two space characters
1492- Give the category in a 12 chars wide field, padded with whitespace on
1493 the right (because of `-'). Append a colon if there is a category
1494 (because of `:').
1495- If there is a time-of-day, put it into a 12 chars wide field. If no
1496 time, don't put in an empty field, just skip it (because of '?').
1497- Finally, put the scheduling information and append a whitespace.
1498
1499As another example, if you don't want the time-of-day of entries in
1500the prefix, you could use:
1501
1502 (setq org-agenda-prefix-format \" %-11:c% s\")
1503
1504See also the variables `org-agenda-remove-times-when-in-prefix' and
1505`org-agenda-remove-tags-when-in-prefix'."
1506 :type 'string
1507 :group 'org-agenda-prefix)
1508
1509(defcustom org-timeline-prefix-format " % s"
1510 "Like `org-agenda-prefix-format', but for the timeline of a single file."
1511 :type 'string
1512 :group 'org-agenda-prefix)
1513
1514(defvar org-prefix-format-compiled nil
1515 "The compiled version of the most recently used prefix format.
1516Depending on which command was used last, this may be the compiled version
1517of `org-agenda-prefix-format' or `org-timeline-prefix-format'.")
1518
1519;; FIXME: There seem to be situations where this does no work.
1520(defcustom org-agenda-remove-times-when-in-prefix t
1521 "Non-nil means, remove duplicate time specifications in agenda items.
1522When the format `org-agenda-prefix-format' contains a `%t' specifier, a
1523time-of-day specification in a headline or diary entry is extracted and
1524placed into the prefix. If this option is non-nil, the original specification
1525\(a timestamp or -range, or just a plain time(range) specification like
152611:30-4pm) will be removed for agenda display. This makes the agenda less
1527cluttered.
1528The option can be t or nil. It may also be the symbol `beg', indicating
1529that the time should only be removed what it is located at the beginning of
1530the headline/diary entry."
1531 :group 'org-agenda-prefix
1532 :type '(choice
1533 (const :tag "Always" t)
1534 (const :tag "Never" nil)
1535 (const :tag "When at beginning of entry" beg)))
1536
1537(defcustom org-agenda-remove-tags-when-in-prefix nil
1538 "Non-nil means, remove the tags from the headline copy in the agenda.
1539When this is the symbol `prefix', only remove tags when
1540`org-agenda-prefix-format' contains a `%T' specifier."
1541 :group 'org-agenda-prefix
1542 :type '(choice
1543 (const :tag "Always" t)
1544 (const :tag "Never" nil)
1545 (const :tag "When prefix format contains %T" prefix)))
1400 1546
1401(defgroup org-export nil 1547(defgroup org-export nil
1402 "Options for exporting org-listings." 1548 "Options for exporting org-listings."
1403 :tag "Org Export" 1549 :tag "Org Export"
1404 :group 'org) 1550 :group 'org)
1405 1551
1552(defgroup org-export-general nil
1553 "General options for exporting Org-mode files."
1554 :tag "Org Export General"
1555 :group 'org-export)
1556
1406(defcustom org-export-language-setup 1557(defcustom org-export-language-setup
1407 '(("en" "Author" "Date" "Table of Contents") 1558 '(("en" "Author" "Date" "Table of Contents")
1408 ("da" "Ophavsmand" "Dato" "Indhold") 1559 ("da" "Ophavsmand" "Dato" "Indhold")
@@ -1416,7 +1567,7 @@ Automatically means, when TAB or RET or C-c C-c are pressed in the line."
1416 "Terms used in export text, translated to different languages. 1567 "Terms used in export text, translated to different languages.
1417Use the variable `org-export-default-language' to set the language, 1568Use the variable `org-export-default-language' to set the language,
1418or use the +OPTION lines for a per-file setting." 1569or use the +OPTION lines for a per-file setting."
1419 :group 'org-export 1570 :group 'org-export-general
1420 :type '(repeat 1571 :type '(repeat
1421 (list 1572 (list
1422 (string :tag "HTML language tag") 1573 (string :tag "HTML language tag")
@@ -1427,53 +1578,7 @@ or use the +OPTION lines for a per-file setting."
1427(defcustom org-export-default-language "en" 1578(defcustom org-export-default-language "en"
1428 "The default language of HTML export, as a string. 1579 "The default language of HTML export, as a string.
1429This should have an association in `org-export-language-setup'." 1580This should have an association in `org-export-language-setup'."
1430 :group 'org-export 1581 :group 'org-export-general
1431 :type 'string)
1432
1433(defcustom org-export-html-style
1434"<style type=\"text/css\">
1435 html {
1436 font-family: Times, serif;
1437 font-size: 12pt;
1438 }
1439 .title { text-align: center; }
1440 .todo, .deadline { color: red; }
1441 .done { color: green; }
1442 .target { background-color: lavender; }
1443 pre {
1444 border: 1pt solid #AEBDCC;
1445 background-color: #F3F5F7;
1446 padding: 5pt;
1447 font-family: courier, monospace;
1448 }
1449 table { border-collapse: collapse; }
1450 td, th {
1451 vertical-align: top;
1452 border: 1pt solid #ADB9CC;
1453 }
1454</style>"
1455 "The default style specification for exported HTML files.
1456Since there are different ways of setting style information, this variable
1457needs to contain the full HTML structure to provide a style, including the
1458surrounding HTML tags. The style specifications should include definitions
1459for new classes todo, done, title, and deadline. For example, legal values
1460would be:
1461
1462 <style type=\"text/css\">
1463 p { font-weight: normal; color: gray; }
1464 h1 { color: black; }
1465 .title { text-align: center; }
1466 .todo, .deadline { color: red; }
1467 .done { color: green; }
1468 </style>
1469
1470or, if you want to keep the style in a file,
1471
1472 <link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\">
1473
1474As the value of this option simply gets inserted into the HTML <head> header,
1475you can \"misuse\" it to add arbitrary text to the header."
1476 :group 'org-export
1477 :type 'string) 1582 :type 'string)
1478 1583
1479(defcustom org-export-headline-levels 3 1584(defcustom org-export-headline-levels 3
@@ -1483,14 +1588,14 @@ Note that a numeric prefix argument to an exporter function overrides
1483this setting. 1588this setting.
1484 1589
1485This option can also be set with the +OPTIONS line, e.g. \"H:2\"." 1590This option can also be set with the +OPTIONS line, e.g. \"H:2\"."
1486 :group 'org-export 1591 :group 'org-export-general
1487 :type 'number) 1592 :type 'number)
1488 1593
1489(defcustom org-export-with-section-numbers t 1594(defcustom org-export-with-section-numbers t
1490 "Non-nil means, add section numbers to headlines when exporting. 1595 "Non-nil means, add section numbers to headlines when exporting.
1491 1596
1492This option can also be set with the +OPTIONS line, e.g. \"num:t\"." 1597This option can also be set with the +OPTIONS line, e.g. \"num:t\"."
1493 :group 'org-export 1598 :group 'org-export-general
1494 :type 'boolean) 1599 :type 'boolean)
1495 1600
1496(defcustom org-export-with-toc t 1601(defcustom org-export-with-toc t
@@ -1503,30 +1608,13 @@ ASCII export, and with red color in HTML output.
1503In HTML output, the TOC will be clickable. 1608In HTML output, the TOC will be clickable.
1504 1609
1505This option can also be set with the +OPTIONS line, e.g. \"toc:nil\"." 1610This option can also be set with the +OPTIONS line, e.g. \"toc:nil\"."
1506 :group 'org-export 1611 :group 'org-export-general
1507 :type 'boolean) 1612 :type 'boolean)
1508 1613
1509(defcustom org-export-plain-list-max-depth 20 1614(defcustom org-export-mark-todo-in-toc nil
1510 "Maximum depth of hand-formatted lists in HTML export. 1615 "Non-nil means, mark TOC lines that contain any open TODO items."
1511 1616 :group 'org-export-general
1512Org-mode parses hand-formatted enumeration and bullet lists and 1617 :type 'boolean)
1513transforms them to HTML open export. Different indentation of the
1514bullet or number indicates different list nesting levels. To avoid
1515confusion, only a single level is allowed by default. When this is
1516larger than 1, deeper indentation leads to deeper list nesting. For
1517example, the default value of 3 allows the following list to be
1518formatted correctly in HTML:
1519
1520 * Fruit
1521 - Apple
1522 - Banana
1523 1. from Africa
1524 2. from South America
1525 - Pineapple
1526 * Bread
1527 * Dairy products"
1528 :group 'org-export
1529 :type 'integer)
1530 1618
1531(defcustom org-export-preserve-breaks nil 1619(defcustom org-export-preserve-breaks nil
1532 "Non-nil means, preserve all line breaks when exporting. 1620 "Non-nil means, preserve all line breaks when exporting.
@@ -1534,24 +1622,57 @@ Normally, in HTML output paragraphs will be reformatted. In ASCII
1534export, line breaks will always be preserved, regardless of this variable. 1622export, line breaks will always be preserved, regardless of this variable.
1535 1623
1536This option can also be set with the +OPTIONS line, e.g. \"\\n:t\"." 1624This option can also be set with the +OPTIONS line, e.g. \"\\n:t\"."
1537 :group 'org-export 1625 :group 'org-export-general
1538 :type 'boolean) 1626 :type 'boolean)
1539 1627
1540(defcustom org-export-html-inline-images t 1628(defgroup org-export-translation nil
1541 "Non-nil means, inline images into exported HTML pages. 1629 "Options for translating special ascii sequences for the export backends."
1542The link will still be to the original location of the image file. 1630 :tag "Org Export Translation"
1543So if you are moving the page, lets say to your public HTML site, 1631 :group 'org-export)
1544you will have to move the image and maybe change the link." 1632
1545 :group 'org-export 1633(defcustom org-export-with-emphasize t
1634 "Non-nil means, interpret *word*, /word/, and _word_ as emphasized text.
1635If the export target supports emphasizing text, the word will be
1636typeset in bold, italic, or underlined, respectively. Works only for
1637single words, but you can say: I *really* *mean* *this*.
1638Not all export backends support this.
1639
1640This option can also be set with the +OPTIONS line, e.g. \"*:nil\"."
1641 :group 'org-export-translation
1546 :type 'boolean) 1642 :type 'boolean)
1547 1643
1548(defcustom org-export-html-expand t 1644(defcustom org-export-with-sub-superscripts t
1549 "Non-nil means, for HTML export, treat @<...> as HTML tag. 1645 "Non-nil means, interpret \"_\" and \"^\" for export.
1550When nil, these tags will be exported as plain text and therefore 1646When this option is turned on, you can use TeX-like syntax for sub- and
1551not be interpreted by a browser. 1647superscripts. Several characters after \"_\" or \"^\" will be
1648considered as a single item - so grouping with {} is normally not
1649needed. For example, the following things will be parsed as single
1650sub- or superscripts.
1552 1651
1553This option can also be set with the +OPTIONS line, e.g. \"@:nil\"." 1652 10^24 or 10^tau several digits will be considered 1 item.
1554 :group 'org-export 1653 10^-12 or 10^-tau a leading sign with digits or a word
1654 x^2-y^3 will be read as x^2 - y^3, because items are
1655 terminated by almost any nonword/nondigit char.
1656 x_{i^2} or x^(2-i) braces or parenthesis do grouping.
1657
1658Still, ambiguity is possible - so when in doubt use {} to enclose the
1659sub/superscript.
1660Not all export backends support this, but HTML does.
1661
1662This option can also be set with the +OPTIONS line, e.g. \"^:nil\"."
1663 :group 'org-export-translation
1664 :type 'boolean)
1665
1666(defcustom org-export-with-TeX-macros t
1667 "Non-nil means, interpret simple TeX-like macros when exporting.
1668For example, HTML export converts \\alpha to &alpha; and \\AA to &Aring;.
1669No only real TeX macros will work here, but the standard HTML entities
1670for math can be used as macro names as well. For a list of supported
1671names in HTML export, see the constant `org-html-entities'.
1672Not all export backends support this.
1673
1674This option can also be set with the +OPTIONS line, e.g. \"TeX:nil\"."
1675 :group 'org-export-translation
1555 :type 'boolean) 1676 :type 'boolean)
1556 1677
1557(defcustom org-export-with-fixed-width t 1678(defcustom org-export-with-fixed-width t
@@ -1561,13 +1682,24 @@ example:
1561 : ;; Some Lisp examples 1682 : ;; Some Lisp examples
1562 : (while (defc cnt) 1683 : (while (defc cnt)
1563 : (ding)) 1684 : (ding))
1564will be looking just like this in also HTML. In ASCII export, this option 1685will be looking just like this in also HTML. See also the QUOTE keyword.
1565has no effect. 1686Not all export backends support this.
1566 1687
1567This option can also be set with the +OPTIONS line, e.g. \"::nil\"." 1688This option can also be set with the +OPTIONS line, e.g. \"::nil\"."
1568 :group 'org-export 1689 :group 'org-export-translation
1569 :type 'boolean) 1690 :type 'boolean)
1570 1691
1692(defcustom org-match-sexp-depth 3
1693 "Number of stacked braces for sub/superscript matching.
1694This has to be set before loading org.el to be effective."
1695 :group 'org-export-translation
1696 :type 'integer)
1697
1698(defgroup org-export-tables nil
1699 "Options for exporting tables in Org-mode."
1700 :tag "Org Export Tables"
1701 :group 'org-export)
1702
1571(defcustom org-export-with-tables t 1703(defcustom org-export-with-tables t
1572 "If non-nil, lines starting with \"|\" define a table. 1704 "If non-nil, lines starting with \"|\" define a table.
1573For example: 1705For example:
@@ -1576,10 +1708,19 @@ For example:
1576 |-------------+----------+-----------| 1708 |-------------+----------+-----------|
1577 | Arthur Dent | England | 29.2.2100 | 1709 | Arthur Dent | England | 29.2.2100 |
1578 1710
1579In ASCII export, this option has no effect. 1711Not all export backends support this.
1580 1712
1581This option can also be set with the +OPTIONS line, e.g. \"|:nil\"." 1713This option can also be set with the +OPTIONS line, e.g. \"|:nil\"."
1582 :group 'org-export 1714 :group 'org-export-tables
1715 :type 'boolean)
1716
1717(defcustom org-export-highlight-first-table-line t
1718 "Non-nil means, highlight the first table line.
1719In HTML export, this means use <th> instead of <td>.
1720In tables created with table.el, this applies to the first table line.
1721In Org-mode tables, all lines before the first horizontal separator
1722line will be formatted with <th> tags."
1723 :group 'org-export-tables
1583 :type 'boolean) 1724 :type 'boolean)
1584 1725
1585(defcustom org-export-table-remove-special-lines t 1726(defcustom org-export-table-remove-special-lines t
@@ -1588,7 +1729,7 @@ This removes the special marking character column from tables that are set
1588up for spreadsheet calculations. It also removes the entire lines 1729up for spreadsheet calculations. It also removes the entire lines
1589marked with `!', `_', or `^'. The lines with `$' are kept, because 1730marked with `!', `_', or `^'. The lines with `$' are kept, because
1590the values of constants may be useful to have." 1731the values of constants may be useful to have."
1591 :group 'org-export 1732 :group 'org-export-tables
1592 :type 'boolean) 1733 :type 'boolean)
1593 1734
1594(defcustom org-export-prefer-native-exporter-for-tables nil 1735(defcustom org-export-prefer-native-exporter-for-tables nil
@@ -1599,112 +1740,151 @@ the table does not use row- or column-spanning). This has the
1599advantage, that the automatic HTML conversions for math symbols and 1740advantage, that the automatic HTML conversions for math symbols and
1600sub/superscripts can be applied. Org-mode's HTML generator is also 1741sub/superscripts can be applied. Org-mode's HTML generator is also
1601much faster." 1742much faster."
1602 :group 'org-export 1743 :group 'org-export-tables
1603 :type 'boolean) 1744 :type 'boolean)
1604 1745
1605(defcustom org-export-html-table-tag 1746(defgroup org-export-ascii nil
1606 "<table border=1 cellspacing=0 cellpadding=6>" 1747 "Options specific for ASCII export of Org-mode files."
1607 "The HTML tag used to start a table. 1748 :tag "Org Export ASCII"
1608This must be a <table> tag, but you may change the options like 1749 :group 'org-export)
1609borders and spacing."
1610 :group 'org-export
1611 :type 'string)
1612
1613(defcustom org-export-with-emphasize t
1614 "Non-nil means, interpret *word*, /word/, and _word_ as emphasized text.
1615If the export target supports emphasizing text, the word will be
1616typeset in bold, italic, or underlined, respectively. Works only for
1617single words, but you can say: I *really* *mean* *this*.
1618In ASCII export, this option has no effect.
1619 1750
1620This option can also be set with the +OPTIONS line, e.g. \"*:nil\"." 1751(defcustom org-export-ascii-show-new-buffer t
1621 :group 'org-export 1752 "Non-nil means, popup buffer containing the exported ASCII text.
1753Otherwise the buffer will just be saved to a file and stay hidden."
1754 :group 'org-export-ascii
1622 :type 'boolean) 1755 :type 'boolean)
1623 1756
1624(defcustom org-match-sexp-depth 3 1757(defgroup org-export-xml nil
1625 "Number of stacked braces for sub/superscript matching. 1758 "Options specific for XML export of Org-mode files."
1626This has to be set before loading org.el to be effective." 1759 :tag "Org Export XML"
1627 :group 'org-export 1760 :group 'org-export)
1628 :type 'integer)
1629 1761
1630;; FIXME: Should () parens be removed as well in sub/superscripts? 1762(defcustom org-export-xml-type 'xoxo ;kw, if we have only one.
1631(defcustom org-export-with-sub-superscripts t 1763 "The kind of XML to be produced by the XML exporter.
1632 "Non-nil means, interpret \"_\" and \"^\" for export. 1764Allowed values are:
1633When this option is turned on, you can use TeX-like syntax for sub- and 1765xoxo The XOXO exporter."
1634superscripts. Several characters after \"_\" or \"^\" will be 1766 :group 'org-export-xml
1635considered as a single item - so grouping with {} is normally not 1767 :type '(choice
1636needed. For example, the following things will be parsed as single 1768 (const :tag "XOXO" xoxo)))
1637sub- or superscripts.
1638 1769
1639 10^24 or 10^tau several digits will be considered 1 item. 1770(defgroup org-export-html nil
1640 10^-12 or 10^-tau a leading sign with digits or a word 1771 "Options specific for HTML export of Org-mode files."
1641 x^2-y^3 will be read as x^2 - y^3, because items are 1772 :tag "Org Export HTML"
1642 terminated by almost any nonword/nondigit char. 1773 :group 'org-export)
1643 x_{i^2} or x^(2-i) braces or parenthesis do grouping.
1644 1774
1645Still, ambiguity is possible - so when in doubt use {} to enclose the 1775(defcustom org-export-html-style
1646sub/superscript. 1776"<style type=\"text/css\">
1647In ASCII export, this option has no effect. 1777 html {
1778 font-family: Times, serif;
1779 font-size: 12pt;
1780 }
1781 .title { text-align: center; }
1782 .todo, .deadline { color: red; }
1783 .done { color: green; }
1784 .target { background-color: lavender; }
1785 pre {
1786 border: 1pt solid #AEBDCC;
1787 background-color: #F3F5F7;
1788 padding: 5pt;
1789 font-family: courier, monospace;
1790 }
1791 table { border-collapse: collapse; }
1792 td, th {
1793 vertical-align: top;
1794 border: 1pt solid #ADB9CC;
1795 }
1796</style>"
1797 "The default style specification for exported HTML files.
1798Since there are different ways of setting style information, this variable
1799needs to contain the full HTML structure to provide a style, including the
1800surrounding HTML tags. The style specifications should include definitions
1801for new classes todo, done, title, and deadline. For example, legal values
1802would be:
1648 1803
1649This option can also be set with the +OPTIONS line, e.g. \"^:nil\"." 1804 <style type=\"text/css\">
1650 :group 'org-export 1805 p { font-weight: normal; color: gray; }
1806 h1 { color: black; }
1807 .title { text-align: center; }
1808 .todo, .deadline { color: red; }
1809 .done { color: green; }
1810 </style>
1811
1812or, if you want to keep the style in a file,
1813
1814 <link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\">
1815
1816As the value of this option simply gets inserted into the HTML <head> header,
1817you can \"misuse\" it to add arbitrary text to the header."
1818 :group 'org-export-html
1819 :type 'string)
1820
1821(defcustom org-export-html-inline-images t
1822 "Non-nil means, inline images into exported HTML pages.
1823The link will still be to the original location of the image file.
1824So if you are moving the page, lets say to your public HTML site,
1825you will have to move the image and maybe change the link."
1826 :group 'org-export-html
1651 :type 'boolean) 1827 :type 'boolean)
1652 1828
1653(defcustom org-export-with-TeX-macros t 1829(defcustom org-export-html-expand t
1654 "Non-nil means, interpret simple TeX-like macros when exporting. 1830 "Non-nil means, for HTML export, treat @<...> as HTML tag.
1655For example, HTML export converts \\alpha to &alpha; and \\AA to &Aring;. 1831When nil, these tags will be exported as plain text and therefore
1656No only real TeX macros will work here, but the standard HTML entities 1832not be interpreted by a browser.
1657for math can be used as macro names as well. For a list of supported
1658names in HTML export, see the constant `org-html-entities'.
1659In ASCII export, this option has no effect.
1660 1833
1661This option can also be set with the +OPTIONS line, e.g. \"TeX:nil\"." 1834This option can also be set with the +OPTIONS line, e.g. \"@:nil\"."
1662 :group 'org-export 1835 :group 'org-export-html
1663 :type 'boolean) 1836 :type 'boolean)
1664 1837
1838(defcustom org-export-html-table-tag
1839 "<table border=1 cellspacing=0 cellpadding=6>"
1840 "The HTML tag used to start a table.
1841This must be a <table> tag, but you may change the options like
1842borders and spacing."
1843 :group 'org-export-html
1844 :type 'string)
1845
1665(defcustom org-export-html-with-timestamp nil 1846(defcustom org-export-html-with-timestamp nil
1666 "If non-nil, write `org-export-html-html-helper-timestamp' 1847 "If non-nil, write `org-export-html-html-helper-timestamp'
1667into the exported HTML text. Otherwise, the buffer will just be saved 1848into the exported HTML text. Otherwise, the buffer will just be saved
1668to a file." 1849to a file."
1669 :group 'org-export 1850 :group 'org-export-html
1670 :type 'boolean) 1851 :type 'boolean)
1671 1852
1672(defcustom org-export-html-html-helper-timestamp 1853(defcustom org-export-html-html-helper-timestamp
1673 "<br><br><hr><p><!-- hhmts start --> <!-- hhmts end -->\n" 1854 "<br><br><hr><p><!-- hhmts start --> <!-- hhmts end -->\n"
1674 "The HTML tag used as timestamp delimiter for HTML-helper-mode." 1855 "The HTML tag used as timestamp delimiter for HTML-helper-mode."
1675 :group 'org-export 1856 :group 'org-export-html
1676 :type 'string) 1857 :type 'string)
1677 1858
1678(defcustom org-export-ascii-show-new-buffer t
1679 "Non-nil means, popup buffer containing the exported ASCII text.
1680Otherwise the buffer will just be saved to a file and stay hidden."
1681 :group 'org-export
1682 :type 'boolean)
1683
1684(defcustom org-export-html-show-new-buffer nil 1859(defcustom org-export-html-show-new-buffer nil
1685 "Non-nil means, popup buffer containing the exported html text. 1860 "Non-nil means, popup buffer containing the exported html text.
1686Otherwise, the buffer will just be saved to a file and stay hidden." 1861Otherwise, the buffer will just be saved to a file and stay hidden."
1687 :group 'org-export 1862 :group 'org-export-html
1688 :type 'boolean) 1863 :type 'boolean)
1689 1864
1865(defgroup org-export-icalendar nil
1866 "Options specific for iCalendar export of Org-mode files."
1867 :tag "Org Export iCalendar"
1868 :group 'org-export)
1869
1690(defcustom org-combined-agenda-icalendar-file "~/org.ics" 1870(defcustom org-combined-agenda-icalendar-file "~/org.ics"
1691 "The file name for the iCalendar file covering all agenda files. 1871 "The file name for the iCalendar file covering all agenda files.
1692This file is created with the command \\[org-export-icalendar-all-agenda-files]." 1872This file is created with the command \\[org-export-icalendar-all-agenda-files]."
1693 :group 'org-export 1873 :group 'org-export-icalendar
1694 :type 'file) 1874 :type 'file)
1695 1875
1696(defcustom org-icalendar-include-todo nil 1876(defcustom org-icalendar-include-todo nil
1697 "Non-nil means, export to iCalendar files should also cover TODO items." 1877 "Non-nil means, export to iCalendar files should also cover TODO items."
1698 :group 'org-export 1878 :group 'org-export-icalendar
1699 :type 'boolean) 1879 :type 'boolean)
1700 1880
1701(defcustom org-icalendar-combined-name "OrgMode" 1881(defcustom org-icalendar-combined-name "OrgMode"
1702 "Calendar name for the combined iCalendar representing all agenda files." 1882 "Calendar name for the combined iCalendar representing all agenda files."
1703 :group 'org-export 1883 :group 'org-export-icalendar
1704 :type 'string) 1884 :type 'string)
1705 1885
1706(defgroup org-font-lock nil 1886(defgroup org-font-lock nil
1707 "Faces and settings for highlighting in Org-mode." 1887 "Font-lock settings for highlighting in Org-mode."
1708 :tag "Org Font Lock" 1888 :tag "Org Font Lock"
1709 :group 'org) 1889 :group 'org)
1710 1890
@@ -1741,16 +1921,19 @@ Changing this variable requires a restart of Emacs to take effect."
1741 :group 'org-font-lock 1921 :group 'org-font-lock
1742 :type 'boolean) 1922 :type 'boolean)
1743 1923
1924(defgroup org-faces nil
1925 "Faces in Org-mode."
1926 :tag "Org Faces"
1927 :group 'org-font-lock)
1928
1744(defface org-hide 1929(defface org-hide
1745 '( 1930 '(
1746 (((type tty) (class color)) (:foreground "white")) 1931 (((type tty) (class color)) (:foreground "white"))
1747 (((class color) (background light)) (:foreground "white")) 1932 (((class color) (background light)) (:foreground "white"))
1748 (((class color) (background dark)) (:foreground "black")) 1933 (((class color) (background dark)) (:foreground "black"))
1749; (((class color) (background light)) (:foreground "grey90"))
1750; (((class color) (background dark)) (:foreground "grey10"))
1751 (t (:inverse-video nil))) 1934 (t (:inverse-video nil)))
1752 "Face used for level 1 headlines." 1935 "Face used for level 1 headlines."
1753 :group 'org-font-lock) 1936 :group 'org-faces)
1754 1937
1755(defface org-level-1 ;; font-lock-function-name-face 1938(defface org-level-1 ;; font-lock-function-name-face
1756 '((((type tty) (class color)) (:foreground "blue" :weight bold)) 1939 '((((type tty) (class color)) (:foreground "blue" :weight bold))
@@ -1758,7 +1941,7 @@ Changing this variable requires a restart of Emacs to take effect."
1758 (((class color) (background dark)) (:foreground "LightSkyBlue")) 1941 (((class color) (background dark)) (:foreground "LightSkyBlue"))
1759 (t (:inverse-video t :bold t))) 1942 (t (:inverse-video t :bold t)))
1760 "Face used for level 1 headlines." 1943 "Face used for level 1 headlines."
1761 :group 'org-font-lock) 1944 :group 'org-faces)
1762 1945
1763(defface org-level-2 ;; font-lock-variable-name-face 1946(defface org-level-2 ;; font-lock-variable-name-face
1764 '((((type tty) (class color)) (:foreground "yellow" :weight light)) 1947 '((((type tty) (class color)) (:foreground "yellow" :weight light))
@@ -1766,7 +1949,7 @@ Changing this variable requires a restart of Emacs to take effect."
1766 (((class color) (background dark)) (:foreground "LightGoldenrod")) 1949 (((class color) (background dark)) (:foreground "LightGoldenrod"))
1767 (t (:bold t :italic t))) 1950 (t (:bold t :italic t)))
1768 "Face used for level 2 headlines." 1951 "Face used for level 2 headlines."
1769 :group 'org-font-lock) 1952 :group 'org-faces)
1770 1953
1771(defface org-level-3 ;; font-lock-keyword-face 1954(defface org-level-3 ;; font-lock-keyword-face
1772 '((((type tty) (class color)) (:foreground "cyan" :weight bold)) 1955 '((((type tty) (class color)) (:foreground "cyan" :weight bold))
@@ -1774,7 +1957,7 @@ Changing this variable requires a restart of Emacs to take effect."
1774 (((class color) (background dark)) (:foreground "Cyan")) 1957 (((class color) (background dark)) (:foreground "Cyan"))
1775 (t (:bold t))) 1958 (t (:bold t)))
1776 "Face used for level 3 headlines." 1959 "Face used for level 3 headlines."
1777 :group 'org-font-lock) 1960 :group 'org-faces)
1778 1961
1779(defface org-level-4 ;; font-lock-comment-face 1962(defface org-level-4 ;; font-lock-comment-face
1780 '((((type tty pc) (class color) (background light)) (:foreground "red")) 1963 '((((type tty pc) (class color) (background light)) (:foreground "red"))
@@ -1783,7 +1966,7 @@ Changing this variable requires a restart of Emacs to take effect."
1783 (((class color) (background dark)) (:foreground "chocolate1")) 1966 (((class color) (background dark)) (:foreground "chocolate1"))
1784 (t (:bold t :italic t))) 1967 (t (:bold t :italic t)))
1785 "Face used for level 4 headlines." 1968 "Face used for level 4 headlines."
1786 :group 'org-font-lock) 1969 :group 'org-faces)
1787 1970
1788(defface org-level-5 ;; font-lock-type-face 1971(defface org-level-5 ;; font-lock-type-face
1789 '((((type tty) (class color)) (:foreground "green")) 1972 '((((type tty) (class color)) (:foreground "green"))
@@ -1791,7 +1974,7 @@ Changing this variable requires a restart of Emacs to take effect."
1791 (((class color) (background dark)) (:foreground "PaleGreen")) 1974 (((class color) (background dark)) (:foreground "PaleGreen"))
1792 (t (:bold t :underline t))) 1975 (t (:bold t :underline t)))
1793 "Face used for level 5 headlines." 1976 "Face used for level 5 headlines."
1794 :group 'org-font-lock) 1977 :group 'org-faces)
1795 1978
1796(defface org-level-6 ;; font-lock-constant-face 1979(defface org-level-6 ;; font-lock-constant-face
1797 '((((type tty) (class color)) (:foreground "magenta")) 1980 '((((type tty) (class color)) (:foreground "magenta"))
@@ -1799,7 +1982,7 @@ Changing this variable requires a restart of Emacs to take effect."
1799 (((class color) (background dark)) (:foreground "Aquamarine")) 1982 (((class color) (background dark)) (:foreground "Aquamarine"))
1800 (t (:bold t :underline t))) 1983 (t (:bold t :underline t)))
1801 "Face used for level 6 headlines." 1984 "Face used for level 6 headlines."
1802 :group 'org-font-lock) 1985 :group 'org-faces)
1803 1986
1804(defface org-level-7 ;; font-lock-builtin-face 1987(defface org-level-7 ;; font-lock-builtin-face
1805 '((((type tty) (class color)) (:foreground "blue" :weight light)) 1988 '((((type tty) (class color)) (:foreground "blue" :weight light))
@@ -1807,7 +1990,7 @@ Changing this variable requires a restart of Emacs to take effect."
1807 (((class color) (background dark)) (:foreground "LightSteelBlue")) 1990 (((class color) (background dark)) (:foreground "LightSteelBlue"))
1808 (t (:bold t))) 1991 (t (:bold t)))
1809 "Face used for level 7 headlines." 1992 "Face used for level 7 headlines."
1810 :group 'org-font-lock) 1993 :group 'org-faces)
1811 1994
1812(defface org-level-8 ;; font-lock-string-face 1995(defface org-level-8 ;; font-lock-string-face
1813 '((((type tty) (class color)) (:foreground "green")) 1996 '((((type tty) (class color)) (:foreground "green"))
@@ -1815,7 +1998,7 @@ Changing this variable requires a restart of Emacs to take effect."
1815 (((class color) (background dark)) (:foreground "LightSalmon")) 1998 (((class color) (background dark)) (:foreground "LightSalmon"))
1816 (t (:italic t))) 1999 (t (:italic t)))
1817 "Face used for level 8 headlines." 2000 "Face used for level 8 headlines."
1818 :group 'org-font-lock) 2001 :group 'org-faces)
1819 2002
1820(defface org-special-keyword ;; font-lock-string-face 2003(defface org-special-keyword ;; font-lock-string-face
1821 '((((type tty) (class color)) (:foreground "green")) 2004 '((((type tty) (class color)) (:foreground "green"))
@@ -1823,7 +2006,7 @@ Changing this variable requires a restart of Emacs to take effect."
1823 (((class color) (background dark)) (:foreground "LightSalmon")) 2006 (((class color) (background dark)) (:foreground "LightSalmon"))
1824 (t (:italic t))) 2007 (t (:italic t)))
1825 "Face used for special keywords." 2008 "Face used for special keywords."
1826 :group 'org-font-lock) 2009 :group 'org-faces)
1827 2010
1828(defface org-warning ;; font-lock-warning-face 2011(defface org-warning ;; font-lock-warning-face
1829 '((((type tty) (class color)) (:foreground "red")) 2012 '((((type tty) (class color)) (:foreground "red"))
@@ -1832,7 +2015,7 @@ Changing this variable requires a restart of Emacs to take effect."
1832; (((class color) (background dark)) (:foreground "Pink" :bold t)) 2015; (((class color) (background dark)) (:foreground "Pink" :bold t))
1833 (t (:inverse-video t :bold t))) 2016 (t (:inverse-video t :bold t)))
1834 "Face for deadlines and TODO keywords." 2017 "Face for deadlines and TODO keywords."
1835 :group 'org-font-lock) 2018 :group 'org-faces)
1836 2019
1837(defface org-headline-done ;; font-lock-string-face 2020(defface org-headline-done ;; font-lock-string-face
1838 '((((type tty) (class color)) (:foreground "green")) 2021 '((((type tty) (class color)) (:foreground "green"))
@@ -1841,9 +2024,9 @@ Changing this variable requires a restart of Emacs to take effect."
1841 (t (:italic t))) 2024 (t (:italic t)))
1842 "Face used to indicate that a headline is DONE. See also the variable 2025 "Face used to indicate that a headline is DONE. See also the variable
1843`org-fontify-done-headline'." 2026`org-fontify-done-headline'."
1844 :group 'org-font-lock) 2027 :group 'org-faces)
1845 2028
1846;; Inheritance does not yet work for xemacs. So we just copy... 2029;; Inheritance does not work for xemacs. So we just copy...
1847 2030
1848(defface org-deadline-announce 2031(defface org-deadline-announce
1849 '((((type tty) (class color)) (:foreground "blue" :weight bold)) 2032 '((((type tty) (class color)) (:foreground "blue" :weight bold))
@@ -1851,7 +2034,7 @@ Changing this variable requires a restart of Emacs to take effect."
1851 (((class color) (background dark)) (:foreground "LightSkyBlue")) 2034 (((class color) (background dark)) (:foreground "LightSkyBlue"))
1852 (t (:inverse-video t :bold t))) 2035 (t (:inverse-video t :bold t)))
1853 "Face for upcoming deadlines." 2036 "Face for upcoming deadlines."
1854 :group 'org-font-lock) 2037 :group 'org-faces)
1855 2038
1856(defface org-scheduled-today 2039(defface org-scheduled-today
1857 '((((type tty) (class color)) (:foreground "green")) 2040 '((((type tty) (class color)) (:foreground "green"))
@@ -1859,7 +2042,7 @@ Changing this variable requires a restart of Emacs to take effect."
1859 (((class color) (background dark)) (:foreground "PaleGreen")) 2042 (((class color) (background dark)) (:foreground "PaleGreen"))
1860 (t (:bold t :underline t))) 2043 (t (:bold t :underline t)))
1861 "Face for items scheduled for a certain day." 2044 "Face for items scheduled for a certain day."
1862 :group 'org-font-lock) 2045 :group 'org-faces)
1863 2046
1864(defface org-scheduled-previously 2047(defface org-scheduled-previously
1865 '((((type tty pc) (class color) (background light)) (:foreground "red")) 2048 '((((type tty pc) (class color) (background light)) (:foreground "red"))
@@ -1868,7 +2051,7 @@ Changing this variable requires a restart of Emacs to take effect."
1868 (((class color) (background dark)) (:foreground "chocolate1")) 2051 (((class color) (background dark)) (:foreground "chocolate1"))
1869 (t (:bold t :italic t))) 2052 (t (:bold t :italic t)))
1870 "Face for items scheduled previously, and not yet done." 2053 "Face for items scheduled previously, and not yet done."
1871 :group 'org-font-lock) 2054 :group 'org-faces)
1872 2055
1873(defface org-formula 2056(defface org-formula
1874 '((((type tty pc) (class color) (background light)) (:foreground "red")) 2057 '((((type tty pc) (class color) (background light)) (:foreground "red"))
@@ -1877,23 +2060,23 @@ Changing this variable requires a restart of Emacs to take effect."
1877 (((class color) (background dark)) (:foreground "chocolate1")) 2060 (((class color) (background dark)) (:foreground "chocolate1"))
1878 (t (:bold t :italic t))) 2061 (t (:bold t :italic t)))
1879 "Face for formulas." 2062 "Face for formulas."
1880 :group 'org-font-lock) 2063 :group 'org-faces)
1881 2064
1882(defface org-link 2065(defface org-link
1883 '((((type tty) (class color)) (:foreground "cyan" :weight bold)) 2066 '((((type tty) (class color)) (:foreground "cyan" :weight bold))
1884 (((class color) (background light)) (:foreground "Purple")) 2067 (((class color) (background light)) (:foreground "Purple" :underline t))
1885 (((class color) (background dark)) (:foreground "Cyan")) 2068 (((class color) (background dark)) (:foreground "Cyan" :underline t))
1886 (t (:bold t))) 2069 (t (:bold t)))
1887 "Face for links." 2070 "Face for links."
1888 :group 'org-font-lock) 2071 :group 'org-faces)
1889 2072
1890(defface org-tag 2073(defface org-tag
1891 '((((type tty) (class color)) (:foreground "cyan" :weight bold)) 2074 '((((type tty) (class color)) (:weight bold))
1892 (((class color) (background light)) (:foreground "Purple" :weight bold)) 2075 (((class color) (background light)) (:weight bold))
1893 (((class color) (background dark)) (:foreground "Cyan" :weight bold)) 2076 (((class color) (background dark)) (:weight bold))
1894 (t (:bold t))) 2077 (t (:bold t)))
1895 "Face for tags." 2078 "Face for tags."
1896 :group 'org-font-lock) 2079 :group 'org-faces)
1897 2080
1898(defface org-done ;; font-lock-type-face 2081(defface org-done ;; font-lock-type-face
1899 '((((type tty) (class color)) (:foreground "green")) 2082 '((((type tty) (class color)) (:foreground "green"))
@@ -1901,7 +2084,7 @@ Changing this variable requires a restart of Emacs to take effect."
1901 (((class color) (background dark)) (:foreground "PaleGreen" :bold t)) 2084 (((class color) (background dark)) (:foreground "PaleGreen" :bold t))
1902 (t (:bold t :underline t))) 2085 (t (:bold t :underline t)))
1903 "Face used for DONE." 2086 "Face used for DONE."
1904 :group 'org-font-lock) 2087 :group 'org-faces)
1905 2088
1906(defface org-table ;; font-lock-function-name-face 2089(defface org-table ;; font-lock-function-name-face
1907 '((((type tty) (class color)) (:foreground "blue" :weight bold)) 2090 '((((type tty) (class color)) (:foreground "blue" :weight bold))
@@ -1909,7 +2092,7 @@ Changing this variable requires a restart of Emacs to take effect."
1909 (((class color) (background dark)) (:foreground "LightSkyBlue")) 2092 (((class color) (background dark)) (:foreground "LightSkyBlue"))
1910 (t (:inverse-video t :bold t))) 2093 (t (:inverse-video t :bold t)))
1911 "Face used for tables." 2094 "Face used for tables."
1912 :group 'org-font-lock) 2095 :group 'org-faces)
1913 2096
1914(defface org-time-grid ;; font-lock-variable-name-face 2097(defface org-time-grid ;; font-lock-variable-name-face
1915 '((((type tty) (class color)) (:foreground "yellow" :weight light)) 2098 '((((type tty) (class color)) (:foreground "yellow" :weight light))
@@ -1917,7 +2100,7 @@ Changing this variable requires a restart of Emacs to take effect."
1917 (((class color) (background dark)) (:foreground "LightGoldenrod")) 2100 (((class color) (background dark)) (:foreground "LightGoldenrod"))
1918 (t (:bold t :italic t))) 2101 (t (:bold t :italic t)))
1919 "Face used for time grids." 2102 "Face used for time grids."
1920 :group 'org-font-lock) 2103 :group 'org-faces)
1921 2104
1922(defvar org-level-faces 2105(defvar org-level-faces
1923 '(org-level-1 org-level-2 org-level-3 org-level-4 2106 '(org-level-1 org-level-2 org-level-3 org-level-4
@@ -1925,6 +2108,51 @@ Changing this variable requires a restart of Emacs to take effect."
1925 )) 2108 ))
1926(defvar org-n-levels (length org-level-faces)) 2109(defvar org-n-levels (length org-level-faces))
1927 2110
2111
2112;; Variables for pre-computed regular expressions, all buffer local
2113(defvar org-done-string nil
2114 "The last string in `org-todo-keywords', indicating an item is DONE.")
2115(make-variable-buffer-local 'org-done-string)
2116(defvar org-todo-regexp nil
2117 "Matches any of the TODO state keywords.")
2118(make-variable-buffer-local 'org-todo-regexp)
2119(defvar org-not-done-regexp nil
2120 "Matches any of the TODO state keywords except the last one.")
2121(make-variable-buffer-local 'org-not-done-regexp)
2122(defvar org-todo-line-regexp nil
2123 "Matches a headline and puts TODO state into group 2 if present.")
2124(make-variable-buffer-local 'org-todo-line-regexp)
2125(defvar org-nl-done-regexp nil
2126 "Matches newline followed by a headline with the DONE keyword.")
2127(make-variable-buffer-local 'org-nl-done-regexp)
2128(defvar org-looking-at-done-regexp nil
2129 "Matches the DONE keyword a point.")
2130(make-variable-buffer-local 'org-looking-at-done-regexp)
2131(defvar org-todo-kwd-priority-p nil
2132 "Do TODO items have priorities?")
2133(make-variable-buffer-local 'org-todo-kwd-priority-p)
2134(defvar org-todo-kwd-max-priority nil
2135 "Maximum priority of TODO items.")
2136(make-variable-buffer-local 'org-todo-kwd-max-priority)
2137(defvar org-ds-keyword-length 12
2138 "Maximum length of the Deadline and SCHEDULED keywords.")
2139(make-variable-buffer-local 'org-ds-keyword-length)
2140(defvar org-deadline-regexp nil
2141 "Matches the DEADLINE keyword.")
2142(make-variable-buffer-local 'org-deadline-regexp)
2143(defvar org-deadline-time-regexp nil
2144 "Matches the DEADLINE keyword together with a time stamp.")
2145(make-variable-buffer-local 'org-deadline-time-regexp)
2146(defvar org-deadline-line-regexp nil
2147 "Matches the DEADLINE keyword and the rest of the line.")
2148(make-variable-buffer-local 'org-deadline-line-regexp)
2149(defvar org-scheduled-regexp nil
2150 "Matches the SCHEDULED keyword.")
2151(make-variable-buffer-local 'org-scheduled-regexp)
2152(defvar org-scheduled-time-regexp nil
2153 "Matches the SCHEDULED keyword together with a time stamp.")
2154(make-variable-buffer-local 'org-scheduled-time-regexp)
2155
1928(defun org-set-regexps-and-options () 2156(defun org-set-regexps-and-options ()
1929 "Precompute regular expressions for current buffer." 2157 "Precompute regular expressions for current buffer."
1930 (when (eq major-mode 'org-mode) 2158 (when (eq major-mode 'org-mode)
@@ -1956,12 +2184,16 @@ Changing this variable requires a restart of Emacs to take effect."
1956 ((equal key "STARTUP") 2184 ((equal key "STARTUP")
1957 (let ((opts (org-split-string value splitre)) 2185 (let ((opts (org-split-string value splitre))
1958 (set '(("fold" org-startup-folded t) 2186 (set '(("fold" org-startup-folded t)
2187 ("overview" org-startup-folded t)
1959 ("nofold" org-startup-folded nil) 2188 ("nofold" org-startup-folded nil)
2189 ("showall" org-startup-folded nil)
1960 ("content" org-startup-folded content) 2190 ("content" org-startup-folded content)
1961 ("hidestars" org-hide-leading-stars t) 2191 ("hidestars" org-hide-leading-stars t)
1962 ("showstars" org-hide-leading-stars nil) 2192 ("showstars" org-hide-leading-stars nil)
1963 ("odd" org-odd-levels-only t) 2193 ("odd" org-odd-levels-only t)
1964 ("oddeven" org-odd-levels-only nil) 2194 ("oddeven" org-odd-levels-only nil)
2195 ("align" org-startup-align-all-tables t)
2196 ("noalign" org-startup-align-all-tables nil)
1965 ("dlcheck" org-startup-with-deadline-check t) 2197 ("dlcheck" org-startup-with-deadline-check t)
1966 ("nodlcheck" org-startup-with-deadline-check nil))) 2198 ("nodlcheck" org-startup-with-deadline-check nil)))
1967 l var val) 2199 l var val)
@@ -2014,57 +2246,57 @@ Changing this variable requires a restart of Emacs to take effect."
2014 2246
2015;; Tell the compiler about dynamically scoped variables, 2247;; Tell the compiler about dynamically scoped variables,
2016;; and variables from other packages 2248;; and variables from other packages
2017(defvar zmacs-regions) 2249(defvar zmacs-regions) ; XEmacs regions
2018(defvar original-date) 2250(defvar original-date) ; dynamically scoped in calendar
2019(defvar org-transient-mark-mode) 2251(defvar org-old-auto-fill-inhibit-regexp) ; local variable used by `orgtbl-mode'
2020(defvar org-old-auto-fill-inhibit-regexp) 2252(defvar orgtbl-mode-menu) ; defined when orgtbl mode get initialized
2021(defvar orgtbl-mode-menu) 2253(defvar org-html-entities) ; defined later in this file
2022(defvar org-html-entities) 2254(defvar org-goto-start-pos) ; dynamically scoped parameter
2023(defvar org-goto-start-pos) 2255(defvar org-time-was-given) ; dynamically scoped parameter
2024(defvar org-cursor-color) 2256(defvar org-ts-what) ; dynamically scoped parameter
2025(defvar org-time-was-given) 2257(defvar mark-active) ; Emacs only, not available in XEmacs.
2026(defvar org-ts-what) 2258(defvar timecnt) ; dynamically scoped parameter
2027(defvar mark-active) 2259(defvar levels-open) ; dynamically scoped parameter
2028(defvar timecnt) 2260(defvar title) ; dynamically scoped parameter
2029(defvar levels-open) 2261(defvar author) ; dynamically scoped parameter
2030(defvar title) 2262(defvar email) ; dynamically scoped parameter
2031(defvar author) 2263(defvar text) ; dynamically scoped parameter
2032(defvar email) 2264(defvar entry) ; dynamically scoped parameter
2033(defvar text) 2265(defvar date) ; dynamically scoped parameter
2034(defvar entry) 2266(defvar language) ; dynamically scoped parameter
2035(defvar date) 2267(defvar options) ; dynamically scoped parameter
2036(defvar language) 2268(defvar ans1) ; dynamically scoped parameter
2037(defvar options) 2269(defvar ans2) ; dynamically scoped parameter
2038(defvar ans1) 2270(defvar starting-day) ; local variable
2039(defvar ans2) 2271(defvar include-all-loc) ; local variable
2040(defvar starting-day) 2272(defvar vm-message-pointer) ; from vm
2041(defvar include-all-loc) 2273(defvar vm-folder-directory) ; from vm
2042(defvar vm-message-pointer) 2274(defvar wl-summary-buffer-elmo-folder) ; from wanderlust
2043(defvar vm-folder-directory) 2275(defvar wl-summary-buffer-folder-name) ; from wanderlust
2044(defvar wl-summary-buffer-elmo-folder) 2276(defvar gnus-group-name) ; from gnus
2045(defvar wl-summary-buffer-folder-name) 2277(defvar gnus-article-current) ; from gnus
2046(defvar gnus-group-name) 2278(defvar w3m-current-url) ; from w3m
2047(defvar gnus-article-current) 2279(defvar mh-progs) ; from MH-E
2048(defvar w3m-current-url) 2280(defvar mh-current-folder) ; from MH-E
2049(defvar mh-progs) 2281(defvar mh-show-folder-buffer) ; from MH-E
2050(defvar mh-current-folder) 2282(defvar mh-index-folder) ; from MH-E
2051(defvar mh-show-folder-buffer) 2283(defvar mh-searcher) ; from MH-E
2052(defvar mh-index-folder) 2284(defvar org-selected-point) ; dynamically scoped parameter
2053(defvar mh-searcher) 2285(defvar calendar-mode-map) ; from calendar.el
2054(defvar org-selected-point) 2286(defvar last-arg) ; local variable
2055(defvar calendar-mode-map) 2287(defvar remember-save-after-remembering) ; from remember.el
2056(defvar remember-save-after-remembering) 2288(defvar remember-data-file) ; from remember.el
2057(defvar remember-data-file) 2289(defvar annotation) ; from remember.el, dynamically scoped in `remember-mode'
2058(defvar last-arg) 2290(defvar initial) ; from remember.el, dynamically scoped in `remember-mode'
2059 2291(defvar orgtbl-mode) ; defined later in this file
2060;;; Define the mode 2292;;; Define the mode
2061 2293
2062(defvar org-mode-map (copy-keymap outline-mode-map) 2294(defvar org-mode-map (copy-keymap outline-mode-map)
2063 "Keymap for Org-mode.") 2295 "Keymap for Org-mode.")
2064 2296
2065(defvar org-struct-menu) 2297(defvar org-struct-menu) ; defined later in this file
2066(defvar org-org-menu) 2298(defvar org-org-menu) ; defined later in this file
2067(defvar org-tbl-menu) 2299(defvar org-tbl-menu) ; defined later in this file
2068 2300
2069;; We use a before-change function to check if a table might need 2301;; We use a before-change function to check if a table might need
2070;; an update. 2302;; an update.
@@ -2099,11 +2331,19 @@ The following commands are available:
2099 (easy-menu-add org-org-menu) 2331 (easy-menu-add org-org-menu)
2100 (easy-menu-add org-tbl-menu) 2332 (easy-menu-add org-tbl-menu)
2101 (org-install-agenda-files-menu) 2333 (org-install-agenda-files-menu)
2334 (if org-descriptive-links (org-add-to-invisibility-spec '(org-link)))
2335 (org-add-to-invisibility-spec '(org-cwidth))
2102 (setq outline-regexp "\\*+") 2336 (setq outline-regexp "\\*+")
2103; (setq outline-regexp "\\(?:\\*+\\|[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\) \\)") 2337 ;;(setq outline-regexp "\\(?:\\*+\\|[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\) \\)")
2104 (setq outline-level 'org-outline-level) 2338 (setq outline-level 'org-outline-level)
2105 (if org-startup-truncated (setq truncate-lines t)) 2339 (when (and org-ellipsis (stringp org-ellipsis))
2340 (unless org-display-table
2341 (setq org-display-table (make-display-table)))
2342 (set-display-table-slot org-display-table
2343 4 (string-to-vector org-ellipsis))
2344 (setq buffer-display-table org-display-table))
2106 (org-set-regexps-and-options) 2345 (org-set-regexps-and-options)
2346 (if org-startup-truncated (setq truncate-lines t))
2107 (set (make-local-variable 'font-lock-unfontify-region-function) 2347 (set (make-local-variable 'font-lock-unfontify-region-function)
2108 'org-unfontify-region) 2348 'org-unfontify-region)
2109 ;; Activate before-change-function 2349 ;; Activate before-change-function
@@ -2124,7 +2364,7 @@ The following commands are available:
2124 ;; Get rid of Outline menus, they are not needed 2364 ;; Get rid of Outline menus, they are not needed
2125 ;; Need to do this here because define-derived-mode sets up 2365 ;; Need to do this here because define-derived-mode sets up
2126 ;; the keymap so late. 2366 ;; the keymap so late.
2127 (if org-xemacs-p 2367 (if (featurep 'xemacs)
2128 (progn 2368 (progn
2129 (delete-menu-item '("Headings")) 2369 (delete-menu-item '("Headings"))
2130 (delete-menu-item '("Show")) 2370 (delete-menu-item '("Show"))
@@ -2135,6 +2375,8 @@ The following commands are available:
2135 (define-key org-mode-map [menu-bar show] 'undefined)) 2375 (define-key org-mode-map [menu-bar show] 'undefined))
2136 2376
2137 (unless org-inhibit-startup 2377 (unless org-inhibit-startup
2378 (if org-startup-align-all-tables
2379 (org-table-map-tables 'org-table-align))
2138 (if org-startup-with-deadline-check 2380 (if org-startup-with-deadline-check
2139 (call-interactively 'org-check-deadlines) 2381 (call-interactively 'org-check-deadlines)
2140 (cond 2382 (cond
@@ -2147,21 +2389,46 @@ The following commands are available:
2147(defsubst org-current-line (&optional pos) 2389(defsubst org-current-line (&optional pos)
2148 (+ (if (bolp) 1 0) (count-lines (point-min) (or pos (point))))) 2390 (+ (if (bolp) 1 0) (count-lines (point-min) (or pos (point)))))
2149 2391
2392(defconst org-rm-props '(invisible t face t keymap t intangible t mouse-face t
2393 mouse-map t)
2394 "Properties to remove when a string without properties is wanted.")
2150 2395
2151;; FIXME: Do we need to copy? 2396(defsubst org-match-string-no-properties (num &optional string)
2152(defun org-string-props (string &rest properties) 2397 (if (featurep 'xemacs)
2153 "Add PROPERTIES to string." 2398 (let ((s (match-string num string)))
2154 (add-text-properties 0 (length string) properties string) 2399 (remove-text-properties 0 (length s) org-rm-props s)
2400 s)
2401 (match-string-no-properties num string)))
2402
2403(defun org-current-time ()
2404 "Current time, possibly rounded to `org-time-stamp-rounding-minutes'."
2405 (if (> org-time-stamp-rounding-minutes 0)
2406 (let ((r org-time-stamp-rounding-minutes)
2407 (time (decode-time)))
2408 (apply 'encode-time
2409 (append (list 0 (* r (floor (+ .5 (/ (float (nth 1 time)) r)))))
2410 (nthcdr 2 time))))
2411 (current-time)))
2412
2413(defun org-add-props (string plist &rest props)
2414 "Add text properties to entire string, from beginning to end.
2415PLIST may be a list of properties, PROPS are individual properties and values
2416that will be added to PLIST. Returns the string that was modified."
2417 (add-text-properties
2418 0 (length string) (if props (append plist props) plist) string)
2155 string) 2419 string)
2420(put 'org-add-props 'lisp-indent-function 2)
2421
2156 2422
2157;;; Font-Lock stuff 2423;;; Font-Lock stuff
2158 2424
2159(defvar org-mouse-map (make-sparse-keymap)) 2425(defvar org-mouse-map (make-sparse-keymap))
2160(define-key org-mouse-map 2426(define-key org-mouse-map
2161 (if org-xemacs-p [button2] [mouse-2]) 'org-open-at-mouse) 2427 (if (featurep 'xemacs) [button2] [mouse-2]) 'org-open-at-mouse)
2162(define-key org-mouse-map 2428(define-key org-mouse-map
2163 (if org-xemacs-p [button3] [mouse-3]) 'org-find-file-at-mouse) 2429 (if (featurep 'xemacs) [button3] [mouse-3]) 'org-find-file-at-mouse)
2164(define-key org-mouse-map [follow-link] 'mouse-face) 2430(when org-mouse-1-follows-link
2431 (define-key org-mouse-map [follow-link] 'mouse-face))
2165(when org-tab-follows-link 2432(when org-tab-follows-link
2166 (define-key org-mouse-map [(tab)] 'org-open-at-point) 2433 (define-key org-mouse-map [(tab)] 'org-open-at-point)
2167 (define-key org-mouse-map "\C-i" 'org-open-at-point)) 2434 (define-key org-mouse-map "\C-i" 'org-open-at-point))
@@ -2171,26 +2438,57 @@ The following commands are available:
2171 2438
2172(require 'font-lock) 2439(require 'font-lock)
2173 2440
2174(defconst org-non-link-chars "\t\n\r|<>\000") 2441(defconst org-non-link-chars "]\t\n\r<>")
2175(defconst org-link-regexp 2442(defconst org-link-types '("https?" "ftp" "mailto" "file" "news" "bbdb" "vm"
2176 (if org-allow-space-in-links 2443 "wl" "mhe" "rmail" "gnus" "shell"))
2177 (concat 2444(defconst org-link-re-with-space
2178 "\\(https?\\|ftp\\|mailto\\|file\\|news\\|bbdb\\|vm\\|wl\\|mhe\\|rmail\\|gnus\\|shell\\):\\([^" org-non-link-chars "]+[^ " org-non-link-chars "]\\)") 2445 (concat
2179 (concat 2446 "<?\\(" (mapconcat 'identity org-link-types "\\|") "\\):"
2180 "\\(https?\\|ftp\\|mailto\\|file\\|news\\|bbdb\\|vm\\|wl\\|mhe\\|rmail\\|gnus\\|shell\\):\\([^ " org-non-link-chars "]+\\)") 2447 "\\([^" org-non-link-chars " ]"
2181 ) 2448 "[^" org-non-link-chars "]*"
2182 "Regular expression for matching links.") 2449 "[^" org-non-link-chars " ]\\)>?")
2183(defconst org-link-maybe-angles-regexp 2450 "Matches a link with spaces, optional angular brackets around it.")
2184 (concat "<?\\(" org-link-regexp "\\)>?") 2451
2185 "Matches a link and optionally surrounding angle brackets.") 2452(defconst org-link-re-with-space2
2186(defconst org-protected-link-regexp 2453 (concat
2187 (concat "\000" org-link-regexp "\000") 2454 "<?\\(" (mapconcat 'identity org-link-types "\\|") "\\):"
2188 "Matches a link and optionally surrounding angle brackets.") 2455 "\\([^" org-non-link-chars " ]"
2456 "[^]\t\n\r]*"
2457 "[^" org-non-link-chars " ]\\)>?")
2458 "Matches a link with spaces, optional angular brackets around it.")
2459
2460(defconst org-angle-link-re
2461 (concat
2462 "<\\(" (mapconcat 'identity org-link-types "\\|") "\\):"
2463 "\\([^" org-non-link-chars " ]"
2464 "[^" org-non-link-chars "]*"
2465 "\\)>")
2466 "Matches link with angular brackets, spaces are allowed.")
2467(defconst org-plain-link-re
2468 (concat
2469 "\\(" (mapconcat 'identity org-link-types "\\|") "\\):"
2470 "\\([^]\t\n\r<>,;() ]+\\)")
2471 "Matches plain link, without spaces.")
2189 2472
2190(defconst org-bracket-link-regexp 2473(defconst org-bracket-link-regexp
2191 "\\[\\[\\([^]]+\\)\\]\\(\\[\\([^]]+\\)\\]\\)?\\]" 2474 "\\[\\[\\([^]]+\\)\\]\\(\\[\\([^]]+\\)\\]\\)?\\]"
2192 "Matches a link in double brackets.") 2475 "Matches a link in double brackets.")
2193 2476
2477(defconst org-bracket-link-analytic-regexp
2478 (concat
2479 "\\[\\["
2480 "\\(\\(" (mapconcat 'identity org-link-types "\\|") "\\):\\)?"
2481 "\\([^]]+\\)"
2482 "\\]"
2483 "\\(\\[" "\\([^]]+\\)" "\\]\\)?"
2484 "\\]"))
2485; 1: http:
2486; 2: http
2487; 3: path
2488; 4: [desc]
2489; 5: desc
2490
2491
2194(defconst org-ts-lengths 2492(defconst org-ts-lengths
2195 (cons (length (format-time-string (car org-time-stamp-formats))) 2493 (cons (length (format-time-string (car org-time-stamp-formats)))
2196 (length (format-time-string (cdr org-time-stamp-formats)))) 2494 (length (format-time-string (cdr org-time-stamp-formats))))
@@ -2209,22 +2507,48 @@ The following commands are available:
2209 org-ts-regexp "\\)?") 2507 org-ts-regexp "\\)?")
2210 "Regular expression matching a time stamp or time stamp range.") 2508 "Regular expression matching a time stamp or time stamp range.")
2211 2509
2212(defun org-activate-links (limit) 2510(defun org-activate-plain-links (limit)
2213 "Run through the buffer and add overlays to links." 2511 "Run through the buffer and add overlays to links."
2214 (if (re-search-forward org-link-regexp limit t) 2512 (if (re-search-forward org-plain-link-re limit t)
2215 (progn 2513 (progn
2216 (add-text-properties (match-beginning 0) (match-end 0) 2514 (add-text-properties (match-beginning 0) (match-end 0)
2217 (list 'mouse-face 'highlight 2515 (list 'mouse-face 'highlight
2218 'keymap org-mouse-map)) 2516 'keymap org-mouse-map
2517 ))
2219 t))) 2518 t)))
2220 2519
2221(defun org-activate-links2 (limit) 2520(defun org-activate-angle-links (limit)
2222 "Run through the buffer and add overlays to links." 2521 "Run through the buffer and add overlays to links."
2223 (if (re-search-forward org-bracket-link-regexp limit t) 2522 (if (re-search-forward org-angle-link-re limit t)
2224 (progn 2523 (progn
2225 (add-text-properties (match-beginning 0) (match-end 0) 2524 (add-text-properties (match-beginning 0) (match-end 0)
2226 (list 'mouse-face 'highlight 2525 (list 'mouse-face 'highlight
2227 'keymap org-mouse-map)) 2526 'keymap org-mouse-map
2527 ))
2528 t)))
2529
2530(defun org-activate-bracket-links (limit)
2531 "Run through the buffer and add overlays to bracketed links."
2532 (if (re-search-forward org-bracket-link-regexp limit t)
2533 (let* ((help (concat "LINK: " (org-match-string-no-properties 1)))
2534 (ip (list 'invisible 'org-link 'intangible t 'rear-nonsticky t
2535 'keymap org-mouse-map 'mouse-face 'highlight
2536 'help-echo help))
2537 (vp (list 'rear-nonsticky t
2538 'keymap org-mouse-map 'mouse-face 'highlight
2539 'help-echo help)))
2540 ;; We need to remove the invisible property here. Table narrowing
2541 ;; may have made some of this invisible.
2542 (remove-text-properties (match-beginning 0) (match-end 0)
2543 '(invisible nil))
2544 (if (match-end 3)
2545 (progn
2546 (add-text-properties (match-beginning 0) (match-beginning 3) ip)
2547 (add-text-properties (match-beginning 3) (match-end 3) vp)
2548 (add-text-properties (match-end 3) (match-end 0) ip))
2549 (add-text-properties (match-beginning 0) (match-beginning 1) ip)
2550 (add-text-properties (match-beginning 1) (match-end 1) vp)
2551 (add-text-properties (match-end 1) (match-end 0) ip))
2228 t))) 2552 t)))
2229 2553
2230(defun org-activate-dates (limit) 2554(defun org-activate-dates (limit)
@@ -2245,22 +2569,38 @@ The following commands are available:
2245 2569
2246(defun org-activate-target-links (limit) 2570(defun org-activate-target-links (limit)
2247 "Run through the buffer and add overlays to target matches." 2571 "Run through the buffer and add overlays to target matches."
2248 (when (and org-radio-targets org-target-link-regexp) 2572 (when org-target-link-regexp
2249 (let ((case-fold-search t)) 2573 (let ((case-fold-search t))
2250 (if (re-search-forward org-target-link-regexp limit t) 2574 (if (re-search-forward org-target-link-regexp limit t)
2251 (progn 2575 (progn
2252 (add-text-properties (match-beginning 0) (match-end 0) 2576 (add-text-properties (match-beginning 0) (match-end 0)
2253 (list 'mouse-face 'highlight 2577 (list 'mouse-face 'highlight
2254 'keymap org-mouse-map 2578 'keymap org-mouse-map
2579 'help-echo "Radio target link"
2255 'org-linked-text t)) 2580 'org-linked-text t))
2256 t))))) 2581 t)))))
2257 2582
2258(defun org-update-radio-target-regexp () 2583(defun org-update-radio-target-regexp ()
2259 "Find all radio targets in this file and update the regular expression." 2584 "Find all radio targets in this file and update the regular expression."
2260 (interactive) 2585 (interactive)
2261 (when org-radio-targets 2586 (when (memq 'radio org-activate-links)
2262 (setq org-target-link-regexp 2587 (setq org-target-link-regexp
2263 (org-make-target-link-regexp (org-all-targets 'radio))) 2588 (org-make-target-link-regexp (org-all-targets 'radio)))
2589 (org-restart-font-lock)))
2590
2591(defun org-hide-wide-columns (limit)
2592 (let (s e)
2593 (setq s (text-property-any (point) (or limit (point-max))
2594 'org-cwidth t))
2595 (when s
2596 (setq e (next-single-property-change s 'org-cwidth))
2597 (add-text-properties s e '(invisible org-cwidth intangible t))
2598 (goto-char e)
2599 t)))
2600
2601(defun org-restart-font-lock ()
2602 "Restart font-lock-mode, to force refontification."
2603 (when (and (boundp 'font-lock-mode) font-lock-mode)
2264 (font-lock-mode -1) 2604 (font-lock-mode -1)
2265 (font-lock-mode 1))) 2605 (font-lock-mode 1)))
2266 2606
@@ -2272,10 +2612,7 @@ With optional argument RADIO, only find radio targets."
2272 (save-excursion 2612 (save-excursion
2273 (goto-char (point-min)) 2613 (goto-char (point-min))
2274 (while (re-search-forward re nil t) 2614 (while (re-search-forward re nil t)
2275 (add-to-list 'rtn (downcase 2615 (add-to-list 'rtn (downcase (org-match-string-no-properties 1))))
2276 (if (fboundp 'match-string-no-properties)
2277 (match-string-no-properties 1)
2278 (match-string 1)))))
2279 rtn))) 2616 rtn)))
2280 2617
2281(defun org-make-target-link-regexp (targets) 2618(defun org-make-target-link-regexp (targets)
@@ -2299,13 +2636,12 @@ between words."
2299 2636
2300(defun org-activate-camels (limit) 2637(defun org-activate-camels (limit)
2301 "Run through the buffer and add overlays to dates." 2638 "Run through the buffer and add overlays to dates."
2302 (if org-activate-camels 2639 (if (re-search-forward org-camel-regexp limit t)
2303 (if (re-search-forward org-camel-regexp limit t) 2640 (progn
2304 (progn 2641 (add-text-properties (match-beginning 0) (match-end 0)
2305 (add-text-properties (match-beginning 0) (match-end 0) 2642 (list 'mouse-face 'highlight
2306 (list 'mouse-face 'highlight 2643 'keymap org-mouse-map))
2307 'keymap org-mouse-map)) 2644 t)))
2308 t))))
2309 2645
2310(defun org-activate-tags (limit) 2646(defun org-activate-tags (limit)
2311 (if (re-search-forward "[ \t]\\(:[A-Za-z_@0-9:]+:\\)[ \r\n]" limit t) 2647 (if (re-search-forward "[ \t]\\(:[A-Za-z_@0-9:]+:\\)[ \r\n]" limit t)
@@ -2331,28 +2667,31 @@ between words."
2331 2667
2332(defun org-set-font-lock-defaults () 2668(defun org-set-font-lock-defaults ()
2333 (let* ((em org-fontify-emphasized-text) 2669 (let* ((em org-fontify-emphasized-text)
2670 (lk org-activate-links)
2334 (org-font-lock-extra-keywords 2671 (org-font-lock-extra-keywords
2335 (list 2672 (list
2336 '("^\\(\\**\\)\\(\\*\\)\\(.*\\)" (1 (org-get-level-face 1)) 2673 '("^\\(\\**\\)\\(\\*\\)\\(.*\\)" (1 (org-get-level-face 1))
2337 (2 (org-get-level-face 2)) (3 (org-get-level-face 3))) 2674 (2 (org-get-level-face 2)) (3 (org-get-level-face 3)))
2338 '(org-activate-links (0 'org-link t)) 2675 '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
2339 '(org-activate-links2 (0 'org-link t)) 2676 (1 'org-table))
2340 '(org-activate-target-links (0 'org-link t)) 2677 (if (memq 'angle lk) '(org-activate-angle-links (0 'org-link t)))
2341 '(org-activate-dates (0 'org-link t)) 2678 (if (memq 'plain lk) '(org-activate-plain-links (0 'org-link t)))
2342 '(org-activate-camels (0 'org-link t)) 2679 (if (memq 'bracket lk) '(org-activate-bracket-links (0 'org-link t)))
2343 '(org-activate-tags (1 'org-tag t)) 2680 (if (memq 'radio lk) '(org-activate-target-links (0 'org-link t)))
2681 (if (memq 'date lk) '(org-activate-dates (0 'org-link t)))
2682 (if (memq 'camel lk) '(org-activate-camels (0 'org-link t)))
2683 (if (memq 'tag lk) '(org-activate-tags (1 'org-tag prepend)))
2684 (if org-table-limit-column-width
2685 '(org-hide-wide-columns (0 nil append)))
2344 (list (concat "^\\*+[ \t]*" org-not-done-regexp) 2686 (list (concat "^\\*+[ \t]*" org-not-done-regexp)
2345 '(1 'org-warning t)) 2687 '(1 'org-warning t))
2346 (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t)) 2688 (list (concat "\\[#[A-Z]\\]") '(0 'org-special-keyword t))
2347 (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t)) 2689 (list (concat "\\<" org-deadline-string) '(0 'org-special-keyword t))
2348 (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t)) 2690 (list (concat "\\<" org-scheduled-string) '(0 'org-special-keyword t))
2349 (list (concat "\\<" org-closed-string) '(0 'org-special-keyword t)) 2691 (list (concat "\\<" org-closed-string) '(0 'org-special-keyword t))
2350; (if em '("\\(\\s-\\|^\\)\\(\\*\\([a-zA-Z]+\\)\\*\\)\\([^a-zA-Z*]\\|$\\)" (3 'bold))) 2692 (if em '("\\(\\W\\|^\\)\\(\\*\\w+\\*\\)\\(\\W\\|$\\)" 2 'bold prepend))
2351; (if em '("\\(\\s-\\|^\\)\\(/\\([a-zA-Z]+\\)/\\)\\([^a-zA-Z*]\\|$\\)" (3 'italic))) 2693 (if em '("\\(\\W\\|^\\)\\(/\\w+/\\)\\(\\W\\|$\\)" 2 'italic prepend))
2352; (if em '("\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)" (3 'underline))) 2694 (if em '("\\(\\W\\|^\\)\\(_\\w+_\\)\\(\\W\\|$\\)" 2 'underline prepend))
2353 (if em '("\\*[a-zA-Z]+\\*" 0 'bold))
2354 (if em '("/*[a-zA-Z]+/" 0 'italic))
2355 (if em '("_[a-zA-Z]+_" 0 'underline))
2356 (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string 2695 (list (concat "^\\*+[ \t]*\\<\\(" org-comment-string
2357 "\\|" org-quote-string "\\)\\>") 2696 "\\|" org-quote-string "\\)\\>")
2358 '(1 'org-special-keyword t)) 2697 '(1 'org-special-keyword t))
@@ -2362,11 +2701,11 @@ between words."
2362 '(1 'org-done t) '(2 'org-headline-done t)) 2701 '(1 'org-done t) '(2 'org-headline-done t))
2363 (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\>") 2702 (list (concat "^[*]+ +\\<\\(" org-done-string "\\)\\>")
2364 '(1 'org-done t))) 2703 '(1 'org-done t)))
2365 '("^[ \t]*\\(\\(|\\|\\+-[-+]\\).*\\S-\\)"
2366 (1 'org-table t))
2367 '("^[ \t]*\\(:.*\\)" (1 'org-table t)) 2704 '("^[ \t]*\\(:.*\\)" (1 'org-table t))
2368 '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t)) 2705 '("| *\\(:?=[^|\n]*\\)" (1 'org-formula t))
2369 '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t)) 2706 '("^[ \t]*| *\\([#!$*_^]\\) *|" (1 'org-formula t))
2707 (if org-format-transports-properties-p
2708 '("| *\\(<[0-9]+>\\) *|" (1 'org-formula t)))
2370 ))) 2709 )))
2371 (setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords)) 2710 (setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords))
2372 ;; Now set the full font-lock-keywords 2711 ;; Now set the full font-lock-keywords
@@ -2383,6 +2722,7 @@ between words."
2383 "Get the right face for match N in font-lock matching of healdines." 2722 "Get the right face for match N in font-lock matching of healdines."
2384 (setq org-l (- (match-end 2) (match-beginning 1))) 2723 (setq org-l (- (match-end 2) (match-beginning 1)))
2385 (if org-odd-levels-only (setq org-l (1+ (/ org-l 2)))) 2724 (if org-odd-levels-only (setq org-l (1+ (/ org-l 2))))
2725; (setq org-f (nth (1- (% org-l org-n-levels)) org-level-faces))
2386 (setq org-f (nth (% (1- org-l) org-n-levels) org-level-faces)) 2726 (setq org-f (nth (% (1- org-l) org-n-levels) org-level-faces))
2387 (cond 2727 (cond
2388 ((eq n 1) (if org-hide-leading-stars 'org-hide org-f)) 2728 ((eq n 1) (if org-hide-leading-stars 'org-hide org-f))
@@ -2397,8 +2737,8 @@ between words."
2397 (inhibit-modification-hooks t) 2737 (inhibit-modification-hooks t)
2398 deactivate-mark buffer-file-name buffer-file-truename) 2738 deactivate-mark buffer-file-name buffer-file-truename)
2399 (remove-text-properties beg end 2739 (remove-text-properties beg end
2400 '(mouse-face nil keymap nil org-linked-text nil)))) 2740 '(mouse-face nil keymap nil org-linked-text nil
2401 2741 invisible nil intangible nil))))
2402;;; Visibility cycling 2742;;; Visibility cycling
2403 2743
2404(defvar org-cycle-global-status nil) 2744(defvar org-cycle-global-status nil)
@@ -2448,8 +2788,9 @@ between words."
2448 ;; Enter the table or move to the next field in the table 2788 ;; Enter the table or move to the next field in the table
2449 (or (org-table-recognize-table.el) 2789 (or (org-table-recognize-table.el)
2450 (progn 2790 (progn
2451 (org-table-justify-field-maybe) 2791 (if arg (org-table-edit-field t)
2452 (org-table-next-field)))) 2792 (org-table-justify-field-maybe)
2793 (org-table-next-field)))))
2453 2794
2454 ((eq arg t) ;; Global cycling 2795 ((eq arg t) ;; Global cycling
2455 2796
@@ -2560,13 +2901,14 @@ between words."
2560(defun org-optimize-window-after-visibility-change (state) 2901(defun org-optimize-window-after-visibility-change (state)
2561 "Adjust the window after a change in outline visibility. 2902 "Adjust the window after a change in outline visibility.
2562This function is the default value of the hook `org-cycle-hook'." 2903This function is the default value of the hook `org-cycle-hook'."
2563 (cond 2904 (when (get-buffer-window (current-buffer))
2564 ((eq state 'overview) (org-first-headline-recenter 1)) 2905 (cond
2565 ((eq state 'content) nil) 2906 ((eq state 'overview) (org-first-headline-recenter 1))
2566 ((eq state 'all) nil) 2907 ((eq state 'content) nil)
2567 ((eq state 'folded) nil) 2908 ((eq state 'all) nil)
2568 ((eq state 'children) (or (org-subtree-end-visible-p) (recenter 1))) 2909 ((eq state 'folded) nil)
2569 ((eq state 'subtree) (or (org-subtree-end-visible-p) (recenter 1))))) 2910 ((eq state 'children) (or (org-subtree-end-visible-p) (recenter 1)))
2911 ((eq state 'subtree) (or (org-subtree-end-visible-p) (recenter 1))))))
2570 2912
2571(defun org-subtree-end-visible-p () 2913(defun org-subtree-end-visible-p ()
2572 "Is the end of the current subtree visible?" 2914 "Is the end of the current subtree visible?"
@@ -2655,6 +2997,7 @@ or nil."
2655 (insert-buffer-substring buf) 2997 (insert-buffer-substring buf)
2656 (let ((org-startup-truncated t) 2998 (let ((org-startup-truncated t)
2657 (org-startup-folded t) 2999 (org-startup-folded t)
3000 (org-startup-align-all-tables nil)
2658 (org-startup-with-deadline-check nil)) 3001 (org-startup-with-deadline-check nil))
2659 (org-mode)) 3002 (org-mode))
2660 (setq buffer-read-only t) 3003 (setq buffer-read-only t)
@@ -2729,10 +3072,8 @@ or nil."
2729 (funcall outline-level))))) 3072 (funcall outline-level)))))
2730 (unless (bolp) (newline)) 3073 (unless (bolp) (newline))
2731 (insert head) 3074 (insert head)
2732 (unless (eolp) 3075 (if (looking-at "[ \t]*")
2733 (save-excursion (newline-and-indent))) 3076 (replace-match " "))
2734 (unless (equal (char-before) ?\ )
2735 (insert " "))
2736 (run-hooks 'org-insert-heading-hook)))) 3077 (run-hooks 'org-insert-heading-hook))))
2737 3078
2738(defun org-insert-item () 3079(defun org-insert-item ()
@@ -2976,7 +3317,6 @@ If CUT is non nil, actually cut the subtree."
2976 (if cut "Cut" "Copied") 3317 (if cut "Cut" "Copied")
2977 (length org-subtree-clip))))) 3318 (length org-subtree-clip)))))
2978 3319
2979;; FIXME: this needs to be adapted for the odd-level-only stuff.
2980(defun org-paste-subtree (&optional level tree) 3320(defun org-paste-subtree (&optional level tree)
2981 "Paste the clipboard as a subtree, with modification of headline level. 3321 "Paste the clipboard as a subtree, with modification of headline level.
2982The entire subtree is promoted or demoted in order to match a new headline 3322The entire subtree is promoted or demoted in order to match a new headline
@@ -3283,7 +3623,6 @@ with something like \"1.\" or \"2)\"."
3283(defvar org-last-indent-begin-marker (make-marker)) 3623(defvar org-last-indent-begin-marker (make-marker))
3284(defvar org-last-indent-end-marker (make-marker)) 3624(defvar org-last-indent-end-marker (make-marker))
3285 3625
3286
3287(defun org-outdent-item (arg) 3626(defun org-outdent-item (arg)
3288 "Outdent a local list item." 3627 "Outdent a local list item."
3289 (interactive "p") 3628 (interactive "p")
@@ -3401,7 +3740,7 @@ heading be marked DONE, and the current time will be added."
3401 (looking-at org-todo-line-regexp) 3740 (looking-at org-todo-line-regexp)
3402 (goto-char (or (match-end 2) (match-beginning 3))) 3741 (goto-char (or (match-end 2) (match-beginning 3)))
3403 (insert "(" (format-time-string (cdr org-time-stamp-formats) 3742 (insert "(" (format-time-string (cdr org-time-stamp-formats)
3404 (current-time)) 3743 (org-current-time))
3405 ")")) 3744 ")"))
3406 ;; Save the buffer, if it is not the same buffer. 3745 ;; Save the buffer, if it is not the same buffer.
3407 (if (not (eq this-buffer buffer)) (save-buffer)))) 3746 (if (not (eq this-buffer buffer)) (save-buffer))))
@@ -3632,7 +3971,7 @@ When UNDONE is non-nil, remove such a time stamp again."
3632 (insert org-closed-string " " 3971 (insert org-closed-string " "
3633 (format-time-string 3972 (format-time-string
3634 (concat "[" (substring (cdr org-time-stamp-formats) 1 -1) "]") 3973 (concat "[" (substring (cdr org-time-stamp-formats) 1 -1) "]")
3635 (current-time)) 3974 (org-current-time))
3636 "\n"))))) 3975 "\n")))))
3637 3976
3638(defun org-show-todo-tree (arg) 3977(defun org-show-todo-tree (arg)
@@ -3727,17 +4066,19 @@ that the match should indeed be shown."
3727 4066
3728;; Overlay compatibility functions 4067;; Overlay compatibility functions
3729(defun org-make-overlay (beg end &optional buffer) 4068(defun org-make-overlay (beg end &optional buffer)
3730 (if org-xemacs-p (make-extent beg end buffer) (make-overlay beg end buffer))) 4069 (if (featurep 'xemacs)
4070 (make-extent beg end buffer)
4071 (make-overlay beg end buffer)))
3731(defun org-delete-overlay (ovl) 4072(defun org-delete-overlay (ovl)
3732 (if org-xemacs-p (delete-extent ovl) (delete-overlay ovl))) 4073 (if (featurep 'xemacs) (delete-extent ovl) (delete-overlay ovl)))
3733(defun org-detatch-overlay (ovl) 4074(defun org-detatch-overlay (ovl)
3734 (if org-xemacs-p (detach-extent ovl) (delete-overlay ovl))) 4075 (if (featurep 'xemacs) (detach-extent ovl) (delete-overlay ovl)))
3735(defun org-move-overlay (ovl beg end &optional buffer) 4076(defun org-move-overlay (ovl beg end &optional buffer)
3736 (if org-xemacs-p 4077 (if (featurep 'xemacs)
3737 (set-extent-endpoints ovl beg end buffer) 4078 (set-extent-endpoints ovl beg end buffer)
3738 (move-overlay ovl beg end buffer))) 4079 (move-overlay ovl beg end buffer)))
3739(defun org-overlay-put (ovl prop value) 4080(defun org-overlay-put (ovl prop value)
3740 (if org-xemacs-p 4081 (if (featurep 'xemacs)
3741 (set-extent-property ovl prop value) 4082 (set-extent-property ovl prop value)
3742 (overlay-put ovl prop value))) 4083 (overlay-put ovl prop value)))
3743 4084
@@ -3876,7 +4217,6 @@ An inactive time stamp is enclosed in square brackets instead of angle
3876brackets. It is inactive in the sense that it does not trigger agenda entries, 4217brackets. It is inactive in the sense that it does not trigger agenda entries,
3877does not link to the calendar and cannot be changed with the S-cursor keys. 4218does not link to the calendar and cannot be changed with the S-cursor keys.
3878So these are more for recording a certain time/date." 4219So these are more for recording a certain time/date."
3879 ;; FIXME: Would it be better not to ask for a date/time here?
3880 (interactive "P") 4220 (interactive "P")
3881 (let ((fmt (if arg (cdr org-time-stamp-formats) 4221 (let ((fmt (if arg (cdr org-time-stamp-formats)
3882 (car org-time-stamp-formats))) 4222 (car org-time-stamp-formats)))
@@ -3891,8 +4231,6 @@ So these are more for recording a certain time/date."
3891(org-overlay-put org-date-ovl 'face 'org-warning) 4231(org-overlay-put org-date-ovl 'face 'org-warning)
3892(org-detatch-overlay org-date-ovl) 4232(org-detatch-overlay org-date-ovl)
3893 4233
3894;;; FIXME: Make the function take "Fri" as "next friday"
3895;;; because these are mostly being used to record the current time.
3896(defun org-read-date (&optional with-time to-time) 4234(defun org-read-date (&optional with-time to-time)
3897 "Read a date and make things smooth for the user. 4235 "Read a date and make things smooth for the user.
3898The prompt will suggest to enter an ISO date, but you can also enter anything 4236The prompt will suggest to enter an ISO date, but you can also enter anything
@@ -3905,6 +4243,7 @@ hour and minute. For example,
3905 12:45 --> today 12:45 4243 12:45 --> today 12:45
3906 22 sept 0:34 --> currentyear-09-22 0:34 4244 22 sept 0:34 --> currentyear-09-22 0:34
3907 12 --> currentyear-currentmonth-12 4245 12 --> currentyear-currentmonth-12
4246 Fri --> nearest Friday (today or later)
3908 etc. 4247 etc.
3909The function understands only English month and weekday abbreviations, 4248The function understands only English month and weekday abbreviations,
3910but this can be configured with the variables `parse-time-months' and 4249but this can be configured with the variables `parse-time-months' and
@@ -3924,29 +4263,30 @@ enter a time, and this function will inform the calling routine about
3924this change. The calling routine may then choose to change the format 4263this change. The calling routine may then choose to change the format
3925used to insert the time stamp into the buffer to include the time." 4264used to insert the time stamp into the buffer to include the time."
3926 (require 'parse-time) 4265 (require 'parse-time)
3927 (let* ((default-time 4266 (let* ((org-time-stamp-rounding-minutes
4267 (if (equal with-time '(16)) 0 org-time-stamp-rounding-minutes))
4268 (ct (org-current-time))
4269 (default-time
3928 ;; Default time is either today, or, when entering a range, 4270 ;; Default time is either today, or, when entering a range,
3929 ;; the range start. 4271 ;; the range start.
3930 (if (save-excursion 4272 (if (save-excursion
3931 (re-search-backward 4273 (re-search-backward
3932 (concat org-ts-regexp "--\\=") 4274 (concat org-ts-regexp "--\\=") ; FIXME: exactly two minuses?
3933 (- (point) 20) t)) 4275 (- (point) 20) t))
3934 (apply 4276 (apply
3935 'encode-time 4277 'encode-time
3936 (mapcar (lambda(x) (or x 0)) ;; FIXME: Problem with timezone? 4278 (mapcar (lambda(x) (or x 0))
3937 (parse-time-string (match-string 1)))) 4279 (parse-time-string (match-string 1))))
3938 (current-time))) 4280 ct))
3939 (calendar-move-hook nil) 4281 (calendar-move-hook nil)
3940 (view-diary-entries-initially nil) 4282 (view-diary-entries-initially nil)
3941 (timestr (format-time-string 4283 (timestr (format-time-string
3942 (if with-time "%Y-%m-%d %H:%M" "%Y-%m-%d") default-time)) 4284 (if with-time "%Y-%m-%d %H:%M" "%Y-%m-%d") default-time))
3943 (prompt (format "YYYY-MM-DD [%s]: " timestr)) 4285 (prompt (format "YYYY-MM-DD [%s]: " timestr))
3944 ans ans1 ans2 4286 ans ans1 ans2
3945 second minute hour day month year tl) 4287 second minute hour day month year tl wday wday1)
3946 4288
3947 (if org-popup-calendar-for-date-prompt 4289 (if org-popup-calendar-for-date-prompt
3948 ;; Also show a calendar for date selection
3949 ;; Copied (with modifications) from planner.el by John Wiegley
3950 (save-excursion 4290 (save-excursion
3951 (save-window-excursion 4291 (save-window-excursion
3952 (calendar) 4292 (calendar)
@@ -3958,9 +4298,9 @@ used to insert the time stamp into the buffer to include the time."
3958 (map (copy-keymap calendar-mode-map)) 4298 (map (copy-keymap calendar-mode-map))
3959 (minibuffer-local-map (copy-keymap minibuffer-local-map))) 4299 (minibuffer-local-map (copy-keymap minibuffer-local-map)))
3960 (define-key map (kbd "RET") 'org-calendar-select) 4300 (define-key map (kbd "RET") 'org-calendar-select)
3961 (define-key map (if org-xemacs-p [button1] [mouse-1]) 4301 (define-key map (if (featurep 'xemacs) [button1] [mouse-1])
3962 'org-calendar-select-mouse) 4302 'org-calendar-select-mouse)
3963 (define-key map (if org-xemacs-p [button2] [mouse-2]) 4303 (define-key map (if (featurep 'xemacs) [button2] [mouse-2])
3964 'org-calendar-select-mouse) 4304 'org-calendar-select-mouse)
3965 (define-key minibuffer-local-map [(meta shift left)] 4305 (define-key minibuffer-local-map [(meta shift left)]
3966 (lambda () (interactive) 4306 (lambda () (interactive)
@@ -4009,12 +4349,19 @@ used to insert the time stamp into the buffer to include the time."
4009 (setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day) 4349 (setq ans (replace-match (format "%04d-%02d-%02d\\5" year month day)
4010 t nil ans)))) 4350 t nil ans))))
4011 (setq tl (parse-time-string ans) 4351 (setq tl (parse-time-string ans)
4012 year (or (nth 5 tl) (string-to-number (format-time-string "%Y"))) 4352 year (or (nth 5 tl) (string-to-number (format-time-string "%Y" ct)))
4013 month (or (nth 4 tl) (string-to-number (format-time-string "%m"))) 4353 month (or (nth 4 tl) (string-to-number (format-time-string "%m" ct)))
4014 day (or (nth 3 tl) (string-to-number (format-time-string "%d"))) 4354 day (or (nth 3 tl) (string-to-number (format-time-string "%d" ct)))
4015 hour (or (nth 2 tl) (string-to-number (format-time-string "%H"))) 4355 hour (or (nth 2 tl) (string-to-number (format-time-string "%H" ct)))
4016 minute (or (nth 1 tl) (string-to-number (format-time-string "%M"))) 4356 minute (or (nth 1 tl) (string-to-number (format-time-string "%M" ct)))
4017 second (or (nth 0 tl) 0)) 4357 second (or (nth 0 tl) 0)
4358 wday (nth 6 tl))
4359 (when (and wday (not (nth 3 tl)))
4360 ;; Weekday was given, but no day, so pick that day in the week
4361 ;; on or after the derived date.
4362 (setq wday1 (nth 6 (decode-time (encode-time 0 0 0 day month year))))
4363 (unless (equal wday wday1)
4364 (setq day (+ day (% (- wday wday1 -7) 7)))))
4018 (if (and (boundp 'org-time-was-given) 4365 (if (and (boundp 'org-time-was-given)
4019 (nth 2 tl)) 4366 (nth 2 tl))
4020 (setq org-time-was-given t)) 4367 (setq org-time-was-given t))
@@ -4118,8 +4465,6 @@ days in order to avoid rounding problems."
4118 (fd1 "%dd") 4465 (fd1 "%dd")
4119 (fh "%02d:%02d") 4466 (fh "%02d:%02d")
4120 y d h m align) 4467 y d h m align)
4121 ;; FIXME: Should I re-introduce years, make year refer to same date?
4122 ;; This would be the only useful way to have years, actually.
4123 (if havetime 4468 (if havetime
4124 (setq ; y (floor (/ diff ys)) diff (mod diff ys) 4469 (setq ; y (floor (/ diff ys)) diff (mod diff ys)
4125 y 0 4470 y 0
@@ -4336,7 +4681,7 @@ If there is already a time stamp at the cursor position, update it."
4336(defvar org-agenda-mode-map (make-sparse-keymap) 4681(defvar org-agenda-mode-map (make-sparse-keymap)
4337 "Keymap for `org-agenda-mode'.") 4682 "Keymap for `org-agenda-mode'.")
4338 4683
4339(defvar org-agenda-menu) 4684(defvar org-agenda-menu) ; defined later in this file.
4340(defvar org-agenda-follow-mode nil) 4685(defvar org-agenda-follow-mode nil)
4341(defvar org-agenda-show-log nil) 4686(defvar org-agenda-show-log nil)
4342(defvar org-agenda-buffer-name "*Org Agenda*") 4687(defvar org-agenda-buffer-name "*Org Agenda*")
@@ -4372,7 +4717,7 @@ The following commands are available:
4372 (if (get 'org-agenda-files 'org-restrict) 4717 (if (get 'org-agenda-files 'org-restrict)
4373 "Restricted to single file" 4718 "Restricted to single file"
4374 "Edit File List") 4719 "Edit File List")
4375 '(customize-variable 'org-agenda-files) 4720 '(org-edit-agenda-file-list)
4376 (not (get 'org-agenda-files 'org-restrict))) 4721 (not (get 'org-agenda-files 'org-restrict)))
4377 "--") 4722 "--")
4378 (mapcar 'org-file-menu-entry (org-agenda-files)))) 4723 (mapcar 'org-file-menu-entry (org-agenda-files))))
@@ -4443,10 +4788,11 @@ The following commands are available:
4443 "Local keymap for agenda entries from Org-mode.") 4788 "Local keymap for agenda entries from Org-mode.")
4444 4789
4445(define-key org-agenda-keymap 4790(define-key org-agenda-keymap
4446 (if org-xemacs-p [(button2)] [(mouse-2)]) 'org-agenda-goto-mouse) 4791 (if (featurep 'xemacs) [(button2)] [(mouse-2)]) 'org-agenda-goto-mouse)
4447(define-key org-agenda-keymap 4792(define-key org-agenda-keymap
4448 (if org-xemacs-p [(button3)] [(mouse-3)]) 'org-agenda-show-mouse) 4793 (if (featurep 'xemacs) [(button3)] [(mouse-3)]) 'org-agenda-show-mouse)
4449(define-key org-agenda-keymap [follow-link] 'mouse-face) 4794(when org-agenda-mouse-1-follows-link
4795 (define-key org-agenda-keymap [follow-link] 'mouse-face))
4450(easy-menu-define org-agenda-menu org-agenda-mode-map "Agenda menu" 4796(easy-menu-define org-agenda-menu org-agenda-mode-map "Agenda menu"
4451 '("Agenda" 4797 '("Agenda"
4452 ("Agenda Files") 4798 ("Agenda Files")
@@ -4553,7 +4899,7 @@ C Configure your own agenda commands")
4553 ((eq type 'todo-tree) "TODO kwd tree") 4899 ((eq type 'todo-tree) "TODO kwd tree")
4554 ((eq type 'occur-tree) "Occur tree") 4900 ((eq type 'occur-tree) "Occur tree")
4555 (t "???")) 4901 (t "???"))
4556 (org-string-props string 'face 'org-link)))) 4902 (org-add-props string nil 'face 'org-warning))))
4557 (goto-char (point-min)) 4903 (goto-char (point-min))
4558 (if (fboundp 'fit-window-to-buffer) (fit-window-to-buffer)) 4904 (if (fboundp 'fit-window-to-buffer) (fit-window-to-buffer))
4559 (message "Press key for agenda command%s" 4905 (message "Press key for agenda command%s"
@@ -4614,10 +4960,58 @@ C Configure your own agenda commands")
4614 (fit-window-to-buffer nil (/ (* (frame-height) 3) 4) 4960 (fit-window-to-buffer nil (/ (* (frame-height) 3) 4)
4615 (/ (frame-height) 2)))) 4961 (/ (frame-height) 2))))
4616 4962
4617(defun org-agenda-files () 4963(defun org-agenda-files (&optional unrestricted)
4618 "Get the list of agenda files." 4964 "Get the list of agenda files.
4619 (or (get 'org-agenda-files 'org-restrict) 4965Optional UNRESTRICTED means return the full list even if a restriction
4620 org-agenda-files)) 4966is currently in place."
4967 (cond
4968 ((and (not unrestricted) (get 'org-agenda-files 'org-restrict)))
4969 ((stringp org-agenda-files) (org-read-agenda-file-list))
4970 ((listp org-agenda-files) org-agenda-files)
4971 (t (error "Invalid value of `org-agenda-files'"))))
4972
4973(defvar org-window-configuration)
4974
4975(defun org-edit-agenda-file-list ()
4976 "Edit the list of agenda files.
4977Depending on setup, this either uses customize to edit the variable
4978`org-agenda-files', or it visits the file that is holding the list. In the
4979latter case, the buffer is set up in a way that saving it automatically kills
4980the buffer and restores the previous window configuration."
4981 (interactive)
4982 (if (stringp org-agenda-files)
4983 (let ((cw (current-window-configuration)))
4984 (find-file org-agenda-files)
4985 (set (make-local-variable 'org-window-configuration) cw)
4986 (org-add-hook 'after-save-hook
4987 (lambda ()
4988 (set-window-configuration
4989 (prog1 org-window-configuration
4990 (kill-buffer (current-buffer))))
4991 (org-install-agenda-files-menu)
4992 (message "New agenda file list installed"))
4993 nil 'local)
4994 (message (substitute-command-keys
4995 "Edit list and finish with \\[save-buffer]")))
4996 (customize-variable 'org-agenda-files)))
4997
4998(defun org-store-new-agenda-file-list (list)
4999 "Set new value for the agenda file list and save it correcly."
5000 (if (stringp org-agenda-files)
5001 (let ((f org-agenda-files) b)
5002 (while (setq b (find-buffer-visiting f)) (kill-buffer b))
5003 (with-temp-file f
5004 (insert (mapconcat 'identity list "\n") "\n")))
5005 (let ((org-mode-hook nil) (default-major-mode 'fundamental-mode))
5006 (setq org-agenda-files list)
5007 (customize-save-variable 'org-agenda-files org-agenda-files))))
5008
5009(defun org-read-agenda-file-list ()
5010 "Read the list of agenda files from a file."
5011 (when (stringp org-agenda-files)
5012 (with-temp-buffer
5013 (insert-file-contents org-agenda-files)
5014 (org-split-string (buffer-string) "[ \t\r\n]*?[\r\n][ \t\r\n]*"))))
4621 5015
4622(defvar org-agenda-markers nil 5016(defvar org-agenda-markers nil
4623 "List of all currently active markers created by `org-agenda'.") 5017 "List of all currently active markers created by `org-agenda'.")
@@ -4736,7 +5130,7 @@ dates."
4736 (calendar-month-name (extract-calendar-month date)) " " 5130 (calendar-month-name (extract-calendar-month date)) " "
4737 (number-to-string (extract-calendar-year date)) "\n") 5131 (number-to-string (extract-calendar-year date)) "\n")
4738 (put-text-property s (1- (point)) 'face 5132 (put-text-property s (1- (point)) 'face
4739 'org-link) 5133 'org-level-3)
4740 (if (equal d today) 5134 (if (equal d today)
4741 (put-text-property s (1- (point)) 'org-today t)) 5135 (put-text-property s (1- (point)) 'org-today t))
4742 (insert (org-finalize-agenda-entries rtn) "\n") 5136 (insert (org-finalize-agenda-entries rtn) "\n")
@@ -4771,7 +5165,8 @@ NDAYS defaults to `org-agenda-ndays'."
4771 (and (null ndays) (equal 1 org-agenda-ndays))) 5165 (and (null ndays) (equal 1 org-agenda-ndays)))
4772 nil org-agenda-start-on-weekday)) 5166 nil org-agenda-start-on-weekday))
4773 (org-agenda-keep-modes keep-modes) 5167 (org-agenda-keep-modes keep-modes)
4774 (files (copy-sequence (org-agenda-files))) 5168 (thefiles (org-agenda-files))
5169 (files thefiles)
4775 (win (selected-window)) 5170 (win (selected-window))
4776 (today (time-to-days (current-time))) 5171 (today (time-to-days (current-time)))
4777 (sd (or start-day today)) 5172 (sd (or start-day today))
@@ -4808,7 +5203,7 @@ NDAYS defaults to `org-agenda-ndays'."
4808 (set (make-local-variable 'include-all-loc) include-all) 5203 (set (make-local-variable 'include-all-loc) include-all)
4809 (when (and (or include-all org-agenda-include-all-todo) 5204 (when (and (or include-all org-agenda-include-all-todo)
4810 (member today day-numbers)) 5205 (member today day-numbers))
4811 (setq files (org-agenda-files) 5206 (setq files thefiles
4812 rtnall nil) 5207 rtnall nil)
4813 (while (setq file (pop files)) 5208 (while (setq file (pop files))
4814 (catch 'nextfile 5209 (catch 'nextfile
@@ -4820,7 +5215,7 @@ NDAYS defaults to `org-agenda-ndays'."
4820 (when rtnall 5215 (when rtnall
4821 (insert "ALL CURRENTLY OPEN TODO ITEMS:\n") 5216 (insert "ALL CURRENTLY OPEN TODO ITEMS:\n")
4822 (add-text-properties (point-min) (1- (point)) 5217 (add-text-properties (point-min) (1- (point))
4823 (list 'face 'org-link)) 5218 (list 'face 'org-level-3))
4824 (insert (org-finalize-agenda-entries rtnall) "\n"))) 5219 (insert (org-finalize-agenda-entries rtnall) "\n")))
4825 (while (setq d (pop day-numbers)) 5220 (while (setq d (pop day-numbers))
4826 (setq date (calendar-gregorian-from-absolute d) 5221 (setq date (calendar-gregorian-from-absolute d)
@@ -4830,7 +5225,7 @@ NDAYS defaults to `org-agenda-ndays'."
4830 (setq start-pos (point)) 5225 (setq start-pos (point))
4831 (if (and start-pos (not end-pos)) 5226 (if (and start-pos (not end-pos))
4832 (setq end-pos (point)))) 5227 (setq end-pos (point))))
4833 (setq files (org-agenda-files) 5228 (setq files thefiles
4834 rtnall nil) 5229 rtnall nil)
4835 (while (setq file (pop files)) 5230 (while (setq file (pop files))
4836 (catch 'nextfile 5231 (catch 'nextfile
@@ -4856,7 +5251,7 @@ NDAYS defaults to `org-agenda-ndays'."
4856 (calendar-month-name (extract-calendar-month date)) 5251 (calendar-month-name (extract-calendar-month date))
4857 (extract-calendar-year date))) 5252 (extract-calendar-year date)))
4858 (put-text-property s (1- (point)) 'face 5253 (put-text-property s (1- (point)) 'face
4859 'org-link) 5254 'org-level-3)
4860 (if rtnall (insert 5255 (if rtnall (insert
4861 (org-finalize-agenda-entries 5256 (org-finalize-agenda-entries
4862 (org-agenda-add-time-grid-maybe 5257 (org-agenda-add-time-grid-maybe
@@ -4927,7 +5322,7 @@ for a keyword. A numeric prefix directly selects the Nth keyword in
4927 (setq rtnall (append rtnall rtn)))) 5322 (setq rtnall (append rtnall rtn))))
4928 (insert "Global list of TODO items of type: ") 5323 (insert "Global list of TODO items of type: ")
4929 (add-text-properties (point-min) (1- (point)) 5324 (add-text-properties (point-min) (1- (point))
4930 (list 'face 'org-link)) 5325 (list 'face 'org-level-3))
4931 (setq pos (point)) 5326 (setq pos (point))
4932 (insert (or org-select-this-todo-keyword "ALL") "\n") 5327 (insert (or org-select-this-todo-keyword "ALL") "\n")
4933 (add-text-properties pos (1- (point)) (list 'face 'org-warning)) 5328 (add-text-properties pos (1- (point)) (list 'face 'org-warning))
@@ -4939,7 +5334,7 @@ for a keyword. A numeric prefix directly selects the Nth keyword in
4939 (format "(%d)%s" (setq n (1+ n)) x)) 5334 (format "(%d)%s" (setq n (1+ n)) x))
4940 org-todo-keywords " ")) 5335 org-todo-keywords " "))
4941 "\n") 5336 "\n")
4942 (add-text-properties pos (1- (point)) (list 'face 'org-link)) 5337 (add-text-properties pos (1- (point)) (list 'face 'org-level-3))
4943 (when rtnall 5338 (when rtnall
4944 (insert (org-finalize-agenda-entries rtnall) "\n")) 5339 (insert (org-finalize-agenda-entries rtnall) "\n"))
4945 (goto-char (point-min)) 5340 (goto-char (point-min))
@@ -4949,12 +5344,9 @@ for a keyword. A numeric prefix directly selects the Nth keyword in
4949 5344
4950(defun org-check-agenda-file (file) 5345(defun org-check-agenda-file (file)
4951 "Make sure FILE exists. If not, ask user what to do." 5346 "Make sure FILE exists. If not, ask user what to do."
4952 ;; FIXME: this does not correctly change the menus
4953 ;; Could probably be fixed by explicitly going to the buffer where
4954 ;; the call originated.
4955 (when (not (file-exists-p file)) 5347 (when (not (file-exists-p file))
4956 (message "non-existent file %s. [R]emove from agenda-files or [A]bort?" 5348 (message "non-existent file %s. [R]emove from list or [A]bort?"
4957 file) 5349 (abbreviate-file-name file))
4958 (let ((r (downcase (read-char-exclusive)))) 5350 (let ((r (downcase (read-char-exclusive))))
4959 (cond 5351 (cond
4960 ((equal r ?r) 5352 ((equal r ?r)
@@ -5075,12 +5467,12 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
5075 5467
5076(defun org-highlight (begin end &optional buffer) 5468(defun org-highlight (begin end &optional buffer)
5077 "Highlight a region with overlay." 5469 "Highlight a region with overlay."
5078 (funcall (if org-xemacs-p 'set-extent-endpoints 'move-overlay) 5470 (funcall (if (featurep 'xemacs) 'set-extent-endpoints 'move-overlay)
5079 org-hl begin end (or buffer (current-buffer)))) 5471 org-hl begin end (or buffer (current-buffer))))
5080 5472
5081(defun org-unhighlight () 5473(defun org-unhighlight ()
5082 "Detach overlay INDEX." 5474 "Detach overlay INDEX."
5083 (funcall (if org-xemacs-p 'detach-extent 'delete-overlay) org-hl)) 5475 (funcall (if (featurep 'xemacs) 'detach-extent 'delete-overlay) org-hl))
5084 5476
5085 5477
5086(defun org-agenda-follow-mode () 5478(defun org-agenda-follow-mode ()
@@ -5153,7 +5545,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
5153 (org-disable-agenda-to-diary t)) 5545 (org-disable-agenda-to-diary t))
5154 (save-excursion 5546 (save-excursion
5155 (save-window-excursion 5547 (save-window-excursion
5156 (list-diary-entries date 1))) 5548 (list-diary-entries date 1))) ;; Keep this name for now, compatibility
5157 (if (not (get-buffer fancy-diary-buffer)) 5549 (if (not (get-buffer fancy-diary-buffer))
5158 (setq entries nil) 5550 (setq entries nil)
5159 (with-current-buffer fancy-diary-buffer 5551 (with-current-buffer fancy-diary-buffer
@@ -5176,11 +5568,7 @@ With prefix ARG, go back that many times `org-agenda-ndays'."
5176 (lambda (x) 5568 (lambda (x)
5177 (setq x (org-format-agenda-item "" x "Diary" nil 'time)) 5569 (setq x (org-format-agenda-item "" x "Diary" nil 'time))
5178 ;; Extend the text properties to the beginning of the line 5570 ;; Extend the text properties to the beginning of the line
5179 (add-text-properties 5571 (org-add-props x (text-properties-at (1- (length x)) x)))
5180 0 (length x)
5181 (text-properties-at (1- (length x)) x)
5182 x)
5183 x)
5184 entries))))) 5572 entries)))))
5185 5573
5186(defun org-agenda-cleanup-fancy-diary () 5574(defun org-agenda-cleanup-fancy-diary ()
@@ -5219,18 +5607,13 @@ date. It also removes lines that contain only whitespace."
5219 5607
5220(defun org-modify-diary-entry-string (string) 5608(defun org-modify-diary-entry-string (string)
5221 "Add text properties to string, allowing org-mode to act on it." 5609 "Add text properties to string, allowing org-mode to act on it."
5222 (add-text-properties 5610 (org-add-props string nil
5223 0 (length string) 5611 'mouse-face 'highlight
5224 (list 'mouse-face 'highlight 5612 'keymap org-agenda-keymap
5225 'keymap org-agenda-keymap 5613 'help-echo (format "mouse-2 or RET jump to diary file %s"
5226 'help-echo 5614 (abbreviate-file-name buffer-file-name))
5227 (format 5615 'org-agenda-diary-link t
5228 "mouse-2 or RET jump to diary file %s" 5616 'org-marker (org-agenda-new-marker (point-at-bol))))
5229 (abbreviate-file-name buffer-file-name))
5230 'org-agenda-diary-link t
5231 'org-marker (org-agenda-new-marker (point-at-bol)))
5232 string)
5233 string)
5234 5617
5235(defun org-diary-default-entry () 5618(defun org-diary-default-entry ()
5236 "Add a dummy entry to the diary. 5619 "Add a dummy entry to the diary.
@@ -5247,9 +5630,10 @@ Needed to avoid empty dates which mess up holiday display."
5247If the current buffer visits an agenda file, find the next one in the list. 5630If the current buffer visits an agenda file, find the next one in the list.
5248If the current buffer does not, find the first agenda file." 5631If the current buffer does not, find the first agenda file."
5249 (interactive) 5632 (interactive)
5250 (let ((files (append org-agenda-files (list (car org-agenda-files)))) 5633 (let* ((fs (org-agenda-files t))
5251 (tcf (if buffer-file-name (file-truename buffer-file-name))) 5634 (files (append fs (list (car fs))))
5252 file) 5635 (tcf (if buffer-file-name (file-truename buffer-file-name)))
5636 file)
5253 (unless files (error "No agenda files")) 5637 (unless files (error "No agenda files"))
5254 (catch 'exit 5638 (catch 'exit
5255 (while (setq file (pop files)) 5639 (while (setq file (pop files))
@@ -5257,7 +5641,7 @@ If the current buffer does not, find the first agenda file."
5257 (when (car files) 5641 (when (car files)
5258 (find-file (car files)) 5642 (find-file (car files))
5259 (throw 'exit t)))) 5643 (throw 'exit t))))
5260 (find-file (car org-agenda-files))))) 5644 (find-file (car fs)))))
5261 5645
5262(defun org-agenda-file-to-end () 5646(defun org-agenda-file-to-end ()
5263 "Move/add the current file to the end of the agenda file list. 5647 "Move/add the current file to the end of the agenda file list.
@@ -5274,7 +5658,7 @@ end of the list."
5274 (interactive "P") 5658 (interactive "P")
5275 (let ((file-alist (mapcar (lambda (x) 5659 (let ((file-alist (mapcar (lambda (x)
5276 (cons (file-truename x) x)) 5660 (cons (file-truename x) x))
5277 org-agenda-files)) 5661 (org-agenda-files t)))
5278 (ctf (file-truename buffer-file-name)) 5662 (ctf (file-truename buffer-file-name))
5279 x had) 5663 x had)
5280 (setq x (assoc ctf file-alist) had x) 5664 (setq x (assoc ctf file-alist) had x)
@@ -5283,9 +5667,7 @@ end of the list."
5283 (if to-end 5667 (if to-end
5284 (setq file-alist (append (delq x file-alist) (list x))) 5668 (setq file-alist (append (delq x file-alist) (list x)))
5285 (setq file-alist (cons x (delq x file-alist)))) 5669 (setq file-alist (cons x (delq x file-alist))))
5286 (setq org-agenda-files (mapcar 'cdr file-alist)) 5670 (org-store-new-agenda-file-list (mapcar 'cdr file-alist))
5287 (let ((org-mode-hook nil) (default-major-mode 'fundamental-mode))
5288 (customize-save-variable 'org-agenda-files org-agenda-files))
5289 (org-install-agenda-files-menu) 5671 (org-install-agenda-files-menu)
5290 (message "File %s to %s of agenda file list" 5672 (message "File %s to %s of agenda file list"
5291 (if had "moved" "added") (if to-end "end" "front")))) 5673 (if had "moved" "added") (if to-end "end" "front"))))
@@ -5303,20 +5685,16 @@ Optional argument FILE means, use this file instead of the current."
5303 (if (equal true-file 5685 (if (equal true-file
5304 (file-truename x)) 5686 (file-truename x))
5305 nil x)) 5687 nil x))
5306 org-agenda-files)))) 5688 (org-agenda-files t)))))
5307 (if (not (= (length files) (length org-agenda-files))) 5689 (if (not (= (length files) (length (org-agenda-files t))))
5308 (progn 5690 (progn
5309 (setq org-agenda-files files) 5691 (org-store-new-agenda-file-list files)
5310 (customize-save-variable 'org-agenda-files org-agenda-files)
5311 (org-install-agenda-files-menu) 5692 (org-install-agenda-files-menu)
5312 (message "Removed file: %s" afile)) 5693 (message "Removed file: %s" afile))
5313 (message "File was not in list: %s" afile)))) 5694 (message "File was not in list: %s" afile))))
5314 5695
5315(defun org-file-menu-entry (file) 5696(defun org-file-menu-entry (file)
5316 (vector file (list 'find-file file) t)) 5697 (vector file (list 'find-file file) t))
5317;; FIXME: Maybe we removed a buffer visited through the menu from
5318;; org-agenda-new-buffers, so that the buffer will not be removed
5319;; when exiting the agenda????
5320 5698
5321(defun org-get-all-dates (beg end &optional no-ranges force-today inactive) 5699(defun org-get-all-dates (beg end &optional no-ranges force-today inactive)
5322 "Return a list of all relevant day numbers from BEG to END buffer positions. 5700 "Return a list of all relevant day numbers from BEG to END buffer positions.
@@ -5394,7 +5772,7 @@ function from a program - use `org-agenda-get-day-entries' instead."
5394 (setq args (or args '(:deadline :scheduled :timestamp))) 5772 (setq args (or args '(:deadline :scheduled :timestamp)))
5395 (let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry)) 5773 (let* ((files (if (and entry (stringp entry) (string-match "\\S-" entry))
5396 (list entry) 5774 (list entry)
5397 org-agenda-files)) 5775 (org-agenda-files t)))
5398 file rtn results) 5776 file rtn results)
5399 ;; If this is called during org-agenda, don't return any entries to 5777 ;; If this is called during org-agenda, don't return any entries to
5400 ;; the calendar. Org Agenda will list these entries itself. 5778 ;; the calendar. Org Agenda will list these entries itself.
@@ -5441,6 +5819,7 @@ the documentation of `org-diary'."
5441 (setq args (or args '(:deadline :scheduled :timestamp))) 5819 (setq args (or args '(:deadline :scheduled :timestamp)))
5442 (let* ((org-startup-with-deadline-check nil) 5820 (let* ((org-startup-with-deadline-check nil)
5443 (org-startup-folded nil) 5821 (org-startup-folded nil)
5822 (org-startup-align-all-tables nil)
5444 (buffer (if (file-exists-p file) 5823 (buffer (if (file-exists-p file)
5445 (org-get-agenda-file-buffer file) 5824 (org-get-agenda-file-buffer file)
5446 (error "No such file %s" file))) 5825 (error "No such file %s" file)))
@@ -5541,11 +5920,9 @@ the documentation of `org-diary'."
5541 (length 5920 (length
5542 (member (match-string 2) org-todo-keywords))) 5921 (member (match-string 2) org-todo-keywords)))
5543 1))) 5922 1)))
5544 (add-text-properties 5923 (org-add-props txt props
5545 0 (length txt) (append (list 'org-marker marker 'org-hd-marker marker 5924 'org-marker marker 'org-hd-marker marker
5546 'priority priority 'category category) 5925 'priority priority 'category category)
5547 props)
5548 txt)
5549 (push txt ee) 5926 (push txt ee)
5550 (goto-char (match-end 1))) 5927 (goto-char (match-end 1)))
5551 (nreverse ee))) 5928 (nreverse ee)))
@@ -5601,32 +5978,19 @@ the documentation of `org-diary'."
5601 (match-string 1) category tags timestr))) 5978 (match-string 1) category tags timestr)))
5602 (setq txt org-agenda-no-heading-message)) 5979 (setq txt org-agenda-no-heading-message))
5603 (setq priority (org-get-priority txt)) 5980 (setq priority (org-get-priority txt))
5604 (add-text-properties 5981 (org-add-props txt props
5605 0 (length txt) (append (list 'org-marker marker 5982 'org-marker marker 'org-hd-marker hdmarker)
5606 'org-hd-marker hdmarker) props)
5607 txt)
5608 (if deadlinep 5983 (if deadlinep
5609 (add-text-properties 5984 (org-add-props txt nil
5610 0 (length txt) 5985 'face (if donep 'org-done 'org-warning)
5611 (list 'face 5986 'undone-face 'org-warning 'done-face 'org-done
5612 (if donep 'org-done 'org-warning) 5987 'category category 'priority (+ 100 priority))
5613 'undone-face 'org-warning
5614 'done-face 'org-done
5615 'category category
5616 'priority (+ 100 priority))
5617 txt)
5618 (if scheduledp 5988 (if scheduledp
5619 (add-text-properties 5989 (org-add-props txt nil
5620 0 (length txt) 5990 'face 'org-scheduled-today
5621 (list 'face 'org-scheduled-today 5991 'undone-face 'org-scheduled-today 'done-face 'org-done
5622 'undone-face 'org-scheduled-today 5992 'category category 'priority (+ 99 priority))
5623 'done-face 'org-done 5993 (org-add-props txt nil 'priority priority 'category category)))
5624 'category category
5625 priority (+ 99 priority))
5626 txt)
5627 (add-text-properties
5628 0 (length txt)
5629 (list 'priority priority 'category category) txt)))
5630 (push txt ee)) 5994 (push txt ee))
5631 (outline-next-heading)))) 5995 (outline-next-heading))))
5632 (nreverse ee))) 5996 (nreverse ee)))
@@ -5673,15 +6037,10 @@ the documentation of `org-diary'."
5673 (match-string 1) category tags timestr))) 6037 (match-string 1) category tags timestr)))
5674 (setq txt org-agenda-no-heading-message)) 6038 (setq txt org-agenda-no-heading-message))
5675 (setq priority 100000) 6039 (setq priority 100000)
5676 (add-text-properties 6040 (org-add-props txt props
5677 0 (length txt) (append (list 'org-marker marker 6041 'org-marker marker 'org-hd-marker hdmarker 'face 'org-done
5678 'org-hd-marker hdmarker 6042 'priority priority 'category category
5679 'face 'org-done 6043 'undone-face 'org-warning 'done-face 'org-done)
5680 'priority priority
5681 'category category
5682 'undone-face 'org-warning
5683 'done-face 'org-done) props)
5684 txt)
5685 (push txt ee)) 6044 (push txt ee))
5686 (outline-next-heading)))) 6045 (outline-next-heading))))
5687 (nreverse ee))) 6046 (nreverse ee)))
@@ -5726,23 +6085,19 @@ the documentation of `org-diary'."
5726 (format "In %3d d.: " diff) head category tags)))) 6085 (format "In %3d d.: " diff) head category tags))))
5727 (setq txt org-agenda-no-heading-message)) 6086 (setq txt org-agenda-no-heading-message))
5728 (when txt 6087 (when txt
5729 (add-text-properties 6088 (org-add-props txt props
5730 0 (length txt) 6089 'org-marker (org-agenda-new-marker pos)
5731 (append 6090 'org-hd-marker (org-agenda-new-marker pos1)
5732 (list 'org-marker (org-agenda-new-marker pos) 6091 'priority (+ (- 10 diff) (org-get-priority txt))
5733 'org-hd-marker (org-agenda-new-marker pos1) 6092 'category category
5734 'priority (+ (- 10 diff) (org-get-priority txt)) 6093 'face (cond ((<= diff 0) 'org-warning)
5735 'category category 6094 ((<= diff 5) 'org-scheduled-previously)
5736 'face (cond ((<= diff 0) 'org-warning) 6095 (t nil))
5737 ((<= diff 5) 'org-scheduled-previously) 6096 'undone-face (cond
5738 (t nil)) 6097 ((<= diff 0) 'org-warning)
5739 'undone-face (cond 6098 ((<= diff 5) 'org-scheduled-previously)
5740 ((<= diff 0) 'org-warning) 6099 (t nil))
5741 ((<= diff 5) 'org-scheduled-previously) 6100 'done-face 'org-done)
5742 (t nil))
5743 'done-face 'org-done)
5744 props)
5745 txt)
5746 (push txt ee))))) 6101 (push txt ee)))))
5747 ee)) 6102 ee))
5748 6103
@@ -5787,13 +6142,11 @@ the documentation of `org-diary'."
5787 category tags)))) 6142 category tags))))
5788 (setq txt org-agenda-no-heading-message)) 6143 (setq txt org-agenda-no-heading-message))
5789 (when txt 6144 (when txt
5790 (add-text-properties 6145 (org-add-props txt props
5791 0 (length txt) 6146 'org-marker (org-agenda-new-marker pos)
5792 (append (list 'org-marker (org-agenda-new-marker pos) 6147 'org-hd-marker (org-agenda-new-marker pos1)
5793 'org-hd-marker (org-agenda-new-marker pos1) 6148 'priority (+ (- 5 diff) (org-get-priority txt))
5794 'priority (+ (- 5 diff) (org-get-priority txt)) 6149 'category category)
5795 'category category)
5796 props) txt)
5797 (push txt ee))))) 6150 (push txt ee)))))
5798 ee)) 6151 ee))
5799 6152
@@ -5833,13 +6186,9 @@ the documentation of `org-diary'."
5833 (match-string 1) category tags 6186 (match-string 1) category tags
5834 (if (= d0 d1) timestr)))) 6187 (if (= d0 d1) timestr))))
5835 (setq txt org-agenda-no-heading-message)) 6188 (setq txt org-agenda-no-heading-message))
5836 (add-text-properties 6189 (org-add-props txt props
5837 0 (length txt) (append (list 'org-marker marker 6190 'org-marker marker 'org-hd-marker hdmarker
5838 'org-hd-marker hdmarker 6191 'priority (org-get-priority txt) 'category category)
5839 'priority (org-get-priority txt)
5840 'category category)
5841 props)
5842 txt)
5843 (push txt ee))) 6192 (push txt ee)))
5844 (outline-next-heading)) 6193 (outline-next-heading))
5845 ;; Sort the entries by expiration date. 6194 ;; Sort the entries by expiration date.
@@ -5901,7 +6250,8 @@ only the correctly processes TXT should be returned - this is used by
5901 (file-name-sans-extension 6250 (file-name-sans-extension
5902 (file-name-nondirectory buffer-file-name)) 6251 (file-name-nondirectory buffer-file-name))
5903 ""))) 6252 "")))
5904 (tag (or (nth (1- (or (length tags) 0)) tags) "")) 6253 (tag (if tags (nth (1- (length tags)) tags) ""))
6254 ;;(tag (or (nth (1- (or (length tags) 0)) tags) "")) FIXME: rm
5905 time ;; needed for the eval of the prefix format 6255 time ;; needed for the eval of the prefix format
5906 (ts (if dotime (concat (if (stringp dotime) dotime "") txt))) 6256 (ts (if dotime (concat (if (stringp dotime) dotime "") txt)))
5907 (time-of-day (and dotime (org-get-time-of-day ts))) 6257 (time-of-day (and dotime (org-get-time-of-day ts)))
@@ -5946,14 +6296,11 @@ only the correctly processes TXT should be returned - this is used by
5946 (setq rtn (concat (eval org-prefix-format-compiled) txt))) 6296 (setq rtn (concat (eval org-prefix-format-compiled) txt)))
5947 6297
5948 ;; And finally add the text properties 6298 ;; And finally add the text properties
5949 (add-text-properties 6299 (org-add-props rtn nil
5950 0 (length rtn) (list 'category (downcase category) 6300 'category (downcase category) 'tags tags
5951 'tags tags 6301 'prefix-length (- (length rtn) (length txt))
5952 'prefix-length (- (length rtn) (length txt)) 6302 'time-of-day time-of-day
5953 'time-of-day time-of-day 6303 'dotime dotime))))
5954 'dotime dotime)
5955 rtn)
5956 rtn)))
5957 6304
5958(defun org-agenda-add-time-grid-maybe (list ndays todayp) 6305(defun org-agenda-add-time-grid-maybe (list ndays todayp)
5959 (catch 'exit 6306 (catch 'exit
@@ -5977,7 +6324,7 @@ only the correctly processes TXT should be returned - this is used by
5977 (unless (and remove (member time have)) 6324 (unless (and remove (member time have))
5978 (setq time (int-to-string time)) 6325 (setq time (int-to-string time))
5979 (push (org-format-agenda-item 6326 (push (org-format-agenda-item
5980 nil string "" nil ;; FIXME: put a category for the grid? 6327 nil string "" nil
5981 (concat (substring time 0 -2) ":" (substring time -2))) 6328 (concat (substring time 0 -2) ":" (substring time -2)))
5982 new) 6329 new)
5983 (put-text-property 6330 (put-text-property
@@ -6078,7 +6425,7 @@ HH:MM."
6078 (priority-down (if priority-up (- priority-up) nil)) 6425 (priority-down (if priority-up (- priority-up) nil))
6079 (category-up (org-cmp-category a b)) 6426 (category-up (org-cmp-category a b))
6080 (category-down (if category-up (- category-up) nil)) 6427 (category-down (if category-up (- category-up) nil))
6081 (category-keep (if category-up +1 nil))) ; FIXME +1 or -1? 6428 (category-keep (if category-up +1 nil)))
6082 (cdr (assoc 6429 (cdr (assoc
6083 (eval (cons 'or org-agenda-sorting-strategy)) 6430 (eval (cons 'or org-agenda-sorting-strategy))
6084 '((-1 . t) (1 . nil) (nil . nil)))))) 6431 '((-1 . t) (1 . nil) (nil . nil))))))
@@ -6370,7 +6717,6 @@ be used to request time specification in the time stamp."
6370 "Return the heading of the current entry, without the stars." 6717 "Return the heading of the current entry, without the stars."
6371 (save-excursion 6718 (save-excursion
6372 (and (memq (char-before) '(?\n ?\r)) (skip-chars-forward "^\n\r")) 6719 (and (memq (char-before) '(?\n ?\r)) (skip-chars-forward "^\n\r"))
6373;;FIXME???????? (and (bolp) (end-of-line 1))
6374 (if (and (re-search-backward "[\r\n]\\*" nil t) 6720 (if (and (re-search-backward "[\r\n]\\*" nil t)
6375 (looking-at "[\r\n]\\*+[ \t]+\\([^\r\n]*\\)")) 6721 (looking-at "[\r\n]\\*+[ \t]+\\([^\r\n]*\\)"))
6376 (match-string 1) 6722 (match-string 1)
@@ -6576,12 +6922,8 @@ are included in the output."
6576 category tags-list)) 6922 category tags-list))
6577 (goto-char lspos) 6923 (goto-char lspos)
6578 (setq marker (org-agenda-new-marker)) 6924 (setq marker (org-agenda-new-marker))
6579 (add-text-properties 6925 (org-add-props txt props
6580 0 (length txt) 6926 'org-marker marker 'org-hd-marker marker 'category category)
6581 (append (list 'org-marker marker 'org-hd-marker marker
6582 'category category)
6583 props)
6584 txt)
6585 (push txt rtn)) 6927 (push txt rtn))
6586 ;; if we are to skip sublevels, jump to end of subtree 6928 ;; if we are to skip sublevels, jump to end of subtree
6587 (point) 6929 (point)
@@ -6683,13 +7025,13 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
6683 (setq rtnall (append rtnall rtn)))))))) 7025 (setq rtnall (append rtnall rtn))))))))
6684 (insert "Headlines with TAGS match: ") 7026 (insert "Headlines with TAGS match: ")
6685 (add-text-properties (point-min) (1- (point)) 7027 (add-text-properties (point-min) (1- (point))
6686 (list 'face 'org-link)) 7028 (list 'face 'org-level-3))
6687 (setq pos (point)) 7029 (setq pos (point))
6688 (insert match "\n") 7030 (insert match "\n")
6689 (add-text-properties pos (1- (point)) (list 'face 'org-warning)) 7031 (add-text-properties pos (1- (point)) (list 'face 'org-warning))
6690 (setq pos (point)) 7032 (setq pos (point))
6691 (insert "Press `C-u r' to search again with new search string\n") 7033 (insert "Press `C-u r' to search again with new search string\n")
6692 (add-text-properties pos (1- (point)) (list 'face 'org-link)) 7034 (add-text-properties pos (1- (point)) (list 'face 'org-level-3))
6693 (when rtnall 7035 (when rtnall
6694 (insert (mapconcat 'identity rtnall "\n"))) 7036 (insert (mapconcat 'identity rtnall "\n")))
6695 (goto-char (point-min)) 7037 (goto-char (point-min))
@@ -6724,7 +7066,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
6724 nil nil current 'org-tags-history))) 7066 nil nil current 'org-tags-history)))
6725 (while (string-match "[-+&]+" tags) 7067 (while (string-match "[-+&]+" tags)
6726 (setq tags (replace-match ":" t t tags)))) 7068 (setq tags (replace-match ":" t t tags))))
6727 ;; FIXME: still optimize this byt not checking when JUST-ALIGN? 7069 ;; FIXME: still optimize this by not checking when JUST-ALIGN?
6728 (unless (setq empty (string-match "\\`[\t ]*\\'" tags)) 7070 (unless (setq empty (string-match "\\`[\t ]*\\'" tags))
6729 (unless (string-match ":$" tags) (setq tags (concat tags ":"))) 7071 (unless (string-match ":$" tags) (setq tags (concat tags ":")))
6730 (unless (string-match "^:" tags) (setq tags (concat ":" tags)))) 7072 (unless (string-match "^:" tags) (setq tags (concat ":" tags))))
@@ -6738,7 +7080,6 @@ With prefix ARG, realign all tags in headings in the current buffer."
6738 (setq hd (match-string 1)) 7080 (setq hd (match-string 1))
6739 (delete-region (match-beginning 0) (match-end 0)) 7081 (delete-region (match-beginning 0) (match-end 0))
6740 (insert-before-markers (org-trim hd) (if empty "" " "))) 7082 (insert-before-markers (org-trim hd) (if empty "" " ")))
6741 ;; FIXME: What happens when adding a new tag??? Seems OK!!!
6742 (unless (equal tags "") 7083 (unless (equal tags "")
6743 (move-to-column (max (current-column) 7084 (move-to-column (max (current-column)
6744 (if (> org-tags-column 0) 7085 (if (> org-tags-column 0)
@@ -6782,7 +7123,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
6782 (save-excursion 7123 (save-excursion
6783 (beginning-of-line 1) 7124 (beginning-of-line 1)
6784 (if (looking-at ".*[ \t]\\(:[A-Za-z_@0-9:]+:\\)[ \t]*\\(\r\\|$\\)") 7125 (if (looking-at ".*[ \t]\\(:[A-Za-z_@0-9:]+:\\)[ \t]*\\(\r\\|$\\)")
6785 (match-string 1) 7126 (org-match-string-no-properties 1)
6786 ""))) 7127 "")))
6787 7128
6788(defun org-get-buffer-tags () 7129(defun org-get-buffer-tags ()
@@ -6792,7 +7133,7 @@ With prefix ARG, realign all tags in headings in the current buffer."
6792 (goto-char (point-min)) 7133 (goto-char (point-min))
6793 (while (re-search-forward "[ \t]:\\([A-Za-z_@0-9:]+\\):[ \t\r\n]" nil t) 7134 (while (re-search-forward "[ \t]:\\([A-Za-z_@0-9:]+\\):[ \t\r\n]" nil t)
6794 (mapc (lambda (x) (add-to-list 'tags x)) 7135 (mapc (lambda (x) (add-to-list 'tags x))
6795 (org-split-string (match-string 1) ":")))) 7136 (org-split-string (org-match-string-no-properties 1) ":"))))
6796 (mapcar 'list tags))) 7137 (mapcar 'list tags)))
6797 7138
6798;;; Link Stuff 7139;;; Link Stuff
@@ -6829,10 +7170,10 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
6829 (looking-at org-bracket-link-regexp) 7170 (looking-at org-bracket-link-regexp)
6830 (<= (match-beginning 0) pos) 7171 (<= (match-beginning 0) pos)
6831 (>= (match-end 0) pos)) 7172 (>= (match-end 0) pos))
6832 (setq link (match-string 1)) 7173 (setq link (org-link-unescape (org-match-string-no-properties 1)))
6833 (while (string-match " *\n *" link) 7174 (while (string-match " *\n *" link)
6834 (setq link (replace-match " " t t link))) 7175 (setq link (replace-match " " t t link)))
6835 (if (string-match org-link-regexp link) 7176 (if (string-match org-link-re-with-space2 link)
6836 (setq type (match-string 1 link) 7177 (setq type (match-string 1 link)
6837 path (match-string 2 link)) 7178 path (match-string 2 link))
6838 (setq type "thisfile" 7179 (setq type "thisfile"
@@ -6849,11 +7190,12 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
6849 (throw 'match t)) 7190 (throw 'match t))
6850 7191
6851 (save-excursion 7192 (save-excursion
6852 (skip-chars-backward 7193 (skip-chars-backward (concat "^[]" org-non-link-chars " "))
6853 (concat (if org-allow-space-in-links "^" "^ ") 7194 (if (equal (char-before) ?<) (backward-char 1))
6854 org-non-link-chars)) 7195 (when (or (looking-at org-angle-link-re)
6855 (when (or (looking-at org-link-regexp) 7196 (looking-at org-plain-link-re)
6856 (and (re-search-forward org-link-regexp (point-at-eol) t) 7197 (and (or (re-search-forward org-angle-link-re (point-at-eol) t)
7198 (re-search-forward org-plain-link-re (point-at-eol) t))
6857 (<= (match-beginning 0) pos) 7199 (<= (match-beginning 0) pos)
6858 (>= (match-end 0) pos))) 7200 (>= (match-end 0) pos)))
6859 (setq type (match-string 1) 7201 (setq type (match-string 1)
@@ -6869,22 +7211,12 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
6869 (throw 'match t))) 7211 (throw 'match t)))
6870 (save-excursion 7212 (save-excursion
6871 (skip-chars-backward "a-zA-Z_") 7213 (skip-chars-backward "a-zA-Z_")
6872 (when (and org-activate-camels 7214 (when (and (memq 'camel org-activate-links)
6873 (looking-at org-camel-regexp)) 7215 (looking-at org-camel-regexp))
6874 (setq type "camel" path (match-string 0)) 7216 (setq type "camel" path (match-string 0))
6875 (if (equal (char-before) ?*) 7217 (if (equal (char-before) ?*)
6876 (setq path (concat "*" path)))) 7218 (setq path (concat "*" path))))
6877 (throw 'match t)) 7219 (throw 'match t)))
6878 (save-excursion
6879 (when (re-search-forward
6880 org-link-regexp
6881 (save-excursion
6882 (condition-case nil
6883 (progn (outline-end-of-subtree) (max pos (point)))
6884 (error (end-of-line 1) (point))))
6885 t)
6886 (setq type (match-string 1)
6887 path (match-string 2)))))
6888 (unless path 7220 (unless path
6889 (error "No link found")) 7221 (error "No link found"))
6890 ;; Remove any trailing spaces in path 7222 ;; Remove any trailing spaces in path
@@ -6894,7 +7226,6 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
6894 (cond 7226 (cond
6895 7227
6896 ((member type '("http" "https" "ftp" "mailto" "news")) 7228 ((member type '("http" "https" "ftp" "mailto" "news"))
6897 ;; give these to some browser
6898 (browse-url (concat type ":" path))) 7229 (browse-url (concat type ":" path)))
6899 7230
6900 ((string= type "tags") 7231 ((string= type "tags")
@@ -6971,7 +7302,10 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file."
6971 (while (string-match "@}" cmd) 7302 (while (string-match "@}" cmd)
6972 (setq cmd (replace-match ">" t t cmd))) 7303 (setq cmd (replace-match ">" t t cmd)))
6973 (if (or (not org-confirm-shell-links) 7304 (if (or (not org-confirm-shell-links)
6974 (yes-or-no-p (format "Execute \"%s\" in the shell? " cmd))) 7305 (funcall org-confirm-shell-links
7306 (format "Execute \"%s\" in shell? "
7307 (org-add-props cmd nil
7308 'face 'org-warning))))
6975 (shell-command cmd) 7309 (shell-command cmd)
6976 (error "Abort")))) 7310 (error "Abort"))))
6977 7311
@@ -7044,7 +7378,7 @@ in all files."
7044 (if (or (org-search-not-link re0 nil t) 7378 (if (or (org-search-not-link re0 nil t)
7045 (org-search-not-link re1 nil t) 7379 (org-search-not-link re1 nil t)
7046 (org-search-not-link re2 nil t) 7380 (org-search-not-link re2 nil t)
7047 (org-search-not-link re2a nil t) ;; FIXME: Right place??? 7381 (org-search-not-link re2a nil t)
7048 (org-search-not-link re3 nil t) 7382 (org-search-not-link re3 nil t)
7049 (org-search-not-link re4 nil t) 7383 (org-search-not-link re4 nil t)
7050 (org-search-not-link re5 nil t) 7384 (org-search-not-link re5 nil t)
@@ -7202,12 +7536,12 @@ onto the ring."
7202 (cond 7536 (cond
7203 ((featurep 'tramp) 7537 ((featurep 'tramp)
7204 ;; use tramp to access the file 7538 ;; use tramp to access the file
7205 (if org-xemacs-p 7539 (if (featurep 'xemacs)
7206 (setq folder (format "[%s@%s]%s" user host file)) 7540 (setq folder (format "[%s@%s]%s" user host file))
7207 (setq folder (format "/%s@%s:%s" user host file)))) 7541 (setq folder (format "/%s@%s:%s" user host file))))
7208 (t 7542 (t
7209 ;; use ange-ftp or efs 7543 ;; use ange-ftp or efs
7210 (require (if org-xemacs-p 'efs 'ange-ftp)) 7544 (require (if (featurep 'xemacs) 'efs 'ange-ftp))
7211 (setq folder (format "/%s@%s:%s" user host file)))))) 7545 (setq folder (format "/%s@%s:%s" user host file))))))
7212 (when folder 7546 (when folder
7213 (funcall (cdr (assq 'vm org-link-frame-setup)) folder readonly) 7547 (funcall (cdr (assq 'vm org-link-frame-setup)) folder readonly)
@@ -7360,6 +7694,28 @@ folders."
7360 (kill-this-buffer) 7694 (kill-this-buffer)
7361 (error "Message not found")))) 7695 (error "Message not found"))))
7362 7696
7697(defun org-upgrade-old-links (&optional query-description)
7698 "Transfer old <...> style links to new [[...]] style links.
7699With arg query-description, ask at each match for a description text to use
7700for this link."
7701 (interactive (list (y-or-n-p "Would you like to be queried for a description at each link?")))
7702 (save-excursion
7703 (goto-char (point-min))
7704 (let ((re (concat "\\([^[]\\)<\\("
7705 "\\(" (mapconcat 'identity org-link-types "\\|")
7706 "\\):"
7707 "[^" org-non-link-chars "]+\\)>"))
7708 l1 l2 (cnt 0))
7709 (while (re-search-forward re nil t)
7710 (setq cnt (1+ cnt)
7711 l1 (org-match-string-no-properties 2)
7712 l2 (save-match-data (org-link-escape l1)))
7713 (when query-description (setq l1 (read-string "Desc: " l1)))
7714 (if (equal l1 l2)
7715 (replace-match (concat (match-string 1) "[[" l1 "]]") t t)
7716 (replace-match (concat (match-string 1) "[[" l2 "][" l1 "]]") t t)))
7717 (message "%d matches have beed treated" cnt))))
7718
7363(defun org-open-file (path &optional in-emacs line search) 7719(defun org-open-file (path &optional in-emacs line search)
7364 "Open the file at PATH. 7720 "Open the file at PATH.
7365First, this expands any special file name abbreviations. Then the 7721First, this expands any special file name abbreviations. Then the
@@ -7409,7 +7765,7 @@ If the file does not exist, an error is thrown."
7409 (shell-command (concat cmd " &")))) 7765 (shell-command (concat cmd " &"))))
7410 ((or (stringp cmd) 7766 ((or (stringp cmd)
7411 (eq cmd 'emacs)) 7767 (eq cmd 'emacs))
7412 (unless (equal (file-truename file) (file-truename buffer-file-name)) 7768 (unless (equal (file-truename file) (file-truename (or buffer-file-name "")))
7413 (funcall (cdr (assq 'file org-link-frame-setup)) file)) 7769 (funcall (cdr (assq 'file org-link-frame-setup)) file))
7414 (if line (goto-line line) 7770 (if line (goto-line line)
7415 (if search (org-link-search search)))) 7771 (if search (org-link-search search))))
@@ -7450,7 +7806,7 @@ For some link types, a prefix arg is interpreted:
7450For links to usenet articles, arg negates `org-usenet-links-prefer-google'. 7806For links to usenet articles, arg negates `org-usenet-links-prefer-google'.
7451For file links, arg negates `org-context-in-file-links'." 7807For file links, arg negates `org-context-in-file-links'."
7452 (interactive "P") 7808 (interactive "P")
7453 (let (link cpltxt txt (pos (point))) 7809 (let (link cpltxt desc txt (pos (point)))
7454 (cond 7810 (cond
7455 7811
7456 ((eq major-mode 'bbdb-mode) 7812 ((eq major-mode 'bbdb-mode)
@@ -7486,9 +7842,7 @@ For file links, arg negates `org-context-in-file-links'."
7486 folder) 7842 folder)
7487 (setq folder (replace-match "" t t folder))) 7843 (setq folder (replace-match "" t t folder)))
7488 (setq cpltxt (concat author " on: " subject)) 7844 (setq cpltxt (concat author " on: " subject))
7489 (setq link (concat cpltxt "\n " 7845 (setq link (org-make-link "vm:" folder "#" message-id)))))
7490 (org-make-link
7491 "vm:" folder "#" message-id))))))
7492 7846
7493 ((eq major-mode 'wl-summary-mode) 7847 ((eq major-mode 'wl-summary-mode)
7494 (let* ((msgnum (wl-summary-message-number)) 7848 (let* ((msgnum (wl-summary-message-number))
@@ -7496,14 +7850,12 @@ For file links, arg negates `org-context-in-file-links'."
7496 msgnum 'message-id)) 7850 msgnum 'message-id))
7497 (wl-message-entity (elmo-msgdb-overview-get-entity 7851 (wl-message-entity (elmo-msgdb-overview-get-entity
7498 msgnum (wl-summary-buffer-msgdb))) 7852 msgnum (wl-summary-buffer-msgdb)))
7499 (author (wl-summary-line-from)) ; FIXME: how to get author name? 7853 (author (wl-summary-line-from)) ; FIXME: correct?
7500 (subject "???")) ; FIXME: How to get subject of email? 7854 (subject "???")) ; FIXME:
7501 (setq message-id (org-remove-angle-brackets message-id)) 7855 (setq message-id (org-remove-angle-brackets message-id))
7502 (setq cpltxt (concat author " on: " subject)) 7856 (setq cpltxt (concat author " on: " subject))
7503 (setq link (concat cpltxt "\n " 7857 (setq link (org-make-link "wl:" wl-summary-buffer-folder-name
7504 (org-make-link 7858 "#" message-id))))
7505 "wl:" wl-summary-buffer-folder-name
7506 "#" message-id)))))
7507 7859
7508 ((or (equal major-mode 'mh-folder-mode) 7860 ((or (equal major-mode 'mh-folder-mode)
7509 (equal major-mode 'mh-show-mode)) 7861 (equal major-mode 'mh-show-mode))
@@ -7511,11 +7863,9 @@ For file links, arg negates `org-context-in-file-links'."
7511 (to-header (org-mhe-get-header "To:")) 7863 (to-header (org-mhe-get-header "To:"))
7512 (subject (org-mhe-get-header "Subject:"))) 7864 (subject (org-mhe-get-header "Subject:")))
7513 (setq cpltxt (concat from-header " on: " subject)) 7865 (setq cpltxt (concat from-header " on: " subject))
7514 (setq link (concat cpltxt "\n " 7866 (setq link (org-make-link "mhe:" (org-mhe-get-message-real-folder) "#"
7515 (org-make-link 7867 (org-remove-angle-brackets
7516 "mhe:" (org-mhe-get-message-real-folder) "#" 7868 (org-mhe-get-header "Message-Id:"))))))
7517 (org-remove-angle-brackets
7518 (org-mhe-get-header "Message-Id:")))))))
7519 7869
7520 ((eq major-mode 'rmail-mode) 7870 ((eq major-mode 'rmail-mode)
7521 (save-excursion 7871 (save-excursion
@@ -7527,9 +7877,7 @@ For file links, arg negates `org-context-in-file-links'."
7527 (subject (mail-fetch-field "subject"))) 7877 (subject (mail-fetch-field "subject")))
7528 (setq message-id (org-remove-angle-brackets message-id)) 7878 (setq message-id (org-remove-angle-brackets message-id))
7529 (setq cpltxt (concat author " on: " subject)) 7879 (setq cpltxt (concat author " on: " subject))
7530 (setq link (concat cpltxt "\n " 7880 (setq link (org-make-link "rmail:" folder "#" message-id))))))
7531 (org-make-link
7532 "rmail:" folder "#" message-id)))))))
7533 7881
7534 ((eq major-mode 'gnus-group-mode) 7882 ((eq major-mode 'gnus-group-mode)
7535 (let ((group (cond ((fboundp 'gnus-group-group-name) ; depending on Gnus 7883 (let ((group (cond ((fboundp 'gnus-group-group-name) ; depending on Gnus
@@ -7561,10 +7909,8 @@ For file links, arg negates `org-context-in-file-links'."
7561 cpltxt "\n " 7909 cpltxt "\n "
7562 (format "http://groups.google.com/groups?as_umsgid=%s" 7910 (format "http://groups.google.com/groups?as_umsgid=%s"
7563 (org-fixup-message-id-for-http message-id)))) 7911 (org-fixup-message-id-for-http message-id))))
7564 (setq link (concat cpltxt "\n" 7912 (setq link (org-make-link "gnus:" group
7565 (org-make-link 7913 "#" (number-to-string article))))))
7566 "gnus:" group
7567 "#" (number-to-string article)))))))
7568 7914
7569 ((eq major-mode 'w3-mode) 7915 ((eq major-mode 'w3-mode)
7570 (setq cpltxt (url-view-url t) 7916 (setq cpltxt (url-view-url t)
@@ -7596,7 +7942,8 @@ For file links, arg negates `org-context-in-file-links'."
7596 (concat cpltxt "::" 7942 (concat cpltxt "::"
7597 (if org-file-link-context-use-camel-case 7943 (if org-file-link-context-use-camel-case
7598 (org-make-org-heading-camel txt) 7944 (org-make-org-heading-camel txt)
7599 (org-make-org-heading-search-string txt)))))) 7945 (org-make-org-heading-search-string txt)))
7946 desc "NONE")))
7600 (if (string-match "::\\'" cpltxt) 7947 (if (string-match "::\\'" cpltxt)
7601 (setq cpltxt (substring cpltxt 0 -2))) 7948 (setq cpltxt (substring cpltxt 0 -2)))
7602 (setq link (org-make-link cpltxt))) 7949 (setq link (org-make-link cpltxt)))
@@ -7614,7 +7961,8 @@ For file links, arg negates `org-context-in-file-links'."
7614 (concat cpltxt "::" 7961 (concat cpltxt "::"
7615 (if org-file-link-context-use-camel-case 7962 (if org-file-link-context-use-camel-case
7616 (org-make-org-heading-camel txt) 7963 (org-make-org-heading-camel txt)
7617 (org-make-org-heading-search-string txt))))) 7964 (org-make-org-heading-search-string txt)))
7965 desc "NONE"))
7618 (setq link (org-make-link cpltxt))) 7966 (setq link (org-make-link cpltxt)))
7619 7967
7620 ((interactive-p) 7968 ((interactive-p)
@@ -7622,12 +7970,17 @@ For file links, arg negates `org-context-in-file-links'."
7622 7970
7623 (t (setq link nil))) 7971 (t (setq link nil)))
7624 7972
7973 (if (consp link) (setq cpltxt (car link) link (cdr link)))
7974 (setq link (or link cpltxt)
7975 desc (or desc cpltxt))
7976 (if (equal desc "NONE") (setq desc nil))
7977
7625 (if (and (interactive-p) link) 7978 (if (and (interactive-p) link)
7626 (progn 7979 (progn
7627 (setq org-stored-links 7980 (setq org-stored-links
7628 (cons (cons (or cpltxt link) link) org-stored-links)) 7981 (cons (list cpltxt link desc) org-stored-links))
7629 (message "Stored: %s" (or cpltxt link))) 7982 (message "Stored: %s" (or cpltxt link)))
7630 link))) 7983 (org-make-link-string link desc))))
7631 7984
7632(defun org-make-org-heading-search-string (&optional string heading) 7985(defun org-make-org-heading-search-string (&optional string heading)
7633 "Make search string for STRING or current headline." 7986 "Make search string for STRING or current headline."
@@ -7675,11 +8028,52 @@ For file links, arg negates `org-context-in-file-links'."
7675 "Concatenate STRINGS, format resulting string with `org-link-format'." 8028 "Concatenate STRINGS, format resulting string with `org-link-format'."
7676 (format org-link-format (apply 'concat strings))) 8029 (format org-link-format (apply 'concat strings)))
7677 8030
7678(defun org-make-link2 (link &optional description) 8031(defun org-make-link-string (link &optional description)
7679 "Make a link with brackets." 8032 "Make a link with brackets, consisting of LINK and DESCRIPTION."
7680 (concat "[[" link "]" 8033 (if (eq org-link-style 'plain)
7681 (if description (concat "[" description "]") "") 8034 (if (equal description link)
7682 "]")) 8035 link
8036 (concat description "\n" link))
8037 (when (stringp description)
8038 ;; Remove brackets from the description, they are fatal.
8039 (while (string-match "\\[\\|\\]" description)
8040 (setq description (replace-match "" t t description))))
8041 (when (equal (org-link-escape link) description)
8042 ;; No description needed, it is identical
8043 (setq description nil))
8044 (when (and (not description)
8045 (not (equal link (org-link-escape link))))
8046 (setq description link))
8047 (concat "[[" (org-link-escape link) "]"
8048 (if description (concat "[" description "]") "")
8049 "]")))
8050
8051(defconst org-link-escape-chars '(("[" . "%5B") ("]" . "%5D") (" " . "%20"))
8052 "Association list of escapes for some characters problematic in links.")
8053
8054(defun org-link-escape (text)
8055 "Escape charaters in TEXT that are problematic for links."
8056 (when text
8057 (let ((re (mapconcat (lambda (x) (regexp-quote (car x)))
8058 org-link-escape-chars "\\|")))
8059 (while (string-match re text)
8060 (setq text
8061 (replace-match
8062 (cdr (assoc (match-string 0 text) org-link-escape-chars))
8063 t t text)))
8064 text)))
8065
8066(defun org-link-unescape (text)
8067 "Reverse the action of `org-link-escape'."
8068 (when text
8069 (let ((re (mapconcat (lambda (x) (regexp-quote (cdr x)))
8070 org-link-escape-chars "\\|")))
8071 (while (string-match re text)
8072 (setq text
8073 (replace-match
8074 (car (rassoc (match-string 0 text) org-link-escape-chars))
8075 t t text)))
8076 text)))
7683 8077
7684(defun org-xor (a b) 8078(defun org-xor (a b)
7685 "Exclusive or." 8079 "Exclusive or."
@@ -7728,6 +8122,12 @@ press RET at the prompt), the link defaults to the most recently
7728stored link. As SPC triggers completion in the minibuffer, you need to 8122stored link. As SPC triggers completion in the minibuffer, you need to
7729use M-SPC or C-q SPC to force the insertion of a space character. 8123use M-SPC or C-q SPC to force the insertion of a space character.
7730 8124
8125You will also be prompted for a description, and if one is given, it will
8126be displayed in the buffer instead of the link.
8127
8128If there is already a link at point, this command will allow you to edit link
8129and description parts.
8130
7731With a \\[universal-argument] prefix, prompts for a file to link to. The file name can be 8131With a \\[universal-argument] prefix, prompts for a file to link to. The file name can be
7732selected using completion. The path to the file will be relative to 8132selected using completion. The path to the file will be relative to
7733the current directory if the file is in the current directory or a 8133the current directory if the file is in the current directory or a
@@ -7737,68 +8137,76 @@ completed in the minibuffer (i.e. normally ~/path/to/file).
7737With two \\[universal-argument] prefixes, enforce an absolute path even if the file 8137With two \\[universal-argument] prefixes, enforce an absolute path even if the file
7738is in the current directory or below." 8138is in the current directory or below."
7739 (interactive "P") 8139 (interactive "P")
7740 (let ((link (if complete-file 8140 (let (link desc entry remove file (pos (point)))
7741 (read-file-name "File: ") 8141 (cond
7742 (completing-read 8142 ((save-excursion
7743 "Link: " org-stored-links nil nil nil 8143 (skip-chars-forward "^]\n\r")
7744 org-insert-link-history 8144 (and (re-search-backward "\\[\\[" nil t)
7745 (or (car (car org-stored-links)))))) 8145 (looking-at org-bracket-link-regexp)
7746 linktxt matched) 8146 (<= (match-beginning 0) pos)
7747 (if (or (not link) (equal link "")) 8147 (>= (match-end 0) pos)))
7748 (error "No links available")) 8148 ;; We do have a link at point, and we are going to edit it.
7749 (if complete-file 8149 (setq remove (list (match-beginning 0) (match-end 0)))
7750 (let ((pwd (file-name-as-directory (expand-file-name ".")))) 8150 (setq desc (if (match-end 3) (org-match-string-no-properties 3)))
7751 (cond 8151 (setq link (read-string "Link: "
7752 ((equal complete-file '(16)) 8152 (org-link-unescape
7753 (insert 8153 (org-match-string-no-properties 1)))))
7754 (org-make-link 8154 (complete-file
7755 "file:" (abbreviate-file-name (expand-file-name link))))) 8155 ;; Completing read for file names.
7756 ((string-match (concat "^" (regexp-quote pwd) "\\(.+\\)") 8156 (setq file (read-file-name "File: "))
7757 (expand-file-name link)) 8157 (let ((pwd (file-name-as-directory (expand-file-name "."))))
7758 (insert 8158 (cond
7759 (org-make-link 8159 ((equal complete-file '(16))
7760 "file:" (match-string 1 (expand-file-name link))))) 8160 (setq link (org-make-link
7761 (t (insert (org-make-link "file:" link))))) 8161 "file:"
7762 (setq linktxt (cdr (assoc link org-stored-links))) 8162 (abbreviate-file-name (expand-file-name file)))))
8163 ((string-match (concat "^" (regexp-quote pwd) "\\(.+\\)")
8164 (expand-file-name file))
8165 (setq link (org-make-link
8166 "file:" (match-string 1 (expand-file-name file)))))
8167 (t (setq link (org-make-link "file:" file))))))
8168 (t
8169 ;; Read link, with completion for stored links.
8170 (setq link (org-completing-read
8171 "Link: " org-stored-links nil nil nil
8172 org-insert-link-history
8173 (or (car (car org-stored-links)))))
8174 (setq entry (assoc link org-stored-links))
7763 (if (not org-keep-stored-link-after-insertion) 8175 (if (not org-keep-stored-link-after-insertion)
7764 (setq org-stored-links (delq (assoc link org-stored-links) 8176 (setq org-stored-links (delq (assoc link org-stored-links)
7765 org-stored-links))) 8177 org-stored-links)))
7766 (if (not linktxt) (setq link (org-make-link link))) 8178 (setq link (if entry (nth 1 entry) link)
7767 (setq link (or linktxt link)) 8179 desc (or desc (nth 2 entry)))))
7768 (when (string-match "<\\<file:\\(.+?\\)::\\([^>]+\\)>" link) 8180
7769 (let* ((path (match-string 1 link)) 8181 (if (string-match org-plain-link-re link)
7770 (case-fold-search nil) 8182 ;; URL-like link, normalize the use of angular brackets.
7771 (search (match-string 2 link))) 8183 (setq link (org-make-link (org-remove-angle-brackets link))))
7772 (when (save-match-data 8184
7773 (equal (file-truename buffer-file-name) 8185 ;; Check if we are linking to the current file. If yes, simplify the link.
7774 (file-truename path))) 8186 (when (string-match "\\<file:\\(.+?\\)::\\([^>]+\\)" link)
7775 ;; We are linking to this same file 8187 (let* ((path (match-string 1 link))
7776 (if (and org-file-link-context-use-camel-case 8188 (case-fold-search nil)
7777 (save-match-data 8189 (search (match-string 2 link)))
7778 (string-match (concat "^" org-camel-regexp "$") search))) 8190 (when (save-match-data
7779 (setq link (replace-match search t t link) 8191 (equal (file-truename buffer-file-name)
7780 matched t) 8192 (file-truename path)))
7781 (setq link (replace-match (concat "[[" search "]]") 8193 ;; We are linking to this same file, with a search option
7782 t t link) 8194 (setq link search))))
7783 matched t))))) 8195 (setq desc (read-string "Description: " desc))
7784 (let ((lines (org-split-string link "\n"))) 8196 (unless (string-match "\\S-" desc) (setq desc nil))
7785 (insert (car lines)) 8197 (if remove (apply 'delete-region remove))
7786 (setq matched (or matched (string-match org-link-regexp (car lines)))) 8198 (insert (org-make-link-string link desc))))
7787 (setq lines (cdr lines)) 8199
7788 (while lines 8200(defun org-completing-read (&rest args)
7789 (insert "\n") 8201 (let ((minibuffer-local-completion-map
7790 (if (save-excursion 8202 (copy-keymap minibuffer-local-completion-map)))
7791 (beginning-of-line 0) 8203 (define-key minibuffer-local-completion-map " " 'self-insert-command)
7792 (looking-at "[ \t]+\\S-")) 8204 (apply 'completing-read args)))
7793 (indent-relative))
7794 (setq matched (or matched
7795 (string-match org-link-regexp (car lines))))
7796 (insert (car lines))
7797 (setq lines (cdr lines))))
7798 (unless matched
7799 (error "Add link type: http(s),ftp,mailto,file,news,bbdb,vm,wl,rmail,gnus, or shell")))))
7800 8205
7801;;; Hooks for remember.el 8206;;; Hooks for remember.el
8207
8208(defvar org-finish-function nil)
8209
7802;;;###autoload 8210;;;###autoload
7803(defun org-remember-annotation () 8211(defun org-remember-annotation ()
7804 "Return a link to the current location as an annotation for remember.el. 8212 "Return a link to the current location as an annotation for remember.el.
@@ -7815,6 +8223,51 @@ RET on headline -> Store as sublevel entry to current headline
7815<left>/<right> -> before/after current headline, same headings level") 8223<left>/<right> -> before/after current headline, same headings level")
7816 8224
7817;;;###autoload 8225;;;###autoload
8226(defun org-remember-apply-template ()
8227 "Initialize *remember* buffer with template, invode `org-mode'.
8228This function should be placed into `remember-mode-hook' and in fact requires
8229to be run from that hook to fucntion properly."
8230 (when org-remember-templates
8231 (let* ((entry (if (= (length org-remember-templates) 1)
8232 (cdar org-remember-templates)
8233 (message "Select template: %s"
8234 (mapconcat
8235 (lambda (x) (char-to-string (car x)))
8236 org-remember-templates " "))
8237 (cdr (assoc (read-char-exclusive) org-remember-templates))))
8238 (tpl (if (consp (cdr entry)) (cadr entry) (cdr entry)))
8239 (file (if (consp (cdr entry)) (nth 2 entry)))
8240 (v-t (format-time-string (car org-time-stamp-formats) (org-current-time)))
8241 (v-T (format-time-string (cdr org-time-stamp-formats) (org-current-time)))
8242 (v-u (concat "[" (substring v-t 1 -1) "]"))
8243 (v-U (concat "[" (substring v-T 1 -1) "]"))
8244 (v-a annotation) ; defined in `remember-mode'
8245 (v-i initial) ; defined in `remember-mode'
8246 (v-n user-full-name)
8247 )
8248 (unless tpl (setq tpl "") (message "No template") (ding))
8249 (insert tpl) (goto-char (point-min))
8250 (while (re-search-forward "%\\([tTuTai]\\)" nil t)
8251 (when (and initial (equal (match-string 0) "%i"))
8252 (save-match-data
8253 (let* ((lead (buffer-substring
8254 (point-at-bol) (match-beginning 0))))
8255 (setq v-i (mapconcat 'identity
8256 (org-split-string initial "\n")
8257 (concat "\n" lead))))))
8258 (replace-match
8259 (or (eval (intern (concat "v-" (match-string 1)))) "")
8260 t t))
8261 (let ((org-startup-folded nil)
8262 (org-startup-with-deadline-check nil))
8263 (org-mode))
8264 (if (and file (string-match "\\S-" file) (not (file-directory-p file)))
8265 (set (make-local-variable 'org-default-notes-file) file))
8266 (goto-char (point-min))
8267 (if (re-search-forward "%\\?" nil t) (replace-match ""))
8268 (set (make-local-variable 'org-finish-function) 'remember-buffer))))
8269
8270;;;###autoload
7818(defun org-remember-handler () 8271(defun org-remember-handler ()
7819 "Store stuff from remember.el into an org file. 8272 "Store stuff from remember.el into an org file.
7820First prompts for an org file. If the user just presses return, the value 8273First prompts for an org file. If the user just presses return, the value
@@ -7855,22 +8308,25 @@ See also the variable `org-reverse-note-order'."
7855 (visiting (find-buffer-visiting file)) 8308 (visiting (find-buffer-visiting file))
7856 (org-startup-with-deadline-check nil) 8309 (org-startup-with-deadline-check nil)
7857 (org-startup-folded nil) 8310 (org-startup-folded nil)
8311 (org-startup-align-all-tables nil)
7858 spos level indent reversed) 8312 spos level indent reversed)
7859 ;; Modify text so that it becomes a nice subtree which can be inserted 8313 ;; Modify text so that it becomes a nice subtree which can be inserted
7860 ;; into an org tree. 8314 ;; into an org tree.
7861 (let* ((lines (split-string txt "\n")) 8315 (let* ((lines (split-string txt "\n"))
7862 (first (car lines)) 8316 first)
7863 (lines (cdr lines))) 8317 ;; remove empty lines at the beginning
8318 (while (and lines (string-match "^[ \t]*\n" (car lines)))
8319 (setq lines (cdr lines)))
8320 (setq first (car lines) lines (cdr lines))
7864 (if (string-match "^\\*+" first) 8321 (if (string-match "^\\*+" first)
7865 ;; Is already a headline 8322 ;; Is already a headline
7866 (setq indent (make-string (- (match-end 0) (match-beginning 0) 8323 (setq indent nil)
7867 -1) ?\ ))
7868 ;; We need to add a headline: Use time and first buffer line 8324 ;; We need to add a headline: Use time and first buffer line
7869 (setq lines (cons first lines) 8325 (setq lines (cons first lines)
7870 first (concat "* " (current-time-string) 8326 first (concat "* " (current-time-string)
7871 " (" (remember-buffer-desc) ")") 8327 " (" (remember-buffer-desc) ")")
7872 indent " ")) 8328 indent " "))
7873 (if org-adapt-indentation 8329 (if (and org-adapt-indentation indent)
7874 (setq lines (mapcar (lambda (x) (concat indent x)) lines))) 8330 (setq lines (mapcar (lambda (x) (concat indent x)) lines)))
7875 (setq txt (concat first "\n" 8331 (setq txt (concat first "\n"
7876 (mapconcat 'identity lines "\n")))) 8332 (mapconcat 'identity lines "\n"))))
@@ -7895,7 +8351,7 @@ See also the variable `org-reverse-note-order'."
7895 (widen) 8351 (widen)
7896 (goto-char (if reversed (point-min) (point-max))) 8352 (goto-char (if reversed (point-min) (point-max)))
7897 (if (not (bolp)) (newline)) 8353 (if (not (bolp)) (newline))
7898 (org-paste-subtree (or current-prefix-arg 2) txt))) 8354 (org-paste-subtree 2 txt)))
7899 ((and (org-on-heading-p nil) (not current-prefix-arg)) 8355 ((and (org-on-heading-p nil) (not current-prefix-arg))
7900 ;; Put it below this entry, at the beg/end of the subtree 8356 ;; Put it below this entry, at the beg/end of the subtree
7901 (org-back-to-heading) 8357 (org-back-to-heading)
@@ -7987,6 +8443,15 @@ and table.el tables."
7987 (org-table-convert))) 8443 (org-table-convert)))
7988 (t (call-interactively 'table-insert)))) 8444 (t (call-interactively 'table-insert))))
7989 8445
8446(defun org-table-create-or-convert-from-region (arg)
8447 "Convert region to table, or create an empty table.
8448If there is an active region, convert it to a table. If there is no such
8449region, create an empty table."
8450 (interactive "P")
8451 (if (org-region-active-p)
8452 (org-table-convert-region (region-beginning) (region-end) arg)
8453 (org-table-create arg)))
8454
7990(defun org-table-create (&optional size) 8455(defun org-table-create (&optional size)
7991 "Query for a size and insert a table skeleton. 8456 "Query for a size and insert a table skeleton.
7992SIZE is a string Columns x Rows like for example \"3x2\"." 8457SIZE is a string Columns x Rows like for example \"3x2\"."
@@ -8019,12 +8484,13 @@ SIZE is a string Columns x Rows like for example \"3x2\"."
8019 (goto-char pos))) 8484 (goto-char pos)))
8020 (org-table-align))) 8485 (org-table-align)))
8021 8486
8022(defun org-table-convert-region (beg0 end0 nspace) 8487(defun org-table-convert-region (beg0 end0 &optional nspace)
8023 "Convert region to a table. 8488 "Convert region to a table.
8024The region goes from BEG0 to END0, but these borders will be moved 8489The region goes from BEG0 to END0, but these borders will be moved
8025slightly, to make sure a beginning of line in the first line is included. 8490slightly, to make sure a beginning of line in the first line is included.
8026When NSPACE is non-nil, it indicates the minimum number of spaces that 8491When NSPACE is non-nil, it indicates the minimum number of spaces that
8027separate columns (default: just one space)." 8492separate columns (default: just one space)."
8493 (interactive "rP")
8028 (let* ((beg (min beg0 end0)) 8494 (let* ((beg (min beg0 end0))
8029 (end (max beg0 end0)) 8495 (end (max beg0 end0))
8030 (tabsep t) 8496 (tabsep t)
@@ -8110,17 +8576,17 @@ Used to check if cursor still is in that table, to minimize realignment.")
8110(defvar org-table-last-alignment nil 8576(defvar org-table-last-alignment nil
8111 "List of flags for flushright alignment, from the last re-alignment. 8577 "List of flags for flushright alignment, from the last re-alignment.
8112This is being used to correctly align a single field after TAB or RET.") 8578This is being used to correctly align a single field after TAB or RET.")
8113;; FIXME: The following is currently not used.
8114(defvar org-table-last-column-widths nil 8579(defvar org-table-last-column-widths nil
8115 "List of max width of fields in each column. 8580 "List of max width of fields in each column.
8116This is being used to correctly align a single field after TAB or RET.") 8581This is being used to correctly align a single field after TAB or RET.")
8117 8582
8118(defvar org-last-recalc-line nil) 8583(defvar org-last-recalc-line nil)
8584(defconst org-narrow-column-arrow "=>"
8585 "Used as display property in narrowed table columns.")
8119 8586
8120(defun org-table-align () 8587(defun org-table-align ()
8121 "Align the table at point by aligning all vertical bars." 8588 "Align the table at point by aligning all vertical bars."
8122 (interactive) 8589 (interactive)
8123 ;; (message "align") (sit-for 2)
8124 (let* ( 8590 (let* (
8125 ;; Limits of table 8591 ;; Limits of table
8126 (beg (org-table-begin)) 8592 (beg (org-table-begin))
@@ -8133,25 +8599,33 @@ This is being used to correctly align a single field after TAB or RET.")
8133 column 8599 column
8134 (indent "") cnt frac 8600 (indent "") cnt frac
8135 rfmt hfmt 8601 rfmt hfmt
8136 (spaces (if (org-in-invisibility-spec-p '(org-table)) 8602 (spaces '(1 . 1))
8137 org-table-spaces-around-invisible-separators
8138 org-table-spaces-around-separators))
8139 (sp1 (car spaces)) 8603 (sp1 (car spaces))
8140 (sp2 (cdr spaces)) 8604 (sp2 (cdr spaces))
8141 (rfmt1 (concat 8605 (rfmt1 (concat
8142 (make-string sp2 ?\ ) "%%%s%ds" (make-string sp1 ?\ ) "|")) 8606 (make-string sp2 ?\ ) "%%%s%ds" (make-string sp1 ?\ ) "|"))
8143 (hfmt1 (concat 8607 (hfmt1 (concat
8144 (make-string sp2 ?-) "%s" (make-string sp1 ?-) "+")) 8608 (make-string sp2 ?-) "%s" (make-string sp1 ?-) "+"))
8145 emptystrings) 8609 emptystrings xx links narrow fmax fmin f1 len c e)
8146 (untabify beg end) 8610 (untabify beg end)
8147 ;; (message "Aligning table...") 8611 (remove-text-properties beg end '(org-cwidth t display t))
8612 ;; Check if we have links
8613 (goto-char beg)
8614 (setq links (re-search-forward org-bracket-link-regexp end t))
8615 ;; Make sure the link properties are right FIXME: Can this be optimized????
8616 (when links (goto-char beg) (while (org-activate-bracket-links end)))
8617 ;; Check if we are narrowing any columns
8618 (goto-char beg)
8619 (setq narrow (and org-format-transports-properties-p
8620 (re-search-forward "<[0-9]+>" end t)))
8148 ;; Get the rows 8621 ;; Get the rows
8149 (setq lines (org-split-string 8622 (setq lines (org-split-string
8150 (buffer-substring-no-properties beg end) "\n")) 8623 (buffer-substring beg end) "\n"))
8151 ;; Store the indentation of the first line 8624 ;; Store the indentation of the first line
8152 (if (string-match "^ *" (car lines)) 8625 (if (string-match "^ *" (car lines))
8153 (setq indent (make-string (- (match-end 0) (match-beginning 0)) ?\ ))) 8626 (setq indent (make-string (- (match-end 0) (match-beginning 0)) ?\ )))
8154 ;; Mark the hlines 8627 ;; Mark the hlines by setting the corresponding element to nil
8628 ;; At the same time, we remove trailing space.
8155 (setq lines (mapcar (lambda (l) 8629 (setq lines (mapcar (lambda (l)
8156 (if (string-match "^ *|-" l) 8630 (if (string-match "^ *|-" l)
8157 nil 8631 nil
@@ -8159,7 +8633,7 @@ This is being used to correctly align a single field after TAB or RET.")
8159 (substring l 0 (match-beginning 0)) 8633 (substring l 0 (match-beginning 0))
8160 l))) 8634 l)))
8161 lines)) 8635 lines))
8162 ;; Get the data fields 8636 ;; Get the data fields by splitting the lines.
8163 (setq fields (mapcar 8637 (setq fields (mapcar
8164 (lambda (l) 8638 (lambda (l)
8165 (org-split-string l " *| *")) 8639 (org-split-string l " *| *"))
@@ -8173,28 +8647,62 @@ This is being used to correctly align a single field after TAB or RET.")
8173 (error "Empty table - created default table"))) 8647 (error "Empty table - created default table")))
8174 ;; A list of empty string to fill any short rows on output 8648 ;; A list of empty string to fill any short rows on output
8175 (setq emptystrings (make-list maxfields "")) 8649 (setq emptystrings (make-list maxfields ""))
8176 ;; Get the maximum length of a field and the most common datatype 8650 ;; Check for special formatting.
8177 ;; for each column
8178 (setq i -1) 8651 (setq i -1)
8179 (while (< (setq i (1+ i)) maxfields) ;; Loop over all columns 8652 (while (< (setq i (1+ i)) maxfields) ;; Loop over all columns
8180 (setq column (mapcar (lambda (x) (or (nth i x) "")) fields)) 8653 (setq column (mapcar (lambda (x) (or (nth i x) "")) fields))
8181 ;; maximum length 8654 ;; Check if there is an explicit width specified
8182 (push (apply 'max 1 (mapcar 'string-width column)) lengths) 8655 (when (and org-table-limit-column-width narrow)
8183 ;; compute the fraction stepwise, ignoring empty fields 8656 (setq c column fmax nil)
8657 (while c
8658 (setq e (pop c))
8659 (if (and (stringp e) (string-match "^<\\([0-9]+\\)>$" e))
8660 (setq fmax (string-to-number (match-string 1 e)) c nil)))
8661 ;; Find fields that are wider than fmax, and shorten them
8662 (when fmax
8663 (loop for xx in column do
8664 (when (and (stringp xx)
8665 (> (org-string-width xx) fmax))
8666 (org-add-props xx nil
8667 'help-echo
8668 (concat "Clipped table field, use C-c ` to edit. Full value is:\n" (copy-sequence xx)))
8669 (setq f1 (min fmax (or (string-match org-bracket-link-regexp xx) fmax)))
8670 (unless (> f1 1)
8671 (error "Cannot narrow field starting with wide link \"%s\""
8672 (match-string 0 xx)))
8673 (add-text-properties f1 (length xx) (list 'org-cwidth t) xx)
8674 (add-text-properties (- f1 2) f1
8675 (list 'display org-narrow-column-arrow)
8676 xx)))))
8677 ;; Get the maximum width for each column
8678 (push (apply 'max 1 (mapcar 'org-string-width column)) lengths)
8679 ;; Get the fraction of numbers, to decide about alignment of the column
8184 (setq cnt 0 frac 0.0) 8680 (setq cnt 0 frac 0.0)
8185 (mapcar 8681 (loop for x in column do
8186 (lambda (x) 8682 (if (equal x "")
8187 (if (equal x "") 8683 nil
8188 nil 8684 (setq frac ( / (+ (* frac cnt)
8189 (setq frac ( / (+ (* frac cnt) 8685 (if (string-match org-table-number-regexp x) 1 0))
8190 (if (string-match org-table-number-regexp x) 1 0)) 8686 (setq cnt (1+ cnt))))))
8191 (setq cnt (1+ cnt))))))
8192 column)
8193 (push (>= frac org-table-number-fraction) typenums)) 8687 (push (>= frac org-table-number-fraction) typenums))
8194 (setq lengths (nreverse lengths) 8688 (setq lengths (nreverse lengths) typenums (nreverse typenums))
8195 typenums (nreverse typenums)) 8689
8690 ;; Store the alignment of this table, for later editing of single fields
8196 (setq org-table-last-alignment typenums 8691 (setq org-table-last-alignment typenums
8197 org-table-last-column-widths lengths) 8692 org-table-last-column-widths lengths)
8693
8694 ;; With invisible characters, `format' does not get the field width right
8695 ;; So we need to make these fields wide by hand.
8696 (when links
8697 (loop for i from 0 upto (1- maxfields) do
8698 (setq len (nth i lengths))
8699 (loop for j from 0 upto (1- (length fields)) do
8700 (setq c (nthcdr i (car (nthcdr j fields))))
8701 (if (and (stringp (car c))
8702 (string-match org-bracket-link-regexp (car c))
8703 (< (org-string-width (car c)) len))
8704 (setcar c (concat (car c) (make-string (- len (org-string-width (car c))) ?\ )))))))
8705
8198 ;; Compute the formats needed for output of the table 8706 ;; Compute the formats needed for output of the table
8199 (setq rfmt (concat indent "|") hfmt (concat indent "|")) 8707 (setq rfmt (concat indent "|") hfmt (concat indent "|"))
8200 (while (setq l (pop lengths)) 8708 (while (setq l (pop lengths))
@@ -8203,13 +8711,7 @@ This is being used to correctly align a single field after TAB or RET.")
8203 hfmt (concat hfmt (format hfmt1 (make-string l ?-))))) 8711 hfmt (concat hfmt (format hfmt1 (make-string l ?-)))))
8204 (setq rfmt (concat rfmt "\n") 8712 (setq rfmt (concat rfmt "\n")
8205 hfmt (concat (substring hfmt 0 -1) "|\n")) 8713 hfmt (concat (substring hfmt 0 -1) "|\n"))
8206 ;; Produce the new table 8714
8207 ;;(while lines
8208 ;; (setq l (pop lines))
8209 ;; (if l
8210 ;; (setq new (concat new (apply 'format rfmt
8211 ;; (append (pop fields) emptystrings))))
8212 ;; (setq new (concat new hfmt))))
8213 (setq new (mapconcat 8715 (setq new (mapconcat
8214 (lambda (l) 8716 (lambda (l)
8215 (if l (apply 'format rfmt 8717 (if l (apply 'format rfmt
@@ -8222,15 +8724,35 @@ This is being used to correctly align a single field after TAB or RET.")
8222 (move-marker org-table-aligned-begin-marker (point)) 8724 (move-marker org-table-aligned-begin-marker (point))
8223 (insert new) 8725 (insert new)
8224 (move-marker org-table-aligned-end-marker (point)) 8726 (move-marker org-table-aligned-end-marker (point))
8727 (when (and orgtbl-mode (not (eq major-mode 'org-mode)))
8728 (goto-char org-table-aligned-begin-marker)
8729 (while (org-hide-wide-columns org-table-aligned-end-marker)))
8225 ;; Try to move to the old location (approximately) 8730 ;; Try to move to the old location (approximately)
8226 (goto-line linepos) 8731 (goto-line linepos)
8227 (set-window-start (selected-window) winstart 'noforce) 8732 (set-window-start (selected-window) winstart 'noforce)
8228 (org-table-goto-column colpos) 8733 (org-table-goto-column colpos)
8229 (setq org-table-may-need-update nil) 8734 (setq org-table-may-need-update nil)
8230 (if (org-in-invisibility-spec-p '(org-table))
8231 (org-table-add-invisible-to-vertical-lines))
8232 )) 8735 ))
8233 8736
8737(defun org-string-width (s)
8738 "Compute width of string, ignoring invisible characters.
8739This ignores character with invisibility property `org-link', and also
8740characters with property `org-cwidth', because these will become invisible
8741upon the next fontification round."
8742 (let (b)
8743 (when (or (eq t buffer-invisibility-spec)
8744 (assq 'org-link buffer-invisibility-spec))
8745 (while (setq b (text-property-any 0 (length s)
8746 'invisible 'org-link s))
8747 (setq s (concat (substring s 0 b)
8748 (substring s (or (next-single-property-change
8749 b 'invisible s) (length s)))))))
8750 (while (setq b (text-property-any 0 (length s) 'org-cwidth t s))
8751 (setq s (concat (substring s 0 b)
8752 (substring s (or (next-single-property-change
8753 b 'org-cwidth s) (length s))))))
8754 (string-width s)))
8755
8234(defun org-table-begin (&optional table-type) 8756(defun org-table-begin (&optional table-type)
8235 "Find the beginning of the table and return its position. 8757 "Find the beginning of the table and return its position.
8236With argument TABLE-TYPE, go to the beginning of a table.el-type table." 8758With argument TABLE-TYPE, go to the beginning of a table.el-type table."
@@ -8261,10 +8783,7 @@ With argument TABLE-TYPE, go to the end of a table.el-type table."
8261Optional argument NEW may specify text to replace the current field content." 8783Optional argument NEW may specify text to replace the current field content."
8262 (cond 8784 (cond
8263 ((and (not new) org-table-may-need-update)) ; Realignment will happen anyway 8785 ((and (not new) org-table-may-need-update)) ; Realignment will happen anyway
8264 ((org-at-table-hline-p) 8786 ((org-at-table-hline-p))
8265 ;; FIXME: I used to enforce realign here, but I think this is not needed.
8266 ;; (setq org-table-may-need-update t)
8267 )
8268 ((and (not new) 8787 ((and (not new)
8269 (or (not (equal (marker-buffer org-table-aligned-begin-marker) 8788 (or (not (equal (marker-buffer org-table-aligned-begin-marker)
8270 (current-buffer))) 8789 (current-buffer)))
@@ -8275,7 +8794,7 @@ Optional argument NEW may specify text to replace the current field content."
8275 (t ;; realign the current field, based on previous full realign 8794 (t ;; realign the current field, based on previous full realign
8276 (let* ((pos (point)) s 8795 (let* ((pos (point)) s
8277 (col (org-table-current-column)) 8796 (col (org-table-current-column))
8278 (num (nth (1- col) org-table-last-alignment)) 8797 (num (if (> col 0) (nth (1- col) org-table-last-alignment)))
8279 l f n o e) 8798 l f n o e)
8280 (when (> col 0) 8799 (when (> col 0)
8281 (skip-chars-backward "^|\n") 8800 (skip-chars-backward "^|\n")
@@ -8435,7 +8954,7 @@ This actually throws an error, so it aborts the current command."
8435 (if (looking-at "|[^|\n]+") 8954 (if (looking-at "|[^|\n]+")
8436 (let* ((pos (match-beginning 0)) 8955 (let* ((pos (match-beginning 0))
8437 (match (match-string 0)) 8956 (match (match-string 0))
8438 (len (string-width match))) 8957 (len (org-string-width match)))
8439 (replace-match (concat "|" (make-string (1- len) ?\ ))) 8958 (replace-match (concat "|" (make-string (1- len) ?\ )))
8440 (goto-char (+ 2 pos)) 8959 (goto-char (+ 2 pos))
8441 (substring match 1))))) 8960 (substring match 1)))))
@@ -8693,21 +9212,13 @@ With prefix ARG, insert below the current line."
8693 (interactive "P") 9212 (interactive "P")
8694 (if (not (org-at-table-p)) 9213 (if (not (org-at-table-p))
8695 (error "Not at a table")) 9214 (error "Not at a table"))
8696 (let* ((line 9215 (let* ((line (buffer-substring (point-at-bol) (point-at-eol)))
8697 (org-expand-wide-chars 9216 (new (org-table-clean-line line)))
8698 (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
8699 new)
8700 (if (string-match "^[ \t]*|-" line)
8701 (setq new (mapcar (lambda (x) (if (member x '(?| ?+)) ?| ?\ )) line))
8702 (setq new (mapcar (lambda (x) (if (equal x ?|) ?| ?\ )) line)))
8703 ;; Fix the first field if necessary 9217 ;; Fix the first field if necessary
8704 (setq new (concat new))
8705 (if (string-match "^[ \t]*| *[#$] *|" line) 9218 (if (string-match "^[ \t]*| *[#$] *|" line)
8706 (setq new (replace-match (match-string 0 line) t t new))) 9219 (setq new (replace-match (match-string 0 line) t t new)))
8707 (beginning-of-line (if arg 2 1)) 9220 (beginning-of-line (if arg 2 1))
8708 (let (org-table-may-need-update) 9221 (let (org-table-may-need-update) (insert-before-markers new "\n"))
8709 (insert-before-markers new)
8710 (insert-before-markers "\n"))
8711 (beginning-of-line 0) 9222 (beginning-of-line 0)
8712 (re-search-forward "| ?" (point-at-eol) t) 9223 (re-search-forward "| ?" (point-at-eol) t)
8713 (and org-table-may-need-update (org-table-align)))) 9224 (and org-table-may-need-update (org-table-align))))
@@ -8718,39 +9229,31 @@ With prefix ARG, insert above the current line."
8718 (interactive "P") 9229 (interactive "P")
8719 (if (not (org-at-table-p)) 9230 (if (not (org-at-table-p))
8720 (error "Not at a table")) 9231 (error "Not at a table"))
8721 (let ((line 9232 (let ((line (org-table-clean-line
8722 (org-expand-wide-chars 9233 (buffer-substring (point-at-bol) (point-at-eol))))
8723 (buffer-substring-no-properties (point-at-bol) (point-at-eol)))) 9234 (col (current-column)))
8724 (col (current-column)) 9235 (while (string-match "|\\( +\\)|" line)
8725 start) 9236 (setq line (replace-match
8726 (if (string-match "^[ \t]*|-" line) 9237 (concat "+" (make-string (- (match-end 1) (match-beginning 1))
8727 (setq line 9238 ?-) "|") t t line)))
8728 (mapcar (lambda (x) (if (member x '(?| ?+)) 9239 (and (string-match "\\+" line) (setq line (replace-match "|" t t line)))
8729 (prog1 (if start ?+ ?|) (setq start t))
8730 (if start ?- ?\ )))
8731 line))
8732 (setq line
8733 (mapcar (lambda (x) (if (equal x ?|)
8734 (prog1 (if start ?+ ?|) (setq start t))
8735 (if start ?- ?\ )))
8736 line)))
8737 (beginning-of-line (if arg 1 2)) 9240 (beginning-of-line (if arg 1 2))
8738 (apply 'insert line) 9241 (insert line "\n")
8739 (if (equal (char-before (point)) ?+)
8740 (progn (backward-delete-char 1) (insert "|")))
8741 (insert "\n")
8742 (beginning-of-line (if arg 1 -1)) 9242 (beginning-of-line (if arg 1 -1))
8743 (move-to-column col))) 9243 (move-to-column col)))
8744 9244
8745(defun org-expand-wide-chars (s) 9245(defun org-table-clean-line (s)
8746 "Expand wide characters to spaces." 9246 "Convert a table line S into a string with only \"|\" and space.
8747 (let (w a) 9247In particular, this does handle wide and invisible characters."
8748 (mapconcat 9248 (if (string-match "^[ \t]*|-" s)
8749 (lambda (x) 9249 ;; It's a hline, just map the characters
8750 (if (> (setq w (string-width (setq a (char-to-string x)))) 1) 9250 (setq s (mapcar (lambda (x) (if (member x '(?| ?+)) ?| ?\ )) s))
8751 (make-string w ?\ ) 9251 (while (string-match "|\\([ \t]*?[^ \t\r\n|][^\r\n|]*\\)|" s)
8752 a)) 9252 (setq s (replace-match
8753 s ""))) 9253 (concat "|" (make-string (org-string-width (match-string 1 s))
9254 ?\ ) "|")
9255 t t s)))
9256 s))
8754 9257
8755(defun org-table-kill-row () 9258(defun org-table-kill-row ()
8756 "Delete the current row or horizontal line from the table." 9259 "Delete the current row or horizontal line from the table."
@@ -8982,6 +9485,64 @@ blank, and the content is appended to the field above."
8982 (insert (org-trim s) " ") 9485 (insert (org-trim s) " ")
8983 (org-table-align)))))) 9486 (org-table-align))))))
8984 9487
9488(defvar org-field-marker nil)
9489
9490(defun org-table-edit-field (arg)
9491 "Edit table field in a different window.
9492This is mainly useful for fields that contain hidden parts.
9493When called with a \\[universal-argument] prefix, just make the full field visible so that
9494it can be edited in place."
9495 (interactive "P")
9496 (if arg
9497 (let ((b (save-excursion (skip-chars-backward "^|") (point)))
9498 (e (save-excursion (skip-chars-forward "^|\r\n") (point))))
9499 (remove-text-properties b e '(org-cwidth t invisible t
9500 display t intangible t))
9501 (if (and (boundp 'font-lock-mode) font-lock-mode)
9502 (font-lock-fontify-block)))
9503 (let ((pos (move-marker (make-marker) (point)))
9504 (field (org-table-get-field))
9505 (cw (current-window-configuration))
9506 p)
9507 (switch-to-buffer-other-window "*Org tmp*")
9508 (erase-buffer)
9509 (insert "#\n# Edit field and finish with C-c C-c\n#\n")
9510 (org-mode)
9511 (goto-char (setq p (point-max)))
9512 (insert (org-trim field))
9513 (remove-text-properties p (point-max)
9514 '(invisible t org-cwidth t display t
9515 intangible t))
9516 (goto-char p)
9517 (set (make-local-variable 'org-finish-function)
9518 'org-table-finish-edit-field)
9519 (set (make-local-variable 'org-window-configuration) cw)
9520 (set (make-local-variable 'org-field-marker) pos)
9521 (message "Edit and finish with C-c C-c"))))
9522
9523(defun org-table-finish-edit-field ()
9524 "Finish editing a table data field.
9525Remove all newline characters, insert the result into the table, realign
9526the table and kill the editing buffer."
9527 (let ((pos org-field-marker)
9528 (cw org-window-configuration)
9529 (cb (current-buffer))
9530 text)
9531 (goto-char (point-min))
9532 (while (re-search-forward "^#.*\n?" nil t) (replace-match ""))
9533 (while (re-search-forward "\\([ \t]*\n[ \t]*\\)+" nil t)
9534 (replace-match " "))
9535 (setq text (org-trim (buffer-string)))
9536 (set-window-configuration cw)
9537 (kill-buffer cb)
9538 (select-window (get-buffer-window (marker-buffer pos)))
9539 (goto-char pos)
9540 (move-marker pos nil)
9541 (org-table-check-inside-data-field)
9542 (org-table-get-field nil text)
9543 (org-table-align)
9544 (message "New field value inserted")))
9545
8985(defun org-trim (s) 9546(defun org-trim (s)
8986 "Remove whitespace at beginning and end of string." 9547 "Remove whitespace at beginning and end of string."
8987 (if (string-match "^[ \t]+" s) (setq s (replace-match "" t t s))) 9548 (if (string-match "^[ \t]+" s) (setq s (replace-match "" t t s)))
@@ -8997,7 +9558,7 @@ IF WIDTH is nil and LINES is non-nil, the string is forced into at most that
8997many lines, whatever width that takes. 9558many lines, whatever width that takes.
8998The return value is a list of lines, without newlines at the end." 9559The return value is a list of lines, without newlines at the end."
8999 (let* ((words (org-split-string string "[ \t\n]+")) 9560 (let* ((words (org-split-string string "[ \t\n]+"))
9000 (maxword (apply 'max (mapcar 'string-width words))) 9561 (maxword (apply 'max (mapcar 'org-string-width words)))
9001 w ll) 9562 w ll)
9002 (cond (width 9563 (cond (width
9003 (org-do-wrap words (max maxword width))) 9564 (org-do-wrap words (max maxword width)))
@@ -9024,7 +9585,6 @@ The return value is a list of lines, without newlines at the end."
9024 (setq lines (push line lines))) 9585 (setq lines (push line lines)))
9025 (nreverse lines))) 9586 (nreverse lines)))
9026 9587
9027;; FIXME: I think I can make this more efficient
9028(defun org-split-string (string &optional separators) 9588(defun org-split-string (string &optional separators)
9029 "Splits STRING into substrings at SEPARATORS. 9589 "Splits STRING into substrings at SEPARATORS.
9030No empty strings are returned if there are matches at the beginning 9590No empty strings are returned if there are matches at the beginning
@@ -9053,49 +9613,6 @@ and end of string."
9053 list))) 9613 list)))
9054 (nreverse list))) 9614 (nreverse list)))
9055 9615
9056(defun org-table-add-invisible-to-vertical-lines ()
9057 "Add an `invisible' property to vertical lines of current table."
9058 (interactive)
9059 (let* ((beg (org-table-begin))
9060 (end (org-table-end))
9061 (end1))
9062 (save-excursion
9063 (goto-char beg)
9064 (while (< (point) end)
9065 (setq end1 (point-at-eol))
9066 (if (looking-at org-table-dataline-regexp)
9067 (while (re-search-forward "|" end1 t)
9068 (add-text-properties (1- (point)) (point)
9069 '(invisible org-table)))
9070 (while (re-search-forward "[+|]" end1 t)
9071 (add-text-properties (1- (point)) (point)
9072 '(invisible org-table))))
9073 (beginning-of-line 2)))))
9074
9075(defun org-table-toggle-vline-visibility (&optional arg)
9076 "Toggle the visibility of table vertical lines.
9077The effect is immediate and on all tables in the file.
9078With prefix ARG, make lines invisible when ARG is positive, make lines
9079visible when ARG is not positive."
9080 (interactive "P")
9081 (let ((action (cond
9082 ((and arg (> (prefix-numeric-value arg) 0)) 'on)
9083 ((and arg (< (prefix-numeric-value arg) 1)) 'off)
9084 (t (if (org-in-invisibility-spec-p '(org-table))
9085 'off
9086 'on)))))
9087 (if (eq action 'off)
9088 (progn
9089 (org-remove-from-invisibility-spec '(org-table))
9090 (org-table-map-tables 'org-table-align)
9091 (message "Vertical table lines visible")
9092 (if (org-at-table-p)
9093 (org-table-align)))
9094 (org-add-to-invisibility-spec '(org-table))
9095 (org-table-map-tables 'org-table-align)
9096 (message "Vertical table lines invisible"))
9097 (redraw-frame (selected-frame))))
9098
9099(defun org-table-map-tables (function) 9616(defun org-table-map-tables (function)
9100 "Apply FUNCTION to the start of all tables in the buffer." 9617 "Apply FUNCTION to the start of all tables in the buffer."
9101 (save-excursion 9618 (save-excursion
@@ -9107,7 +9624,8 @@ visible when ARG is not positive."
9107 (beginning-of-line 1) 9624 (beginning-of-line 1)
9108 (if (looking-at org-table-line-regexp) 9625 (if (looking-at org-table-line-regexp)
9109 (save-excursion (funcall function))) 9626 (save-excursion (funcall function)))
9110 (re-search-forward org-table-any-border-regexp nil 1))))) 9627 (re-search-forward org-table-any-border-regexp nil 1))))
9628 (message "Mapping tables: done"))
9111 9629
9112(defun org-table-sum (&optional beg end nlast) 9630(defun org-table-sum (&optional beg end nlast)
9113 "Sum numbers in region of current table column. 9631 "Sum numbers in region of current table column.
@@ -9362,13 +9880,13 @@ expected, for the other actions only a single column number is needed."
9362 ((eq action 'swap) 9880 ((eq action 'swap)
9363 (setq col1 (car columns) col2 (nth 1 columns) 9881 (setq col1 (car columns) col2 (nth 1 columns)
9364 sc1 (int-to-string col1) sc2 (int-to-string col2)) 9882 sc1 (int-to-string col1) sc2 (int-to-string col2))
9365 ;; Hopefully, ZqZ will never be a name in a table... FIXME: 9883 ;; Hopefully, ZqZtZ will never be a name in a table
9366 (org-table-replace-in-formulas list sc1 "ZqZ") 9884 (org-table-replace-in-formulas list sc1 "ZqZtZ")
9367 (org-table-replace-in-formulas list sc2 sc1) 9885 (org-table-replace-in-formulas list sc2 sc1)
9368 (org-table-replace-in-formulas list "ZqZ" sc2) 9886 (org-table-replace-in-formulas list "ZqZtZ" sc2)
9369 (if (assoc sc1 list) (setcar (assoc sc1 list) "ZqZ")) 9887 (if (assoc sc1 list) (setcar (assoc sc1 list) "ZqZtZ"))
9370 (if (assoc sc2 list) (setcar (assoc sc2 list) sc1)) 9888 (if (assoc sc2 list) (setcar (assoc sc2 list) sc1))
9371 (if (assoc "ZqZ" list) (setcar (assoc "ZqZ" list) sc2))) 9889 (if (assoc "ZqZtZ" list) (setcar (assoc "ZqZtZ" list) sc2)))
9372 (t (error "Invalid action in `org-table-modify-formulas'"))) 9890 (t (error "Invalid action in `org-table-modify-formulas'")))
9373 (if list (org-table-store-formulas list)))) 9891 (if list (org-table-store-formulas list))))
9374 9892
@@ -9681,7 +10199,8 @@ $1-> %s\n" orig formula form))
9681 (org-table-align))))) 10199 (org-table-align)))))
9682 10200
9683(defun org-table-recalculate (&optional all noalign) 10201(defun org-table-recalculate (&optional all noalign)
9684 "Recalculate the current table line by applying all stored formulas." 10202 "Recalculate the current table line by applying all stored formulas.
10203With prefix arg ALL, do this for all lines in the table."
9685 (interactive "P") 10204 (interactive "P")
9686 (or (memq this-command org-recalc-commands) 10205 (or (memq this-command org-recalc-commands)
9687 (setq org-recalc-commands (cons this-command org-recalc-commands))) 10206 (setq org-recalc-commands (cons this-command org-recalc-commands)))
@@ -9797,7 +10316,6 @@ Parameters get priority."
9797(define-key org-edit-formulas-map "\C-c?" 'org-show-variable) 10316(define-key org-edit-formulas-map "\C-c?" 'org-show-variable)
9798 10317
9799(defvar org-pos) 10318(defvar org-pos)
9800(defvar org-window-configuration)
9801 10319
9802(defun org-table-edit-formulas () 10320(defun org-table-edit-formulas ()
9803 "Edit the formulas of the current table in a separate buffer." 10321 "Edit the formulas of the current table in a separate buffer."
@@ -9949,20 +10467,6 @@ With prefix ARG, apply the new formulas to the table."
9949;; active, this binding is ignored inside tables and replaced with a 10467;; active, this binding is ignored inside tables and replaced with a
9950;; modified self-insert. 10468;; modified self-insert.
9951 10469
9952(defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
9953 "Non-nil means, use the optimized table editor version for `orgtbl-mode'.
9954In the optimized version, the table editor takes over all simple keys that
9955normally just insert a character. In tables, the characters are inserted
9956in a way to minimize disturbing the table structure (i.e. in overwrite mode
9957for empty fields). Outside tables, the correct binding of the keys is
9958restored.
9959
9960The default for this option is t if the optimized version is also used in
9961Org-mode. See the variable `org-enable-table-editor' for details. Changing
9962this variable requires a restart of Emacs to become effective."
9963 :group 'org-table
9964 :type 'boolean)
9965
9966(defvar orgtbl-mode nil 10470(defvar orgtbl-mode nil
9967 "Variable controlling `orgtbl-mode', a minor mode enabling the `org-mode' 10471 "Variable controlling `orgtbl-mode', a minor mode enabling the `org-mode'
9968table editor in arbitrary modes.") 10472table editor in arbitrary modes.")
@@ -10002,13 +10506,29 @@ table editor in arbitrary modes.")
10002 (if auto-fill-inhibit-regexp 10506 (if auto-fill-inhibit-regexp
10003 (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp) 10507 (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp)
10004 "[ \t]*|")) 10508 "[ \t]*|"))
10509 (org-add-to-invisibility-spec '(org-cwidth))
10005 (easy-menu-add orgtbl-mode-menu) 10510 (easy-menu-add orgtbl-mode-menu)
10006 (run-hooks 'orgtbl-mode-hook)) 10511 (run-hooks 'orgtbl-mode-hook))
10007 (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp) 10512 (setq auto-fill-inhibit-regexp org-old-auto-fill-inhibit-regexp)
10513 (org-cleanup-narrow-column-properties)
10514 (org-remove-from-invisibility-spec '(org-cwidth))
10008 (remove-hook 'before-change-functions 'org-before-change-function t) 10515 (remove-hook 'before-change-functions 'org-before-change-function t)
10009 (easy-menu-remove orgtbl-mode-menu) 10516 (easy-menu-remove orgtbl-mode-menu)
10010 (force-mode-line-update 'all)))) 10517 (force-mode-line-update 'all))))
10011 10518
10519(defun org-cleanup-narrow-column-properties ()
10520 "Remove all properties related to narrow-column invisibility."
10521 (let ((s 1))
10522 (while (setq s (text-property-any s (point-max)
10523 'display org-narrow-column-arrow))
10524 (remove-text-properties s (1+ s) '(display t)))
10525 (setq s 1)
10526 (while (setq s (text-property-any s (point-max) 'org-cwidth 1))
10527 (remove-text-properties s (1+ s) '(org-cwidth t)))
10528 (setq s 1)
10529 (while (setq s (text-property-any s (point-max) 'invisible 'org-cwidth))
10530 (remove-text-properties s (1+ s) '(invisible t)))))
10531
10012;; Install it as a minor mode. 10532;; Install it as a minor mode.
10013(put 'orgtbl-mode :included t) 10533(put 'orgtbl-mode :included t)
10014(put 'orgtbl-mode :menu-tag "Org Table Mode") 10534(put 'orgtbl-mode :menu-tag "Org Table Mode")
@@ -10069,10 +10589,11 @@ to execute outside of tables."
10069 '("\C-c?" org-table-current-column) 10589 '("\C-c?" org-table-current-column)
10070 '("\C-c " org-table-blank-field) 10590 '("\C-c " org-table-blank-field)
10071 '("\C-c+" org-table-sum) 10591 '("\C-c+" org-table-sum)
10072 '("\C-c|" org-table-toggle-vline-visibility)
10073 '("\C-c=" org-table-eval-formula) 10592 '("\C-c=" org-table-eval-formula)
10074 '("\C-c'" org-table-edit-formulas) 10593 '("\C-c'" org-table-edit-formulas)
10594 '("\C-c`" org-table-edit-field)
10075 '("\C-c*" org-table-recalculate) 10595 '("\C-c*" org-table-recalculate)
10596 '("\C-c|" org-table-create-or-convert-from-region)
10076 '("\C-c^" org-table-sort-lines) 10597 '("\C-c^" org-table-sort-lines)
10077 '([(control ?#)] org-table-rotate-recalc-marks))) 10598 '([(control ?#)] org-table-rotate-recalc-marks)))
10078 elt key fun cmd) 10599 elt key fun cmd)
@@ -10100,8 +10621,8 @@ to execute outside of tables."
10100 ;; some standard editing functions 10621 ;; some standard editing functions
10101 (org-remap orgtbl-mode-map 10622 (org-remap orgtbl-mode-map
10102 'self-insert-command 'orgtbl-self-insert-command 10623 'self-insert-command 'orgtbl-self-insert-command
10103 'delete-char 'orgtbl-delete-char 10624 'delete-char 'org-delete-char
10104 'delete-backward-char 'orgtbl-delete-backward-char) 10625 'delete-backward-char 'org-delete-backward-char)
10105 (define-key orgtbl-mode-map "|" 'org-force-self-insert)) 10626 (define-key orgtbl-mode-map "|" 'org-force-self-insert))
10106 (easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu" 10627 (easy-menu-define orgtbl-mode-menu orgtbl-mode-map "OrgTbl menu"
10107 '("OrgTbl" 10628 '("OrgTbl"
@@ -10111,6 +10632,7 @@ to execute outside of tables."
10111 ["Next Row" org-return :active (org-at-table-p) :keys "RET"] 10632 ["Next Row" org-return :active (org-at-table-p) :keys "RET"]
10112 "--" 10633 "--"
10113 ["Blank Field" org-table-blank-field :active (org-at-table-p) :keys "C-c SPC"] 10634 ["Blank Field" org-table-blank-field :active (org-at-table-p) :keys "C-c SPC"]
10635 ["Edit Field" org-table-edit-field :active (org-at-table-p) :keys "C-c ` "]
10114 ["Copy Field from Above" 10636 ["Copy Field from Above"
10115 org-table-copy-down :active (org-at-table-p) :keys "S-RET"] 10637 org-table-copy-down :active (org-at-table-p) :keys "S-RET"]
10116 "--" 10638 "--"
@@ -10118,7 +10640,9 @@ to execute outside of tables."
10118 ["Move Column Left" org-metaleft :active (org-at-table-p) :keys "M-<left>"] 10640 ["Move Column Left" org-metaleft :active (org-at-table-p) :keys "M-<left>"]
10119 ["Move Column Right" org-metaright :active (org-at-table-p) :keys "M-<right>"] 10641 ["Move Column Right" org-metaright :active (org-at-table-p) :keys "M-<right>"]
10120 ["Delete Column" org-shiftmetaleft :active (org-at-table-p) :keys "M-S-<left>"] 10642 ["Delete Column" org-shiftmetaleft :active (org-at-table-p) :keys "M-S-<left>"]
10121 ["Insert Column" org-shiftmetaright :active (org-at-table-p) :keys "M-S-<right>"]) 10643 ["Insert Column" org-shiftmetaright :active (org-at-table-p) :keys "M-S-<right>"]
10644 "--"
10645 ["Enable Narrowing" (setq org-table-limit-column-width (not org-table-limit-column-width)) :active (org-at-table-p) :selected org-table-limit-column-width :style toggle])
10122 ("Row" 10646 ("Row"
10123 ["Move Row Up" org-metaup :active (org-at-table-p) :keys "M-<up>"] 10647 ["Move Row Up" org-metaup :active (org-at-table-p) :keys "M-<up>"]
10124 ["Move Row Down" org-metadown :active (org-at-table-p) :keys "M-<down>"] 10648 ["Move Row Down" org-metadown :active (org-at-table-p) :keys "M-<down>"]
@@ -10148,11 +10672,12 @@ to execute outside of tables."
10148 )) 10672 ))
10149 t) 10673 t)
10150 10674
10151(defun orgtbl-tab () 10675(defun orgtbl-tab (arg)
10152 "Justification and field motion for `orgtbl-mode'." 10676 "Justification and field motion for `orgtbl-mode'."
10153 (interactive) 10677 (interactive "P")
10154 (org-table-justify-field-maybe) 10678 (if arg (org-table-edit-field t)
10155 (org-table-next-field)) 10679 (org-table-justify-field-maybe)
10680 (org-table-next-field)))
10156 10681
10157(defun orgtbl-ret () 10682(defun orgtbl-ret ()
10158 "Justification and field motion for `orgtbl-mode'." 10683 "Justification and field motion for `orgtbl-mode'."
@@ -10193,43 +10718,6 @@ overwritten, and the table is not marked as requiring realignment."
10193 (interactive "p") 10718 (interactive "p")
10194 (self-insert-command N)) 10719 (self-insert-command N))
10195 10720
10196(defun orgtbl-delete-backward-char (N)
10197 "Like `delete-backward-char', insert whitespace at field end in tables.
10198When deleting backwards, in tables this function will insert whitespace in
10199front of the next \"|\" separator, to keep the table aligned. The table will
10200still be marked for re-alignment, because a narrow field may lead to a
10201reduced column width."
10202 (interactive "p")
10203 (if (and (org-at-table-p)
10204 (eq N 1)
10205 (string-match "|" (buffer-substring (point-at-bol) (point)))
10206 (looking-at ".*?|"))
10207 (let ((pos (point)))
10208 (backward-delete-char N)
10209 (skip-chars-forward "^|")
10210 (insert " ")
10211 (goto-char (1- pos)))
10212 (delete-backward-char N)))
10213
10214(defun orgtbl-delete-char (N)
10215 "Like `delete-char', but insert whitespace at field end in tables.
10216When deleting characters, in tables this function will insert whitespace in
10217front of the next \"|\" separator, to keep the table aligned. The table
10218will still be marked for re-alignment, because a narrow field may lead to
10219a reduced column width."
10220 (interactive "p")
10221 (if (and (org-at-table-p)
10222 (not (bolp))
10223 (not (= (char-after) ?|))
10224 (eq N 1))
10225 (if (looking-at ".*?|")
10226 (let ((pos (point)))
10227 (replace-match (concat
10228 (substring (match-string 0) 1 -1)
10229 " |"))
10230 (goto-char pos)))
10231 (delete-char N)))
10232
10233;;; Exporting 10721;;; Exporting
10234 10722
10235(defconst org-level-max 20) 10723(defconst org-level-max 20)
@@ -10576,6 +11064,8 @@ translations. There is currently no way for users to extend this.")
10576 (let* ((cb (current-buffer)) 11064 (let* ((cb (current-buffer))
10577 (re-radio (and org-target-link-regexp 11065 (re-radio (and org-target-link-regexp
10578 (concat "\\([^<]\\)\\(" org-target-link-regexp "\\)"))) 11066 (concat "\\([^<]\\)\\(" org-target-link-regexp "\\)")))
11067 (re-plain-link (concat "\\([^[<]\\)" org-plain-link-re))
11068 (re-angle-link (concat "\\([^[]\\)" org-angle-link-re))
10579 rtn) 11069 rtn)
10580 (save-excursion 11070 (save-excursion
10581 (set-buffer (get-buffer-create " org-mode-tmp")) 11071 (set-buffer (get-buffer-create " org-mode-tmp"))
@@ -10587,16 +11077,30 @@ translations. There is currently no way for users to extend this.")
10587 (goto-char (point-min)) 11077 (goto-char (point-min))
10588 (while (re-search-forward "^#.*?\\(<<<?[^>\r\n]+>>>?\\).*" nil t) 11078 (while (re-search-forward "^#.*?\\(<<<?[^>\r\n]+>>>?\\).*" nil t)
10589 (replace-match "\\1(INVISIBLE)")) 11079 (replace-match "\\1(INVISIBLE)"))
10590 ;; Find matches for radio targets and turn them into links 11080 ;; Find matches for radio targets and turn them into internal links
10591 (goto-char (point-min)) 11081 (goto-char (point-min))
10592 (when re-radio 11082 (when re-radio
10593 (while (re-search-forward re-radio nil t) 11083 (while (re-search-forward re-radio nil t)
10594 (replace-match "\\1[[\\2]]"))) 11084 (replace-match "\\1[[\\2]]")))
10595 ;; Find all links that contain a newline and put them into a single line 11085 ;; Find all links that contain a newline and put them into a single line
10596 (goto-char (point-min)) 11086 (goto-char (point-min))
10597 (while (re-search-forward "\\(\\[\\[[^]]*?\\)[ \t]*\n[ \t]*\\([^]]*\\]\\]\\)" nil t) 11087 (while (re-search-forward "\\(\\(\\[\\|\\]\\)\\[[^]]*?\\)[ \t]*\n[ \t]*\\([^]]*\\]\\(\\[\\|\\]\\)\\)" nil t)
10598 (replace-match "\\1 \\2") 11088 (replace-match "\\1 \\3")
10599 (goto-char (match-beginning 0))) 11089 (goto-char (match-beginning 0)))
11090 ;; Normalize links: Convert angle and plain links into bracket links
11091 (goto-char (point-min))
11092 (while (re-search-forward re-plain-link nil t)
11093 (replace-match
11094 (concat
11095 (match-string 1) "[[" (match-string 2) ":" (match-string 3) "]]")
11096 t t))
11097 (goto-char (point-min))
11098 (while (re-search-forward re-angle-link nil t)
11099 (replace-match
11100 (concat
11101 (match-string 1) "[[" (match-string 2) ":" (match-string 3) "]]")
11102 t t))
11103
10600 ;; Remove comments 11104 ;; Remove comments
10601 (goto-char (point-min)) 11105 (goto-char (point-min))
10602 (while (re-search-forward "^#.*\n?" nil t) 11106 (while (re-search-forward "^#.*\n?" nil t)
@@ -10683,7 +11187,7 @@ underlined headlines. The default is 3."
10683 (buffer (find-file-noselect filename)) 11187 (buffer (find-file-noselect filename))
10684 (levels-open (make-vector org-level-max nil)) 11188 (levels-open (make-vector org-level-max nil))
10685 (date (format-time-string "%Y/%m/%d" (current-time))) 11189 (date (format-time-string "%Y/%m/%d" (current-time)))
10686 (time (format-time-string "%X" (current-time))) 11190 (time (format-time-string "%X" (org-current-time)))
10687 (author user-full-name) 11191 (author user-full-name)
10688 (title (buffer-name)) 11192 (title (buffer-name))
10689 (options nil) 11193 (options nil)
@@ -10742,7 +11246,8 @@ underlined headlines. The default is 3."
10742 (not (equal (match-string 2 line) 11246 (not (equal (match-string 2 line)
10743 org-done-string))) 11247 org-done-string)))
10744 ; TODO, not DONE 11248 ; TODO, not DONE
10745 (and (= level umax) 11249 (and org-export-mark-todo-in-toc
11250 (= level umax)
10746 (org-search-todo-below 11251 (org-search-todo-below
10747 line lines level)))) 11252 line lines level))))
10748 (setq txt (org-html-expand-for-ascii txt)) 11253 (setq txt (org-html-expand-for-ascii txt))
@@ -10800,7 +11305,7 @@ underlined headlines. The default is 3."
10800 (if todo (throw 'exit t)))))))) 11305 (if todo (throw 'exit t))))))))
10801 11306
10802;; FIXME: Try to handle <b> and <i> as faces via text properties. 11307;; FIXME: Try to handle <b> and <i> as faces via text properties.
10803;; FIXME: Can I implement *bold*,/italic/ and _underline_ for ASCII export? 11308;; We could also implement *bold*,/italic/ and _underline_ for ASCII export
10804(defun org-html-expand-for-ascii (line) 11309(defun org-html-expand-for-ascii (line)
10805 "Handle quoted HTML for ASCII export." 11310 "Handle quoted HTML for ASCII export."
10806 (if org-export-html-expand 11311 (if org-export-html-expand
@@ -10896,7 +11401,7 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
10896#+CATEGORY: %s 11401#+CATEGORY: %s
10897#+SEQ_TODO: %s 11402#+SEQ_TODO: %s
10898#+TYP_TODO: %s 11403#+TYP_TODO: %s
10899#+STARTUP: %s %s %s %s 11404#+STARTUP: %s %s %s %s %s
10900#+ARCHIVE: %s 11405#+ARCHIVE: %s
10901" 11406"
10902 (buffer-name) (user-full-name) user-mail-address org-export-default-language 11407 (buffer-name) (user-full-name) user-mail-address org-export-default-language
@@ -10918,10 +11423,11 @@ Does include HTML export options as well as TODO and CATEGORY stuff."
10918 (mapconcat 'identity org-todo-keywords " ") 11423 (mapconcat 'identity org-todo-keywords " ")
10919 "Me Jason Marie DONE") 11424 "Me Jason Marie DONE")
10920 (cdr (assoc org-startup-folded 11425 (cdr (assoc org-startup-folded
10921 '((nil . "nofold")(t . "fold")(content . "content")))) 11426 '((nil . "showall") (t . "overview") (content . "content"))))
10922 (if org-startup-with-deadline-check "dlcheck" "nodlcheck") 11427 (if org-startup-with-deadline-check "dlcheck" "nodlcheck")
10923 (if org-odd-levels-only "odd" "oddeven") 11428 (if org-odd-levels-only "odd" "oddeven")
10924 (if org-hide-leading-stars "hidestars" "showstars") 11429 (if org-hide-leading-stars "hidestars" "showstars")
11430 (if org-startup-align-all-tables "align" "noalign")
10925 org-archive-location 11431 org-archive-location
10926 )) 11432 ))
10927 11433
@@ -11023,7 +11529,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
11023 (buffer (find-file-noselect filename)) 11529 (buffer (find-file-noselect filename))
11024 (levels-open (make-vector org-level-max nil)) 11530 (levels-open (make-vector org-level-max nil))
11025 (date (format-time-string "%Y/%m/%d" (current-time))) 11531 (date (format-time-string "%Y/%m/%d" (current-time)))
11026 (time (format-time-string "%X" (current-time))) 11532 (time (format-time-string "%X" (org-current-time)))
11027 (author user-full-name) 11533 (author user-full-name)
11028 (title (buffer-name)) 11534 (title (buffer-name))
11029 (options nil) 11535 (options nil)
@@ -11052,6 +11558,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
11052 table-open type 11558 table-open type
11053 table-buffer table-orig-buffer 11559 table-buffer table-orig-buffer
11054 ind start-is-num starter 11560 ind start-is-num starter
11561 rpl path desc desc1 desc2 link
11055 ) 11562 )
11056 (message "Exporting...") 11563 (message "Exporting...")
11057 11564
@@ -11118,7 +11625,8 @@ headlines. The default is 3. Lower levels will become bulleted lists."
11118 (not (equal (match-string 2 line) 11625 (not (equal (match-string 2 line)
11119 org-done-string))) 11626 org-done-string)))
11120 ; TODO, not DONE 11627 ; TODO, not DONE
11121 (and (= level umax) 11628 (and org-export-mark-todo-in-toc
11629 (= level umax)
11122 (org-search-todo-below 11630 (org-search-todo-below
11123 line lines level)))) 11631 line lines level))))
11124 (if org-export-with-section-numbers 11632 (if org-export-with-section-numbers
@@ -11200,7 +11708,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
11200 (cond 11708 (cond
11201 ((match-end 2) 11709 ((match-end 2)
11202 (setq line (replace-match 11710 (setq line (replace-match
11203 (concat "@<a name=\"" 11711 (concat "@<a name=\""
11204 (org-solidify-link-text (match-string 1 line)) 11712 (org-solidify-link-text (match-string 1 line))
11205 "\">\\nbsp@</a>") 11713 "\">\\nbsp@</a>")
11206 t t line))) 11714 t t line)))
@@ -11211,28 +11719,10 @@ headlines. The default is 3. Lower levels will become bulleted lists."
11211 t t line))) 11719 t t line)))
11212 (t 11720 (t
11213 (setq line (replace-match 11721 (setq line (replace-match
11214 (concat "@<a name=\"" 11722 (concat "@<a name=\""
11215 (org-solidify-link-text (match-string 1 line)) 11723 (org-solidify-link-text (match-string 1 line))
11216 "\" class=\"target\">" (match-string 1 line) "@</a> ") 11724 "\" class=\"target\">" (match-string 1 line) "@</a> ")
11217 t t line))))) 11725 t t line)))))
11218 ;; Replace internal links
11219 (while (string-match org-bracket-link-regexp line)
11220 (setq line (replace-match
11221 (concat
11222 "@<a href=\"#"
11223 (org-solidify-link-text (match-string 1 line) target-alist)
11224 "\">"
11225 (match-string (if (match-end 3) 3 1) line)
11226 "@</a>")
11227 t t line)))
11228
11229 ;; Protect the external links
11230 (setq start 0)
11231 (while (string-match org-link-maybe-angles-regexp line start)
11232 (setq start (match-end 0))
11233 (setq line (replace-match
11234 (concat "\000" (match-string 1 line) "\000")
11235 t t line)))
11236 11726
11237 ;; replace "&" by "&amp;", "<" and ">" by "&lt;" and "&gt;" 11727 ;; replace "&" by "&amp;", "<" and ">" by "&lt;" and "&gt;"
11238 ;; handle @<..> HTML tags (replace "@&gt;..&lt;" by "<..>") 11728 ;; handle @<..> HTML tags (replace "@&gt;..&lt;" by "<..>")
@@ -11240,19 +11730,27 @@ headlines. The default is 3. Lower levels will become bulleted lists."
11240 11730
11241 ;; Format the links 11731 ;; Format the links
11242 (setq start 0) 11732 (setq start 0)
11243 (while (string-match org-protected-link-regexp line start) 11733 (while (string-match org-bracket-link-analytic-regexp line start)
11244 (setq start (- (match-end 0) 2)) 11734 (setq start (match-beginning 0))
11245 (setq type (match-string 1 line)) 11735 (setq type (if (match-end 2) (match-string 2 line) "internal"))
11736 (setq path (match-string 3 line))
11737 (setq desc1 (if (match-end 5) (match-string 5 line))
11738 desc2 (if (match-end 2) (concat type ":" path) path)
11739 desc (or desc1 desc2))
11246 (cond 11740 (cond
11741 ((equal type "internal")
11742 (setq rpl
11743 (concat
11744 "<a href=\"#"
11745 (org-solidify-link-text path target-alist)
11746 "\">" desc "</a>")))
11247 ((member type '("http" "https" "ftp" "mailto" "news")) 11747 ((member type '("http" "https" "ftp" "mailto" "news"))
11248 ;; standard URL 11748 ;; standard URL
11249 (setq line (replace-match 11749 (setq link (concat type ":" path))
11250 ; "<a href=\"\\1:\\2\">&lt;\\1:\\2&gt;</a>" 11750 (setq rpl (concat "<a href=\"" link "\">" desc "</a>")))
11251 "<a href=\"\\1:\\2\">\\1:\\2</a>"
11252 nil nil line)))
11253 ((string= type "file") 11751 ((string= type "file")
11254 ;; FILE link 11752 ;; FILE link
11255 (let* ((filename (match-string 2 line)) 11753 (let* ((filename path)
11256 (abs-p (file-name-absolute-p filename)) 11754 (abs-p (file-name-absolute-p filename))
11257 (thefile (if abs-p (expand-file-name filename) filename)) 11755 (thefile (if abs-p (expand-file-name filename) filename))
11258 (thefile (save-match-data 11756 (thefile (save-match-data
@@ -11262,17 +11760,15 @@ headlines. The default is 3. Lower levels will become bulleted lists."
11262 (file-is-image-p 11760 (file-is-image-p
11263 (save-match-data 11761 (save-match-data
11264 (string-match (org-image-file-name-regexp) thefile)))) 11762 (string-match (org-image-file-name-regexp) thefile))))
11265 (setq line (replace-match 11763 (setq rpl (if (and org-export-html-inline-images
11266 (if (and org-export-html-inline-images 11764 file-is-image-p)
11267 file-is-image-p) 11765 (concat "<img src=\"" thefile "\"/>")
11268 (concat "<img src=\"" thefile "\"/>") 11766 (concat "<a href=\"" thefile "\">" desc "</a>")))))
11269 (concat "<a href=\"" thefile "\">\\1:\\2</a>"))
11270 nil nil line))))
11271
11272 ((member type '("bbdb" "vm" "wl" "mhe" "rmail" "gnus" "shell")) 11767 ((member type '("bbdb" "vm" "wl" "mhe" "rmail" "gnus" "shell"))
11273 (setq line (replace-match 11768 (setq rpl (concat "<i>&lt;" type ":" path "&gt;</i>"))))
11274 "<i>&lt;\\1:\\2&gt;</i>" nil nil line))))) 11769 ;; FIXME: We get to see the escaped links!!!!!
11275 11770 (setq line (replace-match rpl t t line)
11771 start (+ start (length rpl))))
11276 ;; TODO items 11772 ;; TODO items
11277 (if (and (string-match org-todo-line-regexp line) 11773 (if (and (string-match org-todo-line-regexp line)
11278 (match-beginning 2)) 11774 (match-beginning 2))
@@ -11330,8 +11826,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
11330 (insert (org-format-table-html table-buffer table-orig-buffer)))) 11826 (insert (org-format-table-html table-buffer table-orig-buffer))))
11331 (t 11827 (t
11332 ;; Normal lines 11828 ;; Normal lines
11333 (when (and (> org-export-plain-list-max-depth 0) 11829 (when (and (string-match
11334 (string-match
11335 (cond 11830 (cond
11336 ((eq llt t) "^\\([ \t]*\\)\\(\\([-+*]\\)\\|\\([0-9]+[.)]\\)\\)?\\( +[^ \t\n\r]\\|[ \t]*$\\)") 11831 ((eq llt t) "^\\([ \t]*\\)\\(\\([-+*]\\)\\|\\([0-9]+[.)]\\)\\)?\\( +[^ \t\n\r]\\|[ \t]*$\\)")
11337 ((= llt ?.) "^\\([ \t]*\\)\\(\\([-+*]\\)\\|\\([0-9]+\\.\\)\\)?\\( +[^ \t\n\r]\\|[ \t]*$\\)") 11832 ((= llt ?.) "^\\([ \t]*\\)\\(\\([-+*]\\)\\|\\([0-9]+\\.\\)\\)?\\( +[^ \t\n\r]\\|[ \t]*$\\)")
@@ -11355,9 +11850,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
11355 (cond 11850 (cond
11356 ((and starter 11851 ((and starter
11357 (or (not in-local-list) 11852 (or (not in-local-list)
11358 (> ind (car local-list-indent))) 11853 (> ind (car local-list-indent))))
11359 (< (length local-list-indent)
11360 org-export-plain-list-max-depth))
11361 ;; Start new (level of ) list 11854 ;; Start new (level of ) list
11362 (insert (if start-is-num "<ol>\n<li>\n" "<ul>\n<li>\n")) 11855 (insert (if start-is-num "<ol>\n<li>\n" "<ul>\n<li>\n"))
11363 (push start-is-num local-list-num) 11856 (push start-is-num local-list-num)
@@ -11541,32 +12034,38 @@ But it has the disadvantage, that Org-mode's HTML conversions cannot be used."
11541 s) 12034 s)
11542 12035
11543(defun org-html-expand (string) 12036(defun org-html-expand (string)
11544 "Prepare STRING for HTML export. Applies all active conversions." 12037 "Prepare STRING for HTML export. Applies all active conversions.
11545 ;; First check if there is a link in the line - if yes, apply conversions 12038If there are links in the string, don't modify these."
11546 ;; only before the start of the link. 12039 (let* (m s l res)
11547 ;; FIXME: This is no longer correct, because links now have an end. 12040 (while (setq m (string-match org-bracket-link-regexp string))
11548 (let* ((m (string-match org-link-regexp string)) 12041 (setq s (substring string 0 m)
11549 (s (if m (substring string 0 m) string)) 12042 l (match-string 0 string)
11550 (r (if m (substring string m) ""))) 12043 string (substring string (match-end 0)))
11551 ;; convert & to &amp;, < to &lt; and > to &gt; 12044 (push (org-html-do-expand s) res)
11552 (setq s (org-html-protect s)) 12045 (push l res))
11553 (if org-export-html-expand 12046 (push (org-html-do-expand string) res)
11554 (while (string-match "@&lt;\\([^&]*\\)&gt;" s) 12047 (apply 'concat (nreverse res))))
11555 (setq s (replace-match "<\\1>" nil nil s)))) 12048
11556 (if org-export-with-emphasize 12049(defun org-html-do-expand (s)
11557 (setq s (org-export-html-convert-emphasize s))) 12050 "Apply all active conversions to translate special ASCII to HTML."
11558 (if org-export-with-sub-superscripts 12051 (setq s (org-html-protect s))
11559 (setq s (org-export-html-convert-sub-super s))) 12052 (if org-export-html-expand
11560 (if org-export-with-TeX-macros 12053 (while (string-match "@&lt;\\([^&]*\\)&gt;" s)
11561 (let ((start 0) wd ass) 12054 (setq s (replace-match "<\\1>" nil nil s))))
11562 (while (setq start (string-match "\\\\\\([a-zA-Z]+\\)" s start)) 12055 (if org-export-with-emphasize
11563 (setq wd (match-string 1 s)) 12056 (setq s (org-export-html-convert-emphasize s)))
11564 (if (setq ass (assoc wd org-html-entities)) 12057 (if org-export-with-sub-superscripts
11565 (setq s (replace-match (or (cdr ass) 12058 (setq s (org-export-html-convert-sub-super s)))
11566 (concat "&" (car ass) ";")) 12059 (if org-export-with-TeX-macros
11567 t t s)) 12060 (let ((start 0) wd ass)
11568 (setq start (+ start (length wd))))))) 12061 (while (setq start (string-match "\\\\\\([a-zA-Z]+\\)" s start))
11569 (concat s r))) 12062 (setq wd (match-string 1 s))
12063 (if (setq ass (assoc wd org-html-entities))
12064 (setq s (replace-match (or (cdr ass)
12065 (concat "&" (car ass) ";"))
12066 t t s))
12067 (setq start (+ start (length wd)))))))
12068 s)
11570 12069
11571(defun org-create-multibrace-regexp (left right n) 12070(defun org-create-multibrace-regexp (left right n)
11572 "Create a regular expression which will match a balanced sexp. 12071 "Create a regular expression which will match a balanced sexp.
@@ -11613,25 +12112,14 @@ stacked delimiters is N. Escaping delimiters is not possible."
11613 string) 12112 string)
11614 12113
11615(defun org-export-html-convert-emphasize (string) 12114(defun org-export-html-convert-emphasize (string)
11616 (while (string-match 12115 (let (c (s 0))
11617 "\\(\\s-\\|^\\)\\(\\*\\([a-zA-Z]+\\)\\*\\)\\([^a-zA-Z*]\\|$\\)" 12116 (while (string-match "\\(\\W\\|^\\)\\([*/_]\\)\\(\\w+\\)\\2\\(\\W\\|$\\)" string s)
11618 string) 12117 (setq c (cdr (assoc (match-string 2 string)
11619 (setq string (replace-match 12118 '(("*" . "b") ("/" . "i") ("_" . "u"))))
11620 (concat "<b>" (match-string 3 string) "</b>") 12119 s (+ (match-end 0) 3)
11621 t t string 2))) 12120 string (replace-match
11622 (while (string-match 12121 (concat "\\1<" c ">\\3</" c ">\\4") t nil string)))
11623 "\\(\\s-\\|^\\)\\(/\\([a-zA-Z]+\\)/\\)\\([^a-zA-Z*]\\|$\\)" 12122 string))
11624 string)
11625 (setq string (replace-match
11626 (concat "<i>" (match-string 3 string) "</i>")
11627 t t string 2)))
11628 (while (string-match
11629 "\\(\\s-\\|^\\)\\(_\\([a-zA-Z]+\\)_\\)\\([^a-zA-Z*]\\|$\\)"
11630 string)
11631 (setq string (replace-match
11632 (concat "<u>" (match-string 3 string) "</u>")
11633 t t string 2)))
11634 string)
11635 12123
11636(defun org-parse-key-lines () 12124(defun org-parse-key-lines ()
11637 "Find the special key lines with the information for exporters." 12125 "Find the special key lines with the information for exporters."
@@ -11755,20 +12243,103 @@ file, but with extension `.ics'."
11755 (interactive) 12243 (interactive)
11756 (org-export-icalendar nil buffer-file-name)) 12244 (org-export-icalendar nil buffer-file-name))
11757 12245
12246(defun org-export-as-xml ()
12247 "Export current buffer as XOXO XML buffer."
12248 (interactive)
12249 (cond ((eq org-export-xml-type 'xoxo)
12250 (org-export-as-xoxo (current-buffer)))))
12251
12252(defun org-export-as-xoxo-insert-into (buffer &rest output)
12253 (with-current-buffer buffer
12254 (apply 'insert output)))
12255
12256(defun org-export-as-xoxo (&optional buffer)
12257 "Export the org buffer as XOXO.
12258The XOXO buffer is named *xoxo-<source buffer name>*"
12259 (interactive (list (current-buffer)))
12260 ;; A quickie abstraction
12261
12262 ;; Output everything as XOXO
12263 (with-current-buffer (get-buffer buffer)
12264 (goto-char (point-min)) ;; CD: beginning-of-buffer is not allowed.
12265 (let* ((filename (concat (file-name-sans-extension buffer-file-name)
12266 ".xml"))
12267 (out (find-file-noselect filename))
12268 (last-level 1)
12269 (hanging-li nil))
12270 ;; Check the output buffer is empty.
12271 (with-current-buffer out (erase-buffer))
12272 ;; Kick off the output
12273 (org-export-as-xoxo-insert-into out "<ol class='xoxo'>\n")
12274 (while (re-search-forward "^\\(\\*+\\) \\(.+\\)" (point-max) 't)
12275 (let* ((hd (match-string-no-properties 1))
12276 (level (length hd))
12277 (text (concat
12278 (match-string-no-properties 2)
12279 (save-excursion
12280 (goto-char (match-end 0))
12281 (let ((str ""))
12282 (catch 'loop
12283 (while 't
12284 (forward-line)
12285 (if (looking-at "^[ \t]\\(.*\\)")
12286 (setq str (concat str (match-string-no-properties 1)))
12287 (throw 'loop str)))))))))
12288
12289 ;; Handle level rendering
12290 (cond
12291 ((> level last-level)
12292 (org-export-as-xoxo-insert-into out "\n<ol>\n"))
12293
12294 ((< level last-level)
12295 (dotimes (- (- last-level level) 1)
12296 (if hanging-li
12297 (org-export-as-xoxo-insert-into out "</li>\n"))
12298 (org-export-as-xoxo-insert-into out "</ol>\n"))
12299 (when hanging-li
12300 (org-export-as-xoxo-insert-into out "</li>\n")
12301 (setq hanging-li nil)))
12302
12303 ((equal level last-level)
12304 (if hanging-li
12305 (org-export-as-xoxo-insert-into out "</li>\n")))
12306 )
12307
12308 (setq last-level level)
12309
12310 ;; And output the new li
12311 (setq hanging-li 't)
12312 (if (equal ?+ (elt text 0))
12313 (org-export-as-xoxo-insert-into out "<li class='" (substring text 1) "'>")
12314 (org-export-as-xoxo-insert-into out "<li>" text))))
12315
12316 ;; Finally finish off the ol
12317 (dotimes (- last-level 1)
12318 (if hanging-li
12319 (org-export-as-xoxo-insert-into out "</li>\n"))
12320 (org-export-as-xoxo-insert-into out "</ol>\n"))
12321
12322 ;; Finish the buffer off and clean it up.
12323 (switch-to-buffer-other-window out)
12324 (indent-region (point-min) (point-max))
12325 (save-buffer)
12326 (goto-char (point-min))
12327 )))
12328
11758;;;###autoload 12329;;;###autoload
11759(defun org-export-icalendar-all-agenda-files () 12330(defun org-export-icalendar-all-agenda-files ()
11760 "Export all files in `org-agenda-files' to iCalendar .ics files. 12331 "Export all files in `org-agenda-files' to iCalendar .ics files.
11761Each iCalendar file will be located in the same directory as the Org-mode 12332Each iCalendar file will be located in the same directory as the Org-mode
11762file, but with extension `.ics'." 12333file, but with extension `.ics'."
11763 (interactive) 12334 (interactive)
11764 (apply 'org-export-icalendar nil org-agenda-files)) 12335 (apply 'org-export-icalendar nil (org-agenda-files t)))
11765 12336
11766;;;###autoload 12337;;;###autoload
11767(defun org-export-icalendar-combine-agenda-files () 12338(defun org-export-icalendar-combine-agenda-files ()
11768 "Export all files in `org-agenda-files' to a single combined iCalendar file. 12339 "Export all files in `org-agenda-files' to a single combined iCalendar file.
11769The file is stored under the name `org-combined-agenda-icalendar-file'." 12340The file is stored under the name `org-combined-agenda-icalendar-file'."
11770 (interactive) 12341 (interactive)
11771 (apply 'org-export-icalendar t org-agenda-files)) 12342 (apply 'org-export-icalendar t (org-agenda-files t)))
11772 12343
11773(defun org-export-icalendar (combine &rest files) 12344(defun org-export-icalendar (combine &rest files)
11774 "Create iCalendar files for all elements of FILES. 12345 "Create iCalendar files for all elements of FILES.
@@ -11929,7 +12500,7 @@ a time), or the day by one (if it does not contain a time)."
11929(define-key org-mode-map [(meta tab)] 'org-complete) 12500(define-key org-mode-map [(meta tab)] 'org-complete)
11930(define-key org-mode-map "\M-\C-i" 'org-complete) ; for tty emacs 12501(define-key org-mode-map "\M-\C-i" 'org-complete) ; for tty emacs
11931;; The following line is necessary under Suse GNU/Linux 12502;; The following line is necessary under Suse GNU/Linux
11932(unless org-xemacs-p 12503(unless (featurep 'xemacs)
11933 (define-key org-mode-map [S-iso-lefttab] 'org-shifttab)) 12504 (define-key org-mode-map [S-iso-lefttab] 'org-shifttab))
11934(define-key org-mode-map [(shift tab)] 'org-shifttab) 12505(define-key org-mode-map [(shift tab)] 'org-shifttab)
11935 12506
@@ -12007,9 +12578,10 @@ a time), or the day by one (if it does not contain a time)."
12007(define-key org-mode-map "\C-c?" 'org-table-current-column) 12578(define-key org-mode-map "\C-c?" 'org-table-current-column)
12008(define-key org-mode-map "\C-c " 'org-table-blank-field) 12579(define-key org-mode-map "\C-c " 'org-table-blank-field)
12009(define-key org-mode-map "\C-c+" 'org-table-sum) 12580(define-key org-mode-map "\C-c+" 'org-table-sum)
12010(define-key org-mode-map "\C-c|" 'org-table-toggle-vline-visibility)
12011(define-key org-mode-map "\C-c=" 'org-table-eval-formula) 12581(define-key org-mode-map "\C-c=" 'org-table-eval-formula)
12012(define-key org-mode-map "\C-c'" 'org-table-edit-formulas) 12582(define-key org-mode-map "\C-c'" 'org-table-edit-formulas)
12583(define-key org-mode-map "\C-c`" 'org-table-edit-field)
12584(define-key org-mode-map "\C-c|" 'org-table-create-or-convert-from-region)
12013(define-key org-mode-map "\C-c*" 'org-table-recalculate) 12585(define-key org-mode-map "\C-c*" 'org-table-recalculate)
12014(define-key org-mode-map [(control ?#)] 'org-table-rotate-recalc-marks) 12586(define-key org-mode-map [(control ?#)] 'org-table-rotate-recalc-marks)
12015(define-key org-mode-map "\C-c~" 'org-table-create-with-table.el) 12587(define-key org-mode-map "\C-c~" 'org-table-create-with-table.el)
@@ -12028,6 +12600,8 @@ a time), or the day by one (if it does not contain a time)."
12028(define-key org-mode-map "\C-c\C-xt" 'org-insert-export-options-template) 12600(define-key org-mode-map "\C-c\C-xt" 'org-insert-export-options-template)
12029(define-key org-mode-map "\C-c:" 'org-toggle-fixed-width-section) 12601(define-key org-mode-map "\C-c:" 'org-toggle-fixed-width-section)
12030(define-key org-mode-map "\C-c\C-xh" 'org-export-as-html) 12602(define-key org-mode-map "\C-c\C-xh" 'org-export-as-html)
12603(define-key org-mode-map "\C-c\C-xx" 'org-export-as-xml)
12604(define-key org-mode-map "\C-c\C-x\C-x" 'org-export-as-xml)
12031(define-key org-mode-map "\C-c\C-xb" 'org-export-as-html-and-open) 12605(define-key org-mode-map "\C-c\C-xb" 'org-export-as-html-and-open)
12032(define-key org-mode-map "\C-c\C-x\C-b" 'org-export-as-html-and-open) 12606(define-key org-mode-map "\C-c\C-x\C-b" 'org-export-as-html-and-open)
12033 12607
@@ -12044,14 +12618,19 @@ If the cursor is in a table looking at whitespace, the whitespace is
12044overwritten, and the table is not marked as requiring realignment." 12618overwritten, and the table is not marked as requiring realignment."
12045 (interactive "p") 12619 (interactive "p")
12046 (if (and (org-table-p) 12620 (if (and (org-table-p)
12047 (or 12621 (progn
12048 (and org-table-auto-blank-field 12622 ;; check if we blank the field, and if that triggers align
12049 (member last-command 12623 (and org-table-auto-blank-field
12050 '(org-cycle org-return org-shifttab org-ctrl-c-ctrl-c)) 12624 (member last-command
12051 (org-table-blank-field)) 12625 '(org-cycle org-return org-shifttab org-ctrl-c-ctrl-c))
12052 t) 12626 (if (or (equal (char-after) ?\ ) (looking-at "[^|\n]* |"))
12627 ;; got extra space, this field does not determine column width
12628 (let (org-table-may-need-update) (org-table-blank-field))
12629 ;; no extra space, this field may determine column width
12630 (org-table-blank-field)))
12631 t)
12053 (eq N 1) 12632 (eq N 1)
12054 (looking-at "[^|\n]* +|")) 12633 (looking-at "[^|\n]* |"))
12055 (let (org-table-may-need-update) 12634 (let (org-table-may-need-update)
12056 (goto-char (1- (match-end 0))) 12635 (goto-char (1- (match-end 0)))
12057 (delete-backward-char 1) 12636 (delete-backward-char 1)
@@ -12060,45 +12639,51 @@ overwritten, and the table is not marked as requiring realignment."
12060 (setq org-table-may-need-update t) 12639 (setq org-table-may-need-update t)
12061 (self-insert-command N))) 12640 (self-insert-command N)))
12062 12641
12063;; FIXME:
12064;; The following two functions might still be optimized to trigger
12065;; re-alignment less frequently.
12066
12067(defun org-delete-backward-char (N) 12642(defun org-delete-backward-char (N)
12068 "Like `delete-backward-char', insert whitespace at field end in tables. 12643 "Like `delete-backward-char', insert whitespace at field end in tables.
12069When deleting backwards, in tables this function will insert whitespace in 12644When deleting backwards, in tables this function will insert whitespace in
12070front of the next \"|\" separator, to keep the table aligned. The table will 12645front of the next \"|\" separator, to keep the table aligned. The table will
12071still be marked for re-alignment, because a narrow field may lead to a 12646still be marked for re-alignment if the field did fill the entire column,
12072reduced column width." 12647because, in this case the deletion might narrow the column."
12073 (interactive "p") 12648 (interactive "p")
12074 (if (and (org-table-p) 12649 (if (and (org-table-p)
12075 (eq N 1) 12650 (eq N 1)
12076 (string-match "|" (buffer-substring (point-at-bol) (point))) 12651 (string-match "|" (buffer-substring (point-at-bol) (point)))
12077 (looking-at ".*?|")) 12652 (looking-at ".*?|"))
12078 (let ((pos (point))) 12653 (let ((pos (point))
12654 (noalign (looking-at "[^|\n\r]* |"))
12655 (c org-table-may-need-update))
12079 (backward-delete-char N) 12656 (backward-delete-char N)
12080 (skip-chars-forward "^|") 12657 (skip-chars-forward "^|")
12081 (insert " ") 12658 (insert " ")
12082 (goto-char (1- pos))) 12659 (goto-char (1- pos))
12660 ;; noalign: if there were two spaces at the end, this field
12661 ;; does not determine the width of the column.
12662 (if noalign (setq org-table-may-need-update c)))
12083 (backward-delete-char N))) 12663 (backward-delete-char N)))
12084 12664
12085(defun org-delete-char (N) 12665(defun org-delete-char (N)
12086 "Like `delete-char', but insert whitespace at field end in tables. 12666 "Like `delete-char', but insert whitespace at field end in tables.
12087When deleting characters, in tables this function will insert whitespace in 12667When deleting characters, in tables this function will insert whitespace in
12088front of the next \"|\" separator, to keep the table aligned. The table 12668front of the next \"|\" separator, to keep the table aligned. The table will
12089will still be marked for re-alignment, because a narrow field may lead to 12669still be marked for re-alignment if the field did fill the entire column,
12090a reduced column width." 12670because, in this case the deletion might narrow the column."
12091 (interactive "p") 12671 (interactive "p")
12092 (if (and (org-table-p) 12672 (if (and (org-table-p)
12093 (not (bolp)) 12673 (not (bolp))
12094 (not (= (char-after) ?|)) 12674 (not (= (char-after) ?|))
12095 (eq N 1)) 12675 (eq N 1))
12096 (if (looking-at ".*?|") 12676 (if (looking-at ".*?|")
12097 (let ((pos (point))) 12677 (let ((pos (point))
12678 (noalign (looking-at "[^|\n\r]* |"))
12679 (c org-table-may-need-update))
12098 (replace-match (concat 12680 (replace-match (concat
12099 (substring (match-string 0) 1 -1) 12681 (substring (match-string 0) 1 -1)
12100 " |")) 12682 " |"))
12101 (goto-char pos))) 12683 (goto-char pos)
12684 ;; noalign: if there were two spaces at the end, this field
12685 ;; does not determine the width of the column.
12686 (if noalign (setq org-table-may-need-update c))))
12102 (delete-char N))) 12687 (delete-char N)))
12103 12688
12104;; How to do this: Measure non-white length of current string 12689;; How to do this: Measure non-white length of current string
@@ -12287,22 +12872,42 @@ See the individual commands for more information."
12287 (org-paste-subtree arg))) 12872 (org-paste-subtree arg)))
12288 12873
12289(defun org-ctrl-c-ctrl-c (&optional arg) 12874(defun org-ctrl-c-ctrl-c (&optional arg)
12290 "Call realign table, or recognize a table.el table, or update keywords. 12875 "Set tags in headline, or update according to changed information at point.
12291When the cursor is inside a table created by the table.el package, 12876
12292activate that table. Otherwise, if the cursor is at a normal table 12877This command does many different things, depending on context:
12293created with org.el, re-align that table. This command works even if 12878
12294the automatic table editor has been turned off. 12879- If the cursor is in a headline, prompt for tags and insert them
12295 12880 into the current line, aligned to `org-tags-column'. When called
12296If the cursor is in a headline, prompt for tags and insert them into 12881 with prefix arg, realign all tags in the current buffer.
12297the current line, aligned to `org-tags-column'. When in a headline and 12882
12298called with prefix arg, realign all tags in the current buffer. 12883- If the cursor is in one of the special #+KEYWORD lines, this
12299 12884 triggers scanning the buffer for these lines and updating the
12300If the cursor is in one of the special #+KEYWORD lines, this triggers 12885 information.
12301scanning the buffer for these lines and updating the information. 12886
12302If the cursor is on a #+TBLFM line, re-apply the formulae to the table." 12887- If the cursor is inside a table, realign the table. This command
12888 works even if the automatic table editor has been turned off.
12889
12890- If the cursor is on a #+TBLFM line, re-apply the formulas to
12891 the entire table.
12892
12893- If the cursor is inside a table created by the table.el package,
12894 activate that table.
12895
12896- If the current buffer is a remember buffer, close note and file it.
12897 with a prefix argument, file it without further interaction to the default
12898 location.
12899
12900- If the cursor is on a <<<target>>>, update radio targets and corresponding
12901 links in this buffer.
12902
12903- If the cursor is on a numbered item in a plain list, renumber the
12904 ordered list."
12303 (interactive "P") 12905 (interactive "P")
12304 (let ((org-enable-table-editor t)) 12906 (let ((org-enable-table-editor t))
12305 (cond 12907 (cond
12908 ((and (local-variable-p 'org-finish-function (current-buffer))
12909 (fboundp org-finish-function))
12910 (funcall org-finish-function))
12306 ((org-on-target-p) (org-update-radio-target-regexp)) 12911 ((org-on-target-p) (org-update-radio-target-regexp))
12307 ((org-on-heading-p) (org-set-tags arg)) 12912 ((org-on-heading-p) (org-set-tags arg))
12308 ((org-at-table.el-p) 12913 ((org-at-table.el-p)
@@ -12328,14 +12933,6 @@ If the cursor is on a #+TBLFM line, re-apply the formulae to the table."
12328 (if (org-at-table-p) (org-table-recalculate t)))) 12933 (if (org-at-table-p) (org-table-recalculate t))))
12329 (t 12934 (t
12330 (org-mode-restart)))) 12935 (org-mode-restart))))
12331 ((org-region-active-p)
12332 (org-table-convert-region (region-beginning) (region-end) arg))
12333 ((condition-case nil
12334 (and (region-beginning) (region-end))
12335 (error nil))
12336 (if (y-or-n-p "Convert inactive region to table? ")
12337 (org-table-convert-region (region-beginning) (region-end) arg)
12338 (error "Abort")))
12339 (t (error "C-c C-c can do nothing useful at this location."))))) 12936 (t (error "C-c C-c can do nothing useful at this location.")))))
12340 12937
12341(defun org-mode-restart () 12938(defun org-mode-restart ()
@@ -12377,13 +12974,16 @@ See the individual commands for more information."
12377 ["Next Row" org-return (org-at-table-p)] 12974 ["Next Row" org-return (org-at-table-p)]
12378 "--" 12975 "--"
12379 ["Blank Field" org-table-blank-field (org-at-table-p)] 12976 ["Blank Field" org-table-blank-field (org-at-table-p)]
12977 ["Edit Field" org-table-edit-field (org-at-table-p)]
12380 ["Copy Field from Above" org-table-copy-down (org-at-table-p)] 12978 ["Copy Field from Above" org-table-copy-down (org-at-table-p)]
12381 "--" 12979 "--"
12382 ("Column" 12980 ("Column"
12383 ["Move Column Left" org-metaleft (org-at-table-p)] 12981 ["Move Column Left" org-metaleft (org-at-table-p)]
12384 ["Move Column Right" org-metaright (org-at-table-p)] 12982 ["Move Column Right" org-metaright (org-at-table-p)]
12385 ["Delete Column" org-shiftmetaleft (org-at-table-p)] 12983 ["Delete Column" org-shiftmetaleft (org-at-table-p)]
12386 ["Insert Column" org-shiftmetaright (org-at-table-p)]) 12984 ["Insert Column" org-shiftmetaright (org-at-table-p)]
12985 "--"
12986 ["Enable Narrowing" (setq org-table-limit-column-width (not org-table-limit-column-width)) :active (org-at-table-p) :selected org-table-limit-column-width :style toggle])
12387 ("Row" 12987 ("Row"
12388 ["Move Row Up" org-metaup (org-at-table-p)] 12988 ["Move Row Up" org-metaup (org-at-table-p)]
12389 ["Move Row Down" org-metadown (org-at-table-p)] 12989 ["Move Row Down" org-metadown (org-at-table-p)]
@@ -12414,12 +13014,9 @@ See the individual commands for more information."
12414 (setq org-table-formula-debug (not org-table-formula-debug)) 13014 (setq org-table-formula-debug (not org-table-formula-debug))
12415 :style toggle :selected org-table-formula-debug] 13015 :style toggle :selected org-table-formula-debug]
12416 "--" 13016 "--"
12417 ["Invisible Vlines" org-table-toggle-vline-visibility
12418 :style toggle :selected (org-in-invisibility-spec-p '(org-table))]
12419 "--"
12420 ["Create" org-table-create (and (not (org-at-table-p)) 13017 ["Create" org-table-create (and (not (org-at-table-p))
12421 org-enable-table-editor)] 13018 org-enable-table-editor)]
12422 ["Convert Region" org-ctrl-c-ctrl-c (not (org-at-table-p 'any))] 13019 ["Convert Region" org-table-convert-region (not (org-at-table-p 'any))]
12423 ["Import from File" org-table-import (not (org-at-table-p))] 13020 ["Import from File" org-table-import (not (org-at-table-p))]
12424 ["Export to File" org-table-export (org-at-table-p)] 13021 ["Export to File" org-table-export (org-at-table-p)]
12425 "--" 13022 "--"
@@ -12493,14 +13090,26 @@ See the individual commands for more information."
12493 ("Hyperlinks" 13090 ("Hyperlinks"
12494 ["Store Link (Global)" org-store-link t] 13091 ["Store Link (Global)" org-store-link t]
12495 ["Insert Link" org-insert-link t] 13092 ["Insert Link" org-insert-link t]
12496 ["Follow Link" org-open-at-point t]) 13093 ["Follow Link" org-open-at-point t]
13094 "--"
13095 ["Descriptive Links"
13096 (progn (org-add-to-invisibility-spec '(org-link)) (org-restart-font-lock))
13097 :style radio :selected (member '(org-link) buffer-invisibility-spec)]
13098 ["Literal Links"
13099 (progn
13100 (org-remove-from-invisibility-spec '(org-link)) (org-restart-font-lock))
13101 :style radio :selected (not (member '(org-link) buffer-invisibility-spec))]
13102 "--"
13103 ["Upgrade all <link> to [[link][desc]]" org-upgrade-old-links
13104 (save-excursion (goto-char (point-min))
13105 (re-search-forward "<[a-z]+:" nil t))])
12497 "--" 13106 "--"
12498 ("Export" 13107 ("Export"
12499 ["ASCII" org-export-as-ascii t] 13108 ["ASCII" org-export-as-ascii t]
12500 ["Extract Visible Text" org-export-copy-visible t] 13109 ["Extract Visible Text" org-export-copy-visible t]
12501 ["HTML" org-export-as-html t] 13110 ["HTML" org-export-as-html t]
12502 ["HTML and Open" org-export-as-html-and-open t] 13111 ["HTML and Open" org-export-as-html-and-open t]
12503; ["OPML" org-export-as-opml nil] 13112 ["XML (XOXO)" org-export-as-xml t]
12504 "--" 13113 "--"
12505 ["iCalendar this file" org-export-icalendar-this-file t] 13114 ["iCalendar this file" org-export-icalendar-this-file t]
12506 ["iCalendar all agenda files" org-export-icalendar-all-agenda-files 13115 ["iCalendar all agenda files" org-export-icalendar-all-agenda-files
@@ -12516,7 +13125,7 @@ See the individual commands for more information."
12516 ("Customize" 13125 ("Customize"
12517 ["Browse Org Group" org-customize t] 13126 ["Browse Org Group" org-customize t]
12518 "--" 13127 "--"
12519 ["Build Full Customize Menu" org-create-customize-menu 13128 ["Expand This Menu" org-create-customize-menu
12520 (fboundp 'customize-menu-create)]) 13129 (fboundp 'customize-menu-create)])
12521 "--" 13130 "--"
12522 ["Refresh setup" org-mode-restart t] 13131 ["Refresh setup" org-mode-restart t]
@@ -12530,16 +13139,22 @@ With optional NODE, go directly to that node."
12530 (Info-goto-node (format "(org)%s" (or node "")))) 13139 (Info-goto-node (format "(org)%s" (or node ""))))
12531 13140
12532(defun org-install-agenda-files-menu () 13141(defun org-install-agenda-files-menu ()
12533 (easy-menu-change 13142 (let ((bl (buffer-list)))
12534 '("Org") "File List for Agenda" 13143 (save-excursion
12535 (append 13144 (while bl
12536 (list 13145 (set-buffer (pop bl))
12537 ["Edit File List" (customize-variable 'org-agenda-files) t] 13146 (if (eq major-mode 'org-mode) (setq bl nil)))
12538 ["Add/Move Current File to Front of List" org-agenda-file-to-front t] 13147 (when (eq major-mode 'org-mode)
12539 ["Remove Current File from List" org-remove-file t] 13148 (easy-menu-change
12540 ["Cycle through agenda files" org-cycle-agenda-files t] 13149 '("Org") "File List for Agenda"
12541 "--") 13150 (append
12542 (mapcar 'org-file-menu-entry org-agenda-files)))) 13151 (list
13152 ["Edit File List" (org-edit-agenda-file-list) t]
13153 ["Add/Move Current File to Front of List" org-agenda-file-to-front t]
13154 ["Remove Current File from List" org-remove-file t]
13155 ["Cycle through agenda files" org-cycle-agenda-files t]
13156 "--")
13157 (mapcar 'org-file-menu-entry (org-agenda-files t))))))))
12543 13158
12544;;; Documentation 13159;;; Documentation
12545 13160
@@ -12623,9 +13238,10 @@ With optional NODE, go directly to that node."
12623 ;; through to `fill-paragraph' when appropriate. 13238 ;; through to `fill-paragraph' when appropriate.
12624 (set (make-local-variable 'fill-paragraph-function) 'org-fill-paragraph) 13239 (set (make-local-variable 'fill-paragraph-function) 'org-fill-paragraph)
12625 ;; Adaptive filling: To get full control, first make sure that 13240 ;; Adaptive filling: To get full control, first make sure that
12626 ;; `adaptive-fill-regexp' never matches. Then install our won matcher. 13241 ;; `adaptive-fill-regexp' never matches. Then install our own matcher.
12627 (setq adaptive-fill-regexp "\000") 13242 (set (make-local-variable 'adaptive-fill-regexp) "\000")
12628 (setq adaptive-fill-function 'org-adaptive-fill-function)) 13243 (set (make-local-variable 'adaptive-fill-function)
13244 'org-adaptive-fill-function))
12629 13245
12630(defun org-fill-paragraph (&optional justify) 13246(defun org-fill-paragraph (&optional justify)
12631 "Re-align a table, pass through to fill-paragraph if no table." 13247 "Re-align a table, pass through to fill-paragraph if no table."
@@ -12650,7 +13266,7 @@ work correctly."
12650 13266
12651(defun org-add-hook (hook function &optional append local) 13267(defun org-add-hook (hook function &optional append local)
12652 "Add-hook, compatible with both Emacsen." 13268 "Add-hook, compatible with both Emacsen."
12653 (if (and local org-xemacs-p) 13269 (if (and local (featurep 'xemacs))
12654 (add-local-hook hook function append) 13270 (add-local-hook hook function append)
12655 (add-hook hook function append local))) 13271 (add-hook hook function append local)))
12656 13272
@@ -12659,7 +13275,7 @@ work correctly."
12659Works on both Emacs and XEmacs." 13275Works on both Emacs and XEmacs."
12660 (if org-ignore-region 13276 (if org-ignore-region
12661 nil 13277 nil
12662 (if org-xemacs-p 13278 (if (featurep 'xemacs)
12663 (and zmacs-regions (region-active-p)) 13279 (and zmacs-regions (region-active-p))
12664 (and transient-mark-mode mark-active)))) 13280 (and transient-mark-mode mark-active))))
12665 13281
@@ -12795,10 +13411,10 @@ If INVISIBLE-OK is non-nil, an invisible heading line is ok too."
12795 (save-excursion 13411 (save-excursion
12796 (skip-chars-forward "<") 13412 (skip-chars-forward "<")
12797 (and (re-search-backward "<<" nil t) 13413 (and (re-search-backward "<<" nil t)
12798 (or (looking-at org-target-regexp) 13414 (or (looking-at org-radio-target-regexp)
12799 (looking-at org-radio-target-regexp)) 13415 (looking-at org-target-regexp))
12800 (<= (match-beginning 0) pos) 13416 (<= (match-beginning 0) pos)
12801 (>= (match-end 0) pos))))) 13417 (>= (1+ (match-end 0)) pos)))))
12802 13418
12803(defun org-up-heading-all (arg) 13419(defun org-up-heading-all (arg)
12804 "Move to the heading line of which the present line is a subheading. 13420 "Move to the heading line of which the present line is a subheading.
@@ -12900,7 +13516,6 @@ Show the heading too, if it is currently invisible."
12900 (or (match-beginning 1) (point-max))) 13516 (or (match-beginning 1) (point-max)))
12901 (if org-noutline-p nil ?\n)))) 13517 (if org-noutline-p nil ?\n))))
12902 13518
12903
12904(defun org-make-options-regexp (kwds) 13519(defun org-make-options-regexp (kwds)
12905 "Make a regular expression for keyword lines." 13520 "Make a regular expression for keyword lines."
12906 (concat 13521 (concat
@@ -12936,3 +13551,4 @@ Show the heading too, if it is currently invisible."
12936 13551
12937;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd 13552;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
12938;;; org.el ends here 13553;;; org.el ends here
13554
diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el
index 1c3e1baa9b1..ce1dbf8993b 100644
--- a/lisp/textmodes/picture.el
+++ b/lisp/textmodes/picture.el
@@ -758,8 +758,9 @@ they are not defaultly assigned to keys."
758 758
759(defun picture-mode-exit (&optional nostrip) 759(defun picture-mode-exit (&optional nostrip)
760 "Undo `picture-mode' and return to previous major mode. 760 "Undo `picture-mode' and return to previous major mode.
761With no argument strips whitespace from end of every line in Picture buffer 761With no argument, strip whitespace from end of every line in Picture buffer;
762 otherwise just return to previous mode." 762 otherwise, just return to previous mode.
763Runs `picture-mode-exit-hook' at the end."
763 (interactive "P") 764 (interactive "P")
764 (if (not (eq major-mode 'picture-mode)) 765 (if (not (eq major-mode 'picture-mode))
765 (error "You aren't editing a Picture") 766 (error "You aren't editing a Picture")
@@ -769,7 +770,8 @@ With no argument strips whitespace from end of every line in Picture buffer
769 (setq major-mode picture-mode-old-major-mode) 770 (setq major-mode picture-mode-old-major-mode)
770 (kill-local-variable 'tab-stop-list) 771 (kill-local-variable 'tab-stop-list)
771 (setq truncate-lines picture-mode-old-truncate-lines) 772 (setq truncate-lines picture-mode-old-truncate-lines)
772 (force-mode-line-update))) 773 (force-mode-line-update)
774 (run-hooks 'picture-mode-exit-hook)))
773 775
774(provide 'picture) 776(provide 'picture)
775 777
diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el
index 76373980be2..2f6d860bd21 100644
--- a/lisp/time-stamp.el
+++ b/lisp/time-stamp.el
@@ -5,7 +5,7 @@
5 5
6;; This file is part of GNU Emacs. 6;; This file is part of GNU Emacs.
7 7
8;; Maintainer's Time-stamp: <2006-02-06 15:11:58 ttn> 8;; Maintainer's Time-stamp: <2006-04-12 20:30:56 rms>
9;; Maintainer: Stephen Gildea <gildea@stop.mail-abuse.org> 9;; Maintainer: Stephen Gildea <gildea@stop.mail-abuse.org>
10;; Keywords: tools 10;; Keywords: tools
11 11
@@ -93,6 +93,7 @@ historical default."
93 :type 'string 93 :type 'string
94 :group 'time-stamp 94 :group 'time-stamp
95 :version "20.1") 95 :version "20.1")
96;;;###autoload(put 'time-stamp-format 'safe-local-variable 'stringp)
96 97
97(defcustom time-stamp-active t 98(defcustom time-stamp-active t
98 "*Non-nil to enable time-stamping of buffers by \\[time-stamp]. 99 "*Non-nil to enable time-stamping of buffers by \\[time-stamp].
@@ -150,7 +151,7 @@ Do not change `time-stamp-line-limit', `time-stamp-start',
150incompatible with other people's files! If you must change them for some 151incompatible with other people's files! If you must change them for some
151application, do so in the local variables section of the time-stamped file 152application, do so in the local variables section of the time-stamped file
152itself.") 153itself.")
153 154;;;###autoload(put 'time-stamp-line-limit 'safe-local-variable 'integerp)
154 155
155(defvar time-stamp-start "Time-stamp:[ \t]+\\\\?[\"<]+" ;Do not change! 156(defvar time-stamp-start "Time-stamp:[ \t]+\\\\?[\"<]+" ;Do not change!
156 "Regexp after which the time stamp is written by \\[time-stamp]. 157 "Regexp after which the time stamp is written by \\[time-stamp].
@@ -163,7 +164,7 @@ Do not change `time-stamp-line-limit', `time-stamp-start',
163incompatible with other people's files! If you must change them for some 164incompatible with other people's files! If you must change them for some
164application, do so in the local variables section of the time-stamped file 165application, do so in the local variables section of the time-stamped file
165itself.") 166itself.")
166 167;;;###autoload(put 'time-stamp-start 'safe-local-variable t)
167 168
168(defvar time-stamp-end "\\\\?[\">]" ;Do not change! 169(defvar time-stamp-end "\\\\?[\">]" ;Do not change!
169 "Regexp marking the text after the time stamp. 170 "Regexp marking the text after the time stamp.
@@ -183,6 +184,7 @@ Do not change `time-stamp-start', `time-stamp-end', `time-stamp-pattern',
183or `time-stamp-inserts-lines' for yourself or you will be incompatible 184or `time-stamp-inserts-lines' for yourself or you will be incompatible
184with other people's files! If you must change them for some application, 185with other people's files! If you must change them for some application,
185do so in the local variables section of the time-stamped file itself.") 186do so in the local variables section of the time-stamped file itself.")
187;;;###autoload(put 'time-stamp-end 'safe-local-variable t)
186 188
187 189
188(defvar time-stamp-inserts-lines nil ;Do not change! 190(defvar time-stamp-inserts-lines nil ;Do not change!
@@ -199,6 +201,7 @@ Do not change `time-stamp-end' or `time-stamp-inserts-lines' for
199yourself or you will be incompatible with other people's files! 201yourself or you will be incompatible with other people's files!
200If you must change them for some application, do so in the local 202If you must change them for some application, do so in the local
201variables section of the time-stamped file itself.") 203variables section of the time-stamped file itself.")
204;;;###autoload(put 'time-stamp-inserts-lines 'safe-local-variable t)
202 205
203 206
204(defvar time-stamp-count 1 ;Do not change! 207(defvar time-stamp-count 1 ;Do not change!
@@ -209,6 +212,7 @@ Do not change `time-stamp-count' for yourself or you will be
209incompatible with other people's files! If you must change it for 212incompatible with other people's files! If you must change it for
210some application, do so in the local variables section of the 213some application, do so in the local variables section of the
211time-stamped file itself.") 214time-stamped file itself.")
215;;;###autoload(put 'time-stamp-count 'safe-local-variable 'integerp)
212 216
213 217
214(defvar time-stamp-pattern nil ;Do not change! 218(defvar time-stamp-pattern nil ;Do not change!
@@ -244,6 +248,7 @@ Do not change `time-stamp-pattern' `time-stamp-line-limit',
244incompatible with other people's files! If you must change them for 248incompatible with other people's files! If you must change them for
245some application, do so only in the local variables section of the 249some application, do so only in the local variables section of the
246time-stamped file itself.") 250time-stamped file itself.")
251;;;###autoload(put 'time-stamp-pattern 'safe-local-variable 'stringp)
247 252
248 253
249 254
diff --git a/lisp/vc.el b/lisp/vc.el
index b130aadb085..61b8aa05a4b 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -584,9 +584,9 @@ See `run-hooks'."
584 :group 'vc 584 :group 'vc
585 :version "21.1") 585 :version "21.1")
586 586
587(defcustom vc-annotate-display-mode nil 587(defcustom vc-annotate-display-mode 'fullscale
588 "Which mode to color the output of \\[vc-annotate] with by default." 588 "Which mode to color the output of \\[vc-annotate] with by default."
589 :type '(choice (const :tag "Default" nil) 589 :type '(choice (const :tag "By Color Map Range" nil)
590 (const :tag "Scale to Oldest" scale) 590 (const :tag "Scale to Oldest" scale)
591 (const :tag "Scale Oldest->Newest" fullscale) 591 (const :tag "Scale Oldest->Newest" fullscale)
592 (number :tag "Specify Fractional Number of Days" 592 (number :tag "Specify Fractional Number of Days"
@@ -617,30 +617,64 @@ version control backend imposes itself."
617 617
618;; Annotate customization 618;; Annotate customization
619(defcustom vc-annotate-color-map 619(defcustom vc-annotate-color-map
620 '(( 20. . "#FFCC00") 620 (if (and (tty-display-color-p) (<= (display-color-cells) 8))
621 ( 40. . "#FF6666") 621 ;; A custom sorted TTY colormap
622 ( 60. . "#FF6600") 622 (let* ((colors
623 ( 80. . "#FF3300") 623 (sort
624 (100. . "#FF00FF") 624 (delq nil
625 (120. . "#FF0000") 625 (mapcar (lambda (x)
626 (140. . "#CCCC00") 626 (if (not (or
627 (160. . "#CC00CC") 627 (string-equal (car x) "white")
628 (180. . "#BC8F8F") 628 (string-equal (car x) "black") ))
629 (200. . "#99CC00") 629 (car x)))
630 (220. . "#999900") 630 (tty-color-alist)))
631 (240. . "#7AC5CD") 631 (lambda (a b)
632 (260. . "#66CC00") 632 (cond
633 (280. . "#33CC33") 633 ((or (string-equal a "red") (string-equal b "blue")) t)
634 (300. . "#00CCFF") 634 ((or (string-equal b "red") (string-equal a "blue")) nil)
635 (320. . "#00CC99") 635 ((string-equal a "yellow") t)
636 (340. . "#0099FF")) 636 ((string-equal b "yellow") nil)
637 ((string-equal a "cyan") t)
638 ((string-equal b "cyan") nil)
639 ((string-equal a "green") t)
640 ((string-equal b "green") nil)
641 ((string-equal a "magenta") t)
642 ((string-equal b "magenta") nil)
643 (t (string< a b))))))
644 (date 20.)
645 (delta (/ (- 360. date) (1- (length colors)))))
646 (mapcar (lambda (x)
647 (prog1
648 (cons date x)
649 (setq date (+ date delta)))) colors))
650 ;; Normal colormap: hue stepped from 0-240deg, value=1., saturation=0.75
651 '(( 20. . "#FF3F3F")
652 ( 40. . "#FF6C3F")
653 ( 60. . "#FF993F")
654 ( 80. . "#FFC63F")
655 (100. . "#FFF33F")
656 (120. . "#DDFF3F")
657 (140. . "#B0FF3F")
658 (160. . "#83FF3F")
659 (180. . "#56FF3F")
660 (200. . "#3FFF56")
661 (220. . "#3FFF83")
662 (240. . "#3FFFB0")
663 (260. . "#3FFFDD")
664 (280. . "#3FF3FF")
665 (300. . "#3FC6FF")
666 (320. . "#3F99FF")
667 (340. . "#3F6CFF")
668 (360. . "#3F3FFF")))
637 "Association list of age versus color, for \\[vc-annotate]. 669 "Association list of age versus color, for \\[vc-annotate].
638Ages are given in units of fractional days. Default is eighteen steps 670Ages are given in units of fractional days. Default is eighteen
639using a twenty day increment." 671steps using a twenty day increment, from red to blue. For TTY
672displays with 8 or fewer colors, the default is red to blue with
673all other colors between (excluding black and white)."
640 :type 'alist 674 :type 'alist
641 :group 'vc) 675 :group 'vc)
642 676
643(defcustom vc-annotate-very-old-color "#0046FF" 677(defcustom vc-annotate-very-old-color "#3F3FFF"
644 "Color for lines older than the current color range in \\[vc-annotate]]." 678 "Color for lines older than the current color range in \\[vc-annotate]]."
645 :type 'string 679 :type 'string
646 :group 'vc) 680 :group 'vc)
@@ -852,7 +886,7 @@ However, before executing BODY, find FILE, and after BODY, save buffer."
852 (if vc-dired-mode 886 (if vc-dired-mode
853 (set-buffer (find-file-noselect (dired-get-filename))) 887 (set-buffer (find-file-noselect (dired-get-filename)))
854 (while vc-parent-buffer 888 (while vc-parent-buffer
855 (pop-to-buffer vc-parent-buffer)) 889 (set-buffer vc-parent-buffer))
856 (if (not buffer-file-name) 890 (if (not buffer-file-name)
857 (error "Buffer %s is not associated with a file" (buffer-name)) 891 (error "Buffer %s is not associated with a file" (buffer-name))
858 (if (not (vc-backend buffer-file-name)) 892 (if (not (vc-backend buffer-file-name))
@@ -2971,7 +3005,7 @@ cover the range from the oldest annotation to the newest."
2971(easy-menu-define vc-annotate-mode-menu vc-annotate-mode-map 3005(easy-menu-define vc-annotate-mode-menu vc-annotate-mode-map
2972 "VC Annotate Display Menu" 3006 "VC Annotate Display Menu"
2973 `("VC-Annotate" 3007 `("VC-Annotate"
2974 ["Default" (unless (null vc-annotate-display-mode) 3008 ["By Color Map Range" (unless (null vc-annotate-display-mode)
2975 (setq vc-annotate-display-mode nil) 3009 (setq vc-annotate-display-mode nil)
2976 (vc-annotate-display-select)) 3010 (vc-annotate-display-select))
2977 :style toggle :selected (null vc-annotate-display-mode)] 3011 :style toggle :selected (null vc-annotate-display-mode)]
@@ -3013,11 +3047,7 @@ BUFFER. `vc-annotate-display-mode' specifies the highlighting mode to
3013use; you may override this using the second optional arg MODE." 3047use; you may override this using the second optional arg MODE."
3014 (interactive) 3048 (interactive)
3015 (if mode (setq vc-annotate-display-mode mode)) 3049 (if mode (setq vc-annotate-display-mode mode))
3016 (when buffer 3050 (pop-to-buffer (or buffer (current-buffer)))
3017 (set-buffer buffer)
3018 (display-buffer buffer))
3019 (if (not vc-annotate-parent-rev)
3020 (vc-annotate-mode))
3021 (cond ((null vc-annotate-display-mode) 3051 (cond ((null vc-annotate-display-mode)
3022 ;; The ratio is global, thus relative to the global color-map. 3052 ;; The ratio is global, thus relative to the global color-map.
3023 (kill-local-variable 'vc-annotate-color-map) 3053 (kill-local-variable 'vc-annotate-color-map)
@@ -3077,7 +3107,11 @@ colors. `vc-annotate-background' specifies the background color."
3077 (vc-ensure-vc-buffer) 3107 (vc-ensure-vc-buffer)
3078 (setq vc-annotate-display-mode display-mode) ;Not sure why. --Stef 3108 (setq vc-annotate-display-mode display-mode) ;Not sure why. --Stef
3079 (let* ((temp-buffer-name (format "*Annotate %s (rev %s)*" (buffer-name) rev)) 3109 (let* ((temp-buffer-name (format "*Annotate %s (rev %s)*" (buffer-name) rev))
3080 (temp-buffer-show-function 'vc-annotate-display-select)) 3110 (temp-buffer-show-function 'vc-annotate-display-select)
3111 ;; If BUF is specified, we presume the caller maintains current line,
3112 ;; so we don't need to do it here. This implementation may give
3113 ;; strange results occasionally in the case of REV != WORKFILE-REV.
3114 (current-line (unless buf (line-number-at-pos))))
3081 (message "Annotating...") 3115 (message "Annotating...")
3082 ;; If BUF is specified it tells in which buffer we should put the 3116 ;; If BUF is specified it tells in which buffer we should put the
3083 ;; annotations. This is used when switching annotations to another 3117 ;; annotations. This is used when switching annotations to another
@@ -3087,15 +3121,21 @@ colors. `vc-annotate-background' specifies the background color."
3087 ;; In case it had to be uniquified. 3121 ;; In case it had to be uniquified.
3088 (setq temp-buffer-name (buffer-name)))) 3122 (setq temp-buffer-name (buffer-name))))
3089 (with-output-to-temp-buffer temp-buffer-name 3123 (with-output-to-temp-buffer temp-buffer-name
3090 (vc-call annotate-command file (get-buffer temp-buffer-name) rev)) 3124 (vc-call annotate-command file (get-buffer temp-buffer-name) rev)
3091 (with-current-buffer temp-buffer-name 3125 ;; we must setup the mode first, and then set our local
3092 (set (make-local-variable 'vc-annotate-backend) (vc-backend file)) 3126 ;; variables before the show-function is called at the exit of
3093 (set (make-local-variable 'vc-annotate-parent-file) file) 3127 ;; with-output-to-temp-buffer
3094 (set (make-local-variable 'vc-annotate-parent-rev) rev) 3128 (with-current-buffer temp-buffer-name
3095 (set (make-local-variable 'vc-annotate-parent-display-mode) 3129 (if (not (equal major-mode 'vc-annotate-mode))
3096 display-mode)) 3130 (vc-annotate-mode))
3097 3131 (set (make-local-variable 'vc-annotate-backend) (vc-backend file))
3098 (message "Annotating... done"))) 3132 (set (make-local-variable 'vc-annotate-parent-file) file)
3133 (set (make-local-variable 'vc-annotate-parent-rev) rev)
3134 (set (make-local-variable 'vc-annotate-parent-display-mode)
3135 display-mode)))
3136 (when current-line
3137 (goto-line current-line temp-buffer-name))
3138 (message "Annotating... done")))
3099 3139
3100(defun vc-annotate-prev-version (prefix) 3140(defun vc-annotate-prev-version (prefix)
3101 "Visit the annotation of the version previous to this one. 3141 "Visit the annotation of the version previous to this one.
@@ -3191,7 +3231,8 @@ string, then it describes a revision number, so warp to that
3191revision." 3231revision."
3192 (if (not (equal major-mode 'vc-annotate-mode)) 3232 (if (not (equal major-mode 'vc-annotate-mode))
3193 (message "Cannot be invoked outside of a vc annotate buffer") 3233 (message "Cannot be invoked outside of a vc annotate buffer")
3194 (let* ((oldline (line-number-at-pos)) 3234 (let* ((buf (current-buffer))
3235 (oldline (line-number-at-pos))
3195 (revspeccopy revspec) 3236 (revspeccopy revspec)
3196 (newrev nil)) 3237 (newrev nil))
3197 (cond 3238 (cond
@@ -3218,10 +3259,10 @@ revision."
3218 (when newrev 3259 (when newrev
3219 (vc-annotate vc-annotate-parent-file newrev 3260 (vc-annotate vc-annotate-parent-file newrev
3220 vc-annotate-parent-display-mode 3261 vc-annotate-parent-display-mode
3221 (current-buffer)) 3262 buf)
3222 (goto-line (min oldline (progn (goto-char (point-max)) 3263 (goto-line (min oldline (progn (goto-char (point-max))
3223 (previous-line) 3264 (previous-line)
3224 (line-number-at-pos)))))))) 3265 (line-number-at-pos))) buf)))))
3225 3266
3226(defun vc-annotate-compcar (threshold a-list) 3267(defun vc-annotate-compcar (threshold a-list)
3227 "Test successive cons cells of A-LIST against THRESHOLD. 3268 "Test successive cons cells of A-LIST against THRESHOLD.
@@ -3275,7 +3316,11 @@ The annotations are relative to the current time, unless overridden by OFFSET."
3275 (let* ((color (or (vc-annotate-compcar difference vc-annotate-color-map) 3316 (let* ((color (or (vc-annotate-compcar difference vc-annotate-color-map)
3276 (cons nil vc-annotate-very-old-color))) 3317 (cons nil vc-annotate-very-old-color)))
3277 ;; substring from index 1 to remove any leading `#' in the name 3318 ;; substring from index 1 to remove any leading `#' in the name
3278 (face-name (concat "vc-annotate-face-" (substring (cdr color) 1))) 3319 (face-name (concat "vc-annotate-face-"
3320 (if (string-equal
3321 (substring (cdr color) 0 1) "#")
3322 (substring (cdr color) 1)
3323 (cdr color))))
3279 ;; Make the face if not done. 3324 ;; Make the face if not done.
3280 (face (or (intern-soft face-name) 3325 (face (or (intern-soft face-name)
3281 (let ((tmp-face (make-face (intern face-name)))) 3326 (let ((tmp-face (make-face (intern face-name))))
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 511e011bcd9..c3591cbb64a 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,33 @@
12006-04-15 Michael Olson <mwolson@gnu.org>
2
3 * processes.texi (Transaction Queues): Mention the new optional
4 `delay-question' argument for `tq-enqueue'.
5
62006-04-13 Bill Wohler <wohler@newt.com>
7
8 * customize.texi (Common Keywords): Use dotted notation for
9 :package-version value. Specify its values. Improve documentation
10 for customize-package-emacs-version-alist.
11
122006-04-12 Bill Wohler <wohler@newt.com>
13
14 * customize.texi (Common Keywords): Move description of
15 customize-package-emacs-version-alist to @defvar.
16
172006-04-10 Bill Wohler <wohler@newt.com>
18
19 * customize.texi (Common Keywords): Add :package-version.
20
212006-04-10 Kim F. Storm <storm@cua.dk>
22
23 * text.texi (Buffer Contents): Add NOPROPS arg to
24 filter-buffer-substring.
25
262006-04-08 Kevin Ryde <user42@zip.com.au>
27
28 * os.texi (Command-Line Arguments): Update xref to emacs manual
29 "Command Arguments" -> "Emacs Invocation", per change there.
30
12006-04-08 Thien-Thi Nguyen <ttn@gnu.org> 312006-04-08 Thien-Thi Nguyen <ttn@gnu.org>
2 32
3 * display.texi (Other Display Specs): Arrange a @code{DOTTED-LIST} to 33 * display.texi (Other Display Specs): Arrange a @code{DOTTED-LIST} to
diff --git a/lispref/customize.texi b/lispref/customize.texi
index 1ae3b5b5132..76b1c1a1a93 100644
--- a/lispref/customize.texi
+++ b/lispref/customize.texi
@@ -130,8 +130,49 @@ any effect unless the code which implements the mode is loaded.
130This option specifies that the item was first introduced in Emacs 130This option specifies that the item was first introduced in Emacs
131version @var{version}, or that its default value was changed in that 131version @var{version}, or that its default value was changed in that
132version. The value @var{version} must be a string. 132version. The value @var{version} must be a string.
133
134@item :package-version '(@var{package} . @var{version})
135This option specifies that the item was first introduced in
136@var{package} version @var{version}, or that its default value was
137changed in that version. This keyword takes priority over :version.
138The value of @var{package} is a symbol and @var{version} is a string.
139The @var{package} and @var{version} must appear in the alist
140@code{customize-package-emacs-version-alist}. Since @var{package} must
141be unique and the user might see it in an error message, a good choice
142is the official name of the package, such as MH-E or Gnus.
143
133@end table 144@end table
134 145
146Packages that use the @code{:package-version} keyword must also update
147the @code{customize-package-emacs-version-alist} variable.
148
149@defvar customize-package-emacs-version-alist
150This alist provides a mapping for the versions of Emacs that are
151associated with versions of a package listed in the
152@code{:package-version} keyword. Its elements look like this:
153
154@example
155(@var{package} (@var{pversion} . @var{eversion})@dots{})
156@end example
157
158For each @var{package}, which is a symbol, there are one or more
159elements that contain a package version @var{pversion} with an
160associated Emacs version @var{eversion}. These versions are strings.
161For example, the MH-E package updates this alist with the following:
162
163@smallexample
164(add-to-list 'customize-package-emacs-version-alist
165 '(MH-E ("6.0" . "22.1") ("6.1" . "22.1") ("7.0" . "22.1")
166 ("7.1" . "22.1") ("7.2" . "22.1") ("7.3" . "22.1")
167 ("7.4" . "22.1") ("8.0" . "22.1")))
168@end smallexample
169
170The value of @var{package} needs to be unique and it needs to match
171the @var{package} value appearing in the @code{:package-version}
172keyword. Since the user might see the value in a error message, a good
173choice is the official name of the package, such as MH-E or Gnus.
174@end defvar
175
135@node Group Definitions 176@node Group Definitions
136@section Defining Custom Groups 177@section Defining Custom Groups
137 178
diff --git a/lispref/os.texi b/lispref/os.texi
index 475a8bd8687..f8b43cfa7f0 100644
--- a/lispref/os.texi
+++ b/lispref/os.texi
@@ -404,8 +404,9 @@ remaining command-line arguments in the variable
404arguments is in @code{command-line-args}.) 404arguments is in @code{command-line-args}.)
405 405
406The command-line arguments are parsed by the @code{command-line-1} 406The command-line arguments are parsed by the @code{command-line-1}
407function in the @file{startup.el} file. See also @ref{Command 407function in the @file{startup.el} file. See also @ref{Emacs
408Arguments, , Command Line Arguments, emacs, The GNU Emacs Manual}. 408Invocation, , Command Line Arguments for Emacs Invocation, emacs, The
409GNU Emacs Manual}.
409@end defvar 410@end defvar
410 411
411@defvar command-line-args 412@defvar command-line-args
diff --git a/lispref/processes.texi b/lispref/processes.texi
index 5f0cfb0edf0..44da398770d 100644
--- a/lispref/processes.texi
+++ b/lispref/processes.texi
@@ -1508,7 +1508,7 @@ process, or it may be a TCP connection to a server, possibly on another
1508machine. 1508machine.
1509@end defun 1509@end defun
1510 1510
1511@defun tq-enqueue queue question regexp closure fn 1511@defun tq-enqueue queue question regexp closure fn &optional delay-question
1512This function sends a transaction to queue @var{queue}. Specifying the 1512This function sends a transaction to queue @var{queue}. Specifying the
1513queue has the effect of specifying the subprocess to talk to. 1513queue has the effect of specifying the subprocess to talk to.
1514 1514
@@ -1521,6 +1521,10 @@ The argument @var{regexp} is a regular expression that should match
1521text at the end of the entire answer, but nothing before; that's how 1521text at the end of the entire answer, but nothing before; that's how
1522@code{tq-enqueue} determines where the answer ends. 1522@code{tq-enqueue} determines where the answer ends.
1523 1523
1524If the argument @var{delay-question} is non-nil, delay sending this
1525question until the process has finished replying to any previous
1526questions. This produces more reliable results with some processes."
1527
1524The return value of @code{tq-enqueue} itself is not meaningful. 1528The return value of @code{tq-enqueue} itself is not meaningful.
1525@end defun 1529@end defun
1526 1530
diff --git a/lispref/text.texi b/lispref/text.texi
index 3a0d4f7a585..d506341f0d5 100644
--- a/lispref/text.texi
+++ b/lispref/text.texi
@@ -205,7 +205,7 @@ This is like @code{buffer-substring}, except that it does not copy text
205properties, just the characters themselves. @xref{Text Properties}. 205properties, just the characters themselves. @xref{Text Properties}.
206@end defun 206@end defun
207 207
208@defun filter-buffer-substring start end &optional delete 208@defun filter-buffer-substring start end &optional delete noprops
209This function passes the buffer text between @var{start} and @var{end} 209This function passes the buffer text between @var{start} and @var{end}
210through the filter functions specified by the variable 210through the filter functions specified by the variable
211@code{buffer-substring-filters}, and returns the value from the last 211@code{buffer-substring-filters}, and returns the value from the last
@@ -217,7 +217,12 @@ If @var{delete} is non-@code{nil}, this function deletes the text
217between @var{start} and @var{end} after copying it, like 217between @var{start} and @var{end} after copying it, like
218@code{delete-and-extract-region}. 218@code{delete-and-extract-region}.
219 219
220Lisp code should use this function instead of @code{buffer-substring} 220If @var{noprops} is non-@code{nil}, the final string returned does not
221include text properties, while the string passed through the filters
222still includes text properties from the buffer text.
223
224Lisp code should use this function instead of @code{buffer-substring},
225@code{buffer-substring-no-properties},
221or @code{delete-and-extract-region} when copying into user-accessible 226or @code{delete-and-extract-region} when copying into user-accessible
222data structures such as the kill-ring, X clipboard, and registers. 227data structures such as the kill-ring, X clipboard, and registers.
223Major and minor modes can add functions to 228Major and minor modes can add functions to
diff --git a/mac/ChangeLog b/mac/ChangeLog
index 5da9f7aca76..80e30045dda 100644
--- a/mac/ChangeLog
+++ b/mac/ChangeLog
@@ -1,3 +1,7 @@
12006-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * inc/config.h (pid_t): Define to int.
4
12006-02-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 52006-02-10 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 6
3 * makefile.MPW (shortlisp, SOME_MACHINE_LISP): Sync with 7 * makefile.MPW (shortlisp, SOME_MACHINE_LISP): Sync with
diff --git a/mac/inc/config.h b/mac/inc/config.h
index cdb7fd5b0e8..200e4005ff0 100644
--- a/mac/inc/config.h
+++ b/mac/inc/config.h
@@ -906,7 +906,7 @@ Boston, MA 02110-1301, USA. */
906/* #undef mbstate_t */ 906/* #undef mbstate_t */
907 907
908/* Define to `int' if <sys/types.h> does not define. */ 908/* Define to `int' if <sys/types.h> does not define. */
909/* #undef pid_t */ 909#define pid_t int
910 910
911/* Define to any substitute for sys_siglist. */ 911/* Define to any substitute for sys_siglist. */
912/* #undef sys_siglist */ 912/* #undef sys_siglist */
diff --git a/man/ChangeLog b/man/ChangeLog
index 8bddc6c1c9f..afb891b18b8 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,77 @@
12006-04-13 Carsten Dominik <dominik@science.uva.nl>
2
3 * org.texi: (Updating settings): New section.
4 (Visibility cycling): Better names for the startup folding
5 options.
6 (Exporting): Completely restructured.
7 (The very busy C-c C-c key): New section.
8 (Summary of in-buffer settings): New section.
9
102006-04-12 Richard Stallman <rms@gnu.org>
11
12 * search.texi: Clean up previous change.
13
142006-04-12 Eli Zaretskii <eliz@gnu.org>
15
16 * search.texi (Regexp Backslash, Regexp Replace): Add index
17 entries for ``back reference'' and mention the term itself in the
18 text.
19
202006-04-11 Richard Stallman <rms@gnu.org>
21
22 * custom.texi (Safe File Variables):
23 Document enable-local-variables = :safe.
24
252006-04-11 Karl Berry <karl@gnu.org>
26
27 * emacs-xtra.texi, emacs.texi (Dired under VC, VC Dired Commands,
28 Remote Repositories, Version Backups, Local Version Control,
29 Snapshots, Making and Using Snapshots, Snapshot Caveats,
30 Miscellaneous Commands and Features of VC, Change Logs and VC,
31 Renaming VC Work Files and Master Files,
32 Inserting Version Control Headers, Customizing VC, General Options,
33 Options for RCS and SCCS, Options specific for CVS): move all
34 these nodes to emacs-xtra.texi, for brevity.
35 * cmdargs.texi, files.texi: change cross-references.
36
372006-04-11 Reiner Steib <Reiner.Steib@gmx.de>
38
39 * gnus.texi, gnus-faq.texi, message.texi: Gnus v5.10.8 is released.
40
412006-04-10 Reiner Steib <Reiner.Steib@gmx.de>
42
43 * gnus.texi (Misc Group Stuff, Summary Buffer, Article Keymap)
44 (Server Commands): Key `v' is reserved for users.
45
462006-04-11 J.D. Smith <jdsmith@as.arizona.edu>
47
48 * files.texi (Old Versions): Update description of vc-annotate's
49 use of color to indicate date ranges.
50
512006-04-11 Carsten Dominik <dominik@science.uva.nl>
52
53 * org.texi (Link format): New section, emphasis on bracket links.
54 (External links): Document bracket links.
55 (FAQ): Expanded to cover shell links and the new link format.
56
572006-04-09 Kevin Ryde <user42@zip.com.au>
58
59 * org.texi (Formula syntax): Typo in node name of calc-eval xref.
60
61 * sending.texi (Mail Sending): In send-mail-function @pxref smtpmail,
62 put info and printed manual names the right way around.
63
642006-04-09 Karl Berry <karl@gnu.org>
65
66 * msdog.texi, emacs-xtra.texi: move all the MS-DOS material to
67 emacs-xtra.texi, leaving only MS Windows information.
68 * building.texi, emacs.texi, frames.texi, gnu.texi, macos.texi,
69 msdog.texi, mule.texi, trouble.texi: change cross-references and
70 node names.
71
72 * emacs.texi: move @summarycontents and @contents to the beginning
73 of the file.
74
12006-04-07 Reiner Steib <Reiner.Steib@gmx.de> 752006-04-07 Reiner Steib <Reiner.Steib@gmx.de>
2 76
3 * gnus.texi (Summary Buffer Lines): Add `*'. 77 * gnus.texi (Summary Buffer Lines): Add `*'.
diff --git a/man/building.texi b/man/building.texi
index ccabf22b549..ec44b828022 100644
--- a/man/building.texi
+++ b/man/building.texi
@@ -323,7 +323,7 @@ method to conditionalize them.
323subprocesses; to work around this lack, @kbd{M-x compile} runs the 323subprocesses; to work around this lack, @kbd{M-x compile} runs the
324compilation command synchronously on MS-DOS. As a consequence, you must 324compilation command synchronously on MS-DOS. As a consequence, you must
325wait until the command finishes before you can do anything else in 325wait until the command finishes before you can do anything else in
326Emacs. @xref{MS-DOS}. 326Emacs. @xref{MS-DOS,,,emacs-xtra,Specialized Emacs Features}.
327 327
328@node Grep Searching 328@node Grep Searching
329@section Searching with Grep under Emacs 329@section Searching with Grep under Emacs
diff --git a/man/cmdargs.texi b/man/cmdargs.texi
index f266913d266..f1e7c539f76 100644
--- a/man/cmdargs.texi
+++ b/man/cmdargs.texi
@@ -551,7 +551,7 @@ The name of an interpreter used to parse and execute programs run from
551inside Emacs. 551inside Emacs.
552@item SMTPSERVER 552@item SMTPSERVER
553The name of the outgoing mail server. Used by the SMTP library 553The name of the outgoing mail server. Used by the SMTP library
554(@pxref{Top,,Sending mail via SMTP,smtpmail}). 554(@pxref{Top,,,Sending mail via SMTP,smtpmail}).
555@cindex background mode, on @command{xterm} 555@cindex background mode, on @command{xterm}
556@item TERM 556@item TERM
557The type of the terminal that Emacs is using. This variable must be 557The type of the terminal that Emacs is using. This variable must be
diff --git a/man/custom.texi b/man/custom.texi
index 8429ddaae74..f133e890b0a 100644
--- a/man/custom.texi
+++ b/man/custom.texi
@@ -1227,9 +1227,10 @@ values for these variables, do it directly by customizing
1227 The variable @code{enable-local-variables} allows you to change the 1227 The variable @code{enable-local-variables} allows you to change the
1228way Emacs processes local variables. Its default value is @code{t}, 1228way Emacs processes local variables. Its default value is @code{t},
1229which specifies the behavior described above. If it is @code{nil}, 1229which specifies the behavior described above. If it is @code{nil},
1230Emacs simply ignores all file local variables. Any other value says 1230Emacs simply ignores all file local variables. @code{:safe} means use
1231to query you about each file that has local variables, without trying 1231only the safe values and ignore the rest. Any other value says to
1232to determine whether the values are known to be safe. 1232query you about each file that has local variables, without trying to
1233determine whether the values are known to be safe.
1233 1234
1234@vindex enable-local-eval 1235@vindex enable-local-eval
1235 The variable @code{enable-local-eval} controls whether Emacs 1236 The variable @code{enable-local-eval} controls whether Emacs
diff --git a/man/emacs-xtra.texi b/man/emacs-xtra.texi
index 4aff9716f75..d4a1e5f000e 100644
--- a/man/emacs-xtra.texi
+++ b/man/emacs-xtra.texi
@@ -57,13 +57,16 @@ license to the document, as described in section 6 of the license.
57@menu 57@menu
58* Introduction:: What documentation belongs here? 58* Introduction:: What documentation belongs here?
59* Autorevert:: Auto Reverting non-file buffers. 59* Autorevert:: Auto Reverting non-file buffers.
60* Subdir switches:: Subdirectory switches in Dired. 60* Subdir Switches:: Subdirectory switches in Dired.
61* Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization. 61* Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.
62* Emerge:: A convenient way of merging two versions 62* Emerge:: A convenient way of merging two versions
63 of a program. 63 of a program.
64* Picture Mode:: Editing pictures made up of characters 64* Picture Mode:: Editing pictures made up of characters
65 using the quarter-plane screen model. 65 using the quarter-plane screen model.
66
67* Advanced VC Usage:: Advanced VC (version control) features.
66* Fortran:: Fortran mode and its special features. 68* Fortran:: Fortran mode and its special features.
69* MS-DOG::
67* Index:: 70* Index::
68@end menu 71@end menu
69 72
@@ -272,7 +275,7 @@ for the buffer reliably assures that all information in the buffer is
272completely up to date (or will be after @code{auto-revert-interval} 275completely up to date (or will be after @code{auto-revert-interval}
273seconds). 276seconds).
274 277
275@node Subdir switches 278@node Subdir Switches
276@chapter Subdirectory Switches in Dired 279@chapter Subdirectory Switches in Dired
277 280
278You can insert subdirectories with specified @code{ls} switches in 281You can insert subdirectories with specified @code{ls} switches in
@@ -1888,6 +1891,887 @@ other modes. @kbd{C-c C-y} (@code{picture-yank-rectangle}) inserts
1888@kbd{C-c C-x} (@code{picture-yank-rectangle-from-register}) does 1891@kbd{C-c C-x} (@code{picture-yank-rectangle-from-register}) does
1889likewise for the rectangle found in a specified register. 1892likewise for the rectangle found in a specified register.
1890 1893
1894@node Advanced VC Usage
1895@chapter Advanced VC Usage
1896
1897 Commonly used features of Emacs' version control (VC) support are
1898described in the main Emacs manual (@pxref{Version Control,,,emacs,
1899the Emacs Manual}). This chapter describes more advanced VC usage.
1900
1901@menu
1902* VC Dired Mode:: Listing files managed by version control.
1903* VC Dired Commands:: Commands to use in a VC Dired buffer.
1904* Remote Repositories:: Efficient access to remote CVS servers.
1905* Snapshots:: Sets of file versions treated as a unit.
1906* Miscellaneous VC:: Various other commands and features of VC.
1907* Customizing VC:: Variables that change VC's behavior.
1908@end menu
1909
1910@node VC Dired Mode
1911@section Dired under VC
1912
1913@cindex PCL-CVS
1914@pindex cvs
1915@cindex CVS Dired Mode
1916 The VC Dired Mode described here works with all the version control
1917systems that VC supports. Another more powerful facility, designed
1918specifically for CVS, is called PCL-CVS. @xref{Top, , About PCL-CVS,
1919pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}.
1920
1921@kindex C-x v d
1922@findex vc-directory
1923 When you are working on a large program, it is often useful to find
1924out which files have changed within an entire directory tree, or to view
1925the status of all files under version control at once, and to perform
1926version control operations on collections of files. You can use the
1927command @kbd{C-x v d} (@code{vc-directory}) to make a directory listing
1928that includes only files relevant for version control.
1929
1930@vindex vc-dired-terse-display
1931 @kbd{C-x v d} creates a buffer which uses VC Dired Mode. This looks
1932much like an ordinary Dired buffer (@pxref{Dired,,,emacs, the
1933Emacs Manual}); however, normally it shows only the noteworthy files
1934(those locked or not up-to-date). This is called @dfn{terse display}.
1935If you set the variable @code{vc-dired-terse-display} to @code{nil},
1936then VC Dired shows all relevant files---those managed under version
1937control, plus all subdirectories (@dfn{full display}). The command
1938@kbd{v t} in a VC Dired buffer toggles between terse display and full
1939display (@pxref{VC Dired Commands}).
1940
1941@vindex vc-dired-recurse
1942 By default, VC Dired produces a recursive listing of noteworthy or
1943relevant files at or below the given directory. You can change this by
1944setting the variable @code{vc-dired-recurse} to @code{nil}; then VC
1945Dired shows only the files in the given directory.
1946
1947 The line for an individual file shows the version control state in the
1948place of the hard link count, owner, group, and size of the file. If
1949the file is unmodified, in sync with the master file, the version
1950control state shown is blank. Otherwise it consists of text in
1951parentheses. Under RCS and SCCS, the name of the user locking the file
1952is shown; under CVS, an abbreviated version of the @samp{cvs status}
1953output is used. Here is an example using RCS:
1954
1955@smallexample
1956@group
1957 /home/jim/project:
1958
1959 -rw-r--r-- (jim) Apr 2 23:39 file1
1960 -r--r--r-- Apr 5 20:21 file2
1961@end group
1962@end smallexample
1963
1964@noindent
1965The files @samp{file1} and @samp{file2} are under version control,
1966@samp{file1} is locked by user jim, and @samp{file2} is unlocked.
1967
1968 Here is an example using CVS:
1969
1970@smallexample
1971@group
1972 /home/joe/develop:
1973
1974 -rw-r--r-- (modified) Aug 2 1997 file1.c
1975 -rw-r--r-- Apr 4 20:09 file2.c
1976 -rw-r--r-- (merge) Sep 13 1996 file3.c
1977@end group
1978@end smallexample
1979
1980 Here @samp{file1.c} is modified with respect to the repository, and
1981@samp{file2.c} is not. @samp{file3.c} is modified, but other changes
1982have also been checked in to the repository---you need to merge them
1983with the work file before you can check it in.
1984
1985@vindex vc-stay-local
1986@vindex vc-cvs-stay-local
1987 In the above, if the repository were on a remote machine, VC would
1988only contact it when the variable @code{vc-stay-local} (or
1989@code{vc-cvs-stay-local}) is nil (@pxref{CVS Options}). This is
1990because access to the repository may be slow, or you may be working
1991offline and not have access to the repository at all. As a
1992consequence, VC would not be able to tell you that @samp{file3.c} is
1993in the ``merge'' state; you would learn that only when you try to
1994check-in your modified copy of the file, or use a command such as
1995@kbd{C-x v m}.
1996
1997 In practice, this is not a problem because CVS handles this case
1998consistently whenever it arises. In VC, you'll simply get prompted to
1999merge the remote changes into your work file first. The benefits of
2000less network communication usually outweigh the disadvantage of not
2001seeing remote changes immediately.
2002
2003@vindex vc-directory-exclusion-list
2004 When VC Dired displays subdirectories (in the ``full'' display mode),
2005it omits some that should never contain any files under version control.
2006By default, this includes Version Control subdirectories such as
2007@samp{RCS} and @samp{CVS}; you can customize this by setting the
2008variable @code{vc-directory-exclusion-list}.
2009
2010 You can fine-tune VC Dired's format by typing @kbd{C-u C-x v d}---as in
2011ordinary Dired, that allows you to specify additional switches for the
2012@samp{ls} command.
2013
2014@node VC Dired Commands
2015@section VC Dired Commands
2016
2017 All the usual Dired commands work normally in VC Dired mode, except
2018for @kbd{v}, which is redefined as the version control prefix. You can
2019invoke VC commands such as @code{vc-diff} and @code{vc-print-log} by
2020typing @kbd{v =}, or @kbd{v l}, and so on. Most of these commands apply
2021to the file name on the current line.
2022
2023 The command @kbd{v v} (@code{vc-next-action}) operates on all the
2024marked files, so that you can lock or check in several files at once.
2025If it operates on more than one file, it handles each file according to
2026its current state; thus, it might lock one file, but check in another
2027file. This could be confusing; it is up to you to avoid confusing
2028behavior by marking a set of files that are in a similar state. If no
2029files are marked, @kbd{v v} operates on the file in the current line.
2030
2031 If any files call for check-in, @kbd{v v} reads a single log entry,
2032then uses it for all the files being checked in. This is convenient for
2033registering or checking in several files at once, as part of the same
2034change.
2035
2036@findex vc-dired-toggle-terse-mode
2037@findex vc-dired-mark-locked
2038 You can toggle between terse display (only locked files, or files not
2039up-to-date) and full display at any time by typing @kbd{v t}
2040(@code{vc-dired-toggle-terse-mode}). There is also a special command
2041@kbd{* l} (@code{vc-dired-mark-locked}), which marks all files currently
2042locked (or, with CVS, all files not up-to-date). Thus, typing @kbd{* l
2043t k} is another way to delete from the buffer all files except those
2044currently locked.
2045
2046@node Remote Repositories
2047@section Remote Repositories
2048@cindex remote repositories (CVS)
2049
2050 A common way of using CVS is to set up a central CVS repository on
2051some Internet host, then have each developer check out a personal
2052working copy of the files on his local machine. Committing changes to
2053the repository, and picking up changes from other users into one's own
2054working area, then works by direct interactions with the CVS server.
2055
2056 One difficulty is that access to the CVS server is often slow, and
2057that developers might need to work off-line as well. VC is designed
2058to reduce the amount of network interaction necessary.
2059
2060@menu
2061* Version Backups:: Keeping local copies of repository versions.
2062* Local Version Control:: Using another version system for local editing.
2063@end menu
2064
2065@node Version Backups
2066@subsection Version Backups
2067@cindex version backups
2068
2069@cindex automatic version backups
2070 When VC sees that the CVS repository for a file is on a remote
2071machine, it automatically makes local backups of unmodified versions
2072of the file---@dfn{automatic version backups}. This means that you
2073can compare the file to the repository version (@kbd{C-x v =}), or
2074revert to that version (@kbd{C-x v u}), without any network
2075interactions.
2076
2077 The local copy of the unmodified file is called a @dfn{version
2078backup} to indicate that it corresponds exactly to a version that is
2079stored in the repository. Note that version backups are not the same
2080as ordinary Emacs backup files (@pxref{Backup,,,emacs, the Emacs
2081Manual}). But they follow a similar naming convention.
2082
2083 For a file that comes from a remote CVS repository, VC makes a
2084version backup whenever you save the first changes to the file, and
2085removes it after you have committed your modified version to the
2086repository. You can disable the making of automatic version backups by
2087setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}).
2088
2089@cindex manual version backups
2090 The name of the automatic version backup for version @var{version}
2091of file @var{file} is @code{@var{file}.~@var{version}.~}. This is
2092almost the same as the name used by @kbd{C-x v ~} (@pxref{Old
2093Versions,,,emacs, the Emacs Manual}), the only difference being
2094the additional dot (@samp{.}) after the version number. This
2095similarity is intentional, because both kinds of files store the same
2096kind of information. The file made by @kbd{C-x v ~} acts as a
2097@dfn{manual version backup}.
2098
2099 All the VC commands that operate on old versions of a file can use
2100both kinds of version backups. For instance, @kbd{C-x v ~} uses
2101either an automatic or a manual version backup, if possible, to get
2102the contents of the version you request. Likewise, @kbd{C-x v =} and
2103@kbd{C-x v u} use either an automatic or a manual version backup, if
2104one of them exists, to get the contents of a version to compare or
2105revert to. If you changed a file outside of Emacs, so that no
2106automatic version backup was created for the previous text, you can
2107create a manual backup of that version using @kbd{C-x v ~}, and thus
2108obtain the benefit of the local copy for Emacs commands.
2109
2110 The only difference in Emacs's handling of manual and automatic
2111version backups, once they exist, is that Emacs deletes automatic
2112version backups when you commit to the repository. By contrast,
2113manual version backups remain until you delete them.
2114
2115@node Local Version Control
2116@subsection Local Version Control
2117@cindex local version control
2118@cindex local back end (version control)
2119
2120When you make many changes to a file that comes from a remote
2121repository, it can be convenient to have version control on your local
2122machine as well. You can then record intermediate versions, revert to
2123a previous state, etc., before you actually commit your changes to the
2124remote server.
2125
2126VC lets you do this by putting a file under a second, local version
2127control system, so that the file is effectively registered in two
2128systems at the same time. For the description here, we will assume
2129that the remote system is CVS, and you use RCS locally, although the
2130mechanism works with any combination of version control systems
2131(@dfn{back ends}).
2132
2133To make it work with other back ends, you must make sure that the
2134``more local'' back end comes before the ``more remote'' back end in
2135the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By
2136default, this variable is set up so that you can use remote CVS and
2137local RCS as described here.
2138
2139To start using local RCS for a file that comes from a remote CVS
2140server, you must @emph{register the file in RCS}, by typing @kbd{C-u
2141C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a
2142prefix argument, and specify RCS as the back end.)
2143
2144You can do this at any time; it does not matter whether you have
2145already modified the file with respect to the version in the CVS
2146repository. If possible, VC tries to make the RCS master start with
2147the unmodified repository version, then checks in any local changes
2148as a new version. This works if you have not made any changes yet, or
2149if the unmodified repository version exists locally as a version
2150backup (@pxref{Version Backups}). If the unmodified version is not
2151available locally, the RCS master starts with the modified version;
2152the only drawback to this is that you cannot compare your changes
2153locally to what is stored in the repository.
2154
2155The version number of the RCS master is derived from the current CVS
2156version, starting a branch from it. For example, if the current CVS
2157version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in
2158the RCS master will be identical to version 1.23 under CVS; your first
2159changes are checked in as 1.23.1.1. (If the unmodified file is not
2160available locally, VC will check in the modified file twice, both as
21611.23 and 1.23.1.1, to make the revision numbers consistent.)
2162
2163If you do not use locking under CVS (the default), locking is also
2164disabled for RCS, so that editing under RCS works exactly as under
2165CVS.
2166
2167When you are done with local editing, you can commit the final version
2168back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}.
2169This initializes the log entry buffer (@pxref{Log Buffer,,,emacs, the
2170Emacs Manual}) to contain all the log entries you have recorded in the
2171RCS master; you can edit them as you wish, and then commit in CVS by
2172typing @kbd{C-c C-c}. If the commit is successful, VC removes the RCS
2173master, so that the file is once again registered under CVS only.
2174(The RCS master is not actually deleted, just renamed by appending
2175@samp{~} to the name, so that you can refer to it later if you wish.)
2176
2177While using local RCS, you can pick up recent changes from the CVS
2178repository into your local file, or commit some of your changes back
2179to CVS, without terminating local RCS version control. To do this,
2180switch to the CVS back end temporarily, with the @kbd{C-x v b} command:
2181
2182@table @kbd
2183@item C-x v b
2184Switch to another back end that the current file is registered
2185under (@code{vc-switch-backend}).
2186
2187@item C-u C-x v b @var{backend} @key{RET}
2188Switch to @var{backend} for the current file.
2189@end table
2190
2191@kindex C-x v b
2192@findex vc-switch-backend
2193@kbd{C-x v b} does not change the buffer contents, or any files; it
2194only changes VC's perspective on how to handle the file. Any
2195subsequent VC commands for that file will operate on the back end that
2196is currently selected.
2197
2198If the current file is registered in more than one back end, typing
2199@kbd{C-x v b} ``cycles'' through all of these back ends. With a
2200prefix argument, it asks for the back end to use in the minibuffer.
2201
2202Thus, if you are using local RCS, and you want to pick up some recent
2203changes in the file from remote CVS, first visit the file, then type
2204@kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m
2205@key{RET}} to merge the news (@pxref{Merging,,,emacs, the Emacs
2206Manual}). You can then switch back to RCS by typing @kbd{C-x v b}
2207again, and continue to edit locally.
2208
2209But if you do this, the revision numbers in the RCS master no longer
2210correspond to those of CVS. Technically, this is not a problem, but
2211it can become difficult to keep track of what is in the CVS repository
2212and what is not. So we suggest that you return from time to time to
2213CVS-only operation, by committing your local changes back to the
2214repository using @kbd{C-u C-x v v cvs @key{RET}}.
2215
2216@node Snapshots
2217@section Snapshots
2218@cindex snapshots and version control
2219
2220 A @dfn{snapshot} is a named set of file versions (one for each
2221registered file) that you can treat as a unit. One important kind of
2222snapshot is a @dfn{release}, a (theoretically) stable version of the
2223system that is ready for distribution to users.
2224
2225@menu
2226* Making Snapshots:: The snapshot facilities.
2227* Snapshot Caveats:: Things to be careful of when using snapshots.
2228@end menu
2229
2230@node Making Snapshots
2231@subsection Making and Using Snapshots
2232
2233 There are two basic commands for snapshots; one makes a
2234snapshot with a given name, the other retrieves a named snapshot.
2235
2236@table @code
2237@kindex C-x v s
2238@findex vc-create-snapshot
2239@item C-x v s @var{name} @key{RET}
2240Define the last saved versions of every registered file in or under the
2241current directory as a snapshot named @var{name}
2242(@code{vc-create-snapshot}).
2243
2244@kindex C-x v r
2245@findex vc-retrieve-snapshot
2246@item C-x v r @var{name} @key{RET}
2247For all registered files at or below the current directory level, select
2248whatever versions correspond to the snapshot @var{name}
2249(@code{vc-retrieve-snapshot}).
2250
2251This command reports an error if any files are locked at or below the
2252current directory, without changing anything; this is to avoid
2253overwriting work in progress.
2254@end table
2255
2256 A snapshot uses a very small amount of resources---just enough to record
2257the list of file names and which version belongs to the snapshot. Thus,
2258you need not hesitate to create snapshots whenever they are useful.
2259
2260 You can give a snapshot name as an argument to @kbd{C-x v =} or
2261@kbd{C-x v ~} (@pxref{Old Versions,,,emacs, the Emacs Manual}).
2262Thus, you can use it to compare a snapshot against the current files,
2263or two snapshots against each other, or a snapshot against a named
2264version.
2265
2266@node Snapshot Caveats
2267@subsection Snapshot Caveats
2268
2269@cindex named configurations (RCS)
2270 VC's snapshot facilities are modeled on RCS's named-configuration
2271support. They use RCS's native facilities for this, so
2272snapshots made using RCS through VC are visible even when you bypass VC.
2273
2274 With CVS, Meta-CVS, and Subversion, VC also uses the native
2275mechanism provided by that back end to make snapshots and retrieve them
2276(@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion).
2277
2278@c worded verbosely to avoid overfull hbox.
2279 For SCCS, VC implements snapshots itself. The files it uses contain
2280name/file/version-number triples. These snapshots are visible only
2281through VC.
2282
2283 There is no support for VC snapshots using GNU Arch yet.
2284
2285 A snapshot is a set of checked-in versions. So make sure that all the
2286files are checked in and not locked when you make a snapshot.
2287
2288 File renaming and deletion can create some difficulties with snapshots.
2289This is not a VC-specific problem, but a general design issue in version
2290control systems that no one has solved very well yet.
2291
2292 If you rename a registered file, you need to rename its master along
2293with it (the command @code{vc-rename-file} does this automatically). If
2294you are using SCCS, you must also update the records of the snapshot, to
2295mention the file by its new name (@code{vc-rename-file} does this,
2296too). An old snapshot that refers to a master file that no longer
2297exists under the recorded name is invalid; VC can no longer retrieve
2298it. It would be beyond the scope of this manual to explain enough about
2299RCS and SCCS to explain how to update the snapshots by hand.
2300
2301 Using @code{vc-rename-file} makes the snapshot remain valid for
2302retrieval, but it does not solve all problems. For example, some of the
2303files in your program probably refer to others by name. At the very
2304least, the makefile probably mentions the file that you renamed. If you
2305retrieve an old snapshot, the renamed file is retrieved under its new
2306name, which is not the name that the makefile expects. So the program
2307won't really work as retrieved.
2308
2309@node Miscellaneous VC
2310@section Miscellaneous Commands and Features of VC
2311
2312 This section explains the less-frequently-used features of VC.
2313
2314@menu
2315* Change Logs and VC:: Generating a change log file from log entries.
2316* Renaming and VC:: A command to rename both the source and master
2317 file correctly.
2318* Version Headers:: Inserting version control headers into working files.
2319@end menu
2320
2321@node Change Logs and VC
2322@subsection Change Logs and VC
2323
2324 If you use RCS or CVS for a program and also maintain a change log
2325file for it (@pxref{Change Log,,,emacs, the Emacs Manual}), you
2326can generate change log entries automatically from the version control
2327log entries:
2328
2329@table @kbd
2330@item C-x v a
2331@kindex C-x v a
2332@findex vc-update-change-log
2333Visit the current directory's change log file and, for registered files
2334in that directory, create new entries for versions checked in since the
2335most recent entry in the change log file.
2336(@code{vc-update-change-log}).
2337
2338This command works with RCS or CVS only, not with any of the other
2339back ends.
2340
2341@item C-u C-x v a
2342As above, but only find entries for the current buffer's file.
2343
2344@item M-1 C-x v a
2345As above, but find entries for all the currently visited files that are
2346maintained with version control. This works only with RCS, and it puts
2347all entries in the log for the default directory, which may not be
2348appropriate.
2349@end table
2350
2351 For example, suppose the first line of @file{ChangeLog} is dated
23521999-04-10, and that the only check-in since then was by Nathaniel
2353Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log
2354messages that start with `#'.}. Then @kbd{C-x v a} visits
2355@file{ChangeLog} and inserts text like this:
2356
2357@iftex
2358@medbreak
2359@end iftex
2360@smallexample
2361@group
23621999-05-22 Nathaniel Bowditch <nat@@apn.org>
2363
2364 * rcs2log: Ignore log messages that start with `#'.
2365@end group
2366@end smallexample
2367@iftex
2368@medbreak
2369@end iftex
2370
2371@noindent
2372You can then edit the new change log entry further as you wish.
2373
2374 Some of the new change log entries may duplicate what's already in
2375ChangeLog. You will have to remove these duplicates by hand.
2376
2377 Normally, the log entry for file @file{foo} is displayed as @samp{*
2378foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted
2379if the text of the log entry starts with @w{@samp{(@var{functionname}):
2380}}. For example, if the log entry for @file{vc.el} is
2381@samp{(vc-do-command): Check call-process status.}, then the text in
2382@file{ChangeLog} looks like this:
2383
2384@iftex
2385@medbreak
2386@end iftex
2387@smallexample
2388@group
23891999-05-06 Nathaniel Bowditch <nat@@apn.org>
2390
2391 * vc.el (vc-do-command): Check call-process status.
2392@end group
2393@end smallexample
2394@iftex
2395@medbreak
2396@end iftex
2397
2398 When @kbd{C-x v a} adds several change log entries at once, it groups
2399related log entries together if they all are checked in by the same
2400author at nearly the same time. If the log entries for several such
2401files all have the same text, it coalesces them into a single entry.
2402For example, suppose the most recent check-ins have the following log
2403entries:
2404
2405@flushleft
2406@bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.}
2407@bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.}
2408@bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.}
2409@end flushleft
2410
2411@noindent
2412They appear like this in @file{ChangeLog}:
2413
2414@iftex
2415@medbreak
2416@end iftex
2417@smallexample
2418@group
24191999-04-01 Nathaniel Bowditch <nat@@apn.org>
2420
2421 * vc.texinfo: Fix expansion typos.
2422
2423 * vc.el, vc-hooks.el: Don't call expand-file-name.
2424@end group
2425@end smallexample
2426@iftex
2427@medbreak
2428@end iftex
2429
2430 Normally, @kbd{C-x v a} separates log entries by a blank line, but you
2431can mark several related log entries to be clumped together (without an
2432intervening blank line) by starting the text of each related log entry
2433with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label
2434itself is not copied to @file{ChangeLog}. For example, suppose the log
2435entries are:
2436
2437@flushleft
2438@bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.}
2439@bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.}
2440@bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.}
2441@end flushleft
2442
2443@noindent
2444Then the text in @file{ChangeLog} looks like this:
2445
2446@iftex
2447@medbreak
2448@end iftex
2449@smallexample
2450@group
24511999-04-01 Nathaniel Bowditch <nat@@apn.org>
2452
2453 * vc.texinfo: Fix expansion typos.
2454 * vc.el, vc-hooks.el: Don't call expand-file-name.
2455@end group
2456@end smallexample
2457@iftex
2458@medbreak
2459@end iftex
2460
2461 A log entry whose text begins with @samp{#} is not copied to
2462@file{ChangeLog}. For example, if you merely fix some misspellings in
2463comments, you can log the change with an entry beginning with @samp{#}
2464to avoid putting such trivia into @file{ChangeLog}.
2465
2466@node Renaming and VC
2467@subsection Renaming VC Work Files and Master Files
2468
2469@findex vc-rename-file
2470 When you rename a registered file, you must also rename its master
2471file correspondingly to get proper results. Use @code{vc-rename-file}
2472to rename the source file as you specify, and rename its master file
2473accordingly. It also updates any snapshots (@pxref{Snapshots}) that
2474mention the file, so that they use the new name; despite this, the
2475snapshot thus modified may not completely work (@pxref{Snapshot
2476Caveats}).
2477
2478 Some back ends do not provide an explicit rename operation to their
2479repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v}
2480on the original and renamed buffers and provide the necessary edit
2481log.
2482
2483 You cannot use @code{vc-rename-file} on a file that is locked by
2484someone else.
2485
2486@node Version Headers
2487@subsection Inserting Version Control Headers
2488
2489 Sometimes it is convenient to put version identification strings
2490directly into working files. Certain special strings called
2491@dfn{version headers} are replaced in each successive version by the
2492number of that version, the name of the user who created it, and other
2493relevant information. All of the back ends that VC supports have such
2494a mechanism, except GNU Arch.
2495
2496 VC does not normally use the information contained in these headers.
2497The exception is RCS---with RCS, version headers are sometimes more
2498reliable than the master file to determine which version of the file
2499you are editing. Note that in a multi-branch environment, version
2500headers are necessary to make VC behave correctly (@pxref{Multi-User
2501Branching,,,emacs, the Emacs Manual}).
2502
2503 Searching for RCS version headers is controlled by the variable
2504@code{vc-consult-headers}. If it is non-@code{nil} (the default),
2505Emacs searches for headers to determine the version number you are
2506editing. Setting it to @code{nil} disables this feature.
2507
2508 Note that although CVS uses the same kind of version headers as RCS
2509does, VC never searches for these headers if you are using CVS,
2510regardless of the above setting.
2511
2512@kindex C-x v h
2513@findex vc-insert-headers
2514 You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to
2515insert a suitable header string.
2516
2517@table @kbd
2518@item C-x v h
2519Insert headers in a file for use with your version-control system.
2520@end table
2521
2522@vindex vc-@var{backend}-header
2523 The default header string is @samp{@w{$}Id$} for RCS and
2524@samp{@w{%}W%} for SCCS. You can specify other headers to insert by
2525setting the variables @code{vc-@var{backend}-header} where
2526@var{backend} is @code{rcs} or @code{sccs}.
2527
2528 Instead of a single string, you can specify a list of strings; then
2529each string in the list is inserted as a separate header on a line of
2530its own.
2531
2532 It may be necessary to use apparently-superfluous backslashes when
2533writing the strings that you put in this variable. For instance, you
2534might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}. The extra
2535backslash prevents the string constant from being interpreted as a
2536header, if the Emacs Lisp file containing it is maintained with
2537version control.
2538
2539@vindex vc-comment-alist
2540 Each header is inserted surrounded by tabs, inside comment delimiters,
2541on a new line at point. Normally the ordinary comment
2542start and comment end strings of the current mode are used, but for
2543certain modes, there are special comment delimiters for this purpose;
2544the variable @code{vc-comment-alist} specifies them. Each element of
2545this list has the form @code{(@var{mode} @var{starter} @var{ender})}.
2546
2547@vindex vc-static-header-alist
2548 The variable @code{vc-static-header-alist} specifies further strings
2549to add based on the name of the buffer. Its value should be a list of
2550elements of the form @code{(@var{regexp} . @var{format})}. Whenever
2551@var{regexp} matches the buffer name, @var{format} is inserted as part
2552of the header. A header line is inserted for each element that matches
2553the buffer name, and for each string specified by
2554@code{vc-@var{backend}-header}. The header line is made by processing the
2555string from @code{vc-@var{backend}-header} with the format taken from the
2556element. The default value for @code{vc-static-header-alist} is as follows:
2557
2558@example
2559@group
2560(("\\.c$" .
2561 "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
2562#endif /* lint */\n"))
2563@end group
2564@end example
2565
2566@noindent
2567It specifies insertion of text of this form:
2568
2569@example
2570@group
2571
2572#ifndef lint
2573static char vcid[] = "@var{string}";
2574#endif /* lint */
2575@end group
2576@end example
2577
2578@noindent
2579Note that the text above starts with a blank line.
2580
2581 If you use more than one version header in a file, put them close
2582together in the file. The mechanism in @code{revert-buffer} that
2583preserves markers may not handle markers positioned between two version
2584headers.
2585
2586@node Customizing VC
2587@section Customizing VC
2588
2589@vindex vc-handled-backends
2590The variable @code{vc-handled-backends} determines which version
2591control systems VC should handle. The default value is @code{(RCS CVS
2592SVN SCCS Arch MCVS)}, so it contains all six version systems that are
2593currently supported. If you want VC to ignore one or more of these
2594systems, exclude its name from the list. To disable VC entirely, set
2595this variable to @code{nil}.
2596
2597The order of systems in the list is significant: when you visit a file
2598registered in more than one system (@pxref{Local Version Control}), VC
2599uses the system that comes first in @code{vc-handled-backends} by
2600default. The order is also significant when you register a file for
2601the first time, @pxref{Registering,,,emacs, the Emacs Manual} for
2602details.
2603
2604@menu
2605* General VC Options:: Options that apply to multiple back ends.
2606* RCS and SCCS:: Options for RCS and SCCS.
2607* CVS Options:: Options for CVS.
2608@end menu
2609
2610@node General VC Options
2611@subsection General Options
2612
2613@vindex vc-make-backup-files
2614 Emacs normally does not save backup files for source files that are
2615maintained with version control. If you want to make backup files even
2616for files that use version control, set the variable
2617@code{vc-make-backup-files} to a non-@code{nil} value.
2618
2619@vindex vc-keep-workfiles
2620 Normally the work file exists all the time, whether it is locked or
2621not. If you set @code{vc-keep-workfiles} to @code{nil}, then checking
2622in a new version with @kbd{C-x v v} deletes the work file; but any
2623attempt to visit the file with Emacs creates it again. (With CVS, work
2624files are always kept.)
2625
2626@vindex vc-follow-symlinks
2627 Editing a version-controlled file through a symbolic link can be
2628dangerous. It bypasses the version control system---you can edit the
2629file without locking it, and fail to check your changes in. Also,
2630your changes might overwrite those of another user. To protect against
2631this, VC checks each symbolic link that you visit, to see if it points
2632to a file under version control.
2633
2634 The variable @code{vc-follow-symlinks} controls what to do when a
2635symbolic link points to a version-controlled file. If it is @code{nil},
2636VC only displays a warning message. If it is @code{t}, VC automatically
2637follows the link, and visits the real file instead, telling you about
2638this in the echo area. If the value is @code{ask} (the default), VC
2639asks you each time whether to follow the link.
2640
2641@vindex vc-suppress-confirm
2642 If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v}
2643and @kbd{C-x v i} can save the current buffer without asking, and
2644@kbd{C-x v u} also operates without asking for confirmation. (This
2645variable does not affect @kbd{C-x v c}; that operation is so drastic
2646that it should always ask for confirmation.)
2647
2648@vindex vc-command-messages
2649 VC mode does much of its work by running the shell commands for RCS,
2650CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC
2651displays messages to indicate which shell commands it runs, and
2652additional messages when the commands finish.
2653
2654@vindex vc-path
2655 You can specify additional directories to search for version control
2656programs by setting the variable @code{vc-path}. These directories
2657are searched before the usual search path. It is rarely necessary to
2658set this variable, because VC normally finds the proper files
2659automatically.
2660
2661@node RCS and SCCS
2662@subsection Options for RCS and SCCS
2663
2664@cindex non-strict locking (RCS)
2665@cindex locking, non-strict (RCS)
2666 By default, RCS uses locking to coordinate the activities of several
2667users, but there is a mode called @dfn{non-strict locking} in which
2668you can check-in changes without locking the file first. Use
2669@samp{rcs -U} to switch to non-strict locking for a particular file,
2670see the @code{rcs} manual page for details.
2671
2672 When deducing the version control state of an RCS file, VC first
2673looks for an RCS version header string in the file (@pxref{Version
2674Headers}). If there is no header string, VC normally looks at the
2675file permissions of the work file; this is fast. But there might be
2676situations when the file permissions cannot be trusted. In this case
2677the master file has to be consulted, which is rather expensive. Also
2678the master file can only tell you @emph{if} there's any lock on the
2679file, but not whether your work file really contains that locked
2680version.
2681
2682@vindex vc-consult-headers
2683 You can tell VC not to use version headers to determine the file
2684status by setting @code{vc-consult-headers} to @code{nil}. VC then
2685always uses the file permissions (if it is supposed to trust them), or
2686else checks the master file.
2687
2688@vindex vc-mistrust-permissions
2689 You can specify the criterion for whether to trust the file
2690permissions by setting the variable @code{vc-mistrust-permissions}.
2691Its value can be @code{t} (always mistrust the file permissions and
2692check the master file), @code{nil} (always trust the file
2693permissions), or a function of one argument which makes the decision.
2694The argument is the directory name of the @file{RCS} subdirectory. A
2695non-@code{nil} value from the function says to mistrust the file
2696permissions. If you find that the file permissions of work files are
2697changed erroneously, set @code{vc-mistrust-permissions} to @code{t}.
2698Then VC always checks the master file to determine the file's status.
2699
2700 VC determines the version control state of files under SCCS much as
2701with RCS. It does not consider SCCS version headers, though. Thus,
2702the variable @code{vc-mistrust-permissions} affects SCCS use, but
2703@code{vc-consult-headers} does not.
2704
2705@node CVS Options
2706@subsection Options specific for CVS
2707
2708@cindex locking (CVS)
2709 By default, CVS does not use locking to coordinate the activities of
2710several users; anyone can change a work file at any time. However,
2711there are ways to restrict this, resulting in behavior that resembles
2712locking.
2713
2714@cindex CVSREAD environment variable (CVS)
2715 For one thing, you can set the @env{CVSREAD} environment variable
2716(the value you use makes no difference). If this variable is defined,
2717CVS makes your work files read-only by default. In Emacs, you must
2718type @kbd{C-x v v} to make the file writable, so that editing works
2719in fact similar as if locking was used. Note however, that no actual
2720locking is performed, so several users can make their files writable
2721at the same time. When setting @env{CVSREAD} for the first time, make
2722sure to check out all your modules anew, so that the file protections
2723are set correctly.
2724
2725@cindex cvs watch feature
2726@cindex watching files (CVS)
2727 Another way to achieve something similar to locking is to use the
2728@dfn{watch} feature of CVS. If a file is being watched, CVS makes it
2729read-only by default, and you must also use @kbd{C-x v v} in Emacs to
2730make it writable. VC calls @code{cvs edit} to make the file writable,
2731and CVS takes care to notify other developers of the fact that you
2732intend to change the file. See the CVS documentation for details on
2733using the watch feature.
2734
2735@vindex vc-stay-local
2736@vindex vc-cvs-stay-local
2737@cindex remote repositories (CVS)
2738 When a file's repository is on a remote machine, VC tries to keep
2739network interactions to a minimum. This is controlled by the variable
2740@code{vc-cvs-stay-local}. There is another variable,
2741@code{vc-stay-local}, which enables the feature also for other back
2742ends that support it, including CVS. In the following, we will talk
2743only about @code{vc-cvs-stay-local}, but everything applies to
2744@code{vc-stay-local} as well.
2745
2746If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses
2747only the entry in the local CVS subdirectory to determine the file's
2748state (and possibly information returned by previous CVS commands).
2749One consequence of this is that when you have modified a file, and
2750somebody else has already checked in other changes to the file, you
2751are not notified of it until you actually try to commit. (But you can
2752try to pick up any recent changes from the repository first, using
2753@kbd{C-x v m @key{RET}}, @pxref{Merging,,,emacs, the Emacs Manual}).
2754
2755 When @code{vc-cvs-stay-local} is @code{t}, VC also makes local
2756version backups, so that simple diff and revert operations are
2757completely local (@pxref{Version Backups}).
2758
2759 On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil},
2760then VC queries the remote repository @emph{before} it decides what to
2761do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local
2762repositories. It also does not make any version backups.
2763
2764 You can also set @code{vc-cvs-stay-local} to a regular expression
2765that is matched against the repository host name; VC then stays local
2766only for repositories from hosts that match the pattern.
2767
2768@vindex vc-cvs-global-switches
2769 You can specify additional command line options to pass to all CVS
2770operations in the variable @code{vc-cvs-global-switches}. These
2771switches are inserted immediately after the @code{cvs} command, before
2772the name of the operation to invoke.
2773
2774
1891@node Fortran 2775@node Fortran
1892@chapter Fortran Mode 2776@chapter Fortran Mode
1893@cindex Fortran mode 2777@cindex Fortran mode
@@ -2406,6 +3290,687 @@ to @samp{continue}, provided Abbrev mode is enabled.@refill
2406 Type @samp{;?} or @samp{;C-h} to display a list of all the built-in 3290 Type @samp{;?} or @samp{;C-h} to display a list of all the built-in
2407Fortran abbrevs and what they stand for. 3291Fortran abbrevs and what they stand for.
2408 3292
3293
3294@node MS-DOG
3295@chapter Emacs and MS-DOS
3296@cindex MS-DOG
3297@cindex MS-DOS peculiarities
3298
3299 This section briefly describes the peculiarities of using Emacs on
3300the MS-DOS ``operating system'' (also known as ``MS-DOG'').
3301Information about Emacs and Microsoft's current operating system
3302Windows (also known as ``Losedows) is in the main Emacs manual
3303(@pxref{Emacs and Microsoft Systems,,, emacs, the Emacs Manual}).
3304
3305 If you build Emacs for MS-DOS, the binary will also run on Windows
33063.X, Windows NT, Windows 9X/ME, Windows 2000, or OS/2 as a DOS
3307application; all of this chapter applies for all of those systems, if
3308you use an Emacs that was built for MS-DOS.
3309
3310 @xref{Text and Binary,,,emacs, the Emacs Manual}, for information
3311about Emacs' special handling of text files under MS-DOS (and
3312Windows).
3313
3314@menu
3315* Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS.
3316* Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS.
3317* Display: MS-DOS Display. Fonts, frames and display size on MS-DOS.
3318* Files: MS-DOS File Names. File name conventions on MS-DOS.
3319* Printing: MS-DOS Printing. How to specify the printer on MS-DOS.
3320* I18N: MS-DOS and MULE. Support for internationalization on MS-DOS.
3321* Processes: MS-DOS Processes. Running subprocesses on MS-DOS.
3322@end menu
3323
3324@node MS-DOS Keyboard
3325@section Keyboard Usage on MS-DOS
3326
3327@kindex DEL @r{(MS-DOS)}
3328@kindex BS @r{(MS-DOS)}
3329 The key that is called @key{DEL} in Emacs (because that's how it is
3330designated on most workstations) is known as @key{BS} (backspace) on a
3331PC. That is why the PC-specific terminal initialization remaps the
3332@key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act
3333as @kbd{C-d} for the same reasons.
3334
3335@kindex C-g @r{(MS-DOS)}
3336@kindex C-BREAK @r{(MS-DOS)}
3337@cindex quitting on MS-DOS
3338 Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit
3339character, just like @kbd{C-g}. This is because Emacs cannot detect
3340that you have typed @kbd{C-g} until it is ready for more input. As a
3341consequence, you cannot use @kbd{C-g} to stop a running command
3342(@pxref{Quitting,,,emacs, the Emacs Manual}). By contrast,
3343@kbd{C-@key{BREAK}} @emph{is} detected as soon as you type it (as
3344@kbd{C-g} is on other systems), so it can be used to stop a running
3345command and for emergency escape (@pxref{Emergency Escape,,,emacs, the
3346Emacs Manual}).
3347
3348@cindex Meta (under MS-DOS)
3349@cindex Hyper (under MS-DOS)
3350@cindex Super (under MS-DOS)
3351@vindex dos-super-key
3352@vindex dos-hyper-key
3353 The PC keyboard maps use the left @key{ALT} key as the @key{META} key.
3354You have two choices for emulating the @key{SUPER} and @key{HYPER} keys:
3355choose either the right @key{CTRL} key or the right @key{ALT} key by
3356setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1
3357or 2 respectively. If neither @code{dos-super-key} nor
3358@code{dos-hyper-key} is 1, then by default the right @key{ALT} key is
3359also mapped to the @key{META} key. However, if the MS-DOS international
3360keyboard support program @file{KEYB.COM} is installed, Emacs will
3361@emph{not} map the right @key{ALT} to @key{META}, since it is used for
3362accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard
3363layouts; in this case, you may only use the left @key{ALT} as @key{META}
3364key.
3365
3366@kindex C-j @r{(MS-DOS)}
3367@vindex dos-keypad-mode
3368 The variable @code{dos-keypad-mode} is a flag variable that controls
3369what key codes are returned by keys in the numeric keypad. You can also
3370define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the
3371following line into your @file{_emacs} file:
3372
3373@smallexample
3374;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.}
3375(define-key function-key-map [kp-enter] [?\C-j])
3376@end smallexample
3377
3378@node MS-DOS Mouse
3379@section Mouse Usage on MS-DOS
3380
3381@cindex mouse support under MS-DOS
3382 Emacs on MS-DOS supports a mouse (on the default terminal only).
3383The mouse commands work as documented, including those that use menus
3384and the menu bar (@pxref{Menu Bar,,,emacs, the Emacs Manual}). Scroll
3385bars don't work in MS-DOS Emacs. PC mice usually have only two
3386buttons; these act as @kbd{Mouse-1} and @kbd{Mouse-2}, but if you
3387press both of them together, that has the effect of @kbd{Mouse-3}. If
3388the mouse does have 3 buttons, Emacs detects that at startup, and all
3389the 3 buttons function normally, as on X.
3390
3391 Help strings for menu-bar and pop-up menus are displayed in the echo
3392area when the mouse pointer moves across the menu items. Highlighting
3393of mouse-sensitive text (@pxref{Mouse References,,,emacs, the Emacs
3394Manual}) is also supported.
3395
3396@cindex mouse, set number of buttons
3397@findex msdos-set-mouse-buttons
3398 Some versions of mouse drivers don't report the number of mouse
3399buttons correctly. For example, mice with a wheel report that they
3400have 3 buttons, but only 2 of them are passed to Emacs; the clicks on
3401the wheel, which serves as the middle button, are not passed. In
3402these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command
3403to tell Emacs how many mouse buttons to expect. You could make such a
3404setting permanent by adding this fragment to your @file{_emacs} init
3405file:
3406
3407@example
3408;; @r{Treat the mouse like a 2-button mouse.}
3409(msdos-set-mouse-buttons 2)
3410@end example
3411
3412@cindex Windows clipboard support
3413 Emacs built for MS-DOS supports clipboard operations when it runs on
3414Windows. Commands that put text on the kill ring, or yank text from
3415the ring, check the Windows clipboard first, just as Emacs does on the
3416X Window System (@pxref{Mouse Commands,,,emacs, the Emacs Manual}).
3417Only the primary selection and the cut buffer are supported by MS-DOS
3418Emacs on Windows; the secondary selection always appears as empty.
3419
3420 Due to the way clipboard access is implemented by Windows, the
3421length of text you can put into the clipboard is limited by the amount
3422of free DOS memory that is available to Emacs. Usually, up to 620KB of
3423text can be put into the clipboard, but this limit depends on the system
3424configuration and is lower if you run Emacs as a subprocess of
3425another program. If the killed text does not fit, Emacs outputs a
3426message saying so, and does not put the text into the clipboard.
3427
3428 Null characters also cannot be put into the Windows clipboard. If the
3429killed text includes null characters, Emacs does not put such text into
3430the clipboard, and displays in the echo area a message to that effect.
3431
3432@vindex dos-display-scancodes
3433 The variable @code{dos-display-scancodes}, when non-@code{nil},
3434directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of
3435each keystroke; this feature serves as a complement to the
3436@code{view-lossage} command, for debugging.
3437
3438@node MS-DOS Display
3439@section Display on MS-DOS
3440@cindex faces under MS-DOS
3441@cindex fonts, emulating under MS-DOS
3442
3443 Display on MS-DOS cannot use font variants, like bold or italic, but
3444it does support multiple faces, each of which can specify a foreground
3445and a background color. Therefore, you can get the full functionality
3446of Emacs packages that use fonts (such as @code{font-lock}, Enriched
3447Text mode, and others) by defining the relevant faces to use different
3448colors. Use the @code{list-colors-display} command (@pxref{Frame
3449Parameters,,,emacs, the Emacs Manual}) and the
3450@code{list-faces-display} command (@pxref{Faces,,,emacs, the Emacs
3451Manual}) to see what colors and faces are available and what they look
3452like.
3453
3454 @xref{MS-DOS and MULE}, later in this chapter, for information on
3455how Emacs displays glyphs and characters that aren't supported by the
3456native font built into the DOS display.
3457
3458@cindex cursor shape on MS-DOS
3459 When Emacs starts, it changes the cursor shape to a solid box. This
3460is for compatibility with other systems, where the box cursor is the
3461default in Emacs. This default shape can be changed to a bar by
3462specifying the @code{cursor-type} parameter in the variable
3463@code{default-frame-alist} (@pxref{Creating Frames,,,emacs, the Emacs
3464Manual}). The MS-DOS terminal doesn't support a vertical-bar cursor,
3465so the bar cursor is horizontal, and the @code{@var{width}} parameter,
3466if specified by the frame parameters, actually determines its height.
3467For this reason, the @code{bar} and @code{hbar} cursor types produce
3468the same effect on MS-DOS. As an extension, the bar cursor
3469specification can include the starting scan line of the cursor as well
3470as its width, like this:
3471
3472@example
3473 '(cursor-type bar @var{width} . @var{start})
3474@end example
3475
3476@noindent
3477In addition, if the @var{width} parameter is negative, the cursor bar
3478begins at the top of the character cell.
3479
3480@cindex frames on MS-DOS
3481 The MS-DOS terminal can only display a single frame at a time. The
3482Emacs frame facilities work on MS-DOS much as they do on text-only
3483terminals (@pxref{Frames,,,emacs, the Emacs Manual}). When you run
3484Emacs from a DOS window on MS-Windows, you can make the visible frame
3485smaller than the full screen, but Emacs still cannot display more than
3486a single frame at a time.
3487
3488@cindex frame size under MS-DOS
3489@findex mode4350
3490@findex mode25
3491 The @code{mode4350} command switches the display to 43 or 50
3492lines, depending on your hardware; the @code{mode25} command switches
3493to the default 80x25 screen size.
3494
3495 By default, Emacs only knows how to set screen sizes of 80 columns by
349625, 28, 35, 40, 43 or 50 rows. However, if your video adapter has
3497special video modes that will switch the display to other sizes, you can
3498have Emacs support those too. When you ask Emacs to switch the frame to
3499@var{n} rows by @var{m} columns dimensions, it checks if there is a
3500variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so,
3501uses its value (which must be an integer) as the video mode to switch
3502to. (Emacs switches to that video mode by calling the BIOS @code{Set
3503Video Mode} function with the value of
3504@code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.)
3505For example, suppose your adapter will switch to 66x80 dimensions when
3506put into video mode 85. Then you can make Emacs support this screen
3507size by putting the following into your @file{_emacs} file:
3508
3509@example
3510(setq screen-dimensions-66x80 85)
3511@end example
3512
3513 Since Emacs on MS-DOS can only set the frame size to specific
3514supported dimensions, it cannot honor every possible frame resizing
3515request. When an unsupported size is requested, Emacs chooses the next
3516larger supported size beyond the specified size. For example, if you
3517ask for 36x80 frame, you will get 40x80 instead.
3518
3519 The variables @code{screen-dimensions-@var{n}x@var{m}} are used only
3520when they exactly match the specified size; the search for the next
3521larger supported size ignores them. In the above example, even if your
3522VGA supports 38x80 dimensions and you define a variable
3523@code{screen-dimensions-38x80} with a suitable value, you will still get
352440x80 screen when you ask for a 36x80 frame. If you want to get the
352538x80 size in this case, you can do it by setting the variable named
3526@code{screen-dimensions-36x80} with the same video mode value as
3527@code{screen-dimensions-38x80}.
3528
3529 Changing frame dimensions on MS-DOS has the effect of changing all the
3530other frames to the new dimensions.
3531
3532@node MS-DOS File Names
3533@section File Names on MS-DOS
3534@cindex file names under MS-DOS
3535@cindex init file, default name under MS-DOS
3536
3537 MS-DOS normally uses a backslash, @samp{\}, to separate name units
3538within a file name, instead of the slash used on other systems. Emacs
3539on MS-DOS permits use of either slash or backslash, and also knows
3540about drive letters in file names.
3541
3542 On MS-DOS, file names are case-insensitive and limited to eight
3543characters, plus optionally a period and three more characters. Emacs
3544knows enough about these limitations to handle file names that were
3545meant for other operating systems. For instance, leading dots
3546@samp{.} in file names are invalid in MS-DOS, so Emacs transparently
3547converts them to underscores @samp{_}; thus your default init file
3548(@pxref{Init File,,,emacs, the Emacs Manual}) is called @file{_emacs}
3549on MS-DOS. Excess characters before or after the period are generally
3550ignored by MS-DOS itself; thus, if you visit the file
3551@file{LongFileName.EvenLongerExtension}, you will silently get
3552@file{longfile.eve}, but Emacs will still display the long file name
3553on the mode line. Other than that, it's up to you to specify file
3554names which are valid under MS-DOS; the transparent conversion as
3555described above only works on file names built into Emacs.
3556
3557@cindex backup file names on MS-DOS
3558 The above restrictions on the file names on MS-DOS make it almost
3559impossible to construct the name of a backup file (@pxref{Backup
3560Names,,,emacs, the Emacs Manual}) without losing some of the original
3561file name characters. For example, the name of a backup file for
3562@file{docs.txt} is @file{docs.tx~} even if single backup is used.
3563
3564@cindex file names under Windows 95/NT
3565@cindex long file names in DOS box under Windows 95/NT
3566 If you run Emacs as a DOS application under Windows 9X, Windows ME, or
3567Windows 2000, you can turn on support for long file names. If you do
3568that, Emacs doesn't truncate file names or convert them to lower case;
3569instead, it uses the file names that you specify, verbatim. To enable
3570long file name support, set the environment variable @env{LFN} to
3571@samp{y} before starting Emacs. Unfortunately, Windows NT doesn't allow
3572DOS programs to access long file names, so Emacs built for MS-DOS will
3573only see their short 8+3 aliases.
3574
3575@cindex @env{HOME} directory under MS-DOS
3576 MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
3577that the directory where it is installed is the value of the @env{HOME}
3578environment variable. That is, if your Emacs binary,
3579@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then
3580Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In
3581particular, that is where Emacs looks for the init file @file{_emacs}.
3582With this in mind, you can use @samp{~} in file names as an alias for
3583the home directory, as you would on GNU or Unix. You can also set
3584@env{HOME} variable in the environment before starting Emacs; its
3585value will then override the above default behavior.
3586
3587 Emacs on MS-DOS handles the directory name @file{/dev} specially,
3588because of a feature in the emulator libraries of DJGPP that pretends
3589I/O devices have names in that directory. We recommend that you avoid
3590using an actual directory named @file{/dev} on any disk.
3591
3592@node MS-DOS Printing
3593@section Printing and MS-DOS
3594
3595 Printing commands, such as @code{lpr-buffer}
3596(@pxref{Printing,,,emacs, the Emacs Manual }) and
3597@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual})
3598can work in MS-DOS and MS-Windows by sending the output to one of the
3599printer ports, if a Posix-style @code{lpr} program is unavailable.
3600The same Emacs variables control printing on all systems, but in some
3601cases they have different default values on MS-DOS and MS-Windows.
3602
3603@vindex printer-name @r{(MS-DOS)}
3604 If you want to use your local printer, printing on it in the usual DOS
3605manner, then set the Lisp variable @code{lpr-command} to @code{""} (its
3606default value) and @code{printer-name} to the name of the printer
3607port---for example, @code{"PRN"}, the usual local printer port (that's
3608the default), or @code{"LPT2"}, or @code{"COM1"} for a serial printer.
3609You can also set @code{printer-name} to a file name, in which case
3610``printed'' output is actually appended to that file. If you set
3611@code{printer-name} to @code{"NUL"}, printed output is silently
3612discarded (sent to the system null device).
3613
3614 On MS-Windows, when the Windows network software is installed, you can
3615also use a printer shared by another machine by setting
3616@code{printer-name} to the UNC share name for that printer---for example,
3617@code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward
3618slashes or backslashes here.) To find out the names of shared printers,
3619run the command @samp{net view} at a DOS command prompt to obtain a list
3620of servers, and @samp{net view @var{server-name}} to see the names of printers
3621(and directories) shared by that server. Alternatively, click the
3622@samp{Network Neighborhood} icon on your desktop, and look for machines
3623which share their printers via the network.
3624
3625@cindex @samp{net use}, and printing on MS-Windows
3626@cindex networked printers (MS-Windows)
3627 If the printer doesn't appear in the output of @samp{net view}, or
3628if setting @code{printer-name} to the UNC share name doesn't produce a
3629hardcopy on that printer, you can use the @samp{net use} command to
3630connect a local print port such as @code{"LPT2"} to the networked
3631printer. For example, typing @kbd{net use LPT2:
3632\\joes_pc\hp4si}@footnote{
3633Note that the @samp{net use} command requires the UNC share name to be
3634typed with the Windows-style backslashes, while the value of
3635@code{printer-name} can be set with either forward- or backslashes.}
3636causes Windows to @dfn{capture} the LPT2 port and redirect the printed
3637material to the printer connected to the machine @code{joes_pc}.
3638After this command, setting @code{printer-name} to @code{"LPT2"}
3639should produce the hardcopy on the networked printer.
3640
3641 With some varieties of Windows network software, you can instruct
3642Windows to capture a specific printer port such as @code{"LPT2"}, and
3643redirect it to a networked printer via the @w{@code{Control
3644Panel->Printers}} applet instead of @samp{net use}.
3645
3646 Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even
3647though they are connected to a Windows machine which uses a different
3648encoding for the same locale. For example, in the Latin-1 locale, DOS
3649uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and
3650MULE}. When you print to such printers from Windows, you can use the
3651@kbd{C-x RET c} (@code{universal-coding-system-argument}) command before
3652@kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS
3653codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET
3654M-x lpr-region RET} will print the region while converting it to the
3655codepage 850 encoding. You may need to create the @code{cp@var{nnn}}
3656coding system with @kbd{M-x codepage-setup}.
3657
3658 If you set @code{printer-name} to a file name, it's best to use an
3659absolute file name. Emacs changes the working directory according to
3660the default directory of the current buffer, so if the file name in
3661@code{printer-name} is relative, you will end up with several such
3662files, each one in the directory of the buffer from which the printing
3663was done.
3664
3665@findex print-buffer @r{(MS-DOS)}
3666@findex print-region @r{(MS-DOS)}
3667@vindex lpr-headers-switches @r{(MS-DOS)}
3668 The commands @code{print-buffer} and @code{print-region} call the
3669@code{pr} program, or use special switches to the @code{lpr} program, to
3670produce headers on each printed page. MS-DOS and MS-Windows don't
3671normally have these programs, so by default, the variable
3672@code{lpr-headers-switches} is set so that the requests to print page
3673headers are silently ignored. Thus, @code{print-buffer} and
3674@code{print-region} produce the same output as @code{lpr-buffer} and
3675@code{lpr-region}, respectively. If you do have a suitable @code{pr}
3676program (for example, from GNU Textutils), set
3677@code{lpr-headers-switches} to @code{nil}; Emacs will then call
3678@code{pr} to produce the page headers, and print the resulting output as
3679specified by @code{printer-name}.
3680
3681@vindex print-region-function @r{(MS-DOS)}
3682@cindex lpr usage under MS-DOS
3683@vindex lpr-command @r{(MS-DOS)}
3684@vindex lpr-switches @r{(MS-DOS)}
3685 Finally, if you do have an @code{lpr} work-alike, you can set the
3686variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use
3687@code{lpr} for printing, as on other systems. (If the name of the
3688program isn't @code{lpr}, set @code{lpr-command} to specify where to
3689find it.) The variable @code{lpr-switches} has its standard meaning
3690when @code{lpr-command} is not @code{""}. If the variable
3691@code{printer-name} has a string value, it is used as the value for the
3692@code{-P} option to @code{lpr}, as on Unix.
3693
3694@findex ps-print-buffer @r{(MS-DOS)}
3695@findex ps-spool-buffer @r{(MS-DOS)}
3696@vindex ps-printer-name @r{(MS-DOS)}
3697@vindex ps-lpr-command @r{(MS-DOS)}
3698@vindex ps-lpr-switches @r{(MS-DOS)}
3699 A parallel set of variables, @code{ps-lpr-command},
3700@code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript
3701Variables,,,emacs, the Emacs Manual}), defines how PostScript files
3702should be printed. These variables are used in the same way as the
3703corresponding variables described above for non-PostScript printing.
3704Thus, the value of @code{ps-printer-name} is used as the name of the
3705device (or file) to which PostScript output is sent, just as
3706@code{printer-name} is used for non-PostScript printing. (There are
3707two distinct sets of variables in case you have two printers attached
3708to two different ports, and only one of them is a PostScript printer.)
3709
3710 The default value of the variable @code{ps-lpr-command} is @code{""},
3711which causes PostScript output to be sent to the printer port specified
3712by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to
3713the name of a program which will accept PostScript files. Thus, if you
3714have a non-PostScript printer, you can set this variable to the name of
3715a PostScript interpreter program (such as Ghostscript). Any switches
3716that need to be passed to the interpreter program are specified using
3717@code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a
3718string, it will be added to the list of switches as the value for the
3719@code{-P} option. This is probably only useful if you are using
3720@code{lpr}, so when using an interpreter typically you would set
3721@code{ps-printer-name} to something other than a string so it is
3722ignored.)
3723
3724 For example, to use Ghostscript for printing on an Epson printer
3725connected to the @samp{LPT2} port, put this in your @file{_emacs} file:
3726
3727@example
3728(setq ps-printer-name t) ; Ghostscript doesn't understand -P
3729(setq ps-lpr-command "c:/gs/gs386")
3730(setq ps-lpr-switches '("-q" "-dNOPAUSE"
3731 "-sDEVICE=epson"
3732 "-r240x72"
3733 "-sOutputFile=LPT2"
3734 "-Ic:/gs"))
3735@end example
3736
3737@noindent
3738(This assumes that Ghostscript is installed in the @file{"c:/gs"}
3739directory.)
3740
3741@vindex dos-printer
3742@vindex dos-ps-printer
3743 For backwards compatibility, the value of @code{dos-printer}
3744(@code{dos-ps-printer}), if it has a value, overrides the value of
3745@code{printer-name} (@code{ps-printer-name}), on MS-DOS and MS-Windows
3746only.
3747
3748
3749@node MS-DOS and MULE
3750@section International Support on MS-DOS
3751@cindex international support @r{(MS-DOS)}
3752
3753 Emacs on MS-DOS supports the same international character sets as it
3754does on GNU, Unix and other platforms (@pxref{International,,,emacs,
3755the Emacs Manual}), including coding systems for converting between
3756the different character sets. However, due to incompatibilities
3757between MS-DOS/MS-Windows and other systems, there are several
3758DOS-specific aspects of this support that you should be aware of.
3759This section describes these aspects.
3760
3761 The description below is largely specific to the MS-DOS port of
3762Emacs, especially where it talks about practical implications for
3763Emacs users. For other operating systems, see the @file{code-pages.el}
3764package, which implements support for MS-DOS- and MS-Windows-specific
3765encodings for all platforms other than MS-DOS.
3766
3767@table @kbd
3768@item M-x dos-codepage-setup
3769Set up Emacs display and coding systems as appropriate for the current
3770DOS codepage.
3771
3772@item M-x codepage-setup
3773Create a coding system for a certain DOS codepage.
3774@end table
3775
3776@cindex codepage, MS-DOS
3777@cindex DOS codepages
3778 MS-DOS is designed to support one character set of 256 characters at
3779any given time, but gives you a variety of character sets to choose
3780from. The alternative character sets are known as @dfn{DOS codepages}.
3781Each codepage includes all 128 @acronym{ASCII} characters, but the other 128
3782characters (codes 128 through 255) vary from one codepage to another.
3783Each DOS codepage is identified by a 3-digit number, such as 850, 862,
3784etc.
3785
3786 In contrast to X, which lets you use several fonts at the same time,
3787MS-DOS normally doesn't allow use of several codepages in a single
3788session. MS-DOS was designed to load a single codepage at system
3789startup, and require you to reboot in order to change
3790it@footnote{Normally, one particular codepage is burnt into the
3791display memory, while other codepages can be installed by modifying
3792system configuration files, such as @file{CONFIG.SYS}, and rebooting.
3793While there is third-party software that allows changing the codepage
3794without rebooting, we describe here how a stock MS-DOS system
3795behaves.}. Much the same limitation applies when you run DOS
3796executables on other systems such as MS-Windows.
3797
3798@cindex unibyte operation @r{(MS-DOS)}
3799 If you invoke Emacs on MS-DOS with the @samp{--unibyte} option
3800(@pxref{Initial Options,,,emacs, the Emacs Manual}), Emacs does not
3801perform any conversion of non-@acronym{ASCII} characters. Instead, it
3802reads and writes any non-@acronym{ASCII} characters verbatim, and
3803sends their 8-bit codes to the display verbatim. Thus, unibyte Emacs
3804on MS-DOS supports the current codepage, whatever it may be, but
3805cannot even represent any other characters.
3806
3807@vindex dos-codepage
3808 For multibyte operation on MS-DOS, Emacs needs to know which
3809characters the chosen DOS codepage can display. So it queries the
3810system shortly after startup to get the chosen codepage number, and
3811stores the number in the variable @code{dos-codepage}. Some systems
3812return the default value 437 for the current codepage, even though the
3813actual codepage is different. (This typically happens when you use the
3814codepage built into the display hardware.) You can specify a different
3815codepage for Emacs to use by setting the variable @code{dos-codepage} in
3816your init file.
3817
3818@cindex language environment, automatic selection on @r{MS-DOS}
3819 Multibyte Emacs supports only certain DOS codepages: those which can
3820display Far-Eastern scripts, like the Japanese codepage 932, and those
3821that encode a single ISO 8859 character set.
3822
3823 The Far-Eastern codepages can directly display one of the MULE
3824character sets for these countries, so Emacs simply sets up to use the
3825appropriate terminal coding system that is supported by the codepage.
3826The special features described in the rest of this section mostly
3827pertain to codepages that encode ISO 8859 character sets.
3828
3829 For the codepages which correspond to one of the ISO character sets,
3830Emacs knows the character set name based on the codepage number. Emacs
3831automatically creates a coding system to support reading and writing
3832files that use the current codepage, and uses this coding system by
3833default. The name of this coding system is @code{cp@var{nnn}}, where
3834@var{nnn} is the codepage number.@footnote{The standard Emacs coding
3835systems for ISO 8859 are not quite right for the purpose, because
3836typically the DOS codepage does not match the standard ISO character
3837codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has
3838code 231 in the standard Latin-1 character set, but the corresponding
3839DOS codepage 850 uses code 135 for this glyph.}
3840
3841@cindex mode line @r{(MS-DOS)}
3842 All the @code{cp@var{nnn}} coding systems use the letter @samp{D}
3843(for ``DOS'') as their mode-line mnemonic. Since both the terminal
3844coding system and the default coding system for file I/O are set to
3845the proper @code{cp@var{nnn}} coding system at startup, it is normal
3846for the mode line on MS-DOS to begin with @samp{-DD\-}. @xref{Mode
3847Line,,,emacs, the Emacs Manual}. Far-Eastern DOS terminals do not use
3848the @code{cp@var{nnn}} coding systems, and thus their initial mode
3849line looks like the Emacs default.
3850
3851 Since the codepage number also indicates which script you are using,
3852Emacs automatically runs @code{set-language-environment} to select the
3853language environment for that script (@pxref{Language
3854Environments,,,emacs, the Emacs Manual}).
3855
3856 If a buffer contains a character belonging to some other ISO 8859
3857character set, not the one that the chosen DOS codepage supports, Emacs
3858displays it using a sequence of @acronym{ASCII} characters. For example, if the
3859current codepage doesn't have a glyph for the letter @samp{@`o} (small
3860@samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where
3861the braces serve as a visual indication that this is a single character.
3862(This may look awkward for some non-Latin characters, such as those from
3863Greek or Hebrew alphabets, but it is still readable by a person who
3864knows the language.) Even though the character may occupy several
3865columns on the screen, it is really still just a single character, and
3866all Emacs commands treat it as one.
3867
3868@cindex IBM graphics characters (MS-DOS)
3869@cindex box-drawing characters (MS-DOS)
3870@cindex line-drawing characters (MS-DOS)
3871 Not all characters in DOS codepages correspond to ISO 8859
3872characters---some are used for other purposes, such as box-drawing
3873characters and other graphics. Emacs maps these characters to two
3874special character sets called @code{eight-bit-control} and
3875@code{eight-bit-graphic}, and displays them as their IBM glyphs.
3876However, you should be aware that other systems might display these
3877characters differently, so you should avoid them in text that might be
3878copied to a different operating system, or even to another DOS machine
3879that uses a different codepage.
3880
3881@vindex dos-unsupported-character-glyph
3882 Emacs supports many other characters sets aside from ISO 8859, but it
3883cannot display them on MS-DOS. So if one of these multibyte characters
3884appears in a buffer, Emacs on MS-DOS displays them as specified by the
3885@code{dos-unsupported-character-glyph} variable; by default, this glyph
3886is an empty triangle. Use the @kbd{C-u C-x =} command to display the
3887actual code and character set of such characters. @xref{Position
3888Info,,,emacs, the Emacs Manual}.
3889
3890@findex codepage-setup
3891 By default, Emacs defines a coding system to support the current
3892codepage. To define a coding system for some other codepage (e.g., to
3893visit a file written on a DOS machine in another country), use the
3894@kbd{M-x codepage-setup} command. It prompts for the 3-digit code of
3895the codepage, with completion, then creates the coding system for the
3896specified codepage. You can then use the new coding system to read and
3897write files, but you must specify it explicitly for the file command
3898when you want to use it (@pxref{Text Coding,,,emacs, the Emacs Manual}).
3899
3900 These coding systems are also useful for visiting a file encoded using
3901a DOS codepage, using Emacs running on some other operating system.
3902
3903@cindex MS-Windows codepages
3904 MS-Windows provides its own codepages, which are different from the
3905DOS codepages for the same locale. For example, DOS codepage 850
3906supports the same character set as Windows codepage 1252; DOS codepage
3907855 supports the same character set as Windows codepage 1251, etc.
3908The MS-Windows version of Emacs uses the current codepage for display
3909when invoked with the @samp{-nw} option. Support for codepages in the
3910Windows port of Emacs is part of the @file{code-pages.el} package.
3911
3912@node MS-DOS Processes
3913@section Subprocesses on MS-DOS
3914
3915@cindex compilation under MS-DOS
3916@cindex inferior processes under MS-DOS
3917@findex compile @r{(MS-DOS)}
3918@findex grep @r{(MS-DOS)}
3919 Because MS-DOS is a single-process ``operating system,''
3920asynchronous subprocesses are not available. In particular, Shell
3921mode and its variants do not work. Most Emacs features that use
3922asynchronous subprocesses also don't work on MS-DOS, including
3923Shell mode and GUD. When in doubt, try and see; commands that
3924don't work output an error message saying that asynchronous processes
3925aren't supported.
3926
3927 Compilation under Emacs with @kbd{M-x compile}, searching files with
3928@kbd{M-x grep} and displaying differences between files with @kbd{M-x
3929diff} do work, by running the inferior processes synchronously. This
3930means you cannot do any more editing until the inferior process
3931finishes.
3932
3933 Spell checking also works, by means of special support for synchronous
3934invocation of the @code{ispell} program. This is slower than the
3935asynchronous invocation on other platforms
3936
3937 Instead of the Shell mode, which doesn't work on MS-DOS, you can use
3938the @kbd{M-x eshell} command. This invokes the Eshell package that
3939implements a Posix-like shell entirely in Emacs Lisp.
3940
3941 By contrast, Emacs compiled as a native Windows application
3942@strong{does} support asynchronous subprocesses. @xref{Windows
3943Processes,,,emacs, the Emacs Manual}.
3944
3945@cindex printing under MS-DOS
3946 Printing commands, such as @code{lpr-buffer}
3947(@pxref{Printing,,,emacs, the Emacs Manual}) and
3948@code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}),
3949work in MS-DOS by sending the output to one of the printer ports.
3950@xref{MS-DOS Printing,,,emacs, the Emacs Manual}.
3951
3952 When you run a subprocess synchronously on MS-DOS, make sure the
3953program terminates and does not try to read keyboard input. If the
3954program does not terminate on its own, you will be unable to terminate
3955it, because MS-DOS provides no general way to terminate a process.
3956Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these
3957cases.
3958
3959 Accessing files on other machines is not supported on MS-DOS. Other
3960network-oriented commands such as sending mail, Web browsing, remote
3961login, etc., don't work either, unless network access is built into
3962MS-DOS with some network redirector.
3963
3964@cindex directory listing on MS-DOS
3965@vindex dired-listing-switches @r{(MS-DOS)}
3966 Dired on MS-DOS uses the @code{ls-lisp} package where other
3967platforms use the system @code{ls} command. Therefore, Dired on
3968MS-DOS supports only some of the possible options you can mention in
3969the @code{dired-listing-switches} variable. The options that work are
3970@samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S},
3971@samp{-s}, @samp{-t}, and @samp{-u}.
3972
3973
2409@node Index 3974@node Index
2410@unnumbered Index 3975@unnumbered Index
2411 3976
diff --git a/man/emacs.texi b/man/emacs.texi
index 79149152416..c926961891f 100644
--- a/man/emacs.texi
+++ b/man/emacs.texi
@@ -73,7 +73,12 @@ Boston, MA 02110-1301 USA
73Cover art by Etienne Suvasa. 73Cover art by Etienne Suvasa.
74 74
75@end titlepage 75@end titlepage
76@page 76
77
78@summarycontents
79@contents
80
81
77@ifnottex 82@ifnottex
78@node Top, Distrib, (dir), (dir) 83@node Top, Distrib, (dir), (dir)
79@top The Emacs Editor 84@top The Emacs Editor
@@ -122,7 +127,7 @@ and Sending Mail and Registers and Minibuffer.
122* Glossary:: The glossary. 127* Glossary:: The glossary.
123* Antinews:: Information about Emacs version 21. 128* Antinews:: Information about Emacs version 21.
124* Mac OS:: Using Emacs in the Mac. 129* Mac OS:: Using Emacs in the Mac.
125* MS-DOS:: Using Emacs on MS-DOS and Microsoft Windows. 130* Emacs and Microsoft Windows:: Using Emacs on Microsoft Windows.
126* Manifesto:: What's GNU? Gnu's Not Unix! 131* Manifesto:: What's GNU? Gnu's Not Unix!
127* Acknowledgments:: Major contributors to GNU Emacs. 132* Acknowledgments:: Major contributors to GNU Emacs.
128 133
@@ -394,10 +399,6 @@ Version Control
394* Old Versions:: Examining and comparing old versions. 399* Old Versions:: Examining and comparing old versions.
395* Secondary VC Commands:: The commands used a little less frequently. 400* Secondary VC Commands:: The commands used a little less frequently.
396* Branches:: Multiple lines of development. 401* Branches:: Multiple lines of development.
397* Remote Repositories:: Efficient access to remote CVS servers.
398* Snapshots:: Sets of file versions treated as a unit.
399* Miscellaneous VC:: Various other commands and features of VC.
400* Customizing VC:: Variables that change VC's behavior.
401 402
402Using Multiple Buffers 403Using Multiple Buffers
403 404
@@ -855,16 +856,9 @@ Emacs and Mac OS
855* Mac Font Specs:: Specifying fonts on Mac. 856* Mac Font Specs:: Specifying fonts on Mac.
856* Mac Functions:: Mac-specific Lisp functions. 857* Mac Functions:: Mac-specific Lisp functions.
857 858
858MS-DOS and Windows 95/98/NT 859Emacs and Microsoft Windows
859 860
860* MS-DOS Keyboard:: Keyboard usage on MS-DOS.
861* MS-DOS Mouse:: Mouse usage on MS-DOS.
862* MS-DOS Display:: Fonts, frames and display size on MS-DOS.
863* MS-DOS File Names:: File-name conventions on MS-DOS.
864* Text and Binary:: Text files on MS-DOS use CRLF to separate lines. 861* Text and Binary:: Text files on MS-DOS use CRLF to separate lines.
865* MS-DOS Printing:: How to specify the printer on MS-DOS.
866* MS-DOS and MULE:: Support for internationalization on MS-DOS.
867* MS-DOS Processes:: Running subprocesses on MS-DOS.
868* Windows Processes:: Running subprocesses on Windows. 862* Windows Processes:: Running subprocesses on Windows.
869* Windows System Menu:: Controlling what the ALT key does. 863* Windows System Menu:: Controlling what the ALT key does.
870@end menu 864@end menu
@@ -926,10 +920,10 @@ This edition of the manual is intended for use with GNU Emacs
926installed on GNU and Unix systems. GNU Emacs can also be used on VMS, 920installed on GNU and Unix systems. GNU Emacs can also be used on VMS,
927MS-DOS (also called MS-DOG), Microsoft Windows, and Macintosh systems. 921MS-DOS (also called MS-DOG), Microsoft Windows, and Macintosh systems.
928Those systems use different file name syntax; in addition, VMS and 922Those systems use different file name syntax; in addition, VMS and
929MS-DOS do not support all GNU Emacs features. @xref{MS-DOS}, for 923MS-DOS do not support all GNU Emacs features. @xref{Emacs and
930information about using Emacs on MS-DOS and Windows. @xref{Mac OS}, 924Microsoft Windows}, for information about using Emacs on Windows.
931for information about using Emacs on Macintosh. We don't try to 925@xref{Mac OS}, for information about using Emacs on Macintosh. We
932describe VMS usage in this manual. 926don't try to describe VMS usage in this manual.
933@end iftex 927@end iftex
934 928
935@node Distrib, Intro, Top, Top 929@node Distrib, Intro, Top, Top
@@ -1604,8 +1598,6 @@ Public License instead of this License.
1604@unnumbered Concept Index 1598@unnumbered Concept Index
1605@printindex cp 1599@printindex cp
1606 1600
1607@summarycontents
1608@contents
1609@bye 1601@bye
1610 1602
1611@ignore 1603@ignore
diff --git a/man/files.texi b/man/files.texi
index 8ed89ac75e1..ab3fe7bb583 100644
--- a/man/files.texi
+++ b/man/files.texi
@@ -517,7 +517,8 @@ value is @code{t}, so that Emacs does write backup files.
517Control}), the variable @code{vc-make-backup-files} determines whether 517Control}), the variable @code{vc-make-backup-files} determines whether
518to make backup files. By default it is @code{nil}, since backup files 518to make backup files. By default it is @code{nil}, since backup files
519are redundant when you store all the previous versions in a version 519are redundant when you store all the previous versions in a version
520control system. @xref{General VC Options}. 520control system. @xref{General VC Options,,,emacs-xtra, Specialized
521Emacs Features}.
521 522
522 At your option, Emacs can keep either a single backup for each file, 523 At your option, Emacs can keep either a single backup for each file,
523or make a series of numbered backup files for each file that you edit. 524or make a series of numbered backup files for each file that you edit.
@@ -1200,7 +1201,7 @@ RCS or CVS, you can switch to CSSC.
1200 1201
1201 VC is enabled by default in Emacs. To disable it, set the 1202 VC is enabled by default in Emacs. To disable it, set the
1202customizable variable @code{vc-handled-backends} to @code{nil} 1203customizable variable @code{vc-handled-backends} to @code{nil}
1203(@pxref{Customizing VC}). 1204(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).
1204 1205
1205@menu 1206@menu
1206* Introduction to VC:: How version control works in general. 1207* Introduction to VC:: How version control works in general.
@@ -1209,10 +1210,6 @@ customizable variable @code{vc-handled-backends} to @code{nil}
1209* Old Versions:: Examining and comparing old versions. 1210* Old Versions:: Examining and comparing old versions.
1210* Secondary VC Commands:: The commands used a little less frequently. 1211* Secondary VC Commands:: The commands used a little less frequently.
1211* Branches:: Multiple lines of development. 1212* Branches:: Multiple lines of development.
1212* Remote Repositories:: Efficient access to remote CVS servers.
1213* Snapshots:: Sets of file versions treated as a unit.
1214* Miscellaneous VC:: Various other commands and features of VC.
1215* Customizing VC:: Variables that change VC's behavior.
1216@end menu 1213@end menu
1217 1214
1218@node Introduction to VC 1215@node Introduction to VC
@@ -1350,7 +1347,7 @@ permitted; check-in is still the way to record a new version.
1350 CVS normally allows each user to modify his own copy of the work file 1347 CVS normally allows each user to modify his own copy of the work file
1351at any time, but requires merging with changes from other users at 1348at any time, but requires merging with changes from other users at
1352check-in time. However, CVS can also be set up to require locking. 1349check-in time. However, CVS can also be set up to require locking.
1353(@pxref{CVS Options}). 1350(@pxref{CVS Options,,,emacs-xtra, Specialized Emacs Features}).
1354 1351
1355@node Types of Log File 1352@node Types of Log File
1356@subsubsection Types of Log File 1353@subsubsection Types of Log File
@@ -1382,7 +1379,8 @@ for each change just once, then put it into both logs. You can write
1382the entry in @file{ChangeLog}, then copy it to the log buffer when you 1379the entry in @file{ChangeLog}, then copy it to the log buffer when you
1383check in the change. Or you can write the entry in the log buffer 1380check in the change. Or you can write the entry in the log buffer
1384while checking in the change, and later use the @kbd{C-x v a} command 1381while checking in the change, and later use the @kbd{C-x v a} command
1385to copy it to @file{ChangeLog} (@pxref{Change Logs and VC}). 1382to copy it to @file{ChangeLog} (@pxref{Change Logs and
1383VC,,,emacs-xtra, Specialized Emacs Features}).
1386 1384
1387@node VC Mode Line 1385@node VC Mode Line
1388@subsection Version Control and the Mode Line 1386@subsection Version Control and the Mode Line
@@ -1547,7 +1545,7 @@ the repository.
1547Instead of the version number, you can also specify the name of a 1545Instead of the version number, you can also specify the name of a
1548version control system. This is useful when one file is being managed 1546version control system. This is useful when one file is being managed
1549with two version control systems at the same time (@pxref{Local 1547with two version control systems at the same time (@pxref{Local
1550Version Control}). 1548Version Control,,,emacs-xtra, Specialized Emacs Features}).
1551@end itemize 1549@end itemize
1552 1550
1553@node Log Buffer 1551@node Log Buffer
@@ -1569,14 +1567,16 @@ control, you can generate the Log Edit text from the ChangeLog using
1569entries for the file(s) concerned in the top entry in the ChangeLog 1567entries for the file(s) concerned in the top entry in the ChangeLog
1570and uses those paragraphs as the log text. This text is only inserted 1568and uses those paragraphs as the log text. This text is only inserted
1571if the top entry was made under your user name on the current date. 1569if the top entry was made under your user name on the current date.
1572@xref{Change Logs and VC}, for the opposite way of 1570@xref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features},
1573working---generating ChangeLog entries from the revision control log. 1571for the opposite way of working---generating ChangeLog entries from
1572the revision control log.
1574 1573
1575 In the @samp{*VC-Log*} buffer, @kbd{C-c C-f} (@kbd{M-x log-edit-show-files}) 1574 In the @samp{*VC-Log*} buffer, @kbd{C-c C-f} (@kbd{M-x
1576shows the list of files to be committed in case you need to check 1575log-edit-show-files}) shows the list of files to be committed in case
1577that. (This can be a list of more than one file if you use VC Dired 1576you need to check that. (This can be a list of more than one file if
1578mode or PCL-CVS. @xref{VC Dired Mode}, and @ref{Top, , About PCL-CVS, 1577you use VC Dired mode or PCL-CVS. @xref{VC Dired Mode,,,emacs-xtra,
1579pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}.) 1578Specialized Emacs Features}, and @ref{Top, , About PCL-CVS, pcl-cvs,
1579PCL-CVS --- The Emacs Front-End to CVS}.)
1580 1580
1581 When you have finished editing the log message, type @kbd{C-c C-c} to 1581 When you have finished editing the log message, type @kbd{C-c C-c} to
1582exit the buffer and commit the change. 1582exit the buffer and commit the change.
@@ -1644,7 +1644,7 @@ Both forms display the output in a special buffer in another window.
1644 You can specify a checked-in version by its number; an empty input 1644 You can specify a checked-in version by its number; an empty input
1645specifies the current contents of the work file (which may be different 1645specifies the current contents of the work file (which may be different
1646from all the checked-in versions). You can also specify a snapshot name 1646from all the checked-in versions). You can also specify a snapshot name
1647(@pxref{Snapshots}) instead of one or both version numbers. 1647(@pxref{Snapshots,,,emacs-xtra, Specialized Emacs Features}) instead of one or both version numbers.
1648 1648
1649 If you supply a directory name instead of the name of a registered 1649 If you supply a directory name instead of the name of a registered
1650file, this command compares the two specified versions of all registered 1650file, this command compares the two specified versions of all registered
@@ -1672,23 +1672,22 @@ versions are not, in general, present as files on your disk.)
1672@kindex C-x v g 1672@kindex C-x v g
1673 For some back ends, you can display the file @dfn{annotated} with 1673 For some back ends, you can display the file @dfn{annotated} with
1674per-line version information and using colors to enhance the visual 1674per-line version information and using colors to enhance the visual
1675appearance, with the command @kbd{M-x vc-annotate}. 1675appearance, with the command @kbd{M-x vc-annotate}. It creates a new
1676It creates a new buffer (the ``annotate buffer'') displaying the 1676buffer (the ``annotate buffer'') displaying the file's text, with each
1677file's text, with each part colored to show how old it is. Text 1677part colored to show how old it is. Text colored red is new, blue means
1678colored red is new, blue means old, and intermediate colors indicate 1678old, and intermediate colors indicate intermediate ages. By default,
1679intermediate ages. By default, the time scale is 360 days, so that 1679the color is scaled over the full range of ages, such that the oldest
1680everything more than one year old is shown in blue. 1680changes are blue, and the newest changes are red.
1681 1681
1682 When you give a prefix argument to this command, it uses the 1682 When you give a prefix argument to this command, it uses the
1683minibuffer to read two arguments: which version number to display and 1683minibuffer to read two arguments: which version number to display and
1684annotate (instead of the current file contents), and a stretch factor 1684annotate (instead of the current file contents), and the time span in
1685for the time scale. A stretch factor of 0.1 means that the color 1685days the color range should cover.
1686range from red to blue spans the past 36 days instead of 360 days. A
1687stretch factor greater than 1 means the color range spans more than a
1688year.
1689 1686
1690 From the annotate buffer, you can use the following keys to browse the 1687 From the annotate buffer, these and other color scaling options are
1691annotations of past revisions, view diffs, or view log entries: 1688available from the @samp{VC-Annotate} menu. In this buffer, you can
1689also use the following keys to browse the annotations of past revisions,
1690view diffs, or view log entries:
1692 1691
1693@table @kbd 1692@table @kbd
1694@item P 1693@item P
@@ -1734,8 +1733,6 @@ use once a day.
1734* Registering:: Putting a file under version control. 1733* Registering:: Putting a file under version control.
1735* VC Status:: Viewing the VC status of files. 1734* VC Status:: Viewing the VC status of files.
1736* VC Undo:: Canceling changes before or after check-in. 1735* VC Undo:: Canceling changes before or after check-in.
1737* VC Dired Mode:: Listing files managed by version control.
1738* VC Dired Commands:: Commands to use in a VC Dired buffer.
1739@end menu 1736@end menu
1740 1737
1741@node Registering 1738@node Registering
@@ -1754,14 +1751,15 @@ Register the visited file for version control.
1754 To register the file, Emacs must choose which version control system 1751 To register the file, Emacs must choose which version control system
1755to use for it. If the file's directory already contains files 1752to use for it. If the file's directory already contains files
1756registered in a version control system, Emacs uses that system. If 1753registered in a version control system, Emacs uses that system. If
1757there is more than one system in use for a directory, Emacs uses the one 1754there is more than one system in use for a directory, Emacs uses the
1758that appears first in @code{vc-handled-backends} (@pxref{Customizing VC}). 1755one that appears first in @code{vc-handled-backends}
1759On the other hand, if there are no files already registered, 1756(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}). On
1760Emacs uses the first system from @code{vc-handled-backends} that could 1757the other hand, if there are no files already registered, Emacs uses
1761register the file (for example, you cannot register a file under CVS if 1758the first system from @code{vc-handled-backends} that could register
1762its directory is not already part of a CVS tree); with the default 1759the file (for example, you cannot register a file under CVS if its
1763value of @code{vc-handled-backends}, this means that Emacs uses RCS in 1760directory is not already part of a CVS tree); with the default value
1764this situation. 1761of @code{vc-handled-backends}, this means that Emacs uses RCS in this
1762situation.
1765 1763
1766 If locking is in use, @kbd{C-x v i} leaves the file unlocked and 1764 If locking is in use, @kbd{C-x v i} leaves the file unlocked and
1767read-only. Type @kbd{C-x v v} if you wish to start editing it. After 1765read-only. Type @kbd{C-x v v} if you wish to start editing it. After
@@ -1816,14 +1814,16 @@ count.
1816 1814
1817@item P 1815@item P
1818Move to the log of the previous file, when the logs of multiple files 1816Move to the log of the previous file, when the logs of multiple files
1819are in the log buffer (@pxref{VC Dired Mode}). Otherwise, just move 1817are in the log buffer (@pxref{VC Dired Mode,,,emacs-xtra, Specialized
1820to the beginning of the log. A numeric prefix argument is a repeat 1818Emacs Features}). Otherwise, just move to the beginning of the log. A
1821count, so @kbd{C-u 10 P} would move backward 10 files. 1819numeric prefix argument is a repeat count, so @kbd{C-u 10 P} would
1820move backward 10 files.
1822 1821
1823@item N 1822@item N
1824Move to the log of the next file, when the logs of multiple files are 1823Move to the log of the next file, when the logs of multiple files are
1825in the log buffer (@pxref{VC Dired Mode}). It also takes a numeric 1824in the log buffer (@pxref{VC Dired Mode,,,emacs-xtra, Specialized
1826prefix argument as a repeat count. 1825Emacs Features}). It also takes a numeric prefix argument as a repeat
1826count.
1827 1827
1828@item f 1828@item f
1829Visit the revision indicated at the current line, like typing @kbd{C-x 1829Visit the revision indicated at the current line, like typing @kbd{C-x
@@ -1877,10 +1877,11 @@ change and then discover a trivial error in it; you can cancel the
1877erroneous check-in, fix the error, and check the file in again. 1877erroneous check-in, fix the error, and check the file in again.
1878 1878
1879 When @kbd{C-x v c} does not revert the buffer, it unexpands all 1879 When @kbd{C-x v c} does not revert the buffer, it unexpands all
1880version control headers in the buffer instead (@pxref{Version Headers}). 1880version control headers in the buffer instead (@pxref{Version
1881This is because the buffer no longer corresponds to any existing 1881Headers,,,emacs-xtra, Specialized Emacs Features}). This is because
1882version. If you check it in again, the check-in process will expand the 1882the buffer no longer corresponds to any existing version. If you
1883headers properly for the new version number. 1883check it in again, the check-in process will expand the headers
1884properly for the new version number.
1884 1885
1885 However, it is impossible to unexpand the RCS @samp{@w{$}Log$} header 1886 However, it is impossible to unexpand the RCS @samp{@w{$}Log$} header
1886automatically. If you use that header feature, you have to unexpand it 1887automatically. If you use that header feature, you have to unexpand it
@@ -1892,142 +1893,6 @@ confirmation with @kbd{yes}. Note also that this command is disabled
1892under CVS, because canceling versions is very dangerous and discouraged 1893under CVS, because canceling versions is very dangerous and discouraged
1893with CVS. 1894with CVS.
1894 1895
1895@node VC Dired Mode
1896@subsubsection Dired under VC
1897
1898@cindex PCL-CVS
1899@pindex cvs
1900@cindex CVS Dired Mode
1901 The VC Dired Mode described here works with all the version control
1902systems that VC supports. Another more powerful facility, designed
1903specifically for CVS, is called PCL-CVS. @xref{Top, , About PCL-CVS,
1904pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}.
1905
1906@kindex C-x v d
1907@findex vc-directory
1908 When you are working on a large program, it is often useful to find
1909out which files have changed within an entire directory tree, or to view
1910the status of all files under version control at once, and to perform
1911version control operations on collections of files. You can use the
1912command @kbd{C-x v d} (@code{vc-directory}) to make a directory listing
1913that includes only files relevant for version control.
1914
1915@vindex vc-dired-terse-display
1916 @kbd{C-x v d} creates a buffer which uses VC Dired Mode. This looks
1917much like an ordinary Dired buffer (@pxref{Dired}); however, normally it
1918shows only the noteworthy files (those locked or not up-to-date). This
1919is called @dfn{terse display}. If you set the variable
1920@code{vc-dired-terse-display} to @code{nil}, then VC Dired shows all
1921relevant files---those managed under version control, plus all
1922subdirectories (@dfn{full display}). The command @kbd{v t} in a VC
1923Dired buffer toggles between terse display and full display (@pxref{VC
1924Dired Commands}).
1925
1926@vindex vc-dired-recurse
1927 By default, VC Dired produces a recursive listing of noteworthy or
1928relevant files at or below the given directory. You can change this by
1929setting the variable @code{vc-dired-recurse} to @code{nil}; then VC
1930Dired shows only the files in the given directory.
1931
1932 The line for an individual file shows the version control state in the
1933place of the hard link count, owner, group, and size of the file. If
1934the file is unmodified, in sync with the master file, the version
1935control state shown is blank. Otherwise it consists of text in
1936parentheses. Under RCS and SCCS, the name of the user locking the file
1937is shown; under CVS, an abbreviated version of the @samp{cvs status}
1938output is used. Here is an example using RCS:
1939
1940@smallexample
1941@group
1942 /home/jim/project:
1943
1944 -rw-r--r-- (jim) Apr 2 23:39 file1
1945 -r--r--r-- Apr 5 20:21 file2
1946@end group
1947@end smallexample
1948
1949@noindent
1950The files @samp{file1} and @samp{file2} are under version control,
1951@samp{file1} is locked by user jim, and @samp{file2} is unlocked.
1952
1953 Here is an example using CVS:
1954
1955@smallexample
1956@group
1957 /home/joe/develop:
1958
1959 -rw-r--r-- (modified) Aug 2 1997 file1.c
1960 -rw-r--r-- Apr 4 20:09 file2.c
1961 -rw-r--r-- (merge) Sep 13 1996 file3.c
1962@end group
1963@end smallexample
1964
1965 Here @samp{file1.c} is modified with respect to the repository, and
1966@samp{file2.c} is not. @samp{file3.c} is modified, but other changes
1967have also been checked in to the repository---you need to merge them
1968with the work file before you can check it in.
1969
1970@vindex vc-stay-local
1971@vindex vc-cvs-stay-local
1972 In the above, if the repository were on a remote machine, VC would
1973only contact it when the variable @code{vc-stay-local} (or
1974@code{vc-cvs-stay-local}) is nil (@pxref{CVS Options}). This is
1975because access to the repository may be slow, or you may be working
1976offline and not have access to the repository at all. As a
1977consequence, VC would not be able to tell you that @samp{file3.c} is
1978in the ``merge'' state; you would learn that only when you try to
1979check-in your modified copy of the file, or use a command such as
1980@kbd{C-x v m}.
1981
1982 In practice, this is not a problem because CVS handles this case
1983consistently whenever it arises. In VC, you'll simply get prompted to
1984merge the remote changes into your work file first. The benefits of
1985less network communication usually outweigh the disadvantage of not
1986seeing remote changes immediately.
1987
1988@vindex vc-directory-exclusion-list
1989 When VC Dired displays subdirectories (in the ``full'' display mode),
1990it omits some that should never contain any files under version control.
1991By default, this includes Version Control subdirectories such as
1992@samp{RCS} and @samp{CVS}; you can customize this by setting the
1993variable @code{vc-directory-exclusion-list}.
1994
1995 You can fine-tune VC Dired's format by typing @kbd{C-u C-x v d}---as in
1996ordinary Dired, that allows you to specify additional switches for the
1997@samp{ls} command.
1998
1999@node VC Dired Commands
2000@subsubsection VC Dired Commands
2001
2002 All the usual Dired commands work normally in VC Dired mode, except
2003for @kbd{v}, which is redefined as the version control prefix. You can
2004invoke VC commands such as @code{vc-diff} and @code{vc-print-log} by
2005typing @kbd{v =}, or @kbd{v l}, and so on. Most of these commands apply
2006to the file name on the current line.
2007
2008 The command @kbd{v v} (@code{vc-next-action}) operates on all the
2009marked files, so that you can lock or check in several files at once.
2010If it operates on more than one file, it handles each file according to
2011its current state; thus, it might lock one file, but check in another
2012file. This could be confusing; it is up to you to avoid confusing
2013behavior by marking a set of files that are in a similar state. If no
2014files are marked, @kbd{v v} operates on the file in the current line.
2015
2016 If any files call for check-in, @kbd{v v} reads a single log entry,
2017then uses it for all the files being checked in. This is convenient for
2018registering or checking in several files at once, as part of the same
2019change.
2020
2021@findex vc-dired-toggle-terse-mode
2022@findex vc-dired-mark-locked
2023 You can toggle between terse display (only locked files, or files not
2024up-to-date) and full display at any time by typing @kbd{v t}
2025(@code{vc-dired-toggle-terse-mode}). There is also a special command
2026@kbd{* l} (@code{vc-dired-mark-locked}), which marks all files currently
2027locked (or, with CVS, all files not up-to-date). Thus, typing @kbd{* l
2028t k} is another way to delete from the buffer all files except those
2029currently locked.
2030
2031@node Branches 1896@node Branches
2032@subsection Multiple Branches of a File 1897@subsection Multiple Branches of a File
2033@cindex branch (version control) 1898@cindex branch (version control)
@@ -2206,9 +2071,10 @@ own choice of selected versions, but all share the same common RCS
2206records. 2071records.
2207 2072
2208 This technique works reliably and automatically, provided that the 2073 This technique works reliably and automatically, provided that the
2209source files contain RCS version headers (@pxref{Version Headers}). The 2074source files contain RCS version headers (@pxref{Version
2210headers enable Emacs to be sure, at all times, which version number is 2075Headers,,,emacs-xtra, Specialized Emacs Features}). The headers enable
2211present in the work file. 2076Emacs to be sure, at all times, which version number is present in the
2077work file.
2212 2078
2213 If the files do not have version headers, you must instead tell Emacs 2079 If the files do not have version headers, you must instead tell Emacs
2214explicitly in each session which branch you are working on. To do this, 2080explicitly in each session which branch you are working on. To do this,
@@ -2216,730 +2082,6 @@ first find the file, then type @kbd{C-u C-x v v} and specify the correct
2216branch number. This ensures that Emacs knows which branch it is using 2082branch number. This ensures that Emacs knows which branch it is using
2217during this particular editing session. 2083during this particular editing session.
2218 2084
2219@node Remote Repositories
2220@subsection Remote Repositories
2221@cindex remote repositories (CVS)
2222
2223 A common way of using CVS is to set up a central CVS repository on
2224some Internet host, then have each developer check out a personal
2225working copy of the files on his local machine. Committing changes to
2226the repository, and picking up changes from other users into one's own
2227working area, then works by direct interactions with the CVS server.
2228
2229 One difficulty is that access to the CVS server is often slow, and
2230that developers might need to work off-line as well. VC is designed
2231to reduce the amount of network interaction necessary.
2232
2233@menu
2234* Version Backups:: Keeping local copies of repository versions.
2235* Local Version Control:: Using another version system for local editing.
2236@end menu
2237
2238@node Version Backups
2239@subsubsection Version Backups
2240@cindex version backups
2241
2242@cindex automatic version backups
2243 When VC sees that the CVS repository for a file is on a remote
2244machine, it automatically makes local backups of unmodified versions
2245of the file---@dfn{automatic version backups}. This means that you
2246can compare the file to the repository version (@kbd{C-x v =}), or
2247revert to that version (@kbd{C-x v u}), without any network
2248interactions.
2249
2250 The local copy of the unmodified file is called a @dfn{version
2251backup} to indicate that it corresponds exactly to a version that is
2252stored in the repository. Note that version backups are not the same
2253as ordinary Emacs backup files (@pxref{Backup}). But they follow a
2254similar naming convention.
2255
2256 For a file that comes from a remote CVS repository, VC makes a
2257version backup whenever you save the first changes to the file, and
2258removes it after you have committed your modified version to the
2259repository. You can disable the making of automatic version backups by
2260setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}).
2261
2262@cindex manual version backups
2263 The name of the automatic version backup for version @var{version}
2264of file @var{file} is @code{@var{file}.~@var{version}.~}. This is
2265almost the same as the name used by @kbd{C-x v ~} (@pxref{Old
2266Versions}), the only difference being the additional dot (@samp{.})
2267after the version number. This similarity is intentional, because
2268both kinds of files store the same kind of information. The file made
2269by @kbd{C-x v ~} acts as a @dfn{manual version backup}.
2270
2271 All the VC commands that operate on old versions of a file can use
2272both kinds of version backups. For instance, @kbd{C-x v ~} uses
2273either an automatic or a manual version backup, if possible, to get
2274the contents of the version you request. Likewise, @kbd{C-x v =} and
2275@kbd{C-x v u} use either an automatic or a manual version backup, if
2276one of them exists, to get the contents of a version to compare or
2277revert to. If you changed a file outside of Emacs, so that no
2278automatic version backup was created for the previous text, you can
2279create a manual backup of that version using @kbd{C-x v ~}, and thus
2280obtain the benefit of the local copy for Emacs commands.
2281
2282 The only difference in Emacs's handling of manual and automatic
2283version backups, once they exist, is that Emacs deletes automatic
2284version backups when you commit to the repository. By contrast,
2285manual version backups remain until you delete them.
2286
2287@node Local Version Control
2288@subsubsection Local Version Control
2289@cindex local version control
2290@cindex local back end (version control)
2291
2292When you make many changes to a file that comes from a remote
2293repository, it can be convenient to have version control on your local
2294machine as well. You can then record intermediate versions, revert to
2295a previous state, etc., before you actually commit your changes to the
2296remote server.
2297
2298VC lets you do this by putting a file under a second, local version
2299control system, so that the file is effectively registered in two
2300systems at the same time. For the description here, we will assume
2301that the remote system is CVS, and you use RCS locally, although the
2302mechanism works with any combination of version control systems
2303(@dfn{back ends}).
2304
2305To make it work with other back ends, you must make sure that the
2306``more local'' back end comes before the ``more remote'' back end in
2307the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By
2308default, this variable is set up so that you can use remote CVS and
2309local RCS as described here.
2310
2311To start using local RCS for a file that comes from a remote CVS
2312server, you must @emph{register the file in RCS}, by typing @kbd{C-u
2313C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a
2314prefix argument, and specify RCS as the back end.)
2315
2316You can do this at any time; it does not matter whether you have
2317already modified the file with respect to the version in the CVS
2318repository. If possible, VC tries to make the RCS master start with
2319the unmodified repository version, then checks in any local changes
2320as a new version. This works if you have not made any changes yet, or
2321if the unmodified repository version exists locally as a version
2322backup (@pxref{Version Backups}). If the unmodified version is not
2323available locally, the RCS master starts with the modified version;
2324the only drawback to this is that you cannot compare your changes
2325locally to what is stored in the repository.
2326
2327The version number of the RCS master is derived from the current CVS
2328version, starting a branch from it. For example, if the current CVS
2329version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in
2330the RCS master will be identical to version 1.23 under CVS; your first
2331changes are checked in as 1.23.1.1. (If the unmodified file is not
2332available locally, VC will check in the modified file twice, both as
23331.23 and 1.23.1.1, to make the revision numbers consistent.)
2334
2335If you do not use locking under CVS (the default), locking is also
2336disabled for RCS, so that editing under RCS works exactly as under
2337CVS.
2338
2339When you are done with local editing, you can commit the final version
2340back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}.
2341This initializes the log entry buffer (@pxref{Log Buffer}) to contain
2342all the log entries you have recorded in the RCS master; you can edit
2343them as you wish, and then commit in CVS by typing @kbd{C-c C-c}. If
2344the commit is successful, VC removes the RCS master, so that the file
2345is once again registered under CVS only. (The RCS master is not
2346actually deleted, just renamed by appending @samp{~} to the name, so
2347that you can refer to it later if you wish.)
2348
2349While using local RCS, you can pick up recent changes from the CVS
2350repository into your local file, or commit some of your changes back
2351to CVS, without terminating local RCS version control. To do this,
2352switch to the CVS back end temporarily, with the @kbd{C-x v b} command:
2353
2354@table @kbd
2355@item C-x v b
2356Switch to another back end that the current file is registered
2357under (@code{vc-switch-backend}).
2358
2359@item C-u C-x v b @var{backend} @key{RET}
2360Switch to @var{backend} for the current file.
2361@end table
2362
2363@kindex C-x v b
2364@findex vc-switch-backend
2365@kbd{C-x v b} does not change the buffer contents, or any files; it
2366only changes VC's perspective on how to handle the file. Any
2367subsequent VC commands for that file will operate on the back end that
2368is currently selected.
2369
2370If the current file is registered in more than one back end, typing
2371@kbd{C-x v b} ``cycles'' through all of these back ends. With a
2372prefix argument, it asks for the back end to use in the minibuffer.
2373
2374Thus, if you are using local RCS, and you want to pick up some recent
2375changes in the file from remote CVS, first visit the file, then type
2376@kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m
2377@key{RET}} to merge the news (@pxref{Merging}). You can then switch
2378back to RCS by typing @kbd{C-x v b} again, and continue to edit
2379locally.
2380
2381But if you do this, the revision numbers in the RCS master no longer
2382correspond to those of CVS. Technically, this is not a problem, but
2383it can become difficult to keep track of what is in the CVS repository
2384and what is not. So we suggest that you return from time to time to
2385CVS-only operation, by committing your local changes back to the
2386repository using @kbd{C-u C-x v v cvs @key{RET}}.
2387
2388@node Snapshots
2389@subsection Snapshots
2390@cindex snapshots and version control
2391
2392 A @dfn{snapshot} is a named set of file versions (one for each
2393registered file) that you can treat as a unit. One important kind of
2394snapshot is a @dfn{release}, a (theoretically) stable version of the
2395system that is ready for distribution to users.
2396
2397@menu
2398* Making Snapshots:: The snapshot facilities.
2399* Snapshot Caveats:: Things to be careful of when using snapshots.
2400@end menu
2401
2402@node Making Snapshots
2403@subsubsection Making and Using Snapshots
2404
2405 There are two basic commands for snapshots; one makes a
2406snapshot with a given name, the other retrieves a named snapshot.
2407
2408@table @code
2409@kindex C-x v s
2410@findex vc-create-snapshot
2411@item C-x v s @var{name} @key{RET}
2412Define the last saved versions of every registered file in or under the
2413current directory as a snapshot named @var{name}
2414(@code{vc-create-snapshot}).
2415
2416@kindex C-x v r
2417@findex vc-retrieve-snapshot
2418@item C-x v r @var{name} @key{RET}
2419For all registered files at or below the current directory level, select
2420whatever versions correspond to the snapshot @var{name}
2421(@code{vc-retrieve-snapshot}).
2422
2423This command reports an error if any files are locked at or below the
2424current directory, without changing anything; this is to avoid
2425overwriting work in progress.
2426@end table
2427
2428 A snapshot uses a very small amount of resources---just enough to record
2429the list of file names and which version belongs to the snapshot. Thus,
2430you need not hesitate to create snapshots whenever they are useful.
2431
2432 You can give a snapshot name as an argument to @kbd{C-x v =} or
2433@kbd{C-x v ~} (@pxref{Old Versions}). Thus, you can use it to compare a
2434snapshot against the current files, or two snapshots against each other,
2435or a snapshot against a named version.
2436
2437@node Snapshot Caveats
2438@subsubsection Snapshot Caveats
2439
2440@cindex named configurations (RCS)
2441 VC's snapshot facilities are modeled on RCS's named-configuration
2442support. They use RCS's native facilities for this, so
2443snapshots made using RCS through VC are visible even when you bypass VC.
2444
2445 With CVS, Meta-CVS, and Subversion, VC also uses the native
2446mechanism provided by that back end to make snapshots and retrieve them
2447(@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion).
2448
2449@c worded verbosely to avoid overfull hbox.
2450 For SCCS, VC implements snapshots itself. The files it uses contain
2451name/file/version-number triples. These snapshots are visible only
2452through VC.
2453
2454 There is no support for VC snapshots using GNU Arch yet.
2455
2456 A snapshot is a set of checked-in versions. So make sure that all the
2457files are checked in and not locked when you make a snapshot.
2458
2459 File renaming and deletion can create some difficulties with snapshots.
2460This is not a VC-specific problem, but a general design issue in version
2461control systems that no one has solved very well yet.
2462
2463 If you rename a registered file, you need to rename its master along
2464with it (the command @code{vc-rename-file} does this automatically). If
2465you are using SCCS, you must also update the records of the snapshot, to
2466mention the file by its new name (@code{vc-rename-file} does this,
2467too). An old snapshot that refers to a master file that no longer
2468exists under the recorded name is invalid; VC can no longer retrieve
2469it. It would be beyond the scope of this manual to explain enough about
2470RCS and SCCS to explain how to update the snapshots by hand.
2471
2472 Using @code{vc-rename-file} makes the snapshot remain valid for
2473retrieval, but it does not solve all problems. For example, some of the
2474files in your program probably refer to others by name. At the very
2475least, the makefile probably mentions the file that you renamed. If you
2476retrieve an old snapshot, the renamed file is retrieved under its new
2477name, which is not the name that the makefile expects. So the program
2478won't really work as retrieved.
2479
2480@node Miscellaneous VC
2481@subsection Miscellaneous Commands and Features of VC
2482
2483 This section explains the less-frequently-used features of VC.
2484
2485@menu
2486* Change Logs and VC:: Generating a change log file from log entries.
2487* Renaming and VC:: A command to rename both the source and master
2488 file correctly.
2489* Version Headers:: Inserting version control headers into working files.
2490@end menu
2491
2492@node Change Logs and VC
2493@subsubsection Change Logs and VC
2494
2495 If you use RCS or CVS for a program and also maintain a change log
2496file for it (@pxref{Change Log}), you can generate change log entries
2497automatically from the version control log entries:
2498
2499@table @kbd
2500@item C-x v a
2501@kindex C-x v a
2502@findex vc-update-change-log
2503Visit the current directory's change log file and, for registered files
2504in that directory, create new entries for versions checked in since the
2505most recent entry in the change log file.
2506(@code{vc-update-change-log}).
2507
2508This command works with RCS or CVS only, not with any of the other
2509back ends.
2510
2511@item C-u C-x v a
2512As above, but only find entries for the current buffer's file.
2513
2514@item M-1 C-x v a
2515As above, but find entries for all the currently visited files that are
2516maintained with version control. This works only with RCS, and it puts
2517all entries in the log for the default directory, which may not be
2518appropriate.
2519@end table
2520
2521 For example, suppose the first line of @file{ChangeLog} is dated
25221999-04-10, and that the only check-in since then was by Nathaniel
2523Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log
2524messages that start with `#'.}. Then @kbd{C-x v a} visits
2525@file{ChangeLog} and inserts text like this:
2526
2527@iftex
2528@medbreak
2529@end iftex
2530@smallexample
2531@group
25321999-05-22 Nathaniel Bowditch <nat@@apn.org>
2533
2534 * rcs2log: Ignore log messages that start with `#'.
2535@end group
2536@end smallexample
2537@iftex
2538@medbreak
2539@end iftex
2540
2541@noindent
2542You can then edit the new change log entry further as you wish.
2543
2544 Some of the new change log entries may duplicate what's already in
2545ChangeLog. You will have to remove these duplicates by hand.
2546
2547 Normally, the log entry for file @file{foo} is displayed as @samp{*
2548foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted
2549if the text of the log entry starts with @w{@samp{(@var{functionname}):
2550}}. For example, if the log entry for @file{vc.el} is
2551@samp{(vc-do-command): Check call-process status.}, then the text in
2552@file{ChangeLog} looks like this:
2553
2554@iftex
2555@medbreak
2556@end iftex
2557@smallexample
2558@group
25591999-05-06 Nathaniel Bowditch <nat@@apn.org>
2560
2561 * vc.el (vc-do-command): Check call-process status.
2562@end group
2563@end smallexample
2564@iftex
2565@medbreak
2566@end iftex
2567
2568 When @kbd{C-x v a} adds several change log entries at once, it groups
2569related log entries together if they all are checked in by the same
2570author at nearly the same time. If the log entries for several such
2571files all have the same text, it coalesces them into a single entry.
2572For example, suppose the most recent check-ins have the following log
2573entries:
2574
2575@flushleft
2576@bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.}
2577@bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.}
2578@bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.}
2579@end flushleft
2580
2581@noindent
2582They appear like this in @file{ChangeLog}:
2583
2584@iftex
2585@medbreak
2586@end iftex
2587@smallexample
2588@group
25891999-04-01 Nathaniel Bowditch <nat@@apn.org>
2590
2591 * vc.texinfo: Fix expansion typos.
2592
2593 * vc.el, vc-hooks.el: Don't call expand-file-name.
2594@end group
2595@end smallexample
2596@iftex
2597@medbreak
2598@end iftex
2599
2600 Normally, @kbd{C-x v a} separates log entries by a blank line, but you
2601can mark several related log entries to be clumped together (without an
2602intervening blank line) by starting the text of each related log entry
2603with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label
2604itself is not copied to @file{ChangeLog}. For example, suppose the log
2605entries are:
2606
2607@flushleft
2608@bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.}
2609@bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.}
2610@bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.}
2611@end flushleft
2612
2613@noindent
2614Then the text in @file{ChangeLog} looks like this:
2615
2616@iftex
2617@medbreak
2618@end iftex
2619@smallexample
2620@group
26211999-04-01 Nathaniel Bowditch <nat@@apn.org>
2622
2623 * vc.texinfo: Fix expansion typos.
2624 * vc.el, vc-hooks.el: Don't call expand-file-name.
2625@end group
2626@end smallexample
2627@iftex
2628@medbreak
2629@end iftex
2630
2631 A log entry whose text begins with @samp{#} is not copied to
2632@file{ChangeLog}. For example, if you merely fix some misspellings in
2633comments, you can log the change with an entry beginning with @samp{#}
2634to avoid putting such trivia into @file{ChangeLog}.
2635
2636@node Renaming and VC
2637@subsubsection Renaming VC Work Files and Master Files
2638
2639@findex vc-rename-file
2640 When you rename a registered file, you must also rename its master
2641file correspondingly to get proper results. Use @code{vc-rename-file}
2642to rename the source file as you specify, and rename its master file
2643accordingly. It also updates any snapshots (@pxref{Snapshots}) that
2644mention the file, so that they use the new name; despite this, the
2645snapshot thus modified may not completely work (@pxref{Snapshot
2646Caveats}).
2647
2648 Some back ends do not provide an explicit rename operation to their
2649repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v}
2650on the original and renamed buffers and provide the necessary edit
2651log.
2652
2653 You cannot use @code{vc-rename-file} on a file that is locked by
2654someone else.
2655
2656@node Version Headers
2657@subsubsection Inserting Version Control Headers
2658
2659 Sometimes it is convenient to put version identification strings
2660directly into working files. Certain special strings called
2661@dfn{version headers} are replaced in each successive version by the
2662number of that version, the name of the user who created it, and other
2663relevant information. All of the back ends that VC supports have such
2664a mechanism, except GNU Arch.
2665
2666 VC does not normally use the information contained in these headers.
2667The exception is RCS---with RCS, version headers are sometimes more
2668reliable than the master file to determine which version of the file
2669you are editing. Note that in a multi-branch environment, version
2670headers are necessary to make VC behave correctly (@pxref{Multi-User
2671Branching}).
2672
2673 Searching for RCS version headers is controlled by the variable
2674@code{vc-consult-headers}. If it is non-@code{nil} (the default),
2675Emacs searches for headers to determine the version number you are
2676editing. Setting it to @code{nil} disables this feature.
2677
2678 Note that although CVS uses the same kind of version headers as RCS
2679does, VC never searches for these headers if you are using CVS,
2680regardless of the above setting.
2681
2682@kindex C-x v h
2683@findex vc-insert-headers
2684 You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to
2685insert a suitable header string.
2686
2687@table @kbd
2688@item C-x v h
2689Insert headers in a file for use with your version-control system.
2690@end table
2691
2692@vindex vc-@var{backend}-header
2693 The default header string is @samp{@w{$}Id$} for RCS and
2694@samp{@w{%}W%} for SCCS. You can specify other headers to insert by
2695setting the variables @code{vc-@var{backend}-header} where
2696@var{backend} is @code{rcs} or @code{sccs}.
2697
2698 Instead of a single string, you can specify a list of strings; then
2699each string in the list is inserted as a separate header on a line of
2700its own.
2701
2702 It may be necessary to use apparently-superfluous backslashes when
2703writing the strings that you put in this variable. For instance, you
2704might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}. The extra
2705backslash prevents the string constant from being interpreted as a
2706header, if the Emacs Lisp file containing it is maintained with
2707version control.
2708
2709@vindex vc-comment-alist
2710 Each header is inserted surrounded by tabs, inside comment delimiters,
2711on a new line at point. Normally the ordinary comment
2712start and comment end strings of the current mode are used, but for
2713certain modes, there are special comment delimiters for this purpose;
2714the variable @code{vc-comment-alist} specifies them. Each element of
2715this list has the form @code{(@var{mode} @var{starter} @var{ender})}.
2716
2717@vindex vc-static-header-alist
2718 The variable @code{vc-static-header-alist} specifies further strings
2719to add based on the name of the buffer. Its value should be a list of
2720elements of the form @code{(@var{regexp} . @var{format})}. Whenever
2721@var{regexp} matches the buffer name, @var{format} is inserted as part
2722of the header. A header line is inserted for each element that matches
2723the buffer name, and for each string specified by
2724@code{vc-@var{backend}-header}. The header line is made by processing the
2725string from @code{vc-@var{backend}-header} with the format taken from the
2726element. The default value for @code{vc-static-header-alist} is as follows:
2727
2728@example
2729@group
2730(("\\.c$" .
2731 "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
2732#endif /* lint */\n"))
2733@end group
2734@end example
2735
2736@noindent
2737It specifies insertion of text of this form:
2738
2739@example
2740@group
2741
2742#ifndef lint
2743static char vcid[] = "@var{string}";
2744#endif /* lint */
2745@end group
2746@end example
2747
2748@noindent
2749Note that the text above starts with a blank line.
2750
2751 If you use more than one version header in a file, put them close
2752together in the file. The mechanism in @code{revert-buffer} that
2753preserves markers may not handle markers positioned between two version
2754headers.
2755
2756@node Customizing VC
2757@subsection Customizing VC
2758
2759@vindex vc-handled-backends
2760The variable @code{vc-handled-backends} determines which version
2761control systems VC should handle. The default value is @code{(RCS CVS
2762SVN SCCS Arch MCVS)}, so it contains all six version systems that are
2763currently supported. If you want VC to ignore one or more of these
2764systems, exclude its name from the list. To disable VC entirely, set
2765this variable to @code{nil}.
2766
2767The order of systems in the list is significant: when you visit a file
2768registered in more than one system (@pxref{Local Version Control}),
2769VC uses the system that comes first in @code{vc-handled-backends} by
2770default. The order is also significant when you register a file for
2771the first time, @pxref{Registering} for details.
2772
2773@menu
2774* General VC Options:: Options that apply to multiple back ends.
2775* RCS and SCCS:: Options for RCS and SCCS.
2776* CVS Options:: Options for CVS.
2777@end menu
2778
2779@node General VC Options
2780@subsubsection General Options
2781
2782@vindex vc-make-backup-files
2783 Emacs normally does not save backup files for source files that are
2784maintained with version control. If you want to make backup files even
2785for files that use version control, set the variable
2786@code{vc-make-backup-files} to a non-@code{nil} value.
2787
2788@vindex vc-keep-workfiles
2789 Normally the work file exists all the time, whether it is locked or
2790not. If you set @code{vc-keep-workfiles} to @code{nil}, then checking
2791in a new version with @kbd{C-x v v} deletes the work file; but any
2792attempt to visit the file with Emacs creates it again. (With CVS, work
2793files are always kept.)
2794
2795@vindex vc-follow-symlinks
2796 Editing a version-controlled file through a symbolic link can be
2797dangerous. It bypasses the version control system---you can edit the
2798file without locking it, and fail to check your changes in. Also,
2799your changes might overwrite those of another user. To protect against
2800this, VC checks each symbolic link that you visit, to see if it points
2801to a file under version control.
2802
2803 The variable @code{vc-follow-symlinks} controls what to do when a
2804symbolic link points to a version-controlled file. If it is @code{nil},
2805VC only displays a warning message. If it is @code{t}, VC automatically
2806follows the link, and visits the real file instead, telling you about
2807this in the echo area. If the value is @code{ask} (the default), VC
2808asks you each time whether to follow the link.
2809
2810@vindex vc-suppress-confirm
2811 If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v}
2812and @kbd{C-x v i} can save the current buffer without asking, and
2813@kbd{C-x v u} also operates without asking for confirmation. (This
2814variable does not affect @kbd{C-x v c}; that operation is so drastic
2815that it should always ask for confirmation.)
2816
2817@vindex vc-command-messages
2818 VC mode does much of its work by running the shell commands for RCS,
2819CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC
2820displays messages to indicate which shell commands it runs, and
2821additional messages when the commands finish.
2822
2823@vindex vc-path
2824 You can specify additional directories to search for version control
2825programs by setting the variable @code{vc-path}. These directories
2826are searched before the usual search path. It is rarely necessary to
2827set this variable, because VC normally finds the proper files
2828automatically.
2829
2830@node RCS and SCCS
2831@subsubsection Options for RCS and SCCS
2832
2833@cindex non-strict locking (RCS)
2834@cindex locking, non-strict (RCS)
2835 By default, RCS uses locking to coordinate the activities of several
2836users, but there is a mode called @dfn{non-strict locking} in which
2837you can check-in changes without locking the file first. Use
2838@samp{rcs -U} to switch to non-strict locking for a particular file,
2839see the @code{rcs} manual page for details.
2840
2841 When deducing the version control state of an RCS file, VC first
2842looks for an RCS version header string in the file (@pxref{Version
2843Headers}). If there is no header string, VC normally looks at the
2844file permissions of the work file; this is fast. But there might be
2845situations when the file permissions cannot be trusted. In this case
2846the master file has to be consulted, which is rather expensive. Also
2847the master file can only tell you @emph{if} there's any lock on the
2848file, but not whether your work file really contains that locked
2849version.
2850
2851@vindex vc-consult-headers
2852 You can tell VC not to use version headers to determine the file
2853status by setting @code{vc-consult-headers} to @code{nil}. VC then
2854always uses the file permissions (if it is supposed to trust them), or
2855else checks the master file.
2856
2857@vindex vc-mistrust-permissions
2858 You can specify the criterion for whether to trust the file
2859permissions by setting the variable @code{vc-mistrust-permissions}.
2860Its value can be @code{t} (always mistrust the file permissions and
2861check the master file), @code{nil} (always trust the file
2862permissions), or a function of one argument which makes the decision.
2863The argument is the directory name of the @file{RCS} subdirectory. A
2864non-@code{nil} value from the function says to mistrust the file
2865permissions. If you find that the file permissions of work files are
2866changed erroneously, set @code{vc-mistrust-permissions} to @code{t}.
2867Then VC always checks the master file to determine the file's status.
2868
2869 VC determines the version control state of files under SCCS much as
2870with RCS. It does not consider SCCS version headers, though. Thus,
2871the variable @code{vc-mistrust-permissions} affects SCCS use, but
2872@code{vc-consult-headers} does not.
2873
2874@node CVS Options
2875@subsubsection Options specific for CVS
2876
2877@cindex locking (CVS)
2878 By default, CVS does not use locking to coordinate the activities of
2879several users; anyone can change a work file at any time. However,
2880there are ways to restrict this, resulting in behavior that resembles
2881locking.
2882
2883@cindex CVSREAD environment variable (CVS)
2884 For one thing, you can set the @env{CVSREAD} environment variable
2885(the value you use makes no difference). If this variable is defined,
2886CVS makes your work files read-only by default. In Emacs, you must
2887type @kbd{C-x v v} to make the file writable, so that editing works
2888in fact similar as if locking was used. Note however, that no actual
2889locking is performed, so several users can make their files writable
2890at the same time. When setting @env{CVSREAD} for the first time, make
2891sure to check out all your modules anew, so that the file protections
2892are set correctly.
2893
2894@cindex cvs watch feature
2895@cindex watching files (CVS)
2896 Another way to achieve something similar to locking is to use the
2897@dfn{watch} feature of CVS. If a file is being watched, CVS makes it
2898read-only by default, and you must also use @kbd{C-x v v} in Emacs to
2899make it writable. VC calls @code{cvs edit} to make the file writable,
2900and CVS takes care to notify other developers of the fact that you
2901intend to change the file. See the CVS documentation for details on
2902using the watch feature.
2903
2904@vindex vc-stay-local
2905@vindex vc-cvs-stay-local
2906@cindex remote repositories (CVS)
2907 When a file's repository is on a remote machine, VC tries to keep
2908network interactions to a minimum. This is controlled by the variable
2909@code{vc-cvs-stay-local}. There is another variable,
2910@code{vc-stay-local}, which enables the feature also for other back
2911ends that support it, including CVS. In the following, we will talk
2912only about @code{vc-cvs-stay-local}, but everything applies to
2913@code{vc-stay-local} as well.
2914
2915If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses
2916only the entry in the local CVS subdirectory to determine the file's
2917state (and possibly information returned by previous CVS commands).
2918One consequence of this is that when you have modified a file, and
2919somebody else has already checked in other changes to the file, you
2920are not notified of it until you actually try to commit. (But you can
2921try to pick up any recent changes from the repository first, using
2922@kbd{C-x v m @key{RET}}, @pxref{Merging}).
2923
2924 When @code{vc-cvs-stay-local} is @code{t}, VC also makes local
2925version backups, so that simple diff and revert operations are
2926completely local (@pxref{Version Backups}).
2927
2928 On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil},
2929then VC queries the remote repository @emph{before} it decides what to
2930do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local
2931repositories. It also does not make any version backups.
2932
2933 You can also set @code{vc-cvs-stay-local} to a regular expression
2934that is matched against the repository host name; VC then stays local
2935only for repositories from hosts that match the pattern.
2936
2937@vindex vc-cvs-global-switches
2938 You can specify additional command line options to pass to all CVS
2939operations in the variable @code{vc-cvs-global-switches}. These
2940switches are inserted immediately after the @code{cvs} command, before
2941the name of the operation to invoke.
2942
2943@node Directories 2085@node Directories
2944@section File Directories 2086@section File Directories
2945 2087
diff --git a/man/frames.texi b/man/frames.texi
index b5ec21533b7..c11d6f74685 100644
--- a/man/frames.texi
+++ b/man/frames.texi
@@ -27,7 +27,7 @@ it terminates all the frames. To delete just one frame, use @kbd{C-x 5
27 27
28 Emacs compiled for MS-DOS emulates some windowing functionality, 28 Emacs compiled for MS-DOS emulates some windowing functionality,
29so that you can use many of the features described in this chapter. 29so that you can use many of the features described in this chapter.
30@xref{MS-DOS Mouse}, for more information. 30@xref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features}.
31 31
32@menu 32@menu
33* Mouse Commands:: Moving, cutting, and pasting, with the mouse. 33* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
diff --git a/man/gnu.texi b/man/gnu.texi
index c2652d09a7b..6b050d7839a 100644
--- a/man/gnu.texi
+++ b/man/gnu.texi
@@ -2,7 +2,7 @@
2@c Copyright (C) 1985, 1986, 1987, 1993, 1995, 2002, 2003, 2004, 2@c Copyright (C) 1985, 1986, 1987, 1993, 1995, 2002, 2003, 2004,
3@c 2005, 2006 Free Software Foundation, Inc. 3@c 2005, 2006 Free Software Foundation, Inc.
4@ifclear justgnu 4@ifclear justgnu
5@node Manifesto,, MS-DOS, Top 5@node Manifesto,, Emacs and Microsoft Windows, Top
6@unnumbered The GNU Manifesto 6@unnumbered The GNU Manifesto
7@end ifclear 7@end ifclear
8@ifset justgnu 8@ifset justgnu
diff --git a/man/gnus-faq.texi b/man/gnus-faq.texi
index 7fa00c37403..a85a36c2d22 100644
--- a/man/gnus-faq.texi
+++ b/man/gnus-faq.texi
@@ -128,7 +128,7 @@ What is the latest version of Gnus?
128Jingle please: Gnus 5.10 is released, get it while it's 128Jingle please: Gnus 5.10 is released, get it while it's
129hot! As well as the step in version number is rather 129hot! As well as the step in version number is rather
130small, Gnus 5.10 has tons of new features which you 130small, Gnus 5.10 has tons of new features which you
131shouldn't miss. The current release (5.10.6) should be at 131shouldn't miss. The current release (5.10.8) should be at
132least as stable as the latest release of the 5.8 series. 132least as stable as the latest release of the 5.8 series.
133 133
134@node [1.2] 134@node [1.2]
diff --git a/man/gnus.texi b/man/gnus.texi
index 6493911afcf..c5857f40ab4 100644
--- a/man/gnus.texi
+++ b/man/gnus.texi
@@ -4043,6 +4043,22 @@ happens. You just have to be careful if you do stuff like that.
4043 4043
4044@table @kbd 4044@table @kbd
4045 4045
4046@item v
4047@kindex v (Group)
4048@cindex keys, reserved for users (Group)
4049The key @kbd{v} is reserved for users. You can bind it key to some
4050function or better use it as a prefix key. For example:
4051
4052@lisp
4053(define-key gnus-group-mode-map (kbd "v j d")
4054 (lambda ()
4055 (interactive)
4056 (gnus-group-jump-to-group "nndraft:drafts")))
4057@end lisp
4058
4059On keys reserved for users in Emacs and on keybindings in general
4060@xref{Keymaps, Keymaps, , emacs, The Emacs Editor}.
4061
4046@item ^ 4062@item ^
4047@kindex ^ (Group) 4063@kindex ^ (Group)
4048@findex gnus-group-enter-server-mode 4064@findex gnus-group-enter-server-mode
@@ -4438,6 +4454,14 @@ group buffer (@pxref{Selecting a Group}).
4438 4454
4439You can have as many summary buffers open as you wish. 4455You can have as many summary buffers open as you wish.
4440 4456
4457@kindex v (Summary)
4458@cindex keys, reserved for users (Summary)
4459The key @kbd{v} is reserved for users. You can bind it key to some
4460function or better use it as a prefix key. For example:
4461@lisp
4462(define-key gnus-summary-mode-map (kbd "v -") "LrS") ;; lower subthread
4463@end lisp
4464
4441@menu 4465@menu
4442* Summary Buffer Format:: Deciding how the summary buffer is to look. 4466* Summary Buffer Format:: Deciding how the summary buffer is to look.
4443* Summary Maneuvering:: Moving around the summary buffer. 4467* Summary Maneuvering:: Moving around the summary buffer.
@@ -11242,6 +11266,11 @@ buffer, which means that you don't actually have to have a summary
11242buffer displayed while reading. You can do it all from the article 11266buffer displayed while reading. You can do it all from the article
11243buffer. 11267buffer.
11244 11268
11269@kindex v (Article)
11270@cindex keys, reserved for users (Article)
11271The key @kbd{v} is reserved for users. You can bind it key to some
11272function or better use it as a prefix key.
11273
11245A few additional keystrokes are available: 11274A few additional keystrokes are available:
11246 11275
11247@table @kbd 11276@table @kbd
@@ -12272,6 +12301,12 @@ Also @pxref{Formatting Variables}.
12272 12301
12273@table @kbd 12302@table @kbd
12274 12303
12304@item v
12305@kindex v (Server)
12306@cindex keys, reserved for users (Server)
12307The key @kbd{v} is reserved for users. You can bind it key to some
12308function or better use it as a prefix key.
12309
12275@item a 12310@item a
12276@kindex a (Server) 12311@kindex a (Server)
12277@findex gnus-server-add-server 12312@findex gnus-server-add-server
diff --git a/man/macos.texi b/man/macos.texi
index ba0f9e995ca..89ce13d1d1b 100644
--- a/man/macos.texi
+++ b/man/macos.texi
@@ -2,7 +2,7 @@
2@c Copyright (C) 2000, 2001, 2002, 2003, 2004, 2@c Copyright (C) 2000, 2001, 2002, 2003, 2004,
3@c 2005, 2006 Free Software Foundation, Inc. 3@c 2005, 2006 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
5@node Mac OS, MS-DOS, Antinews, Top 5@node Mac OS, Emacs and Microsoft Windows, Antinews, Top
6@appendix Emacs and Mac OS 6@appendix Emacs and Mac OS
7@cindex Mac OS 7@cindex Mac OS
8@cindex Macintosh 8@cindex Macintosh
diff --git a/man/msdog.texi b/man/msdog.texi
index 434427b49b4..3bdc9051a71 100644
--- a/man/msdog.texi
+++ b/man/msdog.texi
@@ -2,307 +2,28 @@
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, 2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 3@c 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
5@node MS-DOS, Manifesto, Mac OS, Top 5@node Emacs and Microsoft Windows, Manifesto, Mac OS, Top
6@appendix Emacs and Microsoft Systems 6@appendix Emacs and Microsoft Windows
7@cindex MS-DOG
8@cindex Microsoft Windows 7@cindex Microsoft Windows
9@cindex MS-DOS peculiarities 8
10 9 This section describes peculiarities of using Emacs on Microsoft
11 This section briefly describes the peculiarities of using Emacs on 10Windows. Information about Emacs and Microsoft's older MS-DOS
12the MS-DOS ``operating system'' (also known as ``MS-DOG'') and on 11``operating system'' (also known as ``MS-DOG'') is now in a separate
13Microsoft Windows. 12manual (@inforef{MS-DOG,, emacs-xtra}).
14 13
15 If you build Emacs for MS-DOS, the binary will also run on Windows 14 Iif you want to use Emacs on Windows, you would normally build Emacs
163.X, Windows NT, Windows 9X/ME, Windows 2000, or OS/2 as a DOS 15specifically for Windows. If you do that, the behavior is reasonably
17application; all the of this chapter applies for all of those systems, 16similar to what is documented in the rest of the manual, including
18if you use an Emacs that was built for MS-DOS. 17support for long file names, multiple frames, scroll bars, mouse
19 18menus, and subprocesses. However, a few special considerations apply,
20 However, if you want to use Emacs on Windows, you would normally 19and they are described here.
21build Emacs specifically for Windows. If you do that, most of this
22chapter does not apply; instead, you get behavior much closer to what
23is documented in the rest of the manual, including support for long
24file names, multiple frames, scroll bars, mouse menus, and
25subprocesses. However, the section on text files and binary files
26does still apply. There are also two sections at the end of this
27chapter which apply specifically for the Windows version.
28 20
29@menu 21@menu
30* Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS. 22* Text and Binary:: Text files use CRLF to terminate lines.
31* Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS.
32* Display: MS-DOS Display. Fonts, frames and display size on MS-DOS.
33* Files: MS-DOS File Names. File name conventions on MS-DOS.
34* Text and Binary:: Text files on MS-DOS use CRLF to separate lines.
35* Printing: MS-DOS Printing. How to specify the printer on MS-DOS.
36* I18N: MS-DOS and MULE. Support for internationalization on MS-DOS.
37* Processes: MS-DOS Processes. Running subprocesses on MS-DOS.
38* Windows Processes:: Running subprocesses on Windows. 23* Windows Processes:: Running subprocesses on Windows.
39* Windows System Menu:: Controlling what the ALT key does. 24* Windows System Menu:: Controlling what the ALT key does.
40@end menu 25@end menu
41 26
42@node MS-DOS Keyboard
43@section Keyboard Usage on MS-DOS
44
45@kindex DEL @r{(MS-DOS)}
46@kindex BS @r{(MS-DOS)}
47 The key that is called @key{DEL} in Emacs (because that's how it is
48designated on most workstations) is known as @key{BS} (backspace) on a
49PC. That is why the PC-specific terminal initialization remaps the
50@key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act
51as @kbd{C-d} for the same reasons.
52
53@kindex C-g @r{(MS-DOS)}
54@kindex C-BREAK @r{(MS-DOS)}
55@cindex quitting on MS-DOS
56 Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit
57character, just like @kbd{C-g}. This is because Emacs cannot detect
58that you have typed @kbd{C-g} until it is ready for more input. As a
59consequence, you cannot use @kbd{C-g} to stop a running command
60(@pxref{Quitting}). By contrast, @kbd{C-@key{BREAK}} @emph{is} detected
61as soon as you type it (as @kbd{C-g} is on other systems), so it can be
62used to stop a running command and for emergency escape
63(@pxref{Emergency Escape}).
64
65@cindex Meta (under MS-DOS)
66@cindex Hyper (under MS-DOS)
67@cindex Super (under MS-DOS)
68@vindex dos-super-key
69@vindex dos-hyper-key
70 The PC keyboard maps use the left @key{ALT} key as the @key{META} key.
71You have two choices for emulating the @key{SUPER} and @key{HYPER} keys:
72choose either the right @key{CTRL} key or the right @key{ALT} key by
73setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1
74or 2 respectively. If neither @code{dos-super-key} nor
75@code{dos-hyper-key} is 1, then by default the right @key{ALT} key is
76also mapped to the @key{META} key. However, if the MS-DOS international
77keyboard support program @file{KEYB.COM} is installed, Emacs will
78@emph{not} map the right @key{ALT} to @key{META}, since it is used for
79accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard
80layouts; in this case, you may only use the left @key{ALT} as @key{META}
81key.
82
83@kindex C-j @r{(MS-DOS)}
84@vindex dos-keypad-mode
85 The variable @code{dos-keypad-mode} is a flag variable that controls
86what key codes are returned by keys in the numeric keypad. You can also
87define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the
88following line into your @file{_emacs} file:
89
90@smallexample
91;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.}
92(define-key function-key-map [kp-enter] [?\C-j])
93@end smallexample
94
95@node MS-DOS Mouse
96@section Mouse Usage on MS-DOS
97
98@cindex mouse support under MS-DOS
99 Emacs on MS-DOS supports a mouse (on the default terminal only).
100The mouse commands work as documented, including those that use menus
101and the menu bar (@pxref{Menu Bar}). Scroll bars don't work in
102MS-DOS Emacs. PC mice usually have only two buttons; these act as
103@kbd{Mouse-1} and @kbd{Mouse-2}, but if you press both of them
104together, that has the effect of @kbd{Mouse-3}. If the mouse does have
1053 buttons, Emacs detects that at startup, and all the 3 buttons function
106normally, as on X.
107
108 Help strings for menu-bar and pop-up menus are displayed in the echo
109area when the mouse pointer moves across the menu items.
110Highlighting of mouse-sensitive text (@pxref{Mouse References}) is also
111supported.
112
113@cindex mouse, set number of buttons
114@findex msdos-set-mouse-buttons
115 Some versions of mouse drivers don't report the number of mouse
116buttons correctly. For example, mice with a wheel report that they
117have 3 buttons, but only 2 of them are passed to Emacs; the clicks on
118the wheel, which serves as the middle button, are not passed. In
119these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command
120to tell Emacs how many mouse buttons to expect. You could make such a
121setting permanent by adding this fragment to your @file{_emacs} init
122file:
123
124@example
125;; @r{Treat the mouse like a 2-button mouse.}
126(msdos-set-mouse-buttons 2)
127@end example
128
129@cindex Windows clipboard support
130 Emacs built for MS-DOS supports clipboard operations when it runs on
131Windows. Commands that put text on the kill ring, or yank text from the
132ring, check the Windows clipboard first, just as Emacs does on the X
133Window System (@pxref{Mouse Commands}). Only the primary selection and
134the cut buffer are supported by MS-DOS Emacs on Windows; the secondary
135selection always appears as empty.
136
137 Due to the way clipboard access is implemented by Windows, the
138length of text you can put into the clipboard is limited by the amount
139of free DOS memory that is available to Emacs. Usually, up to 620KB of
140text can be put into the clipboard, but this limit depends on the system
141configuration and is lower if you run Emacs as a subprocess of
142another program. If the killed text does not fit, Emacs outputs a
143message saying so, and does not put the text into the clipboard.
144
145 Null characters also cannot be put into the Windows clipboard. If the
146killed text includes null characters, Emacs does not put such text into
147the clipboard, and displays in the echo area a message to that effect.
148
149@vindex dos-display-scancodes
150 The variable @code{dos-display-scancodes}, when non-@code{nil},
151directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of
152each keystroke; this feature serves as a complement to the
153@code{view-lossage} command, for debugging.
154
155@node MS-DOS Display
156@section Display on MS-DOS
157@cindex faces under MS-DOS
158@cindex fonts, emulating under MS-DOS
159
160 Display on MS-DOS cannot use font variants, like bold or italic,
161but it does support
162multiple faces, each of which can specify a foreground and a background
163color. Therefore, you can get the full functionality of Emacs packages
164that use fonts (such as @code{font-lock}, Enriched Text mode, and
165others) by defining the relevant faces to use different colors. Use the
166@code{list-colors-display} command (@pxref{Frame Parameters}) and the
167@code{list-faces-display} command (@pxref{Faces}) to see what colors and
168faces are available and what they look like.
169
170 @xref{MS-DOS and MULE}, later in this chapter, for information on
171how Emacs displays glyphs and characters that aren't supported by the
172native font built into the DOS display.
173
174@cindex cursor shape on MS-DOS
175 When Emacs starts, it changes the cursor shape to a solid box. This
176is for compatibility with other systems, where the box cursor is the
177default in Emacs. This default shape can be changed to a bar by
178specifying the @code{cursor-type} parameter in the variable
179@code{default-frame-alist} (@pxref{Creating Frames}). The MS-DOS
180terminal doesn't support a vertical-bar cursor, so the bar cursor is
181horizontal, and the @code{@var{width}} parameter, if specified by the
182frame parameters, actually determines its height. For this reason,
183the @code{bar} and @code{hbar} cursor types produce the same effect on
184MS-DOS. As an extension, the bar cursor specification can include the
185starting scan line of the cursor as well as its width, like this:
186
187@example
188 '(cursor-type bar @var{width} . @var{start})
189@end example
190
191@noindent
192In addition, if the @var{width} parameter is negative, the cursor bar
193begins at the top of the character cell.
194
195@cindex frames on MS-DOS
196 The MS-DOS terminal can only display a single frame at a time. The
197Emacs frame facilities work on MS-DOS much as they do on text-only
198terminals (@pxref{Frames}). When you run Emacs from a DOS window on
199MS-Windows, you can make the visible frame smaller than the full
200screen, but Emacs still cannot display more than a single frame at a
201time.
202
203@cindex frame size under MS-DOS
204@findex mode4350
205@findex mode25
206 The @code{mode4350} command switches the display to 43 or 50
207lines, depending on your hardware; the @code{mode25} command switches
208to the default 80x25 screen size.
209
210 By default, Emacs only knows how to set screen sizes of 80 columns by
21125, 28, 35, 40, 43 or 50 rows. However, if your video adapter has
212special video modes that will switch the display to other sizes, you can
213have Emacs support those too. When you ask Emacs to switch the frame to
214@var{n} rows by @var{m} columns dimensions, it checks if there is a
215variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so,
216uses its value (which must be an integer) as the video mode to switch
217to. (Emacs switches to that video mode by calling the BIOS @code{Set
218Video Mode} function with the value of
219@code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.)
220For example, suppose your adapter will switch to 66x80 dimensions when
221put into video mode 85. Then you can make Emacs support this screen
222size by putting the following into your @file{_emacs} file:
223
224@example
225(setq screen-dimensions-66x80 85)
226@end example
227
228 Since Emacs on MS-DOS can only set the frame size to specific
229supported dimensions, it cannot honor every possible frame resizing
230request. When an unsupported size is requested, Emacs chooses the next
231larger supported size beyond the specified size. For example, if you
232ask for 36x80 frame, you will get 40x80 instead.
233
234 The variables @code{screen-dimensions-@var{n}x@var{m}} are used only
235when they exactly match the specified size; the search for the next
236larger supported size ignores them. In the above example, even if your
237VGA supports 38x80 dimensions and you define a variable
238@code{screen-dimensions-38x80} with a suitable value, you will still get
23940x80 screen when you ask for a 36x80 frame. If you want to get the
24038x80 size in this case, you can do it by setting the variable named
241@code{screen-dimensions-36x80} with the same video mode value as
242@code{screen-dimensions-38x80}.
243
244 Changing frame dimensions on MS-DOS has the effect of changing all the
245other frames to the new dimensions.
246
247@node MS-DOS File Names
248@section File Names on MS-DOS
249@cindex file names under MS-DOS
250@cindex init file, default name under MS-DOS
251
252 MS-DOS normally uses a backslash, @samp{\}, to separate name units
253within a file name, instead of the slash used on other systems. Emacs
254on MS-DOS permits use of either slash or backslash, and also knows
255about drive letters in file names.
256
257 On MS-DOS, file names are case-insensitive and limited to eight
258characters, plus optionally a period and three more characters. Emacs
259knows enough about these limitations to handle file names that were
260meant for other operating systems. For instance, leading dots @samp{.}
261in file names are invalid in MS-DOS, so Emacs transparently converts
262them to underscores @samp{_}; thus your default init file (@pxref{Init
263File}) is called @file{_emacs} on MS-DOS. Excess characters before or
264after the period are generally ignored by MS-DOS itself; thus, if you
265visit the file @file{LongFileName.EvenLongerExtension}, you will
266silently get @file{longfile.eve}, but Emacs will still display the long
267file name on the mode line. Other than that, it's up to you to specify
268file names which are valid under MS-DOS; the transparent conversion as
269described above only works on file names built into Emacs.
270
271@cindex backup file names on MS-DOS
272 The above restrictions on the file names on MS-DOS make it almost
273impossible to construct the name of a backup file (@pxref{Backup
274Names}) without losing some of the original file name characters. For
275example, the name of a backup file for @file{docs.txt} is
276@file{docs.tx~} even if single backup is used.
277
278@cindex file names under Windows 95/NT
279@cindex long file names in DOS box under Windows 95/NT
280 If you run Emacs as a DOS application under Windows 9X, Windows ME, or
281Windows 2000, you can turn on support for long file names. If you do
282that, Emacs doesn't truncate file names or convert them to lower case;
283instead, it uses the file names that you specify, verbatim. To enable
284long file name support, set the environment variable @env{LFN} to
285@samp{y} before starting Emacs. Unfortunately, Windows NT doesn't allow
286DOS programs to access long file names, so Emacs built for MS-DOS will
287only see their short 8+3 aliases.
288
289@cindex @env{HOME} directory under MS-DOS
290 MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
291that the directory where it is installed is the value of the @env{HOME}
292environment variable. That is, if your Emacs binary,
293@file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then
294Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In
295particular, that is where Emacs looks for the init file @file{_emacs}.
296With this in mind, you can use @samp{~} in file names as an alias for
297the home directory, as you would on GNU or Unix. You can also set
298@env{HOME} variable in the environment before starting Emacs; its
299value will then override the above default behavior.
300
301 Emacs on MS-DOS handles the directory name @file{/dev} specially,
302because of a feature in the emulator libraries of DJGPP that pretends
303I/O devices have names in that directory. We recommend that you avoid
304using an actual directory named @file{/dev} on any disk.
305
306@node Text and Binary 27@node Text and Binary
307@section Text Files and Binary Files 28@section Text Files and Binary Files
308@cindex text and binary files on MS-DOS/MS-Windows 29@cindex text and binary files on MS-DOS/MS-Windows
@@ -419,379 +140,6 @@ always writes those files with DOS-style EOLs.
419the file-name patterns in @code{file-name-buffer-file-type-alist}, the 140the file-name patterns in @code{file-name-buffer-file-type-alist}, the
420EOL conversion is determined by @code{file-name-buffer-file-type-alist}. 141EOL conversion is determined by @code{file-name-buffer-file-type-alist}.
421 142
422@node MS-DOS Printing
423@section Printing and MS-DOS
424
425 Printing commands, such as @code{lpr-buffer} (@pxref{Printing}) and
426@code{ps-print-buffer} (@pxref{PostScript}) can work in MS-DOS and
427MS-Windows by sending the output to one of the printer ports, if a
428Posix-style @code{lpr} program is unavailable. The same Emacs
429variables control printing on all systems, but in some cases they have
430different default values on MS-DOS and MS-Windows.
431
432@vindex printer-name @r{(MS-DOS)}
433 If you want to use your local printer, printing on it in the usual DOS
434manner, then set the Lisp variable @code{lpr-command} to @code{""} (its
435default value) and @code{printer-name} to the name of the printer
436port---for example, @code{"PRN"}, the usual local printer port (that's
437the default), or @code{"LPT2"}, or @code{"COM1"} for a serial printer.
438You can also set @code{printer-name} to a file name, in which case
439``printed'' output is actually appended to that file. If you set
440@code{printer-name} to @code{"NUL"}, printed output is silently
441discarded (sent to the system null device).
442
443 On MS-Windows, when the Windows network software is installed, you can
444also use a printer shared by another machine by setting
445@code{printer-name} to the UNC share name for that printer---for example,
446@code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward
447slashes or backslashes here.) To find out the names of shared printers,
448run the command @samp{net view} at a DOS command prompt to obtain a list
449of servers, and @samp{net view @var{server-name}} to see the names of printers
450(and directories) shared by that server. Alternatively, click the
451@samp{Network Neighborhood} icon on your desktop, and look for machines
452which share their printers via the network.
453
454@cindex @samp{net use}, and printing on MS-Windows
455@cindex networked printers (MS-Windows)
456 If the printer doesn't appear in the output of @samp{net view}, or
457if setting @code{printer-name} to the UNC share name doesn't produce a
458hardcopy on that printer, you can use the @samp{net use} command to
459connect a local print port such as @code{"LPT2"} to the networked
460printer. For example, typing @kbd{net use LPT2:
461\\joes_pc\hp4si}@footnote{
462Note that the @samp{net use} command requires the UNC share name to be
463typed with the Windows-style backslashes, while the value of
464@code{printer-name} can be set with either forward- or backslashes.}
465causes Windows to @dfn{capture} the LPT2 port and redirect the printed
466material to the printer connected to the machine @code{joes_pc}.
467After this command, setting @code{printer-name} to @code{"LPT2"}
468should produce the hardcopy on the networked printer.
469
470 With some varieties of Windows network software, you can instruct
471Windows to capture a specific printer port such as @code{"LPT2"}, and
472redirect it to a networked printer via the @w{@code{Control
473Panel->Printers}} applet instead of @samp{net use}.
474
475 Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even
476though they are connected to a Windows machine which uses a different
477encoding for the same locale. For example, in the Latin-1 locale, DOS
478uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and
479MULE}. When you print to such printers from Windows, you can use the
480@kbd{C-x RET c} (@code{universal-coding-system-argument}) command before
481@kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS
482codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET
483M-x lpr-region RET} will print the region while converting it to the
484codepage 850 encoding. You may need to create the @code{cp@var{nnn}}
485coding system with @kbd{M-x codepage-setup}.
486
487 If you set @code{printer-name} to a file name, it's best to use an
488absolute file name. Emacs changes the working directory according to
489the default directory of the current buffer, so if the file name in
490@code{printer-name} is relative, you will end up with several such
491files, each one in the directory of the buffer from which the printing
492was done.
493
494@findex print-buffer @r{(MS-DOS)}
495@findex print-region @r{(MS-DOS)}
496@vindex lpr-headers-switches @r{(MS-DOS)}
497 The commands @code{print-buffer} and @code{print-region} call the
498@code{pr} program, or use special switches to the @code{lpr} program, to
499produce headers on each printed page. MS-DOS and MS-Windows don't
500normally have these programs, so by default, the variable
501@code{lpr-headers-switches} is set so that the requests to print page
502headers are silently ignored. Thus, @code{print-buffer} and
503@code{print-region} produce the same output as @code{lpr-buffer} and
504@code{lpr-region}, respectively. If you do have a suitable @code{pr}
505program (for example, from GNU Textutils), set
506@code{lpr-headers-switches} to @code{nil}; Emacs will then call
507@code{pr} to produce the page headers, and print the resulting output as
508specified by @code{printer-name}.
509
510@vindex print-region-function @r{(MS-DOS)}
511@cindex lpr usage under MS-DOS
512@vindex lpr-command @r{(MS-DOS)}
513@vindex lpr-switches @r{(MS-DOS)}
514 Finally, if you do have an @code{lpr} work-alike, you can set the
515variable @code{lpr-command} to @code{"lpr"}. Then Emacs will use
516@code{lpr} for printing, as on other systems. (If the name of the
517program isn't @code{lpr}, set @code{lpr-command} to specify where to
518find it.) The variable @code{lpr-switches} has its standard meaning
519when @code{lpr-command} is not @code{""}. If the variable
520@code{printer-name} has a string value, it is used as the value for the
521@code{-P} option to @code{lpr}, as on Unix.
522
523@findex ps-print-buffer @r{(MS-DOS)}
524@findex ps-spool-buffer @r{(MS-DOS)}
525@vindex ps-printer-name @r{(MS-DOS)}
526@vindex ps-lpr-command @r{(MS-DOS)}
527@vindex ps-lpr-switches @r{(MS-DOS)}
528 A parallel set of variables, @code{ps-lpr-command},
529@code{ps-lpr-switches}, and @code{ps-printer-name} (@pxref{PostScript
530Variables}), defines how PostScript files should be printed. These
531variables are used in the same way as the corresponding variables
532described above for non-PostScript printing. Thus, the value of
533@code{ps-printer-name} is used as the name of the device (or file) to
534which PostScript output is sent, just as @code{printer-name} is used for
535non-PostScript printing. (There are two distinct sets of variables in
536case you have two printers attached to two different ports, and only one
537of them is a PostScript printer.)
538
539 The default value of the variable @code{ps-lpr-command} is @code{""},
540which causes PostScript output to be sent to the printer port specified
541by @code{ps-printer-name}, but @code{ps-lpr-command} can also be set to
542the name of a program which will accept PostScript files. Thus, if you
543have a non-PostScript printer, you can set this variable to the name of
544a PostScript interpreter program (such as Ghostscript). Any switches
545that need to be passed to the interpreter program are specified using
546@code{ps-lpr-switches}. (If the value of @code{ps-printer-name} is a
547string, it will be added to the list of switches as the value for the
548@code{-P} option. This is probably only useful if you are using
549@code{lpr}, so when using an interpreter typically you would set
550@code{ps-printer-name} to something other than a string so it is
551ignored.)
552
553 For example, to use Ghostscript for printing on an Epson printer
554connected to the @samp{LPT2} port, put this in your @file{_emacs} file:
555
556@example
557(setq ps-printer-name t) ; Ghostscript doesn't understand -P
558(setq ps-lpr-command "c:/gs/gs386")
559(setq ps-lpr-switches '("-q" "-dNOPAUSE"
560 "-sDEVICE=epson"
561 "-r240x72"
562 "-sOutputFile=LPT2"
563 "-Ic:/gs"))
564@end example
565
566@noindent
567(This assumes that Ghostscript is installed in the @file{"c:/gs"}
568directory.)
569
570@vindex dos-printer
571@vindex dos-ps-printer
572 For backwards compatibility, the value of @code{dos-printer}
573(@code{dos-ps-printer}), if it has a value, overrides the value of
574@code{printer-name} (@code{ps-printer-name}), on MS-DOS and MS-Windows
575only.
576
577
578@node MS-DOS and MULE
579@section International Support on MS-DOS
580@cindex international support @r{(MS-DOS)}
581
582 Emacs on MS-DOS supports the same international character sets as it
583does on GNU, Unix and other platforms (@pxref{International}), including
584coding systems for converting between the different character sets.
585However, due to incompatibilities between MS-DOS/MS-Windows and other systems,
586there are several DOS-specific aspects of this support that you should
587be aware of. This section describes these aspects.
588
589 The description below is largely specific to the MS-DOS port of
590Emacs, especially where it talks about practical implications for
591Emacs users. For other operating systems, see the @file{code-pages.el}
592package, which implements support for MS-DOS- and MS-Windows-specific
593encodings for all platforms other than MS-DOS.
594
595@table @kbd
596@item M-x dos-codepage-setup
597Set up Emacs display and coding systems as appropriate for the current
598DOS codepage.
599
600@item M-x codepage-setup
601Create a coding system for a certain DOS codepage.
602@end table
603
604@cindex codepage, MS-DOS
605@cindex DOS codepages
606 MS-DOS is designed to support one character set of 256 characters at
607any given time, but gives you a variety of character sets to choose
608from. The alternative character sets are known as @dfn{DOS codepages}.
609Each codepage includes all 128 @acronym{ASCII} characters, but the other 128
610characters (codes 128 through 255) vary from one codepage to another.
611Each DOS codepage is identified by a 3-digit number, such as 850, 862,
612etc.
613
614 In contrast to X, which lets you use several fonts at the same time,
615MS-DOS normally doesn't allow use of several codepages in a single
616session. MS-DOS was designed to load a single codepage at system
617startup, and require you to reboot in order to change
618it@footnote{Normally, one particular codepage is burnt into the
619display memory, while other codepages can be installed by modifying
620system configuration files, such as @file{CONFIG.SYS}, and rebooting.
621While there is third-party software that allows changing the codepage
622without rebooting, we describe here how a stock MS-DOS system
623behaves.}. Much the same limitation applies when you run DOS
624executables on other systems such as MS-Windows.
625
626@cindex unibyte operation @r{(MS-DOS)}
627 If you invoke Emacs on MS-DOS with the @samp{--unibyte} option
628(@pxref{Initial Options}), Emacs does not perform any conversion of
629non-@acronym{ASCII} characters. Instead, it reads and writes any non-@acronym{ASCII}
630characters verbatim, and sends their 8-bit codes to the display
631verbatim. Thus, unibyte Emacs on MS-DOS supports the current codepage,
632whatever it may be, but cannot even represent any other characters.
633
634@vindex dos-codepage
635 For multibyte operation on MS-DOS, Emacs needs to know which
636characters the chosen DOS codepage can display. So it queries the
637system shortly after startup to get the chosen codepage number, and
638stores the number in the variable @code{dos-codepage}. Some systems
639return the default value 437 for the current codepage, even though the
640actual codepage is different. (This typically happens when you use the
641codepage built into the display hardware.) You can specify a different
642codepage for Emacs to use by setting the variable @code{dos-codepage} in
643your init file.
644
645@cindex language environment, automatic selection on @r{MS-DOS}
646 Multibyte Emacs supports only certain DOS codepages: those which can
647display Far-Eastern scripts, like the Japanese codepage 932, and those
648that encode a single ISO 8859 character set.
649
650 The Far-Eastern codepages can directly display one of the MULE
651character sets for these countries, so Emacs simply sets up to use the
652appropriate terminal coding system that is supported by the codepage.
653The special features described in the rest of this section mostly
654pertain to codepages that encode ISO 8859 character sets.
655
656 For the codepages which correspond to one of the ISO character sets,
657Emacs knows the character set name based on the codepage number. Emacs
658automatically creates a coding system to support reading and writing
659files that use the current codepage, and uses this coding system by
660default. The name of this coding system is @code{cp@var{nnn}}, where
661@var{nnn} is the codepage number.@footnote{The standard Emacs coding
662systems for ISO 8859 are not quite right for the purpose, because
663typically the DOS codepage does not match the standard ISO character
664codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has
665code 231 in the standard Latin-1 character set, but the corresponding
666DOS codepage 850 uses code 135 for this glyph.}
667
668@cindex mode line @r{(MS-DOS)}
669 All the @code{cp@var{nnn}} coding systems use the letter @samp{D} (for
670``DOS'') as their mode-line mnemonic. Since both the terminal coding
671system and the default coding system for file I/O are set to the proper
672@code{cp@var{nnn}} coding system at startup, it is normal for the mode
673line on MS-DOS to begin with @samp{-DD\-}. @xref{Mode Line}.
674Far-Eastern DOS terminals do not use the @code{cp@var{nnn}} coding
675systems, and thus their initial mode line looks like the Emacs default.
676
677 Since the codepage number also indicates which script you are using,
678Emacs automatically runs @code{set-language-environment} to select the
679language environment for that script (@pxref{Language Environments}).
680
681 If a buffer contains a character belonging to some other ISO 8859
682character set, not the one that the chosen DOS codepage supports, Emacs
683displays it using a sequence of @acronym{ASCII} characters. For example, if the
684current codepage doesn't have a glyph for the letter @samp{@`o} (small
685@samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where
686the braces serve as a visual indication that this is a single character.
687(This may look awkward for some non-Latin characters, such as those from
688Greek or Hebrew alphabets, but it is still readable by a person who
689knows the language.) Even though the character may occupy several
690columns on the screen, it is really still just a single character, and
691all Emacs commands treat it as one.
692
693@cindex IBM graphics characters (MS-DOS)
694@cindex box-drawing characters (MS-DOS)
695@cindex line-drawing characters (MS-DOS)
696 Not all characters in DOS codepages correspond to ISO 8859
697characters---some are used for other purposes, such as box-drawing
698characters and other graphics. Emacs maps these characters to two
699special character sets called @code{eight-bit-control} and
700@code{eight-bit-graphic}, and displays them as their IBM glyphs.
701However, you should be aware that other systems might display these
702characters differently, so you should avoid them in text that might be
703copied to a different operating system, or even to another DOS machine
704that uses a different codepage.
705
706@vindex dos-unsupported-character-glyph
707 Emacs supports many other characters sets aside from ISO 8859, but it
708cannot display them on MS-DOS. So if one of these multibyte characters
709appears in a buffer, Emacs on MS-DOS displays them as specified by the
710@code{dos-unsupported-character-glyph} variable; by default, this glyph
711is an empty triangle. Use the @kbd{C-u C-x =} command to display the
712actual code and character set of such characters. @xref{Position Info}.
713
714@findex codepage-setup
715 By default, Emacs defines a coding system to support the current
716codepage. To define a coding system for some other codepage (e.g., to
717visit a file written on a DOS machine in another country), use the
718@kbd{M-x codepage-setup} command. It prompts for the 3-digit code of
719the codepage, with completion, then creates the coding system for the
720specified codepage. You can then use the new coding system to read and
721write files, but you must specify it explicitly for the file command
722when you want to use it (@pxref{Text Coding}).
723
724 These coding systems are also useful for visiting a file encoded using
725a DOS codepage, using Emacs running on some other operating system.
726
727@cindex MS-Windows codepages
728 MS-Windows provides its own codepages, which are different from the
729DOS codepages for the same locale. For example, DOS codepage 850
730supports the same character set as Windows codepage 1252; DOS codepage
731855 supports the same character set as Windows codepage 1251, etc.
732The MS-Windows version of Emacs uses the current codepage for display
733when invoked with the @samp{-nw} option. Support for codepages in the
734Windows port of Emacs is part of the @file{code-pages.el} package.
735
736@node MS-DOS Processes
737@section Subprocesses on MS-DOS
738
739@cindex compilation under MS-DOS
740@cindex inferior processes under MS-DOS
741@findex compile @r{(MS-DOS)}
742@findex grep @r{(MS-DOS)}
743 Because MS-DOS is a single-process ``operating system,''
744asynchronous subprocesses are not available. In particular, Shell
745mode and its variants do not work. Most Emacs features that use
746asynchronous subprocesses also don't work on MS-DOS, including
747Shell mode and GUD. When in doubt, try and see; commands that
748don't work output an error message saying that asynchronous processes
749aren't supported.
750
751 Compilation under Emacs with @kbd{M-x compile}, searching files with
752@kbd{M-x grep} and displaying differences between files with @kbd{M-x
753diff} do work, by running the inferior processes synchronously. This
754means you cannot do any more editing until the inferior process
755finishes.
756
757 Spell checking also works, by means of special support for synchronous
758invocation of the @code{ispell} program. This is slower than the
759asynchronous invocation on other platforms
760
761 Instead of the Shell mode, which doesn't work on MS-DOS, you can use
762the @kbd{M-x eshell} command. This invokes the Eshell package that
763implements a Posix-like shell entirely in Emacs Lisp.
764
765 By contrast, Emacs compiled as a native Windows application
766@strong{does} support asynchronous subprocesses. @xref{Windows
767Processes}.
768
769@cindex printing under MS-DOS
770 Printing commands, such as @code{lpr-buffer} (@pxref{Printing}) and
771@code{ps-print-buffer} (@pxref{PostScript}), work in MS-DOS by sending
772the output to one of the printer ports. @xref{MS-DOS Printing}.
773
774 When you run a subprocess synchronously on MS-DOS, make sure the
775program terminates and does not try to read keyboard input. If the
776program does not terminate on its own, you will be unable to terminate
777it, because MS-DOS provides no general way to terminate a process.
778Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these
779cases.
780
781 Accessing files on other machines is not supported on MS-DOS. Other
782network-oriented commands such as sending mail, Web browsing, remote
783login, etc., don't work either, unless network access is built into
784MS-DOS with some network redirector.
785
786@cindex directory listing on MS-DOS
787@vindex dired-listing-switches @r{(MS-DOS)}
788 Dired on MS-DOS uses the @code{ls-lisp} package where other
789platforms use the system @code{ls} command. Therefore, Dired on
790MS-DOS supports only some of the possible options you can mention in
791the @code{dired-listing-switches} variable. The options that work are
792@samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S},
793@samp{-s}, @samp{-t}, and @samp{-u}.
794
795@node Windows Processes 143@node Windows Processes
796@section Subprocesses on Windows 9X/ME and Windows NT/2K 144@section Subprocesses on Windows 9X/ME and Windows NT/2K
797 145
diff --git a/man/mule.texi b/man/mule.texi
index 4b63fb90d4e..91c5aaaf47e 100644
--- a/man/mule.texi
+++ b/man/mule.texi
@@ -605,7 +605,7 @@ system; for example, to visit a file encoded in codepage 850, type
605@key{RET}}@footnote{ 605@key{RET}}@footnote{
606In the MS-DOS port of Emacs, you need to create a @code{cp@var{nnn}} 606In the MS-DOS port of Emacs, you need to create a @code{cp@var{nnn}}
607coding system with @kbd{M-x codepage-setup}, before you can use it. 607coding system with @kbd{M-x codepage-setup}, before you can use it.
608@xref{MS-DOS and MULE}.}. 608@xref{MS-DOS and MULE,,,emacs-extra,Specialized Emacs Features}.}.
609 609
610 In addition to converting various representations of non-@acronym{ASCII} 610 In addition to converting various representations of non-@acronym{ASCII}
611characters, a coding system can perform end-of-line conversion. Emacs 611characters, a coding system can perform end-of-line conversion. Emacs
diff --git a/man/org.texi b/man/org.texi
index 60259e2834c..f3a6c21a445 100644
--- a/man/org.texi
+++ b/man/org.texi
@@ -4,8 +4,8 @@
4@setfilename ../info/org 4@setfilename ../info/org
5@settitle Org Mode Manual 5@settitle Org Mode Manual
6 6
7@set VERSION 4.10 7@set VERSION 4.23
8@set DATE March 2006 8@set DATE April 2006
9 9
10@dircategory Emacs 10@dircategory Emacs
11@direntry 11@direntry
@@ -22,8 +22,7 @@
22 22
23@c Macro definitions 23@c Macro definitions
24 24
25@c FIXME: does not look good in html 25@c Subheadings inside a table.
26@c Subheadings inside a table. Need a difference between info and the rest.
27@macro tsubheading{text} 26@macro tsubheading{text}
28@ifinfo 27@ifinfo
29@subsubheading \text\ 28@subsubheading \text\
@@ -82,6 +81,7 @@ Software Foundation raise funds for GNU development.''
82* Hyperlinks:: Notes in context 81* Hyperlinks:: Notes in context
83* TODO items:: Every tree branch can be a TODO item 82* TODO items:: Every tree branch can be a TODO item
84* Timestamps:: Assign date and time to items 83* Timestamps:: Assign date and time to items
84* Tags:: Tagging headlines and matching sets of tags
85* Agenda Views:: Collecting information into views 85* Agenda Views:: Collecting information into views
86* Exporting:: Sharing and publishing of notes 86* Exporting:: Sharing and publishing of notes
87* Miscellaneous:: All the rest which did not fit elsewhere 87* Miscellaneous:: All the rest which did not fit elsewhere
@@ -94,7 +94,7 @@ Software Foundation raise funds for GNU development.''
94Introduction 94Introduction
95 95
96* Summary:: Brief summary of what Org-mode does 96* Summary:: Brief summary of what Org-mode does
97* Installation and Activation:: How to install Org-mode 97* Installation and activation:: How to install Org-mode
98* Feedback:: Bug reports, ideas, patches etc. 98* Feedback:: Bug reports, ideas, patches etc.
99 99
100Document Structure 100Document Structure
@@ -106,12 +106,12 @@ Document Structure
106* Structure editing:: Changing sequence and level of headlines 106* Structure editing:: Changing sequence and level of headlines
107* Archiving:: Move done task trees to a different place 107* Archiving:: Move done task trees to a different place
108* Sparse trees:: Matches embedded in context 108* Sparse trees:: Matches embedded in context
109* Tags:: Tagging headlines and matching sets of tags
110* Plain Lists:: Editing hand-formatted lists 109* Plain Lists:: Editing hand-formatted lists
111 110
112Tables 111Tables
113 112
114* Built-in table editor:: Simple tables 113* Built-in table editor:: Simple tables
114* Narrow columns:: Stop wasting space in tables
115* Table calculations:: Compute a field from other fields 115* Table calculations:: Compute a field from other fields
116* orgtbl-mode:: The table editor as minor mode 116* orgtbl-mode:: The table editor as minor mode
117* table.el:: Complex tables 117* table.el:: Complex tables
@@ -127,13 +127,14 @@ Calculations in tables
127 127
128Hyperlinks 128Hyperlinks
129 129
130* Internal Links:: Links to other places in the current file 130* Link format:: How links in Org-mode are formatted
131* External Links:: URL-like links to the world 131* Internal links:: Links to other places in the current file
132* External links:: URL-like links to the world
132* Managing links:: Creating, inserting and following 133* Managing links:: Creating, inserting and following
133* Search Options:: Linking to a specific location 134* Search Options:: Linking to a specific location
134* Remember:: Org-trees store quick notes 135* Remember:: Org-trees store quick notes
135 136
136Internal Links 137Internal links
137 138
138* Radio targets:: Make targets trigger links in plain text. 139* Radio targets:: Make targets trigger links in plain text.
139* CamelCase links:: Activating CamelCase words as links 140* CamelCase links:: Activating CamelCase words as links
@@ -141,7 +142,7 @@ Internal Links
141TODO items 142TODO items
142 143
143* TODO basics:: Marking and displaying TODO entries 144* TODO basics:: Marking and displaying TODO entries
144* Progress Logging:: Document your productivity 145* Progress logging:: Document your productivity
145* TODO extensions:: Workflow and assignments 146* TODO extensions:: Workflow and assignments
146* Priorities:: Some things are more important than others 147* Priorities:: Some things are more important than others
147 148
@@ -156,6 +157,12 @@ Timestamps
156* Time stamps:: Assigning a time to a tree entry 157* Time stamps:: Assigning a time to a tree entry
157* Creating timestamps:: Commands which insert timestamps 158* Creating timestamps:: Commands which insert timestamps
158 159
160Tags
161
162* Tag inheritance:: Tags use the tree structure of the outline
163* Setting tags:: How to assign tags to a headline
164* Tag searches:: Searching for combinations of tags
165
159Agenda Views 166Agenda Views
160 167
161* Agenda files:: Files being searched for agenda information 168* Agenda files:: Files being searched for agenda information
@@ -175,20 +182,24 @@ The weekly/daily agenda
175 182
176Exporting 183Exporting
177 184
178* ASCII export:: Export as a structured ASCII file 185* ASCII export:: Exporting to plain ASCII
179* HTML export:: Export as an HTML file 186* HTML export:: Exporting to HTML
180* iCalendar export:: Create calendar entries. 187* XML export:: Exporting to XML
188* iCalendar export:: Exporting in iCalendar format
189* Text interpretation:: How the exporter looks at the file
181 190
182HTML export 191Text interpretation by the exporter
183 192
184* HTML formatting:: Interpretation of the buffer content 193* Comment lines:: Some lines will not be exported
185* Export options:: How to influence exports 194* Enhancing text:: Subscripts, symbols and more
186* Comment lines:: Lines which will not be exported 195* Export options:: How to influence the export settings
187 196
188Miscellaneous 197Miscellaneous
189 198
190* Completion:: M-TAB knows what you need 199* Completion:: M-TAB knows what you need
191* Customization:: Adapting Org-mode to your taste 200* Customization:: Adapting Org-mode to your taste
201* Summary of in-buffer settings:: Using special lines to set options
202* The very busy C-c C-c key:: When in doubt, press C-c C-c
192* Clean view:: Getting rid of leading stars in the outline 203* Clean view:: Getting rid of leading stars in the outline
193* TTY keys:: Using Org-mode on a tty 204* TTY keys:: Using Org-mode on a tty
194* FAQ:: Frequently asked questions 205* FAQ:: Frequently asked questions
@@ -205,11 +216,11 @@ Miscellaneous
205 216
206@menu 217@menu
207* Summary:: Brief summary of what Org-mode does 218* Summary:: Brief summary of what Org-mode does
208* Installation and Activation:: How to install Org-mode 219* Installation and activation:: How to install Org-mode
209* Feedback:: Bug reports, ideas, patches etc. 220* Feedback:: Bug reports, ideas, patches etc.
210@end menu 221@end menu
211 222
212@node Summary, Installation and Activation, Introduction, Introduction 223@node Summary, Installation and activation, Introduction, Introduction
213@section Summary 224@section Summary
214@cindex summary 225@cindex summary
215 226
@@ -234,7 +245,7 @@ Org-mode keeps simple things simple. When first fired up, it should
234feel like a simple but easy to use outliner. Complexity is not 245feel like a simple but easy to use outliner. Complexity is not
235imposed, but a large amount of functionality is available when you 246imposed, but a large amount of functionality is available when you
236need it. Org-mode can be used on different levels and in different 247need it. Org-mode can be used on different levels and in different
237ways, for example 248ways, for example:
238 249
239@example 250@example
240@r{@bullet{} as an outline extension with visibility cycling and structure editing} 251@r{@bullet{} as an outline extension with visibility cycling and structure editing}
@@ -255,7 +266,7 @@ and example files. This page is located at
255 266
256@page 267@page
257 268
258@node Installation and Activation, Feedback, Summary, Introduction 269@node Installation and activation, Feedback, Summary, Introduction
259@section Installation and Activation 270@section Installation and Activation
260@cindex installation 271@cindex installation
261@cindex autoload 272@cindex autoload
@@ -301,9 +312,9 @@ MY PROJECTS -*- mode: org; -*-
301 312
302@noindent which will select Org-mode for this buffer no matter what 313@noindent which will select Org-mode for this buffer no matter what
303the file's name is. See also the variable 314the file's name is. See also the variable
304@code{org-insert-mode-line-in-empty-file'}. 315@code{org-insert-mode-line-in-empty-file}.
305 316
306@node Feedback, , Installation and Activation, Introduction 317@node Feedback, , Installation and activation, Introduction
307@section Feedback 318@section Feedback
308@cindex feedback 319@cindex feedback
309@cindex bug reports 320@cindex bug reports
@@ -316,16 +327,17 @@ or ideas about it, please contact the maintainer Carsten Dominik at
316 327
317For bug reports, please provide as much information as possible, 328For bug reports, please provide as much information as possible,
318including the version information of Emacs (@kbd{C-h v emacs-version 329including the version information of Emacs (@kbd{C-h v emacs-version
319@key{RET}}) and Org-mode (@kbd{M-x org-version}), as well as the 330@key{RET}}) and Org-mode (@kbd{C-h v org-version @key{RET}}), as well as
320Org-mode related setup in @file{.emacs}. If an error occurs, a 331the Org-mode related setup in @file{.emacs}. If an error occurs, a
321traceback can be very useful. Often a small example file helps, along 332traceback can be very useful. Often a small example file helps, along
322with clear information about: 333with clear information about:
334
323@enumerate 335@enumerate
324@item What exactly did you do? 336@item What exactly did you do?
325@item What did you expect to happen? 337@item What did you expect to happen?
326@item What happened instead? 338@item What happened instead?
327@end enumerate 339@end enumerate
328@noindent Thanks for helping to improve this mode. 340@noindent Thank you for helping to improve this mode.
329 341
330@node Document Structure, Tables, Introduction, Top 342@node Document Structure, Tables, Introduction, Top
331@chapter Document Structure 343@chapter Document Structure
@@ -343,7 +355,6 @@ edit the structure of the document.
343* Structure editing:: Changing sequence and level of headlines 355* Structure editing:: Changing sequence and level of headlines
344* Archiving:: Move done task trees to a different place 356* Archiving:: Move done task trees to a different place
345* Sparse trees:: Matches embedded in context 357* Sparse trees:: Matches embedded in context
346* Tags:: Tagging headlines and matching sets of tags
347* Plain Lists:: Editing hand-formatted lists 358* Plain Lists:: Editing hand-formatted lists
348@end menu 359@end menu
349 360
@@ -367,9 +378,9 @@ key.
367@cindex headlines 378@cindex headlines
368@cindex outline tree 379@cindex outline tree
369 380
370Headlines define the structure of an outline tree. The Headlines in 381Headlines define the structure of an outline tree. The headlines in
371Org-mode start with one or more stars, on the left margin. For 382Org-mode start with one or more stars, on the left margin. For
372example 383example:
373 384
374@example 385@example
375* Top level headline 386* Top level headline
@@ -380,6 +391,7 @@ example
380 more text 391 more text
381* Another top level headline 392* Another top level headline
382@end example 393@end example
394
383@noindent Some people find the many stars too noisy and would prefer an 395@noindent Some people find the many stars too noisy and would prefer an
384outline that has whitespace followed by a single star as headline 396outline that has whitespace followed by a single star as headline
385starters. @ref{Clean view} describes a setup to realize this. 397starters. @ref{Clean view} describes a setup to realize this.
@@ -404,10 +416,12 @@ the visibility in the buffer.
404@kindex @key{TAB} 416@kindex @key{TAB}
405@item @key{TAB} 417@item @key{TAB}
406Rotate current subtree between the states 418Rotate current subtree between the states
419
407@example 420@example
408,-> FOLDED -> CHILDREN -> SUBTREE --. 421,-> FOLDED -> CHILDREN -> SUBTREE --.
409'-----------------------------------' 422'-----------------------------------'
410@end example 423@end example
424
411At the beginning of the buffer (or when called with @kbd{C-u}), this does 425At the beginning of the buffer (or when called with @kbd{C-u}), this does
412the same as the command @kbd{S-@key{TAB}} below. 426the same as the command @kbd{S-@key{TAB}} below.
413 427
@@ -418,10 +432,12 @@ the same as the command @kbd{S-@key{TAB}} below.
418@kindex S-@key{TAB} 432@kindex S-@key{TAB}
419@item S-@key{TAB} 433@item S-@key{TAB}
420Rotate the entire buffer between the states 434Rotate the entire buffer between the states
435
421@example 436@example
422,-> OVERVIEW -> CONTENTS -> SHOW ALL --. 437,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
423'--------------------------------------' 438'--------------------------------------'
424@end example 439@end example
440
425Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field. 441Note that inside tables, @kbd{S-@key{TAB}} jumps to the previous field.
426 442
427@cindex show all, command 443@cindex show all, command
@@ -437,9 +453,9 @@ per-file basis by adding one of the following lines anywhere in the
437buffer: 453buffer:
438 454
439@example 455@example
440#+STARTUP: fold 456#+STARTUP: overview
441#+STARTUP: nofold
442#+STARTUP: content 457#+STARTUP: content
458#+STARTUP: showall
443@end example 459@end example
444 460
445@node Motion, Structure editing, Visibility cycling, Document Structure 461@node Motion, Structure editing, Visibility cycling, Document Structure
@@ -499,23 +515,23 @@ beginning of the next line.
499Insert new TODO entry with same level as current heading. 515Insert new TODO entry with same level as current heading.
500@kindex M-@key{left} 516@kindex M-@key{left}
501@item M-@key{left} 517@item M-@key{left}
502Promote current heading by one level 518Promote current heading by one level.
503@kindex M-@key{right} 519@kindex M-@key{right}
504@item M-@key{right} 520@item M-@key{right}
505Demote current heading by one level 521Demote current heading by one level.
506@kindex M-S-@key{left} 522@kindex M-S-@key{left}
507@item M-S-@key{left} 523@item M-S-@key{left}
508Promote the current subtree by one level 524Promote the current subtree by one level.
509@kindex M-S-@key{right} 525@kindex M-S-@key{right}
510@item M-S-@key{right} 526@item M-S-@key{right}
511Demote the current subtree by one level 527Demote the current subtree by one level.
512@kindex M-S-@key{up} 528@kindex M-S-@key{up}
513@item M-S-@key{up} 529@item M-S-@key{up}
514Move subtree up (swap with previous subtree of same 530Move subtree up (swap with previous subtree of same
515level) 531level).
516@kindex M-S-@key{down} 532@kindex M-S-@key{down}
517@item M-S-@key{down} 533@item M-S-@key{down}
518Move subtree down (swap with next subtree of same level) 534Move subtree down (swap with next subtree of same level).
519@kindex C-c C-x C-w 535@kindex C-c C-x C-w
520@kindex C-c C-x C-k 536@kindex C-c C-x C-k
521@item C-c C-x C-w 537@item C-c C-x C-w
@@ -567,7 +583,7 @@ this, see the documentation string of the variable
567agenda, archiving to a different file is a good way to keep archived 583agenda, archiving to a different file is a good way to keep archived
568trees from contributing agenda items. 584trees from contributing agenda items.
569 585
570@node Sparse trees, Tags, Archiving, Document Structure 586@node Sparse trees, Plain Lists, Archiving, Document Structure
571@section Sparse trees 587@section Sparse trees
572@cindex sparse trees 588@cindex sparse trees
573@cindex trees, sparse 589@cindex trees, sparse
@@ -602,11 +618,13 @@ For frequently used sparse trees of specific search strings, you can
602use the variable @code{org-agenda-custom-commands} to define fast 618use the variable @code{org-agenda-custom-commands} to define fast
603keyboard access to specific sparse trees. These commands will then be 619keyboard access to specific sparse trees. These commands will then be
604accessible through the agenda dispatcher (@pxref{Agenda dispatcher}). 620accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
605For example 621For example:
622
606@lisp 623@lisp
607(setq org-agenda-custom-commands 624(setq org-agenda-custom-commands
608 '(("f" occur-tree "FIXME"))) 625 '(("f" occur-tree "FIXME")))
609@end lisp 626@end lisp
627
610@noindent will define the key @kbd{C-c a f} as a shortcut for creating 628@noindent will define the key @kbd{C-c a f} as a shortcut for creating
611a sparse tree matching the string @samp{FIXME}. 629a sparse tree matching the string @samp{FIXME}.
612 630
@@ -621,97 +639,20 @@ To print a sparse tree, you can use the Emacs command
621of the document @footnote{This does not work under XEmacs, because 639of the document @footnote{This does not work under XEmacs, because
622XEmacs uses selective display for outlining, not text properties}. 640XEmacs uses selective display for outlining, not text properties}.
623Or you can use the command @kbd{C-c C-x v} to copy the visible part of 641Or you can use the command @kbd{C-c C-x v} to copy the visible part of
624the document to another file (extension @file{.txt}) which then can be 642the document to another file (extension @file{.txt}) which can then be
625printed in any desired way. 643printed in any desired way.
626 644
627@node Tags, Plain Lists, Sparse trees, Document Structure
628@section Tags
629@cindex tags
630@cindex headline tagging
631@cindex matching, tags
632@cindex sparse tree, tag based
633
634If you wish to implement a tag system to cross-correlate information,
635this can be done as well in Org-mode. Every headline can contain a
636list of tags, at the end of the headline. Tags are normal words
637containing letters, numbers, @samp{_}, and @samp{@@}. Tags must be
638preceded and followed by a single colon; like @samp{:WORK:}. Several
639tags can be specified like @samp{:WORK:URGENT:}.
640
641@cindex inheritance, of tags
642Tags make use of the hierarchical structure of outline trees. If a
643heading has a certain tag, all subheadings will inherit the tag as
644well. For example, in the list
645
646@example
647* Meeting with the French group :WORK:
648** Summary by Frank :BOSS:NOTES:
649*** TODO Prepare slides for him :ACTION:
650@end example
651@noindent
652the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
653@samp{:NOTES:}, and @samp{:ACTION:}. When executing tag searches and
654Org-mode finds that a certain headline matches the search criterion,
655it will not check any sublevel headline, assuming that these likely
656also match, and that the list of matches can become very long. You
657can influence inheritance and searching using the variables
658@code{org-use-tag-inheritance} and
659@code{org-tags-match-list-sublevels}.
660
661@kindex M-@key{TAB}
662Tags can simply be typed into the buffer. After a colon,
663@kbd{M-@key{TAB}} offers completion on all tags being used in the
664current buffer. There are also special commands for inserting tags,
665and for executing searches based on tags.
666
667@table @kbd
668@kindex C-c C-c
669@item C-c C-c
670@cindex completion, of tags
671Enter new tags for the current headline. The minibuffer will prompt
672for a list of tags and offer completion with respect to all other tags
673used in the current buffer. Several tags, separated by colons, may be
674specified at the prompt. After pressing @key{RET}, the tags will
675be inserted and aligned to @code{org-tags-column}. When called with a
676@kbd{C-u} prefix, align all tags in the current buffer to that column,
677just to make things look nice. TAGS are automatically realigned after
678promotion, demotion, and TODO state changes (@pxref{TODO basics}).
679@kindex C-c \
680@item C-c \
681Create a sparse tree with all headlines matching a tags search.
682@kindex C-c a m
683@item C-c a m
684Create a global list of tag matches from all agenda files.
685@xref{Matching headline tags}.
686@kindex C-c a M
687@item C-c a M
688Create a global list of tag matches from all agenda files, but check
689only TODO items and force checking subitems (see variable
690@code{org-tags-match-list-sublevels}).
691@end table
692
693A tags search string can use Boolean operators @samp{&} for AND and
694@samp{|} for OR. @samp{&} binds more strongly than
695@samp{|}. Parenthesis are currently no implemented. A tag may also be
696preceded by @samp{-}, to select against it, and @samp{+} is syntactic
697sugar for positive selection. The AND operator @samp{&} is optional
698when @samp{+} or @samp{-} is present. For example, @samp{+WORK-BOSS}
699would select all headlines that are tagged @samp{:WORK:}, but discard
700those also tagged @samp{:BOSS:}. The search string @samp{WORK|LAPTOP}
701selects all lines tagged @samp{:WORK:} or @samp{:LAPTOP:}. The string
702@samp{WORK|LAPTOP&NIGHT} requires that the @samp{:LAPTOP:} lines are
703also tagged @samp{NIGHT}.
704 645
705@node Plain Lists, , Tags, Document Structure 646@node Plain Lists, , Sparse trees, Document Structure
706@section Plain Lists 647@section Plain Lists
707@cindex plain lists 648@cindex plain lists
708@cindex lists, plain 649@cindex lists, plain
709@cindex lists, ordered 650@cindex lists, ordered
710@cindex ordered lists 651@cindex ordered lists
711 652
712Headlines define the structure of the Org-mode file, and also lists 653Headlines define both the structure of the Org-mode file, and also lists
713(for example TODO items (@pxref{TODO items}) should be created using 654(for example, TODO items (@pxref{TODO items}) should be created using
714headline levels. However, when taking notes, the plain text is 655headline levels). However, when taking notes, the plain text is
715sometimes easier to read with hand-formatted lists. Org-mode supports 656sometimes easier to read with hand-formatted lists. Org-mode supports
716editing such lists, and the HTML exporter (@pxref{Exporting}) does 657editing such lists, and the HTML exporter (@pxref{Exporting}) does
717parse and format them. 658parse and format them.
@@ -721,11 +662,11 @@ with @samp{-}, @samp{+}, or @samp{*}@footnote{When using @samp{*} as a
721bullet, lines must be indented or they will be seen as top-level 662bullet, lines must be indented or they will be seen as top-level
722headlines. Also, when you are hiding leading stars to get a clean 663headlines. Also, when you are hiding leading stars to get a clean
723outline view, plain list items starting with a star are visually 664outline view, plain list items starting with a star are visually
724indistinguishable from true headlines. In short: Even though @samp{*} 665indistinguishable from true headlines. In short: even though @samp{*}
725is supported, it may be better to not use it for plain list items} as 666is supported, it may be better to not use it for plain list items} as
726bullets. Ordered list items start with @samp{1.} or @samp{1)}. Items 667bullets. Ordered list items start with @samp{1.} or @samp{1)}. Items
727belonging to the same list must have the same indentation on the first 668belonging to the same list must have the same indentation on the first
728line. In particular, if an ordered list reaches number @samp{10.}, also 669line. In particular, if an ordered list reaches number @samp{10.}, then
729the 2--digit numbers must be written left-aligned with the other numbers 670the 2--digit numbers must be written left-aligned with the other numbers
730in the list. Indentation also determines the end of a list item. It 671in the list. Indentation also determines the end of a list item. It
731ends before the next line that is indented like the bullet/number, or 672ends before the next line that is indented like the bullet/number, or
@@ -792,12 +733,13 @@ Emacs @file{calc} package.
792 733
793@menu 734@menu
794* Built-in table editor:: Simple tables 735* Built-in table editor:: Simple tables
736* Narrow columns:: Stop wasting space in tables
795* Table calculations:: Compute a field from other fields 737* Table calculations:: Compute a field from other fields
796* orgtbl-mode:: The table editor as minor mode 738* orgtbl-mode:: The table editor as minor mode
797* table.el:: Complex tables 739* table.el:: Complex tables
798@end menu 740@end menu
799 741
800@node Built-in table editor, Table calculations, Tables, Tables 742@node Built-in table editor, Narrow columns, Tables, Tables
801@section The built-in table editor 743@section The built-in table editor
802@cindex table editor, builtin 744@cindex table editor, builtin
803 745
@@ -826,6 +768,7 @@ create the above table, you would only type
826|Name|Phone|Age 768|Name|Phone|Age
827|- 769|-
828@end example 770@end example
771
829@noindent and then press @key{TAB} to align the table and start filling in 772@noindent and then press @key{TAB} to align the table and start filling in
830fields. 773fields.
831 774
@@ -840,18 +783,16 @@ unpredictable for you, configure the variables
840 783
841@table @kbd 784@table @kbd
842@tsubheading{Creation and conversion} 785@tsubheading{Creation and conversion}
843@item M-x org-table-create 786@kindex C-c |
844Creates an empty Org-mode table. However, it is much easier to just 787@item C-c |
845start typing, like @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}} 788Convert the active region to table. If every line contains at least one
846 789TAB character, the function assumes that the material is tab separated.
847@kindex C-c C-c 790If not, lines are split at whitespace into fields. You can use a prefix
848@item C-c C-c 791argument to indicate the minimum number of consecutive spaces required
849Convert region to table. Works when the cursor is not in an existing 792to identify a field separator (default: just one).@*
850table, and when there is a region defined. If every line contains at 793If there is no active region, this command creates an empty Org-mode
851least one TAB character, the function assumes that the material is tab 794table. However, it's easier to just start typing, like
852separated. If not, lines are split at whitespace into fields. You 795@kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
853can use a prefix argument to indicate how many consecutive spaces are
854at least required to indicate a field separator (default: just one).
855 796
856@tsubheading{Re-aligning and field motion} 797@tsubheading{Re-aligning and field motion}
857@kindex C-c C-c 798@kindex C-c C-c
@@ -878,7 +819,7 @@ NEWLINE, so it can be used to split a table.
878@kindex M-@key{right} 819@kindex M-@key{right}
879@item M-@key{left} 820@item M-@key{left}
880@itemx M-@key{right} 821@itemx M-@key{right}
881Move the current column left/right 822Move the current column left/right.
882 823
883@kindex M-S-@key{left} 824@kindex M-S-@key{left}
884@item M-S-@key{left} 825@item M-S-@key{left}
@@ -892,7 +833,7 @@ Insert a new column to the left of the cursor position.
892@kindex M-@key{down} 833@kindex M-@key{down}
893@item M-@key{up} 834@item M-@key{up}
894@itemx M-@key{down} 835@itemx M-@key{down}
895Move the current row up/down 836Move the current row up/down.
896 837
897@kindex M-S-@key{up} 838@kindex M-S-@key{up}
898@item M-S-@key{up} 839@item M-S-@key{up}
@@ -940,7 +881,7 @@ prefix ARG may be used to change the number of desired lines. If there
940is no region, the current field is split at the cursor position and the 881is no region, the current field is split at the cursor position and the
941text fragment to the right of the cursor is prepended to the field one 882text fragment to the right of the cursor is prepended to the field one
942line down. If there is no region, but you specify a prefix ARG, the 883line down. If there is no region, but you specify a prefix ARG, the
943current field gets blank, and the content is appended to the field 884current field is made blank, and the content is appended to the field
944above. 885above.
945 886
946@tsubheading{Calculations} 887@tsubheading{Calculations}
@@ -1000,36 +941,87 @@ incremented during copy. This key is also used by CUA-mode
1000(@pxref{Interaction}). 941(@pxref{Interaction}).
1001 942
1002@tsubheading{Miscellaneous} 943@tsubheading{Miscellaneous}
1003@kindex C-c | 944@kindex C-c `
1004@item C-c | 945@item C-c `
1005Toggle the visibility of vertical lines in tables. The lines are 946Edit the current field in a separate window. This is useful for fields
1006still there, only made invisible with a text property. Any @samp{|} 947that are not fully visible (@pxref{Narrow columns}). When called with a
1007added by hand will become invisible on the next align. 948@kbd{C-u} prefix, just make the full field visible, so that it can be
949edited in place.
950
951@kindex C-c @key{TAB}
952@item C-c @key{TAB}
953This is an alias for @kbd{C-u C-c `} to make the current field fully
954visible.
1008 955
1009@item M-x org-table-import 956@item M-x org-table-import
1010Import a file as a table. The table should be TAB- or whitespace 957Import a file as a table. The table should be TAB- or whitespace
1011separated. Useful for example to import an Excel table or data from a 958separated. Useful, for example, to import an Excel table or data from a
1012database, because these programs generally can write TAB-separated text 959database, because these programs generally can write TAB-separated text
1013files. This command works by inserting the file into the buffer and 960files. This command works by inserting the file into the buffer and
1014then converting the region to a table. Any prefix argument is passed on 961then converting the region to a table. Any prefix argument is passed on
1015to the converter, which uses it to determine the separator. 962to the converter, which uses it to determine the separator.
1016 963
1017@item M-x org-table-export 964@item M-x org-table-export
1018Export the table as a TAB-separated file. Useful for data exchange with 965Export the table as a TAB-separated file. Useful for data exchange with,
1019for example Excel or database programs. 966for example, Excel or database programs.
1020 967
1021@end table 968@end table
1022 969
1023If you don't like the automatic table editor because it gets into your 970If you don't like the automatic table editor because it gets in your
1024way in lines which you would like to start with @samp{|}, you can turn 971way on lines which you would like to start with @samp{|}, you can turn
1025it off with 972it off with
973
1026@lisp 974@lisp
1027(setq org-enable-table-editor nil) 975(setq org-enable-table-editor nil)
1028@end lisp 976@end lisp
977
1029@noindent The only table command which then still works is 978@noindent The only table command which then still works is
1030@kbd{C-c C-c} to do a manual re-align. 979@kbd{C-c C-c} to do a manual re-align.
1031 980
1032@node Table calculations, orgtbl-mode, Built-in table editor, Tables 981@node Narrow columns, Table calculations, Built-in table editor, Tables
982@section Narrow columns
983@cindex narrow columns in tables
984
985The width of columns is automatically determined by the table editor.
986Sometimes a single field or a few fields need to carry more text,
987leading to inconveniently wide columns. To limit@footnote{This feature
988does not work on XEmacs.} the width of a column, one field anywhere in
989the column must carry the string @samp{<N>} where @samp{N} is an integer
990specifying the width of the column in characters. The next re-align
991will then set the width of this column to no more than this value.
992
993@example
994|---+------------------------------| |---+--------|
995| | | | | <6> |
996| 1 | one | | 1 | one |
997| 2 | two | ----\ | 2 | two |
998| 3 | This is a long chunk of text | ----/ | 3 | This=> |
999| 4 | four | | 4 | four |
1000|---+------------------------------| |---+--------|
1001@end example
1002
1003@noindent
1004Fields that are wider become clipped and end in the string @samp{=>}.
1005Note that the full text is still in the buffer, it is only invisible.
1006To see the full text, hold the mouse over the field - a tooltip window
1007will show the full content. To edit such a field, use the command
1008@kbd{C-c `} (that is @kbd{C-c} followed by the backquote). This will
1009open a new window with the full field. Edit it and finish with @kbd{C-c
1010C-c}.
1011
1012When visiting a file containing a table with narrowed columns, the
1013necessary character hiding has not yet happened, and the table needs to
1014be aligned before it looks nice. Setting the option
1015@code{org-startup-align-all-tables} will realign all tables in a file
1016upon visiting, but also slow down startup. You can also set this option
1017on a per-file basis with:
1018
1019@example
1020#+STARTUP: align
1021#+STARTUP: noalign
1022@end example
1023
1024@node Table calculations, orgtbl-mode, Narrow columns, Tables
1033@section Calculations in tables 1025@section Calculations in tables
1034@cindex calculations, in tables 1026@cindex calculations, in tables
1035@cindex spreadsheet capabilities 1027@cindex spreadsheet capabilities
@@ -1062,7 +1054,7 @@ recalculation can be automated.
1062 1054
1063A formula can be any algebraic expression understood by the Emacs 1055A formula can be any algebraic expression understood by the Emacs
1064@file{calc} package. Note that @file{calc} has the slightly 1056@file{calc} package. Note that @file{calc} has the slightly
1065non-standard conversion that @samp{/} has lower precedence than 1057non-standard convention that @samp{/} has lower precedence than
1066@samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}. Before 1058@samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}. Before
1067evaluation by @code{calc-eval} (@pxref{Calling Calc from Your Lisp 1059evaluation by @code{calc-eval} (@pxref{Calling Calc from Your Lisp
1068Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU Emacs 1060Programs,calc-eval,Calling calc from Your Lisp Programs,calc,GNU Emacs
@@ -1091,7 +1083,7 @@ constant. Constants are defined globally through the variable
1091@code{org-table-formula-constants}. If you have the 1083@code{org-table-formula-constants}. If you have the
1092@file{constants.el} package, it will also be used to resolve 1084@file{constants.el} package, it will also be used to resolve
1093constants, including natural constants like @samp{$h} for Planck's 1085constants, including natural constants like @samp{$h} for Planck's
1094constant, units like @samp{$km} for kilometers. Column names and 1086constant, and units like @samp{$km} for kilometers. Column names and
1095parameters can be specified in special table lines. These are 1087parameters can be specified in special table lines. These are
1096described below, see @ref{Advanced features}. 1088described below, see @ref{Advanced features}.
1097 1089
@@ -1106,10 +1098,11 @@ The default settings can be configured using the variable
1106@code{org-calc-default-modes}.} during execution, e.g. @samp{p20} to 1098@code{org-calc-default-modes}.} during execution, e.g. @samp{p20} to
1107switch the internal precision to 20 digits, @samp{n3}, @samp{s3}, 1099switch the internal precision to 20 digits, @samp{n3}, @samp{s3},
1108@samp{e2} or @samp{f4} to switch to normal, scientific, engineering, 1100@samp{e2} or @samp{f4} to switch to normal, scientific, engineering,
1109or fix display format, respectively, and @samp{D}, @samp{R}, @samp{F}, 1101or fixed display format, respectively, and @samp{D}, @samp{R}, @samp{F},
1110and @samp{S} to turn on degrees, radians, fraction and symbolic modes, 1102and @samp{S} to turn on degrees, radians, fraction and symbolic modes,
1111respectively. In addition, you may provide a @code{printf} format 1103respectively. In addition, you may provide a @code{printf} format
1112specifier to reformat the final result. A few examples: 1104specifier to reformat the final result. A few examples:
1105
1113@example 1106@example
1114 $1+$2 @r{Sum of first and second field} 1107 $1+$2 @r{Sum of first and second field}
1115 $1+$2;%.2f @r{Same, format result to two decimals} 1108 $1+$2;%.2f @r{Same, format result to two decimals}
@@ -1120,7 +1113,7 @@ specifier to reformat the final result. A few examples:
1120 tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1} 1113 tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
1121 sin($1);Dp3%.1e @r{Same, but use printf specifier for display} 1114 sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
1122 vmean($2..$7) @r{Compute column range mean, using vector function} 1115 vmean($2..$7) @r{Compute column range mean, using vector function}
1123 vsum(&III) @r{Sum numbers from 3rd hline above to here} 1116 vsum(&III) @r{Sum numbers from 3rd hline above, up to here}
1124 taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree} 1117 taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree}
1125@end example 1118@end example
1126 1119
@@ -1164,12 +1157,13 @@ header.
1164@node Advanced features, Named-field formulas, Column formulas, Table calculations 1157@node Advanced features, Named-field formulas, Column formulas, Table calculations
1165@subsection Advanced features 1158@subsection Advanced features
1166 1159
1167If you want want the recalculation of fields to happen automatically, 1160If you want the recalculation of fields to happen automatically,
1168or if you want to be able to assign a formula to an individual field 1161or if you want to be able to assign a formula to an individual field
1169(instead of an entire column) you need to reserve the first column of 1162(instead of an entire column) you need to reserve the first column of
1170the table for special marking characters. Here is an example of a 1163the table for special marking characters. Here is an example of a
1171table that collects exam results of students and makes use of these 1164table that collects exam results of students and makes use of these
1172features: 1165features:
1166
1173@example 1167@example
1174@group 1168@group
1175|---+---------+--------+--------+--------+-------+------| 1169|---+---------+--------+--------+--------+-------+------|
@@ -1192,7 +1186,7 @@ features:
1192@end example 1186@end example
1193 1187
1194@noindent @b{Important}: Please note that for these special tables, 1188@noindent @b{Important}: Please note that for these special tables,
1195recalculating the table with @kbd{C-u C-c *} does only affect rows 1189recalculating the table with @kbd{C-u C-c *} will only affect rows
1196which are marked @samp{#} or @samp{*}, and named fields. The column 1190which are marked @samp{#} or @samp{*}, and named fields. The column
1197formulas are not applied in rows with empty first field. 1191formulas are not applied in rows with empty first field.
1198 1192
@@ -1209,7 +1203,7 @@ the value @samp{10}. Also, named fields can have their own formula
1209associated with them. 1203associated with them.
1210@item _ 1204@item _
1211Similar to @samp{^}, but defines names for the fields in the row 1205Similar to @samp{^}, but defines names for the fields in the row
1212@emph{below}. 1206@emph{below}.
1213@item $ 1207@item $
1214Fields in this row can define @emph{parameters} for formulas. For 1208Fields in this row can define @emph{parameters} for formulas. For
1215example, if a field in a @samp{$} row contains @samp{max=50}, then 1209example, if a field in a @samp{$} row contains @samp{max=50}, then
@@ -1226,8 +1220,8 @@ lines will be left alone by this command.
1226Selects this line for global recalculation with @kbd{C-u C-c *}, but 1220Selects this line for global recalculation with @kbd{C-u C-c *}, but
1227not for automatic recalculation. Use this when automatic 1221not for automatic recalculation. Use this when automatic
1228recalculation slows down editing too much. 1222recalculation slows down editing too much.
1229@item 1223@item
1230Unmarked lines are exempted from recalculation with @kbd{C-u C-c *}. 1224Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
1231All lines that should be recalculated should be marked with @samp{#} 1225All lines that should be recalculated should be marked with @samp{#}
1232or @samp{*}. 1226or @samp{*}.
1233@end table 1227@end table
@@ -1240,7 +1234,7 @@ or @samp{*}.
1240A named field can have its own formula associated with it. In the 1234A named field can have its own formula associated with it. In the
1241example above, this is used for the @samp{at} field that contains 1235example above, this is used for the @samp{at} field that contains
1242the average result of the students. To enter a formula for a named 1236the average result of the students. To enter a formula for a named
1243field, just type it onto the buffer, preceded by @samp{:=}. Or use 1237field, just type it into the buffer, preceded by @samp{:=}. Or use
1244@kbd{C-u C-c =}. This equation will be stored below the table like 1238@kbd{C-u C-c =}. This equation will be stored below the table like
1245@samp{$name=...}. Any recalculation in the table (even if only 1239@samp{$name=...}. Any recalculation in the table (even if only
1246requested for the current line) will also update all named field 1240requested for the current line) will also update all named field
@@ -1251,9 +1245,9 @@ formulas.
1251@cindex formula editing 1245@cindex formula editing
1252@cindex editing, of table formulas 1246@cindex editing, of table formulas
1253 1247
1254To edit a column or field formula, you can use the commands @kbd{C-c 1248To edit a column or field formula, use the commands @kbd{C-c
1255=} and @kbd{C-u C-c =}, respectively. The currently active expression 1249=} and @kbd{C-u C-c =}, respectively. The currently active expression
1256is then presented as default in the minibuffer, were it may be edited. 1250is then presented as default in the minibuffer, where it may be edited.
1257 1251
1258Note that making a table field blank does not remove the formula 1252Note that making a table field blank does not remove the formula
1259associated with the field - during the next recalculation the field 1253associated with the field - during the next recalculation the field
@@ -1264,7 +1258,7 @@ give an empty reply when prompted for the formula, or to edit the
1264@kindex C-c C-c 1258@kindex C-c C-c
1265You may edit the @samp{#+TBLFM} directly and re-apply 1259You may edit the @samp{#+TBLFM} directly and re-apply
1266the changed equations with @kbd{C-c C-c} in that line, or with the 1260the changed equations with @kbd{C-c C-c} in that line, or with the
1267normal recalculation commands in the table. 1261normal recalculation commands in the table.
1268 1262
1269@kindex C-c ' 1263@kindex C-c '
1270@kindex C-c C-c 1264@kindex C-c C-c
@@ -1283,8 +1277,8 @@ installing the changes.
1283When the evaluation of a formula leads to an error, the field content 1277When the evaluation of a formula leads to an error, the field content
1284becomes the string @samp{#ERROR}. If you would like see what is going 1278becomes the string @samp{#ERROR}. If you would like see what is going
1285on during variable substitution and calculation in order to find a 1279on during variable substitution and calculation in order to find a
1286bug, turn on formula debugging in the menu and repeat the calculation 1280bug, turn on formula debugging in the menu and repeat the calculation,
1287by pressing, for example by pressing @kbd{C-c = @key{RET}} in a field. 1281for example by pressing @kbd{C-c = @key{RET}} in a field.
1288Detailed information will be displayed. 1282Detailed information will be displayed.
1289 1283
1290@node Appetizer, , Editing/debugging formulas, Table calculations 1284@node Appetizer, , Editing/debugging formulas, Table calculations
@@ -1320,6 +1314,7 @@ might want to use it also in other modes like text-mode or mail-mode.
1320The minor mode Orgtbl-mode makes this possible. You can always toggle 1314The minor mode Orgtbl-mode makes this possible. You can always toggle
1321the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for 1315the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
1322example in mail mode, use 1316example in mail mode, use
1317
1323@lisp 1318@lisp
1324(add-hook 'mail-mode-hook 'turn-on-orgtbl) 1319(add-hook 'mail-mode-hook 'turn-on-orgtbl)
1325@end lisp 1320@end lisp
@@ -1362,46 +1357,81 @@ Just like HMTL, Org-mode provides links inside a file, and external
1362links to other files, Usenet articles, emails and much more. 1357links to other files, Usenet articles, emails and much more.
1363 1358
1364@menu 1359@menu
1365* Internal Links:: Links to other places in the current file 1360* Link format:: How links in Org-mode are formatted
1366* External Links:: URL-like links to the world 1361* Internal links:: Links to other places in the current file
1362* External links:: URL-like links to the world
1367* Managing links:: Creating, inserting and following 1363* Managing links:: Creating, inserting and following
1368* Search Options:: Linking to a specific location 1364* Search Options:: Linking to a specific location
1369* Remember:: Org-trees store quick notes 1365* Remember:: Org-trees store quick notes
1370@end menu 1366@end menu
1371 1367
1372@node Internal Links, External Links, Hyperlinks, Hyperlinks 1368@node Link format, Internal links, Hyperlinks, Hyperlinks
1373@section Internal Links 1369@section Link format
1370@cindex link format
1371@cindex format, of links
1372
1373Org-mode will recognize plain URL-like links and activate them as
1374clickable links. However, the general link format looks like this:
1375
1376@example
1377[[link][description]] @r{or alternatively} [[link]]
1378@end example
1379
1380Once a link in the buffer is complete (all brackets present), Org-mode
1381will change the display so that @samp{description} is displayed instead
1382of @samp{[[link][description]]} and @samp{link} is displayed instead of
1383@samp{[[link]]}. Links will be highlighted in the face @code{org-link},
1384which by default is an underlined face. You can directly edit the
1385visible part of a link. Note that this can be either the @samp{link}
1386part (if there is not description) or the @samp{description} part. To
1387edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
1388cursor on the link.
1389
1390If you place the cursor at the beginning or just behind the end of the
1391displayed text and press @key{BACKSPACE}, you will remove the
1392(invisible) bracket at that location. This makes the link incomplete
1393and the internals are again displayed as plain text. Inserting the
1394missing bracket does hide the link internals again. To show the
1395internal structure of all links, use the menu entry
1396@code{Org->Hyperlinks->Literal links}.
1397
1398@node Internal links, External links, Link format, Hyperlinks
1399@section Internal links
1374@cindex internal links 1400@cindex internal links
1375@cindex links, internal 1401@cindex links, internal
1376@cindex CamelCase links 1402@cindex CamelCase links
1377 1403
1378Strings inside double brackets like @samp{[[My Target]]} are links 1404If the link text does not look like a URL, links are considered to be
1379that lead to a text search in the current file. The link can be 1405internal in the current file. Links such as @samp{[[My Target]]} or
1380followed with @kbd{C-c C-o} or with a mouse click (@pxref{Managing 1406@samp{[[My Target][Find my target]]} lead to a text search in the
1381links}). The preferred match for such a link is a dedicated target: 1407current file. The link can be followed with @kbd{C-c C-o} when the
1382The same string in double angular brackets. Targets may be located 1408cursor is on the link, or with a mouse click (@pxref{Managing links}).
1383anywhere, often it is convenient to put them into a comment line, for 1409The preferred match for such a link is a dedicated target: The same
1384example 1410string in double angular brackets. Targets may be located anywhere,
1411often it is convenient to put them into a comment line, for example
1412
1385@example 1413@example
1386# <<My Target>> 1414# <<My Target>>
1387@end example 1415@end example
1388 1416
1389If no dedicated target exists, Org-mode will search for the words in 1417If no dedicated target exists, Org-mode will search for the words in the
1390the link, in the above example for @samp{my target}. Links starting 1418link, often removing the need for a dedicated target. In the above
1391with a star like @samp{*My Target} restrict the search to headlines. 1419example the search would be for @samp{my target}. Links starting with a
1392When searching, Org-mode will first try an exact match, but then move 1420star like @samp{*My Target} restrict the search to headlines. When
1393on to more and more lenient searches. For example, the link 1421searching, Org-mode will first try an exact match, but then move on to
1394@samp{[[*My Targets]]} will find any of the following 1422more and more lenient searches. For example, the link @samp{[[*My
1423Targets]]} will find any of the following:
1424
1395@example 1425@example
1396** My targets 1426** My targets
1397** TODO my targets are bright 1427** TODO my targets are bright
1398** my 20 targets are 1428** my 20 targets are
1399@end example 1429@end example
1400It is therefore often not necessary to set a dedicated target. To 1430
1401insert a link targeting a headline, in-buffer completion can be used. 1431To insert a link targeting a headline, in-buffer completion can be used.
1402Just type a star followed by a few optional letters into the buffer 1432Just type a star followed by a few optional letters into the buffer and
1403and press @kbd{M-@key{TAB}}. All headlines in the current buffer will 1433press @kbd{M-@key{TAB}}. All headlines in the current buffer will be
1404be offered as completions. @xref{Managing links}, for more commands 1434offered as completions. @xref{Managing links}, for more commands
1405creating links. 1435creating links.
1406 1436
1407Following a link pushes a mark onto Org-mode's own mark ring. You can 1437Following a link pushes a mark onto Org-mode's own mark ring. You can
@@ -1414,7 +1444,7 @@ earlier.
1414* CamelCase links:: Activating CamelCase words as links 1444* CamelCase links:: Activating CamelCase words as links
1415@end menu 1445@end menu
1416 1446
1417@node Radio targets, CamelCase links, Internal Links, Internal Links 1447@node Radio targets, CamelCase links, Internal links, Internal links
1418@subsection Radio targets 1448@subsection Radio targets
1419 1449
1420You can configure Org-mode to link any occurrences of certain target 1450You can configure Org-mode to link any occurrences of certain target
@@ -1427,24 +1457,20 @@ scanned automatically for radio targets only when the file is first
1427loaded into Emacs. To update the target list during editing, press 1457loaded into Emacs. To update the target list during editing, press
1428@kbd{C-c C-c} with the cursor on or at a target. 1458@kbd{C-c C-c} with the cursor on or at a target.
1429 1459
1430@node CamelCase links, , Radio targets, Internal Links 1460@node CamelCase links, , Radio targets, Internal links
1431@subsection CamelCase words as links 1461@subsection CamelCase words as links
1432@cindex completion, of CamelCase links 1462@cindex completion, of CamelCase links
1433@cindex CamelCase links, completion of 1463@cindex CamelCase links, completion of
1434 1464
1435As an alternative to @samp{[[...]]} links, Org-mode also supports 1465Org-mode also supports CamelCase words as links. This feature is not
1436CamelCase words as links. This feature is not turned on by default 1466turned on by default because of the inconsistencies this system suffers
1437because of the occasional inconsistencies this system suffers from. 1467from. To activate CamelCase words as links, you need to customize
1438To activate CamelCase words as links, and to make headline completion 1468the option @code{org-activate-links}. A CamelCase word then leads to a
1439offer CamelCase version of headlines, the following customization is 1469text search such that @samp{CamelCaseLink} is equivalent to
1440needed: 1470@samp{[[camel case link]]}.
1441@lisp
1442(setq org-activate-camels t
1443 org-file-link-context-use-camel-case t)
1444@end lisp
1445 1471
1446@node External Links, Managing links, Internal Links, Hyperlinks 1472@node External links, Managing links, Internal links, Hyperlinks
1447@section External Links 1473@section External links
1448@cindex links, external 1474@cindex links, external
1449@cindex external links 1475@cindex external links
1450@cindex links, external 1476@cindex links, external
@@ -1460,39 +1486,46 @@ needed:
1460@cindex SHELL links 1486@cindex SHELL links
1461 1487
1462Org-mode supports links to files, websites, Usenet and email messages; 1488Org-mode supports links to files, websites, Usenet and email messages;
1463and BBDB database entries. Links are just plain-text URL-like 1489and BBDB database entries. External links are URL-like locators. The
1464locators, optionally enclosed by angular brackets. The following list 1490following list shows examples for each link type.
1465shows examples for each link type.
1466 1491
1467@example 1492@example
1468<http://www.astro.uva.nl/~dominik> @r{on the web} 1493http://www.astro.uva.nl/~dominik @r{on the web}
1469<file:/home/dominik/images/jupiter.jpg> @r{file, absolute path} 1494file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
1470<file:papers/last.pdf> @r{file, relative path} 1495file:papers/last.pdf @r{file, relative path}
1471<news:comp.emacs> @r{Usenet link} 1496news:comp.emacs @r{Usenet link}
1472<mailto:adent@@galaxy.net> @r{Mail link} 1497mailto:adent@@galaxy.net @r{Mail link}
1473<vm:folder> @r{VM folder link} 1498vm:folder @r{VM folder link}
1474<vm:folder#id> @r{VM message link} 1499vm:folder#id @r{VM message link}
1475<vm://myself@@some.where.org/folder#id> @r{VM on remote machine} 1500vm://myself@@some.where.org/folder#id @r{VM on remote machine}
1476<wl:folder> @r{WANDERLUST folder link} 1501wl:folder @r{WANDERLUST folder link}
1477<wl:folder#id> @r{WANDERLUST message link} 1502wl:folder#id @r{WANDERLUST message link}
1478<mhe:folder> @r{MH-E folder link} 1503mhe:folder @r{MH-E folder link}
1479<mhe:folder#id> @r{MH-E message link} 1504mhe:folder#id @r{MH-E message link}
1480<rmail:folder> @r{RMAIL folder link} 1505rmail:folder @r{RMAIL folder link}
1481<rmail:folder#id> @r{RMAIL message link} 1506rmail:folder#id @r{RMAIL message link}
1482<gnus:group> @r{GNUS group link} 1507gnus:group @r{GNUS group link}
1483<gnus:group#id> @r{GNUS article link} 1508gnus:group#id @r{GNUS article link}
1484<bbdb:Richard Stallman> @r{BBDB link} 1509bbdb:Richard Stallman @r{BBDB link}
1485<shell:ls *.org>@footnote{Note that @samp{<} and @samp{>} cannot be part of a link, and therefore of a shell command. If you need redirection, use @@@{ and @@@} instead.} @r{A shell command} 1510shell:ls *.org @r{A shell command}
1486@end example 1511@end example
1487 1512
1488A link may contain space characters and is terminated by @samp{>} or by 1513A link should be enclosed in double brackets and may contain a
1489the end of a line. In tables, the end of a table field also terminates 1514descriptive text to be displayed instead of the url (@pxref{Link
1490a link. Angle brackets around a link are not required, but are 1515format}), for example:
1491recommended to avoid problems with punctuation and other text following 1516
1492the link. See also the variable @code{org-allow-space-in-links}. 1517@example
1518[[http://www.gnu.org/software/emacs/][GNU Emacs]]
1519@end example
1493 1520
1521@cindex angular brackets, around links
1522@cindex plain text external links
1523Org-mode also finds external links in the normal text and activates them
1524as links. If spaces must be part of the link (for example in
1525@samp{bbdb:Richard Stallman}) or to remove ambiguities about the end of
1526the link, enclose them in angular brackets.
1494 1527
1495@node Managing links, Search Options, External Links, Hyperlinks 1528@node Managing links, Search Options, External links, Hyperlinks
1496@section Managing links 1529@section Managing links
1497 1530
1498Org-mode provides methods to create a link in the correct syntax, to 1531Org-mode provides methods to create a link in the correct syntax, to
@@ -1504,53 +1537,63 @@ insert it into an org-mode file, and to follow the link.
1504@item C-c l 1537@item C-c l
1505Store a link to the current location. This is a @emph{global} command 1538Store a link to the current location. This is a @emph{global} command
1506which can be used in any buffer to create a link. The link will be 1539which can be used in any buffer to create a link. The link will be
1507stored for later insertion into an Org-mode buffer (see below). For 1540stored for later insertion into an Org-mode buffer (see below). For VM,
1508VM, RMAIL, WANDERLUST, GNUS and BBDB buffers, the link will point to 1541RMAIL, WANDERLUST, MH-E, GNUS and BBDB buffers, the link will point to
1509the current article/entry. For W3 and W3M buffer, the link goes to 1542the current article/entry. For W3 and W3M buffers, the link goes to the
1510the current URL. For Org-mode files, the current headline is 1543current URL. For Org-mode files, the current headline is targeted. For
1511targeted. For any other files, the link will point to the file, with 1544any other files, the link will point to the file, with a search string
1512a search string (@pxref{Search Options}) pointing to the 1545(@pxref{Search Options}) pointing to the contents of the current line.
1513contents of the current line. If there is an active region, the 1546If there is an active region, the selected words will form the basis of
1514selected words will form the basis of the search string. The key 1547the search string. The key binding @kbd{C-c l} is only a suggestion -
1515binding @kbd{C-c l} is only a suggestion - see @ref{Installation and 1548see @ref{Installation and activation}.
1516Activation}.
1517 1549
1518@kindex C-c C-l 1550@kindex C-c C-l
1519@cindex link completion 1551@cindex link completion
1520@cindex file name completion
1521@cindex completion, of links 1552@cindex completion, of links
1522@cindex completion, of file names
1523@cindex inserting links 1553@cindex inserting links
1524@item C-c C-l 1554@item C-c C-l
1525Insert a link. This prompts for a link to be inserted into the 1555Insert a link. This prompts for a link to be inserted into the buffer.
1526buffer. You can just type a link, using one of the link type prefixes 1556You can just type a link, using text for an internal link, or one of the
1527mentioned in the examples above. Through completion, all links stored 1557link type prefixes mentioned in the examples above. Through completion,
1528during the current session can be accessed. When called with prefix 1558all links stored during the current session can be accessed. The link
1529arg, you can use file name completion to enter a file link. The link
1530will be formatted as given in the variable @code{org-link-format} and 1559will be formatted as given in the variable @code{org-link-format} and
1531inserted into the buffer. Note that you don't have to use this 1560inserted into the buffer, along with a descriptive text. Note that you
1532command to insert a link. Links in Org-mode are plain text, and you 1561don't have to use this command to insert a link. Links in Org-mode are
1533can type or paste them straight into the buffer. 1562plain text, and you can type or paste them straight into the buffer.
1563By using this command, the links are automatically enclosed in double
1564brackets, and you will be asked for the optional descriptive text.
1565
1566@kindex C-u C-c C-l
1567@cindex file name completion
1568@cindex completion, of file names
1569@item C-u C-c C-l
1570When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
1571a file will be inserted and you may use file name completion to select
1572the name of the file. The path to the file is inserted relative to the
1573directory of the current org file, if the linked file is in the current
1574directory or in a subdirectory of it. Otherwise an absolute path, if
1575possible with @samp{~/} for your home directory is used. You can force
1576an absolute path with two @kbd{C-u} prefixes.
1577
1578@item C-c C-l @r{with cursor on existing link}
1579When the cursor is on an existing link, @kbd{C-c C-l} allows to edit the
1580link and description parts of the link.
1534 1581
1535@cindex following links 1582@cindex following links
1536@kindex C-c C-o 1583@kindex C-c C-o
1537@item C-c C-o 1584@item C-c C-o
1538Open link at point. This will launch a web browser for URLs (using 1585Open link at point. This will launch a web browser for URLs (using
1539@command{browse-url-at-point}), run vm/gnus/bbdb for the corresponding 1586@command{browse-url-at-point}), run vm/mh-e/wanderlust/rmail/gnus/bbdb
1540links, and execute the command in a shell link. When the cursor is on 1587for the corresponding links, and execute the command in a shell link.
1541a CamelCase link, this commands runs the corresponding search. When 1588When the cursor is on an internal link, this commands runs the
1542the cursor is on a TAGS list in a headline, it creates the 1589corresponding search. When the cursor is on a TAGS list in a headline,
1543corresponding TAGS view. Furthermore, it will visit text files in 1590it creates the corresponding TAGS view. If the cursor is on a time
1544@samp{file:} links with Emacs and select a suitable application for 1591stamp, it compiles the agenda for that date. Furthermore, it will visit
1545non-text files. Classification of files is based on file extension 1592text files in @samp{file:} links with Emacs and select a suitable
1546only. See option @code{org-file-apps}. If there is no link at point, 1593application for non-text files. Classification of files is based on
1547the current subtree will be searched for one. If you want to override 1594file extension only. See option @code{org-file-apps}. If you want to
1548the default application and visit the file with Emacs, use a @kbd{C-u} 1595override the default application and visit the file with Emacs, use a
1549prefix. If the cursor is on a time stamp, compiles the agenda for 1596@kbd{C-u} prefix.
1550that date.
1551
1552@strong{IMPORTANT}: Be careful not to use any dangerous commands in a
1553shell link.
1554 1597
1555@kindex mouse-2 1598@kindex mouse-2
1556@kindex mouse-1 1599@kindex mouse-1
@@ -1589,12 +1632,14 @@ particular location in the file when following a link. This can be a
1589line number or a search option after a double@footnote{For backward 1632line number or a search option after a double@footnote{For backward
1590compatibility, line numbers can also follow a single colon.} colon. 1633compatibility, line numbers can also follow a single colon.} colon.
1591For example: 1634For example:
1635
1592@example 1636@example
1593<file:~/code/main.c::255> 1637[[file:~/code/main.c::255]]
1594<file:~/xx.org::My Target> 1638[[file:~/xx.org::My Target]]
1595<file:~/xx.org::*My Target> 1639[[file:~/xx.org::*My Target]]
1596<file:~/xx.org::/regexp/> 1640[[file:~/xx.org::/regexp/]]
1597@end example 1641@end example
1642
1598@noindent Here is what these options do. 1643@noindent Here is what these options do.
1599 1644
1600@table @code 1645@table @code
@@ -1603,7 +1648,7 @@ Jump to line 255.
1603@item My Target 1648@item My Target
1604Search for a link target @samp{<<My Target>>}, or do a text search for 1649Search for a link target @samp{<<My Target>>}, or do a text search for
1605@samp{my target}, similar to the search in internal links, see 1650@samp{my target}, similar to the search in internal links, see
1606@ref{Internal Links}. 1651@ref{Internal links}.
1607@item *My Target 1652@item *My Target
1608In an Org-mode file, restrict search to headlines. 1653In an Org-mode file, restrict search to headlines.
1609@item /regexp/ 1654@item /regexp/
@@ -1632,29 +1677,65 @@ information. The notes produced by @emph{Remember} can be stored in
1632different ways, and Org-mode files are a good target. Org-mode allows 1677different ways, and Org-mode files are a good target. Org-mode allows
1633to file away notes either to a default file, or directly to the 1678to file away notes either to a default file, or directly to the
1634correct location in your Org-mode outline tree. The following 1679correct location in your Org-mode outline tree. The following
1635customization@footnote{The two autoload forms are only necessary if 1680customization@footnote{The three autoload forms are only necessary if
1636@file{org.el} is not part of the Emacs distribution or an XEmacs 1681@file{org.el} is not part of the Emacs distribution or an XEmacs
1637package.} will tell @emph{Remember} to use org files as target, and to 1682package.} will tell @emph{Remember} to use org files as target, and to
1638create annotations compatible with Org-mode links. 1683create annotations compatible with Org-mode links.
1639 1684
1640@example 1685@example
1641(autoload 'org-remember-annotation "org")
1642(autoload 'org-remember-handler "org")
1643(setq org-directory "~/path/to/my/orgfiles/") 1686(setq org-directory "~/path/to/my/orgfiles/")
1644(setq org-default-notes-file "~/.notes") 1687(setq org-default-notes-file "~/.notes")
1688(autoload 'org-remember-annotation "org")
1689(autoload 'org-remember-apply-template "org")
1690(autoload 'org-remember-handler "org")
1645(setq remember-annotation-functions '(org-remember-annotation)) 1691(setq remember-annotation-functions '(org-remember-annotation))
1646(setq remember-handler-functions '(org-remember-handler)) 1692(setq remember-handler-functions '(org-remember-handler))
1693(add-hook 'remember-mode-hook 'org-remember-apply-template)
1694@end example
1695
1696@cindex templates, for remember
1697In combination with Org-mode, you can use templates to generate
1698different types of remember notes. For example, if you would like to
1699use one template to create general TODO entries, and another one for
1700journal entries, you could use:
1701
1702@example
1703(setq org-remember-templates
1704 '((?t "* TODO %?\n %i\n %a" "~/org/TODO.org")
1705 (?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")))
1706@end example
1707
1708@noindent In these entries, the character specifies how to select the
1709template, the first string specifies the template, and the (optional)
1710second string specifies a default file (overruling
1711@code{org-default-notes-file}) as a target for this note.
1712
1713When you call @kbd{M-x remember} to remember something, org will prompt
1714for a key to select the template and then prepare the buffer like
1715@example
1716* TODO
1717 <file:link to where you called remember>
1647@end example 1718@end example
1648 1719
1649When you compose a note with remember, you have to press @kbd{C-c C-c} 1720@noindent or
1650to exit remember-mode and to file away the note. The handler first 1721
1651prompts for a target file - if you press @key{RET}, the value of 1722@example
1723* [2006-03-21 Tue 15:37]
1724
1725 <file:link to where you called remember>
1726@end example
1727
1728@noindent See the variable @code{org-remember-templates} for more details.
1729
1730When you are finished composing a note with remember, you have to press
1731@kbd{C-c C-c} to file the note away. The handler first prompts for a
1732target file - if you press @key{RET}, the value of
1652@code{org-default-notes-file} is used. Then the command offers the 1733@code{org-default-notes-file} is used. Then the command offers the
1653headings tree of the selected file. You can either immediately press 1734headings tree of the selected file. You can either immediately press
1654@key{RET} to get the note appended to the file. Or you can use 1735@key{RET} to get the note appended to the file. Or you can use vertical
1655vertical cursor motion (@key{up} and @key{down}) and visibility 1736cursor motion (@key{up} and @key{down}) and visibility cycling
1656cycling (@key{TAB}) to find a better place. Pressing @key{RET} or 1737(@key{TAB}) to find a better place. Pressing @key{RET} or @key{left} or
1657@key{left} or @key{right} leads to the following result. 1738@key{right} leads to the following result.
1658 1739
1659@multitable @columnfractions 0.2 0.1 0.7 1740@multitable @columnfractions 0.2 0.1 0.7
1660@item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted} 1741@item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
@@ -1680,6 +1761,7 @@ additional data. If the variable @code{org-adapt-indentation} is
1680non-nil, the entire text is also indented so that it starts in the 1761non-nil, the entire text is also indented so that it starts in the
1681same column as the headline (after the asterisks). 1762same column as the headline (after the asterisks).
1682 1763
1764
1683@node TODO items, Timestamps, Hyperlinks, Top 1765@node TODO items, Timestamps, Hyperlinks, Top
1684@chapter TODO items 1766@chapter TODO items
1685@cindex TODO items 1767@cindex TODO items
@@ -1697,16 +1779,16 @@ things you have to do.
1697 1779
1698@menu 1780@menu
1699* TODO basics:: Marking and displaying TODO entries 1781* TODO basics:: Marking and displaying TODO entries
1700* Progress Logging:: Document your productivity 1782* Progress logging:: Document your productivity
1701* TODO extensions:: Workflow and assignments 1783* TODO extensions:: Workflow and assignments
1702* Priorities:: Some things are more important than others 1784* Priorities:: Some things are more important than others
1703@end menu 1785@end menu
1704 1786
1705@node TODO basics, Progress Logging, TODO items, TODO items 1787@node TODO basics, Progress logging, TODO items, TODO items
1706@section Basic TODO functionality 1788@section Basic TODO functionality
1707 1789
1708Any headline can become a TODO item by starting it with the word TODO, 1790Any headline can become a TODO item by starting it with the word TODO,
1709for example 1791for example:
1710 1792
1711@example 1793@example
1712*** TODO Write letter to Sam Fortune 1794*** TODO Write letter to Sam Fortune
@@ -1720,10 +1802,12 @@ The most important commands to work with TODO entries are:
1720@cindex cycling, of TODO states 1802@cindex cycling, of TODO states
1721@item C-c C-t 1803@item C-c C-t
1722Rotate the TODO state of the current item between 1804Rotate the TODO state of the current item between
1805
1723@example 1806@example
1724,-> (unmarked) -> TODO -> DONE --. 1807,-> (unmarked) -> TODO -> DONE --.
1725'--------------------------------' 1808'--------------------------------'
1726@end example 1809@end example
1810
1727The same rotation can also be done ``remotely'' from the timeline and 1811The same rotation can also be done ``remotely'' from the timeline and
1728agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}). 1812agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
1729@kindex C-c C-v 1813@kindex C-c C-v
@@ -1746,15 +1830,17 @@ If you would like to have all your TODO items listed as part of your
1746agenda, customize the variable @code{org-agenda-include-all-todo}. 1830agenda, customize the variable @code{org-agenda-include-all-todo}.
1747@end table 1831@end table
1748 1832
1749@node Progress Logging, TODO extensions, TODO basics, TODO items 1833@node Progress logging, TODO extensions, TODO basics, TODO items
1750@section Progress Logging 1834@section Progress Logging
1751@cindex progress logging 1835@cindex progress logging
1752@cindex logging, of progress 1836@cindex logging, of progress
1753If you want to keep track of @emph{when} a certain TODO item was 1837If you want to keep track of @emph{when} a certain TODO item was
1754finished, turn on logging with 1838finished, turn on logging with
1839
1755@lisp 1840@lisp
1756(setq org-log-done t) 1841(setq org-log-done t)
1757@end lisp 1842@end lisp
1843
1758@noindent 1844@noindent
1759Then each time you turn a TODO entry into DONE using either @kbd{C-c 1845Then each time you turn a TODO entry into DONE using either @kbd{C-c
1760C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line 1846C-t} in the Org-mode buffer or @kbd{t} in the agenda buffer, a line
@@ -1765,16 +1851,18 @@ state cycling, that line will be removed again. In the timeline
1765you can then use the @kbd{L} key to display the TODO items closed on 1851you can then use the @kbd{L} key to display the TODO items closed on
1766each day, giving you an overview of what has been done on a day. 1852each day, giving you an overview of what has been done on a day.
1767 1853
1768@node TODO extensions, Priorities, Progress Logging, TODO items 1854@node TODO extensions, Priorities, Progress logging, TODO items
1769@section Extended use of TODO keywords 1855@section Extended use of TODO keywords
1770@cindex extended TODO keywords 1856@cindex extended TODO keywords
1771 1857
1772The default implementation of TODO entries is just two states: TODO 1858The default implementation of TODO entries is just two states: TODO and
1773and DONE. You can, however, use the TODO feature for more 1859DONE. You can, however, use the TODO feature for more complicated
1774complicated things by configuring the variables 1860things by configuring the variables @code{org-todo-keywords} and
1775@code{org-todo-keywords} and @code{org-todo-interpretation}. Using 1861@code{org-todo-interpretation}. Using special setup, you can even use
1776special setup, you can even use TODO keywords in different ways in 1862TODO keywords in different ways in different org files.
1777different org files. 1863
1864Note that @i{tags} are another way to classify headlines in general and
1865TODO items in particular (@pxref{Tags}).
1778 1866
1779@menu 1867@menu
1780* Workflow states:: From TODO to DONE in steps 1868* Workflow states:: From TODO to DONE in steps
@@ -1788,7 +1876,7 @@ different org files.
1788@cindex workflow states as TODO keywords 1876@cindex workflow states as TODO keywords
1789 1877
1790You can use TODO keywords to indicate different states in the process 1878You can use TODO keywords to indicate different states in the process
1791of working on an item, for example 1879of working on an item, for example:
1792 1880
1793@lisp 1881@lisp
1794(setq org-todo-keywords '("TODO" "FEEDBACK" "VERIFY" "DONE") 1882(setq org-todo-keywords '("TODO" "FEEDBACK" "VERIFY" "DONE")
@@ -1836,7 +1924,7 @@ Use prefix arguments or completion to quickly select a specific name.
1836You can also review the items of a specific TODO type in a sparse tree 1924You can also review the items of a specific TODO type in a sparse tree
1837by using a numeric prefix to @kbd{C-c C-v}. For example, to see all 1925by using a numeric prefix to @kbd{C-c C-v}. For example, to see all
1838things Lucy has to do, you would use @kbd{C-3 C-c C-v}. To collect 1926things Lucy has to do, you would use @kbd{C-3 C-c C-v}. To collect
1839collect Lucy's items from all agenda files into a single buffer, you 1927Lucy's items from all agenda files into a single buffer, you
1840would use the prefix arg as well when creating the global todo list: 1928would use the prefix arg as well when creating the global todo list:
1841@kbd{C-3 C-c t}. 1929@kbd{C-3 C-c t}.
1842 1930
@@ -1922,7 +2010,7 @@ Furthermore, these keys are also used by CUA-mode
1922(@pxref{Interaction}). 2010(@pxref{Interaction}).
1923@end table 2011@end table
1924 2012
1925@node Timestamps, Agenda Views, TODO items, Top 2013@node Timestamps, Tags, TODO items, Top
1926@chapter Timestamps 2014@chapter Timestamps
1927 2015
1928Items can be labeled with timestamps to make them useful for project 2016Items can be labeled with timestamps to make them useful for project
@@ -1945,7 +2033,7 @@ planning.
1945A time stamp is a specification of a date (possibly with time) in a 2033A time stamp is a specification of a date (possibly with time) in a
1946special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16 2034special format, either @samp{<2003-09-16 Tue>} or @samp{<2003-09-16
1947Tue 09:39>}. A time stamp can appear anywhere in the headline or body 2035Tue 09:39>}. A time stamp can appear anywhere in the headline or body
1948of an org-tree entry. Its presence allows to show entries on specific 2036of an org-tree entry. Its presence allows entries to be shown on specific
1949dates in the agenda (@pxref{Weekly/Daily Agenda}). We distinguish: 2037dates in the agenda (@pxref{Weekly/Daily Agenda}). We distinguish:
1950 2038
1951@table @var 2039@table @var
@@ -2011,12 +2099,13 @@ this command is used twice in succession, a time range is inserted.
2011@kindex C-u C-c . 2099@kindex C-u C-c .
2012@item C-u C-c . 2100@item C-u C-c .
2013Like @kbd{C-c .}, but use the alternative format which contains date 2101Like @kbd{C-c .}, but use the alternative format which contains date
2014and time. 2102and time. The default time can be rounded to multiples of 5 minutes,
2103see the option @code{org-time-stamp-rounding-minutes}.
2015 2104
2016@kindex C-c ! 2105@kindex C-c !
2017@item C-c ! 2106@item C-c !
2018Like @kbd{C-c .}, but insert an inactive time stamp not triggering the 2107Like @kbd{C-c .}, but insert an inactive time stamp not triggering the
2019agenda. 2108agenda.
2020 2109
2021@kindex C-c < 2110@kindex C-c <
2022@item C-c < 2111@item C-c <
@@ -2118,18 +2207,123 @@ One month back.
2118Choose date in calendar (only if nothing typed into minibuffer). 2207Choose date in calendar (only if nothing typed into minibuffer).
2119@end table 2208@end table
2120 2209
2121@node Agenda Views, Exporting, Timestamps, Top 2210@node Tags, Agenda Views, Timestamps, Top
2211@chapter Tags
2212@cindex tags
2213@cindex headline tagging
2214@cindex matching, tags
2215@cindex sparse tree, tag based
2216
2217If you wish to implement a system to cross-correlate information, an
2218excellent way is to assign @i{tags} to headline. Org-mode has
2219extensive support for using tags.
2220
2221Every headline can contain a list of tags, at the end of the headline.
2222Tags are normal words containing letters, numbers, @samp{_}, and
2223@samp{@@}. Tags must be preceded and followed by a single colon; like
2224@samp{:WORK:}. Several tags can be specified like @samp{:WORK:URGENT:}.
2225
2226@menu
2227* Tag inheritance:: Tags use the tree structure of the outline
2228* Setting tags:: How to assign tags to a headline
2229* Tag searches:: Searching for combinations of tags
2230@end menu
2231
2232@node Tag inheritance, Setting tags, Tags, Tags
2233@section Tag inheritance
2234@cindex inheritance, of tags
2235
2236@i{Tags} make use of the hierarchical structure of outline trees. If a
2237heading has a certain tag, all subheadings will inherit the tag as
2238well. For example, in the list
2239
2240@example
2241* Meeting with the French group :WORK:
2242** Summary by Frank :BOSS:NOTES:
2243*** TODO Prepare slides for him :ACTION:
2244@end example
2245
2246@noindent
2247the final heading will have the tags @samp{:WORK:}, @samp{:BOSS:},
2248@samp{:NOTES:}, and @samp{:ACTION:}. When executing tag searches and
2249Org-mode finds that a certain headline matches the search criterion, it
2250will not check any sublevel headline, assuming that these likely also
2251match, and that the list of matches can become very long. However, this
2252may not be what you want, and you can influence inheritance and
2253searching using the variables @code{org-use-tag-inheritance} and
2254@code{org-tags-match-list-sublevels}.
2255
2256@node Setting tags, Tag searches, Tag inheritance, Tags
2257@section Setting tags
2258@cindex setting tags
2259
2260@kindex M-@key{TAB}
2261As Org-mode deals with plain text files, tags can simply be typed into
2262the buffer. After a colon, @kbd{M-@key{TAB}} offers completion on all
2263tags being used in the current buffer. There is also a special command
2264for inserting tags:
2265
2266@table @kbd
2267@kindex C-c C-c
2268@item C-c C-c
2269@cindex completion, of tags
2270Enter new tags for the current headline. The minibuffer will prompt for
2271a list of tags and offer completion with respect to all other tags used
2272in the current buffer. Several tags, separated by colons, may be
2273specified at the prompt. After pressing @key{RET}, the tags will be
2274inserted and aligned to @code{org-tags-column}. When called with a
2275@kbd{C-u} prefix, all tags in the current buffer will be aligned to that
2276column, just to make things look nice. TAGS are automatically realigned
2277after promotion, demotion, and TODO state changes (@pxref{TODO basics}).
2278@end table
2279
2280@node Tag searches, , Setting tags, Tags
2281@section Tag searches
2282@cindex tag searches
2283
2284Once a tags system has been set up, it can be used to collect related
2285information into special lists.
2286
2287@table @kbd
2288@kindex C-c \
2289@item C-c \
2290Create a sparse tree with all headlines matching a tags search.
2291@kindex C-c a m
2292@item C-c a m
2293Create a global list of tag matches from all agenda files.
2294@xref{Matching headline tags}.
2295@kindex C-c a M
2296@item C-c a M
2297Create a global list of tag matches from all agenda files, but check
2298only TODO items and force checking subitems (see variable
2299@code{org-tags-match-list-sublevels}).
2300@end table
2301
2302A @i{tags} search string can use Boolean operators @samp{&} for AND and
2303@samp{|} for OR. @samp{&} binds more strongly than @samp{|}.
2304Parenthesis are currently not implemented. A tag may also be preceded
2305by @samp{-}, to select against it, and @samp{+} is syntactic sugar for
2306positive selection. The AND operator @samp{&} is optional when @samp{+}
2307or @samp{-} is present. For example, @samp{+WORK-BOSS} would select all
2308headlines that are tagged @samp{:WORK:}, but discard those also tagged
2309@samp{:BOSS:}. The search string @samp{WORK|LAPTOP} selects all lines
2310tagged @samp{:WORK:} or @samp{:LAPTOP:}. The string
2311@samp{WORK|LAPTOP&NIGHT} requires that the @samp{:LAPTOP:} lines are
2312also tagged @samp{NIGHT}.
2313
2314@node Agenda Views, Exporting, Tags, Top
2122@chapter Agenda Views 2315@chapter Agenda Views
2123@cindex agenda views 2316@cindex agenda views
2124 2317
2125Due to the way Org-mode works, TODO items and time-stamped items can 2318Due to the way Org-mode works, TODO items, time-stamped items, and
2126be scattered throughout a file or even a number of files. To get an 2319tagged headlines can be scattered throughout a file or even a number of
2127overview over open action items, or over events that are important for 2320files. To get an overview over open action items, or over events that
2128a particular date, this information must be collected, sorted and 2321are important for a particular date, this information must be collected,
2129displayed in an organized way. 2322sorted and displayed in an organized way.
2130 2323
2131Org-mode can select items based on various criteria, and display them 2324Org-mode can select items based on various criteria, and display them
2132in a separate buffer. Three different views are provided: 2325in a separate buffer. Three different views are provided:
2326
2133@itemize @bullet 2327@itemize @bullet
2134@item 2328@item
2135an @emph{agenda} that is like a calendar and shows information 2329an @emph{agenda} that is like a calendar and shows information
@@ -2141,6 +2335,7 @@ action items, and
2141a @emph{tags view} that shows information based on 2335a @emph{tags view} that shows information based on
2142the tags associated with headlines in the outline tree. 2336the tags associated with headlines in the outline tree.
2143@end itemize 2337@end itemize
2338
2144@noindent 2339@noindent
2145The extracted information is displayed in a special @emph{agenda 2340The extracted information is displayed in a special @emph{agenda
2146buffer}. This buffer is read-only, but provides commands to visit the 2341buffer}. This buffer is read-only, but provides commands to visit the
@@ -2161,7 +2356,9 @@ edit these files remotely.
2161@section Agenda files 2356@section Agenda files
2162 2357
2163The information to be shown is collected from all @emph{agenda files}, 2358The information to be shown is collected from all @emph{agenda files},
2164the files listed in the variable @code{org-agenda-files}. Thus even 2359the files listed in the variable @code{org-agenda-files}@footnote{If the
2360value of that variable is not a list, but a single file name, then the
2361list of agenda files will be maintained in that external file.}. Thus even
2165if you only work with a single Org-mode file, this file should be put 2362if you only work with a single Org-mode file, this file should be put
2166into that list@footnote{When using the dispatcher pressing @kbd{1} 2363into that list@footnote{When using the dispatcher pressing @kbd{1}
2167before selecting a command will actually limit the command to the 2364before selecting a command will actually limit the command to the
@@ -2181,8 +2378,9 @@ the front. With prefix arg, file is added/moved to the end.
2181Remove current file from the list of agenda files. 2378Remove current file from the list of agenda files.
2182@kindex C-, 2379@kindex C-,
2183@item C-, 2380@item C-,
2184Cycle through agenda file list. 2381Cycle through agenda file list, visiting one file after the other.
2185@end table 2382@end table
2383
2186@noindent 2384@noindent
2187The Org menu contains the current list of files and can be used 2385The Org menu contains the current list of files and can be used
2188to visit any of them. 2386to visit any of them.
@@ -2195,7 +2393,7 @@ to visit any of them.
2195@cindex agenda commands, custom 2393@cindex agenda commands, custom
2196The views are created through a dispatcher that should be bound to a 2394The views are created through a dispatcher that should be bound to a
2197global key, for example @kbd{C-c a} (@pxref{Installation and 2395global key, for example @kbd{C-c a} (@pxref{Installation and
2198Activation}). In the following we will assume that @kbd{C-c a} is 2396activation}). In the following we will assume that @kbd{C-c a} is
2199indeed how the dispatcher is accessed and list keyboard access to 2397indeed how the dispatcher is accessed and list keyboard access to
2200commands accordingly. After pressing @kbd{C-c a}, an additional 2398commands accordingly. After pressing @kbd{C-c a}, an additional
2201letter is required to execute a command. The dispatcher offers the 2399letter is required to execute a command. The dispatcher offers the
@@ -2206,7 +2404,7 @@ Create the calendar-like agenda (@pxref{Weekly/Daily Agenda}).
2206@item t / T 2404@item t / T
2207Create a list of all TODO items (@pxref{Global TODO list}). 2405Create a list of all TODO items (@pxref{Global TODO list}).
2208@item m / M 2406@item m / M
2209Create a list of headline matching a TAGS expression (@pxref{Matching 2407Create a list of headlines matching a TAGS expression (@pxref{Matching
2210headline tags}). 2408headline tags}).
2211@end table 2409@end table
2212 2410
@@ -2222,6 +2420,7 @@ Custom commands are configured in the variable
2222@code{org-agenda-custom-commands}. You can customize this variable, 2420@code{org-agenda-custom-commands}. You can customize this variable,
2223for example by pressing @kbd{C-c a C}. You can also directly set it 2421for example by pressing @kbd{C-c a C}. You can also directly set it
2224with Emacs Lisp in @file{.emacs}. For example: 2422with Emacs Lisp in @file{.emacs}. For example:
2423
2225@lisp 2424@lisp
2226(setq org-agenda-custom-commands 2425(setq org-agenda-custom-commands
2227 '(("w" todo "WAITING") 2426 '(("w" todo "WAITING")
@@ -2229,8 +2428,9 @@ with Emacs Lisp in @file{.emacs}. For example:
2229 ("U" tags-tree "+BOSS-URGENT") 2428 ("U" tags-tree "+BOSS-URGENT")
2230 ("f" occur-tree "\\<FIXME\\>"))) 2429 ("f" occur-tree "\\<FIXME\\>")))
2231@end lisp 2430@end lisp
2431
2232@noindent will define @kbd{C-c a w} as a global search for 2432@noindent will define @kbd{C-c a w} as a global search for
2233TODO entries with @samp{WAITING} as todo keyword, @kbd{C-c a u} as a 2433TODO entries with @samp{WAITING} as the TODO keyword, @kbd{C-c a u} as a
2234global tags search for headlines marked @samp{:BOSS:} but not 2434global tags search for headlines marked @samp{:BOSS:} but not
2235@samp{:URGENT:}, @kbd{C-c a U} to do the same search but only in the 2435@samp{:URGENT:}, @kbd{C-c a U} to do the same search but only in the
2236current buffer and display the result as a sparse tree, and @kbd{C-c a 2436current buffer and display the result as a sparse tree, and @kbd{C-c a
@@ -2252,11 +2452,11 @@ a paper agenda, showing all the tasks for the current week or day.
2252Compile an agenda for the current week from a list of org files. The 2452Compile an agenda for the current week from a list of org files. The
2253agenda shows the entries for each day. With a @kbd{C-u} prefix (or 2453agenda shows the entries for each day. With a @kbd{C-u} prefix (or
2254when the variable @code{org-agenda-include-all-todo} is @code{t}), all 2454when the variable @code{org-agenda-include-all-todo} is @code{t}), all
2255unfinished TODO items (also those without a date) are also listed at 2455unfinished TODO items (including those without a date) are also listed at
2256the beginning of the buffer, before the first date.@* 2456the beginning of the buffer, before the first date.@*
2257@end table 2457@end table
2258 2458
2259Remote editing from the agenda buffer means for example that you can 2459Remote editing from the agenda buffer means, for example, that you can
2260change the dates of deadlines and appointments from the agenda buffer. 2460change the dates of deadlines and appointments from the agenda buffer.
2261The commands available in the Agenda buffer are listed in @ref{Agenda 2461The commands available in the Agenda buffer are listed in @ref{Agenda
2262commands}. 2462commands}.
@@ -2275,12 +2475,15 @@ commands}.
2275In the agenda buffer, each entry is preceded by a @emph{category}, 2475In the agenda buffer, each entry is preceded by a @emph{category},
2276which is derived from the file name. The category can also be set 2476which is derived from the file name. The category can also be set
2277with a special line anywhere in the buffer, looking like this: 2477with a special line anywhere in the buffer, looking like this:
2478
2278@example 2479@example
2279#+CATEGORY: Thesis 2480#+CATEGORY: Thesis
2280@end example 2481@end example
2482
2281If there are several such lines in a file, each specifies the category 2483If there are several such lines in a file, each specifies the category
2282for the text below it. The display in the agenda buffer looks best if 2484for the text below it (but the first category also applies to any text
2283the category is not longer than 10 characters. 2485before the first CATEGORY line). The display in the agenda buffer looks
2486best if the category is not longer than 10 characters.
2284 2487
2285@node Time-of-day specifications, Calendar/Diary integration, Categories, Weekly/Daily Agenda 2488@node Time-of-day specifications, Calendar/Diary integration, Categories, Weekly/Daily Agenda
2286@subsection Time-of-Day Specifications 2489@subsection Time-of-Day Specifications
@@ -2337,7 +2540,7 @@ The time grid can be turned on and off with the variable
2337 2540
2338Emacs contains the calendar and diary by Edward M. Reingold. The 2541Emacs contains the calendar and diary by Edward M. Reingold. The
2339calendar displays a three-month calendar with holidays from different 2542calendar displays a three-month calendar with holidays from different
2340countries and cultures. The diary allows to keep track of 2543countries and cultures. The diary allows you to keep track of
2341anniversaries, lunar phases, sunrise/set, recurrent appointments 2544anniversaries, lunar phases, sunrise/set, recurrent appointments
2342(weekly, monthly) and more. In this way, it is quite complementary to 2545(weekly, monthly) and more. In this way, it is quite complementary to
2343Org-mode. It can be very useful to combine output from Org-mode with 2546Org-mode. It can be very useful to combine output from Org-mode with
@@ -2349,13 +2552,12 @@ agenda, you only need to customize the variable
2349@lisp 2552@lisp
2350(setq org-agenda-include-diary t) 2553(setq org-agenda-include-diary t)
2351@end lisp 2554@end lisp
2352@noindent
2353 2555
2354@noindent After that, everything will happen automatically. All diary 2556@noindent After that, everything will happen automatically. All diary
2355entries including holidays, anniversaries etc will be included in the 2557entries including holidays, anniversaries etc will be included in the
2356agenda buffer created by Org-mode. @key{SPC}, @key{TAB}, and 2558agenda buffer created by Org-mode. @key{SPC}, @key{TAB}, and
2357@key{RET} can be used from the agenda buffer to jump to the diary 2559@key{RET} can be used from the agenda buffer to jump to the diary
2358file, in order to edit existing diary entries. The @kbd{i} command to 2560file in order to edit existing diary entries. The @kbd{i} command to
2359insert new entries for the current date works in the agenda buffer, as 2561insert new entries for the current date works in the agenda buffer, as
2360well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display 2562well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
2361Sunrise/Sunset times, show lunar phases and to convert to other 2563Sunrise/Sunset times, show lunar phases and to convert to other
@@ -2399,7 +2601,7 @@ the TODO entries directly from that buffer (@pxref{Agenda commands}).
2399@xref{Global TODO list}, for more information. 2601@xref{Global TODO list}, for more information.
2400@kindex C-c a T 2602@kindex C-c a T
2401@item C-c a T 2603@item C-c a T
2402Like the above, but allow to select a specific TODO keyword. You can 2604Like the above, but allows selection of a specific TODO keyword. You can
2403also do this by specifying a prefix argument to @kbd{C-c a t}. With a 2605also do this by specifying a prefix argument to @kbd{C-c a t}. With a
2404@kbd{C-u} prefix you are prompted for a keyword. With a numeric 2606@kbd{C-u} prefix you are prompted for a keyword. With a numeric
2405prefix, the Nth keyword in @code{org-todo-keywords} is selected. 2607prefix, the Nth keyword in @code{org-todo-keywords} is selected.
@@ -2452,7 +2654,7 @@ The timeline is not really an agenda view, because it only summarizes
2452items from a single Org-mode file. But it also uses the agenda buffer 2654items from a single Org-mode file. But it also uses the agenda buffer
2453and provides similar commands, so we discuss it here. The timeline 2655and provides similar commands, so we discuss it here. The timeline
2454shows all time-stamped items in a single Org-mode file (or the 2656shows all time-stamped items in a single Org-mode file (or the
2455selected part of it), in @emph{time-sorted view}. The main purpose of 2657selected part of it), in a @emph{time-sorted view}. The main purpose of
2456this command is to give an overview over events in a project. 2658this command is to give an overview over events in a project.
2457 2659
2458@table @kbd 2660@table @kbd
@@ -2462,8 +2664,8 @@ Show a time-sorted view of the org file, with all time-stamped items.
2462When called with a @kbd{C-u} prefix, all unfinished TODO entries 2664When called with a @kbd{C-u} prefix, all unfinished TODO entries
2463(scheduled or not) are also listed under the current date. 2665(scheduled or not) are also listed under the current date.
2464@end table 2666@end table
2465@noindent
2466 2667
2668@noindent
2467The commands available in the timeline buffer are listed in 2669The commands available in the timeline buffer are listed in
2468@ref{Agenda commands}. 2670@ref{Agenda commands}.
2469 2671
@@ -2476,7 +2678,7 @@ file where they originate. You are not allowed to edit the agenda
2476buffer itself, but commands are provided to show and jump to the 2678buffer itself, but commands are provided to show and jump to the
2477original entry location, and to edit the org-files ``remotely'' from 2679original entry location, and to edit the org-files ``remotely'' from
2478the agenda buffer. In this way, all information is stored only once, 2680the agenda buffer. In this way, all information is stored only once,
2479and you don't risk that your agenda and note files diverge. 2681removing the risk that your agenda and note files may diverge.
2480 2682
2481Some commands can be executed with mouse clicks on agenda lines. For 2683Some commands can be executed with mouse clicks on agenda lines. For
2482the other commands, the cursor needs to be in the desired line. 2684the other commands, the cursor needs to be in the desired line.
@@ -2507,7 +2709,7 @@ Display original location and recenter that window.
2507@itemx mouse-1 2709@itemx mouse-1
2508@itemx @key{TAB} 2710@itemx @key{TAB}
2509Go to the original location of the item in another window. Under Emacs 2711Go to the original location of the item in another window. Under Emacs
251022, also @kbd{mouse-1} will works for this. 271222, @kbd{mouse-1} will also works for this.
2511 2713
2512@kindex @key{RET} 2714@kindex @key{RET}
2513@itemx @key{RET} 2715@itemx @key{RET}
@@ -2531,11 +2733,11 @@ Delete other windows.
2531 2733
2532@kindex w 2734@kindex w
2533@item w 2735@item w
2534Switch to weekly view (7 days displayed together) 2736Switch to weekly view (7 days displayed together).
2535 2737
2536@kindex d 2738@kindex d
2537@item d 2739@item d
2538Switch to daily view (just one day displayed) 2740Switch to daily view (just one day displayed).
2539 2741
2540@kindex D 2742@kindex D
2541@item D 2743@item D
@@ -2580,7 +2782,7 @@ original org file.
2580 2782
2581@kindex T 2783@kindex T
2582@item T 2784@item T
2583Show all tags assiciated with the current item. Because of 2785Show all tags associated with the current item. Because of
2584inheritance, this may be more than the tags listed in the line itself. 2786inheritance, this may be more than the tags listed in the line itself.
2585 2787
2586@kindex : 2788@kindex :
@@ -2650,7 +2852,7 @@ date at the cursor.
2650 2852
2651@kindex M 2853@kindex M
2652@item M 2854@item M
2653Show the phases of the moon for three month around current date. 2855Show the phases of the moon for the three months around current date.
2654 2856
2655@kindex S 2857@kindex S
2656@item S 2858@item S
@@ -2673,7 +2875,7 @@ Export a single iCalendar file containing entries from all agenda files.
2673@tsubheading{Quit and Exit} 2875@tsubheading{Quit and Exit}
2674@kindex q 2876@kindex q
2675@item q 2877@item q
2676Quit Agenda, remove the agenda buffer. 2878Quit agenda, remove the agenda buffer.
2677 2879
2678@kindex x 2880@kindex x
2679@cindex agenda files, removing buffers 2881@cindex agenda files, removing buffers
@@ -2688,21 +2890,34 @@ visit org files will not be removed.
2688@chapter Exporting 2890@chapter Exporting
2689@cindex exporting 2891@cindex exporting
2690 2892
2691For printing and sharing of notes, Org-mode documents can be exported 2893Org-mode documents can be exported into a variety of other formats. For
2692as ASCII or HTML files. To incorporate entries with associated times 2894printing and sharing of notes, ASCII export produces a readable and
2693like deadlines or appointments into a desktop calendar program like 2895simple version of an Org-mode file. HTML export allows to publish a
2694iCal, Org-mode can also produce extracts in the iCalendar format. 2896notes file on the web, while the XML format provides a solid base for
2897exchange with a broad range of other applications. To incorporate
2898entries with associated times like deadlines or appointments into a
2899desktop calendar program like iCal, Org-mode can also produce extracts
2900in the iCalendar format. Currently Org-mode only supports export, not
2901import of these different formats.
2902
2903When exporting, Org-mode uses special conventions to enrich the output
2904produced. @xref{Text interpretation}, for more details.
2695 2905
2696@menu 2906@menu
2697* ASCII export:: Export as a structured ASCII file 2907* ASCII export:: Exporting to plain ASCII
2698* HTML export:: Export as an HTML file 2908* HTML export:: Exporting to HTML
2699* iCalendar export:: Create calendar entries. 2909* XML export:: Exporting to XML
2910* iCalendar export:: Exporting in iCalendar format
2911* Text interpretation:: How the exporter looks at the file
2700@end menu 2912@end menu
2701 2913
2702@node ASCII export, HTML export, Exporting, Exporting 2914@node ASCII export, HTML export, Exporting, Exporting
2703@section ASCII export 2915@section ASCII export
2704@cindex ASCII export 2916@cindex ASCII export
2705 2917
2918ASCII export produces an simple and very readable version of an Org-mode
2919file.
2920
2706@cindex region, active 2921@cindex region, active
2707@cindex active region 2922@cindex active region
2708@cindex transient-mark-mode 2923@cindex transient-mark-mode
@@ -2718,17 +2933,17 @@ warning.
2718@cindex headline levels, for exporting 2933@cindex headline levels, for exporting
2719In the exported version, the first 3 outline levels will become 2934In the exported version, the first 3 outline levels will become
2720headlines, defining a general document structure. Additional levels 2935headlines, defining a general document structure. Additional levels
2721will be exported as itemize lists. If you want that transition to occur 2936will be exported as itemized lists. If you want that transition to occur
2722at a different level, specify it with a prefix argument. For example, 2937at a different level, specify it with a prefix argument. For example,
2938
2723@example 2939@example
2724@kbd{C-1 C-c C-x a org-export-as-ascii} 2940@kbd{C-1 C-c C-x a org-export-as-ascii}
2725@end example 2941@end example
2942
2726@noindent 2943@noindent
2727creates only top level headlines and does the rest as items. Lines 2944creates only top level headlines and does the rest as items.
2728starting with @samp{#} and subtrees starting with the word @samp{COMMENT}
2729will not be exported.
2730 2945
2731@node HTML export, iCalendar export, ASCII export, Exporting 2946@node HTML export, XML export, ASCII export, Exporting
2732@section HTML export 2947@section HTML export
2733@cindex HTML export 2948@cindex HTML export
2734 2949
@@ -2746,45 +2961,160 @@ Export as HTML file @file{myfile.html}.
2746@kindex C-c C-x b 2961@kindex C-c C-x b
2747@item C-c C-x b 2962@item C-c C-x b
2748Export as HTML file and open it with a browser. 2963Export as HTML file and open it with a browser.
2749@kindex C-c C-x t
2750@item C-c C-x t
2751Insert template with export options, see below.
2752@kindex C-c :
2753@item C-c :
2754Toggle fixed-width for entry (QUOTE) or region, see below.
2755@end table 2964@end table
2756 2965
2757@cindex headline levels, for exporting 2966@cindex headline levels, for exporting
2758In the exported version, the first 3 outline levels will become 2967In the exported version, the first 3 outline levels will become
2759headlines, defining a general document structure. Additional levels 2968headlines, defining a general document structure. Additional levels
2760will be exported as itemize lists. If you want that transition to occur 2969will be exported as itemized lists. If you want that transition to occur
2761at a different level, specify it with a prefix argument. For example, 2970at a different level, specify it with a prefix argument. For example,
2971
2762@example 2972@example
2763@kbd{C-2 C-c C-x b} 2973@kbd{C-2 C-c C-x b}
2764@end example 2974@end example
2975
2765@noindent 2976@noindent
2766creates two levels of headings and does the rest as items. 2977creates two levels of headings and does the rest as items.
2767 2978
2979If you want to include HTML tags which should be interpreted as such,
2980mark them with a @samp{@@} like in @samp{@@<b>bold text@@</b>}.
2981Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
2982@samp{&gt;} in HTML export.
2983
2984You can also give style information for the exported file. The
2985default specification can be configured through the option
2986@code{org-export-html-style}. If you want to use a file-local style,
2987you may use file variables, best wrapped into a COMMENT section at the
2988end of the outline tree. For example:
2989
2990@example
2991* COMMENT HTML style specifications
2992
2993# Local Variables:
2994# org-export-html-style: " <style type=\"text/css\">
2995 p @{font-weight: normal; color: gray; @}
2996 h1 @{color: black; @}
2997 </style>"
2998# End: ***
2999@end example
3000
3001Remember to execute @kbd{M-x normal-mode} after changing this to make
3002the new style visible to Emacs. This command restarts org-mode for the
3003current buffer and forces Emacs to re-evaluate the local variables
3004section in the buffer.
3005
3006@node XML export, iCalendar export, HTML export, Exporting
3007@section XML export
3008@cindex XML export
3009
3010Org-mode contains an XML exporter that produces XOXO-style XML.
3011Currently, this exporter only handles the general outline structure and
3012does not interpret any additional Org-mode features.
3013
3014@table @kbd
3015@kindex C-c C-x C-x
3016@item C-c C-x C-x
3017Export as XML file @file{myfile.xml}.
3018@end table
3019
3020@node iCalendar export, Text interpretation, XML export, Exporting
3021@section iCalendar export
3022@cindex iCalendar export
3023
3024Some people like to use Org-mode for keeping track of projects, but
3025still prefer a standard calendar application for anniversaries and
3026appointments. In this case it can be useful to have deadlines and
3027other time-stamped items in Org-mode files show up in the calendar
3028application. Org-mode can export calendar information in the standard
3029iCalendar format.
3030
3031@table @kbd
3032@kindex C-c C-x i
3033@item C-c C-x i
3034Create iCalendar entries for the current file and store them in the same
3035directory, using a file extension @file{.ics}.
3036@kindex C-c C-x C-i
3037@item C-c C-x C-i
3038Like @kbd{C-c C-x i}, but do this for all files in
3039@code{org-agenda-files}. For each of these files, a separate iCalendar
3040file will be written.
3041@kindex C-c C-x c
3042@item C-c C-x c
3043Create a single large iCalendar file from all files in
3044@code{org-agenda-files} and write it to the file given by
3045@code{org-combined-agenda-icalendar-file}.
3046@end table
3047
3048How this calendar is best read and updated, depends on the application
3049you are using. For example, when using iCal under Apple MacOS X, you
3050could create a new calendar @samp{OrgMode} (the default name for the
3051calendar created by @kbd{C-c C-x c}, see the variables
3052@code{org-icalendar-combined-name} and
3053@code{org-combined-agenda-icalendar-file}). Then set Org-mode to
3054overwrite the corresponding file
3055@file{~/Library/Calendars/OrgMode.ics}. You may even use AppleScript
3056to make iCal re-read the calendar files each time a new version of
3057@file{OrgMode.ics} is produced. Here is the setup needed for this:
3058
3059@cindex applescript, for calendar update
3060@lisp
3061(setq org-combined-agenda-icalendar-file
3062 "~/Library/Calendars/OrgMode.ics")
3063(add-hook 'org-after-save-iCalendar-file-hook
3064 (lambda ()
3065 (shell-command
3066 "osascript -e 'tell application \"iCal\" to reload calendars'")))
3067@end lisp
3068
3069@node Text interpretation, , iCalendar export, Exporting
3070@section Text interpretation by the exporter
3071
3072The exporter backends interpret additional structure in the Org-mode file
3073in order to produce better output.
3074
2768@menu 3075@menu
2769* HTML formatting:: Interpretation of the buffer content 3076* Comment lines:: Some lines will not be exported
2770* Export options:: How to influence exports 3077* Enhancing text:: Subscripts, symbols and more
2771* Comment lines:: Lines which will not be exported 3078* Export options:: How to influence the export settings
2772@end menu 3079@end menu
2773 3080
2774@node HTML formatting, Export options, HTML export, HTML export 3081@node Comment lines, Enhancing text, Text interpretation, Text interpretation
2775@subsection HTML formatting 3082@subsection Comment lines
3083@cindex comment lines
3084@cindex exporting, not
3085
3086Lines starting with @samp{#} in column zero are treated as comments
3087and will never be exported. Also entire subtrees starting with the
3088word @samp{COMMENT} will never be exported. Finally, any text before
3089the first headline will not be exported either.
3090
3091@table @kbd
3092@kindex C-c ;
3093@item C-c ;
3094Toggle the COMMENT keyword at the beginning of an entry.
3095@end table
3096
3097
3098
3099@node Enhancing text, Export options, Comment lines, Text interpretation
3100@subsection Enhancing text for export
3101@cindex enhancing text
3102@cindex richer text
3103
3104Some of the export backends of Org-mode allow for sophisticated text
3105formatting, this is true in particular for the HTML backend. Org-mode
3106has a number of typing conventions that allow to produce a richly
3107formatted output.
2776 3108
2777Not all text is transferred literally to the exported HTML file. The
2778exporter implements the following interpretation:
2779 3109
2780@itemize @bullet 3110@itemize @bullet
2781 3111
2782@cindex hand-formatted lists 3112@cindex hand-formatted lists
2783@cindex lists, hand-formatted 3113@cindex lists, hand-formatted
2784@item 3114@item
2785Hand-formatted lists with @samp{-}, @samp{*} or @samp{+} as 3115Plain lists @samp{-}, @samp{*} or @samp{+} as bullet, or with @samp{1.}
2786bullet, or with @samp{1.} or @samp{2)} as enumerator will be recognized and 3116or @samp{2)} as enumerator will be recognized and transformed if the
2787transformed into HTML lists. See @xref{Plain Lists}. 3117backend supports lists. See @xref{Plain Lists}.
2788 3118
2789@cindex underlined text 3119@cindex underlined text
2790@cindex bold text 3120@cindex bold text
@@ -2807,10 +3137,11 @@ use completion for these macros, just type @samp{\} and maybe a few
2807letters, and press @kbd{M-@key{TAB}} to see possible completions. 3137letters, and press @kbd{M-@key{TAB}} to see possible completions.
2808@end itemize 3138@end itemize
2809 3139
2810@cindex tables, export to HTML 3140@cindex tables, export
2811@item 3141@item
2812Tables are transformed into HTML tables. Data fields before the first 3142Tables are transformed into native tables under the exporter, if the
2813horizontal separator line will be formatted as table header fields. 3143export backend supports this. Data fields before the first horizontal
3144separator line will be formatted as table header fields.
2814 3145
2815@cindex fixed width 3146@cindex fixed width
2816@item 3147@item
@@ -2818,19 +3149,20 @@ If a headline starts with the word @samp{QUOTE}, the text below the
2818headline will be typeset as fixed-width, to allow quoting of computer 3149headline will be typeset as fixed-width, to allow quoting of computer
2819codes etc. Lines starting with @samp{:} are also typeset in 3150codes etc. Lines starting with @samp{:} are also typeset in
2820fixed-width font. 3151fixed-width font.
2821 3152@table @kbd
2822@cindex HTML tags 3153@kindex C-c :
2823@item 3154@item C-c :
2824If you want to include HTML tags which should be interpreted as such, 3155Toggle fixed-width for entry (QUOTE) or region, see below.
2825mark them with a @samp{@@} like in @samp{@@<b>bold text@@</b>}. 3156@end table
2826Plain @samp{<} and @samp{>} are always transformed to @samp{&lt;} and
2827@samp{&gt;} in HTML export.
2828@end itemize 3157@end itemize
2829 3158
2830If these conversions conflict with your habits of typing ASCII text, 3159If these conversions conflict with your habits of typing ASCII text,
2831they can all be turned off with corresponding variables. 3160they can all be turned off with corresponding variables (see the
3161customization group @code{org-export-general}, and the following section
3162which explains how to set export options with special lines in a
3163buffer.
2832 3164
2833@node Export options, Comment lines, HTML formatting, HTML export 3165@node Export options, , Enhancing text, Text interpretation
2834@subsection Export options 3166@subsection Export options
2835@cindex options, for export 3167@cindex options, for export
2836 3168
@@ -2842,6 +3174,12 @@ C-x t}. For individual lines, a good way to make sure the keyword is
2842correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion 3174correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
2843(@pxref{Completion}). 3175(@pxref{Completion}).
2844 3176
3177@table @kbd
3178@kindex C-c C-x t
3179@item C-c C-x t
3180Insert template with export options, see example below.
3181@end table
3182
2845@example 3183@example
2846#+TITLE: the title to be shown (default is the buffer name) 3184#+TITLE: the title to be shown (default is the buffer name)
2847#+AUTHOR: the author (default taken from @code{user-full-name}) 3185#+AUTHOR: the author (default taken from @code{user-full-name})
@@ -2851,9 +3189,10 @@ correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
2851#+TEXT: Several lines may be given. 3189#+TEXT: Several lines may be given.
2852#+OPTIONS: H:2 num:t toc:t \n:nil @:t ::t |:t ^:t *:nil TeX:t 3190#+OPTIONS: H:2 num:t toc:t \n:nil @:t ::t |:t ^:t *:nil TeX:t
2853@end example 3191@end example
3192
2854@noindent 3193@noindent
2855The OPTIONS line is a compact form to specify export settings. Here 3194The OPTIONS line is a compact form to specify export settings. Here
2856you can 3195you can:
2857@cindex headline levels 3196@cindex headline levels
2858@cindex section-numbers 3197@cindex section-numbers
2859@cindex table of contents 3198@cindex table of contents
@@ -2877,98 +3216,14 @@ toc: @r{turn on/off table of contents}
2877TeX: @r{turn on/off @TeX{} macros} 3216TeX: @r{turn on/off @TeX{} macros}
2878@end example 3217@end example
2879 3218
2880You can also give style information for the exported file. The
2881default specification can be configured through the option
2882@code{org-export-html-style}. If you want to use a file-local style,
2883you may use file variables, best wrapped into a COMMENT section at the
2884end of the outline tree. For example:
2885
2886@example
2887* COMMENT HTML style specifications
2888
2889# Local Variables:
2890# org-export-html-style: " <style type=\"text/css\">
2891 p @{font-weight: normal; color: gray; @}
2892 h1 @{color: black; @}
2893 </style>"
2894# End: ***
2895@end example
2896
2897Remember to execute @kbd{M-x normal-mode} after changing this to make
2898the new style visible to Emacs.
2899
2900@node Comment lines, , Export options, HTML export
2901@subsection Comment lines
2902@cindex comment lines
2903@cindex exporting, not
2904
2905Lines starting with @samp{#} in column zero are treated as comments
2906and will never be exported. Also entire subtrees starting with the
2907word @samp{COMMENT} will never be exported. Finally, any text before
2908the first headline will not be exported either. This applies also for
2909ASCII export.
2910
2911@table @kbd
2912@kindex C-c ;
2913@item C-c ;
2914Toggle the COMMENT keyword at the beginning of an entry.
2915@end table
2916
2917@node iCalendar export, , HTML export, Exporting
2918@section iCalendar export
2919@cindex iCalendar export
2920
2921Some people like to use Org-mode for keeping track of projects, but
2922still prefer a standard calendar application for anniversaries and
2923appointments. In this case it can be useful to have deadlines and
2924other time-stamped items in Org-mode files show up in the calendar
2925application. Org-mode can export calendar information in the standard
2926iCalendar format.
2927
2928@table @kbd
2929@kindex C-c C-x i
2930@item C-c C-x i
2931Create iCalendar entries for the current file and store them in the same
2932directory, using a file extension @file{.ics}.
2933@kindex C-c C-x C-i
2934@item C-c C-x C-i
2935Like @kbd{C-c C-x i}, but do this for all files in
2936@code{org-agenda-files}. For each of these files, a separate iCalendar
2937file will be written.
2938@kindex C-c C-x c
2939@item C-c C-x c
2940Create a single large iCalendar file from all files in
2941@code{org-agenda-files} and write it to the file given by
2942@code{org-combined-agenda-icalendar-file}.
2943@end table
2944
2945How this calendar is best read and updated, depends on the application
2946you are using. For example, when using iCal under Apple MacOS X, you
2947could create a new calendar @samp{OrgMode} (the default name for the
2948calendar created by @kbd{C-c C-x c}, see the variables
2949@code{org-icalendar-combined-name} and
2950@code{org-combined-agenda-icalendar-file}). Then set Org-mode to
2951overwrite the corresponding file
2952@file{~/Library/Calendars/OrgMode.ics}. You may even use AppleScript
2953to make iCal re-read the calendar files each time a new version of
2954@file{OrgMode.ics} is produced. Here is the setup needed for this:
2955
2956@cindex applescript, for calendar update
2957@lisp
2958(setq org-combined-agenda-icalendar-file
2959 "~/Library/Calendars/OrgMode.ics")
2960(add-hook 'org-after-save-iCalendar-file-hook
2961 (lambda ()
2962 (shell-command
2963 "osascript -e 'tell application \"iCal\" to reload calendars'")))
2964@end lisp
2965
2966@node Miscellaneous, Index, Exporting, Top 3219@node Miscellaneous, Index, Exporting, Top
2967@chapter Miscellaneous 3220@chapter Miscellaneous
2968 3221
2969@menu 3222@menu
2970* Completion:: M-TAB knows what you need 3223* Completion:: M-TAB knows what you need
2971* Customization:: Adapting Org-mode to your taste 3224* Customization:: Adapting Org-mode to your taste
3225* Summary of in-buffer settings:: Using special lines to set options
3226* The very busy C-c C-c key:: When in doubt, press C-c C-c
2972* Clean view:: Getting rid of leading stars in the outline 3227* Clean view:: Getting rid of leading stars in the outline
2973* TTY keys:: Using Org-mode on a tty 3228* TTY keys:: Using Org-mode on a tty
2974* FAQ:: Frequently asked questions 3229* FAQ:: Frequently asked questions
@@ -3021,7 +3276,7 @@ Elsewhere, complete dictionary words using ispell.
3021@end table 3276@end table
3022 3277
3023 3278
3024@node Customization, Clean view, Completion, Miscellaneous 3279@node Customization, Summary of in-buffer settings, Completion, Miscellaneous
3025@section Customization 3280@section Customization
3026@cindex customization 3281@cindex customization
3027@cindex options, for customization 3282@cindex options, for customization
@@ -3031,16 +3286,119 @@ There are more than 100 variables that can be used to customize
3031Org-mode. For the sake of compactness of the manual, we are not 3286Org-mode. For the sake of compactness of the manual, we are not
3032describing the variables here. A structured overview of customization 3287describing the variables here. A structured overview of customization
3033variables is available with @kbd{M-x org-customize}. Or select 3288variables is available with @kbd{M-x org-customize}. Or select
3034@code{Browse Org Group} from the @code{Org->Customization} menu. 3289@code{Browse Org Group} from the @code{Org->Customization} menu. Many
3290settings can also be activated on a per-file basis, by putting special
3291lines into the buffer (@pxref{Summary of in-buffer settings}).
3292
3293@node Summary of in-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
3294@section Summary of in-buffer settings
3295@cindex in-buffer settings
3296@cindex special keywords
3297
3298Org-mode uses special lines in the buffer to define settings on a
3299per-file basis. These lines start with a @samp{#+} followed by a
3300keyword, a colon, and then individual words defining a setting. Several
3301settings words con be in the same line, but you can also have multiple
3302lines for the keyword. While these settings are described throughout
3303the manual, here is a summary. After changing any of those lines in the
3304buffer, press @kbd{C-c C-c} with the cursor still in the line to
3305activate the changes immediately. Otherwise they become effective only
3306when the file is visited again in a new Emacs session.
3035 3307
3036@node Clean view, TTY keys, Customization, Miscellaneous 3308@table @kbd
3309@item #+STARTUP:
3310This line sets options to be used at startup of org-mode, when an
3311Org-mode file is being visited. The first set of options deals with the
3312initial visibility of the outline tree. The corresponding variable for
3313global default settings is @code{org-startup-folded}, with a default
3314value @code{t}, which means @code{overview}.
3315@example
3316overview @r{top-level headlines only}
3317content @r{all headlines}
3318showall @r{no folding at all, show everything}
3319@end example
3320Then there are options for aligning tables upon visiting a file. This
3321is useful in files containing narrowed table columns. The corresponding
3322variable is @code{org-startup-align-all-tables}, with a default value
3323@code{nil}.
3324@example
3325align @r{align all tables}
3326noalign @r{don't align table on startup}
3327@end example
3328Here are the options for hiding leading stars in outline headings. The
3329corresponding variables are @code{org-hide-leading-stars} and
3330@code{org-odd-levels-only}, both with a default setting @code{nil}
3331(meaning @code{showstars} and @code{oddeven}).
3332@example
3333hidestars @r{make all but one of the stars starting a headline invisible.}
3334showstars @r{show all stars starting a headline}
3335odd @r{allow only odd outline levels (1,3,...)}
3336oddeven @r{allow all outline levels}
3337@end example
3338@item #+SEQ_TODO: #+TYP_TODO:
3339These lines that the TODO keywords and their interpretation in the
3340current file. The corresponding variables are @code{org-todo-keywords}
3341and @code{org-todo-interpretation}.
3342@item #+CATEGORY:
3343This line sets the category for the agenda file. The category applies
3344for all subsequent lines until the next @samp{#+CATEGORY} line, or the
3345end of the file.
3346@item #+TBLFM:
3347This line contains the formulas for the table directly above the line.
3348@item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+OPTIONS:
3349These line provide setting for exporting files. For more details see
3350@ref{Export options}.
3351@end table
3352
3353@node The very busy C-c C-c key, Clean view, Summary of in-buffer settings, Miscellaneous
3354@section The very busy C-c C-c key
3355@kindex C-c C-c
3356
3357The key @kbd{C-c C-c} has many purposes in org-mode, which are all
3358mentioned scattered throughout this manual. One specific function of
3359this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
3360other circumstances it means something like @emph{Hey Org-mode, look
3361here and update according to what you see here}. Here is a summary what
3362this means in different contexts.
3363
3364@itemize @minus
3365@c @item
3366@c If the cursor is in a headline, prompt for tags and insert them
3367@c into the current line, aligned to `org-tags-column'. When called
3368@c with prefix arg, realign all tags in the current buffer.
3369@item
3370If the cursor is in one of the special #+KEYWORD lines, this
3371triggers scanning the buffer for these lines and updating the
3372information.
3373@item
3374If the cursor is inside a table, realign the table. This command
3375works even if the automatic table editor has been turned off.
3376@item
3377If the cursor is on a #+TBLFM line, re-apply the formulas to
3378the entire table.
3379@item
3380If the cursor is inside a table created by the @file{table.el} package,
3381activate that table.
3382@item
3383If the current buffer is a remember buffer, close note and file it.
3384with a prefix argument, file it without further interaction to the default
3385location.
3386@item
3387If the cursor is on a <<<target>>>, update radio targets and corresponding
3388links in this buffer.
3389@item
3390If the cursor is on a numbered item in a plain list, renumber the
3391ordered list.
3392@end itemize
3393
3394@node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
3037@section A cleaner outline view 3395@section A cleaner outline view
3038@cindex hiding leading stars 3396@cindex hiding leading stars
3039@cindex clean outline view 3397@cindex clean outline view
3040 3398
3041Some people find it noisy and distracting that the Org-mode headlines 3399Some people find it noisy and distracting that the Org-mode headlines
3042are starting with a potentially large number of stars. For example in 3400are starting with a potentially large number of stars. For example
3043the example tree from @ref{Headlines}: 3401the tree from @ref{Headlines}:
3044 3402
3045@example 3403@example
3046* Top level headline 3404* Top level headline
@@ -3071,9 +3429,10 @@ the buffer)
3071#+STARTUP: showstars 3429#+STARTUP: showstars
3072#+STARTUP: hidestars 3430#+STARTUP: hidestars
3073@end example 3431@end example
3432
3074@noindent 3433@noindent
3075Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate 3434Press @kbd{C-c C-c} with the cursor in a @samp{STARTUP} line to activate
3076the modifications. 3435the modifications.
3077 3436
3078With stars hidden, the tree becomes: 3437With stars hidden, the tree becomes:
3079 3438
@@ -3128,12 +3487,10 @@ activate changes immediately).
3128#+STARTUP: oddeven 3487#+STARTUP: oddeven
3129@end example 3488@end example
3130 3489
3131You can convert an Org-mode file from single-star-per-level to 3490You can convert an Org-mode file from single-star-per-level to the
3132double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels 3491double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
3133RET} in that file. There is no command for the back conversion because 3492RET} in that file. The reverse operation is @kbd{M-x
3134such a command might merge levels and in this way destroy the 3493org-convert-to-oddeven-levels}.
3135structure of the tree.
3136@c FIXME: Maybe we should have such a command...
3137 3494
3138@node TTY keys, FAQ, Clean view, Miscellaneous 3495@node TTY keys, FAQ, Clean view, Miscellaneous
3139@section Using org-mode on a tty 3496@section Using org-mode on a tty
@@ -3179,36 +3536,78 @@ rather use @kbd{C-c .} to re-insert the timestamp.
3179@enumerate 3536@enumerate
3180@item @b{Org-mode seems to be a useful default mode for the various 3537@item @b{Org-mode seems to be a useful default mode for the various
3181@file{README} files I have scattered through my directories. How do I 3538@file{README} files I have scattered through my directories. How do I
3182turn it on for all @file{README} files?} 3539turn it on for all @file{README} files?}@*
3540@c
3183@example 3541@example
3184(add-to-list 'auto-mode-alist '("README$" . org-mode)) 3542(add-to-list 'auto-mode-alist '("README$" . org-mode))
3185@end example 3543@end example
3186 3544
3545@item @b{Some of my links stopped working after I upgraded to a version
35464.20 or later. Why is this, and how can I fix it?}@*
3547@c
3548These must be links in plain text, containing white space, such as
3549@samp{bbdb:Richard Stallman}. You need to protect these links by
3550putting double brackets around them, like @samp{[[bbdb:Richard
3551Stallman]]}.
3552
3553@item @b{I see that Org-mode now creates links using the double bracket
3554convention that hides the link part and the brackets, only showing the
3555description part. How can I convert my old links to this new format?}@*
3556@c
3557Execute once in each Org-mode file: @kbd{M-x org-upgrade-old-links}.
3558The replaces angular brackets with the link format.
3559
3560@item @b{I don't care if you find the new bracket links great, I am
3561attached to the old style using angular brackets and no hiding of the
3562link text. Please give them back to me, don't tell me it is not
3563possible!}@*
3564@c
3565Would I let you down like that? If you must, you can do this
3566
3567@lisp
3568(setq org-link-style 'plain
3569 org-link-format "<%s>")
3570@end lisp
3571
3572@item @b{When I am executing shell links I always get a
3573confirmation prompt and need to type @kbd{yes @key{RET}}, thats 4 key
3574presses! Can I get rid of this?}@*
3575@c
3576@cindex shell links, confirmation
3577@cindex dangerous commands
3578The confirmation is there to protect you from unwantingly execute
3579potentially dangerous commands. For example, imagine a link
3580@samp{[[shell:rm -rf ~/*][Google Search]]}. In an Org-mode buffer, this
3581command would look like @samp{Google Search}, but really it would remove
3582your home directory. If you wish, you can make it easier to respond to
3583the query by setting @code{org-confirm-shell-links} to @code{y-or-n-p}.
3584Then a single @kbd{y} keypress will be enough to confirm shell links.
3585It is also possible to turn off this check entirely, but I do not
3586recommend to do this. Be warned.
3587
3187@item @b{All these stars are driving me mad, I just find the Emacs 3588@item @b{All these stars are driving me mad, I just find the Emacs
3188outlines unreadable. Can't you just put white space and a single star as a 3589outlines unreadable. Can't you just put white space and a single star as a
3189starter for headlines?}@* 3590starter for headlines?}@*
3591@c
3190See @ref{Clean view}. 3592See @ref{Clean view}.
3191 3593
3192@item @b{I would like to have two windows on the same Org-mode 3594@item @b{I would like to have two windows on the same Org-mode
3193file, but with different outline visibility. Is that possible?}@* 3595file, but with different outline visibility. Is that possible?}@*
3596@c
3194@cindex @code{make-indirect-buffer} 3597@cindex @code{make-indirect-buffer}
3195@cindex indirect buffers 3598@cindex indirect buffers
3196In GNU Emacs, you may use @emph{indirect buffers} which do exactly 3599In GNU Emacs, you may use @emph{indirect buffers} which do exactly this.
3197this. See the documentation on the command 3600See the documentation on the command @code{make-indirect-buffer}. In
3198@code{make-indirect-buffer}. In XEmacs, this is currently not 3601XEmacs, this is currently not possible because of the different outline
3199possible because of the different outline implementation. 3602implementation.
3200
3201@item @b{Is there an easy way to insert links to web locations?}@*
3202@cindex URL, paste into buffer
3203Sure, just type or paste them into the buffer. A plain-text URL-like
3204string is directly interpreted as a link.
3205 3603
3206@item @b{When I export my TODO list, every TODO item becomes a 3604@item @b{When I export my TODO list, every TODO item becomes a
3207separate section. How do I enforce these items to be exported as an 3605separate section. How do I enforce these items to be exported as an
3208itemized list?}@* 3606itemized list?}@*
3607@c
3209If you plan to use ASCII or HTML export, make sure things you want to 3608If you plan to use ASCII or HTML export, make sure things you want to
3210be exported as item lists are level 4 at least, even if that does mean 3609be exported as item lists are level 4 at least, even if that does mean
3211there is a level jump. For example 3610there is a level jump. For example:
3212 3611
3213@example 3612@example
3214* Todays top priorities 3613* Todays top priorities
@@ -3225,27 +3624,22 @@ configure the @samp{H} switch.
3225+OPTIONS: H:2; ... 3624+OPTIONS: H:2; ...
3226@end example 3625@end example
3227 3626
3228@item @b{I would like to export only a subtree of my file to HTML. How?}@* 3627@item @b{I would like to export only a subtree of my file to HTML.
3628How?}@*
3629@c
3229@cindex exporting a subtree 3630@cindex exporting a subtree
3230If you want to export a subtree, mark the subtree as region and then 3631If you want to export a subtree, mark the subtree as region and then
3231export. Marking can be done with @kbd{C-c @@ C-x C-x}, for example. 3632export. Marking can be done with @kbd{C-c @@ C-x C-x}, for example.
3232 3633
3233@item @b{Org-mode takes over the S-cursor keys. I also want to use 3634@item @b{Org-mode takes over the S-cursor keys. I also want to use
3234CUA-mode, is there a way to fix this conflict?}@* 3635CUA-mode, is there a way to fix this conflict?}@*
3235Yes, see @ref{Interaction} 3636Yes, see @ref{Interaction}.
3236
3237@item @b{Is there an easy way to insert an empty table template with a
3238default number of rows and columns?}@*
3239@cindex table, empty template
3240To insert an empty table template, just type @samp{|-} and use
3241@key{TAB}. The default size can be changed with the variable
3242@code{org-table-default-size}. However, just starting to type the
3243first line is usually much easier.
3244 3637
3245@item @b{One of my table columns has started to fill up with 3638@item @b{One of my table columns has started to fill up with
3246@samp{#ERROR}. What is going on?}@* 3639@samp{#ERROR}. What is going on?}@*
3640@c
3247Org-mode tried to compute the column from other fields using a 3641Org-mode tried to compute the column from other fields using a
3248formula stored in the @samp{#+TBLFMT:} line just below the table, and 3642formula stored in the @samp{#+TBLFM:} line just below the table, and
3249the evaluation of the formula fails. Fix the fields used in the 3643the evaluation of the formula fails. Fix the fields used in the
3250formula, or fix the formula, or remove it! 3644formula, or fix the formula, or remove it!
3251 3645
@@ -3253,23 +3647,26 @@ formula, or fix the formula, or remove it!
3253horizontal line in the table, pressing TAB creates a new table line 3647horizontal line in the table, pressing TAB creates a new table line
3254@i{before} the horizontal line. How can I quickly move to the line 3648@i{before} the horizontal line. How can I quickly move to the line
3255@i{below} the horizontal line instead?}@* 3649@i{below} the horizontal line instead?}@*
3650@c
3256Press @key{down} (to get on the separator line) and then @key{TAB}. 3651Press @key{down} (to get on the separator line) and then @key{TAB}.
3257Or configure the variable @code{org-table-tab-jumps-over-hlines}. 3652Or configure the variable @code{org-table-tab-jumps-over-hlines}.
3258 3653
3259@item @b{How can I change the indentation of an entire table without 3654@item @b{How can I change the indentation of an entire table without
3260fixing every line by hand?}@* 3655fixing every line by hand?}@*
3656@c
3261@cindex indentation, of tables 3657@cindex indentation, of tables
3262The indentation of a table is set by the first line. So just fix the 3658The indentation of a table is set by the first line. So just fix the
3263indentation of the first line and realign with @key{TAB}. 3659indentation of the first line and realign with @key{TAB}.
3264 3660
3265@item @b{Is it possible to include entries from org-mode files into my 3661@item @b{Is it possible to include entries from org-mode files into my
3266emacs diary?}@* 3662emacs diary?}@*
3663@c
3267Since the org-mode agenda is much more powerful and can contain the 3664Since the org-mode agenda is much more powerful and can contain the
3268diary (@pxref{Calendar/Diary integration}), you should think twice 3665diary (@pxref{Calendar/Diary integration}), you should think twice
3269before deciding to do this. Inegrating org-mode information into the 3666before deciding to do this. Integrating Org-mode information into the
3270diary is, however, possible. The following steps are necessary: 3667diary is, however, possible. The following steps are necessary:
3271Autoload the function @command{org-diary} as shown above under 3668Autoload the function @command{org-diary} as shown above under
3272@ref{Installation and Activation}. You also need to use @emph{fancy 3669@ref{Installation and activation}. You also need to use @emph{fancy
3273diary display} by setting in @file{.emacs}: 3670diary display} by setting in @file{.emacs}:
3274 3671
3275@lisp 3672@lisp
@@ -3291,12 +3688,14 @@ You may also select specific files with
3291&%%(org-diary) ~/path/to/another/org-file.org 3688&%%(org-diary) ~/path/to/another/org-file.org
3292@end example 3689@end example
3293 3690
3294If you now launch the calendar and press @kbd{d} to display a diary, 3691If you now launch the calendar and press @kbd{d} to display a diary, the
3295the headlines of entries containing a timestamp, date range, schedule, 3692headlines of entries containing a timestamp, date range, schedule, or
3296or deadline referring to the selected date will be listed. Just like 3693deadline referring to the selected date will be listed. Just like in
3297in Org-mode's agenda view, the diary for @emph{today} contains 3694Org-mode's agenda view, the diary for @emph{today} contains additional
3298additional entries for overdue deadlines and scheduled items. See 3695entries for overdue deadlines and scheduled items. See also the
3299also the documentation of the @command{org-diary} function. 3696documentation of the @command{org-diary} function. Under XEmacs, it is
3697not possible to jump back from the diary to the org, this works only in
3698the agenda buffer.
3300 3699
3301@end enumerate 3700@end enumerate
3302 3701
@@ -3310,10 +3709,10 @@ Org-mode can cooperate with the following packages:
3310@cindex @file{org-mouse.el} 3709@cindex @file{org-mouse.el}
3311@item @file{org-mouse.el} by Piotr Zielinski 3710@item @file{org-mouse.el} by Piotr Zielinski
3312This package implements extended mouse functionality for Org-mode. It 3711This package implements extended mouse functionality for Org-mode. It
3313allows to cycle visibility and to edit the document structure with the 3712allows you to cycle visibility and to edit the document structure with
3314mouse. It also provides a context-sensitive menu that changes depending 3713the mouse. Best of all, it provides a context-sensitive menu on
3315on the context of a mouse-click. Use a search engine to find this 3714@key{mouse-3} that changes depending on the context of a mouse-click.
3316package on the web. 3715Use a search engine to find this package on the web.
3317@cindex @file{table.el} 3716@cindex @file{table.el}
3318@item @file{table.el} by Takaaki Ota 3717@item @file{table.el} by Takaaki Ota
3319Org mode cooperates with table.el, see @ref{table.el}. @file{table.el} 3718Org mode cooperates with table.el, see @ref{table.el}. @file{table.el}
@@ -3331,7 +3730,7 @@ packages is using calc for embedded calculations. @xref{Embedded Mode,
3331@cindex @file{constants.el} 3730@cindex @file{constants.el}
3332@item @file{constants.el} by Carsten Dominik 3731@item @file{constants.el} by Carsten Dominik
3333In a table formula (@pxref{Table calculations}), it is possible to use 3732In a table formula (@pxref{Table calculations}), it is possible to use
3334names for natural constants or units. Instead of defining you own 3733names for natural constants or units. Instead of defining your own
3335constants in the variable @code{org-table-formula-constants}, install 3734constants in the variable @code{org-table-formula-constants}, install
3336the @file{constants} package which defines a large number of constants 3735the @file{constants} package which defines a large number of constants
3337and units, and lets you use unit prefixes like @samp{M} for 3736and units, and lets you use unit prefixes like @samp{M} for
@@ -3350,38 +3749,40 @@ packages along with Org-mode, configure the variable
3350@code{org-CUA-compatible}. When set, Org-mode will move the following 3749@code{org-CUA-compatible}. When set, Org-mode will move the following
3351keybindings in org-mode files, and in the agenda buffer (but not 3750keybindings in org-mode files, and in the agenda buffer (but not
3352during date selection). 3751during date selection).
3752
3353@example 3753@example
3354S-UP -> M-p S-DOWN -> M-n 3754S-UP -> M-p S-DOWN -> M-n
3355S-LEFT -> M-- S-RIGHT -> M-+ 3755S-LEFT -> M-- S-RIGHT -> M-+
3356S-RET -> C-S-RET 3756S-RET -> C-S-RET
3357@end example 3757@end example
3758
3358Yes, these are unfortunately more difficult to remember. If you want 3759Yes, these are unfortunately more difficult to remember. If you want
3359to have other replacement keys, look at the variable 3760to have other replacement keys, look at the variable
3360@code{org-disputed-keys}. 3761@code{org-disputed-keys}.
3361@item @file{remember.el} by John Wiegley 3762@item @file{remember.el} by John Wiegley
3362Org mode cooperates with remember, see @ref{Remember}. 3763Org mode cooperates with remember, see @ref{Remember}.
3363@file{Remember.el} is not part of Emacs, find it on the web. 3764@file{Remember.el} is not part of Emacs, find it on the web.
3364@cindex @file{planner.el}
3365@item @file{planner.el} by John Wiegley
3366Planner is another tool to plan work and keep track of tasks. Planner
3367uses a multi-file approach with project pages and day pages. Is based
3368on Emacs-Wiki. If Planner is your primary tool, it can be useful to
3369display the agenda entries resulting from org files in day-pages of
3370the planner. This can be done through the diary of the calendar:
3371Integrate org files into the diary as described above, and then turn
3372on the diary support of planner. Planner is not part of Emacs, find it
3373on the web.
3374@end table 3765@end table
3375 3766
3376@node Bugs, Acknowledgments, Interaction, Miscellaneous 3767@node Bugs, Acknowledgments, Interaction, Miscellaneous
3377@section Bugs 3768@section Bugs
3378@cindex bugs 3769@cindex bugs
3379 3770
3380Here is a list of things which should work differently, but which I 3771Here is a list of things that should work differently, but which I
3381have found too hard to fix. 3772have found too hard to fix.
3382 3773
3383@itemize @bullet 3774@itemize @bullet
3384@item 3775@item
3776If a table field starts with a link, and if the corresponding table
3777column is narrowed (@pxref{Narrow columns}) to a width too small to
3778display the link, the field would look entirely empty even though it is
3779not. To prevent this, Org-mode throws an error. The work-around is to
3780make the column wide enough to fit the link, or to add some text (at
3781least 2 characters) before the link in the same field.
3782@item
3783Narrowing table columns does not work on XEmacs, because the
3784@code{format} function does not transport text properties.
3785@item
3385Text in an entry protected with the @samp{QUOTE} keyword should not 3786Text in an entry protected with the @samp{QUOTE} keyword should not
3386autowrap. 3787autowrap.
3387@item 3788@item
@@ -3402,12 +3803,6 @@ Recalculating a table line applies the formulas from left to right.
3402If a formula uses @emph{calculated} fields further down the row, 3803If a formula uses @emph{calculated} fields further down the row,
3403multiple recalculation may be needed to get all fields consistent. 3804multiple recalculation may be needed to get all fields consistent.
3404@item 3805@item
3405Under XEmacs, if Org-mode entries are included into the diary, it is
3406not possible to jump back from the diary to the org file. Apparently,
3407the text properties are lost when the fancy-diary-display is used.
3408However, from Org-mode's timeline and agenda buffers (created with
3409@kbd{C-c C-r} and @kbd{C-c a}), things do work correctly.
3410@item
3411You can only make a single word boldface or italic. To emphasize 3806You can only make a single word boldface or italic. To emphasize
3412several words in a row, each must have the emphasize markers, like in 3807several words in a row, each must have the emphasize markers, like in
3413@samp{*three* *bold* *words*}. 3808@samp{*three* *bold* *words*}.
@@ -3415,8 +3810,6 @@ several words in a row, each must have the emphasize markers, like in
3415The exporters work well, but could be made more efficient. 3810The exporters work well, but could be made more efficient.
3416@end itemize 3811@end itemize
3417 3812
3418@page
3419
3420@node Acknowledgments, , Bugs, Miscellaneous 3813@node Acknowledgments, , Bugs, Miscellaneous
3421@section Acknowledgments 3814@section Acknowledgments
3422@cindex acknowledgments 3815@cindex acknowledgments
@@ -3432,37 +3825,41 @@ Org-mode would not be what it is without your input.
3432@item 3825@item
3433Thomas Baumann contributed the code for links to the MH-E email system. 3826Thomas Baumann contributed the code for links to the MH-E email system.
3434@item 3827@item
3435Pavel Chalmoviansky reported bugs and suggested improvements 3828Alex Bochannek provided a patch for rounding time stamps.
3436related to the agenda treatment of items with specified time.
3437@item 3829@item
3438Sacha Chua, the current maintainer of Planner, suggested to copy 3830Charles Caves' suggestion sparked the implementation of templates for
3439linking code from Planner (I took code for RMAIL and Wanderlust). 3831Remember.
3440@item 3832@item
3441Christian Egli converted the documentation into TeXInfo format and 3833Pavel Chalmoviansky influenced the agenda treatment of items with
3442patched basic CSS formatting support into the HTML exporter. He also 3834specified time.
3443inspired the agenda by showing me his plans for a multifile summary.
3444@item 3835@item
3445Kai Grossjohann pointed out that a number of key bindings in Org-mode 3836Sacha Chua suggested to copy some linking code from Planner.
3446conflict with other packages.
3447@item 3837@item
3448Stefan Monnier provided a patch with lots of little fixes to keep the 3838Christian Egli converted the documentation into TeXInfo format, patched
3449Emacs-Lisp compiler happy. 3839CSS formatting into the HTML exporter, and inspired the agenda.
3840@item
3841Nic Ferrier contributed mailcap and XML support.
3842@item
3843Kai Grossjohann pointed out key-binding conflicts caused by Org-mode.
3844@item
3845Stefan Monnier provided a patch to keep the Emacs-Lisp compiler happy.
3450@item 3846@item
3451Tim O'Callaghan suggested in-file links, search options for 3847Tim O'Callaghan suggested in-file links, search options for
3452general file links, and TAGS. 3848general file links, and TAGS.
3453@item 3849@item
3454Oliver Oppitz suggested multi-state TODO items. 3850Oliver Oppitz suggested multi-state TODO items.
3455@item 3851@item
3456Pete Phillips helped the development of the TAGS feature with beta 3852Scott Otterson sparked the introduction of descriptive text for links,
3457testing and suggestions. 3853among other things.
3854@item
3855Pete Phillips helped the development of the TAGS feature.
3458@item 3856@item
3459Matthias Rempe (Oelde) provided ideas, a patch introducing Windows 3857Matthias Rempe (Oelde) provided ideas, Windows support, and quality
3460NT/2000 support, and quality control. 3858control.
3461@item 3859@item
3462Kevin Rogers contributed code to access VM files on remote hosts. 3860Kevin Rogers contributed code to access VM files on remote hosts.
3463@item 3861@item
3464Philip Rooke created the Org-mode reference card. He also helped with 3862Philip Rooke created the Org-mode reference card and provided lots of feedback.
3465beta testing and contributed a number of very useful ideas.
3466@item 3863@item
3467Christian Schlauer proposed angular brackets around links, among other 3864Christian Schlauer proposed angular brackets around links, among other
3468things. 3865things.
@@ -3470,28 +3867,31 @@ things.
3470Linking to VM/BBDB/GNUS was inspired by Tom Shannon's 3867Linking to VM/BBDB/GNUS was inspired by Tom Shannon's
3471@file{organizer-mode.el}. 3868@file{organizer-mode.el}.
3472@item 3869@item
3473Juergen Vollmer contributed code generating the table of contents 3870J@"urgen Vollmer contributed code generating the table of contents
3474in HTML output, and other export improvements. 3871in HTML output.
3475@item 3872@item
3476Chris Wallace provided a patch implementing the @samp{QUOTE} keyword. 3873Chris Wallace provided a patch implementing the @samp{QUOTE} keyword.
3477@item 3874@item
3478David Wainberg suggested the archiving mechanism and shaped the 3875David Wainberg suggested archiving, and improvements to the linking
3479internal link system with many suggestions and ideas. 3876system.
3480@item 3877@item
3481Scheduling TODO items was inspired by John Wiegley's @file{planner.el}. 3878John Wiegley wrote @file{emacs-wiki.el} and @file{planner.el}. The
3879development of Org-mode was fully independent, and both systems are
3880really different beasts in their basic ideas and implementation details.
3881However, I have later looked at John's code and learned from his
3882implementation of (i) links where the link itself is hidden and only a
3883description is shown, and (ii) popping up a calendar to select a date.
3482@item 3884@item
3483Carsten Wimmer suggested some changes and helped fix a bug in linking 3885Carsten Wimmer suggested some changes and helped fix a bug in linking
3484to GNUS. 3886to GNUS.
3485@item
3486Roland Winkler pointed out that additional keybindings are needed to
3487use Org-mode on a tty.
3488@item 3887@item
3489Piotr Zielinski wrote @file{org-mouse.el} and pointed out to me that 3888Roland Winkler requested additional keybindings to make Org-mode
3490Emacs 22 can be made to follow links using mouse-1 clicks. 3889work on a tty.
3491@c @item 3890@item
3492@c Nic Ferrier and Christian Egli implemented XML export. 3891Piotr Zielinski wrote @file{org-mouse.el} and showed how to follow links
3892with mouse-1.
3493@end itemize 3893@end itemize
3494 3894
3495@node Index, Key Index, Miscellaneous, Top 3895@node Index, Key Index, Miscellaneous, Top
3496@chapter Index 3896@chapter Index
3497 3897
diff --git a/man/search.texi b/man/search.texi
index a38f56e3f26..4ea3053dea7 100644
--- a/man/search.texi
+++ b/man/search.texi
@@ -750,8 +750,10 @@ can add groups for syntactic purposes without interfering with
750the numbering of the groups that are meant to be referred to. 750the numbering of the groups that are meant to be referred to.
751 751
752@item \@var{d} 752@item \@var{d}
753@cindex back reference, in regexp
753matches the same text that matched the @var{d}th occurrence of a 754matches the same text that matched the @var{d}th occurrence of a
754@samp{\( @dots{} \)} construct. 755@samp{\( @dots{} \)} construct. This is called a @dfn{back
756reference}.
755 757
756After the end of a @samp{\( @dots{} \)} construct, the matcher remembers 758After the end of a @samp{\( @dots{} \)} construct, the matcher remembers
757the beginning and end of the text matched by that construct. Then, 759the beginning and end of the text matched by that construct. Then,
@@ -1002,15 +1004,17 @@ any match for a specified pattern.
1002Replace every match for @var{regexp} with @var{newstring}. 1004Replace every match for @var{regexp} with @var{newstring}.
1003@end table 1005@end table
1004 1006
1007@cindex back reference, in regexp replacement
1005 In @code{replace-regexp}, the @var{newstring} need not be constant: 1008 In @code{replace-regexp}, the @var{newstring} need not be constant:
1006it can refer to all or part of what is matched by the @var{regexp}. 1009it can refer to all or part of what is matched by the @var{regexp}.
1007@samp{\&} in @var{newstring} stands for the entire match being 1010@samp{\&} in @var{newstring} stands for the entire match being
1008replaced. @samp{\@var{d}} in @var{newstring}, where @var{d} is a 1011replaced. @samp{\@var{d}} in @var{newstring}, where @var{d} is a
1009digit, stands for whatever matched the @var{d}th parenthesized 1012digit, stands for whatever matched the @var{d}th parenthesized
1010grouping in @var{regexp}. @samp{\#} refers to the count of 1013grouping in @var{regexp}. (This is called a ``back reference''.)
1011replacements already made in this command, as a decimal number. In 1014@samp{\#} refers to the count of replacements already made in this
1012the first replacement, @samp{\#} stands for @samp{0}; in the second, 1015command, as a decimal number. In the first replacement, @samp{\#}
1013for @samp{1}; and so on. For example, 1016stands for @samp{0}; in the second, for @samp{1}; and so on. For
1017example,
1014 1018
1015@example 1019@example
1016M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET} 1020M-x replace-regexp @key{RET} c[ad]+r @key{RET} \&-safe @key{RET}
diff --git a/man/sending.texi b/man/sending.texi
index fb7235b3c11..0c0c249ba5d 100644
--- a/man/sending.texi
+++ b/man/sending.texi
@@ -459,7 +459,7 @@ user agent sends mail. It should be set to a function. The default
459is @code{sendmail-send-it}, which delivers mail using the Sendmail 459is @code{sendmail-send-it}, which delivers mail using the Sendmail
460installation on the local host. To send mail through a SMTP server, 460installation on the local host. To send mail through a SMTP server,
461set it to @code{smtpmail-send-it} and set up the Emacs SMTP library 461set it to @code{smtpmail-send-it} and set up the Emacs SMTP library
462(@pxref{Top,,Emacs SMTP Library, Sending mail via SMTP,smtpmail}). A 462(@pxref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}). A
463third option is @code{feedmail-send-it}, see the commentary section of 463third option is @code{feedmail-send-it}, see the commentary section of
464the @file{feedmail.el} package for more information. 464the @file{feedmail.el} package for more information.
465 465
diff --git a/man/trouble.texi b/man/trouble.texi
index 6298e24805a..f44862598c4 100644
--- a/man/trouble.texi
+++ b/man/trouble.texi
@@ -58,7 +58,8 @@ Search}).
58like @kbd{C-g}. The reason is that it is not feasible, on MS-DOS, to 58like @kbd{C-g}. The reason is that it is not feasible, on MS-DOS, to
59recognize @kbd{C-g} while a command is running, between interactions 59recognize @kbd{C-g} while a command is running, between interactions
60with the user. By contrast, it @emph{is} feasible to recognize 60with the user. By contrast, it @emph{is} feasible to recognize
61@kbd{C-@key{BREAK}} at all times. @xref{MS-DOS Keyboard}. 61@kbd{C-@key{BREAK}} at all times. @xref{MS-DOS Keyboard,,,emacs-xtra,
62Specialized Emacs Features}.
62 63
63@findex keyboard-quit 64@findex keyboard-quit
64 @kbd{C-g} works by setting the variable @code{quit-flag} to @code{t} 65 @kbd{C-g} works by setting the variable @code{quit-flag} to @code{t}
diff --git a/src/ChangeLog b/src/ChangeLog
index a4db51e7ca1..88492417723 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,191 @@
12006-04-17 Kim F. Storm <storm@cua.dk>
2
3 * window.c (coordinates_in_window): On the vertical border,
4 calculate the row number measured from the top of the window, not
5 the top of the frame.
6
72006-04-16 Eli Zaretskii <eliz@gnu.org>
8
9 * s/ms-w32.h (SYSTEM_PURESIZE_EXTRA): Reduce to 24000.
10
112006-04-16 Romain Francoise <romain@orebokech.com>
12
13 * puresize.h (BASE_PURESIZE): Decrement back to 1200000.
14
152006-04-16 Andreas Schwab <schwab@suse.de>
16
17 * puresize.h (PURESIZE_RATIO): Reduce to 10/6.
18
192006-04-15 Romain Francoise <romain@orebokech.com>
20
21 * puresize.h (BASE_PURESIZE): Increment to 1210000.
22
232006-04-13 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> (tiny change)
24
25 * print.c (Fprin1_to_string): Mention in the `doc' that the
26 behavior is modified by `print-level' and `print-length'.
27
282006-04-13 Kenichi Handa <handa@m17n.org>
29
30 * coding.c (setup_coding_system): If eol-type is not yet decided
31 and system_eol_type is not LF, set CODING_REQUIRE_ENCODING_MASK.
32 If coding_system is nil, return 0.
33 (code_convert_region1): Even if coding_system is nil, don't skip
34 conversion if system_eol_type is not LF.
35 (code_convert_string1): Likewise.
36 (code_convert_string_norecord): Likewise.
37
382006-04-13 Kenichi Handa <handa@m17n.org>
39
40 * coding.c (setup_coding_system): Fix previous change.
41 (encode_coding): If eol_type is not yet decided, use
42 system_eol_type.
43 (shrink_encoding_region): If eol_type is not yet decided and
44 system_eol_type is not LF, don't shrink.
45
462006-04-13 Nick Roberts <nickrob@snap.net.nz>
47
48 * xdisp.c (note_mouse_highlight): Add help echo for dragging vertical
49 line.
50
512006-04-12 Richard Stallman <rms@gnu.org>
52
53 * keyboard.c (read_key_sequence): Explicitly avoid keybuf[-1].
54
55 * process.c (conv_lisp_to_sockaddr): If FAMILY unknown, just return.
56 (Fprocess_send_eof): Abort if fail to open null device.
57
582006-04-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
59
60 * fns.c [HAVE_MENUS && MAC_OS]: Include macterm.h.
61
62 * image.c [MAC_OS] (xpm_load_image): Add parentheses around
63 assignment used as truth value. Add explicit braces to avoid
64 ambiguous `else'.
65 [MAC_OS] (gif_load): Remove unused variable `gcpro1'.
66
67 * lisp.h (syms_of_fontset, Fset_fontset_font): Put extern and
68 EXFUN in #ifdef HAVE_WINDOW_SYSTEM.
69 (syms_of_xfns, syms_of_xsmfns, syms_of_xselect, syms_of_xterm):
70 Put externs in #ifdef HAVE_X_WINDOWS.
71 (syms_of_macfns, syms_of_macselect, syms_of_macterm)
72 (syms_of_macmenu, syms_of_mac) [MAC_OS]: Add externs.
73 (init_mac_osx_environment) [MAC_OSX]: Add extern.
74
75 * mac.c (init_process): Remove undef.
76 (select) [MAC_OSX]: Undefine before including sysselect.h.
77 (posix_pathname_to_fsspec, fsspec_to_posix_pathname) [MAC_OSX]:
78 Remove functions and prototypes.
79 (parse_value): Add parentheses around + inside shift.
80 (path_from_vol_dir_name): Make static.
81 (get_temp_dir_name): Remove unused variables `cpb' and `dir_name'.
82 [!MAC_OSX] (get_path_to_system_folder): Likewise.
83 (Fmac_get_file_creator, Fmac_get_file_type): Remove unused
84 variable `cCode'.
85 (Fmac_coerce_ae_data): Remove unused variables `fref' and `fs'.
86 (Fmac_get_preference): Add explicit braces to avoid ambiguous `else'.
87
88 * macfns.c (x_to_mac_color): Remove unused variable `tail'.
89 (x_set_mouse_color): Remove unused variable `dpy'.
90 (Fx_create_frame): Remove unused variable `x_frame_count'.
91 (Fx_server_version): Add explicit braces to avoid ambiguous `else'.
92 (x_sync): Move from macterm.c.
93 (Fx_file_dialog): Remove unused variable `default_filter_index'.
94
95 * macmenu.c (min_menu_id): Make element type explicit.
96
97 * macselect.c (get_flavor_type_from_symbol): Remove unused
98 variable `val'.
99 (get_scrap_private_timestamp, x_get_foreign_selection)
100 (copy_scrap_flavor_data): Add explicit braces to avoid ambiguous `else'.
101 (Fmac_process_deferred_apple_events): Remove unused variables
102 `keyword', `reply', `apple_event', `count', and `err'.
103
104 * macterm.c: Don't include gnu.h.
105 (x_io_error_quitter, x_draw_image_foreground_1): Remove prototypes.
106 (x_sync): Move to macfns.c.
107 [USE_CG_DRAWING] (mac_define_fringe_bitmap): Remove unused
108 variable `mask_bits'.
109 (mac_compute_glyph_string_overhangs): Avoid ambiguous `else'.
110 (x_draw_image_glyph_string): Remove unused variable `pixmap'.
111 (x_mac_to_emacs_modifiers): Remove function.
112 (XTset_vertical_scroll_bar, mac_handle_visibility_change)
113 (x_make_frame_visible, xlfdpat_create, mac_handle_command_event):
114 Add explicit braces to avoid ambiguous `else'.
115 (x_make_frame_visible): Remove unused variables `type',
116 `original_top', and `original_left'.
117 (mac_do_list_fonts, XTread_socket): Add parentheses around && within ||.
118 (x_load_font): Remove unused variables `full_name', and `value'.
119 (do_get_menus, do_init_managers, do_check_ram_size) [!MAC_OS8]:
120 Remove functions.
121 (do_zoom_window): Reorganize variables with respect to conditionals.
122 (init_command_handler): Remove unused variable `err'.
123 [MAC_OSX] (mac_check_bundle): Remove unused variable `child'.
124
125 * macterm.h (x_set_mouse_position, x_set_mouse_pixel_position)
126 (x_make_frame_invisible, x_iconify_frame, x_free_frame_resources)
127 (x_destroy_window, x_wm_set_size_hint, x_delete_display, XFreeGC)
128 (do_menu_choice, have_menus_p, x_real_positions)
129 (x_set_menu_bar_lines, x_pixel_width, x_pixel_height, x_char_width)
130 (x_char_height, x_sync, x_set_tool_bar_lines, x_activate_menubar)
131 (free_frame_menubar): Add externs.
132
133 * unexmacosx.c: Include config.h before using HAVE_MALLOC_MALLOC_H.
134 (malloc, realloc, free): Add undefs.
135 (read_load_commands): Remove unused variable `n' and `j'.
136 (copy_data_segment): Remove unused variable `r'.
137
138 * xdisp.c (get_glyph_string_clip_rects): Add parentheses around &&
139 within ||. Add explicit braces to avoid ambiguous `else'.
140 (dump_glyph_row): Remove label for `inverse_p' from legend.
141
142 * xfaces.c (Finternal_merge_in_global_face, try_font_list): Add
143 explicit braces to avoid ambiguous `else'.
144
1452006-04-11 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> (tiny change)
146
147 * dispnew.c (init_display): Don't init X display if the user asked
148 for a non-X display.
149
1502006-04-12 Kenichi Handa <handa@m17n.org>
151
152 * coding.c (setup_coding_system): Use system_eol_type for default
153 coding->eol_type.
154
1552006-04-11 Dan Nicolaescu <dann@ics.uci.edu>
156
157 * lisp.h (wrong_type_argument): Mark as NO_RETURN.
158
159 * data.c (wrong_type_argument): Try to avoid compiler warnings due
160 to the fact the function is now marked as NO_RETURN.
161
1622006-04-10 Eli Zaretskii <eliz@gnu.org>
163
164 * s/ms-w32.h (pid_t) [_MSC_VER]: New typedef.
165
1662006-04-10 Romain Francoise <romain@orebokech.com>
167
168 * xrdb.c (gethomedir): Use xstrdup.
169
1702006-04-10 Andreas Schwab <schwab@suse.de>
171
172 * xrdb.c (gethomedir): Make sure to always return a pointer that
173 can be passed to free.
174
1752006-04-09 Richard Stallman <rms@gnu.org>
176
177 * lisp.h (Fkill_emacs): Undo previous change.
178
1792006-04-08 Richard Stallman <rms@gnu.org>
180
181 * search.c (boyer_moore): Test ch >= 0400, not >.
182
1832006-04-09 Dan Nicolaescu <dann@ics.uci.edu>
184
185 * puresize.h (pure_write_error): Mark as NO_RETURN.
186
187 * lisp.h (args_out_of_range, args_out_of_range_3)
188
12006-04-08 Eli Zaretskii <eliz@gnu.org> 1892006-04-08 Eli Zaretskii <eliz@gnu.org>
2 190
3 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements 191 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements
diff --git a/src/data.c b/src/data.c
index 8e7f5d20542..ec9a176f078 100644
--- a/src/data.c
+++ b/src/data.c
@@ -125,7 +125,14 @@ wrong_type_argument (predicate, value)
125 tem = call1 (predicate, value); 125 tem = call1 (predicate, value);
126 } 126 }
127 while (NILP (tem)); 127 while (NILP (tem));
128 /* This function is marked as NO_RETURN, gcc would warn if it has a
129 return statement or if falls off the function. Other compilers
130 warn if no return statement is present. */
131#ifndef __GNUC__
128 return value; 132 return value;
133#else
134 abort ();
135#endif
129} 136}
130 137
131void 138void
diff --git a/src/dispnew.c b/src/dispnew.c
index 297125063c7..2884a687e5f 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6640,7 +6640,7 @@ init_display ()
6640 try to use X, and die with an error message if that doesn't work. */ 6640 try to use X, and die with an error message if that doesn't work. */
6641 6641
6642#ifdef HAVE_X_WINDOWS 6642#ifdef HAVE_X_WINDOWS
6643 if (! display_arg) 6643 if (! inhibit_window_system && ! display_arg)
6644 { 6644 {
6645 char *display; 6645 char *display;
6646#ifdef VMS 6646#ifdef VMS
diff --git a/src/fns.c b/src/fns.c
index c6ae96e8383..2d4c49fbaa2 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -48,8 +48,12 @@ Boston, MA 02110-1301, USA. */
48#include "frame.h" 48#include "frame.h"
49#include "window.h" 49#include "window.h"
50#include "blockinput.h" 50#include "blockinput.h"
51#if defined (HAVE_MENUS) && defined (HAVE_X_WINDOWS) 51#ifdef HAVE_MENUS
52#if defined (HAVE_X_WINDOWS)
52#include "xterm.h" 53#include "xterm.h"
54#elif defined (MAC_OS)
55#include "macterm.h"
56#endif
53#endif 57#endif
54 58
55#ifndef NULL 59#ifndef NULL
diff --git a/src/image.c b/src/image.c
index 6f2e93a591a..91aa1198769 100644
--- a/src/image.c
+++ b/src/image.c
@@ -4379,7 +4379,7 @@ xpm_load_image (f, img, contents, end)
4379 if (color == NULL) 4379 if (color == NULL)
4380 goto failure; 4380 goto failure;
4381 4381
4382 while (str = strtok (NULL, " \t")) 4382 while ((str = strtok (NULL, " \t")) != NULL)
4383 { 4383 {
4384 next_key = xpm_str_to_color_key (str); 4384 next_key = xpm_str_to_color_key (str);
4385 if (next_key >= 0) 4385 if (next_key >= 0)
@@ -4407,17 +4407,21 @@ xpm_load_image (f, img, contents, end)
4407 Lisp_Object specified_color = Fassoc (symbol_color, color_symbols); 4407 Lisp_Object specified_color = Fassoc (symbol_color, color_symbols);
4408 4408
4409 if (CONSP (specified_color) && STRINGP (XCDR (specified_color))) 4409 if (CONSP (specified_color) && STRINGP (XCDR (specified_color)))
4410 if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0) 4410 {
4411 color_val = Qt; 4411 if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0)
4412 else if (x_defined_color (f, SDATA (XCDR (specified_color)), 4412 color_val = Qt;
4413 &cdef, 0)) 4413 else if (x_defined_color (f, SDATA (XCDR (specified_color)),
4414 color_val = make_number (cdef.pixel); 4414 &cdef, 0))
4415 color_val = make_number (cdef.pixel);
4416 }
4415 } 4417 }
4416 if (NILP (color_val) && max_key > 0) 4418 if (NILP (color_val) && max_key > 0)
4417 if (xstricmp (max_color, "None") == 0) 4419 {
4418 color_val = Qt; 4420 if (xstricmp (max_color, "None") == 0)
4419 else if (x_defined_color (f, max_color, &cdef, 0)) 4421 color_val = Qt;
4420 color_val = make_number (cdef.pixel); 4422 else if (x_defined_color (f, max_color, &cdef, 0))
4423 color_val = make_number (cdef.pixel);
4424 }
4421 if (!NILP (color_val)) 4425 if (!NILP (color_val))
4422 (*put_color_table) (color_table, beg, chars_per_pixel, color_val); 4426 (*put_color_table) (color_table, beg, chars_per_pixel, color_val);
4423 4427
@@ -7846,7 +7850,6 @@ gif_load (f, img)
7846 int width, height; 7850 int width, height;
7847 XImagePtr ximg; 7851 XImagePtr ximg;
7848 TimeValue time; 7852 TimeValue time;
7849 struct gcpro gcpro1;
7850 int ino; 7853 int ino;
7851 CGrafPtr old_port; 7854 CGrafPtr old_port;
7852 GDHandle old_gdh; 7855 GDHandle old_gdh;
diff --git a/src/keyboard.c b/src/keyboard.c
index 2729ae878a9..e3a77653ed6 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1418,7 +1418,7 @@ command_loop_1 ()
1418 Lisp_Object keybuf[30]; 1418 Lisp_Object keybuf[30];
1419 int i; 1419 int i;
1420 int no_direct; 1420 int no_direct;
1421 int prev_modiff; 1421 int prev_modiff = 0;
1422 struct buffer *prev_buffer = NULL; 1422 struct buffer *prev_buffer = NULL;
1423#ifdef MULTI_KBOARD 1423#ifdef MULTI_KBOARD
1424 int was_locked = single_kboard; 1424 int was_locked = single_kboard;
@@ -9478,6 +9478,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
9478 /* Don't downcase the last character if the caller says don't. 9478 /* Don't downcase the last character if the caller says don't.
9479 Don't downcase it if the result is undefined, either. */ 9479 Don't downcase it if the result is undefined, either. */
9480 if ((dont_downcase_last || first_binding >= nmaps) 9480 if ((dont_downcase_last || first_binding >= nmaps)
9481 && t > 0
9481 && t - 1 == original_uppercase_position) 9482 && t - 1 == original_uppercase_position)
9482 keybuf[t - 1] = original_uppercase; 9483 keybuf[t - 1] = original_uppercase;
9483 9484
diff --git a/src/lisp.h b/src/lisp.h
index 2356c40b731..0792bdf89b0 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2253,9 +2253,10 @@ EXFUN (Fmake_variable_buffer_local, 1);
2253extern Lisp_Object indirect_variable P_ ((Lisp_Object)); 2253extern Lisp_Object indirect_variable P_ ((Lisp_Object));
2254extern Lisp_Object long_to_cons P_ ((unsigned long)); 2254extern Lisp_Object long_to_cons P_ ((unsigned long));
2255extern unsigned long cons_to_long P_ ((Lisp_Object)); 2255extern unsigned long cons_to_long P_ ((Lisp_Object));
2256extern void args_out_of_range P_ ((Lisp_Object, Lisp_Object)); 2256extern void args_out_of_range P_ ((Lisp_Object, Lisp_Object)) NO_RETURN;
2257extern void args_out_of_range_3 P_ ((Lisp_Object, Lisp_Object, Lisp_Object)); 2257extern void args_out_of_range_3 P_ ((Lisp_Object, Lisp_Object,
2258extern Lisp_Object wrong_type_argument P_ ((Lisp_Object, Lisp_Object)); 2258 Lisp_Object)) NO_RETURN;
2259extern Lisp_Object wrong_type_argument P_ ((Lisp_Object, Lisp_Object)) NO_RETURN;
2259extern void store_symval_forwarding P_ ((Lisp_Object, Lisp_Object, 2260extern void store_symval_forwarding P_ ((Lisp_Object, Lisp_Object,
2260 Lisp_Object, struct buffer *)); 2261 Lisp_Object, struct buffer *));
2261extern Lisp_Object do_symval_forwarding P_ ((Lisp_Object)); 2262extern Lisp_Object do_symval_forwarding P_ ((Lisp_Object));
@@ -3235,11 +3236,15 @@ extern void syms_of_dired P_ ((void));
3235extern void syms_of_term P_ ((void)); 3236extern void syms_of_term P_ ((void));
3236extern void fatal () NO_RETURN; 3237extern void fatal () NO_RETURN;
3237 3238
3238#ifdef HAVE_X_WINDOWS 3239#ifdef HAVE_WINDOW_SYSTEM
3239/* Defined in fontset.c */ 3240/* Defined in fontset.c */
3240extern void syms_of_fontset P_ ((void)); 3241extern void syms_of_fontset P_ ((void));
3241EXFUN (Fset_fontset_font, 5); 3242EXFUN (Fset_fontset_font, 5);
3242EXFUN (Fnew_fontset, 2); 3243EXFUN (Fnew_fontset, 2);
3244
3245/* Defined in xfns.c, w32fns.c, or macfns.c */
3246EXFUN (Fxw_display_color_p, 1);
3247EXFUN (Fx_file_dialog, 5);
3243#endif 3248#endif
3244 3249
3245/* Defined in xfaces.c */ 3250/* Defined in xfaces.c */
@@ -3253,12 +3258,6 @@ extern int getloadavg P_ ((double *, int));
3253#ifdef HAVE_X_WINDOWS 3258#ifdef HAVE_X_WINDOWS
3254/* Defined in xfns.c */ 3259/* Defined in xfns.c */
3255extern void syms_of_xfns P_ ((void)); 3260extern void syms_of_xfns P_ ((void));
3256#endif /* HAVE_X_WINDOWS */
3257#ifdef HAVE_WINDOW_SYSTEM
3258/* Defined in xfns.c, w32fns.c, or macfns.c */
3259EXFUN (Fxw_display_color_p, 1);
3260EXFUN (Fx_file_dialog, 5);
3261#endif /* HAVE_WINDOW_SYSTEM */
3262 3261
3263/* Defined in xsmfns.c */ 3262/* Defined in xsmfns.c */
3264extern void syms_of_xsmfns P_ ((void)); 3263extern void syms_of_xsmfns P_ ((void));
@@ -3268,11 +3267,32 @@ extern void syms_of_xselect P_ ((void));
3268 3267
3269/* Defined in xterm.c */ 3268/* Defined in xterm.c */
3270extern void syms_of_xterm P_ ((void)); 3269extern void syms_of_xterm P_ ((void));
3270#endif /* HAVE_X_WINDOWS */
3271 3271
3272#ifdef MSDOS 3272#ifdef MSDOS
3273/* Defined in msdos.c */ 3273/* Defined in msdos.c */
3274EXFUN (Fmsdos_downcase_filename, 1); 3274EXFUN (Fmsdos_downcase_filename, 1);
3275#endif 3275#endif
3276
3277#ifdef MAC_OS
3278/* Defined in macfns.c */
3279extern void syms_of_macfns P_ ((void));
3280
3281/* Defined in macselect.c */
3282extern void syms_of_macselect P_ ((void));
3283
3284/* Defined in macterm.c */
3285extern void syms_of_macterm P_ ((void));
3286
3287/* Defined in macmenu.c */
3288extern void syms_of_macmenu P_ ((void));
3289
3290/* Defined in mac.c */
3291extern void syms_of_mac P_ ((void));
3292#ifdef MAC_OSX
3293extern void init_mac_osx_environment P_ ((void));
3294#endif /* MAC_OSX */
3295#endif /* MAC_OS */
3276 3296
3277/* Nonzero means Emacs has already been initialized. 3297/* Nonzero means Emacs has already been initialized.
3278 Used during startup to detect startup of dumped Emacs. */ 3298 Used during startup to detect startup of dumped Emacs. */
diff --git a/src/mac.c b/src/mac.c
index 40bbacf15ce..2b4e8dcbc64 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -28,7 +28,9 @@ Boston, MA 02110-1301, USA. */
28 28
29#include "lisp.h" 29#include "lisp.h"
30#include "process.h" 30#include "process.h"
31#undef init_process 31#ifdef MAC_OSX
32#undef select
33#endif
32#include "systime.h" 34#include "systime.h"
33#include "sysselect.h" 35#include "sysselect.h"
34#include "blockinput.h" 36#include "blockinput.h"
@@ -79,8 +81,10 @@ static ComponentInstance as_scripting_component;
79/* The single script context used for all script executions. */ 81/* The single script context used for all script executions. */
80static OSAID as_script_context; 82static OSAID as_script_context;
81 83
84#ifndef MAC_OSX
82static OSErr posix_pathname_to_fsspec P_ ((const char *, FSSpec *)); 85static OSErr posix_pathname_to_fsspec P_ ((const char *, FSSpec *));
83static OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *, int)); 86static OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *, int));
87#endif
84 88
85/* When converting from Mac to Unix pathnames, /'s in folder names are 89/* When converting from Mac to Unix pathnames, /'s in folder names are
86 converted to :'s. This function, used in copying folder names, 90 converted to :'s. This function, used in copying folder names,
@@ -1222,7 +1226,7 @@ parse_value (p)
1222 && '0' <= P[1] && P[1] <= '7' 1226 && '0' <= P[1] && P[1] <= '7'
1223 && '0' <= P[2] && P[2] <= '7') 1227 && '0' <= P[2] && P[2] <= '7')
1224 { 1228 {
1225 *q++ = (P[0] - '0' << 6) + (P[1] - '0' << 3) + (P[2] - '0'); 1229 *q++ = ((P[0] - '0') << 6) + ((P[1] - '0') << 3) + (P[2] - '0');
1226 P += 3; 1230 P += 3;
1227 } 1231 }
1228 else 1232 else
@@ -2789,7 +2793,7 @@ link (const char *name1, const char *name2)
2789/* Determine the path name of the file specified by VREFNUM, DIRID, 2793/* Determine the path name of the file specified by VREFNUM, DIRID,
2790 and NAME and place that in the buffer PATH of length 2794 and NAME and place that in the buffer PATH of length
2791 MAXPATHLEN. */ 2795 MAXPATHLEN. */
2792int 2796static int
2793path_from_vol_dir_name (char *path, int man_path_len, short vol_ref_num, 2797path_from_vol_dir_name (char *path, int man_path_len, short vol_ref_num,
2794 long dir_id, ConstStr255Param name) 2798 long dir_id, ConstStr255Param name)
2795{ 2799{
@@ -2834,6 +2838,8 @@ path_from_vol_dir_name (char *path, int man_path_len, short vol_ref_num,
2834} 2838}
2835 2839
2836 2840
2841#ifndef MAC_OSX
2842
2837static OSErr 2843static OSErr
2838posix_pathname_to_fsspec (ufn, fs) 2844posix_pathname_to_fsspec (ufn, fs)
2839 const char *ufn; 2845 const char *ufn;
@@ -2866,8 +2872,6 @@ fsspec_to_posix_pathname (fs, ufn, ufnbuflen)
2866 return fnfErr; 2872 return fnfErr;
2867} 2873}
2868 2874
2869#ifndef MAC_OSX
2870
2871int 2875int
2872readlink (const char *path, char *buf, int bufsiz) 2876readlink (const char *path, char *buf, int bufsiz)
2873{ 2877{
@@ -3124,8 +3128,7 @@ get_temp_dir_name ()
3124 short vol_ref_num; 3128 short vol_ref_num;
3125 long dir_id; 3129 long dir_id;
3126 OSErr err; 3130 OSErr err;
3127 Str255 dir_name, full_path; 3131 Str255 full_path;
3128 CInfoPBRec cpb;
3129 char unix_dir_name[MAXPATHLEN+1]; 3132 char unix_dir_name[MAXPATHLEN+1];
3130 DIR *dir; 3133 DIR *dir;
3131 3134
@@ -3217,8 +3220,7 @@ get_path_to_system_folder ()
3217 short vol_ref_num; 3220 short vol_ref_num;
3218 long dir_id; 3221 long dir_id;
3219 OSErr err; 3222 OSErr err;
3220 Str255 dir_name, full_path; 3223 Str255 full_path;
3221 CInfoPBRec cpb;
3222 static char system_folder_unix_name[MAXPATHLEN+1]; 3224 static char system_folder_unix_name[MAXPATHLEN+1];
3223 DIR *dir; 3225 DIR *dir;
3224 3226
@@ -3947,7 +3949,6 @@ DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 1,
3947#else 3949#else
3948 FSSpec fss; 3950 FSSpec fss;
3949#endif 3951#endif
3950 OSType cCode;
3951 Lisp_Object result = Qnil; 3952 Lisp_Object result = Qnil;
3952 CHECK_STRING (filename); 3953 CHECK_STRING (filename);
3953 3954
@@ -4002,7 +4003,6 @@ DEFUN ("mac-get-file-type", Fmac_get_file_type, Smac_get_file_type, 1, 1, 0,
4002#else 4003#else
4003 FSSpec fss; 4004 FSSpec fss;
4004#endif 4005#endif
4005 OSType cCode;
4006 Lisp_Object result = Qnil; 4006 Lisp_Object result = Qnil;
4007 CHECK_STRING (filename); 4007 CHECK_STRING (filename);
4008 4008
@@ -4296,11 +4296,6 @@ Each type should be a string of length 4 or the symbol
4296 Lisp_Object result = Qnil; 4296 Lisp_Object result = Qnil;
4297 DescType src_desc_type, dst_desc_type; 4297 DescType src_desc_type, dst_desc_type;
4298 AEDesc dst_desc; 4298 AEDesc dst_desc;
4299#ifdef MAC_OSX
4300 FSRef fref;
4301#else
4302 FSSpec fs;
4303#endif
4304 4299
4305 CHECK_STRING (src_data); 4300 CHECK_STRING (src_data);
4306 if (EQ (src_type, Qundecoded_file_name)) 4301 if (EQ (src_type, Qundecoded_file_name))
@@ -4422,18 +4417,20 @@ otherwise. */)
4422 } 4417 }
4423 4418
4424 if (NILP (key)) 4419 if (NILP (key))
4425 if (EQ (format, Qxml)) 4420 {
4426 { 4421 if (EQ (format, Qxml))
4427 CFDataRef data = CFPropertyListCreateXMLData (NULL, plist); 4422 {
4428 if (data == NULL) 4423 CFDataRef data = CFPropertyListCreateXMLData (NULL, plist);
4429 goto out; 4424 if (data == NULL)
4430 result = cfdata_to_lisp (data); 4425 goto out;
4431 CFRelease (data); 4426 result = cfdata_to_lisp (data);
4432 } 4427 CFRelease (data);
4433 else 4428 }
4434 result = 4429 else
4435 cfproperty_list_to_lisp (plist, EQ (format, Qt), 4430 result =
4436 NILP (hash_bound) ? -1 : XINT (hash_bound)); 4431 cfproperty_list_to_lisp (plist, EQ (format, Qt),
4432 NILP (hash_bound) ? -1 : XINT (hash_bound));
4433 }
4437 4434
4438 out: 4435 out:
4439 if (app_plist) 4436 if (app_plist)
@@ -4701,7 +4698,6 @@ mac_get_system_locale ()
4701 4698
4702 4699
4703#ifdef MAC_OSX 4700#ifdef MAC_OSX
4704#undef select
4705 4701
4706extern int inhibit_window_system; 4702extern int inhibit_window_system;
4707extern int noninteractive; 4703extern int noninteractive;
diff --git a/src/macfns.c b/src/macfns.c
index a890a67b5a8..f4cfd61acb3 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -1024,7 +1024,7 @@ Lisp_Object
1024x_to_mac_color (colorname) 1024x_to_mac_color (colorname)
1025 char * colorname; 1025 char * colorname;
1026{ 1026{
1027 register Lisp_Object tail, ret = Qnil; 1027 register Lisp_Object ret = Qnil;
1028 1028
1029 BLOCK_INPUT; 1029 BLOCK_INPUT;
1030 1030
@@ -1359,7 +1359,6 @@ x_set_mouse_color (f, arg, oldval)
1359 Lisp_Object arg, oldval; 1359 Lisp_Object arg, oldval;
1360{ 1360{
1361 struct x_output *x = f->output_data.x; 1361 struct x_output *x = f->output_data.x;
1362 Display *dpy = FRAME_MAC_DISPLAY (f);
1363 Cursor cursor, nontext_cursor, mode_cursor, hand_cursor; 1362 Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
1364 Cursor hourglass_cursor, horizontal_drag_cursor; 1363 Cursor hourglass_cursor, horizontal_drag_cursor;
1365 unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f)); 1364 unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
@@ -2387,7 +2386,6 @@ This function is an internal primitive--use `make-frame' instead. */)
2387 struct mac_display_info *dpyinfo = NULL; 2386 struct mac_display_info *dpyinfo = NULL;
2388 Lisp_Object parent; 2387 Lisp_Object parent;
2389 struct kboard *kb; 2388 struct kboard *kb;
2390 static int x_frame_count = 2; /* begins at 2 because terminal frame is F1 */
2391 2389
2392 check_mac (); 2390 check_mac ();
2393 2391
@@ -2910,23 +2908,25 @@ If omitted or nil, that stands for the selected frame's display. */)
2910 BLOCK_INPUT; 2908 BLOCK_INPUT;
2911 err = Gestalt (gestaltSystemVersion, &response); 2909 err = Gestalt (gestaltSystemVersion, &response);
2912 if (err == noErr) 2910 if (err == noErr)
2913 if (response >= 0x00001040) 2911 {
2914 { 2912 if (response >= 0x00001040)
2915 err = Gestalt ('sys1', &major); /* gestaltSystemVersionMajor */ 2913 {
2916 if (err == noErr) 2914 err = Gestalt ('sys1', &major); /* gestaltSystemVersionMajor */
2917 err = Gestalt ('sys2', &minor); /* gestaltSystemVersionMinor */ 2915 if (err == noErr)
2918 if (err == noErr) 2916 err = Gestalt ('sys2', &minor); /* gestaltSystemVersionMinor */
2919 err = Gestalt ('sys3', &bugfix); /* gestaltSystemVersionBugFix */ 2917 if (err == noErr)
2920 } 2918 err = Gestalt ('sys3', &bugfix); /* gestaltSystemVersionBugFix */
2921 else 2919 }
2922 { 2920 else
2923 bugfix = response & 0xf; 2921 {
2924 response >>= 4; 2922 bugfix = response & 0xf;
2925 minor = response & 0xf; 2923 response >>= 4;
2926 response >>= 4; 2924 minor = response & 0xf;
2927 /* convert BCD to int */ 2925 response >>= 4;
2928 major = response - (response >> 4) * 6; 2926 /* convert BCD to int */
2929 } 2927 major = response - (response >> 4) * 6;
2928 }
2929 }
2930 UNBLOCK_INPUT; 2930 UNBLOCK_INPUT;
2931 2931
2932 if (err != noErr) 2932 if (err != noErr)
@@ -3210,6 +3210,14 @@ DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0,
3210 return Qnil; 3210 return Qnil;
3211} 3211}
3212 3212
3213/* x_sync is a no-op on Mac. */
3214
3215void
3216x_sync (f)
3217 FRAME_PTR f;
3218{
3219}
3220
3213 3221
3214/*********************************************************************** 3222/***********************************************************************
3215 Window properties 3223 Window properties
@@ -4187,7 +4195,6 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
4187 int count = SPECPDL_INDEX (); 4195 int count = SPECPDL_INDEX ();
4188 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6; 4196 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
4189 char filename[MAXPATHLEN]; 4197 char filename[MAXPATHLEN];
4190 int default_filter_index = 1; /* 1: All Files, 2: Directories only */
4191 static NavEventUPP mac_nav_event_callbackUPP = NULL; 4198 static NavEventUPP mac_nav_event_callbackUPP = NULL;
4192 4199
4193 GCPRO6 (prompt, dir, default_filename, mustmatch, file, only_dir_p); 4200 GCPRO6 (prompt, dir, default_filename, mustmatch, file, only_dir_p);
diff --git a/src/macmenu.c b/src/macmenu.c
index 8610ecafd94..29233ec0d64 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -72,7 +72,7 @@ enum mac_menu_kind { /* Menu ID range */
72 MAC_MENU_END /* 32768 */ 72 MAC_MENU_END /* 32768 */
73}; 73};
74 74
75static const min_menu_id[] = {0, 1, 235, 236, 256, 16384, 32768}; 75static const int min_menu_id[] = {0, 1, 235, 236, 256, 16384, 32768};
76 76
77#define DIALOG_WINDOW_RESOURCE 130 77#define DIALOG_WINDOW_RESOURCE 130
78 78
diff --git a/src/macselect.c b/src/macselect.c
index 066892adce0..8312197181f 100644
--- a/src/macselect.c
+++ b/src/macselect.c
@@ -153,7 +153,6 @@ static ScrapFlavorType
153get_flavor_type_from_symbol (sym) 153get_flavor_type_from_symbol (sym)
154 Lisp_Object sym; 154 Lisp_Object sym;
155{ 155{
156 ScrapFlavorType val;
157 Lisp_Object str = Fget (sym, Qmac_ostype); 156 Lisp_Object str = Fget (sym, Qmac_ostype);
158 157
159 if (STRINGP (str) && SBYTES (str) == 4) 158 if (STRINGP (str) && SBYTES (str) == 4)
@@ -322,17 +321,19 @@ get_scrap_private_timestamp (scrap, timestamp)
322 321
323 err = GetScrapFlavorFlags (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &flags); 322 err = GetScrapFlavorFlags (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, &flags);
324 if (err == noErr) 323 if (err == noErr)
325 if (!(flags & kScrapFlavorMaskSenderOnly)) 324 {
326 err = noTypeErr; 325 if (!(flags & kScrapFlavorMaskSenderOnly))
327 else 326 err = noTypeErr;
328 { 327 else
329 Size size = sizeof (*timestamp); 328 {
329 Size size = sizeof (*timestamp);
330 330
331 err = GetScrapFlavorData (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP, 331 err = GetScrapFlavorData (scrap, SCRAP_FLAVOR_TYPE_EMACS_TIMESTAMP,
332 &size, timestamp); 332 &size, timestamp);
333 if (err == noErr && size != sizeof (*timestamp)) 333 if (err == noErr && size != sizeof (*timestamp))
334 err = noTypeErr; 334 err = noTypeErr;
335 } 335 }
336 }
336#else /* !TARGET_API_MAC_CARBON */ 337#else /* !TARGET_API_MAC_CARBON */
337 Handle handle; 338 Handle handle;
338 SInt32 size, offset; 339 SInt32 size, offset;
@@ -683,18 +684,20 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp)
683 684
684 err = get_scrap_from_symbol (selection_symbol, 0, &scrap); 685 err = get_scrap_from_symbol (selection_symbol, 0, &scrap);
685 if (err == noErr && scrap) 686 if (err == noErr && scrap)
686 if (EQ (target_type, QTARGETS)) 687 {
687 { 688 if (EQ (target_type, QTARGETS))
688 result = get_scrap_target_type_list (scrap); 689 {
689 result = Fvconcat (1, &result); 690 result = get_scrap_target_type_list (scrap);
690 } 691 result = Fvconcat (1, &result);
691 else 692 }
692 { 693 else
693 result = get_scrap_string (scrap, target_type); 694 {
694 if (STRINGP (result)) 695 result = get_scrap_string (scrap, target_type);
695 Fput_text_property (make_number (0), make_number (SBYTES (result)), 696 if (STRINGP (result))
696 Qforeign_selection, target_type, result); 697 Fput_text_property (make_number (0), make_number (SBYTES (result)),
697 } 698 Qforeign_selection, target_type, result);
699 }
700 }
698 701
699 UNBLOCK_INPUT; 702 UNBLOCK_INPUT;
700 703
@@ -1009,7 +1012,7 @@ defer_apple_events (apple_event, reply)
1009 /* Mac OS 10.3 Xcode manual says AESuspendTheCurrentEvent makes 1012 /* Mac OS 10.3 Xcode manual says AESuspendTheCurrentEvent makes
1010 copies of the Apple event and the reply, but Mac OS 10.4 Xcode 1013 copies of the Apple event and the reply, but Mac OS 10.4 Xcode
1011 manual says it doesn't. Anyway we create copies of them and save 1014 manual says it doesn't. Anyway we create copies of them and save
1012 it in `deferred_apple_events'. */ 1015 them in `deferred_apple_events'. */
1013 if (err == noErr) 1016 if (err == noErr)
1014 { 1017 {
1015 if (deferred_apple_events.buf == NULL) 1018 if (deferred_apple_events.buf == NULL)
@@ -1123,11 +1126,8 @@ DEFUN ("mac-process-deferred-apple-events", Fmac_process_deferred_apple_events,
1123 doc: /* Process Apple events that are deferred at the startup time. */) 1126 doc: /* Process Apple events that are deferred at the startup time. */)
1124 () 1127 ()
1125{ 1128{
1126 OSErr err;
1127 Lisp_Object result = Qnil; 1129 Lisp_Object result = Qnil;
1128 long i, count; 1130 long i;
1129 AppleEvent apple_event, reply;
1130 AEKeyword keyword;
1131 1131
1132 if (mac_ready_for_apple_events) 1132 if (mac_ready_for_apple_events)
1133 return Qnil; 1133 return Qnil;
@@ -1207,14 +1207,16 @@ copy_scrap_flavor_data (from_scrap, to_scrap, flavor_type)
1207 break; 1207 break;
1208 } 1208 }
1209 if (err == noErr) 1209 if (err == noErr)
1210 if (buf == NULL) 1210 {
1211 err = memFullErr; 1211 if (buf == NULL)
1212 else 1212 err = memFullErr;
1213 { 1213 else
1214 err = PutScrapFlavor (to_scrap, flavor_type, kScrapFlavorMaskNone, 1214 {
1215 size, buf); 1215 err = PutScrapFlavor (to_scrap, flavor_type, kScrapFlavorMaskNone,
1216 xfree (buf); 1216 size, buf);
1217 } 1217 xfree (buf);
1218 }
1219 }
1218 1220
1219 return err; 1221 return err;
1220} 1222}
diff --git a/src/macterm.c b/src/macterm.c
index 472fe3d28c8..5c3787c2a51 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -77,7 +77,6 @@ Boston, MA 02110-1301, USA. */
77#include "termhooks.h" 77#include "termhooks.h"
78#include "termopts.h" 78#include "termopts.h"
79#include "termchar.h" 79#include "termchar.h"
80#include "gnu.h"
81#include "disptab.h" 80#include "disptab.h"
82#include "buffer.h" 81#include "buffer.h"
83#include "window.h" 82#include "window.h"
@@ -217,7 +216,6 @@ QDGlobals qd; /* QuickDraw global information structure. */
217 216
218struct mac_display_info *mac_display_info_for_display (Display *); 217struct mac_display_info *mac_display_info_for_display (Display *);
219static void x_update_window_end P_ ((struct window *, int, int)); 218static void x_update_window_end P_ ((struct window *, int, int));
220static int x_io_error_quitter P_ ((Display *));
221int x_catch_errors P_ ((Display *)); 219int x_catch_errors P_ ((Display *));
222void x_uncatch_errors P_ ((Display *, int)); 220void x_uncatch_errors P_ ((Display *, int));
223void x_lower_frame P_ ((struct frame *)); 221void x_lower_frame P_ ((struct frame *));
@@ -1699,14 +1697,6 @@ XSetWindowBackground (display, w, color)
1699#endif 1697#endif
1700} 1698}
1701 1699
1702/* x_sync is a no-op on Mac. */
1703void
1704x_sync (f)
1705 void *f;
1706{
1707}
1708
1709
1710/* Flush display of frame F, or of all frames if F is null. */ 1700/* Flush display of frame F, or of all frames if F is null. */
1711 1701
1712static void 1702static void
@@ -2082,7 +2072,6 @@ mac_define_fringe_bitmap (which, bits, h, wd)
2082 unsigned short *bits; 2072 unsigned short *bits;
2083 int h, wd; 2073 int h, wd;
2084{ 2074{
2085 unsigned short *mask_bits;
2086 int i; 2075 int i;
2087 CGDataProviderRef provider; 2076 CGDataProviderRef provider;
2088 2077
@@ -2368,7 +2357,6 @@ static void x_setup_relief_colors P_ ((struct glyph_string *));
2368static void x_draw_image_glyph_string P_ ((struct glyph_string *)); 2357static void x_draw_image_glyph_string P_ ((struct glyph_string *));
2369static void x_draw_image_relief P_ ((struct glyph_string *)); 2358static void x_draw_image_relief P_ ((struct glyph_string *));
2370static void x_draw_image_foreground P_ ((struct glyph_string *)); 2359static void x_draw_image_foreground P_ ((struct glyph_string *));
2371static void x_draw_image_foreground_1 P_ ((struct glyph_string *, Pixmap));
2372static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int, 2360static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int,
2373 int, int, int)); 2361 int, int, int));
2374static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int, 2362static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int,
@@ -2569,34 +2557,36 @@ static void
2569mac_compute_glyph_string_overhangs (s) 2557mac_compute_glyph_string_overhangs (s)
2570 struct glyph_string *s; 2558 struct glyph_string *s;
2571{ 2559{
2572 if (s->cmp == NULL 2560 if (!(s->cmp == NULL
2573 && s->first_glyph->type == CHAR_GLYPH) 2561 && s->first_glyph->type == CHAR_GLYPH))
2574 if (!s->two_byte_p 2562 return;
2563
2564 if (!s->two_byte_p
2575#if USE_ATSUI 2565#if USE_ATSUI
2576 || s->font->mac_style 2566 || s->font->mac_style
2577#endif 2567#endif
2578 ) 2568 )
2579 { 2569 {
2580 XCharStruct cs; 2570 XCharStruct cs;
2581 2571
2582 mac_text_extents_16 (s->font, s->char2b, s->nchars, &cs); 2572 mac_text_extents_16 (s->font, s->char2b, s->nchars, &cs);
2583 s->right_overhang = cs.rbearing > cs.width ? cs.rbearing - cs.width : 0; 2573 s->right_overhang = cs.rbearing > cs.width ? cs.rbearing - cs.width : 0;
2584 s->left_overhang = cs.lbearing < 0 ? -cs.lbearing : 0; 2574 s->left_overhang = cs.lbearing < 0 ? -cs.lbearing : 0;
2585 } 2575 }
2586 else 2576 else
2587 { 2577 {
2588 Rect r; 2578 Rect r;
2589 MacFontStruct *font = s->font; 2579 MacFontStruct *font = s->font;
2590 2580
2591 TextFont (font->mac_fontnum); 2581 TextFont (font->mac_fontnum);
2592 TextSize (font->mac_fontsize); 2582 TextSize (font->mac_fontsize);
2593 TextFace (font->mac_fontface); 2583 TextFace (font->mac_fontface);
2594 2584
2595 QDTextBounds (s->nchars * 2, (char *)s->char2b, &r); 2585 QDTextBounds (s->nchars * 2, (char *)s->char2b, &r);
2596 2586
2597 s->right_overhang = r.right > s->width ? r.right - s->width : 0; 2587 s->right_overhang = r.right > s->width ? r.right - s->width : 0;
2598 s->left_overhang = r.left < 0 ? -r.left : 0; 2588 s->left_overhang = r.left < 0 ? -r.left : 0;
2599 } 2589 }
2600} 2590}
2601 2591
2602 2592
@@ -3432,7 +3422,6 @@ x_draw_image_glyph_string (s)
3432 int box_line_hwidth = abs (s->face->box_line_width); 3422 int box_line_hwidth = abs (s->face->box_line_width);
3433 int box_line_vwidth = max (s->face->box_line_width, 0); 3423 int box_line_vwidth = max (s->face->box_line_width, 0);
3434 int height; 3424 int height;
3435 Pixmap pixmap = 0;
3436 3425
3437 height = s->height - 2 * box_line_vwidth; 3426 height = s->height - 2 * box_line_vwidth;
3438 3427
@@ -4178,142 +4167,6 @@ x_frame_rehighlight (dpyinfo)
4178 4167
4179 4168
4180 4169
4181/* Keyboard processing - modifier keys, vendor-specific keysyms, etc. */
4182
4183#if 0 /* MAC_TODO */
4184/* Initialize mode_switch_bit and modifier_meaning. */
4185static void
4186x_find_modifier_meanings (dpyinfo)
4187 struct x_display_info *dpyinfo;
4188{
4189 int min_code, max_code;
4190 KeySym *syms;
4191 int syms_per_code;
4192 XModifierKeymap *mods;
4193
4194 dpyinfo->meta_mod_mask = 0;
4195 dpyinfo->shift_lock_mask = 0;
4196 dpyinfo->alt_mod_mask = 0;
4197 dpyinfo->super_mod_mask = 0;
4198 dpyinfo->hyper_mod_mask = 0;
4199
4200#ifdef HAVE_X11R4
4201 XDisplayKeycodes (dpyinfo->display, &min_code, &max_code);
4202#else
4203 min_code = dpyinfo->display->min_keycode;
4204 max_code = dpyinfo->display->max_keycode;
4205#endif
4206
4207 syms = XGetKeyboardMapping (dpyinfo->display,
4208 min_code, max_code - min_code + 1,
4209 &syms_per_code);
4210 mods = XGetModifierMapping (dpyinfo->display);
4211
4212 /* Scan the modifier table to see which modifier bits the Meta and
4213 Alt keysyms are on. */
4214 {
4215 int row, col; /* The row and column in the modifier table. */
4216
4217 for (row = 3; row < 8; row++)
4218 for (col = 0; col < mods->max_keypermod; col++)
4219 {
4220 KeyCode code
4221 = mods->modifiermap[(row * mods->max_keypermod) + col];
4222
4223 /* Zeroes are used for filler. Skip them. */
4224 if (code == 0)
4225 continue;
4226
4227 /* Are any of this keycode's keysyms a meta key? */
4228 {
4229 int code_col;
4230
4231 for (code_col = 0; code_col < syms_per_code; code_col++)
4232 {
4233 int sym = syms[((code - min_code) * syms_per_code) + code_col];
4234
4235 switch (sym)
4236 {
4237 case XK_Meta_L:
4238 case XK_Meta_R:
4239 dpyinfo->meta_mod_mask |= (1 << row);
4240 break;
4241
4242 case XK_Alt_L:
4243 case XK_Alt_R:
4244 dpyinfo->alt_mod_mask |= (1 << row);
4245 break;
4246
4247 case XK_Hyper_L:
4248 case XK_Hyper_R:
4249 dpyinfo->hyper_mod_mask |= (1 << row);
4250 break;
4251
4252 case XK_Super_L:
4253 case XK_Super_R:
4254 dpyinfo->super_mod_mask |= (1 << row);
4255 break;
4256
4257 case XK_Shift_Lock:
4258 /* Ignore this if it's not on the lock modifier. */
4259 if ((1 << row) == LockMask)
4260 dpyinfo->shift_lock_mask = LockMask;
4261 break;
4262 }
4263 }
4264 }
4265 }
4266 }
4267
4268 /* If we couldn't find any meta keys, accept any alt keys as meta keys. */
4269 if (! dpyinfo->meta_mod_mask)
4270 {
4271 dpyinfo->meta_mod_mask = dpyinfo->alt_mod_mask;
4272 dpyinfo->alt_mod_mask = 0;
4273 }
4274
4275 /* If some keys are both alt and meta,
4276 make them just meta, not alt. */
4277 if (dpyinfo->alt_mod_mask & dpyinfo->meta_mod_mask)
4278 {
4279 dpyinfo->alt_mod_mask &= ~dpyinfo->meta_mod_mask;
4280 }
4281
4282 XFree ((char *) syms);
4283 XFreeModifiermap (mods);
4284}
4285
4286#endif /* MAC_TODO */
4287
4288/* Convert between the modifier bits X uses and the modifier bits
4289 Emacs uses. */
4290
4291static unsigned int
4292x_mac_to_emacs_modifiers (dpyinfo, state)
4293 struct x_display_info *dpyinfo;
4294 unsigned short state;
4295{
4296 return (((state & shiftKey) ? shift_modifier : 0)
4297 | ((state & controlKey) ? ctrl_modifier : 0)
4298 | ((state & cmdKey) ? meta_modifier : 0)
4299 | ((state & optionKey) ? alt_modifier : 0));
4300}
4301
4302#if 0 /* MAC_TODO */
4303static unsigned short
4304x_emacs_to_x_modifiers (dpyinfo, state)
4305 struct x_display_info *dpyinfo;
4306 unsigned int state;
4307{
4308 return ( ((state & alt_modifier) ? dpyinfo->alt_mod_mask : 0)
4309 | ((state & super_modifier) ? dpyinfo->super_mod_mask : 0)
4310 | ((state & hyper_modifier) ? dpyinfo->hyper_mod_mask : 0)
4311 | ((state & shift_modifier) ? ShiftMask : 0)
4312 | ((state & ctrl_modifier) ? ControlMask : 0)
4313 | ((state & meta_modifier) ? dpyinfo->meta_mod_mask : 0));
4314}
4315#endif /* MAC_TODO */
4316
4317/* Convert a keysym to its name. */ 4170/* Convert a keysym to its name. */
4318 4171
4319char * 4172char *
@@ -5104,41 +4957,43 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
5104 4957
5105#ifdef USE_TOOLKIT_SCROLL_BARS 4958#ifdef USE_TOOLKIT_SCROLL_BARS
5106 if (NILP (bar->track_top)) 4959 if (NILP (bar->track_top))
5107 if (sb_width >= disp_height) 4960 {
5108 { 4961 if (sb_width >= disp_height)
5109 XSETINT (bar->track_top, 0); 4962 {
5110 XSETINT (bar->track_height, 0); 4963 XSETINT (bar->track_top, 0);
5111 } 4964 XSETINT (bar->track_height, 0);
5112 else 4965 }
5113 { 4966 else
5114 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar); 4967 {
5115 Rect r0, r1; 4968 ControlHandle ch = SCROLL_BAR_CONTROL_HANDLE (bar);
4969 Rect r0, r1;
5116 4970
5117 BLOCK_INPUT; 4971 BLOCK_INPUT;
5118 4972
5119 SetControl32BitMinimum (ch, 0); 4973 SetControl32BitMinimum (ch, 0);
5120 SetControl32BitMaximum (ch, 1); 4974 SetControl32BitMaximum (ch, 1);
5121 SetControlViewSize (ch, 1); 4975 SetControlViewSize (ch, 1);
5122 4976
5123 /* Move the scroll bar thumb to the top. */ 4977 /* Move the scroll bar thumb to the top. */
5124 SetControl32BitValue (ch, 0); 4978 SetControl32BitValue (ch, 0);
5125 get_control_part_bounds (ch, kControlIndicatorPart, &r0); 4979 get_control_part_bounds (ch, kControlIndicatorPart, &r0);
5126 4980
5127 /* Move the scroll bar thumb to the bottom. */ 4981 /* Move the scroll bar thumb to the bottom. */
5128 SetControl32BitValue (ch, 1); 4982 SetControl32BitValue (ch, 1);
5129 get_control_part_bounds (ch, kControlIndicatorPart, &r1); 4983 get_control_part_bounds (ch, kControlIndicatorPart, &r1);
5130 4984
5131 UnionRect (&r0, &r1, &r0); 4985 UnionRect (&r0, &r1, &r0);
5132 XSETINT (bar->track_top, r0.top); 4986 XSETINT (bar->track_top, r0.top);
5133 XSETINT (bar->track_height, r0.bottom - r0.top); 4987 XSETINT (bar->track_height, r0.bottom - r0.top);
5134 4988
5135 /* Don't show the scroll bar if its height is not enough to 4989 /* Don't show the scroll bar if its height is not enough to
5136 display the scroll bar thumb. */ 4990 display the scroll bar thumb. */
5137 if (r0.bottom - r0.top > 0) 4991 if (r0.bottom - r0.top > 0)
5138 ShowControl (ch); 4992 ShowControl (ch);
5139 4993
5140 UNBLOCK_INPUT; 4994 UNBLOCK_INPUT;
5141 } 4995 }
4996 }
5142 4997
5143 x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole); 4998 x_set_toolkit_scroll_bar_thumb (bar, portion, position, whole);
5144#else /* not USE_TOOLKIT_SCROLL_BARS */ 4999#else /* not USE_TOOLKIT_SCROLL_BARS */
@@ -6224,10 +6079,12 @@ mac_handle_visibility_change (f)
6224 struct input_event buf; 6079 struct input_event buf;
6225 6080
6226 if (IsWindowVisible (wp)) 6081 if (IsWindowVisible (wp))
6227 if (IsWindowCollapsed (wp)) 6082 {
6228 iconified = 1; 6083 if (IsWindowCollapsed (wp))
6229 else 6084 iconified = 1;
6230 visible = 1; 6085 else
6086 visible = 1;
6087 }
6231 6088
6232 if (!f->async_visible && visible) 6089 if (!f->async_visible && visible)
6233 { 6090 {
@@ -6273,9 +6130,6 @@ void
6273x_make_frame_visible (f) 6130x_make_frame_visible (f)
6274 struct frame *f; 6131 struct frame *f;
6275{ 6132{
6276 Lisp_Object type;
6277 int original_top, original_left;
6278
6279 BLOCK_INPUT; 6133 BLOCK_INPUT;
6280 6134
6281 if (! FRAME_VISIBLE_P (f)) 6135 if (! FRAME_VISIBLE_P (f))
@@ -6286,27 +6140,29 @@ x_make_frame_visible (f)
6286 before the window gets really visible. */ 6140 before the window gets really visible. */
6287 if (! FRAME_ICONIFIED_P (f) 6141 if (! FRAME_ICONIFIED_P (f)
6288 && ! f->output_data.mac->asked_for_visible) 6142 && ! f->output_data.mac->asked_for_visible)
6143 {
6289#if TARGET_API_MAC_CARBON 6144#if TARGET_API_MAC_CARBON
6290 if (!(FRAME_SIZE_HINTS (f)->flags & (USPosition | PPosition))) 6145 if (!(FRAME_SIZE_HINTS (f)->flags & (USPosition | PPosition)))
6291 { 6146 {
6292 struct frame *sf = SELECTED_FRAME (); 6147 struct frame *sf = SELECTED_FRAME ();
6293 if (!FRAME_MAC_P (sf)) 6148 if (!FRAME_MAC_P (sf))
6294 RepositionWindow (FRAME_MAC_WINDOW (f), NULL, 6149 RepositionWindow (FRAME_MAC_WINDOW (f), NULL,
6295 kWindowCenterOnMainScreen); 6150 kWindowCenterOnMainScreen);
6296 else 6151 else
6297 RepositionWindow (FRAME_MAC_WINDOW (f), 6152 RepositionWindow (FRAME_MAC_WINDOW (f),
6298 FRAME_MAC_WINDOW (sf), 6153 FRAME_MAC_WINDOW (sf),
6299#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 6154#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
6300 kWindowCascadeStartAtParentWindowScreen 6155 kWindowCascadeStartAtParentWindowScreen
6301#else 6156#else
6302 kWindowCascadeOnParentWindowScreen 6157 kWindowCascadeOnParentWindowScreen
6303#endif 6158#endif
6304 ); 6159 );
6305 x_real_positions (f, &f->left_pos, &f->top_pos); 6160 x_real_positions (f, &f->left_pos, &f->top_pos);
6306 } 6161 }
6307 else 6162 else
6308#endif 6163#endif
6309 x_set_offset (f, f->left_pos, f->top_pos, 0); 6164 x_set_offset (f, f->left_pos, f->top_pos, 0);
6165 }
6310 6166
6311 f->output_data.mac->asked_for_visible = 1; 6167 f->output_data.mac->asked_for_visible = 1;
6312 6168
@@ -6749,15 +6605,17 @@ xlfdpat_create (pattern)
6749 else 6605 else
6750 { 6606 {
6751 if (last_char == '?') 6607 if (last_char == '?')
6752 if (anychar_head > pat->buf && *(anychar_head - 1) == '*') 6608 {
6753 /* ...*??* -> ...*?? */ 6609 if (anychar_head > pat->buf && *(anychar_head - 1) == '*')
6754 continue; 6610 /* ...*??* -> ...*?? */
6755 else 6611 continue;
6756 /* ...a??* -> ...a*?? */ 6612 else
6757 { 6613 /* ...a??* -> ...a*?? */
6758 *anychar_head++ = '*'; 6614 {
6759 c = '?'; 6615 *anychar_head++ = '*';
6760 } 6616 c = '?';
6617 }
6618 }
6761 nblocks++; 6619 nblocks++;
6762 } 6620 }
6763 else if (c == '?') 6621 else if (c == '?')
@@ -7588,7 +7446,7 @@ mac_do_list_fonts (pattern, maxnames)
7588 if (xlfdpat_match (pat, font_name_table[i])) 7446 if (xlfdpat_match (pat, font_name_table[i]))
7589 { 7447 {
7590 font_list = Fcons (build_string (font_name_table[i]), font_list); 7448 font_list = Fcons (build_string (font_name_table[i]), font_list);
7591 if (exact || maxnames > 0 && ++n_fonts >= maxnames) 7449 if (exact || (maxnames > 0 && ++n_fonts >= maxnames))
7592 break; 7450 break;
7593 } 7451 }
7594 else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 7452 else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0
@@ -7611,7 +7469,7 @@ mac_do_list_fonts (pattern, maxnames)
7611 { 7469 {
7612 font_list = Fcons (build_string (scaled), font_list); 7470 font_list = Fcons (build_string (scaled), font_list);
7613 xfree (scaled); 7471 xfree (scaled);
7614 if (exact || maxnames > 0 && ++n_fonts >= maxnames) 7472 if (exact || (maxnames > 0 && ++n_fonts >= maxnames))
7615 break; 7473 break;
7616 } 7474 }
7617 else 7475 else
@@ -8260,10 +8118,8 @@ x_load_font (f, fontname, size)
8260 8118
8261 /* Load the font and add it to the table. */ 8119 /* Load the font and add it to the table. */
8262 { 8120 {
8263 char *full_name;
8264 struct MacFontStruct *font; 8121 struct MacFontStruct *font;
8265 struct font_info *fontp; 8122 struct font_info *fontp;
8266 unsigned long value;
8267 int i; 8123 int i;
8268 8124
8269 fontname = (char *) SDATA (XCAR (font_names)); 8125 fontname = (char *) SDATA (XCAR (font_names));
@@ -8777,6 +8633,7 @@ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec)
8777 8633
8778#endif 8634#endif
8779 8635
8636#ifdef MAC_OS8
8780static void 8637static void
8781do_get_menus (void) 8638do_get_menus (void)
8782{ 8639{
@@ -8838,6 +8695,7 @@ do_check_ram_size (void)
8838 exit (1); 8695 exit (1);
8839 } 8696 }
8840} 8697}
8698#endif /* MAC_OS8 */
8841 8699
8842static void 8700static void
8843do_window_update (WindowPtr win) 8701do_window_update (WindowPtr win)
@@ -9019,42 +8877,41 @@ do_grow_window (WindowPtr w, EventRecord *e)
9019static void 8877static void
9020do_zoom_window (WindowPtr w, int zoom_in_or_out) 8878do_zoom_window (WindowPtr w, int zoom_in_or_out)
9021{ 8879{
9022 GrafPtr save_port;
9023 Rect zoom_rect, port_rect; 8880 Rect zoom_rect, port_rect;
9024 Point top_left; 8881 int columns, rows, width, height;
9025 int w_title_height, columns, rows, width, height;
9026 struct frame *f = mac_window_to_frame (w); 8882 struct frame *f = mac_window_to_frame (w);
9027 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); 8883 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
9028
9029#if TARGET_API_MAC_CARBON 8884#if TARGET_API_MAC_CARBON
9030 { 8885 Point standard_size;
9031 Point standard_size;
9032 8886
9033 standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS); 8887 standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
9034 standard_size.v = dpyinfo->height; 8888 standard_size.v = dpyinfo->height;
9035 8889
9036 if (IsWindowInStandardState (w, &standard_size, &zoom_rect)) 8890 if (IsWindowInStandardState (w, &standard_size, &zoom_rect))
9037 zoom_in_or_out = inZoomIn; 8891 zoom_in_or_out = inZoomIn;
9038 else 8892 else
9039 { 8893 {
9040 /* Adjust the standard size according to character boundaries. */ 8894 /* Adjust the standard size according to character boundaries. */
9041
9042 columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, zoom_rect.right - zoom_rect.left);
9043 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, zoom_rect.bottom - zoom_rect.top);
9044 standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, columns);
9045 standard_size.v = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
9046 GetWindowBounds (w, kWindowContentRgn, &port_rect);
9047 if (IsWindowInStandardState (w, &standard_size, &zoom_rect)
9048 && port_rect.left == zoom_rect.left
9049 && port_rect.top == zoom_rect.top)
9050 zoom_in_or_out = inZoomIn;
9051 else
9052 zoom_in_or_out = inZoomOut;
9053 }
9054 8895
9055 ZoomWindowIdeal (w, zoom_in_or_out, &standard_size); 8896 columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, zoom_rect.right - zoom_rect.left);
9056 } 8897 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, zoom_rect.bottom - zoom_rect.top);
8898 standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, columns);
8899 standard_size.v = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
8900 GetWindowBounds (w, kWindowContentRgn, &port_rect);
8901 if (IsWindowInStandardState (w, &standard_size, &zoom_rect)
8902 && port_rect.left == zoom_rect.left
8903 && port_rect.top == zoom_rect.top)
8904 zoom_in_or_out = inZoomIn;
8905 else
8906 zoom_in_or_out = inZoomOut;
8907 }
8908
8909 ZoomWindowIdeal (w, zoom_in_or_out, &standard_size);
9057#else /* not TARGET_API_MAC_CARBON */ 8910#else /* not TARGET_API_MAC_CARBON */
8911 GrafPtr save_port;
8912 Point top_left;
8913 int w_title_height;
8914
9058 GetPort (&save_port); 8915 GetPort (&save_port);
9059 8916
9060 SetPortWindowPort (w); 8917 SetPortWindowPort (w);
@@ -9189,26 +9046,27 @@ mac_handle_command_event (next_handler, event, data)
9189 mac_find_apple_event_spec (0, command.commandID, 9046 mac_find_apple_event_spec (0, command.commandID,
9190 &class_key, &id_key, &binding); 9047 &class_key, &id_key, &binding);
9191 if (!NILP (binding) && !EQ (binding, Qundefined)) 9048 if (!NILP (binding) && !EQ (binding, Qundefined))
9192 if (INTEGERP (binding)) 9049 {
9193 return XINT (binding); 9050 if (INTEGERP (binding))
9194 else 9051 return XINT (binding);
9195 { 9052 else
9196 AppleEvent apple_event; 9053 {
9197 UInt32 modifiers; 9054 AppleEvent apple_event;
9198 static EventParamName names[] = {kEventParamDirectObject, 9055 static EventParamName names[] = {kEventParamDirectObject,
9199 kEventParamKeyModifiers}; 9056 kEventParamKeyModifiers};
9200 static EventParamType types[] = {typeHICommand, 9057 static EventParamType types[] = {typeHICommand,
9201 typeUInt32}; 9058 typeUInt32};
9202 err = create_apple_event_from_event_ref (event, 2, names, types, 9059 err = create_apple_event_from_event_ref (event, 2, names, types,
9203 &apple_event); 9060 &apple_event);
9204 if (err == noErr) 9061 if (err == noErr)
9205 { 9062 {
9206 err = mac_store_apple_event (class_key, id_key, &apple_event); 9063 err = mac_store_apple_event (class_key, id_key, &apple_event);
9207 AEDisposeDesc (&apple_event); 9064 AEDisposeDesc (&apple_event);
9208 } 9065 }
9209 if (err == noErr) 9066 if (err == noErr)
9210 return noErr; 9067 return noErr;
9211 } 9068 }
9069 }
9212 9070
9213 return eventNotHandledErr; 9071 return eventNotHandledErr;
9214} 9072}
@@ -9216,7 +9074,6 @@ mac_handle_command_event (next_handler, event, data)
9216static OSErr 9074static OSErr
9217init_command_handler () 9075init_command_handler ()
9218{ 9076{
9219 OSErr err = noErr;
9220 EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}}; 9077 EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}};
9221 static EventHandlerUPP handle_command_eventUPP = NULL; 9078 static EventHandlerUPP handle_command_eventUPP = NULL;
9222 9079
@@ -10092,18 +9949,18 @@ XTread_socket (sd, expected, hold_quit)
10092 XSETINT (inev.x, mouse_loc.h); 9949 XSETINT (inev.x, mouse_loc.h);
10093 XSETINT (inev.y, mouse_loc.v); 9950 XSETINT (inev.y, mouse_loc.v);
10094 9951
10095 if (dpyinfo->grabbed && tracked_scroll_bar 9952 if ((dpyinfo->grabbed && tracked_scroll_bar)
10096 || ch != 0 9953 || (ch != 0
10097#ifndef USE_TOOLKIT_SCROLL_BARS 9954#ifndef USE_TOOLKIT_SCROLL_BARS
10098 /* control_part_code becomes kControlNoPart if 9955 /* control_part_code becomes kControlNoPart if
10099 a progress indicator is clicked. */ 9956 a progress indicator is clicked. */
10100 && control_part_code != kControlNoPart 9957 && control_part_code != kControlNoPart
10101#else /* USE_TOOLKIT_SCROLL_BARS */ 9958#else /* USE_TOOLKIT_SCROLL_BARS */
10102#ifdef MAC_OSX 9959#ifdef MAC_OSX
10103 && control_kind.kind == kControlKindScrollBar 9960 && control_kind.kind == kControlKindScrollBar
10104#endif /* MAC_OSX */ 9961#endif /* MAC_OSX */
10105#endif /* USE_TOOLKIT_SCROLL_BARS */ 9962#endif /* USE_TOOLKIT_SCROLL_BARS */
10106 ) 9963 ))
10107 { 9964 {
10108 struct scroll_bar *bar; 9965 struct scroll_bar *bar;
10109 9966
@@ -10903,7 +10760,6 @@ mac_check_bundle()
10903 extern int inhibit_window_system; 10760 extern int inhibit_window_system;
10904 extern int noninteractive; 10761 extern int noninteractive;
10905 CFBundleRef appsBundle; 10762 CFBundleRef appsBundle;
10906 pid_t child;
10907 10763
10908 /* No need to test if already -nw*/ 10764 /* No need to test if already -nw*/
10909 if (inhibit_window_system || noninteractive) 10765 if (inhibit_window_system || noninteractive)
diff --git a/src/macterm.h b/src/macterm.h
index 872a4b60199..e35f04a6ba6 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -550,7 +550,15 @@ extern int XParseGeometry P_ ((char *, int *, int *, unsigned int *,
550/* Defined in macterm.c. */ 550/* Defined in macterm.c. */
551 551
552extern void x_set_window_size P_ ((struct frame *, int, int, int)); 552extern void x_set_window_size P_ ((struct frame *, int, int, int));
553extern void x_set_mouse_position P_ ((struct frame *, int, int));
554extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int));
553extern void x_make_frame_visible P_ ((struct frame *)); 555extern void x_make_frame_visible P_ ((struct frame *));
556extern void x_make_frame_invisible P_ ((struct frame *));
557extern void x_iconify_frame P_ ((struct frame *));
558extern void x_free_frame_resources P_ ((struct frame *));
559extern void x_destroy_window P_ ((struct frame *));
560extern void x_wm_set_size_hint P_ ((struct frame *, long, int));
561extern void x_delete_display P_ ((struct x_display_info *));
554extern void mac_initialize P_ ((void)); 562extern void mac_initialize P_ ((void));
555extern Pixmap XCreatePixmap P_ ((Display *, WindowPtr, unsigned int, 563extern Pixmap XCreatePixmap P_ ((Display *, WindowPtr, unsigned int,
556 unsigned int, unsigned int)); 564 unsigned int, unsigned int));
@@ -560,6 +568,7 @@ extern Pixmap XCreatePixmapFromBitmapData P_ ((Display *, WindowPtr, char *,
560 unsigned int)); 568 unsigned int));
561extern void XFreePixmap P_ ((Display *, Pixmap)); 569extern void XFreePixmap P_ ((Display *, Pixmap));
562extern GC XCreateGC P_ ((Display *, Window, unsigned long, XGCValues *)); 570extern GC XCreateGC P_ ((Display *, Window, unsigned long, XGCValues *));
571extern void XFreeGC P_ ((Display *, GC));
563extern void XSetForeground P_ ((Display *, GC, unsigned long)); 572extern void XSetForeground P_ ((Display *, GC, unsigned long));
564extern void XSetBackground P_ ((Display *, GC, unsigned long)); 573extern void XSetBackground P_ ((Display *, GC, unsigned long));
565extern void XSetWindowBackground P_ ((Display *, WindowPtr, unsigned long)); 574extern void XSetWindowBackground P_ ((Display *, WindowPtr, unsigned long));
@@ -571,6 +580,7 @@ extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *));
571extern OSErr install_window_handler P_ ((WindowPtr)); 580extern OSErr install_window_handler P_ ((WindowPtr));
572extern void remove_window_handler P_ ((WindowPtr)); 581extern void remove_window_handler P_ ((WindowPtr));
573extern Lisp_Object mac_make_lispy_event_code P_ ((int)); 582extern Lisp_Object mac_make_lispy_event_code P_ ((int));
583extern void do_menu_choice P_ ((SInt32));
574#if USE_CG_DRAWING 584#if USE_CG_DRAWING
575extern void mac_prepare_for_quickdraw P_ ((struct frame *)); 585extern void mac_prepare_for_quickdraw P_ ((struct frame *));
576#endif 586#endif
@@ -584,6 +594,24 @@ extern void mac_prepare_for_quickdraw P_ ((struct frame *));
584 594
585extern void x_clear_frame_selections P_ ((struct frame *)); 595extern void x_clear_frame_selections P_ ((struct frame *));
586 596
597/* Defined in macfns.c */
598
599extern int have_menus_p P_ ((void));
600
601extern void x_real_positions P_ ((struct frame *, int *, int *));
602extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
603extern int x_pixel_width P_ ((struct frame *));
604extern int x_pixel_height P_ ((struct frame *));
605extern int x_char_width P_ ((struct frame *));
606extern int x_char_height P_ ((struct frame *));
607extern void x_sync P_ ((struct frame *));
608extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
609
610/* Defined in macmenu.c */
611
612extern void x_activate_menubar P_ ((struct frame *));
613extern void free_frame_menubar P_ ((struct frame *));
614
587/* Defined in mac.c. */ 615/* Defined in mac.c. */
588 616
589extern void mac_clear_font_name_table P_ ((void)); 617extern void mac_clear_font_name_table P_ ((void));
diff --git a/src/print.c b/src/print.c
index cb3378dd2b1..0eb82b663d6 100644
--- a/src/print.c
+++ b/src/print.c
@@ -759,7 +759,8 @@ DEFUN ("prin1-to-string", Fprin1_to_string, Sprin1_to_string, 1, 2, 0,
759 doc: /* Return a string containing the printed representation of OBJECT. 759 doc: /* Return a string containing the printed representation of OBJECT.
760OBJECT can be any Lisp object. This function outputs quoting characters 760OBJECT can be any Lisp object. This function outputs quoting characters
761when necessary to make output that `read' can handle, whenever possible, 761when necessary to make output that `read' can handle, whenever possible,
762unless the optional second argument NOESCAPE is non-nil. 762unless the optional second argument NOESCAPE is non-nil. For complex objects,
763the behavior is controlled by `print-level' and `print-length', which see.
763 764
764OBJECT is any of the Lisp data types: a number, a string, a symbol, 765OBJECT is any of the Lisp data types: a number, a string, a symbol,
765a list, a buffer, a window, a frame, etc. 766a list, a buffer, a window, a frame, etc.
diff --git a/src/process.c b/src/process.c
index eab9daa6bdd..8e4a0d22160 100644
--- a/src/process.c
+++ b/src/process.c
@@ -2323,7 +2323,11 @@ get_lisp_to_sockaddr_size (address, familyp)
2323} 2323}
2324 2324
2325/* Convert an address object (vector or string) to an internal sockaddr. 2325/* Convert an address object (vector or string) to an internal sockaddr.
2326 Format of address has already been validated by size_lisp_to_sockaddr. */ 2326
2327 The address format has been basically validated by
2328 get_lisp_to_sockaddr_size, but this does not mean FAMILY is valid;
2329 it could have come from user data. So if FAMILY is not valid,
2330 we return after zeroing *SA. */
2327 2331
2328static void 2332static void
2329conv_lisp_to_sockaddr (family, address, sa, len) 2333conv_lisp_to_sockaddr (family, address, sa, len)
@@ -2337,7 +2341,6 @@ conv_lisp_to_sockaddr (family, address, sa, len)
2337 register int i; 2341 register int i;
2338 2342
2339 bzero (sa, len); 2343 bzero (sa, len);
2340 sa->sa_family = family;
2341 2344
2342 if (VECTORP (address)) 2345 if (VECTORP (address))
2343 { 2346 {
@@ -2349,6 +2352,7 @@ conv_lisp_to_sockaddr (family, address, sa, len)
2349 i = XINT (p->contents[--len]); 2352 i = XINT (p->contents[--len]);
2350 sin->sin_port = htons (i); 2353 sin->sin_port = htons (i);
2351 cp = (unsigned char *)&sin->sin_addr; 2354 cp = (unsigned char *)&sin->sin_addr;
2355 sa->sa_family = family;
2352 } 2356 }
2353#ifdef AF_INET6 2357#ifdef AF_INET6
2354 else if (family == AF_INET6) 2358 else if (family == AF_INET6)
@@ -2364,9 +2368,10 @@ conv_lisp_to_sockaddr (family, address, sa, len)
2364 int j = XFASTINT (p->contents[i]) & 0xffff; 2368 int j = XFASTINT (p->contents[i]) & 0xffff;
2365 ip6[i] = ntohs (j); 2369 ip6[i] = ntohs (j);
2366 } 2370 }
2367 return; 2371 sa->sa_family = family;
2368 } 2372 }
2369#endif 2373#endif
2374 return;
2370 } 2375 }
2371 else if (STRINGP (address)) 2376 else if (STRINGP (address))
2372 { 2377 {
@@ -2377,6 +2382,7 @@ conv_lisp_to_sockaddr (family, address, sa, len)
2377 cp = SDATA (address); 2382 cp = SDATA (address);
2378 for (i = 0; i < sizeof (sockun->sun_path) && *cp; i++) 2383 for (i = 0; i < sizeof (sockun->sun_path) && *cp; i++)
2379 sockun->sun_path[i] = *cp++; 2384 sockun->sun_path[i] = *cp++;
2385 sa->sa_family = family;
2380 } 2386 }
2381#endif 2387#endif
2382 return; 2388 return;
@@ -6229,6 +6235,8 @@ text to PROCESS after you call this function. */)
6229 emacs_close (XINT (XPROCESS (proc)->outfd)); 6235 emacs_close (XINT (XPROCESS (proc)->outfd));
6230#endif /* not HAVE_SHUTDOWN */ 6236#endif /* not HAVE_SHUTDOWN */
6231 new_outfd = emacs_open (NULL_DEVICE, O_WRONLY, 0); 6237 new_outfd = emacs_open (NULL_DEVICE, O_WRONLY, 0);
6238 if (new_outfd < 0)
6239 abort ();
6232 old_outfd = XINT (XPROCESS (proc)->outfd); 6240 old_outfd = XINT (XPROCESS (proc)->outfd);
6233 6241
6234 if (!proc_encode_coding_system[new_outfd]) 6242 if (!proc_encode_coding_system[new_outfd])
diff --git a/src/puresize.h b/src/puresize.h
index 93dac70c123..fa73736bc43 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -49,7 +49,7 @@ Boston, MA 02110-1301, USA. */
49/* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ 49/* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */
50#ifndef PURESIZE_RATIO 50#ifndef PURESIZE_RATIO
51#if BITS_PER_EMACS_INT > 32 51#if BITS_PER_EMACS_INT > 32
52#define PURESIZE_RATIO 9/5 /* Don't surround with `()'. */ 52#define PURESIZE_RATIO 10/6 /* Don't surround with `()'. */
53#else 53#else
54#define PURESIZE_RATIO 1 54#define PURESIZE_RATIO 1
55#endif 55#endif
@@ -65,7 +65,7 @@ Boston, MA 02110-1301, USA. */
65 { if (PURE_P (obj)) \ 65 { if (PURE_P (obj)) \
66 pure_write_error (); } 66 pure_write_error (); }
67 67
68extern void pure_write_error P_ ((void)); 68extern void pure_write_error P_ ((void)) NO_RETURN;
69 69
70/* Define PURE_P. */ 70/* Define PURE_P. */
71 71
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 5c6d1d07c20..55f62644d04 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -365,6 +365,9 @@ Boston, MA 02110-1301, USA. */
365#define ftruncate _chsize 365#define ftruncate _chsize
366#define getw _getw 366#define getw _getw
367#define getpid _getpid 367#define getpid _getpid
368#ifdef _MSC_VER
369typedef int pid_t;
370#endif
368#define isatty _isatty 371#define isatty _isatty
369#define logb _logb 372#define logb _logb
370#define _longjmp longjmp 373#define _longjmp longjmp
@@ -462,8 +465,10 @@ extern char *get_emacs_configuration_options (void);
462#endif 465#endif
463#include <string.h> 466#include <string.h>
464 467
465/* We need a little extra space, see ../../lisp/loadup.el */ 468/* We need a little extra space, see ../../lisp/loadup.el.
466#define SYSTEM_PURESIZE_EXTRA 137500 469 The number below comes from 22038 bytes worth (as of 2006-04)
470 of w32-specific files loaded by loadup.el, plus 2K spare. */
471#define SYSTEM_PURESIZE_EXTRA 24000
467 472
468/* For unexec to work on Alpha systems, we need to put Emacs' 473/* For unexec to work on Alpha systems, we need to put Emacs'
469 initialized data into a separate section from the CRT initialized 474 initialized data into a separate section from the CRT initialized
diff --git a/src/search.c b/src/search.c
index dfde3280240..f613630eaf9 100644
--- a/src/search.c
+++ b/src/search.c
@@ -1699,7 +1699,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
1699 ch = -1; 1699 ch = -1;
1700 } 1700 }
1701 1701
1702 if (ch > 0400) 1702 if (ch >= 0400)
1703 j = (ch & 0x3F) | 0200; 1703 j = (ch & 0x3F) | 0200;
1704 else 1704 else
1705 j = *ptr; 1705 j = *ptr;
@@ -1718,7 +1718,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
1718 while (1) 1718 while (1)
1719 { 1719 {
1720 TRANSLATE (ch, inverse_trt, ch); 1720 TRANSLATE (ch, inverse_trt, ch);
1721 if (ch > 0400) 1721 if (ch >= 0400)
1722 j = (ch & 0x3F) | 0200; 1722 j = (ch & 0x3F) | 0200;
1723 else 1723 else
1724 j = ch; 1724 j = ch;
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index db77a83cee2..4ca0be829a2 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -100,7 +100,11 @@ Boston, MA 02110-1301, USA. */
100#if defined (__ppc__) 100#if defined (__ppc__)
101#include <mach-o/ppc/reloc.h> 101#include <mach-o/ppc/reloc.h>
102#endif 102#endif
103#if defined (HAVE_MALLOC_MALLOC_H) 103#include <config.h>
104#undef malloc
105#undef realloc
106#undef free
107#ifdef HAVE_MALLOC_MALLOC_H
104#include <malloc/malloc.h> 108#include <malloc/malloc.h>
105#else 109#else
106#include <objc/malloc.h> 110#include <objc/malloc.h>
@@ -558,7 +562,7 @@ print_load_command (struct load_command *lc)
558static void 562static void
559read_load_commands () 563read_load_commands ()
560{ 564{
561 int n, i, j; 565 int i;
562 566
563 if (!unexec_read (&mh, sizeof (struct mach_header))) 567 if (!unexec_read (&mh, sizeof (struct mach_header)))
564 unexec_error ("cannot read mach-o header"); 568 unexec_error ("cannot read mach-o header");
@@ -680,7 +684,6 @@ copy_data_segment (struct load_command *lc)
680 struct section *sectp; 684 struct section *sectp;
681 int j; 685 int j;
682 unsigned long header_offset, file_offset, old_file_offset; 686 unsigned long header_offset, file_offset, old_file_offset;
683 struct region_t *r;
684 687
685 printf ("Writing segment %-16.16s at %#8x - %#8x (sz: %#8x)\n", 688 printf ("Writing segment %-16.16s at %#8x - %#8x (sz: %#8x)\n",
686 scp->segname, scp->fileoff, scp->fileoff + scp->filesize, 689 scp->segname, scp->fileoff, scp->fileoff + scp->filesize,
diff --git a/src/window.c b/src/window.c
index 039e955efd0..d4e6ac3569f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -661,12 +661,20 @@ coordinates_in_window (w, x, y)
661 || WINDOW_RIGHTMOST_P (w)) 661 || WINDOW_RIGHTMOST_P (w))
662 { 662 {
663 if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width) 663 if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width)
664 return ON_VERTICAL_BORDER; 664 {
665 *x = max (0, *x - x0);
666 *y -= top_y;
667 return ON_VERTICAL_BORDER;
668 }
665 } 669 }
666 else 670 else
667 { 671 {
668 if (abs (*x - x1) < grabbable_width) 672 if (abs (*x - x1) < grabbable_width)
669 return ON_VERTICAL_BORDER; 673 {
674 *x = min (x1, *x) - x0;
675 *y -= top_y;
676 return ON_VERTICAL_BORDER;
677 }
670 } 678 }
671 679
672 if (*x < x0 || *x >= x1) 680 if (*x < x0 || *x >= x1)
@@ -708,7 +716,11 @@ coordinates_in_window (w, x, y)
708 && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w) 716 && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
709 && !WINDOW_RIGHTMOST_P (w) 717 && !WINDOW_RIGHTMOST_P (w)
710 && (abs (*x - right_x) < grabbable_width)) 718 && (abs (*x - right_x) < grabbable_width))
711 return ON_VERTICAL_BORDER; 719 {
720 *x = min (right_x, *x) - left_x;
721 *y -= top_y;
722 return ON_VERTICAL_BORDER;
723 }
712 } 724 }
713 else 725 else
714 { 726 {
@@ -720,6 +732,8 @@ coordinates_in_window (w, x, y)
720 { 732 {
721 /* On the border on the right side of the window? Assume that 733 /* On the border on the right side of the window? Assume that
722 this area begins at RIGHT_X minus a canonical char width. */ 734 this area begins at RIGHT_X minus a canonical char width. */
735 *x = min (right_x, *x) - left_x;
736 *y -= top_y;
723 return ON_VERTICAL_BORDER; 737 return ON_VERTICAL_BORDER;
724 } 738 }
725 } 739 }
diff --git a/src/xdisp.c b/src/xdisp.c
index 43673bb6197..ca5137bb4ff 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1913,7 +1913,7 @@ get_glyph_string_clip_rects (s, rects, n)
1913 } 1913 }
1914 1914
1915 if ((s->for_overlaps & OVERLAPS_BOTH) == 0 1915 if ((s->for_overlaps & OVERLAPS_BOTH) == 0
1916 || (s->for_overlaps & OVERLAPS_BOTH) == OVERLAPS_BOTH && n == 1) 1916 || ((s->for_overlaps & OVERLAPS_BOTH) == OVERLAPS_BOTH && n == 1))
1917 { 1917 {
1918#ifdef CONVERT_FROM_XRECT 1918#ifdef CONVERT_FROM_XRECT
1919 CONVERT_FROM_XRECT (r, *rects); 1919 CONVERT_FROM_XRECT (r, *rects);
@@ -1939,23 +1939,27 @@ get_glyph_string_clip_rects (s, rects, n)
1939 { 1939 {
1940 rs[i] = r; 1940 rs[i] = r;
1941 if (r.y + r.height > row_y) 1941 if (r.y + r.height > row_y)
1942 if (r.y < row_y) 1942 {
1943 rs[i].height = row_y - r.y; 1943 if (r.y < row_y)
1944 else 1944 rs[i].height = row_y - r.y;
1945 rs[i].height = 0; 1945 else
1946 rs[i].height = 0;
1947 }
1946 i++; 1948 i++;
1947 } 1949 }
1948 if (s->for_overlaps & OVERLAPS_SUCC) 1950 if (s->for_overlaps & OVERLAPS_SUCC)
1949 { 1951 {
1950 rs[i] = r; 1952 rs[i] = r;
1951 if (r.y < row_y + s->row->visible_height) 1953 if (r.y < row_y + s->row->visible_height)
1952 if (r.y + r.height > row_y + s->row->visible_height) 1954 {
1953 { 1955 if (r.y + r.height > row_y + s->row->visible_height)
1954 rs[i].y = row_y + s->row->visible_height; 1956 {
1955 rs[i].height = r.y + r.height - rs[i].y; 1957 rs[i].y = row_y + s->row->visible_height;
1956 } 1958 rs[i].height = r.y + r.height - rs[i].y;
1957 else 1959 }
1958 rs[i].height = 0; 1960 else
1961 rs[i].height = 0;
1962 }
1959 i++; 1963 i++;
1960 } 1964 }
1961 1965
@@ -14959,7 +14963,7 @@ dump_glyph_row (row, vpos, glyphs)
14959{ 14963{
14960 if (glyphs != 1) 14964 if (glyphs != 1)
14961 { 14965 {
14962 fprintf (stderr, "Row Start End Used oEI><\\CTZFesm X Y W H V A P\n"); 14966 fprintf (stderr, "Row Start End Used oE><\\CTZFesm X Y W H V A P\n");
14963 fprintf (stderr, "======================================================================\n"); 14967 fprintf (stderr, "======================================================================\n");
14964 14968
14965 fprintf (stderr, "%3d %5d %5d %4d %1.1d%1.1d%1.1d%1.1d\ 14969 fprintf (stderr, "%3d %5d %5d %4d %1.1d%1.1d%1.1d%1.1d\
@@ -22529,7 +22533,10 @@ note_mouse_highlight (f, x, y)
22529 } 22533 }
22530 22534
22531 if (part == ON_VERTICAL_BORDER) 22535 if (part == ON_VERTICAL_BORDER)
22532 cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor; 22536 {
22537 cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;
22538 help_echo_string = make_string ("drag-mouse-1: resize", 20);
22539 }
22533 else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE 22540 else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE
22534 || part == ON_SCROLL_BAR) 22541 || part == ON_SCROLL_BAR)
22535 cursor = FRAME_X_OUTPUT (f)->nontext_cursor; 22542 cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
diff --git a/src/xfaces.c b/src/xfaces.c
index 0d91f433fce..3a066ee12c3 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -5063,10 +5063,12 @@ Default face attributes override any local face attributes. */)
5063 gvec = XVECTOR (global_lface)->contents; 5063 gvec = XVECTOR (global_lface)->contents;
5064 for (i = 1; i < LFACE_VECTOR_SIZE; ++i) 5064 for (i = 1; i < LFACE_VECTOR_SIZE; ++i)
5065 if (! UNSPECIFIEDP (gvec[i])) 5065 if (! UNSPECIFIEDP (gvec[i]))
5066 if (IGNORE_DEFFACE_P (gvec[i])) 5066 {
5067 lvec[i] = Qunspecified; 5067 if (IGNORE_DEFFACE_P (gvec[i]))
5068 else 5068 lvec[i] = Qunspecified;
5069 lvec[i] = gvec[i]; 5069 else
5070 lvec[i] = gvec[i];
5071 }
5070 5072
5071 return Qnil; 5073 return Qnil;
5072} 5074}
diff --git a/src/xrdb.c b/src/xrdb.c
index 2b7888ebe84..988db614c41 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -315,7 +315,7 @@ gethomedir ()
315 } 315 }
316 316
317 if (ptr == NULL) 317 if (ptr == NULL)
318 return "/"; 318 return xstrdup ("/");
319 319
320 copy = (char *) malloc (strlen (ptr) + 2); 320 copy = (char *) malloc (strlen (ptr) + 2);
321 strcpy (copy, ptr); 321 strcpy (copy, ptr);