aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2006-08-16 14:08:49 +0000
committerMiles Bader2006-08-16 14:08:49 +0000
commitde20e0ccdb039a2ac27e5bbd3e06ab70c4e7bb65 (patch)
tree80243ce02b52cbf7945c614bd213dd63142b861a
parent7a5c2a42040b12b037940a067aee6ac6fde01680 (diff)
parent5ebdc2990a95cc38b21f772eea4de3ceee149e54 (diff)
downloademacs-de20e0ccdb039a2ac27e5bbd3e06ab70c4e7bb65.tar.gz
emacs-de20e0ccdb039a2ac27e5bbd3e06ab70c4e7bb65.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 382-398) - Update from CVS - Update from erc--emacs--22 - Fix ERC bug introduced in last patch - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 123-125) - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-101
-rw-r--r--ChangeLog9
-rw-r--r--INSTALL.CVS5
-rw-r--r--admin/ChangeLog4
-rw-r--r--admin/FOR-RELEASE67
-rw-r--r--configure.in2
-rw-r--r--etc/ChangeLog23
-rw-r--r--etc/DEBUG13
-rw-r--r--etc/NEWS53
-rw-r--r--etc/TUTORIAL2
-rw-r--r--etc/TUTORIAL.de4
-rw-r--r--etc/orgcard.tex2
-rw-r--r--lib-src/ChangeLog15
-rw-r--r--lib-src/etags.c7
-rw-r--r--lisp/ChangeLog307
-rw-r--r--lisp/allout.el813
-rw-r--r--lisp/avoid.el25
-rw-r--r--lisp/bindings.el102
-rw-r--r--lisp/buff-menu.el8
-rw-r--r--lisp/calendar/timeclock.el16
-rw-r--r--lisp/compare-w.el34
-rw-r--r--lisp/complete.el73
-rw-r--r--lisp/cus-edit.el9
-rw-r--r--lisp/cus-start.el2
-rw-r--r--lisp/cus-theme.el6
-rw-r--r--lisp/emacs-lisp/bindat.el9
-rw-r--r--lisp/emacs-lisp/edebug.el10
-rw-r--r--lisp/erc/ChangeLog38
-rw-r--r--lisp/erc/erc-backend.el15
-rw-r--r--lisp/erc/erc-log.el22
-rw-r--r--lisp/erc/erc-match.el2
-rw-r--r--lisp/erc/erc.el39
-rw-r--r--lisp/eshell/em-glob.el3
-rw-r--r--lisp/facemenu.el71
-rw-r--r--lisp/faces.el2
-rw-r--r--lisp/filesets.el2
-rw-r--r--lisp/font-lock.el32
-rw-r--r--lisp/gnus/ChangeLog24
-rw-r--r--lisp/gnus/compface.el40
-rw-r--r--lisp/gnus/mm-extern.el2
-rw-r--r--lisp/gnus/nnheader.el2
-rw-r--r--lisp/gnus/nnweb.el11
-rw-r--r--lisp/help.el21
-rw-r--r--lisp/info.el2
-rw-r--r--lisp/international/latexenc.el10
-rw-r--r--lisp/international/mule-diag.el30
-rw-r--r--lisp/net/zone-mode.el120
-rw-r--r--lisp/newcomment.el11
-rw-r--r--lisp/pcvs.el2
-rw-r--r--lisp/progmodes/gdb-ui.el170
-rw-r--r--lisp/progmodes/gud.el10
-rw-r--r--lisp/progmodes/sh-script.el13
-rw-r--r--lisp/simple.el30
-rw-r--r--lisp/term/x-win.el9
-rw-r--r--lisp/term/xterm.el31
-rw-r--r--lisp/textmodes/dns-mode.el31
-rw-r--r--lisp/textmodes/org.el577
-rw-r--r--lisp/x-dnd.el6
-rw-r--r--lispref/ChangeLog79
-rw-r--r--lispref/commands.texi9
-rw-r--r--lispref/customize.texi39
-rw-r--r--lispref/keymaps.texi9
-rw-r--r--lispref/modes.texi834
-rw-r--r--lispref/os.texi18
-rw-r--r--lispref/strings.texi15
-rw-r--r--lispref/text.texi126
-rw-r--r--man/ChangeLog78
-rw-r--r--man/ack.texi2
-rw-r--r--man/building.texi13
-rw-r--r--man/cmdargs.texi4
-rw-r--r--man/dired.texi2
-rw-r--r--man/emacs.texi2
-rw-r--r--man/faq.texi187
-rw-r--r--man/help.texi114
-rw-r--r--man/mark.texi2
-rw-r--r--man/misc.texi13
-rw-r--r--man/mule.texi4
-rw-r--r--man/org.texi154
-rw-r--r--man/rcirc.texi2
-rw-r--r--man/texinfo.tex44
-rw-r--r--man/text.texi64
-rw-r--r--src/.gdbinit6
-rw-r--r--src/ChangeLog135
-rw-r--r--src/alloc.c27
-rw-r--r--src/buffer.c12
-rw-r--r--src/editfns.c24
-rw-r--r--src/frame.c13
-rw-r--r--src/keyboard.c71
-rw-r--r--src/keyboard.h3
-rw-r--r--src/print.c9
-rw-r--r--src/puresize.h2
-rw-r--r--src/w32.c22
-rw-r--r--src/w32.h3
-rw-r--r--src/w32fns.c41
-rw-r--r--src/w32menu.c6
-rw-r--r--src/xselect.c51
-rw-r--r--src/xterm.c9
-rw-r--r--src/xterm.h6
97 files changed, 3456 insertions, 1796 deletions
diff --git a/ChangeLog b/ChangeLog
index b34b4d6d09c..892a4a18ba3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
12006-08-16 Andreas Schwab <schwab@suse.de>
2
3 * configure.in (PKG_CHECK_MODULES): Use AS_MESSAGE_LOG_FD instead
4 of hardcoding it.
5
62006-08-16 Richard Stallman <rms@gnu.org>
7
8 * INSTALL.CVS: Clean up wording.
9
12006-07-14 Eli Zaretskii <eliz@gnu.org> 102006-07-14 Eli Zaretskii <eliz@gnu.org>
2 11
3 * configure.in (PKG_CHECK_MODULES): Redirect the output of 12 * configure.in (PKG_CHECK_MODULES): Redirect the output of
diff --git a/INSTALL.CVS b/INSTALL.CVS
index ce3fa9f2627..e67ea4db0f2 100644
--- a/INSTALL.CVS
+++ b/INSTALL.CVS
@@ -12,8 +12,9 @@ The bootstrap process makes sure all necessary files are rebuilt
12before it builds the final Emacs binary. 12before it builds the final Emacs binary.
13 13
14Normally, it is not necessary to use "make bootstrap" after every CVS 14Normally, it is not necessary to use "make bootstrap" after every CVS
15update. Unless there are problems, we suggest the following 15update. Unless there are problems, we suggest using the following
16procedure: 16alternative procedure after you have done "make bootstrap" at least
17once:
17 18
18 $ ./configure 19 $ ./configure
19 $ make 20 $ make
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 51c8fa9100b..97602d53653 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,7 @@
12006-08-13 Chong Yidong <cyd@stupidchicken.com>
2
3 * FOR-RELEASE: Elisp manual checking completed.
4
12006-07-17 Reiner Steib <Reiner.Steib@gmx.de> 52006-07-17 Reiner Steib <Reiner.Steib@gmx.de>
2 6
3 * FOR-RELEASE: Update refcard section. 7 * FOR-RELEASE: Update refcard section.
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE
index cb5df6149c7..35070c082b1 100644
--- a/admin/FOR-RELEASE
+++ b/admin/FOR-RELEASE
@@ -31,11 +31,6 @@ and KDE projects, to use the new Emacs icons in etc/images/icons.
31 31
32* BUGS 32* BUGS
33 33
34** bojohan's and johnsu01@wjsullivan.net's 18 July bug reports that
35 "C-n doesn't work in Customize Option buffer in -nw with long value
36 displayed". Yidong proposed a fix, but needs a field expert to check
37 it.
38
39** Markus Gritsch's report about Emacs looping on Windoze with the following 34** Markus Gritsch's report about Emacs looping on Windoze with the following
40.emacs file, and then reduce Emacs frame width to "something quite narrow": 35.emacs file, and then reduce Emacs frame width to "something quite narrow":
41 (setq-default truncate-lines t) 36 (setq-default truncate-lines t)
@@ -44,73 +39,15 @@ and KDE projects, to use the new Emacs icons in etc/images/icons.
44 '(hscroll-step 1) 39 '(hscroll-step 1)
45 ) 40 )
46 41
47** David Kastrup's report on strange scrolling of large images.
48
49** Jorgen Schaefer <forcer@forcix.cx>'s June 18 bug report about 42** Jorgen Schaefer <forcer@forcix.cx>'s June 18 bug report about
50 fields and invisible overlays needs attention from a field expert. 43 fields and invisible overlays needs attention from a field expert.
51 44
52** Implement buffer-chars-modified-tick. 45** Implement buffer-chars-modified-tick.
53 46
54* DOCUMENTATION 47** henman@it.to-be.co.jp 09 Aug 2006: ispell.el problem.
55
56** Check the Emacs Lisp manual.
57 48
58Each manual section should be checked for factual correctness
59regarding recent changes by at least two people. After each file
60name, on the same line or the following line, come the names of the
61people who have checked it.
62 49
63SECTION READERS 50* DOCUMENTATION
64----------------------------------
65lispref/abbrevs.texi "Luc Teirlinck" Chong Yidong
66lispref/advice.texi Joakim Verona Chong Yidong
67lispref/anti.texi Chong Yidong Kim F. Storm
68lispref/backups.texi "Luc Teirlinck" Chong Yidong
69lispref/buffers.texi "Luc Teirlinck" Chong Yidong
70lispref/calendar.texi Joakim Verona Chong Yidong
71lispref/commands.texi "Luc Teirlinck" Chong Yidong
72lispref/compile.texi "Luc Teirlinck" Chong Yidong
73lispref/control.texi "Luc Teirlinck" Chong Yidong
74lispref/customize.texi Chong Yidong "Luc Teirlinck"
75lispref/debugging.texi Joakim Verona Lute Kamstra
76lispref/display.texi Chong Yidong Jason Rumney
77lispref/edebug.texi Chong Yidong "Luc Teirlinck"
78lispref/elisp.texi "Luc Teirlinck" Lute Kamstra
79lispref/errors.texi "Luc Teirlinck" Chong Yidong
80lispref/eval.texi "Luc Teirlinck" Chong Yidong
81lispref/files.texi "Luc Teirlinck" Chong Yidong
82lispref/frames.texi "Luc Teirlinck" Chong Yidong
83lispref/functions.texi "Luc Teirlinck" Chong Yidong
84lispref/hash.texi "Luc Teirlinck" Chong Yidong
85lispref/help.texi "Luc Teirlinck" Chong Yidong
86lispref/hooks.texi Lute Kamstra Chong Yidong
87lispref/internals.texi "Luc Teirlinck" Chong Yidong
88lispref/intro.texi "Luc Teirlinck" Josh Varner
89lispref/keymaps.texi "Luc Teirlinck" Chong Yidong
90lispref/lists.texi "Luc Teirlinck" Chong Yidong
91lispref/loading.texi "Luc Teirlinck" Chong Yidong
92lispref/locals.texi Chong Yidong Nick Roberts
93lispref/macros.texi "Luc Teirlinck" Chong Yidong
94lispref/maps.texi Chong Yidong Kim F. Storm
95lispref/markers.texi "Luc Teirlinck" Chong Yidong
96lispref/minibuf.texi "Luc Teirlinck" Chong Yidong
97lispref/modes.texi Chong Yidong
98lispref/nonascii.texi "Luc Teirlinck" Chong Yidong
99lispref/numbers.texi "Luc Teirlinck" Chong Yidong
100lispref/objects.texi "Luc Teirlinck" Chong Yidong
101lispref/os.texi "Luc Teirlinck" Chong Yidong
102lispref/positions.texi "Luc Teirlinck" Chong Yidong
103lispref/processes.texi Chong Yidong ttn
104lispref/searching.texi "Luc Teirlinck" Chong Yidong
105lispref/sequences.texi "Luc Teirlinck" Chong Yidong
106lispref/streams.texi "Luc Teirlinck" Chong Yidong
107lispref/strings.texi "Luc Teirlinck" Chong Yidong
108lispref/symbols.texi "Luc Teirlinck" Chong Yidong
109lispref/syntax.texi "Luc Teirlinck" Chong Yidong
110lispref/text.texi Chong Yidong
111lispref/tips.texi "Luc Teirlinck" Chong Yidong
112lispref/variables.texi "Luc Teirlinck" Chong Yidong
113lispref/windows.texi "Luc Teirlinck" Chong Yidong
114 51
115** Check the Emacs Tutorial. 52** Check the Emacs Tutorial.
116 53
diff --git a/configure.in b/configure.in
index 6df5b292749..c1899fd32cf 100644
--- a/configure.in
+++ b/configure.in
@@ -1509,7 +1509,7 @@ AC_DEFUN([PKG_CHECK_MODULES], [
1509 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then 1509 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
1510 AC_MSG_CHECKING(for $2) 1510 AC_MSG_CHECKING(for $2)
1511 1511
1512 if $PKG_CONFIG --exists "$2" 2>&5; then 1512 if $PKG_CONFIG --exists "$2" 2>&AS_MESSAGE_LOG_FD; then
1513 AC_MSG_RESULT(yes) 1513 AC_MSG_RESULT(yes)
1514 succeeded=yes 1514 succeeded=yes
1515 1515
diff --git a/etc/ChangeLog b/etc/ChangeLog
index ae887b33da9..32d7525e153 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,24 @@
12006-08-15 Carsten Dominik <dominik@science.uva.nl>
2
3 * orgcard.tex: Version number change.
4
52006-08-12 Werner Lemberg <wl@gnu.org>
6
7 * TUTORIAL.de: Synchronize with TUTORIAL.
8
92006-08-10 Romain Francoise <romain@orebokech.com>
10
11 * NEWS: Mention that zone-mode.el is now obsolete.
12
132006-08-09 Richard Stallman <rms@gnu.org>
14
15 * TUTORIAL: Don't say which side scroll bar is on.
16
172006-08-06 Nick Roberts <nickrob@snap.net.nz>
18
19 * DEBUG (Note): Add note about following a longjmp call.
20 Add local variables list for outline mode.
21
12006-08-03 Michael Olson <mwolson@gnu.org> 222006-08-03 Michael Olson <mwolson@gnu.org>
2 23
3 * ERC-NEWS: Update for ERC 5.1.4. 24 * ERC-NEWS: Update for ERC 5.1.4.
@@ -186,7 +207,7 @@
186 207
1872006-05-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> 2082006-05-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
188 209
189 * NEWS: Mention F10 for Gtk+/Leddtif/Lucid menus. 210 * NEWS: Mention F10 for Gtk+/Lesstif/Lucid menus.
190 211
1912006-05-26 Eli Zaretskii <eliz@gnu.org> 2122006-05-26 Eli Zaretskii <eliz@gnu.org>
192 213
diff --git a/etc/DEBUG b/etc/DEBUG
index 63327b3ce5c..bc81d1d5dc2 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -272,6 +272,13 @@ related data structures in a terse and user-friendly format:
272The above commands also exist in a version with an `x' suffix which 272The above commands also exist in a version with an `x' suffix which
273takes an object of the relevant type as argument. 273takes an object of the relevant type as argument.
274 274
275** Following longjmp call.
276
277Recent versions of glibc (2.4+?) encrypt stored values for setjmp/longjmp which
278prevents GDB from being able to follow a longjmp call using `next'. To
279disable this protection you need to set the environment variable
280LD_POINTER_GUARD to 0.
281
275** Using GDB in Emacs 282** Using GDB in Emacs
276 283
277Debugging with GDB in Emacs offers some advantages over the command line (See 284Debugging with GDB in Emacs offers some advantages over the command line (See
@@ -739,4 +746,10 @@ look at the disassembly to determine which registers are being used,
739and look at those registers directly, to see the actual current values 746and look at those registers directly, to see the actual current values
740of these variables. 747of these variables.
741 748
749
750Local variables:
751mode: outline
752paragraph-separate: "[ ]*$"
753end:
754
742;;; arch-tag: fbf32980-e35d-481f-8e4c-a2eca2586e6b 755;;; arch-tag: fbf32980-e35d-481f-8e4c-a2eca2586e6b
diff --git a/etc/NEWS b/etc/NEWS
index e49ef100b1a..241396ade7a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1846,9 +1846,8 @@ type "C-h i m org RET" to read that manual. A reference card is
1846available in `etc/orgcard.tex' and `etc/orgcard.ps'. 1846available in `etc/orgcard.tex' and `etc/orgcard.ps'.
1847 1847
1848+++ 1848+++
1849** The new package dns-mode.el add syntax highlight of DNS master files. 1849** The new package dns-mode.el adds syntax highlighting of DNS master files.
1850The key binding C-c C-s (`dns-mode-soa-increment-serial') can be used 1850It is a modern replacement for zone-mode.el, which is now obsolete.
1851to increment the SOA serial.
1852 1851
1853--- 1852---
1854** The new global minor mode `file-name-shadow-mode' modifies the way 1853** The new global minor mode `file-name-shadow-mode' modifies the way
@@ -2069,6 +2068,7 @@ using hi-lock-mode in an initialization file will turn on Hi Lock in all
2069buffers and no warning will be issued (for compatibility with the 2068buffers and no warning will be issued (for compatibility with the
2070behavior in older versions of Emacs). 2069behavior in older versions of Emacs).
2071 2070
2071---
2072** Changes in Allout 2072** Changes in Allout
2073 2073
2074*** Topic cryptography added, enabling easy gpg topic encryption and 2074*** Topic cryptography added, enabling easy gpg topic encryption and
@@ -2077,11 +2077,19 @@ clear-text within a single file to your heart's content, using symmetric
2077and/or public key modes. Time-limited key caching, user-provided 2077and/or public key modes. Time-limited key caching, user-provided
2078symmetric key hinting and consistency verification, auto-encryption of 2078symmetric key hinting and consistency verification, auto-encryption of
2079pending topics on save, and more, make it easy to use encryption in 2079pending topics on save, and more, make it easy to use encryption in
2080powerful ways. 2080powerful ways. Encryption behavior customization is collected in the
2081allout-encryption customization group.
2081 2082
2082*** `allout-view-change-hook' marked as being deprecated - use 2083*** `allout-view-change-hook' marked as being deprecated - use
2083`allout-exposure-change-hook' instead. Both are currently being used, but 2084`allout-exposure-change-hook' instead. Both are still invoked, but
2084`allout-view-change-hook' will be ignored in a subsequent allout version. 2085`allout-view-change-hook' will eventually be ignored. The new
2086`allout-exposure-change-hook' is called with args that were passed to
2087`allout-flag-region', making it easier to use.
2088
2089*** Other allout functions which change the outline structure also have
2090hooks, enabling cooperative allout enhancements. See
2091`allout-structure-added-hook', `allout-structure-deleted-hook', and
2092`allout-structure-shifted-hook'.
2085 2093
2086*** Default command prefix changed to "\C-c " (control-c space), to avoid 2094*** Default command prefix changed to "\C-c " (control-c space), to avoid
2087intruding on user's keybinding space. Customize the 2095intruding on user's keybinding space. Customize the
@@ -2092,23 +2100,43 @@ concealed text, instead of selective-display. This simplifies the code, in
2092particular avoiding the need for kludges for isearch dynamic-display, 2100particular avoiding the need for kludges for isearch dynamic-display,
2093discretionary handling of edits of concealed text, undo concerns, etc. 2101discretionary handling of edits of concealed text, undo concerns, etc.
2094 2102
2103*** Some previously rough topic-header format edge cases are reconciled.
2104Level 1 topics use the mode's comment format, and lines starting with the
2105asterisk - for instance, the comment close of some languages (eg, c's "*/"
2106or mathematica's "*)") - at the beginning of line are no longer are
2107interpreted as level 1 topics in those modes. (Yay!)
2108
2095*** Many substantial fixes and refinements, including: 2109*** Many substantial fixes and refinements, including:
2096 2110
2097 - repaired inhibition of inadvertent edits to concealed text 2111 - repaired regexp-quoting of custom header prefixes, so any literals
2098 - repaired retention of topic body hanging indent upon topic depth shifts 2112 will now work (for instance, mathematica's "(*" is now properly
2113 accepted).
2114 - repaired inhibition of inadvertent edits to concealed text.
2099 - refuse to create "containment discontinuities", where a 2115 - refuse to create "containment discontinuities", where a
2100 topic is shifted deeper than the offspring-depth of its' container 2116 topic is shifted deeper than the offspring-depth of its' container
2101 - auto-fill-mode is now left inactive when allout-mode starts, if it 2117 - auto-fill-mode is now left inactive when allout-mode starts, if it
2102 already was inactive. also, `allout-inhibit-auto-fill' custom 2118 already was inactive. also, `allout-inhibit-auto-fill' custom
2103 configuration variable makes it easy to disable auto fill in allout 2119 configuration variable makes it easy to disable auto fill in allout
2104 outlines in general or on a per-buffer basis. 2120 outlines in general or on a per-buffer basis.
2105 - new hook `allout-mode-deactivate-hook', for coordinating with 2121 - mode hook changes: new hook `allout-mode-deactivate-hook', for
2106 deactivation of allout-mode. 2122 coordinating with deactivation of allout-mode. `allout-mode-hook' is
2123 now run after the `allout-mode' variable is changed, as is the new
2124 `allout-mode-deactivate-hook'.
2125 - allout now tolerates fielded text in outlines without disruption.
2126 - hot-spot navigation now is modularized with a new function,
2127 `allout-hotspot-key-handler', enabling easier articulation and
2128 enhancement of the functionality by allout addons.
2129 - topic body navigation is easier, where repeated beginning of line and
2130 end of line key commands cycle through the actually beginning/end of
2131 line and then beginning/end of topic, etc. see new customization vars
2132 `allout-beginning-of-line-cycles' and `allout-end-of-line-cycles'.
2133 - repaired retention of topic body hanging indent upon topic depth shifts
2107 - bulleting variation is simpler and more accommodating, both in the 2134 - bulleting variation is simpler and more accommodating, both in the
2108 default behavior and in ability to vary when creating new topics 2135 default behavior and in ability to vary when creating new topics
2109 - mode deactivation now does cleans up effectively, more properly 2136 - mode deactivation now does cleans up effectively, more properly
2110 restoring affected variables and hooks to former state, removing 2137 restoring affected variables and hooks to former state, removing
2111 overlays, etc. 2138 overlays, etc. see `allout-add-resumptions' and
2139 `allout-do-resumptions', which replace the old `allout-resumptions'.
2112 - included a few unit-tests for interior functionality. developers can 2140 - included a few unit-tests for interior functionality. developers can
2113 have them automatically run at the end of module load by customizing 2141 have them automatically run at the end of module load by customizing
2114 the option `allout-run-unit-tests-on-load'. 2142 the option `allout-run-unit-tests-on-load'.
@@ -3588,6 +3616,9 @@ variable `calculator-radix-grouping-mode'.
3588** iso-acc.el is now obsolete. Use one of the latin input methods instead. 3616** iso-acc.el is now obsolete. Use one of the latin input methods instead.
3589 3617
3590--- 3618---
3619** zone-mode.el is now obsolete. Use dns-mode.el instead.
3620
3621---
3591** cplus-md.el has been deleted. 3622** cplus-md.el has been deleted.
3592 3623
3593** Ewoc changes 3624** Ewoc changes
diff --git a/etc/TUTORIAL b/etc/TUTORIAL
index 5748d0d4e5e..630cc4f9765 100644
--- a/etc/TUTORIAL
+++ b/etc/TUTORIAL
@@ -217,7 +217,7 @@ This should have scrolled the screen up by 8 lines. If you would like
217to scroll it down again, you can give an argument to M-v. 217to scroll it down again, you can give an argument to M-v.
218 218
219If you are using a windowed display, such as X11 or MS-Windows, there 219If you are using a windowed display, such as X11 or MS-Windows, there
220should be a tall rectangular area called a scroll bar at the left hand 220should be a tall rectangular area called a scroll bar at the
221side of the Emacs window. You can scroll the text by clicking the 221side of the Emacs window. You can scroll the text by clicking the
222mouse in the scroll bar. 222mouse in the scroll bar.
223 223
diff --git a/etc/TUTORIAL.de b/etc/TUTORIAL.de
index 4ccdd88523c..c181d596065 100644
--- a/etc/TUTORIAL.de
+++ b/etc/TUTORIAL.de
@@ -285,8 +285,8 @@ sein. Wollen Sie ihn nach unten verschieben, dann geben Sie M-v mit
285einem numerischen Argument ein. 285einem numerischen Argument ein.
286 286
287Wenn Sie eine graphische Oberfläche wie X oder MS-Windows verwenden, 287Wenn Sie eine graphische Oberfläche wie X oder MS-Windows verwenden,
288dann befindet sich ein schmaler, langgezogener rechteckiger Bereich im 288dann befindet sich ein schmaler, langgezogener rechteckiger Bereich auf
289Regelfall auf der linken Seite des Emacs-Fensters. Dieser Bereich 289der linken oder rechten Seite des Emacs-Fensters. Dieser Bereich
290wird Scrollbar genannt (`Verschiebungsbalken'). Sie können Text 290wird Scrollbar genannt (`Verschiebungsbalken'). Sie können Text
291verschieben, indem Sie mit der Maus auf den Scrollbar klicken. 291verschieben, indem Sie mit der Maus auf den Scrollbar klicken.
292 292
diff --git a/etc/orgcard.tex b/etc/orgcard.tex
index 951d0167c2e..ef2e847b5f1 100644
--- a/etc/orgcard.tex
+++ b/etc/orgcard.tex
@@ -1,5 +1,5 @@
1% Reference Card for Org Mode 1% Reference Card for Org Mode
2\def\orgversionnumber{4.43} 2\def\orgversionnumber{4.44}
3\def\year{2006} 3\def\year{2006}
4% 4%
5%**start of header 5%**start of header
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index f61188fb8d5..3328f010846 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,18 @@
12006-08-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * etags.c (readline): expect sscanf returns >= 1.
4 (readline): Change position on %n and \" in sscanf.
5
62006-08-07 Masatake YAMATO <jet@gyve.org>
7
8 * etags.c (readline): expect sscanf returns 2,
9 not 1.
10
112006-08-07 Masatake YAMATO <jet@gyve.org>
12
13 * etags.c (TEX_mode): Check getc retruns EOF.
14 File ended without newline causes infinite loop.
15
12002-07-30 Adrian Aichner <adrian@xemacs.org> (tiny change) 162002-07-30 Adrian Aichner <adrian@xemacs.org> (tiny change)
2 17
3 * etags.c: It's XEmacs, not Xemacs: change all the occurences. 18 * etags.c: It's XEmacs, not Xemacs: change all the occurences.
diff --git a/lib-src/etags.c b/lib-src/etags.c
index d60c12c2bcc..49a18be1df5 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -5165,7 +5165,7 @@ TEX_mode (inf)
5165 { 5165 {
5166 /* Skip to next line if we hit the TeX comment char. */ 5166 /* Skip to next line if we hit the TeX comment char. */
5167 if (c == '%') 5167 if (c == '%')
5168 while (c != '\n') 5168 while (c != '\n' && c != EOF)
5169 c = getc (inf); 5169 c = getc (inf);
5170 else if (c == TEX_LESC || c == TEX_SESC ) 5170 else if (c == TEX_LESC || c == TEX_SESC )
5171 break; 5171 break;
@@ -6259,9 +6259,10 @@ readline (lbp, stream)
6259 int start, lno; 6259 int start, lno;
6260 6260
6261 if (DEBUG) start = 0; /* shut up the compiler */ 6261 if (DEBUG) start = 0; /* shut up the compiler */
6262 if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) == 1) 6262 if (sscanf (lbp->buffer, "#line %d %n\"", &lno, &start) >= 1
6263 && lbp->buffer[start] == '"')
6263 { 6264 {
6264 char *endp = lbp->buffer + start; 6265 char *endp = lbp->buffer + ++start;
6265 6266
6266 assert (start > 0); 6267 assert (start > 0);
6267 while ((endp = etags_strchr (endp, '"')) != NULL 6268 while ((endp = etags_strchr (endp, '"')) != NULL
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index dabcdb2f911..53f8448edfc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,294 @@
12006-08-16 Richard Stallman <rms@gnu.org>
2
3 * term/x-win.el (x-clipboard-yank): Specify * in interactive spec.
4 (special-event-map): Process drag-n-drop events this way.
5
6 * simple.el (move-beginning-of-line): Test whether fields
7 would prevent motion back to line's first visible character.
8 If so, stop where the fields would stop the motion.
9
10 * newcomment.el (comment-indent): Fully update INDENT
11 before checking to see if it will change the text.
12
13 * cus-edit.el (custom-newline): New function.
14 (custom-mode-map): Bind newline to custom-newline.
15
16 * compare-w.el (compare-windows): Factor compare-ignore-whitespace
17 into ignore-whitespace.
18 Check each buffer for its skip-function.
19 Handle compare-windows-skip-whitespace special-case test
20 by returning t from default skip function.
21
222006-08-15 Carsten Dominik <dominik@science.uva.nl>
23
24 * textmodes/org.el (org-clock-special-range,
25 org-clock-update-time-maybe): New functions.
26 (org-stamp-time-of-day-regexp): Allow weekday to be of word chars,
27 not only a-z.
28 (org-agenda-get-blocks): Allow multiple blocks per headline.
29 (org-timestamp-change): Call `org-clock-update-time-maybe'.
30 (org-export-html-title-format)
31 (org-export-html-toplevel-hlevel): New options.
32 (org-export-language-setup): Added support for Czech.
33 (org-mode, org-insert-todo-heading, org-find-visible)
34 (org-find-invisible, org-invisible-p, org-invisible-p2)
35 (org-back-to-heading, org-on-heading-p, org-up-heading-all)
36 (org-show-subtree, org-show-entry, org-make-options-regexp):
37 Removed compatibility support for old outline-mode.
38 (org-check-occur-regexp): Funtion removed.
39 (org-on-heading-p, org-back-to-heading): Made defalias.
40 (org-set-local): New defsubst.
41 (org-set-regexps-and-options, org-mode)
42 (org-set-font-lock-defaults, org-edit-agenda-file-list)
43 (org-timeline, org-agenda-list, org-todo-list, org-tags-view)
44 (org-remember-apply-template, org-table-edit-field)
45 (org-table-edit-formulas, orgtbl-mode, org-export-as-ascii)
46 (org-set-autofill-regexps): Use `org-set-local'.
47 (org-table-eval-formula): Fixed bug with parsing of display flags.
48
492006-08-15 Nick Roberts <nickrob@snap.net.nz>
50
51 * progmodes/gdb-ui.el (gdb-info-stack-custom): Indicate selected
52 frame with fringe arrow. Suggested by Simon Marshall
53 <simon.marshall@misys.com>.
54 (gdb-stack-position): New variable.
55 (gdb-starting, gdb-exited): Reset gdb-stack-position to nil.
56 (gdb-frames-mode): Set gdb-stack-position to nil. Add to
57 overlay-arrow-variable-list
58 (gdb-reset): Delete gdb-stack-position from above list.
59
602006-08-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
61
62 * term/x-win.el (menu-bar-edit-menu): Disable paste if buffer is
63 read only.
64
652006-08-13 Romain Francoise <romain@orebokech.com>
66
67 * cus-theme.el (customize-create-theme)
68 (custom-theme-visit-theme): End `y-or-n-p' prompt with a space.
69
70 * filesets.el (filesets-add-buffer): Ditto.
71
72 * pcvs.el (cvs-change-cvsroot): Ditto.
73
742006-08-13 Nick Roberts <nickrob@snap.net.nz>
75
76 * progmodes/gdb-ui.el (gdb-frame-separate-io-buffer)
77 (gdb-use-separate-io-buffer, menu): Avoid using `inferior' in text.
78 (gdb-memory-mode, gdb-locals-watch-map): Don't quote lambda
79 expressions.
80 (gdb-info-breakpoints-custom): Use gdb-breakpoint-regexp.
81 Only search till end of line.
82 Add face to function names in case of no filename.
83 Add face to variable names of watchpoints.
84
852006-08-12 Robert Thorpe <rthorpe@realworldtech.com> (tiny change)
86
87 * cus-start.el <indent-tabs-mode>: Move to the `indent'
88 customization group.
89
902006-08-12 Ken Manheimer <ken.manheimer@gmail.com>
91
92 * allout.el (allout-prior-bindings, allout-added-bindings):
93 Remove, after long deprecation.
94 (allout-beginning-of-line-cycles, allout-end-of-line-cycles):
95 Add customization vars controlling allout-beginning-of-line and
96 allout-end-of-line conveniences.
97 (allout-header-prefix, allout-use-mode-specific-leader)
98 (allout-use-mode-specific-leader, allout-mode-leaders): Revised
99 docstrings.
100 (allout-infer-header-lead): Change to be an alias for
101 allout-infer-header-lead-and-primary-bullet.
102 (allout-infer-header-lead-and-primary-bullet): New version of
103 allout-infer-header-lead which assigns the primary bullet to the
104 same as the header lead, when its being changed.
105 (allout-infer-body-reindent): Apply regexp-quote instead of
106 unconditionally prepending "\\", so that all literal
107 allout-header-prefix and allout-primary-bullet strings are
108 properly handled.
109 (allout-add-resumptions): Add optional qualifier for extending or
110 appending to existing values, rather than replacing them.
111 (allout-view-change-hook): Clarify docstring.
112 (allout-exposure-change-hook): Take explicit arguments, via
113 run-hook-with-args.
114 (allout-structure-added-hook)
115 (allout-structure-deleted-hook)
116 (allout-structure-shifted-hook): New hooks analogous to
117 allout-exposure-change-hook for other kinds of structural outline
118 edits.
119 (allout-encryption-plaintext-sanitization-regexps): New encryption
120 customization variable, by which cooperating modes can provde
121 massage of the plaintext without actually being passed it.
122 (allout-encryption-ciphertext-rejection-regexps)
123 (allout-encryption-ciphertext-rejection-ceiling): New encryption
124 customization variables, by which cooperating modes can prohibit
125 rare but possible ciphertext patterns from fouling their
126 operation, with actually being passed the ciphertext.
127 (allout-mode): Run activation and deactivation hooks after the
128 minor-mode variable has been toggled, to clarify the mode
129 disposition. The new encryption ciphertext rejection variable is
130 used to ensure that the ciphertext does not contain text that
131 would be recognized as outline structural elements by allout.
132 Substite allout-beginning-of-line and allout-end-of-line for
133 conventionall beginning-of-line and end-of-line bindings.
134 If allout-old-style-prefixes is non-nil, don't nullify it on mode
135 activation!
136 (allout-beginning-of-line): Respect `allout-beginning-of-line-cycles'.
137 (allout-end-of-line): Respect `allout-end-of-line-cycles'.
138 (allout-chart-subtree): Implement new mode, charting only the
139 visible items in the subtree, when new 'visible' parameter is
140 non-nil.
141 (allout-end-of-subtree): Properly handle the last item in the
142 buffer.
143 (allout-pre-command-business, allout-command-counter): Increment
144 an advertised counter so that cooperating enhancements can track
145 revisions of items.
146 (allout-open-topic): Run allout-structure-added-hook with suitable
147 arguments.
148 (allout-shift-in): Run allout-structure-shifted-hook with suitable
149 arguments.
150 (allout-shift-out): Fix doubling for negative args and ensure call
151 of allout-structure-shifted-hook by solely using allout-shift-in.
152 (allout-kill-line, allout-kill-topic): Run
153 allout-structure-deleted-hook with suitable arguments.
154 (allout-yank-processing): Run allout-structure-added-hook with
155 proper arguments.
156 (allout-yank): Enclose activity in allout-unprotected.
157 (allout-flag-region): Run allout-exposure-change-hook with
158 suitable arguments, instead of making the callee infer the
159 arguments.
160 (allout-encrypt-string): Support
161 allout-encryption-plaintext-sanitization-regexps,
162 allout-encryption-ciphertext-rejection-regexps, and
163 allout-encryption-ciphertext-rejection-ceiling. Indicate correct
164 en/de cryption mode in symmetric encryption failure message.
165 (allout-obtain-passphrase): Use copy-sequence to get a distinct
166 copy of the passphrase, and don't zero it or we'll corrupt the
167 stashed copy.
168 (allout-create-encryption-passphrase-verifier)
169 (allout-verify-passphrase): Respect the new signature for
170 allout-encrypt-string.
171 (allout-get-configvar-values): Convenience for getting a
172 configuration variable value and handling its absence gracefully.
173
1742006-08-11 Romain Francoise <romain@orebokech.com>
175
176 * obsolete/zone-mode.el: Delete.
177
1782006-08-11 Stefan Monnier <monnier@iro.umontreal.ca>
179
180 * textmodes/dns-mode.el (dns-mode): Use before-save-hook.
181
1822006-08-11 Thien-Thi Nguyen <ttn@gnu.org>
183
184 * emacs-lisp/bindat.el (bindat-ip-to-string):
185 Use `format-network-address' if possible.
186
1872006-08-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
188
189 * x-dnd.el (x-dnd-init-frame): Call x-register-dnd-atom.
190
1912006-08-10 Chong Yidong <cyd@stupidchicken.com>
192
193 * emacs-lisp/edebug.el (edebug-recursive-edit): Don't save and
194 restore unread-command-events here.
195 (edebug-display): Do it here, to detect sit-for interruptions.
196
1972006-08-10 Romain Francoise <romain@orebokech.com>
198
199 * textmodes/dns-mode.el: Alias `zone-mode' to `dns-mode'.
200 (dns-mode-soa-auto-increment-serial): New user option.
201 (dns-mode-soa-maybe-increment-serial): New function.
202 (dns-mode): Add the latter to `write-contents-functions'.
203
204 * obsolete/zone-mode.el: Move to obsolete/ from net/.
205 Delete autoload cookies.
206
2072006-08-10 John Wiegley <johnw@newartisans.com>
208
209 * eshell/em-glob.el (eshell-glob-chars-list)
210 (eshell-glob-translate-alist): Add support for [^g] in character globs.
211
2122006-08-10 Richard Stallman <rms@gnu.org>
213
214 * facemenu.el (facemenu-add-face): Pass frame to facemenu-active-faces.
215 (facemenu-set-face): Doc fix.
216 (facemenu-listed-faces): Doc fix.
217
2182006-08-09 Chong Yidong <cyd@stupidchicken.com>
219
220 * avoid.el (mouse-avoidance-animating-pointer): New var.
221 (mouse-avoidance-nudge-mouse): Use it.
222 (mouse-avoidance-banish): Rename from mouse-avoidance-banish-hook.
223 (mouse-avoidance-exile): Rename from mouse-avoidance-exile-hook
224 (mouse-avoidance-fancy): Rename from mouse-avoidance-fancy-hook.
225 Don't activate if currently animating. All callers changed.
226
2272006-08-09 John Wiegley <johnw@newartisans.com>
228
229 * calendar/timeclock.el (timeclock-use-elapsed): Added a new
230 variable, which causes timeclock to report elapsed time worked,
231 instead of just work remaining.
232
2332006-08-09 Kenichi Handa <handa@m17n.org>
234
235 * international/latexenc.el (latexenc-find-file-coding-system):
236 Fix for the case that the 2nd element of arg-list is a cons.
237
2382006-08-08 Chong Yidong <cyd@stupidchicken.com>
239
240 * info.el (Info-fontify-node): Handle preceding `in' for note
241 reference hiding rules.
242
2432006-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
244
245 * progmodes/sh-script.el (sh-quoted-subshell): Make sure we don't
246 mistake a closing " for an opening one.
247
2482006-08-07 Dan Nicolaescu <dann@ics.uci.edu>
249
250 * term/xterm.el (terminal-init-xterm): Add more key bindings.
251
2522006-08-07 Stefan Monnier <monnier@iro.umontreal.ca>
253
254 * complete.el (PC-do-completion): Filter out completions matching
255 completion-ignored-extensions before checking whether there are
256 multiple completions.
257 Don't use `list' unnecessarily when building completion tables.
258
2592006-08-06 Richard Stallman <rms@gnu.org>
260
261 * help.el (describe-mode): Make minor mode list more concise.
262
2632006-08-05 Chong Yidong <cyd@stupidchicken.com>
264
265 * bindings.el: Give mode-line-format, mode-line-modes, and
266 mode-line-position `standard-value' properties.
267
2682006-08-05 Eli Zaretskii <eliz@gnu.org>
269
270 * buff-menu.el (list-buffers-noselect): For Info buffers, use
271 "(file)node" instead of the file name.
272
2732006-08-05 Richard Stallman <rms@gnu.org>
274
275 * faces.el (escape-glyph): Doc fix.
276
2772006-08-04 Kenichi Handa <handa@m17n.org>
278
279 * international/mule-diag.el (describe-font): Improve docstring
280 and error message. Use frame-parameter (not frame-parameters).
281
2822006-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
283
284 * progmodes/gud.el (gdb-script-font-lock-syntactic-keywords):
285 Correctly mark the end-of-docstring char.
286
2872006-08-03 Chong Yidong <cyd@stupidchicken.com>
288
289 * simple.el (line-move-to-column): Constrain move-to-column to
290 current field.
291
12006-08-03 Stefan Monnier <monnier@iro.umontreal.ca> 2922006-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
2 293
3 * font-lock.el (font-lock-beg, font-lock-end) 294 * font-lock.el (font-lock-beg, font-lock-end)
@@ -173,9 +464,9 @@
173 464
1742006-07-26 Mathias Dahl <mathias.dahl@gmail.com> 4652006-07-26 Mathias Dahl <mathias.dahl@gmail.com>
175 466
176 * tumme.el (tumme-backward-image): Add prefix argument. Add error 467 * tumme.el (tumme-backward-image): Add prefix argument. Add error
177 when at first image. 468 when at first image.
178 (tumme-forward-image): Add prefix argument. Add error when at last 469 (tumme-forward-image): Add prefix argument. Add error when at last
179 image. 470 image.
180 471
1812006-07-25 Stefan Monnier <monnier@iro.umontreal.ca> 4722006-07-25 Stefan Monnier <monnier@iro.umontreal.ca>
@@ -239,8 +530,8 @@
2392006-07-24 Daiki Ueno <ueno@unixuser.org> 5302006-07-24 Daiki Ueno <ueno@unixuser.org>
240 531
241 * pgg-def.el (pgg-truncate-key-identifier): Truncate the key ID to 8 532 * pgg-def.el (pgg-truncate-key-identifier): Truncate the key ID to 8
242 letters from the end. Thanks to "David Smith" <davidsmith@acm.org> and 533 letters from the end. Thanks to "David Smith" <davidsmith@acm.org>
243 andreas@altroot.de (Andreas V,Av(Bgele) 534 and andreas@altroot.de (Andreas V,Av(Bgele).
244 535
2452006-07-23 Thien-Thi Nguyen <ttn@gnu.org> 5362006-07-23 Thien-Thi Nguyen <ttn@gnu.org>
246 537
@@ -279,7 +570,7 @@
2792006-07-21 Dan Nicolaescu <dann@ics.uci.edu> 5702006-07-21 Dan Nicolaescu <dann@ics.uci.edu>
280 571
281 * term/xterm.el (terminal-init-xterm): Fix key bindings 572 * term/xterm.el (terminal-init-xterm): Fix key bindings
282 syntax. Bind S-return, C-M-., C-TAB, S-TAB and C-S-TAB. 573 syntax. Bind S-return, C-M-., C-TAB, S-TAB and C-S-TAB.
283 574
2842006-07-21 Eli Zaretskii <eliz@gnu.org> 5752006-07-21 Eli Zaretskii <eliz@gnu.org>
285 576
@@ -315,7 +606,7 @@
315 606
316 * calc.el (calc-previous-alg-entry): Remove variable. 607 * calc.el (calc-previous-alg-entry): Remove variable.
317 608
318 * calc-aent.el (calc-alg-entry-history, calc-quick-calc-history): 609 * calc-aent.el (calc-alg-entry-history, calc-quick-calc-history):
319 New variables. 610 New variables.
320 (calc-alg-entry): Use `calc-alg-entry-history'. 611 (calc-alg-entry): Use `calc-alg-entry-history'.
321 (calc-do-quick-calc): Use `calc-quick-calc-history'. 612 (calc-do-quick-calc): Use `calc-quick-calc-history'.
@@ -639,8 +930,8 @@
639 930
6402006-07-10 Chong Yidong <cyd@stupidchicken.com> 9312006-07-10 Chong Yidong <cyd@stupidchicken.com>
641 932
642 * progmodes/cc-awk.el (defconst): Use eval-and-compile to avoid 933 * progmodes/cc-awk.el (c-awk-escaped-nls*): Use eval-and-compile to
643 compilation error. 934 avoid compilation error.
644 935
645 * subr.el (sit-for): New function. 936 * subr.el (sit-for): New function.
646 937
diff --git a/lisp/allout.el b/lisp/allout.el
index f1f262c70b7..379f664d092 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -213,15 +213,73 @@ just the header."
213(put 'allout-show-bodies 'safe-local-variable 213(put 'allout-show-bodies 'safe-local-variable
214 (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil))))) 214 (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil)))))
215 215
216;;;_ = allout-beginning-of-line-cycles
217(defcustom allout-beginning-of-line-cycles t
218 "*If non-nil, \\[allout-beginning-of-line] will cycle through smart-placement options.
219
220Cycling only happens on when the command is repeated, not when it
221follows a different command.
222
223Smart-placement means that repeated calls to this function will
224advance as follows:
225
226 - if the cursor is on a non-headline body line and not on the first column:
227 then it goes to the first column
228 - if the cursor is on the first column of a non-headline body line:
229 then it goes to the start of the headline within the item body
230 - if the cursor is on the headline and not the start of the headline:
231 then it goes to the start of the headline
232 - if the cursor is on the start of the headline:
233 then it goes to the bullet character \(for hotspot navigation\)
234 - if the cursor is on the bullet character:
235 then it goes to the first column of that line \(the headline\)
236 - if the cursor is on the first column of the headline:
237 then it goes to the start of the headline within the item body.
238
239In this fashion, you can use the beginning-of-line command to do
240its normal job and then, when repeated, advance through the
241entry, cycling back to start.
242
243If this configuration variable is nil, then the cursor is just
244advanced to the beginning of the line and remains there on
245repeated calls."
246 :type 'boolean :group 'allout)
247;;;_ = allout-end-of-line-cycles
248(defcustom allout-end-of-line-cycles t
249 "*If non-nil, \\[allout-end-of-line] will cycle through smart-placement options.
250
251Cycling only happens on when the command is repeated, not when it
252follows a different command.
253
254Smart-placement means that repeated calls to this function will
255advance as follows:
256
257 - if the cursor is not on the end-of-line,
258 then it goes to the end-of-line
259 - if the cursor is on the end-of-line but not the end-of-entry,
260 then it goes to the end-of-entry, exposing it if necessary
261 - if the cursor is on the end-of-entry,
262 then it goes to the end of the head line
263
264In this fashion, you can use the end-of-line command to do its
265normal job and then, when repeated, advance through the entry,
266cycling back to start.
267
268If this configuration variable is nil, then the cursor is just
269advanced to the end of the line and remains there on repeated
270calls."
271 :type 'boolean :group 'allout)
272
216;;;_ = allout-header-prefix 273;;;_ = allout-header-prefix
217(defcustom allout-header-prefix "." 274(defcustom allout-header-prefix "."
275;; this string is treated as literal match. it will be `regexp-quote'd, so
276;; one cannot use regular expressions to match varying header prefixes.
218 "*Leading string which helps distinguish topic headers. 277 "*Leading string which helps distinguish topic headers.
219 278
220Outline topic header lines are identified by a leading topic 279Outline topic header lines are identified by a leading topic
221header prefix, which mostly have the value of this var at their front. 280header prefix, which mostly have the value of this var at their front.
222\(Level 1 topics are exceptions. They consist of only a single 281Level 1 topics are exceptions. They consist of only a single
223character, which is typically set to the `allout-primary-bullet'. Many 282character, which is typically set to the `allout-primary-bullet'."
224outlines start at level 2 to avoid this discrepancy."
225 :type 'string 283 :type 'string
226 :group 'allout) 284 :group 'allout)
227(make-variable-buffer-local 'allout-header-prefix) 285(make-variable-buffer-local 'allout-header-prefix)
@@ -300,11 +358,13 @@ strings."
300(defcustom allout-use-mode-specific-leader t 358(defcustom allout-use-mode-specific-leader t
301 "*When non-nil, use mode-specific topic-header prefixes. 359 "*When non-nil, use mode-specific topic-header prefixes.
302 360
303Allout outline mode will use the mode-specific `allout-mode-leaders' 361Allout outline mode will use the mode-specific `allout-mode-leaders' or
304and/or comment-start string, if any, to lead the topic prefix string, 362comment-start string, if any, to lead the topic prefix string, so topic
305so topic headers look like comments in the programming language. 363headers look like comments in the programming language. It will also use
364the comment-start string, with an '_' appended, for `allout-primary-bullet'.
306 365
307String values are used as they stand. 366String values are used as literals, not regular expressions, so
367do not escape any regulare-expression characters.
308 368
309Value t means to first check for assoc value in `allout-mode-leaders' 369Value t means to first check for assoc value in `allout-mode-leaders'
310alist, then use comment-start string, if any, then use default \(`.'). 370alist, then use comment-start string, if any, then use default \(`.').
@@ -313,15 +373,17 @@ alist, then use comment-start string, if any, then use default \(`.').
313Set to the symbol for either of `allout-mode-leaders' or 373Set to the symbol for either of `allout-mode-leaders' or
314`comment-start' to use only one of them, respectively. 374`comment-start' to use only one of them, respectively.
315 375
316Value nil means to always use the default \(`.'). 376Value nil means to always use the default \(`.') and leave
317 377`allout-primary-bullet' unaltered.
318comment-start strings that do not end in spaces are tripled, and an 378
319`_' underscore is tacked on the end, to distinguish them from regular 379comment-start strings that do not end in spaces are tripled in
320comment strings. comment-start strings that do end in spaces are not 380the header-prefix, and an `_' underscore is tacked on the end, to
321tripled, but an underscore is substituted for the space. [This 381distinguish them from regular comment strings. comment-start
322presumes that the space is for appearance, not comment syntax. You 382strings that do end in spaces are not tripled, but an underscore
323can use `allout-mode-leaders' to override this behavior, when 383is substituted for the space. [This presumes that the space is
324incorrect.]" 384for appearance, not comment syntax. You can use
385`allout-mode-leaders' to override this behavior, when
386undesired.]"
325 :type '(choice (const t) (const nil) string 387 :type '(choice (const t) (const nil) string
326 (const allout-mode-leaders) 388 (const allout-mode-leaders)
327 (const comment-start)) 389 (const comment-start))
@@ -334,13 +396,14 @@ incorrect.]"
334(defvar allout-mode-leaders '() 396(defvar allout-mode-leaders '()
335 "Specific allout-prefix leading strings per major modes. 397 "Specific allout-prefix leading strings per major modes.
336 398
337Entries will be used instead or in lieu of mode-specific 399Use this if the mode's comment-start string isn't what you
338comment-start strings. See also `allout-use-mode-specific-leader'. 400prefer, or if the mode lacks a comment-start string. See
401`allout-use-mode-specific-leader' for more details.
339 402
340If you're constructing a string that will comment-out outline 403If you're constructing a string that will comment-out outline
341structuring so it can be included in program code, append an extra 404structuring so it can be included in program code, append an extra
342character, like an \"_\" underscore, to distinguish the lead string 405character, like an \"_\" underscore, to distinguish the lead string
343from regular comments that start at bol.") 406from regular comments that start at the beginning-of-line.")
344 407
345;;;_ = allout-old-style-prefixes 408;;;_ = allout-old-style-prefixes
346(defcustom allout-old-style-prefixes nil 409(defcustom allout-old-style-prefixes nil
@@ -828,9 +891,9 @@ language comments. Returns the leading string."
828 (setq allout-reindent-bodies nil) 891 (setq allout-reindent-bodies nil)
829 (allout-reset-header-lead header-lead) 892 (allout-reset-header-lead header-lead)
830 header-lead) 893 header-lead)
831;;;_ > allout-infer-header-lead () 894;;;_ > allout-infer-header-lead-and-primary-bullet ()
832(defun allout-infer-header-lead () 895(defun allout-infer-header-lead-and-primary-bullet ()
833 "Determine appropriate `allout-header-prefix'. 896 "Determine appropriate `allout-header-prefix' and `allout-primary-bullet'.
834 897
835Works according to settings of: 898Works according to settings of:
836 899
@@ -874,10 +937,14 @@ invoking it directly."
874 "_"))))))) 937 "_")))))))
875 (if (not leader) 938 (if (not leader)
876 nil 939 nil
877 (if (string= leader allout-header-prefix) 940 (setq allout-header-prefix leader)
878 nil ; no change, nothing to do. 941 (if (not allout-old-style-prefixes)
879 (setq allout-header-prefix leader) 942 ;; setting allout-primary-bullet makes the top level topics use -
880 allout-header-prefix)))) 943 ;; actually, be - the special prefix:
944 (setq allout-primary-bullet leader))
945 allout-header-prefix)))
946(defalias 'allout-infer-header-lead
947 'allout-infer-header-lead-and-primary-bullet)
881;;;_ > allout-infer-body-reindent () 948;;;_ > allout-infer-body-reindent ()
882(defun allout-infer-body-reindent () 949(defun allout-infer-body-reindent ()
883 "Determine proper setting for `allout-reindent-bodies'. 950 "Determine proper setting for `allout-reindent-bodies'.
@@ -930,13 +997,13 @@ Works with respect to `allout-plain-bullets-string' and
930 (setq allout-plain-bullets-string-len (length allout-plain-bullets-string)) 997 (setq allout-plain-bullets-string-len (length allout-plain-bullets-string))
931 (setq allout-header-subtraction (1- (length allout-header-prefix))) 998 (setq allout-header-subtraction (1- (length allout-header-prefix)))
932 ;; Produce the new allout-regexp: 999 ;; Produce the new allout-regexp:
933 (setq allout-regexp (concat "\\(\\" 1000 (setq allout-regexp (concat "\\("
934 allout-header-prefix 1001 (regexp-quote allout-header-prefix)
935 "[ \t]*[" 1002 "[ \t]*["
936 allout-bullets-string 1003 allout-bullets-string
937 "]\\)\\|\\" 1004 "]\\)\\|"
938 allout-primary-bullet 1005 (regexp-quote allout-primary-bullet)
939 "+\\|\^l")) 1006 "+\\|\^l"))
940 (setq allout-line-boundary-regexp 1007 (setq allout-line-boundary-regexp
941 (concat "\\(\n\\)\\(" allout-regexp "\\)")) 1008 (concat "\\(\n\\)\\(" allout-regexp "\\)"))
942 (setq allout-bob-regexp 1009 (setq allout-bob-regexp
@@ -965,16 +1032,6 @@ See doc string for allout-keybindings-list for format of binding list."
965 (car (cdr cell))))))) 1032 (car (cdr cell)))))))
966 keymap-list) 1033 keymap-list)
967 map)) 1034 map))
968;;;_ = allout-prior-bindings - being deprecated.
969(defvar allout-prior-bindings nil
970 "Variable for use in V18, with allout-added-bindings, for
971resurrecting, on mode deactivation, bindings that existed before
972activation. Being deprecated.")
973;;;_ = allout-added-bindings - being deprecated
974(defvar allout-added-bindings nil
975 "Variable for use in V18, with allout-prior-bindings, for
976resurrecting, on mode deactivation, bindings that existed before
977activation. Being deprecated.")
978;;;_ : Menu bar 1035;;;_ : Menu bar
979(defvar allout-mode-exposure-menu) 1036(defvar allout-mode-exposure-menu)
980(defvar allout-mode-editing-menu) 1037(defvar allout-mode-editing-menu)
@@ -1050,43 +1107,65 @@ See `allout-add-resumptions' and `allout-do-resumptions'.")
1050(make-variable-buffer-local 'allout-mode-prior-settings) 1107(make-variable-buffer-local 'allout-mode-prior-settings)
1051;;;_ > allout-add-resumptions (&rest pairs) 1108;;;_ > allout-add-resumptions (&rest pairs)
1052(defun allout-add-resumptions (&rest pairs) 1109(defun allout-add-resumptions (&rest pairs)
1053 "Set name/value pairs. 1110 "Set name/value PAIRS.
1054 1111
1055Old settings are preserved for later resumption using `allout-do-resumptions'. 1112Old settings are preserved for later resumption using `allout-do-resumptions'.
1056 1113
1114The new values are set as a buffer local. On resumption, the prior buffer
1115scope of the variable is restored along with its value. If it was a void
1116buffer-local value, then it is left as nil on resumption.
1117
1057The pairs are lists whose car is the name of the variable and car of the 1118The pairs are lists whose car is the name of the variable and car of the
1058cdr is the new value: '(some-var some-value)'. 1119cdr is the new value: '(some-var some-value)'. The pairs can actually be
1120triples, where the third element qualifies the disposition of the setting,
1121as described further below.
1059 1122
1060The new value is set as a buffer local. 1123If the optional third element is the symbol 'extend, then the new value
1124created by `cons'ing the second element of the pair onto the front of the
1125existing value.
1061 1126
1062If the variable was not previously buffer-local, then that is noted and the 1127If the optional third element is the symbol 'append, then the new value is
1063`allout-do-resumptions' will just `kill-local-variable' of that binding. 1128extended from the existing one by `append'ing a list containing the second
1129element of the pair onto the end of the existing value.
1064 1130
1065If it previously was buffer-local, the old value is noted and resurrected 1131Extension, and resumptions in general, should not be used for hook
1066by `allout-do-resumptions'. \(If the local value was previously void, then 1132functions - use the 'local mode of `add-hook' for that, instead.
1067it is left as nil on resumption.\)
1068 1133
1069The settings are stored on `allout-mode-prior-settings'." 1134The settings are stored on `allout-mode-prior-settings'."
1070 (while pairs 1135 (while pairs
1071 (let* ((pair (pop pairs)) 1136 (let* ((pair (pop pairs))
1072 (name (car pair)) 1137 (name (car pair))
1073 (value (cadr pair))) 1138 (value (cadr pair))
1139 (qualifier (if (> (length pair) 2)
1140 (caddr pair)))
1141 prior-value)
1074 (if (not (symbolp name)) 1142 (if (not (symbolp name))
1075 (error "Pair's name, %S, must be a symbol, not %s" 1143 (error "Pair's name, %S, must be a symbol, not %s"
1076 name (type-of name))) 1144 name (type-of name)))
1145 (setq prior-value (condition-case err
1146 (symbol-value name)
1147 (void-variable nil)))
1077 (when (not (assoc name allout-mode-prior-settings)) 1148 (when (not (assoc name allout-mode-prior-settings))
1078 ;; Not already added as a resumption, create the prior setting entry. 1149 ;; Not already added as a resumption, create the prior setting entry.
1079 (if (local-variable-p name) 1150 (if (local-variable-p name)
1080 ;; is already local variable - preserve the prior value: 1151 ;; is already local variable - preserve the prior value:
1081 (push (list name (condition-case err 1152 (push (list name prior-value) allout-mode-prior-settings)
1082 (symbol-value name)
1083 (void-variable nil)))
1084 allout-mode-prior-settings)
1085 ;; wasn't local variable, indicate so for resumption by killing 1153 ;; wasn't local variable, indicate so for resumption by killing
1086 ;; local value, and make it local: 1154 ;; local value, and make it local:
1087 (push (list name) allout-mode-prior-settings) 1155 (push (list name) allout-mode-prior-settings)
1088 (make-local-variable name))) 1156 (make-local-variable name)))
1089 (set name value)))) 1157 (if qualifier
1158 (cond ((eq qualifier 'extend)
1159 (if (not (listp prior-value))
1160 (error "extension of non-list prior value attempted")
1161 (set name (cons value prior-value))))
1162 ((eq qualifier 'append)
1163 (if (not (listp prior-value))
1164 (error "appending of non-list prior value attempted")
1165 (set name (append prior-value (list value)))))
1166 (t (error "unrecognized setting qualifier `%s' encountered"
1167 qualifier)))
1168 (set name value)))))
1090;;;_ > allout-do-resumptions () 1169;;;_ > allout-do-resumptions ()
1091(defun allout-do-resumptions () 1170(defun allout-do-resumptions ()
1092 "Resume all name/value settings registered by `allout-add-resumptions'. 1171 "Resume all name/value settings registered by `allout-add-resumptions'.
@@ -1121,18 +1200,67 @@ their settings before allout-mode was started."
1121 "Symbol for use as allout invisible-text overlay category.") 1200 "Symbol for use as allout invisible-text overlay category.")
1122;;;_ x allout-view-change-hook 1201;;;_ x allout-view-change-hook
1123(defvar allout-view-change-hook nil 1202(defvar allout-view-change-hook nil
1124 "*\(Deprecated\) Hook that's run after allout outline exposure changes. 1203 "*\(Deprecated\) A hook run after allout outline exposure changes.
1125 1204
1126Switch to using `allout-exposure-change-hook' instead. Both 1205Switch to using `allout-exposure-change-hook' instead. Both hooks are
1127variables are currently respected, but this one will be ignored 1206currently respected, but the other conveys the details of the exposure
1128in a subsequent allout version.") 1207change via explicit parameters, and this one will eventually be disabled in
1208a subsequent allout version.")
1129;;;_ = allout-exposure-change-hook 1209;;;_ = allout-exposure-change-hook
1130(defvar allout-exposure-change-hook nil 1210(defvar allout-exposure-change-hook nil
1131 "*Hook that's run after allout outline exposure changes. 1211 "*Hook that's run after allout outline subtree exposure changes.
1212
1213It is run at the conclusion of `allout-flag-region'.
1214
1215Functions on the hook must take three arguments:
1216
1217 - from - integer indicating the point at the start of the change.
1218 - to - integer indicating the point of the end of the change.
1219 - flag - change mode: nil for exposure, otherwise concealment.
1220
1221This hook might be invoked multiple times by a single command.
1222
1223This hook is replacing `allout-view-change-hook', which is being deprecated
1224and eventually will not be invoked.")
1225;;;_ = allout-structure-added-hook
1226(defvar allout-structure-added-hook nil
1227 "*Hook that's run after addition of items to the outline.
1228
1229Functions on the hook should take two arguments:
1230
1231 - new-start - integer indicating the point at the start of the first new item.
1232 - new-end - integer indicating the point of the end of the last new item.
1233
1234Some edits that introduce new items may missed by this hook -
1235specifically edits that native allout routines do not control.
1236
1237This hook might be invoked multiple times by a single command.")
1238;;;_ = allout-structure-deleted-hook
1239(defvar allout-structure-deleted-hook nil
1240 "*Hook that's run after disciplined deletion of subtrees from the outline.
1241
1242Functions on the hook must take two arguments:
1243
1244 - depth - integer indicating the depth of the subtree that was deleted.
1245 - removed-from - integer indicating the point where the subtree was removed.
1246
1247Some edits that remove or invalidate items may missed by this hook -
1248specifically edits that native allout routines do not control.
1132 1249
1133This variable will replace `allout-view-change-hook' in a subsequent allout 1250This hook might be invoked multiple times by a single command.")
1134version, though both are currently respected.") 1251;;;_ = allout-structure-shifted-hook
1252(defvar allout-structure-shifted-hook nil
1253 "*Hook that's run after shifting of items in the outline.
1135 1254
1255Functions on the hook should take two arguments:
1256
1257 - depth-change - integer indicating depth increase, negative for decrease
1258 - start - integer indicating the start point of the shifted parent item.
1259
1260Some edits that shift items can be missed by this hook - specifically edits
1261that native allout routines do not control.
1262
1263This hook might be invoked multiple times by a single command.")
1136;;;_ = allout-outside-normal-auto-fill-function 1264;;;_ = allout-outside-normal-auto-fill-function
1137(defvar allout-outside-normal-auto-fill-function nil 1265(defvar allout-outside-normal-auto-fill-function nil
1138 "Value of normal-auto-fill-function outside of allout mode. 1266 "Value of normal-auto-fill-function outside of allout mode.
@@ -1186,6 +1314,42 @@ state, if file variable adjustments are enabled. See
1186This is used to decrypt the topic that was currently being edited, if it 1314This is used to decrypt the topic that was currently being edited, if it
1187was encrypted automatically as part of a file write or autosave.") 1315was encrypted automatically as part of a file write or autosave.")
1188(make-variable-buffer-local 'allout-after-save-decrypt) 1316(make-variable-buffer-local 'allout-after-save-decrypt)
1317;;;_ = allout-encryption-plaintext-sanitization-regexps
1318(defvar allout-encryption-plaintext-sanitization-regexps nil
1319 "List of regexps whose matches are removed from plaintext before encryption.
1320
1321This is for the sake of removing artifacts, like escapes, that are added on
1322and not actually part of the original plaintext. The removal is done just
1323prior to encryption.
1324
1325Entries must be symbols that are bound to the desired values.
1326
1327Each value can be a regexp or a list with a regexp followed by a
1328substitution string. If it's just a regexp, all its matches are removed
1329before the text is encrypted. If it's a regexp and a substitution, the
1330substition is used against the regexp matches, a la `replace-match'.")
1331(make-variable-buffer-local 'allout-encryption-text-removal-regexps)
1332;;;_ = allout-encryption-ciphertext-rejection-regexps
1333(defvar allout-encryption-ciphertext-rejection-regexps nil
1334 "Variable for regexps matching plaintext to remove before encryption.
1335
1336This is for the sake of redoing encryption in cases where the ciphertext
1337incidentally contains strings that would disrupt mode operation -
1338for example, a line that happens to look like an allout-mode topic prefix.
1339
1340Entries must be symbols that are bound to the desired regexp values.
1341
1342The encryption will be retried up to
1343`allout-encryption-ciphertext-rejection-limit' times, after which an error
1344is raised.")
1345
1346(make-variable-buffer-local 'allout-encryption-ciphertext-rejection-regexps)
1347;;;_ = allout-encryption-ciphertext-rejection-ceiling
1348(defvar allout-encryption-ciphertext-rejection-ceiling 5
1349 "Limit on number of times encryption ciphertext is rejected.
1350
1351See `allout-encryption-ciphertext-rejection-regexps' for rejection reasons.")
1352(make-variable-buffer-local 'allout-encryption-ciphertext-rejection-ceiling)
1189;;;_ > allout-mode-p () 1353;;;_ > allout-mode-p ()
1190;; Must define this macro above any uses, or byte compilation will lack 1354;; Must define this macro above any uses, or byte compilation will lack
1191;; proper def, if file isn't loaded - eg, during emacs build! 1355;; proper def, if file isn't loaded - eg, during emacs build!
@@ -1637,16 +1801,15 @@ OPEN: A topic that is not closed, though its offspring or body may be."
1637 (remove-overlays (point-min) (point-max) 1801 (remove-overlays (point-min) (point-max)
1638 'category 'allout-exposure-category) 1802 'category 'allout-exposure-category)
1639 1803
1640 (run-hooks 'allout-mode-deactivate-hook) 1804 (setq allout-mode nil)
1641 (setq allout-mode nil)) 1805 (run-hooks 'allout-mode-deactivate-hook))
1642 1806
1643 ;; Activation: 1807 ;; Activation:
1644 ((not active) 1808 ((not active)
1645 (setq allout-explicitly-deactivated nil) 1809 (setq allout-explicitly-deactivated nil)
1646 (if allout-old-style-prefixes 1810 (if allout-old-style-prefixes
1647 ;; Inhibit all the fancy formatting: 1811 ;; Inhibit all the fancy formatting:
1648 (allout-add-resumptions '((allout-primary-bullet "*") 1812 (allout-add-resumptions '(allout-primary-bullet "*")))
1649 (allout-old-style-prefixes ()))))
1650 1813
1651 (allout-overlay-preparations) ; Doesn't hurt to redo this. 1814 (allout-overlay-preparations) ; Doesn't hurt to redo this.
1652 1815
@@ -1654,15 +1817,28 @@ OPEN: A topic that is not closed, though its offspring or body may be."
1654 (allout-infer-body-reindent) 1817 (allout-infer-body-reindent)
1655 1818
1656 (set-allout-regexp) 1819 (set-allout-regexp)
1820 (allout-add-resumptions
1821 '(allout-encryption-ciphertext-rejection-regexps
1822 allout-line-boundary-regexp
1823 extend)
1824 '(allout-encryption-ciphertext-rejection-regexps
1825 allout-bob-regexp
1826 extend))
1657 1827
1658 ;; Produce map from current version of allout-keybindings-list: 1828 ;; Produce map from current version of allout-keybindings-list:
1659 (setq allout-mode-map 1829 (setq allout-mode-map
1660 (produce-allout-mode-map allout-keybindings-list)) 1830 (produce-allout-mode-map allout-keybindings-list))
1661 (substitute-key-definition 'beginning-of-line 1831 (substitute-key-definition 'beginning-of-line
1662 'move-beginning-of-line 1832 'allout-beginning-of-line
1833 allout-mode-map global-map)
1834 (substitute-key-definition 'move-beginning-of-line
1835 'allout-beginning-of-line
1663 allout-mode-map global-map) 1836 allout-mode-map global-map)
1664 (substitute-key-definition 'end-of-line 1837 (substitute-key-definition 'end-of-line
1665 'move-end-of-line 1838 'allout-end-of-line
1839 allout-mode-map global-map)
1840 (substitute-key-definition 'move-end-of-line
1841 'allout-end-of-line
1666 allout-mode-map global-map) 1842 allout-mode-map global-map)
1667 (produce-allout-mode-menubar-entries) 1843 (produce-allout-mode-menubar-entries)
1668 (fset 'allout-mode-map allout-mode-map) 1844 (fset 'allout-mode-map allout-mode-map)
@@ -1717,8 +1893,8 @@ OPEN: A topic that is not closed, though its offspring or body may be."
1717 (if allout-layout 1893 (if allout-layout
1718 (setq do-layout t)) 1894 (setq do-layout t))
1719 1895
1720 (run-hooks 'allout-mode-hook) 1896 (setq allout-mode t)
1721 (setq allout-mode t)) 1897 (run-hooks 'allout-mode-hook))
1722 1898
1723 ;; Reactivation: 1899 ;; Reactivation:
1724 ((setq do-layout t) 1900 ((setq do-layout t)
@@ -2044,6 +2220,52 @@ Outermost is first."
2044 (while (allout-hidden-p) 2220 (while (allout-hidden-p)
2045 (end-of-line) 2221 (end-of-line)
2046 (if (allout-hidden-p) (forward-char 1))))) 2222 (if (allout-hidden-p) (forward-char 1)))))
2223;;;_ > allout-beginning-of-line ()
2224(defun allout-beginning-of-line ()
2225 "Beginning-of-line with `allout-beginning-of-line-cycles' behavior, if set."
2226
2227 (interactive)
2228
2229 (if (or (not allout-beginning-of-line-cycles)
2230 (not (equal last-command this-command)))
2231 (move-beginning-of-line 1)
2232 (let ((beginning-of-body (save-excursion
2233 (allout-beginning-of-current-entry)
2234 (point))))
2235 (cond ((= (current-column) 0)
2236 (allout-beginning-of-current-entry))
2237 ((< (point) beginning-of-body)
2238 (allout-beginning-of-current-line))
2239 ((= (point) beginning-of-body)
2240 (goto-char (allout-current-bullet-pos)))
2241 (t (allout-beginning-of-current-line)
2242 (if (< (point) beginning-of-body)
2243 ;; we were on the headline after its start:
2244 (allout-beginning-of-current-entry)))))))
2245;;;_ > allout-end-of-line ()
2246(defun allout-end-of-line ()
2247 "End-of-line with `allout-end-of-line-cycles' behavior, if set."
2248
2249 (interactive)
2250
2251 (if (or (not allout-end-of-line-cycles)
2252 (not (equal last-command this-command)))
2253 (allout-end-of-current-line)
2254 (let ((end-of-entry (save-excursion
2255 (allout-end-of-entry)
2256 (point))))
2257 (cond ((not (eolp))
2258 (allout-end-of-current-line))
2259 ((or (allout-hidden-p) (save-excursion
2260 (forward-char -1)
2261 (allout-hidden-p)))
2262 (allout-back-to-current-heading)
2263 (allout-show-current-entry)
2264 (allout-end-of-entry))
2265 ((>= (point) end-of-entry)
2266 (allout-back-to-current-heading)
2267 (allout-end-of-current-line))
2268 (t (allout-end-of-entry))))))
2047;;;_ > allout-next-heading () 2269;;;_ > allout-next-heading ()
2048(defsubst allout-next-heading () 2270(defsubst allout-next-heading ()
2049 "Move to the heading for the topic \(possibly invisible) after this one. 2271 "Move to the heading for the topic \(possibly invisible) after this one.
@@ -2108,13 +2330,17 @@ Return the location of the beginning of the heading, or nil if not found."
2108;;; for assessment or adjustment of the subtree, without redundant 2330;;; for assessment or adjustment of the subtree, without redundant
2109;;; traversal of the structure. 2331;;; traversal of the structure.
2110 2332
2111;;;_ > allout-chart-subtree (&optional levels orig-depth prev-depth) 2333;;;_ > allout-chart-subtree (&optional levels visible orig-depth prev-depth)
2112(defun allout-chart-subtree (&optional levels orig-depth prev-depth) 2334(defun allout-chart-subtree (&optional levels visible orig-depth prev-depth)
2113 "Produce a location \"chart\" of subtopics of the containing topic. 2335 "Produce a location \"chart\" of subtopics of the containing topic.
2114 2336
2115Optional argument LEVELS specifies the depth \(relative to start 2337Optional argument LEVELS specifies the depth \(relative to start
2116depth) for the chart. Subsequent optional args are not for public 2338depth) for the chart.
2117use. 2339
2340When optional argument VISIBLE is non-nil, the chart includes
2341only the visible subelements of the charted subjects.
2342
2343The remaining optional args are not for internal use by the function.
2118 2344
2119Point is left at the end of the subtree. 2345Point is left at the end of the subtree.
2120 2346
@@ -2141,7 +2367,9 @@ starting point, and PREV-DEPTH is depth of prior topic."
2141 ; position to first offspring: 2367 ; position to first offspring:
2142 (progn (setq orig-depth (allout-depth)) 2368 (progn (setq orig-depth (allout-depth))
2143 (or prev-depth (setq prev-depth (1+ orig-depth))) 2369 (or prev-depth (setq prev-depth (1+ orig-depth)))
2144 (allout-next-heading))) 2370 (if visible
2371 (allout-next-visible-heading 1)
2372 (allout-next-heading))))
2145 2373
2146 ;; Loop over the current levels' siblings. Besides being more 2374 ;; Loop over the current levels' siblings. Besides being more
2147 ;; efficient than tail-recursing over a level, it avoids exceeding 2375 ;; efficient than tail-recursing over a level, it avoids exceeding
@@ -2163,8 +2391,12 @@ starting point, and PREV-DEPTH is depth of prior topic."
2163 ;; next heading at lesser depth: 2391 ;; next heading at lesser depth:
2164 (while (and (<= curr-depth 2392 (while (and (<= curr-depth
2165 (allout-recent-depth)) 2393 (allout-recent-depth))
2166 (allout-next-heading)))) 2394 (if visible
2167 (allout-next-heading))) 2395 (allout-next-visible-heading 1)
2396 (allout-next-heading)))))
2397 (if visible
2398 (allout-next-visible-heading 1)
2399 (allout-next-heading))))
2168 2400
2169 ((and (< prev-depth curr-depth) 2401 ((and (< prev-depth curr-depth)
2170 (or (not levels) 2402 (or (not levels)
@@ -2173,8 +2405,9 @@ starting point, and PREV-DEPTH is depth of prior topic."
2173 (setq chart 2405 (setq chart
2174 (cons (allout-chart-subtree (and levels 2406 (cons (allout-chart-subtree (and levels
2175 (1- levels)) 2407 (1- levels))
2176 orig-depth 2408 visible
2177 curr-depth) 2409 orig-depth
2410 curr-depth)
2178 chart)) 2411 chart))
2179 ;; ... then continue with this one. 2412 ;; ... then continue with this one.
2180 ) 2413 )
@@ -2369,7 +2602,9 @@ Returns the value of point."
2369 (while (and (not (eobp)) 2602 (while (and (not (eobp))
2370 (> (allout-recent-depth) level)) 2603 (> (allout-recent-depth) level))
2371 (allout-next-heading)) 2604 (allout-next-heading))
2372 (and (not (eobp)) (forward-char -1)) 2605 (if (eobp)
2606 (allout-end-of-entry)
2607 (forward-char -1))
2373 (if (and (not include-trailing-blank) (= ?\n (preceding-char))) 2608 (if (and (not include-trailing-blank) (= ?\n (preceding-char)))
2374 (forward-char -1)) 2609 (forward-char -1))
2375 (setq allout-recent-end-of-subtree (point)))) 2610 (setq allout-recent-end-of-subtree (point))))
@@ -2675,6 +2910,13 @@ hot-spot operation, where literal characters typed over a topic bullet
2675are mapped to the command of the corresponding control-key on the 2910are mapped to the command of the corresponding control-key on the
2676`allout-mode-map'.") 2911`allout-mode-map'.")
2677(make-variable-buffer-local 'allout-post-goto-bullet) 2912(make-variable-buffer-local 'allout-post-goto-bullet)
2913;;;_ = allout-command-counter
2914(defvar allout-command-counter 0
2915 "Counter that monotonically increases in allout-mode buffers.
2916
2917Set by `allout-pre-command-business', to support allout addons in
2918coordinating with allout activity.")
2919(make-variable-buffer-local 'allout-command-counter)
2678;;;_ > allout-post-command-business () 2920;;;_ > allout-post-command-business ()
2679(defun allout-post-command-business () 2921(defun allout-post-command-business ()
2680 "Outline `post-command-hook' function. 2922 "Outline `post-command-hook' function.
@@ -2692,7 +2934,7 @@ are mapped to the command of the corresponding control-key on the
2692 allout-after-save-decrypt) 2934 allout-after-save-decrypt)
2693 (allout-after-saves-handler)) 2935 (allout-after-saves-handler))
2694 2936
2695 ;; Implement -post-goto-bullet, if set: 2937 ;; Implement allout-post-goto-bullet, if set:
2696 (if (and allout-post-goto-bullet 2938 (if (and allout-post-goto-bullet
2697 (allout-current-bullet-pos)) 2939 (allout-current-bullet-pos))
2698 (progn (goto-char (allout-current-bullet-pos)) 2940 (progn (goto-char (allout-current-bullet-pos))
@@ -2701,7 +2943,9 @@ are mapped to the command of the corresponding control-key on the
2701;;;_ > allout-pre-command-business () 2943;;;_ > allout-pre-command-business ()
2702(defun allout-pre-command-business () 2944(defun allout-pre-command-business ()
2703 "Outline `pre-command-hook' function for outline buffers. 2945 "Outline `pre-command-hook' function for outline buffers.
2704Implements special behavior when cursor is on bullet character. 2946
2947Among other things, implements special behavior when the cursor is on the
2948topic bullet character.
2705 2949
2706When the cursor is on the bullet character, self-insert characters are 2950When the cursor is on the bullet character, self-insert characters are
2707reinterpreted as the corresponding control-character in the 2951reinterpreted as the corresponding control-character in the
@@ -2709,7 +2953,7 @@ reinterpreted as the corresponding control-character in the
2709the cursor which has moved as a result of such reinterpretation is 2953the cursor which has moved as a result of such reinterpretation is
2710positioned on the bullet character of the destination topic. 2954positioned on the bullet character of the destination topic.
2711 2955
2712The upshot is that you can get easy, single (ie, unmodified) key 2956The upshot is that you can get easy, single \(ie, unmodified\) key
2713outline maneuvering operations by positioning the cursor on the bullet 2957outline maneuvering operations by positioning the cursor on the bullet
2714char. When in this mode you can use regular cursor-positioning 2958char. When in this mode you can use regular cursor-positioning
2715command/keystrokes to relocate the cursor off of a bullet character to 2959command/keystrokes to relocate the cursor off of a bullet character to
@@ -2717,6 +2961,9 @@ return to regular interpretation of self-insert characters."
2717 2961
2718 (if (not (allout-mode-p)) 2962 (if (not (allout-mode-p))
2719 nil 2963 nil
2964 ;; Increment allout-command-counter
2965 (setq allout-command-counter (1+ allout-command-counter))
2966 ;; Do hot-spot navigation.
2720 (if (and (eq this-command 'self-insert-command) 2967 (if (and (eq this-command 'self-insert-command)
2721 (eq (point)(allout-current-bullet-pos))) 2968 (eq (point)(allout-current-bullet-pos)))
2722 (allout-hotspot-key-handler)))) 2969 (allout-hotspot-key-handler))))
@@ -2990,6 +3237,8 @@ case.)
2990 3237
2991If OFFER-RECENT-BULLET is true, offer to use the bullet of the prior sibling. 3238If OFFER-RECENT-BULLET is true, offer to use the bullet of the prior sibling.
2992 3239
3240Runs
3241
2993Nuances: 3242Nuances:
2994 3243
2995- Creation of new topics is with respect to the visible topic 3244- Creation of new topics is with respect to the visible topic
@@ -3040,7 +3289,8 @@ Nuances:
3040 allout-numbered-bullet)))) 3289 allout-numbered-bullet))))
3041 (point))) 3290 (point)))
3042 dbl-space 3291 dbl-space
3043 doing-beginning) 3292 doing-beginning
3293 start end)
3044 3294
3045 (if (not opening-on-blank) 3295 (if (not opening-on-blank)
3046 ; Positioning and vertical 3296 ; Positioning and vertical
@@ -3141,8 +3391,10 @@ Nuances:
3141 (not (bolp))) 3391 (not (bolp)))
3142 (forward-char 1)))) 3392 (forward-char 1))))
3143 )) 3393 ))
3394 (setq start (point))
3144 (insert (concat (allout-make-topic-prefix opening-numbered t depth) 3395 (insert (concat (allout-make-topic-prefix opening-numbered t depth)
3145 " ")) 3396 " "))
3397 (setq end (1+ (point)))
3146 3398
3147 (allout-rebullet-heading (and offer-recent-bullet ref-bullet) 3399 (allout-rebullet-heading (and offer-recent-bullet ref-bullet)
3148 depth nil nil t) 3400 depth nil nil t)
@@ -3150,6 +3402,8 @@ Nuances:
3150 (save-excursion (goto-char ref-topic) 3402 (save-excursion (goto-char ref-topic)
3151 (allout-show-children))) 3403 (allout-show-children)))
3152 (end-of-line) 3404 (end-of-line)
3405
3406 (run-hook-with-args 'allout-structure-added-hook start end)
3153 ) 3407 )
3154 ) 3408 )
3155;;;_ > allout-open-subtopic (arg) 3409;;;_ > allout-open-subtopic (arg)
@@ -3548,6 +3802,7 @@ discontinuity. The first topic in the file can be adjusted to any positive
3548depth, however." 3802depth, however."
3549 (interactive "p") 3803 (interactive "p")
3550 (if (> arg 0) 3804 (if (> arg 0)
3805 ;; refuse to create a containment discontinuity:
3551 (save-excursion 3806 (save-excursion
3552 (allout-back-to-current-heading) 3807 (allout-back-to-current-heading)
3553 (if (not (bobp)) 3808 (if (not (bobp))
@@ -3564,7 +3819,20 @@ depth, however."
3564 (1+ predecessor-depth))) 3819 (1+ predecessor-depth)))
3565 (error (concat "Disallowed shift deeper than" 3820 (error (concat "Disallowed shift deeper than"
3566 " containing topic's children."))))))) 3821 " containing topic's children.")))))))
3567 (allout-rebullet-topic arg)) 3822 (let ((where (point))
3823 has-successor)
3824 (if (and (< arg 0)
3825 (allout-current-topic-collapsed-p)
3826 (save-excursion (allout-next-sibling)))
3827 (setq has-successor t))
3828 (allout-rebullet-topic arg)
3829 (when (< arg 0)
3830 (save-excursion
3831 (if (allout-ascend)
3832 (allout-show-children)))
3833 (if has-successor
3834 (allout-show-children)))
3835 (run-hook-with-args 'allout-structure-shifted-hook arg where)))
3568;;;_ > allout-shift-out (arg) 3836;;;_ > allout-shift-out (arg)
3569(defun allout-shift-out (arg) 3837(defun allout-shift-out (arg)
3570 "Decrease depth of current heading and any topics collapsed within it. 3838 "Decrease depth of current heading and any topics collapsed within it.
@@ -3574,9 +3842,7 @@ one level greater than the immediately previous topic, to avoid containment
3574discontinuity. The first topic in the file can be adjusted to any positive 3842discontinuity. The first topic in the file can be adjusted to any positive
3575depth, however." 3843depth, however."
3576 (interactive "p") 3844 (interactive "p")
3577 (if (< arg 0) 3845 (allout-shift-in (* arg -1)))
3578 (allout-shift-in (* arg -1)))
3579 (allout-rebullet-topic (* arg -1)))
3580;;;_ : Surgery (kill-ring) functions with special provisions for outlines: 3846;;;_ : Surgery (kill-ring) functions with special provisions for outlines:
3581;;;_ > allout-kill-line (&optional arg) 3847;;;_ > allout-kill-line (&optional arg)
3582(defun allout-kill-line (&optional arg) 3848(defun allout-kill-line (&optional arg)
@@ -3610,7 +3876,8 @@ depth, however."
3610 (save-excursion ; Renumber subsequent topics if needed: 3876 (save-excursion ; Renumber subsequent topics if needed:
3611 (if (not (looking-at allout-regexp)) 3877 (if (not (looking-at allout-regexp))
3612 (allout-next-heading)) 3878 (allout-next-heading))
3613 (allout-renumber-to-depth depth)))))) 3879 (allout-renumber-to-depth depth)))
3880 (run-hook-with-args 'allout-structure-deleted-hook depth (point)))))
3614;;;_ > allout-kill-topic () 3881;;;_ > allout-kill-topic ()
3615(defun allout-kill-topic () 3882(defun allout-kill-topic ()
3616 "Kill topic together with subtopics. 3883 "Kill topic together with subtopics.
@@ -3656,7 +3923,8 @@ when yank with allout-yank into an outline as a heading."
3656 (allout-unprotected (kill-region beg (point))) 3923 (allout-unprotected (kill-region beg (point)))
3657 (sit-for 0) 3924 (sit-for 0)
3658 (save-excursion 3925 (save-excursion
3659 (allout-renumber-to-depth depth)))) 3926 (allout-renumber-to-depth depth))
3927 (run-hook-with-args 'allout-structure-deleted-hook depth (point))))
3660;;;_ > allout-yank-processing () 3928;;;_ > allout-yank-processing ()
3661(defun allout-yank-processing (&optional arg) 3929(defun allout-yank-processing (&optional arg)
3662 3930
@@ -3683,112 +3951,113 @@ however, are left exactly like normal, non-allout-specific yanks."
3683 ; region around subject: 3951 ; region around subject:
3684 (if (< (allout-mark-marker t) (point)) 3952 (if (< (allout-mark-marker t) (point))
3685 (exchange-point-and-mark)) 3953 (exchange-point-and-mark))
3686 (let* ((inhibit-field-text-motion t) 3954 (allout-unprotected
3687 (subj-beg (point)) 3955 (let* ((subj-beg (point))
3688 (into-bol (bolp)) 3956 (into-bol (bolp))
3689 (subj-end (allout-mark-marker t)) 3957 (subj-end (allout-mark-marker t))
3690 (was-collapsed (get-text-property subj-beg 'allout-was-collapsed)) 3958 (was-collapsed (get-text-property subj-beg 'allout-was-collapsed))
3691 ;; 'resituate' if yanking an entire topic into topic header: 3959 ;; 'resituate' if yanking an entire topic into topic header:
3692 (resituate (and (allout-e-o-prefix-p) 3960 (resituate (and (allout-e-o-prefix-p)
3693 (looking-at (concat "\\(" allout-regexp "\\)")) 3961 (looking-at (concat "\\(" allout-regexp "\\)"))
3694 (allout-prefix-data (match-beginning 1) 3962 (allout-prefix-data (match-beginning 1)
3695 (match-end 1)))) 3963 (match-end 1))))
3696 ;; `rectify-numbering' if resituating (where several topics may 3964 ;; `rectify-numbering' if resituating (where several topics may
3697 ;; be resituating) or yanking a topic into a topic slot (bol): 3965 ;; be resituating) or yanking a topic into a topic slot (bol):
3698 (rectify-numbering (or resituate 3966 (rectify-numbering (or resituate
3699 (and into-bol (looking-at allout-regexp))))) 3967 (and into-bol (looking-at allout-regexp)))))
3700 (if resituate 3968 (if resituate
3701 ; The yanked stuff is a topic: 3969 ; The yanked stuff is a topic:
3702 (let* ((prefix-len (- (match-end 1) subj-beg)) 3970 (let* ((prefix-len (- (match-end 1) subj-beg))
3703 (subj-depth (allout-recent-depth)) 3971 (subj-depth (allout-recent-depth))
3704 (prefix-bullet (allout-recent-bullet)) 3972 (prefix-bullet (allout-recent-bullet))
3705 (adjust-to-depth 3973 (adjust-to-depth
3706 ;; Nil if adjustment unnecessary, otherwise depth to which 3974 ;; Nil if adjustment unnecessary, otherwise depth to which
3707 ;; adjustment should be made: 3975 ;; adjustment should be made:
3708 (save-excursion 3976 (save-excursion
3709 (and (goto-char subj-end) 3977 (and (goto-char subj-end)
3710 (eolp) 3978 (eolp)
3711 (goto-char subj-beg) 3979 (goto-char subj-beg)
3712 (and (looking-at allout-regexp) 3980 (and (looking-at allout-regexp)
3713 (progn 3981 (progn
3714 (beginning-of-line) 3982 (beginning-of-line)
3715 (not (= (point) subj-beg))) 3983 (not (= (point) subj-beg)))
3716 (looking-at allout-regexp) 3984 (looking-at allout-regexp)
3717 (allout-prefix-data (match-beginning 0) 3985 (allout-prefix-data (match-beginning 0)
3718 (match-end 0))) 3986 (match-end 0)))
3719 (allout-recent-depth)))) 3987 (allout-recent-depth))))
3720 (more t)) 3988 (more t))
3721 (setq rectify-numbering allout-numbered-bullet) 3989 (setq rectify-numbering allout-numbered-bullet)
3722 (if adjust-to-depth 3990 (if adjust-to-depth
3723 ; Do the adjustment: 3991 ; Do the adjustment:
3724 (progn 3992 (progn
3725 (message "... yanking") (sit-for 0) 3993 (message "... yanking") (sit-for 0)
3726 (save-restriction 3994 (save-restriction
3727 (narrow-to-region subj-beg subj-end) 3995 (narrow-to-region subj-beg subj-end)
3728 ; Trim off excessive blank 3996 ; Trim off excessive blank
3729 ; line at end, if any: 3997 ; line at end, if any:
3730 (goto-char (point-max)) 3998 (goto-char (point-max))
3731 (if (looking-at "^$") 3999 (if (looking-at "^$")
3732 (allout-unprotected (delete-char -1))) 4000 (allout-unprotected (delete-char -1)))
3733 ; Work backwards, with each 4001 ; Work backwards, with each
3734 ; shallowest level, 4002 ; shallowest level,
3735 ; successively excluding the 4003 ; successively excluding the
3736 ; last processed topic from 4004 ; last processed topic from
3737 ; the narrow region: 4005 ; the narrow region:
3738 (while more 4006 (while more
3739 (allout-back-to-current-heading) 4007 (allout-back-to-current-heading)
3740 ; go as high as we can in each bunch: 4008 ; go as high as we can in each bunch:
3741 (while (allout-ascend-to-depth (1- (allout-depth)))) 4009 (while (allout-ascend-to-depth (1- (allout-depth))))
3742 (save-excursion 4010 (save-excursion
3743 (allout-rebullet-topic-grunt (- adjust-to-depth 4011 (allout-rebullet-topic-grunt (- adjust-to-depth
3744 subj-depth)) 4012 subj-depth))
3745 (allout-depth)) 4013 (allout-depth))
3746 (if (setq more (not (bobp))) 4014 (if (setq more (not (bobp)))
3747 (progn (widen) 4015 (progn (widen)
3748 (forward-char -1) 4016 (forward-char -1)
3749 (narrow-to-region subj-beg (point)))))) 4017 (narrow-to-region subj-beg (point))))))
3750 (message "") 4018 (message "")
3751 ;; Preserve new bullet if it's a distinctive one, otherwise 4019 ;; Preserve new bullet if it's a distinctive one, otherwise
3752 ;; use old one: 4020 ;; use old one:
3753 (if (string-match (regexp-quote prefix-bullet) 4021 (if (string-match (regexp-quote prefix-bullet)
3754 allout-distinctive-bullets-string) 4022 allout-distinctive-bullets-string)
3755 ; Delete from bullet of old to 4023 ; Delete from bullet of old to
3756 ; before bullet of new: 4024 ; before bullet of new:
3757 (progn 4025 (progn
3758 (beginning-of-line) 4026 (beginning-of-line)
3759 (delete-region (point) subj-beg) 4027 (delete-region (point) subj-beg)
3760 (set-marker (allout-mark-marker t) subj-end) 4028 (set-marker (allout-mark-marker t) subj-end)
3761 (goto-char subj-beg) 4029 (goto-char subj-beg)
3762 (allout-end-of-prefix)) 4030 (allout-end-of-prefix))
3763 ; Delete base subj prefix, 4031 ; Delete base subj prefix,
3764 ; leaving old one: 4032 ; leaving old one:
3765 (delete-region (point) (+ (point) 4033 (delete-region (point) (+ (point)
3766 prefix-len 4034 prefix-len
3767 (- adjust-to-depth subj-depth))) 4035 (- adjust-to-depth subj-depth)))
3768 ; and delete residual subj 4036 ; and delete residual subj
3769 ; prefix digits and space: 4037 ; prefix digits and space:
3770 (while (looking-at "[0-9]") (delete-char 1)) 4038 (while (looking-at "[0-9]") (delete-char 1))
3771 (if (looking-at " ") (delete-char 1)))) 4039 (if (looking-at " ") (delete-char 1))))
3772 (exchange-point-and-mark)))) 4040 (exchange-point-and-mark))))
3773 (if rectify-numbering 4041 (if rectify-numbering
3774 (progn 4042 (progn
3775 (save-excursion 4043 (save-excursion
3776 ; Give some preliminary feedback: 4044 ; Give some preliminary feedback:
3777 (message "... reconciling numbers") (sit-for 0) 4045 (message "... reconciling numbers") (sit-for 0)
3778 ; ... and renumber, in case necessary: 4046 ; ... and renumber, in case necessary:
3779 (goto-char subj-beg) 4047 (goto-char subj-beg)
3780 (if (allout-goto-prefix) 4048 (if (allout-goto-prefix)
3781 (allout-rebullet-heading nil ;;; solicit 4049 (allout-rebullet-heading nil ;;; solicit
3782 (allout-depth) ;;; depth 4050 (allout-depth) ;;; depth
3783 nil ;;; number-control 4051 nil ;;; number-control
3784 nil ;;; index 4052 nil ;;; index
3785 t)) 4053 t))
3786 (message "")))) 4054 (message ""))))
3787 (when (and (or into-bol resituate) was-collapsed) 4055 (when (and (or into-bol resituate) was-collapsed)
3788 (remove-text-properties subj-beg (1+ subj-beg) '(allout-was-collapsed)) 4056 (remove-text-properties subj-beg (1+ subj-beg) '(allout-was-collapsed))
3789 (allout-hide-current-subtree)) 4057 (allout-hide-current-subtree))
3790 (if (not resituate) 4058 (if (not resituate)
3791 (exchange-point-and-mark)))) 4059 (exchange-point-and-mark))
4060 (run-hook-with-args 'allout-structure-added-hook subj-beg subj-end))))
3792;;;_ > allout-yank (&optional arg) 4061;;;_ > allout-yank (&optional arg)
3793(defun allout-yank (&optional arg) 4062(defun allout-yank (&optional arg)
3794 "`allout-mode' yank, with depth and numbering adjustment of yanked topics. 4063 "`allout-mode' yank, with depth and numbering adjustment of yanked topics.
@@ -3820,10 +4089,10 @@ works with normal `yank' in non-outline buffers."
3820 4089
3821 (interactive "*P") 4090 (interactive "*P")
3822 (setq this-command 'yank) 4091 (setq this-command 'yank)
3823 (yank arg) 4092 (allout-unprotected
4093 (yank arg))
3824 (if (allout-mode-p) 4094 (if (allout-mode-p)
3825 (allout-yank-processing)) 4095 (allout-yank-processing)))
3826)
3827;;;_ > allout-yank-pop (&optional arg) 4096;;;_ > allout-yank-pop (&optional arg)
3828(defun allout-yank-pop (&optional arg) 4097(defun allout-yank-pop (&optional arg)
3829 "Yank-pop like `allout-yank' when popping to bare outline prefixes. 4098 "Yank-pop like `allout-yank' when popping to bare outline prefixes.
@@ -3882,9 +4151,13 @@ by pops to non-distinctive yanks. Bug..."
3882;;;_ - Fundamental 4151;;;_ - Fundamental
3883;;;_ > allout-flag-region (from to flag) 4152;;;_ > allout-flag-region (from to flag)
3884(defun allout-flag-region (from to flag) 4153(defun allout-flag-region (from to flag)
3885 "Conceal text from FROM to TO if FLAG is non-nil, else reveal it. 4154 "Conceal text between FROM and TO if FLAG is non-nil, else reveal it.
4155
4156Exposure-change hook `allout-exposure-change-hook' is run with the same
4157arguments as this function, after the exposure changes are made. \(The old
4158`allout-view-change-hook' is being deprecated, and eventually will not be
4159invoked.\)"
3886 4160
3887Text is shown if flag is nil and hidden otherwise."
3888 ;; We use outline invisibility spec. 4161 ;; We use outline invisibility spec.
3889 (remove-overlays from to 'category 'allout-exposure-category) 4162 (remove-overlays from to 'category 'allout-exposure-category)
3890 (when flag 4163 (when flag
@@ -3895,7 +4168,7 @@ Text is shown if flag is nil and hidden otherwise."
3895 (while props 4168 (while props
3896 (overlay-put o (pop props) (pop props))))))) 4169 (overlay-put o (pop props) (pop props)))))))
3897 (run-hooks 'allout-view-change-hook) 4170 (run-hooks 'allout-view-change-hook)
3898 (run-hooks 'allout-exposure-change-hook)) 4171 (run-hook-with-args 'allout-exposure-change-hook from to flag))
3899;;;_ > allout-flag-current-subtree (flag) 4172;;;_ > allout-flag-current-subtree (flag)
3900(defun allout-flag-current-subtree (flag) 4173(defun allout-flag-current-subtree (flag)
3901 "Conceal currently-visible topic's subtree if FLAG non-nil, else reveal it." 4174 "Conceal currently-visible topic's subtree if FLAG non-nil, else reveal it."
@@ -4071,10 +4344,12 @@ true, then single-line topics are considered to be collapsed. By
4071default, they are treated as being uncollapsed." 4344default, they are treated as being uncollapsed."
4072 (save-excursion 4345 (save-excursion
4073 (and 4346 (and
4074 (= (progn (allout-back-to-current-heading) 4347 ;; Is the topic all on one line (allowing for trailing blank line)?
4075 (move-end-of-line 1) 4348 (>= (progn (allout-back-to-current-heading)
4076 (point)) 4349 (move-end-of-line 1)
4077 (allout-end-of-current-subtree (not (looking-at "\n\n")))) 4350 (point))
4351 (allout-end-of-current-subtree (not (looking-at "\n\n"))))
4352
4078 (or include-single-liners 4353 (or include-single-liners
4079 (progn (backward-char 1) (allout-hidden-p)))))) 4354 (progn (backward-char 1) (allout-hidden-p))))))
4080;;;_ > allout-hide-current-subtree (&optional just-close) 4355;;;_ > allout-hide-current-subtree (&optional just-close)
@@ -5097,8 +5372,8 @@ See `allout-toggle-current-subtree-encryption' for more details."
5097;;; fetch-pass &optional retried verifying 5372;;; fetch-pass &optional retried verifying
5098;;; passphrase) 5373;;; passphrase)
5099(defun allout-encrypt-string (text decrypt allout-buffer key-type for-key 5374(defun allout-encrypt-string (text decrypt allout-buffer key-type for-key
5100 fetch-pass &optional retried verifying 5375 fetch-pass &optional retried rejected
5101 passphrase) 5376 verifying passphrase)
5102 "Encrypt or decrypt message TEXT. 5377 "Encrypt or decrypt message TEXT.
5103 5378
5104If DECRYPT is true (default false), then decrypt instead of encrypt. 5379If DECRYPT is true (default false), then decrypt instead of encrypt.
@@ -5116,6 +5391,11 @@ that have been solicited in sequence leading to this current call.
5116Optional PASSPHRASE enables explicit delivery of the decryption passphrase, 5391Optional PASSPHRASE enables explicit delivery of the decryption passphrase,
5117for verification purposes. 5392for verification purposes.
5118 5393
5394Optional REJECTED is for internal use - conveys the number of
5395rejections due to matches against
5396`allout-encryption-ciphertext-rejection-regexps', as limited by
5397`allout-encryption-ciphertext-rejection-ceiling'.
5398
5119Returns the resulting string, or nil if the transformation fails." 5399Returns the resulting string, or nil if the transformation fails."
5120 5400
5121 (require 'pgg) 5401 (require 'pgg)
@@ -5141,6 +5421,17 @@ Returns the resulting string, or nil if the transformation fails."
5141 target-prompt-id 5421 target-prompt-id
5142 (or (buffer-file-name allout-buffer) 5422 (or (buffer-file-name allout-buffer)
5143 target-prompt-id)))) 5423 target-prompt-id))))
5424 (strip-plaintext-regexps
5425 (if (not decrypt)
5426 (allout-get-configvar-values
5427 'allout-encryption-plaintext-sanitization-regexps)))
5428 (reject-ciphertext-regexps
5429 (if (not decrypt)
5430 (allout-get-configvar-values
5431 'allout-encryption-ciphertext-rejection-regexps)))
5432 (rejected (or rejected 0))
5433 (rejections-left (- allout-encryption-ciphertext-rejection-ceiling
5434 rejected))
5144 result-text status) 5435 result-text status)
5145 5436
5146 (if (and fetch-pass (not passphrase)) 5437 (if (and fetch-pass (not passphrase))
@@ -5161,10 +5452,19 @@ Returns the resulting string, or nil if the transformation fails."
5161 key-type 5452 key-type
5162 allout-buffer 5453 allout-buffer
5163 retried fetch-pass))) 5454 retried fetch-pass)))
5455
5164 (with-temp-buffer 5456 (with-temp-buffer
5165 5457
5166 (insert text) 5458 (insert text)
5167 5459
5460 (when (and strip-plaintext-regexps (not decrypt))
5461 (dolist (re strip-plaintext-regexps)
5462 (let ((re (if (listp re) (car re) re))
5463 (replacement (if (listp re) (cadr re) "")))
5464 (goto-char (point-min))
5465 (while (re-search-forward re nil t)
5466 (replace-match replacement nil nil)))))
5467
5168 (cond 5468 (cond
5169 5469
5170 ;; symmetric: 5470 ;; symmetric:
@@ -5183,7 +5483,8 @@ Returns the resulting string, or nil if the transformation fails."
5183 (if verifying 5483 (if verifying
5184 (throw 'encryption-failed nil) 5484 (throw 'encryption-failed nil)
5185 (pgg-remove-passphrase-from-cache target-cache-id t) 5485 (pgg-remove-passphrase-from-cache target-cache-id t)
5186 (error "Symmetric-cipher encryption failed - %s" 5486 (error "Symmetric-cipher %scryption failed - %s"
5487 (if decrypt "de" "en")
5187 "try again with different passphrase.")))) 5488 "try again with different passphrase."))))
5188 5489
5189 ;; encrypt 'keypair: 5490 ;; encrypt 'keypair:
@@ -5208,48 +5509,68 @@ Returns the resulting string, or nil if the transformation fails."
5208 (if status 5509 (if status
5209 (pgg-situate-output (point-min) (point-max)) 5510 (pgg-situate-output (point-min) (point-max))
5210 (error (pgg-remove-passphrase-from-cache target-cache-id t) 5511 (error (pgg-remove-passphrase-from-cache target-cache-id t)
5211 (error "decryption failed")))) 5512 (error "decryption failed")))))
5212 )
5213 5513
5214 (setq result-text 5514 (setq result-text
5215 (buffer-substring 1 (- (point-max) (if decrypt 0 1)))) 5515 (buffer-substring 1 (- (point-max) (if decrypt 0 1))))
5216
5217 ;; validate result - non-empty
5218 (cond ((not result-text)
5219 (if verifying
5220 nil
5221 ;; transform was fruitless, retry w/new passphrase.
5222 (pgg-remove-passphrase-from-cache target-cache-id t)
5223 (allout-encrypt-string text allout-buffer decrypt nil
5224 (if retried (1+ retried) 1)
5225 passphrase)))
5226
5227 ;; Barf if encryption yields extraordinary control chars:
5228 ((and (not decrypt)
5229 (string-match "[\C-a\C-k\C-o-\C-z\C-@]"
5230 result-text))
5231 (error (concat "encryption produced unusable"
5232 " non-armored text - reconfigure!")))
5233
5234 ;; valid result and just verifying or non-symmetric:
5235 ((or verifying (not (equal key-type 'symmetric)))
5236 (if (or verifying decrypt)
5237 (pgg-add-passphrase-to-cache target-cache-id
5238 passphrase t))
5239 result-text)
5240
5241 ;; valid result and regular symmetric - "register"
5242 ;; passphrase with mnemonic aids/cache.
5243 (t
5244 (set-buffer allout-buffer)
5245 (if passphrase
5246 (pgg-add-passphrase-to-cache target-cache-id
5247 passphrase t))
5248 (allout-update-passphrase-mnemonic-aids for-key passphrase
5249 allout-buffer)
5250 result-text)
5251 )
5252 ) 5516 )
5517
5518 ;; validate result - non-empty
5519 (cond ((not result-text)
5520 (if verifying
5521 nil
5522 ;; transform was fruitless, retry w/new passphrase.
5523 (pgg-remove-passphrase-from-cache target-cache-id t)
5524 (allout-encrypt-string text decrypt allout-buffer
5525 key-type for-key nil
5526 (if retried (1+ retried) 1)
5527 rejected verifying nil)))
5528
5529 ;; Retry (within limit) if ciphertext contains rejections:
5530 ((and (not decrypt)
5531 ;; Check for disqualification of this ciphertext:
5532 (let ((regexps reject-ciphertext-regexps)
5533 reject-it)
5534 (while (and regexps (not reject-it))
5535 (setq reject-it (string-match (car regexps)
5536 result-text))
5537 (pop regexps))
5538 reject-it))
5539 (setq rejections-left (1- rejections-left))
5540 (if (<= rejections-left 0)
5541 (error (concat "Ciphertext rejected too many times"
5542 " (%s), per `%s'")
5543 allout-encryption-ciphertext-rejection-ceiling
5544 'allout-encryption-ciphertext-rejection-regexps)
5545 (allout-encrypt-string text decrypt allout-buffer
5546 key-type for-key nil
5547 retried (1+ rejected)
5548 verifying passphrase)))
5549 ;; Barf if encryption yields extraordinary control chars:
5550 ((and (not decrypt)
5551 (string-match "[\C-a\C-k\C-o-\C-z\C-@]"
5552 result-text))
5553 (error (concat "Encryption produced non-armored text, which"
5554 "conflicts with allout mode - reconfigure!")))
5555
5556 ;; valid result and just verifying or non-symmetric:
5557 ((or verifying (not (equal key-type 'symmetric)))
5558 (if (or verifying decrypt)
5559 (pgg-add-passphrase-to-cache target-cache-id
5560 passphrase t))
5561 result-text)
5562
5563 ;; valid result and regular symmetric - "register"
5564 ;; passphrase with mnemonic aids/cache.
5565 (t
5566 (set-buffer allout-buffer)
5567 (if passphrase
5568 (pgg-add-passphrase-to-cache target-cache-id
5569 passphrase t))
5570 (allout-update-passphrase-mnemonic-aids for-key passphrase
5571 allout-buffer)
5572 result-text)
5573 )
5253 ) 5574 )
5254 ) 5575 )
5255 ) 5576 )
@@ -5313,7 +5634,6 @@ of the availability of a cached copy."
5313 (pgg-read-passphrase-from-cache cache-id t))) 5634 (pgg-read-passphrase-from-cache cache-id t)))
5314 (got-pass (or cached 5635 (got-pass (or cached
5315 (pgg-read-passphrase full-prompt cache-id t))) 5636 (pgg-read-passphrase full-prompt cache-id t)))
5316
5317 confirmation) 5637 confirmation)
5318 5638
5319 (if (not got-pass) 5639 (if (not got-pass)
@@ -5321,14 +5641,14 @@ of the availability of a cached copy."
5321 5641
5322 ;; Duplicate our handle on the passphrase so it's not clobbered by 5642 ;; Duplicate our handle on the passphrase so it's not clobbered by
5323 ;; deactivate-passwd memory clearing: 5643 ;; deactivate-passwd memory clearing:
5324 (setq got-pass (format "%s" got-pass)) 5644 (setq got-pass (copy-sequence got-pass))
5325 5645
5326 (cond (verifier-string 5646 (cond (verifier-string
5327 (save-window-excursion 5647 (save-window-excursion
5328 (if (allout-encrypt-string verifier-string 'decrypt 5648 (if (allout-encrypt-string verifier-string 'decrypt
5329 allout-buffer 'symmetric 5649 allout-buffer 'symmetric
5330 for-key nil 0 'verifying 5650 for-key nil 0 0 'verifying
5331 got-pass) 5651 (copy-sequence got-pass))
5332 (setq confirmation (format "%s" got-pass)))) 5652 (setq confirmation (format "%s" got-pass))))
5333 5653
5334 (if (and (not confirmation) 5654 (if (and (not confirmation)
@@ -5365,15 +5685,7 @@ of the availability of a cached copy."
5365 ;; recurse to this routine: 5685 ;; recurse to this routine:
5366 (pgg-read-passphrase prompt-sans-hint cache-id t)) 5686 (pgg-read-passphrase prompt-sans-hint cache-id t))
5367 (pgg-remove-passphrase-from-cache cache-id t) 5687 (pgg-remove-passphrase-from-cache cache-id t)
5368 (error "Confirmation failed."))) 5688 (error "Confirmation failed."))))))))
5369 ;; reduce opportunity for memory cherry-picking by zeroing duplicate:
5370 (dotimes (i (length got-pass))
5371 (aset got-pass i 0))
5372 )
5373 )
5374 )
5375 )
5376 )
5377;;;_ > allout-encrypted-topic-p () 5689;;;_ > allout-encrypted-topic-p ()
5378(defun allout-encrypted-topic-p () 5690(defun allout-encrypted-topic-p ()
5379 "True if the current topic is encryptable and encrypted." 5691 "True if the current topic is encryptable and encrypted."
@@ -5426,7 +5738,7 @@ An error is raised if the text is not encrypted."
5426 (dotimes (i (length spew)) 5738 (dotimes (i (length spew))
5427 (aset spew i (1+ (random 254)))) 5739 (aset spew i (1+ (random 254))))
5428 (allout-encrypt-string spew nil (current-buffer) 'symmetric 5740 (allout-encrypt-string spew nil (current-buffer) 'symmetric
5429 nil nil 0 passphrase)) 5741 nil nil 0 0 passphrase))
5430 ) 5742 )
5431;;;_ > allout-update-passphrase-mnemonic-aids (for-key passphrase 5743;;;_ > allout-update-passphrase-mnemonic-aids (for-key passphrase
5432;;; outline-buffer) 5744;;; outline-buffer)
@@ -5505,7 +5817,7 @@ Derived from value of `allout-passphrase-verifier-string'."
5505 allout-passphrase-verifier-string 5817 allout-passphrase-verifier-string
5506 (allout-encrypt-string (allout-get-encryption-passphrase-verifier) 5818 (allout-encrypt-string (allout-get-encryption-passphrase-verifier)
5507 'decrypt allout-buffer 'symmetric 5819 'decrypt allout-buffer 'symmetric
5508 key nil 0 'verifying passphrase) 5820 key nil 0 0 'verifying passphrase)
5509 t))) 5821 t)))
5510;;;_ > allout-next-topic-pending-encryption (&optional except-mark) 5822;;;_ > allout-next-topic-pending-encryption (&optional except-mark)
5511(defun allout-next-topic-pending-encryption (&optional except-mark) 5823(defun allout-next-topic-pending-encryption (&optional except-mark)
@@ -5808,6 +6120,25 @@ If BEG is bigger than END we return 0."
5808 (goto-char (1+ (match-beginning 0))) 6120 (goto-char (1+ (match-beginning 0)))
5809 (setq count (1+ count))) 6121 (setq count (1+ count)))
5810 count)))) 6122 count))))
6123;;;_ > allout-get-configvar-values (varname)
6124(defun allout-get-configvar-values (configvar-name)
6125 "Return a list of values of the symbols in list bound to CONFIGVAR-NAME.
6126
6127The user is prompted for removal of symbols that are unbound, and they
6128otherwise are ignored.
6129
6130CONFIGVAR-NAME should be the name of the configuration variable,
6131not its value."
6132
6133 (let ((configvar-value (symbol-value configvar-name))
6134 got)
6135 (dolist (sym configvar-value)
6136 (if (not (boundp sym))
6137 (if (yes-or-no-p (format "%s entry `%s' is unbound - remove it? "
6138 configvar-name sym))
6139 (delq sym (symbol-value configvar-name)))
6140 (push (symbol-value sym) got)))
6141 (reverse got)))
5811;;;_ > allout-mark-marker to accommodate divergent emacsen: 6142;;;_ > allout-mark-marker to accommodate divergent emacsen:
5812(defun allout-mark-marker (&optional force buffer) 6143(defun allout-mark-marker (&optional force buffer)
5813 "Accommodate the different signature for `mark-marker' across Emacsen. 6144 "Accommodate the different signature for `mark-marker' across Emacsen.
diff --git a/lisp/avoid.el b/lisp/avoid.el
index 1868707720e..b497c2007bd 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -124,6 +124,7 @@ Only applies in mouse-avoidance-modes `animate' and `jump'."
124(defvar mouse-avoidance-pointer-shapes nil) 124(defvar mouse-avoidance-pointer-shapes nil)
125(defvar mouse-avoidance-n-pointer-shapes 0) 125(defvar mouse-avoidance-n-pointer-shapes 0)
126(defvar mouse-avoidance-old-pointer-shape nil) 126(defvar mouse-avoidance-old-pointer-shape nil)
127(defvar mouse-avoidance-animating-pointer nil)
127 128
128;; This timer is used to run something when Emacs is idle. 129;; This timer is used to run something when Emacs is idle.
129(defvar mouse-avoidance-timer nil) 130(defvar mouse-avoidance-timer nil)
@@ -243,16 +244,19 @@ You can redefine this if you want the mouse banished to a different corner."
243 (+ (cdr mouse-avoidance-state) deltay))) 244 (+ (cdr mouse-avoidance-state) deltay)))
244 (if (or (eq mouse-avoidance-mode 'animate) 245 (if (or (eq mouse-avoidance-mode 'animate)
245 (eq mouse-avoidance-mode 'proteus)) 246 (eq mouse-avoidance-mode 'proteus))
246 (let ((i 0.0)) 247 (let ((i 0.0)
248 (incr (max .1 (/ 1.0 mouse-avoidance-nudge-dist))))
249 (setq mouse-avoidance-animating-pointer t)
247 (while (<= i 1) 250 (while (<= i 1)
248 (mouse-avoidance-set-mouse-position 251 (mouse-avoidance-set-mouse-position
249 (cons (+ (car cur-pos) (round (* i deltax))) 252 (cons (+ (car cur-pos) (round (* i deltax)))
250 (+ (cdr cur-pos) (round (* i deltay))))) 253 (+ (cdr cur-pos) (round (* i deltay)))))
251 (setq i (+ i (max .1 (/ 1.0 mouse-avoidance-nudge-dist)))) 254 (setq i (+ i incr))
252 (if (eq mouse-avoidance-mode 'proteus) 255 (if (eq mouse-avoidance-mode 'proteus)
253 (mouse-avoidance-set-pointer-shape 256 (mouse-avoidance-set-pointer-shape
254 (mouse-avoidance-random-shape))) 257 (mouse-avoidance-random-shape)))
255 (sit-for mouse-avoidance-animation-delay))) 258 (sit-for mouse-avoidance-animation-delay))
259 (setq mouse-avoidance-animating-pointer nil))
256 (mouse-avoidance-set-mouse-position (cons (+ (car (cdr cur)) deltax) 260 (mouse-avoidance-set-mouse-position (cons (+ (car (cdr cur)) deltax)
257 (+ (cdr (cdr cur)) deltay)))))) 261 (+ (cdr (cdr cur)) deltay))))))
258 262
@@ -294,11 +298,11 @@ redefine this function to suit your own tastes."
294 (memq 'drag modifiers) 298 (memq 'drag modifiers)
295 (memq 'down modifiers))))))) 299 (memq 'down modifiers)))))))
296 300
297(defun mouse-avoidance-banish-hook () 301(defun mouse-avoidance-banish ()
298 (if (not (mouse-avoidance-ignore-p)) 302 (if (not (mouse-avoidance-ignore-p))
299 (mouse-avoidance-banish-mouse))) 303 (mouse-avoidance-banish-mouse)))
300 304
301(defun mouse-avoidance-exile-hook () 305(defun mouse-avoidance-exile ()
302 ;; For exile mode, the state is nil when the mouse is in its normal 306 ;; For exile mode, the state is nil when the mouse is in its normal
303 ;; position, and set to the old mouse-position when the mouse is in exile. 307 ;; position, and set to the old mouse-position when the mouse is in exile.
304 (if (not (mouse-avoidance-ignore-p)) 308 (if (not (mouse-avoidance-ignore-p))
@@ -317,9 +321,10 @@ redefine this function to suit your own tastes."
317 ;; but clear state anyway, to be ready for another move 321 ;; but clear state anyway, to be ready for another move
318 (setq mouse-avoidance-state nil)))))) 322 (setq mouse-avoidance-state nil))))))
319 323
320(defun mouse-avoidance-fancy-hook () 324(defun mouse-avoidance-fancy ()
321 ;; Used for the "fancy" modes, ie jump et al. 325 ;; Used for the "fancy" modes, ie jump et al.
322 (if (and (not (mouse-avoidance-ignore-p)) 326 (if (and (not mouse-avoidance-animating-pointer)
327 (not (mouse-avoidance-ignore-p))
323 (mouse-avoidance-too-close-p (mouse-position))) 328 (mouse-avoidance-too-close-p (mouse-position)))
324 (let ((old-pos (mouse-position))) 329 (let ((old-pos (mouse-position)))
325 (mouse-avoidance-nudge-mouse) 330 (mouse-avoidance-nudge-mouse)
@@ -375,14 +380,14 @@ definition of \"random distance\".)"
375 (eq mode 'animate) 380 (eq mode 'animate)
376 (eq mode 'proteus)) 381 (eq mode 'proteus))
377 (setq mouse-avoidance-timer 382 (setq mouse-avoidance-timer
378 (run-with-idle-timer 0.1 t 'mouse-avoidance-fancy-hook)) 383 (run-with-idle-timer 0.1 t 'mouse-avoidance-fancy))
379 (setq mouse-avoidance-mode mode 384 (setq mouse-avoidance-mode mode
380 mouse-avoidance-state (cons 0 0) 385 mouse-avoidance-state (cons 0 0)
381 mouse-avoidance-old-pointer-shape 386 mouse-avoidance-old-pointer-shape
382 (and (boundp 'x-pointer-shape) x-pointer-shape))) 387 (and (boundp 'x-pointer-shape) x-pointer-shape)))
383 ((eq mode 'exile) 388 ((eq mode 'exile)
384 (setq mouse-avoidance-timer 389 (setq mouse-avoidance-timer
385 (run-with-idle-timer 0.1 t 'mouse-avoidance-exile-hook)) 390 (run-with-idle-timer 0.1 t 'mouse-avoidance-exile))
386 (setq mouse-avoidance-mode mode 391 (setq mouse-avoidance-mode mode
387 mouse-avoidance-state nil)) 392 mouse-avoidance-state nil))
388 ((or (eq mode 'banish) 393 ((or (eq mode 'banish)
@@ -390,7 +395,7 @@ definition of \"random distance\".)"
390 (and (null mode) (null mouse-avoidance-mode)) 395 (and (null mode) (null mouse-avoidance-mode))
391 (and mode (> (prefix-numeric-value mode) 0))) 396 (and mode (> (prefix-numeric-value mode) 0)))
392 (setq mouse-avoidance-timer 397 (setq mouse-avoidance-timer
393 (run-with-idle-timer 0.1 t 'mouse-avoidance-banish-hook)) 398 (run-with-idle-timer 0.1 t 'mouse-avoidance-banish))
394 (setq mouse-avoidance-mode 'banish)) 399 (setq mouse-avoidance-mode 'banish))
395 (t (setq mouse-avoidance-mode nil))) 400 (t (setq mouse-avoidance-mode nil)))
396 (force-mode-line-update)) 401 (force-mode-line-update))
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 1accc5b2662..dacde69fa02 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -280,52 +280,62 @@ Keymap to display on minor modes.")
280 ;; mouse-1: select window, mouse-2: delete others, mouse-3: delete, 280 ;; mouse-1: select window, mouse-2: delete others, mouse-3: delete,
281 ;; drag-mouse-1: resize, C-mouse-2: split horizontally" 281 ;; drag-mouse-1: resize, C-mouse-2: split horizontally"
282 "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this") 282 "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this")
283 (dashes (propertize "--" 'help-echo help-echo))) 283 (dashes (propertize "--" 'help-echo help-echo))
284 (setq-default mode-line-format 284 (standard-mode-line-format
285 (list 285 (list
286 "%e" 286 "%e"
287 (propertize "-" 'help-echo help-echo) 287 (propertize "-" 'help-echo help-echo)
288 'mode-line-mule-info 288 'mode-line-mule-info
289 'mode-line-modified 289 'mode-line-modified
290 'mode-line-frame-identification 290 'mode-line-frame-identification
291 'mode-line-buffer-identification 291 'mode-line-buffer-identification
292 (propertize " " 'help-echo help-echo) 292 (propertize " " 'help-echo help-echo)
293 'mode-line-position 293 'mode-line-position
294 '(vc-mode vc-mode) 294 '(vc-mode vc-mode)
295 (propertize " " 'help-echo help-echo) 295 (propertize " " 'help-echo help-echo)
296 'mode-line-modes 296 'mode-line-modes
297 `(which-func-mode ("" which-func-format ,dashes)) 297 `(which-func-mode ("" which-func-format ,dashes))
298 `(global-mode-string (,dashes global-mode-string)) 298 `(global-mode-string (,dashes global-mode-string))
299 (propertize "-%-" 'help-echo help-echo))) 299 (propertize "-%-" 'help-echo help-echo)))
300 300 (standard-mode-line-modes
301 (setq-default mode-line-modes 301 (list
302 (list 302 (propertize "%[(" 'help-echo help-echo)
303 (propertize "%[(" 'help-echo help-echo) 303 `(:propertize ("" mode-name)
304 `(:propertize ("" mode-name) 304 help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes"
305 help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes" 305 mouse-face mode-line-highlight
306 mouse-face mode-line-highlight 306 local-map ,mode-line-major-mode-keymap)
307 local-map ,mode-line-major-mode-keymap) 307 '("" mode-line-process)
308 '("" mode-line-process) 308 `(:propertize ("" minor-mode-alist)
309 `(:propertize ("" minor-mode-alist) 309 mouse-face mode-line-highlight
310 mouse-face mode-line-highlight 310 help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes"
311 help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes" 311 local-map ,mode-line-minor-mode-keymap)
312 local-map ,mode-line-minor-mode-keymap) 312 (propertize "%n" 'help-echo "mouse-2: widen"
313 (propertize "%n" 'help-echo "mouse-2: widen" 313 'mouse-face 'mode-line-highlight
314 'mouse-face 'mode-line-highlight 314 'local-map (make-mode-line-mouse-map
315 'local-map (make-mode-line-mouse-map 315 'mouse-2 #'mode-line-widen))
316 'mouse-2 #'mode-line-widen)) 316 (propertize ")%]--" 'help-echo help-echo)))
317 (propertize ")%]--" 'help-echo help-echo))) 317 (standard-mode-line-position
318 318 `((-3 ,(propertize "%p" 'help-echo help-echo))
319 (setq-default mode-line-position 319 (size-indication-mode
320 `((-3 ,(propertize "%p" 'help-echo help-echo)) 320 (8 ,(propertize " of %I" 'help-echo help-echo)))
321 (size-indication-mode 321 (line-number-mode
322 (8 ,(propertize " of %I" 'help-echo help-echo))) 322 ((column-number-mode
323 (line-number-mode 323 (10 ,(propertize " (%l,%c)" 'help-echo help-echo))
324 ((column-number-mode 324 (6 ,(propertize " L%l" 'help-echo help-echo))))
325 (10 ,(propertize " (%l,%c)" 'help-echo help-echo)) 325 ((column-number-mode
326 (6 ,(propertize " L%l" 'help-echo help-echo)))) 326 (5 ,(propertize " C%c" 'help-echo help-echo))))))))
327 ((column-number-mode 327
328 (5 ,(propertize " C%c" 'help-echo help-echo)))))))) 328 (setq-default mode-line-format standard-mode-line-format)
329 (put 'mode-line-format 'standard-value
330 (list `(quote ,standard-mode-line-format)))
331
332 (setq-default mode-line-modes standard-mode-line-modes)
333 (put 'mode-line-modes 'standard-value
334 (list `(quote ,standard-mode-line-modes)))
335
336 (setq-default mode-line-position standard-mode-line-position)
337 (put 'mode-line-position 'standard-value
338 (list `(quote ,standard-mode-line-position))))
329 339
330(defvar mode-line-buffer-identification-keymap nil "\ 340(defvar mode-line-buffer-identification-keymap nil "\
331Keymap for what is displayed by `mode-line-buffer-identification'.") 341Keymap for what is displayed by `mode-line-buffer-identification'.")
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index e9e7e9a2bb8..398b362d4e4 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -117,6 +117,7 @@ file buffers. It affects both manual reverting and reverting by
117Auto Revert Mode.") 117Auto Revert Mode.")
118 118
119(defvar Info-current-file) ;; from info.el 119(defvar Info-current-file) ;; from info.el
120(defvar Info-current-node) ;; from info.el
120 121
121(make-variable-buffer-local 'Buffer-menu-files-only) 122(make-variable-buffer-local 'Buffer-menu-files-only)
122 123
@@ -786,7 +787,12 @@ For more information, see the function `buffer-menu'."
786 ((eq file 'toc) 787 ((eq file 'toc)
787 (setq file "*Info TOC*")) 788 (setq file "*Info TOC*"))
788 ((not (stringp file)) ;; avoid errors 789 ((not (stringp file)) ;; avoid errors
789 (setq file nil)))))) 790 (setq file nil))
791 (t
792 (setq file (concat "("
793 (file-name-nondirectory file)
794 ")"
795 Info-current-node)))))))
790 (push (list buffer bits name (buffer-size) mode file) 796 (push (list buffer bits name (buffer-size) mode file)
791 list)))))) 797 list))))))
792 ;; Preserve the original buffer-list ordering, just in case. 798 ;; Preserve the original buffer-list ordering, just in case.
diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el
index 3f2697509f3..13b3671e16a 100644
--- a/lisp/calendar/timeclock.el
+++ b/lisp/calendar/timeclock.el
@@ -95,7 +95,7 @@
95 :group 'timeclock) 95 :group 'timeclock)
96 96
97(defcustom timeclock-relative t 97(defcustom timeclock-relative t
98 "*Whether to maken reported time relative to `timeclock-workday'. 98 "*Whether to make reported time relative to `timeclock-workday'.
99For example, if the length of a normal workday is eight hours, and you 99For example, if the length of a normal workday is eight hours, and you
100work four hours on Monday, then the amount of time \"remaining\" on 100work four hours on Monday, then the amount of time \"remaining\" on
101Tuesday is twelve hours -- relative to an averaged work period of 101Tuesday is twelve hours -- relative to an averaged work period of
@@ -251,7 +251,10 @@ each day.")
251This value is not accurate enough to be useful by itself. Rather, 251This value is not accurate enough to be useful by itself. Rather,
252call `timeclock-workday-elapsed', to determine how much time has been 252call `timeclock-workday-elapsed', to determine how much time has been
253worked so far today. Also, if `timeclock-relative' is nil, this value 253worked so far today. Also, if `timeclock-relative' is nil, this value
254will be the same as `timeclock-discrepancy'.") ; ? gm 254will be the same as `timeclock-discrepancy'.")
255
256(defvar timeclock-use-elapsed nil
257 "Non-nil if the modeline should display time elapsed, not remaining.")
255 258
256(defvar timeclock-last-period nil 259(defvar timeclock-last-period nil
257 "Integer representing the number of seconds in the last period. 260 "Integer representing the number of seconds in the last period.
@@ -424,7 +427,9 @@ If SHOW-SECONDS is non-nil, display second resolution.
424If TODAY-ONLY is non-nil, the display will be relative only to time 427If TODAY-ONLY is non-nil, the display will be relative only to time
425worked today, ignoring the time worked on previous days." 428worked today, ignoring the time worked on previous days."
426 (interactive "P") 429 (interactive "P")
427 (let ((remainder (timeclock-workday-remaining)) ; today-only? 430 (let ((remainder (timeclock-workday-remaining
431 (or today-only
432 (not timeclock-relative))))
428 (last-in (equal (car timeclock-last-event) "i")) 433 (last-in (equal (car timeclock-last-event) "i"))
429 status) 434 status)
430 (setq status 435 (setq status
@@ -619,7 +624,10 @@ relative only to the time worked today, and not to past time."
619The value of `timeclock-relative' affects the display as described in 624The value of `timeclock-relative' affects the display as described in
620that variable's documentation." 625that variable's documentation."
621 (interactive) 626 (interactive)
622 (let ((remainder (timeclock-workday-remaining (not timeclock-relative))) 627 (let ((remainder
628 (if timeclock-use-elapsed
629 (timeclock-workday-elapsed)
630 (timeclock-workday-remaining (not timeclock-relative))))
623 (last-in (equal (car timeclock-last-event) "i"))) 631 (last-in (equal (car timeclock-last-event) "i")))
624 (when (and (< remainder 0) 632 (when (and (< remainder 0)
625 (not (and timeclock-day-over 633 (not (and timeclock-day-over
diff --git a/lisp/compare-w.el b/lisp/compare-w.el
index e61f24a0c7c..3aa01424fb5 100644
--- a/lisp/compare-w.el
+++ b/lisp/compare-w.el
@@ -167,16 +167,14 @@ on first call it advances points to the next difference,
167on second call it synchronizes points by skipping the difference, 167on second call it synchronizes points by skipping the difference,
168on third call it again advances points to the next difference and so on." 168on third call it again advances points to the next difference and so on."
169 (interactive "P") 169 (interactive "P")
170 (if compare-ignore-whitespace
171 (setq ignore-whitespace (not ignore-whitespace)))
170 (let* (p1 p2 maxp1 maxp2 b1 b2 w2 172 (let* (p1 p2 maxp1 maxp2 b1 b2 w2
171 (progress 1) 173 (progress 1)
172 (opoint1 (point)) 174 (opoint1 (point))
173 opoint2 175 opoint2
174 (skip-func (if (if ignore-whitespace ; XOR 176 skip-func-1
175 (not compare-ignore-whitespace) 177 skip-func-2
176 compare-ignore-whitespace)
177 (if (stringp compare-windows-whitespace)
178 'compare-windows-skip-whitespace
179 compare-windows-whitespace)))
180 (sync-func (if (stringp compare-windows-sync) 178 (sync-func (if (stringp compare-windows-sync)
181 'compare-windows-sync-regexp 179 'compare-windows-sync-regexp
182 compare-windows-sync))) 180 compare-windows-sync)))
@@ -190,8 +188,19 @@ on third call it again advances points to the next difference and so on."
190 b2 (window-buffer w2)) 188 b2 (window-buffer w2))
191 (setq opoint2 p2) 189 (setq opoint2 p2)
192 (setq maxp1 (point-max)) 190 (setq maxp1 (point-max))
193 (save-excursion 191
194 (set-buffer b2) 192 (setq skip-func-1 (if ignore-whitespace
193 (if (stringp compare-windows-whitespace)
194 (lambda () (compare-windows-skip-whitespace)
195 t)
196 compare-windows-whitespace)))
197
198 (with-current-buffer b2
199 (setq skip-func-2 (if ignore-whitespace
200 (if (stringp compare-windows-whitespace)
201 (lambda () (compare-windows-skip-whitespace)
202 t)
203 compare-windows-whitespace)))
195 (push-mark p2 t) 204 (push-mark p2 t)
196 (setq maxp2 (point-max))) 205 (setq maxp2 (point-max)))
197 (push-mark) 206 (push-mark)
@@ -199,17 +208,16 @@ on third call it again advances points to the next difference and so on."
199 (while (> progress 0) 208 (while (> progress 0)
200 ;; If both windows have whitespace next to point, 209 ;; If both windows have whitespace next to point,
201 ;; optionally skip over it. 210 ;; optionally skip over it.
202 (and skip-func 211 (and skip-func-1
203 (save-excursion 212 (save-excursion
204 (let (p1a p2a w1 w2 result1 result2) 213 (let (p1a p2a w1 w2 result1 result2)
205 (setq result1 (funcall skip-func opoint1)) 214 (setq result1 (funcall skip-func-1 opoint1))
206 (setq p1a (point)) 215 (setq p1a (point))
207 (set-buffer b2) 216 (set-buffer b2)
208 (goto-char p2) 217 (goto-char p2)
209 (setq result2 (funcall skip-func opoint2)) 218 (setq result2 (funcall skip-func-2 opoint2))
210 (setq p2a (point)) 219 (setq p2a (point))
211 (if (or (stringp compare-windows-whitespace) 220 (if (and result1 result2 (eq result1 result2))
212 (and result1 result2 (eq result1 result2)))
213 (setq p1 p1a 221 (setq p1 p1a
214 p2 p2a))))) 222 p2 p2a)))))
215 223
diff --git a/lisp/complete.el b/lisp/complete.el
index c49ad488536..90c1ceceb32 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -543,8 +543,8 @@ of `minibuffer-completion-table' and the minibuffer contents.")
543 (let ((compl (all-completions (if env-on 543 (let ((compl (all-completions (if env-on
544 (file-name-nondirectory (substring str 0 p)) 544 (file-name-nondirectory (substring str 0 p))
545 (substring str 0 p)) 545 (substring str 0 p))
546 table 546 table
547 pred))) 547 pred)))
548 (setq p compl) 548 (setq p compl)
549 (while p 549 (while p
550 (and (string-match regex (car p)) 550 (and (string-match regex (car p))
@@ -553,6 +553,34 @@ of `minibuffer-completion-table' and the minibuffer contents.")
553 (setq poss (cons (car p) poss)))) 553 (setq poss (cons (car p) poss))))
554 (setq p (cdr p))))) 554 (setq p (cdr p)))))
555 555
556 ;; Handle completion-ignored-extensions
557 (and filename
558 (not (eq mode 'help))
559 (let ((p2 poss))
560
561 ;; Build a regular expression representing the extensions list
562 (or (equal completion-ignored-extensions PC-ignored-extensions)
563 (setq PC-ignored-regexp
564 (concat "\\("
565 (mapconcat
566 'regexp-quote
567 (setq PC-ignored-extensions
568 completion-ignored-extensions)
569 "\\|")
570 "\\)\\'")))
571
572 ;; Check if there are any without an ignored extension.
573 ;; Also ignore `.' and `..'.
574 (setq p nil)
575 (while p2
576 (or (string-match PC-ignored-regexp (car p2))
577 (string-match "\\(\\`\\|/\\)[.][.]?/?\\'" (car p2))
578 (setq p (cons (car p2) p)))
579 (setq p2 (cdr p2)))
580
581 ;; If there are "good" names, use them
582 (and p (setq poss p))))
583
556 ;; Now we have a list of possible completions 584 ;; Now we have a list of possible completions
557 (cond 585 (cond
558 586
@@ -575,34 +603,6 @@ of `minibuffer-completion-table' and the minibuffer contents.")
575 ((or (cdr (setq helpposs poss)) 603 ((or (cdr (setq helpposs poss))
576 (memq mode '(help word))) 604 (memq mode '(help word)))
577 605
578 ;; Handle completion-ignored-extensions
579 (and filename
580 (not (eq mode 'help))
581 (let ((p2 poss))
582
583 ;; Build a regular expression representing the extensions list
584 (or (equal completion-ignored-extensions PC-ignored-extensions)
585 (setq PC-ignored-regexp
586 (concat "\\("
587 (mapconcat
588 'regexp-quote
589 (setq PC-ignored-extensions
590 completion-ignored-extensions)
591 "\\|")
592 "\\)\\'")))
593
594 ;; Check if there are any without an ignored extension.
595 ;; Also ignore `.' and `..'.
596 (setq p nil)
597 (while p2
598 (or (string-match PC-ignored-regexp (car p2))
599 (string-match "\\(\\`\\|/\\)[.][.]?/?\\'" (car p2))
600 (setq p (cons (car p2) p)))
601 (setq p2 (cdr p2)))
602
603 ;; If there are "good" names, use them
604 (and p (setq poss p))))
605
606 ;; Is the actual string one of the possible completions? 606 ;; Is the actual string one of the possible completions?
607 (setq p (and (not (eq mode 'help)) poss)) 607 (setq p (and (not (eq mode 'help)) poss))
608 (while (and p 608 (while (and p
@@ -623,7 +623,8 @@ of `minibuffer-completion-table' and the minibuffer contents.")
623 623
624 ;; Check if next few letters are the same in all cases 624 ;; Check if next few letters are the same in all cases
625 (if (and (not (eq mode 'help)) 625 (if (and (not (eq mode 'help))
626 (setq prefix (try-completion (PC-chunk-after basestr skip) (mapcar 'list poss)))) 626 (setq prefix (try-completion (PC-chunk-after basestr skip)
627 poss)))
627 (let ((first t) i) 628 (let ((first t) i)
628 ;; Retain capitalization of user input even if 629 ;; Retain capitalization of user input even if
629 ;; completion-ignore-case is set. 630 ;; completion-ignore-case is set.
@@ -669,13 +670,9 @@ of `minibuffer-completion-table' and the minibuffer contents.")
669 (+ beg (length dirname)) end) 670 (+ beg (length dirname)) end)
670 skip) 671 skip)
671 (mapcar 672 (mapcar
672 (function 673 (lambda (x)
673 (lambda (x) 674 (when (string-match skip x)
674 (list 675 (substring x (match-end 0))))
675 (and (string-match skip x)
676 (substring
677 x
678 (match-end 0))))))
679 poss))) 676 poss)))
680 (or (> i 0) (> (length prefix) 0)) 677 (or (> i 0) (> (length prefix) 0))
681 (or (not (eq mode 'word)) 678 (or (not (eq mode 'word))
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 0493dd0894c..609b5572a08 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -4436,6 +4436,7 @@ The format is suitable for use with `easy-menu-define'."
4436 (let ((map (make-keymap))) 4436 (let ((map (make-keymap)))
4437 (set-keymap-parent map widget-keymap) 4437 (set-keymap-parent map widget-keymap)
4438 (define-key map [remap self-insert-command] 'custom-no-edit) 4438 (define-key map [remap self-insert-command] 'custom-no-edit)
4439 (define-key map "\^m" 'custom-newline)
4439 (define-key map " " 'scroll-up) 4440 (define-key map " " 'scroll-up)
4440 (define-key map "\177" 'scroll-down) 4441 (define-key map "\177" 'scroll-down)
4441 (define-key map "\C-c\C-c" 'Custom-set) 4442 (define-key map "\C-c\C-c" 'Custom-set)
@@ -4452,6 +4453,14 @@ The format is suitable for use with `easy-menu-define'."
4452 (interactive "@d") 4453 (interactive "@d")
4453 (error "You can't edit this part of the Custom buffer")) 4454 (error "You can't edit this part of the Custom buffer"))
4454 4455
4456(defun custom-newline (pos &optional event)
4457 "Invoke button at POS, or refuse to allow editing of Custom buffer."
4458 (interactive "@d")
4459 (let ((button (get-char-property pos 'button)))
4460 (if button
4461 (widget-apply-action button event)
4462 (error "You can't edit this part of the Custom buffer"))))
4463
4455(easy-menu-define Custom-mode-menu 4464(easy-menu-define Custom-mode-menu
4456 custom-mode-map 4465 custom-mode-map
4457 "Menu used in customization buffers." 4466 "Menu used in customization buffers."
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index e35a75da598..2fce89c73c2 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -178,7 +178,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of
178 ;; fringe.c 178 ;; fringe.c
179 (overflow-newline-into-fringe fringe boolean) 179 (overflow-newline-into-fringe fringe boolean)
180 ;; indent.c 180 ;; indent.c
181 (indent-tabs-mode fill boolean) 181 (indent-tabs-mode indent boolean)
182 ;; keyboard.c 182 ;; keyboard.c
183 (meta-prefix-char keyboard character) 183 (meta-prefix-char keyboard character)
184 (auto-save-interval auto-save integer) 184 (auto-save-interval auto-save integer)
diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el
index 53f530505ae..b4fe1e4b0bf 100644
--- a/lisp/cus-theme.el
+++ b/lisp/cus-theme.el
@@ -99,7 +99,7 @@ the directory " custom-theme-directory "\n\n")
99 (widget-insert " ") 99 (widget-insert " ")
100 (widget-create 'push-button 100 (widget-create 'push-button
101 :notify (lambda (&rest ignore) 101 :notify (lambda (&rest ignore)
102 (when (y-or-n-p "Discard current changes?") 102 (when (y-or-n-p "Discard current changes? ")
103 (kill-buffer (current-buffer)) 103 (kill-buffer (current-buffer))
104 (customize-create-theme))) 104 (customize-create-theme)))
105 "Reset Buffer") 105 "Reset Buffer")
@@ -137,7 +137,7 @@ the directory " custom-theme-directory "\n\n")
137 (widget-insert "\n") 137 (widget-insert "\n")
138 (widget-create 'push-button 138 (widget-create 'push-button
139 :notify (lambda (&rest ignore) 139 :notify (lambda (&rest ignore)
140 (when (y-or-n-p "Discard current changes?") 140 (when (y-or-n-p "Discard current changes? ")
141 (kill-buffer (current-buffer)) 141 (kill-buffer (current-buffer))
142 (customize-create-theme))) 142 (customize-create-theme)))
143 "Reset Buffer") 143 "Reset Buffer")
@@ -290,7 +290,7 @@ Optional EVENT is the location for the menu."
290(defun custom-theme-visit-theme () 290(defun custom-theme-visit-theme ()
291 (interactive) 291 (interactive)
292 (when (or (null custom-theme-variables) 292 (when (or (null custom-theme-variables)
293 (if (y-or-n-p "Discard current changes?") 293 (if (y-or-n-p "Discard current changes? ")
294 (progn (customize-create-theme) t))) 294 (progn (customize-create-theme) t)))
295 (let ((theme (call-interactively 'custom-theme-merge-theme))) 295 (let ((theme (call-interactively 'custom-theme-merge-theme)))
296 (unless (eq theme 'user) 296 (unless (eq theme 'user)
diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el
index d05eed2c4a2..1b37f3f772f 100644
--- a/lisp/emacs-lisp/bindat.el
+++ b/lisp/emacs-lisp/bindat.el
@@ -619,9 +619,12 @@ If optional second arg SEP is a string, use that as separator."
619 (bindat-format-vector vect "%02x" (if (stringp sep) sep ":"))) 619 (bindat-format-vector vect "%02x" (if (stringp sep) sep ":")))
620 620
621(defun bindat-ip-to-string (ip) 621(defun bindat-ip-to-string (ip)
622 "Format vector IP as an ip address in dotted notation." 622 "Format vector IP as an ip address in dotted notation.
623 (format "%d.%d.%d.%d" 623The port (if any) is omitted. IP can be a string, as well."
624 (aref ip 0) (aref ip 1) (aref ip 2) (aref ip 3))) 624 (if (vectorp ip)
625 (format-network-address ip t)
626 (format "%d.%d.%d.%d"
627 (aref ip 0) (aref ip 1) (aref ip 2) (aref ip 3))))
625 628
626(provide 'bindat) 629(provide 'bindat)
627 630
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 8645ec5a6ed..5107ee60274 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -2556,6 +2556,7 @@ MSG is printed after `::::} '."
2556 (edebug-outside-buffer (current-buffer)) 2556 (edebug-outside-buffer (current-buffer))
2557 (edebug-outside-point (point)) 2557 (edebug-outside-point (point))
2558 (edebug-outside-mark (edebug-mark)) 2558 (edebug-outside-mark (edebug-mark))
2559 (edebug-outside-unread-command-events unread-command-events)
2559 edebug-outside-windows ; window or screen configuration 2560 edebug-outside-windows ; window or screen configuration
2560 edebug-buffer-points 2561 edebug-buffer-points
2561 2562
@@ -2574,6 +2575,7 @@ MSG is printed after `::::} '."
2574 (overlay-arrow-string overlay-arrow-string) 2575 (overlay-arrow-string overlay-arrow-string)
2575 (cursor-in-echo-area nil) 2576 (cursor-in-echo-area nil)
2576 (default-cursor-in-non-selected-windows t) 2577 (default-cursor-in-non-selected-windows t)
2578 (unread-command-events unread-command-events)
2577 ;; any others?? 2579 ;; any others??
2578 ) 2580 )
2579 (if (not (buffer-name edebug-buffer)) 2581 (if (not (buffer-name edebug-buffer))
@@ -2662,6 +2664,7 @@ MSG is printed after `::::} '."
2662 2664
2663 (t (message ""))) 2665 (t (message "")))
2664 2666
2667 (setq unread-command-events nil)
2665 (if (eq 'after edebug-arg-mode) 2668 (if (eq 'after edebug-arg-mode)
2666 (progn 2669 (progn
2667 ;; Display result of previous evaluation. 2670 ;; Display result of previous evaluation.
@@ -2681,8 +2684,7 @@ MSG is printed after `::::} '."
2681 ((eq edebug-execution-mode 'trace) 2684 ((eq edebug-execution-mode 'trace)
2682 (edebug-sit-for edebug-sit-for-seconds)) ; Force update and pause. 2685 (edebug-sit-for edebug-sit-for-seconds)) ; Force update and pause.
2683 ((eq edebug-execution-mode 'Trace-fast) 2686 ((eq edebug-execution-mode 'Trace-fast)
2684 (edebug-sit-for 0)) ; Force update and continue. 2687 (edebug-sit-for 0))) ; Force update and continue.
2685 )
2686 2688
2687 (unwind-protect 2689 (unwind-protect
2688 (if (or edebug-stop 2690 (if (or edebug-stop
@@ -2778,6 +2780,7 @@ MSG is printed after `::::} '."
2778 (with-timeout-unsuspend edebug-with-timeout-suspend) 2780 (with-timeout-unsuspend edebug-with-timeout-suspend)
2779 ;; Reset global variables to outside values in case they were changed. 2781 ;; Reset global variables to outside values in case they were changed.
2780 (setq 2782 (setq
2783 unread-command-events edebug-outside-unread-command-events
2781 overlay-arrow-position edebug-outside-o-a-p 2784 overlay-arrow-position edebug-outside-o-a-p
2782 overlay-arrow-string edebug-outside-o-a-s 2785 overlay-arrow-string edebug-outside-o-a-s
2783 cursor-in-echo-area edebug-outside-c-i-e-a 2786 cursor-in-echo-area edebug-outside-c-i-e-a
@@ -2868,7 +2871,6 @@ MSG is printed after `::::} '."
2868 2871
2869 (edebug-outside-last-input-event last-input-event) 2872 (edebug-outside-last-input-event last-input-event)
2870 (edebug-outside-last-command-event last-command-event) 2873 (edebug-outside-last-command-event last-command-event)
2871 (edebug-outside-unread-command-events unread-command-events)
2872 (edebug-outside-last-event-frame last-event-frame) 2874 (edebug-outside-last-event-frame last-event-frame)
2873 (edebug-outside-last-nonmenu-event last-nonmenu-event) 2875 (edebug-outside-last-nonmenu-event last-nonmenu-event)
2874 (edebug-outside-track-mouse track-mouse) 2876 (edebug-outside-track-mouse track-mouse)
@@ -2890,7 +2892,6 @@ MSG is printed after `::::} '."
2890 ;; More for Emacs 19 2892 ;; More for Emacs 19
2891 (last-input-event nil) 2893 (last-input-event nil)
2892 (last-command-event nil) 2894 (last-command-event nil)
2893 (unread-command-events nil)
2894 (last-event-frame nil) 2895 (last-event-frame nil)
2895 (last-nonmenu-event nil) 2896 (last-nonmenu-event nil)
2896 (track-mouse nil) 2897 (track-mouse nil)
@@ -2950,7 +2951,6 @@ MSG is printed after `::::} '."
2950 last-command edebug-outside-last-command 2951 last-command edebug-outside-last-command
2951 this-command edebug-outside-this-command 2952 this-command edebug-outside-this-command
2952 unread-command-char edebug-outside-unread-command-char 2953 unread-command-char edebug-outside-unread-command-char
2953 unread-command-events edebug-outside-unread-command-events
2954 current-prefix-arg edebug-outside-current-prefix-arg 2954 current-prefix-arg edebug-outside-current-prefix-arg
2955 last-input-char edebug-outside-last-input-char 2955 last-input-char edebug-outside-last-input-char
2956 last-input-event edebug-outside-last-input-event 2956 last-input-event edebug-outside-last-input-event
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 0129bd43976..72754aa1cd3 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,41 @@
12006-08-13 Romain Francoise <romain@orebokech.com>
2
3 * erc-match.el (erc-log-matches-make-buffer): End `y-or-n-p'
4 prompt with a space.
5
62006-08-07 Michael Olson <mwolson@gnu.org>
7
8 * erc-backend.el (erc-process-sentinel-1): Use erc-display-message
9 in several places instead of inserting text.
10 (erc-process-sentinel): Move to the input-marker before removing
11 the prompt.
12
13 * erc.el (erc-port): Fix customization options.
14 (erc-display-message): Handle null type explicitly. Previously,
15 this was relying on a chance side-effect. Cosmetic indentation
16 tweak.
17 (english): Add 'finished and 'terminated entries to the catalog.
18 Add initial and terminal newlines to 'disconnected and
19 'disconnected-noreconnect entries. Avoid long lines.
20
212006-08-06 Michael Olson <mwolson@gnu.org>
22
23 * erc.el (erc-arrange-session-in-multiple-windows): Fix bug with
24 multi-tty Emacs.
25 (erc-select-startup-file): Fix bug introduced by recent change.
26
272006-08-05 Michael Olson <mwolson@gnu.org>
28
29 * erc-log.el (erc-log-standardize-name): New function that returns
30 a filename that is safe for use for a log file.
31 (erc-current-logfile): Use it.
32
33 * erc.el (erc-startup-file-list): Search in ~/.emacs.d first,
34 since that is a fairly standard directory.
35 (erc-select-startup-file): Re-write to use
36 convert-standard-filename, which will ensure that MS-DOS systems
37 look for the _ercrc.el file.
38
12006-08-02 Michael Olson <mwolson@gnu.org> 392006-08-02 Michael Olson <mwolson@gnu.org>
2 40
3 * erc.el (erc-version-string): Release ERC 5.1.4. 41 * erc.el (erc-version-string): Release ERC 5.1.4.
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 705ca7a9e63..5acbcb05ab8 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -493,11 +493,7 @@ action."
493 (if erc-server-quitting 493 (if erc-server-quitting
494 ;; normal quit 494 ;; normal quit
495 (progn 495 (progn
496 (let ((string "\n\n*** ERC finished ***\n") 496 (erc-display-message nil 'error (current-buffer) 'finished)
497 (inhibit-read-only t))
498 (erc-put-text-property 0 (length string)
499 'face 'erc-error-face string)
500 (insert string))
501 (when erc-kill-server-buffer-on-quit 497 (when erc-kill-server-buffer-on-quit
502 (set-buffer-modified-p nil) 498 (set-buffer-modified-p nil)
503 (kill-buffer (current-buffer)))) 499 (kill-buffer (current-buffer))))
@@ -519,12 +515,8 @@ action."
519 (erc erc-session-server erc-session-port erc-server-current-nick 515 (erc erc-session-server erc-session-port erc-server-current-nick
520 erc-session-user-full-name t erc-session-password) 516 erc-session-user-full-name t erc-session-password)
521 ;; terminate, do not reconnect 517 ;; terminate, do not reconnect
522 (let ((string (concat "\n\n*** ERC terminated: " event 518 (erc-display-message nil 'error (current-buffer)
523 "\n")) 519 'terminated ?e event))))
524 (inhibit-read-only t))
525 (erc-put-text-property 0 (length string)
526 'face 'erc-error-face string)
527 (insert string)))))
528 520
529(defun erc-process-sentinel (cproc event) 521(defun erc-process-sentinel (cproc event)
530 "Sentinel function for ERC process." 522 "Sentinel function for ERC process."
@@ -545,6 +537,7 @@ action."
545 (run-hook-with-args 'erc-disconnected-hook 537 (run-hook-with-args 'erc-disconnected-hook
546 (erc-current-nick) (system-name) "") 538 (erc-current-nick) (system-name) "")
547 ;; Remove the prompt 539 ;; Remove the prompt
540 (goto-char (or (marker-position erc-input-marker) (point-max)))
548 (forward-line 0) 541 (forward-line 0)
549 (erc-remove-text-properties-region (point) (point-max)) 542 (erc-remove-text-properties-region (point) (point-max))
550 (delete-region (point) (point-max)) 543 (delete-region (point) (point-max))
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el
index 418e45060bd..2fe29e82fe5 100644
--- a/lisp/erc/erc-log.el
+++ b/lisp/erc/erc-log.el
@@ -71,8 +71,6 @@
71;; markers. 71;; markers.
72 72
73;;; TODO: 73;;; TODO:
74;; * Erc needs a generalised make-safe-file-name function, so that
75;; generated file names don't contain any invalid file characters.
76;; 74;;
77;; * Really, we need to lock the logfiles somehow, so that if a user 75;; * Really, we need to lock the logfiles somehow, so that if a user
78;; is running multiple emacsen and/or on the same channel as more 76;; is running multiple emacsen and/or on the same channel as more
@@ -293,17 +291,27 @@ is writeable (it will be created as necessary) and
293 (funcall erc-enable-logging (or buffer (current-buffer))) 291 (funcall erc-enable-logging (or buffer (current-buffer)))
294 erc-enable-logging))) 292 erc-enable-logging)))
295 293
294(defun erc-log-standardize-name (filename)
295 "Make FILENAME safe to use as the name of an ERC log.
296This will not work with full paths, only names.
297
298Any unsafe characters in the name are replaced with \"!\". The
299filename is downcased."
300 (downcase (erc-replace-regexp-in-string
301 "[/\\]" "!" (convert-standard-filename filename))))
302
296(defun erc-current-logfile (&optional buffer) 303(defun erc-current-logfile (&optional buffer)
297 "Return the logfile to use for BUFFER. 304 "Return the logfile to use for BUFFER.
298If BUFFER is nil, the value of `current-buffer' is used. 305If BUFFER is nil, the value of `current-buffer' is used.
299This is determined by `erc-generate-log-file-name-function'. 306This is determined by `erc-generate-log-file-name-function'.
300The result is converted to lowercase, as IRC is case-insensitive" 307The result is converted to lowercase, as IRC is case-insensitive"
301 (expand-file-name 308 (expand-file-name
302 (downcase (funcall erc-generate-log-file-name-function 309 (erc-log-standardize-name
303 (or buffer (current-buffer)) 310 (funcall erc-generate-log-file-name-function
304 (or (erc-default-target) (buffer-name buffer)) 311 (or buffer (current-buffer))
305 (erc-current-nick) 312 (or (erc-default-target) (buffer-name buffer))
306 erc-session-server erc-session-port)) 313 (erc-current-nick)
314 erc-session-server erc-session-port))
307 erc-log-channels-directory)) 315 erc-log-channels-directory))
308 316
309(defun erc-generate-log-file-name-with-date (buffer &rest ignore) 317(defun erc-generate-log-file-name-with-date (buffer &rest ignore)
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index ffbc7482aae..b5dc913a8c4 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -566,7 +566,7 @@ deactivate/activate match logging in the latter. See
566 (unless buffer-already 566 (unless buffer-already
567 (insert " == Type \"q\" to dismiss messages ==\n") 567 (insert " == Type \"q\" to dismiss messages ==\n")
568 (erc-view-mode-enter nil (lambda (buffer) 568 (erc-view-mode-enter nil (lambda (buffer)
569 (when (y-or-n-p "Discard messages?") 569 (when (y-or-n-p "Discard messages? ")
570 (kill-buffer buffer))))) 570 (kill-buffer buffer)))))
571 buffer))) 571 buffer)))
572 572
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 4317b831d56..41d59576251 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -157,8 +157,8 @@ parameters and authentication."
157This can be either a string or a number." 157This can be either a string or a number."
158 :group 'erc 158 :group 'erc
159 :type '(choice (const :tag "None" nil) 159 :type '(choice (const :tag "None" nil)
160 (const :tag "Port number" number) 160 (integer :tag "Port number")
161 (const :tag "Port string" string))) 161 (string :tag "Port string")))
162 162
163(defcustom erc-nick nil 163(defcustom erc-nick nil
164 "Nickname to use if one is not provided. 164 "Nickname to use if one is not provided.
@@ -822,7 +822,8 @@ See `erc-server-flood-margin' for other flood-related parameters.")
822;; Script parameters 822;; Script parameters
823 823
824(defcustom erc-startup-file-list 824(defcustom erc-startup-file-list
825 '("~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc") 825 '("~/.emacs.d/.ercrc.el" "~/.emacs.d/.ercrc"
826 "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
826 "List of files to try for a startup script. 827 "List of files to try for a startup script.
827The first existent and readable one will get executed. 828The first existent and readable one will get executed.
828 829
@@ -2362,6 +2363,8 @@ See also `erc-format-message' and `erc-display-line'."
2362 msg))) 2363 msg)))
2363 (setq string 2364 (setq string
2364 (cond 2365 (cond
2366 ((null type)
2367 string)
2365 ((listp type) 2368 ((listp type)
2366 (mapc (lambda (type) 2369 (mapc (lambda (type)
2367 (setq string 2370 (setq string
@@ -2374,7 +2377,7 @@ See also `erc-format-message' and `erc-display-line'."
2374 (if (not (erc-response-p parsed)) 2377 (if (not (erc-response-p parsed))
2375 (erc-display-line string buffer) 2378 (erc-display-line string buffer)
2376 (unless (member (erc-response.command parsed) erc-hide-list) 2379 (unless (member (erc-response.command parsed) erc-hide-list)
2377 (erc-put-text-property 0 (length string) 'erc-parsed parsed string) 2380 (erc-put-text-property 0 (length string) 'erc-parsed parsed string)
2378 (erc-put-text-property 0 (length string) 'rear-sticky t string) 2381 (erc-put-text-property 0 (length string) 'rear-sticky t string)
2379 (erc-display-line string buffer))))) 2382 (erc-display-line string buffer)))))
2380 2383
@@ -5241,13 +5244,11 @@ If FILE is found, return the path to it."
5241(defun erc-select-startup-file () 5244(defun erc-select-startup-file ()
5242 "Select an ERC startup file. 5245 "Select an ERC startup file.
5243See also `erc-startup-file-list'." 5246See also `erc-startup-file-list'."
5244 (let ((l erc-startup-file-list) 5247 (catch 'found
5245 (f nil)) 5248 (dolist (f erc-startup-file-list)
5246 (while (and (not f) l) 5249 (setq f (convert-standard-filename f))
5247 (if (file-readable-p (car l)) 5250 (when (file-readable-p f)
5248 (setq f (car l))) 5251 (throw 'found f)))))
5249 (setq l (cdr l)))
5250 f))
5251 5252
5252(defun erc-find-script-file (file) 5253(defun erc-find-script-file (file)
5253 "Search for FILE in `default-directory', and any in `erc-script-path'." 5254 "Search for FILE in `default-directory', and any in `erc-script-path'."
@@ -5894,7 +5895,8 @@ All windows are opened in the current frame."
5894 (setq bufs (cdr bufs)) 5895 (setq bufs (cdr bufs))
5895 (while bufs 5896 (while bufs
5896 (split-window) 5897 (split-window)
5897 (switch-to-buffer-other-window (car bufs)) 5898 (other-window 1)
5899 (switch-to-buffer (car bufs))
5898 (setq bufs (cdr bufs)) 5900 (setq bufs (cdr bufs))
5899 (balance-windows))))) 5901 (balance-windows)))))
5900 5902
@@ -5946,12 +5948,17 @@ All windows are opened in the current frame."
5946 (ctcp-request-to . "==> CTCP request from %n (%u@%h) to %t: %r") 5948 (ctcp-request-to . "==> CTCP request from %n (%u@%h) to %t: %r")
5947 (ctcp-too-many . "Too many CTCP queries in single message. Ignoring") 5949 (ctcp-too-many . "Too many CTCP queries in single message. Ignoring")
5948 (flood-ctcp-off . "FLOOD PROTECTION: Automatic CTCP responses turned off.") 5950 (flood-ctcp-off . "FLOOD PROTECTION: Automatic CTCP responses turned off.")
5949 (flood-strict-mode . "FLOOD PROTECTION: Switched to Strict Flood Control mode.") 5951 (flood-strict-mode
5950 (disconnected . "Connection failed! Re-establishing connection...") 5952 . "FLOOD PROTECTION: Switched to Strict Flood Control mode.")
5951 (disconnected-noreconnect . "Connection failed! Not re-establishing connection.") 5953 (disconnected . "\n\nConnection failed! Re-establishing connection...\n")
5954 (disconnected-noreconnect
5955 . "\n\nConnection failed! Not re-establishing connection.\n")
5956 (finished . "\n\n*** ERC finished ***\n")
5957 (terminated . "\n\n*** ERC terminated: %e\n")
5952 (login . "Logging in as \'%n\'...") 5958 (login . "Logging in as \'%n\'...")
5953 (nick-in-use . "%n is in use. Choose new nickname: ") 5959 (nick-in-use . "%n is in use. Choose new nickname: ")
5954 (nick-too-long . "WARNING: Nick length (%i) exceeds max NICKLEN(%l) defined by server") 5960 (nick-too-long
5961 . "WARNING: Nick length (%i) exceeds max NICKLEN(%l) defined by server")
5955 (no-default-channel . "No default channel") 5962 (no-default-channel . "No default channel")
5956 (no-invitation . "You've got no invitation") 5963 (no-invitation . "You've got no invitation")
5957 (no-target . "No target") 5964 (no-target . "No target")
diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el
index 76bde7784dc..c700d5d7f6e 100644
--- a/lisp/eshell/em-glob.el
+++ b/lisp/eshell/em-glob.el
@@ -97,7 +97,7 @@ This option slows down recursive glob processing by quite a bit."
97 :type 'boolean 97 :type 'boolean
98 :group 'eshell-glob) 98 :group 'eshell-glob)
99 99
100(defcustom eshell-glob-chars-list '(?\] ?\[ ?* ?? ?~ ?\( ?\) ?| ?#) 100(defcustom eshell-glob-chars-list '(?\] ?\[ ?* ?? ?~ ?\( ?\) ?| ?# ?^)
101 "*List of additional characters used in extended globbing." 101 "*List of additional characters used in extended globbing."
102 :type '(repeat character) 102 :type '(repeat character)
103 :group 'eshell-glob) 103 :group 'eshell-glob)
@@ -105,6 +105,7 @@ This option slows down recursive glob processing by quite a bit."
105(defcustom eshell-glob-translate-alist 105(defcustom eshell-glob-translate-alist
106 '((?\] . "]") 106 '((?\] . "]")
107 (?\[ . "[") 107 (?\[ . "[")
108 (?^ . "^")
108 (?? . ".") 109 (?? . ".")
109 (?* . ".*") 110 (?* . ".*")
110 (?~ . "~") 111 (?~ . "~")
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index a8d8ea9a4b5..eaaf4dacd72 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -134,18 +134,24 @@ just before \"Other\" at the end."
134 134
135(defcustom facemenu-listed-faces nil 135(defcustom facemenu-listed-faces nil
136 "*List of faces to include in the Face menu. 136 "*List of faces to include in the Face menu.
137Each element should be a symbol, which is the name of a face. 137Each element should be a symbol, the name of a face.
138The \"basic \" faces in `facemenu-keybindings' are automatically 138The \"basic \" faces in `facemenu-keybindings' are automatically
139added to the Face menu, and are not included in this list. 139added to the Face menu, and need not be in this list.
140 140
141You can set this list before loading facemenu.el, or add a face to it before 141This value takes effect when you load facemenu.el. If the
142creating that face if you want it to be listed. If you change the 142list includes symbols which are not defined as faces, they
143variable so as to eliminate faces that have already been added to the menu, 143are ignored; however, subsequently defining or creating
144call `facemenu-update' to recalculate the menu contents. 144those faces adds them to the menu then. You can call
145 145`facemenu-update' to recalculate the menu contents, such as
146If this variable is t, all faces will be added to the menu. This 146if you change the value of this variable,
147is useful for setting temporarily if you want to add faces to the 147
148menu when they are created." 148If this variable is t, all faces that you apply to text
149using the face menu commands (even by name), and all faces
150that you define or create, are added to the menu. You may
151find it useful to set this variable to t temporarily while
152you define some faces, so that they will be added. However,
153if the value is no longer t and you call `facemenu-update',
154it will remove any faces not explicitly in the list."
149 :type '(choice (const :tag "List all faces" t) 155 :type '(choice (const :tag "List all faces" t)
150 (const :tag "None" nil) 156 (const :tag "None" nil)
151 (repeat symbol)) 157 (repeat symbol))
@@ -320,19 +326,24 @@ variables."
320 326
321;;;###autoload 327;;;###autoload
322(defun facemenu-set-face (face &optional start end) 328(defun facemenu-set-face (face &optional start end)
323 "Add FACE to the region or next character typed. 329 "Apply FACE to the region or next character typed.
324This adds FACE to the top of the face list; any faces lower on the list that 330
325will not show through at all will be removed. 331If the region is active (normally true except in Transient
326 332Mark mode) and nonempty, and there is no prefix argument,
327Interactively, reads the face name with the minibuffer. 333this command applies FACE to the region. Otherwise, it applies FACE
328 334to the faces to use for the next character
329If the region is active (normally true except in Transient Mark mode) 335inserted. (Moving point or switching buffers before typing
330and there is no prefix argument, this command sets the region to the 336a character to insert cancels the specification.)
331requested face. 337
332 338If FACE is `default', to \"apply\" it means clearing
333Otherwise, this command specifies the face for the next character 339the list of faces to be used. For any other value of FACE,
334inserted. Moving point or switching buffers before 340to \"apply\" it means putting FACE at the front of the list
335typing a character to insert cancels the specification." 341of faces to be used, and removing any faces further
342along in the list that would be completely overridden by
343preceding faces (including FACE).
344
345This command can also add FACE to the menu of faces,
346if `facemenu-listed-faces' says to do that."
336 (interactive (list (progn 347 (interactive (list (progn
337 (barf-if-buffer-read-only) 348 (barf-if-buffer-read-only)
338 (read-face-name "Use face")) 349 (read-face-name "Use face"))
@@ -612,7 +623,12 @@ effect. See `facemenu-remove-face-function'."
612 (cons face 623 (cons face
613 (if (listp prev) 624 (if (listp prev)
614 prev 625 prev
615 (list prev))))))) 626 (list prev)))
627 ;; Specify the selected frame
628 ;; because nil would mean to use
629 ;; the new-frame default settings,
630 ;; and those are usually nil.
631 (selected-frame)))))
616 (setq part-start part-end))) 632 (setq part-start part-end)))
617 (setq self-insert-face (if (eq last-command self-insert-face-command) 633 (setq self-insert-face (if (eq last-command self-insert-face-command)
618 (cons face (if (listp self-insert-face) 634 (cons face (if (listp self-insert-face)
@@ -655,9 +671,8 @@ use the selected frame. If t, then the global, non-frame faces are used."
655 (nreverse active-list))) 671 (nreverse active-list)))
656 672
657(defun facemenu-add-new-face (face) 673(defun facemenu-add-new-face (face)
658 "Add FACE (a face) to the Face menu. 674 "Add FACE (a face) to the Face menu if `facemenu-listed-faces' says so.
659 675This is called whenever you create a new face, and at other times."
660This is called whenever you create a new face."
661 (let* (name 676 (let* (name
662 symbol 677 symbol
663 menu docstring 678 menu docstring
diff --git a/lisp/faces.el b/lisp/faces.el
index 4627b5ff594..f2d3e0ddb44 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -2066,7 +2066,7 @@ created."
2066 ;; red4 is too dark, but some say blue is too loud. 2066 ;; red4 is too dark, but some say blue is too loud.
2067 ;; brown seems to work ok. -- rms. 2067 ;; brown seems to work ok. -- rms.
2068 (t :foreground "brown")) 2068 (t :foreground "brown"))
2069 "Face for characters displayed as ^-sequences or \-sequences." 2069 "Face for characters displayed as sequences using `^' or `\\'."
2070 :group 'basic-faces 2070 :group 'basic-faces
2071 :version "22.1") 2071 :version "22.1")
2072 2072
diff --git a/lisp/filesets.el b/lisp/filesets.el
index 4ca5a9d1420..eb8cdb02617 100644
--- a/lisp/filesets.el
+++ b/lisp/filesets.el
@@ -1798,7 +1798,7 @@ User will be queried, if no fileset name is provided."
1798 filesets-data nil))) 1798 filesets-data nil)))
1799 (entry (or (assoc name filesets-data) 1799 (entry (or (assoc name filesets-data)
1800 (when (y-or-n-p 1800 (when (y-or-n-p
1801 (format "Fileset %s does not exist. Create it?" 1801 (format "Fileset %s does not exist. Create it? "
1802 name)) 1802 name))
1803 (progn 1803 (progn
1804 (add-to-list 'filesets-data (list name '(:files))) 1804 (add-to-list 'filesets-data (list name '(:files)))
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index b05b7ecc2e6..82f9be4cb4c 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -976,7 +976,7 @@ The value of this variable is used when Font Lock mode is turned on."
976;; multi-line strings and comments; regexps are not appropriate for the job.) 976;; multi-line strings and comments; regexps are not appropriate for the job.)
977 977
978(defvar font-lock-extend-after-change-region-function nil 978(defvar font-lock-extend-after-change-region-function nil
979 "A function that determines the region to fontify after a change. 979 "A function that determines the region to refontify after a change.
980 980
981This variable is either nil, or is a function that determines the 981This variable is either nil, or is a function that determines the
982region to refontify after a change. 982region to refontify after a change.
@@ -985,7 +985,7 @@ Font-lock calls this function after each buffer change.
985 985
986The function is given three parameters, the standard BEG, END, and OLD-LEN 986The function is given three parameters, the standard BEG, END, and OLD-LEN
987from `after-change-functions'. It should return either a cons of the beginning 987from `after-change-functions'. It should return either a cons of the beginning
988and end buffer positions \(in that order) of the region to fontify, or nil 988and end buffer positions \(in that order) of the region to refontify, or nil
989\(which directs the caller to fontify a default region). 989\(which directs the caller to fontify a default region).
990This function should preserve the match-data. 990This function should preserve the match-data.
991The region it returns may start or end in the middle of a line.") 991The region it returns may start or end in the middle of a line.")
@@ -1044,6 +1044,12 @@ a very meaningful entity to highlight.")
1044(defvar font-lock-beg) (defvar font-lock-end) 1044(defvar font-lock-beg) (defvar font-lock-end)
1045(defvar font-lock-extend-region-functions 1045(defvar font-lock-extend-region-functions
1046 '(font-lock-extend-region-wholelines 1046 '(font-lock-extend-region-wholelines
1047 ;; This use of font-lock-multiline property is unreliable but is just
1048 ;; a handy heuristic: in case you don't have a function that does
1049 ;; /identification/ of multiline elements, you may still occasionally
1050 ;; discover them by accident (or you may /identify/ them but not in all
1051 ;; cases), in which case the font-lock-multiline property can help make
1052 ;; sure you will properly *re*identify them during refontification.
1047 font-lock-extend-region-multiline) 1053 font-lock-extend-region-multiline)
1048 "Special hook run just before proceeding to fontify a region. 1054 "Special hook run just before proceeding to fontify a region.
1049This is used to allow major modes to help font-lock find safe buffer positions 1055This is used to allow major modes to help font-lock find safe buffer positions
@@ -1167,6 +1173,13 @@ what properties to clear before refontifying a region.")
1167 1173
1168(defvar jit-lock-start) (defvar jit-lock-end) 1174(defvar jit-lock-start) (defvar jit-lock-end)
1169(defun font-lock-extend-jit-lock-region-after-change (beg end old-len) 1175(defun font-lock-extend-jit-lock-region-after-change (beg end old-len)
1176 "Function meant for `jit-lock-after-change-extend-region-functions'.
1177This function does 2 things:
1178- extend the region so that it not only includes the part that was modified
1179 but also the surrounding text whose highlighting may change as a consequence.
1180- anticipate (part of) the region extension that will happen later in
1181 `font-lock-default-fontify-region', in order to avoid the need for
1182 double-redisplay in `jit-lock-fontify-now'."
1170 (save-excursion 1183 (save-excursion
1171 ;; First extend the region as font-lock-after-change-function would. 1184 ;; First extend the region as font-lock-after-change-function would.
1172 (let ((region (if font-lock-extend-after-change-region-function 1185 (let ((region (if font-lock-extend-after-change-region-function
@@ -1177,6 +1190,16 @@ what properties to clear before refontifying a region.")
1177 end (max jit-lock-end (cdr region)))) 1190 end (max jit-lock-end (cdr region))))
1178 ;; Then extend the region obeying font-lock-multiline properties, 1191 ;; Then extend the region obeying font-lock-multiline properties,
1179 ;; indicating which part of the buffer needs to be refontified. 1192 ;; indicating which part of the buffer needs to be refontified.
1193 ;; !!! This is the *main* user of font-lock-multiline property !!!
1194 ;; font-lock-after-change-function could/should also do that, but it
1195 ;; doesn't need to because font-lock-default-fontify-region does
1196 ;; it anyway. Here OTOH we have no guarantee that
1197 ;; font-lock-default-fontify-region will be executed on this region
1198 ;; any time soon.
1199 ;; Note: contrary to font-lock-default-fontify-region, we do not do
1200 ;; any loop here because we are not looking for a safe spot: we just
1201 ;; mark the text whose appearance may need to change as a result of
1202 ;; the buffer modification.
1180 (when (and (> beg (point-min)) 1203 (when (and (> beg (point-min))
1181 (get-text-property (1- beg) 'font-lock-multiline)) 1204 (get-text-property (1- beg) 'font-lock-multiline))
1182 (setq beg (or (previous-single-property-change 1205 (setq beg (or (previous-single-property-change
@@ -1186,8 +1209,11 @@ what properties to clear before refontifying a region.")
1186 'font-lock-multiline nil) 1209 'font-lock-multiline nil)
1187 (point-max))) 1210 (point-max)))
1188 ;; Finally, pre-enlarge the region to a whole number of lines, to try 1211 ;; Finally, pre-enlarge the region to a whole number of lines, to try
1189 ;; and predict what font-lock-default-fontify-region will do, so as to 1212 ;; and anticipate what font-lock-default-fontify-region will do, so as to
1190 ;; avoid double-redisplay. 1213 ;; avoid double-redisplay.
1214 ;; We could just run `font-lock-extend-region-functions', but since
1215 ;; the only purpose is to avoid the double-redisplay, we prefer to
1216 ;; do here only the part that is cheap and most likely to be useful.
1191 (when (memq 'font-lock-extend-region-wholelines 1217 (when (memq 'font-lock-extend-region-wholelines
1192 font-lock-extend-region-functions) 1218 font-lock-extend-region-functions)
1193 (goto-char beg) 1219 (goto-char beg)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 750956b9f8b..6ddd513610a 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,27 @@
12006-08-13 Romain Francoise <romain@orebokech.com>
2
3 * mm-extern.el (mm-extern-mail-server): End `y-or-n-p' prompt with a
4 space.
5
62006-08-09 Katsumi Yamaoka <yamaoka@jpl.org>
7
8 * compface.el (uncompface): Use binary rather than raw-text-unix.
9
102006-08-09 Katsumi Yamaoka <yamaoka@jpl.org>
11
12 * compface.el (uncompface): Make sure the eol conversion doesn't take
13 place when communicating with the external programs. Reported by
14 ARISAWA Akihiro <ari@mbf.ocn.ne.jp>.
15
162006-07-31 Katsumi Yamaoka <yamaoka@jpl.org>
17
18 * nnheader.el (nnheader-insert-head): Fix typo in comment.
19
202006-07-31 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de>
21
22 * nnweb.el (nnweb-google-parse-1): Update regexp for author and date.
23 Make it more robust by parsing author and date independently.
24
12006-07-28 Katsumi Yamaoka <yamaoka@jpl.org> 252006-07-28 Katsumi Yamaoka <yamaoka@jpl.org>
2 26
3 * nnheader.el (nnheader-insert-head): Make it work with Mac as well. 27 * nnheader.el (nnheader-insert-head): Make it work with Mac as well.
diff --git a/lisp/gnus/compface.el b/lisp/gnus/compface.el
index f6bd9bfd720..33e05046e84 100644
--- a/lisp/gnus/compface.el
+++ b/lisp/gnus/compface.el
@@ -34,24 +34,28 @@ GNU/Linux system these might be in packages with names like `compface'
34or `faces-xface' and `netpbm' or `libgr-progs', for instance." 34or `faces-xface' and `netpbm' or `libgr-progs', for instance."
35 (with-temp-buffer 35 (with-temp-buffer
36 (insert face) 36 (insert face)
37 (and (eq 0 (apply 'call-process-region (point-min) (point-max) 37 (let ((coding-system-for-read 'raw-text)
38 "uncompface" 38 ;; At least "icontopbm" doesn't work with Windows because
39 'delete '(t nil) nil)) 39 ;; the line-break code is converted into CRLF by default.
40 (progn 40 (coding-system-for-write 'binary))
41 (goto-char (point-min)) 41 (and (eq 0 (apply 'call-process-region (point-min) (point-max)
42 (insert "/* Width=48, Height=48 */\n") 42 "uncompface"
43 ;; I just can't get "icontopbm" to work correctly on its 43 'delete '(t nil) nil))
44 ;; own in XEmacs. And Emacs doesn't understand un-raw pbm 44 (progn
45 ;; files. 45 (goto-char (point-min))
46 (if (not (featurep 'xemacs)) 46 (insert "/* Width=48, Height=48 */\n")
47 (eq 0 (call-process-region (point-min) (point-max) 47 ;; I just can't get "icontopbm" to work correctly on its
48 "icontopbm" 48 ;; own in XEmacs. And Emacs doesn't understand un-raw pbm
49 'delete '(t nil))) 49 ;; files.
50 (shell-command-on-region (point-min) (point-max) 50 (if (not (featurep 'xemacs))
51 "icontopbm | pnmnoraw" 51 (eq 0 (call-process-region (point-min) (point-max)
52 (current-buffer) t) 52 "icontopbm"
53 t)) 53 'delete '(t nil)))
54 (buffer-string)))) 54 (shell-command-on-region (point-min) (point-max)
55 "icontopbm | pnmnoraw"
56 (current-buffer) t)
57 t))
58 (buffer-string)))))
55 59
56(provide 'compface) 60(provide 'compface)
57 61
diff --git a/lisp/gnus/mm-extern.el b/lisp/gnus/mm-extern.el
index c574bd6156e..f4c728541e9 100644
--- a/lisp/gnus/mm-extern.el
+++ b/lisp/gnus/mm-extern.el
@@ -97,7 +97,7 @@
97 (subject (or (cdr (assq 'subject params)) "none")) 97 (subject (or (cdr (assq 'subject params)) "none"))
98 (buf (current-buffer)) 98 (buf (current-buffer))
99 info) 99 info)
100 (if (y-or-n-p (format "Send a request message to %s?" server)) 100 (if (y-or-n-p (format "Send a request message to %s? " server))
101 (save-window-excursion 101 (save-window-excursion
102 (message-mail server subject) 102 (message-mail server subject)
103 (message-goto-body) 103 (message-goto-body)
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el
index 79732cd3d88..82e1d3ab554 100644
--- a/lisp/gnus/nnheader.el
+++ b/lisp/gnus/nnheader.el
@@ -598,7 +598,7 @@ the line could be found."
598 (nth 1 (mm-insert-file-contents 598 (nth 1 (mm-insert-file-contents
599 file nil beg 599 file nil beg
600 (incf beg nnheader-head-chop-length)))) 600 (incf beg nnheader-head-chop-length))))
601 ;; CRLF of CR might be used for the line-break code. 601 ;; CRLF or CR might be used for the line-break code.
602 (prog1 (not (re-search-forward "\n\r?\n\\|\r\r" nil t)) 602 (prog1 (not (re-search-forward "\n\r?\n\\|\r\r" nil t))
603 (goto-char (point-max))) 603 (goto-char (point-max)))
604 (or (null nnheader-max-head-length) 604 (or (null nnheader-max-head-length)
diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el
index 7c0c8e0e444..d020d533aea 100644
--- a/lisp/gnus/nnweb.el
+++ b/lisp/gnus/nnweb.el
@@ -366,14 +366,15 @@ Valid types include `google', `dejanews', and `gmane'.")
366 (mm-url-decode-entities) 366 (mm-url-decode-entities)
367 (search-backward " - ") 367 (search-backward " - ")
368 (when (looking-at 368 (when (looking-at
369 " - \\([a-zA-Z]+\\) \\([0-9]+\\)\\(?: \\([0-9]\\{4\\}\\)\\)?[^\n]+by ?\n?\\([^<\n]+\\)\n") 369 "\\W+\\(\\w+\\) \\([0-9]+\\)\\(?: \\([0-9]\\{4\\}\\)\\)?")
370 (setq From (match-string 4) 370 (setq Date (format "%s %s 00:00:00 %s"
371 Date (format "%s %s 00:00:00 %s"
372 (match-string 1) 371 (match-string 1)
373 (match-string 2) 372 (match-string 2)
374 (or (match-string 3) 373 (or (match-string 3)
375 (substring (current-time-string) -4))))) 374 (substring (current-time-string) -4))))
376 375 (goto-char (match-end 0)))
376 (when (looking-at "[^b]+by\\W+\\([^<\n]+\\)")
377 (setq From (match-string 1)))
377 (widen) 378 (widen)
378 (forward-line 1) 379 (forward-line 1)
379 (incf i) 380 (incf i)
diff --git a/lisp/help.el b/lisp/help.el
index 4d92f69cebd..db76efb01a0 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -822,16 +822,13 @@ whose documentation describes the minor mode."
822 (sort minor-modes 822 (sort minor-modes
823 (lambda (a b) (string-lessp (cadr a) (cadr b))))) 823 (lambda (a b) (string-lessp (cadr a) (cadr b)))))
824 (when minor-modes 824 (when minor-modes
825 (princ "Summary of minor modes:\n") 825 (princ "Enabled minor modes:\n")
826 (make-local-variable 'help-button-cache) 826 (make-local-variable 'help-button-cache)
827 (with-current-buffer standard-output 827 (with-current-buffer standard-output
828 (dolist (mode minor-modes) 828 (dolist (mode minor-modes)
829 (let ((mode-function (nth 0 mode)) 829 (let ((mode-function (nth 0 mode))
830 (pretty-minor-mode (nth 1 mode)) 830 (pretty-minor-mode (nth 1 mode))
831 (indicator (nth 2 mode))) 831 (indicator (nth 2 mode)))
832 (setq indicator (if (zerop (length indicator))
833 "no indicator"
834 (format "indicator%s" indicator)))
835 (add-text-properties 0 (length pretty-minor-mode) 832 (add-text-properties 0 (length pretty-minor-mode)
836 '(face bold) pretty-minor-mode) 833 '(face bold) pretty-minor-mode)
837 (save-excursion 834 (save-excursion
@@ -840,16 +837,22 @@ whose documentation describes the minor mode."
840 (push (point-marker) help-button-cache) 837 (push (point-marker) help-button-cache)
841 ;; Document the minor modes fully. 838 ;; Document the minor modes fully.
842 (insert pretty-minor-mode) 839 (insert pretty-minor-mode)
843 (princ (format " minor mode (%s):\n" indicator)) 840 (princ (format " minor mode (%s):\n"
841 (if (zerop (length indicator))
842 "no indicator"
843 (format "indicator%s"
844 indicator))))
844 (princ (documentation mode-function))) 845 (princ (documentation mode-function)))
845 (princ " ")
846 (insert-button pretty-minor-mode 846 (insert-button pretty-minor-mode
847 'action (car help-button-cache) 847 'action (car help-button-cache)
848 'follow-link t 848 'follow-link t
849 'help-echo "mouse-2, RET: show full information") 849 'help-echo "mouse-2, RET: show full information")
850 (princ (format " minor mode (%s):\n" indicator))))) 850 (newline)))
851 (princ "\n(Full information about these minor modes 851 (forward-line -1)
852follows the description of the major mode.)\n\n")) 852 (fill-paragraph nil)
853 (forward-line 1))
854
855 (princ "\n(Information about these minor modes follows the major mode info.)\n\n"))
853 ;; Document the major mode. 856 ;; Document the major mode.
854 (let ((mode mode-name)) 857 (let ((mode mode-name))
855 (with-current-buffer standard-output 858 (with-current-buffer standard-output
diff --git a/lisp/info.el b/lisp/info.el
index def9a12ab0f..34509e72f25 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3806,6 +3806,8 @@ the variable `Info-file-list-for-emacs'."
3806 (setq other-tag 3806 (setq other-tag
3807 (cond ((save-match-data (looking-back "\\<see")) 3807 (cond ((save-match-data (looking-back "\\<see"))
3808 "") 3808 "")
3809 ((save-match-data (looking-back "\\<in"))
3810 "")
3809 ((memq (char-before) '(nil ?\. ?! ??)) 3811 ((memq (char-before) '(nil ?\. ?! ??))
3810 "See ") 3812 "See ")
3811 ((save-match-data 3813 ((save-match-data
diff --git a/lisp/international/latexenc.el b/lisp/international/latexenc.el
index 25d56c1e928..58e8d6c88e8 100644
--- a/lisp/international/latexenc.el
+++ b/lisp/international/latexenc.el
@@ -138,8 +138,14 @@ coding system names is determined from `latex-inputenc-coding-alist'."
138 ((and (require 'code-pages nil t) (coding-system-p sym)) sym) 138 ((and (require 'code-pages nil t) (coding-system-p sym)) sym)
139 (t 'undecided))) 139 (t 'undecided)))
140 ;; else try to find it in the master/main file 140 ;; else try to find it in the master/main file
141 (let ((default-directory (file-name-directory (nth 1 arg-list))) 141
142 latexenc-main-file) 142 ;; Fixme: If the current file is in an archive (e.g. tar,
143 ;; zip), we should find the master file in that archive.
144 ;; But, that is not yet implemented. -- K.Handa
145 (let ((default-directory (if (stringp (nth 1 arg-list))
146 (file-name-directory (nth 1 arg-list))
147 default-directory))
148 latexenc-main-file)
143 ;; Is there a TeX-master or tex-main-file in the local variables 149 ;; Is there a TeX-master or tex-main-file in the local variables
144 ;; section? 150 ;; section?
145 (unless latexenc-dont-use-TeX-master-flag 151 (unless latexenc-dont-use-TeX-master-flag
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index 8b0a25dbae0..d1cc9618175 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -830,18 +830,28 @@ but still contains full information about each coding system."
830 830
831;;;###autoload 831;;;###autoload
832(defun describe-font (fontname) 832(defun describe-font (fontname)
833 "Display information about fonts which partially match FONTNAME." 833 "Display information about a font whose name is FONTNAME.
834 (interactive "sFontname (default current choice for ASCII chars): ") 834The font must be already used by Emacs."
835 (interactive "sFont name (default current choice for ASCII chars): ")
835 (or (and window-system (fboundp 'fontset-list)) 836 (or (and window-system (fboundp 'fontset-list))
836 (error "No fontsets being used")) 837 (error "No fonts being used"))
837 (when (or (not fontname) (= (length fontname) 0)) 838 (let (fontset font-info)
838 (setq fontname (cdr (assq 'font (frame-parameters)))) 839 (when (or (not fontname) (= (length fontname) 0))
839 (if (query-fontset fontname) 840 (setq fontname (frame-parameter nil 'font))
840 (setq fontname 841 ;; Check if FONTNAME is a fontset.
841 (nth 1 (assq 'ascii (aref (fontset-info fontname) 2)))))) 842 (if (query-fontset fontname)
842 (let ((font-info (font-info fontname))) 843 (setq fontset fontname
844 fontname (nth 1 (assq 'ascii
845 (aref (fontset-info fontname) 2))))))
846 (setq font-info (font-info fontname))
843 (if (null font-info) 847 (if (null font-info)
844 (message "No matching font") 848 (if fontset
849 ;; The font should be surely used. So, there's some
850 ;; problem about getting information about it. It is
851 ;; better to print the fontname to show which font has
852 ;; this problem.
853 (message "No information about \"%s\"" fontname)
854 (message "No matching font being used"))
845 (with-output-to-temp-buffer "*Help*" 855 (with-output-to-temp-buffer "*Help*"
846 (describe-font-internal font-info 'verbose))))) 856 (describe-font-internal font-info 'verbose)))))
847 857
diff --git a/lisp/net/zone-mode.el b/lisp/net/zone-mode.el
deleted file mode 100644
index 441ef143f9c..00000000000
--- a/lisp/net/zone-mode.el
+++ /dev/null
@@ -1,120 +0,0 @@
1;;; zone-mode.el --- major mode for editing DNS zone files
2
3;; Copyright (C) 1998, 2002, 2003, 2004, 2005,
4;; 2006 Free Software Foundation, Inc.
5
6;; Author: John Heidemann <johnh@isi.edu>
7;; Keywords: DNS, languages
8
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software; you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation; either version 2, or (at your option)
14;; any later version.
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs; see the file COPYING. If not, write to the
23;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24;; Boston, MA 02110-1301, USA.
25
26;;; Commentary:
27
28;;;
29;;; See the comments in ``define-derived-mode zone-mode''
30;;; (the last function in this file)
31;;; for what this mode is and how to use it automatically.
32;;;
33
34;;;
35;;; Credits:
36;;; Zone-mode was written by John Heidemann <johnh@isi.edu>,
37;;; with bug fixes from Simon Leinen <simon@limmat.switch.ch>.
38;;;
39
40;;; Code:
41
42(defun zone-mode-update-serial ()
43 "Update the serial number in a zone."
44 (interactive)
45 (save-excursion
46 (goto-char (point-min))
47 (while (re-search-forward "\\b\\([0-9]+\\)\\([0-9][0-9]\\)\\([ \t]+;[ \t]+[Ss]erial\\)" (point-max) t)
48 (let* ((old-date (match-string 1))
49 (old-seq (match-string 2))
50 (old-seq-num (string-to-number (match-string 2)))
51 (old-flag (match-string 3))
52 (cur-date (format-time-string "%Y%m%d"))
53 (new-seq
54 (cond
55 ((not (string= old-date cur-date))
56 "00") ;; reset sequence number
57 ((>= old-seq-num 99)
58 (error "Serial number's sequence cannot increment beyond 99"))
59 (t
60 (format "%02d" (1+ old-seq-num)))))
61 (old-serial (concat old-date old-seq))
62 (new-serial (concat cur-date new-seq)))
63 (if (string-lessp new-serial old-serial)
64 (error "Serial numbers want to move backwards from %s to %s" old-serial new-serial)
65 (replace-match (concat cur-date new-seq old-flag) t t))))))
66
67;;;###autoload
68(defun zone-mode-update-serial-hook ()
69 "Update the serial number in a zone if the file was modified."
70 (interactive)
71 (if (buffer-modified-p (current-buffer))
72 (zone-mode-update-serial))
73 nil ;; so we can run from write-file-hooks
74 )
75
76(defvar zone-mode-syntax-table nil
77 "Zone-mode's syntax table.")
78
79(defun zone-mode-load-time-setup ()
80 "Initialize `zone-mode' stuff."
81 (setq zone-mode-syntax-table (make-syntax-table))
82 (modify-syntax-entry ?\; "<" zone-mode-syntax-table)
83 (modify-syntax-entry ?\n ">" zone-mode-syntax-table))
84
85;;;###autoload
86(define-derived-mode zone-mode fundamental-mode "zone"
87 "A mode for editing DNS zone files.
88
89Zone-mode does two things:
90
91 - automatically update the serial number for a zone
92 when saving the file
93
94 - fontification"
95
96 (add-hook 'write-file-functions 'zone-mode-update-serial-hook nil t)
97
98 (if (null zone-mode-syntax-table)
99 (zone-mode-load-time-setup)) ;; should have been run at load-time
100
101 ;; font-lock support:
102 (set-syntax-table zone-mode-syntax-table)
103 (make-local-variable 'comment-start)
104 (setq comment-start ";")
105 (make-local-variable 'comment-start-skip)
106 ;; Look within the line for a ; following an even number of backslashes
107 ;; after either a non-backslash or the line beginning.
108 (setq comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+[ \t]*")
109 (make-local-variable 'comment-column)
110 (setq comment-column 40)
111 (make-local-variable 'font-lock-defaults)
112 (setq font-lock-defaults
113 '(nil nil nil nil beginning-of-line)))
114
115(zone-mode-load-time-setup)
116
117(provide 'zone-mode)
118
119;;; arch-tag: 6a2940ef-fd4f-4de7-b979-b027b09821fe
120;;; zone-mode.el ends here
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 5dfa1eb8959..358c834de73 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -599,11 +599,16 @@ If CONTINUE is non-nil, use the `comment-continue' markers if any."
599 (if (and other (<= other max) (> other min)) 599 (if (and other (<= other max) (> other min))
600 ;; There is a comment and it's in the range: bingo. 600 ;; There is a comment and it's in the range: bingo.
601 (setq indent other)))))))) 601 (setq indent other))))))))
602 ;; Update INDENT to leave at least one space
603 ;; after other nonwhite text on the line.
604 (save-excursion
605 (skip-chars-backward " \t")
606 (unless (bolp)
607 (setq indent (max indent (1+ (current-column))))))
608 ;; If that's different from comment's current position, change it.
602 (unless (= (current-column) indent) 609 (unless (= (current-column) indent)
603 ;; If that's different from current, change it.
604 (delete-region (point) (progn (skip-chars-backward " \t") (point))) 610 (delete-region (point) (progn (skip-chars-backward " \t") (point)))
605 (indent-to (if (bolp) indent 611 (indent-to indent)))
606 (max indent (1+ (current-column)))))))
607 (goto-char cpos) 612 (goto-char cpos)
608 (set-marker cpos nil)))) 613 (set-marker cpos nil))))
609 614
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index 89aeef53b80..a9105227bfd 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -2287,7 +2287,7 @@ this file, or a list of arguments to send to the program."
2287 (interactive "DNew repository: ") 2287 (interactive "DNew repository: ")
2288 (if (or (file-directory-p (expand-file-name "CVSROOT" newroot)) 2288 (if (or (file-directory-p (expand-file-name "CVSROOT" newroot))
2289 (y-or-n-p (concat "Warning: no CVSROOT found inside repository." 2289 (y-or-n-p (concat "Warning: no CVSROOT found inside repository."
2290 " Change cvs-cvsroot anyhow?"))) 2290 " Change cvs-cvsroot anyhow? ")))
2291 (setq cvs-cvsroot newroot))) 2291 (setq cvs-cvsroot newroot)))
2292 2292
2293;;;; 2293;;;;
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index e6c6380bf88..b5334ba5bc5 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -115,6 +115,7 @@ address for root variables.")
115(defvar gdb-main-file nil "Source file from which program execution begins.") 115(defvar gdb-main-file nil "Source file from which program execution begins.")
116(defvar gud-old-arrow nil) 116(defvar gud-old-arrow nil)
117(defvar gdb-overlay-arrow-position nil) 117(defvar gdb-overlay-arrow-position nil)
118(defvar gdb-stack-position nil)
118(defvar gdb-server-prefix nil) 119(defvar gdb-server-prefix nil)
119(defvar gdb-flush-pending-output nil) 120(defvar gdb-flush-pending-output nil)
120(defvar gdb-location-alist nil 121(defvar gdb-location-alist nil
@@ -321,7 +322,7 @@ of the inferior. Non-nil means display the layout shown for
321 :version "22.1") 322 :version "22.1")
322 323
323(defcustom gdb-use-separate-io-buffer nil 324(defcustom gdb-use-separate-io-buffer nil
324 "Non-nil means display output from the inferior in a separate buffer." 325 "Non-nil means display output from the debugged program in a separate buffer."
325 :type 'boolean 326 :type 'boolean
326 :group 'gud 327 :group 'gud
327 :version "22.1") 328 :version "22.1")
@@ -353,14 +354,14 @@ With arg, display additional buffers iff arg is positive."
353 (error nil)))) 354 (error nil))))
354 355
355(defun gdb-use-separate-io-buffer (arg) 356(defun gdb-use-separate-io-buffer (arg)
356 "Toggle separate IO for inferior. 357 "Toggle separate IO for debugged program.
357With arg, use separate IO iff arg is positive." 358With arg, use separate IO iff arg is positive."
358 (interactive "P") 359 (interactive "P")
359 (setq gdb-use-separate-io-buffer 360 (setq gdb-use-separate-io-buffer
360 (if (null arg) 361 (if (null arg)
361 (not gdb-use-separate-io-buffer) 362 (not gdb-use-separate-io-buffer)
362 (> (prefix-numeric-value arg) 0))) 363 (> (prefix-numeric-value arg) 0)))
363 (message (format "Separate inferior IO %sabled" 364 (message (format "Separate IO %sabled"
364 (if gdb-use-separate-io-buffer "en" "dis"))) 365 (if gdb-use-separate-io-buffer "en" "dis")))
365 (if (and gud-comint-buffer 366 (if (and gud-comint-buffer
366 (buffer-name gud-comint-buffer)) 367 (buffer-name gud-comint-buffer))
@@ -1030,7 +1031,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'."
1030 (minibuffer . nil))) 1031 (minibuffer . nil)))
1031 1032
1032(defun gdb-frame-separate-io-buffer () 1033(defun gdb-frame-separate-io-buffer ()
1033 "Display IO of inferior in a new frame." 1034 "Display IO of debugged program in a new frame."
1034 (interactive) 1035 (interactive)
1035 (if gdb-use-separate-io-buffer 1036 (if gdb-use-separate-io-buffer
1036 (let ((special-display-regexps (append special-display-regexps '(".*"))) 1037 (let ((special-display-regexps (append special-display-regexps '(".*")))
@@ -1296,6 +1297,7 @@ not GDB."
1296 (setq gud-old-arrow gud-overlay-arrow-position) 1297 (setq gud-old-arrow gud-overlay-arrow-position)
1297 (setq gud-overlay-arrow-position nil) 1298 (setq gud-overlay-arrow-position nil)
1298 (setq gdb-overlay-arrow-position nil) 1299 (setq gdb-overlay-arrow-position nil)
1300 (setq gdb-stack-position nil)
1299 (if gdb-use-separate-io-buffer 1301 (if gdb-use-separate-io-buffer
1300 (setq gdb-output-sink 'inferior)))) 1302 (setq gdb-output-sink 'inferior))))
1301 (t 1303 (t
@@ -1330,6 +1332,7 @@ directives."
1330 (setq gdb-active-process nil) 1332 (setq gdb-active-process nil)
1331 (setq gud-overlay-arrow-position nil) 1333 (setq gud-overlay-arrow-position nil)
1332 (setq gdb-overlay-arrow-position nil) 1334 (setq gdb-overlay-arrow-position nil)
1335 (setq gdb-stack-position nil)
1333 (setq gud-old-arrow nil) 1336 (setq gud-old-arrow nil)
1334 (setq gdb-inferior-status "exited") 1337 (setq gdb-inferior-status "exited")
1335 (gdb-force-mode-line-update 1338 (gdb-force-mode-line-update
@@ -1776,9 +1779,8 @@ static char *magick[] = {
1776 (goto-char (point-min)) 1779 (goto-char (point-min))
1777 (while (< (point) (- (point-max) 1)) 1780 (while (< (point) (- (point-max) 1))
1778 (forward-line 1) 1781 (forward-line 1)
1779 (if (looking-at "[^\t].*?breakpoint") 1782 (if (looking-at gdb-breakpoint-regexp)
1780 (progn 1783 (progn
1781 (looking-at "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\(.\\)")
1782 (setq bptno (match-string 1)) 1784 (setq bptno (match-string 1))
1783 (setq flag (char-after (match-beginning 2))) 1785 (setq flag (char-after (match-beginning 2)))
1784 (add-text-properties 1786 (add-text-properties
@@ -1786,43 +1788,55 @@ static char *magick[] = {
1786 (if (eq flag ?y) 1788 (if (eq flag ?y)
1787 '(face font-lock-warning-face) 1789 '(face font-lock-warning-face)
1788 '(face font-lock-type-face))) 1790 '(face font-lock-type-face)))
1789 (beginning-of-line) 1791 (let ((bl (point))
1790 (if (re-search-forward " in \\(.*\\) at\\s-+" nil t) 1792 (el (line-end-position)))
1791 (progn 1793 (if (re-search-forward " in \\(.*\\) at\\s-+" el t)
1794 (progn
1795 (add-text-properties
1796 (match-beginning 1) (match-end 1)
1797 '(face font-lock-function-name-face))
1798 (looking-at "\\(\\S-+\\):\\([0-9]+\\)")
1799 (let ((line (match-string 2))
1800 (file (match-string 1)))
1801 (add-text-properties bl el
1802 '(mouse-face highlight
1803 help-echo "mouse-2, RET: visit breakpoint"))
1804 (unless (file-exists-p file)
1805 (setq file (cdr (assoc bptno gdb-location-alist))))
1806 (if (and file
1807 (not (string-equal file "File not found")))
1808 (with-current-buffer
1809 (find-file-noselect file 'nowarn)
1810 (set (make-local-variable 'gud-minor-mode)
1811 'gdba)
1812 (set (make-local-variable 'tool-bar-map)
1813 gud-tool-bar-map)
1814 ;; Only want one breakpoint icon at each
1815 ;; location.
1816 (save-excursion
1817 (goto-line (string-to-number line))
1818 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))
1819 (gdb-enqueue-input
1820 (list
1821 (concat gdb-server-prefix "list "
1822 (match-string-no-properties 1) ":1\n")
1823 'ignore))
1824 (gdb-enqueue-input
1825 (list (concat gdb-server-prefix "info source\n")
1826 `(lambda () (gdb-get-location
1827 ,bptno ,line ,flag)))))))
1828 (if (re-search-forward
1829 "<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
1830 el t)
1831 (add-text-properties
1832 (match-beginning 1) (match-end 1)
1833 '(face font-lock-function-name-face))
1834 (end-of-line)
1835 (re-search-backward "\\s-\\(\\S-*\\)"
1836 bl t)
1792 (add-text-properties 1837 (add-text-properties
1793 (match-beginning 1) (match-end 1) 1838 (match-beginning 1) (match-end 1)
1794 '(face font-lock-function-name-face)) 1839 '(face font-lock-variable-name-face)))))))
1795 (looking-at "\\(\\S-+\\):\\([0-9]+\\)")
1796 (let ((line (match-string 2))
1797 (file (match-string 1)))
1798 (add-text-properties (line-beginning-position)
1799 (line-end-position)
1800 '(mouse-face highlight
1801 help-echo "mouse-2, RET: visit breakpoint"))
1802 (unless (file-exists-p file)
1803 (setq file (cdr (assoc bptno gdb-location-alist))))
1804 (if (and file
1805 (not (string-equal file "File not found")))
1806 (with-current-buffer
1807 (find-file-noselect file 'nowarn)
1808 (set (make-local-variable 'gud-minor-mode)
1809 'gdba)
1810 (set (make-local-variable 'tool-bar-map)
1811 gud-tool-bar-map)
1812 ;; Only want one breakpoint icon at each
1813 ;; location.
1814 (save-excursion
1815 (goto-line (string-to-number line))
1816 (gdb-put-breakpoint-icon (eq flag ?y) bptno)))
1817 (gdb-enqueue-input
1818 (list
1819 (concat gdb-server-prefix "list "
1820 (match-string-no-properties 1) ":1\n")
1821 'ignore))
1822 (gdb-enqueue-input
1823 (list (concat gdb-server-prefix "info source\n")
1824 `(lambda () (gdb-get-location
1825 ,bptno ,line ,flag))))))))))
1826 (end-of-line)))))) 1840 (end-of-line))))))
1827 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))) 1841 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom)))
1828 1842
@@ -2026,8 +2040,14 @@ static char *magick[] = {
2026 (goto-char bl) 2040 (goto-char bl)
2027 (when (looking-at "^#\\([0-9]+\\)") 2041 (when (looking-at "^#\\([0-9]+\\)")
2028 (when (string-equal (match-string 1) gdb-frame-number) 2042 (when (string-equal (match-string 1) gdb-frame-number)
2029 (put-text-property bl (+ bl 4) 2043 (if (> (car (window-fringes)) 0)
2030 'face '(:inverse-video t))) 2044 (progn
2045 (or gdb-stack-position
2046 (setq gdb-stack-position (make-marker)))
2047 (set-marker gdb-stack-position (point)))
2048 (set-marker gdb-stack-position nil)
2049 (put-text-property bl (+ bl 4)
2050 'face '(:inverse-video t))))
2031 (when (re-search-forward 2051 (when (re-search-forward
2032 (concat 2052 (concat
2033 (if (string-equal (match-string 1) "0") "" " in ") 2053 (if (string-equal (match-string 1) "0") "" " in ")
@@ -2098,6 +2118,8 @@ static char *magick[] = {
2098 (kill-all-local-variables) 2118 (kill-all-local-variables)
2099 (setq major-mode 'gdb-frames-mode) 2119 (setq major-mode 'gdb-frames-mode)
2100 (setq mode-name "Frames") 2120 (setq mode-name "Frames")
2121 (setq gdb-stack-position nil)
2122 (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position)
2101 (setq buffer-read-only t) 2123 (setq buffer-read-only t)
2102 (use-local-map gdb-frames-mode-map) 2124 (use-local-map gdb-frames-mode-map)
2103 (run-mode-hooks 'gdb-frames-mode-hook) 2125 (run-mode-hooks 'gdb-frames-mode-hook)
@@ -2549,18 +2571,18 @@ corresponding to the mode line clicked."
2549 'local-map 2571 'local-map
2550 (gdb-make-header-line-mouse-map 2572 (gdb-make-header-line-mouse-map
2551 'mouse-1 2573 'mouse-1
2552 #'(lambda () (interactive) 2574 (lambda () (interactive)
2553 (let ((gdb-memory-address 2575 (let ((gdb-memory-address
2554 ;; Let GDB do the arithmetic. 2576 ;; Let GDB do the arithmetic.
2555 (concat 2577 (concat
2556 gdb-memory-address " - " 2578 gdb-memory-address " - "
2557 (number-to-string 2579 (number-to-string
2558 (* gdb-memory-repeat-count 2580 (* gdb-memory-repeat-count
2559 (cond ((string= gdb-memory-unit "b") 1) 2581 (cond ((string= gdb-memory-unit "b") 1)
2560 ((string= gdb-memory-unit "h") 2) 2582 ((string= gdb-memory-unit "h") 2)
2561 ((string= gdb-memory-unit "w") 4) 2583 ((string= gdb-memory-unit "w") 4)
2562 ((string= gdb-memory-unit "g") 8))))))) 2584 ((string= gdb-memory-unit "g") 8)))))))
2563 (gdb-invalidate-memory))))) 2585 (gdb-invalidate-memory)))))
2564 "|" 2586 "|"
2565 (propertize "+" 2587 (propertize "+"
2566 'face font-lock-warning-face 2588 'face font-lock-warning-face
@@ -2568,9 +2590,9 @@ corresponding to the mode line clicked."
2568 'mouse-face 'mode-line-highlight 2590 'mouse-face 'mode-line-highlight
2569 'local-map (gdb-make-header-line-mouse-map 2591 'local-map (gdb-make-header-line-mouse-map
2570 'mouse-1 2592 'mouse-1
2571 #'(lambda () (interactive) 2593 (lambda () (interactive)
2572 (let ((gdb-memory-address nil)) 2594 (let ((gdb-memory-address nil))
2573 (gdb-invalidate-memory))))) 2595 (gdb-invalidate-memory)))))
2574 "]: " 2596 "]: "
2575 (propertize gdb-memory-address 2597 (propertize gdb-memory-address
2576 'face font-lock-warning-face 2598 'face font-lock-warning-face
@@ -2635,13 +2657,13 @@ corresponding to the mode line clicked."
2635 2657
2636(defvar gdb-locals-watch-map 2658(defvar gdb-locals-watch-map
2637 (let ((map (make-sparse-keymap))) 2659 (let ((map (make-sparse-keymap)))
2638 (define-key map "\r" '(lambda () (interactive) 2660 (define-key map "\r" (lambda () (interactive)
2639 (beginning-of-line) 2661 (beginning-of-line)
2640 (gud-watch))) 2662 (gud-watch)))
2641 (define-key map [mouse-2] '(lambda (event) (interactive "e") 2663 (define-key map [mouse-2] (lambda (event) (interactive "e")
2642 (mouse-set-point event) 2664 (mouse-set-point event)
2643 (beginning-of-line) 2665 (beginning-of-line)
2644 (gud-watch))) 2666 (gud-watch)))
2645 map) 2667 map)
2646 "Keymap to create watch expression of a complex data type local variable.") 2668 "Keymap to create watch expression of a complex data type local variable.")
2647 2669
@@ -2764,7 +2786,7 @@ corresponding to the mode line clicked."
2764 (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer)) 2786 (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer))
2765 (define-key menu [threads] '("Threads" . gdb-display-threads-buffer)) 2787 (define-key menu [threads] '("Threads" . gdb-display-threads-buffer))
2766 (define-key menu [inferior] 2788 (define-key menu [inferior]
2767 '(menu-item "Inferior IO" gdb-display-separate-io-buffer 2789 '(menu-item "Separate IO" gdb-display-separate-io-buffer
2768 :enable gdb-use-separate-io-buffer)) 2790 :enable gdb-use-separate-io-buffer))
2769 (define-key menu [memory] '("Memory" . gdb-display-memory-buffer)) 2791 (define-key menu [memory] '("Memory" . gdb-display-memory-buffer))
2770 (define-key menu [registers] '("Registers" . gdb-display-registers-buffer)) 2792 (define-key menu [registers] '("Registers" . gdb-display-registers-buffer))
@@ -2783,7 +2805,7 @@ corresponding to the mode line clicked."
2783 (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer)) 2805 (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer))
2784 (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer)) 2806 (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer))
2785 (define-key menu [inferior] 2807 (define-key menu [inferior]
2786 '(menu-item "Inferior IO" gdb-frame-separate-io-buffer 2808 '(menu-item "Separate IO" gdb-frame-separate-io-buffer
2787 :enable gdb-use-separate-io-buffer)) 2809 :enable gdb-use-separate-io-buffer))
2788 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) 2810 (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
2789 (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer)) 2811 (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer))
@@ -2802,9 +2824,9 @@ corresponding to the mode line clicked."
2802 :help "Toggle look for source frame." 2824 :help "Toggle look for source frame."
2803 :button (:toggle . gdb-find-source-frame))) 2825 :button (:toggle . gdb-find-source-frame)))
2804 (define-key menu [gdb-use-separate-io] 2826 (define-key menu [gdb-use-separate-io]
2805 '(menu-item "Separate Inferior IO" gdb-use-separate-io-buffer 2827 '(menu-item "Separate IO" gdb-use-separate-io-buffer
2806 :visible (eq gud-minor-mode 'gdba) 2828 :visible (eq gud-minor-mode 'gdba)
2807 :help "Toggle separate IO for inferior." 2829 :help "Toggle separate IO for debugged program."
2808 :button (:toggle . gdb-use-separate-io-buffer))) 2830 :button (:toggle . gdb-use-separate-io-buffer)))
2809 (define-key menu [gdb-many-windows] 2831 (define-key menu [gdb-many-windows]
2810 '(menu-item "Display Other Windows" gdb-many-windows 2832 '(menu-item "Display Other Windows" gdb-many-windows
@@ -2901,12 +2923,13 @@ Kills the gdb buffers, and resets variables and the source buffers."
2901 (setq gud-minor-mode nil) 2923 (setq gud-minor-mode nil)
2902 (kill-local-variable 'tool-bar-map) 2924 (kill-local-variable 'tool-bar-map)
2903 (kill-local-variable 'gdb-define-alist)))))) 2925 (kill-local-variable 'gdb-define-alist))))))
2904 (when (markerp gdb-overlay-arrow-position) 2926 (setq gdb-overlay-arrow-position nil)
2905 (move-marker gdb-overlay-arrow-position nil)
2906 (setq gdb-overlay-arrow-position nil))
2907 (setq overlay-arrow-variable-list 2927 (setq overlay-arrow-variable-list
2908 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)) 2928 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
2909 (setq fringe-indicator-alist '((overlay-arrow . right-triangle))) 2929 (setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
2930 (setq gdb-stack-position nil)
2931 (setq overlay-arrow-variable-list
2932 (delq 'gdb-stack-position overlay-arrow-variable-list))
2910 (if (boundp 'speedbar-frame) (speedbar-timer-fn)) 2933 (if (boundp 'speedbar-frame) (speedbar-timer-fn))
2911 (setq gud-running nil) 2934 (setq gud-running nil)
2912 (setq gdb-active-process nil) 2935 (setq gdb-active-process nil)
@@ -3128,8 +3151,7 @@ BUFFER nil or omitted means use the current buffer."
3128 '((overlay-arrow . hollow-right-triangle)))) 3151 '((overlay-arrow . hollow-right-triangle))))
3129 (or gdb-overlay-arrow-position 3152 (or gdb-overlay-arrow-position
3130 (setq gdb-overlay-arrow-position (make-marker))) 3153 (setq gdb-overlay-arrow-position (make-marker)))
3131 (set-marker gdb-overlay-arrow-position 3154 (set-marker gdb-overlay-arrow-position (point))))))
3132 (point) (current-buffer))))))
3133 ;; remove all breakpoint-icons in assembler buffer before updating. 3155 ;; remove all breakpoint-icons in assembler buffer before updating.
3134 (gdb-remove-breakpoint-icons (point-min) (point-max)))) 3156 (gdb-remove-breakpoint-icons (point-min) (point-max))))
3135 (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer) 3157 (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 97e54135a6f..84b40e8ba80 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -3180,7 +3180,15 @@ class of the file (using s to separate nested class ids)."
3180(defvar gdb-script-font-lock-syntactic-keywords 3180(defvar gdb-script-font-lock-syntactic-keywords
3181 '(("^document\\s-.*\\(\n\\)" (1 "< b")) 3181 '(("^document\\s-.*\\(\n\\)" (1 "< b"))
3182 ;; It would be best to change the \n in front, but it's more difficult. 3182 ;; It would be best to change the \n in front, but it's more difficult.
3183 ("^en\\(d\\)\\>" (1 "> b")))) 3183 ("^end\\>"
3184 (0 (progn
3185 (unless (eq (match-beginning 0) (point-min))
3186 (put-text-property (1- (match-beginning 0)) (match-beginning 0)
3187 'syntax-table (eval-when-compile
3188 (string-to-syntax "> b")))
3189 (put-text-property (1- (match-beginning 0)) (match-end 0)
3190 'font-lock-multiline t)
3191 nil))))))
3184 3192
3185(defun gdb-script-font-lock-syntactic-face (state) 3193(defun gdb-script-font-lock-syntactic-face (state)
3186 (cond 3194 (cond
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index f748bb4b040..a08f999f089 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -986,7 +986,9 @@ subshells can nest."
986 ;; FIXME: This can (and often does) match multiple lines, yet it makes no 986 ;; FIXME: This can (and often does) match multiple lines, yet it makes no
987 ;; effort to handle multiline cases correctly, so it ends up being 987 ;; effort to handle multiline cases correctly, so it ends up being
988 ;; rather flakey. 988 ;; rather flakey.
989 (when (re-search-forward "\"\\(?:\\(?:.\\|\n\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" limit t) 989 (when (and (re-search-forward "\"\\(?:\\(?:.\\|\n\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" limit t)
990 ;; Make sure the " we matched is an opening quote.
991 (eq ?\" (nth 3 (syntax-ppss))))
990 ;; bingo we have a $( or a ` inside a "" 992 ;; bingo we have a $( or a ` inside a ""
991 (let ((char (char-after (point))) 993 (let ((char (char-after (point)))
992 (continue t) 994 (continue t)
@@ -1081,9 +1083,6 @@ This is used to flag quote characters in subshell constructs inside strings
1081 ("\\(\\\\\\)'" 1 ,sh-st-punc) 1083 ("\\(\\\\\\)'" 1 ,sh-st-punc)
1082 ;; Make sure $@ and @? are correctly recognized as sexps. 1084 ;; Make sure $@ and @? are correctly recognized as sexps.
1083 ("\\$\\([?@]\\)" 1 ,sh-st-symbol) 1085 ("\\$\\([?@]\\)" 1 ,sh-st-symbol)
1084 ;; highlight (possibly nested) subshells inside "" quoted regions correctly.
1085 (sh-quoted-subshell
1086 (1 (sh-apply-quoted-subshell) t t))
1087 ;; Find HEREDOC starters and add a corresponding rule for the ender. 1086 ;; Find HEREDOC starters and add a corresponding rule for the ender.
1088 (sh-font-lock-here-doc 1087 (sh-font-lock-here-doc
1089 (2 (sh-font-lock-open-heredoc 1088 (2 (sh-font-lock-open-heredoc
@@ -1093,7 +1092,11 @@ This is used to flag quote characters in subshell constructs inside strings
1093 (and (match-beginning 3) (/= (match-beginning 3) (match-end 3)))) 1092 (and (match-beginning 3) (/= (match-beginning 3) (match-end 3))))
1094 nil t)) 1093 nil t))
1095 ;; Distinguish the special close-paren in `case'. 1094 ;; Distinguish the special close-paren in `case'.
1096 (")" 0 (sh-font-lock-paren (match-beginning 0))))) 1095 (")" 0 (sh-font-lock-paren (match-beginning 0)))
1096 ;; highlight (possibly nested) subshells inside "" quoted regions correctly.
1097 ;; This should be at the very end because it uses syntax-ppss.
1098 (sh-quoted-subshell
1099 (1 (sh-apply-quoted-subshell) t t))))
1097 1100
1098(defun sh-font-lock-syntactic-face-function (state) 1101(defun sh-font-lock-syntactic-face-function (state)
1099 (let ((q (nth 3 state))) 1102 (let ((q (nth 3 state)))
diff --git a/lisp/simple.el b/lisp/simple.el
index 204684a3d5b..86b3af702e4 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3697,7 +3697,10 @@ because what we really need is for `move-to-column'
3697and `current-column' to be able to ignore invisible text." 3697and `current-column' to be able to ignore invisible text."
3698 (if (zerop col) 3698 (if (zerop col)
3699 (beginning-of-line) 3699 (beginning-of-line)
3700 (move-to-column col)) 3700 (let ((opoint (point)))
3701 (move-to-column col)
3702 ;; move-to-column doesn't respect field boundaries.
3703 (goto-char (constrain-to-field (point) opoint))))
3701 3704
3702 (when (and line-move-ignore-invisible 3705 (when (and line-move-ignore-invisible
3703 (not (bolp)) (line-move-invisible-p (1- (point)))) 3706 (not (bolp)) (line-move-invisible-p (1- (point))))
@@ -3767,7 +3770,8 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
3767 (interactive "p") 3770 (interactive "p")
3768 (or arg (setq arg 1)) 3771 (or arg (setq arg 1))
3769 3772
3770 (let ((orig (point))) 3773 (let ((orig (point))
3774 start first-vis first-vis-field-value)
3771 3775
3772 ;; Move by lines, if ARG is not 1 (the default). 3776 ;; Move by lines, if ARG is not 1 (the default).
3773 (if (/= arg 1) 3777 (if (/= arg 1)
@@ -3778,10 +3782,24 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
3778 (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) 3782 (while (and (not (bobp)) (line-move-invisible-p (1- (point))))
3779 (goto-char (previous-char-property-change (point))) 3783 (goto-char (previous-char-property-change (point)))
3780 (skip-chars-backward "^\n")) 3784 (skip-chars-backward "^\n"))
3781 3785 (setq start (point))
3782 ;; Take care of fields. 3786
3783 (goto-char (constrain-to-field (point) orig 3787 ;; Now find first visible char in the line
3784 (/= arg 1) t nil)))) 3788 (while (and (not (eobp)) (line-move-invisible-p (point)))
3789 (goto-char (next-char-property-change (point))))
3790 (setq first-vis (point))
3791
3792 ;; See if fields would stop us from reaching FIRST-VIS.
3793 (setq first-vis-field-value
3794 (constrain-to-field first-vis orig (/= arg 1) t nil))
3795
3796 (goto-char (if (/= first-vis-field-value first-vis)
3797 ;; If yes, obey them.
3798 first-vis-field-value
3799 ;; Otherwise, move to START with attention to fields.
3800 ;; (It is possible that fields never matter in this case.)
3801 (constrain-to-field (point) orig
3802 (/= arg 1) t nil)))))
3785 3803
3786 3804
3787;;; Many people have said they rarely use this feature, and often type 3805;;; Many people have said they rarely use this feature, and often type
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 21515e02612..9229ec549e6 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -2484,7 +2484,7 @@ order until succeed.")
2484;; Override Paste so it looks at CLIPBOARD first. 2484;; Override Paste so it looks at CLIPBOARD first.
2485(defun x-clipboard-yank () 2485(defun x-clipboard-yank ()
2486 "Insert the clipboard contents, or the last stretch of killed text." 2486 "Insert the clipboard contents, or the last stretch of killed text."
2487 (interactive) 2487 (interactive "*")
2488 (let ((clipboard-text (x-selection-value 'CLIPBOARD)) 2488 (let ((clipboard-text (x-selection-value 'CLIPBOARD))
2489 (x-select-enable-clipboard t)) 2489 (x-select-enable-clipboard t))
2490 (if (and clipboard-text (> (length clipboard-text) 0)) 2490 (if (and clipboard-text (> (length clipboard-text) 0))
@@ -2492,12 +2492,13 @@ order until succeed.")
2492 (yank))) 2492 (yank)))
2493 2493
2494(define-key menu-bar-edit-menu [paste] 2494(define-key menu-bar-edit-menu [paste]
2495 (cons "Paste" (cons "Paste text from clipboard or kill ring" 2495 '(menu-item "Paste" x-clipboard-yank
2496 'x-clipboard-yank))) 2496 :enable (not buffer-read-only)
2497 :help "Paste (yank) text most recently cut/copied"))
2497 2498
2498;; Initiate drag and drop 2499;; Initiate drag and drop
2499(add-hook 'after-make-frame-functions 'x-dnd-init-frame) 2500(add-hook 'after-make-frame-functions 'x-dnd-init-frame)
2500(global-set-key [drag-n-drop] 'x-dnd-handle-drag-n-drop-event) 2501(define-key special-event-map [drag-n-drop] 'x-dnd-handle-drag-n-drop-event)
2501 2502
2502;; Let F10 do menu bar navigation. 2503;; Let F10 do menu bar navigation.
2503(and (fboundp 'menu-bar-open) 2504(and (fboundp 'menu-bar-open)
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 7622f23752b..9ea51a2f774 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -228,8 +228,37 @@
228 (define-key map "\e[4~" [select]) 228 (define-key map "\e[4~" [select])
229 (define-key map "\e[29~" [print]) 229 (define-key map "\e[29~" [print])
230 230
231 ;; These keys are available in xterm starting from version 214 231 ;; These keys are available in xterm starting from version 216
232 ;; if the modifyOtherKeys resource is set to 1. 232 ;; if the modifyOtherKeys resource is set to 1.
233
234 (define-key map "\e[27;5;39~" [?\C-\'])
235 (define-key map "\e[27;5;45~" [?\C--])
236
237 (define-key map "\e[27;5;48~" [?\C-0])
238 (define-key map "\e[27;5;49~" [?\C-1])
239 ;; Not all C-DIGIT keys have a distinct binding.
240 (define-key map "\e[27;5;57~" [?\C-9])
241
242 (define-key map "\e[27;5;59~" [?\C-\;])
243 (define-key map "\e[27;5;61~" [?\C-=])
244
245
246 (define-key map "\e[27;6;33~" [?\C-!])
247 (define-key map "\e[27;6;34~" [?\C-\"])
248 (define-key map "\e[27;6;35~" [?\C-#])
249 (define-key map "\e[27;6;36~" [?\C-$])
250 (define-key map "\e[27;6;37~" [?\C-%])
251 (define-key map "\e[27;6;38~" [(C-&)])
252 (define-key map "\e[27;6;40~" [?\C-(])
253 (define-key map "\e[27;6;41~" [?\C-)])
254 (define-key map "\e[27;6;42~" [?\C-*])
255 (define-key map "\e[27;6;43~" [?\C-+])
256
257 (define-key map "\e[27;6;58~" [?\C-:])
258 (define-key map "\e[27;6;60~" [?\C-<])
259 (define-key map "\e[27;6;62~" [?\C->])
260 (define-key map "\e[27;6;63~" [(C-\?)])
261
233 (define-key map "\e[27;5;9~" [C-tab]) 262 (define-key map "\e[27;5;9~" [C-tab])
234 (define-key map "\e[27;5;13~" [C-return]) 263 (define-key map "\e[27;5;13~" [C-return])
235 (define-key map "\e[27;5;44~" [?\C-,]) 264 (define-key map "\e[27;5;44~" [?\C-,])
diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el
index a323d4c4468..21fe137118f 100644
--- a/lisp/textmodes/dns-mode.el
+++ b/lisp/textmodes/dns-mode.el
@@ -90,6 +90,18 @@
90 :type 'sexp 90 :type 'sexp
91 :group 'dns-mode) 91 :group 'dns-mode)
92 92
93(defcustom dns-mode-soa-auto-increment-serial t
94 "Whether to increment the SOA serial number automatically.
95
96If this variable is t, the serial number is incremented upon each save of
97the file. If it is `ask', Emacs asks for confirmation whether it should
98increment the serial upon saving. If nil, serials must be incremented
99manually with \\[dns-mode-soa-increment-serial]."
100 :type '(choice (const :tag "Always" t)
101 (const :tag "Ask" ask)
102 (const :tag "Never" nil))
103 :group 'dns-mode)
104
93;; Syntax table. 105;; Syntax table.
94 106
95(defvar dns-mode-syntax-table 107(defvar dns-mode-syntax-table
@@ -135,8 +147,12 @@ Turning on DNS mode runs `dns-mode-hook'."
135 (unless (featurep 'xemacs) 147 (unless (featurep 'xemacs)
136 (set (make-local-variable 'font-lock-defaults) 148 (set (make-local-variable 'font-lock-defaults)
137 '(dns-mode-font-lock-keywords nil nil ((?_ . "w"))))) 149 '(dns-mode-font-lock-keywords nil nil ((?_ . "w")))))
150 (add-hook 'before-save-hook 'dns-mode-soa-maybe-increment-serial
151 nil t)
138 (easy-menu-add dns-mode-menu dns-mode-map)) 152 (easy-menu-add dns-mode-menu dns-mode-map))
139 153
154;;;###autoload (defalias 'zone-mode 'dns-mode)
155
140;; Tools. 156;; Tools.
141 157
142;;;###autoload 158;;;###autoload
@@ -192,6 +208,21 @@ Turning on DNS mode runs `dns-mode-hook'."
192 (message "Replaced old serial %s with %s" serial new)) 208 (message "Replaced old serial %s with %s" serial new))
193 (error "Cannot locate serial number in SOA record")))))) 209 (error "Cannot locate serial number in SOA record"))))))
194 210
211(defun dns-mode-soa-maybe-increment-serial ()
212 "Increment SOA serial if needed.
213
214This function is run from `before-save-hook'."
215 (when (and (buffer-modified-p)
216 dns-mode-soa-auto-increment-serial
217 (or (eq dns-mode-soa-auto-increment-serial t)
218 (y-or-n-p "Increment SOA serial? ")))
219 ;; If `dns-mode-soa-increment-serial' signals an error saving will
220 ;; fail but that probably means that the serial should be fixed to
221 ;; comply with the RFC anyway! -rfr
222 (progn (dns-mode-soa-increment-serial)
223 ;; We return nil in case this is used in write-contents-functions.
224 nil)))
225
195;;;###autoload(add-to-list 'auto-mode-alist '("\\.soa\\'" . dns-mode)) 226;;;###autoload(add-to-list 'auto-mode-alist '("\\.soa\\'" . dns-mode))
196 227
197(provide 'dns-mode) 228(provide 'dns-mode)
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index 4cda0d6b3a0..1fcac6855d9 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.43 8;; Version: 4.44
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -90,10 +90,12 @@
90;; 90;;
91;; Recent changes 91;; Recent changes
92;; -------------- 92;; --------------
93;; Version 4.43 93;; Version 4.44
94;; - Big fixes 94;; - Clock table can be done for a limited time interval.
95;; - Obsolete support for the old outline mode has been removed.
96;; - Bug fixes and code cleaning.
95;; 97;;
96;; Version 4.42 98;; Version 4.43
97;; - Bug fixes 99;; - Bug fixes
98;; - `s' key in the agenda saves all org-mode buffers. 100;; - `s' key in the agenda saves all org-mode buffers.
99;; 101;;
@@ -212,16 +214,13 @@
212 214
213;;; Customization variables 215;;; Customization variables
214 216
215(defvar org-version "4.43" 217(defvar org-version "4.44"
216 "The version number of the file org.el.") 218 "The version number of the file org.el.")
217(defun org-version () 219(defun org-version ()
218 (interactive) 220 (interactive)
219 (message "Org-mode version %s" org-version)) 221 (message "Org-mode version %s" org-version))
220 222
221;; The following constant is for compatibility with different versions 223;; Compatibility constants
222;; of outline.el.
223(defconst org-noutline-p (featurep 'noutline)
224 "Are we using the new outline mode?")
225(defconst org-xemacs-p (featurep 'xemacs)) ; not used by org.el itself 224(defconst org-xemacs-p (featurep 'xemacs)) ; not used by org.el itself
226(defconst org-format-transports-properties-p 225(defconst org-format-transports-properties-p
227 (let ((x "a")) 226 (let ((x "a"))
@@ -1132,7 +1131,7 @@ files and the cdr the corresponding command. Possible values for the
1132file identifier are 1131file identifier are
1133 \"ext\" A string identifying an extension 1132 \"ext\" A string identifying an extension
1134 `directory' Matches a directory 1133 `directory' Matches a directory
1135 `remote' Matches a remove file, accessible through tramp or efs. 1134 `remote' Matches a remote file, accessible through tramp or efs.
1136 Remote files most likely should be visited through emacs 1135 Remote files most likely should be visited through emacs
1137 because external applications cannot handle such paths. 1136 because external applications cannot handle such paths.
1138 t Default for all remaining files 1137 t Default for all remaining files
@@ -1831,6 +1830,7 @@ Org-mode files lives."
1831 1830
1832(defcustom org-export-language-setup 1831(defcustom org-export-language-setup
1833 '(("en" "Author" "Date" "Table of Contents") 1832 '(("en" "Author" "Date" "Table of Contents")
1833 ("cs" "Autor" "Datum" "Obsah")
1834 ("da" "Ophavsmand" "Dato" "Indhold") 1834 ("da" "Ophavsmand" "Dato" "Indhold")
1835 ("de" "Autor" "Datum" "Inhaltsverzeichnis") 1835 ("de" "Autor" "Datum" "Inhaltsverzeichnis")
1836 ("es" "Autor" "Fecha" "\xccndice") 1836 ("es" "Autor" "Fecha" "\xccndice")
@@ -2150,6 +2150,16 @@ you can \"misuse\" it to add arbitrary text to the header."
2150 :group 'org-export-html 2150 :group 'org-export-html
2151 :type 'string) 2151 :type 'string)
2152 2152
2153(defcustom org-export-html-title-format "<h1 class=\"title\">%s</h1>\n"
2154 "Format for typesetting the document title in HTML export."
2155 :group 'org-export-html
2156 :type 'string)
2157
2158(defcustom org-export-html-toplevel-hlevel 2
2159 "The <H> level for level 1 headings in HTML export."
2160 :group 'org-export-html
2161 :type 'string)
2162
2153(defcustom org-export-html-link-org-files-as-html t 2163(defcustom org-export-html-link-org-files-as-html t
2154 "Non-nil means, make file links to `file.org' point to `file.html'. 2164 "Non-nil means, make file links to `file.org' point to `file.html'.
2155When org-mode is exporting an org-mode file to HTML, links to 2165When org-mode is exporting an org-mode file to HTML, links to
@@ -2694,6 +2704,10 @@ Also put tags into group 4 if tags are present.")
2694 (remove-text-properties 0 (length s) org-rm-props s) 2704 (remove-text-properties 0 (length s) org-rm-props s)
2695 s) 2705 s)
2696 2706
2707(defsubst org-set-local (var value)
2708 "Make VAR local in current buffer and set it to VALUE."
2709 (set (make-variable-buffer-local var) value))
2710
2697(defsubst org-mode-p () 2711(defsubst org-mode-p ()
2698 "Check if the current buffer is in Org-mode." 2712 "Check if the current buffer is in Org-mode."
2699 (eq major-mode 'org-mode)) 2713 (eq major-mode 'org-mode))
@@ -2703,7 +2717,7 @@ Also put tags into group 4 if tags are present.")
2703 (when (org-mode-p) 2717 (when (org-mode-p)
2704 (let ((re (org-make-options-regexp 2718 (let ((re (org-make-options-regexp
2705 '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO" 2719 '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO"
2706 "STARTUP" "ARCHIVE" "TAGS"))) 2720 "STARTUP" "ARCHIVE" "TAGS" "CALC")))
2707 (splitre "[ \t]+") 2721 (splitre "[ \t]+")
2708 kwds int key value cat arch tags) 2722 kwds int key value cat arch tags)
2709 (save-excursion 2723 (save-excursion
@@ -2755,10 +2769,10 @@ Also put tags into group 4 if tags are present.")
2755 (remove-text-properties 0 (length arch) 2769 (remove-text-properties 0 (length arch)
2756 '(face t fontified t) arch))) 2770 '(face t fontified t) arch)))
2757 ))) 2771 )))
2758 (and cat (set (make-local-variable 'org-category) cat)) 2772 (and cat (org-set-local 'org-category cat))
2759 (and kwds (set (make-local-variable 'org-todo-keywords) kwds)) 2773 (and kwds (org-set-local 'org-todo-keywords kwds))
2760 (and arch (set (make-local-variable 'org-archive-location) arch)) 2774 (and arch (org-set-local 'org-archive-location arch))
2761 (and int (set (make-local-variable 'org-todo-interpretation) int)) 2775 (and int (org-set-local 'org-todo-interpretation int))
2762 (when tags 2776 (when tags
2763 (let (e tgs) 2777 (let (e tgs)
2764 (while (setq e (pop tags)) 2778 (while (setq e (pop tags))
@@ -2770,7 +2784,7 @@ Also put tags into group 4 if tags are present.")
2770 (string-to-char (match-string 2 e))) 2784 (string-to-char (match-string 2 e)))
2771 tgs)) 2785 tgs))
2772 (t (push (list e) tgs)))) 2786 (t (push (list e) tgs))))
2773 (set (make-local-variable 'org-tag-alist) nil) 2787 (org-set-local 'org-tag-alist nil)
2774 (while (setq e (pop tgs)) 2788 (while (setq e (pop tgs))
2775 (or (and (stringp (car e)) 2789 (or (and (stringp (car e))
2776 (assoc (car e) org-tag-alist)) 2790 (assoc (car e) org-tag-alist))
@@ -2928,15 +2942,11 @@ The following commands are available:
2928 ;; Need to do this here because define-derived-mode sets up 2942 ;; Need to do this here because define-derived-mode sets up
2929 ;; the keymap so late. 2943 ;; the keymap so late.
2930 (if (featurep 'xemacs) 2944 (if (featurep 'xemacs)
2931 (if org-noutline-p 2945 (progn
2932 (progn 2946 ;; Assume this is Greg's port, it used easymenu
2933 (easy-menu-remove outline-mode-menu-heading) 2947 (easy-menu-remove outline-mode-menu-heading)
2934 (easy-menu-remove outline-mode-menu-show) 2948 (easy-menu-remove outline-mode-menu-show)
2935 (easy-menu-remove outline-mode-menu-hide)) 2949 (easy-menu-remove outline-mode-menu-hide))
2936 (delete-menu-item '("Headings"))
2937 (delete-menu-item '("Show"))
2938 (delete-menu-item '("Hide"))
2939 (set-menubar-dirty-flag))
2940 (define-key org-mode-map [menu-bar headings] 'undefined) 2950 (define-key org-mode-map [menu-bar headings] 'undefined)
2941 (define-key org-mode-map [menu-bar hide] 'undefined) 2951 (define-key org-mode-map [menu-bar hide] 'undefined)
2942 (define-key org-mode-map [menu-bar show] 'undefined)) 2952 (define-key org-mode-map [menu-bar show] 'undefined))
@@ -2947,7 +2957,7 @@ The following commands are available:
2947 (if org-descriptive-links (org-add-to-invisibility-spec '(org-link))) 2957 (if org-descriptive-links (org-add-to-invisibility-spec '(org-link)))
2948 (org-add-to-invisibility-spec '(org-cwidth)) 2958 (org-add-to-invisibility-spec '(org-cwidth))
2949 (when (featurep 'xemacs) 2959 (when (featurep 'xemacs)
2950 (set (make-local-variable 'line-move-ignore-invisible) t)) 2960 (org-set-local 'line-move-ignore-invisible t))
2951 (setq outline-regexp "\\*+") 2961 (setq outline-regexp "\\*+")
2952 ;;(setq outline-regexp "\\(?:\\*+\\|[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\) \\)") 2962 ;;(setq outline-regexp "\\(?:\\*+\\|[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\) \\)")
2953 (setq outline-level 'org-outline-level) 2963 (setq outline-level 'org-outline-level)
@@ -2958,12 +2968,14 @@ The following commands are available:
2958 4 (string-to-vector org-ellipsis)) 2968 4 (string-to-vector org-ellipsis))
2959 (setq buffer-display-table org-display-table)) 2969 (setq buffer-display-table org-display-table))
2960 (org-set-regexps-and-options) 2970 (org-set-regexps-and-options)
2971 ;; Calc embedded
2972 (org-set-local 'calc-embedded-open-mode "# ")
2961 (modify-syntax-entry ?# "<") 2973 (modify-syntax-entry ?# "<")
2962 (if org-startup-truncated (setq truncate-lines t)) 2974 (if org-startup-truncated (setq truncate-lines t))
2963 (set (make-local-variable 'font-lock-unfontify-region-function) 2975 (org-set-local 'font-lock-unfontify-region-function
2964 'org-unfontify-region) 2976 'org-unfontify-region)
2965 ;; Activate before-change-function 2977 ;; Activate before-change-function
2966 (set (make-local-variable 'org-table-may-need-update) t) 2978 (org-set-local 'org-table-may-need-update t)
2967 (org-add-hook 'before-change-functions 'org-before-change-function nil 2979 (org-add-hook 'before-change-functions 'org-before-change-function nil
2968 'local) 2980 'local)
2969 ;; Check for running clock before killing a buffer 2981 ;; Check for running clock before killing a buffer
@@ -3107,7 +3119,7 @@ that will be added to PLIST. Returns the string that was modified."
3107 org-ts-regexp "\\)?") 3119 org-ts-regexp "\\)?")
3108 "Regular expression matching a time stamp or time stamp range.") 3120 "Regular expression matching a time stamp or time stamp range.")
3109 3121
3110(defvar org-§emph-face nil) 3122(defvar org-§emph-face nil)
3111 3123
3112(defun org-do-emphasis-faces (limit) 3124(defun org-do-emphasis-faces (limit)
3113 "Run through the buffer and add overlays to links." 3125 "Run through the buffer and add overlays to links."
@@ -3340,10 +3352,9 @@ between words."
3340 ))) 3352 )))
3341 (setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords)) 3353 (setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords))
3342 ;; Now set the full font-lock-keywords 3354 ;; Now set the full font-lock-keywords
3343 (set (make-local-variable 'org-font-lock-keywords) 3355 (org-set-local 'org-font-lock-keywords org-font-lock-extra-keywords)
3344 org-font-lock-extra-keywords) 3356 (org-set-local 'font-lock-defaults
3345 (set (make-local-variable 'font-lock-defaults) 3357 '(org-font-lock-keywords t nil nil backward-paragraph))
3346 '(org-font-lock-keywords t nil nil backward-paragraph))
3347 (kill-local-variable 'font-lock-keywords) nil)) 3358 (kill-local-variable 'font-lock-keywords) nil))
3348 3359
3349(defvar org-m nil) 3360(defvar org-m nil)
@@ -3812,9 +3823,7 @@ state (TODO by default). Also with prefix arg, force first state."
3812 (org-insert-heading) 3823 (org-insert-heading)
3813 (save-excursion 3824 (save-excursion
3814 (org-back-to-heading) 3825 (org-back-to-heading)
3815 (if org-noutline-p 3826 (outline-previous-heading)
3816 (outline-previous-heading)
3817 (outline-previous-visible-heading t))
3818 (looking-at org-todo-line-regexp)) 3827 (looking-at org-todo-line-regexp))
3819 (if (or arg 3828 (if (or arg
3820 (not (match-beginning 2)) 3829 (not (match-beginning 2))
@@ -4703,7 +4712,7 @@ the children that do not contain any open TODO items."
4703 (pc '(:org-comment t)) 4712 (pc '(:org-comment t))
4704 (pall '(:org-archived t :org-comment t)) 4713 (pall '(:org-archived t :org-comment t))
4705 (rea (concat ":" org-archive-tag ":")) 4714 (rea (concat ":" org-archive-tag ":"))
4706 bmp file re) 4715 bmp file re)
4707 (save-excursion 4716 (save-excursion
4708 (while (setq file (pop files)) 4717 (while (setq file (pop files))
4709 (org-check-agenda-file file) 4718 (org-check-agenda-file file)
@@ -4775,7 +4784,7 @@ If not found, stay at current position and return nil."
4775 pos)) 4784 pos))
4776 4785
4777(defconst org-dblock-start-re 4786(defconst org-dblock-start-re
4778 "^#\\+BEGIN:[ \t]+\\(\\S-+\\)[ \t]+\\(.*\\)" 4787 "^#\\+BEGIN:[ \t]+\\(\\S-+\\)\\([ \t]+\\(.*\\)\\)?"
4779 "Matches the startline of a dynamic block, with parameters.") 4788 "Matches the startline of a dynamic block, with parameters.")
4780 4789
4781(defconst org-dblock-end-re "^#\\+END\\([: \t\r\n]\\|$\\)" 4790(defconst org-dblock-end-re "^#\\+END\\([: \t\r\n]\\|$\\)"
@@ -4803,7 +4812,7 @@ the property list including an extra property :name with the block name."
4803 (let* ((begdel (1+ (match-end 0))) 4812 (let* ((begdel (1+ (match-end 0)))
4804 (name (match-string 1)) 4813 (name (match-string 1))
4805 (params (append (list :name name) 4814 (params (append (list :name name)
4806 (read (concat "(" (match-string 2) ")"))))) 4815 (read (concat "(" (match-string 3) ")")))))
4807 (unless (re-search-forward org-dblock-end-re nil t) 4816 (unless (re-search-forward org-dblock-end-re nil t)
4808 (error "Dynamic block not terminated")) 4817 (error "Dynamic block not terminated"))
4809 (delete-region begdel (match-beginning 0)) 4818 (delete-region begdel (match-beginning 0))
@@ -5200,7 +5209,6 @@ If CALLBACK is non-nil, it is a function which is called to confirm
5200that the match should indeed be shown." 5209that the match should indeed be shown."
5201 (interactive "sRegexp: ") 5210 (interactive "sRegexp: ")
5202 (org-remove-occur-highlights nil nil t) 5211 (org-remove-occur-highlights nil nil t)
5203 (setq regexp (org-check-occur-regexp regexp))
5204 (let ((cnt 0)) 5212 (let ((cnt 0))
5205 (save-excursion 5213 (save-excursion
5206 (goto-char (point-min)) 5214 (goto-char (point-min))
@@ -5625,56 +5633,58 @@ next column.
5625For time difference computation, a year is assumed to be exactly 365 5633For time difference computation, a year is assumed to be exactly 365
5626days in order to avoid rounding problems." 5634days in order to avoid rounding problems."
5627 (interactive "P") 5635 (interactive "P")
5628 (save-excursion 5636 (or
5629 (unless (org-at-date-range-p) 5637 (org-clock-update-time-maybe)
5630 (goto-char (point-at-bol)) 5638 (save-excursion
5631 (re-search-forward org-tr-regexp (point-at-eol) t)) 5639 (unless (org-at-date-range-p)
5632 (if (not (org-at-date-range-p)) 5640 (goto-char (point-at-bol))
5633 (error "Not at a time-stamp range, and none found in current line"))) 5641 (re-search-forward org-tr-regexp (point-at-eol) t))
5634 (let* ((ts1 (match-string 1)) 5642 (if (not (org-at-date-range-p))
5635 (ts2 (match-string 2)) 5643 (error "Not at a time-stamp range, and none found in current line")))
5636 (havetime (or (> (length ts1) 15) (> (length ts2) 15))) 5644 (let* ((ts1 (match-string 1))
5637 (match-end (match-end 0)) 5645 (ts2 (match-string 2))
5638 (time1 (org-time-string-to-time ts1)) 5646 (havetime (or (> (length ts1) 15) (> (length ts2) 15)))
5639 (time2 (org-time-string-to-time ts2)) 5647 (match-end (match-end 0))
5640 (t1 (time-to-seconds time1)) 5648 (time1 (org-time-string-to-time ts1))
5641 (t2 (time-to-seconds time2)) 5649 (time2 (org-time-string-to-time ts2))
5642 (diff (abs (- t2 t1))) 5650 (t1 (time-to-seconds time1))
5643 (negative (< (- t2 t1) 0)) 5651 (t2 (time-to-seconds time2))
5644 ;; (ys (floor (* 365 24 60 60))) 5652 (diff (abs (- t2 t1)))
5645 (ds (* 24 60 60)) 5653 (negative (< (- t2 t1) 0))
5646 (hs (* 60 60)) 5654 ;; (ys (floor (* 365 24 60 60)))
5647 (fy "%dy %dd %02d:%02d") 5655 (ds (* 24 60 60))
5648 (fy1 "%dy %dd") 5656 (hs (* 60 60))
5649 (fd "%dd %02d:%02d") 5657 (fy "%dy %dd %02d:%02d")
5650 (fd1 "%dd") 5658 (fy1 "%dy %dd")
5651 (fh "%02d:%02d") 5659 (fd "%dd %02d:%02d")
5652 y d h m align) 5660 (fd1 "%dd")
5653 (if havetime 5661 (fh "%02d:%02d")
5654 (setq ; y (floor (/ diff ys)) diff (mod diff ys) 5662 y d h m align)
5655 y 0 5663 (if havetime
5656 d (floor (/ diff ds)) diff (mod diff ds) 5664 (setq ; y (floor (/ diff ys)) diff (mod diff ys)
5657 h (floor (/ diff hs)) diff (mod diff hs) 5665 y 0
5658 m (floor (/ diff 60))) 5666 d (floor (/ diff ds)) diff (mod diff ds)
5659 (setq ; y (floor (/ diff ys)) diff (mod diff ys) 5667 h (floor (/ diff hs)) diff (mod diff hs)
5660 y 0 5668 m (floor (/ diff 60)))
5661 d (floor (+ (/ diff ds) 0.5)) 5669 (setq ; y (floor (/ diff ys)) diff (mod diff ys)
5662 h 0 m 0)) 5670 y 0
5663 (if (not to-buffer) 5671 d (floor (+ (/ diff ds) 0.5))
5664 (message (org-make-tdiff-string y d h m)) 5672 h 0 m 0))
5665 (when (org-at-table-p) 5673 (if (not to-buffer)
5666 (goto-char match-end) 5674 (message (org-make-tdiff-string y d h m))
5667 (setq align t) 5675 (when (org-at-table-p)
5668 (and (looking-at " *|") (goto-char (match-end 0)))) 5676 (goto-char match-end)
5669 (if (looking-at 5677 (setq align t)
5670 "\\( *-? *[0-9]+y\\)?\\( *[0-9]+d\\)? *[0-9][0-9]:[0-9][0-9]") 5678 (and (looking-at " *|") (goto-char (match-end 0))))
5671 (replace-match "")) 5679 (if (looking-at
5672 (if negative (insert " -")) 5680 "\\( *-? *[0-9]+y\\)?\\( *[0-9]+d\\)? *[0-9][0-9]:[0-9][0-9]")
5673 (if (> y 0) (insert " " (format (if havetime fy fy1) y d h m)) 5681 (replace-match ""))
5674 (if (> d 0) (insert " " (format (if havetime fd fd1) d h m)) 5682 (if negative (insert " -"))
5675 (insert " " (format fh h m)))) 5683 (if (> y 0) (insert " " (format (if havetime fy fy1) y d h m))
5676 (if align (org-table-align)) 5684 (if (> d 0) (insert " " (format (if havetime fd fd1) d h m))
5677 (message "Time difference inserted")))) 5685 (insert " " (format fh h m))))
5686 (if align (org-table-align))
5687 (message "Time difference inserted")))))
5678 5688
5679(defun org-make-tdiff-string (y d h m) 5689(defun org-make-tdiff-string (y d h m)
5680 (let ((fmt "") 5690 (let ((fmt "")
@@ -5817,6 +5827,7 @@ in the timestamp determines what will be changed."
5817 (setcar (nthcdr 2 time0) (or (nth 1 time0) 0)) 5827 (setcar (nthcdr 2 time0) (or (nth 1 time0) 0))
5818 (setq time (apply 'encode-time time0)))) 5828 (setq time (apply 'encode-time time0))))
5819 (insert (setq org-last-changed-timestamp (format-time-string fmt time))) 5829 (insert (setq org-last-changed-timestamp (format-time-string fmt time)))
5830 (org-clock-update-time-maybe)
5820 (goto-char pos) 5831 (goto-char pos)
5821 ;; Try to recenter the calendar window, if any 5832 ;; Try to recenter the calendar window, if any
5822 (if (and org-calendar-follow-timestamp-change 5833 (if (and org-calendar-follow-timestamp-change
@@ -5937,18 +5948,19 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
5937 "Holds the file total time in minutes, after a call to `org-clock-sum'.") 5948 "Holds the file total time in minutes, after a call to `org-clock-sum'.")
5938 (make-variable-buffer-local 'org-clock-file-total-minutes) 5949 (make-variable-buffer-local 'org-clock-file-total-minutes)
5939 5950
5940(defun org-clock-sum () 5951(defun org-clock-sum (&optional tstart tend)
5941 "Sum the times for each subtree. 5952 "Sum the times for each subtree.
5942Puts the resulting times in minutes as a text property on each headline." 5953Puts the resulting times in minutes as a text property on each headline."
5943 (interactive) 5954 (interactive)
5944 (let* ((bmp (buffer-modified-p)) 5955 (let* ((bmp (buffer-modified-p))
5945 (re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*" 5956 (re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*"
5946 org-clock-string 5957 org-clock-string
5947 ".*=>[ \t]*\\([0-9]+\\):\\([0-9]+\\)[ \t]*$")) 5958 "[ \t]*\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)"))
5948 (lmax 30) 5959 (lmax 30)
5949 (ltimes (make-vector lmax 0)) 5960 (ltimes (make-vector lmax 0))
5950 (t1 0) 5961 (t1 0)
5951 (level 0) 5962 (level 0)
5963 ts te dt
5952 time) 5964 time)
5953 (remove-text-properties (point-min) (point-max) '(:org-clock-minutes t)) 5965 (remove-text-properties (point-min) (point-max) '(:org-clock-minutes t))
5954 (save-excursion 5966 (save-excursion
@@ -5956,8 +5968,16 @@ Puts the resulting times in minutes as a text property on each headline."
5956 (while (re-search-backward re nil t) 5968 (while (re-search-backward re nil t)
5957 (if (match-end 2) 5969 (if (match-end 2)
5958 ;; A time 5970 ;; A time
5959 (setq t1 (+ t1 (* 60 (string-to-number (match-string 2))) 5971 (setq ts (match-string 2)
5960 (string-to-number (match-string 3)))) 5972 te (match-string 3)
5973 ts (time-to-seconds
5974 (apply 'encode-time (org-parse-time-string ts)))
5975 te (time-to-seconds
5976 (apply 'encode-time (org-parse-time-string te)))
5977 ts (if tstart (max ts tstart) ts)
5978 te (if tend (min te tend) te)
5979 dt (- te ts)
5980 t1 (if (> dt 0) (+ t1 (floor (/ dt 60))) t1))
5961 ;; A headline 5981 ;; A headline
5962 (setq level (- (match-end 1) (match-beginning 1))) 5982 (setq level (- (match-end 1) (match-beginning 1)))
5963 (when (or (> t1 0) (> (aref ltimes level) 0)) 5983 (when (or (> t1 0) (> (aref ltimes level) 0))
@@ -6069,26 +6089,112 @@ The BEGIN line can contain parameters. Allowed are:
6069 (interactive) 6089 (interactive)
6070 (org-remove-clock-overlays) 6090 (org-remove-clock-overlays)
6071 (unless (org-find-dblock "clocktable") 6091 (unless (org-find-dblock "clocktable")
6072 (org-create-dblock (list :name "clocktable" 6092 (org-create-dblock (list :name "clocktable"
6073 :maxlevel 2 :emphasize nil))) 6093 :maxlevel 2 :emphasize nil)))
6074 (org-update-dblock)) 6094 (org-update-dblock))
6075 6095
6096(defun org-clock-update-time-maybe ()
6097 "If this is a CLOCK line, update it and return t.
6098Otherwise, return nil."
6099 (interactive)
6100 (save-excursion
6101 (beginning-of-line 1)
6102 (skip-chars-forward " \t")
6103 (when (looking-at org-clock-string)
6104 (let ((re (concat "[ \t]*" org-clock-string
6105 " *[[<]\\([^]>]+\\)[]>]-+[[<]\\([^]>]+\\)[]>]"
6106 "\\([ \t]*=>.*\\)?"))
6107 ts te h m s)
6108 (if (not (looking-at re))
6109 nil
6110 (and (match-end 3) (delete-region (match-beginning 3) (match-end 3)))
6111 (end-of-line 1)
6112 (setq ts (match-string 1)
6113 te (match-string 2))
6114 (setq s (- (time-to-seconds
6115 (apply 'encode-time (org-parse-time-string te)))
6116 (time-to-seconds
6117 (apply 'encode-time (org-parse-time-string ts))))
6118 h (floor (/ s 3600))
6119 s (- s (* 3600 h))
6120 m (floor (/ s 60))
6121 s (- s (* 60 s)))
6122 (insert " => " (format "%2d:%02d" h m))
6123 t)))))
6124
6125(defun org-clock-special-range (key &optional time as-strings)
6126 "Return two times bordering a special time range.
6127Key is a symbol specifying the range and can be one of `today', `yesterday',
6128`thisweek', `lastweek', `thismonth', `lastmonth', `thisyear', `lastyear'.
6129A week starts Monday 0:00 and ends Sunday 24:00.
6130The range is determined relative to TIME. TIME defaults to the current time.
6131The return value is a cons cell with two internal times like the ones
6132returned by `current time' or `encode-time'. if AS-STRINGS is non-nil,
6133the returned times will be formatted strings."
6134 (let* ((tm (decode-time (or time (current-time))))
6135 (s 0) (m (nth 1 tm)) (h (nth 2 tm))
6136 (d (nth 3 tm)) (month (nth 4 tm)) (y (nth 5 tm))
6137 (dow (nth 6 tm))
6138 s1 m1 h1 d1 month1 y1 diff ts te fm)
6139 (cond
6140 ((eq key 'today)
6141 (setq h 0 m 0 h1 24 m1 0))
6142 ((eq key 'yesterday)
6143 (setq d (1- d) h 0 m 0 h1 24 m1 0))
6144 ((eq key 'thisweek)
6145 (setq diff (if (= dow 0) 6 (1- dow))
6146 m 0 h 0 d (- d diff) d1 (+ 7 d)))
6147 ((eq key 'lastweek)
6148 (setq diff (+ 7 (if (= dow 0) 6 (1- dow)))
6149 m 0 h 0 d (- d diff) d1 (+ 7 d)))
6150 ((eq key 'thismonth)
6151 (setq d 1 h 0 m 0 d1 1 month1 (1+ month) h1 0 m1 0))
6152 ((eq key 'lastmonth)
6153 (setq d 1 h 0 m 0 d1 1 month (1- month) month1 (1+ month) h1 0 m1 0))
6154 ((eq key 'thisyear)
6155 (setq m 0 h 0 d 1 month 1 y1 (1+ y)))
6156 ((eq key 'lastyear)
6157 (setq m 0 h 0 d 1 month 1 y (1- y) y1 (1+ y)))
6158 (t (error "No such time block %s" key)))
6159 (setq ts (encode-time s m h d month y)
6160 te (encode-time (or s1 s) (or m1 m) (or h1 h)
6161 (or d1 d) (or month1 month) (or y1 y)))
6162 (setq fm (cdr org-time-stamp-formats))
6163 (if as-strings
6164 (cons (format-time-string fm ts) (format-time-string fm te))
6165 (cons ts te))))
6166
6076(defun org-dblock-write:clocktable (params) 6167(defun org-dblock-write:clocktable (params)
6077 "Write the standard clocktable." 6168 "Write the standard clocktable."
6078 (let ((hlchars '((1 . "*") (2 . ?/))) 6169 (let ((hlchars '((1 . "*") (2 . ?/)))
6079 (emph nil) 6170 (emph nil)
6080 (ins (make-marker)) 6171 (ins (make-marker))
6081 ipos time h m p level hlc hdl maxlevel) 6172 ipos time h m p level hlc hdl maxlevel
6173 ts te cc block)
6082 (setq maxlevel (or (plist-get params :maxlevel) 3) 6174 (setq maxlevel (or (plist-get params :maxlevel) 3)
6083 emph (plist-get params :emphasize)) 6175 emph (plist-get params :emphasize)
6176 ts (plist-get params :tstart)
6177 te (plist-get params :tend)
6178 block (plist-get params :block))
6179 (when block
6180 (setq cc (org-clock-special-range block nil t)
6181 ts (car cc) te (cdr cc)))
6182 (if ts (setq ts (time-to-seconds
6183 (apply 'encode-time (org-parse-time-string ts)))))
6184 (if te (setq te (time-to-seconds
6185 (apply 'encode-time (org-parse-time-string te)))))
6084 (move-marker ins (point)) 6186 (move-marker ins (point))
6085 (setq ipos (point)) 6187 (setq ipos (point))
6086 (insert-before-markers "Clock summary at [" 6188 (insert-before-markers "Clock summary at ["
6087 (substring 6189 (substring
6088 (format-time-string (cdr org-time-stamp-formats)) 6190 (format-time-string (cdr org-time-stamp-formats))
6089 1 -1) 6191 1 -1)
6090 "]\n|L|Headline|Time|\n") 6192 "]."
6091 (org-clock-sum) 6193 (if block
6194 (format " Considered range is /%s/." block)
6195 "")
6196 "\n\n|L|Headline|Time|\n")
6197 (org-clock-sum ts te)
6092 (setq h (/ org-clock-file-total-minutes 60) 6198 (setq h (/ org-clock-file-total-minutes 60)
6093 m (- org-clock-file-total-minutes (* 60 h))) 6199 m (- org-clock-file-total-minutes (* 60 h)))
6094 (insert-before-markers "|-\n|0|" "*Total file time*| " 6200 (insert-before-markers "|-\n|0|" "*Total file time*| "
@@ -6475,7 +6581,7 @@ the buffer and restores the previous window configuration."
6475 (if (stringp org-agenda-files) 6581 (if (stringp org-agenda-files)
6476 (let ((cw (current-window-configuration))) 6582 (let ((cw (current-window-configuration)))
6477 (find-file org-agenda-files) 6583 (find-file org-agenda-files)
6478 (set (make-local-variable 'org-window-configuration) cw) 6584 (org-set-local 'org-window-configuration cw)
6479 (org-add-hook 'after-save-hook 6585 (org-add-hook 'after-save-hook
6480 (lambda () 6586 (lambda ()
6481 (set-window-configuration 6587 (set-window-configuration
@@ -6603,7 +6709,7 @@ dates."
6603 (setq buffer-read-only nil) 6709 (setq buffer-read-only nil)
6604 (erase-buffer) 6710 (erase-buffer)
6605 (org-agenda-mode) (setq buffer-read-only nil) 6711 (org-agenda-mode) (setq buffer-read-only nil)
6606 (set (make-local-variable 'org-agenda-type) 'timeline) 6712 (org-set-local 'org-agenda-type 'timeline)
6607 (if doclosed (push :closed args)) 6713 (if doclosed (push :closed args))
6608 (push :timestamp args) 6714 (push :timestamp args)
6609 (if dotodo (push :todo args)) 6715 (if dotodo (push :todo args))
@@ -6701,9 +6807,9 @@ NDAYS defaults to `org-agenda-ndays'."
6701 (setq buffer-read-only nil) 6807 (setq buffer-read-only nil)
6702 (erase-buffer) 6808 (erase-buffer)
6703 (org-agenda-mode) (setq buffer-read-only nil) 6809 (org-agenda-mode) (setq buffer-read-only nil)
6704 (set (make-local-variable 'org-agenda-type) 'agenda) 6810 (org-set-local 'org-agenda-type 'agenda)
6705 (set (make-local-variable 'starting-day) (car day-numbers)) 6811 (org-set-local 'starting-day (car day-numbers))
6706 (set (make-local-variable 'include-all-loc) include-all) 6812 (org-set-local 'include-all-loc include-all)
6707 (when (and (or include-all org-agenda-include-all-todo) 6813 (when (and (or include-all org-agenda-include-all-todo)
6708 (member today day-numbers)) 6814 (member today day-numbers))
6709 (setq files thefiles 6815 (setq files thefiles
@@ -6812,11 +6918,11 @@ for a keyword. A numeric prefix directly selects the Nth keyword in
6812 (setq buffer-read-only nil) 6918 (setq buffer-read-only nil)
6813 (erase-buffer) 6919 (erase-buffer)
6814 (org-agenda-mode) (setq buffer-read-only nil) 6920 (org-agenda-mode) (setq buffer-read-only nil)
6815 (set (make-local-variable 'org-agenda-type) 'todo) 6921 (org-set-local 'org-agenda-type 'todo)
6816 (set (make-local-variable 'last-arg) arg) 6922 (org-set-local 'last-arg arg)
6817 (set (make-local-variable 'org-todo-keywords) kwds) 6923 (org-set-local 'org-todo-keywords kwds)
6818 (set (make-local-variable 'org-agenda-redo-command) 6924 (org-set-local 'org-agenda-redo-command
6819 '(org-todo-list (or current-prefix-arg last-arg) t)) 6925 '(org-todo-list (or current-prefix-arg last-arg) t))
6820 (setq files (org-agenda-files) 6926 (setq files (org-agenda-files)
6821 rtnall nil) 6927 rtnall nil)
6822 (org-prepare-agenda-buffers files) 6928 (org-prepare-agenda-buffers files)
@@ -7704,11 +7810,12 @@ the documentation of `org-diary'."
7704 (abbreviate-file-name buffer-file-name)))) 7810 (abbreviate-file-name buffer-file-name))))
7705 (regexp org-tr-regexp) 7811 (regexp org-tr-regexp)
7706 (d0 (calendar-absolute-from-gregorian date)) 7812 (d0 (calendar-absolute-from-gregorian date))
7707 marker hdmarker ee txt d1 d2 s1 s2 timestr category tags) 7813 marker hdmarker ee txt d1 d2 s1 s2 timestr category tags pos)
7708 (goto-char (point-min)) 7814 (goto-char (point-min))
7709 (while (re-search-forward regexp nil t) 7815 (while (re-search-forward regexp nil t)
7710 (catch :skip 7816 (catch :skip
7711 (org-agenda-skip) 7817 (org-agenda-skip)
7818 (setq pos (point))
7712 (setq timestr (match-string 0) 7819 (setq timestr (match-string 0)
7713 s1 (match-string 1) 7820 s1 (match-string 1)
7714 s2 (match-string 2) 7821 s2 (match-string 2)
@@ -7736,7 +7843,8 @@ the documentation of `org-diary'."
7736 'org-marker marker 'org-hd-marker hdmarker 7843 'org-marker marker 'org-hd-marker hdmarker
7737 'priority (org-get-priority txt) 'category category) 7844 'priority (org-get-priority txt) 'category category)
7738 (push txt ee))) 7845 (push txt ee)))
7739 (outline-next-heading))) 7846 (goto-char pos)))
7847; (outline-next-heading))) ;FIXME: correct to be removed??????
7740 ;; Sort the entries by expiration date. 7848 ;; Sort the entries by expiration date.
7741 (nreverse ee))) 7849 (nreverse ee)))
7742 7850
@@ -7757,7 +7865,7 @@ groups carry important information:
7757 7865
7758(defconst org-stamp-time-of-day-regexp 7866(defconst org-stamp-time-of-day-regexp
7759 (concat 7867 (concat
7760 "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} +[a-zA-Z]+ +\\)" 7868 "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} +\\sw+ +\\)"
7761 "\\([012][0-9]:[0-5][0-9]\\)>" 7869 "\\([012][0-9]:[0-5][0-9]\\)>"
7762 "\\(--?" 7870 "\\(--?"
7763 "<\\1\\([012][0-9]:[0-5][0-9]\\)>\\)?") 7871 "<\\1\\([012][0-9]:[0-5][0-9]\\)>\\)?")
@@ -8620,10 +8728,10 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
8620 (setq buffer-read-only nil) 8728 (setq buffer-read-only nil)
8621 (erase-buffer) 8729 (erase-buffer)
8622 (org-agenda-mode) (setq buffer-read-only nil) 8730 (org-agenda-mode) (setq buffer-read-only nil)
8623 (set (make-local-variable 'org-agenda-type) 'tags) 8731 (org-set-local 'org-agenda-type 'tags)
8624 (set (make-local-variable 'org-agenda-redo-command) 8732 (org-set-local 'org-agenda-redo-command
8625 (list 'org-tags-view (list 'quote todo-only) 8733 (list 'org-tags-view (list 'quote todo-only)
8626 (list 'if 'current-prefix-arg nil match) t)) 8734 (list 'if 'current-prefix-arg nil match) t))
8627 (setq files (org-agenda-files) 8735 (setq files (org-agenda-files)
8628 rtnall nil) 8736 rtnall nil)
8629 (org-prepare-agenda-buffers files) 8737 (org-prepare-agenda-buffers files)
@@ -10234,13 +10342,13 @@ to be run from that hook to fucntion properly."
10234 (org-startup-with-deadline-check nil)) 10342 (org-startup-with-deadline-check nil))
10235 (org-mode)) 10343 (org-mode))
10236 (if (and file (string-match "\\S-" file) (not (file-directory-p file))) 10344 (if (and file (string-match "\\S-" file) (not (file-directory-p file)))
10237 (set (make-local-variable 'org-default-notes-file) file)) 10345 (org-set-local 'org-default-notes-file file))
10238 (goto-char (point-min)) 10346 (goto-char (point-min))
10239 (if (re-search-forward "%\\?" nil t) (replace-match ""))) 10347 (if (re-search-forward "%\\?" nil t) (replace-match "")))
10240 (let ((org-startup-folded nil) 10348 (let ((org-startup-folded nil)
10241 (org-startup-with-deadline-check nil)) 10349 (org-startup-with-deadline-check nil))
10242 (org-mode))) 10350 (org-mode)))
10243 (set (make-local-variable 'org-finish-function) 'remember-buffer)) 10351 (org-set-local 'org-finish-function 'remember-buffer))
10244 10352
10245;;;###autoload 10353;;;###autoload
10246(defun org-remember-handler () 10354(defun org-remember-handler ()
@@ -11492,10 +11600,10 @@ it can be edited in place."
11492 '(invisible t org-cwidth t display t 11600 '(invisible t org-cwidth t display t
11493 intangible t)) 11601 intangible t))
11494 (goto-char p) 11602 (goto-char p)
11495 (set (make-local-variable 'org-finish-function) 11603 (org-set-local 'org-finish-function
11496 'org-table-finish-edit-field) 11604 'org-table-finish-edit-field)
11497 (set (make-local-variable 'org-window-configuration) cw) 11605 (org-set-local 'org-window-configuration cw)
11498 (set (make-local-variable 'org-field-marker) pos) 11606 (org-set-local 'org-field-marker pos)
11499 (message "Edit and finish with C-c C-c")))) 11607 (message "Edit and finish with C-c C-c"))))
11500 11608
11501(defun org-table-finish-edit-field () 11609(defun org-table-finish-edit-field ()
@@ -12098,10 +12206,11 @@ not overwrite the stored one."
12098 (setq formula (car tmp) 12206 (setq formula (car tmp)
12099 fmt (concat (cdr (assoc "%" org-table-local-parameters)) 12207 fmt (concat (cdr (assoc "%" org-table-local-parameters))
12100 (nth 1 tmp))) 12208 (nth 1 tmp)))
12101 (while (string-match "[pnfse]\\(-?[0-9]+\\)" fmt) 12209 (while (string-match "\\([pnfse]\\)\\(-?[0-9]+\\)" fmt)
12102 (setq c (string-to-char (match-string 1 fmt)) 12210 (setq c (string-to-char (match-string 1 fmt))
12103 n (string-to-number (or (match-string 1 fmt) ""))) 12211 n (string-to-number (match-string 2 fmt)))
12104 (if (= c ?p) (setq modes (org-set-calc-mode 'calc-internal-prec n)) 12212 (if (= c ?p)
12213 (setq modes (org-set-calc-mode 'calc-internal-prec n))
12105 (setq modes (org-set-calc-mode 12214 (setq modes (org-set-calc-mode
12106 'calc-float-format 12215 'calc-float-format
12107 (list (cdr (assoc c '((?n . float) (?f . fix) 12216 (list (cdr (assoc c '((?n . float) (?f . fix)
@@ -12314,8 +12423,8 @@ Parameters get priority."
12314 (switch-to-buffer-other-window "*Edit Formulas*") 12423 (switch-to-buffer-other-window "*Edit Formulas*")
12315 (erase-buffer) 12424 (erase-buffer)
12316 (fundamental-mode) 12425 (fundamental-mode)
12317 (set (make-local-variable 'org-pos) pos) 12426 (org-set-local 'org-pos pos)
12318 (set (make-local-variable 'org-window-configuration) wc) 12427 (org-set-local 'org-window-configuration wc)
12319 (use-local-map org-edit-formulas-map) 12428 (use-local-map org-edit-formulas-map)
12320 (setq s "# Edit formulas and finish with `C-c C-c'. 12429 (setq s "# Edit formulas and finish with `C-c C-c'.
12321# Use `C-u C-c C-c' to also appy them immediately to the entire table. 12430# Use `C-u C-c C-c' to also appy them immediately to the entire table.
@@ -12481,15 +12590,15 @@ table editor in arbitrary modes.")
12481 (let ((c (assq 'orgtbl-mode minor-mode-map-alist))) 12590 (let ((c (assq 'orgtbl-mode minor-mode-map-alist)))
12482 (and c (setq minor-mode-map-alist 12591 (and c (setq minor-mode-map-alist
12483 (cons c (delq c minor-mode-map-alist))))) 12592 (cons c (delq c minor-mode-map-alist)))))
12484 (set (make-local-variable (quote org-table-may-need-update)) t) 12593 (org-set-local (quote org-table-may-need-update) t)
12485 (org-add-hook 'before-change-functions 'org-before-change-function 12594 (org-add-hook 'before-change-functions 'org-before-change-function
12486 nil 'local) 12595 nil 'local)
12487 (set (make-local-variable 'org-old-auto-fill-inhibit-regexp) 12596 (org-set-local 'org-old-auto-fill-inhibit-regexp
12488 auto-fill-inhibit-regexp) 12597 auto-fill-inhibit-regexp)
12489 (set (make-local-variable 'auto-fill-inhibit-regexp) 12598 (org-set-local 'auto-fill-inhibit-regexp
12490 (if auto-fill-inhibit-regexp 12599 (if auto-fill-inhibit-regexp
12491 (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp) 12600 (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp)
12492 "[ \t]*|")) 12601 "[ \t]*|"))
12493 (org-add-to-invisibility-spec '(org-cwidth)) 12602 (org-add-to-invisibility-spec '(org-cwidth))
12494 (easy-menu-add orgtbl-mode-menu) 12603 (easy-menu-add orgtbl-mode-menu)
12495 (run-hooks 'orgtbl-mode-hook)) 12604 (run-hooks 'orgtbl-mode-hook))
@@ -13388,7 +13497,7 @@ underlined headlines. The default is 3."
13388 (set (make-local-variable (cdr x)) 13497 (set (make-local-variable (cdr x))
13389 (plist-get opt-plist (car x)))) 13498 (plist-get opt-plist (car x))))
13390 org-export-plist-vars) 13499 org-export-plist-vars)
13391 (set (make-local-variable 'org-odd-levels-only) odd) 13500 (org-set-local 'org-odd-levels-only odd)
13392 (setq umax (if arg (prefix-numeric-value arg) 13501 (setq umax (if arg (prefix-numeric-value arg)
13393 org-export-headline-levels)) 13502 org-export-headline-levels))
13394 13503
@@ -13594,22 +13703,15 @@ command."
13594 (goto-char (point-min))))) 13703 (goto-char (point-min)))))
13595 13704
13596(defun org-find-visible () 13705(defun org-find-visible ()
13597 (if (featurep 'noutline) 13706 (let ((s (point)))
13598 (let ((s (point))) 13707 (while (and (not (= (point-max) (setq s (next-overlay-change s))))
13599 (while (and (not (= (point-max) (setq s (next-overlay-change s)))) 13708 (get-char-property s 'invisible)))
13600 (get-char-property s 'invisible))) 13709 s))
13601 s)
13602 (skip-chars-forward "^\n")
13603 (point)))
13604(defun org-find-invisible () 13710(defun org-find-invisible ()
13605 (if (featurep 'noutline) 13711 (let ((s (point)))
13606 (let ((s (point))) 13712 (while (and (not (= (point-max) (setq s (next-overlay-change s))))
13607 (while (and (not (= (point-max) (setq s (next-overlay-change s)))) 13713 (not (get-char-property s 'invisible))))
13608 (not (get-char-property s 'invisible)))) 13714 s))
13609 s)
13610 (skip-chars-forward "^\r")
13611 (point)))
13612
13613 13715
13614;; HTML 13716;; HTML
13615 13717
@@ -13859,14 +13961,16 @@ lang=\"%s\" xml:lang=\"%s\">
13859 (insert (or (plist-get opt-plist :preamble) "")) 13961 (insert (or (plist-get opt-plist :preamble) ""))
13860 13962
13861 (when (plist-get opt-plist :auto-preamble) 13963 (when (plist-get opt-plist :auto-preamble)
13862 (if title (insert (concat "<h1 class=\"title\">" 13964 (if title (insert (format org-export-html-title-format
13863 (org-html-expand title) "</h1>\n"))) 13965 (org-html-expand title))))
13864
13865 (if text (insert "<p>\n" (org-html-expand text) "</p>"))) 13966 (if text (insert "<p>\n" (org-html-expand text) "</p>")))
13866 13967
13867 (if org-export-with-toc 13968 (if org-export-with-toc
13868 (progn 13969 (progn
13869 (insert (format "<h2>%s</h2>\n" (nth 3 lang-words))) 13970 (insert (format "<h%d>%s</h%d>\n"
13971 org-export-html-toplevel-hlevel
13972 (nth 3 lang-words)
13973 org-export-html-toplevel-hlevel))
13870 (insert "<ul>\n<li>") 13974 (insert "<ul>\n<li>")
13871 (setq lines 13975 (setq lines
13872 (mapcar '(lambda (line) 13976 (mapcar '(lambda (line)
@@ -14553,7 +14657,7 @@ When TITLE is nil, just close all open levels."
14553 (insert "<ul>\n<li>" title "<br/>\n"))) 14657 (insert "<ul>\n<li>" title "<br/>\n")))
14554 (if org-export-with-section-numbers 14658 (if org-export-with-section-numbers
14555 (setq title (concat (org-section-number level) " " title))) 14659 (setq title (concat (org-section-number level) " " title)))
14556 (setq level (+ level 1)) 14660 (setq level (+ level org-export-html-toplevel-hlevel -1))
14557 (if with-toc 14661 (if with-toc
14558 (insert (format "\n<h%d><a name=\"sec-%d\">%s</a></h%d>\n" 14662 (insert (format "\n<h%d><a name=\"sec-%d\">%s</a></h%d>\n"
14559 level head-count title level)) 14663 level head-count title level))
@@ -15763,6 +15867,10 @@ See the individual commands for more information."
15763 "--" 15867 "--"
15764 ("TODO Lists" 15868 ("TODO Lists"
15765 ["TODO/DONE/-" org-todo t] 15869 ["TODO/DONE/-" org-todo t]
15870 ("Select keyword"
15871 ["Next keyword" org-shiftright (org-on-heading-p)]
15872 ["Previous keyword" org-shiftleft (org-on-heading-p)]
15873 ["Complete Keyword" org-complete (assq :todo-keyword (org-context))])
15766 ["Show TODO Tree" org-show-todo-tree t] 15874 ["Show TODO Tree" org-show-todo-tree t]
15767 ["Global TODO list" org-todo-list t] 15875 ["Global TODO list" org-todo-list t]
15768 "--" 15876 "--"
@@ -16042,31 +16150,32 @@ return nil."
16042 ;; In the paragraph separator we include headlines, because filling 16150 ;; In the paragraph separator we include headlines, because filling
16043 ;; text in a line directly attached to a headline would otherwise 16151 ;; text in a line directly attached to a headline would otherwise
16044 ;; fill the headline as well. 16152 ;; fill the headline as well.
16045 (set (make-local-variable 'comment-start-skip) "^#+[ \t]*") 16153 (org-set-local 'comment-start-skip "^#+[ \t]*")
16046 (set (make-local-variable 'paragraph-separate) "\f\\|\\*\\|[ ]*$\\|[ \t]*[:|]") 16154 (org-set-local 'paragraph-separate "\f\\|\\*\\|[ ]*$\\|[ \t]*[:|]")
16047 ;; The paragraph starter includes hand-formatted lists. 16155 ;; The paragraph starter includes hand-formatted lists.
16048 (set (make-local-variable 'paragraph-start) 16156 (org-set-local 'paragraph-start
16049 "\f\\|[ ]*$\\|\\([*\f]+\\)\\|[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)\\|[ \t]*[:|]") 16157 "\f\\|[ ]*$\\|\\([*\f]+\\)\\|[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)\\|[ \t]*[:|]")
16050 ;; Inhibit auto-fill for headers, tables and fixed-width lines. 16158 ;; Inhibit auto-fill for headers, tables and fixed-width lines.
16051 ;; But only if the user has not turned off tables or fixed-width regions 16159 ;; But only if the user has not turned off tables or fixed-width regions
16052 (set (make-local-variable 'auto-fill-inhibit-regexp) 16160 (org-set-local
16053 (concat "\\*\\|#" 16161 'auto-fill-inhibit-regexp
16054 "\\|[ \t]*" org-keyword-time-regexp 16162 (concat "\\*\\|#"
16055 (if (or org-enable-table-editor org-enable-fixed-width-editor) 16163 "\\|[ \t]*" org-keyword-time-regexp
16056 (concat 16164 (if (or org-enable-table-editor org-enable-fixed-width-editor)
16057 "\\|[ \t]*[" 16165 (concat
16058 (if org-enable-table-editor "|" "") 16166 "\\|[ \t]*["
16059 (if org-enable-fixed-width-editor ":" "") 16167 (if org-enable-table-editor "|" "")
16060 "]")))) 16168 (if org-enable-fixed-width-editor ":" "")
16169 "]"))))
16061 ;; We use our own fill-paragraph function, to make sure that tables 16170 ;; We use our own fill-paragraph function, to make sure that tables
16062 ;; and fixed-width regions are not wrapped. That function will pass 16171 ;; and fixed-width regions are not wrapped. That function will pass
16063 ;; through to `fill-paragraph' when appropriate. 16172 ;; through to `fill-paragraph' when appropriate.
16064 (set (make-local-variable 'fill-paragraph-function) 'org-fill-paragraph) 16173 (org-set-local 'fill-paragraph-function 'org-fill-paragraph)
16065 ;; Adaptive filling: To get full control, first make sure that 16174 ; Adaptive filling: To get full control, first make sure that
16066 ;; `adaptive-fill-regexp' never matches. Then install our own matcher. 16175 ;; `adaptive-fill-regexp' never matches. Then install our own matcher.
16067 (set (make-local-variable 'adaptive-fill-regexp) "\000") 16176 (org-set-local 'adaptive-fill-regexp "\000")
16068 (set (make-local-variable 'adaptive-fill-function) 16177 (org-set-local 'adaptive-fill-function
16069 'org-adaptive-fill-function)) 16178 'org-adaptive-fill-function))
16070 16179
16071(defun org-fill-paragraph (&optional justify) 16180(defun org-fill-paragraph (&optional justify)
16072 "Re-align a table, pass through to fill-paragraph if no table." 16181 "Re-align a table, pass through to fill-paragraph if no table."
@@ -16145,18 +16254,7 @@ that can be added."
16145 t) 16254 t)
16146 "\\'")))) 16255 "\\'"))))
16147 16256
16148;; Functions needed for compatibility with old outline.el. 16257;; Functions extending outline functionality
16149
16150;; Programming for the old outline.el (that uses selective display
16151;; instead of `invisible' text properties) is a nightmare, mostly
16152;; because regular expressions can no longer be anchored at
16153;; beginning/end of line. Therefore a number of function need special
16154;; treatment when the old outline.el is being used.
16155
16156;; The following functions capture almost the entire compatibility code
16157;; between the different versions of outline-mode. The only other
16158;; places where this is important are the font-lock-keywords, and in
16159;; `org-export-visible'. Search for `org-noutline-p' to find them.
16160 16258
16161;; C-a should go to the beginning of a *visible* line, also in the 16259;; C-a should go to the beginning of a *visible* line, also in the
16162;; new outline.el. I guess this should be patched into Emacs? 16260;; new outline.el. I guess this should be patched into Emacs?
@@ -16174,60 +16272,26 @@ to a visible line beginning. This makes the function of C-a more intuitive."
16174 (beginning-of-line 1)) 16272 (beginning-of-line 1))
16175 (forward-char 1)))) 16273 (forward-char 1))))
16176 16274
16177(when org-noutline-p 16275(define-key org-mode-map "\C-a" 'org-beginning-of-line)
16178 (define-key org-mode-map "\C-a" 'org-beginning-of-line))
16179 16276
16180(defun org-invisible-p () 16277(defun org-invisible-p ()
16181 "Check if point is at a character currently not visible." 16278 "Check if point is at a character currently not visible."
16182 (if org-noutline-p 16279 ;; Early versions of noutline don't have `outline-invisible-p'.
16183 ;; Early versions of noutline don't have `outline-invisible-p'. 16280 (if (fboundp 'outline-invisible-p)
16184 (if (fboundp 'outline-invisible-p) 16281 (outline-invisible-p)
16185 (outline-invisible-p) 16282 (get-char-property (point) 'invisible)))
16186 (get-char-property (point) 'invisible))
16187 (save-excursion
16188 (skip-chars-backward "^\r\n")
16189 (equal (char-before) ?\r))))
16190 16283
16191(defun org-invisible-p2 () 16284(defun org-invisible-p2 ()
16192 "Check if point is at a character currently not visible." 16285 "Check if point is at a character currently not visible."
16193 (save-excursion 16286 (save-excursion
16194 (if org-noutline-p 16287 (if (and (eolp) (not (bobp))) (backward-char 1))
16195 (progn 16288 ;; Early versions of noutline don't have `outline-invisible-p'.
16196 (if (and (eolp) (not (bobp))) (backward-char 1)) 16289 (if (fboundp 'outline-invisible-p)
16197 ;; Early versions of noutline don't have `outline-invisible-p'. 16290 (outline-invisible-p)
16198 (if (fboundp 'outline-invisible-p) 16291 (get-char-property (point) 'invisible))))
16199 (outline-invisible-p) 16292
16200 (get-char-property (point) 'invisible))) 16293(defalias 'org-back-to-heading 'outline-back-to-heading)
16201 (skip-chars-backward "^\r\n") 16294(defalias 'org-on-heading-p 'outline-on-heading-p)
16202 (equal (char-before) ?\r))))
16203
16204(defun org-back-to-heading (&optional invisible-ok)
16205 "Move to previous heading line, or beg of this line if it's a heading.
16206Only visible heading lines are considered, unless INVISIBLE-OK is non-nil."
16207 (if org-noutline-p
16208 (outline-back-to-heading invisible-ok)
16209 (if (and (or (bobp) (memq (char-before) '(?\n ?\r)))
16210 (looking-at outline-regexp))
16211 t
16212 (if (re-search-backward (concat (if invisible-ok "\\([\r\n]\\|^\\)" "^")
16213 outline-regexp)
16214 nil t)
16215 (if invisible-ok
16216 (progn (goto-char (or (match-end 1) (match-beginning 0)))
16217 (looking-at outline-regexp)))
16218 (error "Before first heading")))))
16219
16220(defun org-on-heading-p (&optional invisible-ok)
16221 "Return t if point is on a (visible) heading line.
16222If INVISIBLE-OK is non-nil, an invisible heading line is ok too."
16223 (if org-noutline-p
16224 (outline-on-heading-p 'invisible-ok)
16225 (save-excursion
16226 (skip-chars-backward "^\n\r")
16227 (and (looking-at outline-regexp)
16228 (or invisible-ok
16229 (bobp)
16230 (equal (char-before) ?\n))))))
16231 16295
16232(defun org-on-target-p () 16296(defun org-on-target-p ()
16233 (let ((pos (point))) 16297 (let ((pos (point)))
@@ -16243,47 +16307,20 @@ If INVISIBLE-OK is non-nil, an invisible heading line is ok too."
16243 "Move to the heading line of which the present line is a subheading. 16307 "Move to the heading line of which the present line is a subheading.
16244This function considers both visible and invisible heading lines. 16308This function considers both visible and invisible heading lines.
16245With argument, move up ARG levels." 16309With argument, move up ARG levels."
16246 (if org-noutline-p 16310 (if (fboundp 'outline-up-heading-all)
16247 (if (fboundp 'outline-up-heading-all) 16311 (outline-up-heading-all arg) ; emacs 21 version of outline.el
16248 (outline-up-heading-all arg) ; emacs 21 version of outline.el 16312 (outline-up-heading arg t))) ; emacs 22 version of outline.el
16249 (outline-up-heading arg t)) ; emacs 22 version of outline.el
16250 (org-back-to-heading t)
16251 (looking-at outline-regexp)
16252 (if (<= (- (match-end 0) (match-beginning 0)) arg)
16253 (error "Cannot move up %d levels" arg)
16254 (re-search-backward
16255 (concat "[\n\r]" (regexp-quote
16256 (make-string (- (match-end 0) (match-beginning 0) arg)
16257 ?*))
16258 "[^*]"))
16259 (forward-char 1))))
16260 16313
16261(defun org-show-hidden-entry () 16314(defun org-show-hidden-entry ()
16262 "Show an entry where even the heading is hidden." 16315 "Show an entry where even the heading is hidden."
16263 (save-excursion 16316 (save-excursion
16264 (if (not org-noutline-p)
16265 (progn
16266 (org-back-to-heading t)
16267 (org-flag-heading nil)))
16268 (org-show-entry))) 16317 (org-show-entry)))
16269 16318
16270(defun org-check-occur-regexp (regexp)
16271 "If REGEXP starts with \"^\", modify it to check for \\r as well.
16272Of course, only for the old outline mode."
16273 (if org-noutline-p
16274 regexp
16275 (if (string-match "^\\^" regexp)
16276 (concat "[\n\r]" (substring regexp 1))
16277 regexp)))
16278
16279(defun org-flag-heading (flag &optional entry) 16319(defun org-flag-heading (flag &optional entry)
16280 "Flag the current heading. FLAG non-nil means make invisible. 16320 "Flag the current heading. FLAG non-nil means make invisible.
16281When ENTRY is non-nil, show the entire entry." 16321When ENTRY is non-nil, show the entire entry."
16282 (save-excursion 16322 (save-excursion
16283 (org-back-to-heading t) 16323 (org-back-to-heading t)
16284 (if (not org-noutline-p)
16285 ;; Make the current headline visible
16286 (outline-flag-region (max 1 (1- (point))) (point) (if flag ?\r ?\n)))
16287 ;; Check if we should show the entire entry 16324 ;; Check if we should show the entire entry
16288 (if entry 16325 (if entry
16289 (progn 16326 (progn
@@ -16293,9 +16330,7 @@ When ENTRY is non-nil, show the entire entry."
16293 (org-flag-heading nil)))) 16330 (org-flag-heading nil))))
16294 (outline-flag-region (max 1 (1- (point))) 16331 (outline-flag-region (max 1 (1- (point)))
16295 (save-excursion (outline-end-of-heading) (point)) 16332 (save-excursion (outline-end-of-heading) (point))
16296 (if org-noutline-p 16333 flag))))
16297 flag
16298 (if flag ?\r ?\n))))))
16299 16334
16300(defun org-end-of-subtree (&optional invisible-OK) 16335(defun org-end-of-subtree (&optional invisible-OK)
16301 ;; This is an exact copy of the original function, but it uses 16336 ;; This is an exact copy of the original function, but it uses
@@ -16324,7 +16359,7 @@ When ENTRY is non-nil, show the entire entry."
16324 (point) 16359 (point)
16325 (save-excursion 16360 (save-excursion
16326 (outline-end-of-subtree) (outline-next-heading) (point)) 16361 (outline-end-of-subtree) (outline-next-heading) (point))
16327 (if org-noutline-p nil ?\n))) 16362 nil))
16328 16363
16329(defun org-show-entry () 16364(defun org-show-entry ()
16330 "Show the body directly following this heading. 16365 "Show the body directly following this heading.
@@ -16337,16 +16372,16 @@ Show the heading too, if it is currently invisible."
16337 (save-excursion 16372 (save-excursion
16338 (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move) 16373 (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move)
16339 (or (match-beginning 1) (point-max))) 16374 (or (match-beginning 1) (point-max)))
16340 (if org-noutline-p nil ?\n)))) 16375 nil)))
16341 16376
16342(defun org-make-options-regexp (kwds) 16377(defun org-make-options-regexp (kwds)
16343 "Make a regular expression for keyword lines." 16378 "Make a regular expression for keyword lines."
16344 (concat 16379 (concat
16345 (if org-noutline-p "^" "[\n\r]") 16380 "^"
16346 "#?[ \t]*\\+\\(" 16381 "#?[ \t]*\\+\\("
16347 (mapconcat 'regexp-quote kwds "\\|") 16382 (mapconcat 'regexp-quote kwds "\\|")
16348 "\\):[ \t]*" 16383 "\\):[ \t]*"
16349 (if org-noutline-p "\\(.+\\)" "\\([^\n\r]+\\)"))) 16384 "\\(.+\\)"))
16350 16385
16351;; Make `bookmark-jump' show the jump location if it was hidden. 16386;; Make `bookmark-jump' show the jump location if it was hidden.
16352(eval-after-load "bookmark" 16387(eval-after-load "bookmark"
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index 693a2d7fa4b..81fe9a8e868 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -121,6 +121,12 @@ any protocol specific data.")
121 121
122(defun x-dnd-init-frame (&optional frame) 122(defun x-dnd-init-frame (&optional frame)
123 "Setup drag and drop for FRAME (i.e. create appropriate properties)." 123 "Setup drag and drop for FRAME (i.e. create appropriate properties)."
124 (x-register-dnd-atom "DndProtocol" frame)
125 (x-register-dnd-atom "_MOTIF_DRAG_AND_DROP_MESSAGE" frame)
126 (x-register-dnd-atom "XdndEnter" frame)
127 (x-register-dnd-atom "XdndPosition" frame)
128 (x-register-dnd-atom "XdndLeave" frame)
129 (x-register-dnd-atom "XdndDrop" frame)
124 (x-dnd-init-xdnd-for-frame frame) 130 (x-dnd-init-xdnd-for-frame frame)
125 (x-dnd-init-motif-for-frame frame)) 131 (x-dnd-init-motif-for-frame frame))
126 132
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index f64f9eb56df..d09689ce637 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,62 @@
12006-08-16 Richard Stallman <rms@gnu.org>
2
3 * keymaps.texi (Extended Menu Items): Show format of cached
4 bindings in extended menu items.
5
6 * customize.texi (Variable Definitions): Explain when the
7 standard value expression is evaluated.
8
92006-08-15 Chong Yidong <cyd@stupidchicken.com>
10
11 * commands.texi (Reading One Event): Explain idleness in
12 `read-event'.
13
142006-08-12 Chong Yidong <cyd@stupidchicken.com>
15
16 * text.texi (Near Point): Say "cursor" not "terminal cursor".
17 (Commands for Insertion): Removed split-line since it's not
18 relevant for Lisp programming.
19 (Yank Commands): Rewrite introduction.
20 (Undo): Clarify.
21 (Maintaining Undo): Clarify. Document undo-ask-before-discard.
22 (Filling): Remove redundant comment. Clarify return value of
23 current-justification.
24 (Margins): Minor clarifications.
25 (Adaptive Fill): Update default value of adaptive-fill-regexp.
26 (Sorting): Update definition of sort-lines.
27 (Columns): Clarify behavior of sort-columns.
28 (Indent Tabs): Link to Tab Stops in Emacs manual.
29 (Special Properties): Clarify.
30 (Clickable Text): Mention Buttons package.
31
322006-08-12 Kevin Ryde <user42@zip.com.au>
33
34 * os.texi (Time Parsing): Add %z to description of
35 format-time-string, as per docstring. Add cross reference to
36 glibc manual for strftime.
37
382006-08-08 Richard Stallman <rms@gnu.org>
39
40 * modes.texi: Clean up wording in previous change.
41
422006-08-07 Chong Yidong <cyd@stupidchicken.com>
43
44 * modes.texi (Hooks): Clarify.
45 (Major Mode Basics): Mention define-derived-mode explicitly.
46 (Major Mode Conventions): Rebinding RET is OK for some modes.
47 Mention change-major-mode-hook and after-change-major-mode-hook.
48 (Example Major Modes): Moved to end of Modes section.
49 (Mode Line Basics): Clarify.
50 (Mode Line Data): Mention help-echo and local-map in strings.
51 Explain reason for treatment of non-risky variables.
52 (Properties in Mode): Clarify.
53 (Faces for Font Lock): Add font-lock-negation-char-face.
54
552006-08-04 Eli Zaretskii <eliz@gnu.org>
56
57 * strings.texi (Formatting Strings): Warn against arbitrary
58 strings as first arg to `format'.
59
12006-07-31 Thien-Thi Nguyen <ttn@gnu.org> 602006-07-31 Thien-Thi Nguyen <ttn@gnu.org>
2 61
3 * text.texi (Clickable Text): Mention `help-echo' text property. 62 * text.texi (Clickable Text): Mention `help-echo' text property.
@@ -290,7 +349,7 @@
290 349
291 * anti.texi, customize.texi, display.texi, internals.texi: 350 * anti.texi, customize.texi, display.texi, internals.texi:
292 * minibuf.texi, modes.texi, tips.texi: 351 * minibuf.texi, modes.texi, tips.texi:
293 Fix overfull/underfull boxes. 352 Fix overfull/underfull boxes.
294 353
2952006-07-05 Thien-Thi Nguyen <ttn@gnu.org> 3542006-07-05 Thien-Thi Nguyen <ttn@gnu.org>
296 355
@@ -367,7 +426,7 @@
367 426
3682006-06-09 Aidan Kehoe <kehoea@parhasard.net> 4272006-06-09 Aidan Kehoe <kehoea@parhasard.net>
369 428
370 * objects.texi (Character Type): Describe the\uABCD and \U00ABCDEF 429 * objects.texi (Character Type): Describe the \uABCD and \U00ABCDEF
371 syntax. 430 syntax.
372 431
3732006-06-07 Eli Zaretskii <eliz@gnu.org> 4322006-06-07 Eli Zaretskii <eliz@gnu.org>
@@ -679,7 +738,7 @@
6792006-04-13 Bill Wohler <wohler@newt.com> 7382006-04-13 Bill Wohler <wohler@newt.com>
680 739
681 * customize.texi (Common Keywords): Use dotted notation for 740 * customize.texi (Common Keywords): Use dotted notation for
682 :package-version value. Specify its values. Improve documentation 741 :package-version value. Specify its values. Improve documentation
683 for customize-package-emacs-version-alist. 742 for customize-package-emacs-version-alist.
684 743
6852006-04-12 Bill Wohler <wohler@newt.com> 7442006-04-12 Bill Wohler <wohler@newt.com>
@@ -1724,7 +1783,7 @@
1724 (Jumping): Clarify description of `h' command. 1783 (Jumping): Clarify description of `h' command.
1725 Eliminate redundant @ref. 1784 Eliminate redundant @ref.
1726 (Breaks): New node. 1785 (Breaks): New node.
1727 (Breakpoints): is now a subsubsection. 1786 (Breakpoints): Is now a subsubsection.
1728 (Global Break Condition): Mention `C-x X X'. 1787 (Global Break Condition): Mention `C-x X X'.
1729 (Edebug Views): Clarify `v' and `p'. Mention `C-x X w'. 1788 (Edebug Views): Clarify `v' and `p'. Mention `C-x X w'.
1730 (Trace Buffer): Clarify STRING arg of `edebug-tracing'. 1789 (Trace Buffer): Clarify STRING arg of `edebug-tracing'.
@@ -2974,7 +3033,7 @@
2974 3033
29752004-10-24 Jason Rumney <jasonr@gnu.org> 30342004-10-24 Jason Rumney <jasonr@gnu.org>
2976 3035
2977 * commands.texi (Misc Events): Remove mouse-wheel. Add wheel-up 3036 * commands.texi (Misc Events): Remove mouse-wheel. Add wheel-up
2978 and wheel-down. 3037 and wheel-down.
2979 3038
29802004-10-24 Kai Grossjohann <kai.grossjohann@gmx.net> 30392004-10-24 Kai Grossjohann <kai.grossjohann@gmx.net>
@@ -3203,7 +3262,7 @@
3203 except while processing `frame-title-format' or `icon-title-format'. 3262 except while processing `frame-title-format' or `icon-title-format'.
3204 (Deleting Frames): Correct description of `delete-frame'. 3263 (Deleting Frames): Correct description of `delete-frame'.
3205 Non-nil return values of `frame-live-p' are like those of `framep'. 3264 Non-nil return values of `frame-live-p' are like those of `framep'.
3206 (Frames and Windows): mention return value of 3265 (Frames and Windows): Mention return value of
3207 `set-frame-selected-window'. 3266 `set-frame-selected-window'.
3208 (Visibility of Frames): Mention `force' argument to 3267 (Visibility of Frames): Mention `force' argument to
3209 `make-frame-invisible'. `frame-visible-p' returns t for all 3268 `make-frame-invisible'. `frame-visible-p' returns t for all
@@ -3530,7 +3589,7 @@
3530 3589
35312004-03-07 Thien-Thi Nguyen <ttn@gnu.org> 35902004-03-07 Thien-Thi Nguyen <ttn@gnu.org>
3532 3591
3533 * customize.texi: Fix typo. Remove eol whitespace. 3592 * customize.texi: Fix typo. Remove eol whitespace.
3534 3593
35352004-03-04 Richard M. Stallman <rms@gnu.org> 35942004-03-04 Richard M. Stallman <rms@gnu.org>
3536 3595
@@ -3566,7 +3625,7 @@
3566 * text.texi: Various small changes in addition to the following: 3625 * text.texi: Various small changes in addition to the following:
3567 (User-Level Deletion): Mention optional BACKWARD-ONLY argument 3626 (User-Level Deletion): Mention optional BACKWARD-ONLY argument
3568 to delete-horizontal-space. 3627 to delete-horizontal-space.
3569 (Kill Functions, Yanking, Low-Level Kill Ring): clarify and correct 3628 (Kill Functions, Yanking, Low-Level Kill Ring): Clarify and correct
3570 description of yank-handler text property at various places. 3629 description of yank-handler text property at various places.
3571 3630
3572 * frames.texi (Window System Selections): Add anchor. 3631 * frames.texi (Window System Selections): Add anchor.
@@ -4593,7 +4652,7 @@
4593 * loading.texi (Unloading): Fix recent change for load-history. 4652 * loading.texi (Unloading): Fix recent change for load-history.
4594 4653
4595 * customize.texi (Simple Types): Clarify description of custom 4654 * customize.texi (Simple Types): Clarify description of custom
4596 type 'number. Describe new custom type 'float. 4655 type 'number. Describe new custom type 'float.
4597 4656
45982002-12-04 Markus Rost <rost@math.ohio-state.edu> 46572002-12-04 Markus Rost <rost@math.ohio-state.edu>
4599 4658
@@ -5123,7 +5182,7 @@ Mon Apr 17 18:56:50 1989 Robert J. Chassell (bob@rice-chex.ai.mit.edu)
5123Tue Apr 11 12:23:28 1989 Robert J. Chassell (bob@rice-chex.ai.mit.edu) 5182Tue Apr 11 12:23:28 1989 Robert J. Chassell (bob@rice-chex.ai.mit.edu)
5124 5183
5125 * Applied Karl Berry's patches to *.texinfo files, but not to 5184 * Applied Karl Berry's patches to *.texinfo files, but not to
5126 texinfo.tex; those diffs are in `berry-texinfo-tex-diffs'. (Karl's 5185 texinfo.tex; those diffs are in `berry-texinfo-tex-diffs'. (Karl's
5127 new title page format is also not applied, since it requires 5186 new title page format is also not applied, since it requires
5128 texinfo.tex changes.) 5187 texinfo.tex changes.)
5129 5188
diff --git a/lispref/commands.texi b/lispref/commands.texi
index 8e34fe360bf..2a091524bed 100644
--- a/lispref/commands.texi
+++ b/lispref/commands.texi
@@ -2229,6 +2229,15 @@ number of seconds; on these systems, @var{seconds} is rounded down.
2229If @var{seconds} is @code{nil}, @code{read-event} waits as long as 2229If @var{seconds} is @code{nil}, @code{read-event} waits as long as
2230necessary for input to arrive. 2230necessary for input to arrive.
2231 2231
2232If @var{seconds} is @code{nil}, Emacs is considered idle while waiting
2233for user input to arrive. Idle timers---those created with
2234@code{run-with-idle-timer} (@pxref{Timers})---can run during this
2235period. However, if @var{seconds} is non-@code{nil}, the state of
2236idleness remains unchanged. If Emacs is non-idle when
2237@code{read-event} is called, it remains non-idle throughout the
2238operation of @code{read-event}; if Emacs is idle (which can happen if
2239the call happens inside an idle timer), it remains idle.
2240
2232If @code{read-event} gets an event that is defined as a help character, 2241If @code{read-event} gets an event that is defined as a help character,
2233then in some cases @code{read-event} processes the event directly without 2242then in some cases @code{read-event} processes the event directly without
2234returning. @xref{Help Functions}. Certain other events, called 2243returning. @xref{Help Functions}. Certain other events, called
diff --git a/lispref/customize.texi b/lispref/customize.texi
index e3e78c46bb4..9e10e547b56 100644
--- a/lispref/customize.texi
+++ b/lispref/customize.texi
@@ -251,19 +251,30 @@ turn this feature back on, if someone would like to do the work.
251 251
252 Use @code{defcustom} to declare user-editable variables. 252 Use @code{defcustom} to declare user-editable variables.
253 253
254@defmac defcustom option default doc [keyword value]@dots{} 254@defmac defcustom option standard doc [keyword value]@dots{}
255Declare @var{option} as a customizable user option variable. Do not 255This construct declares @var{option} as a customizable user option
256quote @var{option}. The argument @var{doc} specifies the documentation 256variable. You should not quote @var{option}. The argument @var{doc}
257string for the variable. There is no need to start it with a @samp{*} 257specifies the documentation string for the variable. There is no need
258because @code{defcustom} automatically marks @var{option} as a 258to start it with a @samp{*}, because @code{defcustom} automatically
259@dfn{user option} (@pxref{Defining Variables}). 259marks @var{option} as a @dfn{user option} (@pxref{Defining
260 260Variables}).
261If @var{option} is void, @code{defcustom} initializes it to 261
262@var{default}. @var{default} should be an expression to compute the 262The argument @var{standard} is an expression that specifies the
263value; be careful in writing it, because it can be evaluated on more 263standard value for @var{option}. Evaluating the @code{defcustom} form
264than one occasion. You should normally avoid using backquotes in 264evaluates @var{standard}, but does not necessarily install the
265@var{default} because they are not expanded when editing the value, 265standard value. If @var{option} already has a default value,
266causing list values to appear to have the wrong structure. 266@code{defcustom} does not change it. If the user has saved a
267customization for @var{option}, @code{defcustom} installs the user's
268customized value as @var{option}'s default value. If neither of those
269cases applies, @code{defcustom} installs the result of evaluating
270@var{standard} as the default value.
271
272The expression @var{standard} can be evaluated at various other times,
273too---whenever the customization facility needs to know @var{option}'s
274standard value. So be sure to use an expression which is harmless to
275evaluate at any time. We recommend avoiding backquotes in
276@var{standard}, because they are not expanded when editing the value,
277so list values will appear to have the wrong structure.
267 278
268If you specify the @code{:set} option, to make the variable take other 279If you specify the @code{:set} option, to make the variable take other
269special actions when set through the customization buffer, the 280special actions when set through the customization buffer, the
@@ -406,7 +417,7 @@ type of @var{symbol}.
406@end defun 417@end defun
407 418
408Internally, @code{defcustom} uses the symbol property 419Internally, @code{defcustom} uses the symbol property
409@code{standard-value} to record the expression for the default value, 420@code{standard-value} to record the expression for the standard value,
410and @code{saved-value} to record the value saved by the user with the 421and @code{saved-value} to record the value saved by the user with the
411customization buffer. Both properties are actually lists whose car is 422customization buffer. Both properties are actually lists whose car is
412an expression which evaluates to the value. 423an expression which evaluates to the value.
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi
index 44b92ddfcb8..13f4550a082 100644
--- a/lispref/keymaps.texi
+++ b/lispref/keymaps.texi
@@ -2016,7 +2016,7 @@ binding, like this:
2016 2016
2017@c This line is not too long--rms. 2017@c This line is not too long--rms.
2018@example 2018@example
2019(@var{item-string} @r{[}@var{help-string}@r{]} (@var{key-binding-data}) . @var{real-binding}) 2019(@var{item-string} @r{[}@var{help}@r{]} (@var{key-binding-data}) . @var{real-binding})
2020@end example 2020@end example
2021 2021
2022@noindent 2022@noindent
@@ -2140,6 +2140,13 @@ operates on menu data structures, so you should write it so it can
2140safely be called at any time. 2140safely be called at any time.
2141@end table 2141@end table
2142 2142
2143 When an equivalent key binding is cached, the binding looks like this.
2144
2145@example
2146(menu-item @var{item-name} @var{real-binding} (@var{key-binding-data})
2147 . @var{item-property-list})
2148@end example
2149
2143@node Menu Separators 2150@node Menu Separators
2144@subsubsection Menu Separators 2151@subsubsection Menu Separators
2145@cindex menu separators 2152@cindex menu separators
diff --git a/lispref/modes.texi b/lispref/modes.texi
index 38227633c6b..f8afcd8a829 100644
--- a/lispref/modes.texi
+++ b/lispref/modes.texi
@@ -43,18 +43,19 @@ up in the init file (@pxref{Init File}), but Lisp programs can set them also.
43 43
44@cindex normal hook 44@cindex normal hook
45 Most of the hooks in Emacs are @dfn{normal hooks}. These variables 45 Most of the hooks in Emacs are @dfn{normal hooks}. These variables
46contain lists of functions to be called with no arguments. When the 46contain lists of functions to be called with no arguments. By
47hook name ends in @samp{-hook}, that tells you it is normal. We try to 47convention, whenever the hook name ends in @samp{-hook}, that tells
48make all hooks normal, as much as possible, so that you can use them in 48you it is normal. We try to make all hooks normal, as much as
49a uniform way. 49possible, so that you can use them in a uniform way.
50 50
51 Every major mode function is supposed to run a normal hook called the 51 Every major mode function is supposed to run a normal hook called
52@dfn{mode hook} as the last step of initialization. This makes it easy 52the @dfn{mode hook} as the one of the last steps of initialization.
53for a user to customize the behavior of the mode, by overriding the 53This makes it easy for a user to customize the behavior of the mode,
54buffer-local variable assignments already made by the mode. Most 54by overriding the buffer-local variable assignments already made by
55minor modes also run a mode hook at their end. But hooks are used in 55the mode. Most minor mode functions also run a mode hook at the end.
56other contexts too. For example, the hook @code{suspend-hook} runs 56But hooks are used in other contexts too. For example, the hook
57just before Emacs suspends itself (@pxref{Suspending Emacs}). 57@code{suspend-hook} runs just before Emacs suspends itself
58(@pxref{Suspending Emacs}).
58 59
59 The recommended way to add a hook function to a normal hook is by 60 The recommended way to add a hook function to a normal hook is by
60calling @code{add-hook} (see below). The hook functions may be any of 61calling @code{add-hook} (see below). The hook functions may be any of
@@ -65,20 +66,16 @@ globally or buffer-locally with @code{add-hook}.
65 66
66@cindex abnormal hook 67@cindex abnormal hook
67 If the hook variable's name does not end with @samp{-hook}, that 68 If the hook variable's name does not end with @samp{-hook}, that
68indicates it is probably an @dfn{abnormal hook}. Then you should look at its 69indicates it is probably an @dfn{abnormal hook}. That means the hook
69documentation to see how to use the hook properly. 70functions are called with arguments, or their return values are used
71in some way. The hook's documentation says how the functions are
72called. You can use @code{add-hook} to add a function to an abnormal
73hook, but you must write the function to follow the hook's calling
74convention.
70 75
71 If the variable's name ends in @samp{-functions} or @samp{-hooks}, 76 By convention, abnormal hook names end in @samp{-functions} or
72then the value is a list of functions, but it is abnormal in that either 77@samp{-hooks}. If the variable's name ends in @samp{-function}, then
73these functions are called with arguments or their values are used in 78its value is just a single function, not a list of functions.
74some way. You can use @code{add-hook} to add a function to the list,
75but you must take care in writing the function. (A few of these
76variables, notably those ending in @samp{-hooks}, are actually
77normal hooks which were named before we established the convention of
78using @samp{-hook} for them.)
79
80 If the variable's name ends in @samp{-function}, then its value
81is just a single function, not a list of functions.
82 79
83 Here's an example that uses a mode hook to turn on Auto Fill mode when 80 Here's an example that uses a mode hook to turn on Auto Fill mode when
84in Lisp Interaction mode: 81in Lisp Interaction mode:
@@ -96,12 +93,13 @@ arguments, and runs each hook in turn. Each argument should be a
96symbol that is a normal hook variable. These arguments are processed 93symbol that is a normal hook variable. These arguments are processed
97in the order specified. 94in the order specified.
98 95
99If a hook variable has a non-@code{nil} value, that value may be a 96If a hook variable has a non-@code{nil} value, that value should be a
100function or a list of functions. (The former option is considered 97list of functions. @code{run-hooks} calls all the functions, one by
101obsolete.) If the value is a function (either a lambda expression or 98one, with no arguments.
102a symbol with a function definition), it is called. If it is a list 99
103that isn't a function, its elements are called, consecutively. All 100The hook variable's value can also be a single function---either a
104the hook functions are called with no arguments. 101lambda expression or a symbol with a function definition---which
102@code{run-hooks} calls. But this usage is obsolete.
105@end defun 103@end defun
106 104
107@defun run-hook-with-args hook &rest args 105@defun run-hook-with-args hook &rest args
@@ -187,7 +185,6 @@ to another major mode in the same buffer.
187@menu 185@menu
188* Major Mode Basics:: 186* Major Mode Basics::
189* Major Mode Conventions:: Coding conventions for keymaps, etc. 187* Major Mode Conventions:: Coding conventions for keymaps, etc.
190* Example Major Modes:: Text mode and Lisp modes.
191* Auto Major Mode:: How Emacs chooses the major mode automatically. 188* Auto Major Mode:: How Emacs chooses the major mode automatically.
192* Mode Help:: Finding out how to use a mode. 189* Mode Help:: Finding out how to use a mode.
193* Derived Modes:: Defining a new major mode based on another major 190* Derived Modes:: Defining a new major mode based on another major
@@ -195,6 +192,7 @@ to another major mode in the same buffer.
195* Generic Modes:: Defining a simple major mode that supports 192* Generic Modes:: Defining a simple major mode that supports
196 comment syntax and Font Lock mode. 193 comment syntax and Font Lock mode.
197* Mode Hooks:: Hooks run at the end of major mode functions. 194* Mode Hooks:: Hooks run at the end of major mode functions.
195* Example Major Modes:: Text mode and Lisp modes.
198@end menu 196@end menu
199 197
200@node Major Mode Basics 198@node Major Mode Basics
@@ -214,14 +212,14 @@ specialized editing task, creating a new major mode is usually a good
214idea. In practice, writing a major mode is easy (in contrast to 212idea. In practice, writing a major mode is easy (in contrast to
215writing a minor mode, which is often difficult). 213writing a minor mode, which is often difficult).
216 214
217 If the new mode is similar to an old one, it is often unwise to modify 215 If the new mode is similar to an old one, it is often unwise to
218the old one to serve two purposes, since it may become harder to use and 216modify the old one to serve two purposes, since it may become harder
219maintain. Instead, copy and rename an existing major mode definition 217to use and maintain. Instead, copy and rename an existing major mode
220and alter the copy---or define a @dfn{derived mode} (@pxref{Derived 218definition and alter the copy---or use @code{define-derived-mode} to
221Modes}). For example, Rmail Edit mode, which is in 219define a @dfn{derived mode} (@pxref{Derived Modes}). For example,
222@file{emacs/lisp/mail/rmailedit.el}, is a major mode that is very similar to 220Rmail Edit mode is a major mode that is very similar to Text mode
223Text mode except that it provides two additional commands. Its 221except that it provides two additional commands. Its definition is
224definition is distinct from that of Text mode, but uses that of Text mode. 222distinct from that of Text mode, but uses that of Text mode.
225 223
226 Even if the new mode is not an obvious derivative of any other mode, 224 Even if the new mode is not an obvious derivative of any other mode,
227it is convenient to use @code{define-derived-mode} with a @code{nil} 225it is convenient to use @code{define-derived-mode} with a @code{nil}
@@ -287,8 +285,10 @@ Documentation}.
287 285
288@item 286@item
289The major mode command should start by calling 287The major mode command should start by calling
290@code{kill-all-local-variables}. This is what gets rid of the 288@code{kill-all-local-variables}. This runs the normal hook
291buffer-local variables of the major mode previously in effect. 289@code{change-major-mode-hook}, then gets rid of the buffer-local
290variables of the major mode previously in effect. @xref{Creating
291Buffer-Local}.
292 292
293@item 293@item
294The major mode command should set the variable @code{major-mode} to the 294The major mode command should set the variable @code{major-mode} to the
@@ -355,9 +355,11 @@ Rmail that do not allow self-insertion of text can reasonably redefine
355letters and other printing characters as special commands. 355letters and other printing characters as special commands.
356 356
357@item 357@item
358Major modes must not define @key{RET} to do anything other than insert 358Major modes modes for editing text should not define @key{RET} to do
359a newline. The command to insert a newline and then indent is 359anything other than insert a newline. However, it is ok for
360@kbd{C-j}. Please keep this distinction uniform for all major modes. 360specialized modes for text that users don't directly edit, such as
361Dired and Info modes, to redefine @key{RET} to do something entirely
362different.
361 363
362@item 364@item
363Major modes should not alter options that are primarily a matter of user 365Major modes should not alter options that are primarily a matter of user
@@ -427,10 +429,11 @@ other packages would interfere with them.
427@item 429@item
428@cindex mode hook 430@cindex mode hook
429@cindex major mode hook 431@cindex major mode hook
430Each major mode should have a @dfn{mode hook} named 432Each major mode should have a normal @dfn{mode hook} named
431@code{@var{modename}-mode-hook}. The major mode command should run that 433@code{@var{modename}-mode-hook}. The very last thing the major mode command
432hook, with @code{run-mode-hooks}, as the very last thing it 434should do is to call @code{run-mode-hooks}. This runs the mode hook,
433does. @xref{Mode Hooks}. 435and then runs the normal hook @code{after-change-major-mode-hook}.
436@xref{Mode Hooks}.
434 437
435@item 438@item
436The major mode command may start by calling some other major mode 439The major mode command may start by calling some other major mode
@@ -488,281 +491,6 @@ that they may be evaluated more than once without adverse consequences.
488Even if you never load the file more than once, someone else will. 491Even if you never load the file more than once, someone else will.
489@end itemize 492@end itemize
490 493
491@node Example Major Modes
492@subsection Major Mode Examples
493
494 Text mode is perhaps the simplest mode besides Fundamental mode.
495Here are excerpts from @file{text-mode.el} that illustrate many of
496the conventions listed above:
497
498@smallexample
499@group
500;; @r{Create the syntax table for this mode.}
501(defvar text-mode-syntax-table
502 (let ((st (make-syntax-table)))
503 (modify-syntax-entry ?\" ". " st)
504 (modify-syntax-entry ?\\ ". " st)
505 ;; Add `p' so M-c on `hello' leads to `Hello', not `hello'.
506 (modify-syntax-entry ?' "w p" st)
507 st)
508 "Syntax table used while in `text-mode'.")
509@end group
510
511;; @r{Create the keymap for this mode.}
512@group
513(defvar text-mode-map
514 (let ((map (make-sparse-keymap)))
515 (define-key map "\e\t" 'ispell-complete-word)
516 (define-key map "\es" 'center-line)
517 (define-key map "\eS" 'center-paragraph)
518 map)
519 "Keymap for `text-mode'.
520Many other modes, such as Mail mode, Outline mode
521and Indented Text mode, inherit all the commands
522defined in this map.")
523@end group
524@end smallexample
525
526 Here is how the actual mode command is defined now:
527
528@smallexample
529@group
530(define-derived-mode text-mode nil "Text"
531 "Major mode for editing text written for humans to read.
532In this mode, paragraphs are delimited only by blank or white lines.
533You can thus get the full benefit of adaptive filling
534 (see the variable `adaptive-fill-mode').
535\\@{text-mode-map@}
536Turning on Text mode runs the normal hook `text-mode-hook'."
537@end group
538@group
539 (make-local-variable 'text-mode-variant)
540 (setq text-mode-variant t)
541 ;; @r{These two lines are a feature added recently.}
542 (set (make-local-variable 'require-final-newline)
543 mode-require-final-newline)
544 (set (make-local-variable 'indent-line-function) 'indent-relative))
545@end group
546@end smallexample
547
548 But here is how it was defined formerly, before
549@code{define-derived-mode} existed:
550
551@smallexample
552@group
553;; @r{This isn't needed nowadays, since @code{define-derived-mode} does it.}
554(defvar text-mode-abbrev-table nil
555 "Abbrev table used while in text mode.")
556(define-abbrev-table 'text-mode-abbrev-table ())
557@end group
558
559@group
560(defun text-mode ()
561 "Major mode for editing text intended for humans to read...
562 Special commands: \\@{text-mode-map@}
563@end group
564@group
565Turning on text-mode runs the hook `text-mode-hook'."
566 (interactive)
567 (kill-all-local-variables)
568 (use-local-map text-mode-map)
569@end group
570@group
571 (setq local-abbrev-table text-mode-abbrev-table)
572 (set-syntax-table text-mode-syntax-table)
573@end group
574@group
575 ;; @r{These four lines are absent from the current version}
576 ;; @r{not because this is done some other way, but rather}
577 ;; @r{because nowadays Text mode uses the normal definition of paragraphs.}
578 (make-local-variable 'paragraph-start)
579 (setq paragraph-start (concat "[ \t]*$\\|" page-delimiter))
580 (make-local-variable 'paragraph-separate)
581 (setq paragraph-separate paragraph-start)
582 (make-local-variable 'indent-line-function)
583 (setq indent-line-function 'indent-relative-maybe)
584@end group
585@group
586 (setq mode-name "Text")
587 (setq major-mode 'text-mode)
588 (run-mode-hooks 'text-mode-hook)) ; @r{Finally, this permits the user to}
589 ; @r{customize the mode with a hook.}
590@end group
591@end smallexample
592
593@cindex @file{lisp-mode.el}
594 The three Lisp modes (Lisp mode, Emacs Lisp mode, and Lisp
595Interaction mode) have more features than Text mode and the code is
596correspondingly more complicated. Here are excerpts from
597@file{lisp-mode.el} that illustrate how these modes are written.
598
599@cindex syntax table example
600@smallexample
601@group
602;; @r{Create mode-specific table variables.}
603(defvar lisp-mode-syntax-table nil "")
604(defvar lisp-mode-abbrev-table nil "")
605@end group
606
607@group
608(defvar emacs-lisp-mode-syntax-table
609 (let ((table (make-syntax-table)))
610 (let ((i 0))
611@end group
612
613@group
614 ;; @r{Set syntax of chars up to @samp{0} to say they are}
615 ;; @r{part of symbol names but not words.}
616 ;; @r{(The digit @samp{0} is @code{48} in the @acronym{ASCII} character set.)}
617 (while (< i ?0)
618 (modify-syntax-entry i "_ " table)
619 (setq i (1+ i)))
620 ;; @r{@dots{} similar code follows for other character ranges.}
621@end group
622@group
623 ;; @r{Then set the syntax codes for characters that are special in Lisp.}
624 (modify-syntax-entry ? " " table)
625 (modify-syntax-entry ?\t " " table)
626 (modify-syntax-entry ?\f " " table)
627 (modify-syntax-entry ?\n "> " table)
628@end group
629@group
630 ;; @r{Give CR the same syntax as newline, for selective-display.}
631 (modify-syntax-entry ?\^m "> " table)
632 (modify-syntax-entry ?\; "< " table)
633 (modify-syntax-entry ?` "' " table)
634 (modify-syntax-entry ?' "' " table)
635 (modify-syntax-entry ?, "' " table)
636@end group
637@group
638 ;; @r{@dots{}likewise for many other characters@dots{}}
639 (modify-syntax-entry ?\( "() " table)
640 (modify-syntax-entry ?\) ")( " table)
641 (modify-syntax-entry ?\[ "(] " table)
642 (modify-syntax-entry ?\] ")[ " table))
643 table))
644@end group
645@group
646;; @r{Create an abbrev table for lisp-mode.}
647(define-abbrev-table 'lisp-mode-abbrev-table ())
648@end group
649@end smallexample
650
651 Much code is shared among the three Lisp modes. The following
652function sets various variables; it is called by each of the major Lisp
653mode functions:
654
655@smallexample
656@group
657(defun lisp-mode-variables (lisp-syntax)
658 (when lisp-syntax
659 (set-syntax-table lisp-mode-syntax-table))
660 (setq local-abbrev-table lisp-mode-abbrev-table)
661 @dots{}
662@end group
663@end smallexample
664
665 Functions such as @code{forward-paragraph} use the value of the
666@code{paragraph-start} variable. Since Lisp code is different from
667ordinary text, the @code{paragraph-start} variable needs to be set
668specially to handle Lisp. Also, comments are indented in a special
669fashion in Lisp and the Lisp modes need their own mode-specific
670@code{comment-indent-function}. The code to set these variables is the
671rest of @code{lisp-mode-variables}.
672
673@smallexample
674@group
675 (make-local-variable 'paragraph-start)
676 (setq paragraph-start (concat page-delimiter "\\|$" ))
677 (make-local-variable 'paragraph-separate)
678 (setq paragraph-separate paragraph-start)
679 @dots{}
680@end group
681@group
682 (make-local-variable 'comment-indent-function)
683 (setq comment-indent-function 'lisp-comment-indent))
684 @dots{}
685@end group
686@end smallexample
687
688 Each of the different Lisp modes has a slightly different keymap. For
689example, Lisp mode binds @kbd{C-c C-z} to @code{run-lisp}, but the other
690Lisp modes do not. However, all Lisp modes have some commands in
691common. The following code sets up the common commands:
692
693@smallexample
694@group
695(defvar shared-lisp-mode-map ()
696 "Keymap for commands shared by all sorts of Lisp modes.")
697
698;; @r{Putting this @code{if} after the @code{defvar} is an older style.}
699(if shared-lisp-mode-map
700 ()
701 (setq shared-lisp-mode-map (make-sparse-keymap))
702 (define-key shared-lisp-mode-map "\e\C-q" 'indent-sexp)
703 (define-key shared-lisp-mode-map "\177"
704 'backward-delete-char-untabify))
705@end group
706@end smallexample
707
708@noindent
709And here is the code to set up the keymap for Lisp mode:
710
711@smallexample
712@group
713(defvar lisp-mode-map ()
714 "Keymap for ordinary Lisp mode...")
715
716(if lisp-mode-map
717 ()
718 (setq lisp-mode-map (make-sparse-keymap))
719 (set-keymap-parent lisp-mode-map shared-lisp-mode-map)
720 (define-key lisp-mode-map "\e\C-x" 'lisp-eval-defun)
721 (define-key lisp-mode-map "\C-c\C-z" 'run-lisp))
722@end group
723@end smallexample
724
725 Finally, here is the complete major mode function definition for
726Lisp mode.
727
728@smallexample
729@group
730(defun lisp-mode ()
731 "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp.
732Commands:
733Delete converts tabs to spaces as it moves back.
734Blank lines separate paragraphs. Semicolons start comments.
735\\@{lisp-mode-map@}
736Note that `run-lisp' may be used either to start an inferior Lisp job
737or to switch back to an existing one.
738@end group
739
740@group
741Entry to this mode calls the value of `lisp-mode-hook'
742if that value is non-nil."
743 (interactive)
744 (kill-all-local-variables)
745@end group
746@group
747 (use-local-map lisp-mode-map) ; @r{Select the mode's keymap.}
748 (setq major-mode 'lisp-mode) ; @r{This is how @code{describe-mode}}
749 ; @r{finds out what to describe.}
750 (setq mode-name "Lisp") ; @r{This goes into the mode line.}
751 (lisp-mode-variables t) ; @r{This defines various variables.}
752 (make-local-variable 'comment-start-skip)
753 (setq comment-start-skip
754 "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
755 (make-local-variable 'font-lock-keywords-case-fold-search)
756 (setq font-lock-keywords-case-fold-search t)
757@end group
758@group
759 (setq imenu-case-fold-search t)
760 (set-syntax-table lisp-mode-syntax-table)
761 (run-mode-hooks 'lisp-mode-hook)) ; @r{This permits the user to use a}
762 ; @r{hook to customize the mode.}
763@end group
764@end smallexample
765
766@node Auto Major Mode 494@node Auto Major Mode
767@subsection How Emacs Chooses a Major Mode 495@subsection How Emacs Chooses a Major Mode
768 496
@@ -1073,104 +801,365 @@ Do not write an @code{interactive} spec in the definition;
1073@subsection Generic Modes 801@subsection Generic Modes
1074@cindex generic mode 802@cindex generic mode
1075 803
1076@dfn{Generic modes} are simple major modes with basic support for 804 @dfn{Generic modes} are simple major modes with basic support for
1077comment syntax and Font Lock mode. They are primarily useful for 805comment syntax and Font Lock mode. To define a generic mode, use the
1078configuration files. To define a generic mode, use the macro 806macro @code{define-generic-mode}. See the file @file{generic-x.el}
1079@code{define-generic-mode}. See the file @file{generic-x.el} for some 807for some examples of the use of @code{define-generic-mode}.
1080examples of the use of @code{define-generic-mode}.
1081 808
1082@defmac define-generic-mode mode comment-list keyword-list font-lock-list auto-mode-list function-list &optional docstring 809@defmac define-generic-mode mode comment-list keyword-list font-lock-list auto-mode-list function-list &optional docstring
1083This macro creates a new generic mode. The argument @var{mode} (an 810This macro defines a generic mode command named @var{mode} (a symbol,
1084unquoted symbol) is the major mode command. The optional argument 811not quoted). The optional argument @var{docstring} is the
1085@var{docstring} is the documentation for the mode command. If you do 812documentation for the mode command. If you do not supply it,
1086not supply it, @code{define-generic-mode} uses a default documentation 813@code{define-generic-mode} generates one by default.
1087string instead. 814
1088 815The argument @var{comment-list} is a list in which each element is
1089@var{comment-list} is a list in which each element is either a 816either a character, a string of one or two characters, or a cons cell.
1090character, a string of one or two characters, or a cons cell. A 817A character or a string is set up in the mode's syntax table as a
1091character or a string is set up in the mode's syntax table as a
1092``comment starter.'' If the entry is a cons cell, the @sc{car} is set 818``comment starter.'' If the entry is a cons cell, the @sc{car} is set
1093up as a ``comment starter'' and the @sc{cdr} as a ``comment ender.'' 819up as a ``comment starter'' and the @sc{cdr} as a ``comment ender.''
1094(Use @code{nil} for the latter if you want comments to end at the end 820(Use @code{nil} for the latter if you want comments to end at the end
1095of the line.) Note that the syntax table has limitations about what 821of the line.) Note that the syntax table mechanism has limitations
1096comment starters and enders are actually possible. @xref{Syntax 822about what comment starters and enders are actually possible.
1097Tables}. 823@xref{Syntax Tables}.
1098 824
1099@var{keyword-list} is a list of keywords to highlight with 825The argument @var{keyword-list} is a list of keywords to highlight
1100@code{font-lock-keyword-face}. Each keyword should be a string. 826with @code{font-lock-keyword-face}. Each keyword should be a string.
1101@var{font-lock-list} is a list of additional expressions to highlight. 827Meanwhile, @var{font-lock-list} is a list of additional expressions to
1102Each element of this list should have the same form as an element of 828highlight. Each element of this list should have the same form as an
1103@code{font-lock-keywords}. @xref{Search-based Fontification}. 829element of @code{font-lock-keywords}. @xref{Search-based
1104 830Fontification}.
1105@var{auto-mode-list} is a list of regular expressions to add to the 831
1106variable @code{auto-mode-alist}. These regular expressions are added 832The argument @var{auto-mode-list} is a list of regular expressions to
1107when Emacs runs the macro expansion. 833add to the variable @code{auto-mode-alist}. They are added by the execution
1108 834of the @code{define-generic-mode} form, not by expanding the macro call.
1109@var{function-list} is a list of functions to call to do some 835
1110additional setup. The mode command calls these functions just before 836Finally, @var{function-list} is a list of functions for the mode
1111it runs the mode hook variable @code{@var{mode}-hook}. 837command to call for additional setup. It calls these functions just
838before it runs the mode hook variable @code{@var{mode}-hook}.
1112@end defmac 839@end defmac
1113 840
1114@node Mode Hooks 841@node Mode Hooks
1115@subsection Mode Hooks 842@subsection Mode Hooks
1116 843
1117 The two last things a major mode function should do is run its mode 844 Every major mode function should finish by running its mode hook and
1118hook and finally the mode independent normal hook 845the mode-independent normal hook @code{after-change-major-mode-hook}.
1119@code{after-change-major-mode-hook}. If the major mode is a derived 846It does this by calling @code{run-mode-hooks}. If the major mode is a
1120mode, that is if it calls another major mode (the parent mode) in its 847derived mode, that is if it calls another major mode (the parent mode)
1121body, then the parent's mode hook is run just before the derived 848in its body, it should do this inside @code{delay-mode-hooks} so that
1122mode's hook. Neither the parent's mode hook nor 849the parent won't run these hooks itself. Instead, the derived mode's
1123@code{after-change-major-mode-hook} are run at the end of the actual 850call to @code{run-mode-hooks} runs the parent's mode hook too.
1124call to the parent mode. This applies recursively if the parent mode 851@xref{Major Mode Conventions}.
1125has itself a parent. That is, the mode hooks of all major modes 852
1126called directly or indirectly by the major mode function are all run 853 Emacs versions before Emacs 22 did not have @code{delay-mode-hooks}.
1127in sequence at the end, just before 854When user-implemented major modes have not been updated to use it,
1128@code{after-change-major-mode-hook}. 855they won't entirely follow these conventions: they may run the
1129 856parent's mode hook too early, or fail to run
1130 These conventions are new in Emacs 22, and some major modes 857@code{after-change-major-mode-hook}. If you encounter such a major
1131implemented by users do not follow them yet. So if you put a function 858mode, please correct it to follow these conventions.
1132onto @code{after-change-major-mode-hook}, keep in mind that some modes
1133will fail to run it. If a user complains about that, you can respond,
1134``That major mode fails to follow Emacs conventions, and that's why it
1135fails to work. Please fix the major mode.'' In most cases, that is
1136good enough, so go ahead and use @code{after-change-major-mode-hook}.
1137However, if a certain feature needs to be completely reliable,
1138it should not use @code{after-change-major-mode-hook} as of yet.
1139 859
1140 When you defined a major mode using @code{define-derived-mode}, it 860 When you defined a major mode using @code{define-derived-mode}, it
1141automatically makes sure these conventions are followed. If you 861automatically makes sure these conventions are followed. If you
1142define a major mode ``from scratch,'' not using 862define a major mode ``by hand,'' not using @code{define-derived-mode},
1143@code{define-derived-mode}, make sure the major mode command follows 863use the following functions to handle these conventions automatically.
1144these and other conventions. @xref{Major Mode Conventions}. You use
1145these functions to do it properly.
1146 864
1147@defun run-mode-hooks &rest hookvars 865@defun run-mode-hooks &rest hookvars
1148Major modes should run their mode hook using this function. It is 866Major modes should run their mode hook using this function. It is
1149similar to @code{run-hooks} (@pxref{Hooks}), but it also runs 867similar to @code{run-hooks} (@pxref{Hooks}), but it also runs
1150@code{after-change-major-mode-hook}. 868@code{after-change-major-mode-hook}.
1151 869
1152When the call to this function is dynamically inside a 870When this function is called during the execution of a
1153@code{delay-mode-hooks} form, this function does not run any hooks. 871@code{delay-mode-hooks} form, it does not run the hooks immediately.
1154Instead, it arranges for the next call to @code{run-mode-hooks} to run 872Instead, it arranges for the next call to @code{run-mode-hooks} to run
1155@var{hookvars}. 873them.
1156@end defun 874@end defun
1157 875
1158@defmac delay-mode-hooks body@dots{} 876@defmac delay-mode-hooks body@dots{}
1159This macro executes @var{body} like @code{progn}, but all calls to 877When one major mode command calls another, it should do so inside of
1160@code{run-mode-hooks} inside @var{body} delay running their hooks. 878@code{delay-mode-hooks}.
1161They will be run by the first call to @code{run-mode-hooks} after exit 879
1162from @code{delay-mode-hooks}. This is the proper way for a major mode 880This macro executes @var{body}, but tells all @code{run-mode-hooks}
1163command to invoke its parent mode. 881calls during the execution of @var{body} to delay running their hooks.
882The hooks will actually run during the next call to
883@code{run-mode-hooks} after the end of the @code{delay-mode-hooks}
884construct.
1164@end defmac 885@end defmac
1165 886
1166@defvar after-change-major-mode-hook 887@defvar after-change-major-mode-hook
1167Every major mode function should run this normal hook at its very end. 888This is a normal hook run by @code{run-mode-hooks}. It is run at the
1168It normally does not need to do so explicitly. Indeed, a major mode 889very end of every properly-written major mode function.
1169function should normally run its mode hook with @code{run-mode-hooks}
1170as the very last thing it does, and the last thing
1171@code{run-mode-hooks} does is run @code{after-change-major-mode-hook}.
1172@end defvar 890@end defvar
1173 891
892@node Example Major Modes
893@subsection Major Mode Examples
894
895 Text mode is perhaps the simplest mode besides Fundamental mode.
896Here are excerpts from @file{text-mode.el} that illustrate many of
897the conventions listed above:
898
899@smallexample
900@group
901;; @r{Create the syntax table for this mode.}
902(defvar text-mode-syntax-table
903 (let ((st (make-syntax-table)))
904 (modify-syntax-entry ?\" ". " st)
905 (modify-syntax-entry ?\\ ". " st)
906 ;; Add `p' so M-c on `hello' leads to `Hello', not `hello'.
907 (modify-syntax-entry ?' "w p" st)
908 st)
909 "Syntax table used while in `text-mode'.")
910@end group
911
912;; @r{Create the keymap for this mode.}
913@group
914(defvar text-mode-map
915 (let ((map (make-sparse-keymap)))
916 (define-key map "\e\t" 'ispell-complete-word)
917 (define-key map "\es" 'center-line)
918 (define-key map "\eS" 'center-paragraph)
919 map)
920 "Keymap for `text-mode'.
921Many other modes, such as Mail mode, Outline mode
922and Indented Text mode, inherit all the commands
923defined in this map.")
924@end group
925@end smallexample
926
927 Here is how the actual mode command is defined now:
928
929@smallexample
930@group
931(define-derived-mode text-mode nil "Text"
932 "Major mode for editing text written for humans to read.
933In this mode, paragraphs are delimited only by blank or white lines.
934You can thus get the full benefit of adaptive filling
935 (see the variable `adaptive-fill-mode').
936\\@{text-mode-map@}
937Turning on Text mode runs the normal hook `text-mode-hook'."
938@end group
939@group
940 (make-local-variable 'text-mode-variant)
941 (setq text-mode-variant t)
942 ;; @r{These two lines are a feature added recently.}
943 (set (make-local-variable 'require-final-newline)
944 mode-require-final-newline)
945 (set (make-local-variable 'indent-line-function) 'indent-relative))
946@end group
947@end smallexample
948
949 But here is how it was defined formerly, before
950@code{define-derived-mode} existed:
951
952@smallexample
953@group
954;; @r{This isn't needed nowadays, since @code{define-derived-mode} does it.}
955(defvar text-mode-abbrev-table nil
956 "Abbrev table used while in text mode.")
957(define-abbrev-table 'text-mode-abbrev-table ())
958@end group
959
960@group
961(defun text-mode ()
962 "Major mode for editing text intended for humans to read...
963 Special commands: \\@{text-mode-map@}
964@end group
965@group
966Turning on text-mode runs the hook `text-mode-hook'."
967 (interactive)
968 (kill-all-local-variables)
969 (use-local-map text-mode-map)
970@end group
971@group
972 (setq local-abbrev-table text-mode-abbrev-table)
973 (set-syntax-table text-mode-syntax-table)
974@end group
975@group
976 ;; @r{These four lines are absent from the current version}
977 ;; @r{not because this is done some other way, but rather}
978 ;; @r{because nowadays Text mode uses the normal definition of paragraphs.}
979 (make-local-variable 'paragraph-start)
980 (setq paragraph-start (concat "[ \t]*$\\|" page-delimiter))
981 (make-local-variable 'paragraph-separate)
982 (setq paragraph-separate paragraph-start)
983 (make-local-variable 'indent-line-function)
984 (setq indent-line-function 'indent-relative-maybe)
985@end group
986@group
987 (setq mode-name "Text")
988 (setq major-mode 'text-mode)
989 (run-mode-hooks 'text-mode-hook)) ; @r{Finally, this permits the user to}
990 ; @r{customize the mode with a hook.}
991@end group
992@end smallexample
993
994@cindex @file{lisp-mode.el}
995 The three Lisp modes (Lisp mode, Emacs Lisp mode, and Lisp
996Interaction mode) have more features than Text mode and the code is
997correspondingly more complicated. Here are excerpts from
998@file{lisp-mode.el} that illustrate how these modes are written.
999
1000@cindex syntax table example
1001@smallexample
1002@group
1003;; @r{Create mode-specific table variables.}
1004(defvar lisp-mode-syntax-table nil "")
1005(defvar lisp-mode-abbrev-table nil "")
1006@end group
1007
1008@group
1009(defvar emacs-lisp-mode-syntax-table
1010 (let ((table (make-syntax-table)))
1011 (let ((i 0))
1012@end group
1013
1014@group
1015 ;; @r{Set syntax of chars up to @samp{0} to say they are}
1016 ;; @r{part of symbol names but not words.}
1017 ;; @r{(The digit @samp{0} is @code{48} in the @acronym{ASCII} character set.)}
1018 (while (< i ?0)
1019 (modify-syntax-entry i "_ " table)
1020 (setq i (1+ i)))
1021 ;; @r{@dots{} similar code follows for other character ranges.}
1022@end group
1023@group
1024 ;; @r{Then set the syntax codes for characters that are special in Lisp.}
1025 (modify-syntax-entry ? " " table)
1026 (modify-syntax-entry ?\t " " table)
1027 (modify-syntax-entry ?\f " " table)
1028 (modify-syntax-entry ?\n "> " table)
1029@end group
1030@group
1031 ;; @r{Give CR the same syntax as newline, for selective-display.}
1032 (modify-syntax-entry ?\^m "> " table)
1033 (modify-syntax-entry ?\; "< " table)
1034 (modify-syntax-entry ?` "' " table)
1035 (modify-syntax-entry ?' "' " table)
1036 (modify-syntax-entry ?, "' " table)
1037@end group
1038@group
1039 ;; @r{@dots{}likewise for many other characters@dots{}}
1040 (modify-syntax-entry ?\( "() " table)
1041 (modify-syntax-entry ?\) ")( " table)
1042 (modify-syntax-entry ?\[ "(] " table)
1043 (modify-syntax-entry ?\] ")[ " table))
1044 table))
1045@end group
1046@group
1047;; @r{Create an abbrev table for lisp-mode.}
1048(define-abbrev-table 'lisp-mode-abbrev-table ())
1049@end group
1050@end smallexample
1051
1052 The three modes for Lisp share much of their code. For instance,
1053each calls the following function to set various variables:
1054
1055@smallexample
1056@group
1057(defun lisp-mode-variables (lisp-syntax)
1058 (when lisp-syntax
1059 (set-syntax-table lisp-mode-syntax-table))
1060 (setq local-abbrev-table lisp-mode-abbrev-table)
1061 @dots{}
1062@end group
1063@end smallexample
1064
1065 In Lisp and most programming languages, we want the paragraph
1066commands to treat only blank lines as paragraph separators. And the
1067modes should undestand the Lisp conventions for comments. The rest of
1068@code{lisp-mode-variables} sets this up:
1069
1070@smallexample
1071@group
1072 (make-local-variable 'paragraph-start)
1073 (setq paragraph-start (concat page-delimiter "\\|$" ))
1074 (make-local-variable 'paragraph-separate)
1075 (setq paragraph-separate paragraph-start)
1076 @dots{}
1077@end group
1078@group
1079 (make-local-variable 'comment-indent-function)
1080 (setq comment-indent-function 'lisp-comment-indent))
1081 @dots{}
1082@end group
1083@end smallexample
1084
1085 Each of the different Lisp modes has a slightly different keymap. For
1086example, Lisp mode binds @kbd{C-c C-z} to @code{run-lisp}, but the other
1087Lisp modes do not. However, all Lisp modes have some commands in
1088common. The following code sets up the common commands:
1089
1090@smallexample
1091@group
1092(defvar shared-lisp-mode-map ()
1093 "Keymap for commands shared by all sorts of Lisp modes.")
1094
1095;; @r{Putting this @code{if} after the @code{defvar} is an older style.}
1096(if shared-lisp-mode-map
1097 ()
1098 (setq shared-lisp-mode-map (make-sparse-keymap))
1099 (define-key shared-lisp-mode-map "\e\C-q" 'indent-sexp)
1100 (define-key shared-lisp-mode-map "\177"
1101 'backward-delete-char-untabify))
1102@end group
1103@end smallexample
1104
1105@noindent
1106And here is the code to set up the keymap for Lisp mode:
1107
1108@smallexample
1109@group
1110(defvar lisp-mode-map ()
1111 "Keymap for ordinary Lisp mode...")
1112
1113(if lisp-mode-map
1114 ()
1115 (setq lisp-mode-map (make-sparse-keymap))
1116 (set-keymap-parent lisp-mode-map shared-lisp-mode-map)
1117 (define-key lisp-mode-map "\e\C-x" 'lisp-eval-defun)
1118 (define-key lisp-mode-map "\C-c\C-z" 'run-lisp))
1119@end group
1120@end smallexample
1121
1122 Finally, here is the complete major mode function definition for
1123Lisp mode.
1124
1125@smallexample
1126@group
1127(defun lisp-mode ()
1128 "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp.
1129Commands:
1130Delete converts tabs to spaces as it moves back.
1131Blank lines separate paragraphs. Semicolons start comments.
1132\\@{lisp-mode-map@}
1133Note that `run-lisp' may be used either to start an inferior Lisp job
1134or to switch back to an existing one.
1135@end group
1136
1137@group
1138Entry to this mode calls the value of `lisp-mode-hook'
1139if that value is non-nil."
1140 (interactive)
1141 (kill-all-local-variables)
1142@end group
1143@group
1144 (use-local-map lisp-mode-map) ; @r{Select the mode's keymap.}
1145 (setq major-mode 'lisp-mode) ; @r{This is how @code{describe-mode}}
1146 ; @r{finds out what to describe.}
1147 (setq mode-name "Lisp") ; @r{This goes into the mode line.}
1148 (lisp-mode-variables t) ; @r{This defines various variables.}
1149 (make-local-variable 'comment-start-skip)
1150 (setq comment-start-skip
1151 "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *")
1152 (make-local-variable 'font-lock-keywords-case-fold-search)
1153 (setq font-lock-keywords-case-fold-search t)
1154@end group
1155@group
1156 (setq imenu-case-fold-search t)
1157 (set-syntax-table lisp-mode-syntax-table)
1158 (run-mode-hooks 'lisp-mode-hook)) ; @r{This permits the user to use a}
1159 ; @r{hook to customize the mode.}
1160@end group
1161@end smallexample
1162
1174@node Minor Modes 1163@node Minor Modes
1175@section Minor Modes 1164@section Minor Modes
1176@cindex minor mode 1165@cindex minor mode
@@ -1533,16 +1522,14 @@ minor modes.
1533@subsection Mode Line Basics 1522@subsection Mode Line Basics
1534 1523
1535 @code{mode-line-format} is a buffer-local variable that holds a 1524 @code{mode-line-format} is a buffer-local variable that holds a
1536@dfn{mode line construct}, a kind of template, which controls the 1525@dfn{mode line construct}, a kind of template, which controls what is
1537display the mode line of the current buffer. All windows for the same 1526displayed on the mode line of the current buffer. The value of
1538buffer use the same @code{mode-line-format}, so their mode lines 1527@code{header-line-format} specifies the buffer's header line in the
1539appear the same---except for scrolling percentages, and line and 1528same way. All windows for the same buffer use the same
1540column numbers, since those depend on point and on how the window is 1529@code{mode-line-format} and @code{header-line-format}.
1541scrolled. The value of @code{header-line-format} specifies the 1530
1542buffer's header line in the same way, with a mode line construct. 1531 For efficiency, Emacs does not continuously recompute the mode
1543 1532line and header line of a window. It does so when circumstances
1544 For efficiency, Emacs does not recompute the mode line and header
1545line of a window in every redisplay. It does so when circumstances
1546appear to call for it---for instance, if you change the window 1533appear to call for it---for instance, if you change the window
1547configuration, switch buffers, narrow or widen the buffer, scroll, or 1534configuration, switch buffers, narrow or widen the buffer, scroll, or
1548change the buffer's modification status. If you modify any of the 1535change the buffer's modification status. If you modify any of the
@@ -1552,7 +1539,6 @@ how text is displayed (@pxref{Display}), you may want to force an
1552update of the mode line so as to display the new information or 1539update of the mode line so as to display the new information or
1553display it in the new way. 1540display it in the new way.
1554 1541
1555@c Emacs 19 feature
1556@defun force-mode-line-update &optional all 1542@defun force-mode-line-update &optional all
1557Force redisplay of the current buffer's mode line and header line. 1543Force redisplay of the current buffer's mode line and header line.
1558The next redisplay will update the mode line and header line based on 1544The next redisplay will update the mode line and header line based on
@@ -1589,15 +1575,17 @@ defined to have mode-line constructs as their values.
1589@table @code 1575@table @code
1590@cindex percent symbol in mode line 1576@cindex percent symbol in mode line
1591@item @var{string} 1577@item @var{string}
1592A string as a mode-line construct appears verbatim in the mode line 1578A string as a mode-line construct appears verbatim except for
1593except for @dfn{@code{%}-constructs} in it. These stand for 1579@dfn{@code{%}-constructs} in it. These stand for substitution of
1594substitution of other data; see @ref{%-Constructs}. 1580other data; see @ref{%-Constructs}.
1595 1581
1596If the string has @code{face} properties, they are copied into the 1582If parts of the string have @code{face} properties, they control
1597mode line contents too (@pxref{Properties in Mode}). Any characters 1583display of the text just as they would text in the buffer. Any
1598in the mode line which have no @code{face} properties are displayed, 1584characters which have no @code{face} properties are displayed, by
1599by default, in the face @code{mode-line} or @code{mode-line-inactive} 1585default, in the face @code{mode-line} or @code{mode-line-inactive}
1600(@pxref{Standard Faces,,, emacs, The GNU Emacs Manual}). 1586(@pxref{Standard Faces,,, emacs, The GNU Emacs Manual}). The
1587@code{help-echo} and @code{local-map} properties in @var{string} have
1588special meanings. @xref{Properties in Mode}.
1601 1589
1602@item @var{symbol} 1590@item @var{symbol}
1603A symbol as a mode-line construct stands for its value. The value of 1591A symbol as a mode-line construct stands for its value. The value of
@@ -1612,7 +1600,9 @@ Unless @var{symbol} is marked as ``risky'' (i.e., it has a
1612non-@code{nil} @code{risky-local-variable} property), all text 1600non-@code{nil} @code{risky-local-variable} property), all text
1613properties specified in @var{symbol}'s value are ignored. This 1601properties specified in @var{symbol}'s value are ignored. This
1614includes the text properties of strings in @var{symbol}'s value, as 1602includes the text properties of strings in @var{symbol}'s value, as
1615well as all @code{:eval} and @code{:propertize} forms in it. 1603well as all @code{:eval} and @code{:propertize} forms in it. (The
1604reason for this is security: non-risky variables could be set
1605automatically from file variables without prompting the user.)
1616 1606
1617@item (@var{string} @var{rest}@dots{}) 1607@item (@var{string} @var{rest}@dots{})
1618@itemx (@var{list} @var{rest}@dots{}) 1608@itemx (@var{list} @var{rest}@dots{})
@@ -2055,10 +2045,10 @@ structure, and make @var{form} evaluate to a string that has a text
2055property. 2045property.
2056@end enumerate 2046@end enumerate
2057 2047
2058 You use the @code{local-map} property to specify a keymap. Like any 2048 You can use the @code{local-map} property to specify a keymap. This
2059keymap, it can bind character keys and function keys; but that has no 2049keymap only takes real effect for mouse clicks; binding character keys
2060effect, since it is impossible to move point into the mode line. This 2050and function keys to it has no effect, since it is impossible to move
2061keymap can only take real effect for mouse clicks. 2051point into the mode line.
2062 2052
2063 When the mode line refers to a variable which does not have a 2053 When the mode line refers to a variable which does not have a
2064non-@code{nil} @code{risky-local-variable} property, any text 2054non-@code{nil} @code{risky-local-variable} property, any text
@@ -2889,6 +2879,10 @@ Used (typically) for constant names.
2889@vindex font-lock-preprocessor-face 2879@vindex font-lock-preprocessor-face
2890Used (typically) for preprocessor commands. 2880Used (typically) for preprocessor commands.
2891 2881
2882@item font-lock-negation-char-face
2883@vindex font-lock-negation-char-face
2884Used (typically) for easily-overlooked negation characters.
2885
2892@item font-lock-warning-face 2886@item font-lock-warning-face
2893@vindex font-lock-warning-face 2887@vindex font-lock-warning-face
2894Used (typically) for constructs that are peculiar, or that greatly 2888Used (typically) for constructs that are peculiar, or that greatly
@@ -3057,7 +3051,7 @@ so that the scanned text never starts or ends in the middle of a
3057multiline construct. 3051multiline construct.
3058@item 3052@item
3059Add a function to @code{font-lock-extend-region-functions} that does 3053Add a function to @code{font-lock-extend-region-functions} that does
3060the \emph{identification} and extends the scan so that the scanned 3054the @emph{identification} and extends the scan so that the scanned
3061text never starts or ends in the middle of a multiline construct. 3055text never starts or ends in the middle of a multiline construct.
3062@end itemize 3056@end itemize
3063 3057
diff --git a/lispref/os.texi b/lispref/os.texi
index 30f66889387..ab277afdce6 100644
--- a/lispref/os.texi
+++ b/lispref/os.texi
@@ -1256,7 +1256,9 @@ This stands for the year without century (00-99).
1256@item %Y 1256@item %Y
1257This stands for the year with century. 1257This stands for the year with century.
1258@item %Z 1258@item %Z
1259This stands for the time zone abbreviation. 1259This stands for the time zone abbreviation (e.g., @samp{EST}).
1260@item %z
1261This stands for the time zone numerical offset (e.g., @samp{-0500}).
1260@end table 1262@end table
1261 1263
1262You can also specify the field width and type of padding for any of 1264You can also specify the field width and type of padding for any of
@@ -1286,12 +1288,14 @@ If @var{universal} is non-@code{nil}, that means to describe the time as
1286Universal Time; @code{nil} means describe it using what Emacs believes 1288Universal Time; @code{nil} means describe it using what Emacs believes
1287is the local time zone (see @code{current-time-zone}). 1289is the local time zone (see @code{current-time-zone}).
1288 1290
1289This function uses the C library function @code{strftime} to do most of 1291This function uses the C library function @code{strftime}
1290the work. In order to communicate with that function, it first encodes 1292(@pxref{Formatting Calendar Time,,, libc, The GNU C Library Reference
1291its argument using the coding system specified by 1293Manual}) to do most of the work. In order to communicate with that
1292@code{locale-coding-system} (@pxref{Locales}); after @code{strftime} 1294function, it first encodes its argument using the coding system
1293returns the resulting string, @code{format-time-string} decodes the 1295specified by @code{locale-coding-system} (@pxref{Locales}); after
1294string using that same coding system. 1296@code{strftime} returns the resulting string,
1297@code{format-time-string} decodes the string using that same coding
1298system.
1295@end defun 1299@end defun
1296 1300
1297@defun seconds-to-time seconds 1301@defun seconds-to-time seconds
diff --git a/lispref/strings.texi b/lispref/strings.texi
index 46c01982f32..17a62b546b4 100644
--- a/lispref/strings.texi
+++ b/lispref/strings.texi
@@ -700,8 +700,8 @@ in the copy with encodings of the corresponding @var{objects}. The
700arguments @var{objects} are the computed values to be formatted. 700arguments @var{objects} are the computed values to be formatted.
701 701
702The characters in @var{string}, other than the format specifications, 702The characters in @var{string}, other than the format specifications,
703are copied directly into the output; if they have text properties, 703are copied directly into the output, including their text properties,
704these are copied into the output also. 704if any.
705@end defun 705@end defun
706 706
707@cindex @samp{%} in format 707@cindex @samp{%} in format
@@ -719,6 +719,17 @@ For example:
719@end group 719@end group
720@end example 720@end example
721 721
722 Since @code{format} interprets @samp{%} characters as format
723specifications, you should @emph{never} pass an arbitrary string as
724the first argument. This is particularly true when the string is
725generated by some Lisp code. Unless the string is @emph{known} to
726never include any @samp{%} characters, pass @code{"%s"}, described
727below, as the first argument, and the string as the second, like this:
728
729@example
730 (format "%s" @var{arbitrary-string})
731@end example
732
722 If @var{string} contains more than one format specification, the 733 If @var{string} contains more than one format specification, the
723format specifications correspond to successive values from 734format specifications correspond to successive values from
724@var{objects}. Thus, the first format specification in @var{string} 735@var{objects}. Thus, the first format specification in @var{string}
diff --git a/lispref/text.texi b/lispref/text.texi
index 08e55f18f05..4d2f278bee8 100644
--- a/lispref/text.texi
+++ b/lispref/text.texi
@@ -103,9 +103,9 @@ This function returns the character following point in the current
103buffer. This is similar to @code{(char-after (point))}. However, if 103buffer. This is similar to @code{(char-after (point))}. However, if
104point is at the end of the buffer, then @code{following-char} returns 0. 104point is at the end of the buffer, then @code{following-char} returns 0.
105 105
106Remember that point is always between characters, and the terminal 106Remember that point is always between characters, and the cursor
107cursor normally appears over the character following point. Therefore, 107normally appears over the character following point. Therefore, the
108the character returned by @code{following-char} is the character the 108character returned by @code{following-char} is the character the
109cursor is over. 109cursor is over.
110 110
111In this example, point is between the @samp{a} and the @samp{c}. 111In this example, point is between the @samp{a} and the @samp{c}.
@@ -526,16 +526,6 @@ The value returned is @code{nil}. In an interactive call, @var{count}
526is the numeric prefix argument. 526is the numeric prefix argument.
527@end deffn 527@end deffn
528 528
529@deffn Command split-line
530This command splits the current line, moving the portion of the line
531after point down vertically so that it is on the next line directly
532below where it was before. Whitespace is inserted as needed at the
533beginning of the lower line, using the @code{indent-to} function.
534@code{split-line} returns the position of point.
535
536Programs hardly ever use this function.
537@end deffn
538
539@defvar overwrite-mode 529@defvar overwrite-mode
540This variable controls whether overwrite mode is in effect. The value 530This variable controls whether overwrite mode is in effect. The value
541should be @code{overwrite-mode-textual}, @code{overwrite-mode-binary}, 531should be @code{overwrite-mode-textual}, @code{overwrite-mode-binary},
@@ -978,8 +968,11 @@ the @var{undo} value.
978@comment node-name, next, previous, up 968@comment node-name, next, previous, up
979@subsection Functions for Yanking 969@subsection Functions for Yanking
980 970
981 @dfn{Yanking} means reinserting an entry of previously killed text 971 This section describes higher-level commands for yanking, which are
982from the kill ring. The text properties are copied too. 972intended primarily for the user but useful also in Lisp programs.
973Both @code{yank} and @code{yank-pop} honor the
974@code{yank-excluded-properties} variable and @code{yank-handler} text
975property (@pxref{Yanking}).
983 976
984@deffn Command yank &optional arg 977@deffn Command yank &optional arg
985@cindex inserting killed text 978@cindex inserting killed text
@@ -1213,7 +1206,7 @@ value for @code{kill-ring-max} is 60.
1213to the buffer's text so that they can be undone. (The buffers that 1206to the buffer's text so that they can be undone. (The buffers that
1214don't have one are usually special-purpose buffers for which Emacs 1207don't have one are usually special-purpose buffers for which Emacs
1215assumes that undoing is not useful. In particular, any buffer whose 1208assumes that undoing is not useful. In particular, any buffer whose
1216name begins with a space has its undo recording off by default, 1209name begins with a space has its undo recording off by default;
1217see @ref{Buffer Names}.) All the primitives that modify the 1210see @ref{Buffer Names}.) All the primitives that modify the
1218text in the buffer automatically add elements to the front of the undo 1211text in the buffer automatically add elements to the front of the undo
1219list, which is in the variable @code{buffer-undo-list}. 1212list, which is in the variable @code{buffer-undo-list}.
@@ -1318,8 +1311,7 @@ they're being called for the sake of undoing.
1318@defun primitive-undo count list 1311@defun primitive-undo count list
1319This is the basic function for undoing elements of an undo list. 1312This is the basic function for undoing elements of an undo list.
1320It undoes the first @var{count} elements of @var{list}, returning 1313It undoes the first @var{count} elements of @var{list}, returning
1321the rest of @var{list}. You could write this function in Lisp, 1314the rest of @var{list}.
1322but it is convenient to have it in C.
1323 1315
1324@code{primitive-undo} adds elements to the buffer's undo list when it 1316@code{primitive-undo} adds elements to the buffer's undo list when it
1325changes the buffer. Undo commands avoid confusion by saving the undo 1317changes the buffer. Undo commands avoid confusion by saving the undo
@@ -1372,7 +1364,9 @@ them back to size limits you can set. (For this purpose, the ``size''
1372of an undo list measures the cons cells that make up the list, plus the 1364of an undo list measures the cons cells that make up the list, plus the
1373strings of deleted text.) Three variables control the range of acceptable 1365strings of deleted text.) Three variables control the range of acceptable
1374sizes: @code{undo-limit}, @code{undo-strong-limit} and 1366sizes: @code{undo-limit}, @code{undo-strong-limit} and
1375@code{undo-outer-limit}. 1367@code{undo-outer-limit}. In these variables, size is counted as the
1368number of bytes occupied, which includes both saved text and other
1369data.
1376 1370
1377@defopt undo-limit 1371@defopt undo-limit
1378This is the soft limit for the acceptable size of an undo list. The 1372This is the soft limit for the acceptable size of an undo list. The
@@ -1392,6 +1386,17 @@ exceeds this limit, Emacs discards the info and displays a warning.
1392This is a last ditch limit to prevent memory overflow. 1386This is a last ditch limit to prevent memory overflow.
1393@end defopt 1387@end defopt
1394 1388
1389@defopt undo-ask-before-discard
1390If this variable is non-@code{nil}, when the undo info exceeds
1391@code{undo-outer-limit}, Emacs asks in the echo area whether to
1392discard the info. The default value is @code{nil}, which means to
1393discard it automatically.
1394
1395This option is mainly intended for debugging. Garbage collection is
1396inhibited while the question is asked, which means that Emacs might
1397leak memory if the user waits too long before answering the question.
1398@end defopt
1399
1395@node Filling 1400@node Filling
1396@comment node-name, next, previous, up 1401@comment node-name, next, previous, up
1397@section Filling 1402@section Filling
@@ -1481,8 +1486,6 @@ it. If the region was made up of many paragraphs, the blank lines
1481between paragraphs are removed. This function justifies as well as 1486between paragraphs are removed. This function justifies as well as
1482filling when @var{justify} is non-@code{nil}. 1487filling when @var{justify} is non-@code{nil}.
1483 1488
1484In an interactive call, any prefix argument requests justification.
1485
1486If @var{nosqueeze} is non-@code{nil}, that means to leave whitespace 1489If @var{nosqueeze} is non-@code{nil}, that means to leave whitespace
1487other than line breaks untouched. If @var{squeeze-after} is 1490other than line breaks untouched. If @var{squeeze-after} is
1488non-@code{nil}, it specifies a position in the region, and means don't 1491non-@code{nil}, it specifies a position in the region, and means don't
@@ -1522,6 +1525,11 @@ values are @code{left}, @code{right}, @code{full}, @code{center}, or
1522@defun current-justification 1525@defun current-justification
1523This function returns the proper justification style to use for filling 1526This function returns the proper justification style to use for filling
1524the text around point. 1527the text around point.
1528
1529This returns the value of the @code{justification} text property at
1530point, or the variable @var{default-justification} if there is no such
1531text property. However, it returns @code{nil} rather than @code{none}
1532to mean ``don't justify''.
1525@end defun 1533@end defun
1526 1534
1527@defopt sentence-end-double-space 1535@defopt sentence-end-double-space
@@ -1569,14 +1577,14 @@ newlines'' act as paragraph separators.
1569@section Margins for Filling 1577@section Margins for Filling
1570 1578
1571@defopt fill-prefix 1579@defopt fill-prefix
1572This buffer-local variable specifies a string of text that appears at 1580This buffer-local variable, if non-@code{nil}, specifies a string of
1573the beginning 1581text that appears at the beginning of normal text lines and should be
1574of normal text lines and should be disregarded when filling them. Any 1582disregarded when filling them. Any line that fails to start with the
1575line that fails to start with the fill prefix is considered the start of 1583fill prefix is considered the start of a paragraph; so is any line
1576a paragraph; so is any line that starts with the fill prefix followed by 1584that starts with the fill prefix followed by additional whitespace.
1577additional whitespace. Lines that start with the fill prefix but no 1585Lines that start with the fill prefix but no additional whitespace are
1578additional whitespace are ordinary text lines that can be filled 1586ordinary text lines that can be filled together. The resulting filled
1579together. The resulting filled lines also start with the fill prefix. 1587lines also start with the fill prefix.
1580 1588
1581The fill prefix follows the left margin whitespace, if any. 1589The fill prefix follows the left margin whitespace, if any.
1582@end defopt 1590@end defopt
@@ -1661,12 +1669,11 @@ becomes buffer-local when set in any fashion.
1661 1669
1662@defvar fill-nobreak-predicate 1670@defvar fill-nobreak-predicate
1663This variable gives major modes a way to specify not to break a line 1671This variable gives major modes a way to specify not to break a line
1664at certain places. Its value should be a list of functions, but a 1672at certain places. Its value should be a list of functions. Whenever
1665single function is also supported for compatibility. Whenever filling 1673filling considers breaking the line at a certain place in the buffer,
1666considers breaking the line at a certain place in the buffer, it calls 1674it calls each of these functions with no arguments and with point
1667each of these functions with no arguments and with point located at 1675located at that place. If any of the functions returns
1668that place. If any of the functions returns non-@code{nil}, then the 1676non-@code{nil}, then the line won't be broken there.
1669line won't be broken there.
1670@end defvar 1677@end defvar
1671 1678
1672@node Adaptive Fill 1679@node Adaptive Fill
@@ -1733,7 +1740,7 @@ Adaptive Fill mode matches this regular expression against the text
1733starting after the left margin whitespace (if any) on a line; the 1740starting after the left margin whitespace (if any) on a line; the
1734characters it matches are that line's candidate for the fill prefix. 1741characters it matches are that line's candidate for the fill prefix.
1735 1742
1736@w{@code{"[ \t]*\\([-|#;>*]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"}} is the 1743@w{@code{"[ \t]*\\([-!|#%;>*·•‣âƒâ—¦]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"}} is the
1737default value. This matches a number enclosed in parentheses or 1744default value. This matches a number enclosed in parentheses or
1738followed by a period, or certain punctuation characters, or any 1745followed by a period, or certain punctuation characters, or any
1739sequence of these intermingled with whitespace. In particular, it 1746sequence of these intermingled with whitespace. In particular, it
@@ -1898,7 +1905,8 @@ the sort order."
1898 (save-restriction 1905 (save-restriction
1899 (narrow-to-region beg end) 1906 (narrow-to-region beg end)
1900 (goto-char (point-min)) 1907 (goto-char (point-min))
1901 (sort-subr reverse 'forward-line 'end-of-line)))) 1908 (let ((inhibit-field-text-motion t))
1909 (sort-subr reverse 'forward-line 'end-of-line)))))
1902@end group 1910@end group
1903@end example 1911@end example
1904 1912
@@ -2054,9 +2062,12 @@ One unusual thing about this command is that the entire line
2054containing position @var{beg}, and the entire line containing position 2062containing position @var{beg}, and the entire line containing position
2055@var{end}, are included in the region sorted. 2063@var{end}, are included in the region sorted.
2056 2064
2057Note that @code{sort-columns} uses the @code{sort} utility program, 2065Note that @code{sort-columns} rejects text that contains tabs, because
2058and so cannot work properly on text containing tab characters. Use 2066tabs could be split across the specified columns. Use @kbd{M-x
2059@kbd{M-x untabify} to convert tabs to spaces before sorting. 2067untabify} to convert tabs to spaces before sorting.
2068
2069When possible, this command actually works by calling the @code{sort}
2070utility program.
2060@end deffn 2071@end deffn
2061 2072
2062@node Columns 2073@node Columns
@@ -2391,6 +2402,7 @@ spaces and tab characters to reach the next tab stop column; it does not
2391affect the display of tab characters in the buffer (@pxref{Usual 2402affect the display of tab characters in the buffer (@pxref{Usual
2392Display}). Note that the @key{TAB} character as input uses this tab 2403Display}). Note that the @key{TAB} character as input uses this tab
2393stop feature only in a few major modes, such as Text mode. 2404stop feature only in a few major modes, such as Text mode.
2405@xref{Tab Stops,,, emacs, The GNU Emacs Manual}.
2394 2406
2395@deffn Command tab-to-tab-stop 2407@deffn Command tab-to-tab-stop
2396This command inserts spaces or tabs before point, up to the next tab 2408This command inserts spaces or tabs before point, up to the next tab
@@ -3079,22 +3091,23 @@ This feature is used in the mode line and for other active text.
3079@cindex keymap of character 3091@cindex keymap of character
3080@kindex keymap @r{(text property)} 3092@kindex keymap @r{(text property)}
3081The @code{keymap} property specifies an additional keymap for 3093The @code{keymap} property specifies an additional keymap for
3082commands. The property's value for the character before point applies 3094commands. When this keymap applies, it is used for key lookup before
3083if it is non-@code{nil} and rear-sticky, and the property's value for 3095the minor mode keymaps and before the buffer's local map.
3084the character after point applies if it is non-@code{nil} and 3096@xref{Active Keymaps}. If the property value is a symbol, the
3097symbol's function definition is used as the keymap.
3098
3099The property's value for the character before point applies if it is
3100non-@code{nil} and rear-sticky, and the property's value for the
3101character after point applies if it is non-@code{nil} and
3085front-sticky. (For mouse clicks, the position of the click is used 3102front-sticky. (For mouse clicks, the position of the click is used
3086instead of the position of point.) If the property value is a symbol, 3103instead of the position of point.)
3087the symbol's function definition is used as the keymap.
3088
3089When this keymap applies, it is used for key lookup before the minor
3090mode keymaps and before the buffer's local map. @xref{Active
3091Keymaps}.
3092 3104
3093@item local-map 3105@item local-map
3094@kindex local-map @r{(text property)} 3106@kindex local-map @r{(text property)}
3095This property works like @code{keymap} except that it specifies a 3107This property works like @code{keymap} except that it specifies a
3096keymap to use @emph{instead of} the buffer's local map. For most 3108keymap to use @emph{instead of} the buffer's local map. For most
3097purposes (perhaps all purposes), the @code{keymap} is superior. 3109purposes (perhaps all purposes), it is better to use the @code{keymap}
3110property.
3098 3111
3099@item syntax-table 3112@item syntax-table
3100The @code{syntax-table} property overrides what the syntax table says 3113The @code{syntax-table} property overrides what the syntax table says
@@ -3479,9 +3492,16 @@ being called over and over for the same text.
3479@subsection Defining Clickable Text 3492@subsection Defining Clickable Text
3480@cindex clickable text 3493@cindex clickable text
3481 3494
3482 There are two parts of setting up @dfn{clickable text} in a buffer: 3495 @dfn{Clickable text} is text that can be clicked, with either the
3483(1) to indicate clickability when the mouse moves over the text, and (2) 3496the mouse or via keyboard commands, to produce some result. Many
3484to make a mouse button do something when you click on that text. 3497major modes use clickable text to implement features such as
3498hyper-links. The @code{button} package provides an easy way to insert
3499and manipulate clickable text. @xref{Buttons}.
3500
3501 In this section, we will explain how to manually set up clickable
3502text in a buffer using text properties. This involves two things: (1)
3503indicating clickability when the mouse moves over the text, and (2)
3504making @kbd{RET} or a mouse click on that text do something.
3485 3505
3486 Indicating clickability usually involves highlighting the text, and 3506 Indicating clickability usually involves highlighting the text, and
3487often involves displaying helpful information about the action, such 3507often involves displaying helpful information about the action, such
diff --git a/man/ChangeLog b/man/ChangeLog
index 4723b892276..4063ca3e2b0 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,63 @@
12006-08-16 Richard Stallman <rms@gnu.org>
2
3 * misc.texi (Saving Emacs Sessions): Clean up wording.
4
5 * mark.texi (Marking Objects): Mention term "select all".
6
7 * emacs.texi (Top): Update subnode menu.
8
9 * help.texi (Help Mode): Move node up in file.
10
112006-08-15 Carsten Dominik <dominik@science.uva.nl>
12
13 * org.texi (Installation, Activation): Split from Installation and
14 Activation.
15 (Clocking work time): Documented new features.
16
172006-08-15 Nick Roberts <nickrob@snap.net.nz>
18
19 * building.texi (Stack Buffer): Explain fringe arrow.
20
212006-08-13 Alex Schroeder <alex@gnu.org>
22
23 * rcirc.texi (Configuration): Use correct variable in rcirc-authinfo
24 example.
25
262006-08-12 Eli Zaretskii <eliz@gnu.org>
27
28 * faq.texi (How to add fonts): New node.
29
30 * misc.texi (Saving Emacs Sessions): Clarify when desktop is restored
31 on startup.
32
332006-08-11 Romain Francoise <romain@orebokech.com>
34
35 * ack.texi (Acknowledgments): Delete mention to zone-mode.el.
36
372006-08-10 Sven Joachim <svenjoac@gmx.de> (tiny change)
38
39 * mule.texi (Recognize Coding, Text Coding): Fix typos.
40
412006-08-10 Richard Stallman <rms@gnu.org>
42
43 * text.texi (Format Faces): Substantial rewrites to deal
44 with face merging. Empty regions don't count. Clarify
45 face property inheritance.
46
472006-08-08 Romain Francoise <romain@orebokech.com>
48
49 * dired.texi (Marks vs Flags): Fix typo reported by Ari Roponen
50 <arjuropo@cc.jyu.fi>.
51
522006-08-05 Romain Francoise <romain@orebokech.com>
53
54 * faq.texi (New in Emacs 22): Expand.
55
562006-08-04 Eli Zaretskii <eliz@gnu.org>
57
58 * cmdargs.texi (Window Size X) <--geometry>: Only width and height
59 apply to all frames.
60
12006-08-03 Michael Olson <mwolson@gnu.org> 612006-08-03 Michael Olson <mwolson@gnu.org>
2 62
3 * erc.texi: Update for ERC 5.1.4. 63 * erc.texi: Update for ERC 5.1.4.
@@ -10,7 +70,7 @@
10 70
11 * building.texi (GDB Graphical Interface): Shorten node names. 71 * building.texi (GDB Graphical Interface): Shorten node names.
12 (GDB-UI Layout): Use GDB-related. 72 (GDB-UI Layout): Use GDB-related.
13 (Stack Buffer): Simplify English. 73 (Other GDB-UI Buffers): Simplify English.
14 74
152006-07-31 Richard Stallman <rms@gnu.org> 752006-07-31 Richard Stallman <rms@gnu.org>
16 76
@@ -31,7 +91,7 @@
31 * building.texi (GDB commands in Fringe): Rename to... 91 * building.texi (GDB commands in Fringe): Rename to...
32 (Source Buffers): ..this and move forward. Describe hollow arrow and 92 (Source Buffers): ..this and move forward. Describe hollow arrow and
33 new option gdb-find-source-frame. 93 new option gdb-find-source-frame.
34 94
352006-07-29 Richard Stallman <rms@gnu.org> 952006-07-29 Richard Stallman <rms@gnu.org>
36 96
37 * dired.texi (Operating on Files): Simplify previous change 97 * dired.texi (Operating on Files): Simplify previous change
@@ -45,7 +105,7 @@
452006-07-28 Richard Stallman <rms@gnu.org> 1052006-07-28 Richard Stallman <rms@gnu.org>
46 106
47 * mark.texi (Transient Mark): Clarify that region never disappears 107 * mark.texi (Transient Mark): Clarify that region never disappears
48 when Transient Mark mode is off, and not when it is on. 108 when Transient Mark mode is off, and not when it is on.
49 109
502006-07-27 Richard Stallman <rms@gnu.org> 1102006-07-27 Richard Stallman <rms@gnu.org>
51 111
@@ -55,15 +115,15 @@
55 115
56 * xresources.texi (GTK styles): Fix texinfo usage. 116 * xresources.texi (GTK styles): Fix texinfo usage.
57 117
58 * pgg.texi, org.texi, info.texi, forms.texi, flymake.texi: 118 * pgg.texi, org.texi, info.texi, forms.texi, flymake.texi:
59 * faq.texi: Move periods and commas inside quotes. 119 * faq.texi: Move periods and commas inside quotes.
60 120
61 * commands.texi (User Input): Explain why we teach keyboard cmds. 121 * commands.texi (User Input): Explain why we teach keyboard cmds.
62 122
63 * xresources.texi, xresmini.texi, search.texi, programs.texi: 123 * xresources.texi, xresmini.texi, search.texi, programs.texi:
64 * misc.texi, kmacro.texi, killing.texi, glossary.texi: 124 * misc.texi, kmacro.texi, killing.texi, glossary.texi:
65 * fortran-xtra.texi, files.texi, emacs.texi, emacs-xtra.texi: 125 * fortran-xtra.texi, files.texi, emacs.texi, emacs-xtra.texi:
66 * doclicense.texi, display.texi, dired.texi, basic.texi: 126 * doclicense.texi, display.texi, dired.texi, basic.texi:
67 * anti.texi, ack.texi: Move periods and commas inside quotes. 127 * anti.texi, ack.texi: Move periods and commas inside quotes.
68 128
692006-07-22 Eli Zaretskii <eliz@gnu.org> 1292006-07-22 Eli Zaretskii <eliz@gnu.org>
diff --git a/man/ack.texi b/man/ack.texi
index 7294cdc3350..67c731d6174 100644
--- a/man/ack.texi
+++ b/man/ack.texi
@@ -419,8 +419,6 @@ them.
419@item 419@item
420John Heidemann wrote @file{mouse-copy.el} and @file{mouse-drag.el}, 420John Heidemann wrote @file{mouse-copy.el} and @file{mouse-drag.el},
421which provide alternative mouse-based editing and scrolling features. 421which provide alternative mouse-based editing and scrolling features.
422He also contributed @file{zone-mode.el}, a major mode for editing DNS
423zone files.
424 422
425@item 423@item
426Jon K Hellan wrote @file{utf7.el}, support for mail-safe transformation 424Jon K Hellan wrote @file{utf7.el}, support for mail-safe transformation
diff --git a/man/building.texi b/man/building.texi
index 8b479960e71..68aeb023b76 100644
--- a/man/building.texi
+++ b/man/building.texi
@@ -1001,12 +1001,13 @@ of the nested subroutine calls (@dfn{stack frames}) now active in the
1001program. @xref{Backtrace,, Backtraces, gdb, The GNU debugger}. 1001program. @xref{Backtrace,, Backtraces, gdb, The GNU debugger}.
1002 1002
1003@findex gdb-frames-select 1003@findex gdb-frames-select
1004 The selected frame number is displayed in reverse contrast. To 1004An arrow in the fringe points to the selected frame or, if the fringe is
1005select a frame in GDB, move point in the stack buffer to that stack 1005not present, the number of the selected frame is displayed in reverse
1006frame and type @key{RET} (@code{gdb-frames-select}), or click 1006contrast. To select a frame in GDB, move point in the stack buffer to
1007that stack frame and type @key{RET} (@code{gdb-frames-select}), or click
1007@kbd{Mouse-2} on a stack frame. If the locals buffer is visible, 1008@kbd{Mouse-2} on a stack frame. If the locals buffer is visible,
1008selecting a stack frame updates it to display the local variables of 1009selecting a stack frame updates it to display the local variables of the
1009the new frame. 1010new frame.
1010 1011
1011@node Other GDB-UI Buffers 1012@node Other GDB-UI Buffers
1012@subsubsection Other Buffers 1013@subsubsection Other Buffers
@@ -1018,7 +1019,7 @@ If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil},
1018the program being debugged takes its input and displays its output 1019the program being debugged takes its input and displays its output
1019here. Otherwise it uses the GUD buffer for that. To toggle whether 1020here. Otherwise it uses the GUD buffer for that. To toggle whether
1020GUD mode uses this buffer, do @kbd{M-x gdb-use-separate-io-buffer}. 1021GUD mode uses this buffer, do @kbd{M-x gdb-use-separate-io-buffer}.
1021That takes effect when you next restart the program you are debugging. 1022This takes effect when you next restart the program you are debugging.
1022 1023
1023The history and replay commands from Shell mode are available here, 1024The history and replay commands from Shell mode are available here,
1024as are the commands to send signals to the debugged program. 1025as are the commands to send signals to the debugged program.
diff --git a/man/cmdargs.texi b/man/cmdargs.texi
index a1b26bcdcb3..fc17d7ec695 100644
--- a/man/cmdargs.texi
+++ b/man/cmdargs.texi
@@ -1013,7 +1013,9 @@ position of the initial Emacs frame:
1013@cindex geometry, command-line argument 1013@cindex geometry, command-line argument
1014Specify the size @var{width} and @var{height} (measured in character 1014Specify the size @var{width} and @var{height} (measured in character
1015columns and lines), and positions @var{xoffset} and @var{yoffset} 1015columns and lines), and positions @var{xoffset} and @var{yoffset}
1016(measured in pixels). This applies to all frames. 1016(measured in pixels). The @var{width} and @var{height} parameters
1017apply to all frames, whereas @var{xoffset} and @var{yoffset} only to
1018the initial frame.
1017 1019
1018@item -fs 1020@item -fs
1019@opindex -fs 1021@opindex -fs
diff --git a/man/dired.texi b/man/dired.texi
index 3bb32c1ac74..0281c6b0107 100644
--- a/man/dired.texi
+++ b/man/dired.texi
@@ -325,7 +325,7 @@ for @file{..} and typing @kbd{f} there.
325 Instead of flagging a file with @samp{D}, you can @dfn{mark} the 325 Instead of flagging a file with @samp{D}, you can @dfn{mark} the
326file with some other character (usually @samp{*}). Most Dired 326file with some other character (usually @samp{*}). Most Dired
327commands to operate on files use the files marked with @samp{*}. The 327commands to operate on files use the files marked with @samp{*}. The
328only command that operates on flagged flies is @kbd{x}, which expunges 328only command that operates on flagged files is @kbd{x}, which expunges
329them. 329them.
330 330
331 Here are some commands for marking with @samp{*}, for unmarking, and 331 Here are some commands for marking with @samp{*}, for unmarking, and
diff --git a/man/emacs.texi b/man/emacs.texi
index 5277a5cebbc..780b5c97b6e 100644
--- a/man/emacs.texi
+++ b/man/emacs.texi
@@ -272,9 +272,9 @@ Help
272* Key Help:: Asking what a key does in Emacs. 272* Key Help:: Asking what a key does in Emacs.
273* Name Help:: Asking about a command, variable or function name. 273* Name Help:: Asking about a command, variable or function name.
274* Apropos:: Asking what pertains to a given topic. 274* Apropos:: Asking what pertains to a given topic.
275* Help Mode:: Special features of Help mode and Help buffers.
275* Library Keywords:: Finding Lisp libraries by keywords (topics). 276* Library Keywords:: Finding Lisp libraries by keywords (topics).
276* Language Help:: Help relating to international language support. 277* Language Help:: Help relating to international language support.
277* Help Mode:: Special features of Help mode and Help buffers.
278* Misc Help:: Other help commands. 278* Misc Help:: Other help commands.
279* Help Files:: Commands to display pre-written help files. 279* Help Files:: Commands to display pre-written help files.
280* Help Echo:: Help on active text and tooltips (`balloon help') 280* Help Echo:: Help on active text and tooltips (`balloon help')
diff --git a/man/faq.texi b/man/faq.texi
index 7890c13a4d8..54be5f38a65 100644
--- a/man/faq.texi
+++ b/man/faq.texi
@@ -1146,16 +1146,28 @@ and on @code{xterm} with @kbd{emacs -nw}.
1146@cindex Emacs 22, new features in 1146@cindex Emacs 22, new features in
1147@cindex Recently introduced features 1147@cindex Recently introduced features
1148 1148
1149@c FIXME: Improve this node before the 22.1 release.
1150@cindex Default features 1149@cindex Default features
1151Font-lock mode, auto-compression mode, and file name shadow mode are now 1150Font Lock mode, auto-compression mode, and file name shadow mode are now
1152enabled by default. It is now possible to follow links with 1151enabled by default. On graphics displays it is now possible to follow
1153@kbd{mouse-1}. 1152links with @kbd{mouse-1}, and the modeline of the selected window is now
1154 1153highlighted. Window fringes are now customizable. The minibuffer
1155@cindex Supported systems 1154prompt is now displayed in a distinct face.
1156Emacs 22 features support for GNU/Linux systems on S390 and X86-64 1155
1157machines, as well as support for the Mac OS X and Cygwin operating 1156Emacs now reads abbrev definitions automatically at startup. The
1158systems. 1157maximum size of buffers has been doubled and is now 256M on 32-bit
1158machines. Grep mode is now separate from Compilation mode and has many
1159new specific options and commands.
1160
1161The original Emacs macro system has been replaced by the new Kmacro
1162package, which provides many new commands and features and a simple
1163interface that uses the function keys F3 and F4. Macros are now stored
1164in a macro ring, and can be debugged and edited interactively.
1165
1166The GUD (Grand Unified Debugger) package can now be used with a full
1167graphical user interface to the debugger which provides many features
1168found in traditional development environments, making it easy to
1169manipulate breakpoints, add watch points, display the call stack, etc.
1170Breakpoints are now displayed in the source buffer.
1159 1171
1160@cindex GTK+ Toolkit 1172@cindex GTK+ Toolkit
1161@cindex Drag-and-drop 1173@cindex Drag-and-drop
@@ -1164,15 +1176,39 @@ Emacs can now be built with GTK+ widgets, and supports drag-and-drop
1164operation on X. Mouse wheel support is now enabled by default. 1176operation on X. Mouse wheel support is now enabled by default.
1165 1177
1166@cindex New modes 1178@cindex New modes
1167Many new modes and packages have been included in Emacs, such as Leim, 1179Many new modes and packages have been included in Emacs, such as Calc,
1168Calc, Tramp and URL, as well as IDO, CUA, rcirc, ERC, conf-mode, 1180Tramp and URL, as well as IDO, CUA, rcirc, ERC, conf-mode, python-mode,
1169python-mode, table, tumme, SES, ruler, Flymake, Org, PGG, etc. 1181table, tumme, SES, ruler, Flymake, Org, PGG, wdired, t-mouse, longlines,
1182dns-mode, savehist, Password, Printing, Reveal, etc.
1183
1184@cindex Multilingual Environment
1185Leim is now part of Emacs. Unicode support has been much improved, and
1186the following input methods have been added: belarusian, bulgarian-bds,
1187bulgarian-phonetic, chinese-sisheng, croatian, dutch, georgian,
1188latin-alt-postfix, latin-postfix, latin-prefix, latvian-keyboard,
1189lithuanian-numeric, lithuanian-keyboard, malayalam-inscript, rfc1345,
1190russian-computer, sgml, slovenian, tamil-inscript ucs,
1191ukrainian-computer, vietnamese-telex, and welsh.
1192
1193The following language environment have also been added: Belarusian,
1194Bulgarian, Chinese-EUC-TW, Croatian, French, Georgian, Italian, Latin-6,
1195Latin-7, Latvian, Lithuanian, Malayalam, Russian, Russian, Slovenian,
1196Swedish, Tajik, Tamil, UTF-8, Ukrainian, Ukrainian, Welsh, and
1197Windows-1255.
1198
1199@cindex Supported systems
1200Emacs 22 features support for GNU/Linux systems on S390 and x86-64
1201machines, as well as support for the Mac OS X and Cygwin operating
1202systems.
1170 1203
1171@cindex Documentation 1204@cindex Documentation
1172@cindex Emacs Lisp Manual 1205@cindex Emacs Lisp Manual
1173In addition, Emacs 22 now includes the Emacs Lisp Reference Manual 1206In addition, Emacs 22 now includes the Emacs Lisp Reference Manual
1174(@pxref{Emacs Lisp documentation}) and the Emacs Lisp Intro. 1207(@pxref{Emacs Lisp documentation}) and the Emacs Lisp Intro.
1175 1208
1209Many other changes have been made in Emacs 22, use @kbd{C-h n} to get a
1210full list.
1211
1176@c ------------------------------------------------------------ 1212@c ------------------------------------------------------------
1177@node Common requests, Bugs and problems, Status of Emacs, Top 1213@node Common requests, Bugs and problems, Status of Emacs, Top
1178@chapter Common requests 1214@chapter Common requests
@@ -4837,6 +4873,7 @@ You can get the old behavior by binding @kbd{SPC} to
4837* Inputting eight-bit characters:: 4873* Inputting eight-bit characters::
4838* Kanji and Chinese characters:: 4874* Kanji and Chinese characters::
4839* Right-to-left alphabets:: 4875* Right-to-left alphabets::
4876* How to add fonts::
4840@end menu 4877@end menu
4841 4878
4842@node Emacs does not display 8-bit characters, Inputting eight-bit characters, Alternate character sets, Alternate character sets 4879@node Emacs does not display 8-bit characters, Inputting eight-bit characters, Alternate character sets, Alternate character sets
@@ -4876,7 +4913,7 @@ Emacs 20 and later includes many of the features of MULE, the MULtilingual
4876Enhancement to Emacs. @xref{Installing Emacs}, for information on where 4913Enhancement to Emacs. @xref{Installing Emacs}, for information on where
4877to find and download the latest version of Emacs. 4914to find and download the latest version of Emacs.
4878 4915
4879@node Right-to-left alphabets, , Kanji and Chinese characters, Alternate character sets 4916@node Right-to-left alphabets, How to add fonts, Kanji and Chinese characters, Alternate character sets
4880@section Where is an Emacs that can handle Semitic (right-to-left) alphabets? 4917@section Where is an Emacs that can handle Semitic (right-to-left) alphabets?
4881@cindex Right-to-left alphabets 4918@cindex Right-to-left alphabets
4882@cindex Hebrew, handling with Emacs 4919@cindex Hebrew, handling with Emacs
@@ -4896,8 +4933,128 @@ Emacs 18. Write to Joel if you want the patches or package.
4896@file{hebrew.el} requires a Hebrew screen font, but no other hardware support. 4933@file{hebrew.el} requires a Hebrew screen font, but no other hardware support.
4897Joel has a screen font for PCs running MS-DOS or GNU/Linux. 4934Joel has a screen font for PCs running MS-DOS or GNU/Linux.
4898 4935
4899You might also try to query archie for files named with @file{hebrew}; 4936You might also try querying @code{archie} for files named with
4900several ftp sites in Israel may also have the necessary files. 4937@file{hebrew}; several ftp sites in Israel may also have the necessary
4938files.
4939
4940@node How to add fonts, , Right-to-left alphabets, Alternate character sets
4941@section How do I add fonts for use with Emacs?
4942@cindex add fonts for use with Emacs
4943@cindex intlfonts
4944
4945First, download and install the BDF font files and any auxiliary
4946packages they need. The GNU Intlfonts distribution can be found on
4947@uref{http://directory.fsf.org/localization/intlfonts.html, the GNU
4948Software Directory Web site}.
4949
4950Next, if you are on X Window system, issue the following two commands
4951from the shell's prompt:
4952
4953@example
4954 xset +fp /usr/local/share/emacs/fonts
4955 xset fp rehash
4956@end example
4957
4958@noindent
4959(Modify the first command if you installed the fonts in a directory
4960that is not @file{/usr/local/share/emacs/fonts}.) You also need to
4961arrange for these two commands to run whenever you log in, e.g., by
4962adding them to your window-system startup file, such as
4963@file{~/.xsessionrc} or @file{~/.gnomerc}.
4964
4965Now, add the following line to your @file{~/.emacs} init file:
4966
4967@lisp
4968 (add-to-list 'bdf-directory-list "/usr/share/emacs/fonts/bdf")
4969@end lisp
4970
4971@noindent
4972(Again, modify the file name if you installed the fonts elsewhere.)
4973
4974Finally, if you wish to use the installed fonts with @code{ps-print},
4975add the following line to your @file{~/.emacs}:
4976
4977@lisp
4978 (setq ps-multibyte-buffer 'bdf-font-except-latin)
4979@end lisp
4980
4981A few additional steps are necessary for MS-Windows; they are listed
4982below.
4983
4984First, make sure @emph{all} the directories with BDF font files are
4985mentioned in @code{bdf-directory-list}. On Unix and GNU/Linux
4986systems, one normally runs @kbd{make install} to install the BDF fonts
4987in the same directory. By contrast, Windows users typically don't run
4988the Intlfonts installation command, but unpack the distribution in
4989some directory, which leaves the BDF fonts in its subdirectories. For
4990example, assume that you unpacked Intlfonts in @file{C:/Intlfonts};
4991then you should set @code{bdf-directory-list} as follows:
4992
4993@lisp
4994 (setq bdf-directory-list
4995 '("C:/Intlfonts/Asian"
4996 "C:/Intlfonts/Chinese" "C:/Intlfonts/Chinese.X"
4997 "C:/Intlfonts/Chinese.BIG" "C:/Intlfonts/Ethiopic"
4998 "C:/Intlfonts/European" "C:/Intlfonts/European.BIG"
4999 "C:/Intlfonts/Japanese" "C:/Intlfonts/Japanese.X"
5000 "C:/Intlfonts/Japanese.BIG" "C:/Intlfonts/Korean.X"
5001 "C:/Intlfonts/Misc"))
5002@end lisp
5003
5004@cindex @code{w32-bdf-filename-alist}
5005@cindex @code{w32-find-bdf-fonts}
5006Next, you need to set up the variable @code{w32-bdf-filename-alist} to
5007an alist of the BDF fonts and their corresponding file names.
5008Assuming you have set @code{bdf-directory-list} to name all the
5009directories with the BDF font files, the following Lisp snippet will
5010set up @code{w32-bdf-filename-alist}:
5011
5012@lisp
5013 (setq w32-bdf-filename-alist
5014 (w32-find-bdf-fonts bdf-directory-list))
5015@end lisp
5016
5017Now, create fontsets for the BDF fonts:
5018
5019@lisp
5020 (create-fontset-from-fontset-spec
5021 "-*-fixed-medium-r-normal-*-16-*-*-*-c-*-fontset-bdf,
5022 japanese-jisx0208:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1983-*,
5023 katakana-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*,
5024 latin-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*,
5025 japanese-jisx0208-1978:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1978-*,
5026 thai-tis620:-misc-fixed-medium-r-normal--16-160-72-72-m-80-tis620.2529-1,
5027 lao:-misc-fixed-medium-r-normal--16-160-72-72-m-80-MuleLao-1,
5028 tibetan-1-column:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-80-MuleTibetan-1,
5029 ethiopic:-Admas-Ethiomx16f-Medium-R-Normal--16-150-100-100-M-160-Ethiopic-Unicode,
5030 tibetan:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-160-MuleTibetan-0")
5031@end lisp
5032
5033Many of the international bdf fonts from Intlfonts are type 0, and
5034therefore need to be added to font-encoding-alist:
5035
5036@lisp
5037 (setq font-encoding-alist
5038 (append '(("MuleTibetan-0" (tibetan . 0))
5039 ("GB2312" (chinese-gb2312 . 0))
5040 ("JISX0208" (japanese-jisx0208 . 0))
5041 ("JISX0212" (japanese-jisx0212 . 0))
5042 ("VISCII" (vietnamese-viscii-lower . 0))
5043 ("KSC5601" (korean-ksc5601 . 0))
5044 ("MuleArabic-0" (arabic-digit . 0))
5045 ("MuleArabic-1" (arabic-1-column . 0))
5046 ("MuleArabic-2" (arabic-2-column . 0)))
5047 font-encoding-alist))
5048@end lisp
5049
5050You can now use the Emacs font menu to select the @samp{bdf: 16-dot medium}
5051fontset, or you can select it by setting the default font in your
5052@file{~/.emacs}:
5053
5054@lisp
5055 (set-default-font "fontset-bdf")
5056@end lisp
5057
4901 5058
4902@c ------------------------------------------------------------ 5059@c ------------------------------------------------------------
4903@node Mail and news, Concept index, Alternate character sets, Top 5060@node Mail and news, Concept index, Alternate character sets, Top
diff --git a/man/help.texi b/man/help.texi
index 6696b3440dd..08f528f5151 100644
--- a/man/help.texi
+++ b/man/help.texi
@@ -74,9 +74,9 @@ This displays the available Emacs packages based on keywords.
74* Key Help:: Asking what a key does in Emacs. 74* Key Help:: Asking what a key does in Emacs.
75* Name Help:: Asking about a command, variable or function name. 75* Name Help:: Asking about a command, variable or function name.
76* Apropos:: Asking what pertains to a given topic. 76* Apropos:: Asking what pertains to a given topic.
77* Help Mode:: Special features of Help mode and Help buffers.
77* Library Keywords:: Finding Lisp libraries by keywords (topics). 78* Library Keywords:: Finding Lisp libraries by keywords (topics).
78* Language Help:: Help relating to international language support. 79* Language Help:: Help relating to international language support.
79* Help Mode:: Special features of Help mode and Help buffers.
80* Misc Help:: Other help commands. 80* Misc Help:: Other help commands.
81* Help Files:: Commands to display pre-written help files. 81* Help Files:: Commands to display pre-written help files.
82* Help Echo:: Help on active text and tooltips (`balloon help') 82* Help Echo:: Help on active text and tooltips (`balloon help')
@@ -390,6 +390,62 @@ display the most relevant ones first.
390the variable @code{apropos-documentation-sort-by-scores} is 390the variable @code{apropos-documentation-sort-by-scores} is
391@code{nil}, apropos lists the symbols found in alphabetical order. 391@code{nil}, apropos lists the symbols found in alphabetical order.
392 392
393@node Help Mode
394@section Help Mode Commands
395
396 Help buffers provide the same commands as View mode (@pxref{Misc File
397Ops}), plus a few special commands of their own.
398
399@table @kbd
400@item @key{SPC}
401Scroll forward.
402@item @key{DEL}
403Scroll backward.
404@item @key{RET}
405Follow a cross reference at point.
406@item @key{TAB}
407Move point forward to the next cross reference.
408@item S-@key{TAB}
409Move point back to the previous cross reference.
410@item Mouse-1
411@itemx Mouse-2
412Follow a cross reference that you click on.
413@item C-c C-c
414Show all documentation about the symbol at point.
415@end table
416
417 When a function name (@pxref{M-x,, Running Commands by Name}),
418variable name (@pxref{Variables}), or face name (@pxref{Faces})
419appears in the documentation, it normally appears inside paired
420single-quotes. To view the documentation of that command, variable or
421face, you can click on the name with @kbd{Mouse-1} or @kbd{Mouse-2},
422or move point there and type @key{RET}. Use @kbd{C-c C-b} to retrace
423your steps.
424
425@cindex URL, viewing in help
426@cindex help, viewing web pages
427@cindex viewing web pages in help
428@cindex web pages, viewing in help
429@findex browse-url
430 You can follow cross references to URLs (web pages) also. This uses
431the @code{browse-url} command to view the page in the browser you
432choose. @xref{Browse-URL}.
433
434@kindex @key{TAB} @r{(Help mode)}
435@findex help-next-ref
436@kindex S-@key{TAB} @r{(Help mode)}
437@findex help-previous-ref
438 There are convenient commands to move point to cross references in
439the help text. @key{TAB} (@code{help-next-ref}) moves point down to
440the next cross reference. @kbd{S-@key{TAB}} moves up to the previous
441cross reference (@code{help-previous-ref}).
442
443 To view all documentation about any symbol name that appears in the
444text, move point to the symbol name and type @kbd{C-c C-c}
445(@code{help-follow-symbol}). This shows all available documentation
446about the symbol as a variable, function and/or face. As above, use
447@kbd{C-c C-b} to retrace your steps.
448
393@node Library Keywords 449@node Library Keywords
394@section Keyword Search for Lisp Libraries 450@section Keyword Search for Lisp Libraries
395 451
@@ -460,62 +516,6 @@ input method currently in use. @xref{Input Methods}.
460coding systems---either a specified coding system, or the ones 516coding systems---either a specified coding system, or the ones
461currently in use. @xref{Coding Systems}. 517currently in use. @xref{Coding Systems}.
462 518
463@node Help Mode
464@section Help Mode Commands
465
466 Help buffers provide the same commands as View mode (@pxref{Misc File
467Ops}), plus a few special commands of their own.
468
469@table @kbd
470@item @key{SPC}
471Scroll forward.
472@item @key{DEL}
473Scroll backward.
474@item @key{RET}
475Follow a cross reference at point.
476@item @key{TAB}
477Move point forward to the next cross reference.
478@item S-@key{TAB}
479Move point back to the previous cross reference.
480@item Mouse-1
481@itemx Mouse-2
482Follow a cross reference that you click on.
483@item C-c C-c
484Show all documentation about the symbol at point.
485@end table
486
487 When a function name (@pxref{M-x,, Running Commands by Name}),
488variable name (@pxref{Variables}), or face name (@pxref{Faces})
489appears in the documentation, it normally appears inside paired
490single-quotes. To view the documentation of that command, variable or
491face, you can click on the name with @kbd{Mouse-1} or @kbd{Mouse-2},
492or move point there and type @key{RET}. Use @kbd{C-c C-b} to retrace
493your steps.
494
495@cindex URL, viewing in help
496@cindex help, viewing web pages
497@cindex viewing web pages in help
498@cindex web pages, viewing in help
499@findex browse-url
500 You can follow cross references to URLs (web pages) also. This uses
501the @code{browse-url} command to view the page in the browser you
502choose. @xref{Browse-URL}.
503
504@kindex @key{TAB} @r{(Help mode)}
505@findex help-next-ref
506@kindex S-@key{TAB} @r{(Help mode)}
507@findex help-previous-ref
508 There are convenient commands to move point to cross references in
509the help text. @key{TAB} (@code{help-next-ref}) moves point down to
510the next cross reference. @kbd{S-@key{TAB}} moves up to the previous
511cross reference (@code{help-previous-ref}).
512
513 To view all documentation about any symbol name that appears in the
514text, move point to the symbol name and type @kbd{C-c C-c}
515(@code{help-follow-symbol}). This shows all available documentation
516about the symbol as a variable, function and/or face. As above, use
517@kbd{C-c C-b} to retrace your steps.
518
519@node Misc Help 519@node Misc Help
520@section Other Help Commands 520@section Other Help Commands
521 521
diff --git a/man/mark.texi b/man/mark.texi
index 7429b67db2b..2736dccd297 100644
--- a/man/mark.texi
+++ b/man/mark.texi
@@ -369,7 +369,7 @@ negative) instead of the current page.
369 369
370 Finally, @kbd{C-x h} (@code{mark-whole-buffer}) sets up the entire 370 Finally, @kbd{C-x h} (@code{mark-whole-buffer}) sets up the entire
371buffer as the region, by putting point at the beginning and the mark at 371buffer as the region, by putting point at the beginning and the mark at
372the end. 372the end. (In some programs this is called ``select all.'')
373 373
374 In Transient Mark mode, all of these commands activate the mark. 374 In Transient Mark mode, all of these commands activate the mark.
375 375
diff --git a/man/misc.texi b/man/misc.texi
index 6f6d448bc7d..f6fb5edfbdb 100644
--- a/man/misc.texi
+++ b/man/misc.texi
@@ -1998,8 +1998,9 @@ subsequent Emacs sessions reload the saved desktop.
1998@findex desktop-save 1998@findex desktop-save
1999@vindex desktop-save-mode 1999@vindex desktop-save-mode
2000 You can save the desktop manually with the command @kbd{M-x 2000 You can save the desktop manually with the command @kbd{M-x
2001desktop-save}. You can also enable automatic desktop saving when 2001desktop-save}. You can also enable automatic saving of the desktop
2002you exit Emacs: use the Customization buffer (@pxref{Easy 2002when you exit Emacs, and automatic restoration of the last saved
2003desktop when Emacs starts: use the Customization buffer (@pxref{Easy
2003Customization}) to set @code{desktop-save-mode} to @code{t} for future 2004Customization}) to set @code{desktop-save-mode} to @code{t} for future
2004sessions, or add this line in your @file{~/.emacs} file: 2005sessions, or add this line in your @file{~/.emacs} file:
2005 2006
@@ -2009,7 +2010,8 @@ sessions, or add this line in your @file{~/.emacs} file:
2009 2010
2010@findex desktop-change-dir 2011@findex desktop-change-dir
2011@findex desktop-revert 2012@findex desktop-revert
2012 When Emacs starts, it looks for a saved desktop in the current 2013 If you turn on @code{desktop-save-mode} in your @file{~/.emacs},
2014then when Emacs starts, it looks for a saved desktop in the current
2013directory. Thus, you can have separate saved desktops in different 2015directory. Thus, you can have separate saved desktops in different
2014directories, and the starting directory determines which one Emacs 2016directories, and the starting directory determines which one Emacs
2015reloads. You can save the current desktop and reload one saved in 2017reloads. You can save the current desktop and reload one saved in
@@ -2018,7 +2020,10 @@ another directory by typing @kbd{M-x desktop-change-dir}. Typing
2018 2020
2019 Specify the option @samp{--no-desktop} on the command line when you 2021 Specify the option @samp{--no-desktop} on the command line when you
2020don't want it to reload any saved desktop. This turns off 2022don't want it to reload any saved desktop. This turns off
2021@code{desktop-save-mode} for the current session. 2023@code{desktop-save-mode} for the current session. Starting Emacs with
2024the @samp{--no-init-file} option also disables desktop reloading,
2025since it bypasses the @file{.emacs} init file, where
2026@code{desktop-save-mode} is usually turned on.
2022 2027
2023@vindex desktop-restore-eager 2028@vindex desktop-restore-eager
2024 By default, all the buffers in the desktop are restored at one go. 2029 By default, all the buffers in the desktop are restored at one go.
diff --git a/man/mule.texi b/man/mule.texi
index a49478dfe02..9437e30f485 100644
--- a/man/mule.texi
+++ b/man/mule.texi
@@ -785,7 +785,7 @@ file. The variable @code{file-coding-system-alist} specifies this
785correspondence. There is a special function 785correspondence. There is a special function
786@code{modify-coding-system-alist} for adding elements to this list. For 786@code{modify-coding-system-alist} for adding elements to this list. For
787example, to read and write all @samp{.txt} files using the coding system 787example, to read and write all @samp{.txt} files using the coding system
788@code{china-iso-8bit}, you can execute this Lisp expression: 788@code{chinese-iso-8bit}, you can execute this Lisp expression:
789 789
790@smallexample 790@smallexample
791(modify-coding-system-alist 'file "\\.txt\\'" 'chinese-iso-8bit) 791(modify-coding-system-alist 'file "\\.txt\\'" 'chinese-iso-8bit)
@@ -1003,7 +1003,7 @@ of with @kbd{C-x @key{RET} f}, there is no warning if the buffer
1003contains characters that the coding system cannot handle. 1003contains characters that the coding system cannot handle.
1004 1004
1005 Other file commands affected by a specified coding system include 1005 Other file commands affected by a specified coding system include
1006@kbd{C-x C-i} and @kbd{C-x C-v}, as well as the other-window variants 1006@kbd{C-x i} and @kbd{C-x C-v}, as well as the other-window variants
1007of @kbd{C-x C-f}. @kbd{C-x @key{RET} c} also affects commands that 1007of @kbd{C-x C-f}. @kbd{C-x @key{RET} c} also affects commands that
1008start subprocesses, including @kbd{M-x shell} (@pxref{Shell}). If the 1008start subprocesses, including @kbd{M-x shell} (@pxref{Shell}). If the
1009immediately following command does not use the coding system, then 1009immediately following command does not use the coding system, then
diff --git a/man/org.texi b/man/org.texi
index 3e327279726..7897ba32867 100644
--- a/man/org.texi
+++ b/man/org.texi
@@ -3,8 +3,8 @@
3@setfilename ../info/org 3@setfilename ../info/org
4@settitle Org Mode Manual 4@settitle Org Mode Manual
5 5
6@set VERSION 4.43 6@set VERSION 4.44
7@set DATE July 2006 7@set DATE August 2006
8 8
9@dircategory Emacs 9@dircategory Emacs
10@direntry 10@direntry
@@ -98,7 +98,8 @@ Software Foundation raise funds for GNU development.''
98Introduction 98Introduction
99 99
100* Summary:: Brief summary of what Org-mode does 100* Summary:: Brief summary of what Org-mode does
101* Installation:: How to install Org-mode 101* Installation:: How to install a downloaded version of Org-mode
102* Activation:: How to activate Org-mode for certain buffers.
102* Feedback:: Bug reports, ideas, patches etc. 103* Feedback:: Bug reports, ideas, patches etc.
103 104
104Document Structure 105Document Structure
@@ -270,7 +271,8 @@ Extensions, Hooks and Hacking
270 271
271@menu 272@menu
272* Summary:: Brief summary of what Org-mode does 273* Summary:: Brief summary of what Org-mode does
273* Installation:: How to install Org-mode 274* Installation:: How to install a downloaded version of Org-mode
275* Activation:: How to activate Org-mode for certain buffers.
274* Feedback:: Bug reports, ideas, patches etc. 276* Feedback:: Bug reports, ideas, patches etc.
275@end menu 277@end menu
276 278
@@ -323,18 +325,68 @@ questions (FAQ), links to tutorials etc. This page is located at
323 325
324@page 326@page
325 327
326@node Installation, Feedback, Summary, Introduction 328@node Installation, Activation, Summary, Introduction
327@section Installation and Activation 329@section Installation
328@cindex installation 330@cindex installation
331@cindex XEmacs
332
333@b{Important:} If Org-mode is part of the Emacs distribution or an
334XEmacs package, please skip this section and go directly to
335@ref{Activation}.
336
337If you have downloaded Org-mode from the Web, you must take the
338following steps to install it: Go into the Org-mode distribution
339directory and edit the top section of the file @file{Makefile}. You
340must set the name of the Emacs binary (likely either @file{emacs} or
341@file{xemacs}), and the paths to the directories where local Lisp and
342Info files are kept. If you don't have access to the system-wide
343directories, create your own two directories for these files, enter them
344into the Makefile, and make sure Emacs finds the Lisp files by adding
345the following line to @file{.emacs}:
346
347@example
348(setq load-path (cons "~/path/to/lispdir" load-path))
349@end example
350
351@b{XEmacs users now need to install the file @file{noutline.el} from
352the @file{xemacs} subdirectory of the Org-mode distribution. Use the
353command:}
354
355@example
356@b{make install-noutline}
357@end example
358
359@noindent Now byte-compile and install the Lisp files with the shell
360commands:
361
362@example
363make
364make install
365@end example
366
367@noindent If you want to install the info documentation, use this command:
368
369@example
370make install-info
371@end example
372
373@noindent Then add to @file{.emacs}:
374
375@lisp
376;; This line only if org-mode is not part of the X/Emacs distribution.
377(require 'org-install)
378@end lisp
379
380@node Activation, Feedback, Installation, Introduction
381@section Activation
382@cindex activation
329@cindex autoload 383@cindex autoload
330@cindex global keybindings 384@cindex global keybindings
331@cindex keybindings, global 385@cindex keybindings, global
332 386
333If Org-mode is part of the Emacs distribution or an XEmacs package, 387Add the following lines to your @file{.emacs} file. The last two lines
334you only need to copy the following lines to your @file{.emacs} file. 388define @emph{global} keys for the commands @command{org-store-link} and
335The last two lines define @emph{global} keys for the commands 389@command{org-agenda} - please choose suitable keys yourself.
336@command{org-store-link} and @command{org-agenda} - please
337choose suitable keys yourself.
338 390
339@lisp 391@lisp
340;; The following lines are always needed. Choose your own keys. 392;; The following lines are always needed. Choose your own keys.
@@ -345,30 +397,17 @@ choose suitable keys yourself.
345 397
346Furthermore, you must activate @code{font-lock-mode} in org-mode 398Furthermore, you must activate @code{font-lock-mode} in org-mode
347buffers, because significant functionality depends on font-locking being 399buffers, because significant functionality depends on font-locking being
348active. You can do this with either one of the following two lines: 400active. You can do this with either one of the following two lines
401(XEmacs user must use the second option):
349@lisp 402@lisp
350(global-font-lock-mode 1) ; for all buffers 403(global-font-lock-mode 1) ; for all buffers
351(add-hook 'org-mode-hook 'turn-on-font-lock) ; org-mode buffers only 404(add-hook 'org-mode-hook 'turn-on-font-lock) ; org-mode buffers only
352@end lisp 405@end lisp
353 406
354If you have downloaded Org-mode from the Web, you must take additional
355action: Byte-compile @file{org.el} and @file{org-publish.el} and put
356them together with @file{org-install.el} on your load path. Then add to
357@file{.emacs}:
358
359@lisp
360;; This line only if org-mode is not part of the X/Emacs distribution.
361(require 'org-install)
362@end lisp
363
364If you use Org-mode with XEmacs, you also need to install the file
365@file{noutline.el} from the @file{xemacs} subdirectory of the Org-mode
366distribution.
367
368@cindex org-mode, turning on 407@cindex org-mode, turning on
369With this setup, all files with extension @samp{.org} will be put into 408With this setup, all files with extension @samp{.org} will be put
370Org-mode. As an alternative, make the first line of a file look like 409into Org-mode. As an alternative, make the first line of a file look
371this: 410like this:
372 411
373@example 412@example
374MY PROJECTS -*- mode: org; -*- 413MY PROJECTS -*- mode: org; -*-
@@ -378,7 +417,7 @@ MY PROJECTS -*- mode: org; -*-
378the file's name is. See also the variable 417the file's name is. See also the variable
379@code{org-insert-mode-line-in-empty-file}. 418@code{org-insert-mode-line-in-empty-file}.
380 419
381@node Feedback, , Installation, Introduction 420@node Feedback, , Activation, Introduction
382@section Feedback 421@section Feedback
383@cindex feedback 422@cindex feedback
384@cindex bug reports 423@cindex bug reports
@@ -826,8 +865,14 @@ But in the end, not individual scenes matter but the film as a whole.
826@end group 865@end group
827@end example 866@end example
828 867
829Org-mode supports these lists by tuning filling and wrapping commands 868Org-mode supports these lists by tuning filling and wrapping commands to
830to deal with them correctly. 869deal with them correctly@footnote{Org-mode only changes the filling
870settings for Emacs. For XEmacs, you should use Kyle E. Jones'
871@file{filladapt.el}. To turn is on, put into @file{.emacs}:
872@example
873(require 'filladapt)
874@end example
875}.
831 876
832The following commands act on items when the cursor is in the first line 877The following commands act on items when the cursor is in the first line
833of an item (the line with the bullet or number). 878of an item (the line with the bullet or number).
@@ -2160,7 +2205,7 @@ If you define many keywords, you can use in-buffer completion (see
2160 2205
2161The second possibility is to use TODO keywords to indicate different 2206The second possibility is to use TODO keywords to indicate different
2162types of action items. For example, you might want to indicate that 2207types of action items. For example, you might want to indicate that
2163items are for ``work'' or ``home.'' If you are into David Allen's 2208items are for ``work'' or ``home''. If you are into David Allen's
2164@emph{Getting Things DONE}, you might want to use todo types 2209@emph{Getting Things DONE}, you might want to use todo types
2165@samp{NEXTACTION}, @samp{WAITING}, @samp{MAYBE}. Or, when you work 2210@samp{NEXTACTION}, @samp{WAITING}, @samp{MAYBE}. Or, when you work
2166with several people on a single project, you might want to assign 2211with several people on a single project, you might want to assign
@@ -2547,7 +2592,12 @@ keyword together with a timestamp.
2547Stop the clock (clock-out). The inserts another timestamp at the same 2592Stop the clock (clock-out). The inserts another timestamp at the same
2548location where the clock was last started. It also directly computes 2593location where the clock was last started. It also directly computes
2549the resulting time in inserts it after the time range as @samp{=> 2594the resulting time in inserts it after the time range as @samp{=>
2550HH:MM}. 2595HH:MM}.
2596@kindex C-c C-y
2597@item C-c C-y
2598Recompute the time interval after changing one of the time stamps. This
2599is only necessary if you edit the time stamps directly. If you change
2600them with @kbd{S-@key{cursor}} keys, the update is automatic.
2551@kindex C-c C-t 2601@kindex C-c C-t
2552@item C-c C-t 2602@item C-c C-t
2553Changing the TODO state of an item to DONE automatically stops the clock 2603Changing the TODO state of an item to DONE automatically stops the clock
@@ -2565,8 +2615,8 @@ can use visibility cycling to study the tree, but the overlays disappear
2565automatically when the buffer is changed. 2615automatically when the buffer is changed.
2566@kindex C-c C-x C-r 2616@kindex C-c C-x C-r
2567@item C-c C-x C-r 2617@item C-c C-x C-r
2568Insert a dynamic block containing a clock report as an org-mode table 2618Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
2569into the current file. 2619report as an org-mode table into the current file.
2570@example 2620@example
2571#+BEGIN: clocktable :maxlevel 2 :emphasize nil 2621#+BEGIN: clocktable :maxlevel 2 :emphasize nil
2572 2622
@@ -2578,7 +2628,32 @@ table. The @samp{BEGIN} line can specify options:
2578@example 2628@example
2579:maxlevels @r{Maximum level depth to which times are listed in the table.} 2629:maxlevels @r{Maximum level depth to which times are listed in the table.}
2580:emphasize @r{When @code{t}, emphasize level one and level two items} 2630:emphasize @r{When @code{t}, emphasize level one and level two items}
2631:block @r{The time block to consider. This block is specified relative}
2632 @r{to the current time and may be any of these keywords:}
2633 @r{@code{today}, @code{yesterday}, @code{thisweek}, @code{lastweek},}
2634 @r{@code{thismonth}, @code{lastmonth}, @code{thisyear}, or @code{lastyear}}.
2635:tstart @r{A time string specifying when to start considering times}
2636:tend @r{A time string specifying when to stop considering times}
2637@end example
2638So to get a clock summary for the current day, you could write
2639@example
2640#+BEGIN: clocktable :maxlevel 2 :block today
2641
2642#+END: clocktable
2581@end example 2643@end example
2644and to use a specific time range you could write@footnote{Note that all
2645parameters must be specified in a single line - the line is broken here
2646only to fit it onto the manual.}
2647@example
2648#+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
2649 :tend "<2006-08-10 Thu 12:00>"
2650
2651#+END: clocktable
2652@end example
2653@kindex C-u C-c C-x C-u
2654@item C-u C-c C-x C-u
2655Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
2656you have several clocktable blocks in a buffer.
2582@end table 2657@end table
2583 2658
2584The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in 2659The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
@@ -4653,8 +4728,7 @@ setup. See the installation instructions in the file
4653@item @file{cdlatex.el} by Carsten Dominik 4728@item @file{cdlatex.el} by Carsten Dominik
4654@cindex @file{cdlatex.el} 4729@cindex @file{cdlatex.el}
4655Org-mode can make use of the cdlatex package to efficiently enter 4730Org-mode can make use of the cdlatex package to efficiently enter
4656La@TeX{} fragments into Org-mode files. 4731La@TeX{} fragments into Org-mode files. See @ref{CDLaTeX mode}.
4657@file{cdlatex.el} is not part of Emacs, find it on the web.
4658@item @file{remember.el} by John Wiegley 4732@item @file{remember.el} by John Wiegley
4659@cindex @file{remember.el} 4733@cindex @file{remember.el}
4660Org mode cooperates with remember, see @ref{Remember}. 4734Org mode cooperates with remember, see @ref{Remember}.
@@ -4784,7 +4858,7 @@ caused by the preparations for the 22.1 release. In the mean time,
4784@url{http://dto.freeshell.org/e/org-publish.el}. 4858@url{http://dto.freeshell.org/e/org-publish.el}.
4785@cindex @file{org-blog.el} 4859@cindex @file{org-blog.el}
4786@item @file{org-blog.el} by David O'Toole 4860@item @file{org-blog.el} by David O'Toole
4787A blogging plug-in for @file{org-publish.el}. 4861A blogging plug-in for @file{org-publish.el}.@*
4788@url{http://dto.freeshell.org/notebook/OrgMode.html}. 4862@url{http://dto.freeshell.org/notebook/OrgMode.html}.
4789@cindex @file{org-blogging.el} 4863@cindex @file{org-blogging.el}
4790@item @file{org-blogging.el} by Bastien Guerry 4864@item @file{org-blogging.el} by Bastien Guerry
@@ -4805,7 +4879,7 @@ to the block and can also specify parameters for the function producing
4805the content of the block. 4879the content of the block.
4806 4880
4807@example 4881@example
4808#+BEGIN: myblock :parameter1 value1 :parameter2 value2 ..... 4882#+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
4809 4883
4810#+END: 4884#+END:
4811@end example 4885@end example
diff --git a/man/rcirc.texi b/man/rcirc.texi
index fb24a681b7f..606e6beea06 100644
--- a/man/rcirc.texi
+++ b/man/rcirc.texi
@@ -501,7 +501,7 @@ by the arguments this method requires.
501Here is an example to illustrate how you would set it: 501Here is an example to illustrate how you would set it:
502 502
503@example 503@example
504(setq rcirc-startup-channels-alist 504(setq rcirc-authinfo
505 '(("freenode" nickserv "bob" "p455w0rd") 505 '(("freenode" nickserv "bob" "p455w0rd")
506 ("freenode" chanserv "bob" "#bobland" "passwd99") 506 ("freenode" chanserv "bob" "#bobland" "passwd99")
507 ("bitlbee" bitlbee "robert" "sekrit"))) 507 ("bitlbee" bitlbee "robert" "sekrit")))
diff --git a/man/texinfo.tex b/man/texinfo.tex
index d41d40084b0..36c1acad97c 100644
--- a/man/texinfo.tex
+++ b/man/texinfo.tex
@@ -3,7 +3,7 @@
3% Load plain if necessary, i.e., if running under initex. 3% Load plain if necessary, i.e., if running under initex.
4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5% 5%
6\def\texinfoversion{2006-06-19.13} 6\def\texinfoversion{2006-07-17.16}
7% 7%
8% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 8% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free 9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
@@ -327,9 +327,9 @@
327 \pagebody{#1}% 327 \pagebody{#1}%
328 \ifdim\ht\footlinebox > 0pt 328 \ifdim\ht\footlinebox > 0pt
329 % Only leave this space if the footline is nonempty. 329 % Only leave this space if the footline is nonempty.
330 % (We lessened \vsize for it in \oddfootingxxx.) 330 % (We lessened \vsize for it in \oddfootingyyy.)
331 % The \baselineskip=24pt in plain's \makefootline has no effect. 331 % The \baselineskip=24pt in plain's \makefootline has no effect.
332 \vskip 2\baselineskip 332 \vskip 24pt
333 \unvbox\footlinebox 333 \unvbox\footlinebox
334 \fi 334 \fi
335 % 335 %
@@ -2051,11 +2051,11 @@ where each line of input produces a line of output.}
2051% and arrange explicitly to hyphenate at a dash. 2051% and arrange explicitly to hyphenate at a dash.
2052% -- rms. 2052% -- rms.
2053{ 2053{
2054 \catcode`\-=\active 2054 \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active
2055 \catcode`\_=\active
2056 % 2055 %
2057 \global\def\code{\begingroup 2056 \global\def\code{\begingroup
2058 \catcode`\-=\active \catcode`\_=\active 2057 \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active
2058 \let'\singlequotechar
2059 \ifallowcodebreaks 2059 \ifallowcodebreaks
2060 \let-\codedash 2060 \let-\codedash
2061 \let_\codeunder 2061 \let_\codeunder
@@ -2472,8 +2472,8 @@ where each line of input produces a line of output.}
2472 % 2472 %
2473 % Leave some space for the footline. Hopefully ok to assume 2473 % Leave some space for the footline. Hopefully ok to assume
2474 % @evenfooting will not be used by itself. 2474 % @evenfooting will not be used by itself.
2475 \global\advance\pageheight by -\baselineskip 2475 \global\advance\pageheight by -12pt
2476 \global\advance\vsize by -\baselineskip 2476 \global\advance\vsize by -12pt
2477} 2477}
2478 2478
2479\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} 2479\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
@@ -5042,7 +5042,7 @@ where each line of input produces a line of output.}
5042{\tentt \global\dimen0 = 3em}% Width of the box. 5042{\tentt \global\dimen0 = 3em}% Width of the box.
5043\dimen2 = .55pt % Thickness of rules 5043\dimen2 = .55pt % Thickness of rules
5044% The text. (`r' is open on the right, `e' somewhat less so on the left.) 5044% The text. (`r' is open on the right, `e' somewhat less so on the left.)
5045\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} 5045\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
5046% 5046%
5047\setbox\errorbox=\hbox to \dimen0{\hfil 5047\setbox\errorbox=\hbox to \dimen0{\hfil
5048 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. 5048 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
@@ -5265,11 +5265,10 @@ where each line of input produces a line of output.}
5265% 5265%
5266\maketwodispenvs {lisp}{example}{% 5266\maketwodispenvs {lisp}{example}{%
5267 \nonfillstart 5267 \nonfillstart
5268 \tt 5268 \tt\quoteexpand
5269 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. 5269 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
5270 \gobble % eat return 5270 \gobble % eat return
5271} 5271}
5272
5273% @display/@smalldisplay: same as @lisp except keep current font. 5272% @display/@smalldisplay: same as @lisp except keep current font.
5274% 5273%
5275\makedispenv {display}{% 5274\makedispenv {display}{%
@@ -5397,6 +5396,22 @@ where each line of input produces a line of output.}
5397\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount 5396\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
5398% 5397%
5399\def\starttabbox{\setbox0=\hbox\bgroup} 5398\def\starttabbox{\setbox0=\hbox\bgroup}
5399
5400% Allow an option to not replace quotes with a regular directed right
5401% quote/apostrophe (char 0x27), but instead use the undirected quote
5402% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it
5403% the default, but it works for pasting with more pdf viewers (at least
5404% evince), the lilypond developers report. xpdf does work with the
5405% regular 0x27.
5406%
5407\def\singlequotechar{%
5408 \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
5409 '%
5410 \else
5411 \char'15
5412 \fi
5413}
5414%
5400\begingroup 5415\begingroup
5401 \catcode`\^^I=\active 5416 \catcode`\^^I=\active
5402 \gdef\tabexpand{% 5417 \gdef\tabexpand{%
@@ -5409,7 +5424,13 @@ where each line of input produces a line of output.}
5409 \wd0=\dimen0 \box0 \starttabbox 5424 \wd0=\dimen0 \box0 \starttabbox
5410 }% 5425 }%
5411 } 5426 }
5427 \catcode`\'=\active
5428 \gdef\quoteexpand{%
5429 \catcode`\'=\active
5430 \def'{\singlequotechar}
5431 }%
5412\endgroup 5432\endgroup
5433%
5413\def\setupverbatim{% 5434\def\setupverbatim{%
5414 \let\nonarrowing = t% 5435 \let\nonarrowing = t%
5415 \nonfillstart 5436 \nonfillstart
@@ -5418,6 +5439,7 @@ where each line of input produces a line of output.}
5418 \def\par{\leavevmode\egroup\box0\endgraf}% 5439 \def\par{\leavevmode\egroup\box0\endgraf}%
5419 \catcode`\`=\active 5440 \catcode`\`=\active
5420 \tabexpand 5441 \tabexpand
5442 \quoteexpand
5421 % Respect line breaks, 5443 % Respect line breaks,
5422 % print special symbols as themselves, and 5444 % print special symbols as themselves, and
5423 % make each space count 5445 % make each space count
diff --git a/man/text.texi b/man/text.texi
index 3a166174fda..b764a83d8db 100644
--- a/man/text.texi
+++ b/man/text.texi
@@ -2067,59 +2067,61 @@ Display a list of all the defined colors (@code{list-colors-display}).
2067@subsection Faces in Formatted Text 2067@subsection Faces in Formatted Text
2068 2068
2069 The Faces submenu lists various Emacs faces including @code{bold}, 2069 The Faces submenu lists various Emacs faces including @code{bold},
2070@code{italic}, and @code{underline}. Selecting one of these adds the 2070@code{italic}, and @code{underline} (@pxref{Faces}). These menu items
2071chosen face to the region. @xref{Faces}. You can also specify a face 2071operate on the region if it is active and nonempty. Otherwise, they
2072with these keyboard commands: 2072specify to use that face for an immediately following self-inserting
2073character. Instead of the menu, you can use these keyboard commands:
2073 2074
2074@table @kbd 2075@table @kbd
2075@kindex M-o d @r{(Enriched mode)} 2076@kindex M-o d @r{(Enriched mode)}
2076@findex facemenu-set-default 2077@findex facemenu-set-default
2077@item M-o d 2078@item M-o d
2078Set the region, or the next inserted character, to the @code{default} face 2079Remove all @code{face} properties from the region (which includes
2079(@code{facemenu-set-default}). 2080specified colors), or force the following inserted character to have no
2081@code{face} property (@code{facemenu-set-default}).
2080@kindex M-o b @r{(Enriched mode)} 2082@kindex M-o b @r{(Enriched mode)}
2081@findex facemenu-set-bold 2083@findex facemenu-set-bold
2082@item M-o b 2084@item M-o b
2083Set the region, or the next inserted character, to the @code{bold} face 2085Add the face @code{bold} to the region or to the following inserted
2084(@code{facemenu-set-bold}). 2086character (@code{facemenu-set-bold}).
2085@kindex M-o i @r{(Enriched mode)} 2087@kindex M-o i @r{(Enriched mode)}
2086@findex facemenu-set-italic 2088@findex facemenu-set-italic
2087@item M-o i 2089@item M-o i
2088Set the region, or the next inserted character, to the @code{italic} face 2090Add the face @code{italic} to the region or to the following inserted
2089(@code{facemenu-set-italic}). 2091character (@code{facemenu-set-italic}).
2090@kindex M-o l @r{(Enriched mode)} 2092@kindex M-o l @r{(Enriched mode)}
2091@findex facemenu-set-bold-italic 2093@findex facemenu-set-bold-italic
2092@item M-o l 2094@item M-o l
2093Set the region, or the next inserted character, to the @code{bold-italic} face 2095Add the face @code{bold-italic} to the region or to the following
2094(@code{facemenu-set-bold-italic}). 2096inserted character (@code{facemenu-set-bold-italic}).
2095@kindex M-o u @r{(Enriched mode)} 2097@kindex M-o u @r{(Enriched mode)}
2096@findex facemenu-set-underline 2098@findex facemenu-set-underline
2097@item M-o u 2099@item M-o u
2098Set the region, or the next inserted character, to the @code{underline} face 2100Add the face @code{underline} to the region or to the following inserted
2099(@code{facemenu-set-underline}). 2101character (@code{facemenu-set-underline}).
2100@kindex M-o o @r{(Enriched mode)} 2102@kindex M-o o @r{(Enriched mode)}
2101@findex facemenu-set-face 2103@findex facemenu-set-face
2102@item M-o o @var{face} @key{RET} 2104@item M-o o @var{face} @key{RET}
2103Set the region, or the next inserted character, to the face @var{face} 2105Add the face @var{face} to the region or to the following inserted
2104(@code{facemenu-set-face}). 2106character (@code{facemenu-set-face}).
2105@end table 2107@end table
2106 2108
2107 If you use these commands with a prefix argument---or, in Transient Mark 2109 With a prefix argument, all these commands apply to an immediately
2108mode, if the region is not active---then these commands specify a face 2110following self-inserting character, disregarding the region.
2109to use for any immediately following self-inserting input.
2110@xref{Transient Mark}. This applies to both the keyboard commands and
2111the menu commands.
2112 2111
2113 Specifying the @code{default} face also resets foreground and 2112 A self-inserting character normally inherits the @code{face}
2114background color to their defaults.(@pxref{Format Colors}). 2113property (and most other text properties) from the preceding character
2114in the buffer. If you use the above commands to specify face for the
2115next self-inserting character, or the next section's commands to
2116specify a foreground or background color for it, then it does not
2117inherit the @code{face} property from the preceding character; instead
2118it uses whatever you specified. It will still inherit other text
2119properties, though.
2115 2120
2116 Any self-inserting character you type inherits, by default, the face 2121 Strictly speaking, these commands apply only to the first following
2117properties (as well as most other text properties) of the preceding 2122self-inserting character that you type. But if you insert additional
2118character. Specifying any face property, including foreground or 2123characters after it, they will inherit from the first one. So it
2119background color, for your next self-inserting character will prevent 2124appears that these commands apply to all of them.
2120it from inheriting any face properties from the preceding character,
2121although it will still inherit other text properties. Characters
2122inserted by yanking do not inherit text properties.
2123 2125
2124 Enriched mode defines two additional faces: @code{excerpt} and 2126 Enriched mode defines two additional faces: @code{excerpt} and
2125@code{fixed}. These correspond to codes used in the text/enriched file 2127@code{fixed}. These correspond to codes used in the text/enriched file
@@ -2157,8 +2159,8 @@ colors that you have used in Enriched mode in the current Emacs session.
2157 2159
2158 If you specify a color with a prefix argument---or, in Transient 2160 If you specify a color with a prefix argument---or, in Transient
2159Mark mode, if the region is not active---then it applies to any 2161Mark mode, if the region is not active---then it applies to any
2160immediately following self-inserting input. @xref{Transient Mark}. 2162immediately following self-inserting input. Otherwise, the command
2161Otherwise, the command applies to the region. 2163applies to the region.
2162 2164
2163 Each color menu contains one additional item: @samp{Other}. You can use 2165 Each color menu contains one additional item: @samp{Other}. You can use
2164this item to specify a color that is not listed in the menu; it reads 2166this item to specify a color that is not listed in the menu; it reads
diff --git a/src/.gdbinit b/src/.gdbinit
index 60730536ae9..e1ad68e9eb3 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -164,6 +164,10 @@ define pitx
164 if ($it->current.pos.charpos != $it->current.pos.bytepos) 164 if ($it->current.pos.charpos != $it->current.pos.bytepos)
165 printf "[%d]", $it->current.pos.bytepos 165 printf "[%d]", $it->current.pos.bytepos
166 end 166 end
167 printf " pos=%d", $it->position.charpos
168 if ($it->position.charpos != $it->position.bytepos)
169 printf "[%d]", $it->position.bytepos
170 end
167 printf " start=%d", $it->start.pos.charpos 171 printf " start=%d", $it->start.pos.charpos
168 if ($it->start.pos.charpos != $it->start.pos.bytepos) 172 if ($it->start.pos.charpos != $it->start.pos.bytepos)
169 printf "[%d]", $it->start.pos.bytepos 173 printf "[%d]", $it->start.pos.bytepos
@@ -218,7 +222,7 @@ define pitx
218 printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent 222 printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent
219 printf "\n" 223 printf "\n"
220 set $i = 0 224 set $i = 0
221 while ($i < $it->sp) 225 while ($i < $it->sp && $i < 4)
222 set $e = $it->stack[$i] 226 set $e = $it->stack[$i]
223 printf "stack[%d]: ", $i 227 printf "stack[%d]: ", $i
224 output $e->method 228 output $e->method
diff --git a/src/ChangeLog b/src/ChangeLog
index 474ead0cde6..1d7e22867e3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,138 @@
12006-08-16 Andreas Schwab <schwab@suse.de>
2
3 * print.c (debug_output_compilation_hack): Fix return type.
4
52006-08-16 Richard Stallman <rms@gnu.org>
6
7 * print.c (debug_output_compilation_hack): New function.
8
92006-08-16 Kenichi Handa <handa@m17n.org>
10
11 * fileio.c (choose_write_coding_system): Use LF for end-of-line
12 in auto-saving.
13
142006-08-15 Chong Yidong <cyd@stupidchicken.com>
15
16 * keyboard.c (read_char): Don't change idle timer state at all if
17 end_time is supplied.
18
192006-08-15 Kenichi Handa <handa@m17n.org>
20
21 * coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New arg RET. If SRC
22 is exhausted, return with RET.
23 (detect_coding_emacs_mule, detect_coding_iso2022)
24 (detect_coding_sjis, detect_coding_big5, detect_coding_utf_8)
25 (detect_coding_utf_16, detect_coding_ccl): Adjusted for the above
26 change.
27
282006-08-14 Chong Yidong <cyd@stupidchicken.com>
29
30 * keyboard.c (read_char): Don't reset idle timers if a time limit
31 is supplied.
32
332006-08-14 Kim F. Storm <storm@cua.dk>
34
35 * .gdbinit (pitx): Print iterator position.
36 Limit stack dump in case iterator is not initialized.
37
382006-08-12 Eli Zaretskii <eliz@gnu.org>
39
40 * frame.c (Fmouse_position, Fmouse_pixel_position)
41 (Fset_mouse_position, Fset_mouse_pixel_position): Doc fix.
42
432006-08-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
44
45 * xselect.c (Fx_register_dnd_atom): New function.
46 (syms_of_xselect): Defsubr it.
47 (x_handle_dnd_message): Check that message_type is in
48 dpyinfo->x_dnd_atoms before generating lisp event.
49
50 * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track
51 of drag and drop Atoms.
52
53 * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms*
54
55
562006-08-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
57
58 * keyboard.c: Define in_sighandler.
59 (input_available_signal): Set in_sighandler.
60 (init_keyboard): Initialize in_sighandler.
61
62 * keyboard.h: Declare in_sighandler.
63
64 * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler
65 to check if mutex should be locked or not.
66
672006-08-09 Richard Stallman <rms@gnu.org>
68
69 * keyboard.c (keyremap_step): No-op if fkey->parent = nil.
70 (read_key_sequence): Always start fkey.start and fkey.end at 0,
71 and likewise for keytran.
72
732006-08-09 Kenichi Handa <handa@m17n.org>
74
75 * coding.c (syms_of_coding): Improve the docstring
76 file-coding-system-alist.
77
782006-08-07 Andreas Schwab <schwab@suse.de>
79
80 * puresize.h (BASE_PURESIZE): Increase to 1120000.
81
822006-08-06 Chong Yidong <cyd@stupidchicken.com>
83
84 * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars.
85 (Fkill_all_local_variables): Use it.
86 (syms_of_buffer): Defvar it.
87
882006-08-05 Eli Zaretskii <eliz@gnu.org>
89
90 * w32.c (w32_valid_pointer_p): New function.
91
92 * w32.h: Add prototype for w32_valid_pointer_p.
93
94 * alloc.c: Include w32.h.
95 (valid_lisp_object_p) [WINDOWSNT]: Call w32_valid_pointer_p to do
96 the job.
97
98 * keyboard.c (kbd_buffer_get_event): Return Qnil when current time
99 is exactly equal to end_time, not only when it is past that.
100
1012006-08-04 Chong Yidong <cyd@stupidchicken.com>
102
103 * keyboard.c (read_char): Rebalance specpdl after receiving jump.
104
105 * process.c: Reapply 2006-08-01 change.
106
1072006-08-04 Eli Zaretskii <eliz@gnu.org>
108
109 * w32fns.c (w32_query_font): Fix last change: use stricmp.
110
1112006-08-04 Stefan Monnier <monnier@iro.umontreal.ca>
112
113 * editfns.c (Fsubst_char_in_region): Redo the setup work after running
114 the before-change-functions since they may have altered the buffer.
115
1162006-08-04 Ralf Angeli <angeli@caeruleus.net>
117
118 * w32fns.c (w32_createwindow): Handle -geometry command line option
119 and the geometry settings in the Registry.
120
1212006-08-04 Kenichi Handa <handa@m17n.org>
122
123 * w32fns.c (w32_query_font): Compare names by ignoring case.
124
125 * xterm.c (x_query_font): Compare names by ignoring case.
126
1272006-08-03 Jason Rumney <jasonr@gnu.org>
128
129 * w32menu.c (w32_menu_show, w32_dialog_show): Call Fsignal to quit
130 when no option selected.
131
1322006-08-03 Chong Yidong <cyd@stupidchicken.com>
133
134 * process.c: Revert last change.
135
12006-08-01 Kim F. Storm <storm@cua.dk> 1362006-08-01 Kim F. Storm <storm@cua.dk>
2 137
3 * process.c (wait_reading_process_output_unwind): New function. 138 * process.c (wait_reading_process_output_unwind): New function.
diff --git a/src/alloc.c b/src/alloc.c
index 171cdade81a..9cd87503c5a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -80,6 +80,7 @@ extern POINTER_TYPE *sbrk ();
80 80
81#ifdef WINDOWSNT 81#ifdef WINDOWSNT
82#include <fcntl.h> 82#include <fcntl.h>
83#include "w32.h"
83#endif 84#endif
84 85
85#ifdef DOUG_LEA_MALLOC 86#ifdef DOUG_LEA_MALLOC
@@ -129,17 +130,27 @@ static pthread_mutex_t alloc_mutex;
129#define BLOCK_INPUT_ALLOC \ 130#define BLOCK_INPUT_ALLOC \
130 do \ 131 do \
131 { \ 132 { \
132 pthread_mutex_lock (&alloc_mutex); \ 133 if (!in_sighandler) \
133 if (pthread_self () == main_thread) \ 134 { \
134 BLOCK_INPUT; \ 135 pthread_mutex_lock (&alloc_mutex); \
136 if (pthread_self () == main_thread) \
137 BLOCK_INPUT; \
138 else \
139 sigblock (sigmask (SIGIO)); \
140 } \
135 } \ 141 } \
136 while (0) 142 while (0)
137#define UNBLOCK_INPUT_ALLOC \ 143#define UNBLOCK_INPUT_ALLOC \
138 do \ 144 do \
139 { \ 145 { \
140 if (pthread_self () == main_thread) \ 146 if (!in_sighandler) \
141 UNBLOCK_INPUT; \ 147 { \
142 pthread_mutex_unlock (&alloc_mutex); \ 148 pthread_mutex_unlock (&alloc_mutex); \
149 if (pthread_self () == main_thread) \
150 UNBLOCK_INPUT; \
151 else \
152 sigunblock (sigmask (SIGIO)); \
153 } \
143 } \ 154 } \
144 while (0) 155 while (0)
145 156
@@ -4572,6 +4583,9 @@ int
4572valid_pointer_p (p) 4583valid_pointer_p (p)
4573 void *p; 4584 void *p;
4574{ 4585{
4586#ifdef WINDOWSNT
4587 return w32_valid_pointer_p (p, 16);
4588#else
4575 int fd; 4589 int fd;
4576 4590
4577 /* Obviously, we cannot just access it (we would SEGV trying), so we 4591 /* Obviously, we cannot just access it (we would SEGV trying), so we
@@ -4588,6 +4602,7 @@ valid_pointer_p (p)
4588 } 4602 }
4589 4603
4590 return -1; 4604 return -1;
4605#endif
4591} 4606}
4592 4607
4593/* Return 1 if OBJ is a valid lisp object. 4608/* Return 1 if OBJ is a valid lisp object.
diff --git a/src/buffer.c b/src/buffer.c
index 6115f727deb..d26c4451d13 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -146,6 +146,9 @@ Lisp_Object Vinhibit_read_only;
146Lisp_Object Vkill_buffer_query_functions; 146Lisp_Object Vkill_buffer_query_functions;
147Lisp_Object Qkill_buffer_query_functions; 147Lisp_Object Qkill_buffer_query_functions;
148 148
149/* Hook run before changing a major mode. */
150Lisp_Object Vchange_major_mode_hook, Qchange_major_mode_hook;
151
149/* List of functions to call before changing an unmodified buffer. */ 152/* List of functions to call before changing an unmodified buffer. */
150Lisp_Object Vfirst_change_hook; 153Lisp_Object Vfirst_change_hook;
151 154
@@ -2402,7 +2405,7 @@ the normal hook `change-major-mode-hook'. */)
2402 Lisp_Object oalist; 2405 Lisp_Object oalist;
2403 2406
2404 if (!NILP (Vrun_hooks)) 2407 if (!NILP (Vrun_hooks))
2405 call1 (Vrun_hooks, intern ("change-major-mode-hook")); 2408 call1 (Vrun_hooks, Qchange_major_mode_hook);
2406 oalist = current_buffer->local_var_alist; 2409 oalist = current_buffer->local_var_alist;
2407 2410
2408 /* Make sure none of the bindings in oalist 2411 /* Make sure none of the bindings in oalist
@@ -6014,6 +6017,13 @@ t means to use hollow box cursor. See `cursor-type' for other values. */);
6014 doc: /* List of functions called with no args to query before killing a buffer. */); 6017 doc: /* List of functions called with no args to query before killing a buffer. */);
6015 Vkill_buffer_query_functions = Qnil; 6018 Vkill_buffer_query_functions = Qnil;
6016 6019
6020 DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook,
6021 doc: /* Normal hook run before changing the major mode of a buffer.
6022The function `kill-all-local-variables' runs this before doing anything else. */);
6023 Vchange_major_mode_hook = Qnil;
6024 Qchange_major_mode_hook = intern ("change-major-mode-hook");
6025 staticpro (&Qchange_major_mode_hook);
6026
6017 defsubr (&Sbuffer_live_p); 6027 defsubr (&Sbuffer_live_p);
6018 defsubr (&Sbuffer_list); 6028 defsubr (&Sbuffer_list);
6019 defsubr (&Sget_buffer); 6029 defsubr (&Sget_buffer);
diff --git a/src/editfns.c b/src/editfns.c
index 02ea2d2abb8..aa6ad457676 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -2712,6 +2712,10 @@ Both characters must have the same length of multi-byte form. */)
2712 Lisp_Object start, end, fromchar, tochar, noundo; 2712 Lisp_Object start, end, fromchar, tochar, noundo;
2713{ 2713{
2714 register int pos, pos_byte, stop, i, len, end_byte; 2714 register int pos, pos_byte, stop, i, len, end_byte;
2715 /* Keep track of the first change in the buffer:
2716 if 0 we haven't found it yet.
2717 if < 0 we've found it and we've run the before-change-function.
2718 if > 0 we've actually performed it and the value is its position. */
2715 int changed = 0; 2719 int changed = 0;
2716 unsigned char fromstr[MAX_MULTIBYTE_LENGTH], tostr[MAX_MULTIBYTE_LENGTH]; 2720 unsigned char fromstr[MAX_MULTIBYTE_LENGTH], tostr[MAX_MULTIBYTE_LENGTH];
2717 unsigned char *p; 2721 unsigned char *p;
@@ -2724,6 +2728,8 @@ Both characters must have the same length of multi-byte form. */)
2724 int last_changed = 0; 2728 int last_changed = 0;
2725 int multibyte_p = !NILP (current_buffer->enable_multibyte_characters); 2729 int multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
2726 2730
2731 restart:
2732
2727 validate_region (&start, &end); 2733 validate_region (&start, &end);
2728 CHECK_NUMBER (fromchar); 2734 CHECK_NUMBER (fromchar);
2729 CHECK_NUMBER (tochar); 2735 CHECK_NUMBER (tochar);
@@ -2761,7 +2767,7 @@ Both characters must have the same length of multi-byte form. */)
2761 That's faster than getting rid of things, 2767 That's faster than getting rid of things,
2762 and it prevents even the entry for a first change. 2768 and it prevents even the entry for a first change.
2763 Also inhibit locking the file. */ 2769 Also inhibit locking the file. */
2764 if (!NILP (noundo)) 2770 if (!changed && !NILP (noundo))
2765 { 2771 {
2766 record_unwind_protect (subst_char_in_region_unwind, 2772 record_unwind_protect (subst_char_in_region_unwind,
2767 current_buffer->undo_list); 2773 current_buffer->undo_list);
@@ -2795,10 +2801,14 @@ Both characters must have the same length of multi-byte form. */)
2795 && (len == 2 || (p[2] == fromstr[2] 2801 && (len == 2 || (p[2] == fromstr[2]
2796 && (len == 3 || p[3] == fromstr[3])))))) 2802 && (len == 3 || p[3] == fromstr[3]))))))
2797 { 2803 {
2798 if (! changed) 2804 if (changed < 0)
2805 /* We've already seen this and run the before-change-function;
2806 this time we only need to record the actual position. */
2807 changed = pos;
2808 else if (!changed)
2799 { 2809 {
2800 changed = pos; 2810 changed = -1;
2801 modify_region (current_buffer, changed, XINT (end)); 2811 modify_region (current_buffer, pos, XINT (end));
2802 2812
2803 if (! NILP (noundo)) 2813 if (! NILP (noundo))
2804 { 2814 {
@@ -2807,6 +2817,10 @@ Both characters must have the same length of multi-byte form. */)
2807 if (MODIFF - 1 == current_buffer->auto_save_modified) 2817 if (MODIFF - 1 == current_buffer->auto_save_modified)
2808 current_buffer->auto_save_modified++; 2818 current_buffer->auto_save_modified++;
2809 } 2819 }
2820
2821 /* The before-change-function may have moved the gap
2822 or even modified the buffer so we should start over. */
2823 goto restart;
2810 } 2824 }
2811 2825
2812 /* Take care of the case where the new character 2826 /* Take care of the case where the new character
@@ -2859,7 +2873,7 @@ Both characters must have the same length of multi-byte form. */)
2859 pos++; 2873 pos++;
2860 } 2874 }
2861 2875
2862 if (changed) 2876 if (changed > 0)
2863 { 2877 {
2864 signal_after_change (changed, 2878 signal_after_change (changed,
2865 last_changed - changed, last_changed - changed); 2879 last_changed - changed, last_changed - changed);
diff --git a/src/frame.c b/src/frame.c
index 9bbdcd592aa..c57618696eb 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1439,7 +1439,8 @@ The functions are run with one arg, the frame to be deleted. */)
1439DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, 1439DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0,
1440 doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. 1440 doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position.
1441The position is given in character cells, where (0, 0) is the 1441The position is given in character cells, where (0, 0) is the
1442upper-left corner. 1442upper-left corner of the frame, X is the horizontal offset, and Y is
1443the vertical offset.
1443If Emacs is running on a mouseless terminal or hasn't been programmed 1444If Emacs is running on a mouseless terminal or hasn't been programmed
1444to read the mouse position, it returns the selected frame for FRAME 1445to read the mouse position, it returns the selected frame for FRAME
1445and nil for X and Y. 1446and nil for X and Y.
@@ -1487,7 +1488,8 @@ DEFUN ("mouse-pixel-position", Fmouse_pixel_position,
1487 Smouse_pixel_position, 0, 0, 0, 1488 Smouse_pixel_position, 0, 0, 0,
1488 doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. 1489 doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position.
1489The position is given in pixel units, where (0, 0) is the 1490The position is given in pixel units, where (0, 0) is the
1490upper-left corner. 1491upper-left corner of the frame, X is the horizontal offset, and Y is
1492the vertical offset.
1491If Emacs is running on a mouseless terminal or hasn't been programmed 1493If Emacs is running on a mouseless terminal or hasn't been programmed
1492to read the mouse position, it returns the selected frame for FRAME 1494to read the mouse position, it returns the selected frame for FRAME
1493and nil for X and Y. */) 1495and nil for X and Y. */)
@@ -1520,6 +1522,10 @@ Coordinates are relative to the frame, not a window,
1520so the coordinates of the top left character in the frame 1522so the coordinates of the top left character in the frame
1521may be nonzero due to left-hand scroll bars or the menu bar. 1523may be nonzero due to left-hand scroll bars or the menu bar.
1522 1524
1525The position is given in character cells, where (0, 0) is the
1526upper-left corner of the frame, X is the horizontal offset, and Y is
1527the vertical offset.
1528
1523This function is a no-op for an X frame that is not visible. 1529This function is a no-op for an X frame that is not visible.
1524If you have just created a frame, you must wait for it to become visible 1530If you have just created a frame, you must wait for it to become visible
1525before calling this function on it, like this. 1531before calling this function on it, like this.
@@ -1552,6 +1558,9 @@ before calling this function on it, like this.
1552DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position, 1558DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position,
1553 Sset_mouse_pixel_position, 3, 3, 0, 1559 Sset_mouse_pixel_position, 3, 3, 0,
1554 doc: /* Move the mouse pointer to pixel position (X,Y) in FRAME. 1560 doc: /* Move the mouse pointer to pixel position (X,Y) in FRAME.
1561The position is given in pixels, where (0, 0) is the upper-left corner
1562of the frame, X is the horizontal offset, and Y is the vertical offset.
1563
1555Note, this is a no-op for an X frame that is not visible. 1564Note, this is a no-op for an X frame that is not visible.
1556If you have just created a frame, you must wait for it to become visible 1565If you have just created a frame, you must wait for it to become visible
1557before calling this function on it, like this. 1566before calling this function on it, like this.
diff --git a/src/keyboard.c b/src/keyboard.c
index 45d5832a905..62c862f69d1 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -100,6 +100,9 @@ int interrupt_input_pending;
100/* File descriptor to use for input. */ 100/* File descriptor to use for input. */
101extern int input_fd; 101extern int input_fd;
102 102
103/* Nonzero if we are executing from the SIGIO signal handler. */
104int in_sighandler;
105
103#ifdef HAVE_WINDOW_SYSTEM 106#ifdef HAVE_WINDOW_SYSTEM
104/* Make all keyboard buffers much bigger when using X windows. */ 107/* Make all keyboard buffers much bigger when using X windows. */
105#ifdef MAC_OS8 108#ifdef MAC_OS8
@@ -2403,7 +2406,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
2403 EMACS_TIME *end_time; 2406 EMACS_TIME *end_time;
2404{ 2407{
2405 volatile Lisp_Object c; 2408 volatile Lisp_Object c;
2406 int count; 2409 int count, jmpcount;
2407 jmp_buf local_getcjmp; 2410 jmp_buf local_getcjmp;
2408 jmp_buf save_jump; 2411 jmp_buf save_jump;
2409 volatile int key_already_recorded = 0; 2412 volatile int key_already_recorded = 0;
@@ -2629,11 +2632,13 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
2629 around any call to sit_for or kbd_buffer_get_event; 2632 around any call to sit_for or kbd_buffer_get_event;
2630 it *must not* be in effect when we call redisplay. */ 2633 it *must not* be in effect when we call redisplay. */
2631 2634
2635 jmpcount = SPECPDL_INDEX ();
2632 if (_setjmp (local_getcjmp)) 2636 if (_setjmp (local_getcjmp))
2633 { 2637 {
2634 /* We must have saved the outer value of getcjmp here, 2638 /* We must have saved the outer value of getcjmp here,
2635 so restore it now. */ 2639 so restore it now. */
2636 restore_getcjmp (save_jump); 2640 restore_getcjmp (save_jump);
2641 unbind_to (jmpcount, Qnil);
2637 XSETINT (c, quit_char); 2642 XSETINT (c, quit_char);
2638 internal_last_event_frame = selected_frame; 2643 internal_last_event_frame = selected_frame;
2639 Vlast_event_frame = internal_last_event_frame; 2644 Vlast_event_frame = internal_last_event_frame;
@@ -2674,7 +2679,12 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
2674 goto non_reread; 2679 goto non_reread;
2675 } 2680 }
2676 2681
2677 timer_start_idle (); 2682 /* Start idle timers if no time limit is supplied. We don't do it
2683 if a time limit is supplied to avoid an infinite recursion in the
2684 situation where an idle timer calls `sit-for'. */
2685
2686 if (!end_time)
2687 timer_start_idle ();
2678 2688
2679 /* If in middle of key sequence and minibuffer not active, 2689 /* If in middle of key sequence and minibuffer not active,
2680 start echoing if enough time elapses. */ 2690 start echoing if enough time elapses. */
@@ -2744,7 +2754,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
2744 c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); 2754 c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu);
2745 2755
2746 /* Now that we have read an event, Emacs is not idle. */ 2756 /* Now that we have read an event, Emacs is not idle. */
2747 timer_stop_idle (); 2757 if (!end_time)
2758 timer_stop_idle ();
2748 2759
2749 goto exit; 2760 goto exit;
2750 } 2761 }
@@ -2874,7 +2885,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
2874 /* Actually read a character, waiting if necessary. */ 2885 /* Actually read a character, waiting if necessary. */
2875 save_getcjmp (save_jump); 2886 save_getcjmp (save_jump);
2876 restore_getcjmp (local_getcjmp); 2887 restore_getcjmp (local_getcjmp);
2877 timer_start_idle (); 2888 if (!end_time)
2889 timer_start_idle ();
2878 c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time); 2890 c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time);
2879 restore_getcjmp (save_jump); 2891 restore_getcjmp (save_jump);
2880 2892
@@ -2926,7 +2938,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
2926 2938
2927 non_reread: 2939 non_reread:
2928 2940
2929 timer_stop_idle (); 2941 if (!end_time)
2942 timer_stop_idle ();
2930 RESUME_POLLING; 2943 RESUME_POLLING;
2931 2944
2932 if (NILP (c)) 2945 if (NILP (c))
@@ -2960,7 +2973,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
2960 last_input_char = c; 2973 last_input_char = c;
2961 Fcommand_execute (tem, Qnil, Fvector (1, &last_input_char), Qt); 2974 Fcommand_execute (tem, Qnil, Fvector (1, &last_input_char), Qt);
2962 2975
2963 if (CONSP (c) && EQ (XCAR (c), Qselect_window)) 2976 if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time)
2964 /* We stopped being idle for this event; undo that. This 2977 /* We stopped being idle for this event; undo that. This
2965 prevents automatic window selection (under 2978 prevents automatic window selection (under
2966 mouse_autoselect_window from acting as a real input event, for 2979 mouse_autoselect_window from acting as a real input event, for
@@ -3166,7 +3179,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
3166 show_help_echo (help, window, object, position, 0); 3179 show_help_echo (help, window, object, position, 0);
3167 3180
3168 /* We stopped being idle for this event; undo that. */ 3181 /* We stopped being idle for this event; undo that. */
3169 timer_resume_idle (); 3182 if (!end_time)
3183 timer_resume_idle ();
3170 goto retry; 3184 goto retry;
3171 } 3185 }
3172 3186
@@ -3952,13 +3966,15 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
3952 { 3966 {
3953 EMACS_TIME duration; 3967 EMACS_TIME duration;
3954 EMACS_GET_TIME (duration); 3968 EMACS_GET_TIME (duration);
3955 EMACS_SUB_TIME (duration, *end_time, duration); 3969 if (EMACS_TIME_GE (duration, *end_time))
3956 if (EMACS_TIME_NEG_P (duration)) 3970 return Qnil; /* finished waiting */
3957 return Qnil;
3958 else 3971 else
3959 wait_reading_process_output (EMACS_SECS (duration), 3972 {
3960 EMACS_USECS (duration), 3973 EMACS_SUB_TIME (duration, *end_time, duration);
3961 -1, 1, Qnil, NULL, 0); 3974 wait_reading_process_output (EMACS_SECS (duration),
3975 EMACS_USECS (duration),
3976 -1, 1, Qnil, NULL, 0);
3977 }
3962 } 3978 }
3963 else 3979 else
3964 wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0); 3980 wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0);
@@ -6920,6 +6936,8 @@ input_available_signal (signo)
6920 SIGNAL_THREAD_CHECK (signo); 6936 SIGNAL_THREAD_CHECK (signo);
6921#endif 6937#endif
6922 6938
6939 in_sighandler = 1;
6940
6923 if (input_available_clear_time) 6941 if (input_available_clear_time)
6924 EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); 6942 EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0);
6925 6943
@@ -6931,6 +6949,7 @@ input_available_signal (signo)
6931 sigfree (); 6949 sigfree ();
6932#endif 6950#endif
6933 errno = old_errno; 6951 errno = old_errno;
6952 in_sighandler = 0;
6934} 6953}
6935#endif /* SIGIO */ 6954#endif /* SIGIO */
6936 6955
@@ -8381,7 +8400,15 @@ follow_key (key, nmaps, current, defs, next)
8381 such as Vfunction_key_map and Vkey_translation_map. */ 8400 such as Vfunction_key_map and Vkey_translation_map. */
8382typedef struct keyremap 8401typedef struct keyremap
8383{ 8402{
8384 Lisp_Object map, parent; 8403 /* This is the map originally specified for this use. */
8404 Lisp_Object parent;
8405 /* This is a submap reached by looking up, in PARENT,
8406 the events from START to END. */
8407 Lisp_Object map;
8408 /* Positions [START, END) in the key sequence buffer
8409 are the key that we have scanned so far.
8410 Those events are the ones that we will replace
8411 if PAREHT maps them into a key sequence. */
8385 int start, end; 8412 int start, end;
8386} keyremap; 8413} keyremap;
8387 8414
@@ -8454,7 +8481,11 @@ keyremap_step (keybuf, bufsize, fkey, input, doit, diff, prompt)
8454 Lisp_Object next, key; 8481 Lisp_Object next, key;
8455 8482
8456 key = keybuf[fkey->end++]; 8483 key = keybuf[fkey->end++];
8457 next = access_keymap_keyremap (fkey->map, key, prompt, doit); 8484
8485 if (KEYMAPP (fkey->parent))
8486 next = access_keymap_keyremap (fkey->map, key, prompt, doit);
8487 else
8488 next = Qnil;
8458 8489
8459 /* If keybuf[fkey->start..fkey->end] is bound in the 8490 /* If keybuf[fkey->start..fkey->end] is bound in the
8460 map and we're in a position to do the key remapping, replace it with 8491 map and we're in a position to do the key remapping, replace it with
@@ -8652,9 +8683,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
8652 delayed_switch_frame = Qnil; 8683 delayed_switch_frame = Qnil;
8653 fkey.map = fkey.parent = Vfunction_key_map; 8684 fkey.map = fkey.parent = Vfunction_key_map;
8654 keytran.map = keytran.parent = Vkey_translation_map; 8685 keytran.map = keytran.parent = Vkey_translation_map;
8655 /* If there is no translation-map, turn off scanning. */ 8686 fkey.start = fkey.end = 0;
8656 fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; 8687 keytran.start = keytran.end = 0;
8657 keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1;
8658 8688
8659 if (INTERACTIVE) 8689 if (INTERACTIVE)
8660 { 8690 {
@@ -9481,8 +9511,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
9481 9511
9482 keybuf[t - 1] = new_key; 9512 keybuf[t - 1] = new_key;
9483 mock_input = max (t, mock_input); 9513 mock_input = max (t, mock_input);
9484 fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; 9514 fkey.start = fkey.end = 0;
9485 keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; 9515 keytran.start = keytran.end = 0;
9486 9516
9487 goto replay_sequence; 9517 goto replay_sequence;
9488 } 9518 }
@@ -10786,6 +10816,7 @@ init_keyboard ()
10786 do_mouse_tracking = Qnil; 10816 do_mouse_tracking = Qnil;
10787#endif 10817#endif
10788 input_pending = 0; 10818 input_pending = 0;
10819 in_sighandler = 0;
10789 10820
10790 /* This means that command_loop_1 won't try to select anything the first 10821 /* This means that command_loop_1 won't try to select anything the first
10791 time through. */ 10822 time through. */
diff --git a/src/keyboard.h b/src/keyboard.h
index 96ac7d2e856..f8d8f789c08 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -190,6 +190,9 @@ extern EMACS_INT num_nonmacro_input_events;
190/* Nonzero means polling for input is temporarily suppressed. */ 190/* Nonzero means polling for input is temporarily suppressed. */
191extern int poll_suppress_count; 191extern int poll_suppress_count;
192 192
193/* Nonzero if we are executing from the SIGIO signal handler. */
194extern int in_sighandler;
195
193/* Keymap mapping ASCII function key sequences onto their preferred forms. 196/* Keymap mapping ASCII function key sequences onto their preferred forms.
194 Initialized by the terminal-specific lisp files. */ 197 Initialized by the terminal-specific lisp files. */
195extern Lisp_Object Vfunction_key_map; 198extern Lisp_Object Vfunction_key_map;
diff --git a/src/print.c b/src/print.c
index 6fdd41ada04..80fe22c7149 100644
--- a/src/print.c
+++ b/src/print.c
@@ -924,6 +924,15 @@ to make it write to the debugging output. */)
924 return character; 924 return character;
925} 925}
926 926
927/* This function is never called. Its purpose is to prevent
928 print_output_debug_flag from being optimized away. */
929
930void
931debug_output_compilation_hack (x)
932 int x;
933{
934 print_output_debug_flag = x;
935}
927 936
928#if defined(GNU_LINUX) 937#if defined(GNU_LINUX)
929 938
diff --git a/src/puresize.h b/src/puresize.h
index bae7cbb6d6a..5dd374af207 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA. */
43#endif 43#endif
44 44
45#ifndef BASE_PURESIZE 45#ifndef BASE_PURESIZE
46#define BASE_PURESIZE (1102000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) 46#define BASE_PURESIZE (1120000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
47#endif 47#endif
48 48
49/* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ 49/* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */
diff --git a/src/w32.c b/src/w32.c
index c093eab599e..0da908ff932 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -323,6 +323,28 @@ w32_strerror (int error_no)
323 return buf; 323 return buf;
324} 324}
325 325
326/* Return 1 if P is a valid pointer to an object of size SIZE. Return
327 0 if P is NOT a valid pointer. Return -1 if we cannot validate P.
328
329 This is called from alloc.c:valid_pointer_p. */
330int
331w32_valid_pointer_p (void *p, int size)
332{
333 SIZE_T done;
334 HANDLE h = OpenProcess (PROCESS_VM_READ, FALSE, GetCurrentProcessId ());
335
336 if (h)
337 {
338 unsigned char *buf = alloca (size);
339 int retval = ReadProcessMemory (h, p, buf, size, &done);
340
341 CloseHandle (h);
342 return retval;
343 }
344 else
345 return -1;
346}
347
326static char startup_dir[MAXPATHLEN]; 348static char startup_dir[MAXPATHLEN];
327 349
328/* Get the current working directory. */ 350/* Get the current working directory. */
diff --git a/src/w32.h b/src/w32.h
index 1d5dbee6d40..6ba25a42403 100644
--- a/src/w32.h
+++ b/src/w32.h
@@ -110,6 +110,9 @@ extern void delete_child (child_process *cp);
110/* Equivalent of strerror for W32 error codes. */ 110/* Equivalent of strerror for W32 error codes. */
111extern char * w32_strerror (int error_no); 111extern char * w32_strerror (int error_no);
112 112
113/* Validate a pointer. */
114extern int w32_valid_pointer_p (void *, int);
115
113/* Get long (aka "true") form of file name, if it exists. */ 116/* Get long (aka "true") form of file name, if it exists. */
114extern BOOL w32_get_long_filename (char * name, char * buf, int size); 117extern BOOL w32_get_long_filename (char * name, char * buf, int size);
115 118
diff --git a/src/w32fns.c b/src/w32fns.c
index 9c0198f288d..f0060de7933 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -2067,7 +2067,8 @@ w32_createwindow (f)
2067{ 2067{
2068 HWND hwnd; 2068 HWND hwnd;
2069 RECT rect; 2069 RECT rect;
2070 Lisp_Object top, left; 2070 Lisp_Object top = Qunbound;
2071 Lisp_Object left = Qunbound;
2071 2072
2072 rect.left = rect.top = 0; 2073 rect.left = rect.top = 0;
2073 rect.right = FRAME_PIXEL_WIDTH (f); 2074 rect.right = FRAME_PIXEL_WIDTH (f);
@@ -2080,13 +2081,41 @@ w32_createwindow (f)
2080 2081
2081 if (!hprevinst) 2082 if (!hprevinst)
2082 { 2083 {
2084 Lisp_Object ifa;
2085
2083 w32_init_class (hinst); 2086 w32_init_class (hinst);
2087
2088 /* Handle the -geometry command line option and the geometry
2089 settings in the registry. They are decoded and put into
2090 initial-frame-alist by w32-win.el:x-handle-geometry. */
2091 ifa = Fsymbol_value (intern ("initial-frame-alist"));
2092 if (CONSP (ifa))
2093 {
2094 Lisp_Object lt = Fassq (Qleft, ifa);
2095 Lisp_Object tp = Fassq (Qtop, ifa);
2096
2097 if (!NILP (lt))
2098 {
2099 lt = XCDR (lt);
2100 if (INTEGERP (lt))
2101 left = lt;
2102 }
2103 if (!NILP (tp))
2104 {
2105 tp = XCDR (tp);
2106 if (INTEGERP (tp))
2107 top = tp;
2108 }
2109 }
2084 } 2110 }
2085 2111
2086 /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero 2112 if (EQ (left, Qunbound) && EQ (top, Qunbound))
2087 for anything that is not a number and is not Qunbound. */ 2113 {
2088 left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); 2114 /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero
2089 top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); 2115 for anything that is not a number and is not Qunbound. */
2116 left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER);
2117 top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER);
2118 }
2090 2119
2091 FRAME_W32_WINDOW (f) = hwnd 2120 FRAME_W32_WINDOW (f) = hwnd
2092 = CreateWindow (EMACS_CLASS, 2121 = CreateWindow (EMACS_CLASS,
@@ -6269,7 +6298,7 @@ w32_query_font (struct frame *f, char *fontname)
6269 6298
6270 for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++) 6299 for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++)
6271 { 6300 {
6272 if (strcmp(pfi->name, fontname) == 0) return pfi; 6301 if (stricmp(pfi->name, fontname) == 0) return pfi;
6273 } 6302 }
6274 6303
6275 return NULL; 6304 return NULL;
diff --git a/src/w32menu.c b/src/w32menu.c
index 389e6c5b856..11af1d66b6f 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -1994,6 +1994,9 @@ w32_menu_show (f, x, y, for_click, keymaps, title, error)
1994 } 1994 }
1995 } 1995 }
1996 } 1996 }
1997 else if (!for_click)
1998 /* Make "Cancel" equivalent to C-g. */
1999 Fsignal (Qquit, Qnil);
1997 2000
1998 return Qnil; 2001 return Qnil;
1999} 2002}
@@ -2186,6 +2189,9 @@ w32_dialog_show (f, keymaps, title, header, error)
2186 } 2189 }
2187 } 2190 }
2188 } 2191 }
2192 else
2193 /* Make "Cancel" equivalent to C-g. */
2194 Fsignal (Qquit, Qnil);
2189 2195
2190 return Qnil; 2196 return Qnil;
2191} 2197}
diff --git a/src/xselect.c b/src/xselect.c
index fcac2860359..013a52dbdb1 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2677,8 +2677,48 @@ If the value is 0 or the atom is not known, return the empty string. */)
2677 return ret; 2677 return ret;
2678} 2678}
2679 2679
2680/* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. 2680DEFUN ("x-register-dnd-atom", Fx_register_dnd_atom,
2681 TODO: Check if this client event really is a DND event? */ 2681 Sx_register_dnd_atom, 1, 2, 0,
2682 doc: /* Request that dnd events are made for ClientMessages with ATOM.
2683ATOM can be a symbol or a string. The ATOM is interned on the display that
2684FRAME is on. If FRAME is nil, the selected frame is used. */)
2685 (atom, frame)
2686 Lisp_Object atom, frame;
2687{
2688 Atom x_atom;
2689 struct frame *f = check_x_frame (frame);
2690 size_t i;
2691 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
2692
2693
2694 if (SYMBOLP (atom))
2695 x_atom = symbol_to_x_atom (dpyinfo, FRAME_X_DISPLAY (f), atom);
2696 else if (STRINGP (atom))
2697 {
2698 BLOCK_INPUT;
2699 x_atom = XInternAtom (FRAME_X_DISPLAY (f), (char *) SDATA (atom), False);
2700 UNBLOCK_INPUT;
2701 }
2702 else
2703 error ("ATOM must be a symbol or a string");
2704
2705 for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i)
2706 if (dpyinfo->x_dnd_atoms[i] == x_atom)
2707 return Qnil;
2708
2709 if (dpyinfo->x_dnd_atoms_length == dpyinfo->x_dnd_atoms_size)
2710 {
2711 dpyinfo->x_dnd_atoms_size *= 2;
2712 dpyinfo->x_dnd_atoms = xrealloc (dpyinfo->x_dnd_atoms,
2713 sizeof (*dpyinfo->x_dnd_atoms)
2714 * dpyinfo->x_dnd_atoms_size);
2715 }
2716
2717 dpyinfo->x_dnd_atoms[dpyinfo->x_dnd_atoms_length++] = x_atom;
2718 return Qnil;
2719}
2720
2721/* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. */
2682 2722
2683int 2723int
2684x_handle_dnd_message (f, event, dpyinfo, bufp) 2724x_handle_dnd_message (f, event, dpyinfo, bufp)
@@ -2694,6 +2734,12 @@ x_handle_dnd_message (f, event, dpyinfo, bufp)
2694 int x, y; 2734 int x, y;
2695 unsigned char *data = (unsigned char *) event->data.b; 2735 unsigned char *data = (unsigned char *) event->data.b;
2696 int idata[5]; 2736 int idata[5];
2737 size_t i;
2738
2739 for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i)
2740 if (dpyinfo->x_dnd_atoms[i] == event->message_type) break;
2741
2742 if (i == dpyinfo->x_dnd_atoms_length) return 0;
2697 2743
2698 XSETFRAME (frame, f); 2744 XSETFRAME (frame, f);
2699 2745
@@ -2867,6 +2913,7 @@ syms_of_xselect ()
2867 2913
2868 defsubr (&Sx_get_atom_name); 2914 defsubr (&Sx_get_atom_name);
2869 defsubr (&Sx_send_client_message); 2915 defsubr (&Sx_send_client_message);
2916 defsubr (&Sx_register_dnd_atom);
2870 2917
2871 reading_selection_reply = Fcons (Qnil, Qnil); 2918 reading_selection_reply = Fcons (Qnil, Qnil);
2872 staticpro (&reading_selection_reply); 2919 staticpro (&reading_selection_reply);
diff --git a/src/xterm.c b/src/xterm.c
index 126d954a3a4..9cd945ae63b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -10362,8 +10362,8 @@ x_query_font (f, fontname)
10362 10362
10363 for (i = 0; i < dpyinfo->n_fonts; i++) 10363 for (i = 0; i < dpyinfo->n_fonts; i++)
10364 if (dpyinfo->font_table[i].name 10364 if (dpyinfo->font_table[i].name
10365 && (!strcmp (dpyinfo->font_table[i].name, fontname) 10365 && (!strcasecmp (dpyinfo->font_table[i].name, fontname)
10366 || !strcmp (dpyinfo->font_table[i].full_name, fontname))) 10366 || !strcasecmp (dpyinfo->font_table[i].full_name, fontname)))
10367 return (dpyinfo->font_table + i); 10367 return (dpyinfo->font_table + i);
10368 return NULL; 10368 return NULL;
10369} 10369}
@@ -11044,6 +11044,11 @@ x_term_init (display_name, xrm_option, resource_name)
11044 11044
11045 dpyinfo->cut_buffers_initialized = 0; 11045 dpyinfo->cut_buffers_initialized = 0;
11046 11046
11047 dpyinfo->x_dnd_atoms_size = 8;
11048 dpyinfo->x_dnd_atoms_length = 0;
11049 dpyinfo->x_dnd_atoms = xmalloc (sizeof (*dpyinfo->x_dnd_atoms)
11050 * dpyinfo->x_dnd_atoms_size);
11051
11047 connection = ConnectionNumber (dpyinfo->display); 11052 connection = ConnectionNumber (dpyinfo->display);
11048 dpyinfo->connection = connection; 11053 dpyinfo->connection = connection;
11049 11054
diff --git a/src/xterm.h b/src/xterm.h
index 8bc9782b02b..1c5d215f864 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -389,6 +389,12 @@ struct x_display_info
389 X_WMTYPE_A, 389 X_WMTYPE_A,
390 X_WMTYPE_B 390 X_WMTYPE_B
391 } wm_type; 391 } wm_type;
392
393
394 /* Atoms that are drag and drop atoms */
395 Atom *x_dnd_atoms;
396 size_t x_dnd_atoms_size;
397 size_t x_dnd_atoms_length;
392}; 398};
393 399
394#ifdef HAVE_X_I18N 400#ifdef HAVE_X_I18N