diff options
| author | Karoly Lorentey | 2006-10-14 16:56:21 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-10-14 16:56:21 +0000 |
| commit | 3f87f67ee215ffeecbd2f53bd7f342cdf03f47df (patch) | |
| tree | 16f2af9111af08a94d608d96a957f5c3ec5effcc | |
| parent | 350e4fb815d7413ef6d339dd664014706f742927 (diff) | |
| parent | 7a210b69c7f92650c524766d1b9d3f3eefdd67c7 (diff) | |
| download | emacs-3f87f67ee215ffeecbd2f53bd7f342cdf03f47df.tar.gz emacs-3f87f67ee215ffeecbd2f53bd7f342cdf03f47df.zip | |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-371
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-372
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-373
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-374
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-375
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-376
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-377
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-378
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-379
Merge from erc--emacs--21
* emacs@sv.gnu.org/emacs--devo--0--patch-380
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-381
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-382
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-383
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-384
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-385
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-386
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-387
Fix ERC bug introduced in last patch
* emacs@sv.gnu.org/emacs--devo--0--patch-388
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-389
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-390
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-391
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-392
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-393
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-394
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-395
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-396
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-397
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-398
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-399
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-400
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-401
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-402
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-403
Rcirc update from Ryan Yeske
* emacs@sv.gnu.org/emacs--devo--0--patch-404
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-405
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-406
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-407
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-408
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-409
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-410
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-411
Miscellaneous tq-related fixes.
* emacs@sv.gnu.org/emacs--devo--0--patch-412
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-121
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-122
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-123
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-124
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-125
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-126
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-127
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-581
175 files changed, 8088 insertions, 11133 deletions
| @@ -1,3 +1,12 @@ | |||
| 1 | 2006-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 | |||
| 6 | 2006-08-16 Richard Stallman <rms@gnu.org> | ||
| 7 | |||
| 8 | * INSTALL.CVS: Clean up wording. | ||
| 9 | |||
| 1 | 2006-07-14 Eli Zaretskii <eliz@gnu.org> | 10 | 2006-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 | |||
| 12 | before it builds the final Emacs binary. | 12 | before it builds the final Emacs binary. |
| 13 | 13 | ||
| 14 | Normally, it is not necessary to use "make bootstrap" after every CVS | 14 | Normally, it is not necessary to use "make bootstrap" after every CVS |
| 15 | update. Unless there are problems, we suggest the following | 15 | update. Unless there are problems, we suggest using the following |
| 16 | procedure: | 16 | alternative procedure after you have done "make bootstrap" at least |
| 17 | once: | ||
| 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 @@ | |||
| 1 | 2006-08-13 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * FOR-RELEASE: Elisp manual checking completed. | ||
| 4 | |||
| 1 | 2006-07-17 Reiner Steib <Reiner.Steib@gmx.de> | 5 | 2006-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 13469376c9b..13c6e13bac5 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE | |||
| @@ -29,7 +29,9 @@ Reminders sent out on 2006-06-08. | |||
| 29 | ** Send an email to the various distributions, including the GNOME | 29 | ** Send an email to the various distributions, including the GNOME |
| 30 | and KDE projects, to use the new Emacs icons in etc/images/icons. | 30 | and KDE projects, to use the new Emacs icons in etc/images/icons. |
| 31 | 31 | ||
| 32 | * BUGS | 32 | * WINDOWS SUPPORT BUGS. |
| 33 | These don't need to be fixed to start pretest, but we call the | ||
| 34 | attention of Windows users to fixing them. | ||
| 33 | 35 | ||
| 34 | ** Markus Gritsch's report about Emacs looping on Windoze with the following | 36 | ** Markus Gritsch's report about Emacs looping on Windoze with the following |
| 35 | .emacs file, and then reduce Emacs frame width to "something quite narrow": | 37 | .emacs file, and then reduce Emacs frame width to "something quite narrow": |
| @@ -39,73 +41,23 @@ and KDE projects, to use the new Emacs icons in etc/images/icons. | |||
| 39 | '(hscroll-step 1) | 41 | '(hscroll-step 1) |
| 40 | ) | 42 | ) |
| 41 | 43 | ||
| 42 | ** David Kastrup's report on strange scrolling of large images. | 44 | ** Drew Adams 12 Aug bug rpt: overlay display artifact: trace left behind |
| 45 | Windows only bug. | ||
| 46 | |||
| 47 | * BUGS | ||
| 48 | |||
| 49 | ** Milan Zamazal's Aug 23 bug report about crashes with certain fonts. | ||
| 43 | 50 | ||
| 44 | ** Jorgen Schaefer <forcer@forcix.cx>'s June 18 bug report about | 51 | ** C-g fails to interrupt accept-process-output in Gnus. |
| 45 | fields and invisible overlays needs attention from a field expert. | ||
| 46 | 52 | ||
| 47 | ** Implement buffer-chars-modified-tick. | 53 | ** Implement buffer-chars-modified-tick. |
| 48 | 54 | ||
| 49 | * DOCUMENTATION | 55 | ** henman@it.to-be.co.jp 09 Aug 2006: ispell.el problem. |
| 50 | 56 | ||
| 51 | ** Check the Emacs Lisp manual. | 57 | ** Make key-binding use the maps specified by positions given in the events. |
| 52 | 58 | ||
| 53 | Each manual section should be checked for factual correctness | ||
| 54 | regarding recent changes by at least two people. After each file | ||
| 55 | name, on the same line or the following line, come the names of the | ||
| 56 | people who have checked it. | ||
| 57 | 59 | ||
| 58 | SECTION READERS | 60 | * DOCUMENTATION |
| 59 | ---------------------------------- | ||
| 60 | lispref/abbrevs.texi "Luc Teirlinck" Chong Yidong | ||
| 61 | lispref/advice.texi Joakim Verona Chong Yidong | ||
| 62 | lispref/anti.texi Chong Yidong Kim F. Storm | ||
| 63 | lispref/backups.texi "Luc Teirlinck" Chong Yidong | ||
| 64 | lispref/buffers.texi "Luc Teirlinck" Chong Yidong | ||
| 65 | lispref/calendar.texi Joakim Verona Chong Yidong | ||
| 66 | lispref/commands.texi "Luc Teirlinck" Chong Yidong | ||
| 67 | lispref/compile.texi "Luc Teirlinck" Chong Yidong | ||
| 68 | lispref/control.texi "Luc Teirlinck" Chong Yidong | ||
| 69 | lispref/customize.texi Chong Yidong "Luc Teirlinck" | ||
| 70 | lispref/debugging.texi Joakim Verona Lute Kamstra | ||
| 71 | lispref/display.texi Chong Yidong Jason Rumney | ||
| 72 | lispref/edebug.texi Chong Yidong "Luc Teirlinck" | ||
| 73 | lispref/elisp.texi "Luc Teirlinck" Lute Kamstra | ||
| 74 | lispref/errors.texi "Luc Teirlinck" Chong Yidong | ||
| 75 | lispref/eval.texi "Luc Teirlinck" Chong Yidong | ||
| 76 | lispref/files.texi "Luc Teirlinck" Chong Yidong | ||
| 77 | lispref/frames.texi "Luc Teirlinck" Chong Yidong | ||
| 78 | lispref/functions.texi "Luc Teirlinck" Chong Yidong | ||
| 79 | lispref/hash.texi "Luc Teirlinck" Chong Yidong | ||
| 80 | lispref/help.texi "Luc Teirlinck" Chong Yidong | ||
| 81 | lispref/hooks.texi Lute Kamstra Chong Yidong | ||
| 82 | lispref/internals.texi "Luc Teirlinck" Chong Yidong | ||
| 83 | lispref/intro.texi "Luc Teirlinck" Josh Varner | ||
| 84 | lispref/keymaps.texi "Luc Teirlinck" Chong Yidong | ||
| 85 | lispref/lists.texi "Luc Teirlinck" Chong Yidong | ||
| 86 | lispref/loading.texi "Luc Teirlinck" Chong Yidong | ||
| 87 | lispref/locals.texi Chong Yidong Nick Roberts | ||
| 88 | lispref/macros.texi "Luc Teirlinck" Chong Yidong | ||
| 89 | lispref/maps.texi Chong Yidong Kim F. Storm | ||
| 90 | lispref/markers.texi "Luc Teirlinck" Chong Yidong | ||
| 91 | lispref/minibuf.texi "Luc Teirlinck" Chong Yidong | ||
| 92 | lispref/modes.texi Chong Yidong | ||
| 93 | lispref/nonascii.texi "Luc Teirlinck" Chong Yidong | ||
| 94 | lispref/numbers.texi "Luc Teirlinck" Chong Yidong | ||
| 95 | lispref/objects.texi "Luc Teirlinck" Chong Yidong | ||
| 96 | lispref/os.texi "Luc Teirlinck" Chong Yidong | ||
| 97 | lispref/positions.texi "Luc Teirlinck" Chong Yidong | ||
| 98 | lispref/processes.texi Chong Yidong ttn | ||
| 99 | lispref/searching.texi "Luc Teirlinck" Chong Yidong | ||
| 100 | lispref/sequences.texi "Luc Teirlinck" Chong Yidong | ||
| 101 | lispref/streams.texi "Luc Teirlinck" Chong Yidong | ||
| 102 | lispref/strings.texi "Luc Teirlinck" Chong Yidong | ||
| 103 | lispref/symbols.texi "Luc Teirlinck" Chong Yidong | ||
| 104 | lispref/syntax.texi "Luc Teirlinck" Chong Yidong | ||
| 105 | lispref/text.texi Chong Yidong | ||
| 106 | lispref/tips.texi "Luc Teirlinck" Chong Yidong | ||
| 107 | lispref/variables.texi "Luc Teirlinck" Chong Yidong | ||
| 108 | lispref/windows.texi "Luc Teirlinck" Chong Yidong | ||
| 109 | 61 | ||
| 110 | ** Check the Emacs Tutorial. | 62 | ** Check the Emacs Tutorial. |
| 111 | 63 | ||
diff --git a/configure.in b/configure.in index 1dd45cc6676..307208918ec 100644 --- a/configure.in +++ b/configure.in | |||
| @@ -1500,7 +1500,7 @@ AC_DEFUN([PKG_CHECK_MODULES], [ | |||
| 1500 | if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then | 1500 | if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then |
| 1501 | AC_MSG_CHECKING(for $2) | 1501 | AC_MSG_CHECKING(for $2) |
| 1502 | 1502 | ||
| 1503 | if $PKG_CONFIG --exists "$2" 2>&5; then | 1503 | if $PKG_CONFIG --exists "$2" 2>&AS_MESSAGE_LOG_FD; then |
| 1504 | AC_MSG_RESULT(yes) | 1504 | AC_MSG_RESULT(yes) |
| 1505 | succeeded=yes | 1505 | succeeded=yes |
| 1506 | 1506 | ||
diff --git a/etc/ChangeLog b/etc/ChangeLog index 627d536ee69..100460e9b93 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,79 @@ | |||
| 1 | 2006-08-25 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * TUTORIAL: Give priority to graphical terminals over text terminals | ||
| 4 | regarding C-z. | ||
| 5 | |||
| 6 | 2006-08-21 Sun Yijiang <sunyijiang@gmail.com> | ||
| 7 | |||
| 8 | * TUTORIAL.cn: Sync with the latest TUTORIAL. | ||
| 9 | |||
| 10 | 2006-08-20 Dave Love <fx@gnu.org> | ||
| 11 | |||
| 12 | * emacs.py: Update to Dave Love's latest version. | ||
| 13 | (__all__): Fix args -> eargs. Add new `modpath' fun. | ||
| 14 | (eargs): Add `imports' arg. | ||
| 15 | (all_names): New fun. | ||
| 16 | (complete): Rewrite without using rlcompleter. | ||
| 17 | Remove `namespace' arg, add `imports' arg. | ||
| 18 | (ehelp): Replace g and l args with `imports'. | ||
| 19 | (eimport): Use __main__ rather than `emacs' namespace. | ||
| 20 | (modpath): New fun. | ||
| 21 | |||
| 22 | 2006-08-20 Slawomir Nowaczyk <slawomir.nowaczyk.847@student.lu.se> (tiny change) | ||
| 23 | |||
| 24 | * emacs.py (eexecfile): Use the __main__ rather than `emacs' namespace. | ||
| 25 | |||
| 26 | 2006-08-18 Primoz PETERLIN <primoz.peterlin@mf.uni-lj.si> | ||
| 27 | |||
| 28 | * TUTORIAL.sl: Synchronize with TUTORIAL. | ||
| 29 | |||
| 30 | 2006-08-18 Mats Lidell <matsl@contactor.se> | ||
| 31 | |||
| 32 | * TUTORIAL.sv: Synchronize with TUTORIAL. | ||
| 33 | |||
| 34 | 2006-08-18 Alfredo Finelli <alfredofnl@tiscali.it> | ||
| 35 | |||
| 36 | * TUTORIAL.it: Synchronize with TUTORIAL. | ||
| 37 | |||
| 38 | 2006-08-15 Carsten Dominik <dominik@science.uva.nl> | ||
| 39 | |||
| 40 | * orgcard.tex: Version number change. | ||
| 41 | |||
| 42 | 2006-08-12 Werner Lemberg <wl@gnu.org> | ||
| 43 | |||
| 44 | * TUTORIAL.de: Synchronize with TUTORIAL. | ||
| 45 | |||
| 46 | 2006-08-10 Romain Francoise <romain@orebokech.com> | ||
| 47 | |||
| 48 | * NEWS: Mention that zone-mode.el is now obsolete. | ||
| 49 | |||
| 50 | 2006-08-09 Richard Stallman <rms@gnu.org> | ||
| 51 | |||
| 52 | * TUTORIAL: Don't say which side scroll bar is on. | ||
| 53 | |||
| 54 | 2006-08-06 Nick Roberts <nickrob@snap.net.nz> | ||
| 55 | |||
| 56 | * DEBUG (Note): Add note about following a longjmp call. | ||
| 57 | Add local variables list for outline mode. | ||
| 58 | |||
| 59 | 2006-08-03 Michael Olson <mwolson@gnu.org> | ||
| 60 | |||
| 61 | * ERC-NEWS: Update for ERC 5.1.4. | ||
| 62 | |||
| 63 | 2006-08-01 Kenichi Handa <handa@m17n.org> | ||
| 64 | |||
| 65 | * NEWS (find-operation-coding-system): Describe the more detail of | ||
| 66 | the change. | ||
| 67 | |||
| 68 | 2006-07-28 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 69 | |||
| 70 | * GNUS-NEWS: Regenerate from Oort Gnus node in texi/gnus.texi using | ||
| 71 | texi/gnus-news.el of the trunk. | ||
| 72 | |||
| 73 | 2006-07-29 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 74 | |||
| 75 | * NEWS: Fix typo. | ||
| 76 | |||
| 1 | 2006-07-17 Reiner Steib <Reiner.Steib@gmx.de> | 77 | 2006-07-17 Reiner Steib <Reiner.Steib@gmx.de> |
| 2 | 78 | ||
| 3 | * ru-refcard.ps: Regenerate. | 79 | * ru-refcard.ps: Regenerate. |
| @@ -168,7 +244,7 @@ | |||
| 168 | 244 | ||
| 169 | 2006-05-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 245 | 2006-05-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 170 | 246 | ||
| 171 | * NEWS: Mention F10 for Gtk+/Leddtif/Lucid menus. | 247 | * NEWS: Mention F10 for Gtk+/Lesstif/Lucid menus. |
| 172 | 248 | ||
| 173 | 2006-05-26 Eli Zaretskii <eliz@gnu.org> | 249 | 2006-05-26 Eli Zaretskii <eliz@gnu.org> |
| 174 | 250 | ||
| @@ -272,6 +272,13 @@ related data structures in a terse and user-friendly format: | |||
| 272 | The above commands also exist in a version with an `x' suffix which | 272 | The above commands also exist in a version with an `x' suffix which |
| 273 | takes an object of the relevant type as argument. | 273 | takes an object of the relevant type as argument. |
| 274 | 274 | ||
| 275 | ** Following longjmp call. | ||
| 276 | |||
| 277 | Recent versions of glibc (2.4+?) encrypt stored values for setjmp/longjmp which | ||
| 278 | prevents GDB from being able to follow a longjmp call using `next'. To | ||
| 279 | disable this protection you need to set the environment variable | ||
| 280 | LD_POINTER_GUARD to 0. | ||
| 281 | |||
| 275 | ** Using GDB in Emacs | 282 | ** Using GDB in Emacs |
| 276 | 283 | ||
| 277 | Debugging with GDB in Emacs offers some advantages over the command line (See | 284 | Debugging 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, | |||
| 739 | and look at those registers directly, to see the actual current values | 746 | and look at those registers directly, to see the actual current values |
| 740 | of these variables. | 747 | of these variables. |
| 741 | 748 | ||
| 749 | |||
| 750 | Local variables: | ||
| 751 | mode: outline | ||
| 752 | paragraph-separate: "[ ]*$" | ||
| 753 | end: | ||
| 754 | |||
| 742 | ;;; arch-tag: fbf32980-e35d-481f-8e4c-a2eca2586e6b | 755 | ;;; arch-tag: fbf32980-e35d-481f-8e4c-a2eca2586e6b |
diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index 778344c68c7..3a026ee1162 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS | |||
| @@ -1,6 +1,27 @@ | |||
| 1 | ERC NEWS -*- outline -*- | 1 | ERC NEWS -*- outline -*- |
| 2 | 2 | ||
| 3 | * Changes in ERC 5.2 (unreleased) | 3 | * Changes in ERC 5.1.4 |
| 4 | |||
| 5 | ** Make find-function and find-variable work in Emacs 22 for | ||
| 6 | names that are constructed by `define-erc-module'. | ||
| 7 | |||
| 8 | ** Fix bug introduced in ERC 5.1.3 that caused messages to go the | ||
| 9 | wrong buffer. | ||
| 10 | |||
| 11 | ** Changes and additions to modules | ||
| 12 | |||
| 13 | *** Highlighting (erc-match.el) | ||
| 14 | |||
| 15 | **** Don't activate view-mode. | ||
| 16 | |||
| 17 | *** Logging (erc-log.el) | ||
| 18 | |||
| 19 | **** When this module is activated, make sure logging is enabled on | ||
| 20 | already-opened buffers. Ditto for disabling logging when the module | ||
| 21 | is deactivated. | ||
| 22 | |||
| 23 | **** Fix some errors that occur when exiting Emacs without first | ||
| 24 | quitting open IRC servers. | ||
| 4 | 25 | ||
| 5 | * Changes in ERC 5.1.3 | 26 | * Changes in ERC 5.1.3 |
| 6 | 27 | ||
diff --git a/etc/GNUS-NEWS b/etc/GNUS-NEWS index f13b4fa5dd3..31f9ad6613e 100644 --- a/etc/GNUS-NEWS +++ b/etc/GNUS-NEWS | |||
| @@ -1,151 +1,200 @@ | |||
| 1 | GNUS NEWS -- history of user-visible changes. | 1 | GNUS NEWS -- history of user-visible changes. |
| 2 | Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, | 2 | Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, |
| 3 | 2005, 2006 Free Software Foundation, Inc. | 3 | 2006 Free Software Foundation, Inc. |
| 4 | See the end for copying conditions. | 4 | See the end for copying conditions. |
| 5 | 5 | ||
| 6 | Please send Gnus bug reports to bugs@gnus.org. | 6 | Please send Gnus bug reports to bugs@gnus.org. |
| 7 | For older news, see Gnus info node "New Features". | 7 | For older news, see Gnus info node "New Features". |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | * Changes in Oort Gnus | 10 | * Installation changes |
| 11 | 11 | ||
| 12 | ** `F' (`gnus-article-followup-with-original') and `R' | 12 | ** Upgrading from previous (stable) version if you have used Oort. |
| 13 | (`gnus-article-reply-with-original') only yank the text in the region if the | ||
| 14 | region is active. | ||
| 15 | 13 | ||
| 16 | ** `gnus-group-read-ephemeral-group' can be called interactively, using `G M'. | 14 | If you have tried Oort (the unstable Gnus branch leading to this |
| 15 | release) but went back to a stable version, be careful when upgrading to | ||
| 16 | this version. In particular, you will probably want to remove all | ||
| 17 | `.marks' (nnml) and `.mrk' (nnfolder) files, so that flags are read from | ||
| 18 | your `.newsrc.eld' instead of from the `.marks'/`.mrk' file where this | ||
| 19 | release store flags. See a later entry for more information about | ||
| 20 | marks. Note that downgrading isn't save in general. | ||
| 17 | 21 | ||
| 18 | ** In draft groups, `e' is now bound to `gnus-draft-edit-message'. | 22 | ** Lisp files are now installed in `.../site-lisp/gnus/' by default. It |
| 19 | Use `B w' for `gnus-summary-edit-article' instead. | 23 | defaulted to `.../site-lisp/' formerly. In addition to this, the new |
| 24 | installer issues a warning if other Gnus installations which will shadow | ||
| 25 | the latest one are detected. You can then remove those shadows manually | ||
| 26 | or remove them using `make remove-installed-shadows'. | ||
| 20 | 27 | ||
| 21 | ** The revised Gnus FAQ is included in the manual. | 28 | ** New `make.bat' for compiling and installing Gnus under MS Windows |
| 22 | See the info node "Frequently Asked Questions". | ||
| 23 | 29 | ||
| 24 | ** Upgrading from previous (stable) version if you have used Oort. | 30 | Use `make.bat' if you want to install Gnus under MS Windows, the first |
| 31 | argument to the batch-program should be the directory where `xemacs.exe' | ||
| 32 | respectively `emacs.exe' is located, iff you want to install Gnus after | ||
| 33 | compiling it, give `make.bat' `/copy' as the second parameter. | ||
| 25 | 34 | ||
| 26 | If you have tried Oort (the unstable Gnus branch leading to this | 35 | `make.bat' has been rewritten from scratch, it now features automatic |
| 27 | release) but went back to a stable version, be careful when upgrading | 36 | recognition of XEmacs and GNU Emacs, generates `gnus-load.el', checks if |
| 28 | to this version. In particular, you will probably want to remove all | 37 | errors occur while compilation and generation of info files and reports |
| 29 | .marks (nnml) and .mrk (nnfolder) files, so that flags are read from | 38 | them at the end of the build process. It now uses `makeinfo' if it is |
| 30 | your ~/.newsrc.eld instead of from the .marks/.mrk file where this | 39 | available and falls back to `infohack.el' otherwise. `make.bat' should |
| 31 | release store flags. See a later entry for more information about | 40 | now install all files which are necessary to run Gnus and be generally a |
| 32 | marks. Note that downgrading isn't safe in general. | 41 | complete replacement for the `configure; make; make install' cycle used |
| 42 | under Unix systems. | ||
| 33 | 43 | ||
| 34 | ** Article Buttons | 44 | The new `make.bat' makes `make-x.bat' and `xemacs.mak' superfluous, so |
| 45 | they have been removed. | ||
| 35 | 46 | ||
| 36 | More buttons for URLs, mail addresses, Message-IDs, Info links, man pages and | 47 | ** `~/News/overview/' not used. |
| 37 | Emacs or Gnus related references, see the info node "Article Buttons". The | ||
| 38 | variables `gnus-button-*-level' can be used to control the appearance of all | ||
| 39 | article buttons, see the info node "Article Button Levels". | ||
| 40 | 48 | ||
| 41 | ** Dired integration | 49 | As a result of the following change, the `~/News/overview/' directory is |
| 50 | not used any more. You can safely delete the entire hierarchy. | ||
| 42 | 51 | ||
| 43 | `gnus-dired-minor-mode' installs key bindings in dired buffers to send a file | 52 | ** `(require 'gnus-load)' |
| 44 | as an attachment (`C-c C-m C-a'), open a file using the approriate mailcap | ||
| 45 | entry (`C-c C-m C-l'), and print a file using the mailcap entry (`C-c C-m | ||
| 46 | C-p'). See the info node "Other modes". | ||
| 47 | 53 | ||
| 54 | If you use a stand-alone Gnus distribution, you'd better add `(require | ||
| 55 | 'gnus-load)' into your `~/.emacs' after adding the Gnus lisp directory | ||
| 56 | into load-path. | ||
| 48 | 57 | ||
| 49 | ** Gnus can display RSS newsfeeds as a newsgroup. To get started do `B | 58 | File `gnus-load.el' contains autoload commands, functions and variables, |
| 50 | nnrss RET RET' in the Group buffer. | 59 | some of which may not be included in distributions of Emacsen. |
| 51 | 60 | ||
| 52 | ** Single-part yenc encoded attachments can be decoded. | ||
| 53 | 61 | ||
| 54 | ** Picons | 62 | |
| 55 | The picons code has been reimplemented to work in Emacs 21 -- some of | 63 | * New packages and libraries within Gnus |
| 56 | the previous options have been removed or renamed. | ||
| 57 | 64 | ||
| 58 | Picons are small "personal icons" representing users, domain and | 65 | ** The revised Gnus FAQ is included in the manual, *Note Frequently Asked |
| 59 | newsgroups, which can be displayed in the Article buffer. To enable | 66 | Questions::. |
| 60 | picons, install the picons database from | 67 | |
| 68 | ** TLS wrapper shipped with Gnus | ||
| 61 | 69 | ||
| 62 | http://www.cs.indiana.edu/picons/ftp/index.html | 70 | TLS/SSL is now supported in IMAP and NNTP via `tls.el' and GNUTLS. The |
| 71 | old TLS/SSL support via (external third party) `ssl.el' and OpenSSL | ||
| 72 | still works. | ||
| 63 | 73 | ||
| 64 | and point `gnus-picon-databases' to that location. | 74 | ** Improved anti-spam features. |
| 75 | |||
| 76 | Gnus is now able to take out spam from your mail and news streams using | ||
| 77 | a wide variety of programs and filter rules. Among the supported | ||
| 78 | methods are RBL blocklists, bogofilter and white/blacklists. Hooks for | ||
| 79 | easy use of external packages such as SpamAssassin and Hashcash are also | ||
| 80 | new. *Note Thwarting Email Spam::. | ||
| 81 | |||
| 82 | ** Gnus supports server-side mail filtering using Sieve. | ||
| 83 | |||
| 84 | Sieve rules can be added as Group Parameters for groups, and the | ||
| 85 | complete Sieve script is generated using `D g' from the Group buffer, | ||
| 86 | and then uploaded to the server using `C-c C-l' in the generated Sieve | ||
| 87 | buffer. *Note Sieve Commands::, and the new Sieve manual *Note Top: | ||
| 88 | (sieve)Top. | ||
| 65 | 89 | ||
| 66 | ** If the new option `gnus-treat-body-boundary' is `head', a boundary | 90 | |
| 67 | line is drawn at the end of the headers. | 91 | |
| 92 | * Changes in group mode | ||
| 93 | |||
| 94 | ** `gnus-group-read-ephemeral-group' can be called interactively, using `G | ||
| 95 | M'. | ||
| 68 | 96 | ||
| 69 | ** Retrieval of charters and control messages | 97 | ** Retrieval of charters and control messages |
| 98 | |||
| 70 | There are new commands for fetching newsgroup charters (`H c') and | 99 | There are new commands for fetching newsgroup charters (`H c') and |
| 71 | control messages (`H C'). | 100 | control messages (`H C'). |
| 72 | 101 | ||
| 73 | ** Delayed articles | 102 | ** The new variable `gnus-parameters' can be used to set group parameters. |
| 74 | You can delay the sending of a message with `C-c C-j' in the Message | ||
| 75 | buffer. The messages are delivered at specified time. This is useful | ||
| 76 | for sending yourself reminders. Setup with (gnus-delay-initialize). | ||
| 77 | 103 | ||
| 78 | ** If `auto-compression-mode' is enabled, attachments are automatically | 104 | Earlier this was done only via `G p' (or `G c'), which stored the |
| 79 | decompressed when activated. | 105 | parameters in `~/.newsrc.eld', but via this variable you can enjoy the |
| 106 | powers of customize, and simplified backups since you set the variable | ||
| 107 | in `~/.gnus.el' instead of `~/.newsrc.eld'. The variable maps regular | ||
| 108 | expressions matching group names to group parameters, a'la: | ||
| 109 | (setq gnus-parameters | ||
| 110 | '(("mail\\..*" | ||
| 111 | (gnus-show-threads nil) | ||
| 112 | (gnus-use-scoring nil)) | ||
| 113 | ("^nnimap:\\(foo.bar\\)$" | ||
| 114 | (to-group . "\\1")))) | ||
| 80 | 115 | ||
| 81 | ** If the new option `nnml-use-compressed-files' is non-nil, | 116 | ** Unread count correct in nnimap groups. |
| 82 | the nnml back end allows compressed message files. | ||
| 83 | 117 | ||
| 84 | ** Signed article headers (X-PGP-Sig) can be verified with `W p'. | 118 | The estimated number of unread articles in the group buffer should now |
| 119 | be correct for nnimap groups. This is achieved by calling | ||
| 120 | `nnimap-fixup-unread-after-getting-new-news' from the | ||
| 121 | `gnus-setup-news-hook' (called on startup) and | ||
| 122 | `gnus-after-getting-new-news-hook'. (called after getting new mail). If | ||
| 123 | you have modified those variables from the default, you may want to add | ||
| 124 | `nnimap-fixup-unread-after-getting-new-news' again. If you were happy | ||
| 125 | with the estimate and want to save some (minimal) time when getting new | ||
| 126 | mail, remove the function. | ||
| 85 | 127 | ||
| 86 | ** The Summary Buffer uses an arrow in the fringe to indicate the | 128 | ** Group names are treated as UTF-8 by default. |
| 87 | current article in Emacs 21 running on a graphical display. Customize | ||
| 88 | `gnus-summary-display-arrow' to disable it. | ||
| 89 | 129 | ||
| 90 | ** Warn about email replies to news | 130 | This is supposedly what USEFOR wanted to migrate to. See |
| 91 | Do you often find yourself replying to news by email by mistake? Then | 131 | `gnus-group-name-charset-group-alist' and |
| 92 | the new option `gnus-confirm-mail-reply-to-news' is just the thing for | 132 | `gnus-group-name-charset-method-alist' for customization. |
| 93 | you. | ||
| 94 | 133 | ||
| 95 | ** If the new option `gnus-summary-display-while-building' is non-nil, | 134 | ** `gnus-group-charset-alist' and `gnus-group-ignored-charsets-alist'. |
| 96 | the summary buffer is shown and updated as it's being built. | ||
| 97 | 135 | ||
| 98 | ** The new `recent' mark "." indicates newly arrived messages (as | 136 | The regexps in these variables are compared with full group names |
| 99 | opposed to old but unread messages). | 137 | instead of real group names in 5.8. Users who customize these variables |
| 138 | should change those regexps accordingly. For example: | ||
| 139 | ("^han\\>" euc-kr) -> ("\\(^\\|:\\)han\\>" euc-kr) | ||
| 100 | 140 | ||
| 101 | ** The new option `gnus-gcc-mark-as-read' automatically marks | ||
| 102 | Gcc articles as read. | ||
| 103 | 141 | ||
| 104 | ** The nndoc back end now supports mailman digests and exim bounces. | 142 | |
| 143 | * Changes in summary and article mode | ||
| 105 | 144 | ||
| 106 | ** Gnus supports RFC 2369 mailing list headers, and adds a number of | 145 | ** `F' (`gnus-article-followup-with-original') and `R' |
| 107 | related commands in mailing list groups. | 146 | (`gnus-article-reply-with-original') only yank the text in the region if |
| 147 | the region is active. | ||
| 108 | 148 | ||
| 109 | ** The Date header can be displayed in a format that can be read aloud | 149 | ** In draft groups, `e' is now bound to `gnus-draft-edit-message'. Use `B |
| 110 | in English, see `gnus-treat-date-english'. | 150 | w' for `gnus-summary-edit-article' instead. |
| 111 | 151 | ||
| 112 | ** The envelope sender address can be customized when using Sendmail, see | 152 | ** Article Buttons |
| 113 | `message-sendmail-envelope-from'. | ||
| 114 | 153 | ||
| 115 | ** diffs are automatically highlighted in groups matching | 154 | More buttons for URLs, mail addresses, Message-IDs, Info links, man |
| 116 | `mm-uu-diff-groups-regexp' | 155 | pages and Emacs or Gnus related references. *Note Article Buttons::. |
| 156 | The variables `gnus-button-*-level' can be used to control the | ||
| 157 | appearance of all article buttons. *Note Article Button Levels::. | ||
| 117 | 158 | ||
| 118 | ** TLS wrapper shipped with Gnus | 159 | ** Single-part yenc encoded attachments can be decoded. |
| 119 | 160 | ||
| 120 | TLS/SSL is now supported in IMAP and NNTP via tls.el and GNUTLS. The | 161 | ** Picons |
| 121 | old TLS/SSL support via (external third party) ssl.el and OpenSSL | ||
| 122 | still works. | ||
| 123 | 162 | ||
| 124 | ** New make.bat for compiling and installing Gnus under MS Windows | 163 | The picons code has been reimplemented to work in GNU Emacs--some of the |
| 164 | previous options have been removed or renamed. | ||
| 125 | 165 | ||
| 126 | Use make.bat if you want to install Gnus under MS Windows, the first | 166 | Picons are small "personal icons" representing users, domain and |
| 127 | argument to the batch-program should be the directory where xemacs.exe | 167 | newsgroups, which can be displayed in the Article buffer. *Note |
| 128 | respectively emacs.exe is located, iff you want to install Gnus after | 168 | Picons::. |
| 129 | compiling it, give make.bat /copy as the second parameter. | ||
| 130 | 169 | ||
| 131 | `make.bat' has been rewritten from scratch, it now features automatic | 170 | ** If the new option `gnus-treat-body-boundary' is non-`nil', a boundary |
| 132 | recognition of XEmacs and GNU Emacs, generates gnus-load.el, checks if | 171 | line is drawn at the end of the headers. |
| 133 | errors occur while compilation and generation of info files and reports | ||
| 134 | them at the end of the build process. It now uses makeinfo if it is | ||
| 135 | available and falls back to infohack.el otherwise. `make.bat' should now | ||
| 136 | install all files which are necessary to run Gnus and be generally a | ||
| 137 | complete replacement for the "configure; make; make install" cycle used | ||
| 138 | under Unix systems. | ||
| 139 | 172 | ||
| 140 | The new make.bat makes make-x.bat superfluous, so it has been removed. | 173 | ** Signed article headers (X-PGP-Sig) can be verified with `W p'. |
| 141 | 174 | ||
| 142 | ** Support for non-ASCII domain names | 175 | ** The Summary Buffer uses an arrow in the fringe to indicate the current |
| 176 | article. Use `(setq gnus-summary-display-arrow nil)' to disable it. | ||
| 143 | 177 | ||
| 144 | Message supports non-ASCII domain names in From:, To: and Cc: and will | 178 | ** Warn about email replies to news |
| 145 | encode them when you try to send a message. The variable | 179 | |
| 146 | `message-use-idna' controls this. Gnus will also decode non-ASCII | 180 | Do you often find yourself replying to news by email by mistake? Then |
| 147 | domain names in From:, To: and Cc: when you view a message. The | 181 | the new option `gnus-confirm-mail-reply-to-news' is just the thing for |
| 148 | variable `gnus-use-idna' controls this. | 182 | you. |
| 183 | |||
| 184 | ** If the new option `gnus-summary-display-while-building' is non-`nil', | ||
| 185 | the summary buffer is shown and updated as it's being built. | ||
| 186 | |||
| 187 | ** The new `recent' mark `.' indicates newly arrived messages (as opposed | ||
| 188 | to old but unread messages). | ||
| 189 | |||
| 190 | ** Gnus supports RFC 2369 mailing list headers, and adds a number of | ||
| 191 | related commands in mailing list groups. *Note Mailing List::. | ||
| 192 | |||
| 193 | ** The Date header can be displayed in a format that can be read aloud in | ||
| 194 | English. *Note Article Date::. | ||
| 195 | |||
| 196 | ** diffs are automatically highlighted in groups matching | ||
| 197 | `mm-uu-diff-groups-regexp' | ||
| 149 | 198 | ||
| 150 | ** Better handling of Microsoft citation styles | 199 | ** Better handling of Microsoft citation styles |
| 151 | 200 | ||
| @@ -155,227 +204,183 @@ though it is not quoted in any way. The variable | |||
| 155 | `gnus-cite-unsightly-citation-regexp' matches the start of these | 204 | `gnus-cite-unsightly-citation-regexp' matches the start of these |
| 156 | citations. | 205 | citations. |
| 157 | 206 | ||
| 158 | ** gnus-article-skip-boring | 207 | The new command `W Y f' (`gnus-article-outlook-deuglify-article') allows |
| 208 | deuglifying broken Outlook (Express) articles. | ||
| 159 | 209 | ||
| 160 | If you set `gnus-article-skip-boring' to t, then Gnus will not scroll | 210 | ** `gnus-article-skip-boring' |
| 161 | down to show you a page that contains only boring text, which by | ||
| 162 | default means cited text and signature. You can customize what is | ||
| 163 | skippable using `gnus-article-boring-faces'. | ||
| 164 | 211 | ||
| 165 | This feature is especially useful if you read many articles that | 212 | If you set `gnus-article-skip-boring' to `t', then Gnus will not scroll |
| 166 | consist of a little new content at the top with a long, untrimmed | 213 | down to show you a page that contains only boring text, which by default |
| 167 | message cited below. | 214 | means cited text and signature. You can customize what is skippable |
| 215 | using `gnus-article-boring-faces'. | ||
| 168 | 216 | ||
| 169 | ** The format spec %C for positioning point has changed to %*. | 217 | This feature is especially useful if you read many articles that consist |
| 218 | of a little new content at the top with a long, untrimmed message cited | ||
| 219 | below. | ||
| 170 | 220 | ||
| 171 | ** The new variable `gnus-parameters' can be used to set group parameters. | 221 | ** Smileys (`:-)', `;-)' etc) are now displayed graphically in Emacs too. |
| 172 | 222 | ||
| 173 | Earlier this was done only via `G p' (or `G c'), which stored the | 223 | Put `(setq gnus-treat-display-smileys nil)' in `~/.gnus.el' to disable |
| 174 | parameters in ~/.newsrc.eld, but via this variable you can enjoy the | 224 | it. |
| 175 | powers of customize, and simplified backups since you set the variable | ||
| 176 | in ~/.emacs instead of ~/.newsrc.eld. The variable maps regular | ||
| 177 | expressions matching group names to group parameters, a'la: | ||
| 178 | 225 | ||
| 179 | (setq gnus-parameters | 226 | ** Face headers handling. *Note Face::. |
| 180 | '(("mail\\..*" | ||
| 181 | (gnus-show-threads nil) | ||
| 182 | (gnus-use-scoring nil)) | ||
| 183 | ("^nnimap:\\(foo.bar\\)$" | ||
| 184 | (to-group . "\\1")))) | ||
| 185 | 227 | ||
| 186 | ** Smileys (":-)", ";-)" etc) are now iconized for Emacs too. | 228 | ** In the summary buffer, the new command `/ N' inserts new messages and `/ |
| 229 | o' inserts old messages. | ||
| 187 | 230 | ||
| 188 | Customize `gnus-treat-display-smileys' to disable it. | 231 | ** Gnus decodes morse encoded messages if you press `W m'. |
| 189 | 232 | ||
| 190 | ** Gnus no longer generates the Sender: header automatically. | 233 | ** `gnus-summary-line-format' |
| 191 | 234 | ||
| 192 | Earlier it was generated iff the user configurable email address was | 235 | The default value changed to `%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n'. |
| 193 | different from the Gnus guessed default user address. As the guessing | 236 | Moreover `gnus-extra-headers', `nnmail-extra-headers' and |
| 194 | algorithm is rarely correct these days, and (more controversially) the | 237 | `gnus-ignored-from-addresses' changed their default so that the users |
| 195 | only use of the Sender: header was to check if you are entitled to | 238 | name will be replaced by the recipient's name or the group name posting |
| 196 | cancel/supersede news (which is now solved by Cancel Locks instead, | 239 | to for NNTP groups. |
| 197 | see another entry), generation of the header has been disabled by | ||
| 198 | default. See the variables `message-required-headers', | ||
| 199 | `message-required-news-headers', and `message-required-mail-headers'. | ||
| 200 | 240 | ||
| 201 | ** Features from third party message-utils.el added to message.el. | 241 | ** Deleting of attachments. |
| 202 | 242 | ||
| 203 | Message now asks if you wish to remove "(was: <old subject>)" from | 243 | The command `gnus-mime-save-part-and-strip' (bound to `C-o' on MIME |
| 204 | subject lines (see `message-subject-trailing-was-query'). C-c M-m and | 244 | buttons) saves a part and replaces the part with an external one. |
| 205 | C-c M-f inserts markers indicating included text. C-c C-f a adds a | 245 | `gnus-mime-delete-part' (bound to `d' on MIME buttons) removes a part. |
| 206 | X-No-Archive: header. C-c C-f x inserts appropriate headers and a | 246 | It works only on back ends that support editing. |
| 207 | note in the body for cross-postings and followups (see the variables | ||
| 208 | `message-cross-post-*'). | ||
| 209 | 247 | ||
| 210 | ** References and X-Draft-Headers are no longer generated when you | 248 | ** `gnus-default-charset' |
| 211 | start composing messages and `message-generate-headers-first' is nil. | ||
| 212 | 249 | ||
| 213 | ** Improved anti-spam features. | 250 | The default value is determined from the `current-language-environment' |
| 251 | variable, instead of `iso-8859-1'. Also the `.*' item in | ||
| 252 | `gnus-group-charset-alist' is removed. | ||
| 214 | 253 | ||
| 215 | Gnus is now able to take out spam from your mail and news streams | 254 | ** Printing capabilities are enhanced. |
| 216 | using a wide variety of programs and filter rules. Among the supported | ||
| 217 | methods are RBL blocklists, bogofilter and white/blacklists. Hooks | ||
| 218 | for easy use of external packages such as SpamAssassin and Hashcash | ||
| 219 | are also new. | ||
| 220 | 255 | ||
| 221 | ** Easy inclusion of X-Faces headers. | 256 | Gnus supports Muttprint natively with `O P' from the Summary and Article |
| 257 | buffers. Also, each individual MIME part can be printed using `p' on | ||
| 258 | the MIME button. | ||
| 222 | 259 | ||
| 223 | ** In the summary buffer, the new command / N inserts new messages and | 260 | ** Extended format specs. |
| 224 | / o inserts old messages. | ||
| 225 | 261 | ||
| 226 | ** Gnus decodes morse encoded messages if you press W m. | 262 | Format spec `%&user-date;' is added into |
| 263 | `gnus-summary-line-format-alist'. Also, user defined extended format | ||
| 264 | specs are supported. The extended format specs look like `%u&foo;', | ||
| 265 | which invokes function `gnus-user-format-function-FOO'. Because `&' is | ||
| 266 | used as the escape character, old user defined format `%u&' is no longer | ||
| 267 | supported. | ||
| 227 | 268 | ||
| 228 | ** Unread count correct in nnimap groups. | 269 | ** `/ *' (`gnus-summary-limit-include-cached') is rewritten. |
| 229 | 270 | ||
| 230 | The estimated number of unread articles in the group buffer should now | 271 | It was aliased to `Y c' (`gnus-summary-insert-cached-articles'). The |
| 231 | be correct for nnimap groups. This is achieved by calling | 272 | new function filters out other articles. |
| 232 | `nnimap-fixup-unread-after-getting-new-news' from the | ||
| 233 | `gnus-setup-news-hook' (called on startup) and | ||
| 234 | `gnus-after-getting-new-news-hook' (called after getting new mail). | ||
| 235 | If you have modified those variables from the default, you may want to | ||
| 236 | add n-f-u-a-g-n-n again. If you were happy with the estimate and want | ||
| 237 | to save some (minimal) time when getting new mail, remove the | ||
| 238 | function. | ||
| 239 | |||
| 240 | ** Group Carbon Copy (GCC) quoting | ||
| 241 | 273 | ||
| 242 | To support groups that contains SPC and other weird characters, groups | 274 | ** Some limiting commands accept a `C-u' prefix to negate the match. |
| 243 | are quoted before they are placed in the Gcc: header. This means | ||
| 244 | variables such as `gnus-message-archive-group' should no longer | ||
| 245 | contain quote characters to make groups containing SPC work. Also, if | ||
| 246 | you are using the string "nnml:foo, nnml:bar" (indicating Gcc into two | ||
| 247 | groups) you must change it to return the list ("nnml:foo" "nnml:bar"), | ||
| 248 | otherwise the Gcc: line will be quoted incorrectly. Note that | ||
| 249 | returning the string "nnml:foo, nnml:bar" was incorrect earlier, it | ||
| 250 | just didn't generate any problems since it was inserted directly. | ||
| 251 | 275 | ||
| 252 | ** ~/News/overview/ not used. | 276 | If `C-u' is used on subject, author or extra headers, i.e., `/ s', `/ |
| 277 | a', and `/ x' (`gnus-summary-limit-to-{subject,author,extra}') | ||
| 278 | respectively, the result will be to display all articles that do not | ||
| 279 | match the expression. | ||
| 253 | 280 | ||
| 254 | As a result of the following change, the ~/News/overview/ directory is | 281 | ** Gnus inlines external parts (message/external). |
| 255 | not used any more. You can safely delete the entire hierarchy. | ||
| 256 | 282 | ||
| 257 | ** gnus-agent | ||
| 258 | 283 | ||
| 259 | The Gnus Agent has seen a major update. It is now enabled by default, | 284 | |
| 260 | and all nntp and nnimap servers from `gnus-select-method' and | 285 | * Changes in Message mode and related Gnus features |
| 261 | `gnus-secondary-select-method' are agentized by default. Earlier only | ||
| 262 | the server in `gnus-select-method' was agentized by the default, and the | ||
| 263 | agent was disabled by default. When the agent is enabled, headers are | ||
| 264 | now also retrieved from the Agent cache instead of the backends when | ||
| 265 | possible. Earlier this only happened in the unplugged state. You can | ||
| 266 | enroll or remove servers with `J a' and `J r' in the server buffer. | ||
| 267 | Gnus will not download articles into the Agent cache, unless you | ||
| 268 | instruct it to do so, though, by using `J u' or `J s' from the Group | ||
| 269 | buffer. You revert to the old behaviour of having the Agent disabled | ||
| 270 | by customizing `gnus-agent'. Note that putting `(gnus-agentize)' in | ||
| 271 | ~/.gnus is not needed any more. | ||
| 272 | 286 | ||
| 273 | ** gnus-summary-line-format | 287 | ** Delayed articles |
| 274 | 288 | ||
| 275 | The default value changed to "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n". | 289 | You can delay the sending of a message with `C-c C-j' in the Message |
| 276 | Moreover `gnus-extra-headers', `nnmail-extra-headers' and | 290 | buffer. The messages are delivered at specified time. This is useful |
| 277 | `gnus-ignored-from-addresses' changed their default so that the users | 291 | for sending yourself reminders. *Note Delayed Articles::. |
| 278 | name will be replaced by the recipient's name or the group name | ||
| 279 | posting to for NNTP groups. | ||
| 280 | 292 | ||
| 281 | ** deuglify.el (gnus-article-outlook-deuglify-article) | 293 | ** If the new option `nnml-use-compressed-files' is non-`nil', the nnml |
| 294 | back end allows compressed message files. | ||
| 282 | 295 | ||
| 283 | A new file from Raymond Scholz <rscholz@zonix.de> for deuglifying | 296 | ** The new option `gnus-gcc-mark-as-read' automatically marks Gcc articles |
| 284 | broken Outlook (Express) articles. | 297 | as read. |
| 285 | 298 | ||
| 286 | ** (require 'gnus-load) | 299 | ** Externalizing of attachments |
| 287 | 300 | ||
| 288 | If you use a stand-alone Gnus distribution, you'd better add | 301 | If `gnus-gcc-externalize-attachments' or |
| 289 | "(require 'gnus-load)" to your ~/.emacs after adding the Gnus | 302 | `message-fcc-externalize-attachments' is non-`nil', attach local files |
| 290 | lisp directory into load-path. | 303 | as external parts. |
| 291 | 304 | ||
| 292 | File gnus-load.el contains autoload commands, functions and variables, | 305 | ** The envelope sender address can be customized when using Sendmail. |
| 293 | some of which may not be included in distributions of Emacsen. | 306 | *Note Mail Variables: (message)Mail Variables. |
| 294 | 307 | ||
| 295 | ** gnus-slave-unplugged | 308 | ** Gnus no longer generate the Sender: header automatically. |
| 296 | 309 | ||
| 297 | A new command which starts gnus offline in slave mode. | 310 | Earlier it was generated iff the user configurable email address was |
| 311 | different from the Gnus guessed default user address. As the guessing | ||
| 312 | algorithm is rarely correct these days, and (more controversially) the | ||
| 313 | only use of the Sender: header was to check if you are entitled to | ||
| 314 | cancel/supersede news (which is now solved by Cancel Locks instead, see | ||
| 315 | another entry), generation of the header has been disabled by default. | ||
| 316 | See the variables `message-required-headers', | ||
| 317 | `message-required-news-headers', and `message-required-mail-headers'. | ||
| 298 | 318 | ||
| 299 | ** message-insinuate-rmail | 319 | ** Features from third party `message-utils.el' added to `message.el'. |
| 300 | 320 | ||
| 301 | Adding (message-insinuate-rmail) in .emacs and customizing | 321 | Message now asks if you wish to remove `(was: <old subject>)' from |
| 302 | `mail-user-agent' to `gnus-user-agent' convinces Rmail to compose, | 322 | subject lines (see `message-subject-trailing-was-query'). `C-c M-m' and |
| 303 | reply and forward messages in Message mode, where you can enjoy the | 323 | `C-c M-f' inserts markers indicating included text. `C-c C-f a' adds a |
| 304 | power of MML. | 324 | X-No-Archive: header. `C-c C-f x' inserts appropriate headers and a |
| 325 | note in the body for cross-postings and followups (see the variables | ||
| 326 | `message-cross-post-*'). | ||
| 305 | 327 | ||
| 306 | ** message-minibuffer-local-map | 328 | ** References and X-Draft-From headers are no longer generated when you |
| 329 | start composing messages and `message-generate-headers-first' is `nil'. | ||
| 307 | 330 | ||
| 308 | The line below enables BBDB in resending a message: | 331 | ** Easy inclusion of X-Faces headers. *Note X-Face::. |
| 309 | 332 | ||
| 310 | (define-key message-minibuffer-local-map [?\t] 'bbdb-complete-name) | 333 | ** Group Carbon Copy (GCC) quoting |
| 311 | 334 | ||
| 312 | ** Externalizing and deleting of attachments. | 335 | To support groups that contains SPC and other weird characters, groups |
| 336 | are quoted before they are placed in the Gcc: header. This means | ||
| 337 | variables such as `gnus-message-archive-group' should no longer contain | ||
| 338 | quote characters to make groups containing SPC work. Also, if you are | ||
| 339 | using the string `nnml:foo, nnml:bar' (indicating Gcc into two groups) | ||
| 340 | you must change it to return the list `("nnml:foo" "nnml:bar")', | ||
| 341 | otherwise the Gcc: line will be quoted incorrectly. Note that returning | ||
| 342 | the string `nnml:foo, nnml:bar' was incorrect earlier, it just didn't | ||
| 343 | generate any problems since it was inserted directly. | ||
| 313 | 344 | ||
| 314 | If `gnus-gcc-externalize-attachments' (or | 345 | ** `message-insinuate-rmail' |
| 315 | `message-fcc-externalize-attachments') is non-nil, attach local files | ||
| 316 | as external parts. | ||
| 317 | 346 | ||
| 318 | The command `gnus-mime-save-part-and-strip' (bound to `C-o' on MIME | 347 | Adding `(message-insinuate-rmail)' and `(setq mail-user-agent |
| 319 | buttons) saves a part and replaces the part with an external one. | 348 | 'gnus-user-agent)' in `.emacs' convinces Rmail to compose, reply and |
| 320 | `gnus-mime-delete-part' (bound to `d' on MIME buttons) removes a part. | 349 | forward messages in message-mode, where you can enjoy the power of MML. |
| 321 | It works only on back ends that support editing. | ||
| 322 | 350 | ||
| 323 | ** gnus-default-charset | 351 | ** `message-minibuffer-local-map' |
| 324 | 352 | ||
| 325 | The default value now guesses on the basis of your environment instead | 353 | The line below enables BBDB in resending a message: |
| 326 | of using Latin-1. Also the ".*" item in gnus-group-charset-alist is | 354 | (define-key message-minibuffer-local-map [(tab)] |
| 327 | removed. | 355 | 'bbdb-complete-name) |
| 328 | 356 | ||
| 329 | ** gnus-posting-styles | 357 | ** `gnus-posting-styles' |
| 330 | 358 | ||
| 331 | Add a new format of match like | 359 | Add a new format of match like |
| 332 | 360 | ((header "to" "larsi.*org") | |
| 333 | ((header "to" "larsi.*org") | 361 | (Organization "Somewhere, Inc.")) |
| 334 | (Organization "Somewhere, Inc.")) | ||
| 335 | |||
| 336 | The old format like the lines below is obsolete, but still accepted. | 362 | The old format like the lines below is obsolete, but still accepted. |
| 363 | (header "to" "larsi.*org" | ||
| 364 | (Organization "Somewhere, Inc.")) | ||
| 337 | 365 | ||
| 338 | (header "to" "larsi.*org" | 366 | ** `message-ignored-news-headers' and `message-ignored-mail-headers' |
| 339 | (Organization "Somewhere, Inc.")) | ||
| 340 | |||
| 341 | ** message-ignored-news-headers and message-ignored-mail-headers | ||
| 342 | 367 | ||
| 343 | X-Draft-From and X-Gnus-Agent-Meta-Information have been added into | 368 | `X-Draft-From' and `X-Gnus-Agent-Meta-Information' have been added into |
| 344 | these two variables. If you customized those, perhaps you need add | 369 | these two variables. If you customized those, perhaps you need add |
| 345 | those two headers too. | 370 | those two headers too. |
| 346 | 371 | ||
| 347 | ** Gnus reads the NOV and articles in the Agent if plugged. | 372 | ** Gnus supports the "format=flowed" (RFC 2646) parameter. On composing |
| 348 | 373 | messages, it is enabled by `use-hard-newlines'. Decoding format=flowed | |
| 349 | If one reads an article while plugged, and the article already exists | 374 | was present but not documented in earlier versions. |
| 350 | in the Agent, it won't get downloaded once more. Customize | ||
| 351 | `gnus-agent-cache' to revert to the old behavior. | ||
| 352 | |||
| 353 | ** Gnus supports the "format=flowed" (RFC 2646) parameter. | ||
| 354 | |||
| 355 | On composing messages, it is enabled by `use-hard-newlines'. Decoding | ||
| 356 | format=flowed was present but not documented in earlier versions. | ||
| 357 | 375 | ||
| 358 | ** The option `mm-fill-flowed' can be used to disable treatment of | 376 | ** The option `mm-fill-flowed' can be used to disable treatment of |
| 359 | format=flowed messages. Also, flowed text is disabled when sending | 377 | "format=flowed" messages. Also, flowed text is disabled when sending |
| 360 | inline PGP signed messages. (New in Gnus 5.10.8) | 378 | inline PGP signed messages. (New in Gnus 5.10.7) |
| 361 | |||
| 362 | ** The tool bar icons are now (de)activated correctly in the group | ||
| 363 | buffer, see the variable `gnus-group-update-tool-bar'. It's default | ||
| 364 | value depends on your Emacs version. (New in Gnus 5.10.8) | ||
| 365 | 379 | ||
| 366 | ** Gnus supports the generation of RFC 2298 Disposition Notification requests. | 380 | ** Gnus supports the generation of RFC 2298 Disposition Notification |
| 381 | requests. | ||
| 367 | 382 | ||
| 368 | This is invoked with the C-c M-n key binding from message mode. | 383 | This is invoked with the `C-c M-n' key binding from message mode. |
| 369 | |||
| 370 | ** Gnus supports Maildir groups. | ||
| 371 | |||
| 372 | Gnus includes a new backend nnmaildir.el. | ||
| 373 | |||
| 374 | ** Printing capabilities are enhanced. | ||
| 375 | |||
| 376 | Gnus supports Muttprint natively with O P from the Summary and Article | ||
| 377 | buffers. Also, each individual MIME part can be printed using p on | ||
| 378 | the MIME button. | ||
| 379 | 384 | ||
| 380 | ** Message supports the Importance: (RFC 2156) header. | 385 | ** Message supports the Importance: (RFC 2156) header. |
| 381 | 386 | ||
| @@ -384,151 +389,130 @@ valid values. | |||
| 384 | 389 | ||
| 385 | ** Gnus supports Cancel Locks in News. | 390 | ** Gnus supports Cancel Locks in News. |
| 386 | 391 | ||
| 387 | This means a header "Cancel-Lock" is inserted in news posting. It is | 392 | This means a header `Cancel-Lock' is inserted in news posting. It is |
| 388 | used to determine if you wrote a article or not (for cancelling and | 393 | used to determine if you wrote an article or not (for canceling and |
| 389 | superseding). Gnus generates a random password string the first time | 394 | superseding). Gnus generates a random password string the first time |
| 390 | you post a message, and saves it using the Custom system. While the | 395 | you post a message, and saves it in your `~/.emacs' using the Custom |
| 391 | variable is called `canlock-password', it is not security sensitive | 396 | system. While the variable is called `canlock-password', it is not |
| 392 | data. Publishing your canlock string on the web will not allow anyone | 397 | security sensitive data. Publishing your canlock string on the web will |
| 393 | to be able to anything she could not already do. The behaviour can be | 398 | not allow anyone to be able to anything she could not already do. The |
| 394 | changed by customizing `message-insert-canlock'. | 399 | behavior can be changed by customizing `message-insert-canlock'. |
| 395 | 400 | ||
| 396 | ** Gnus supports server-side mail filtering using Sieve. | 401 | ** Gnus supports PGP (RFC 1991/2440), PGP/MIME (RFC 2015/3156) and S/MIME |
| 397 | 402 | (RFC 2630-2633). | |
| 398 | Sieve rules can be added as Group Parameters for groups, and the | ||
| 399 | complete Sieve script is generated using `D g' from the Group buffer, | ||
| 400 | and then uploaded to the server using `C-c C-l' in the generated Sieve | ||
| 401 | buffer. Search the online Gnus manual for "sieve", and see the new | ||
| 402 | Sieve manual, for more information. | ||
| 403 | |||
| 404 | ** Extended format specs. | ||
| 405 | 403 | ||
| 406 | Format spec "%&user-date;" is added into | 404 | It needs an external S/MIME and OpenPGP implementation, but no |
| 407 | `gnus-summary-line-format-alist'. Also, user defined extended format | 405 | additional Lisp libraries. This add several menu items to the |
| 408 | specs are supported. The extended format specs look like "%u&foo;", | 406 | Attachments menu, and `C-c RET' key bindings, when composing messages. |
| 409 | which invokes function `gnus-user-format-function-foo'. Because "&" is | 407 | This also obsoletes `gnus-article-hide-pgp-hook'. |
| 410 | used as the escape character, old user defined format "%u&" is no | ||
| 411 | longer supported. | ||
| 412 | |||
| 413 | ** `/ *' (gnus-summary-limit-include-cached) is rewritten. | ||
| 414 | |||
| 415 | It was aliased to `Y c' (gnus-summary-insert-cached-articles). The new | ||
| 416 | function filters out other articles. | ||
| 417 | |||
| 418 | ** Some limiting commands accept a C-u prefix to negate the match. | ||
| 419 | |||
| 420 | If C-u is used on subject, author or extra headers, i.e., `/ s', `/ | ||
| 421 | a', and `/ x' (gnus-summary-limit-to-{subject,author,extra}) | ||
| 422 | respectively, the result will be to display all articles that do not | ||
| 423 | match the expression. | ||
| 424 | 408 | ||
| 425 | ** Group names are treated as UTF-8 by default. | 409 | ** MML (Mime compose) prefix changed from `M-m' to `C-c C-m'. |
| 426 | 410 | ||
| 427 | This is supposedly what USEFOR wanted to migrate to. See | 411 | This change was made to avoid conflict with the standard binding of |
| 428 | `gnus-group-name-charset-group-alist' and | 412 | `back-to-indentation', which is also useful in message mode. |
| 429 | `gnus-group-name-charset-method-alist' for customization. | ||
| 430 | 413 | ||
| 431 | ** The nnml and nnfolder backends store marks for each group. | 414 | ** The default for `message-forward-show-mml' changed to the symbol `best'. |
| 432 | 415 | ||
| 433 | This makes it possible to take backup of nnml/nnfolder servers/groups | 416 | The behavior for the `best' value is to show MML (i.e., convert to MIME) |
| 434 | separately of ~/.newsrc.eld, while preserving marks. It also makes it | 417 | when appropriate. MML will not be used when forwarding signed or |
| 435 | possible to share articles and marks between users (without sharing | 418 | encrypted messages, as the conversion invalidate the digital signature. |
| 436 | the ~/.newsrc.eld file) within e.g. a department. It works by storing | ||
| 437 | the marks stored in ~/.newsrc.eld in a per-group file ".marks" (for | ||
| 438 | nnml) and "groupname.mrk" (for nnfolder, named "groupname"). If the | ||
| 439 | nnml/nnfolder is moved to another machine, Gnus will automatically use | ||
| 440 | the .marks or .mrk file instead of the information in ~/.newsrc.eld. | ||
| 441 | The new server variables `nnml-marks-is-evil' and | ||
| 442 | `nnfolder-marks-is-evil' can be used to disable this feature. | ||
| 443 | 419 | ||
| 444 | ** The menu bar item (in Group and Summary buffer) named "Misc" has | 420 | ** If `auto-compression-mode' is enabled, attachments are automatically |
| 445 | been renamed to "Gnus". | 421 | decompressed when activated. |
| 446 | 422 | ||
| 447 | ** The menu bar item (in Message mode) named "MML" has been renamed to | 423 | ** Support for non-ASCII domain names |
| 448 | "Attachments". Note that this menu also contains security related | ||
| 449 | stuff, like signing and encryption. | ||
| 450 | 424 | ||
| 451 | ** gnus-group-charset-alist and gnus-group-ignored-charsets-alist. | 425 | Message supports non-ASCII domain names in From:, To: and Cc: and will |
| 426 | query you whether to perform encoding when you try to send a message. | ||
| 427 | The variable `message-use-idna' controls this. Gnus will also decode | ||
| 428 | non-ASCII domain names in From:, To: and Cc: when you view a message. | ||
| 429 | The variable `gnus-use-idna' controls this. | ||
| 452 | 430 | ||
| 453 | The regexps in these variables are compared with full group names | 431 | ** You can now drag and drop attachments to the Message buffer. See |
| 454 | instead of real group names in 5.8. Users who customize these | 432 | `mml-dnd-protocol-alist' and `mml-dnd-attach-options'. *Note MIME: |
| 455 | variables should change those regexps accordingly. For example: | 433 | (message)MIME. |
| 456 | 434 | ||
| 457 | ("^han\\>" euc-kr) -> ("\\(^\\|:\\)han\\>" euc-kr) | ||
| 458 | 435 | ||
| 459 | ** Gnus supports PGP (RFC 1991/2440), PGP/MIME (RFC 2015/3156) and | 436 | |
| 460 | S/MIME (RFC 2630-2633). | 437 | * Changes in back ends |
| 461 | 438 | ||
| 462 | It needs an external S/MIME and OpenPGP implementation, but no | 439 | ** Gnus can display RSS newsfeeds as a newsgroup. *Note RSS::. |
| 463 | additional lisp libraries. This add several menu items to the | ||
| 464 | Attachments menu, and C-c RET key bindings, when composing messages. | ||
| 465 | This also obsoletes `gnus-article-hide-pgp-hook'. | ||
| 466 | 440 | ||
| 467 | ** Gnus inlines external parts (message/external). | 441 | ** The nndoc back end now supports mailman digests and exim bounces. |
| 468 | 442 | ||
| 469 | ** MML (Mime compose) prefix changed from `M-m' to `C-c C-m'. | 443 | ** Gnus supports Maildir groups. |
| 470 | 444 | ||
| 471 | This change was made to avoid conflict with the standard binding of | 445 | Gnus includes a new back end `nnmaildir.el'. *Note Maildir::. |
| 472 | `back-to-indentation', which is also useful in message mode. | ||
| 473 | 446 | ||
| 474 | ** The default for message-forward-show-mml changed to symbol best. | 447 | ** The nnml and nnfolder back ends store marks for each groups. |
| 475 | 448 | ||
| 476 | The behaviour for the `best' value is to show MML (i.e., convert MIME | 449 | This makes it possible to take backup of nnml/nnfolder servers/groups |
| 477 | to MML) when appropriate. MML will not be used when forwarding signed | 450 | separately of `~/.newsrc.eld', while preserving marks. It also makes it |
| 478 | or encrypted messages, as the conversion invalidate the digital | 451 | possible to share articles and marks between users (without sharing the |
| 479 | signature. | 452 | `~/.newsrc.eld' file) within e.g. a department. It works by storing the |
| 453 | marks stored in `~/.newsrc.eld' in a per-group file `.marks' (for nnml) | ||
| 454 | and `GROUPNAME.mrk' (for nnfolder, named GROUPNAME). If the | ||
| 455 | nnml/nnfolder is moved to another machine, Gnus will automatically use | ||
| 456 | the `.marks' or `.mrk' file instead of the information in | ||
| 457 | `~/.newsrc.eld'. The new server variables `nnml-marks-is-evil' and | ||
| 458 | `nnfolder-marks-is-evil' can be used to disable this feature. | ||
| 480 | 459 | ||
| 481 | ** Bug fixes. | ||
| 482 | 460 | ||
| 483 | 461 | ||
| 484 | * Changes in Pterodactyl Gnus (5.8/5.9) | 462 | * Appearance |
| 485 | 463 | ||
| 486 | The Gnus NEWS entries are short, but they reflect sweeping changes in | 464 | ** The menu bar item (in Group and Summary buffer) named "Misc" has been |
| 487 | four areas: Article display treatment, MIME treatment, | 465 | renamed to "Gnus". |
| 488 | internationalization and mail-fetching. | ||
| 489 | 466 | ||
| 490 | ** The mail-fetching functions have changed. See the manual for the | 467 | ** The menu bar item (in Message mode) named "MML" has been renamed to |
| 491 | many details. In particular, all procmail fetching variables are gone. | 468 | "Attachments". Note that this menu also contains security related |
| 469 | stuff, like signing and encryption (*note Security: (message)Security.). | ||
| 492 | 470 | ||
| 493 | If you used procmail like in | 471 | ** The tool bars have been updated to use GNOME icons in Group, Summary and |
| 472 | Message mode. You can also customize the tool bars. This is a new | ||
| 473 | feature in Gnus 5.10.9. (Only for Emacs, not in XEmacs.) | ||
| 494 | 474 | ||
| 495 | (setq nnmail-use-procmail t) | 475 | ** The tool bar icons are now (de)activated correctly in the group buffer, |
| 496 | (setq nnmail-spool-file 'procmail) | 476 | see the variable `gnus-group-update-tool-bar'. Its default value |
| 497 | (setq nnmail-procmail-directory "~/mail/incoming/") | 477 | depends on your Emacs version. This is a new feature in Gnus 5.10.9. |
| 498 | (setq nnmail-procmail-suffix "\\.in") | ||
| 499 | 478 | ||
| 500 | this now has changed to | 479 | |
| 480 | * Miscellaneous changes | ||
| 501 | 481 | ||
| 502 | (setq mail-sources | 482 | ** `gnus-agent' |
| 503 | '((directory :path "~/mail/incoming/" | ||
| 504 | :suffix ".in"))) | ||
| 505 | 483 | ||
| 506 | More information is available in the info doc at Select Methods -> | 484 | The Gnus Agent has seen a major updated and is now enabled by default, |
| 507 | Getting Mail -> Mail Sources | 485 | and all nntp and nnimap servers from `gnus-select-method' and |
| 486 | `gnus-secondary-select-method' are agentized by default. Earlier only | ||
| 487 | the server in `gnus-select-method' was agentized by the default, and the | ||
| 488 | agent was disabled by default. When the agent is enabled, headers are | ||
| 489 | now also retrieved from the Agent cache instead of the back ends when | ||
| 490 | possible. Earlier this only happened in the unplugged state. You can | ||
| 491 | enroll or remove servers with `J a' and `J r' in the server buffer. | ||
| 492 | Gnus will not download articles into the Agent cache, unless you | ||
| 493 | instruct it to do so, though, by using `J u' or `J s' from the Group | ||
| 494 | buffer. You revert to the old behavior of having the Agent disabled | ||
| 495 | with `(setq gnus-agent nil)'. Note that putting `(gnus-agentize)' in | ||
| 496 | `~/.gnus.el' is not needed any more. | ||
| 508 | 497 | ||
| 509 | ** Gnus is now a MIME-capable reader. This affects many parts of | 498 | ** Gnus reads the NOV and articles in the Agent if plugged. |
| 510 | Gnus, and adds a slew of new commands. See the manual for details. | ||
| 511 | 499 | ||
| 512 | ** Gnus has also been multilingualized. This also affects too | 500 | If one reads an article while plugged, and the article already exists in |
| 513 | many parts of Gnus to summarize here, and adds many new variables. | 501 | the Agent, it won't get downloaded once more. `(setq gnus-agent-cache |
| 502 | nil)' reverts to the old behavior. | ||
| 514 | 503 | ||
| 515 | ** gnus-auto-select-first can now be a function to be | 504 | ** Dired integration |
| 516 | called to position point. | ||
| 517 | 505 | ||
| 518 | ** The user can now decide which extra headers should be included in | 506 | `gnus-dired-minor-mode' (see *Note Other modes::) installs key bindings |
| 519 | summary buffers and NOV files. | 507 | in dired buffers to send a file as an attachment, open a file using the |
| 508 | appropriate mailcap entry, and print a file using the mailcap entry. | ||
| 520 | 509 | ||
| 521 | ** `gnus-article-display-hook' has been removed. Instead, a number | 510 | ** The format spec `%C' for positioning point has changed to `%*'. |
| 522 | of variables starting with `gnus-treat-' have been added. | ||
| 523 | 511 | ||
| 524 | ** The Gnus posting styles have been redone again and now works in a | 512 | ** `gnus-slave-unplugged' |
| 525 | subtly different manner. | ||
| 526 | 513 | ||
| 527 | ** New web-based backends have been added: nnslashdot, nnwarchive | 514 | A new command which starts Gnus offline in slave mode. |
| 528 | and nnultimate. nnweb has been revamped, again, to keep up with | ||
| 529 | ever-changing layouts. | ||
| 530 | 515 | ||
| 531 | ** Gnus can now read IMAP mail via nnimap. | ||
| 532 | 516 | ||
| 533 | 517 | ||
| 534 | * For older news, see Gnus info node "New Features". | 518 | * For older news, see Gnus info node "New Features". |
| @@ -536,8 +520,8 @@ ever-changing layouts. | |||
| 536 | ---------------------------------------------------------------------- | 520 | ---------------------------------------------------------------------- |
| 537 | Copyright information: | 521 | Copyright information: |
| 538 | 522 | ||
| 539 | Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, | 523 | Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, |
| 540 | 2005, 2006 Free Software Foundation, Inc. | 524 | 2006 Free Software Foundation, Inc. |
| 541 | 525 | ||
| 542 | Permission is granted to anyone to make or distribute verbatim copies | 526 | Permission is granted to anyone to make or distribute verbatim copies |
| 543 | of this document as received, in any medium, provided that the | 527 | of this document as received, in any medium, provided that the |
| @@ -95,7 +95,6 @@ doesn't automatically select the right one. | |||
| 95 | Its name is `pt-br-refcard.tex'. The corresponding PostScript file is | 95 | Its name is `pt-br-refcard.tex'. The corresponding PostScript file is |
| 96 | also included. | 96 | also included. |
| 97 | 97 | ||
| 98 | |||
| 99 | --- | 98 | --- |
| 100 | ** A French translation of the `Emacs Survival Guide' is available. | 99 | ** A French translation of the `Emacs Survival Guide' is available. |
| 101 | 100 | ||
| @@ -202,6 +201,13 @@ an interactively callable function. | |||
| 202 | all frames you create. A position specified with --geometry only | 201 | all frames you create. A position specified with --geometry only |
| 203 | affects the initial frame. | 202 | affects the initial frame. |
| 204 | 203 | ||
| 204 | --- | ||
| 205 | ** Emacs built for MS-Windows now behaves like Emacs on X does, | ||
| 206 | wrt its frame position: if you don't specify a position (in your | ||
| 207 | .emacs init file, in the Registry, or with the --geometry command-line | ||
| 208 | option), Emacs leaves the frame position to the Windows' window | ||
| 209 | manager. | ||
| 210 | |||
| 205 | +++ | 211 | +++ |
| 206 | ** Emacs can now be invoked in full-screen mode on a windowed display. | 212 | ** Emacs can now be invoked in full-screen mode on a windowed display. |
| 207 | When Emacs is invoked on a window system, the new command-line options | 213 | When Emacs is invoked on a window system, the new command-line options |
| @@ -241,8 +247,9 @@ according to the value of `save-abbrevs'. | |||
| 241 | 247 | ||
| 242 | +++ | 248 | +++ |
| 243 | ** If the environment variable EMAIL is defined, Emacs now uses its value | 249 | ** If the environment variable EMAIL is defined, Emacs now uses its value |
| 244 | to compute the default value of `use-mail-address', in preference to | 250 | to compute the default value of `user-mail-address', in preference to |
| 245 | concatenation of `user-login-name' with the name of your host machine. | 251 | concatenation of `user-login-name' with the name of your host machine. |
| 252 | |||
| 246 | 253 | ||
| 247 | * Incompatible Editing Changes in Emacs 22.1 | 254 | * Incompatible Editing Changes in Emacs 22.1 |
| 248 | 255 | ||
| @@ -832,6 +839,13 @@ The variable `automatic-hscrolling' was renamed to | |||
| 832 | the window now works sensibly, by automatically adjusting the window's | 839 | the window now works sensibly, by automatically adjusting the window's |
| 833 | vscroll property. | 840 | vscroll property. |
| 834 | 841 | ||
| 842 | *** New customize option `overline-margin' controls the space between | ||
| 843 | overline and text. | ||
| 844 | |||
| 845 | *** New variable `x-underline-at-descent-line' controls the relative | ||
| 846 | position of the underline. When set, it overrides the | ||
| 847 | `x-use-underline-position-properties' variables. | ||
| 848 | |||
| 835 | +++ | 849 | +++ |
| 836 | *** The new face `mode-line-inactive' is used to display the mode line | 850 | *** The new face `mode-line-inactive' is used to display the mode line |
| 837 | of non-selected windows. The `mode-line' face is now used to display | 851 | of non-selected windows. The `mode-line' face is now used to display |
| @@ -1764,9 +1778,8 @@ type "C-h i m org RET" to read that manual. A reference card is | |||
| 1764 | available in `etc/orgcard.tex' and `etc/orgcard.ps'. | 1778 | available in `etc/orgcard.tex' and `etc/orgcard.ps'. |
| 1765 | 1779 | ||
| 1766 | +++ | 1780 | +++ |
| 1767 | ** The new package dns-mode.el add syntax highlight of DNS master files. | 1781 | ** The new package dns-mode.el adds syntax highlighting of DNS master files. |
| 1768 | The key binding C-c C-s (`dns-mode-soa-increment-serial') can be used | 1782 | It is a modern replacement for zone-mode.el, which is now obsolete. |
| 1769 | to increment the SOA serial. | ||
| 1770 | 1783 | ||
| 1771 | --- | 1784 | --- |
| 1772 | ** The new global minor mode `file-name-shadow-mode' modifies the way | 1785 | ** The new global minor mode `file-name-shadow-mode' modifies the way |
| @@ -1987,6 +2000,7 @@ using hi-lock-mode in an initialization file will turn on Hi Lock in all | |||
| 1987 | buffers and no warning will be issued (for compatibility with the | 2000 | buffers and no warning will be issued (for compatibility with the |
| 1988 | behavior in older versions of Emacs). | 2001 | behavior in older versions of Emacs). |
| 1989 | 2002 | ||
| 2003 | --- | ||
| 1990 | ** Changes in Allout | 2004 | ** Changes in Allout |
| 1991 | 2005 | ||
| 1992 | *** Topic cryptography added, enabling easy gpg topic encryption and | 2006 | *** Topic cryptography added, enabling easy gpg topic encryption and |
| @@ -1995,11 +2009,19 @@ clear-text within a single file to your heart's content, using symmetric | |||
| 1995 | and/or public key modes. Time-limited key caching, user-provided | 2009 | and/or public key modes. Time-limited key caching, user-provided |
| 1996 | symmetric key hinting and consistency verification, auto-encryption of | 2010 | symmetric key hinting and consistency verification, auto-encryption of |
| 1997 | pending topics on save, and more, make it easy to use encryption in | 2011 | pending topics on save, and more, make it easy to use encryption in |
| 1998 | powerful ways. | 2012 | powerful ways. Encryption behavior customization is collected in the |
| 2013 | allout-encryption customization group. | ||
| 1999 | 2014 | ||
| 2000 | *** `allout-view-change-hook' marked as being deprecated - use | 2015 | *** `allout-view-change-hook' marked as being deprecated - use |
| 2001 | `allout-exposure-change-hook' instead. Both are currently being used, but | 2016 | `allout-exposure-change-hook' instead. Both are still invoked, but |
| 2002 | `allout-view-change-hook' will be ignored in a subsequent allout version. | 2017 | `allout-view-change-hook' will eventually be ignored. The new |
| 2018 | `allout-exposure-change-hook' is called with args that were passed to | ||
| 2019 | `allout-flag-region', making it easier to use. | ||
| 2020 | |||
| 2021 | *** Other allout functions which change the outline structure also have | ||
| 2022 | hooks, enabling cooperative allout enhancements. See | ||
| 2023 | `allout-structure-added-hook', `allout-structure-deleted-hook', and | ||
| 2024 | `allout-structure-shifted-hook'. | ||
| 2003 | 2025 | ||
| 2004 | *** Default command prefix changed to "\C-c " (control-c space), to avoid | 2026 | *** Default command prefix changed to "\C-c " (control-c space), to avoid |
| 2005 | intruding on user's keybinding space. Customize the | 2027 | intruding on user's keybinding space. Customize the |
| @@ -2010,23 +2032,43 @@ concealed text, instead of selective-display. This simplifies the code, in | |||
| 2010 | particular avoiding the need for kludges for isearch dynamic-display, | 2032 | particular avoiding the need for kludges for isearch dynamic-display, |
| 2011 | discretionary handling of edits of concealed text, undo concerns, etc. | 2033 | discretionary handling of edits of concealed text, undo concerns, etc. |
| 2012 | 2034 | ||
| 2035 | *** Some previously rough topic-header format edge cases are reconciled. | ||
| 2036 | Level 1 topics use the mode's comment format, and lines starting with the | ||
| 2037 | asterisk - for instance, the comment close of some languages (eg, c's "*/" | ||
| 2038 | or mathematica's "*)") - at the beginning of line are no longer are | ||
| 2039 | interpreted as level 1 topics in those modes. (Yay!) | ||
| 2040 | |||
| 2013 | *** Many substantial fixes and refinements, including: | 2041 | *** Many substantial fixes and refinements, including: |
| 2014 | 2042 | ||
| 2015 | - repaired inhibition of inadvertent edits to concealed text | 2043 | - repaired regexp-quoting of custom header prefixes, so any literals |
| 2016 | - repaired retention of topic body hanging indent upon topic depth shifts | 2044 | will now work (for instance, mathematica's "(*" is now properly |
| 2045 | accepted). | ||
| 2046 | - repaired inhibition of inadvertent edits to concealed text. | ||
| 2017 | - refuse to create "containment discontinuities", where a | 2047 | - refuse to create "containment discontinuities", where a |
| 2018 | topic is shifted deeper than the offspring-depth of its' container | 2048 | topic is shifted deeper than the offspring-depth of its' container |
| 2019 | - auto-fill-mode is now left inactive when allout-mode starts, if it | 2049 | - auto-fill-mode is now left inactive when allout-mode starts, if it |
| 2020 | already was inactive. also, `allout-inhibit-auto-fill' custom | 2050 | already was inactive. also, `allout-inhibit-auto-fill' custom |
| 2021 | configuration variable makes it easy to disable auto fill in allout | 2051 | configuration variable makes it easy to disable auto fill in allout |
| 2022 | outlines in general or on a per-buffer basis. | 2052 | outlines in general or on a per-buffer basis. |
| 2023 | - new hook `allout-mode-deactivate-hook', for coordinating with | 2053 | - mode hook changes: new hook `allout-mode-deactivate-hook', for |
| 2024 | deactivation of allout-mode. | 2054 | coordinating with deactivation of allout-mode. `allout-mode-hook' is |
| 2055 | now run after the `allout-mode' variable is changed, as is the new | ||
| 2056 | `allout-mode-deactivate-hook'. | ||
| 2057 | - allout now tolerates fielded text in outlines without disruption. | ||
| 2058 | - hot-spot navigation now is modularized with a new function, | ||
| 2059 | `allout-hotspot-key-handler', enabling easier articulation and | ||
| 2060 | enhancement of the functionality by allout addons. | ||
| 2061 | - topic body navigation is easier, where repeated beginning of line and | ||
| 2062 | end of line key commands cycle through the actually beginning/end of | ||
| 2063 | line and then beginning/end of topic, etc. see new customization vars | ||
| 2064 | `allout-beginning-of-line-cycles' and `allout-end-of-line-cycles'. | ||
| 2065 | - repaired retention of topic body hanging indent upon topic depth shifts | ||
| 2025 | - bulleting variation is simpler and more accommodating, both in the | 2066 | - bulleting variation is simpler and more accommodating, both in the |
| 2026 | default behavior and in ability to vary when creating new topics | 2067 | default behavior and in ability to vary when creating new topics |
| 2027 | - mode deactivation now does cleans up effectively, more properly | 2068 | - mode deactivation now does cleans up effectively, more properly |
| 2028 | restoring affected variables and hooks to former state, removing | 2069 | restoring affected variables and hooks to former state, removing |
| 2029 | overlays, etc. | 2070 | overlays, etc. see `allout-add-resumptions' and |
| 2071 | `allout-do-resumptions', which replace the old `allout-resumptions'. | ||
| 2030 | - included a few unit-tests for interior functionality. developers can | 2072 | - included a few unit-tests for interior functionality. developers can |
| 2031 | have them automatically run at the end of module load by customizing | 2073 | have them automatically run at the end of module load by customizing |
| 2032 | the option `allout-run-unit-tests-on-load'. | 2074 | the option `allout-run-unit-tests-on-load'. |
| @@ -3506,6 +3548,9 @@ variable `calculator-radix-grouping-mode'. | |||
| 3506 | ** iso-acc.el is now obsolete. Use one of the latin input methods instead. | 3548 | ** iso-acc.el is now obsolete. Use one of the latin input methods instead. |
| 3507 | 3549 | ||
| 3508 | --- | 3550 | --- |
| 3551 | ** zone-mode.el is now obsolete. Use dns-mode.el instead. | ||
| 3552 | |||
| 3553 | --- | ||
| 3509 | ** cplus-md.el has been deleted. | 3554 | ** cplus-md.el has been deleted. |
| 3510 | 3555 | ||
| 3511 | ** Ewoc changes | 3556 | ** Ewoc changes |
| @@ -3654,8 +3699,10 @@ w32-use-full-screen-buffer to t. | |||
| 3654 | 3699 | ||
| 3655 | * Incompatible Lisp Changes in Emacs 22.1 | 3700 | * Incompatible Lisp Changes in Emacs 22.1 |
| 3656 | 3701 | ||
| 3657 | ** The function find-operation-coding-system accepts a cons (FILENAME | 3702 | ** The function find-operation-coding-system may be called with a cons |
| 3658 | . BUFFER) in an argument correponding to the target. | 3703 | (FILENAME . BUFFER) in the second argument if the first argument |
| 3704 | OPERATION is `insert-file-contents', and thus a function registered in | ||
| 3705 | `file-coding-system-alist' is also called with such an argument. | ||
| 3659 | 3706 | ||
| 3660 | --- | 3707 | --- |
| 3661 | ** The variables post-command-idle-hook and post-command-idle-delay have | 3708 | ** The variables post-command-idle-hook and post-command-idle-delay have |
| @@ -4625,6 +4672,7 @@ keymap alist to this list. | |||
| 4625 | 4672 | ||
| 4626 | *** The definition of a key-binding passed to define-key can use XEmacs-style | 4673 | *** The definition of a key-binding passed to define-key can use XEmacs-style |
| 4627 | key-sequences, such as [(control a)]. | 4674 | key-sequences, such as [(control a)]. |
| 4675 | |||
| 4628 | ** Abbrev changes: | 4676 | ** Abbrev changes: |
| 4629 | 4677 | ||
| 4630 | +++ | 4678 | +++ |
| @@ -5354,6 +5402,11 @@ text to being a piece of code, so you'd put a `jit-lock-defer-multiline' | |||
| 5354 | property over the second half of the command to force (deferred) | 5402 | property over the second half of the command to force (deferred) |
| 5355 | refontification of `bar' whenever the `e' is added/removed. | 5403 | refontification of `bar' whenever the `e' is added/removed. |
| 5356 | 5404 | ||
| 5405 | *** `font-lock-extend-region-functions' makes it possible to alter the way | ||
| 5406 | the fontification region is chosen. This can be used to prevent rounding | ||
| 5407 | up to whole lines, or to extend the region to include all related lines | ||
| 5408 | of multiline constructs so that such constructs get properly recognized. | ||
| 5409 | |||
| 5357 | ** Major mode mechanism changes: | 5410 | ** Major mode mechanism changes: |
| 5358 | 5411 | ||
| 5359 | +++ | 5412 | +++ |
| @@ -5448,6 +5501,9 @@ been renamed to `disabled-command-function'. The variable | |||
| 5448 | *** `emacsserver' now runs `pre-command-hook' and `post-command-hook' | 5501 | *** `emacsserver' now runs `pre-command-hook' and `post-command-hook' |
| 5449 | when it receives a request from emacsclient. | 5502 | when it receives a request from emacsclient. |
| 5450 | 5503 | ||
| 5504 | +++ | ||
| 5505 | *** `current-idle-time' reports how long Emacs has been idle. | ||
| 5506 | |||
| 5451 | ** Lisp file loading changes: | 5507 | ** Lisp file loading changes: |
| 5452 | 5508 | ||
| 5453 | +++ | 5509 | +++ |
| @@ -21,7 +21,7 @@ a window doesn't select it. | |||
| 21 | but if you type M-n you should get the visited file name of the | 21 | but if you type M-n you should get the visited file name of the |
| 22 | current buffer. | 22 | current buffer. |
| 23 | 23 | ||
| 24 | ** whitespace-cleanup should work only on the region if the region is active. | 24 | ** describe-face should show an example of text in the face. |
| 25 | 25 | ||
| 26 | ** Distribute a bar cursor of width > 1 evenly between the two glyphs | 26 | ** Distribute a bar cursor of width > 1 evenly between the two glyphs |
| 27 | on each side of the bar (what to do at the edges?). | 27 | on each side of the bar (what to do at the edges?). |
| @@ -125,6 +125,9 @@ current buffer. | |||
| 125 | 125 | ||
| 126 | ** Internationalize Emacs's messages. | 126 | ** Internationalize Emacs's messages. |
| 127 | 127 | ||
| 128 | ** Set up a facility to save backtraces when errors happen during | ||
| 129 | specified filters, specified timers, and specified hooks. | ||
| 130 | |||
| 128 | ** Install mmc@maruska.dyndns.org's no-flicker change. | 131 | ** Install mmc@maruska.dyndns.org's no-flicker change. |
| 129 | 132 | ||
| 130 | ** Add a "current vertical pixel level" value that goes with point, | 133 | ** Add a "current vertical pixel level" value that goes with point, |
diff --git a/etc/TUTORIAL b/etc/TUTORIAL index 5748d0d4e5e..63e5d601fed 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 | |||
| 217 | to scroll it down again, you can give an argument to M-v. | 217 | to scroll it down again, you can give an argument to M-v. |
| 218 | 218 | ||
| 219 | If you are using a windowed display, such as X11 or MS-Windows, there | 219 | If you are using a windowed display, such as X11 or MS-Windows, there |
| 220 | should be a tall rectangular area called a scroll bar at the left hand | 220 | should be a tall rectangular area called a scroll bar at the |
| 221 | side of the Emacs window. You can scroll the text by clicking the | 221 | side of the Emacs window. You can scroll the text by clicking the |
| 222 | mouse in the scroll bar. | 222 | mouse in the scroll bar. |
| 223 | 223 | ||
| @@ -644,18 +644,18 @@ session--this is the command C-x C-c. (Do not worry about losing | |||
| 644 | changes you have made; C-x C-c offers to save each changed file before | 644 | changes you have made; C-x C-c offers to save each changed file before |
| 645 | it kills the Emacs.) | 645 | it kills the Emacs.) |
| 646 | 646 | ||
| 647 | C-z is the command to exit Emacs *temporarily*--so that you can go | 647 | If you are using a graphical display that supports multiple |
| 648 | back to the same Emacs session afterward. | 648 | applications in parallel, you don't need any special command to move |
| 649 | 649 | from Emacs to another application. You can do this with the mouse or | |
| 650 | On systems which allow it, C-z "suspends" Emacs; that is, it returns | 650 | with window manager commands. However, if you're using a text |
| 651 | to the shell but does not destroy the Emacs. In the most common | 651 | terminal which can only show one application at a time, you need to |
| 652 | shells, you can resume Emacs with the `fg' command or with `%emacs'. | 652 | "suspend" Emacs to move to any other program. |
| 653 | 653 | ||
| 654 | On systems which do not implement suspending, C-z creates a subshell | 654 | C-z is the command to exit Emacs *temporarily*--so that you can go |
| 655 | running under Emacs to give you the chance to run other programs and | 655 | back to the same Emacs session afterward. When Emacs is running on a |
| 656 | return to Emacs afterward; it does not truly "exit" from Emacs. In | 656 | text terminal, C-z "suspends" Emacs; that is, it returns to the shell |
| 657 | this case, the shell command `exit' is the usual way to get back to | 657 | but does not destroy the Emacs. In the most common shells, you can |
| 658 | Emacs from the subshell. | 658 | resume Emacs with the `fg' command or with `%emacs'. |
| 659 | 659 | ||
| 660 | The time to use C-x C-c is when you are about to log out. It's also | 660 | The time to use C-x C-c is when you are about to log out. It's also |
| 661 | the right thing to use to exit an Emacs invoked under mail handling | 661 | the right thing to use to exit an Emacs invoked under mail handling |
diff --git a/etc/TUTORIAL.cn b/etc/TUTORIAL.cn index a1589aa0cd7..7ba8d808c2d 100644 --- a/etc/TUTORIAL.cn +++ b/etc/TUTORIAL.cn | |||
| @@ -165,7 +165,7 @@ M-comma£¨META ¶ººÅ£©¡£ | |||
| 165 | ´ó²¿·ÖµÄ Emacs ÃüÁî½ÓÊÜÊý×Ö²ÎÊý£¬²¢ÇÒ¶ÔÓÚ¶àÊýÃüÁî¶øÑÔ£¬ÕâЩÊý×Ö²ÎÊýµÄ×÷ | 165 | ´ó²¿·ÖµÄ Emacs ÃüÁî½ÓÊÜÊý×Ö²ÎÊý£¬²¢ÇÒ¶ÔÓÚ¶àÊýÃüÁî¶øÑÔ£¬ÕâЩÊý×Ö²ÎÊýµÄ×÷ |
| 166 | ÓÃÊÇÖ¸¶¨ÃüÁîµÄÖØ¸´´ÎÊý¡£ÎªÒ»¸öÃüÁîÖ¸¶¨Êý×Ö²ÎÊý£¨Ò²¾ÍÊÇÖØ¸´´ÎÊý£©µÄ·½·¨ | 166 | ÓÃÊÇÖ¸¶¨ÃüÁîµÄÖØ¸´´ÎÊý¡£ÎªÒ»¸öÃüÁîÖ¸¶¨Êý×Ö²ÎÊý£¨Ò²¾ÍÊÇÖØ¸´´ÎÊý£©µÄ·½·¨ |
| 167 | ÊÇ£ºÏÈÊäÈë C-u£¬È»ºóÊäÈëÊý×Ö×÷Ϊ²ÎÊý£¬×îºóÔÙÊäÈëÃüÁî¡£Èç¹ûÄãÓÐMETA £¨»ò | 167 | ÊÇ£ºÏÈÊäÈë C-u£¬È»ºóÊäÈëÊý×Ö×÷Ϊ²ÎÊý£¬×îºóÔÙÊäÈëÃüÁî¡£Èç¹ûÄãÓÐMETA £¨»ò |
| 168 | EDIT »ò ALT£©¼ü£¬ÄÇô»¹ÓÐÁíÒ»ÖÖ°ì·¨£º°´×¡ META ¼ü²»¶¯£¬È»ºóÊäÈëÊý×Ö¡£²» | 168 | EDIT »ò ALT£©¼ü£¬ÄÇô»¹ÓÐÁíÒ»ÖÖ°ì·¨£º°´×¡ META ¼ü²»·Å£¬È»ºóÊäÈëÊý×Ö¡£²» |
| 169 | ¹ýÎÒÃÇ»¹Êǽ¨ÒéÄãÓà C-u£¬ÒòΪËüÔÚÈκÎÖÕ¶Ë»úÉ϶¼ÄÜÓá£ÕâÖÖÊý×Ö²ÎÊýÒ²³ÆÎª | 169 | ¹ýÎÒÃÇ»¹Êǽ¨ÒéÄãÓà C-u£¬ÒòΪËüÔÚÈκÎÖÕ¶Ë»úÉ϶¼ÄÜÓá£ÕâÖÖÊý×Ö²ÎÊýÒ²³ÆÎª |
| 170 | ¡°Ç°×º²ÎÊý¡±£¬Òâ˼ÊÇ˵Õâ¸ö²ÎÊýÊÇÏÈÓÚʹÓÃËüµÄÃüÁî¶øÊäÈëµÄ¡£ | 170 | ¡°Ç°×º²ÎÊý¡±£¬Òâ˼ÊÇ˵Õâ¸ö²ÎÊýÊÇÏÈÓÚʹÓÃËüµÄÃüÁî¶øÊäÈëµÄ¡£ |
| 171 | 171 | ||
| @@ -174,9 +174,9 @@ EDIT »ò ALT£©¼ü£¬ÄÇô»¹ÓÐÁíÒ»ÖÖ°ì·¨£º°´×¡ META ¼ü²»¶¯£¬È»ºóÊäÈëÊý×Ö¡£²» | |||
| 174 | >> Ϊ C-n »òÕß C-p Ö¸¶¨Ò»¸öÊý×Ö²ÎÊý£¬ÕâÑùÄã¿ÉÒÔÖ»ÓÃÒ»¸öÃüÁî¾Í°Ñ¹â±êÒÆ¶¯ | 174 | >> Ϊ C-n »òÕß C-p Ö¸¶¨Ò»¸öÊý×Ö²ÎÊý£¬ÕâÑùÄã¿ÉÒÔÖ»ÓÃÒ»¸öÃüÁî¾Í°Ñ¹â±êÒÆ¶¯ |
| 175 | µ½±¾Ðеĸ½½ü¡£ | 175 | µ½±¾Ðеĸ½½ü¡£ |
| 176 | 176 | ||
| 177 | ËäÈ»´ó²¿·ÖÃüÁîÓÃÊý×Ö²ÎÊýÀ´×÷ΪÆäÖØ¸´´ÎÊý£¬µ«ÊÇÒ²ÓÐЩÃüÁîÀýÍ⣬ËüÃǽ«Êý | 177 | ËäÈ»´ó²¿·ÖÃüÁî°ÑÊý×Ö²ÎÊý½âÊÍΪÆäÖØ¸´´ÎÊý£¬µ«ÊÇÒ²ÓÐЩÃüÁîÀýÍ⣬ËüÃǽ«Êý |
| 178 | ×Ö²ÎÊýÁí×öËüÓᣱÈÈçÓÐЩÃüÁĿǰ»¹Ã»Ñ§µ½£©½ö½ö½«Ç°×º²ÎÊý×÷Ϊһ¸ö±ê | 178 | ×Ö²ÎÊýÁí×öËüÓᣱÈÈçÓÐЩÃüÁÎÒÃÇĿǰ»¹Ã»Ñ§µ½£©½ö½ö½«Ç°×º²ÎÊý×÷Ϊһ¸ö |
| 179 | Ö¾¡ª¡ªÖ»ÒªÓÐÒ»¸öǰ׺²ÎÊý³öÏÖ£¬²»¹ÜÆäֵΪºÎ£¬ÃüÁîµÄ¹¦Äܶ¼»á¸Ä±ä¡£ | 179 | ±êÖ¾¡ª¡ªÖ»Òª¸ø³öÓÐÒ»¸öǰ׺²ÎÊý£¬²»¹ÜÆäֵΪºÎ£¬Ëü¶¼»á¸Ä±äÃüÁîµÄ¹¦ÄÜ¡£ |
| 180 | 180 | ||
| 181 | ¶ø C-v ºÍ M-v ÔòÊôÓÚÁíÒ»ÖÖÀàÐ͵ÄÀýÍâ¡£µ±¸ø¶¨Ò»¸ö²ÎÊýʱ£¬ËüÃǽ«¹ö¶¯ÄãÖ¸ | 181 | ¶ø C-v ºÍ M-v ÔòÊôÓÚÁíÒ»ÖÖÀàÐ͵ÄÀýÍâ¡£µ±¸ø¶¨Ò»¸ö²ÎÊýʱ£¬ËüÃǽ«¹ö¶¯ÄãÖ¸ |
| 182 | ¶¨µÄ¡°ÐÐÊý¡±£¬¶ø²»ÊÇ¡°ÆÁÊý¡±¡£¾ÙÀýÀ´Ëµ£¬C-u 8 C-v ½«ÆÁÄ»ÏòϹö¶¯ 8 ÐУ¬ | 182 | ¶¨µÄ¡°ÐÐÊý¡±£¬¶ø²»ÊÇ¡°ÆÁÊý¡±¡£¾ÙÀýÀ´Ëµ£¬C-u 8 C-v ½«ÆÁÄ»ÏòϹö¶¯ 8 ÐУ¬ |
| @@ -188,8 +188,8 @@ EDIT »ò ALT£©¼ü£¬ÄÇô»¹ÓÐÁíÒ»ÖÖ°ì·¨£º°´×¡ META ¼ü²»¶¯£¬È»ºóÊäÈëÊý×Ö¡£²» | |||
| 188 | ÒÔ¸ø¶¨Ò»¸ö²ÎÊýÈ»ºóÖ´ÐÐ M-v¡£ | 188 | ÒÔ¸ø¶¨Ò»¸ö²ÎÊýÈ»ºóÖ´ÐÐ M-v¡£ |
| 189 | 189 | ||
| 190 | Èç¹ûÄãÕýÔÚʹÓÃÒ»¸ö´°¿Úϵͳ£¬±ÈÈç X11 »òÕß΢ÈíµÄ Windows£¬ÄÇôÔÚ Emacs | 190 | Èç¹ûÄãÕýÔÚʹÓÃÒ»¸ö´°¿Úϵͳ£¬±ÈÈç X11 »òÕß΢ÈíµÄ Windows£¬ÄÇôÔÚ Emacs |
| 191 | ´°¿ÚµÄ×ó±ß»òÕßÓÒ±ßÓ¦¸ÃÓÐÒ»¸ö³¤·½ÐεÄÇøÓò½Ð¡°¹ö¶¯Ìõ¡±£¬Äã¿ÉÒÔÓÃÊó±ê²Ù×Ý | 191 | ´°¿ÚµÄ±ßÔµÓ¦¸ÃÓÐÒ»¸ö³¤·½ÐεÄÇøÓò½Ð¡°¹ö¶¯Ìõ¡±£¬Äã¿ÉÒÔÓÃÊó±ê²Ù×ݹö¶¯ÌõÀ´ |
| 192 | ¹ö¶¯ÌõÀ´¹ö¶¯ÎÄ×Ö¡£ | 192 | ¹ö¶¯ÎÄ×Ö¡£ |
| 193 | 193 | ||
| 194 | >> ÊÔ×ÅÔÚ¡°¹ö¶¯ÌõÄڵķ´°×ÇøÓò¡±Éϰ´Ò»ÏÂÊó±êÖмü¡£ | 194 | >> ÊÔ×ÅÔÚ¡°¹ö¶¯ÌõÄڵķ´°×ÇøÓò¡±Éϰ´Ò»ÏÂÊó±êÖмü¡£ |
| 195 | ÎÄ×ÖÓ¦¸Ã»á¹ö¶¯µ½Êó±êËùָʾµÄλÖᣠ| 195 | ÎÄ×ÖÓ¦¸Ã»á¹ö¶¯µ½Êó±êËùָʾµÄλÖᣠ|
| @@ -202,10 +202,10 @@ EDIT »ò ALT£©¼ü£¬ÄÇô»¹ÓÐÁíÒ»ÖÖ°ì·¨£º°´×¡ META ¼ü²»¶¯£¬È»ºóÊäÈëÊý×Ö¡£²» | |||
| 202 | * ÔÚ EMACS ʧȥÏìÓ¦µÄʱºò£¨WHEN EMACS IS HUNG£© | 202 | * ÔÚ EMACS ʧȥÏìÓ¦µÄʱºò£¨WHEN EMACS IS HUNG£© |
| 203 | ----------------------------------------------- | 203 | ----------------------------------------------- |
| 204 | 204 | ||
| 205 | Èç¹û Emacs ¶ÔÄãµÄÃüÁîʧȥÏìÓ¦£¬Äã¿ÉÒԺܰ²È«µØÓà C-g À´ÖÕÖ¹Õâ¸öÃüÁî¡£ | 205 | Èç¹û Emacs ¶ÔÄãµÄÃüÁîʧȥÏìÓ¦£¬Äã¿ÉÒÔÓà C-g À´°²È«µØÖÕÖ¹ÕâÌõÃüÁî¡£C-g |
| 206 | C-g Ò²¿ÉÒÔ±»ÓÃÀ´ÖÕÖ¹Ò»¸öÖ´Ðйý¾ÃµÄÃüÁî¡£ | 206 | Ò²¿ÉÒÔÖÕÖ¹Ò»ÌõÖ´Ðйý¾ÃµÄÃüÁî¡£ |
| 207 | 207 | ||
| 208 | C-g »¹¿ÉÒÔ±»À´È¡ÏûÊý×Ö²ÎÊýºÍÄÇЩÊäÈëµ½Ò»°ëµÄÃüÁî¡£ | 208 | C-g »¹¿ÉÒÔÈ¡ÏûÊý×Ö²ÎÊýºÍÖ»ÊäÈëµ½Ò»°ëµÄÃüÁî¡£ |
| 209 | 209 | ||
| 210 | >> ÊäÈë C-u 100 É趨һ¸öֵΪ 100 µÄÊý×Ö²ÎÊý£¬È»ºó°´ C-g¡£ | 210 | >> ÊäÈë C-u 100 É趨һ¸öֵΪ 100 µÄÊý×Ö²ÎÊý£¬È»ºó°´ C-g¡£ |
| 211 | ÏÖÔÚÔÙ°´ C-f£¬¹â±êÓ¦¸ÃÖ»»áÒÆ¶¯Ò»¸ö×Ö·û£¬ÒòΪÄãÒѾÓà C-g È¡ÏûÁ˲ÎÊý¡£ | 211 | ÏÖÔÚÔÙ°´ C-f£¬¹â±êÓ¦¸ÃÖ»»áÒÆ¶¯Ò»¸ö×Ö·û£¬ÒòΪÄãÒѾÓà C-g È¡ÏûÁ˲ÎÊý¡£ |
| @@ -219,16 +219,16 @@ C-g »¹¿ÉÒÔ±»À´È¡ÏûÊý×Ö²ÎÊýºÍÄÇЩÊäÈëµ½Ò»°ëµÄÃüÁî¡£ | |||
| 219 | ----------------------------------- | 219 | ----------------------------------- |
| 220 | 220 | ||
| 221 | ÓÐһЩ Emacs ÃüÁî±»¡°½ûÓá±ÁË£¬ÒÔ±ÜÃâ³õѧÕßÔÚ²»Á˽âÆäÈ·Çй¦ÄܵÄÇé¿öÏÂÎó | 221 | ÓÐһЩ Emacs ÃüÁî±»¡°½ûÓá±ÁË£¬ÒÔ±ÜÃâ³õѧÕßÔÚ²»Á˽âÆäÈ·Çй¦ÄܵÄÇé¿öÏÂÎó |
| 222 | ÓÃÕâЩÃüÁÔì³ÉÂé·³¡£ | 222 | ÓÃËüÃÇ£¬Ôì³ÉÂé·³¡£ |
| 223 | 223 | ||
| 224 | Èç¹ûÄãÓõ½ÁËÒ»¸ö±»½ûÓõÄÃüÁEmacs »áÏÔʾһ¸öÌáʾÏûÏ¢£¬¸æËßÄãÕâ¸öÃüÁî | 224 | Èç¹ûÄãÓõ½ÁËÒ»¸ö±»½ûÓõÄÃüÁEmacs »áÏÔʾһ¸öÌáʾÏûÏ¢£¬¸æËßÄãÕâ¸öÃüÁî |
| 225 | µ½µ×ÊǸÉʲôµÄ£¬Ñ¯ÎÊÄãÊÇ·ñÒª¼ÌÐø£¬²¢Ôڵõ½ÄãµÄ¿Ï¶¨Ö®ºóÔÙÖ´ÐÐÕâÃüÁî¡£ | 225 | µ½µ×ÊǸÉʲôµÄ£¬Ñ¯ÎÊÄãÊÇ·ñÒª¼ÌÐø£¬²¢Ôڵõ½ÄãµÄ¿Ï¶¨Ö®ºóÔÙÖ´ÐÐÕâÃüÁî¡£ |
| 226 | 226 | ||
| 227 | ÄãÒªÊÇÕæµÄÏëÖ´Ðб»½ûÓõÄÃüÁÄÇôÔÚ Emacs ѯÎÊÄãµÄʱºòÓ¦¸Ã°´¿Õ¸ñ¡£Ò»°ã | 227 | Èç¹ûÄãÕæµÄÏëÓÃÕâÌõÃüÁÔÚ Emacs ѯÎÊÄãµÄʱºòÓ¦¸Ã°´¿Õ¸ñ¡£Ò»°ãÀ´Ëµ£¬Èç¹û |
| 228 | À´Ëµ£¬Èç¹ûÄã²»ÏëÖ´ÐУ¬°´¡°n¡±¾ÍÐÐÁË¡£ | 228 | Äã²»ÏëÓ㬾Ͱ´¡°n¡±¡£ |
| 229 | 229 | ||
| 230 | >> ÊÔÊÔ C-x C-l £¨ÕâÊÇÒ»¸ö±»½ûÓõÄÃüÁ | 230 | >> ÊÔÊÔ C-x C-l £¨ÕâÊÇÒ»¸ö±»½ûÓõÄÃüÁ |
| 231 | È»ºóÓà n À´»Ø´ðÎÊÌâ¡£ | 231 | È»ºóÓà n À´»Ø´ðѯÎÊ¡£ |
| 232 | 232 | ||
| 233 | 233 | ||
| 234 | * ´°¸ñ£¨WINDOWS£© | 234 | * ´°¸ñ£¨WINDOWS£© |
| @@ -245,7 +245,7 @@ Emacs ¿ÉÒÔÓжà¸ö´°¸ñ£¬Ã¿¸ö´°¸ñ¶¼ÏÔʾ²»Í¬µÄÎÄ×Ö¡£ÎÒÃǺóÃæÔÙ½éÉÜÔõô¶Ô¸¶ | |||
| 245 | >> °Ñ¹â±êÒÆµ½±¾ÐÐÈ»ºóÊäÈë C-u 0 C-l¡£ | 245 | >> °Ñ¹â±êÒÆµ½±¾ÐÐÈ»ºóÊäÈë C-u 0 C-l¡£ |
| 246 | 246 | ||
| 247 | >> ÊäÈë CONTROL-h k CONTROL-f¡£¹Û²ìµ±Ò»¸öд°¸ñ³öÏÖʱµ±Ç°´°¸ñ£¨ÓÃÀ´ÏÔʾ | 247 | >> ÊäÈë CONTROL-h k CONTROL-f¡£¹Û²ìµ±Ò»¸öд°¸ñ³öÏÖʱµ±Ç°´°¸ñ£¨ÓÃÀ´ÏÔʾ |
| 248 | CONTROL-f ÃüÁîµÄÎĵµ£©ÊÇÈçºÎËõСµÄ¡£ | 248 | CONTROL-f ÃüÁîµÄÎĵµ£©ÊÇÈçºÎ±äСµÄ¡£ |
| 249 | 249 | ||
| 250 | >> ÊäÈë C-x 1 ¹ØµôÎĵµ´°¸ñ¡£ | 250 | >> ÊäÈë C-x 1 ¹ØµôÎĵµ´°¸ñ¡£ |
| 251 | 251 | ||
| @@ -265,33 +265,33 @@ Emacs ÊÓΪÎÄ×Ö²¢ÇÒ¿ÉÒÔÖ±½Ó²åÈë¡£Çà <Return>£¨»Ø³µ¼ü£©»á²åÈëÒ»¸ö»»Ðзû¡£ | |||
| 265 | Ó÷¨Ó¦¸ÃÒ»Ñù¡£Ò»°ãÀ´Ëµ <Delback> ¾ÍÊÇλÓÚ <Return> ¼üÉÏ·½Ä³´¦µÄÒ»¸ö´óºÅ | 265 | Ó÷¨Ó¦¸ÃÒ»Ñù¡£Ò»°ãÀ´Ëµ <Delback> ¾ÍÊÇλÓÚ <Return> ¼üÉÏ·½Ä³´¦µÄÒ»¸ö´óºÅ |
| 266 | ¼ü£¬Í¨³£±»±êʾΪ¡°Delete¡±¡¢¡°Del¡±»òÕß¡°Backspace¡±¡£ | 266 | ¼ü£¬Í¨³£±»±êʾΪ¡°Delete¡±¡¢¡°Del¡±»òÕß¡°Backspace¡±¡£ |
| 267 | 267 | ||
| 268 | Èç¹ûÄãÕÒµ½Á˱ê×Å¡°Backspace¡±µÄ¼ü£¬ÄÇôËüÓ¦¸Ã¾ÍÊÇ <Delback>£»¼´±ãÄãÓÖÔÚ | 268 | Èç¹ûÄãÕÒµ½ÁË¡°Backspace¡±¼ü£¬ÄÇôËüÓ¦¸Ã¾ÍÊÇ <Delback>£»ÄÄÅÂÄãÓÖÔÚ±ðµÄµØ |
| 269 | ¼üÅÌÆäËüµØ·½ÕÒµ½ÁËÒ»¸ö±êʾΪ¡°Del¡±µÄ¼ü£¬ÄÇôËüÒ²Ó¦¸Ã²»ÊÇ <Delback>¡£ | 269 | ·½ÕÒµ½ÁËÒ»¸ö¡°Del¡±¼ü£¬ÄÇôËüÒ²Ó¦¸Ã²»ÊÇ <Delback>¡£ |
| 270 | 270 | ||
| 271 | Ò»ÖÖ¸üͨÓõÄ˵·¨ÊÇ£¬<Delback> ½«Î»ÓÚ¹â±êǰµÄÒ»¸ö×Ö·ûɾ³ý¡£ | 271 | Ò»ÖÖ¸üͨÓõÄ˵·¨ÊÇ£¬<Delback> ½«É¾³ýλÓÚ¹â±êǰµÄÒ»¸ö×Ö·û¡£ |
| 272 | 272 | ||
| 273 | >> ÏÖÔÚ¾ÍÊÔÊÔ¡ª¡ªÇõã×Ö£¬È»ºó°´¼¸Ï <Delback> ɾ³ýËüÃÇ¡£ | 273 | >> ÏÖÔÚ¾ÍÊÔÊÔ¡ª¡ªÇõã×Ö£¬È»ºó°´¼¸Ï <Delback> ɾ³ýËüÃÇ¡£ |
| 274 | ²»Óõ£ÐÄÄã»áÐÞ¸ÄÎļþ£¬Äã¸Éʲô¶¼Ã»¹ØÏµ£¬ÕâÀï¾ÍÊÇר¸øÄãÁ·Ï°Óõġ£ | 274 | ²»Óõ£ÐÄÄã»áÐÞ¸ÄÎļþ£¬Äã¸Éʲô¶¼Ã»¹ØÏµ£¬ÕâÀï¾ÍÊÇר¸øÄãÁ·Ï°Óõġ£ |
| 275 | 275 | ||
| 276 | Èç¹ûÒ»ÐÐÎÄ×ֺܳ¤¡¢³¬³öÁË´°¸ñµÄ¿í¶È£¬ÏÔʾ²»ÏµIJ¿·Ö»áÔÚ½ôÁÚµÄÏÂÒ»ÐмÌÐø | 276 | Èç¹ûÒ»ÐÐÎÄ×ֺܳ¤¡¢³¬³öÁË´°¸ñµÄ¿í¶È£¬ÏÔʾ²»ÏµIJ¿·Ö»áÔÚ½ôÁÚµÄÏÂÒ»ÐмÌÐø |
| 277 | ÏÔʾ¡£Õâʱ»áÓÐÒ»¸ö·´Ð±Ïߣ¨¿ØÖÆÌ¨ÏÂÊÇ·´Ð±Ïߣ¬Èç¹ûÄãÓÃͼÐδ°¿Úϵͳ£¬ÔòÓ¦ | 277 | ÏÔʾ¡£Õâʱ»áÓÐÒ»¸ö·´Ð±Ïߣ¨ÔÚ¿ØÖÆÌ¨ÏÂÊÇ·´Ð±Ïߣ¬Èç¹ûÄãÓÃͼÐδ°¿Úϵͳ£¬Ôò |
| 278 | ¸ÃÊÇÒ»¸öССµÄתÍä¼ýÍ·£©ÏÔʾÔÚÓÒ±ßÑØ£¬±íÃ÷ÕâÊÇijһÐеĽÓÐøÏÔʾ¡£ | 278 | Ó¦¸ÃÊÇÒ»¸öССµÄתÍä¼ýÍ·£©ÏÔʾÔÚÓÒ±ßÑØ£¬±íÃ÷ÕâÊÇijһÐеĽÓÐøÏÔʾ¡£ |
| 279 | 279 | ||
| 280 | >> ÊäÈëÎÄ×Ö£¬Ò»Ö±µ½ÆÁÄ»µÄÓұ߽磬Ȼºó¼ÌÐø£¬Äã»á¿´µ½Ò»¸ö½ÓÐøÐгöÏÖ¡£ | 280 | >> ÊäÈëÎÄ×Ö£¬Ò»Ö±µ½ÆÁÄ»µÄÓұ߽磬Ȼºó¼ÌÐø£¬Äã»á¿´µ½Ò»¸ö½ÓÐøÐгöÏÖ¡£ |
| 281 | 281 | ||
| 282 | >> Óà <Delback> ɾµôһЩÎÄ×Ö£¬Ö±µ½´ËÐ㤶ÈСÓÚ´°¸ñ¿í¶È£¬½ÓÐøÐоÍÏûʧÁË¡£ | 282 | >> Óà <Delback> ɾµôһЩÎÄ×Ö£¬Ö±µ½´ËÐ㤶ÈСÓÚ´°¸ñ¿í¶È£¬½ÓÐøÐоÍÏûʧÁË¡£ |
| 283 | 283 | ||
| 284 | Äã¿ÉÒÔÏñɾ³ýÆäËû×Ö·ûÒ»Ñùɾ³ý»»Ðзû¡£É¾³ýÁ½ÐÐÖмäµÄ»»Ðзû»á½«Á½Ðкϲ¢³É | 284 | »»Ðзû¸úÆäËû×Ö·ûÒ»Ñù¿ÉÒÔ±»É¾³ý¡£Á½ÐÐÖмäµÄ»»Ðзû±»É¾³ýºó£¬ÕâÁ½Ðн«»áºÏ |
| 285 | Ò»ÐС£Èç¹ûºÏ²¢µÄ½á¹ûʹÕâÒ»ÐÐÌ«³¤£¬³¬³öÁË´°¸ñµÄ¿í¶È£¬Ëü¾Í»áÒÔÒ»¸ö½ÓÐøÐÐ | 285 | ²¢³ÉÒ»ÐС£Èç¹ûºÏ²¢ºóµÄÕâÒ»ÐÐÌ«³¤£¬³¬³öÁË´°¸ñ¿í¶È£¬Ëü¾Í»áÒÔÒ»¸ö½ÓÐøÐÐÀ´ |
| 286 | À´ÏÔʾ¡£ | 286 | ÏÔʾ¡£ |
| 287 | 287 | ||
| 288 | >> ÒÆ¶¯¹â±êµ½±¾ÐеĿªÍ·²¢ÊäÈë <Delback>¡£ | 288 | >> ÒÆ¶¯¹â±êµ½Ä³ÐеĿªÍ·²¢ÊäÈë <Delback>¡£ |
| 289 | Õâʱ±¾ÐÐÓëÆäǰһÐн«±»ºÏ²¢ÎªÒ»ÐС£ | 289 | Õâʱ¸ÃÐн«ÓëÆäǰһÐÐÒ»Æð±»ºÏ²¢ÎªÒ»ÐС£ |
| 290 | 290 | ||
| 291 | >> ÊäÈë <Return> ÖØÐ²åÈëÄã¸Õ²Åɾ³ýµÄ»»Ðзû¡£ | 291 | >> ÊäÈë <Return> ÖØÐ²åÈëÄã¸Õ²Åɾ³ýµÄ»»Ðзû¡£ |
| 292 | 292 | ||
| 293 | Ç°ÃæËµ¹ý£¬´ó²¿·ÖµÄ Emacs ÃüÁî¶¼¿ÉÒÔÖ¸¶¨Öظ´´ÎÊý£¬ÕâÆäÖÐÒ²°üÀ¨ÊäÈë×Ö·ûµÄ | 293 | Ç°Ãæ½²¹ý£¬´ó²¿·ÖµÄ Emacs ÃüÁî¶¼¿ÉÒÔÖ¸¶¨Öظ´´ÎÊý£¬ÕâÆäÖÐÒ²°üÀ¨ÊäÈë×Ö·ûµÄ |
| 294 | ÃüÁî¡£ÖØ¸´Ö´ÐÐÊäÈë×Ö·ûµÄÃüÁîʵ¼ÊÉϾÍÊÇÊäÈë¶à¸öÒ»ÑùµÄ×Ö·û¡£ | 294 | ÃüÁî¡£ÖØ¸´Ö´ÐÐÊäÈë×Ö·ûµÄÃüÁîʵ¼ÊÉϾÍÊÇÊäÈë¶à¸öÏàͬµÄ×Ö·û¡£ |
| 295 | 295 | ||
| 296 | >> ÊÔÊÔ C-u 8 *£¬Õ⽫»á²åÈë ********¡£ | 296 | >> ÊÔÊÔ C-u 8 *£¬Õ⽫»á²åÈë ********¡£ |
| 297 | 297 | ||
| @@ -329,10 +329,10 @@ C-SPC ÍùÍù±»ÖÐÎÄÓû§É趨³ÉÊäÈë·¨Èȼü£¬Èç¹ûÕâÑù£¬C-SPC ¾Í±»ÏµÍ³À¹½Ø¶øÎÞ | |||
| 329 | ×¢Òâ,¡°ÒƳý£¨kill£©¡±ºÍ¡°É¾³ý£¨delete£©¡±µÄ²»Í¬ÔÚÓÚ±»ÒƳýµÄ¶«Î÷¿ÉÒÔÕÒ»Ø | 329 | ×¢Òâ,¡°ÒƳý£¨kill£©¡±ºÍ¡°É¾³ý£¨delete£©¡±µÄ²»Í¬ÔÚÓÚ±»ÒƳýµÄ¶«Î÷¿ÉÒÔÕÒ»Ø |
| 330 | À´£¬¶ø±»É¾³ýµÄ¾Í²»ÐÐÁË¡£¡¾Êµ¼ÊÉÏ£¬ÒƳýµôµÄ¶«Î÷ËäÈ»¿´ÆðÀ´¡°Ïûʧ¡±ÁË£¬µ« | 330 | À´£¬¶ø±»É¾³ýµÄ¾Í²»ÐÐÁË¡£¡¾Êµ¼ÊÉÏ£¬ÒƳýµôµÄ¶«Î÷ËäÈ»¿´ÆðÀ´¡°Ïûʧ¡±ÁË£¬µ« |
| 331 | ʵ¼ÊÉϱ» Emacs ¼Ç¼ÁËÏÂÀ´£¬Òò´Ë»¹¿ÉÒÔÕÒ»ØÀ´£»¶øÉ¾³ýµôµÄ¶«Î÷ËäȻҲ¿ÉÄÜ»¹ | 331 | ʵ¼ÊÉϱ» Emacs ¼Ç¼ÁËÏÂÀ´£¬Òò´Ë»¹¿ÉÒÔÕÒ»ØÀ´£»¶øÉ¾³ýµôµÄ¶«Î÷ËäȻҲ¿ÉÄÜ»¹ |
| 332 | ÔÚÄÚ´æÀµ«ÊÇÒѾ±»Emacs¡°Åׯú¡±ÁË£¬ËùÒÔ¾ÍÕÒ²»»ØÀ´ÁË¡£¡¿ÖØÐ²åÈë±»ÒÆ³ý | 332 | ÔÚÄÚ´æÀµ«ÊÇÒѾ±» Emacs¡°Åׯú¡±ÁË£¬ËùÒÔ¾ÍÕÒ²»»ØÀ´ÁË¡£¡¿ÖØÐ²åÈë±»ÒÆ |
| 333 | µÄÎÄ×Ö³ÆÎª¡°Õٻأ¨yank£©¡±¡£Ò»°ã¶øÑÔ£¬ÄÇЩ»áÈ¥³ýºÜ¶àÎÄ×ÖµÄÃüÁî»á°ÑÈ¥³ý | 333 | ³ýµÄÎÄ×Ö³ÆÎª¡°Õٻأ¨yank£©¡±¡£Ò»°ã¶øÑÔ£¬ÄÇЩ»áÈ¥³ýºÜ¶àÎÄ×ÖµÄÃüÁî»á°ÑÈ¥ |
| 334 | µôµÄÎÄ×Ö´¢´æÆðÀ´£¨ËüÃDZ»É趨³ÉÁË¡°¿ÉÕٻء±£©£¬¶øÄÇЩֻÊÇÈ¥³ýÒ»¸ö×Ö·û»ò | 334 | ³ýµôµÄÎÄ×Ö´¢´æÆðÀ´£¨ËüÃDZ»É趨³ÉÁË¡°¿ÉÕٻء±£©£¬¶øÄÇЩֻÊÇÈ¥³ýÒ»¸ö×Ö·û |
| 335 | ÕßÖ»ÊÇÈ¥³ý¿Õ°×µÄÃüÁî¾Í²»»á´¢´æÄÇЩ±»È¥³ýµôµÄ¶«Î÷£¨Òò´ËÄã¾ÍÎÞ·¨Õٻأ©¡£ | 335 | »òÕßÖ»ÊÇÈ¥³ý¿Õ°×µÄÃüÁî¾Í²»»á´¢´æ±»È¥³ýµôµÄ¶«Î÷£¨×ÔÈ»Äã¾ÍÎÞ·¨ÕÙ»ØÁË£©¡£ |
| 336 | 336 | ||
| 337 | >> ÒÆ¶¯¹â±êµ½Ò»·Ç¿Õ°×ÐеÄÐÐÍ·£¬È»ºóÊäÈë C-k ÒÆ³ýÄÇÒ»ÐÐÉϵÄÎÄ×Ö¡£ | 337 | >> ÒÆ¶¯¹â±êµ½Ò»·Ç¿Õ°×ÐеÄÐÐÍ·£¬È»ºóÊäÈë C-k ÒÆ³ýÄÇÒ»ÐÐÉϵÄÎÄ×Ö¡£ |
| 338 | 338 | ||
| @@ -409,9 +409,9 @@ C-_ Ò²Êdz·ÏúÃüÁËüµÄ×÷Óøú C-x u Ò»Ñù£¬µ«ÊÇËü±È½ÏÈÝÒ×¶à´ÎÊäÈë¡£C-_ µÄ | |||
| 409 | ´æÅÌ£¬¾ÍÒªÔÚ±à¼Ç°¡°Ñ°ÕÒ¡±µ½Ò»¸ö´æÅÌÎļþ¡££¨Õâ¸ö¹ý³Ìͨ³£Ò²±»³ÆÎª¡°·ÃÎÊ¡± | 409 | ´æÅÌ£¬¾ÍÒªÔÚ±à¼Ç°¡°Ñ°ÕÒ¡±µ½Ò»¸ö´æÅÌÎļþ¡££¨Õâ¸ö¹ý³Ìͨ³£Ò²±»³ÆÎª¡°·ÃÎÊ¡± |
| 410 | Îļþ¡££© | 410 | Îļþ¡££© |
| 411 | 411 | ||
| 412 | ѰÕÒµ½Ò»¸öÎļþÒâζ×ÅÄã¿ÉÒÔÔÚ Emacs Àï²é¿´Õâ¸öÎļþµÄÄÚÈÝ¡£´ÓºÜ¶à½Ç¶È½²£¬ | 412 | ѰÕÒµ½Ò»¸öÎļþÒâζ×ÅÄã¿ÉÒÔÔÚ Emacs Àï²é¿´Õâ¸öÎļþµÄÄÚÈÝ¡£´ÓºÜ¶à·½Ãæ½²£¬ |
| 413 | Õâ¾ÍµÈÓÚÄãÔÚÖ±½Ó±à¼Õâ¸öÎļþ¡£µ«ÊÇÄãËù×öµÄÐÞ¸ÄÖ»ÓÐÔÚ¡°´æÅÌ¡±µÄʱºò²Å»á | 413 | Õâ¾ÍµÈÓÚÄãÔÚÖ±½Ó±à¼Õâ¸öÎļþ¡£µ«ÊÇÄãËù×öµÄÐÞ¸ÄÖ»ÓÐÔÚ¡°´æÅÌ¡±µÄʱºò²Å»á |
| 414 | ±»Ð´ÈëÎļþ¡£Ò²ÕýÒòΪÈç´Ë£¬Äã¿ÉÒÔ¶ªÆúÒ»¸ö¸Äµ½Ò»°ëµÄÎļþ¶ø²»±Ø°ÑÕâ¸ö²Ð·Ï | 414 | ±»Ð´ÈëÎļþ¡£Ò²ÕýÒòΪÈç´Ë£¬Äã¿ÉÒÔ¶ªÆúÒ»¸ö¸Äµ½Ò»°ëµÄÎļþ¶ø²»±Ø°ÑÕâ¸ö²Ðȱ |
| 415 | ÎļþÒ²±£´æµ½¼ÆËã»úÉÏ¡£×îºó¾ÍËãÄãÕæÕý´æÁËÅÌ£¬Emacs Ò²»á°Ñ´æÅÌǰµÄÎļþÖØ | 415 | ÎļþÒ²±£´æµ½¼ÆËã»úÉÏ¡£×îºó¾ÍËãÄãÕæÕý´æÁËÅÌ£¬Emacs Ò²»á°Ñ´æÅÌǰµÄÎļþÖØ |
| 416 | ÃüÃû±£´æ£¬ÒÔ·ÀÄã¸ÄÍêÖ®ºóÓÖÏë·´»Ú¡£ | 416 | ÃüÃû±£´æ£¬ÒÔ·ÀÄã¸ÄÍêÖ®ºóÓÖÏë·´»Ú¡£ |
| 417 | 417 | ||
| @@ -572,10 +572,10 @@ replace-string£¨×Ö·û´®Ìæ»»£©Õâ¸öÃüÁËü»áÔÚÈ«ÎÄ·¶Î§ÄÚ°ÑÒ»¸ö×Ö·û´®Ìæ»» | |||
| 572 | ×Ö·û´®Ìæ»»ÃüÁîÐèÒªÁ½¸ö²ÎÊý¡ª¡ª±»Ìæ»»µÄ×Ö·û´®ºÍÓÃÀ´Ìæ»»ËüµÄ×Ö·û´®¡£Ã¿¸ö | 572 | ×Ö·û´®Ìæ»»ÃüÁîÐèÒªÁ½¸ö²ÎÊý¡ª¡ª±»Ìæ»»µÄ×Ö·û´®ºÍÓÃÀ´Ìæ»»ËüµÄ×Ö·û´®¡£Ã¿¸ö |
| 573 | ²ÎÊýµÄÊäÈëÓû»ÐзûÀ´½áÊø¡£ | 573 | ²ÎÊýµÄÊäÈëÓû»ÐзûÀ´½áÊø¡£ |
| 574 | 574 | ||
| 575 | >> ½«¹â±êÒÆµ½±¾ÐеÄÏÂÁ½Ðпհף¬È»ºóÊäÈë | 575 | >> ½«¹â±êÒÆµ½±¾ÐÐÏÂÃæµÚ¶þÐеĿհ״¦£¬È»ºóÊäÈë |
| 576 | M-x repl s<Return>changed<Return>altered<Return>¡£ | 576 | M-x repl s<Return>changed<Return>altered<Return>¡£ |
| 577 | 577 | ||
| 578 | ¡¾ÎªÁ˼ÌÐøÁ·Ï°£¬±£ÁôÒ»ÐÐÔÎÄÈçÏ£º | 578 | ¡¾ÒÔϱ£ÁôÒ»ÐÐÔÎÄ£¬ÒÔÓ¦Á·Ï°Ö®Ð裺 |
| 579 | Notice how this line has changed: you've replaced... ¡¿ | 579 | Notice how this line has changed: you've replaced... ¡¿ |
| 580 | 580 | ||
| 581 | Çë×¢ÒâÕâÒ»ÐÐÊÇÔõô¸Ä±äµÄ£ºÔÚ¹â±êÖ®ºóµÄ·¶Î§ÄÚ£¬ÄãÒѾ½«¡°changed¡±Õâ¸ö | 581 | Çë×¢ÒâÕâÒ»ÐÐÊÇÔõô¸Ä±äµÄ£ºÔÚ¹â±êÖ®ºóµÄ·¶Î§ÄÚ£¬ÄãÒѾ½«¡°changed¡±Õâ¸ö |
| @@ -617,7 +617,7 @@ replace-string£¨×Ö·û´®Ìæ»»£©Õâ¸öÃüÁËü»áÔÚÈ«ÎÄ·¶Î§ÄÚ°ÑÒ»¸ö×Ö·û´®Ìæ»» | |||
| 617 | ¹ûλÓÚÎļþµÄĩ⣬¾ÍÏÔʾ --Bot--¡£Èç¹ûÎļþºÜС£¬Ò»ÆÁ¾Í×ãÒÔÏÔʾȫ²¿ÄÚÈÝ£¬ | 617 | ¹ûλÓÚÎļþµÄĩ⣬¾ÍÏÔʾ --Bot--¡£Èç¹ûÎļþºÜС£¬Ò»ÆÁ¾Í×ãÒÔÏÔʾȫ²¿ÄÚÈÝ£¬ |
| 618 | ÄÇô״̬À¸»áÏÔʾ --All--¡£ | 618 | ÄÇô״̬À¸»áÏÔʾ --All--¡£ |
| 619 | 619 | ||
| 620 | L ºÍÆäºóµÄÊý×Ö¸ø³öÁ˹â±êËùÔÚÐеÄÐкš£ | 620 | ¡°L¡± ºÍÆäºóµÄÊý×Ö¸ø³öÁ˹â±êËùÔÚÐеÄÐкš£ |
| 621 | 621 | ||
| 622 | ×ͷµÄÐǺţ¨*£©±íʾÄãÒѾ¶ÔÎÄ×Ö×ö¹ý¸Ä¶¯¡£¸Õ¸Õ´ò¿ªµÄÎļþ¿Ï¶¨Ã»Óб»¸Ä¶¯ | 622 | ×ͷµÄÐǺţ¨*£©±íʾÄãÒѾ¶ÔÎÄ×Ö×ö¹ý¸Ä¶¯¡£¸Õ¸Õ´ò¿ªµÄÎļþ¿Ï¶¨Ã»Óб»¸Ä¶¯ |
| 623 | ¹ý£¬ËùÒÔ״̬À¸ÉÏÏÔʾµÄ²»ÊÇÐǺŶøÊǶÌÏߣ¨-£©¡£ | 623 | ¹ý£¬ËùÒÔ״̬À¸ÉÏÏÔʾµÄ²»ÊÇÐǺŶøÊǶÌÏߣ¨-£©¡£ |
| @@ -690,14 +690,14 @@ Emacs ¿ÉÒÔÏòǰ»òÕßÏòºóËÑË÷×Ö·û´®¡£ËÑË÷ÃüÁîÊÇÒ»¸öÒÆ¶¯¹â±êµÄÃüÁËÑË÷³É | |||
| 690 | ¹¦ºó£¬¹â±ê»áÍ£ÁôÔÚËÑË÷Ä¿±ê³öÏֵĵط½¡£ | 690 | ¹¦ºó£¬¹â±ê»áÍ£ÁôÔÚËÑË÷Ä¿±ê³öÏֵĵط½¡£ |
| 691 | 691 | ||
| 692 | Emacs µÄËÑË÷ÃüÁîµÄ¶ÀÌØÖ®´¦ÔÚÓÚ£¬ËüÊÇ¡°½¥½øµÄ£¨incremental£©¡±£¬Òâ˼ÊÇËÑ | 692 | Emacs µÄËÑË÷ÃüÁîµÄ¶ÀÌØÖ®´¦ÔÚÓÚ£¬ËüÊÇ¡°½¥½øµÄ£¨incremental£©¡±£¬Òâ˼ÊÇËÑ |
| 693 | Ë÷ÓëÊäÈëͬʱ½øÐУºÄãÔÚÕâ±ßÒ»¸ö×ÖÒ»¸ö×ÖµØÊäÈëÄãÏëËÑË÷µÄ¶«Î÷£¬Í¬Ê± Emacs | 693 | Ë÷ÓëÊäÈëͬʱ½øÐУºÄãÔÚ¼üÅÌÉÏÒ»×ÖÒ»¾äµØÊäÈëËÑË÷´ÊµÄ¹ý³ÌÖУ¬Emacs ¾ÍÒѾ |
| 694 | ÔÚÄDZ߾ÍÌæÄãËÑË÷ÁË¡£ | 694 | ¿ªÊ¼ÌæÄãËÑË÷ÁË¡£ |
| 695 | 695 | ||
| 696 | C-s ÊÇÏòǰËÑË÷£¬C-r ÊÇÏòºóËÑË÷¡£²»¹ýÊÖ±ðÕâô¿ì£¡Ïȵȵȱð׿±ÊÔ¡£ | 696 | C-s ÊÇÏòǰËÑË÷£¬C-r ÊÇÏòºóËÑË÷¡£²»¹ýÊÖ±ðÕâô¿ì£¡Ïȵȵȱð׿±ÊÔ¡£ |
| 697 | 697 | ||
| 698 | ÔÚÄã°´Ï C-s Ö®ºó£¬Äã»á·¢ÏÖ»ØÏÔÇøÀïÓС°I-search¡±×ÖÑù³öÏÖ£¬ÕâÊÇÔÚÌáʾ | 698 | ÔÚÄã°´Ï C-s Ö®ºó£¬Äã»á·¢ÏÖ»ØÏÔÇøÀïÓС°I-search¡±×ÖÑù³öÏÖ£¬ÌáʾÄãĿǰ |
| 699 | ÄãĿǰ Emacs Õý´¦ÓÚ¡°½¥½øËÑË÷¡±×´Ì¬£¬ÕýÔڵȴýÄãÊäÈëËÑË÷×Ö´®¡£<Return> | 699 | Emacs Õý´¦ÓÚ¡°½¥½øËÑË÷¡±×´Ì¬£¬ÕýÔڵȴýÄãÊäÈëËÑË÷×Ö´®¡£°´ <Return> »á½á |
| 700 | »á½áÊøËÑË÷¡£ | 700 | ÊøËÑË÷¡£ |
| 701 | 701 | ||
| 702 | >> ÊäÈë C-s ¿ªÊ¼Ò»¸öËÑË÷¡£×¢ÒâÇÃÂýÒ»µã£¬Ò»´ÎÊäÈëÒ»¸ö×Ö·û¡£ | 702 | >> ÊäÈë C-s ¿ªÊ¼Ò»¸öËÑË÷¡£×¢ÒâÇÃÂýÒ»µã£¬Ò»´ÎÊäÈëÒ»¸ö×Ö·û¡£ |
| 703 | ÂýÂýÊäÈë¡°cursor¡±Õû¸ö´Ê£¬Ã¿ÇÃÒ»¸ö×Ö¾ÍÔÝͣһϣ¬×¢Òâ¹Û²ì¹â±ê¡£ | 703 | ÂýÂýÊäÈë¡°cursor¡±Õû¸ö´Ê£¬Ã¿ÇÃÒ»¸ö×Ö¾ÍÔÝͣһϣ¬×¢Òâ¹Û²ì¹â±ê¡£ |
| @@ -917,10 +917,10 @@ Emacs ÀïÀ´£¬ÇëÓà C-z¡£¡¾Çл»µ½ shell ½ö¶Ô¿ØÖÆÌ¨Ï嵀 Emacs ÓÐЧ¡¿ | |||
| 917 | 917 | ||
| 918 | Emacs ¿ìËÙÖ¸ÄÏ£¨Tutorial£©ÔçÓÐÁ½¸öÁõÕѺêµÄÖÐÎÄÒë±¾£¬·±¼ò¸÷Ò»¡£Æä¼òÌå°æ±¾ | 918 | Emacs ¿ìËÙÖ¸ÄÏ£¨Tutorial£©ÔçÓÐÁ½¸öÁõÕѺêµÄÖÐÎÄÒë±¾£¬·±¼ò¸÷Ò»¡£Æä¼òÌå°æ±¾ |
| 919 | £¨TUTORIAL.cn£©»ù±¾ÓÉ·±Ìå°æ±¾£¨TUTORIAL.zh£©¾´ÊÓïÌæ»»¶øµÃ¡£È»¶ø·±¼òÖÐÎÄ | 919 | £¨TUTORIAL.cn£©»ù±¾ÓÉ·±Ìå°æ±¾£¨TUTORIAL.zh£©¾´ÊÓïÌæ»»¶øµÃ¡£È»¶ø·±¼òÖÐÎÄ |
| 920 | ²»½öÔÚÓôÊϰ¹ßÉÏÓÐËù²»Í¬£¬¸üÓÐÖî¶à±í´ï·½Ê½ºÍ¾ä·¨·½ÃæµÄ²îÒì¡£Òò´ËÒ»Ö±ÒÔÀ´ | 920 | ²»½öÔÚÓôÊϰ¹ßÉÏÓÐËù²»Í¬£¬¸üÓÐÖî¶à±í´ï·½Ê½Óë¾ä·¨·½ÃæµÄ²îÒ죬Òò´ËÒ»Ö±ÒÔÀ´ |
| 921 | ÔĶÁ TUTORIAL.cn ¶¼ÂÔ¾õ»ÞɬºÍÉúÓ²¡£Õâ´ÎÖØÐ·Òë TUTORIAL.cn µÄ¶¯»úÕýÊÇÔ´ | 921 | Óû§Ê¹Óà TUTORIAL.cn ¶¼»áÂÔ¾õÉúÓ²ºÍ»Þɬ¡£Õâ´ÎÖØÐ·Òë TUTORIAL.cn µÄ¶¯»ú |
| 922 | ÓÚÕâÖÖÌåÑ飬ϣÍûÎÒÃǵŤ×÷Äܹ»Èñ¾ÎĸüºÃµÄ·¢»ÓÆäÓ¦ÓеÄ×÷Óá£TUTORIAL.zh | 922 | ÕýÊÇÔ´ÓÚÕâÖÖÌåÑ飬ϣÍûÎÒÃǵŤ×÷Äܹ»Èñ¾ÎĸüºÃµØ·¢»ÓÆä×÷Óá£TUTORIAL.zh |
| 923 | µÄÒëÎÄÖÊÁ¿ºÜ¸ß£¬ÔÚ·Òë¹ý³ÌÖиøÓè¹ýÎÒÃǺܶà½è¼øºÍ²Î¿¼£¬Ôڴ˶ÔÁõÕѺêµÄ¹¤×÷ | 923 | µÄÒëÎÄÖÊÁ¿ºÜ¸ß£¬ÔÚ·Òë¹ý³ÌÖиøÓè¹ýÎÒÃÇÐí¶à½è¼øºÍ²Î¿¼£¬Ôڴ˶ÔÁõÕѺêµÄ¹¤×÷ |
| 924 | ±íʾ¸Ðл¡£ | 924 | ±íʾ¸Ðл¡£ |
| 925 | 925 | ||
| 926 | ·Òë¹ý³ÌÖÐ×î´óµÄÌôսιýÓÚÊõÓïÒë´ÊµÄÑ¡ÔñÁË¡£¾¹ýˮľÉçÇø Emacs °åÈÈÐÄÍø | 926 | ·Òë¹ý³ÌÖÐ×î´óµÄÌôսιýÓÚÊõÓïÒë´ÊµÄÑ¡ÔñÁË¡£¾¹ýˮľÉçÇø Emacs °åÈÈÐÄÍø |
| @@ -954,6 +954,10 @@ Emacs ¿ìËÙÖ¸ÄÏ£¨Tutorial£©ÔçÓÐÁ½¸öÁõÕѺêµÄÖÐÎÄÒë±¾£¬·±¼ò¸÷Ò»¡£Æä¼òÌå°æ±¾ | |||
| 954 | Öеġ°window¡±¾ÍÖ»ÄÜÒë³É¡°´°¸ñ¡±ÁË¡£ÎÒÃÇÈÏΪ Emacs ÖÐ window ºÍ | 954 | Öеġ°window¡±¾ÍÖ»ÄÜÒë³É¡°´°¸ñ¡±ÁË¡£ÎÒÃÇÈÏΪ Emacs ÖÐ window ºÍ |
| 955 | frame µÄ¹ØÏµÓô°¸ñºÍ´°¿ÚÀ´Àà±ÈÊÇÊ®·ÖÐÎÏóµÄ¡£ | 955 | frame µÄ¹ØÏµÓô°¸ñºÍ´°¿ÚÀ´Àà±ÈÊÇÊ®·ÖÐÎÏóµÄ¡£ |
| 956 | 956 | ||
| 957 | ¡¶Ñ§Ï°GNU Emacs¡·£¨µÚ¶þ°æ£©Ò»Êé¶Ô¡°window¡±ºÍ¡°frame¡±µÄ·ÒëÓë±¾½Ì³Ì | ||
| 958 | ¸ÕºÃÏà·´£¨·Ö±ðÒë×÷¡°´°¿Ú¡±ºÍ¡°´°¸ñ¡±£©¡£ÔÚ´ËÌØ±ð×¢Ã÷£¬ÒÔÏû³ý¿ÉÄܲúÉú | ||
| 959 | µÄÒÉ»ó¡£ | ||
| 960 | |||
| 957 | [2] ¶ÔÓÚ¡°delete¡±ºÍ¡°kill¡±µÄÇø±ð£¬ÕýÎÄÒѾ¸ø³öÁËÏêϸµÄ˵Ã÷¡£¡°É¾³ý¡±ºÍ | 961 | [2] ¶ÔÓÚ¡°delete¡±ºÍ¡°kill¡±µÄÇø±ð£¬ÕýÎÄÒѾ¸ø³öÁËÏêϸµÄ˵Ã÷¡£¡°É¾³ý¡±ºÍ |
| 958 | ¡°ÒƳý¡±Ïà±È½ÏÆðÀ´£¬Ç°Õ߸ü¶àµØÒþº¬×Å¡°ÆÆ»µ¡±ºÍ¡°²»¿É»Ö¸´¡±µÄÒâ˼£¬¶ø | 962 | ¡°ÒƳý¡±Ïà±È½ÏÆðÀ´£¬Ç°Õ߸ü¶àµØÒþº¬×Å¡°ÆÆ»µ¡±ºÍ¡°²»¿É»Ö¸´¡±µÄÒâ˼£¬¶ø |
| 959 | ºóÕ߸ü¶àµØÒþº¬×Å¡°±»×ªÒÆ¡±ºÍ¡°¿É»Ö¸´¡±µÄÒâ˼¡£Òò´Ë·Ö±ðÑ¡ÔñËüÃÇ×÷ΪÉÏ | 963 | ºóÕ߸ü¶àµØÒþº¬×Å¡°±»×ªÒÆ¡±ºÍ¡°¿É»Ö¸´¡±µÄÒâ˼¡£Òò´Ë·Ö±ðÑ¡ÔñËüÃÇ×÷ΪÉÏ |
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 | |||
| 285 | einem numerischen Argument ein. | 285 | einem numerischen Argument ein. |
| 286 | 286 | ||
| 287 | Wenn Sie eine graphische Oberfläche wie X oder MS-Windows verwenden, | 287 | Wenn Sie eine graphische Oberfläche wie X oder MS-Windows verwenden, |
| 288 | dann befindet sich ein schmaler, langgezogener rechteckiger Bereich im | 288 | dann befindet sich ein schmaler, langgezogener rechteckiger Bereich auf |
| 289 | Regelfall auf der linken Seite des Emacs-Fensters. Dieser Bereich | 289 | der linken oder rechten Seite des Emacs-Fensters. Dieser Bereich |
| 290 | wird Scrollbar genannt (`Verschiebungsbalken'). Sie können Text | 290 | wird Scrollbar genannt (`Verschiebungsbalken'). Sie können Text |
| 291 | verschieben, indem Sie mit der Maus auf den Scrollbar klicken. | 291 | verschieben, indem Sie mit der Maus auf den Scrollbar klicken. |
| 292 | 292 | ||
diff --git a/etc/TUTORIAL.it b/etc/TUTORIAL.it index 46388e78cc3..84e10878fa8 100644 --- a/etc/TUTORIAL.it +++ b/etc/TUTORIAL.it | |||
| @@ -219,9 +219,9 @@ La schermata si sposta di 8 righe verso l'alto. Se vuoi tornare di nuovo | |||
| 219 | in basso puoi usare un argomento numerico con M-v. | 219 | in basso puoi usare un argomento numerico con M-v. |
| 220 | 220 | ||
| 221 | Quando si usa un sistema a finestre, come X11 o MS-Windows, ci dovrebbe | 221 | Quando si usa un sistema a finestre, come X11 o MS-Windows, ci dovrebbe |
| 222 | essere un'area rettangolare allungata chiamata barra di scorrimento sul | 222 | essere un'area rettangolare allungata chiamata barra di scorrimento a |
| 223 | lato sinistro della finestra di Emacs. Si può far scorrere il testo con | 223 | un lato della finestra di Emacs. Si può far scorrere il testo con un |
| 224 | un click del mouse nella barra di scorrimento. | 224 | click del mouse nella barra di scorrimento. |
| 225 | 225 | ||
| 226 | >> Prova a premere il pulsante centrale del mouse sopra all'area | 226 | >> Prova a premere il pulsante centrale del mouse sopra all'area |
| 227 | evidenziata nella barra di scorrimento. Verrà visualizzata una parte | 227 | evidenziata nella barra di scorrimento. Verrà visualizzata una parte |
diff --git a/etc/TUTORIAL.sl b/etc/TUTORIAL.sl index 52d2d18766c..3cb38ace65b 100644 --- a/etc/TUTORIAL.sl +++ b/etc/TUTORIAL.sl | |||
| @@ -222,7 +222,7 @@ To bi moralo zaslon premakniti navzgor za osem vrstic. Èe bi ga radi | |||
| 222 | premaknili nazaj, poskusite M-v z istim argumentom. | 222 | premaknili nazaj, poskusite M-v z istim argumentom. |
| 223 | 223 | ||
| 224 | Èe uporabljate grafièni vmesnik, denimo X11 ali MS Windows, imate | 224 | Èe uporabljate grafièni vmesnik, denimo X11 ali MS Windows, imate |
| 225 | verjetno ob levem robu Emacsovega okna navpièno pravokotno ploskev, | 225 | verjetno ob robu Emacsovega okna navpièno pravokotno ploskev, |
| 226 | imenovano drsnik. Pogled na besedilo lahko premikate tudi tako, da z | 226 | imenovano drsnik. Pogled na besedilo lahko premikate tudi tako, da z |
| 227 | mi¹ko kliknete na drsnik. | 227 | mi¹ko kliknete na drsnik. |
| 228 | 228 | ||
diff --git a/etc/TUTORIAL.sv b/etc/TUTORIAL.sv index a2e0cd9abea..732d1fa397e 100644 --- a/etc/TUTORIAL.sv +++ b/etc/TUTORIAL.sv | |||
| @@ -224,7 +224,7 @@ Detta borde ha flyttat skärmbilden 8 rader uppåt. Om du önskar flytta | |||
| 224 | tillbaka igen är det bara att ge samma argument till M-v. | 224 | tillbaka igen är det bara att ge samma argument till M-v. |
| 225 | 225 | ||
| 226 | Om du använder Emacs under ett fönstersystem, som X11 eller | 226 | Om du använder Emacs under ett fönstersystem, som X11 eller |
| 227 | MS-Windows, finns det troligen ett rektangulärt område på vänster sida | 227 | MS-Windows, finns det troligen ett rektangulärt område på sidan |
| 228 | av Emacs-fönstret, en så kallad rullningslist. Genom att klicka i den | 228 | av Emacs-fönstret, en så kallad rullningslist. Genom att klicka i den |
| 229 | med musen kan du rulla texten. | 229 | med musen kan du rulla texten. |
| 230 | 230 | ||
diff --git a/etc/emacs.py b/etc/emacs.py index 9538b0b7127..7614f0927df 100644 --- a/etc/emacs.py +++ b/etc/emacs.py | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | """Definitions used by commands sent to inferior Python in python.el.""" | 1 | """Definitions used by commands sent to inferior Python in python.el.""" |
| 2 | 2 | ||
| 3 | # Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. | 3 | # Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. |
| 4 | # Author: Dave Love <d.love@dl.ac.uk> | 4 | # Author: Dave Love <fx@gnu.org> |
| 5 | 5 | ||
| 6 | # This file is part of GNU Emacs. | 6 | # This file is part of GNU Emacs. |
| 7 | 7 | ||
| @@ -20,17 +20,19 @@ | |||
| 20 | # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 20 | # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 21 | # Boston, MA 02110-1301, USA. | 21 | # Boston, MA 02110-1301, USA. |
| 22 | 22 | ||
| 23 | import os, sys, traceback, inspect, rlcompleter, __main__ | 23 | import os, sys, traceback, inspect, __main__ |
| 24 | from sets import Set | ||
| 24 | 25 | ||
| 25 | __all__ = ["eexecfile", "args", "complete", "ehelp", "eimport"] | 26 | __all__ = ["eexecfile", "eargs", "complete", "ehelp", "eimport", "modpath"] |
| 26 | 27 | ||
| 27 | def eexecfile (file): | 28 | def eexecfile (file): |
| 28 | """Execute FILE and then remove it. | 29 | """Execute FILE and then remove it. |
| 30 | Execute the file within the __main__ namespace. | ||
| 29 | If we get an exception, print a traceback with the top frame | 31 | If we get an exception, print a traceback with the top frame |
| 30 | (oursleves) excluded.""" | 32 | (ourselves) excluded.""" |
| 31 | try: | 33 | try: |
| 32 | try: execfile (file, globals (), globals ()) | 34 | try: execfile (file, __main__.__dict__) |
| 33 | except: | 35 | except: |
| 34 | (type, value, tb) = sys.exc_info () | 36 | (type, value, tb) = sys.exc_info () |
| 35 | # Lose the stack frame for this location. | 37 | # Lose the stack frame for this location. |
| 36 | tb = tb.tb_next | 38 | tb = tb.tb_next |
| @@ -40,9 +42,10 @@ def eexecfile (file): | |||
| 40 | finally: | 42 | finally: |
| 41 | os.remove (file) | 43 | os.remove (file) |
| 42 | 44 | ||
| 43 | def eargs (name): | 45 | def eargs (name, imports): |
| 44 | "Get arglist of NAME for Eldoc &c." | 46 | "Get arglist of NAME for Eldoc &c." |
| 45 | try: | 47 | try: |
| 48 | if imports: exec imports | ||
| 46 | parts = name.split ('.') | 49 | parts = name.split ('.') |
| 47 | if len (parts) > 1: | 50 | if len (parts) > 1: |
| 48 | exec 'import ' + parts[0] # might fail | 51 | exec 'import ' + parts[0] # might fail |
| @@ -56,8 +59,7 @@ def eargs (name): | |||
| 56 | return | 59 | return |
| 57 | if inspect.ismethod (func): | 60 | if inspect.ismethod (func): |
| 58 | func = func.im_func | 61 | func = func.im_func |
| 59 | if not inspect.isfunction (func): | 62 | if not inspect.isfunction (func): return |
| 60 | return | ||
| 61 | (args, varargs, varkw, defaults) = inspect.getargspec (func) | 63 | (args, varargs, varkw, defaults) = inspect.getargspec (func) |
| 62 | # No space between name and arglist for consistency with builtins. | 64 | # No space between name and arglist for consistency with builtins. |
| 63 | print '_emacs_out', \ | 65 | print '_emacs_out', \ |
| @@ -65,41 +67,109 @@ def eargs (name): | |||
| 65 | defaults) | 67 | defaults) |
| 66 | except: pass | 68 | except: pass |
| 67 | 69 | ||
| 68 | def complete (text, namespace = None): | 70 | def all_names (object): |
| 71 | """Return (an approximation to) a list of all possible attribute | ||
| 72 | names reachable via the attributes of OBJECT, i.e. roughly the | ||
| 73 | leaves of the dictionary tree under it.""" | ||
| 74 | |||
| 75 | def do_object (object, names): | ||
| 76 | if inspect.ismodule (object): | ||
| 77 | do_module (object, names) | ||
| 78 | elif inspect.isclass (object): | ||
| 79 | do_class (object, names) | ||
| 80 | # Might have an object without its class in scope. | ||
| 81 | elif hasattr (object, '__class__'): | ||
| 82 | names.add ('__class__') | ||
| 83 | do_class (object.__class__, names) | ||
| 84 | # Probably not a good idea to try to enumerate arbitrary | ||
| 85 | # dictionaries... | ||
| 86 | return names | ||
| 87 | |||
| 88 | def do_module (module, names): | ||
| 89 | if hasattr (module, '__all__'): # limited export list | ||
| 90 | names.union_update (module.__all__) | ||
| 91 | for i in module.__all__: | ||
| 92 | do_object (getattr (module, i), names) | ||
| 93 | else: # use all names | ||
| 94 | names.union_update (dir (module)) | ||
| 95 | for i in dir (module): | ||
| 96 | do_object (getattr (module, i), names) | ||
| 97 | return names | ||
| 98 | |||
| 99 | def do_class (object, names): | ||
| 100 | ns = dir (object) | ||
| 101 | names.union_update (ns) | ||
| 102 | if hasattr (object, '__bases__'): # superclasses | ||
| 103 | for i in object.__bases__: do_object (i, names) | ||
| 104 | return names | ||
| 105 | |||
| 106 | return do_object (object, Set ([])) | ||
| 107 | |||
| 108 | def complete (name, imports): | ||
| 69 | """Complete TEXT in NAMESPACE and print a Lisp list of completions. | 109 | """Complete TEXT in NAMESPACE and print a Lisp list of completions. |
| 70 | NAMESPACE is currently not used.""" | 110 | Exec IMPORTS first.""" |
| 71 | if namespace is None: namespace = __main__.__dict__ | 111 | import __main__, keyword |
| 72 | c = rlcompleter.Completer (namespace) | 112 | |
| 113 | def class_members(object): | ||
| 114 | names = dir (object) | ||
| 115 | if hasattr (object, '__bases__'): | ||
| 116 | for super in object.__bases__: | ||
| 117 | names = class_members (super) | ||
| 118 | return names | ||
| 119 | |||
| 120 | names = Set ([]) | ||
| 121 | base = None | ||
| 73 | try: | 122 | try: |
| 74 | if '.' in text: | 123 | dict = __main__.__dict__.copy() |
| 75 | matches = c.attr_matches (text) | 124 | if imports: exec imports in dict |
| 76 | else: | 125 | l = len (name) |
| 77 | matches = c.global_matches (text) | 126 | if not "." in name: |
| 78 | print '_emacs_out (', | 127 | for list in [dir (__builtins__), keyword.kwlist, dict.keys()]: |
| 79 | for elt in matches: | 128 | for elt in list: |
| 80 | print '"%s"' % elt, | 129 | if elt[:l] == name: names.add(elt) |
| 81 | print ')' | 130 | else: |
| 82 | except: | 131 | base = name[:name.rfind ('.')] |
| 83 | print '_emacs_out ()' | 132 | name = name[name.rfind('.')+1:] |
| 133 | try: | ||
| 134 | object = eval (base, dict) | ||
| 135 | names = Set (dir (object)) | ||
| 136 | if hasattr (object, '__class__'): | ||
| 137 | names.add('__class__') | ||
| 138 | names.union_update (class_members (object)) | ||
| 139 | except: names = all_names (dict) | ||
| 140 | except: return [] | ||
| 141 | l = len(name) | ||
| 142 | print '_emacs_out (', | ||
| 143 | for n in names: | ||
| 144 | if name == n[:l]: | ||
| 145 | if base: print '"%s.%s"' % (base, n), | ||
| 146 | else: print '"%s"' % n, | ||
| 147 | print ')' | ||
| 84 | 148 | ||
| 85 | def ehelp (name, g, l): | 149 | def ehelp (name, imports): |
| 86 | """Get help on string NAME using globals G and locals L. | 150 | """Get help on string NAME. |
| 87 | First try to eval name for, e.g. user definitions where we need | 151 | First try to eval name for, e.g. user definitions where we need |
| 88 | the object. Otherwise try the string form.""" | 152 | the object. Otherwise try the string form.""" |
| 89 | try: help (eval (name, g, l)) | 153 | locls = {} |
| 154 | if imports: | ||
| 155 | try: exec imports in locls | ||
| 156 | except: pass | ||
| 157 | try: help (eval (name, globals(), locls)) | ||
| 90 | except: help (name) | 158 | except: help (name) |
| 91 | 159 | ||
| 92 | def eimport (mod, dir): | 160 | def eimport (mod, dir): |
| 93 | """Import module MOD with directory DIR at the head of the search path. | 161 | """Import module MOD with directory DIR at the head of the search path. |
| 94 | NB doesn't load from DIR if MOD shadows a system module.""" | 162 | NB doesn't load from DIR if MOD shadows a system module.""" |
| 163 | from __main__ import __dict__ | ||
| 164 | |||
| 95 | path0 = sys.path[0] | 165 | path0 = sys.path[0] |
| 96 | sys.path[0] = dir | 166 | sys.path[0] = dir |
| 97 | try: | 167 | try: |
| 98 | try: | 168 | try: |
| 99 | if globals().has_key(mod) and inspect.ismodule (eval (mod)): | 169 | if __dict__.has_key(mod) and inspect.ismodule (__dict__[mod]): |
| 100 | reload(eval (mod)) | 170 | reload (__dict__[mod]) |
| 101 | else: | 171 | else: |
| 102 | globals ()[mod] = __import__ (mod) | 172 | __dict__[mod] = __import__ (mod) |
| 103 | except: | 173 | except: |
| 104 | (type, value, tb) = sys.exc_info () | 174 | (type, value, tb) = sys.exc_info () |
| 105 | print "Traceback (most recent call last):" | 175 | print "Traceback (most recent call last):" |
| @@ -107,6 +177,17 @@ def eimport (mod, dir): | |||
| 107 | finally: | 177 | finally: |
| 108 | sys.path[0] = path0 | 178 | sys.path[0] = path0 |
| 109 | 179 | ||
| 110 | print '_emacs_ok' # ready for input and can call continuation | 180 | def modpath (module): |
| 181 | """Return the source file for the given MODULE (or None). | ||
| 182 | Assumes that MODULE.py and MODULE.pyc are in the same directory.""" | ||
| 183 | try: | ||
| 184 | path = __import__ (module).__file__ | ||
| 185 | if path[-4:] == '.pyc' and os.path.exists (path[0:-1]): | ||
| 186 | path = path[:-1] | ||
| 187 | print "_emacs_out", path | ||
| 188 | except: | ||
| 189 | print "_emacs_out ()" | ||
| 190 | |||
| 191 | # print '_emacs_ok' # ready for input and can call continuation | ||
| 111 | 192 | ||
| 112 | # arch-tag: d90408f3-90e2-4de4-99c2-6eb9c7b9ca46 | 193 | # arch-tag: d90408f3-90e2-4de4-99c2-6eb9c7b9ca46 |
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 6be0910d27a..3328f010846 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,29 @@ | |||
| 1 | 2006-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 | |||
| 6 | 2006-08-07 Masatake YAMATO <jet@gyve.org> | ||
| 7 | |||
| 8 | * etags.c (readline): expect sscanf returns 2, | ||
| 9 | not 1. | ||
| 10 | |||
| 11 | 2006-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 | |||
| 16 | 2002-07-30 Adrian Aichner <adrian@xemacs.org> (tiny change) | ||
| 17 | |||
| 18 | * etags.c: It's XEmacs, not Xemacs: change all the occurences. | ||
| 19 | |||
| 20 | 2006-07-30 Francesco Potort,Al(B <pot@gnu.org> | ||
| 21 | |||
| 22 | * etags.c [ETAGS_REGEXPS]: Now is unconditionally defined. | ||
| 23 | [LONG_OPTIONS]: Changed to NO_LONG_OPTIONS, which is undefined. | ||
| 24 | (Objc_suffixes): Suggest using --lang=c for full help. | ||
| 25 | (C_entries): Initialise savetoken to 0 to shut up the compiler. | ||
| 26 | |||
| 1 | 2006-07-20 Andreas Schwab <schwab@suse.de> | 27 | 2006-07-20 Andreas Schwab <schwab@suse.de> |
| 2 | 28 | ||
| 3 | * fakemail.c (fatal): Drop second parameter and treat first | 29 | * fakemail.c (fatal): Drop second parameter and treat first |
diff --git a/lib-src/etags.c b/lib-src/etags.c index b5ff33c8b4c..49a18be1df5 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -41,7 +41,7 @@ | |||
| 41 | * configuration file containing regexp definitions for etags. | 41 | * configuration file containing regexp definitions for etags. |
| 42 | */ | 42 | */ |
| 43 | 43 | ||
| 44 | char pot_etags_version[] = "@(#) pot revision number is 17.18"; | 44 | char pot_etags_version[] = "@(#) pot revision number is 17.20"; |
| 45 | 45 | ||
| 46 | #define TRUE 1 | 46 | #define TRUE 1 |
| 47 | #define FALSE 0 | 47 | #define FALSE 0 |
| @@ -59,12 +59,10 @@ char pot_etags_version[] = "@(#) pot revision number is 17.18"; | |||
| 59 | /* On some systems, Emacs defines static as nothing for the sake | 59 | /* On some systems, Emacs defines static as nothing for the sake |
| 60 | of unexec. We don't want that here since we don't use unexec. */ | 60 | of unexec. We don't want that here since we don't use unexec. */ |
| 61 | # undef static | 61 | # undef static |
| 62 | # define ETAGS_REGEXPS /* use the regexp features */ | 62 | # ifndef PTR /* for XEmacs */ |
| 63 | # define LONG_OPTIONS /* accept long options */ | ||
| 64 | # ifndef PTR /* for Xemacs */ | ||
| 65 | # define PTR void * | 63 | # define PTR void * |
| 66 | # endif | 64 | # endif |
| 67 | # ifndef __P /* for Xemacs */ | 65 | # ifndef __P /* for XEmacs */ |
| 68 | # define __P(args) args | 66 | # define __P(args) args |
| 69 | # endif | 67 | # endif |
| 70 | #else /* no config.h */ | 68 | #else /* no config.h */ |
| @@ -82,14 +80,7 @@ char pot_etags_version[] = "@(#) pot revision number is 17.18"; | |||
| 82 | # define _GNU_SOURCE 1 /* enables some compiler checks on GNU */ | 80 | # define _GNU_SOURCE 1 /* enables some compiler checks on GNU */ |
| 83 | #endif | 81 | #endif |
| 84 | 82 | ||
| 85 | #ifdef LONG_OPTIONS | 83 | /* WIN32_NATIVE is for XEmacs. |
| 86 | # undef LONG_OPTIONS | ||
| 87 | # define LONG_OPTIONS TRUE | ||
| 88 | #else | ||
| 89 | # define LONG_OPTIONS FALSE | ||
| 90 | #endif | ||
| 91 | |||
| 92 | /* WIN32_NATIVE is for Xemacs. | ||
| 93 | MSDOS, WINDOWSNT, DOS_NT are for Emacs. */ | 84 | MSDOS, WINDOWSNT, DOS_NT are for Emacs. */ |
| 94 | #ifdef WIN32_NATIVE | 85 | #ifdef WIN32_NATIVE |
| 95 | # undef MSDOS | 86 | # undef MSDOS |
| @@ -167,25 +158,25 @@ char pot_etags_version[] = "@(#) pot revision number is 17.18"; | |||
| 167 | # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) | 158 | # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) |
| 168 | #endif | 159 | #endif |
| 169 | 160 | ||
| 170 | #if LONG_OPTIONS | 161 | #ifdef NO_LONG_OPTIONS /* define this if you don't have GNU getopt */ |
| 171 | # include <getopt.h> | 162 | # define NO_LONG_OPTIONS TRUE |
| 172 | #else | ||
| 173 | # define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr) | 163 | # define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr) |
| 174 | extern char *optarg; | 164 | extern char *optarg; |
| 175 | extern int optind, opterr; | 165 | extern int optind, opterr; |
| 176 | #endif /* LONG_OPTIONS */ | 166 | #else |
| 167 | # define NO_LONG_OPTIONS FALSE | ||
| 168 | # include <getopt.h> | ||
| 169 | #endif /* NO_LONG_OPTIONS */ | ||
| 177 | 170 | ||
| 178 | #ifdef ETAGS_REGEXPS | 171 | #ifndef HAVE_CONFIG_H /* this is a standalone compilation */ |
| 179 | # ifndef HAVE_CONFIG_H /* this is a standalone compilation */ | 172 | # ifdef __CYGWIN__ /* compiling on Cygwin */ |
| 180 | # ifdef __CYGWIN__ /* compiling on Cygwin */ | ||
| 181 | !!! NOTICE !!! | 173 | !!! NOTICE !!! |
| 182 | the regex.h distributed with Cygwin is not compatible with etags, alas! | 174 | the regex.h distributed with Cygwin is not compatible with etags, alas! |
| 183 | If you want regular expression support, you should delete this notice and | 175 | If you want regular expression support, you should delete this notice and |
| 184 | arrange to use the GNU regex.h and regex.c. | 176 | arrange to use the GNU regex.h and regex.c. |
| 185 | # endif | ||
| 186 | # endif | 177 | # endif |
| 187 | # include <regex.h> | 178 | #endif |
| 188 | #endif /* ETAGS_REGEXPS */ | 179 | #include <regex.h> |
| 189 | 180 | ||
| 190 | /* Define CTAGS to make the program "ctags" compatible with the usual one. | 181 | /* Define CTAGS to make the program "ctags" compatible with the usual one. |
| 191 | Leave it undefined to make the program "etags", which makes emacs-style | 182 | Leave it undefined to make the program "etags", which makes emacs-style |
| @@ -312,7 +303,6 @@ typedef struct | |||
| 312 | char *what; /* the argument itself */ | 303 | char *what; /* the argument itself */ |
| 313 | } argument; | 304 | } argument; |
| 314 | 305 | ||
| 315 | #ifdef ETAGS_REGEXPS | ||
| 316 | /* Structure defining a regular expression. */ | 306 | /* Structure defining a regular expression. */ |
| 317 | typedef struct regexp | 307 | typedef struct regexp |
| 318 | { | 308 | { |
| @@ -327,7 +317,6 @@ typedef struct regexp | |||
| 327 | bool ignore_case; /* ignore case when matching */ | 317 | bool ignore_case; /* ignore case when matching */ |
| 328 | bool multi_line; /* do a multi-line match on the whole file */ | 318 | bool multi_line; /* do a multi-line match on the whole file */ |
| 329 | } regexp; | 319 | } regexp; |
| 330 | #endif /* ETAGS_REGEXPS */ | ||
| 331 | 320 | ||
| 332 | 321 | ||
| 333 | /* Many compilers barf on this: | 322 | /* Many compilers barf on this: |
| @@ -375,11 +364,9 @@ static long readline_internal __P((linebuffer *, FILE *)); | |||
| 375 | static bool nocase_tail __P((char *)); | 364 | static bool nocase_tail __P((char *)); |
| 376 | static void get_tag __P((char *, char **)); | 365 | static void get_tag __P((char *, char **)); |
| 377 | 366 | ||
| 378 | #ifdef ETAGS_REGEXPS | ||
| 379 | static void analyse_regex __P((char *)); | 367 | static void analyse_regex __P((char *)); |
| 380 | static void free_regexps __P((void)); | 368 | static void free_regexps __P((void)); |
| 381 | static void regex_tag_multiline __P((void)); | 369 | static void regex_tag_multiline __P((void)); |
| 382 | #endif /* ETAGS_REGEXPS */ | ||
| 383 | static void error __P((const char *, const char *)); | 370 | static void error __P((const char *, const char *)); |
| 384 | static void suggest_asking_for_help __P((void)); | 371 | static void suggest_asking_for_help __P((void)); |
| 385 | void fatal __P((char *, char *)); | 372 | void fatal __P((char *, char *)); |
| @@ -485,14 +472,9 @@ static bool packages_only; /* --packages-only: in Ada, only tag packages*/ | |||
| 485 | #define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */ | 472 | #define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */ |
| 486 | static bool parsing_stdin; /* --parse-stdin used */ | 473 | static bool parsing_stdin; /* --parse-stdin used */ |
| 487 | 474 | ||
| 488 | #ifdef ETAGS_REGEXPS | ||
| 489 | static regexp *p_head; /* list of all regexps */ | 475 | static regexp *p_head; /* list of all regexps */ |
| 490 | static bool need_filebuf; /* some regexes are multi-line */ | 476 | static bool need_filebuf; /* some regexes are multi-line */ |
| 491 | #else | ||
| 492 | # define need_filebuf FALSE | ||
| 493 | #endif /* ETAGS_REGEXPS */ | ||
| 494 | 477 | ||
| 495 | #if LONG_OPTIONS | ||
| 496 | static struct option longopts[] = | 478 | static struct option longopts[] = |
| 497 | { | 479 | { |
| 498 | { "append", no_argument, NULL, 'a' }, | 480 | { "append", no_argument, NULL, 'a' }, |
| @@ -507,11 +489,9 @@ static struct option longopts[] = | |||
| 507 | { "members", no_argument, &members, TRUE }, | 489 | { "members", no_argument, &members, TRUE }, |
| 508 | { "no-members", no_argument, &members, FALSE }, | 490 | { "no-members", no_argument, &members, FALSE }, |
| 509 | { "output", required_argument, NULL, 'o' }, | 491 | { "output", required_argument, NULL, 'o' }, |
| 510 | #ifdef ETAGS_REGEXPS | ||
| 511 | { "regex", required_argument, NULL, 'r' }, | 492 | { "regex", required_argument, NULL, 'r' }, |
| 512 | { "no-regex", no_argument, NULL, 'R' }, | 493 | { "no-regex", no_argument, NULL, 'R' }, |
| 513 | { "ignore-case-regex", required_argument, NULL, 'c' }, | 494 | { "ignore-case-regex", required_argument, NULL, 'c' }, |
| 514 | #endif /* ETAGS_REGEXPS */ | ||
| 515 | { "parse-stdin", required_argument, NULL, STDIN }, | 495 | { "parse-stdin", required_argument, NULL, STDIN }, |
| 516 | { "version", no_argument, NULL, 'V' }, | 496 | { "version", no_argument, NULL, 'V' }, |
| 517 | 497 | ||
| @@ -533,7 +513,6 @@ static struct option longopts[] = | |||
| 533 | #endif | 513 | #endif |
| 534 | { NULL } | 514 | { NULL } |
| 535 | }; | 515 | }; |
| 536 | #endif /* LONG_OPTIONS */ | ||
| 537 | 516 | ||
| 538 | static compressor compressors[] = | 517 | static compressor compressors[] = |
| 539 | { | 518 | { |
| @@ -681,13 +660,15 @@ static char *Objc_suffixes [] = | |||
| 681 | static char Objc_help [] = | 660 | static char Objc_help [] = |
| 682 | "In Objective C code, tags include Objective C definitions for classes,\n\ | 661 | "In Objective C code, tags include Objective C definitions for classes,\n\ |
| 683 | class categories, methods and protocols. Tags for variables and\n\ | 662 | class categories, methods and protocols. Tags for variables and\n\ |
| 684 | functions in classes are named `CLASS::VARIABLE' and `CLASS::FUNCTION'."; | 663 | functions in classes are named `CLASS::VARIABLE' and `CLASS::FUNCTION'.\n\ |
| 664 | (Use --help --lang=c --lang=objc --lang=java for full help.)"; | ||
| 685 | 665 | ||
| 686 | static char *Pascal_suffixes [] = | 666 | static char *Pascal_suffixes [] = |
| 687 | { "p", "pas", NULL }; | 667 | { "p", "pas", NULL }; |
| 688 | static char Pascal_help [] = | 668 | static char Pascal_help [] = |
| 689 | "In Pascal code, the tags are the functions and procedures defined\n\ | 669 | "In Pascal code, the tags are the functions and procedures defined\n\ |
| 690 | in the file."; | 670 | in the file."; |
| 671 | /* " // this is for working around an Emacs highlighting bug... */ | ||
| 691 | 672 | ||
| 692 | static char *Perl_suffixes [] = | 673 | static char *Perl_suffixes [] = |
| 693 | { "pl", "pm", NULL }; | 674 | { "pl", "pm", NULL }; |
| @@ -885,11 +866,11 @@ print_help (argbuffer) | |||
| 885 | printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\ | 866 | printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\ |
| 886 | \n\ | 867 | \n\ |
| 887 | These are the options accepted by %s.\n", progname, progname); | 868 | These are the options accepted by %s.\n", progname, progname); |
| 888 | if (LONG_OPTIONS) | 869 | if (NO_LONG_OPTIONS) |
| 889 | puts ("You may use unambiguous abbreviations for the long option names."); | 870 | puts ("WARNING: long option names do not work with this executable,\n\ |
| 871 | as it is not linked with GNU getopt."); | ||
| 890 | else | 872 | else |
| 891 | puts ("Long option names do not work with this executable, as it is not\n\ | 873 | puts ("You may use unambiguous abbreviations for the long option names."); |
| 892 | linked with GNU getopt."); | ||
| 893 | puts (" A - as file name means read names from stdin (one per line).\n\ | 874 | puts (" A - as file name means read names from stdin (one per line).\n\ |
| 894 | Absolute names are stored in the output file as they are.\n\ | 875 | Absolute names are stored in the output file as they are.\n\ |
| 895 | Relative ones are stored relative to the output file's directory.\n"); | 876 | Relative ones are stored relative to the output file's directory.\n"); |
| @@ -949,7 +930,6 @@ Relative ones are stored relative to the output file's directory.\n"); | |||
| 949 | puts ("--members\n\ | 930 | puts ("--members\n\ |
| 950 | Create tag entries for members of structures in some languages."); | 931 | Create tag entries for members of structures in some languages."); |
| 951 | 932 | ||
| 952 | #ifdef ETAGS_REGEXPS | ||
| 953 | puts ("-r REGEXP, --regex=REGEXP or --regex=@regexfile\n\ | 933 | puts ("-r REGEXP, --regex=REGEXP or --regex=@regexfile\n\ |
| 954 | Make a tag for each line matching a regular expression pattern\n\ | 934 | Make a tag for each line matching a regular expression pattern\n\ |
| 955 | in the following files. {LANGUAGE}REGEXP uses REGEXP for LANGUAGE\n\ | 935 | in the following files. {LANGUAGE}REGEXP uses REGEXP for LANGUAGE\n\ |
| @@ -964,7 +944,6 @@ Relative ones are stored relative to the output file's directory.\n"); | |||
| 964 | causes dot to match any character, including newline."); | 944 | causes dot to match any character, including newline."); |
| 965 | puts ("-R, --no-regex\n\ | 945 | puts ("-R, --no-regex\n\ |
| 966 | Don't create tags from regexps for the following files."); | 946 | Don't create tags from regexps for the following files."); |
| 967 | #endif /* ETAGS_REGEXPS */ | ||
| 968 | puts ("-I, --ignore-indentation\n\ | 947 | puts ("-I, --ignore-indentation\n\ |
| 969 | In C and C++ do not assume that a closing brace in the first\n\ | 948 | In C and C++ do not assume that a closing brace in the first\n\ |
| 970 | column is the final brace of a function or structure definition."); | 949 | column is the final brace of a function or structure definition."); |
| @@ -1194,14 +1173,8 @@ main (argc, argv) | |||
| 1194 | 1173 | ||
| 1195 | /* When the optstring begins with a '-' getopt_long does not rearrange the | 1174 | /* When the optstring begins with a '-' getopt_long does not rearrange the |
| 1196 | non-options arguments to be at the end, but leaves them alone. */ | 1175 | non-options arguments to be at the end, but leaves them alone. */ |
| 1197 | optstring = "-"; | 1176 | optstring = concat (NO_LONG_OPTIONS ? "" : "-", |
| 1198 | #ifdef ETAGS_REGEXPS | 1177 | "ac:Cf:Il:o:r:RSVhH", |
| 1199 | optstring = "-r:Rc:"; | ||
| 1200 | #endif /* ETAGS_REGEXPS */ | ||
| 1201 | if (!LONG_OPTIONS) | ||
| 1202 | optstring += 1; /* remove the initial '-' */ | ||
| 1203 | optstring = concat (optstring, | ||
| 1204 | "aCf:Il:o:SVhH", | ||
| 1205 | (CTAGS) ? "BxdtTuvw" : "Di:"); | 1178 | (CTAGS) ? "BxdtTuvw" : "Di:"); |
| 1206 | 1179 | ||
| 1207 | while ((opt = getopt_long (argc, argv, optstring, longopts, NULL)) != EOF) | 1180 | while ((opt = getopt_long (argc, argv, optstring, longopts, NULL)) != EOF) |
| @@ -1375,11 +1348,9 @@ main (argc, argv) | |||
| 1375 | case at_language: | 1348 | case at_language: |
| 1376 | lang = argbuffer[i].lang; | 1349 | lang = argbuffer[i].lang; |
| 1377 | break; | 1350 | break; |
| 1378 | #ifdef ETAGS_REGEXPS | ||
| 1379 | case at_regexp: | 1351 | case at_regexp: |
| 1380 | analyse_regex (argbuffer[i].what); | 1352 | analyse_regex (argbuffer[i].what); |
| 1381 | break; | 1353 | break; |
| 1382 | #endif | ||
| 1383 | case at_filename: | 1354 | case at_filename: |
| 1384 | #ifdef VMS | 1355 | #ifdef VMS |
| 1385 | while ((this_file = gfnames (argbuffer[i].what, &got_err)) != NULL) | 1356 | while ((this_file = gfnames (argbuffer[i].what, &got_err)) != NULL) |
| @@ -1419,9 +1390,7 @@ main (argc, argv) | |||
| 1419 | } | 1390 | } |
| 1420 | } | 1391 | } |
| 1421 | 1392 | ||
| 1422 | #ifdef ETAGS_REGEXPS | ||
| 1423 | free_regexps (); | 1393 | free_regexps (); |
| 1424 | #endif /* ETAGS_REGEXPS */ | ||
| 1425 | free (lb.buffer); | 1394 | free (lb.buffer); |
| 1426 | free (filebuf.buffer); | 1395 | free (filebuf.buffer); |
| 1427 | free (token_name.buffer); | 1396 | free (token_name.buffer); |
| @@ -1979,9 +1948,7 @@ find_entries (inf) | |||
| 1979 | 1948 | ||
| 1980 | parser (inf); | 1949 | parser (inf); |
| 1981 | 1950 | ||
| 1982 | #ifdef ETAGS_REGEXPS | ||
| 1983 | regex_tag_multiline (); | 1951 | regex_tag_multiline (); |
| 1984 | #endif /* ETAGS_REGEXPS */ | ||
| 1985 | } | 1952 | } |
| 1986 | 1953 | ||
| 1987 | 1954 | ||
| @@ -3239,7 +3206,7 @@ C_entries (c_ext, inf) | |||
| 3239 | int typdefbracelev; /* bracelev where a typedef struct body begun */ | 3206 | int typdefbracelev; /* bracelev where a typedef struct body begun */ |
| 3240 | bool incomm, inquote, inchar, quotednl, midtoken; | 3207 | bool incomm, inquote, inchar, quotednl, midtoken; |
| 3241 | bool yacc_rules; /* in the rules part of a yacc file */ | 3208 | bool yacc_rules; /* in the rules part of a yacc file */ |
| 3242 | struct tok savetoken; /* token saved during preprocessor handling */ | 3209 | struct tok savetoken = {0}; /* token saved during preprocessor handling */ |
| 3243 | 3210 | ||
| 3244 | 3211 | ||
| 3245 | linebuffer_init (&lbs[0].lb); | 3212 | linebuffer_init (&lbs[0].lb); |
| @@ -5198,7 +5165,7 @@ TEX_mode (inf) | |||
| 5198 | { | 5165 | { |
| 5199 | /* Skip to next line if we hit the TeX comment char. */ | 5166 | /* Skip to next line if we hit the TeX comment char. */ |
| 5200 | if (c == '%') | 5167 | if (c == '%') |
| 5201 | while (c != '\n') | 5168 | while (c != '\n' && c != EOF) |
| 5202 | c = getc (inf); | 5169 | c = getc (inf); |
| 5203 | else if (c == TEX_LESC || c == TEX_SESC ) | 5170 | else if (c == TEX_LESC || c == TEX_SESC ) |
| 5204 | break; | 5171 | break; |
| @@ -5735,8 +5702,6 @@ erlang_atom (s) | |||
| 5735 | } | 5702 | } |
| 5736 | 5703 | ||
| 5737 | 5704 | ||
| 5738 | #ifdef ETAGS_REGEXPS | ||
| 5739 | |||
| 5740 | static char *scan_separators __P((char *)); | 5705 | static char *scan_separators __P((char *)); |
| 5741 | static void add_regex __P((char *, language *)); | 5706 | static void add_regex __P((char *, language *)); |
| 5742 | static char *substitute __P((char *, char *, struct re_registers *)); | 5707 | static char *substitute __P((char *, char *, struct re_registers *)); |
| @@ -6141,8 +6106,6 @@ regex_tag_multiline () | |||
| 6141 | } | 6106 | } |
| 6142 | } | 6107 | } |
| 6143 | 6108 | ||
| 6144 | #endif /* ETAGS_REGEXPS */ | ||
| 6145 | |||
| 6146 | 6109 | ||
| 6147 | static bool | 6110 | static bool |
| 6148 | nocase_tail (cp) | 6111 | nocase_tail (cp) |
| @@ -6296,9 +6259,10 @@ readline (lbp, stream) | |||
| 6296 | int start, lno; | 6259 | int start, lno; |
| 6297 | 6260 | ||
| 6298 | if (DEBUG) start = 0; /* shut up the compiler */ | 6261 | if (DEBUG) start = 0; /* shut up the compiler */ |
| 6299 | 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] == '"') | ||
| 6300 | { | 6264 | { |
| 6301 | char *endp = lbp->buffer + start; | 6265 | char *endp = lbp->buffer + ++start; |
| 6302 | 6266 | ||
| 6303 | assert (start > 0); | 6267 | assert (start > 0); |
| 6304 | while ((endp = etags_strchr (endp, '"')) != NULL | 6268 | while ((endp = etags_strchr (endp, '"')) != NULL |
| @@ -6405,7 +6369,6 @@ readline (lbp, stream) | |||
| 6405 | } | 6369 | } |
| 6406 | } /* if #line directives should be considered */ | 6370 | } /* if #line directives should be considered */ |
| 6407 | 6371 | ||
| 6408 | #ifdef ETAGS_REGEXPS | ||
| 6409 | { | 6372 | { |
| 6410 | int match; | 6373 | int match; |
| 6411 | regexp *rp; | 6374 | regexp *rp; |
| @@ -6462,7 +6425,6 @@ readline (lbp, stream) | |||
| 6462 | } | 6425 | } |
| 6463 | } | 6426 | } |
| 6464 | } | 6427 | } |
| 6465 | #endif /* ETAGS_REGEXPS */ | ||
| 6466 | } | 6428 | } |
| 6467 | 6429 | ||
| 6468 | 6430 | ||
| @@ -6623,7 +6585,7 @@ static void | |||
| 6623 | suggest_asking_for_help () | 6585 | suggest_asking_for_help () |
| 6624 | { | 6586 | { |
| 6625 | fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", | 6587 | fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", |
| 6626 | progname, LONG_OPTIONS ? "--help" : "-h"); | 6588 | progname, NO_LONG_OPTIONS ? "-h" : "--help"); |
| 6627 | exit (EXIT_FAILURE); | 6589 | exit (EXIT_FAILURE); |
| 6628 | } | 6590 | } |
| 6629 | 6591 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 30aee0030ba..187f2ff3fae 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,707 @@ | |||
| 1 | 2006-08-27 Michael Olson <mwolson@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/tq.el: Small grammar fix in comments. | ||
| 4 | (tq-enqueue): Check for existence of queue rather than the | ||
| 5 | head queue item's question, which was a no-op. | ||
| 6 | (tq-filter, tq-process-buffer): Make sure the process buffer | ||
| 7 | exists before making it the current buffer. | ||
| 8 | |||
| 9 | 2006-08-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 10 | |||
| 11 | * term/mac-win.el (mac-apple-event-map): Rename hicommand to hi-command. | ||
| 12 | (mac-dnd-drop-data): Apply 2006-08-22 change for x-dnd-drop-data. | ||
| 13 | (special-event-map): Apply 2006-08-16 change for x-win.el. | ||
| 14 | |||
| 15 | 2006-08-26 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 16 | |||
| 17 | * progmodes/python.el (python-send-receive): Wait in the | ||
| 18 | process's buffer so as to check the right buffer-local variables. | ||
| 19 | |||
| 20 | 2006-08-25 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 21 | |||
| 22 | * emacs-lisp/checkdoc.el: Remove * in defcustoms. | ||
| 23 | (defgroup checkdoc): Move to beginning. | ||
| 24 | |||
| 25 | * progmodes/python.el (python-preoutput-skip-next-prompt): New var. | ||
| 26 | (python-preoutput-continuation): Remove. | ||
| 27 | (python-preoutput-filter): Simplify correspondingly. | ||
| 28 | Remove handling of _emacs_ok. Make sure we skip _emacs_out's prompts. | ||
| 29 | Loop around to catch embedded _emacs_out output. | ||
| 30 | (run-python): Send the import&print command on a single line. | ||
| 31 | (python-send-command): Send command&print on a single line. | ||
| 32 | (python-send-string): Only add double \n if needed. | ||
| 33 | (python-send-receive): Loop until the result comes. | ||
| 34 | (python-mode-running): Defvar it. | ||
| 35 | (python-setup-brm): Remove unused var `menu'. | ||
| 36 | Only bind py-mode-map and `features' around brm-init. | ||
| 37 | (python-calculate-indentation): Remove unused var `point'. | ||
| 38 | (python-beginning-of-defun): Remove unused var `def-line'. | ||
| 39 | |||
| 40 | 2006-08-25 Richard Stallman <rms@gnu.org> | ||
| 41 | |||
| 42 | * kmacro.el (kmacro-repeat-on-last-key): Doc fix. | ||
| 43 | |||
| 44 | 2006-08-25 Michael Kifer <kifer@cs.stonybrook.edu> | ||
| 45 | |||
| 46 | * viper.el (viper-set-hooks): Use frame bindings for | ||
| 47 | viper-vi-state-cursor-color. | ||
| 48 | (viper-non-hook-settings): Don't set default | ||
| 49 | mode-line-buffer-identification. | ||
| 50 | |||
| 51 | * viper-util.el (viper-set-cursor-color-according-to-state): New fun. | ||
| 52 | (viper-set-cursor-color-according-to-state) | ||
| 53 | (viper-get-saved-cursor-color-in-replace-mode) | ||
| 54 | (viper-get-saved-cursor-color-in-insert-mode): Make conditional on | ||
| 55 | viper-emacs-state-cursor-color. | ||
| 56 | |||
| 57 | * viper-cmd.el (viper-envelop-ESC-key): Bug fix. | ||
| 58 | (viper-undo): Use point if undo-beg-posn is nil. | ||
| 59 | (viper-insert-state-post-command-sentinel, viper-change-state-to-emacs) | ||
| 60 | (viper-after-change-undo-hook): Don't use | ||
| 61 | viper-emacs-state-cursor-color by default. | ||
| 62 | (viper-undo): More sensible positioning after undo. | ||
| 63 | |||
| 64 | * viper-ex.el (ex-splice-args-in-1-letr-cmd): Get rid of caddr. | ||
| 65 | (viper-emacs-state-cursor-color): Default to nil, since this feature | ||
| 66 | doesn't work well yet. | ||
| 67 | |||
| 68 | * ediff-mult.el (ediff-intersect-directories) | ||
| 69 | (ediff-get-directory-files-under-revision, ediff-dir-diff-copy-file): | ||
| 70 | always expand filenames. | ||
| 71 | |||
| 72 | 2006-08-24 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 73 | |||
| 74 | * tumme.el: Remove * in defcustoms's docstrings. | ||
| 75 | |||
| 76 | 2006-08-24 Chong Yidong <cyd@stupidchicken.com> | ||
| 77 | |||
| 78 | * emacs-lisp/timer.el (timer-set-idle-time, run-with-idle-timer): | ||
| 79 | Accept internal time format for SECS arg. | ||
| 80 | (timer-relative-time): Doc fix. | ||
| 81 | |||
| 82 | * jit-lock.el: "Stealth fontification by requeuing timers" patch, | ||
| 83 | adapted from Martin Rudalics. | ||
| 84 | (jit-lock-stealth-repeat-timer, jit-lock-stealth-buffers): New vars. | ||
| 85 | (jit-lock-mode): Create jit-lock-stealth-repeat-timer. | ||
| 86 | (jit-lock-stealth-fontify): Reschedule as a idle timer instead of | ||
| 87 | using sit-for. | ||
| 88 | |||
| 89 | 2006-08-24 Francesc Rocher <francesc.rocher@gmail.com> | ||
| 90 | |||
| 91 | * cus-start.el (all): Add `overline-margin' and | ||
| 92 | `x-underline-at-descent-line'. | ||
| 93 | |||
| 94 | 2006-08-24 Kim F. Storm <storm@cua.dk> | ||
| 95 | |||
| 96 | * progmodes/grep.el (grep-find-use-xargs): Use explicit value `exec' | ||
| 97 | to mean "use find -exec"; nil now unambiguously means auto-detect. | ||
| 98 | (grep-compute-defaults): Set grep-find-use-xargs to `exec' if not `gnu'. | ||
| 99 | Use shell-quote-argument to build grep-find-command and grep-find-template. | ||
| 100 | (rgrep): Use shell-quote-argument to properly quote arguments to find. | ||
| 101 | Reported by Tom Seddon. | ||
| 102 | |||
| 103 | 2006-08-23 Chong Yidong <cyd@stupidchicken.com> | ||
| 104 | |||
| 105 | * startup.el (fancy-splash-head): Give instructions for dismissing | ||
| 106 | the splash screen for default startup too. | ||
| 107 | (display-startup-echo-area-message, fancy-splash-screens) | ||
| 108 | (use-fancy-splash-screens-p): New arg hide-on-input. If nil, show | ||
| 109 | all splash text at once and keep the splash buffer around. | ||
| 110 | (command-line-1): Give display-startup-echo-area-message a t arg. | ||
| 111 | |||
| 112 | 2006-08-23 Carsten Dominik <dominik@science.uva.nl> | ||
| 113 | |||
| 114 | * textmodes/org.el (org-follow-gnus-link): Make sure the dedicated | ||
| 115 | gnus frame is selected. | ||
| 116 | |||
| 117 | 2006-08-23 Nick Roberts <nickrob@snap.net.nz> | ||
| 118 | |||
| 119 | * progmodes/gdb-ui.el (gdb-starting): Reset gdb-signalled to nil. | ||
| 120 | |||
| 121 | 2006-08-22 Kim F. Storm <storm@cua.dk> | ||
| 122 | |||
| 123 | * ido.el (ido-set-matches-1): Fix full matching for subdirs. | ||
| 124 | Add suffix matching for subdirs. | ||
| 125 | |||
| 126 | 2006-08-22 Jorgen Schaefer <forcer@forcix.cx> (tiny change) | ||
| 127 | |||
| 128 | * x-dnd.el (x-dnd-drop-data): Don't call goto-char if | ||
| 129 | mouse-yank-at-point is non-nil. | ||
| 130 | |||
| 131 | 2006-08-22 Nick Roberts <nickrob@snap.net.nz> | ||
| 132 | |||
| 133 | * progmodes/gdb-ui.el (gdb-frame-memory-buffer): Make frame | ||
| 134 | a bit wider and remove fringes to fit initial output on line. | ||
| 135 | |||
| 136 | 2006-08-21 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 137 | |||
| 138 | * frame.el (blink-cursor-end): Only ignore the error we care about. | ||
| 139 | (blink-cursor-mode): Use blink-cursor-end to simplify the code. | ||
| 140 | |||
| 141 | 2006-08-21 Richard Stallman <rms@gnu.org> | ||
| 142 | |||
| 143 | * whitespace.el (whitespace-cleanup): Doc fix. | ||
| 144 | |||
| 145 | 2006-08-20 Ryan Yeske <rcyeske@gmail.com> | ||
| 146 | |||
| 147 | * net/rcirc.el (rcirc-show-maximum-output): New var. | ||
| 148 | (rcirc-buffer-process): If no buffer argument is supplied, use | ||
| 149 | current-buffer. | ||
| 150 | (rcirc-complete-nick): Complete to the last completed nick first. | ||
| 151 | (rcirc-mode): Preserve the value of `rcirc-urls' across | ||
| 152 | connections. Setup scroll function. | ||
| 153 | (rcirc-scroll-to-bottom): New function. | ||
| 154 | (rcirc-print): Use nick syntax around regexp work. | ||
| 155 | Notice dim-nicks speaking only if they say our nick. | ||
| 156 | (rcirc-update-activity-string): Do not show the modeline indicator | ||
| 157 | if there are no live rcirc processes. | ||
| 158 | (rcirc-cmd-ignore): Ignore case. | ||
| 159 | (rcirc-browse-url-at-point): Fix off-by-one error. | ||
| 160 | |||
| 161 | 2006-08-20 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 162 | |||
| 163 | * progmodes/python.el: Remove * in defcustom docstrings. | ||
| 164 | (run-python, python-proc, python-try-complete): Use derived-mode-p. | ||
| 165 | (python-mode): Set tab-width and indent-tabs-mode. | ||
| 166 | |||
| 167 | 2006-08-20 Dave Love <fx@gnu.org> | ||
| 168 | |||
| 169 | * progmodes/python.el: Update to Dave Love's latest version. | ||
| 170 | (python-font-lock-keywords, python-mode): Don't use | ||
| 171 | font-lock-syntax-table, but match symbol elements explicitly instead. | ||
| 172 | (python-mode-map): Add help, and a few more key bindings. | ||
| 173 | (python-skip-comments/blanks): Move out of comments as well. | ||
| 174 | (python-continuation-line-p): Behave better with unbalanced parens. | ||
| 175 | (python-blank-line-p): New fun. | ||
| 176 | (python-open-block-statement-p): Don't use a heuristic. | ||
| 177 | (python-outdent-p): Better handle blocks-in-the-same-line. | ||
| 178 | (python-calculate-indentation): Misc improvements. | ||
| 179 | (python-comment-indent): Remove. | ||
| 180 | (python-block-pairs): New var. | ||
| 181 | (python-first-word): New fun. | ||
| 182 | (python-indentation-levels): Handle more common cases. | ||
| 183 | (python-indent-line-1): Add `leave' argument. | ||
| 184 | (python-indent-region): New fun. | ||
| 185 | (python-skip-out): New fun. | ||
| 186 | (python-beginning-of-statement, python-end-of-statement): Use it. | ||
| 187 | (python-next-statement): Return correct count even at eob. | ||
| 188 | (python-end-of-block): Fix paren-typo. | ||
| 189 | (python-imenu-create-index): Add module variables. | ||
| 190 | (run-python): Add `new' arg. | ||
| 191 | Check we're at a prompt before returning. | ||
| 192 | (python-send-command): Move to end of buffer. | ||
| 193 | Wait for prompt to return. | ||
| 194 | (python-set-proc): New fun. | ||
| 195 | (python-imports): New var. | ||
| 196 | (python-describe-symbol): Use it. Adjust to new interface of `ehelp'. | ||
| 197 | (python-eldoc-function): Try to move out of arg list. | ||
| 198 | (python-outline-level): Offset by 1. | ||
| 199 | (python-find-imports): New fun. | ||
| 200 | (python-symbol-completions): Use python-imports. | ||
| 201 | (python-module-path, ffap-alist): Add support for ffap. | ||
| 202 | (python-skeletons, python-mode-abbrev-table, def-python-skeleton) | ||
| 203 | (pythin-insert-*, python-default-template, python-expand-template): | ||
| 204 | Add templates/skeletons. | ||
| 205 | (python-setup-brm): Support for Bicycle Repair Man. | ||
| 206 | (python-abbrev-syntax-table): New var. | ||
| 207 | (python-abbrev-pc-hook, python-pea-hook): New funs. | ||
| 208 | |||
| 209 | 2006-08-20 Chong Yidong <cyd@stupidchicken.com> | ||
| 210 | |||
| 211 | * frame.el (blink-cursor-start): Set timer first. | ||
| 212 | (blink-cursor-end): Ignore timer cancelling errors. | ||
| 213 | Suggested by Ken Manheimer. | ||
| 214 | |||
| 215 | 2006-08-20 Juanma Barranquero <lekktu@gmail.com> | ||
| 216 | |||
| 217 | * newcomment.el (comment-box): Call `comment-normalize-vars'. | ||
| 218 | Add autoload cookie. | ||
| 219 | |||
| 220 | 2006-08-20 Richard Stallman <rms@gnu.org> | ||
| 221 | |||
| 222 | * simple.el (line-number-at-pos): Doc fix. | ||
| 223 | |||
| 224 | * emacs-lisp/timer.el (run-with-idle-timer): Pass t to | ||
| 225 | timer-activate-when-idle, so timer can run before Emacs becomes | ||
| 226 | non-idle again. | ||
| 227 | |||
| 228 | 2006-08-18 Yoni Rabkin Katzenell <yoni-r@actcom.com> (tiny change) | ||
| 229 | |||
| 230 | * whitespace.el (whitespace-cleanup-internal): New optional arg | ||
| 231 | REGION-ONLY. If it's non-nil, modify the message to the user | ||
| 232 | accordingly. | ||
| 233 | (whitespace-cleanup-region): Call whitespace-cleanup-internal with | ||
| 234 | a non-nil argument. | ||
| 235 | |||
| 236 | 2006-08-18 Gustav H,Ae(Bllberg <gustav@gmail.com> (tiny change) | ||
| 237 | |||
| 238 | * rect.el (spaces-string): Simplify and add doc string. | ||
| 239 | |||
| 240 | 2006-08-17 Romain Francoise <romain@orebokech.com> | ||
| 241 | |||
| 242 | * progmodes/gdb-ui.el (gdb-edit-locals-value): Balance parens. | ||
| 243 | |||
| 244 | 2006-08-17 Richard Stallman <rms@gnu.org> | ||
| 245 | |||
| 246 | * compare-w.el (compare-windows): lambda's take an arg and pass | ||
| 247 | it to compare-windows-skip-whitespace. | ||
| 248 | |||
| 249 | 2006-08-17 Martin Rudalics <rudalics@gmx.at> | ||
| 250 | |||
| 251 | * jit-lock.el (jit-lock-fontify-now): Protect the modified status of | ||
| 252 | the right buffer. | ||
| 253 | |||
| 254 | 2006-08-17 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 255 | |||
| 256 | * pcvs-parse.el (cvs-parse-table): Accept the new `...' format for | ||
| 257 | removed files. | ||
| 258 | |||
| 259 | 2006-08-17 Nick Roberts <nickrob@snap.net.nz> | ||
| 260 | |||
| 261 | * progmodes/gdb-ui.el (gdb-locals-watch-map) | ||
| 262 | (gdb-locals-watch-map-1): Suppress keymap first. | ||
| 263 | (gdb-edit-locals-map-1): New variable. | ||
| 264 | (gdb-edit-locals-value): New function. | ||
| 265 | (gdb-stack-list-locals-handler): Use them. | ||
| 266 | |||
| 267 | 2006-08-16 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 268 | |||
| 269 | * mouse.el (global-map): Allow yanking with mouse-2 at a spot whose | ||
| 270 | cursor would normally be drawn in the fringe. | ||
| 271 | |||
| 272 | * font-lock.el (font-lock-extend-region-wholelines): Fix up typo. | ||
| 273 | Reported by Martin Rudalics <rudalics@gmx.at>. | ||
| 274 | |||
| 275 | 2006-08-16 Richard Stallman <rms@gnu.org> | ||
| 276 | |||
| 277 | * term/x-win.el (x-clipboard-yank): Specify * in interactive spec. | ||
| 278 | (special-event-map): Process drag-n-drop events this way. | ||
| 279 | |||
| 280 | * simple.el (move-beginning-of-line): Test whether fields | ||
| 281 | would prevent motion back to line's first visible character. | ||
| 282 | If so, stop where the fields would stop the motion. | ||
| 283 | |||
| 284 | * newcomment.el (comment-indent): Fully update INDENT | ||
| 285 | before checking to see if it will change the text. | ||
| 286 | |||
| 287 | * cus-edit.el (custom-newline): New function. | ||
| 288 | (custom-mode-map): Bind newline to custom-newline. | ||
| 289 | |||
| 290 | * compare-w.el (compare-windows): Factor compare-ignore-whitespace | ||
| 291 | into ignore-whitespace. | ||
| 292 | Check each buffer for its skip-function. | ||
| 293 | Handle compare-windows-skip-whitespace special-case test | ||
| 294 | by returning t from default skip function. | ||
| 295 | |||
| 296 | 2006-08-15 Carsten Dominik <dominik@science.uva.nl> | ||
| 297 | |||
| 298 | * textmodes/org.el (org-clock-special-range) | ||
| 299 | (org-clock-update-time-maybe): New functions. | ||
| 300 | (org-stamp-time-of-day-regexp): Allow weekday to be of word chars, | ||
| 301 | not only a-z. | ||
| 302 | (org-agenda-get-blocks): Allow multiple blocks per headline. | ||
| 303 | (org-timestamp-change): Call `org-clock-update-time-maybe'. | ||
| 304 | (org-export-html-title-format) | ||
| 305 | (org-export-html-toplevel-hlevel): New options. | ||
| 306 | (org-export-language-setup): Add support for Czech. | ||
| 307 | (org-mode, org-insert-todo-heading, org-find-visible) | ||
| 308 | (org-find-invisible, org-invisible-p, org-invisible-p2) | ||
| 309 | (org-back-to-heading, org-on-heading-p, org-up-heading-all) | ||
| 310 | (org-show-subtree, org-show-entry, org-make-options-regexp): | ||
| 311 | Remove compatibility support for old outline-mode. | ||
| 312 | (org-check-occur-regexp): Funtion removed. | ||
| 313 | (org-on-heading-p, org-back-to-heading): Made defalias. | ||
| 314 | (org-set-local): New defsubst. | ||
| 315 | (org-set-regexps-and-options, org-mode) | ||
| 316 | (org-set-font-lock-defaults, org-edit-agenda-file-list) | ||
| 317 | (org-timeline, org-agenda-list, org-todo-list, org-tags-view) | ||
| 318 | (org-remember-apply-template, org-table-edit-field) | ||
| 319 | (org-table-edit-formulas, orgtbl-mode, org-export-as-ascii) | ||
| 320 | (org-set-autofill-regexps): Use `org-set-local'. | ||
| 321 | (org-table-eval-formula): Fix bug with parsing of display flags. | ||
| 322 | |||
| 323 | 2006-08-15 Nick Roberts <nickrob@snap.net.nz> | ||
| 324 | |||
| 325 | * progmodes/gdb-ui.el (gdb-info-stack-custom): Indicate selected | ||
| 326 | frame with fringe arrow. Suggested by Simon Marshall | ||
| 327 | <simon.marshall@misys.com>. | ||
| 328 | (gdb-stack-position): New variable. | ||
| 329 | (gdb-starting, gdb-exited): Reset gdb-stack-position to nil. | ||
| 330 | (gdb-frames-mode): Set gdb-stack-position to nil. | ||
| 331 | Add to overlay-arrow-variable-list | ||
| 332 | (gdb-reset): Delete gdb-stack-position from above list. | ||
| 333 | |||
| 334 | 2006-08-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 335 | |||
| 336 | * term/x-win.el (menu-bar-edit-menu): Disable paste if buffer is | ||
| 337 | read only. | ||
| 338 | |||
| 339 | 2006-08-13 Romain Francoise <romain@orebokech.com> | ||
| 340 | |||
| 341 | * cus-theme.el (customize-create-theme) | ||
| 342 | (custom-theme-visit-theme): End `y-or-n-p' prompt with a space. | ||
| 343 | |||
| 344 | * filesets.el (filesets-add-buffer): Ditto. | ||
| 345 | |||
| 346 | * pcvs.el (cvs-change-cvsroot): Ditto. | ||
| 347 | |||
| 348 | 2006-08-13 Nick Roberts <nickrob@snap.net.nz> | ||
| 349 | |||
| 350 | * progmodes/gdb-ui.el (gdb-frame-separate-io-buffer) | ||
| 351 | (gdb-use-separate-io-buffer, menu): Avoid using `inferior' in text. | ||
| 352 | (gdb-memory-mode, gdb-locals-watch-map): Don't quote lambda | ||
| 353 | expressions. | ||
| 354 | (gdb-info-breakpoints-custom): Use gdb-breakpoint-regexp. | ||
| 355 | Only search till end of line. | ||
| 356 | Add face to function names in case of no filename. | ||
| 357 | Add face to variable names of watchpoints. | ||
| 358 | |||
| 359 | 2006-08-12 Robert Thorpe <rthorpe@realworldtech.com> (tiny change) | ||
| 360 | |||
| 361 | * cus-start.el <indent-tabs-mode>: Move to the `indent' | ||
| 362 | customization group. | ||
| 363 | |||
| 364 | 2006-08-12 Ken Manheimer <ken.manheimer@gmail.com> | ||
| 365 | |||
| 366 | * allout.el (allout-prior-bindings, allout-added-bindings): | ||
| 367 | Remove, after long deprecation. | ||
| 368 | (allout-beginning-of-line-cycles, allout-end-of-line-cycles): | ||
| 369 | Add customization vars controlling allout-beginning-of-line and | ||
| 370 | allout-end-of-line conveniences. | ||
| 371 | (allout-header-prefix, allout-use-mode-specific-leader) | ||
| 372 | (allout-use-mode-specific-leader, allout-mode-leaders): | ||
| 373 | Revise docstrings. | ||
| 374 | (allout-infer-header-lead): Change to be an alias for | ||
| 375 | allout-infer-header-lead-and-primary-bullet. | ||
| 376 | (allout-infer-header-lead-and-primary-bullet): New version of | ||
| 377 | allout-infer-header-lead which assigns the primary bullet to the | ||
| 378 | same as the header lead, when its being changed. | ||
| 379 | (allout-infer-body-reindent): Apply regexp-quote instead of | ||
| 380 | unconditionally prepending "\\", so that all literal | ||
| 381 | allout-header-prefix and allout-primary-bullet strings are | ||
| 382 | properly handled. | ||
| 383 | (allout-add-resumptions): Add optional qualifier for extending or | ||
| 384 | appending to existing values, rather than replacing them. | ||
| 385 | (allout-view-change-hook): Clarify docstring. | ||
| 386 | (allout-exposure-change-hook): Take explicit arguments, via | ||
| 387 | run-hook-with-args. | ||
| 388 | (allout-structure-added-hook) | ||
| 389 | (allout-structure-deleted-hook) | ||
| 390 | (allout-structure-shifted-hook): New hooks analogous to | ||
| 391 | allout-exposure-change-hook for other kinds of structural outline | ||
| 392 | edits. | ||
| 393 | (allout-encryption-plaintext-sanitization-regexps): New encryption | ||
| 394 | customization variable, by which cooperating modes can provde | ||
| 395 | massage of the plaintext without actually being passed it. | ||
| 396 | (allout-encryption-ciphertext-rejection-regexps) | ||
| 397 | (allout-encryption-ciphertext-rejection-ceiling): New encryption | ||
| 398 | customization variables, by which cooperating modes can prohibit | ||
| 399 | rare but possible ciphertext patterns from fouling their | ||
| 400 | operation, with actually being passed the ciphertext. | ||
| 401 | (allout-mode): Run activation and deactivation hooks after the | ||
| 402 | minor-mode variable has been toggled, to clarify the mode | ||
| 403 | disposition. The new encryption ciphertext rejection variable is | ||
| 404 | used to ensure that the ciphertext does not contain text that | ||
| 405 | would be recognized as outline structural elements by allout. | ||
| 406 | Substite allout-beginning-of-line and allout-end-of-line for | ||
| 407 | conventionall beginning-of-line and end-of-line bindings. | ||
| 408 | If allout-old-style-prefixes is non-nil, don't nullify it on mode | ||
| 409 | activation! | ||
| 410 | (allout-beginning-of-line): Respect `allout-beginning-of-line-cycles'. | ||
| 411 | (allout-end-of-line): Respect `allout-end-of-line-cycles'. | ||
| 412 | (allout-chart-subtree): Implement new mode, charting only the | ||
| 413 | visible items in the subtree, when new 'visible' parameter is non-nil. | ||
| 414 | (allout-end-of-subtree): Properly handle the last item in the buffer. | ||
| 415 | (allout-pre-command-business, allout-command-counter): | ||
| 416 | Increment an advertised counter so that cooperating enhancements can | ||
| 417 | track revisions of items. | ||
| 418 | (allout-open-topic): Run allout-structure-added-hook with suitable | ||
| 419 | arguments. | ||
| 420 | (allout-shift-in): Run allout-structure-shifted-hook with suitable | ||
| 421 | arguments. | ||
| 422 | (allout-shift-out): Fix doubling for negative args and ensure call | ||
| 423 | of allout-structure-shifted-hook by solely using allout-shift-in. | ||
| 424 | (allout-kill-line, allout-kill-topic): | ||
| 425 | Run allout-structure-deleted-hook with suitable arguments. | ||
| 426 | (allout-yank-processing): Run allout-structure-added-hook with | ||
| 427 | proper arguments. | ||
| 428 | (allout-yank): Enclose activity in allout-unprotected. | ||
| 429 | (allout-flag-region): Run allout-exposure-change-hook with | ||
| 430 | suitable arguments, instead of making the callee infer the arguments. | ||
| 431 | (allout-encrypt-string): | ||
| 432 | Support allout-encryption-plaintext-sanitization-regexps, | ||
| 433 | allout-encryption-ciphertext-rejection-regexps, and | ||
| 434 | allout-encryption-ciphertext-rejection-ceiling. Indicate correct | ||
| 435 | en/de cryption mode in symmetric encryption failure message. | ||
| 436 | (allout-obtain-passphrase): Use copy-sequence to get a distinct | ||
| 437 | copy of the passphrase, and don't zero it or we'll corrupt the | ||
| 438 | stashed copy. | ||
| 439 | (allout-create-encryption-passphrase-verifier) | ||
| 440 | (allout-verify-passphrase): Respect the new signature for | ||
| 441 | allout-encrypt-string. | ||
| 442 | (allout-get-configvar-values): Convenience for getting a | ||
| 443 | configuration variable value and handling its absence gracefully. | ||
| 444 | |||
| 445 | 2006-08-11 Romain Francoise <romain@orebokech.com> | ||
| 446 | |||
| 447 | * obsolete/zone-mode.el: Delete. | ||
| 448 | |||
| 449 | 2006-08-11 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 450 | |||
| 451 | * textmodes/dns-mode.el (dns-mode): Use before-save-hook. | ||
| 452 | |||
| 453 | 2006-08-11 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 454 | |||
| 455 | * emacs-lisp/bindat.el (bindat-ip-to-string): | ||
| 456 | Use `format-network-address' if possible. | ||
| 457 | |||
| 458 | 2006-08-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 459 | |||
| 460 | * x-dnd.el (x-dnd-init-frame): Call x-register-dnd-atom. | ||
| 461 | |||
| 462 | 2006-08-10 Chong Yidong <cyd@stupidchicken.com> | ||
| 463 | |||
| 464 | * emacs-lisp/edebug.el (edebug-recursive-edit): Don't save and | ||
| 465 | restore unread-command-events here. | ||
| 466 | (edebug-display): Do it here, to detect sit-for interruptions. | ||
| 467 | |||
| 468 | 2006-08-10 Romain Francoise <romain@orebokech.com> | ||
| 469 | |||
| 470 | * textmodes/dns-mode.el: Alias `zone-mode' to `dns-mode'. | ||
| 471 | (dns-mode-soa-auto-increment-serial): New user option. | ||
| 472 | (dns-mode-soa-maybe-increment-serial): New function. | ||
| 473 | (dns-mode): Add the latter to `write-contents-functions'. | ||
| 474 | |||
| 475 | * obsolete/zone-mode.el: Move to obsolete/ from net/. | ||
| 476 | Delete autoload cookies. | ||
| 477 | |||
| 478 | 2006-08-10 John Wiegley <johnw@newartisans.com> | ||
| 479 | |||
| 480 | * eshell/em-glob.el (eshell-glob-chars-list) | ||
| 481 | (eshell-glob-translate-alist): Add support for [^g] in character globs. | ||
| 482 | |||
| 483 | 2006-08-10 Richard Stallman <rms@gnu.org> | ||
| 484 | |||
| 485 | * facemenu.el (facemenu-add-face): Pass frame to facemenu-active-faces. | ||
| 486 | (facemenu-set-face): Doc fix. | ||
| 487 | (facemenu-listed-faces): Doc fix. | ||
| 488 | |||
| 489 | 2006-08-09 Chong Yidong <cyd@stupidchicken.com> | ||
| 490 | |||
| 491 | * avoid.el (mouse-avoidance-animating-pointer): New var. | ||
| 492 | (mouse-avoidance-nudge-mouse): Use it. | ||
| 493 | (mouse-avoidance-banish): Rename from mouse-avoidance-banish-hook. | ||
| 494 | (mouse-avoidance-exile): Rename from mouse-avoidance-exile-hook | ||
| 495 | (mouse-avoidance-fancy): Rename from mouse-avoidance-fancy-hook. | ||
| 496 | Don't activate if currently animating. All callers changed. | ||
| 497 | |||
| 498 | 2006-08-09 John Wiegley <johnw@newartisans.com> | ||
| 499 | |||
| 500 | * calendar/timeclock.el (timeclock-use-elapsed): Added a new | ||
| 501 | variable, which causes timeclock to report elapsed time worked, | ||
| 502 | instead of just work remaining. | ||
| 503 | |||
| 504 | 2006-08-09 Kenichi Handa <handa@m17n.org> | ||
| 505 | |||
| 506 | * international/latexenc.el (latexenc-find-file-coding-system): | ||
| 507 | Fix for the case that the 2nd element of arg-list is a cons. | ||
| 508 | |||
| 509 | 2006-08-08 Chong Yidong <cyd@stupidchicken.com> | ||
| 510 | |||
| 511 | * info.el (Info-fontify-node): Handle preceding `in' for note | ||
| 512 | reference hiding rules. | ||
| 513 | |||
| 514 | 2006-08-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 515 | |||
| 516 | * progmodes/sh-script.el (sh-quoted-subshell): Make sure we don't | ||
| 517 | mistake a closing " for an opening one. | ||
| 518 | |||
| 519 | 2006-08-07 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 520 | |||
| 521 | * term/xterm.el (terminal-init-xterm): Add more key bindings. | ||
| 522 | |||
| 523 | 2006-08-07 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 524 | |||
| 525 | * complete.el (PC-do-completion): Filter out completions matching | ||
| 526 | completion-ignored-extensions before checking whether there are | ||
| 527 | multiple completions. | ||
| 528 | Don't use `list' unnecessarily when building completion tables. | ||
| 529 | |||
| 530 | 2006-08-06 Richard Stallman <rms@gnu.org> | ||
| 531 | |||
| 532 | * help.el (describe-mode): Make minor mode list more concise. | ||
| 533 | |||
| 534 | 2006-08-05 Chong Yidong <cyd@stupidchicken.com> | ||
| 535 | |||
| 536 | * bindings.el: Give mode-line-format, mode-line-modes, and | ||
| 537 | mode-line-position `standard-value' properties. | ||
| 538 | |||
| 539 | 2006-08-05 Eli Zaretskii <eliz@gnu.org> | ||
| 540 | |||
| 541 | * buff-menu.el (list-buffers-noselect): For Info buffers, use | ||
| 542 | "(file)node" instead of the file name. | ||
| 543 | |||
| 544 | 2006-08-05 Richard Stallman <rms@gnu.org> | ||
| 545 | |||
| 546 | * faces.el (escape-glyph): Doc fix. | ||
| 547 | |||
| 548 | 2006-08-04 Kenichi Handa <handa@m17n.org> | ||
| 549 | |||
| 550 | * international/mule-diag.el (describe-font): Improve docstring | ||
| 551 | and error message. Use frame-parameter (not frame-parameters). | ||
| 552 | |||
| 553 | 2006-08-03 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 554 | |||
| 555 | * progmodes/gud.el (gdb-script-font-lock-syntactic-keywords): | ||
| 556 | Correctly mark the end-of-docstring char. | ||
| 557 | |||
| 558 | 2006-08-03 Chong Yidong <cyd@stupidchicken.com> | ||
| 559 | |||
| 560 | * simple.el (line-move-to-column): Constrain move-to-column to | ||
| 561 | current field. | ||
| 562 | |||
| 563 | 2006-08-03 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 564 | |||
| 565 | * font-lock.el (font-lock-beg, font-lock-end) | ||
| 566 | (font-lock-extend-region-functions): New vars. | ||
| 567 | (font-lock-extend-region-multiline) | ||
| 568 | (font-lock-extend-region-wholelines): New functions. | ||
| 569 | (font-lock-default-fontify-region): Use them. | ||
| 570 | (font-lock-extend-jit-lock-region-after-change): Only round up | ||
| 571 | if font-lock-default-fontify-region will do it as well. | ||
| 572 | |||
| 573 | * font-lock.el (font-lock-extend-after-change-region-function): | ||
| 574 | Rename from font-lock-extend-region-function. | ||
| 575 | (font-lock-extend-region): Remove by inlining at call sites. | ||
| 576 | (font-lock-after-change-function): Don't needlessly round up to a whole | ||
| 577 | number of lines. | ||
| 578 | (font-lock-extend-jit-lock-region-after-change): Be more careful about | ||
| 579 | the boundary conditions and the interactions between the various ways | ||
| 580 | to extend the region. | ||
| 581 | |||
| 582 | 2006-08-02 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 583 | |||
| 584 | * jit-lock.el (jit-lock-fontify-now): Preserve the buffer's | ||
| 585 | modification status when forcing the second redisplay. | ||
| 586 | |||
| 587 | 2006-08-03 Kim F. Storm <storm@cua.dk> | ||
| 588 | |||
| 589 | * edmacro.el (edmacro-fix-menu-commands): Ignore switch-frame. | ||
| 590 | |||
| 591 | 2006-08-02 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 592 | |||
| 593 | * pcvs-util.el (cvs-get-buffer-create): Obey `noreuse' even if `name' | ||
| 594 | doesn't look like a file name. | ||
| 595 | |||
| 596 | * complete.el (PC-expand-many-files): Avoid signalling an error when | ||
| 597 | the current directory doesn't exist. Reported by Micha,Ak(Bl Cadilhac. | ||
| 598 | |||
| 599 | 2006-08-02 Andreas Schwab <schwab@suse.de> | ||
| 600 | |||
| 601 | * bindings.el (mode-line-format): Simplify reference to vc-mode. | ||
| 602 | |||
| 603 | 2006-08-02 Nick Roberts <nickrob@snap.net.nz> | ||
| 604 | |||
| 605 | * bindings.el (map): Make mode-line-buffer-identification-keymap | ||
| 606 | before defining propertized-buffer-identification. | ||
| 607 | |||
| 608 | 2006-08-01 Richard Stallman <rms@gnu.org> | ||
| 609 | |||
| 610 | * bindings.el (mode-line-format): Adjust spacing around vc-mode. | ||
| 611 | |||
| 612 | 2006-08-02 Nick Roberts <nickrob@snap.net.nz> | ||
| 613 | |||
| 614 | * progmodes/gdb-ui.el (gdb-find-source-frame): Make nil the | ||
| 615 | default value. | ||
| 616 | (gdb-find-source-frame): New function. | ||
| 617 | (menu): Add to menu bar. | ||
| 618 | |||
| 619 | 2006-08-01 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 620 | |||
| 621 | * font-core.el (font-lock-extend-region-function) | ||
| 622 | (font-lock-extend-region): Move to font-lock.el. | ||
| 623 | |||
| 624 | * font-lock.el (font-lock-extend-region-function) | ||
| 625 | (font-lock-extend-region): Move from font-core.el. Simplify. | ||
| 626 | |||
| 627 | * jit-lock.el (jit-lock-fontify-now): Cause a second redisplay | ||
| 628 | if needed. | ||
| 629 | (jit-lock-start, jit-lock-end): New dynamic scoped vars. | ||
| 630 | (jit-lock-after-change-extend-region-functions): New hook. | ||
| 631 | (jit-lock-after-change): Use it instead of hard-coding font-lock code. | ||
| 632 | |||
| 633 | * font-lock.el (font-lock-extend-jit-lock-region-after-change): New fun. | ||
| 634 | (font-lock-turn-on-thing-lock): Use it. | ||
| 635 | |||
| 636 | * longlines.el (longlines-show-region): Make it work on read-only | ||
| 637 | buffers as well. | ||
| 638 | |||
| 639 | 2006-08-01 Nick Roberts <nickrob@snap.net.nz> | ||
| 640 | |||
| 641 | * progmodes/gdb-ui.el (gdb-set-hollow): Check for gud-last-last-frame. | ||
| 642 | |||
| 643 | 2006-07-31 Richard Stallman <rms@gnu.org> | ||
| 644 | |||
| 645 | * progmodes/vhdl-mode.el (vhdl-speedbar-display-directory) | ||
| 646 | (vhdl-speedbar-display-projects): Update old obsolete | ||
| 647 | speedbar variable names. | ||
| 648 | |||
| 649 | 2006-07-31 Nick Roberts <nickrob@snap.net.nz> | ||
| 650 | |||
| 651 | * progmodes/gdb-ui.el (gdb-find-source-frame): New option. | ||
| 652 | (gdb-stopped): Use it. | ||
| 653 | |||
| 654 | * t-mouse.el (t-mouse-mode): Use set-process-query-on-exit-flag. | ||
| 655 | |||
| 656 | 2006-07-29 Chong Yidong <cyd@stupidchicken.com> | ||
| 657 | |||
| 658 | * loadhist.el (unload-feature): Handle new `(t . SYMBOL)' format | ||
| 659 | for load-history elements. | ||
| 660 | |||
| 661 | 2006-07-29 Eli Zaretskii <eliz@gnu.org> | ||
| 662 | |||
| 663 | * files.el (convert-standard-filename): For Cygwin, replace | ||
| 664 | characters not allowed in Windows file names. | ||
| 665 | (make-auto-save-file-name): Add Cygwin to the list of systems | ||
| 666 | where the auto-save file name needs to be run through | ||
| 667 | convert-standard-filename. | ||
| 668 | |||
| 669 | 2006-07-29 Lennart Borgman <lennart.borgman.073@student.lu.se> | ||
| 670 | |||
| 671 | * window.el (bw-get-tree): Don't integerp subtree if it's nil. | ||
| 672 | |||
| 673 | 2006-07-28 Richard Stallman <rms@gnu.org> | ||
| 674 | |||
| 675 | * bindings.el (mode-line-frame-identification) | ||
| 676 | (propertized-buffer-identification): Centralize the code | ||
| 677 | to initialize the variable. | ||
| 678 | |||
| 679 | * progmodes/grep.el (grep-default-command): Catch errors from | ||
| 680 | wildcard-to-regexp. | ||
| 681 | |||
| 682 | 2006-07-29 Kim F. Storm <storm@cua.dk> | ||
| 683 | |||
| 684 | * progmodes/grep.el (grep-tag-default): New function. | ||
| 685 | (grep-default-command, grep-read-regexp): Use it. | ||
| 686 | (grep-read-files): Use car of grep-files-history or grep-files-aliases | ||
| 687 | as default if nothing else applies. | ||
| 688 | |||
| 689 | 2006-07-28 Bill Atkins <atkinw@rpi.edu> (tiny change) | ||
| 690 | |||
| 691 | * wdired.el (wdired-change-to-wdired-mode, wdired-change-to-dired-mode): | ||
| 692 | Throw error if buffer is not in Dired and Wdired mode, respectively. | ||
| 693 | |||
| 694 | 2006-07-28 Chong Yidong <cyd@stupidchicken.com> | ||
| 695 | |||
| 696 | * cus-edit.el (custom-no-edit): Revert 2006-07-27 change, so that | ||
| 697 | self-insert-command keys don't activate buttons. | ||
| 698 | (custom-mode-map): Just don't bind "\C-m" to `custom-no-edit'. | ||
| 699 | |||
| 700 | 2006-07-29 Nick Roberts <nickrob@snap.net.nz> | ||
| 701 | |||
| 702 | * progmodes/gdb-ui.el (gdb-info-breakpoints-custom): Use different | ||
| 703 | faces for enable character. | ||
| 704 | |||
| 1 | 2006-07-28 Nick Roberts <nickrob@snap.net.nz> | 705 | 2006-07-28 Nick Roberts <nickrob@snap.net.nz> |
| 2 | 706 | ||
| 3 | * Makefile.in (recompile): Update comment to reflect change | 707 | * Makefile.in (recompile): Update comment to reflect change |
| @@ -31,9 +735,9 @@ | |||
| 31 | 735 | ||
| 32 | 2006-07-26 Mathias Dahl <mathias.dahl@gmail.com> | 736 | 2006-07-26 Mathias Dahl <mathias.dahl@gmail.com> |
| 33 | 737 | ||
| 34 | * tumme.el (tumme-backward-image): Add prefix argument. Add error | 738 | * tumme.el (tumme-backward-image): Add prefix argument. Add error |
| 35 | when at first image. | 739 | when at first image. |
| 36 | (tumme-forward-image): Add prefix argument. Add error when at last | 740 | (tumme-forward-image): Add prefix argument. Add error when at last |
| 37 | image. | 741 | image. |
| 38 | 742 | ||
| 39 | 2006-07-25 Stefan Monnier <monnier@iro.umontreal.ca> | 743 | 2006-07-25 Stefan Monnier <monnier@iro.umontreal.ca> |
| @@ -45,10 +749,10 @@ | |||
| 45 | 749 | ||
| 46 | * tumme.el (tumme-track-original-file): Add `buffer-live-p' check. | 750 | * tumme.el (tumme-track-original-file): Add `buffer-live-p' check. |
| 47 | (tumme-format-properties-string): Handle empty `buf'. | 751 | (tumme-format-properties-string): Handle empty `buf'. |
| 48 | (tumme-get-comment): Change variable names inside `let'. Add | 752 | (tumme-get-comment): Change variable names inside `let'. |
| 49 | missing `let' variable that cause font-lock problems. | 753 | Add missing `let' variable that cause font-lock problems. |
| 50 | (tumme-write-comments): Change variable names inside `let'. Add | 754 | (tumme-write-comments): Change variable names inside `let'. |
| 51 | missing `let' variable that cause font-lock problems. | 755 | Add missing `let' variable that cause font-lock problems. |
| 52 | (tumme-forward-image): Rename from `tumme-forward-char'. | 756 | (tumme-forward-image): Rename from `tumme-forward-char'. |
| 53 | (tumme-backward-image): Rename from `tumme-backward-char'. | 757 | (tumme-backward-image): Rename from `tumme-backward-char'. |
| 54 | 758 | ||
| @@ -97,8 +801,8 @@ | |||
| 97 | 2006-07-24 Daiki Ueno <ueno@unixuser.org> | 801 | 2006-07-24 Daiki Ueno <ueno@unixuser.org> |
| 98 | 802 | ||
| 99 | * pgg-def.el (pgg-truncate-key-identifier): Truncate the key ID to 8 | 803 | * pgg-def.el (pgg-truncate-key-identifier): Truncate the key ID to 8 |
| 100 | letters from the end. Thanks to "David Smith" <davidsmith@acm.org> and | 804 | letters from the end. Thanks to "David Smith" <davidsmith@acm.org> |
| 101 | andreas@altroot.de (Andreas V,Av(Bgele) | 805 | and andreas@altroot.de (Andreas V,Av(Bgele). |
| 102 | 806 | ||
| 103 | 2006-07-23 Thien-Thi Nguyen <ttn@gnu.org> | 807 | 2006-07-23 Thien-Thi Nguyen <ttn@gnu.org> |
| 104 | 808 | ||
| @@ -137,7 +841,7 @@ | |||
| 137 | 2006-07-21 Dan Nicolaescu <dann@ics.uci.edu> | 841 | 2006-07-21 Dan Nicolaescu <dann@ics.uci.edu> |
| 138 | 842 | ||
| 139 | * term/xterm.el (terminal-init-xterm): Fix key bindings | 843 | * term/xterm.el (terminal-init-xterm): Fix key bindings |
| 140 | syntax. Bind S-return, C-M-., C-TAB, S-TAB and C-S-TAB. | 844 | syntax. Bind S-return, C-M-., C-TAB, S-TAB and C-S-TAB. |
| 141 | 845 | ||
| 142 | 2006-07-21 Eli Zaretskii <eliz@gnu.org> | 846 | 2006-07-21 Eli Zaretskii <eliz@gnu.org> |
| 143 | 847 | ||
| @@ -173,7 +877,7 @@ | |||
| 173 | 877 | ||
| 174 | * calc.el (calc-previous-alg-entry): Remove variable. | 878 | * calc.el (calc-previous-alg-entry): Remove variable. |
| 175 | 879 | ||
| 176 | * calc-aent.el (calc-alg-entry-history, calc-quick-calc-history): | 880 | * calc-aent.el (calc-alg-entry-history, calc-quick-calc-history): |
| 177 | New variables. | 881 | New variables. |
| 178 | (calc-alg-entry): Use `calc-alg-entry-history'. | 882 | (calc-alg-entry): Use `calc-alg-entry-history'. |
| 179 | (calc-do-quick-calc): Use `calc-quick-calc-history'. | 883 | (calc-do-quick-calc): Use `calc-quick-calc-history'. |
| @@ -497,8 +1201,8 @@ | |||
| 497 | 1201 | ||
| 498 | 2006-07-10 Chong Yidong <cyd@stupidchicken.com> | 1202 | 2006-07-10 Chong Yidong <cyd@stupidchicken.com> |
| 499 | 1203 | ||
| 500 | * progmodes/cc-awk.el (defconst): Use eval-and-compile to avoid | 1204 | * progmodes/cc-awk.el (c-awk-escaped-nls*): Use eval-and-compile to |
| 501 | compilation error. | 1205 | avoid compilation error. |
| 502 | 1206 | ||
| 503 | * subr.el (sit-for): New function. | 1207 | * subr.el (sit-for): New function. |
| 504 | 1208 | ||
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 | |||
| 220 | Cycling only happens on when the command is repeated, not when it | ||
| 221 | follows a different command. | ||
| 222 | |||
| 223 | Smart-placement means that repeated calls to this function will | ||
| 224 | advance 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 | |||
| 239 | In this fashion, you can use the beginning-of-line command to do | ||
| 240 | its normal job and then, when repeated, advance through the | ||
| 241 | entry, cycling back to start. | ||
| 242 | |||
| 243 | If this configuration variable is nil, then the cursor is just | ||
| 244 | advanced to the beginning of the line and remains there on | ||
| 245 | repeated 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 | |||
| 251 | Cycling only happens on when the command is repeated, not when it | ||
| 252 | follows a different command. | ||
| 253 | |||
| 254 | Smart-placement means that repeated calls to this function will | ||
| 255 | advance 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 | |||
| 264 | In this fashion, you can use the end-of-line command to do its | ||
| 265 | normal job and then, when repeated, advance through the entry, | ||
| 266 | cycling back to start. | ||
| 267 | |||
| 268 | If this configuration variable is nil, then the cursor is just | ||
| 269 | advanced to the end of the line and remains there on repeated | ||
| 270 | calls." | ||
| 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 | ||
| 220 | Outline topic header lines are identified by a leading topic | 279 | Outline topic header lines are identified by a leading topic |
| 221 | header prefix, which mostly have the value of this var at their front. | 280 | header prefix, which mostly have the value of this var at their front. |
| 222 | \(Level 1 topics are exceptions. They consist of only a single | 281 | Level 1 topics are exceptions. They consist of only a single |
| 223 | character, which is typically set to the `allout-primary-bullet'. Many | 282 | character, which is typically set to the `allout-primary-bullet'." |
| 224 | outlines 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 | ||
| 303 | Allout outline mode will use the mode-specific `allout-mode-leaders' | 361 | Allout outline mode will use the mode-specific `allout-mode-leaders' or |
| 304 | and/or comment-start string, if any, to lead the topic prefix string, | 362 | comment-start string, if any, to lead the topic prefix string, so topic |
| 305 | so topic headers look like comments in the programming language. | 363 | headers look like comments in the programming language. It will also use |
| 364 | the comment-start string, with an '_' appended, for `allout-primary-bullet'. | ||
| 306 | 365 | ||
| 307 | String values are used as they stand. | 366 | String values are used as literals, not regular expressions, so |
| 367 | do not escape any regulare-expression characters. | ||
| 308 | 368 | ||
| 309 | Value t means to first check for assoc value in `allout-mode-leaders' | 369 | Value t means to first check for assoc value in `allout-mode-leaders' |
| 310 | alist, then use comment-start string, if any, then use default \(`.'). | 370 | alist, 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 \(`.'). | |||
| 313 | Set to the symbol for either of `allout-mode-leaders' or | 373 | Set 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 | ||
| 316 | Value nil means to always use the default \(`.'). | 376 | Value nil means to always use the default \(`.') and leave |
| 317 | 377 | `allout-primary-bullet' unaltered. | |
| 318 | comment-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 | 379 | comment-start strings that do not end in spaces are tripled in |
| 320 | comment strings. comment-start strings that do end in spaces are not | 380 | the header-prefix, and an `_' underscore is tacked on the end, to |
| 321 | tripled, but an underscore is substituted for the space. [This | 381 | distinguish them from regular comment strings. comment-start |
| 322 | presumes that the space is for appearance, not comment syntax. You | 382 | strings that do end in spaces are not tripled, but an underscore |
| 323 | can use `allout-mode-leaders' to override this behavior, when | 383 | is substituted for the space. [This presumes that the space is |
| 324 | incorrect.]" | 384 | for appearance, not comment syntax. You can use |
| 385 | `allout-mode-leaders' to override this behavior, when | ||
| 386 | undesired.]" | ||
| 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 | ||
| 337 | Entries will be used instead or in lieu of mode-specific | 399 | Use this if the mode's comment-start string isn't what you |
| 338 | comment-start strings. See also `allout-use-mode-specific-leader'. | 400 | prefer, or if the mode lacks a comment-start string. See |
| 401 | `allout-use-mode-specific-leader' for more details. | ||
| 339 | 402 | ||
| 340 | If you're constructing a string that will comment-out outline | 403 | If you're constructing a string that will comment-out outline |
| 341 | structuring so it can be included in program code, append an extra | 404 | structuring so it can be included in program code, append an extra |
| 342 | character, like an \"_\" underscore, to distinguish the lead string | 405 | character, like an \"_\" underscore, to distinguish the lead string |
| 343 | from regular comments that start at bol.") | 406 | from 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 | ||
| 835 | Works according to settings of: | 898 | Works 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 | ||
| 971 | resurrecting, on mode deactivation, bindings that existed before | ||
| 972 | activation. 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 | ||
| 976 | resurrecting, on mode deactivation, bindings that existed before | ||
| 977 | activation. 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 | ||
| 1055 | Old settings are preserved for later resumption using `allout-do-resumptions'. | 1112 | Old settings are preserved for later resumption using `allout-do-resumptions'. |
| 1056 | 1113 | ||
| 1114 | The new values are set as a buffer local. On resumption, the prior buffer | ||
| 1115 | scope of the variable is restored along with its value. If it was a void | ||
| 1116 | buffer-local value, then it is left as nil on resumption. | ||
| 1117 | |||
| 1057 | The pairs are lists whose car is the name of the variable and car of the | 1118 | The pairs are lists whose car is the name of the variable and car of the |
| 1058 | cdr is the new value: '(some-var some-value)'. | 1119 | cdr is the new value: '(some-var some-value)'. The pairs can actually be |
| 1120 | triples, where the third element qualifies the disposition of the setting, | ||
| 1121 | as described further below. | ||
| 1059 | 1122 | ||
| 1060 | The new value is set as a buffer local. | 1123 | If the optional third element is the symbol 'extend, then the new value |
| 1124 | created by `cons'ing the second element of the pair onto the front of the | ||
| 1125 | existing value. | ||
| 1061 | 1126 | ||
| 1062 | If the variable was not previously buffer-local, then that is noted and the | 1127 | If 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. | 1128 | extended from the existing one by `append'ing a list containing the second |
| 1129 | element of the pair onto the end of the existing value. | ||
| 1064 | 1130 | ||
| 1065 | If it previously was buffer-local, the old value is noted and resurrected | 1131 | Extension, and resumptions in general, should not be used for hook |
| 1066 | by `allout-do-resumptions'. \(If the local value was previously void, then | 1132 | functions - use the 'local mode of `add-hook' for that, instead. |
| 1067 | it is left as nil on resumption.\) | ||
| 1068 | 1133 | ||
| 1069 | The settings are stored on `allout-mode-prior-settings'." | 1134 | The 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 | ||
| 1126 | Switch to using `allout-exposure-change-hook' instead. Both | 1205 | Switch to using `allout-exposure-change-hook' instead. Both hooks are |
| 1127 | variables are currently respected, but this one will be ignored | 1206 | currently respected, but the other conveys the details of the exposure |
| 1128 | in a subsequent allout version.") | 1207 | change via explicit parameters, and this one will eventually be disabled in |
| 1208 | a 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 | |||
| 1213 | It is run at the conclusion of `allout-flag-region'. | ||
| 1214 | |||
| 1215 | Functions 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 | |||
| 1221 | This hook might be invoked multiple times by a single command. | ||
| 1222 | |||
| 1223 | This hook is replacing `allout-view-change-hook', which is being deprecated | ||
| 1224 | and 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 | |||
| 1229 | Functions 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 | |||
| 1234 | Some edits that introduce new items may missed by this hook - | ||
| 1235 | specifically edits that native allout routines do not control. | ||
| 1236 | |||
| 1237 | This 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 | |||
| 1242 | Functions 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 | |||
| 1247 | Some edits that remove or invalidate items may missed by this hook - | ||
| 1248 | specifically edits that native allout routines do not control. | ||
| 1132 | 1249 | ||
| 1133 | This variable will replace `allout-view-change-hook' in a subsequent allout | 1250 | This hook might be invoked multiple times by a single command.") |
| 1134 | version, 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 | ||
| 1255 | Functions 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 | |||
| 1260 | Some edits that shift items can be missed by this hook - specifically edits | ||
| 1261 | that native allout routines do not control. | ||
| 1262 | |||
| 1263 | This 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 | |||
| 1186 | This is used to decrypt the topic that was currently being edited, if it | 1314 | This is used to decrypt the topic that was currently being edited, if it |
| 1187 | was encrypted automatically as part of a file write or autosave.") | 1315 | was 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 | |||
| 1321 | This is for the sake of removing artifacts, like escapes, that are added on | ||
| 1322 | and not actually part of the original plaintext. The removal is done just | ||
| 1323 | prior to encryption. | ||
| 1324 | |||
| 1325 | Entries must be symbols that are bound to the desired values. | ||
| 1326 | |||
| 1327 | Each value can be a regexp or a list with a regexp followed by a | ||
| 1328 | substitution string. If it's just a regexp, all its matches are removed | ||
| 1329 | before the text is encrypted. If it's a regexp and a substitution, the | ||
| 1330 | substition 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 | |||
| 1336 | This is for the sake of redoing encryption in cases where the ciphertext | ||
| 1337 | incidentally contains strings that would disrupt mode operation - | ||
| 1338 | for example, a line that happens to look like an allout-mode topic prefix. | ||
| 1339 | |||
| 1340 | Entries must be symbols that are bound to the desired regexp values. | ||
| 1341 | |||
| 1342 | The encryption will be retried up to | ||
| 1343 | `allout-encryption-ciphertext-rejection-limit' times, after which an error | ||
| 1344 | is 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 | |||
| 1351 | See `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 | ||
| 2115 | Optional argument LEVELS specifies the depth \(relative to start | 2337 | Optional argument LEVELS specifies the depth \(relative to start |
| 2116 | depth) for the chart. Subsequent optional args are not for public | 2338 | depth) for the chart. |
| 2117 | use. | 2339 | |
| 2340 | When optional argument VISIBLE is non-nil, the chart includes | ||
| 2341 | only the visible subelements of the charted subjects. | ||
| 2342 | |||
| 2343 | The remaining optional args are not for internal use by the function. | ||
| 2118 | 2344 | ||
| 2119 | Point is left at the end of the subtree. | 2345 | Point 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 | |||
| 2675 | are mapped to the command of the corresponding control-key on the | 2910 | are 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 | |||
| 2917 | Set by `allout-pre-command-business', to support allout addons in | ||
| 2918 | coordinating 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. |
| 2704 | Implements special behavior when cursor is on bullet character. | 2946 | |
| 2947 | Among other things, implements special behavior when the cursor is on the | ||
| 2948 | topic bullet character. | ||
| 2705 | 2949 | ||
| 2706 | When the cursor is on the bullet character, self-insert characters are | 2950 | When the cursor is on the bullet character, self-insert characters are |
| 2707 | reinterpreted as the corresponding control-character in the | 2951 | reinterpreted as the corresponding control-character in the |
| @@ -2709,7 +2953,7 @@ reinterpreted as the corresponding control-character in the | |||
| 2709 | the cursor which has moved as a result of such reinterpretation is | 2953 | the cursor which has moved as a result of such reinterpretation is |
| 2710 | positioned on the bullet character of the destination topic. | 2954 | positioned on the bullet character of the destination topic. |
| 2711 | 2955 | ||
| 2712 | The upshot is that you can get easy, single (ie, unmodified) key | 2956 | The upshot is that you can get easy, single \(ie, unmodified\) key |
| 2713 | outline maneuvering operations by positioning the cursor on the bullet | 2957 | outline maneuvering operations by positioning the cursor on the bullet |
| 2714 | char. When in this mode you can use regular cursor-positioning | 2958 | char. When in this mode you can use regular cursor-positioning |
| 2715 | command/keystrokes to relocate the cursor off of a bullet character to | 2959 | command/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 | ||
| 2991 | If OFFER-RECENT-BULLET is true, offer to use the bullet of the prior sibling. | 3238 | If OFFER-RECENT-BULLET is true, offer to use the bullet of the prior sibling. |
| 2992 | 3239 | ||
| 3240 | Runs | ||
| 3241 | |||
| 2993 | Nuances: | 3242 | Nuances: |
| 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 | |||
| 3548 | depth, however." | 3802 | depth, 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 | |||
| 3574 | discontinuity. The first topic in the file can be adjusted to any positive | 3842 | discontinuity. The first topic in the file can be adjusted to any positive |
| 3575 | depth, however." | 3843 | depth, 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 | |||
| 4156 | Exposure-change hook `allout-exposure-change-hook' is run with the same | ||
| 4157 | arguments as this function, after the exposure changes are made. \(The old | ||
| 4158 | `allout-view-change-hook' is being deprecated, and eventually will not be | ||
| 4159 | invoked.\)" | ||
| 3886 | 4160 | ||
| 3887 | Text 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 | |||
| 4071 | default, they are treated as being uncollapsed." | 4344 | default, 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 | ||
| 5104 | If DECRYPT is true (default false), then decrypt instead of encrypt. | 5379 | If 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. | |||
| 5116 | Optional PASSPHRASE enables explicit delivery of the decryption passphrase, | 5391 | Optional PASSPHRASE enables explicit delivery of the decryption passphrase, |
| 5117 | for verification purposes. | 5392 | for verification purposes. |
| 5118 | 5393 | ||
| 5394 | Optional REJECTED is for internal use - conveys the number of | ||
| 5395 | rejections due to matches against | ||
| 5396 | `allout-encryption-ciphertext-rejection-regexps', as limited by | ||
| 5397 | `allout-encryption-ciphertext-rejection-ceiling'. | ||
| 5398 | |||
| 5119 | Returns the resulting string, or nil if the transformation fails." | 5399 | Returns 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 | |||
| 6127 | The user is prompted for removal of symbols that are unbound, and they | ||
| 6128 | otherwise are ignored. | ||
| 6129 | |||
| 6130 | CONFIGVAR-NAME should be the name of the configuration variable, | ||
| 6131 | not 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 eea9184cee4..9671bf26f25 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el | |||
| @@ -215,14 +215,6 @@ mnemonics of the following coding systems: | |||
| 215 | 215 | ||
| 216 | (make-variable-buffer-local 'mode-line-mule-info) | 216 | (make-variable-buffer-local 'mode-line-mule-info) |
| 217 | 217 | ||
| 218 | (defvar mode-line-buffer-identification (purecopy '("%12b")) "\ | ||
| 219 | Mode-line control for identifying the buffer being displayed. | ||
| 220 | Its default value is (\"%12b\"). | ||
| 221 | Major modes that edit things other than ordinary files may change this | ||
| 222 | \(e.g. Info, Dired,...)") | ||
| 223 | |||
| 224 | (make-variable-buffer-local 'mode-line-buffer-identification) | ||
| 225 | |||
| 226 | (defvar mode-line-frame-identification '(window-system " " "-%F ") | 218 | (defvar mode-line-frame-identification '(window-system " " "-%F ") |
| 227 | "Mode-line control to describe the current frame.") | 219 | "Mode-line control to describe the current frame.") |
| 228 | 220 | ||
| @@ -294,56 +286,102 @@ Keymap to display on minor modes.") | |||
| 294 | ;; mouse-1: select window, mouse-2: delete others, mouse-3: delete, | 286 | ;; mouse-1: select window, mouse-2: delete others, mouse-3: delete, |
| 295 | ;; drag-mouse-1: resize, C-mouse-2: split horizontally" | 287 | ;; drag-mouse-1: resize, C-mouse-2: split horizontally" |
| 296 | "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this") | 288 | "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this") |
| 297 | (dashes (propertize "--" 'help-echo help-echo))) | 289 | (dashes (propertize "--" 'help-echo help-echo)) |
| 298 | (setq-default mode-line-format | 290 | (standard-mode-line-format |
| 299 | (list | 291 | (list |
| 300 | "%e" | 292 | "%e" |
| 301 | (propertize "-" 'help-echo help-echo) | 293 | (propertize "-" 'help-echo help-echo) |
| 302 | 'mode-line-mule-info | 294 | 'mode-line-mule-info |
| 303 | 'mode-line-client | 295 | 'mode-line-client |
| 304 | 'mode-line-modified | 296 | 'mode-line-modified |
| 305 | 'mode-line-frame-identification | 297 | 'mode-line-frame-identification |
| 306 | 'mode-line-buffer-identification | 298 | 'mode-line-buffer-identification |
| 307 | (propertize " " 'help-echo help-echo) | 299 | (propertize " " 'help-echo help-echo) |
| 308 | 'mode-line-position | 300 | 'mode-line-position |
| 309 | `(vc-mode ("" vc-mode ,(propertize " " 'help-echo help-echo))) | 301 | '(vc-mode vc-mode) |
| 310 | 'mode-line-modes | 302 | (propertize " " 'help-echo help-echo) |
| 311 | `(which-func-mode ("" which-func-format ,dashes)) | 303 | 'mode-line-modes |
| 312 | `(global-mode-string (,dashes global-mode-string)) | 304 | `(which-func-mode ("" which-func-format ,dashes)) |
| 313 | (propertize "-%-" 'help-echo help-echo))) | 305 | `(global-mode-string (,dashes global-mode-string)) |
| 314 | 306 | (propertize "-%-" 'help-echo help-echo))) | |
| 315 | (setq-default mode-line-modes | 307 | (standard-mode-line-modes |
| 316 | (list | 308 | (list |
| 317 | (propertize "%[(" 'help-echo help-echo) | 309 | (propertize "%[(" 'help-echo help-echo) |
| 318 | `(:propertize ("" mode-name) | 310 | `(:propertize ("" mode-name) |
| 319 | help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes" | 311 | help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes" |
| 320 | mouse-face mode-line-highlight | 312 | mouse-face mode-line-highlight |
| 321 | local-map ,mode-line-major-mode-keymap) | 313 | local-map ,mode-line-major-mode-keymap) |
| 322 | '("" mode-line-process) | 314 | '("" mode-line-process) |
| 323 | `(:propertize ("" minor-mode-alist) | 315 | `(:propertize ("" minor-mode-alist) |
| 324 | mouse-face mode-line-highlight | 316 | mouse-face mode-line-highlight |
| 325 | help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes" | 317 | help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes" |
| 326 | local-map ,mode-line-minor-mode-keymap) | 318 | local-map ,mode-line-minor-mode-keymap) |
| 327 | (propertize "%n" 'help-echo "mouse-2: widen" | 319 | (propertize "%n" 'help-echo "mouse-2: widen" |
| 328 | 'mouse-face 'mode-line-highlight | 320 | 'mouse-face 'mode-line-highlight |
| 329 | 'local-map (make-mode-line-mouse-map | 321 | 'local-map (make-mode-line-mouse-map |
| 330 | 'mouse-2 #'mode-line-widen)) | 322 | 'mouse-2 #'mode-line-widen)) |
| 331 | (propertize ")%]--" 'help-echo help-echo))) | 323 | (propertize ")%]--" 'help-echo help-echo))) |
| 332 | 324 | ||
| 333 | (setq-default mode-line-position | 325 | (standard-mode-line-position |
| 334 | `((-3 ,(propertize "%p" 'help-echo help-echo)) | 326 | `((-3 ,(propertize "%p" 'help-echo help-echo)) |
| 335 | (size-indication-mode | 327 | (size-indication-mode |
| 336 | (8 ,(propertize " of %I" 'help-echo help-echo))) | 328 | (8 ,(propertize " of %I" 'help-echo help-echo))) |
| 337 | (line-number-mode | 329 | (line-number-mode |
| 338 | ((column-number-mode | 330 | ((column-number-mode |
| 339 | (10 ,(propertize " (%l,%c)" 'help-echo help-echo)) | 331 | (10 ,(propertize " (%l,%c)" 'help-echo help-echo)) |
| 340 | (6 ,(propertize " L%l" 'help-echo help-echo)))) | 332 | (6 ,(propertize " L%l" 'help-echo help-echo)))) |
| 341 | ((column-number-mode | 333 | ((column-number-mode |
| 342 | (5 ,(propertize " C%c" 'help-echo help-echo)))))))) | 334 | (5 ,(propertize " C%c" 'help-echo help-echo)))))))) |
| 335 | |||
| 336 | (setq-default mode-line-format standard-mode-line-format) | ||
| 337 | (put 'mode-line-format 'standard-value | ||
| 338 | (list `(quote ,standard-mode-line-format))) | ||
| 339 | |||
| 340 | (setq-default mode-line-modes standard-mode-line-modes) | ||
| 341 | (put 'mode-line-modes 'standard-value | ||
| 342 | (list `(quote ,standard-mode-line-modes))) | ||
| 343 | |||
| 344 | (setq-default mode-line-position standard-mode-line-position) | ||
| 345 | (put 'mode-line-position 'standard-value | ||
| 346 | (list `(quote ,standard-mode-line-position)))) | ||
| 343 | 347 | ||
| 344 | (defvar mode-line-buffer-identification-keymap nil "\ | 348 | (defvar mode-line-buffer-identification-keymap nil "\ |
| 345 | Keymap for what is displayed by `mode-line-buffer-identification'.") | 349 | Keymap for what is displayed by `mode-line-buffer-identification'.") |
| 346 | 350 | ||
| 351 | ;; Add menu of buffer operations to the buffer identification part | ||
| 352 | ;; of the mode line.or header line. | ||
| 353 | ; | ||
| 354 | (let ((map (make-sparse-keymap))) | ||
| 355 | ;; Bind down- events so that the global keymap won't ``shine | ||
| 356 | ;; through''. | ||
| 357 | (define-key map [mode-line mouse-1] 'mode-line-previous-buffer) | ||
| 358 | (define-key map [header-line down-mouse-1] 'ignore) | ||
| 359 | (define-key map [header-line mouse-1] 'mode-line-previous-buffer) | ||
| 360 | (define-key map [header-line down-mouse-3] 'ignore) | ||
| 361 | (define-key map [mode-line mouse-3] 'mode-line-next-buffer) | ||
| 362 | (define-key map [header-line down-mouse-3] 'ignore) | ||
| 363 | (define-key map [header-line mouse-3] 'mode-line-next-buffer) | ||
| 364 | (setq mode-line-buffer-identification-keymap map)) | ||
| 365 | |||
| 366 | (defun propertized-buffer-identification (fmt) | ||
| 367 | "Return a list suitable for `mode-line-buffer-identification'. | ||
| 368 | FMT is a format specifier such as \"%12b\". This function adds | ||
| 369 | text properties for face, help-echo, and local-map to it." | ||
| 370 | (list (propertize fmt | ||
| 371 | 'face 'mode-line-buffer-id | ||
| 372 | 'help-echo | ||
| 373 | (purecopy "mouse-1: previous buffer, mouse-3: next buffer") | ||
| 374 | 'mouse-face 'mode-line-highlight | ||
| 375 | 'local-map mode-line-buffer-identification-keymap))) | ||
| 376 | |||
| 377 | (defvar mode-line-buffer-identification (propertized-buffer-identification "%12b") "\ | ||
| 378 | Mode-line control for identifying the buffer being displayed. | ||
| 379 | Its default value is (\"%12b\") with some text properties added. | ||
| 380 | Major modes that edit things other than ordinary files may change this | ||
| 381 | \(e.g. Info, Dired,...)") | ||
| 382 | |||
| 383 | (make-variable-buffer-local 'mode-line-buffer-identification) | ||
| 384 | |||
| 347 | (defun unbury-buffer () "\ | 385 | (defun unbury-buffer () "\ |
| 348 | Switch to the last buffer in the buffer list." | 386 | Switch to the last buffer in the buffer list." |
| 349 | (interactive) | 387 | (interactive) |
| @@ -449,35 +487,6 @@ Menu of mode operations in the mode line.") | |||
| 449 | (let ((indicator (car (nth 4 (car (cdr event)))))) | 487 | (let ((indicator (car (nth 4 (car (cdr event)))))) |
| 450 | (describe-minor-mode-from-indicator indicator))) | 488 | (describe-minor-mode-from-indicator indicator))) |
| 451 | 489 | ||
| 452 | ;; Add menu of buffer operations to the buffer identification part | ||
| 453 | ;; of the mode line.or header line. | ||
| 454 | ; | ||
| 455 | (let ((map (make-sparse-keymap))) | ||
| 456 | ;; Bind down- events so that the global keymap won't ``shine | ||
| 457 | ;; through''. | ||
| 458 | (define-key map [mode-line mouse-1] 'mode-line-previous-buffer) | ||
| 459 | (define-key map [header-line down-mouse-1] 'ignore) | ||
| 460 | (define-key map [header-line mouse-1] 'mode-line-previous-buffer) | ||
| 461 | (define-key map [header-line down-mouse-3] 'ignore) | ||
| 462 | (define-key map [mode-line mouse-3] 'mode-line-next-buffer) | ||
| 463 | (define-key map [header-line down-mouse-3] 'ignore) | ||
| 464 | (define-key map [header-line mouse-3] 'mode-line-next-buffer) | ||
| 465 | (setq mode-line-buffer-identification-keymap map)) | ||
| 466 | |||
| 467 | (defun propertized-buffer-identification (fmt) | ||
| 468 | "Return a list suitable for `mode-line-buffer-identification'. | ||
| 469 | FMT is a format specifier such as \"%12b\". This function adds | ||
| 470 | text properties for face, help-echo, and local-map to it." | ||
| 471 | (list (propertize fmt | ||
| 472 | 'face 'mode-line-buffer-id | ||
| 473 | 'help-echo | ||
| 474 | (purecopy "mouse-1: previous buffer, mouse-3: next buffer") | ||
| 475 | 'mouse-face 'mode-line-highlight | ||
| 476 | 'local-map mode-line-buffer-identification-keymap))) | ||
| 477 | |||
| 478 | (setq-default mode-line-buffer-identification | ||
| 479 | (propertized-buffer-identification "%12b")) | ||
| 480 | |||
| 481 | (defvar minor-mode-alist nil "\ | 490 | (defvar minor-mode-alist nil "\ |
| 482 | Alist saying how to show minor modes in the mode line. | 491 | Alist saying how to show minor modes in the mode line. |
| 483 | Each element looks like (VARIABLE STRING); | 492 | Each element looks like (VARIABLE STRING); |
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 | |||
| 117 | Auto Revert Mode.") | 117 | Auto 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'. |
| 99 | For example, if the length of a normal workday is eight hours, and you | 99 | For example, if the length of a normal workday is eight hours, and you |
| 100 | work four hours on Monday, then the amount of time \"remaining\" on | 100 | work four hours on Monday, then the amount of time \"remaining\" on |
| 101 | Tuesday is twelve hours -- relative to an averaged work period of | 101 | Tuesday is twelve hours -- relative to an averaged work period of |
| @@ -251,7 +251,10 @@ each day.") | |||
| 251 | This value is not accurate enough to be useful by itself. Rather, | 251 | This value is not accurate enough to be useful by itself. Rather, |
| 252 | call `timeclock-workday-elapsed', to determine how much time has been | 252 | call `timeclock-workday-elapsed', to determine how much time has been |
| 253 | worked so far today. Also, if `timeclock-relative' is nil, this value | 253 | worked so far today. Also, if `timeclock-relative' is nil, this value |
| 254 | will be the same as `timeclock-discrepancy'.") ; ? gm | 254 | will 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. | |||
| 424 | If TODAY-ONLY is non-nil, the display will be relative only to time | 427 | If TODAY-ONLY is non-nil, the display will be relative only to time |
| 425 | worked today, ignoring the time worked on previous days." | 428 | worked 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." | |||
| 619 | The value of `timeclock-relative' affects the display as described in | 624 | The value of `timeclock-relative' affects the display as described in |
| 620 | that variable's documentation." | 625 | that 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..8dc0ac1e330 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, | |||
| 167 | on second call it synchronizes points by skipping the difference, | 167 | on second call it synchronizes points by skipping the difference, |
| 168 | on third call it again advances points to the next difference and so on." | 168 | on 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,21 @@ 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 (pos) | ||
| 195 | (compare-windows-skip-whitespace pos) | ||
| 196 | t) | ||
| 197 | compare-windows-whitespace))) | ||
| 198 | |||
| 199 | (with-current-buffer b2 | ||
| 200 | (setq skip-func-2 (if ignore-whitespace | ||
| 201 | (if (stringp compare-windows-whitespace) | ||
| 202 | (lambda (pos) | ||
| 203 | (compare-windows-skip-whitespace pos) | ||
| 204 | t) | ||
| 205 | compare-windows-whitespace))) | ||
| 195 | (push-mark p2 t) | 206 | (push-mark p2 t) |
| 196 | (setq maxp2 (point-max))) | 207 | (setq maxp2 (point-max))) |
| 197 | (push-mark) | 208 | (push-mark) |
| @@ -199,17 +210,16 @@ on third call it again advances points to the next difference and so on." | |||
| 199 | (while (> progress 0) | 210 | (while (> progress 0) |
| 200 | ;; If both windows have whitespace next to point, | 211 | ;; If both windows have whitespace next to point, |
| 201 | ;; optionally skip over it. | 212 | ;; optionally skip over it. |
| 202 | (and skip-func | 213 | (and skip-func-1 |
| 203 | (save-excursion | 214 | (save-excursion |
| 204 | (let (p1a p2a w1 w2 result1 result2) | 215 | (let (p1a p2a w1 w2 result1 result2) |
| 205 | (setq result1 (funcall skip-func opoint1)) | 216 | (setq result1 (funcall skip-func-1 opoint1)) |
| 206 | (setq p1a (point)) | 217 | (setq p1a (point)) |
| 207 | (set-buffer b2) | 218 | (set-buffer b2) |
| 208 | (goto-char p2) | 219 | (goto-char p2) |
| 209 | (setq result2 (funcall skip-func opoint2)) | 220 | (setq result2 (funcall skip-func-2 opoint2)) |
| 210 | (setq p2a (point)) | 221 | (setq p2a (point)) |
| 211 | (if (or (stringp compare-windows-whitespace) | 222 | (if (and result1 result2 (eq result1 result2)) |
| 212 | (and result1 result2 (eq result1 result2))) | ||
| 213 | (setq p1 p1a | 223 | (setq p1 p1a |
| 214 | p2 p2a))))) | 224 | p2 p2a))))) |
| 215 | 225 | ||
diff --git a/lisp/complete.el b/lisp/complete.el index ca6231893c3..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)) |
| @@ -811,6 +808,12 @@ or properties are considered." | |||
| 811 | (defun PC-expand-many-files (name) | 808 | (defun PC-expand-many-files (name) |
| 812 | (with-current-buffer (generate-new-buffer " *Glob Output*") | 809 | (with-current-buffer (generate-new-buffer " *Glob Output*") |
| 813 | (erase-buffer) | 810 | (erase-buffer) |
| 811 | (when (and (file-name-absolute-p name) | ||
| 812 | (not (file-directory-p default-directory))) | ||
| 813 | ;; If the current working directory doesn't exist `shell-command' | ||
| 814 | ;; signals an error. So if the file names we're looking for don't | ||
| 815 | ;; depend on the working directory, switch to a valid directory first. | ||
| 816 | (setq default-directory "/")) | ||
| 814 | (shell-command (concat "echo " name) t) | 817 | (shell-command (concat "echo " name) t) |
| 815 | (goto-char (point-min)) | 818 | (goto-char (point-min)) |
| 816 | ;; CSH-style shells were known to output "No match", whereas | 819 | ;; CSH-style shells were known to output "No match", whereas |
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 15f43080aff..609b5572a08 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -4435,9 +4435,8 @@ The format is suitable for use with `easy-menu-define'." | |||
| 4435 | ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26. | 4435 | ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26. |
| 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] | 4438 | (define-key map [remap self-insert-command] 'custom-no-edit) |
| 4439 | 'custom-no-edit) | 4439 | (define-key map "\^m" 'custom-newline) |
| 4440 | (define-key map "\^m" 'custom-no-edit) | ||
| 4441 | (define-key map " " 'scroll-up) | 4440 | (define-key map " " 'scroll-up) |
| 4442 | (define-key map "\177" 'scroll-down) | 4441 | (define-key map "\177" 'scroll-down) |
| 4443 | (define-key map "\C-c\C-c" 'Custom-set) | 4442 | (define-key map "\C-c\C-c" 'Custom-set) |
| @@ -4452,6 +4451,11 @@ The format is suitable for use with `easy-menu-define'." | |||
| 4452 | (defun custom-no-edit (pos &optional event) | 4451 | (defun custom-no-edit (pos &optional event) |
| 4453 | "Invoke button at POS, or refuse to allow editing of Custom buffer." | 4452 | "Invoke button at POS, or refuse to allow editing of Custom buffer." |
| 4454 | (interactive "@d") | 4453 | (interactive "@d") |
| 4454 | (error "You can't edit this part of the Custom buffer")) | ||
| 4455 | |||
| 4456 | (defun custom-newline (pos &optional event) | ||
| 4457 | "Invoke button at POS, or refuse to allow editing of Custom buffer." | ||
| 4458 | (interactive "@d") | ||
| 4455 | (let ((button (get-char-property pos 'button))) | 4459 | (let ((button (get-char-property pos 'button))) |
| 4456 | (if button | 4460 | (if button |
| 4457 | (widget-apply-action button event) | 4461 | (widget-apply-action button event) |
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index cceed27951e..b59cb57aaf6 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el | |||
| @@ -175,7 +175,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of | |||
| 175 | ;; fringe.c | 175 | ;; fringe.c |
| 176 | (overflow-newline-into-fringe fringe boolean) | 176 | (overflow-newline-into-fringe fringe boolean) |
| 177 | ;; indent.c | 177 | ;; indent.c |
| 178 | (indent-tabs-mode fill boolean) | 178 | (indent-tabs-mode indent boolean) |
| 179 | ;; keyboard.c | 179 | ;; keyboard.c |
| 180 | (meta-prefix-char keyboard character) | 180 | (meta-prefix-char keyboard character) |
| 181 | (auto-save-interval auto-save integer) | 181 | (auto-save-interval auto-save integer) |
| @@ -360,6 +360,7 @@ since it could result in memory overflow and make Emacs crash." | |||
| 360 | (other :tag "Unlimited" t))) | 360 | (other :tag "Unlimited" t))) |
| 361 | (unibyte-display-via-language-environment mule boolean) | 361 | (unibyte-display-via-language-environment mule boolean) |
| 362 | (blink-cursor-alist cursor alist "22.1") | 362 | (blink-cursor-alist cursor alist "22.1") |
| 363 | (overline-margin display integer "22.1") | ||
| 363 | ;; xfaces.c | 364 | ;; xfaces.c |
| 364 | (scalable-fonts-allowed display boolean) | 365 | (scalable-fonts-allowed display boolean) |
| 365 | ;; xfns.c | 366 | ;; xfns.c |
| @@ -371,6 +372,7 @@ since it could result in memory overflow and make Emacs crash." | |||
| 371 | ;; xterm.c | 372 | ;; xterm.c |
| 372 | (mouse-autoselect-window display boolean "21.3") | 373 | (mouse-autoselect-window display boolean "21.3") |
| 373 | (x-use-underline-position-properties display boolean "21.3") | 374 | (x-use-underline-position-properties display boolean "21.3") |
| 375 | (x-underline-at-descent-line display boolean "22.1") | ||
| 374 | (x-stretch-cursor display boolean "21.1"))) | 376 | (x-stretch-cursor display boolean "21.1"))) |
| 375 | this symbol group type standard version native-p | 377 | this symbol group type standard version native-p |
| 376 | ;; This function turns a value | 378 | ;; This function turns a value |
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/ediff-mult.el b/lisp/ediff-mult.el index 71859a5d4c5..b33ad7c1859 100644 --- a/lisp/ediff-mult.el +++ b/lisp/ediff-mult.el | |||
| @@ -648,8 +648,8 @@ behavior." | |||
| 648 | (mapcar | 648 | (mapcar |
| 649 | (lambda (elt) | 649 | (lambda (elt) |
| 650 | (ediff-make-new-meta-list-element | 650 | (ediff-make-new-meta-list-element |
| 651 | (concat auxdir1 elt) | 651 | (expand-file-name (concat auxdir1 elt)) |
| 652 | (concat auxdir2 elt) | 652 | (expand-file-name (concat auxdir2 elt)) |
| 653 | (if lis3 | 653 | (if lis3 |
| 654 | (progn | 654 | (progn |
| 655 | ;; The following is done because: In merging with | 655 | ;; The following is done because: In merging with |
| @@ -660,7 +660,7 @@ behavior." | |||
| 660 | ;; the second case, we insert nil. | 660 | ;; the second case, we insert nil. |
| 661 | (setq elt (ediff-add-slash-if-directory auxdir3 elt)) | 661 | (setq elt (ediff-add-slash-if-directory auxdir3 elt)) |
| 662 | (if (file-exists-p (concat auxdir3 elt)) | 662 | (if (file-exists-p (concat auxdir3 elt)) |
| 663 | (concat auxdir3 elt)))))) | 663 | (expand-file-name (concat auxdir3 elt))))))) |
| 664 | common))) | 664 | common))) |
| 665 | ;; return result | 665 | ;; return result |
| 666 | (cons common-part difflist) | 666 | (cons common-part difflist) |
| @@ -716,7 +716,7 @@ behavior." | |||
| 716 | auxdir1 nil nil | 716 | auxdir1 nil nil |
| 717 | merge-autostore-dir nil) | 717 | merge-autostore-dir nil) |
| 718 | (mapcar (lambda (elt) (ediff-make-new-meta-list-element | 718 | (mapcar (lambda (elt) (ediff-make-new-meta-list-element |
| 719 | (concat auxdir1 elt) nil nil)) | 719 | (expand-file-name (concat auxdir1 elt)) nil nil)) |
| 720 | common)) | 720 | common)) |
| 721 | )) | 721 | )) |
| 722 | 722 | ||
| @@ -1338,7 +1338,10 @@ Useful commands: | |||
| 1338 | ;; update ediff-meta-list by direct modification | 1338 | ;; update ediff-meta-list by direct modification |
| 1339 | (nconc meta-list | 1339 | (nconc meta-list |
| 1340 | (list (ediff-make-new-meta-list-element | 1340 | (list (ediff-make-new-meta-list-element |
| 1341 | otherfile1 otherfile2 otherfile3))) | 1341 | (expand-file-name otherfile1) |
| 1342 | (expand-file-name otherfile2) | ||
| 1343 | (if otherfile3 | ||
| 1344 | (expand-file-name otherfile3))))) | ||
| 1342 | ) | 1345 | ) |
| 1343 | (ediff-update-meta-buffer meta-buf 'must-redraw) | 1346 | (ediff-update-meta-buffer meta-buf 'must-redraw) |
| 1344 | )) | 1347 | )) |
diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 86bf29f0381..3b562bbdbdf 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el | |||
| @@ -670,6 +670,7 @@ This function assumes that the events can be stored in a string." | |||
| 670 | (cond ((atom ev) | 670 | (cond ((atom ev) |
| 671 | (push ev result)) | 671 | (push ev result)) |
| 672 | ((eq (car ev) 'help-echo)) | 672 | ((eq (car ev) 'help-echo)) |
| 673 | ((eq (car ev) 'switch-frame)) | ||
| 673 | ((equal ev '(menu-bar)) | 674 | ((equal ev '(menu-bar)) |
| 674 | (push 'menu-bar result)) | 675 | (push 'menu-bar result)) |
| 675 | ((equal (cadadr ev) '(menu-bar)) | 676 | ((equal (cadadr ev) '(menu-bar)) |
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" | 623 | The 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/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index bbeea5d703d..68603c905a5 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el | |||
| @@ -193,8 +193,14 @@ | |||
| 193 | (defvar compilation-error-regexp-alist) | 193 | (defvar compilation-error-regexp-alist) |
| 194 | (defvar compilation-mode-font-lock-keywords) | 194 | (defvar compilation-mode-font-lock-keywords) |
| 195 | 195 | ||
| 196 | (defgroup checkdoc nil | ||
| 197 | "Support for doc string checking in Emacs Lisp." | ||
| 198 | :prefix "checkdoc" | ||
| 199 | :group 'lisp | ||
| 200 | :version "20.3") | ||
| 201 | |||
| 196 | (defcustom checkdoc-autofix-flag 'semiautomatic | 202 | (defcustom checkdoc-autofix-flag 'semiautomatic |
| 197 | "*Non-nil means attempt auto-fixing of doc strings. | 203 | "Non-nil means attempt auto-fixing of doc strings. |
| 198 | If this value is the symbol `query', then the user is queried before | 204 | If this value is the symbol `query', then the user is queried before |
| 199 | any change is made. If the value is `automatic', then all changes are | 205 | any change is made. If the value is `automatic', then all changes are |
| 200 | made without asking unless the change is very-complex. If the value | 206 | made without asking unless the change is very-complex. If the value |
| @@ -208,37 +214,39 @@ The value `never' is the same as nil, never ask or change anything." | |||
| 208 | (other :tag "semiautomatic" semiautomatic))) | 214 | (other :tag "semiautomatic" semiautomatic))) |
| 209 | 215 | ||
| 210 | (defcustom checkdoc-bouncy-flag t | 216 | (defcustom checkdoc-bouncy-flag t |
| 211 | "*Non-nil means to \"bounce\" to auto-fix locations. | 217 | "Non-nil means to \"bounce\" to auto-fix locations. |
| 212 | Setting this to nil will silently make fixes that require no user | 218 | Setting this to nil will silently make fixes that require no user |
| 213 | interaction. See `checkdoc-autofix-flag' for auto-fixing details." | 219 | interaction. See `checkdoc-autofix-flag' for auto-fixing details." |
| 214 | :group 'checkdoc | 220 | :group 'checkdoc |
| 215 | :type 'boolean) | 221 | :type 'boolean) |
| 216 | 222 | ||
| 217 | (defcustom checkdoc-force-docstrings-flag t | 223 | (defcustom checkdoc-force-docstrings-flag t |
| 218 | "*Non-nil means that all checkable definitions should have documentation. | 224 | "Non-nil means that all checkable definitions should have documentation. |
| 219 | Style guide dictates that interactive functions MUST have documentation, | 225 | Style guide dictates that interactive functions MUST have documentation, |
| 220 | and that it's good but not required practice to make non user visible items | 226 | and that it's good but not required practice to make non user visible items |
| 221 | have doc strings." | 227 | have doc strings." |
| 222 | :group 'checkdoc | 228 | :group 'checkdoc |
| 223 | :type 'boolean) | 229 | :type 'boolean) |
| 230 | (put 'checkdoc-force-docstrings-flag 'safe-local-variable 'booleanp) | ||
| 224 | 231 | ||
| 225 | (defcustom checkdoc-force-history-flag t | 232 | (defcustom checkdoc-force-history-flag t |
| 226 | "*Non-nil means that files should have a History section or ChangeLog file. | 233 | "Non-nil means that files should have a History section or ChangeLog file. |
| 227 | This helps document the evolution of, and recent changes to, the package." | 234 | This helps document the evolution of, and recent changes to, the package." |
| 228 | :group 'checkdoc | 235 | :group 'checkdoc |
| 229 | :type 'boolean) | 236 | :type 'boolean) |
| 230 | 237 | ||
| 231 | (defcustom checkdoc-permit-comma-termination-flag nil | 238 | (defcustom checkdoc-permit-comma-termination-flag nil |
| 232 | "*Non-nil means the first line of a docstring may end with a comma. | 239 | "Non-nil means the first line of a docstring may end with a comma. |
| 233 | Ordinarily, a full sentence is required. This may be misleading when | 240 | Ordinarily, a full sentence is required. This may be misleading when |
| 234 | there is a substantial caveat to the one-line description -- the comma | 241 | there is a substantial caveat to the one-line description -- the comma |
| 235 | should be used when the first part could stand alone as a sentence, but | 242 | should be used when the first part could stand alone as a sentence, but |
| 236 | it indicates that a modifying clause follows." | 243 | it indicates that a modifying clause follows." |
| 237 | :group 'checkdoc | 244 | :group 'checkdoc |
| 238 | :type 'boolean) | 245 | :type 'boolean) |
| 246 | (put 'checkdoc-permit-comma-termination-flag 'safe-local-variable 'booleanp) | ||
| 239 | 247 | ||
| 240 | (defcustom checkdoc-spellcheck-documentation-flag nil | 248 | (defcustom checkdoc-spellcheck-documentation-flag nil |
| 241 | "*Non-nil means run Ispell on text based on value. | 249 | "Non-nil means run Ispell on text based on value. |
| 242 | This is automatically set to nil if Ispell does not exist on your | 250 | This is automatically set to nil if Ispell does not exist on your |
| 243 | system. Possible values are: | 251 | system. Possible values are: |
| 244 | 252 | ||
| @@ -259,14 +267,14 @@ system. Possible values are: | |||
| 259 | "List of words that are correct when spell-checking Lisp documentation.") | 267 | "List of words that are correct when spell-checking Lisp documentation.") |
| 260 | 268 | ||
| 261 | (defcustom checkdoc-max-keyref-before-warn 10 | 269 | (defcustom checkdoc-max-keyref-before-warn 10 |
| 262 | "*The number of \\ [command-to-keystroke] tokens allowed in a doc string. | 270 | "The number of \\ [command-to-keystroke] tokens allowed in a doc string. |
| 263 | Any more than this and a warning is generated suggesting that the construct | 271 | Any more than this and a warning is generated suggesting that the construct |
| 264 | \\ {keymap} be used instead." | 272 | \\ {keymap} be used instead." |
| 265 | :group 'checkdoc | 273 | :group 'checkdoc |
| 266 | :type 'integer) | 274 | :type 'integer) |
| 267 | 275 | ||
| 268 | (defcustom checkdoc-arguments-in-order-flag t | 276 | (defcustom checkdoc-arguments-in-order-flag t |
| 269 | "*Non-nil means warn if arguments appear out of order. | 277 | "Non-nil means warn if arguments appear out of order. |
| 270 | Setting this to nil will mean only checking that all the arguments | 278 | Setting this to nil will mean only checking that all the arguments |
| 271 | appear in the proper form in the documentation, not that they are in | 279 | appear in the proper form in the documentation, not that they are in |
| 272 | the same order as they appear in the argument list. No mention is | 280 | the same order as they appear in the argument list. No mention is |
| @@ -298,7 +306,7 @@ problem discovered. This is useful for adding additional checks.") | |||
| 298 | A search leaves the cursor in front of the parameter list.") | 306 | A search leaves the cursor in front of the parameter list.") |
| 299 | 307 | ||
| 300 | (defcustom checkdoc-verb-check-experimental-flag t | 308 | (defcustom checkdoc-verb-check-experimental-flag t |
| 301 | "*Non-nil means to attempt to check the voice of the doc string. | 309 | "Non-nil means to attempt to check the voice of the doc string. |
| 302 | This check keys off some words which are commonly misused. See the | 310 | This check keys off some words which are commonly misused. See the |
| 303 | variable `checkdoc-common-verbs-wrong-voice' if you wish to add your own." | 311 | variable `checkdoc-common-verbs-wrong-voice' if you wish to add your own." |
| 304 | :group 'checkdoc | 312 | :group 'checkdoc |
| @@ -2633,12 +2641,6 @@ function called to create the messages." | |||
| 2633 | (setq checkdoc-pending-errors nil) | 2641 | (setq checkdoc-pending-errors nil) |
| 2634 | nil))) | 2642 | nil))) |
| 2635 | 2643 | ||
| 2636 | (defgroup checkdoc nil | ||
| 2637 | "Support for doc string checking in Emacs Lisp." | ||
| 2638 | :prefix "checkdoc" | ||
| 2639 | :group 'lisp | ||
| 2640 | :version "20.3") | ||
| 2641 | |||
| 2642 | (custom-add-option 'emacs-lisp-mode-hook | 2644 | (custom-add-option 'emacs-lisp-mode-hook |
| 2643 | (lambda () (checkdoc-minor-mode 1))) | 2645 | (lambda () (checkdoc-minor-mode 1))) |
| 2644 | 2646 | ||
| @@ -2650,5 +2652,5 @@ function called to create the messages." | |||
| 2650 | 2652 | ||
| 2651 | (provide 'checkdoc) | 2653 | (provide 'checkdoc) |
| 2652 | 2654 | ||
| 2653 | ;;; arch-tag: c49a7ec8-3bb7-46f2-bfbc-d5f26e033b26 | 2655 | ;; arch-tag: c49a7ec8-3bb7-46f2-bfbc-d5f26e033b26 |
| 2654 | ;;; checkdoc.el ends here | 2656 | ;;; checkdoc.el ends here |
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/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index a98dd60fc21..82eac50c874 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el | |||
| @@ -60,14 +60,22 @@ fire repeatedly that many seconds apart." | |||
| 60 | 60 | ||
| 61 | (defun timer-set-idle-time (timer secs &optional repeat) | 61 | (defun timer-set-idle-time (timer secs &optional repeat) |
| 62 | "Set the trigger idle time of TIMER to SECS. | 62 | "Set the trigger idle time of TIMER to SECS. |
| 63 | SECS may be an integer, floating point number, or the internal | ||
| 64 | time format (HIGH LOW USECS) returned by, e.g., `current-idle-time'. | ||
| 63 | If optional third argument REPEAT is non-nil, make the timer | 65 | If optional third argument REPEAT is non-nil, make the timer |
| 64 | fire each time Emacs is idle for that many seconds." | 66 | fire each time Emacs is idle for that many seconds." |
| 65 | (or (timerp timer) | 67 | (or (timerp timer) |
| 66 | (error "Invalid timer")) | 68 | (error "Invalid timer")) |
| 67 | (aset timer 1 0) | 69 | (if (consp secs) |
| 68 | (aset timer 2 0) | 70 | (progn (aset timer 1 (car secs)) |
| 69 | (aset timer 3 0) | 71 | (aset timer 2 (if (consp (cdr secs)) (car (cdr secs)) (cdr secs))) |
| 70 | (timer-inc-time timer secs) | 72 | (aset timer 3 (or (and (consp (cdr secs)) (consp (cdr (cdr secs))) |
| 73 | (nth 2 secs)) | ||
| 74 | 0))) | ||
| 75 | (aset timer 1 0) | ||
| 76 | (aset timer 2 0) | ||
| 77 | (aset timer 3 0) | ||
| 78 | (timer-inc-time timer secs)) | ||
| 71 | (aset timer 4 repeat) | 79 | (aset timer 4 repeat) |
| 72 | timer) | 80 | timer) |
| 73 | 81 | ||
| @@ -104,7 +112,7 @@ of SECS seconds since the epoch. SECS may be a fraction." | |||
| 104 | 112 | ||
| 105 | (defun timer-relative-time (time secs &optional usecs) | 113 | (defun timer-relative-time (time secs &optional usecs) |
| 106 | "Advance TIME by SECS seconds and optionally USECS microseconds. | 114 | "Advance TIME by SECS seconds and optionally USECS microseconds. |
| 107 | SECS may be a fraction." | 115 | SECS may be either an integer or a floating point number." |
| 108 | (let ((high (car time)) | 116 | (let ((high (car time)) |
| 109 | (low (if (consp (cdr time)) (nth 1 time) (cdr time))) | 117 | (low (if (consp (cdr time)) (nth 1 time) (cdr time))) |
| 110 | (micro (if (numberp (car-safe (cdr-safe (cdr time)))) | 118 | (micro (if (numberp (car-safe (cdr-safe (cdr time)))) |
| @@ -412,7 +420,10 @@ This function is for compatibility; see also `run-with-timer'." | |||
| 412 | (defun run-with-idle-timer (secs repeat function &rest args) | 420 | (defun run-with-idle-timer (secs repeat function &rest args) |
| 413 | "Perform an action the next time Emacs is idle for SECS seconds. | 421 | "Perform an action the next time Emacs is idle for SECS seconds. |
| 414 | The action is to call FUNCTION with arguments ARGS. | 422 | The action is to call FUNCTION with arguments ARGS. |
| 415 | SECS may be an integer or a floating point number. | 423 | SECS may be an integer, a floating point number, or the internal |
| 424 | time format (HIGH LOW USECS) returned by, e.g., `current-idle-time'. | ||
| 425 | If Emacs is currently idle, and has been idle for N seconds (N < SECS), | ||
| 426 | then it will call FUNCTION in SECS - N seconds from now. | ||
| 416 | 427 | ||
| 417 | If REPEAT is non-nil, do the action each time Emacs has been idle for | 428 | If REPEAT is non-nil, do the action each time Emacs has been idle for |
| 418 | exactly SECS seconds (that is, only once for each time Emacs becomes idle). | 429 | exactly SECS seconds (that is, only once for each time Emacs becomes idle). |
| @@ -425,7 +436,7 @@ This function returns a timer object which you can use in `cancel-timer'." | |||
| 425 | (let ((timer (timer-create))) | 436 | (let ((timer (timer-create))) |
| 426 | (timer-set-function timer function args) | 437 | (timer-set-function timer function args) |
| 427 | (timer-set-idle-time timer secs repeat) | 438 | (timer-set-idle-time timer secs repeat) |
| 428 | (timer-activate-when-idle timer) | 439 | (timer-activate-when-idle timer t) |
| 429 | timer)) | 440 | timer)) |
| 430 | 441 | ||
| 431 | (defun with-timeout-handler (tag) | 442 | (defun with-timeout-handler (tag) |
diff --git a/lisp/emacs-lisp/tq.el b/lisp/emacs-lisp/tq.el index 2126d7663fc..1e1e143f0f0 100644 --- a/lisp/emacs-lisp/tq.el +++ b/lisp/emacs-lisp/tq.el | |||
| @@ -66,7 +66,7 @@ | |||
| 66 | ;; regexp: regular expression that matches the end of a response from | 66 | ;; regexp: regular expression that matches the end of a response from |
| 67 | ;; the process | 67 | ;; the process |
| 68 | (defun tq-queue-head-regexp (tq) (car (cdr (car (tq-queue tq))))) | 68 | (defun tq-queue-head-regexp (tq) (car (cdr (car (tq-queue tq))))) |
| 69 | ;; closure: additional data to pass to function | 69 | ;; closure: additional data to pass to the function |
| 70 | (defun tq-queue-head-closure (tq) (car (cdr (cdr (car (tq-queue tq)))))) | 70 | (defun tq-queue-head-closure (tq) (car (cdr (cdr (car (tq-queue tq)))))) |
| 71 | ;; fn: function to call upon receiving a complete response from the | 71 | ;; fn: function to call upon receiving a complete response from the |
| 72 | ;; process | 72 | ;; process |
| @@ -119,7 +119,7 @@ If DELAY-QUESTION is non-nil, delay sending this question until | |||
| 119 | the process has finished replying to any previous questions. | 119 | the process has finished replying to any previous questions. |
| 120 | This produces more reliable results with some processes." | 120 | This produces more reliable results with some processes." |
| 121 | (let ((sendp (or (not delay-question) | 121 | (let ((sendp (or (not delay-question) |
| 122 | (not (tq-queue-head-question tq))))) | 122 | (not (tq-queue tq))))) |
| 123 | (tq-queue-add tq (unless sendp question) regexp closure fn) | 123 | (tq-queue-add tq (unless sendp question) regexp closure fn) |
| 124 | (when sendp | 124 | (when sendp |
| 125 | (process-send-string (tq-process tq) question)))) | 125 | (process-send-string (tq-process tq) question)))) |
| @@ -131,35 +131,39 @@ This produces more reliable results with some processes." | |||
| 131 | 131 | ||
| 132 | (defun tq-filter (tq string) | 132 | (defun tq-filter (tq string) |
| 133 | "Append STRING to the TQ's buffer; then process the new data." | 133 | "Append STRING to the TQ's buffer; then process the new data." |
| 134 | (with-current-buffer (tq-buffer tq) | 134 | (let ((buffer (tq-buffer tq))) |
| 135 | (goto-char (point-max)) | 135 | (when (buffer-live-p buffer) |
| 136 | (insert string) | 136 | (with-current-buffer buffer |
| 137 | (tq-process-buffer tq))) | 137 | (goto-char (point-max)) |
| 138 | (insert string) | ||
| 139 | (tq-process-buffer tq))))) | ||
| 138 | 140 | ||
| 139 | (defun tq-process-buffer (tq) | 141 | (defun tq-process-buffer (tq) |
| 140 | "Check TQ's buffer for the regexp at the head of the queue." | 142 | "Check TQ's buffer for the regexp at the head of the queue." |
| 141 | (set-buffer (tq-buffer tq)) | 143 | (let ((buffer (tq-buffer tq))) |
| 142 | (if (= 0 (buffer-size)) () | 144 | (when (buffer-live-p buffer) |
| 143 | (if (tq-queue-empty tq) | 145 | (set-buffer buffer) |
| 144 | (let ((buf (generate-new-buffer "*spurious*"))) | 146 | (if (= 0 (buffer-size)) () |
| 145 | (copy-to-buffer buf (point-min) (point-max)) | 147 | (if (tq-queue-empty tq) |
| 146 | (delete-region (point-min) (point)) | 148 | (let ((buf (generate-new-buffer "*spurious*"))) |
| 147 | (pop-to-buffer buf nil) | 149 | (copy-to-buffer buf (point-min) (point-max)) |
| 148 | (error "Spurious communication from process %s, see buffer %s" | 150 | (delete-region (point-min) (point)) |
| 149 | (process-name (tq-process tq)) | 151 | (pop-to-buffer buf nil) |
| 150 | (buffer-name buf))) | 152 | (error "Spurious communication from process %s, see buffer %s" |
| 151 | (goto-char (point-min)) | 153 | (process-name (tq-process tq)) |
| 152 | (if (re-search-forward (tq-queue-head-regexp tq) nil t) | 154 | (buffer-name buf))) |
| 153 | (let ((answer (buffer-substring (point-min) (point)))) | 155 | (goto-char (point-min)) |
| 154 | (delete-region (point-min) (point)) | 156 | (if (re-search-forward (tq-queue-head-regexp tq) nil t) |
| 155 | (unwind-protect | 157 | (let ((answer (buffer-substring (point-min) (point)))) |
| 156 | (condition-case nil | 158 | (delete-region (point-min) (point)) |
| 157 | (funcall (tq-queue-head-fn tq) | 159 | (unwind-protect |
| 158 | (tq-queue-head-closure tq) | 160 | (condition-case nil |
| 159 | answer) | 161 | (funcall (tq-queue-head-fn tq) |
| 160 | (error nil)) | 162 | (tq-queue-head-closure tq) |
| 161 | (tq-queue-pop tq)) | 163 | answer) |
| 162 | (tq-process-buffer tq)))))) | 164 | (error nil)) |
| 165 | (tq-queue-pop tq)) | ||
| 166 | (tq-process-buffer tq)))))))) | ||
| 163 | 167 | ||
| 164 | (provide 'tq) | 168 | (provide 'tq) |
| 165 | 169 | ||
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 0dce3b94ff0..af757a2a55c 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el | |||
| @@ -46,6 +46,8 @@ | |||
| 46 | (defvar mark-even-if-inactive) | 46 | (defvar mark-even-if-inactive) |
| 47 | (defvar init-message) | 47 | (defvar init-message) |
| 48 | (defvar initial) | 48 | (defvar initial) |
| 49 | (defvar undo-beg-posn) | ||
| 50 | (defvar undo-end-posn) | ||
| 49 | 51 | ||
| 50 | ;; loading happens only in non-interactive compilation | 52 | ;; loading happens only in non-interactive compilation |
| 51 | ;; in order to spare non-viperized emacs from being viperized | 53 | ;; in order to spare non-viperized emacs from being viperized |
| @@ -196,7 +198,7 @@ | |||
| 196 | (viper-save-cursor-color 'before-insert-mode)) | 198 | (viper-save-cursor-color 'before-insert-mode)) |
| 197 | ;; set insert mode cursor color | 199 | ;; set insert mode cursor color |
| 198 | (viper-change-cursor-color viper-insert-state-cursor-color))) | 200 | (viper-change-cursor-color viper-insert-state-cursor-color))) |
| 199 | (if (eq viper-current-state 'emacs-state) | 201 | (if (and viper-emacs-state-cursor-color (eq viper-current-state 'emacs-state)) |
| 200 | (let ((has-saved-cursor-color-in-emacs-mode | 202 | (let ((has-saved-cursor-color-in-emacs-mode |
| 201 | (stringp (viper-get-saved-cursor-color-in-emacs-mode)))) | 203 | (stringp (viper-get-saved-cursor-color-in-emacs-mode)))) |
| 202 | (or has-saved-cursor-color-in-emacs-mode | 204 | (or has-saved-cursor-color-in-emacs-mode |
| @@ -722,12 +724,13 @@ | |||
| 722 | (viper-set-replace-overlay (point-min) (point-min))) | 724 | (viper-set-replace-overlay (point-min) (point-min))) |
| 723 | (viper-hide-replace-overlay) | 725 | (viper-hide-replace-overlay) |
| 724 | 726 | ||
| 725 | (let ((has-saved-cursor-color-in-emacs-mode | 727 | (if viper-emacs-state-cursor-color |
| 726 | (stringp (viper-get-saved-cursor-color-in-emacs-mode)))) | 728 | (let ((has-saved-cursor-color-in-emacs-mode |
| 727 | (or has-saved-cursor-color-in-emacs-mode | 729 | (stringp (viper-get-saved-cursor-color-in-emacs-mode)))) |
| 728 | (string= (viper-get-cursor-color) viper-emacs-state-cursor-color) | 730 | (or has-saved-cursor-color-in-emacs-mode |
| 729 | (viper-save-cursor-color 'before-emacs-mode)) | 731 | (string= (viper-get-cursor-color) viper-emacs-state-cursor-color) |
| 730 | (viper-change-cursor-color viper-emacs-state-cursor-color)) | 732 | (viper-save-cursor-color 'before-emacs-mode)) |
| 733 | (viper-change-cursor-color viper-emacs-state-cursor-color))) | ||
| 731 | 734 | ||
| 732 | (viper-change-state 'emacs-state) | 735 | (viper-change-state 'emacs-state) |
| 733 | 736 | ||
| @@ -1030,10 +1033,13 @@ as a Meta key and any number of multiple escapes is allowed." | |||
| 1030 | (inhibit-quit t)) | 1033 | (inhibit-quit t)) |
| 1031 | (if (viper-ESC-event-p event) | 1034 | (if (viper-ESC-event-p event) |
| 1032 | (progn | 1035 | (progn |
| 1033 | ;; Emacs 22.50.8 introduced a bug, which makes even a single ESC into | 1036 | ;; Some versions of Emacs (eg., 22.50.8 have a bug, which makes even |
| 1034 | ;; a fast keyseq. To guard against this, we added a check if there | 1037 | ;; a single ESC into ;; a fast keyseq. To guard against this, we |
| 1035 | ;; are other events as well | 1038 | ;; added a check if there are other events as well. Keep the next |
| 1036 | (if (and (viper-fast-keysequence-p) unread-command-events) | 1039 | ;; line for the next time the bug reappears, so that will remember to |
| 1040 | ;; report it. | ||
| 1041 | ;;(if (and (viper-fast-keysequence-p) unread-command-events) | ||
| 1042 | (if (viper-fast-keysequence-p) ;; for Emacsen without the above bug | ||
| 1037 | (progn | 1043 | (progn |
| 1038 | (let (minor-mode-map-alist emulation-mode-map-alists) | 1044 | (let (minor-mode-map-alist emulation-mode-map-alists) |
| 1039 | (viper-set-unread-command-events event) | 1045 | (viper-set-unread-command-events event) |
| @@ -1744,12 +1750,14 @@ invokes the command before that, etc." | |||
| 1744 | 1750 | ||
| 1745 | ;; Hook used in viper-undo | 1751 | ;; Hook used in viper-undo |
| 1746 | (defun viper-after-change-undo-hook (beg end len) | 1752 | (defun viper-after-change-undo-hook (beg end len) |
| 1747 | (setq undo-beg-posn beg | 1753 | (if undo-in-progress |
| 1748 | undo-end-posn (or end beg)) | 1754 | (setq undo-beg-posn beg |
| 1749 | ;; some other hooks may be changing various text properties in | 1755 | undo-end-posn (or end beg)) |
| 1750 | ;; the buffer in response to 'undo'; so remove this hook to avoid | 1756 | ;; some other hooks may be changing various text properties in |
| 1751 | ;; its repeated invocation | 1757 | ;; the buffer in response to 'undo'; so remove this hook to avoid |
| 1752 | (remove-hook 'viper-undo-functions 'viper-after-change-undo-hook 'local)) | 1758 | ;; its repeated invocation |
| 1759 | (remove-hook 'viper-undo-functions 'viper-after-change-undo-hook 'local) | ||
| 1760 | )) | ||
| 1753 | 1761 | ||
| 1754 | (defun viper-undo () | 1762 | (defun viper-undo () |
| 1755 | "Undo previous change." | 1763 | "Undo previous change." |
| @@ -1764,25 +1772,29 @@ invokes the command before that, etc." | |||
| 1764 | 1772 | ||
| 1765 | (undo-start) | 1773 | (undo-start) |
| 1766 | (undo-more 2) | 1774 | (undo-more 2) |
| 1767 | (setq undo-beg-posn (or undo-beg-posn before-undo-pt) | 1775 | ;;(setq undo-beg-posn (or undo-beg-posn (point)) |
| 1768 | undo-end-posn (or undo-end-posn undo-beg-posn)) | 1776 | ;; undo-end-posn (or undo-end-posn (point))) |
| 1777 | ;;(setq undo-beg-posn (or undo-beg-posn before-undo-pt) | ||
| 1778 | ;; undo-end-posn (or undo-end-posn undo-beg-posn)) | ||
| 1769 | 1779 | ||
| 1770 | (goto-char undo-beg-posn) | 1780 | (if (and undo-beg-posn undo-end-posn) |
| 1771 | (sit-for 0) | ||
| 1772 | (if (and viper-keep-point-on-undo | ||
| 1773 | (pos-visible-in-window-p before-undo-pt)) | ||
| 1774 | (progn | 1781 | (progn |
| 1775 | (push-mark (point-marker) t) | 1782 | (goto-char undo-beg-posn) |
| 1776 | (viper-sit-for-short 300) | 1783 | (sit-for 0) |
| 1777 | (goto-char undo-end-posn) | 1784 | (if (and viper-keep-point-on-undo |
| 1778 | (viper-sit-for-short 300) | 1785 | (pos-visible-in-window-p before-undo-pt)) |
| 1779 | (if (and (> (viper-chars-in-region undo-beg-posn before-undo-pt) 1) | 1786 | (progn |
| 1780 | (> (viper-chars-in-region undo-end-posn before-undo-pt) 1)) | 1787 | (push-mark (point-marker) t) |
| 1781 | (goto-char before-undo-pt) | 1788 | (viper-sit-for-short 300) |
| 1782 | (goto-char undo-beg-posn))) | 1789 | (goto-char undo-end-posn) |
| 1783 | (push-mark before-undo-pt t)) | 1790 | (viper-sit-for-short 300) |
| 1791 | (if (pos-visible-in-window-p undo-beg-posn) | ||
| 1792 | (goto-char before-undo-pt) | ||
| 1793 | (goto-char undo-beg-posn))) | ||
| 1794 | (push-mark before-undo-pt t)) | ||
| 1795 | )) | ||
| 1796 | |||
| 1784 | (if (and (eolp) (not (bolp))) (backward-char 1)) | 1797 | (if (and (eolp) (not (bolp))) (backward-char 1)) |
| 1785 | ;;(if (not modified) (set-buffer-modified-p t)) | ||
| 1786 | ) | 1798 | ) |
| 1787 | (setq this-command 'viper-undo)) | 1799 | (setq this-command 'viper-undo)) |
| 1788 | 1800 | ||
| @@ -3952,7 +3964,8 @@ Null string will repeat previous search." | |||
| 3952 | (let ((val (viper-p-val arg)) | 3964 | (let ((val (viper-p-val arg)) |
| 3953 | (com (viper-getcom arg)) | 3965 | (com (viper-getcom arg)) |
| 3954 | debug-on-error) | 3966 | debug-on-error) |
| 3955 | (if (null viper-s-string) (error viper-NoPrevSearch)) | 3967 | (if (or (null viper-s-string) (string= viper-s-string "")) |
| 3968 | (error viper-NoPrevSearch)) | ||
| 3956 | (viper-search viper-s-string viper-s-forward arg) | 3969 | (viper-search viper-s-string viper-s-forward arg) |
| 3957 | (if com | 3970 | (if com |
| 3958 | (progn | 3971 | (progn |
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index e2824246fad..f9f08034582 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el | |||
| @@ -208,12 +208,12 @@ | |||
| 208 | 208 | ||
| 209 | ;; If this is a one-letter magic command, splice in args. | 209 | ;; If this is a one-letter magic command, splice in args. |
| 210 | (defun ex-splice-args-in-1-letr-cmd (key list) | 210 | (defun ex-splice-args-in-1-letr-cmd (key list) |
| 211 | (let ((onelet (ex-cmd-is-one-letter (assoc (substring key 0 1) list)))) | 211 | (let ((oneletter (ex-cmd-is-one-letter (assoc (substring key 0 1) list)))) |
| 212 | (if onelet | 212 | (if oneletter |
| 213 | (list key | 213 | (list key |
| 214 | (append (cadr onelet) | 214 | (append (cadr oneletter) |
| 215 | (if (< 1 (length key)) (list (substring key 1)))) | 215 | (if (< 1 (length key)) (list (substring key 1)))) |
| 216 | (caddr onelet))) | 216 | (car (cdr (cdr oneletter))) )) |
| 217 | )) | 217 | )) |
| 218 | 218 | ||
| 219 | 219 | ||
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index 80938b0282a..465f6e5cfb8 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el | |||
| @@ -434,7 +434,10 @@ delete the text being replaced, as in standard Vi." | |||
| 434 | (if (fboundp 'make-variable-frame-local) | 434 | (if (fboundp 'make-variable-frame-local) |
| 435 | (make-variable-frame-local 'viper-insert-state-cursor-color)) | 435 | (make-variable-frame-local 'viper-insert-state-cursor-color)) |
| 436 | 436 | ||
| 437 | (defcustom viper-emacs-state-cursor-color "Magenta" | 437 | ;; viper-emacs-state-cursor-color doesn't work well. Causes cursor colors to be |
| 438 | ;; confused in some cases. So, this var is nulled for now. | ||
| 439 | ;; (defcustom viper-emacs-state-cursor-color "Magenta" | ||
| 440 | (defcustom viper-emacs-state-cursor-color nil | ||
| 438 | "Cursor color when Viper is in emacs state." | 441 | "Cursor color when Viper is in emacs state." |
| 439 | :type 'string | 442 | :type 'string |
| 440 | :group 'viper) | 443 | :group 'viper) |
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index 252088a476d..fe179be9cd1 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el | |||
| @@ -137,10 +137,10 @@ | |||
| 137 | (x-display-color-p) ; emacs | 137 | (x-display-color-p) ; emacs |
| 138 | )) | 138 | )) |
| 139 | 139 | ||
| 140 | (defsubst viper-get-cursor-color () | 140 | (defun viper-get-cursor-color (&optional frame) |
| 141 | (viper-cond-compile-for-xemacs-or-emacs | 141 | (viper-cond-compile-for-xemacs-or-emacs |
| 142 | (color-instance-name | 142 | (color-instance-name |
| 143 | (frame-property (selected-frame) 'cursor-color)) ; xemacs | 143 | (frame-property (or frame (selected-frame)) 'cursor-color)) ; xemacs |
| 144 | (cdr (assoc 'cursor-color (frame-parameters))) ; emacs | 144 | (cdr (assoc 'cursor-color (frame-parameters))) ; emacs |
| 145 | )) | 145 | )) |
| 146 | 146 | ||
| @@ -152,18 +152,31 @@ | |||
| 152 | 152 | ||
| 153 | 153 | ||
| 154 | ;; cursor colors | 154 | ;; cursor colors |
| 155 | (defun viper-change-cursor-color (new-color) | 155 | (defun viper-change-cursor-color (new-color &optional frame) |
| 156 | (if (and (viper-window-display-p) (viper-color-display-p) | 156 | (if (and (viper-window-display-p) (viper-color-display-p) |
| 157 | (stringp new-color) (viper-color-defined-p new-color) | 157 | (stringp new-color) (viper-color-defined-p new-color) |
| 158 | (not (string= new-color (viper-get-cursor-color)))) | 158 | (not (string= new-color (viper-get-cursor-color)))) |
| 159 | (viper-cond-compile-for-xemacs-or-emacs | 159 | (viper-cond-compile-for-xemacs-or-emacs |
| 160 | (set-frame-property | 160 | (set-frame-property |
| 161 | (selected-frame) 'cursor-color (make-color-instance new-color)) | 161 | (or frame (selected-frame)) |
| 162 | 'cursor-color (make-color-instance new-color)) | ||
| 162 | (modify-frame-parameters | 163 | (modify-frame-parameters |
| 163 | (selected-frame) (list (cons 'cursor-color new-color))) | 164 | (or frame (selected-frame)) |
| 165 | (list (cons 'cursor-color new-color))) | ||
| 164 | ) | 166 | ) |
| 165 | )) | 167 | )) |
| 166 | 168 | ||
| 169 | (defun viper-set-cursor-color-according-to-state (&optional frame) | ||
| 170 | (cond ((eq viper-current-state 'replace-state) | ||
| 171 | (viper-change-cursor-color viper-replace-state-cursor-color frame)) | ||
| 172 | ((and (eq viper-current-state 'emacs-state) | ||
| 173 | viper-emacs-state-cursor-color) | ||
| 174 | (viper-change-cursor-color viper-emacs-state-cursor-color frame)) | ||
| 175 | ((eq viper-current-state 'insert-state) | ||
| 176 | (viper-change-cursor-color viper-insert-state-cursor-color frame)) | ||
| 177 | (t | ||
| 178 | (viper-change-cursor-color viper-vi-state-cursor-color frame)))) | ||
| 179 | |||
| 167 | ;; By default, saves current frame cursor color in the | 180 | ;; By default, saves current frame cursor color in the |
| 168 | ;; viper-saved-cursor-color-in-replace-mode property of viper-replace-overlay | 181 | ;; viper-saved-cursor-color-in-replace-mode property of viper-replace-overlay |
| 169 | (defun viper-save-cursor-color (before-which-mode) | 182 | (defun viper-save-cursor-color (before-which-mode) |
| @@ -191,7 +204,7 @@ | |||
| 191 | (if viper-emacs-p 'frame-parameter 'frame-property) | 204 | (if viper-emacs-p 'frame-parameter 'frame-property) |
| 192 | (selected-frame) | 205 | (selected-frame) |
| 193 | 'viper-saved-cursor-color-in-replace-mode) | 206 | 'viper-saved-cursor-color-in-replace-mode) |
| 194 | (if (eq viper-current-state 'emacs-mode) | 207 | (if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color) |
| 195 | viper-emacs-state-cursor-color | 208 | viper-emacs-state-cursor-color |
| 196 | viper-vi-state-cursor-color))) | 209 | viper-vi-state-cursor-color))) |
| 197 | 210 | ||
| @@ -201,7 +214,7 @@ | |||
| 201 | (if viper-emacs-p 'frame-parameter 'frame-property) | 214 | (if viper-emacs-p 'frame-parameter 'frame-property) |
| 202 | (selected-frame) | 215 | (selected-frame) |
| 203 | 'viper-saved-cursor-color-in-insert-mode) | 216 | 'viper-saved-cursor-color-in-insert-mode) |
| 204 | (if (eq viper-current-state 'emacs-mode) | 217 | (if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color) |
| 205 | viper-emacs-state-cursor-color | 218 | viper-emacs-state-cursor-color |
| 206 | viper-vi-state-cursor-color))) | 219 | viper-vi-state-cursor-color))) |
| 207 | 220 | ||
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 8f858526da3..0ba7bdd041a 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el | |||
| @@ -534,10 +534,6 @@ If Viper is enabled, turn it off. Otherwise, turn it on." | |||
| 534 | (defun viper-mode () | 534 | (defun viper-mode () |
| 535 | "Turn on Viper emulation of Vi in Emacs. See Info node `(viper)Viper'." | 535 | "Turn on Viper emulation of Vi in Emacs. See Info node `(viper)Viper'." |
| 536 | (interactive) | 536 | (interactive) |
| 537 | (if (null viper-vi-state-cursor-color) | ||
| 538 | (modify-frame-parameters | ||
| 539 | (selected-frame) | ||
| 540 | (list (cons 'viper-vi-state-cursor-color (viper-get-cursor-color))))) | ||
| 541 | (if (not noninteractive) | 537 | (if (not noninteractive) |
| 542 | (progn | 538 | (progn |
| 543 | ;; if the user requested viper-mode explicitly | 539 | ;; if the user requested viper-mode explicitly |
| @@ -618,7 +614,8 @@ This startup message appears whenever you load Viper, unless you type `y' now." | |||
| 618 | 614 | ||
| 619 | (or (memq major-mode viper-emacs-state-mode-list) ; don't switch to Vi | 615 | (or (memq major-mode viper-emacs-state-mode-list) ; don't switch to Vi |
| 620 | (memq major-mode viper-insert-state-mode-list) ; don't switch | 616 | (memq major-mode viper-insert-state-mode-list) ; don't switch |
| 621 | (viper-change-state-to-vi))))) | 617 | (viper-change-state-to-vi)) |
| 618 | ))) | ||
| 622 | 619 | ||
| 623 | 620 | ||
| 624 | ;; Apply a little heuristic to invoke vi state on major-modes | 621 | ;; Apply a little heuristic to invoke vi state on major-modes |
| @@ -862,8 +859,11 @@ It also can't undo some Viper settings." | |||
| 862 | ;; info about the display and windows until emacs initialization is complete | 859 | ;; info about the display and windows until emacs initialization is complete |
| 863 | ;; So do it via the window-setup-hook | 860 | ;; So do it via the window-setup-hook |
| 864 | (add-hook 'window-setup-hook | 861 | (add-hook 'window-setup-hook |
| 865 | '(lambda () | 862 | '(lambda () |
| 866 | (setq viper-vi-state-cursor-color (viper-get-cursor-color)))) | 863 | (modify-frame-parameters |
| 864 | (selected-frame) | ||
| 865 | (list (cons 'viper-vi-state-cursor-color | ||
| 866 | (viper-get-cursor-color)))))) | ||
| 867 | 867 | ||
| 868 | ;; Tell vc-diff to put *vc* in Vi mode | 868 | ;; Tell vc-diff to put *vc* in Vi mode |
| 869 | (if (featurep 'vc) | 869 | (if (featurep 'vc) |
| @@ -903,7 +903,6 @@ It also can't undo some Viper settings." | |||
| 903 | 903 | ||
| 904 | (defadvice set-cursor-color (after viper-set-cursor-color-ad activate) | 904 | (defadvice set-cursor-color (after viper-set-cursor-color-ad activate) |
| 905 | "Change cursor color in VI state." | 905 | "Change cursor color in VI state." |
| 906 | ;;(setq viper-vi-state-cursor-color (ad-get-arg 0)) | ||
| 907 | (modify-frame-parameters | 906 | (modify-frame-parameters |
| 908 | (selected-frame) | 907 | (selected-frame) |
| 909 | (list (cons 'viper-vi-state-cursor-color (ad-get-arg 0)))) | 908 | (list (cons 'viper-vi-state-cursor-color (ad-get-arg 0)))) |
| @@ -1008,8 +1007,8 @@ It also can't undo some Viper settings." | |||
| 1008 | ;; these are primarily advices and Vi-ish variable settings | 1007 | ;; these are primarily advices and Vi-ish variable settings |
| 1009 | (defun viper-non-hook-settings () | 1008 | (defun viper-non-hook-settings () |
| 1010 | 1009 | ||
| 1011 | ;; Viper changes the default mode-line-buffer-identification | 1010 | ;;;; Viper changes the default mode-line-buffer-identification |
| 1012 | (setq-default mode-line-buffer-identification '(" %b")) | 1011 | ;;(setq-default mode-line-buffer-identification '(" %b")) |
| 1013 | 1012 | ||
| 1014 | ;; setup emacs-supported vi-style feel | 1013 | ;; setup emacs-supported vi-style feel |
| 1015 | (setq next-line-add-newlines nil | 1014 | (setq next-line-add-newlines nil |
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 216d14d0aa6..72754aa1cd3 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog | |||
| @@ -1,3 +1,78 @@ | |||
| 1 | 2006-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 | |||
| 6 | 2006-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 | |||
| 21 | 2006-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 | |||
| 27 | 2006-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 | |||
| 39 | 2006-08-02 Michael Olson <mwolson@gnu.org> | ||
| 40 | |||
| 41 | * erc.el (erc-version-string): Release ERC 5.1.4. | ||
| 42 | |||
| 43 | * Makefile, NEWS, erc.texi: Update for the 5.1.4 release. | ||
| 44 | |||
| 45 | * erc.el (erc-active-buffer): Fix bug that caused messages to go | ||
| 46 | to the wrong buffer. Thanks to offby1 for the report. | ||
| 47 | |||
| 48 | * erc-backend.el (erc-coding-system-for-target): Handle case where | ||
| 49 | target is nil. Thanks to Kai Fan for the patch. | ||
| 50 | |||
| 51 | 2006-07-29 Michael Olson <mwolson@gnu.org> | ||
| 52 | |||
| 53 | * erc-log.el (erc-log-setup-logging): Don't offer to save the | ||
| 54 | buffer. It will be saved automatically killed. Thanks to Johan | ||
| 55 | Bockgård and Tassilo Horn for pointing this out. | ||
| 56 | |||
| 57 | 2006-07-27 Johan Bockgård <bojohan@users.sourceforge.net> | ||
| 58 | |||
| 59 | * erc.el (define-erc-module): Make find-function and find-variable | ||
| 60 | find the names constructed by `define-erc-module' in Emacs 22. | ||
| 61 | |||
| 62 | 2006-07-14 Michael Olson <mwolson@gnu.org> | ||
| 63 | |||
| 64 | * erc-log.el (log): Make sure that we enable logging on | ||
| 65 | already-opened buffers as well, in case the user toggles this | ||
| 66 | module after loading ERC. Also be sure to remove logging ability | ||
| 67 | from all ERC buffers when the module is disabled. | ||
| 68 | (erc-log-setup-logging): Set buffer-file-name to nil rather than | ||
| 69 | the empty string. This should fix some errors that occur when | ||
| 70 | quitting Emacs without first killing all ERC buffers. | ||
| 71 | (erc-log-disable-logging): New function that removes the logging | ||
| 72 | ability from the current buffer. | ||
| 73 | |||
| 74 | * erc-spelling.el (spelling): Use dolist and buffer-live-p. | ||
| 75 | |||
| 1 | 2006-07-12 Michael Olson <mwolson@gnu.org> | 76 | 2006-07-12 Michael Olson <mwolson@gnu.org> |
| 2 | 77 | ||
| 3 | * erc-match.el (erc-log-matches): Bind inhibit-read-only rather | 78 | * erc-match.el (erc-log-matches): Bind inhibit-read-only rather |
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 7dce9e4bf01..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)) |
| @@ -563,11 +556,12 @@ action." | |||
| 563 | "Return the coding system or cons cell appropriate for TARGET. | 556 | "Return the coding system or cons cell appropriate for TARGET. |
| 564 | This is determined via `erc-encoding-coding-alist' or | 557 | This is determined via `erc-encoding-coding-alist' or |
| 565 | `erc-server-coding-system'." | 558 | `erc-server-coding-system'." |
| 566 | (or (let ((case-fold-search t)) | 559 | (or (when target |
| 567 | (catch 'match | 560 | (let ((case-fold-search t)) |
| 568 | (dolist (pat erc-encoding-coding-alist) | 561 | (catch 'match |
| 569 | (when (string-match (car pat) target) | 562 | (dolist (pat erc-encoding-coding-alist) |
| 570 | (throw 'match (cdr pat)))))) | 563 | (when (string-match (car pat) target) |
| 564 | (throw 'match (cdr pat))))))) | ||
| 571 | (and (functionp erc-server-coding-system) | 565 | (and (functionp erc-server-coding-system) |
| 572 | (funcall erc-server-coding-system)) | 566 | (funcall erc-server-coding-system)) |
| 573 | erc-server-coding-system)) | 567 | erc-server-coding-system)) |
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index b316a8588bd..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 |
| @@ -218,7 +216,10 @@ also be a predicate function. To only log when you are not set away, use: | |||
| 218 | (add-hook 'erc-quit-hook 'erc-conditional-save-queries) | 216 | (add-hook 'erc-quit-hook 'erc-conditional-save-queries) |
| 219 | (add-hook 'erc-part-hook 'erc-conditional-save-buffer) | 217 | (add-hook 'erc-part-hook 'erc-conditional-save-buffer) |
| 220 | ;; append, so that 'erc-initialize-log-marker runs first | 218 | ;; append, so that 'erc-initialize-log-marker runs first |
| 221 | (add-hook 'erc-connect-pre-hook 'erc-log-setup-logging 'append)) | 219 | (add-hook 'erc-connect-pre-hook 'erc-log-setup-logging 'append) |
| 220 | (dolist (buffer (erc-buffer-list)) | ||
| 221 | (when (buffer-live-p buffer) | ||
| 222 | (with-current-buffer buffer (erc-log-setup-logging))))) | ||
| 222 | ;; disable | 223 | ;; disable |
| 223 | ((remove-hook 'erc-insert-post-hook 'erc-save-buffer-in-logs) | 224 | ((remove-hook 'erc-insert-post-hook 'erc-save-buffer-in-logs) |
| 224 | (remove-hook 'erc-send-post-hook 'erc-save-buffer-in-logs) | 225 | (remove-hook 'erc-send-post-hook 'erc-save-buffer-in-logs) |
| @@ -226,7 +227,10 @@ also be a predicate function. To only log when you are not set away, use: | |||
| 226 | (remove-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs) | 227 | (remove-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs) |
| 227 | (remove-hook 'erc-quit-hook 'erc-conditional-save-queries) | 228 | (remove-hook 'erc-quit-hook 'erc-conditional-save-queries) |
| 228 | (remove-hook 'erc-part-hook 'erc-conditional-save-buffer) | 229 | (remove-hook 'erc-part-hook 'erc-conditional-save-buffer) |
| 229 | (remove-hook 'erc-connect-pre-hook 'erc-log-setup-logging))) | 230 | (remove-hook 'erc-connect-pre-hook 'erc-log-setup-logging) |
| 231 | (dolist (buffer (erc-buffer-list)) | ||
| 232 | (when (buffer-live-p buffer) | ||
| 233 | (with-current-buffer buffer (erc-log-disable-logging)))))) | ||
| 230 | 234 | ||
| 231 | (define-key erc-mode-map "\C-c\C-l" 'erc-save-buffer-in-logs) | 235 | (define-key erc-mode-map "\C-c\C-l" 'erc-save-buffer-in-logs) |
| 232 | 236 | ||
| @@ -236,8 +240,7 @@ also be a predicate function. To only log when you are not set away, use: | |||
| 236 | This function is destined to be run from `erc-connect-pre-hook'." | 240 | This function is destined to be run from `erc-connect-pre-hook'." |
| 237 | (when (erc-logging-enabled) | 241 | (when (erc-logging-enabled) |
| 238 | (auto-save-mode -1) | 242 | (auto-save-mode -1) |
| 239 | (setq buffer-offer-save t | 243 | (setq buffer-file-name nil) |
| 240 | buffer-file-name "") | ||
| 241 | (set (make-local-variable 'write-file-functions) | 244 | (set (make-local-variable 'write-file-functions) |
| 242 | '(erc-save-buffer-in-logs)) | 245 | '(erc-save-buffer-in-logs)) |
| 243 | (when erc-log-insert-log-on-open | 246 | (when erc-log-insert-log-on-open |
| @@ -245,6 +248,12 @@ This function is destined to be run from `erc-connect-pre-hook'." | |||
| 245 | (move-marker erc-last-saved-position | 248 | (move-marker erc-last-saved-position |
| 246 | (1- (point-max))))))) | 249 | (1- (point-max))))))) |
| 247 | 250 | ||
| 251 | (defun erc-log-disable-logging () | ||
| 252 | "Disable logging in the current buffer." | ||
| 253 | (when (erc-logging-enabled) | ||
| 254 | (setq buffer-offer-save nil | ||
| 255 | erc-enable-logging nil))) | ||
| 256 | |||
| 248 | (defun erc-log-all-but-server-buffers (buffer) | 257 | (defun erc-log-all-but-server-buffers (buffer) |
| 249 | "Returns t if logging should be enabled in BUFFER. | 258 | "Returns t if logging should be enabled in BUFFER. |
| 250 | Returns nil iff `erc-server-buffer-p' returns t." | 259 | Returns nil iff `erc-server-buffer-p' returns t." |
| @@ -282,17 +291,27 @@ is writeable (it will be created as necessary) and | |||
| 282 | (funcall erc-enable-logging (or buffer (current-buffer))) | 291 | (funcall erc-enable-logging (or buffer (current-buffer))) |
| 283 | erc-enable-logging))) | 292 | erc-enable-logging))) |
| 284 | 293 | ||
| 294 | (defun erc-log-standardize-name (filename) | ||
| 295 | "Make FILENAME safe to use as the name of an ERC log. | ||
| 296 | This will not work with full paths, only names. | ||
| 297 | |||
| 298 | Any unsafe characters in the name are replaced with \"!\". The | ||
| 299 | filename is downcased." | ||
| 300 | (downcase (erc-replace-regexp-in-string | ||
| 301 | "[/\\]" "!" (convert-standard-filename filename)))) | ||
| 302 | |||
| 285 | (defun erc-current-logfile (&optional buffer) | 303 | (defun erc-current-logfile (&optional buffer) |
| 286 | "Return the logfile to use for BUFFER. | 304 | "Return the logfile to use for BUFFER. |
| 287 | If BUFFER is nil, the value of `current-buffer' is used. | 305 | If BUFFER is nil, the value of `current-buffer' is used. |
| 288 | This is determined by `erc-generate-log-file-name-function'. | 306 | This is determined by `erc-generate-log-file-name-function'. |
| 289 | The result is converted to lowercase, as IRC is case-insensitive" | 307 | The result is converted to lowercase, as IRC is case-insensitive" |
| 290 | (expand-file-name | 308 | (expand-file-name |
| 291 | (downcase (funcall erc-generate-log-file-name-function | 309 | (erc-log-standardize-name |
| 292 | (or buffer (current-buffer)) | 310 | (funcall erc-generate-log-file-name-function |
| 293 | (or (erc-default-target) (buffer-name buffer)) | 311 | (or buffer (current-buffer)) |
| 294 | (erc-current-nick) | 312 | (or (erc-default-target) (buffer-name buffer)) |
| 295 | erc-session-server erc-session-port)) | 313 | (erc-current-nick) |
| 314 | erc-session-server erc-session-port)) | ||
| 296 | erc-log-channels-directory)) | 315 | erc-log-channels-directory)) |
| 297 | 316 | ||
| 298 | (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-spelling.el b/lisp/erc/erc-spelling.el index 3cbc786274d..7ed0f510539 100644 --- a/lisp/erc/erc-spelling.el +++ b/lisp/erc/erc-spelling.el | |||
| @@ -40,15 +40,13 @@ | |||
| 40 | ;; Use erc-connect-pre-hook instead of erc-mode-hook as pre-hook is | 40 | ;; Use erc-connect-pre-hook instead of erc-mode-hook as pre-hook is |
| 41 | ;; called AFTER the server buffer is initialized. | 41 | ;; called AFTER the server buffer is initialized. |
| 42 | ((add-hook 'erc-connect-pre-hook 'erc-spelling-init) | 42 | ((add-hook 'erc-connect-pre-hook 'erc-spelling-init) |
| 43 | (mapc (lambda (buffer) | 43 | (dolist (buffer (erc-buffer-list)) |
| 44 | (when buffer | 44 | (when (buffer-live-p buffer) |
| 45 | (with-current-buffer buffer (erc-spelling-init)))) | 45 | (with-current-buffer buffer (erc-spelling-init))))) |
| 46 | (erc-buffer-list))) | ||
| 47 | ((remove-hook 'erc-connect-pre-hook 'erc-spelling-init) | 46 | ((remove-hook 'erc-connect-pre-hook 'erc-spelling-init) |
| 48 | (mapc (lambda (buffer) | 47 | (dolist (buffer (erc-buffer-list)) |
| 49 | (when buffer | 48 | (when (buffer-live-p buffer) |
| 50 | (with-current-buffer buffer (flyspell-mode 0)))) | 49 | (with-current-buffer buffer (flyspell-mode 0)))))) |
| 51 | (erc-buffer-list)))) | ||
| 52 | 50 | ||
| 53 | (defcustom erc-spelling-dictionaries nil | 51 | (defcustom erc-spelling-dictionaries nil |
| 54 | "An alist mapping buffer names to dictionaries. | 52 | "An alist mapping buffer names to dictionaries. |
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index fd5a49eae4b..41d59576251 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -67,7 +67,7 @@ | |||
| 67 | 67 | ||
| 68 | ;;; Code: | 68 | ;;; Code: |
| 69 | 69 | ||
| 70 | (defconst erc-version-string "Version 5.1.3" | 70 | (defconst erc-version-string "Version 5.1.4" |
| 71 | "ERC version. This is used by function `erc-version'.") | 71 | "ERC version. This is used by function `erc-version'.") |
| 72 | 72 | ||
| 73 | (eval-when-compile (require 'cl)) | 73 | (eval-when-compile (require 'cl)) |
| @@ -157,8 +157,8 @@ parameters and authentication." | |||
| 157 | This can be either a string or a number." | 157 | This 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. |
| 827 | The first existent and readable one will get executed. | 828 | The first existent and readable one will get executed. |
| 828 | 829 | ||
| @@ -1243,7 +1244,11 @@ With arg, turn ERC %S mode on if and only if arg is positive. | |||
| 1243 | (format "erc-%s-mode" | 1244 | (format "erc-%s-mode" |
| 1244 | (downcase (symbol-name alias))))) | 1245 | (downcase (symbol-name alias))))) |
| 1245 | (quote | 1246 | (quote |
| 1246 | ,mode)))))) | 1247 | ,mode))) |
| 1248 | ;; For find-function and find-variable. | ||
| 1249 | (put ',mode 'definition-name ',name) | ||
| 1250 | (put ',enable 'definition-name ',name) | ||
| 1251 | (put ',disable 'definition-name ',name)))) | ||
| 1247 | 1252 | ||
| 1248 | (put 'define-erc-module 'doc-string-elt 3) | 1253 | (put 'define-erc-module 'doc-string-elt 3) |
| 1249 | 1254 | ||
| @@ -1388,8 +1393,8 @@ server buffer") | |||
| 1388 | Defaults to the server buffer." | 1393 | Defaults to the server buffer." |
| 1389 | (with-current-buffer (erc-server-buffer) | 1394 | (with-current-buffer (erc-server-buffer) |
| 1390 | (if (buffer-live-p erc-active-buffer) | 1395 | (if (buffer-live-p erc-active-buffer) |
| 1391 | erc-active-buffer) | 1396 | erc-active-buffer |
| 1392 | (setq erc-active-buffer (current-buffer)))) | 1397 | (setq erc-active-buffer (current-buffer))))) |
| 1393 | 1398 | ||
| 1394 | (defun erc-set-active-buffer (buffer) | 1399 | (defun erc-set-active-buffer (buffer) |
| 1395 | "Set the value of `erc-active-buffer' to BUFFER." | 1400 | "Set the value of `erc-active-buffer' to BUFFER." |
| @@ -2358,6 +2363,8 @@ See also `erc-format-message' and `erc-display-line'." | |||
| 2358 | msg))) | 2363 | msg))) |
| 2359 | (setq string | 2364 | (setq string |
| 2360 | (cond | 2365 | (cond |
| 2366 | ((null type) | ||
| 2367 | string) | ||
| 2361 | ((listp type) | 2368 | ((listp type) |
| 2362 | (mapc (lambda (type) | 2369 | (mapc (lambda (type) |
| 2363 | (setq string | 2370 | (setq string |
| @@ -2370,7 +2377,7 @@ See also `erc-format-message' and `erc-display-line'." | |||
| 2370 | (if (not (erc-response-p parsed)) | 2377 | (if (not (erc-response-p parsed)) |
| 2371 | (erc-display-line string buffer) | 2378 | (erc-display-line string buffer) |
| 2372 | (unless (member (erc-response.command parsed) erc-hide-list) | 2379 | (unless (member (erc-response.command parsed) erc-hide-list) |
| 2373 | (erc-put-text-property 0 (length string) 'erc-parsed parsed string) | 2380 | (erc-put-text-property 0 (length string) 'erc-parsed parsed string) |
| 2374 | (erc-put-text-property 0 (length string) 'rear-sticky t string) | 2381 | (erc-put-text-property 0 (length string) 'rear-sticky t string) |
| 2375 | (erc-display-line string buffer))))) | 2382 | (erc-display-line string buffer))))) |
| 2376 | 2383 | ||
| @@ -5237,13 +5244,11 @@ If FILE is found, return the path to it." | |||
| 5237 | (defun erc-select-startup-file () | 5244 | (defun erc-select-startup-file () |
| 5238 | "Select an ERC startup file. | 5245 | "Select an ERC startup file. |
| 5239 | See also `erc-startup-file-list'." | 5246 | See also `erc-startup-file-list'." |
| 5240 | (let ((l erc-startup-file-list) | 5247 | (catch 'found |
| 5241 | (f nil)) | 5248 | (dolist (f erc-startup-file-list) |
| 5242 | (while (and (not f) l) | 5249 | (setq f (convert-standard-filename f)) |
| 5243 | (if (file-readable-p (car l)) | 5250 | (when (file-readable-p f) |
| 5244 | (setq f (car l))) | 5251 | (throw 'found f))))) |
| 5245 | (setq l (cdr l))) | ||
| 5246 | f)) | ||
| 5247 | 5252 | ||
| 5248 | (defun erc-find-script-file (file) | 5253 | (defun erc-find-script-file (file) |
| 5249 | "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'." |
| @@ -5890,7 +5895,8 @@ All windows are opened in the current frame." | |||
| 5890 | (setq bufs (cdr bufs)) | 5895 | (setq bufs (cdr bufs)) |
| 5891 | (while bufs | 5896 | (while bufs |
| 5892 | (split-window) | 5897 | (split-window) |
| 5893 | (switch-to-buffer-other-window (car bufs)) | 5898 | (other-window 1) |
| 5899 | (switch-to-buffer (car bufs)) | ||
| 5894 | (setq bufs (cdr bufs)) | 5900 | (setq bufs (cdr bufs)) |
| 5895 | (balance-windows))))) | 5901 | (balance-windows))))) |
| 5896 | 5902 | ||
| @@ -5942,12 +5948,17 @@ All windows are opened in the current frame." | |||
| 5942 | (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") |
| 5943 | (ctcp-too-many . "Too many CTCP queries in single message. Ignoring") | 5949 | (ctcp-too-many . "Too many CTCP queries in single message. Ignoring") |
| 5944 | (flood-ctcp-off . "FLOOD PROTECTION: Automatic CTCP responses turned off.") | 5950 | (flood-ctcp-off . "FLOOD PROTECTION: Automatic CTCP responses turned off.") |
| 5945 | (flood-strict-mode . "FLOOD PROTECTION: Switched to Strict Flood Control mode.") | 5951 | (flood-strict-mode |
| 5946 | (disconnected . "Connection failed! Re-establishing connection...") | 5952 | . "FLOOD PROTECTION: Switched to Strict Flood Control mode.") |
| 5947 | (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") | ||
| 5948 | (login . "Logging in as \'%n\'...") | 5958 | (login . "Logging in as \'%n\'...") |
| 5949 | (nick-in-use . "%n is in use. Choose new nickname: ") | 5959 | (nick-in-use . "%n is in use. Choose new nickname: ") |
| 5950 | (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") | ||
| 5951 | (no-default-channel . "No default channel") | 5962 | (no-default-channel . "No default channel") |
| 5952 | (no-invitation . "You've got no invitation") | 5963 | (no-invitation . "You've got no invitation") |
| 5953 | (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. |
| 137 | Each element should be a symbol, which is the name of a face. | 137 | Each element should be a symbol, the name of a face. |
| 138 | The \"basic \" faces in `facemenu-keybindings' are automatically | 138 | The \"basic \" faces in `facemenu-keybindings' are automatically |
| 139 | added to the Face menu, and are not included in this list. | 139 | added to the Face menu, and need not be in this list. |
| 140 | 140 | ||
| 141 | You can set this list before loading facemenu.el, or add a face to it before | 141 | This value takes effect when you load facemenu.el. If the |
| 142 | creating that face if you want it to be listed. If you change the | 142 | list includes symbols which are not defined as faces, they |
| 143 | variable so as to eliminate faces that have already been added to the menu, | 143 | are ignored; however, subsequently defining or creating |
| 144 | call `facemenu-update' to recalculate the menu contents. | 144 | those faces adds them to the menu then. You can call |
| 145 | 145 | `facemenu-update' to recalculate the menu contents, such as | |
| 146 | If this variable is t, all faces will be added to the menu. This | 146 | if you change the value of this variable, |
| 147 | is useful for setting temporarily if you want to add faces to the | 147 | |
| 148 | menu when they are created." | 148 | If this variable is t, all faces that you apply to text |
| 149 | using the face menu commands (even by name), and all faces | ||
| 150 | that you define or create, are added to the menu. You may | ||
| 151 | find it useful to set this variable to t temporarily while | ||
| 152 | you define some faces, so that they will be added. However, | ||
| 153 | if the value is no longer t and you call `facemenu-update', | ||
| 154 | it 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. |
| 324 | This adds FACE to the top of the face list; any faces lower on the list that | 330 | |
| 325 | will not show through at all will be removed. | 331 | If the region is active (normally true except in Transient |
| 326 | 332 | Mark mode) and nonempty, and there is no prefix argument, | |
| 327 | Interactively, reads the face name with the minibuffer. | 333 | this command applies FACE to the region. Otherwise, it applies FACE |
| 328 | 334 | to the faces to use for the next character | |
| 329 | If the region is active (normally true except in Transient Mark mode) | 335 | inserted. (Moving point or switching buffers before typing |
| 330 | and there is no prefix argument, this command sets the region to the | 336 | a character to insert cancels the specification.) |
| 331 | requested face. | 337 | |
| 332 | 338 | If FACE is `default', to \"apply\" it means clearing | |
| 333 | Otherwise, this command specifies the face for the next character | 339 | the list of faces to be used. For any other value of FACE, |
| 334 | inserted. Moving point or switching buffers before | 340 | to \"apply\" it means putting FACE at the front of the list |
| 335 | typing a character to insert cancels the specification." | 341 | of faces to be used, and removing any faces further |
| 342 | along in the list that would be completely overridden by | ||
| 343 | preceding faces (including FACE). | ||
| 344 | |||
| 345 | This command can also add FACE to the menu of faces, | ||
| 346 | if `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 | 675 | This is called whenever you create a new face, and at other times." | |
| 660 | This 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 f501e0054d1..c893e47ca79 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -2075,7 +2075,7 @@ terminal type to a different value." | |||
| 2075 | ;; red4 is too dark, but some say blue is too loud. | 2075 | ;; red4 is too dark, but some say blue is too loud. |
| 2076 | ;; brown seems to work ok. -- rms. | 2076 | ;; brown seems to work ok. -- rms. |
| 2077 | (t :foreground "brown")) | 2077 | (t :foreground "brown")) |
| 2078 | "Face for characters displayed as ^-sequences or \-sequences." | 2078 | "Face for characters displayed as sequences using `^' or `\\'." |
| 2079 | :group 'basic-faces | 2079 | :group 'basic-faces |
| 2080 | :version "22.1") | 2080 | :version "22.1") |
| 2081 | 2081 | ||
diff --git a/lisp/files.el b/lisp/files.el index 2b1446683be..e099d30a01f 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -540,13 +540,21 @@ is a valid DOS file name, but c:/bar/c:/foo is not. | |||
| 540 | 540 | ||
| 541 | This function's standard definition is trivial; it just returns | 541 | This function's standard definition is trivial; it just returns |
| 542 | the argument. However, on Windows and DOS, replace invalid | 542 | the argument. However, on Windows and DOS, replace invalid |
| 543 | characters. On DOS, make sure to obey the 8.3 limitations. On | 543 | characters. On DOS, make sure to obey the 8.3 limitations. |
| 544 | Windows, turn Cygwin names into native names, and also turn | 544 | In the native Windows build, turn Cygwin names into native names, |
| 545 | slashes into backslashes if the shell requires it (see | 545 | and also turn slashes into backslashes if the shell requires it (see |
| 546 | `w32-shell-dos-semantics'). | 546 | `w32-shell-dos-semantics'). |
| 547 | 547 | ||
| 548 | See Info node `(elisp)Standard File Names' for more details." | 548 | See Info node `(elisp)Standard File Names' for more details." |
| 549 | filename) | 549 | (if (eq system-type 'cygwin) |
| 550 | (let ((name (copy-sequence filename)) | ||
| 551 | (start 0)) | ||
| 552 | ;; Replace invalid filename characters with ! | ||
| 553 | (while (string-match "[?*:<>|\"\000-\037]" name start) | ||
| 554 | (aset name (match-beginning 0) ?!) | ||
| 555 | (setq start (match-end 0))) | ||
| 556 | name) | ||
| 557 | filename)) | ||
| 550 | 558 | ||
| 551 | (defun read-directory-name (prompt &optional dir default-dirname mustmatch initial) | 559 | (defun read-directory-name (prompt &optional dir default-dirname mustmatch initial) |
| 552 | "Read directory name, prompting with PROMPT and completing in directory DIR. | 560 | "Read directory name, prompting with PROMPT and completing in directory DIR. |
| @@ -4369,7 +4377,7 @@ See also `auto-save-file-name-p'." | |||
| 4369 | "#"))) | 4377 | "#"))) |
| 4370 | ;; Make sure auto-save file names don't contain characters | 4378 | ;; Make sure auto-save file names don't contain characters |
| 4371 | ;; invalid for the underlying filesystem. | 4379 | ;; invalid for the underlying filesystem. |
| 4372 | (if (and (memq system-type '(ms-dos windows-nt)) | 4380 | (if (and (memq system-type '(ms-dos windows-nt cygwin)) |
| 4373 | ;; Don't modify remote (ange-ftp) filenames | 4381 | ;; Don't modify remote (ange-ftp) filenames |
| 4374 | (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" result))) | 4382 | (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" result))) |
| 4375 | (convert-standard-filename result) | 4383 | (convert-standard-filename result) |
| @@ -4404,7 +4412,7 @@ See also `auto-save-file-name-p'." | |||
| 4404 | ((file-writable-p default-directory) default-directory) | 4412 | ((file-writable-p default-directory) default-directory) |
| 4405 | ((file-writable-p "/var/tmp/") "/var/tmp/") | 4413 | ((file-writable-p "/var/tmp/") "/var/tmp/") |
| 4406 | ("~/"))))) | 4414 | ("~/"))))) |
| 4407 | (if (and (memq system-type '(ms-dos windows-nt)) | 4415 | (if (and (memq system-type '(ms-dos windows-nt cygwin)) |
| 4408 | ;; Don't modify remote (ange-ftp) filenames | 4416 | ;; Don't modify remote (ange-ftp) filenames |
| 4409 | (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" fname))) | 4417 | (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" fname))) |
| 4410 | ;; The call to convert-standard-filename is in case | 4418 | ;; The call to convert-standard-filename is in case |
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-core.el b/lisp/font-core.el index d2cb8dccd10..85bbf60f0d9 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el | |||
| @@ -83,34 +83,6 @@ where MAJOR-MODE is a symbol and FONT-LOCK-DEFAULTS is a list of default | |||
| 83 | settings. See the variable `font-lock-defaults', which takes precedence.") | 83 | settings. See the variable `font-lock-defaults', which takes precedence.") |
| 84 | (make-obsolete-variable 'font-lock-defaults-alist 'font-lock-defaults) | 84 | (make-obsolete-variable 'font-lock-defaults-alist 'font-lock-defaults) |
| 85 | 85 | ||
| 86 | (defvar font-lock-extend-region-function nil | ||
| 87 | "A function that determines the region to fontify after a change. | ||
| 88 | |||
| 89 | This buffer-local variable is either nil, or is a function that determines the | ||
| 90 | region to fontify. It is usually set by the major mode. The currently active | ||
| 91 | font-lock after-change function calls this function after each buffer change. | ||
| 92 | |||
| 93 | The function is given three parameters, the standard BEG, END, and OLD-LEN | ||
| 94 | from after-change-functions. It should return either a cons of the beginning | ||
| 95 | and end buffer positions \(in that order) of the region to fontify, or nil | ||
| 96 | \(which directs the caller to fontify a default region). This function need | ||
| 97 | not preserve point or the match-data, but must preserve the current | ||
| 98 | restriction. The region it returns may start or end in the middle of a | ||
| 99 | line.") | ||
| 100 | (make-variable-buffer-local 'font-lock-extend-region-function) | ||
| 101 | |||
| 102 | (defun font-lock-extend-region (beg end old-len) | ||
| 103 | "Determine the region to fontify after a buffer change. | ||
| 104 | |||
| 105 | BEG END and OLD-LEN are the standard parameters from after-change-functions. | ||
| 106 | The return value is either nil \(which directs the caller to chose the region | ||
| 107 | itself), or a cons of the beginning and end \(in that order) of the region. | ||
| 108 | The region returned may start or end in the middle of a line." | ||
| 109 | (if font-lock-extend-region-function | ||
| 110 | (save-match-data | ||
| 111 | (save-excursion | ||
| 112 | (funcall font-lock-extend-region-function beg end old-len))))) | ||
| 113 | |||
| 114 | (defvar font-lock-function 'font-lock-default-function | 86 | (defvar font-lock-function 'font-lock-default-function |
| 115 | "A function which is called when `font-lock-mode' is toggled. | 87 | "A function which is called when `font-lock-mode' is toggled. |
| 116 | It will be passed one argument, which is the current value of | 88 | It will be passed one argument, which is the current value of |
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index f001a0bfaac..093780c3914 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -893,7 +893,11 @@ The value of this variable is used when Font Lock mode is turned on." | |||
| 893 | (set (make-local-variable 'font-lock-fontified) t) | 893 | (set (make-local-variable 'font-lock-fontified) t) |
| 894 | ;; Use jit-lock. | 894 | ;; Use jit-lock. |
| 895 | (jit-lock-register 'font-lock-fontify-region | 895 | (jit-lock-register 'font-lock-fontify-region |
| 896 | (not font-lock-keywords-only)))))) | 896 | (not font-lock-keywords-only)) |
| 897 | ;; Tell jit-lock how we extend the region to refontify. | ||
| 898 | (add-hook 'jit-lock-after-change-extend-region-functions | ||
| 899 | 'font-lock-extend-jit-lock-region-after-change | ||
| 900 | nil t))))) | ||
| 897 | 901 | ||
| 898 | (defun font-lock-turn-off-thing-lock () | 902 | (defun font-lock-turn-off-thing-lock () |
| 899 | (cond ((and (boundp 'fast-lock-mode) fast-lock-mode) | 903 | (cond ((and (boundp 'fast-lock-mode) fast-lock-mode) |
| @@ -971,6 +975,21 @@ The value of this variable is used when Font Lock mode is turned on." | |||
| 971 | ;; directives correctly and cleanly. (It is the same problem as fontifying | 975 | ;; directives correctly and cleanly. (It is the same problem as fontifying |
| 972 | ;; 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.) |
| 973 | 977 | ||
| 978 | (defvar font-lock-extend-after-change-region-function nil | ||
| 979 | "A function that determines the region to refontify after a change. | ||
| 980 | |||
| 981 | This variable is either nil, or is a function that determines the | ||
| 982 | region to refontify after a change. | ||
| 983 | It is usually set by the major mode via `font-lock-defaults'. | ||
| 984 | Font-lock calls this function after each buffer change. | ||
| 985 | |||
| 986 | The function is given three parameters, the standard BEG, END, and OLD-LEN | ||
| 987 | from `after-change-functions'. It should return either a cons of the beginning | ||
| 988 | and end buffer positions \(in that order) of the region to refontify, or nil | ||
| 989 | \(which directs the caller to fontify a default region). | ||
| 990 | This function should preserve the match-data. | ||
| 991 | The region it returns may start or end in the middle of a line.") | ||
| 992 | |||
| 974 | (defun font-lock-fontify-buffer () | 993 | (defun font-lock-fontify-buffer () |
| 975 | "Fontify the current buffer the way the function `font-lock-mode' would." | 994 | "Fontify the current buffer the way the function `font-lock-mode' would." |
| 976 | (interactive) | 995 | (interactive) |
| @@ -1021,6 +1040,59 @@ The value of this variable is used when Font Lock mode is turned on." | |||
| 1021 | Useful for things like RMAIL and Info where the whole buffer is not | 1040 | Useful for things like RMAIL and Info where the whole buffer is not |
| 1022 | a very meaningful entity to highlight.") | 1041 | a very meaningful entity to highlight.") |
| 1023 | 1042 | ||
| 1043 | |||
| 1044 | (defvar font-lock-beg) (defvar font-lock-end) | ||
| 1045 | (defvar font-lock-extend-region-functions | ||
| 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. | ||
| 1053 | font-lock-extend-region-multiline) | ||
| 1054 | "Special hook run just before proceeding to fontify a region. | ||
| 1055 | This is used to allow major modes to help font-lock find safe buffer positions | ||
| 1056 | as beginning and end of the fontified region. Its most common use is to solve | ||
| 1057 | the problem of /identification/ of multiline elements by providing a function | ||
| 1058 | that tries to find such elements and move the boundaries such that they do | ||
| 1059 | not fall in the middle of one. | ||
| 1060 | Each function is called with no argument; it is expected to adjust the | ||
| 1061 | dynamically bound variables `font-lock-beg' and `font-lock-end'; and return | ||
| 1062 | non-nil iff it did make such an adjustment. | ||
| 1063 | These functions are run in turn repeatedly until they all return nil. | ||
| 1064 | Put first the functions more likely to cause a change and cheaper to compute.") | ||
| 1065 | ;; Mark it as a special hook which doesn't use any global setting | ||
| 1066 | ;; (i.e. doesn't obey the element t in the buffer-local value). | ||
| 1067 | (make-variable-buffer-local 'font-lock-extend-region-functions) | ||
| 1068 | |||
| 1069 | (defun font-lock-extend-region-multiline () | ||
| 1070 | "Move fontification boundaries away from any `font-lock-multiline' property." | ||
| 1071 | (let ((changed nil)) | ||
| 1072 | (when (and (> font-lock-beg (point-min)) | ||
| 1073 | (get-text-property (1- font-lock-beg) 'font-lock-multiline)) | ||
| 1074 | (setq changed t) | ||
| 1075 | (setq font-lock-beg (or (previous-single-property-change | ||
| 1076 | font-lock-beg 'font-lock-multiline) | ||
| 1077 | (point-min)))) | ||
| 1078 | ;; | ||
| 1079 | (when (get-text-property font-lock-end 'font-lock-multiline) | ||
| 1080 | (setq changed t) | ||
| 1081 | (setq font-lock-end (or (text-property-any font-lock-end (point-max) | ||
| 1082 | 'font-lock-multiline nil) | ||
| 1083 | (point-max)))) | ||
| 1084 | changed)) | ||
| 1085 | |||
| 1086 | |||
| 1087 | (defun font-lock-extend-region-wholelines () | ||
| 1088 | "Move fontification boundaries to beginning of lines." | ||
| 1089 | (let ((changed nil)) | ||
| 1090 | (goto-char font-lock-beg) | ||
| 1091 | (unless (bolp) (setq changed t font-lock-beg (line-beginning-position))) | ||
| 1092 | (goto-char font-lock-end) | ||
| 1093 | (unless (bolp) (setq changed t font-lock-end (line-beginning-position 2))) | ||
| 1094 | changed)) | ||
| 1095 | |||
| 1024 | (defun font-lock-default-fontify-region (beg end loudly) | 1096 | (defun font-lock-default-fontify-region (beg end loudly) |
| 1025 | (save-buffer-state | 1097 | (save-buffer-state |
| 1026 | ((parse-sexp-lookup-properties | 1098 | ((parse-sexp-lookup-properties |
| @@ -1032,24 +1104,21 @@ a very meaningful entity to highlight.") | |||
| 1032 | ;; Use the fontification syntax table, if any. | 1104 | ;; Use the fontification syntax table, if any. |
| 1033 | (when font-lock-syntax-table | 1105 | (when font-lock-syntax-table |
| 1034 | (set-syntax-table font-lock-syntax-table)) | 1106 | (set-syntax-table font-lock-syntax-table)) |
| 1035 | (goto-char beg) | 1107 | ;; Extend the region to fontify so that it starts and ends at |
| 1036 | (setq beg (line-beginning-position)) | 1108 | ;; safe places. |
| 1037 | ;; check to see if we should expand the beg/end area for | 1109 | (let ((funs font-lock-extend-region-functions) |
| 1038 | ;; proper multiline matches | 1110 | (font-lock-beg beg) |
| 1039 | (when (and (> beg (point-min)) | 1111 | (font-lock-end end)) |
| 1040 | (get-text-property (1- beg) 'font-lock-multiline)) | 1112 | (while funs |
| 1041 | ;; We are just after or in a multiline match. | 1113 | (setq funs (if (or (not (funcall (car funs))) |
| 1042 | (setq beg (or (previous-single-property-change | 1114 | (eq funs font-lock-extend-region-functions)) |
| 1043 | beg 'font-lock-multiline) | 1115 | (cdr funs) |
| 1044 | (point-min))) | 1116 | ;; If there's been a change, we should go through |
| 1045 | (goto-char beg) | 1117 | ;; the list again since this new position may |
| 1046 | (setq beg (line-beginning-position))) | 1118 | ;; warrant a different answer from one of the fun |
| 1047 | (setq end (or (text-property-any end (point-max) | 1119 | ;; we've already seen. |
| 1048 | 'font-lock-multiline nil) | 1120 | font-lock-extend-region-functions))) |
| 1049 | (point-max))) | 1121 | (setq beg font-lock-beg end font-lock-end)) |
| 1050 | (goto-char end) | ||
| 1051 | ;; Round up to a whole line. | ||
| 1052 | (unless (bolp) (setq end (line-beginning-position 2))) | ||
| 1053 | ;; Now do the fontification. | 1122 | ;; Now do the fontification. |
| 1054 | (font-lock-unfontify-region beg end) | 1123 | (font-lock-unfontify-region beg end) |
| 1055 | (when font-lock-syntactic-keywords | 1124 | (when font-lock-syntactic-keywords |
| @@ -1083,19 +1152,77 @@ what properties to clear before refontifying a region.") | |||
| 1083 | 1152 | ||
| 1084 | ;; Called when any modification is made to buffer text. | 1153 | ;; Called when any modification is made to buffer text. |
| 1085 | (defun font-lock-after-change-function (beg end old-len) | 1154 | (defun font-lock-after-change-function (beg end old-len) |
| 1086 | (let ((inhibit-point-motion-hooks t) | 1155 | (save-excursion |
| 1087 | (inhibit-quit t) | 1156 | (let ((inhibit-point-motion-hooks t) |
| 1088 | (region (font-lock-extend-region beg end old-len))) | 1157 | (inhibit-quit t) |
| 1089 | (save-excursion | 1158 | (region (if font-lock-extend-after-change-region-function |
| 1159 | (funcall font-lock-extend-after-change-region-function | ||
| 1160 | beg end old-len)))) | ||
| 1090 | (save-match-data | 1161 | (save-match-data |
| 1091 | (if region | 1162 | (if region |
| 1092 | ;; Fontify the region the major mode has specified. | 1163 | ;; Fontify the region the major mode has specified. |
| 1093 | (setq beg (car region) end (cdr region)) | 1164 | (setq beg (car region) end (cdr region)) |
| 1094 | ;; Fontify the whole lines which enclose the region. | 1165 | ;; Fontify the whole lines which enclose the region. |
| 1095 | (setq beg (progn (goto-char beg) (line-beginning-position)) | 1166 | ;; Actually, this is not needed because |
| 1096 | end (progn (goto-char end) (line-beginning-position 2)))) | 1167 | ;; font-lock-default-fontify-region already rounds up to a whole |
| 1168 | ;; number of lines. | ||
| 1169 | ;; (setq beg (progn (goto-char beg) (line-beginning-position)) | ||
| 1170 | ;; end (progn (goto-char end) (line-beginning-position 2))) | ||
| 1171 | ) | ||
| 1097 | (font-lock-fontify-region beg end))))) | 1172 | (font-lock-fontify-region beg end))))) |
| 1098 | 1173 | ||
| 1174 | (defvar jit-lock-start) (defvar jit-lock-end) | ||
| 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'. | ||
| 1177 | This 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'." | ||
| 1183 | (save-excursion | ||
| 1184 | ;; First extend the region as font-lock-after-change-function would. | ||
| 1185 | (let ((region (if font-lock-extend-after-change-region-function | ||
| 1186 | (funcall font-lock-extend-after-change-region-function | ||
| 1187 | beg end old-len)))) | ||
| 1188 | (if region | ||
| 1189 | (setq beg (min jit-lock-start (car region)) | ||
| 1190 | end (max jit-lock-end (cdr region)))) | ||
| 1191 | ;; Then extend the region obeying font-lock-multiline properties, | ||
| 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. | ||
| 1203 | (when (and (> beg (point-min)) | ||
| 1204 | (get-text-property (1- beg) 'font-lock-multiline)) | ||
| 1205 | (setq beg (or (previous-single-property-change | ||
| 1206 | beg 'font-lock-multiline) | ||
| 1207 | (point-min)))) | ||
| 1208 | (setq end (or (text-property-any end (point-max) | ||
| 1209 | 'font-lock-multiline nil) | ||
| 1210 | (point-max))) | ||
| 1211 | ;; Finally, pre-enlarge the region to a whole number of lines, to try | ||
| 1212 | ;; and anticipate what font-lock-default-fontify-region will do, so as to | ||
| 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. | ||
| 1217 | (when (memq 'font-lock-extend-region-wholelines | ||
| 1218 | font-lock-extend-region-functions) | ||
| 1219 | (goto-char beg) | ||
| 1220 | (forward-line 0) | ||
| 1221 | (setq jit-lock-start (min jit-lock-start (point))) | ||
| 1222 | (goto-char end) | ||
| 1223 | (forward-line 1) | ||
| 1224 | (setq jit-lock-end (max jit-lock-end (point))))))) | ||
| 1225 | |||
| 1099 | (defun font-lock-fontify-block (&optional arg) | 1226 | (defun font-lock-fontify-block (&optional arg) |
| 1100 | "Fontify some lines the way `font-lock-fontify-buffer' would. | 1227 | "Fontify some lines the way `font-lock-fontify-buffer' would. |
| 1101 | The lines could be a function or paragraph, or a specified number of lines. | 1228 | The lines could be a function or paragraph, or a specified number of lines. |
diff --git a/lisp/format.el b/lisp/format.el index 58c69575d36..66eca0c2ac2 100644 --- a/lisp/format.el +++ b/lisp/format.el | |||
| @@ -117,17 +117,17 @@ DOC-STR should be a single line providing more information about the | |||
| 117 | 117 | ||
| 118 | REGEXP is a regular expression to match against the beginning of the file; | 118 | REGEXP is a regular expression to match against the beginning of the file; |
| 119 | it should match only files in that format. Use nil to avoid | 119 | it should match only files in that format. Use nil to avoid |
| 120 | matching at all for formats for which this isn't appropriate to | 120 | matching at all for formats for which it isn't appropriate to |
| 121 | require explicit encoding/decoding. | 121 | require explicit encoding/decoding. |
| 122 | 122 | ||
| 123 | FROM-FN is called to decode files in that format; it gets two args, BEGIN | 123 | FROM-FN is called to decode files in that format; it takes two args, BEGIN |
| 124 | and END, and can make any modifications it likes, returning the new | 124 | and END, and can make any modifications it likes, returning the new |
| 125 | end. It must make sure that the beginning of the file no longer | 125 | end. It must make sure that the beginning of the file no longer |
| 126 | matches REGEXP, or else it will get called again. | 126 | matches REGEXP, or else it will get called again. |
| 127 | Alternatively, FROM-FN can be a string, which specifies a shell command | 127 | Alternatively, FROM-FN can be a string, which specifies a shell command |
| 128 | (including options) to be used as a filter to perform the conversion. | 128 | (including options) to be used as a filter to perform the conversion. |
| 129 | 129 | ||
| 130 | TO-FN is called to encode a region into that format; it is passed three | 130 | TO-FN is called to encode a region into that format; it takes three |
| 131 | arguments: BEGIN, END, and BUFFER. BUFFER is the original buffer that | 131 | arguments: BEGIN, END, and BUFFER. BUFFER is the original buffer that |
| 132 | the data being written came from, which the function could use, for | 132 | the data being written came from, which the function could use, for |
| 133 | example, to find the values of local variables. TO-FN should either | 133 | example, to find the values of local variables. TO-FN should either |
| @@ -142,7 +142,7 @@ MODIFY, if non-nil, means the TO-FN wants to modify the region. If nil, | |||
| 142 | 142 | ||
| 143 | MODE-FN, if specified, is called when visiting a file with that format. | 143 | MODE-FN, if specified, is called when visiting a file with that format. |
| 144 | It is called with a single positive argument, on the assumption | 144 | It is called with a single positive argument, on the assumption |
| 145 | that it turns on some Emacs mode. | 145 | that this would turn on some minor mode. |
| 146 | 146 | ||
| 147 | PRESERVE, if non-nil, means that `format-write-file' should not remove | 147 | PRESERVE, if non-nil, means that `format-write-file' should not remove |
| 148 | this format from `buffer-file-formats'.") | 148 | this format from `buffer-file-formats'.") |
| @@ -150,8 +150,8 @@ PRESERVE, if non-nil, means that `format-write-file' should not remove | |||
| 150 | ;;; Basic Functions (called from Lisp) | 150 | ;;; Basic Functions (called from Lisp) |
| 151 | 151 | ||
| 152 | (defun format-encode-run-method (method from to &optional buffer) | 152 | (defun format-encode-run-method (method from to &optional buffer) |
| 153 | "Translate using function or shell script METHOD the text from FROM to TO. | 153 | "Translate using METHOD the text from FROM to TO. |
| 154 | If METHOD is a string, it is a shell command; | 154 | If METHOD is a string, it is a shell command (including options); |
| 155 | otherwise, it should be a Lisp function. | 155 | otherwise, it should be a Lisp function. |
| 156 | BUFFER should be the buffer that the output originally came from." | 156 | BUFFER should be the buffer that the output originally came from." |
| 157 | (if (stringp method) | 157 | (if (stringp method) |
| @@ -173,9 +173,9 @@ BUFFER should be the buffer that the output originally came from." | |||
| 173 | (funcall method from to buffer))) | 173 | (funcall method from to buffer))) |
| 174 | 174 | ||
| 175 | (defun format-decode-run-method (method from to &optional buffer) | 175 | (defun format-decode-run-method (method from to &optional buffer) |
| 176 | "Decode using function or shell script METHOD the text from FROM to TO. | 176 | "Decode using METHOD the text from FROM to TO. |
| 177 | If METHOD is a string, it is a shell command; otherwise, it should be | 177 | If METHOD is a string, it is a shell command (including options); otherwise, |
| 178 | a Lisp function. Decoding is done for the given BUFFER." | 178 | it should be a Lisp function. Decoding is done for the given BUFFER." |
| 179 | (if (stringp method) | 179 | (if (stringp method) |
| 180 | (let ((error-buff (get-buffer-create "*Format Errors*")) | 180 | (let ((error-buff (get-buffer-create "*Format Errors*")) |
| 181 | (coding-system-for-write 'no-conversion) | 181 | (coding-system-for-write 'no-conversion) |
| @@ -200,15 +200,15 @@ a Lisp function. Decoding is done for the given BUFFER." | |||
| 200 | 200 | ||
| 201 | (defun format-annotate-function (format from to orig-buf format-count) | 201 | (defun format-annotate-function (format from to orig-buf format-count) |
| 202 | "Return annotations for writing region as FORMAT. | 202 | "Return annotations for writing region as FORMAT. |
| 203 | FORMAT is a symbol naming one of the formats defined in `format-alist', | 203 | FORMAT is a symbol naming one of the formats defined in `format-alist'. |
| 204 | it must be a single symbol, not a list like `buffer-file-format'. | 204 | It must be a single symbol, not a list like `buffer-file-format'. |
| 205 | FROM and TO delimit the region to be operated on in the current buffer. | 205 | FROM and TO delimit the region to be operated on in the current buffer. |
| 206 | ORIG-BUF is the original buffer that the data came from. | 206 | ORIG-BUF is the original buffer that the data came from. |
| 207 | 207 | ||
| 208 | FORMAT-COUNT is an integer specifying how many times this function has | 208 | FORMAT-COUNT is an integer specifying how many times this function has |
| 209 | been called in the process of decoding ORIG-BUF. | 209 | been called in the process of decoding ORIG-BUF. |
| 210 | 210 | ||
| 211 | This function works like a function on `write-region-annotate-functions': | 211 | This function works like a function in `write-region-annotate-functions': |
| 212 | it either returns a list of annotations, or returns with a different buffer | 212 | it either returns a list of annotations, or returns with a different buffer |
| 213 | current, which contains the modified text to write. In the latter case, | 213 | current, which contains the modified text to write. In the latter case, |
| 214 | this function's value is nil. | 214 | this function's value is nil. |
| @@ -253,7 +253,7 @@ If optional third arg VISIT-FLAG is true, set `buffer-file-format' | |||
| 253 | to the reverted list of formats used, and call any mode functions defined | 253 | to the reverted list of formats used, and call any mode functions defined |
| 254 | for those formats. | 254 | for those formats. |
| 255 | 255 | ||
| 256 | Returns the new length of the decoded region. | 256 | Return the new length of the decoded region. |
| 257 | 257 | ||
| 258 | For most purposes, consider using `format-decode-region' instead." | 258 | For most purposes, consider using `format-decode-region' instead." |
| 259 | (let ((mod (buffer-modified-p)) | 259 | (let ((mod (buffer-modified-p)) |
| @@ -312,9 +312,9 @@ For most purposes, consider using `format-decode-region' instead." | |||
| 312 | 312 | ||
| 313 | (defun format-decode-buffer (&optional format) | 313 | (defun format-decode-buffer (&optional format) |
| 314 | "Translate the buffer from some FORMAT. | 314 | "Translate the buffer from some FORMAT. |
| 315 | If the format is not specified, this function attempts to guess. | 315 | If the format is not specified, attempt a regexp-based guess. |
| 316 | `buffer-file-format' is set to the format used, and any mode-functions | 316 | Set `buffer-file-format' to the format used, and call any |
| 317 | for the format are called." | 317 | format-specific mode functions." |
| 318 | (interactive | 318 | (interactive |
| 319 | (list (format-read "Translate buffer from format (default guess): "))) | 319 | (list (format-read "Translate buffer from format (default guess): "))) |
| 320 | (save-excursion | 320 | (save-excursion |
| @@ -343,7 +343,7 @@ formats defined in `format-alist', or a list of such symbols." | |||
| 343 | 343 | ||
| 344 | (defun format-encode-region (beg end &optional format) | 344 | (defun format-encode-region (beg end &optional format) |
| 345 | "Translate the region into some FORMAT. | 345 | "Translate the region into some FORMAT. |
| 346 | FORMAT defaults to `buffer-file-format', it is a symbol naming | 346 | FORMAT defaults to `buffer-file-format'. It is a symbol naming |
| 347 | one of the formats defined in `format-alist', or a list of such symbols." | 347 | one of the formats defined in `format-alist', or a list of such symbols." |
| 348 | (interactive | 348 | (interactive |
| 349 | (list (region-beginning) (region-end) | 349 | (list (region-beginning) (region-end) |
| @@ -374,9 +374,9 @@ Make buffer visit that file and set the format as the default for future | |||
| 374 | saves. If the buffer is already visiting a file, you can specify a directory | 374 | saves. If the buffer is already visiting a file, you can specify a directory |
| 375 | name as FILENAME, to write a file of the same old name in that directory. | 375 | name as FILENAME, to write a file of the same old name in that directory. |
| 376 | 376 | ||
| 377 | If optional third arg CONFIRM is non-nil, this function asks for | 377 | If optional third arg CONFIRM is non-nil, ask for confirmation before |
| 378 | confirmation before overwriting an existing file. Interactively, | 378 | overwriting an existing file. Interactively, confirmation is required |
| 379 | confirmation is required unless you supply a prefix argument." | 379 | unless you supply a prefix argument." |
| 380 | (interactive | 380 | (interactive |
| 381 | ;; Same interactive spec as write-file, plus format question. | 381 | ;; Same interactive spec as write-file, plus format question. |
| 382 | (let* ((file (if buffer-file-name | 382 | (let* ((file (if buffer-file-name |
| @@ -419,7 +419,7 @@ If FORMAT is nil then do not do any format conversion." | |||
| 419 | "Insert the contents of file FILENAME using data format FORMAT. | 419 | "Insert the contents of file FILENAME using data format FORMAT. |
| 420 | If FORMAT is nil then do not do any format conversion. | 420 | If FORMAT is nil then do not do any format conversion. |
| 421 | The optional third and fourth arguments BEG and END specify | 421 | The optional third and fourth arguments BEG and END specify |
| 422 | the part of the file to read. | 422 | the part (in bytes) of the file to read. |
| 423 | 423 | ||
| 424 | The return value is like the value of `insert-file-contents': | 424 | The return value is like the value of `insert-file-contents': |
| 425 | a list (ABSOLUTE-FILE-NAME SIZE)." | 425 | a list (ABSOLUTE-FILE-NAME SIZE)." |
| @@ -456,10 +456,10 @@ Formats are defined in `format-alist'. Optional arg is the PROMPT to use." | |||
| 456 | (defun format-replace-strings (alist &optional reverse beg end) | 456 | (defun format-replace-strings (alist &optional reverse beg end) |
| 457 | "Do multiple replacements on the buffer. | 457 | "Do multiple replacements on the buffer. |
| 458 | ALIST is a list of (FROM . TO) pairs, which should be proper arguments to | 458 | ALIST is a list of (FROM . TO) pairs, which should be proper arguments to |
| 459 | `search-forward' and `replace-match' respectively. | 459 | `search-forward' and `replace-match', respectively. |
| 460 | Optional 2nd arg REVERSE, if non-nil, means the pairs are (TO . FROM), so that | 460 | Optional second arg REVERSE, if non-nil, means the pairs are (TO . FROM), |
| 461 | you can use the same list in both directions if it contains only literal | 461 | so that you can use the same list in both directions if it contains only |
| 462 | strings. | 462 | literal strings. |
| 463 | Optional args BEG and END specify a region of the buffer on which to operate." | 463 | Optional args BEG and END specify a region of the buffer on which to operate." |
| 464 | (save-excursion | 464 | (save-excursion |
| 465 | (save-restriction | 465 | (save-restriction |
| @@ -497,7 +497,7 @@ the value of `foo'." | |||
| 497 | 497 | ||
| 498 | (defun format-make-relatively-unique (a b) | 498 | (defun format-make-relatively-unique (a b) |
| 499 | "Delete common elements of lists A and B, return as pair. | 499 | "Delete common elements of lists A and B, return as pair. |
| 500 | Compares using `equal'." | 500 | Compare using `equal'." |
| 501 | (let* ((acopy (copy-sequence a)) | 501 | (let* ((acopy (copy-sequence a)) |
| 502 | (bcopy (copy-sequence b)) | 502 | (bcopy (copy-sequence b)) |
| 503 | (tail acopy)) | 503 | (tail acopy)) |
| @@ -511,9 +511,9 @@ Compares using `equal'." | |||
| 511 | 511 | ||
| 512 | (defun format-common-tail (a b) | 512 | (defun format-common-tail (a b) |
| 513 | "Given two lists that have a common tail, return it. | 513 | "Given two lists that have a common tail, return it. |
| 514 | Compares with `equal', and returns the part of A that is equal to the | 514 | Compare with `equal', and return the part of A that is equal to the |
| 515 | equivalent part of B. If even the last items of the two are not equal, | 515 | equivalent part of B. If even the last items of the two are not equal, |
| 516 | returns nil." | 516 | return nil." |
| 517 | (let ((la (length a)) | 517 | (let ((la (length a)) |
| 518 | (lb (length b))) | 518 | (lb (length b))) |
| 519 | ;; Make sure they are the same length | 519 | ;; Make sure they are the same length |
| @@ -534,9 +534,9 @@ A proper list is a list ending with a nil cdr, not with an atom " | |||
| 534 | (null list))) | 534 | (null list))) |
| 535 | 535 | ||
| 536 | (defun format-reorder (items order) | 536 | (defun format-reorder (items order) |
| 537 | "Arrange ITEMS to following partial ORDER. | 537 | "Arrange ITEMS to follow partial ORDER. |
| 538 | Elements of ITEMS equal to elements of ORDER will be rearranged to follow the | 538 | Elements of ITEMS equal to elements of ORDER will be rearranged |
| 539 | ORDER. Unmatched items will go last." | 539 | to follow the ORDER. Unmatched items will go last." |
| 540 | (if order | 540 | (if order |
| 541 | (let ((item (member (car order) items))) | 541 | (let ((item (member (car order) items))) |
| 542 | (if item | 542 | (if item |
| @@ -793,7 +793,7 @@ yet known. | |||
| 793 | ;; next-single-property-change instead of text-property-not-all, but then | 793 | ;; next-single-property-change instead of text-property-not-all, but then |
| 794 | ;; we have to see if we passed TO. | 794 | ;; we have to see if we passed TO. |
| 795 | (defun format-property-increment-region (from to prop delta default) | 795 | (defun format-property-increment-region (from to prop delta default) |
| 796 | "Over the region between FROM and TO increment property PROP by amount DELTA. | 796 | "In the region from FROM to TO increment property PROP by amount DELTA. |
| 797 | DELTA may be negative. If property PROP is nil anywhere | 797 | DELTA may be negative. If property PROP is nil anywhere |
| 798 | in the region, it is treated as though it were DEFAULT." | 798 | in the region, it is treated as though it were DEFAULT." |
| 799 | (let ((cur from) val newval next) | 799 | (let ((cur from) val newval next) |
| @@ -810,7 +810,7 @@ in the region, it is treated as though it were DEFAULT." | |||
| 810 | 810 | ||
| 811 | (defun format-insert-annotations (list &optional offset) | 811 | (defun format-insert-annotations (list &optional offset) |
| 812 | "Apply list of annotations to buffer as `write-region' would. | 812 | "Apply list of annotations to buffer as `write-region' would. |
| 813 | Inserts each element of the given LIST of buffer annotations at its | 813 | Insert each element of the given LIST of buffer annotations at its |
| 814 | appropriate place. Use second arg OFFSET if the annotations' locations are | 814 | appropriate place. Use second arg OFFSET if the annotations' locations are |
| 815 | not relative to the beginning of the buffer: annotations will be inserted | 815 | not relative to the beginning of the buffer: annotations will be inserted |
| 816 | at their location-OFFSET+1 \(ie, the offset is treated as the position of | 816 | at their location-OFFSET+1 \(ie, the offset is treated as the position of |
| @@ -834,7 +834,7 @@ property is the name of the annotation that you want to use, as it is for the | |||
| 834 | 834 | ||
| 835 | (defun format-annotate-region (from to translations format-fn ignore) | 835 | (defun format-annotate-region (from to translations format-fn ignore) |
| 836 | "Generate annotations for text properties in the region. | 836 | "Generate annotations for text properties in the region. |
| 837 | Searches for changes between FROM and TO, and describes them with a list of | 837 | Search for changes between FROM and TO, and describe them with a list of |
| 838 | annotations as defined by alist TRANSLATIONS and FORMAT-FN. IGNORE lists text | 838 | annotations as defined by alist TRANSLATIONS and FORMAT-FN. IGNORE lists text |
| 839 | properties not to consider; any text properties that are neither ignored nor | 839 | properties not to consider; any text properties that are neither ignored nor |
| 840 | listed in TRANSLATIONS are warned about. | 840 | listed in TRANSLATIONS are warned about. |
| @@ -975,9 +975,9 @@ either strings, or lists of the form (PARAMETER VALUE)." | |||
| 975 | "Return annotations for property PROP changing from OLD to NEW. | 975 | "Return annotations for property PROP changing from OLD to NEW. |
| 976 | These are searched for in the translations alist TRANSLATIONS | 976 | These are searched for in the translations alist TRANSLATIONS |
| 977 | (see `format-annotate-region' for the format). | 977 | (see `format-annotate-region' for the format). |
| 978 | If NEW does not appear in the list, but there is a default function, then that | 978 | If NEW does not appear in the list, but there is a default function, |
| 979 | function is called. | 979 | then call that function. |
| 980 | Returns a cons of the form (CLOSE . OPEN) | 980 | Return a cons of the form (CLOSE . OPEN) |
| 981 | where CLOSE is a list of annotations to close | 981 | where CLOSE is a list of annotations to close |
| 982 | and OPEN is a list of annotations to open. | 982 | and OPEN is a list of annotations to open. |
| 983 | 983 | ||
| @@ -1016,7 +1016,7 @@ either strings, or lists of the form (PARAMETER VALUE)." | |||
| 1016 | (format-annotate-atomic-property-change prop-alist old new))))) | 1016 | (format-annotate-atomic-property-change prop-alist old new))))) |
| 1017 | 1017 | ||
| 1018 | (defun format-annotate-atomic-property-change (prop-alist old new) | 1018 | (defun format-annotate-atomic-property-change (prop-alist old new) |
| 1019 | "Internal function annotate a single property change. | 1019 | "Internal function to annotate a single property change. |
| 1020 | PROP-ALIST is the relevant element of a TRANSLATIONS list. | 1020 | PROP-ALIST is the relevant element of a TRANSLATIONS list. |
| 1021 | OLD and NEW are the values." | 1021 | OLD and NEW are the values." |
| 1022 | (let (num-ann) | 1022 | (let (num-ann) |
diff --git a/lisp/frame.el b/lisp/frame.el index e965007c8b0..1ad42e387a8 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -1362,49 +1362,19 @@ The function `blink-cursor-start' is called when the timer fires.") | |||
| 1362 | This timer calls `blink-cursor-timer-function' every | 1362 | This timer calls `blink-cursor-timer-function' every |
| 1363 | `blink-cursor-interval' seconds.") | 1363 | `blink-cursor-interval' seconds.") |
| 1364 | 1364 | ||
| 1365 | (define-minor-mode blink-cursor-mode | ||
| 1366 | "Toggle blinking cursor mode. | ||
| 1367 | With a numeric argument, turn blinking cursor mode on iff ARG is positive. | ||
| 1368 | When blinking cursor mode is enabled, the cursor of the selected | ||
| 1369 | window blinks. | ||
| 1370 | |||
| 1371 | Note that this command is effective only when Emacs | ||
| 1372 | displays through a window system, because then Emacs does its own | ||
| 1373 | cursor display. On a text-only terminal, this is not implemented." | ||
| 1374 | :init-value (not (or noninteractive | ||
| 1375 | no-blinking-cursor | ||
| 1376 | (eq system-type 'ms-dos) | ||
| 1377 | (not (memq initial-window-system '(x w32 mac))))) | ||
| 1378 | :initialize 'custom-initialize-safe-default | ||
| 1379 | :group 'cursor | ||
| 1380 | :global t | ||
| 1381 | (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer)) | ||
| 1382 | (if blink-cursor-timer (cancel-timer blink-cursor-timer)) | ||
| 1383 | (setq blink-cursor-idle-timer nil | ||
| 1384 | blink-cursor-timer nil) | ||
| 1385 | (if blink-cursor-mode | ||
| 1386 | (progn | ||
| 1387 | ;; Hide the cursor. | ||
| 1388 | ;;(internal-show-cursor nil nil) | ||
| 1389 | (setq blink-cursor-idle-timer | ||
| 1390 | (run-with-idle-timer blink-cursor-delay | ||
| 1391 | blink-cursor-delay | ||
| 1392 | 'blink-cursor-start))) | ||
| 1393 | (internal-show-cursor nil t))) | ||
| 1394 | |||
| 1395 | (define-obsolete-variable-alias 'blink-cursor 'blink-cursor-mode "22.1") | ||
| 1396 | |||
| 1397 | (defun blink-cursor-start () | 1365 | (defun blink-cursor-start () |
| 1398 | "Timer function called from the timer `blink-cursor-idle-timer'. | 1366 | "Timer function called from the timer `blink-cursor-idle-timer'. |
| 1399 | This starts the timer `blink-cursor-timer', which makes the cursor blink | 1367 | This starts the timer `blink-cursor-timer', which makes the cursor blink |
| 1400 | if appropriate. It also arranges to cancel that timer when the next | 1368 | if appropriate. It also arranges to cancel that timer when the next |
| 1401 | command starts, by installing a pre-command hook." | 1369 | command starts, by installing a pre-command hook." |
| 1402 | (when (null blink-cursor-timer) | 1370 | (when (null blink-cursor-timer) |
| 1403 | (add-hook 'pre-command-hook 'blink-cursor-end) | 1371 | ;; Set up the timer first, so that if this signals an error, |
| 1404 | (internal-show-cursor nil nil) | 1372 | ;; blink-cursor-end is not added to pre-command-hook. |
| 1405 | (setq blink-cursor-timer | 1373 | (setq blink-cursor-timer |
| 1406 | (run-with-timer blink-cursor-interval blink-cursor-interval | 1374 | (run-with-timer blink-cursor-interval blink-cursor-interval |
| 1407 | 'blink-cursor-timer-function)))) | 1375 | 'blink-cursor-timer-function)) |
| 1376 | (add-hook 'pre-command-hook 'blink-cursor-end) | ||
| 1377 | (internal-show-cursor nil nil))) | ||
| 1408 | 1378 | ||
| 1409 | (defun blink-cursor-timer-function () | 1379 | (defun blink-cursor-timer-function () |
| 1410 | "Timer function of timer `blink-cursor-timer'." | 1380 | "Timer function of timer `blink-cursor-timer'." |
| @@ -1417,10 +1387,38 @@ When run, it cancels the timer `blink-cursor-timer' and removes | |||
| 1417 | itself as a pre-command hook." | 1387 | itself as a pre-command hook." |
| 1418 | (remove-hook 'pre-command-hook 'blink-cursor-end) | 1388 | (remove-hook 'pre-command-hook 'blink-cursor-end) |
| 1419 | (internal-show-cursor nil t) | 1389 | (internal-show-cursor nil t) |
| 1420 | (cancel-timer blink-cursor-timer) | 1390 | (when blink-cursor-timer |
| 1421 | (setq blink-cursor-timer nil)) | 1391 | (cancel-timer blink-cursor-timer) |
| 1392 | (setq blink-cursor-timer nil))) | ||
| 1422 | 1393 | ||
| 1394 | (define-minor-mode blink-cursor-mode | ||
| 1395 | "Toggle blinking cursor mode. | ||
| 1396 | With a numeric argument, turn blinking cursor mode on iff ARG is positive. | ||
| 1397 | When blinking cursor mode is enabled, the cursor of the selected | ||
| 1398 | window blinks. | ||
| 1423 | 1399 | ||
| 1400 | Note that this command is effective only when Emacs | ||
| 1401 | displays through a window system, because then Emacs does its own | ||
| 1402 | cursor display. On a text-only terminal, this is not implemented." | ||
| 1403 | :init-value (not (or noninteractive | ||
| 1404 | no-blinking-cursor | ||
| 1405 | (eq system-type 'ms-dos) | ||
| 1406 | (not (memq window-system '(x w32 mac))))) | ||
| 1407 | :initialize 'custom-initialize-safe-default | ||
| 1408 | :group 'cursor | ||
| 1409 | :global t | ||
| 1410 | (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer)) | ||
| 1411 | (setq blink-cursor-idle-timer nil) | ||
| 1412 | (blink-cursor-end) | ||
| 1413 | (when blink-cursor-mode | ||
| 1414 | ;; Hide the cursor. | ||
| 1415 | ;;(internal-show-cursor nil nil) | ||
| 1416 | (setq blink-cursor-idle-timer | ||
| 1417 | (run-with-idle-timer blink-cursor-delay | ||
| 1418 | blink-cursor-delay | ||
| 1419 | 'blink-cursor-start)))) | ||
| 1420 | |||
| 1421 | (define-obsolete-variable-alias 'blink-cursor 'blink-cursor-mode "22.1") | ||
| 1424 | 1422 | ||
| 1425 | ;; Hourglass pointer | 1423 | ;; Hourglass pointer |
| 1426 | 1424 | ||
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index beccd918c3e..6927e3bfbac 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,47 @@ | |||
| 1 | 2006-08-23 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> | ||
| 2 | |||
| 3 | [ Backported bug fix from No Gnus. ] | ||
| 4 | |||
| 5 | * gnus.el (gnus-find-method-for-group): On killed/unknown groups, try | ||
| 6 | looking up the method using GROUP's prefix before inventing a new one. | ||
| 7 | It is used on killed/unknown groups in various places where returning | ||
| 8 | an all-new method isn't expected by the caller. | ||
| 9 | |||
| 10 | * gnus-util.el (gnus-group-server): Copy required macro from No Gnus. | ||
| 11 | |||
| 12 | 2006-08-13 Romain Francoise <romain@orebokech.com> | ||
| 13 | |||
| 14 | * mm-extern.el (mm-extern-mail-server): End `y-or-n-p' prompt with a | ||
| 15 | space. | ||
| 16 | |||
| 17 | 2006-08-09 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 18 | |||
| 19 | * compface.el (uncompface): Use binary rather than raw-text-unix. | ||
| 20 | |||
| 21 | 2006-08-09 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 22 | |||
| 23 | * compface.el (uncompface): Make sure the eol conversion doesn't take | ||
| 24 | place when communicating with the external programs. Reported by | ||
| 25 | ARISAWA Akihiro <ari@mbf.ocn.ne.jp>. | ||
| 26 | |||
| 27 | 2006-07-31 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 28 | |||
| 29 | * nnheader.el (nnheader-insert-head): Fix typo in comment. | ||
| 30 | |||
| 31 | 2006-07-31 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> | ||
| 32 | |||
| 33 | * nnweb.el (nnweb-google-parse-1): Update regexp for author and date. | ||
| 34 | Make it more robust by parsing author and date independently. | ||
| 35 | |||
| 36 | 2006-07-28 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 37 | |||
| 38 | * nnheader.el (nnheader-insert-head): Make it work with Mac as well. | ||
| 39 | |||
| 40 | 2006-07-27 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 41 | |||
| 42 | * nnheader.el (nnheader-insert-head): Make it work even if the file | ||
| 43 | uses CRLF for the line-break code. | ||
| 44 | |||
| 1 | 2006-07-19 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> | 45 | 2006-07-19 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> |
| 2 | 46 | ||
| 3 | * mm-url.el (mm-url-insert-file-contents): Inhibit Connection: close | 47 | * mm-url.el (mm-url-insert-file-contents): Inhibit Connection: close |
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' | |||
| 34 | or `faces-xface' and `netpbm' or `libgr-progs', for instance." | 34 | or `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/gnus-util.el b/lisp/gnus/gnus-util.el index 6b525fc490c..6f706fabce5 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el | |||
| @@ -607,6 +607,17 @@ If N, return the Nth ancestor instead." | |||
| 607 | (substring gname (match-end 0)) | 607 | (substring gname (match-end 0)) |
| 608 | gname))) | 608 | gname))) |
| 609 | 609 | ||
| 610 | (defmacro gnus-group-server (group) | ||
| 611 | "Find the server name of a foreign newsgroup. | ||
| 612 | For example, (gnus-group-server \"nnimap+yxa:INBOX.foo\") would | ||
| 613 | yield \"nnimap:yxa\"." | ||
| 614 | `(let ((gname ,group)) | ||
| 615 | (if (string-match "^\\([^:+]+\\)\\(?:\\+\\([^:]*\\)\\)?:" gname) | ||
| 616 | (format "%s:%s" (match-string 1 gname) (or | ||
| 617 | (match-string 2 gname) | ||
| 618 | "")) | ||
| 619 | (format "%s:%s" (car gnus-select-method) (cadr gnus-select-method))))) | ||
| 620 | |||
| 610 | (defun gnus-make-sort-function (funs) | 621 | (defun gnus-make-sort-function (funs) |
| 611 | "Return a composite sort condition based on the functions in FUNS." | 622 | "Return a composite sort condition based on the functions in FUNS." |
| 612 | (cond | 623 | (cond |
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 7a04c61151a..8554b1332f1 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el | |||
| @@ -4079,8 +4079,13 @@ If NEWSGROUP is nil, return the global kill file name instead." | |||
| 4079 | (or gnus-override-method | 4079 | (or gnus-override-method |
| 4080 | (and (not group) | 4080 | (and (not group) |
| 4081 | gnus-select-method) | 4081 | gnus-select-method) |
| 4082 | (and (not (gnus-group-entry group)) ;; a new group | 4082 | (and (not (gnus-group-entry group)) |
| 4083 | (gnus-group-name-to-method group)) | 4083 | ;; Killed or otherwise unknown group. |
| 4084 | (or | ||
| 4085 | ;; If we know a virtual server by that name, return its method. | ||
| 4086 | (gnus-server-to-method (gnus-group-server group)) | ||
| 4087 | ;; Guess a new method as last resort. | ||
| 4088 | (gnus-group-name-to-method group))) | ||
| 4084 | (let ((info (or info (gnus-get-info group))) | 4089 | (let ((info (or info (gnus-get-info group))) |
| 4085 | method) | 4090 | method) |
| 4086 | (if (or (not info) | 4091 | (if (or (not info) |
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 d564d42414e..82e1d3ab554 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el | |||
| @@ -586,17 +586,27 @@ the line could be found." | |||
| 586 | (if (eq nnheader-max-head-length t) | 586 | (if (eq nnheader-max-head-length t) |
| 587 | ;; Just read the entire file. | 587 | ;; Just read the entire file. |
| 588 | (nnheader-insert-file-contents file) | 588 | (nnheader-insert-file-contents file) |
| 589 | ;; Read 1K blocks until we find a separator. | 589 | ;; Read blocks of the size specified by `nnheader-head-chop-length' |
| 590 | ;; until we find a separator. | ||
| 590 | (let ((beg 0) | 591 | (let ((beg 0) |
| 591 | format-alist) | 592 | (start (point)) |
| 593 | ;; Use `binary' to prevent the contents from being decoded, | ||
| 594 | ;; or it will change the number of characters that | ||
| 595 | ;; `insert-file-contents' returns. | ||
| 596 | (coding-system-for-read 'binary)) | ||
| 592 | (while (and (eq nnheader-head-chop-length | 597 | (while (and (eq nnheader-head-chop-length |
| 593 | (nth 1 (nnheader-insert-file-contents | 598 | (nth 1 (mm-insert-file-contents |
| 594 | file nil beg | 599 | file nil beg |
| 595 | (incf beg nnheader-head-chop-length)))) | 600 | (incf beg nnheader-head-chop-length)))) |
| 596 | (prog1 (not (search-forward "\n\n" nil t)) | 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)) | ||
| 597 | (goto-char (point-max))) | 603 | (goto-char (point-max))) |
| 598 | (or (null nnheader-max-head-length) | 604 | (or (null nnheader-max-head-length) |
| 599 | (< beg nnheader-max-head-length)))))) | 605 | (< beg nnheader-max-head-length)))) |
| 606 | ;; Finally decode the contents. | ||
| 607 | (when (mm-coding-system-p nnheader-file-coding-system) | ||
| 608 | (mm-decode-coding-region start (point-max) | ||
| 609 | nnheader-file-coding-system)))) | ||
| 600 | t)) | 610 | t)) |
| 601 | 611 | ||
| 602 | (defun nnheader-article-p () | 612 | (defun nnheader-article-p () |
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) |
| 852 | follows 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/ido.el b/lisp/ido.el index be1cba62f27..2d531728b67 100644 --- a/lisp/ido.el +++ b/lisp/ido.el | |||
| @@ -1840,6 +1840,7 @@ If INITIAL is non-nil, it specifies the initial input string." | |||
| 1840 | (and d (cdr d))))))) | 1840 | (and d (cdr d))))))) |
| 1841 | (if (member ido-default-item ido-ignore-item-temp-list) | 1841 | (if (member ido-default-item ido-ignore-item-temp-list) |
| 1842 | (setq ido-default-item nil)) | 1842 | (setq ido-default-item nil)) |
| 1843 | (ido-trace "new default" ido-default-item) | ||
| 1843 | (setq ido-set-default-item nil)) | 1844 | (setq ido-set-default-item nil)) |
| 1844 | 1845 | ||
| 1845 | (if ido-process-ignore-lists-inhibit | 1846 | (if ido-process-ignore-lists-inhibit |
| @@ -3528,37 +3529,40 @@ for first matching file." | |||
| 3528 | (let* ((case-fold-search ido-case-fold) | 3529 | (let* ((case-fold-search ido-case-fold) |
| 3529 | (slash (and (not ido-enable-prefix) (ido-final-slash ido-text))) | 3530 | (slash (and (not ido-enable-prefix) (ido-final-slash ido-text))) |
| 3530 | (text (if slash (substring ido-text 0 -1) ido-text)) | 3531 | (text (if slash (substring ido-text 0 -1) ido-text)) |
| 3531 | (rexq (concat (if ido-enable-regexp text (regexp-quote text)) (if slash ".*/" ""))) | 3532 | (rex0 (if ido-enable-regexp text (regexp-quote text))) |
| 3533 | (rexq (concat rex0 (if slash ".*/" ""))) | ||
| 3532 | (re (if ido-enable-prefix (concat "\\`" rexq) rexq)) | 3534 | (re (if ido-enable-prefix (concat "\\`" rexq) rexq)) |
| 3533 | (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" re)) | 3535 | (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) |
| 3534 | (concat "\\`" re "\\'"))) | 3536 | (concat "\\`" rex0 (if slash "/" "") "\\'"))) |
| 3537 | (suffix-re (and do-full slash | ||
| 3538 | (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) | ||
| 3539 | (concat rex0 "/\\'"))) | ||
| 3535 | (prefix-re (and full-re (not ido-enable-prefix) | 3540 | (prefix-re (and full-re (not ido-enable-prefix) |
| 3536 | (concat "\\`" rexq))) | 3541 | (concat "\\`" rexq))) |
| 3537 | (non-prefix-dot (or (not ido-enable-dot-prefix) | 3542 | (non-prefix-dot (or (not ido-enable-dot-prefix) |
| 3538 | (not ido-process-ignore-lists) | 3543 | (not ido-process-ignore-lists) |
| 3539 | ido-enable-prefix | 3544 | ido-enable-prefix |
| 3540 | (= (length ido-text) 0))) | 3545 | (= (length ido-text) 0))) |
| 3541 | 3546 | full-matches suffix-matches prefix-matches matches) | |
| 3542 | full-matches | ||
| 3543 | prefix-matches | ||
| 3544 | matches) | ||
| 3545 | (setq ido-incomplete-regexp nil) | 3547 | (setq ido-incomplete-regexp nil) |
| 3546 | (condition-case error | 3548 | (condition-case error |
| 3547 | (mapcar | 3549 | (mapcar |
| 3548 | (lambda (item) | 3550 | (lambda (item) |
| 3549 | (let ((name (ido-name item))) | 3551 | (let ((name (ido-name item))) |
| 3550 | (if (and (or non-prefix-dot | 3552 | (if (and (or non-prefix-dot |
| 3551 | (if (= (aref ido-text 0) ?.) | 3553 | (if (= (aref ido-text 0) ?.) |
| 3552 | (= (aref name 0) ?.) | 3554 | (= (aref name 0) ?.) |
| 3553 | (/= (aref name 0) ?.))) | 3555 | (/= (aref name 0) ?.))) |
| 3554 | (string-match re name)) | 3556 | (string-match re name)) |
| 3555 | (cond | 3557 | (cond |
| 3556 | ((and full-re (string-match full-re name)) | 3558 | ((and full-re (string-match full-re name)) |
| 3557 | (setq full-matches (cons item full-matches))) | 3559 | (setq full-matches (cons item full-matches))) |
| 3558 | ((and prefix-re (string-match prefix-re name)) | 3560 | ((and suffix-re (string-match suffix-re name)) |
| 3559 | (setq prefix-matches (cons item prefix-matches))) | 3561 | (setq suffix-matches (cons item suffix-matches))) |
| 3560 | (t (setq matches (cons item matches)))))) | 3562 | ((and prefix-re (string-match prefix-re name)) |
| 3561 | t) | 3563 | (setq prefix-matches (cons item prefix-matches))) |
| 3564 | (t (setq matches (cons item matches)))))) | ||
| 3565 | t) | ||
| 3562 | items) | 3566 | items) |
| 3563 | (invalid-regexp | 3567 | (invalid-regexp |
| 3564 | (setq ido-incomplete-regexp t | 3568 | (setq ido-incomplete-regexp t |
| @@ -3566,10 +3570,15 @@ for first matching file." | |||
| 3566 | ;; special-case single match, and handle appropriately | 3570 | ;; special-case single match, and handle appropriately |
| 3567 | ;; elsewhere. | 3571 | ;; elsewhere. |
| 3568 | matches (cdr error)))) | 3572 | matches (cdr error)))) |
| 3569 | (if prefix-matches | 3573 | (when prefix-matches |
| 3570 | (setq matches (nconc prefix-matches matches))) | 3574 | (ido-trace "prefix match" prefix-matches) |
| 3571 | (if full-matches | 3575 | (setq matches (nconc prefix-matches matches))) |
| 3572 | (setq matches (nconc full-matches matches))) | 3576 | (when suffix-matches |
| 3577 | (ido-trace "suffix match" (list text suffix-re suffix-matches)) | ||
| 3578 | (setq matches (nconc suffix-matches matches))) | ||
| 3579 | (when full-matches | ||
| 3580 | (ido-trace "full match" (list text full-re full-matches)) | ||
| 3581 | (setq matches (nconc full-matches matches))) | ||
| 3573 | (when (and (null matches) | 3582 | (when (and (null matches) |
| 3574 | ido-enable-flex-matching | 3583 | ido-enable-flex-matching |
| 3575 | (> (length ido-text) 1) | 3584 | (> (length ido-text) 1) |
| @@ -4096,12 +4105,13 @@ For details of keybindings, do `\\[describe-function] ido-find-file'." | |||
| 4096 | try-single-dir-match | 4105 | try-single-dir-match |
| 4097 | refresh) | 4106 | refresh) |
| 4098 | 4107 | ||
| 4099 | (ido-trace "\nexhibit" this-command) | 4108 | (when ido-trace-enable |
| 4100 | (ido-trace "dir" ido-current-directory) | 4109 | (ido-trace "\nexhibit" this-command) |
| 4101 | (ido-trace "contents" contents) | 4110 | (ido-trace "dir" ido-current-directory) |
| 4102 | (ido-trace "list" ido-cur-list) | 4111 | (ido-trace "contents" contents) |
| 4103 | (ido-trace "matches" ido-matches) | 4112 | (ido-trace "list" ido-cur-list) |
| 4104 | (ido-trace "rescan" ido-rescan) | 4113 | (ido-trace "matches" ido-matches) |
| 4114 | (ido-trace "rescan" ido-rescan)) | ||
| 4105 | 4115 | ||
| 4106 | (save-excursion | 4116 | (save-excursion |
| 4107 | (goto-char (point-max)) | 4117 | (goto-char (point-max)) |
diff --git a/lisp/info.el b/lisp/info.el index 87327d8656b..dc08557e28d 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -3805,6 +3805,8 @@ the variable `Info-file-list-for-emacs'." | |||
| 3805 | (setq other-tag | 3805 | (setq other-tag |
| 3806 | (cond ((save-match-data (looking-back "\\<see")) | 3806 | (cond ((save-match-data (looking-back "\\<see")) |
| 3807 | "") | 3807 | "") |
| 3808 | ((save-match-data (looking-back "\\<in")) | ||
| 3809 | "") | ||
| 3808 | ((memq (char-before) '(nil ?\. ?! ??)) | 3810 | ((memq (char-before) '(nil ?\. ?! ??)) |
| 3809 | "See ") | 3811 | "See ") |
| 3810 | ((save-match-data | 3812 | ((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 0a2e5a7c325..57b77249ba8 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el | |||
| @@ -1039,18 +1039,28 @@ but still contains full information about each coding system." | |||
| 1039 | 1039 | ||
| 1040 | ;;;###autoload | 1040 | ;;;###autoload |
| 1041 | (defun describe-font (fontname) | 1041 | (defun describe-font (fontname) |
| 1042 | "Display information about fonts which partially match FONTNAME." | 1042 | "Display information about a font whose name is FONTNAME. |
| 1043 | (interactive "sFontname (default current choice for ASCII chars): ") | 1043 | The font must be already used by Emacs." |
| 1044 | (interactive "sFont name (default current choice for ASCII chars): ") | ||
| 1044 | (or (and window-system (fboundp 'fontset-list)) | 1045 | (or (and window-system (fboundp 'fontset-list)) |
| 1045 | (error "No fontsets being used")) | 1046 | (error "No fonts being used")) |
| 1046 | (when (or (not fontname) (= (length fontname) 0)) | 1047 | (let (fontset font-info) |
| 1047 | (setq fontname (cdr (assq 'font (frame-parameters)))) | 1048 | (when (or (not fontname) (= (length fontname) 0)) |
| 1048 | (if (query-fontset fontname) | 1049 | (setq fontname (frame-parameter nil 'font)) |
| 1049 | (setq fontname | 1050 | ;; Check if FONTNAME is a fontset. |
| 1050 | (nth 1 (assq 'ascii (aref (fontset-info fontname) 2)))))) | 1051 | (if (query-fontset fontname) |
| 1051 | (let ((font-info (font-info fontname))) | 1052 | (setq fontset fontname |
| 1053 | fontname (nth 1 (assq 'ascii | ||
| 1054 | (aref (fontset-info fontname) 2)))))) | ||
| 1055 | (setq font-info (font-info fontname)) | ||
| 1052 | (if (null font-info) | 1056 | (if (null font-info) |
| 1053 | (message "No matching font") | 1057 | (if fontset |
| 1058 | ;; The font should be surely used. So, there's some | ||
| 1059 | ;; problem about getting information about it. It is | ||
| 1060 | ;; better to print the fontname to show which font has | ||
| 1061 | ;; this problem. | ||
| 1062 | (message "No information about \"%s\"" fontname) | ||
| 1063 | (message "No matching font being used")) | ||
| 1054 | (with-output-to-temp-buffer "*Help*" | 1064 | (with-output-to-temp-buffer "*Help*" |
| 1055 | (describe-font-internal font-info 'verbose))))) | 1065 | (describe-font-internal font-info 'verbose))))) |
| 1056 | 1066 | ||
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el index 0e131b665ef..89959ad8525 100644 --- a/lisp/jit-lock.el +++ b/lisp/jit-lock.el | |||
| @@ -31,6 +31,8 @@ | |||
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | (eval-when-compile | 33 | (eval-when-compile |
| 34 | (require 'cl) | ||
| 35 | |||
| 34 | (defmacro with-buffer-unmodified (&rest body) | 36 | (defmacro with-buffer-unmodified (&rest body) |
| 35 | "Eval BODY, preserving the current buffer's modified state." | 37 | "Eval BODY, preserving the current buffer's modified state." |
| 36 | (declare (debug t)) | 38 | (declare (debug t)) |
| @@ -169,6 +171,8 @@ If nil, contextual fontification is disabled.") | |||
| 169 | 171 | ||
| 170 | (defvar jit-lock-stealth-timer nil | 172 | (defvar jit-lock-stealth-timer nil |
| 171 | "Timer for stealth fontification in Just-in-time Lock mode.") | 173 | "Timer for stealth fontification in Just-in-time Lock mode.") |
| 174 | (defvar jit-lock-stealth-repeat-timer nil | ||
| 175 | "Timer for repeated stealth fontification in Just-in-time Lock mode.") | ||
| 172 | (defvar jit-lock-context-timer nil | 176 | (defvar jit-lock-context-timer nil |
| 173 | "Timer for context fontification in Just-in-time Lock mode.") | 177 | "Timer for context fontification in Just-in-time Lock mode.") |
| 174 | (defvar jit-lock-defer-timer nil | 178 | (defvar jit-lock-defer-timer nil |
| @@ -176,6 +180,8 @@ If nil, contextual fontification is disabled.") | |||
| 176 | 180 | ||
| 177 | (defvar jit-lock-defer-buffers nil | 181 | (defvar jit-lock-defer-buffers nil |
| 178 | "List of buffers with pending deferred fontification.") | 182 | "List of buffers with pending deferred fontification.") |
| 183 | (defvar jit-lock-stealth-buffers nil | ||
| 184 | "List of buffers that are being fontified stealthily.") | ||
| 179 | 185 | ||
| 180 | ;;; JIT lock mode | 186 | ;;; JIT lock mode |
| 181 | 187 | ||
| @@ -223,6 +229,13 @@ the variable `jit-lock-stealth-nice'." | |||
| 223 | (run-with-idle-timer jit-lock-stealth-time t | 229 | (run-with-idle-timer jit-lock-stealth-time t |
| 224 | 'jit-lock-stealth-fontify))) | 230 | 'jit-lock-stealth-fontify))) |
| 225 | 231 | ||
| 232 | ;; Create, but do not activate, the idle timer for repeated | ||
| 233 | ;; stealth fontification. | ||
| 234 | (when (and jit-lock-stealth-time (null jit-lock-stealth-repeat-timer)) | ||
| 235 | (setq jit-lock-stealth-repeat-timer (timer-create)) | ||
| 236 | (timer-set-function jit-lock-stealth-repeat-timer | ||
| 237 | 'jit-lock-stealth-fontify '(t))) | ||
| 238 | |||
| 226 | ;; Init deferred fontification timer. | 239 | ;; Init deferred fontification timer. |
| 227 | (when (and jit-lock-defer-time (null jit-lock-defer-timer)) | 240 | (when (and jit-lock-defer-time (null jit-lock-defer-timer)) |
| 228 | (setq jit-lock-defer-timer | 241 | (setq jit-lock-defer-timer |
| @@ -331,7 +344,7 @@ Defaults to the whole buffer. END can be out of bounds." | |||
| 331 | ;; from the end of a buffer to its start, can do repeated | 344 | ;; from the end of a buffer to its start, can do repeated |
| 332 | ;; `parse-partial-sexp' starting from `point-min', which can | 345 | ;; `parse-partial-sexp' starting from `point-min', which can |
| 333 | ;; take a long time in a large buffer. | 346 | ;; take a long time in a large buffer. |
| 334 | (let (next) | 347 | (let ((orig-start start) next) |
| 335 | (save-match-data | 348 | (save-match-data |
| 336 | ;; Fontify chunks beginning at START. The end of a | 349 | ;; Fontify chunks beginning at START. The end of a |
| 337 | ;; chunk is either `end', or the start of a region | 350 | ;; chunk is either `end', or the start of a region |
| @@ -374,6 +387,26 @@ Defaults to the whole buffer. END can be out of bounds." | |||
| 374 | (quit (put-text-property start next 'fontified nil) | 387 | (quit (put-text-property start next 'fontified nil) |
| 375 | (funcall 'signal (car err) (cdr err)))) | 388 | (funcall 'signal (car err) (cdr err)))) |
| 376 | 389 | ||
| 390 | ;; The redisplay engine has already rendered the buffer up-to | ||
| 391 | ;; `orig-start' and won't notice if the above jit-lock-functions | ||
| 392 | ;; changed the appearance of any part of the buffer prior | ||
| 393 | ;; to that. So if `start' is before `orig-start', we need to | ||
| 394 | ;; cause a new redisplay cycle after this one so that any changes | ||
| 395 | ;; are properly reflected on screen. | ||
| 396 | ;; To make such repeated redisplay happen less often, we can | ||
| 397 | ;; eagerly extend the refontified region with | ||
| 398 | ;; jit-lock-after-change-extend-region-functions. | ||
| 399 | (when (< start orig-start) | ||
| 400 | (lexical-let ((start start) | ||
| 401 | (orig-start orig-start) | ||
| 402 | (buf (current-buffer))) | ||
| 403 | (run-with-timer | ||
| 404 | 0 nil (lambda () | ||
| 405 | (with-current-buffer buf | ||
| 406 | (with-buffer-prepared-for-jit-lock | ||
| 407 | (put-text-property start orig-start | ||
| 408 | 'fontified t))))))) | ||
| 409 | |||
| 377 | ;; Find the start of the next chunk, if any. | 410 | ;; Find the start of the next chunk, if any. |
| 378 | (setq start (text-property-any next end 'fontified nil)))))))) | 411 | (setq start (text-property-any next end 'fontified nil)))))))) |
| 379 | 412 | ||
| @@ -421,71 +454,55 @@ Value is nil if there is nothing more to fontify." | |||
| 421 | (t next)))) | 454 | (t next)))) |
| 422 | result)))) | 455 | result)))) |
| 423 | 456 | ||
| 424 | 457 | (defun jit-lock-stealth-fontify (&optional repeat) | |
| 425 | (defun jit-lock-stealth-fontify () | ||
| 426 | "Fontify buffers stealthily. | 458 | "Fontify buffers stealthily. |
| 427 | This functions is called after Emacs has been idle for | 459 | This function is called repeatedly after Emacs has become idle for |
| 428 | `jit-lock-stealth-time' seconds." | 460 | `jit-lock-stealth-time' seconds. Optional argument REPEAT is expected |
| 429 | ;; I used to check `inhibit-read-only' here, but I can't remember why. -stef | 461 | non-nil in a repeated invocation of this function." |
| 462 | ;; Cancel timer for repeated invocations. | ||
| 463 | (unless repeat | ||
| 464 | (cancel-timer jit-lock-stealth-repeat-timer)) | ||
| 430 | (unless (or executing-kbd-macro | 465 | (unless (or executing-kbd-macro |
| 431 | memory-full | 466 | memory-full |
| 432 | (window-minibuffer-p (selected-window))) | 467 | (window-minibuffer-p (selected-window)) |
| 433 | (let ((buffers (buffer-list)) | 468 | ;; For first invocation set up `jit-lock-stealth-buffers'. |
| 434 | (outer-buffer (current-buffer)) | 469 | ;; In repeated invocations it's already been set up. |
| 470 | (null (if repeat | ||
| 471 | jit-lock-stealth-buffers | ||
| 472 | (setq jit-lock-stealth-buffers (buffer-list))))) | ||
| 473 | (let ((buffer (car jit-lock-stealth-buffers)) | ||
| 474 | (delay 0) | ||
| 435 | minibuffer-auto-raise | 475 | minibuffer-auto-raise |
| 436 | message-log-max) | 476 | message-log-max |
| 437 | (with-local-quit | 477 | start) |
| 438 | (while (and buffers (not (input-pending-p))) | 478 | (if (and jit-lock-stealth-load |
| 439 | (with-current-buffer (pop buffers) | 479 | (> (car (load-average)) jit-lock-stealth-load)) |
| 440 | (when jit-lock-mode | 480 | ;; Wait a little if load is too high. |
| 441 | ;; This is funny. Calling sit-for with 3rd arg non-nil | 481 | (setq delay jit-lock-stealth-time) |
| 442 | ;; so that it doesn't redisplay, internally calls | 482 | (if (buffer-live-p buffer) |
| 443 | ;; wait_reading_process_input also with a parameter | 483 | (with-current-buffer buffer |
| 444 | ;; saying "don't redisplay." Since this function here | 484 | (if (and jit-lock-mode |
| 445 | ;; is called periodically, this effectively leads to | 485 | (setq start (jit-lock-stealth-chunk-start (point)))) |
| 446 | ;; process output not being redisplayed at all because | 486 | ;; Fontify one block of at most `jit-lock-chunk-size' |
| 447 | ;; redisplay_internal is never called. (That didn't | 487 | ;; characters. |
| 448 | ;; work in the old redisplay either.) So, we learn that | 488 | (with-temp-message (if jit-lock-stealth-verbose |
| 449 | ;; we mustn't call sit-for that way here. But then, we | 489 | (concat "JIT stealth lock " |
| 450 | ;; have to be cautious not to call sit-for in a widened | 490 | (buffer-name))) |
| 451 | ;; buffer, since this could display hidden parts of that | 491 | (jit-lock-fontify-now start |
| 452 | ;; buffer. This explains the seemingly weird use of | 492 | (+ start jit-lock-chunk-size)) |
| 453 | ;; save-restriction/widen here. | 493 | ;; Run again after `jit-lock-stealth-nice' seconds. |
| 454 | 494 | (setq delay (or jit-lock-stealth-nice 0))) | |
| 455 | (with-temp-message (if jit-lock-stealth-verbose | 495 | ;; Nothing to fontify here. Remove this buffer from |
| 456 | (concat "JIT stealth lock " | 496 | ;; `jit-lock-stealth-buffers' and run again immediately. |
| 457 | (buffer-name))) | 497 | (setq jit-lock-stealth-buffers (cdr jit-lock-stealth-buffers)))) |
| 458 | 498 | ;; Buffer is no longer live. Remove it from | |
| 459 | ;; In the following code, the `sit-for' calls cause a | 499 | ;; `jit-lock-stealth-buffers' and run again immediately. |
| 460 | ;; redisplay, so it's required that the | 500 | (setq jit-lock-stealth-buffers (cdr jit-lock-stealth-buffers)))) |
| 461 | ;; buffer-modified flag of a buffer that is displayed | 501 | ;; Call us again. |
| 462 | ;; has the right value---otherwise the mode line of | 502 | (when jit-lock-stealth-buffers |
| 463 | ;; an unmodified buffer would show a `*'. | 503 | (timer-set-idle-time jit-lock-stealth-repeat-timer (current-idle-time)) |
| 464 | (let (start | 504 | (timer-inc-time jit-lock-stealth-repeat-timer delay) |
| 465 | (nice (or jit-lock-stealth-nice 0)) | 505 | (timer-activate-when-idle jit-lock-stealth-repeat-timer t))))) |
| 466 | (point (point-min))) | ||
| 467 | (while (and (setq start | ||
| 468 | (jit-lock-stealth-chunk-start point)) | ||
| 469 | ;; In case sit-for runs any timers, | ||
| 470 | ;; give them the expected current buffer. | ||
| 471 | (with-current-buffer outer-buffer | ||
| 472 | (sit-for nice))) | ||
| 473 | |||
| 474 | ;; fontify a block. | ||
| 475 | (jit-lock-fontify-now start (+ start jit-lock-chunk-size)) | ||
| 476 | ;; If stealth jit-locking is done backwards, this leads to | ||
| 477 | ;; excessive O(n^2) refontification. -stef | ||
| 478 | ;; (when (>= jit-lock-context-unfontify-pos start) | ||
| 479 | ;; (setq jit-lock-context-unfontify-pos end)) | ||
| 480 | |||
| 481 | ;; Wait a little if load is too high. | ||
| 482 | (when (and jit-lock-stealth-load | ||
| 483 | (> (car (load-average)) jit-lock-stealth-load)) | ||
| 484 | ;; In case sit-for runs any timers, | ||
| 485 | ;; give them the expected current buffer. | ||
| 486 | (with-current-buffer outer-buffer | ||
| 487 | (sit-for (or jit-lock-stealth-time 30)))))))))))))) | ||
| 488 | |||
| 489 | 506 | ||
| 490 | 507 | ||
| 491 | ;;; Deferred fontification. | 508 | ;;; Deferred fontification. |
| @@ -548,6 +565,19 @@ This functions is called after Emacs has been idle for | |||
| 548 | '(fontified nil jit-lock-defer-multiline nil))) | 565 | '(fontified nil jit-lock-defer-multiline nil))) |
| 549 | (setq jit-lock-context-unfontify-pos (point-max))))))))) | 566 | (setq jit-lock-context-unfontify-pos (point-max))))))))) |
| 550 | 567 | ||
| 568 | (defvar jit-lock-start) (defvar jit-lock-end) ; Dynamically scoped variables. | ||
| 569 | (defvar jit-lock-after-change-extend-region-functions nil | ||
| 570 | "Hook that can extend the text to refontify after a change. | ||
| 571 | This is run after every buffer change. The functions are called with | ||
| 572 | the three arguments of `after-change-functions': START END OLD-LEN. | ||
| 573 | The extended region to refontify is returned indirectly by modifying | ||
| 574 | the variables `jit-lock-start' and `jit-lock-end'. | ||
| 575 | |||
| 576 | Note that extending the region this way is not strictly necessary, except | ||
| 577 | that the nature of the redisplay code tends to otherwise leave some of | ||
| 578 | the rehighlighted text displayed with the old highlight until the next | ||
| 579 | redisplay (see comment about repeated redisplay in `jit-lock-fontify-now').") | ||
| 580 | |||
| 551 | (defun jit-lock-after-change (start end old-len) | 581 | (defun jit-lock-after-change (start end old-len) |
| 552 | "Mark the rest of the buffer as not fontified after a change. | 582 | "Mark the rest of the buffer as not fontified after a change. |
| 553 | Installed on `after-change-functions'. | 583 | Installed on `after-change-functions'. |
| @@ -557,44 +587,24 @@ This function ensures that lines following the change will be refontified | |||
| 557 | in case the syntax of those lines has changed. Refontification | 587 | in case the syntax of those lines has changed. Refontification |
| 558 | will take place when text is fontified stealthily." | 588 | will take place when text is fontified stealthily." |
| 559 | (when (and jit-lock-mode (not memory-full)) | 589 | (when (and jit-lock-mode (not memory-full)) |
| 560 | (let ((region (font-lock-extend-region start end old-len))) | 590 | (let ((jit-lock-start start) |
| 561 | (save-excursion | 591 | (jit-lock-end end)) |
| 562 | (with-buffer-prepared-for-jit-lock | 592 | (with-buffer-prepared-for-jit-lock |
| 563 | ;; It's important that the `fontified' property be set from the | 593 | (run-hook-with-args 'jit-lock-after-change-extend-region-functions |
| 564 | ;; beginning of the line, else font-lock will properly change the | 594 | start end old-len) |
| 565 | ;; text's face, but the display will have been done already and will | 595 | ;; Make sure we change at least one char (in case of deletions). |
| 566 | ;; be inconsistent with the buffer's content. | 596 | (setq jit-lock-end (min (max jit-lock-end (1+ start)) (point-max))) |
| 567 | ;; | 597 | ;; Request refontification. |
| 568 | ;; FIXME!!! (Alan Mackenzie, 2006-03-14): If start isn't at a BOL, | 598 | (put-text-property jit-lock-start jit-lock-end 'fontified nil)) |
| 569 | ;; expanding the region to BOL might mis-fontify, should the BOL not | 599 | ;; Mark the change for deferred contextual refontification. |
| 570 | ;; be at a "safe" position. | 600 | (when jit-lock-context-unfontify-pos |
| 571 | (setq start (if region | 601 | (setq jit-lock-context-unfontify-pos |
| 572 | (car region) | 602 | ;; Here we use `start' because nothing guarantees that the |
| 573 | (goto-char start) | 603 | ;; text between start and end will be otherwise refontified: |
| 574 | (line-beginning-position))) | 604 | ;; usually it will be refontified by virtue of being |
| 575 | 605 | ;; displayed, but if it's outside of any displayed area in the | |
| 576 | ;; If we're in text that matches a multi-line font-lock pattern, | 606 | ;; buffer, only jit-lock-context-* will re-fontify it. |
| 577 | ;; make sure the whole text will be redisplayed. | 607 | (min jit-lock-context-unfontify-pos jit-lock-start)))))) |
| 578 | ;; I'm not sure this is ever necessary and/or sufficient. -stef | ||
| 579 | (when (get-text-property start 'font-lock-multiline) | ||
| 580 | (setq start (or (previous-single-property-change | ||
| 581 | start 'font-lock-multiline) | ||
| 582 | (point-min)))) | ||
| 583 | |||
| 584 | (if region (setq end (cdr region))) | ||
| 585 | ;; Make sure we change at least one char (in case of deletions). | ||
| 586 | (setq end (min (max end (1+ start)) (point-max))) | ||
| 587 | ;; Request refontification. | ||
| 588 | (put-text-property start end 'fontified nil)) | ||
| 589 | ;; Mark the change for deferred contextual refontification. | ||
| 590 | (when jit-lock-context-unfontify-pos | ||
| 591 | (setq jit-lock-context-unfontify-pos | ||
| 592 | ;; Here we use `start' because nothing guarantees that the | ||
| 593 | ;; text between start and end will be otherwise refontified: | ||
| 594 | ;; usually it will be refontified by virtue of being | ||
| 595 | ;; displayed, but if it's outside of any displayed area in the | ||
| 596 | ;; buffer, only jit-lock-context-* will re-fontify it. | ||
| 597 | (min jit-lock-context-unfontify-pos start))))))) | ||
| 598 | 608 | ||
| 599 | (provide 'jit-lock) | 609 | (provide 'jit-lock) |
| 600 | 610 | ||
diff --git a/lisp/kmacro.el b/lisp/kmacro.el index d3db76fcc8a..2d1f5f33847 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el | |||
| @@ -409,7 +409,7 @@ Optional arg EMPTY is message to print if no macros are defined." | |||
| 409 | 409 | ||
| 410 | 410 | ||
| 411 | (defun kmacro-repeat-on-last-key (keys) | 411 | (defun kmacro-repeat-on-last-key (keys) |
| 412 | "Process kmacro commands keys immidiately after cycling the ring." | 412 | "Process kmacro commands keys immediately after cycling the ring." |
| 413 | (setq keys (vconcat keys)) | 413 | (setq keys (vconcat keys)) |
| 414 | (let ((n (1- (length keys))) | 414 | (let ((n (1- (length keys))) |
| 415 | cmd done repeat) | 415 | cmd done repeat) |
diff --git a/lisp/loadhist.el b/lisp/loadhist.el index 635059f93e5..61f15c8ef1c 100644 --- a/lisp/loadhist.el +++ b/lisp/loadhist.el | |||
| @@ -222,8 +222,8 @@ such as redefining an Emacs function." | |||
| 222 | (if aload | 222 | (if aload |
| 223 | (fset fun (cons 'autoload aload)) | 223 | (fset fun (cons 'autoload aload)) |
| 224 | (fmakunbound fun)))))) | 224 | (fmakunbound fun)))))) |
| 225 | (require nil) | 225 | ((t require) nil) |
| 226 | (t (message "Unexpected element %s in load-history" x))) | 226 | (t (message "Unexpected element %s in load-history" x))) |
| 227 | ;; Kill local values as much as possible. | 227 | ;; Kill local values as much as possible. |
| 228 | (dolist (buf (buffer-list)) | 228 | (dolist (buf (buffer-list)) |
| 229 | (with-current-buffer buf | 229 | (with-current-buffer buf |
diff --git a/lisp/longlines.el b/lisp/longlines.el index 9da3de217ab..77e0b415344 100644 --- a/lisp/longlines.el +++ b/lisp/longlines.el | |||
| @@ -44,7 +44,7 @@ | |||
| 44 | :group 'fill) | 44 | :group 'fill) |
| 45 | 45 | ||
| 46 | (defcustom longlines-auto-wrap t | 46 | (defcustom longlines-auto-wrap t |
| 47 | "*Non-nil means long lines are automatically wrapped after each command. | 47 | "Non-nil means long lines are automatically wrapped after each command. |
| 48 | Otherwise, you can perform filling using `fill-paragraph' or | 48 | Otherwise, you can perform filling using `fill-paragraph' or |
| 49 | `auto-fill-mode'. In any case, the soft newlines will be removed | 49 | `auto-fill-mode'. In any case, the soft newlines will be removed |
| 50 | when the file is saved to disk." | 50 | when the file is saved to disk." |
| @@ -52,7 +52,7 @@ when the file is saved to disk." | |||
| 52 | :type 'boolean) | 52 | :type 'boolean) |
| 53 | 53 | ||
| 54 | (defcustom longlines-wrap-follows-window-size nil | 54 | (defcustom longlines-wrap-follows-window-size nil |
| 55 | "*Non-nil means wrapping and filling happen at the edge of the window. | 55 | "Non-nil means wrapping and filling happen at the edge of the window. |
| 56 | Otherwise, `fill-column' is used, regardless of the window size. This | 56 | Otherwise, `fill-column' is used, regardless of the window size. This |
| 57 | does not work well when the buffer is displayed in multiple windows | 57 | does not work well when the buffer is displayed in multiple windows |
| 58 | with differing widths." | 58 | with differing widths." |
| @@ -60,7 +60,7 @@ with differing widths." | |||
| 60 | :type 'boolean) | 60 | :type 'boolean) |
| 61 | 61 | ||
| 62 | (defcustom longlines-show-hard-newlines nil | 62 | (defcustom longlines-show-hard-newlines nil |
| 63 | "*Non-nil means each hard newline is marked on the screen. | 63 | "Non-nil means each hard newline is marked on the screen. |
| 64 | \(The variable `longlines-show-effect' controls what they look like.) | 64 | \(The variable `longlines-show-effect' controls what they look like.) |
| 65 | You can also enable the display temporarily, using the command | 65 | You can also enable the display temporarily, using the command |
| 66 | `longlines-show-hard-newlines'" | 66 | `longlines-show-hard-newlines'" |
| @@ -68,7 +68,7 @@ You can also enable the display temporarily, using the command | |||
| 68 | :type 'boolean) | 68 | :type 'boolean) |
| 69 | 69 | ||
| 70 | (defcustom longlines-show-effect (propertize "|\n" 'face 'escape-glyph) | 70 | (defcustom longlines-show-effect (propertize "|\n" 'face 'escape-glyph) |
| 71 | "*A string to display when showing hard newlines. | 71 | "A string to display when showing hard newlines. |
| 72 | This is used when `longlines-show-hard-newlines' is on." | 72 | This is used when `longlines-show-hard-newlines' is on." |
| 73 | :group 'longlines | 73 | :group 'longlines |
| 74 | :type 'string) | 74 | :type 'string) |
| @@ -202,7 +202,8 @@ With optional argument ARG, make the hard newlines invisible again." | |||
| 202 | "Make hard newlines between BEG and END visible." | 202 | "Make hard newlines between BEG and END visible." |
| 203 | (let* ((pmin (min beg end)) | 203 | (let* ((pmin (min beg end)) |
| 204 | (pmax (max beg end)) | 204 | (pmax (max beg end)) |
| 205 | (pos (text-property-not-all pmin pmax 'hard nil))) | 205 | (pos (text-property-not-all pmin pmax 'hard nil)) |
| 206 | (inhibit-read-only t)) | ||
| 206 | (while pos | 207 | (while pos |
| 207 | (put-text-property pos (1+ pos) 'display | 208 | (put-text-property pos (1+ pos) 'display |
| 208 | (copy-sequence longlines-show-effect)) | 209 | (copy-sequence longlines-show-effect)) |
diff --git a/lisp/mouse.el b/lisp/mouse.el index 043c78578db..4e11b1d4c96 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -2398,6 +2398,8 @@ and selects that window." | |||
| 2398 | (global-set-key [right-fringe mouse-1] 'mouse-set-point) | 2398 | (global-set-key [right-fringe mouse-1] 'mouse-set-point) |
| 2399 | 2399 | ||
| 2400 | (global-set-key [mouse-2] 'mouse-yank-at-click) | 2400 | (global-set-key [mouse-2] 'mouse-yank-at-click) |
| 2401 | ;; Allow yanking also when the corresponding cursor is "in the fringe". | ||
| 2402 | (global-set-key [right-fringe mouse-2] [mouse-2]) | ||
| 2401 | (global-set-key [mouse-3] 'mouse-save-then-kill) | 2403 | (global-set-key [mouse-3] 'mouse-save-then-kill) |
| 2402 | 2404 | ||
| 2403 | ;; By binding these to down-going events, we let the user use the up-going | 2405 | ;; By binding these to down-going events, we let the user use the up-going |
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 1f051ffa9f2..c34ac7dcf78 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el | |||
| @@ -40,6 +40,8 @@ | |||
| 40 | ;; Open a new irc connection with: | 40 | ;; Open a new irc connection with: |
| 41 | ;; M-x irc RET | 41 | ;; M-x irc RET |
| 42 | 42 | ||
| 43 | ;;; Todo: | ||
| 44 | |||
| 43 | ;;; Code: | 45 | ;;; Code: |
| 44 | 46 | ||
| 45 | (require 'ring) | 47 | (require 'ring) |
| @@ -140,6 +142,10 @@ number. If zero or nil, no truncating is done." | |||
| 140 | (integer :tag "Number of lines")) | 142 | (integer :tag "Number of lines")) |
| 141 | :group 'rcirc) | 143 | :group 'rcirc) |
| 142 | 144 | ||
| 145 | (defcustom rcirc-show-maximum-output t | ||
| 146 | "*If non-nil, scroll buffer to keep the point at the bottom of | ||
| 147 | the window.") | ||
| 148 | |||
| 143 | (defcustom rcirc-authinfo nil | 149 | (defcustom rcirc-authinfo nil |
| 144 | "List of authentication passwords. | 150 | "List of authentication passwords. |
| 145 | Each element of the list is a list with a SERVER-REGEXP string | 151 | Each element of the list is a list with a SERVER-REGEXP string |
| @@ -297,6 +303,7 @@ and the cdr part is used for encoding." | |||
| 297 | 303 | ||
| 298 | (defvar rcirc-urls nil | 304 | (defvar rcirc-urls nil |
| 299 | "List of urls seen in the current buffer.") | 305 | "List of urls seen in the current buffer.") |
| 306 | (put 'rcirc-urls 'permanent-local t) | ||
| 300 | 307 | ||
| 301 | (defvar rcirc-keepalive-seconds 60 | 308 | (defvar rcirc-keepalive-seconds 60 |
| 302 | "Number of seconds between keepalive pings. | 309 | "Number of seconds between keepalive pings. |
| @@ -539,7 +546,10 @@ Function is called with PROCESS, COMMAND, SENDER, ARGS and LINE.") | |||
| 539 | (defun rcirc-buffer-process (&optional buffer) | 546 | (defun rcirc-buffer-process (&optional buffer) |
| 540 | "Return the process associated with channel BUFFER. | 547 | "Return the process associated with channel BUFFER. |
| 541 | With no argument or nil as argument, use the current buffer." | 548 | With no argument or nil as argument, use the current buffer." |
| 542 | (get-buffer-process (or buffer rcirc-server-buffer))) | 549 | (get-buffer-process (if buffer |
| 550 | (with-current-buffer buffer | ||
| 551 | rcirc-server-buffer) | ||
| 552 | rcirc-server-buffer))) | ||
| 543 | 553 | ||
| 544 | (defun rcirc-server-name (process) | 554 | (defun rcirc-server-name (process) |
| 545 | "Return PROCESS server name, given by the 001 response." | 555 | "Return PROCESS server name, given by the 001 response." |
| @@ -601,10 +611,11 @@ If NOTICEP is non-nil, send a notice instead of privmsg." | |||
| 601 | 611 | ||
| 602 | (defvar rcirc-nick-completions nil) | 612 | (defvar rcirc-nick-completions nil) |
| 603 | (defvar rcirc-nick-completion-start-offset nil) | 613 | (defvar rcirc-nick-completion-start-offset nil) |
| 614 | |||
| 604 | (defun rcirc-complete-nick () | 615 | (defun rcirc-complete-nick () |
| 605 | "Cycle through nick completions from list of nicks in channel." | 616 | "Cycle through nick completions from list of nicks in channel." |
| 606 | (interactive) | 617 | (interactive) |
| 607 | (if (eq last-command 'rcirc-complete-nick) | 618 | (if (eq last-command this-command) |
| 608 | (setq rcirc-nick-completions | 619 | (setq rcirc-nick-completions |
| 609 | (append (cdr rcirc-nick-completions) | 620 | (append (cdr rcirc-nick-completions) |
| 610 | (list (car rcirc-nick-completions)))) | 621 | (list (car rcirc-nick-completions)))) |
| @@ -626,9 +637,10 @@ If NOTICEP is non-nil, send a notice instead of privmsg." | |||
| 626 | rcirc-target)))))) | 637 | rcirc-target)))))) |
| 627 | (let ((completion (car rcirc-nick-completions))) | 638 | (let ((completion (car rcirc-nick-completions))) |
| 628 | (when completion | 639 | (when completion |
| 640 | (rcirc-put-nick-channel (rcirc-buffer-process) completion rcirc-target) | ||
| 629 | (delete-region (+ rcirc-prompt-end-marker | 641 | (delete-region (+ rcirc-prompt-end-marker |
| 630 | rcirc-nick-completion-start-offset) | 642 | rcirc-nick-completion-start-offset) |
| 631 | (point)) | 643 | (point)) |
| 632 | (insert (concat completion | 644 | (insert (concat completion |
| 633 | (if (= (+ rcirc-prompt-end-marker | 645 | (if (= (+ rcirc-prompt-end-marker |
| 634 | rcirc-nick-completion-start-offset) | 646 | rcirc-nick-completion-start-offset) |
| @@ -709,7 +721,6 @@ If NOTICEP is non-nil, send a notice instead of privmsg." | |||
| 709 | (make-local-variable 'rcirc-short-buffer-name) | 721 | (make-local-variable 'rcirc-short-buffer-name) |
| 710 | (setq rcirc-short-buffer-name nil) | 722 | (setq rcirc-short-buffer-name nil) |
| 711 | (make-local-variable 'rcirc-urls) | 723 | (make-local-variable 'rcirc-urls) |
| 712 | (setq rcirc-urls nil) | ||
| 713 | (setq use-hard-newlines t) | 724 | (setq use-hard-newlines t) |
| 714 | 725 | ||
| 715 | (make-local-variable 'rcirc-decode-coding-system) | 726 | (make-local-variable 'rcirc-decode-coding-system) |
| @@ -742,6 +753,9 @@ If NOTICEP is non-nil, send a notice instead of privmsg." | |||
| 742 | (make-local-variable 'kill-buffer-hook) | 753 | (make-local-variable 'kill-buffer-hook) |
| 743 | (add-hook 'kill-buffer-hook 'rcirc-kill-buffer-hook) | 754 | (add-hook 'kill-buffer-hook 'rcirc-kill-buffer-hook) |
| 744 | 755 | ||
| 756 | (make-local-variable 'window-scroll-functions) | ||
| 757 | (add-hook 'window-scroll-functions 'rcirc-scroll-to-bottom) | ||
| 758 | |||
| 745 | ;; add to buffer list, and update buffer abbrevs | 759 | ;; add to buffer list, and update buffer abbrevs |
| 746 | (when target ; skip server buffer | 760 | (when target ; skip server buffer |
| 747 | (let ((buffer (current-buffer))) | 761 | (let ((buffer (current-buffer))) |
| @@ -1144,6 +1158,15 @@ is found by looking up RESPONSE in `rcirc-response-formats'." | |||
| 1144 | (make-variable-buffer-local 'rcirc-last-sender) | 1158 | (make-variable-buffer-local 'rcirc-last-sender) |
| 1145 | (defvar rcirc-gray-toggle nil) | 1159 | (defvar rcirc-gray-toggle nil) |
| 1146 | (make-variable-buffer-local 'rcirc-gray-toggle) | 1160 | (make-variable-buffer-local 'rcirc-gray-toggle) |
| 1161 | |||
| 1162 | (defun rcirc-scroll-to-bottom (window display-start) | ||
| 1163 | "Scroll window to show maximum output if `rcirc-show-maximum-output' is | ||
| 1164 | non-nil." | ||
| 1165 | (when rcirc-show-maximum-output | ||
| 1166 | (with-selected-window window | ||
| 1167 | (when (>= (window-point) rcirc-prompt-end-marker) | ||
| 1168 | (recenter -1))))) | ||
| 1169 | |||
| 1147 | (defun rcirc-print (process sender response target text &optional activity) | 1170 | (defun rcirc-print (process sender response target text &optional activity) |
| 1148 | "Print TEXT in the buffer associated with TARGET. | 1171 | "Print TEXT in the buffer associated with TARGET. |
| 1149 | Format based on SENDER and RESPONSE. If ACTIVITY is non-nil, | 1172 | Format based on SENDER and RESPONSE. If ACTIVITY is non-nil, |
| @@ -1240,16 +1263,19 @@ record activity." | |||
| 1240 | ;; record modeline activity | 1263 | ;; record modeline activity |
| 1241 | (when activity | 1264 | (when activity |
| 1242 | (let ((nick-match | 1265 | (let ((nick-match |
| 1243 | (string-match (concat "\\b" | 1266 | (with-syntax-table rcirc-nick-syntax-table |
| 1244 | (regexp-quote (rcirc-nick process)) | 1267 | (string-match (concat "\\b" |
| 1245 | "\\b") | 1268 | (regexp-quote (rcirc-nick process)) |
| 1246 | text))) | 1269 | "\\b") |
| 1270 | text)))) | ||
| 1247 | (when (if rcirc-ignore-buffer-activity-flag | 1271 | (when (if rcirc-ignore-buffer-activity-flag |
| 1248 | ;; - Always notice when our nick is mentioned | 1272 | ;; - Always notice when our nick is mentioned |
| 1249 | nick-match | 1273 | nick-match |
| 1250 | ;; - Never bother us if a dim-nick spoke | 1274 | ;; - unless our nick is mentioned, don't bother us |
| 1251 | (not (and rcirc-dim-nick-regexp sender | 1275 | ;; - with dim-nicks |
| 1252 | (string-match rcirc-dim-nick-regexp sender)))) | 1276 | (or nick-match |
| 1277 | (not (and rcirc-dim-nick-regexp sender | ||
| 1278 | (string-match rcirc-dim-nick-regexp sender))))) | ||
| 1253 | (rcirc-record-activity | 1279 | (rcirc-record-activity |
| 1254 | (current-buffer) | 1280 | (current-buffer) |
| 1255 | (when (or nick-match (and (not (rcirc-channel-p rcirc-target)) | 1281 | (when (or nick-match (and (not (rcirc-channel-p rcirc-target)) |
| @@ -1504,18 +1530,20 @@ activity. Only run if the buffer is not visible and | |||
| 1504 | (lopri (car pair)) | 1530 | (lopri (car pair)) |
| 1505 | (hipri (cdr pair))) | 1531 | (hipri (cdr pair))) |
| 1506 | (setq rcirc-activity-string | 1532 | (setq rcirc-activity-string |
| 1507 | (if (or hipri lopri) | 1533 | (cond ((or hipri lopri) |
| 1508 | (concat "-" | 1534 | (concat "-" |
| 1509 | (and hipri "[") | 1535 | (and hipri "[") |
| 1510 | (rcirc-activity-string hipri) | 1536 | (rcirc-activity-string hipri) |
| 1511 | (and hipri lopri ",") | 1537 | (and hipri lopri ",") |
| 1512 | (and lopri | 1538 | (and lopri |
| 1513 | (concat "(" | 1539 | (concat "(" |
| 1514 | (rcirc-activity-string lopri) | 1540 | (rcirc-activity-string lopri) |
| 1515 | ")")) | 1541 | ")")) |
| 1516 | (and hipri "]") | 1542 | (and hipri "]") |
| 1517 | "-") | 1543 | "-")) |
| 1518 | "-[]-")))) | 1544 | ((not (null (rcirc-process-list))) |
| 1545 | "-[]-") | ||
| 1546 | (t ""))))) | ||
| 1519 | 1547 | ||
| 1520 | (defun rcirc-activity-string (buffers) | 1548 | (defun rcirc-activity-string (buffers) |
| 1521 | (mapconcat (lambda (b) | 1549 | (mapconcat (lambda (b) |
| @@ -1771,7 +1799,7 @@ nicks when no NICK is given. When listing ignored nicks, the | |||
| 1771 | ones added to the list automatically are marked with an asterisk." | 1799 | ones added to the list automatically are marked with an asterisk." |
| 1772 | (interactive "sToggle ignoring of nick: ") | 1800 | (interactive "sToggle ignoring of nick: ") |
| 1773 | (when (not (string= "" nick)) | 1801 | (when (not (string= "" nick)) |
| 1774 | (if (member nick rcirc-ignore-list) | 1802 | (if (member-ignore-case nick rcirc-ignore-list) |
| 1775 | (setq rcirc-ignore-list (delete nick rcirc-ignore-list)) | 1803 | (setq rcirc-ignore-list (delete nick rcirc-ignore-list)) |
| 1776 | (setq rcirc-ignore-list (cons nick rcirc-ignore-list)))) | 1804 | (setq rcirc-ignore-list (cons nick rcirc-ignore-list)))) |
| 1777 | (rcirc-print process (rcirc-nick process) "IGNORE" target | 1805 | (rcirc-print process (rcirc-nick process) "IGNORE" target |
| @@ -1800,6 +1828,7 @@ ones added to the list automatically are marked with an asterisk." | |||
| 1800 | "://") | 1828 | "://") |
| 1801 | "www.") | 1829 | "www.") |
| 1802 | (1+ (char "-a-zA-Z0-9_.")) | 1830 | (1+ (char "-a-zA-Z0-9_.")) |
| 1831 | (1+ (char "-a-zA-Z0-9_")) | ||
| 1803 | (optional ":" (1+ (char "0-9")))) | 1832 | (optional ":" (1+ (char "0-9")))) |
| 1804 | (and (1+ (char "-a-zA-Z0-9_.")) | 1833 | (and (1+ (char "-a-zA-Z0-9_.")) |
| 1805 | (or ".com" ".net" ".org") | 1834 | (or ".com" ".net" ".org") |
| @@ -1823,7 +1852,7 @@ ones added to the list automatically are marked with an asterisk." | |||
| 1823 | (defun rcirc-browse-url-at-point (point) | 1852 | (defun rcirc-browse-url-at-point (point) |
| 1824 | "Send URL at point to `browse-url'." | 1853 | "Send URL at point to `browse-url'." |
| 1825 | (interactive "d") | 1854 | (interactive "d") |
| 1826 | (let ((beg (previous-single-property-change point 'mouse-face)) | 1855 | (let ((beg (previous-single-property-change (1+ point) 'mouse-face)) |
| 1827 | (end (next-single-property-change point 'mouse-face))) | 1856 | (end (next-single-property-change point 'mouse-face))) |
| 1828 | (browse-url (buffer-substring-no-properties beg end)))) | 1857 | (browse-url (buffer-substring-no-properties beg end)))) |
| 1829 | 1858 | ||
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 | |||
| 89 | Zone-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..0cf0160afb1 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el | |||
| @@ -299,7 +299,7 @@ the variables are properly set." | |||
| 299 | (substring comment-start 1))) | 299 | (substring comment-start 1))) |
| 300 | ;; Hasn't been necessary yet. | 300 | ;; Hasn't been necessary yet. |
| 301 | ;; (unless (string-match comment-start-skip comment-continue) | 301 | ;; (unless (string-match comment-start-skip comment-continue) |
| 302 | ;; (kill-local-variable 'comment-continue)) | 302 | ;; (kill-local-variable 'comment-continue)) |
| 303 | ) | 303 | ) |
| 304 | ;; comment-skip regexps | 304 | ;; comment-skip regexps |
| 305 | (unless (and comment-start-skip | 305 | (unless (and comment-start-skip |
| @@ -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 | ||
| @@ -764,7 +769,7 @@ comment markers." | |||
| 764 | (box-equal nil)) ;Whether we might be using `=' for boxes. | 769 | (box-equal nil)) ;Whether we might be using `=' for boxes. |
| 765 | (save-restriction | 770 | (save-restriction |
| 766 | (narrow-to-region spt ept) | 771 | (narrow-to-region spt ept) |
| 767 | 772 | ||
| 768 | ;; Remove the comment-start. | 773 | ;; Remove the comment-start. |
| 769 | (goto-char ipt) | 774 | (goto-char ipt) |
| 770 | (skip-syntax-backward " ") | 775 | (skip-syntax-backward " ") |
| @@ -793,7 +798,7 @@ comment markers." | |||
| 793 | ;; If there's something left but it doesn't look like | 798 | ;; If there's something left but it doesn't look like |
| 794 | ;; a comment-start any more, just remove it. | 799 | ;; a comment-start any more, just remove it. |
| 795 | (delete-region (point-min) (point)))) | 800 | (delete-region (point-min) (point)))) |
| 796 | 801 | ||
| 797 | ;; Remove the end-comment (and leading padding and such). | 802 | ;; Remove the end-comment (and leading padding and such). |
| 798 | (goto-char (point-max)) (comment-enter-backward) | 803 | (goto-char (point-max)) (comment-enter-backward) |
| 799 | ;; Check for special `=' used sometimes in comment-box. | 804 | ;; Check for special `=' used sometimes in comment-box. |
| @@ -1057,11 +1062,13 @@ The strings used as comment starts are built from | |||
| 1057 | lines | 1062 | lines |
| 1058 | (nth 3 style)))))) | 1063 | (nth 3 style)))))) |
| 1059 | 1064 | ||
| 1065 | ;;;###autoload | ||
| 1060 | (defun comment-box (beg end &optional arg) | 1066 | (defun comment-box (beg end &optional arg) |
| 1061 | "Comment out the BEG .. END region, putting it inside a box. | 1067 | "Comment out the BEG .. END region, putting it inside a box. |
| 1062 | The numeric prefix ARG specifies how many characters to add to begin- and | 1068 | The numeric prefix ARG specifies how many characters to add to begin- and |
| 1063 | end- comment markers additionally to what `comment-add' already specifies." | 1069 | end- comment markers additionally to what `comment-add' already specifies." |
| 1064 | (interactive "*r\np") | 1070 | (interactive "*r\np") |
| 1071 | (comment-normalize-vars) | ||
| 1065 | (let ((comment-style (if (cadr (assoc comment-style comment-styles)) | 1072 | (let ((comment-style (if (cadr (assoc comment-style comment-styles)) |
| 1066 | 'box-multi 'box))) | 1073 | 'box-multi 'box))) |
| 1067 | (comment-region beg end (+ comment-add arg)))) | 1074 | (comment-region beg end (+ comment-add arg)))) |
diff --git a/lisp/pcvs-parse.el b/lisp/pcvs-parse.el index 0193939606c..bd493126532 100644 --- a/lisp/pcvs-parse.el +++ b/lisp/pcvs-parse.el | |||
| @@ -285,7 +285,8 @@ The remaining KEYS are passed directly to `cvs-create-fileinfo'." | |||
| 285 | (and | 285 | (and |
| 286 | (cvs-or | 286 | (cvs-or |
| 287 | (cvs-match "warning: \\(.*\\) is not (any longer) pertinent$" (file 1)) | 287 | (cvs-match "warning: \\(.*\\) is not (any longer) pertinent$" (file 1)) |
| 288 | (cvs-match "\\(.*\\) is no longer in the repository$" (file 1))) | 288 | (cvs-match "`\\(.*\\)' is no longer in the repository$" (file 1)) |
| 289 | (cvs-match "\\(.*\\) is no longer in the repository$" (file 1))) | ||
| 289 | (cvs-parsed-fileinfo | 290 | (cvs-parsed-fileinfo |
| 290 | (if dont-change-disc '(NEED-UPDATE . REMOVED) 'DEAD) file)) | 291 | (if dont-change-disc '(NEED-UPDATE . REMOVED) 'DEAD) file)) |
| 291 | 292 | ||
diff --git a/lisp/pcvs-util.el b/lisp/pcvs-util.el index cb18fc83d59..84ce2e117b9 100644 --- a/lisp/pcvs-util.el +++ b/lisp/pcvs-util.el | |||
| @@ -126,7 +126,9 @@ with `create-file-buffer' and will probably get another name than NAME. | |||
| 126 | In such a case, the search for another buffer with the same name doesn't | 126 | In such a case, the search for another buffer with the same name doesn't |
| 127 | use the buffer name but the buffer's `list-buffers-directory' variable. | 127 | use the buffer name but the buffer's `list-buffers-directory' variable. |
| 128 | If NOREUSE is non-nil, always return a new buffer." | 128 | If NOREUSE is non-nil, always return a new buffer." |
| 129 | (or (and (not (file-name-absolute-p name)) (get-buffer-create name)) | 129 | (or (and (not (file-name-absolute-p name)) |
| 130 | (if noreuse (generate-new-buffer name) | ||
| 131 | (get-buffer-create name))) | ||
| 130 | (unless noreuse | 132 | (unless noreuse |
| 131 | (dolist (buf (buffer-list)) | 133 | (dolist (buf (buffer-list)) |
| 132 | (with-current-buffer buf | 134 | (with-current-buffer buf |
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 dca6fa16df0..f45bb2fe524 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 |
| @@ -314,14 +315,14 @@ Also display the main routine in the disassembly buffer if present." | |||
| 314 | "Nil means just pop up the GUD buffer unless `gdb-show-main' is t. | 315 | "Nil means just pop up the GUD buffer unless `gdb-show-main' is t. |
| 315 | In this case it starts with two windows: one displaying the GUD | 316 | In this case it starts with two windows: one displaying the GUD |
| 316 | buffer and the other with the source file with the main routine | 317 | buffer and the other with the source file with the main routine |
| 317 | of the inferior. Non-nil means display the layout shown for | 318 | of the debugged program. Non-nil means display the layout shown for |
| 318 | `gdba'." | 319 | `gdba'." |
| 319 | :type 'boolean | 320 | :type 'boolean |
| 320 | :group 'gud | 321 | :group 'gud |
| 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. |
| 357 | With arg, use separate IO iff arg is positive." | 358 | With 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)) |
| @@ -383,8 +384,7 @@ With arg, use separate IO iff arg is positive." | |||
| 383 | (list t nil) nil "-c" | 384 | (list t nil) nil "-c" |
| 384 | (concat gdb-cpp-define-alist-program " " | 385 | (concat gdb-cpp-define-alist-program " " |
| 385 | gdb-cpp-define-alist-flags))))) | 386 | gdb-cpp-define-alist-flags))))) |
| 386 | (define-list (split-string output "\n" t)) | 387 | (define-list (split-string output "\n" t)) (name)) |
| 387 | (name)) | ||
| 388 | (setq gdb-define-alist nil) | 388 | (setq gdb-define-alist nil) |
| 389 | (dolist (define define-list) | 389 | (dolist (define define-list) |
| 390 | (setq name (nth 1 (split-string define "[( ]"))) | 390 | (setq name (nth 1 (split-string define "[( ]"))) |
| @@ -1030,7 +1030,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'." | |||
| 1030 | (minibuffer . nil))) | 1030 | (minibuffer . nil))) |
| 1031 | 1031 | ||
| 1032 | (defun gdb-frame-separate-io-buffer () | 1032 | (defun gdb-frame-separate-io-buffer () |
| 1033 | "Display IO of inferior in a new frame." | 1033 | "Display IO of debugged program in a new frame." |
| 1034 | (interactive) | 1034 | (interactive) |
| 1035 | (if gdb-use-separate-io-buffer | 1035 | (if gdb-use-separate-io-buffer |
| 1036 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | 1036 | (let ((special-display-regexps (append special-display-regexps '(".*"))) |
| @@ -1290,12 +1290,14 @@ not GDB." | |||
| 1290 | (progn | 1290 | (progn |
| 1291 | (setq gud-running t) | 1291 | (setq gud-running t) |
| 1292 | (setq gdb-inferior-status "running") | 1292 | (setq gdb-inferior-status "running") |
| 1293 | (setq gdb-signalled nil) | ||
| 1293 | (gdb-force-mode-line-update | 1294 | (gdb-force-mode-line-update |
| 1294 | (propertize gdb-inferior-status 'face font-lock-type-face)) | 1295 | (propertize gdb-inferior-status 'face font-lock-type-face)) |
| 1295 | (gdb-remove-text-properties) | 1296 | (gdb-remove-text-properties) |
| 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 |
| @@ -1358,6 +1361,23 @@ directives." | |||
| 1358 | :type 'boolean | 1361 | :type 'boolean |
| 1359 | :version "22.1") | 1362 | :version "22.1") |
| 1360 | 1363 | ||
| 1364 | (defcustom gdb-find-source-frame nil | ||
| 1365 | "Non-nil means try to find a source frame further up stack e.g after signal." | ||
| 1366 | :group 'gud | ||
| 1367 | :type 'boolean | ||
| 1368 | :version "22.1") | ||
| 1369 | |||
| 1370 | (defun gdb-find-source-frame (arg) | ||
| 1371 | "Toggle trying to find a source frame further up stack. | ||
| 1372 | With arg, look for a source frame further up stack iff arg is positive." | ||
| 1373 | (interactive "P") | ||
| 1374 | (setq gdb-find-source-frame | ||
| 1375 | (if (null arg) | ||
| 1376 | (not gdb-find-source-frame) | ||
| 1377 | (> (prefix-numeric-value arg) 0))) | ||
| 1378 | (message (format "Looking for source frame %sabled" | ||
| 1379 | (if gdb-find-source-frame "en" "dis")))) | ||
| 1380 | |||
| 1361 | (defun gdb-stopped (ignored) | 1381 | (defun gdb-stopped (ignored) |
| 1362 | "An annotation handler for `stopped'. | 1382 | "An annotation handler for `stopped'. |
| 1363 | It is just like `gdb-stopping', except that if we already set the output | 1383 | It is just like `gdb-stopping', except that if we already set the output |
| @@ -1371,14 +1391,15 @@ sink to `user' in `gdb-stopping', that is fine." | |||
| 1371 | (if gdb-same-frame | 1391 | (if gdb-same-frame |
| 1372 | (gdb-display-gdb-buffer) | 1392 | (gdb-display-gdb-buffer) |
| 1373 | (gdb-frame-gdb-buffer)) | 1393 | (gdb-frame-gdb-buffer)) |
| 1394 | (if gdb-find-source-frame | ||
| 1374 | ;;Try to find source further up stack e.g after signal. | 1395 | ;;Try to find source further up stack e.g after signal. |
| 1375 | (setq gdb-look-up-stack | 1396 | (setq gdb-look-up-stack |
| 1376 | (if (gdb-get-buffer 'gdb-stack-buffer) | 1397 | (if (gdb-get-buffer 'gdb-stack-buffer) |
| 1377 | 'keep | 1398 | 'keep |
| 1378 | (progn | 1399 | (progn |
| 1379 | (gdb-get-buffer-create 'gdb-stack-buffer) | 1400 | (gdb-get-buffer-create 'gdb-stack-buffer) |
| 1380 | (gdb-invalidate-frames) | 1401 | (gdb-invalidate-frames) |
| 1381 | 'delete))))) | 1402 | 'delete)))))) |
| 1382 | (unless (member gdb-inferior-status '("exited" "signal")) | 1403 | (unless (member gdb-inferior-status '("exited" "signal")) |
| 1383 | (setq gdb-inferior-status "stopped") | 1404 | (setq gdb-inferior-status "stopped") |
| 1384 | (gdb-force-mode-line-update | 1405 | (gdb-force-mode-line-update |
| @@ -1754,52 +1775,69 @@ static char *magick[] = { | |||
| 1754 | (gdb-remove-breakpoint-icons (point-min) (point-max))))) | 1775 | (gdb-remove-breakpoint-icons (point-min) (point-max))))) |
| 1755 | (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer) | 1776 | (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer) |
| 1756 | (save-excursion | 1777 | (save-excursion |
| 1778 | (let ((buffer-read-only nil)) | ||
| 1757 | (goto-char (point-min)) | 1779 | (goto-char (point-min)) |
| 1758 | (while (< (point) (- (point-max) 1)) | 1780 | (while (< (point) (- (point-max) 1)) |
| 1759 | (forward-line 1) | 1781 | (forward-line 1) |
| 1760 | (if (looking-at "[^\t].*?breakpoint") | 1782 | (if (looking-at gdb-breakpoint-regexp) |
| 1761 | (progn | 1783 | (progn |
| 1762 | (looking-at "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\(.\\)") | ||
| 1763 | (setq bptno (match-string 1)) | 1784 | (setq bptno (match-string 1)) |
| 1764 | (setq flag (char-after (match-beginning 2))) | 1785 | (setq flag (char-after (match-beginning 2))) |
| 1765 | (beginning-of-line) | 1786 | (add-text-properties |
| 1766 | (if (re-search-forward " in \\(.*\\) at\\s-+" nil t) | 1787 | (match-beginning 2) (match-end 2) |
| 1767 | (progn | 1788 | (if (eq flag ?y) |
| 1768 | (let ((buffer-read-only nil)) | 1789 | '(face font-lock-warning-face) |
| 1769 | (add-text-properties (match-beginning 1) (match-end 1) | 1790 | '(face font-lock-type-face))) |
| 1770 | '(face font-lock-function-name-face))) | 1791 | (let ((bl (point)) |
| 1771 | (looking-at "\\(\\S-+\\):\\([0-9]+\\)") | 1792 | (el (line-end-position))) |
| 1772 | (let ((line (match-string 2)) (buffer-read-only nil) | 1793 | (if (re-search-forward " in \\(.*\\) at\\s-+" el t) |
| 1773 | (file (match-string 1))) | 1794 | (progn |
| 1774 | (add-text-properties (line-beginning-position) | 1795 | (add-text-properties |
| 1775 | (line-end-position) | 1796 | (match-beginning 1) (match-end 1) |
| 1776 | '(mouse-face highlight | 1797 | '(face font-lock-function-name-face)) |
| 1777 | help-echo "mouse-2, RET: visit breakpoint")) | 1798 | (looking-at "\\(\\S-+\\):\\([0-9]+\\)") |
| 1778 | (unless (file-exists-p file) | 1799 | (let ((line (match-string 2)) |
| 1779 | (setq file (cdr (assoc bptno gdb-location-alist)))) | 1800 | (file (match-string 1))) |
| 1780 | (if (and file | 1801 | (add-text-properties bl el |
| 1781 | (not (string-equal file "File not found"))) | 1802 | '(mouse-face highlight |
| 1782 | (with-current-buffer | 1803 | help-echo "mouse-2, RET: visit breakpoint")) |
| 1783 | (find-file-noselect file 'nowarn) | 1804 | (unless (file-exists-p file) |
| 1784 | (set (make-local-variable 'gud-minor-mode) | 1805 | (setq file (cdr (assoc bptno gdb-location-alist)))) |
| 1785 | 'gdba) | 1806 | (if (and file |
| 1786 | (set (make-local-variable 'tool-bar-map) | 1807 | (not (string-equal file "File not found"))) |
| 1787 | gud-tool-bar-map) | 1808 | (with-current-buffer |
| 1788 | ;; Only want one breakpoint icon at each | 1809 | (find-file-noselect file 'nowarn) |
| 1789 | ;; location. | 1810 | (set (make-local-variable 'gud-minor-mode) |
| 1790 | (save-excursion | 1811 | 'gdba) |
| 1791 | (goto-line (string-to-number line)) | 1812 | (set (make-local-variable 'tool-bar-map) |
| 1792 | (gdb-put-breakpoint-icon (eq flag ?y) bptno))) | 1813 | gud-tool-bar-map) |
| 1793 | (gdb-enqueue-input | 1814 | ;; Only want one breakpoint icon at each |
| 1794 | (list | 1815 | ;; location. |
| 1795 | (concat gdb-server-prefix "list " | 1816 | (save-excursion |
| 1796 | (match-string-no-properties 1) ":1\n") | 1817 | (goto-line (string-to-number line)) |
| 1797 | 'ignore)) | 1818 | (gdb-put-breakpoint-icon (eq flag ?y) bptno))) |
| 1798 | (gdb-enqueue-input | 1819 | (gdb-enqueue-input |
| 1799 | (list (concat gdb-server-prefix "info source\n") | 1820 | (list |
| 1800 | `(lambda () (gdb-get-location | 1821 | (concat gdb-server-prefix "list " |
| 1801 | ,bptno ,line ,flag)))))))))) | 1822 | (match-string-no-properties 1) ":1\n") |
| 1802 | (end-of-line))))) | 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) | ||
| 1837 | (add-text-properties | ||
| 1838 | (match-beginning 1) (match-end 1) | ||
| 1839 | '(face font-lock-variable-name-face))))))) | ||
| 1840 | (end-of-line)))))) | ||
| 1803 | (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))) | 1841 | (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))) |
| 1804 | 1842 | ||
| 1805 | (defun gdb-mouse-set-clear-breakpoint (event) | 1843 | (defun gdb-mouse-set-clear-breakpoint (event) |
| @@ -2002,8 +2040,14 @@ static char *magick[] = { | |||
| 2002 | (goto-char bl) | 2040 | (goto-char bl) |
| 2003 | (when (looking-at "^#\\([0-9]+\\)") | 2041 | (when (looking-at "^#\\([0-9]+\\)") |
| 2004 | (when (string-equal (match-string 1) gdb-frame-number) | 2042 | (when (string-equal (match-string 1) gdb-frame-number) |
| 2005 | (put-text-property bl (+ bl 4) | 2043 | (if (> (car (window-fringes)) 0) |
| 2006 | '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)))) | ||
| 2007 | (when (re-search-forward | 2051 | (when (re-search-forward |
| 2008 | (concat | 2052 | (concat |
| 2009 | (if (string-equal (match-string 1) "0") "" " in ") | 2053 | (if (string-equal (match-string 1) "0") "" " in ") |
| @@ -2036,9 +2080,10 @@ static char *magick[] = { | |||
| 2036 | (setq gdb-look-up-stack nil)) | 2080 | (setq gdb-look-up-stack nil)) |
| 2037 | 2081 | ||
| 2038 | (defun gdb-set-hollow () | 2082 | (defun gdb-set-hollow () |
| 2039 | (with-current-buffer (gud-find-file (car gud-last-last-frame)) | 2083 | (if gud-last-last-frame |
| 2040 | (setq fringe-indicator-alist | 2084 | (with-current-buffer (gud-find-file (car gud-last-last-frame)) |
| 2041 | '((overlay-arrow . hollow-right-triangle))))) | 2085 | (setq fringe-indicator-alist |
| 2086 | '((overlay-arrow . hollow-right-triangle)))))) | ||
| 2042 | 2087 | ||
| 2043 | (defun gdb-stack-buffer-name () | 2088 | (defun gdb-stack-buffer-name () |
| 2044 | (with-current-buffer gud-comint-buffer | 2089 | (with-current-buffer gud-comint-buffer |
| @@ -2073,6 +2118,8 @@ static char *magick[] = { | |||
| 2073 | (kill-all-local-variables) | 2118 | (kill-all-local-variables) |
| 2074 | (setq major-mode 'gdb-frames-mode) | 2119 | (setq major-mode 'gdb-frames-mode) |
| 2075 | (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) | ||
| 2076 | (setq buffer-read-only t) | 2123 | (setq buffer-read-only t) |
| 2077 | (use-local-map gdb-frames-mode-map) | 2124 | (use-local-map gdb-frames-mode-map) |
| 2078 | (run-mode-hooks 'gdb-frames-mode-hook) | 2125 | (run-mode-hooks 'gdb-frames-mode-hook) |
| @@ -2524,18 +2571,18 @@ corresponding to the mode line clicked." | |||
| 2524 | 'local-map | 2571 | 'local-map |
| 2525 | (gdb-make-header-line-mouse-map | 2572 | (gdb-make-header-line-mouse-map |
| 2526 | 'mouse-1 | 2573 | 'mouse-1 |
| 2527 | #'(lambda () (interactive) | 2574 | (lambda () (interactive) |
| 2528 | (let ((gdb-memory-address | 2575 | (let ((gdb-memory-address |
| 2529 | ;; Let GDB do the arithmetic. | 2576 | ;; Let GDB do the arithmetic. |
| 2530 | (concat | 2577 | (concat |
| 2531 | gdb-memory-address " - " | 2578 | gdb-memory-address " - " |
| 2532 | (number-to-string | 2579 | (number-to-string |
| 2533 | (* gdb-memory-repeat-count | 2580 | (* gdb-memory-repeat-count |
| 2534 | (cond ((string= gdb-memory-unit "b") 1) | 2581 | (cond ((string= gdb-memory-unit "b") 1) |
| 2535 | ((string= gdb-memory-unit "h") 2) | 2582 | ((string= gdb-memory-unit "h") 2) |
| 2536 | ((string= gdb-memory-unit "w") 4) | 2583 | ((string= gdb-memory-unit "w") 4) |
| 2537 | ((string= gdb-memory-unit "g") 8))))))) | 2584 | ((string= gdb-memory-unit "g") 8))))))) |
| 2538 | (gdb-invalidate-memory))))) | 2585 | (gdb-invalidate-memory))))) |
| 2539 | "|" | 2586 | "|" |
| 2540 | (propertize "+" | 2587 | (propertize "+" |
| 2541 | 'face font-lock-warning-face | 2588 | 'face font-lock-warning-face |
| @@ -2543,9 +2590,9 @@ corresponding to the mode line clicked." | |||
| 2543 | 'mouse-face 'mode-line-highlight | 2590 | 'mouse-face 'mode-line-highlight |
| 2544 | 'local-map (gdb-make-header-line-mouse-map | 2591 | 'local-map (gdb-make-header-line-mouse-map |
| 2545 | 'mouse-1 | 2592 | 'mouse-1 |
| 2546 | #'(lambda () (interactive) | 2593 | (lambda () (interactive) |
| 2547 | (let ((gdb-memory-address nil)) | 2594 | (let ((gdb-memory-address nil)) |
| 2548 | (gdb-invalidate-memory))))) | 2595 | (gdb-invalidate-memory))))) |
| 2549 | "]: " | 2596 | "]: " |
| 2550 | (propertize gdb-memory-address | 2597 | (propertize gdb-memory-address |
| 2551 | 'face font-lock-warning-face | 2598 | 'face font-lock-warning-face |
| @@ -2592,8 +2639,11 @@ corresponding to the mode line clicked." | |||
| 2592 | (defun gdb-frame-memory-buffer () | 2639 | (defun gdb-frame-memory-buffer () |
| 2593 | "Display memory contents in a new frame." | 2640 | "Display memory contents in a new frame." |
| 2594 | (interactive) | 2641 | (interactive) |
| 2595 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | 2642 | (let* ((special-display-regexps (append special-display-regexps '(".*"))) |
| 2596 | (special-display-frame-alist gdb-frame-parameters)) | 2643 | (special-display-frame-alist |
| 2644 | (cons '(left-fringe . 0) | ||
| 2645 | (cons '(right-fringe . 0) | ||
| 2646 | (cons '(width . 83) gdb-frame-parameters))))) | ||
| 2597 | (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer)))) | 2647 | (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer)))) |
| 2598 | 2648 | ||
| 2599 | 2649 | ||
| @@ -2610,13 +2660,14 @@ corresponding to the mode line clicked." | |||
| 2610 | 2660 | ||
| 2611 | (defvar gdb-locals-watch-map | 2661 | (defvar gdb-locals-watch-map |
| 2612 | (let ((map (make-sparse-keymap))) | 2662 | (let ((map (make-sparse-keymap))) |
| 2613 | (define-key map "\r" '(lambda () (interactive) | 2663 | (suppress-keymap map) |
| 2614 | (beginning-of-line) | 2664 | (define-key map "\r" (lambda () (interactive) |
| 2615 | (gud-watch))) | 2665 | (beginning-of-line) |
| 2616 | (define-key map [mouse-2] '(lambda (event) (interactive "e") | 2666 | (gud-watch))) |
| 2617 | (mouse-set-point event) | 2667 | (define-key map [mouse-2] (lambda (event) (interactive "e") |
| 2618 | (beginning-of-line) | 2668 | (mouse-set-point event) |
| 2619 | (gud-watch))) | 2669 | (beginning-of-line) |
| 2670 | (gud-watch))) | ||
| 2620 | map) | 2671 | map) |
| 2621 | "Keymap to create watch expression of a complex data type local variable.") | 2672 | "Keymap to create watch expression of a complex data type local variable.") |
| 2622 | 2673 | ||
| @@ -2739,7 +2790,7 @@ corresponding to the mode line clicked." | |||
| 2739 | (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer)) | 2790 | (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer)) |
| 2740 | (define-key menu [threads] '("Threads" . gdb-display-threads-buffer)) | 2791 | (define-key menu [threads] '("Threads" . gdb-display-threads-buffer)) |
| 2741 | (define-key menu [inferior] | 2792 | (define-key menu [inferior] |
| 2742 | '(menu-item "Inferior IO" gdb-display-separate-io-buffer | 2793 | '(menu-item "Separate IO" gdb-display-separate-io-buffer |
| 2743 | :enable gdb-use-separate-io-buffer)) | 2794 | :enable gdb-use-separate-io-buffer)) |
| 2744 | (define-key menu [memory] '("Memory" . gdb-display-memory-buffer)) | 2795 | (define-key menu [memory] '("Memory" . gdb-display-memory-buffer)) |
| 2745 | (define-key menu [registers] '("Registers" . gdb-display-registers-buffer)) | 2796 | (define-key menu [registers] '("Registers" . gdb-display-registers-buffer)) |
| @@ -2758,7 +2809,7 @@ corresponding to the mode line clicked." | |||
| 2758 | (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer)) | 2809 | (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer)) |
| 2759 | (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer)) | 2810 | (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer)) |
| 2760 | (define-key menu [inferior] | 2811 | (define-key menu [inferior] |
| 2761 | '(menu-item "Inferior IO" gdb-frame-separate-io-buffer | 2812 | '(menu-item "Separate IO" gdb-frame-separate-io-buffer |
| 2762 | :enable gdb-use-separate-io-buffer)) | 2813 | :enable gdb-use-separate-io-buffer)) |
| 2763 | (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) | 2814 | (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) |
| 2764 | (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer)) | 2815 | (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer)) |
| @@ -2771,10 +2822,15 @@ corresponding to the mode line clicked." | |||
| 2771 | (define-key gud-menu-map [ui] | 2822 | (define-key gud-menu-map [ui] |
| 2772 | `(menu-item (if (eq gud-minor-mode 'gdba) "GDB-UI" "GDB-MI") | 2823 | `(menu-item (if (eq gud-minor-mode 'gdba) "GDB-UI" "GDB-MI") |
| 2773 | ,menu :visible (memq gud-minor-mode '(gdbmi gdba)))) | 2824 | ,menu :visible (memq gud-minor-mode '(gdbmi gdba)))) |
| 2825 | (define-key menu [gdb-find-source-frame] | ||
| 2826 | '(menu-item "Look For Source Frame" gdb-find-source-frame | ||
| 2827 | :visible (eq gud-minor-mode 'gdba) | ||
| 2828 | :help "Toggle look for source frame." | ||
| 2829 | :button (:toggle . gdb-find-source-frame))) | ||
| 2774 | (define-key menu [gdb-use-separate-io] | 2830 | (define-key menu [gdb-use-separate-io] |
| 2775 | '(menu-item "Separate inferior IO" gdb-use-separate-io-buffer | 2831 | '(menu-item "Separate IO" gdb-use-separate-io-buffer |
| 2776 | :visible (eq gud-minor-mode 'gdba) | 2832 | :visible (eq gud-minor-mode 'gdba) |
| 2777 | :help "Toggle separate IO for inferior." | 2833 | :help "Toggle separate IO for debugged program." |
| 2778 | :button (:toggle . gdb-use-separate-io-buffer))) | 2834 | :button (:toggle . gdb-use-separate-io-buffer))) |
| 2779 | (define-key menu [gdb-many-windows] | 2835 | (define-key menu [gdb-many-windows] |
| 2780 | '(menu-item "Display Other Windows" gdb-many-windows | 2836 | '(menu-item "Display Other Windows" gdb-many-windows |
| @@ -2871,12 +2927,13 @@ Kills the gdb buffers, and resets variables and the source buffers." | |||
| 2871 | (setq gud-minor-mode nil) | 2927 | (setq gud-minor-mode nil) |
| 2872 | (kill-local-variable 'tool-bar-map) | 2928 | (kill-local-variable 'tool-bar-map) |
| 2873 | (kill-local-variable 'gdb-define-alist)))))) | 2929 | (kill-local-variable 'gdb-define-alist)))))) |
| 2874 | (when (markerp gdb-overlay-arrow-position) | 2930 | (setq gdb-overlay-arrow-position nil) |
| 2875 | (move-marker gdb-overlay-arrow-position nil) | ||
| 2876 | (setq gdb-overlay-arrow-position nil)) | ||
| 2877 | (setq overlay-arrow-variable-list | 2931 | (setq overlay-arrow-variable-list |
| 2878 | (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)) | 2932 | (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)) |
| 2879 | (setq fringe-indicator-alist '((overlay-arrow . right-triangle))) | 2933 | (setq fringe-indicator-alist '((overlay-arrow . right-triangle))) |
| 2934 | (setq gdb-stack-position nil) | ||
| 2935 | (setq overlay-arrow-variable-list | ||
| 2936 | (delq 'gdb-stack-position overlay-arrow-variable-list)) | ||
| 2880 | (if (boundp 'speedbar-frame) (speedbar-timer-fn)) | 2937 | (if (boundp 'speedbar-frame) (speedbar-timer-fn)) |
| 2881 | (setq gud-running nil) | 2938 | (setq gud-running nil) |
| 2882 | (setq gdb-active-process nil) | 2939 | (setq gdb-active-process nil) |
| @@ -3098,8 +3155,7 @@ BUFFER nil or omitted means use the current buffer." | |||
| 3098 | '((overlay-arrow . hollow-right-triangle)))) | 3155 | '((overlay-arrow . hollow-right-triangle)))) |
| 3099 | (or gdb-overlay-arrow-position | 3156 | (or gdb-overlay-arrow-position |
| 3100 | (setq gdb-overlay-arrow-position (make-marker))) | 3157 | (setq gdb-overlay-arrow-position (make-marker))) |
| 3101 | (set-marker gdb-overlay-arrow-position | 3158 | (set-marker gdb-overlay-arrow-position (point)))))) |
| 3102 | (point) (current-buffer)))))) | ||
| 3103 | ;; remove all breakpoint-icons in assembler buffer before updating. | 3159 | ;; remove all breakpoint-icons in assembler buffer before updating. |
| 3104 | (gdb-remove-breakpoint-icons (point-min) (point-max)))) | 3160 | (gdb-remove-breakpoint-icons (point-min) (point-max)))) |
| 3105 | (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer) | 3161 | (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer) |
| @@ -3460,10 +3516,32 @@ in_scope=\"\\(.*?\\)\".*?}") | |||
| 3460 | 3516 | ||
| 3461 | (defvar gdb-locals-watch-map-1 | 3517 | (defvar gdb-locals-watch-map-1 |
| 3462 | (let ((map (make-sparse-keymap))) | 3518 | (let ((map (make-sparse-keymap))) |
| 3519 | (suppress-keymap map) | ||
| 3520 | (define-key map "\r" 'gud-watch) | ||
| 3463 | (define-key map [mouse-2] 'gud-watch) | 3521 | (define-key map [mouse-2] 'gud-watch) |
| 3464 | map) | 3522 | map) |
| 3465 | "Keymap to create watch expression of a complex data type local variable.") | 3523 | "Keymap to create watch expression of a complex data type local variable.") |
| 3466 | 3524 | ||
| 3525 | (defvar gdb-edit-locals-map-1 | ||
| 3526 | (let ((map (make-sparse-keymap))) | ||
| 3527 | (suppress-keymap map) | ||
| 3528 | (define-key map "\r" 'gdb-edit-locals-value) | ||
| 3529 | (define-key map [mouse-2] 'gdb-edit-locals-value) | ||
| 3530 | map) | ||
| 3531 | "Keymap to edit value of a simple data type local variable.") | ||
| 3532 | |||
| 3533 | (defun gdb-edit-locals-value (&optional event) | ||
| 3534 | "Assign a value to a variable displayed in the locals buffer." | ||
| 3535 | (interactive (list last-input-event)) | ||
| 3536 | (save-excursion | ||
| 3537 | (if event (posn-set-point (event-end event))) | ||
| 3538 | (beginning-of-line) | ||
| 3539 | (let* ((var (current-word)) | ||
| 3540 | (value (read-string (format "New value (%s): " var)))) | ||
| 3541 | (gdb-enqueue-input | ||
| 3542 | (list (concat gdb-server-prefix"set variable " var " = " value "\n") | ||
| 3543 | 'ignore))))) | ||
| 3544 | |||
| 3467 | ;; Dont display values of arrays or structures. | 3545 | ;; Dont display values of arrays or structures. |
| 3468 | ;; These can be expanded using gud-watch. | 3546 | ;; These can be expanded using gud-watch. |
| 3469 | (defun gdb-stack-list-locals-handler () | 3547 | (defun gdb-stack-list-locals-handler () |
| @@ -3491,20 +3569,26 @@ in_scope=\"\\(.*?\\)\".*?}") | |||
| 3491 | (let* ((window (get-buffer-window buf 0)) | 3569 | (let* ((window (get-buffer-window buf 0)) |
| 3492 | (start (window-start window)) | 3570 | (start (window-start window)) |
| 3493 | (p (window-point window)) | 3571 | (p (window-point window)) |
| 3494 | (buffer-read-only nil)) | 3572 | (buffer-read-only nil) (name) (value)) |
| 3495 | (erase-buffer) | 3573 | (erase-buffer) |
| 3496 | (dolist (local locals-list) | 3574 | (dolist (local locals-list) |
| 3497 | (setq name (car local)) | 3575 | (setq name (car local)) |
| 3498 | (if (or (not (nth 2 local)) | 3576 | (setq value (nth 2 local)) |
| 3499 | (string-match "^\\0x" (nth 2 local))) | 3577 | (if (or (not value) |
| 3578 | (string-match "^\\0x" value)) | ||
| 3500 | (add-text-properties 0 (length name) | 3579 | (add-text-properties 0 (length name) |
| 3501 | `(mouse-face highlight | 3580 | `(mouse-face highlight |
| 3502 | help-echo "mouse-2: create watch expression" | 3581 | help-echo "mouse-2: create watch expression" |
| 3503 | local-map ,gdb-locals-watch-map-1) | 3582 | local-map ,gdb-locals-watch-map-1) |
| 3504 | name)) | 3583 | name) |
| 3584 | (add-text-properties 0 (length value) | ||
| 3585 | `(mouse-face highlight | ||
| 3586 | help-echo "mouse-2: edit value" | ||
| 3587 | local-map ,gdb-edit-locals-map-1) | ||
| 3588 | value)) | ||
| 3505 | (insert | 3589 | (insert |
| 3506 | (concat name "\t" (nth 1 local) | 3590 | (concat name "\t" (nth 1 local) |
| 3507 | "\t" (nth 2 local) "\n"))) | 3591 | "\t" value "\n"))) |
| 3508 | (set-window-start window start) | 3592 | (set-window-start window start) |
| 3509 | (set-window-point window p)))))))) | 3593 | (set-window-point window p)))))))) |
| 3510 | 3594 | ||
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index e7d85910a63..48692f9742f 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -335,7 +335,7 @@ This variable's value takes effect when `grep-compute-defaults' is called.") | |||
| 335 | (defvar grep-find-use-xargs nil | 335 | (defvar grep-find-use-xargs nil |
| 336 | "Whether \\[grep-find] uses the `xargs' utility by default. | 336 | "Whether \\[grep-find] uses the `xargs' utility by default. |
| 337 | 337 | ||
| 338 | If nil, it uses `find -exec'; if `gnu', it uses `find -print0' and `xargs -0'; | 338 | If `exec', it uses `find -exec'; if `gnu', it uses `find -print0' and `xargs -0'; |
| 339 | if not nil and not `gnu', it uses `find -print' and `xargs'. | 339 | if not nil and not `gnu', it uses `find -print' and `xargs'. |
| 340 | 340 | ||
| 341 | This variable's value takes effect when `grep-compute-defaults' is called.") | 341 | This variable's value takes effect when `grep-compute-defaults' is called.") |
| @@ -419,21 +419,29 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." | |||
| 419 | (format "%s <C> %s <R> <F>" grep-program grep-options))) | 419 | (format "%s <C> %s <R> <F>" grep-program grep-options))) |
| 420 | (unless grep-find-use-xargs | 420 | (unless grep-find-use-xargs |
| 421 | (setq grep-find-use-xargs | 421 | (setq grep-find-use-xargs |
| 422 | (if (and | 422 | (cond |
| 423 | (grep-probe find-program `(nil nil nil ,null-device "-print0")) | 423 | ((and |
| 424 | (grep-probe "xargs" `(nil nil nil "-0" "-e" "echo"))) | 424 | (grep-probe find-program `(nil nil nil ,null-device "-print0")) |
| 425 | 'gnu))) | 425 | (grep-probe "xargs" `(nil nil nil "-0" "-e" "echo"))) |
| 426 | 'gnu) | ||
| 427 | (t | ||
| 428 | 'exec)))) | ||
| 426 | (unless grep-find-command | 429 | (unless grep-find-command |
| 427 | (setq grep-find-command | 430 | (setq grep-find-command |
| 428 | (cond ((eq grep-find-use-xargs 'gnu) | 431 | (cond ((eq grep-find-use-xargs 'gnu) |
| 429 | (format "%s . -type f -print0 | xargs -0 -e %s" | 432 | (format "%s . -type f -print0 | xargs -0 -e %s" |
| 430 | find-program grep-command)) | 433 | find-program grep-command)) |
| 431 | (grep-find-use-xargs | 434 | ((eq grep-find-use-xargs 'exec) |
| 435 | (let ((cmd0 (format "%s . -type f -exec %s" | ||
| 436 | find-program grep-command))) | ||
| 437 | (cons | ||
| 438 | (format "%s {} %s %s" | ||
| 439 | cmd0 null-device | ||
| 440 | (shell-quote-argument ";")) | ||
| 441 | (1+ (length cmd0))))) | ||
| 442 | (t | ||
| 432 | (format "%s . -type f -print | xargs %s" | 443 | (format "%s . -type f -print | xargs %s" |
| 433 | find-program grep-command)) | 444 | find-program grep-command))))) |
| 434 | (t (cons (format "%s . -type f -exec %s {} %s \\;" | ||
| 435 | find-program grep-command null-device) | ||
| 436 | (+ 22 (length grep-command))))))) | ||
| 437 | (unless grep-find-template | 445 | (unless grep-find-template |
| 438 | (setq grep-find-template | 446 | (setq grep-find-template |
| 439 | (let ((gcmd (format "%s <C> %s <R>" | 447 | (let ((gcmd (format "%s <C> %s <R>" |
| @@ -441,11 +449,13 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." | |||
| 441 | (cond ((eq grep-find-use-xargs 'gnu) | 449 | (cond ((eq grep-find-use-xargs 'gnu) |
| 442 | (format "%s . <X> -type f <F> -print0 | xargs -0 -e %s" | 450 | (format "%s . <X> -type f <F> -print0 | xargs -0 -e %s" |
| 443 | find-program gcmd)) | 451 | find-program gcmd)) |
| 444 | (grep-find-use-xargs | 452 | ((eq grep-find-use-xargs 'exec) |
| 453 | (format "%s . <X> -type f <F> -exec %s {} %s %s" | ||
| 454 | find-program gcmd null-device | ||
| 455 | (shell-quote-argument ";"))) | ||
| 456 | (t | ||
| 445 | (format "%s . <X> -type f <F> -print | xargs %s" | 457 | (format "%s . <X> -type f <F> -print | xargs %s" |
| 446 | find-program gcmd)) | 458 | find-program gcmd)))))))) |
| 447 | (t (format "%s . <X> -type f <F> -exec %s {} %s \\;" | ||
| 448 | find-program gcmd null-device)))))))) | ||
| 449 | (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t)) | 459 | (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t)) |
| 450 | (setq grep-highlight-matches | 460 | (setq grep-highlight-matches |
| 451 | (with-temp-buffer | 461 | (with-temp-buffer |
| @@ -455,34 +465,48 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'." | |||
| 455 | (search-forward "--color" nil t)) | 465 | (search-forward "--color" nil t)) |
| 456 | t))))) | 466 | t))))) |
| 457 | 467 | ||
| 468 | (defun grep-tag-default () | ||
| 469 | (or (and transient-mark-mode mark-active | ||
| 470 | (/= (point) (mark)) | ||
| 471 | (buffer-substring-no-properties (point) (mark))) | ||
| 472 | (funcall (or find-tag-default-function | ||
| 473 | (get major-mode 'find-tag-default-function) | ||
| 474 | 'find-tag-default)) | ||
| 475 | "")) | ||
| 476 | |||
| 458 | (defun grep-default-command () | 477 | (defun grep-default-command () |
| 459 | (let ((tag-default | 478 | "Compute the default grep command for C-u M-x grep to offer." |
| 460 | (shell-quote-argument | 479 | (let ((tag-default (shell-quote-argument (grep-tag-default))) |
| 461 | (or (funcall (or find-tag-default-function | 480 | ;; This a regexp to match single shell arguments. |
| 462 | (get major-mode 'find-tag-default-function) | 481 | ;; Could someone please add comments explaining it? |
| 463 | 'find-tag-default)) | ||
| 464 | ""))) | ||
| 465 | (sh-arg-re "\\(\\(?:\"\\(?:[^\"]\\|\\\\\"\\)+\"\\|'[^']+'\\|[^\"' \t\n]\\)+\\)") | 482 | (sh-arg-re "\\(\\(?:\"\\(?:[^\"]\\|\\\\\"\\)+\"\\|'[^']+'\\|[^\"' \t\n]\\)+\\)") |
| 466 | (grep-default (or (car grep-history) grep-command))) | 483 | (grep-default (or (car grep-history) grep-command))) |
| 467 | ;; Replace the thing matching for with that around cursor. | 484 | ;; In the default command, find the arg that specifies the pattern. |
| 468 | (when (or (string-match | 485 | (when (or (string-match |
| 469 | (concat "[^ ]+\\s +\\(?:-[^ ]+\\s +\\)*" | 486 | (concat "[^ ]+\\s +\\(?:-[^ ]+\\s +\\)*" |
| 470 | sh-arg-re "\\(\\s +\\(\\S +\\)\\)?") | 487 | sh-arg-re "\\(\\s +\\(\\S +\\)\\)?") |
| 471 | grep-default) | 488 | grep-default) |
| 472 | ;; If the string is not yet complete. | 489 | ;; If the string is not yet complete. |
| 473 | (string-match "\\(\\)\\'" grep-default)) | 490 | (string-match "\\(\\)\\'" grep-default)) |
| 474 | (unless (or (not (stringp buffer-file-name)) | 491 | ;; Maybe we will replace the pattern with the default tag. |
| 475 | (when (match-beginning 2) | 492 | ;; But first, maybe replace the file name pattern. |
| 476 | (save-match-data | 493 | (condition-case nil |
| 477 | (string-match | 494 | (unless (or (not (stringp buffer-file-name)) |
| 478 | (wildcard-to-regexp | 495 | (when (match-beginning 2) |
| 479 | (file-name-nondirectory | 496 | (save-match-data |
| 480 | (match-string 3 grep-default))) | 497 | (string-match |
| 481 | (file-name-nondirectory buffer-file-name))))) | 498 | (wildcard-to-regexp |
| 482 | (setq grep-default (concat (substring grep-default | 499 | (file-name-nondirectory |
| 483 | 0 (match-beginning 2)) | 500 | (match-string 3 grep-default))) |
| 484 | " *." | 501 | (file-name-nondirectory buffer-file-name))))) |
| 485 | (file-name-extension buffer-file-name)))) | 502 | (setq grep-default (concat (substring grep-default |
| 503 | 0 (match-beginning 2)) | ||
| 504 | " *." | ||
| 505 | (file-name-extension buffer-file-name)))) | ||
| 506 | ;; In case wildcard-to-regexp gets an error | ||
| 507 | ;; from invalid data. | ||
| 508 | (error nil)) | ||
| 509 | ;; Now replace the pattern with the default tag. | ||
| 486 | (replace-match tag-default t t grep-default 1)))) | 510 | (replace-match tag-default t t grep-default 1)))) |
| 487 | 511 | ||
| 488 | 512 | ||
| @@ -590,15 +614,11 @@ substitution string. Note dynamic scoping of variables.") | |||
| 590 | 614 | ||
| 591 | (defun grep-read-regexp () | 615 | (defun grep-read-regexp () |
| 592 | "Read regexp arg for interactive grep." | 616 | "Read regexp arg for interactive grep." |
| 593 | (let ((default | 617 | (let ((default (grep-tag-default))) |
| 594 | (or (funcall (or find-tag-default-function | ||
| 595 | (get major-mode 'find-tag-default-function) | ||
| 596 | 'find-tag-default)) | ||
| 597 | ""))) | ||
| 598 | (read-string | 618 | (read-string |
| 599 | (concat "Search for" | 619 | (concat "Search for" |
| 600 | (if (and default (> (length default) 0)) | 620 | (if (and default (> (length default) 0)) |
| 601 | (format " (default %s): " default) ": ")) | 621 | (format " (default \"%s\"): " default) ": ")) |
| 602 | nil 'grep-regexp-history default))) | 622 | nil 'grep-regexp-history default))) |
| 603 | 623 | ||
| 604 | (defun grep-read-files (regexp) | 624 | (defun grep-read-files (regexp) |
| @@ -620,7 +640,9 @@ substitution string. Note dynamic scoping of variables.") | |||
| 620 | (cdr alias))) | 640 | (cdr alias))) |
| 621 | (and fn | 641 | (and fn |
| 622 | (let ((ext (file-name-extension fn))) | 642 | (let ((ext (file-name-extension fn))) |
| 623 | (and ext (concat "*." ext)))))) | 643 | (and ext (concat "*." ext)))) |
| 644 | (car grep-files-history) | ||
| 645 | (car (car grep-files-aliases)))) | ||
| 624 | (files (read-string | 646 | (files (read-string |
| 625 | (concat "Search for \"" regexp | 647 | (concat "Search for \"" regexp |
| 626 | "\" in files" | 648 | "\" in files" |
| @@ -724,18 +746,26 @@ This command shares argument histories with \\[lgrep] and \\[grep-find]." | |||
| 724 | (let ((command (grep-expand-template | 746 | (let ((command (grep-expand-template |
| 725 | grep-find-template | 747 | grep-find-template |
| 726 | regexp | 748 | regexp |
| 727 | (concat "\\( -name " | 749 | (concat (shell-quote-argument "(") |
| 750 | " -name " | ||
| 728 | (mapconcat #'shell-quote-argument | 751 | (mapconcat #'shell-quote-argument |
| 729 | (split-string files) | 752 | (split-string files) |
| 730 | " -o -name ") | 753 | " -o -name ") |
| 731 | " \\)") | 754 | " " |
| 755 | (shell-quote-argument ")")) | ||
| 732 | dir | 756 | dir |
| 733 | (and grep-find-ignored-directories | 757 | (and grep-find-ignored-directories |
| 734 | (concat "\\( -path '*/" | 758 | (concat (shell-quote-argument "(") |
| 735 | (mapconcat #'identity | 759 | ;; we should use shell-quote-argument here |
| 760 | " -path " | ||
| 761 | (mapconcat #'(lambda (dir) | ||
| 762 | (shell-quote-argument | ||
| 763 | (concat "*/" dir))) | ||
| 736 | grep-find-ignored-directories | 764 | grep-find-ignored-directories |
| 737 | "' -o -path '*/") | 765 | " -o -path ") |
| 738 | "' \\) -prune -o "))))) | 766 | " " |
| 767 | (shell-quote-argument ")") | ||
| 768 | " -prune -o "))))) | ||
| 739 | (when command | 769 | (when command |
| 740 | (if current-prefix-arg | 770 | (if current-prefix-arg |
| 741 | (setq command | 771 | (setq command |
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/python.el b/lisp/progmodes/python.el index 9636f7eaeae..c38a6e82f83 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -9,19 +9,19 @@ | |||
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| 11 | 11 | ||
| 12 | ;; This file is free software; you can redistribute it and/or modify | 12 | ;; GNU Emacs is free software; you can redistribute it and/or modify |
| 13 | ;; it under the terms of the GNU General Public License as published by | 13 | ;; it under the terms of the GNU General Public License as published by |
| 14 | ;; the Free Software Foundation; either version 2, or (at your option) | 14 | ;; the Free Software Foundation; either version 2, or (at your option) |
| 15 | ;; any later version. | 15 | ;; any later version. |
| 16 | 16 | ||
| 17 | ;; This file is distributed in the hope that it will be useful, | 17 | ;; GNU Emacs is distributed in the hope that it will be useful, |
| 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 20 | ;; GNU General Public License for more details. | 20 | ;; GNU General Public License for more details. |
| 21 | 21 | ||
| 22 | ;; You should have received a copy of the GNU General Public License | 22 | ;; You should have received a copy of the GNU General Public License |
| 23 | ;; along with GNU Emacs; see the file COPYING. If not, write to | 23 | ;; along with GNU Emacs; see the file COPYING. If not, write to the |
| 24 | ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 24 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 25 | ;; Boston, MA 02110-1301, USA. | 25 | ;; Boston, MA 02110-1301, USA. |
| 26 | 26 | ||
| 27 | ;;; Commentary: | 27 | ;;; Commentary: |
| @@ -32,41 +32,44 @@ | |||
| 32 | ;; maintained with Python. That isn't covered by an FSF copyright | 32 | ;; maintained with Python. That isn't covered by an FSF copyright |
| 33 | ;; assignment, unlike this code, and seems not to be well-maintained | 33 | ;; assignment, unlike this code, and seems not to be well-maintained |
| 34 | ;; for Emacs (though I've submitted fixes). This mode is rather | 34 | ;; for Emacs (though I've submitted fixes). This mode is rather |
| 35 | ;; simpler and is, perhaps, better in other ways. In particular, | 35 | ;; simpler and is better in other ways. In particular, using the |
| 36 | ;; using the syntax functions with text properties maintained by | 36 | ;; syntax functions with text properties maintained by font-lock makes |
| 37 | ;; font-lock should make it more correct with arbitrary string and | 37 | ;; it more correct with arbitrary string and comment contents. |
| 38 | ;; comment contents. | ||
| 39 | 38 | ||
| 40 | ;; This doesn't implement all the facilities of python-mode.el. Some | 39 | ;; This doesn't implement all the facilities of python-mode.el. Some |
| 41 | ;; just need doing, e.g. catching exceptions in the inferior Python | 40 | ;; just need doing, e.g. catching exceptions in the inferior Python |
| 42 | ;; buffer (but see M-x pdb for debugging). [Actually, the use of | 41 | ;; buffer (but see M-x pdb for debugging). [Actually, the use of |
| 43 | ;; `compilation-minor-mode' now is probably enough for that.] Others | 42 | ;; `compilation-shell-minor-mode' now is probably enough for that.] |
| 44 | ;; don't seem appropriate. For instance, `forward-into-nomenclature' | 43 | ;; Others don't seem appropriate. For instance, |
| 45 | ;; should be done separately, since it's not specific to Python, and | 44 | ;; `forward-into-nomenclature' should be done separately, since it's |
| 46 | ;; I've installed a minor mode to do the job properly in Emacs 22. | 45 | ;; not specific to Python, and I've installed a minor mode to do the |
| 46 | ;; job properly in Emacs 23. [CC mode 5.31 contains an incompatible | ||
| 47 | ;; feature, `c-subword-mode' which is intended to have a similar | ||
| 48 | ;; effect, but actually only affects word-oriented keybindings.] | ||
| 49 | |||
| 47 | ;; Other things seem more natural or canonical here, e.g. the | 50 | ;; Other things seem more natural or canonical here, e.g. the |
| 48 | ;; {beginning,end}-of-defun implementation dealing with nested | 51 | ;; {beginning,end}-of-defun implementation dealing with nested |
| 49 | ;; definitions, and the inferior mode following `cmuscheme'. The | 52 | ;; definitions, and the inferior mode following `cmuscheme'. (The |
| 50 | ;; inferior mode can find the source of errors from | 53 | ;; inferior mode can find the source of errors from |
| 51 | ;; `python-send-region' & al via `compilation-minor-mode'. Successive | 54 | ;; `python-send-region' & al via `compilation-shell-minor-mode'.) |
| 52 | ;; TABs cycle between possible indentations for the line. There is | 55 | ;; There is (limited) symbol completion using lookup in Python and |
| 53 | ;; symbol completion using lookup in Python. | 56 | ;; Eldoc support also using the inferior process. Successive TABs |
| 57 | ;; cycle between possible indentations for the line. | ||
| 54 | 58 | ||
| 55 | ;; Even where it has similar facilities, this is incompatible with | 59 | ;; Even where it has similar facilities, this mode is incompatible |
| 56 | ;; python-mode.el in various respects. For instance, various key | 60 | ;; with python-mode.el in some respects. For instance, various key |
| 57 | ;; bindings are changed to obey Emacs conventions, and things like | 61 | ;; bindings are changed to obey Emacs conventions. |
| 58 | ;; marking blocks and `beginning-of-defun' behave differently. | ||
| 59 | 62 | ||
| 60 | ;; TODO: See various Fixmes below. | 63 | ;; TODO: See various Fixmes below. |
| 61 | 64 | ||
| 62 | ;;; Code: | 65 | ;;; Code: |
| 63 | 66 | ||
| 64 | ;; It's messy to autoload the relevant comint functions so that comint | ||
| 65 | ;; is only required when inferior Python is used. | ||
| 66 | (require 'comint) | ||
| 67 | (eval-when-compile | 67 | (eval-when-compile |
| 68 | (require 'cl) | ||
| 68 | (require 'compile) | 69 | (require 'compile) |
| 69 | (autoload 'info-lookup-maybe-add-help "info-look")) | 70 | (require 'comint)) |
| 71 | |||
| 72 | (autoload 'comint-mode "comint") | ||
| 70 | 73 | ||
| 71 | (defgroup python nil | 74 | (defgroup python nil |
| 72 | "Silly walks in the Python language." | 75 | "Silly walks in the Python language." |
| @@ -84,31 +87,37 @@ | |||
| 84 | ;;;; Font lock | 87 | ;;;; Font lock |
| 85 | 88 | ||
| 86 | (defvar python-font-lock-keywords | 89 | (defvar python-font-lock-keywords |
| 87 | `(,(rx (and word-start | 90 | `(,(rx symbol-start |
| 88 | ;; From v 2.3 reference. | 91 | ;; From v 2.4 reference. |
| 89 | ;; def and class dealt with separately below | 92 | ;; def and class dealt with separately below |
| 90 | (or "and" "assert" "break" "continue" "del" "elif" "else" | 93 | (or "and" "assert" "break" "continue" "del" "elif" "else" |
| 91 | "except" "exec" "finally" "for" "from" "global" "if" | 94 | "except" "exec" "finally" "for" "from" "global" "if" |
| 92 | "import" "in" "is" "lambda" "not" "or" "pass" "print" | 95 | "import" "in" "is" "lambda" "not" "or" "pass" "print" |
| 93 | "raise" "return" "try" "while" "yield" | 96 | "raise" "return" "try" "while" "yield" |
| 94 | ;; Future keywords | 97 | ;; Future keywords |
| 95 | "as" "None") | 98 | "as" "None") |
| 96 | word-end)) | 99 | symbol-end) |
| 97 | (,(rx (and word-start (group "class") (1+ space) (group (1+ word)))) | 100 | ;; Definitions |
| 98 | (1 font-lock-keyword-face) (2 font-lock-type-face)) | 101 | (,(rx symbol-start (group "class") (1+ space) (group (1+ (or word ?_)))) |
| 99 | (,(rx (and word-start (group "def") (1+ space) (group (1+ word)))) | 102 | (1 font-lock-keyword-face) (2 font-lock-type-face)) |
| 100 | (1 font-lock-keyword-face) (2 font-lock-function-name-face)))) | 103 | (,(rx symbol-start (group "def") (1+ space) (group (1+ (or word ?_)))) |
| 104 | (1 font-lock-keyword-face) (2 font-lock-function-name-face)) | ||
| 105 | ;; Top-level assignments are worth highlighting. | ||
| 106 | (,(rx line-start (group (1+ (or word ?_))) (0+ space) "=") | ||
| 107 | (1 font-lock-variable-name-face)) | ||
| 108 | (,(rx "@" (1+ (or word ?_))) ; decorators | ||
| 109 | (0 font-lock-preprocessor-face)))) | ||
| 101 | 110 | ||
| 102 | (defconst python-font-lock-syntactic-keywords | 111 | (defconst python-font-lock-syntactic-keywords |
| 103 | ;; Make outer chars of matching triple-quote sequences into generic | 112 | ;; Make outer chars of matching triple-quote sequences into generic |
| 104 | ;; string delimiters. Fixme: Is there a better way? | 113 | ;; string delimiters. Fixme: Is there a better way? |
| 105 | `((,(rx (and (or line-start buffer-start (not (syntax escape))) ; avoid escaped | 114 | `((,(rx (or line-start buffer-start |
| 106 | ; leading quote | 115 | (not (syntax escape))) ; avoid escaped leading quote |
| 107 | (group (optional (any "uUrR"))) ; prefix gets syntax property | 116 | (group (optional (any "uUrR"))) ; prefix gets syntax property |
| 108 | (optional (any "rR")) ; possible second prefix | 117 | (optional (any "rR")) ; possible second prefix |
| 109 | (group (syntax string-quote)) ; maybe gets property | 118 | (group (syntax string-quote)) ; maybe gets property |
| 110 | (backref 2) ; per first quote | 119 | (backref 2) ; per first quote |
| 111 | (group (backref 2)))) ; maybe gets property | 120 | (group (backref 2))) ; maybe gets property |
| 112 | (1 (python-quote-syntax 1)) | 121 | (1 (python-quote-syntax 1)) |
| 113 | (2 (python-quote-syntax 2)) | 122 | (2 (python-quote-syntax 2)) |
| 114 | (3 (python-quote-syntax 3))) | 123 | (3 (python-quote-syntax 3))) |
| @@ -132,6 +141,8 @@ Used for syntactic keywords. N is the match number (1, 2 or 3)." | |||
| 132 | ;; x = ''' """ ' a | 141 | ;; x = ''' """ ' a |
| 133 | ;; ''' | 142 | ;; ''' |
| 134 | ;; x '"""' x """ \"""" x | 143 | ;; x '"""' x """ \"""" x |
| 144 | ;; Fixme: """""" goes wrong (due to syntax-ppss not getting the string | ||
| 145 | ;; fence context). | ||
| 135 | (save-excursion | 146 | (save-excursion |
| 136 | (goto-char (match-beginning 0)) | 147 | (goto-char (match-beginning 0)) |
| 137 | (cond | 148 | (cond |
| @@ -140,19 +151,17 @@ Used for syntactic keywords. N is the match number (1, 2 or 3)." | |||
| 140 | (let ((syntax (syntax-ppss))) | 151 | (let ((syntax (syntax-ppss))) |
| 141 | (when (eq t (nth 3 syntax)) ; after unclosed fence | 152 | (when (eq t (nth 3 syntax)) ; after unclosed fence |
| 142 | (goto-char (nth 8 syntax)) ; fence position | 153 | (goto-char (nth 8 syntax)) ; fence position |
| 143 | ;; Skip any prefix. | 154 | (skip-chars-forward "uUrR") ; skip any prefix |
| 144 | (if (memq (char-after) '(?u ?U ?R ?r)) | ||
| 145 | (skip-chars-forward "uUrR")) | ||
| 146 | ;; Is it a matching sequence? | 155 | ;; Is it a matching sequence? |
| 147 | (if (eq (char-after) (char-after (match-beginning 2))) | 156 | (if (eq (char-after) (char-after (match-beginning 2))) |
| 148 | (eval-when-compile (string-to-syntax "|")))))) | 157 | (eval-when-compile (string-to-syntax "|")))))) |
| 149 | ;; Consider property for initial char, accounting for prefixes. | 158 | ;; Consider property for initial char, accounting for prefixes. |
| 150 | ((or (and (= n 2) ; not prefix | 159 | ((or (and (= n 2) ; leading quote (not prefix) |
| 151 | (= (match-beginning 1) (match-end 1))) ; prefix is null | 160 | (= (match-beginning 1) (match-end 1))) ; prefix is null |
| 152 | (and (= n 1) ; prefix | 161 | (and (= n 1) ; prefix |
| 153 | (/= (match-beginning 1) (match-end 1)))) ; non-empty | 162 | (/= (match-beginning 1) (match-end 1)))) ; non-empty |
| 154 | (unless (eq 'string (syntax-ppss-context (syntax-ppss))) | 163 | (unless (eq 'string (syntax-ppss-context (syntax-ppss))) |
| 155 | (eval-when-compile (string-to-syntax "|")))) | 164 | (eval-when-compile (string-to-syntax "|")))) |
| 156 | ;; Otherwise (we're in a non-matching string) the property is | 165 | ;; Otherwise (we're in a non-matching string) the property is |
| 157 | ;; nil, which is OK. | 166 | ;; nil, which is OK. |
| 158 | ))) | 167 | ))) |
| @@ -204,23 +213,37 @@ Used for syntactic keywords. N is the match number (1, 2 or 3)." | |||
| 204 | (define-key map "\C-c\C-l" 'python-load-file) ; a la cmuscheme | 213 | (define-key map "\C-c\C-l" 'python-load-file) ; a la cmuscheme |
| 205 | (substitute-key-definition 'complete-symbol 'python-complete-symbol | 214 | (substitute-key-definition 'complete-symbol 'python-complete-symbol |
| 206 | map global-map) | 215 | map global-map) |
| 207 | ;; Fixme: Add :help to menu. | 216 | (define-key map "\C-c\C-i" 'python-find-imports) |
| 217 | (define-key map "\C-c\C-t" 'python-expand-template) | ||
| 208 | (easy-menu-define python-menu map "Python Mode menu" | 218 | (easy-menu-define python-menu map "Python Mode menu" |
| 209 | '("Python" | 219 | `("Python" |
| 210 | ["Shift region left" python-shift-left :active mark-active] | 220 | :help "Python-specific Features" |
| 211 | ["Shift region right" python-shift-right :active mark-active] | 221 | ["Shift region left" python-shift-left :active mark-active |
| 222 | :help "Shift by a single indentation step"] | ||
| 223 | ["Shift region right" python-shift-right :active mark-active | ||
| 224 | :help "Shift by a single indentation step"] | ||
| 212 | "-" | 225 | "-" |
| 213 | ["Mark block" python-mark-block] | 226 | ["Mark block" python-mark-block |
| 227 | :help "Mark innermost block around point"] | ||
| 214 | ["Mark def/class" mark-defun | 228 | ["Mark def/class" mark-defun |
| 215 | :help "Mark innermost definition around point"] | 229 | :help "Mark innermost definition around point"] |
| 216 | "-" | 230 | "-" |
| 217 | ["Start of block" python-beginning-of-block] | 231 | ["Start of block" python-beginning-of-block |
| 218 | ["End of block" python-end-of-block] | 232 | :help "Go to start of innermost definition around point"] |
| 233 | ["End of block" python-end-of-block | ||
| 234 | :help "Go to end of innermost definition around point"] | ||
| 219 | ["Start of def/class" beginning-of-defun | 235 | ["Start of def/class" beginning-of-defun |
| 220 | :help "Go to start of innermost definition around point"] | 236 | :help "Go to start of innermost definition around point"] |
| 221 | ["End of def/class" end-of-defun | 237 | ["End of def/class" end-of-defun |
| 222 | :help "Go to end of innermost definition around point"] | 238 | :help "Go to end of innermost definition around point"] |
| 223 | "-" | 239 | "-" |
| 240 | ("Templates..." | ||
| 241 | :help "Expand templates for compound statements" | ||
| 242 | :filter (lambda (&rest junk) | ||
| 243 | (mapcar (lambda (elt) | ||
| 244 | (vector (car elt) (cdr elt) t)) | ||
| 245 | python-skeletons))) ; defined later | ||
| 246 | "-" | ||
| 224 | ["Start interpreter" run-python | 247 | ["Start interpreter" run-python |
| 225 | :help "Run `inferior' Python in separate buffer"] | 248 | :help "Run `inferior' Python in separate buffer"] |
| 226 | ["Import/reload file" python-load-file | 249 | ["Import/reload file" python-load-file |
| @@ -233,12 +256,23 @@ Used for syntactic keywords. N is the match number (1, 2 or 3)." | |||
| 233 | :help "Evaluate current definition in inferior Python session"] | 256 | :help "Evaluate current definition in inferior Python session"] |
| 234 | ["Switch to interpreter" python-switch-to-python | 257 | ["Switch to interpreter" python-switch-to-python |
| 235 | :help "Switch to inferior Python buffer"] | 258 | :help "Switch to inferior Python buffer"] |
| 259 | ["Set default process" python-set-proc | ||
| 260 | :help "Make buffer's inferior process the default" | ||
| 261 | :active (buffer-live-p python-buffer)] | ||
| 236 | ["Check file" python-check :help "Run pychecker"] | 262 | ["Check file" python-check :help "Run pychecker"] |
| 237 | ["Debugger" pdb :help "Run pdb under GUD"] | 263 | ["Debugger" pdb :help "Run pdb under GUD"] |
| 238 | "-" | 264 | "-" |
| 239 | ["Help on symbol" python-describe-symbol | 265 | ["Help on symbol" python-describe-symbol |
| 240 | :help "Use pydoc on symbol at point"])) | 266 | :help "Use pydoc on symbol at point"] |
| 267 | ["Complete symbol" python-complete-symbol | ||
| 268 | :help "Complete (qualified) symbol before point"] | ||
| 269 | ["Update imports" python-find-imports | ||
| 270 | :help "Update list of top-level imports for completion"])) | ||
| 241 | map)) | 271 | map)) |
| 272 | ;; Fixme: add toolbar stuff for useful things like symbol help, send | ||
| 273 | ;; region, at least. (Shouldn't be specific to Python, obviously.) | ||
| 274 | ;; eric has items including: (un)indent, (un)comment, restart script, | ||
| 275 | ;; run script, debug script; also things for profiling, unit testing. | ||
| 242 | 276 | ||
| 243 | (defvar python-mode-syntax-table | 277 | (defvar python-mode-syntax-table |
| 244 | (let ((table (make-syntax-table))) | 278 | (let ((table (make-syntax-table))) |
| @@ -263,7 +297,8 @@ Used for syntactic keywords. N is the match number (1, 2 or 3)." | |||
| 263 | 297 | ||
| 264 | (defsubst python-in-string/comment () | 298 | (defsubst python-in-string/comment () |
| 265 | "Return non-nil if point is in a Python literal (a comment or string)." | 299 | "Return non-nil if point is in a Python literal (a comment or string)." |
| 266 | (syntax-ppss-context (syntax-ppss))) | 300 | ;; We don't need to save the match data. |
| 301 | (nth 8 (syntax-ppss))) | ||
| 267 | 302 | ||
| 268 | (defconst python-space-backslash-table | 303 | (defconst python-space-backslash-table |
| 269 | (let ((table (copy-syntax-table python-mode-syntax-table))) | 304 | (let ((table (copy-syntax-table python-mode-syntax-table))) |
| @@ -273,13 +308,21 @@ Used for syntactic keywords. N is the match number (1, 2 or 3)." | |||
| 273 | 308 | ||
| 274 | (defun python-skip-comments/blanks (&optional backward) | 309 | (defun python-skip-comments/blanks (&optional backward) |
| 275 | "Skip comments and blank lines. | 310 | "Skip comments and blank lines. |
| 276 | BACKWARD non-nil means go backwards, otherwise go forwards. Backslash is | 311 | BACKWARD non-nil means go backwards, otherwise go forwards. |
| 277 | treated as whitespace so that continued blank lines are skipped. | 312 | Backslash is treated as whitespace so that continued blank lines |
| 278 | Doesn't move out of comments -- should be outside or at end of line." | 313 | are skipped. Doesn't move out of comments -- should be outside |
| 279 | (with-syntax-table python-space-backslash-table | 314 | or at end of line." |
| 280 | (forward-comment (if backward | 315 | (let ((arg (if backward |
| 281 | most-negative-fixnum | 316 | ;; If we're in a comment (including on the trailing |
| 282 | most-positive-fixnum)))) | 317 | ;; newline), forward-comment doesn't move backwards out |
| 318 | ;; of it. Don't set the syntax table round this bit! | ||
| 319 | (let ((syntax (syntax-ppss))) | ||
| 320 | (if (nth 4 syntax) | ||
| 321 | (goto-char (nth 8 syntax))) | ||
| 322 | (- (point-max))) | ||
| 323 | (point-max)))) | ||
| 324 | (with-syntax-table python-space-backslash-table | ||
| 325 | (forward-comment arg)))) | ||
| 283 | 326 | ||
| 284 | (defun python-backslash-continuation-line-p () | 327 | (defun python-backslash-continuation-line-p () |
| 285 | "Non-nil if preceding line ends with backslash that is not in a comment." | 328 | "Non-nil if preceding line ends with backslash that is not in a comment." |
| @@ -289,12 +332,17 @@ Doesn't move out of comments -- should be outside or at end of line." | |||
| 289 | (defun python-continuation-line-p () | 332 | (defun python-continuation-line-p () |
| 290 | "Return non-nil if current line continues a previous one. | 333 | "Return non-nil if current line continues a previous one. |
| 291 | The criteria are that the previous line ends in a backslash outside | 334 | The criteria are that the previous line ends in a backslash outside |
| 292 | comments and strings, or that the bracket/paren nesting depth is nonzero." | 335 | comments and strings, or that point is within brackets/parens." |
| 293 | (or (and (eq ?\\ (char-before (line-end-position 0))) | 336 | (or (python-backslash-continuation-line-p) |
| 294 | (not (syntax-ppss-context (syntax-ppss)))) | 337 | (let ((depth (syntax-ppss-depth |
| 295 | (< 0 (syntax-ppss-depth | 338 | (save-excursion ; syntax-ppss with arg changes point |
| 296 | (save-excursion ; syntax-ppss with arg changes point | 339 | (syntax-ppss (line-beginning-position)))))) |
| 297 | (syntax-ppss (line-beginning-position))))))) | 340 | (or (> depth 0) |
| 341 | (if (< depth 0) ; Unbalanced brackets -- act locally | ||
| 342 | (save-excursion | ||
| 343 | (condition-case () | ||
| 344 | (progn (backward-up-list) t) ; actually within brackets | ||
| 345 | (error nil)))))))) | ||
| 298 | 346 | ||
| 299 | (defun python-comment-line-p () | 347 | (defun python-comment-line-p () |
| 300 | "Return non-nil iff current line has only a comment." | 348 | "Return non-nil iff current line has only a comment." |
| @@ -304,6 +352,12 @@ comments and strings, or that the bracket/paren nesting depth is nonzero." | |||
| 304 | (back-to-indentation) | 352 | (back-to-indentation) |
| 305 | (looking-at (rx (or (syntax comment-start) line-end)))))) | 353 | (looking-at (rx (or (syntax comment-start) line-end)))))) |
| 306 | 354 | ||
| 355 | (defun python-blank-line-p () | ||
| 356 | "Return non-nil iff current line is blank." | ||
| 357 | (save-excursion | ||
| 358 | (beginning-of-line) | ||
| 359 | (looking-at "\\s-*$"))) | ||
| 360 | |||
| 307 | (defun python-beginning-of-string () | 361 | (defun python-beginning-of-string () |
| 308 | "Go to beginning of string around point. | 362 | "Go to beginning of string around point. |
| 309 | Do nothing if not in string." | 363 | Do nothing if not in string." |
| @@ -316,83 +370,70 @@ Do nothing if not in string." | |||
| 316 | BOS non-nil means point is known to be at beginning of statement." | 370 | BOS non-nil means point is known to be at beginning of statement." |
| 317 | (save-excursion | 371 | (save-excursion |
| 318 | (unless bos (python-beginning-of-statement)) | 372 | (unless bos (python-beginning-of-statement)) |
| 319 | (and (not (python-comment-line-p)) | 373 | (looking-at (rx (and (or "if" "else" "elif" "while" "for" "def" |
| 320 | (re-search-forward (rx (and ?: (0+ space) | 374 | "class" "try" "except" "finally") |
| 321 | (optional (and (syntax comment-start) | 375 | symbol-end))))) |
| 322 | (0+ not-newline))) | ||
| 323 | line-end)) | ||
| 324 | (save-excursion (python-end-of-statement)) | ||
| 325 | t) | ||
| 326 | (not (progn (goto-char (match-beginning 0)) | ||
| 327 | (python-in-string/comment)))))) | ||
| 328 | 376 | ||
| 329 | (defun python-close-block-statement-p (&optional bos) | 377 | (defun python-close-block-statement-p (&optional bos) |
| 330 | "Return non-nil if current line is a statement closing a block. | 378 | "Return non-nil if current line is a statement closing a block. |
| 331 | BOS non-nil means point is at beginning of statement. | 379 | BOS non-nil means point is at beginning of statement. |
| 332 | The criteria are that the line isn't a comment or in string and starts with | 380 | The criteria are that the line isn't a comment or in string and |
| 333 | keyword `raise', `break', `continue' or `pass'." | 381 | starts with keyword `raise', `break', `continue' or `pass'." |
| 334 | (save-excursion | 382 | (save-excursion |
| 335 | (unless bos (python-beginning-of-statement)) | 383 | (unless bos (python-beginning-of-statement)) |
| 336 | (back-to-indentation) | 384 | (back-to-indentation) |
| 337 | (looking-at (rx (and (or "return" "raise" "break" "continue" "pass") | 385 | (looking-at (rx (or "return" "raise" "break" "continue" "pass") |
| 338 | symbol-end))))) | 386 | symbol-end)))) |
| 339 | 387 | ||
| 340 | (defun python-outdent-p () | 388 | (defun python-outdent-p () |
| 341 | "Return non-nil if current line should outdent a level." | 389 | "Return non-nil if current line should outdent a level." |
| 342 | (save-excursion | 390 | (save-excursion |
| 343 | (back-to-indentation) | 391 | (back-to-indentation) |
| 344 | (and (looking-at (rx (and (or (and (or "else" "finally") symbol-end) | 392 | (and (looking-at (rx (and (or "else" "finally" "except" "elif") |
| 345 | (and (or "except" "elif") symbol-end | 393 | symbol-end))) |
| 346 | (1+ (not (any ?:))))) | 394 | (not (python-in-string/comment)) |
| 347 | (optional space) ":" (optional space) | ||
| 348 | (or (syntax comment-start) line-end)))) | ||
| 349 | (progn (end-of-line) | ||
| 350 | (not (python-in-string/comment))) | ||
| 351 | ;; Ensure there's a previous statement and move to it. | 395 | ;; Ensure there's a previous statement and move to it. |
| 352 | (zerop (python-previous-statement)) | 396 | (zerop (python-previous-statement)) |
| 353 | (not (python-close-block-statement-p t)) | 397 | (not (python-close-block-statement-p t)) |
| 354 | ;; Fixme: check this | 398 | ;; Fixme: check this |
| 355 | (not (looking-at (rx (and (or (and (or "if" "elif" "except" | 399 | (not (python-open-block-statement-p))))) |
| 356 | "for" "while") | ||
| 357 | symbol-end (1+ (not (any ?:)))) | ||
| 358 | (and "try" symbol-end)) | ||
| 359 | (optional space) ":" (optional space) | ||
| 360 | (or (syntax comment-start) line-end))))) | ||
| 361 | (progn (end-of-line) | ||
| 362 | (not (python-in-string/comment)))))) | ||
| 363 | 400 | ||
| 364 | ;;;; Indentation. | 401 | ;;;; Indentation. |
| 365 | 402 | ||
| 366 | (defcustom python-indent 4 | 403 | (defcustom python-indent 4 |
| 367 | "*Number of columns for a unit of indentation in Python mode. | 404 | "Number of columns for a unit of indentation in Python mode. |
| 368 | See also `\\[python-guess-indent]'" | 405 | See also `\\[python-guess-indent]'" |
| 369 | :group 'python | 406 | :group 'python |
| 370 | :type 'integer) | 407 | :type 'integer) |
| 371 | 408 | ||
| 372 | (defcustom python-guess-indent t | 409 | (defcustom python-guess-indent t |
| 373 | "*Non-nil means Python mode guesses `python-indent' for the buffer." | 410 | "Non-nil means Python mode guesses `python-indent' for the buffer." |
| 374 | :type 'boolean | 411 | :type 'boolean |
| 375 | :group 'python) | 412 | :group 'python) |
| 376 | 413 | ||
| 377 | (defcustom python-indent-string-contents t | 414 | (defcustom python-indent-string-contents t |
| 378 | "*Non-nil means indent contents of multi-line strings together. | 415 | "Non-nil means indent contents of multi-line strings together. |
| 379 | This means indent them the same as the preceding non-blank line. | 416 | This means indent them the same as the preceding non-blank line. |
| 380 | Otherwise indent them to column zero." | 417 | Otherwise preserve their indentation. |
| 418 | |||
| 419 | This only applies to `doc' strings, i.e. those that form statements; | ||
| 420 | the indentation is preserved in others." | ||
| 381 | :type '(choice (const :tag "Align with preceding" t) | 421 | :type '(choice (const :tag "Align with preceding" t) |
| 382 | (const :tag "Indent to column 0" nil)) | 422 | (const :tag "Preserve indentation" nil)) |
| 383 | :group 'python) | 423 | :group 'python) |
| 384 | 424 | ||
| 385 | (defcustom python-honour-comment-indentation nil | 425 | (defcustom python-honour-comment-indentation nil |
| 386 | "Non-nil means indent relative to preceding comment line. | 426 | "Non-nil means indent relative to preceding comment line. |
| 387 | Only do this for comments where the leading comment character is followed | 427 | Only do this for comments where the leading comment character is |
| 388 | by space. This doesn't apply to comment lines, which are always indented | 428 | followed by space. This doesn't apply to comment lines, which |
| 389 | in lines with preceding comments." | 429 | are always indented in lines with preceding comments." |
| 390 | :type 'boolean | 430 | :type 'boolean |
| 391 | :group 'python) | 431 | :group 'python) |
| 392 | 432 | ||
| 393 | (defcustom python-continuation-offset 4 | 433 | (defcustom python-continuation-offset 4 |
| 394 | "*Number of columns of additional indentation for continuation lines. | 434 | "Number of columns of additional indentation for continuation lines. |
| 395 | Continuation lines follow a backslash-terminated line starting a statement." | 435 | Continuation lines follow a backslash-terminated line starting a |
| 436 | statement." | ||
| 396 | :group 'python | 437 | :group 'python |
| 397 | :type 'integer) | 438 | :type 'integer) |
| 398 | 439 | ||
| @@ -406,9 +447,9 @@ Set `python-indent' locally to the value guessed." | |||
| 406 | (goto-char (point-min)) | 447 | (goto-char (point-min)) |
| 407 | (let (done indent) | 448 | (let (done indent) |
| 408 | (while (and (not done) (not (eobp))) | 449 | (while (and (not done) (not (eobp))) |
| 409 | (when (and (re-search-forward (rx (and ?: (0+ space) | 450 | (when (and (re-search-forward (rx ?: (0+ space) |
| 410 | (or (syntax comment-start) | 451 | (or (syntax comment-start) |
| 411 | line-end))) | 452 | line-end)) |
| 412 | nil 'move) | 453 | nil 'move) |
| 413 | (python-open-block-statement-p)) | 454 | (python-open-block-statement-p)) |
| 414 | (save-excursion | 455 | (save-excursion |
| @@ -425,8 +466,21 @@ Set `python-indent' locally to the value guessed." | |||
| 425 | (setq indent-tabs-mode nil))) | 466 | (setq indent-tabs-mode nil))) |
| 426 | indent))))) | 467 | indent))))) |
| 427 | 468 | ||
| 469 | ;; Alist of possible indentations and start of statement they would | ||
| 470 | ;; close. Used in indentation cycling (below). | ||
| 471 | (defvar python-indent-list nil | ||
| 472 | "Internal use.") | ||
| 473 | ;; Length of the above | ||
| 474 | (defvar python-indent-list-length nil | ||
| 475 | "Internal use.") | ||
| 476 | ;; Current index into the alist. | ||
| 477 | (defvar python-indent-index nil | ||
| 478 | "Internal use.") | ||
| 479 | |||
| 428 | (defun python-calculate-indentation () | 480 | (defun python-calculate-indentation () |
| 429 | "Calculate Python indentation for line at point." | 481 | "Calculate Python indentation for line at point." |
| 482 | (setq python-indent-list nil | ||
| 483 | python-indent-list-length 1) | ||
| 430 | (save-excursion | 484 | (save-excursion |
| 431 | (beginning-of-line) | 485 | (beginning-of-line) |
| 432 | (let ((syntax (syntax-ppss)) | 486 | (let ((syntax (syntax-ppss)) |
| @@ -434,17 +488,25 @@ Set `python-indent' locally to the value guessed." | |||
| 434 | (cond | 488 | (cond |
| 435 | ((eq 'string (syntax-ppss-context syntax)) ; multi-line string | 489 | ((eq 'string (syntax-ppss-context syntax)) ; multi-line string |
| 436 | (if (not python-indent-string-contents) | 490 | (if (not python-indent-string-contents) |
| 437 | 0 | 491 | (current-indentation) |
| 438 | (save-excursion | 492 | ;; Only respect `python-indent-string-contents' in doc |
| 493 | ;; strings (defined as those which form statements). | ||
| 494 | (if (not (save-excursion | ||
| 495 | (python-beginning-of-statement) | ||
| 496 | (looking-at (rx (or (syntax string-delimiter) | ||
| 497 | (syntax string-quote)))))) | ||
| 498 | (current-indentation) | ||
| 439 | ;; Find indentation of preceding non-blank line within string. | 499 | ;; Find indentation of preceding non-blank line within string. |
| 440 | (setq start (nth 8 syntax)) | 500 | (setq start (nth 8 syntax)) |
| 441 | (forward-line -1) | 501 | (forward-line -1) |
| 442 | (while (and (< start (point)) (looking-at "\\s-*$")) | 502 | (while (and (< start (point)) (looking-at "\\s-*$")) |
| 443 | (forward-line -1)) | 503 | (forward-line -1)) |
| 444 | (current-indentation)))) | 504 | (current-indentation)))) |
| 445 | ((python-continuation-line-p) | 505 | ((python-continuation-line-p) ; after backslash, or bracketed |
| 446 | (let ((point (point)) | 506 | (let ((point (point)) |
| 447 | (open-start (cadr syntax))) | 507 | (open-start (cadr syntax)) |
| 508 | (backslash (python-backslash-continuation-line-p)) | ||
| 509 | (colon (eq ?: (char-before (1- (line-beginning-position)))))) | ||
| 448 | (if open-start | 510 | (if open-start |
| 449 | ;; Inside bracketed expression. | 511 | ;; Inside bracketed expression. |
| 450 | (progn | 512 | (progn |
| @@ -458,7 +520,11 @@ Set `python-indent' locally to the value guessed." | |||
| 458 | (backward-sexp) | 520 | (backward-sexp) |
| 459 | (< (point) point)) | 521 | (< (point) point)) |
| 460 | (error nil)))) | 522 | (error nil)))) |
| 461 | (current-column) | 523 | ;; Extra level if we're backslash-continued or |
| 524 | ;; following a key. | ||
| 525 | (if (or backslash colon) | ||
| 526 | (+ python-indent (current-column)) | ||
| 527 | (current-column)) | ||
| 462 | ;; Otherwise indent relative to statement start, one | 528 | ;; Otherwise indent relative to statement start, one |
| 463 | ;; level per bracketing level. | 529 | ;; level per bracketing level. |
| 464 | (goto-char (1+ open-start)) | 530 | (goto-char (1+ open-start)) |
| @@ -472,112 +538,153 @@ Set `python-indent' locally to the value guessed." | |||
| 472 | (current-indentation) | 538 | (current-indentation) |
| 473 | ;; First continuation line. Indent one step, with an | 539 | ;; First continuation line. Indent one step, with an |
| 474 | ;; extra one if statement opens a block. | 540 | ;; extra one if statement opens a block. |
| 475 | (save-excursion | 541 | (python-beginning-of-statement) |
| 476 | (python-beginning-of-statement) | 542 | (+ (current-indentation) python-continuation-offset |
| 477 | (+ (current-indentation) python-continuation-offset | 543 | (if (python-open-block-statement-p t) |
| 478 | (if (python-open-block-statement-p t) | 544 | python-indent |
| 479 | python-indent | 545 | 0)))))) |
| 480 | 0))))))) | ||
| 481 | ((bobp) 0) | 546 | ((bobp) 0) |
| 482 | ;; Fixme: Like python-mode.el; not convinced by this. | 547 | ;; Fixme: Like python-mode.el; not convinced by this. |
| 483 | ((looking-at (rx (and (0+ space) (syntax comment-start) | 548 | ((looking-at (rx (0+ space) (syntax comment-start) |
| 484 | (not (any " \t\n"))))) ; non-indentable comment | 549 | (not (any " \t\n")))) ; non-indentable comment |
| 485 | (current-indentation)) | 550 | (current-indentation)) |
| 486 | (t (let ((point (point))) | 551 | (t (if python-honour-comment-indentation |
| 487 | (if python-honour-comment-indentation | 552 | ;; Back over whitespace, newlines, non-indentable comments. |
| 488 | ;; Back over whitespace, newlines, non-indentable comments. | 553 | (catch 'done |
| 489 | (catch 'done | 554 | (while t |
| 490 | (while t | 555 | (if (cond ((bobp)) |
| 491 | (if (cond ((bobp)) | 556 | ;; not at comment start |
| 492 | ;; not at comment start | 557 | ((not (forward-comment -1)) |
| 493 | ((not (forward-comment -1)) | 558 | (python-beginning-of-statement) |
| 494 | (python-beginning-of-statement) | 559 | t) |
| 495 | t) | 560 | ;; trailing comment |
| 496 | ;; trailing comment | 561 | ((/= (current-column) (current-indentation)) |
| 497 | ((/= (current-column) (current-indentation)) | 562 | (python-beginning-of-statement) |
| 498 | (python-beginning-of-statement) | 563 | t) |
| 499 | t) | 564 | ;; indentable comment like python-mode.el |
| 500 | ;; indentable comment like python-mode.el | 565 | ((and (looking-at (rx (syntax comment-start) |
| 501 | ((and (looking-at (rx (and (syntax comment-start) | 566 | (or space line-end))) |
| 502 | (or space line-end)))) | 567 | (/= 0 (current-column))))) |
| 503 | (/= 0 (current-column))))) | 568 | (throw 'done t))))) |
| 504 | (throw 'done t)))) | 569 | (python-indentation-levels) |
| 505 | ;; Else back over all comments. | 570 | ;; Prefer to indent comments with an immediately-following |
| 506 | (python-skip-comments/blanks t) | 571 | ;; statement, e.g. |
| 507 | (python-beginning-of-statement)) | 572 | ;; ... |
| 508 | ;; don't lose on bogus outdent | 573 | ;; # ... |
| 509 | (max 0 (+ (current-indentation) | 574 | ;; def ... |
| 510 | (or (cond ((python-open-block-statement-p t) | 575 | (when (and (> python-indent-list-length 1) |
| 511 | python-indent) | 576 | (python-comment-line-p)) |
| 512 | ((python-close-block-statement-p t) | 577 | (forward-line) |
| 513 | (- python-indent))) | 578 | (unless (python-comment-line-p) |
| 514 | (progn (goto-char point) | 579 | (let ((elt (assq (current-indentation) python-indent-list))) |
| 515 | (if (python-outdent-p) | 580 | (setq python-indent-list |
| 516 | (- python-indent))) | 581 | (nconc (delete elt python-indent-list) |
| 517 | 0))))))))) | 582 | (list elt)))))) |
| 518 | 583 | (caar (last python-indent-list))))))) | |
| 519 | (defun python-comment-indent () | ||
| 520 | "`comment-indent-function' for Python." | ||
| 521 | ;; If previous non-blank line was a comment, use its indentation. | ||
| 522 | ;; FIXME: This seems unnecessary since the default code delegates to | ||
| 523 | ;; indent-according-to-mode. --Stef | ||
| 524 | (unless (bobp) | ||
| 525 | (save-excursion | ||
| 526 | (forward-comment -1) | ||
| 527 | (if (eq ?# (char-after)) (current-column))))) | ||
| 528 | 584 | ||
| 529 | ;;;; Cycling through the possible indentations with successive TABs. | 585 | ;;;; Cycling through the possible indentations with successive TABs. |
| 530 | 586 | ||
| 531 | ;; These don't need to be buffer-local since they're only relevant | 587 | ;; These don't need to be buffer-local since they're only relevant |
| 532 | ;; during a cycle. | 588 | ;; during a cycle. |
| 533 | 589 | ||
| 534 | ;; Alist of possible indentations and start of statement they would close. | ||
| 535 | (defvar python-indent-list nil | ||
| 536 | "Internal use.") | ||
| 537 | ;; Length of the above | ||
| 538 | (defvar python-indent-list-length nil | ||
| 539 | "Internal use.") | ||
| 540 | ;; Current index into the alist. | ||
| 541 | (defvar python-indent-index nil | ||
| 542 | "Internal use.") | ||
| 543 | |||
| 544 | (defun python-initial-text () | 590 | (defun python-initial-text () |
| 545 | "Text of line following indentation and ignoring any trailing comment." | 591 | "Text of line following indentation and ignoring any trailing comment." |
| 546 | (buffer-substring (+ (line-beginning-position) (current-indentation)) | 592 | (save-excursion |
| 547 | (save-excursion | 593 | (buffer-substring (progn |
| 548 | (end-of-line) | 594 | (back-to-indentation) |
| 549 | (forward-comment -1) | 595 | (point)) |
| 550 | (point)))) | 596 | (progn |
| 597 | (end-of-line) | ||
| 598 | (forward-comment -1) | ||
| 599 | (point))))) | ||
| 600 | |||
| 601 | (defconst python-block-pairs | ||
| 602 | '(("else" "if" "elif" "while" "for" "try" "except") | ||
| 603 | ("elif" "if" "elif") | ||
| 604 | ("except" "try" "except") | ||
| 605 | ("finally" "try")) | ||
| 606 | "Alist of keyword matches. | ||
| 607 | The car of an element is a keyword introducing a statement which | ||
| 608 | can close a block opened by a keyword in the cdr.") | ||
| 609 | |||
| 610 | (defun python-first-word () | ||
| 611 | "Return first word (actually symbol) on the line." | ||
| 612 | (save-excursion | ||
| 613 | (back-to-indentation) | ||
| 614 | (current-word t))) | ||
| 551 | 615 | ||
| 552 | (defun python-indentation-levels () | 616 | (defun python-indentation-levels () |
| 553 | "Return a list of possible indentations for this line. | 617 | "Return a list of possible indentations for this line. |
| 618 | It is assumed not to be a continuation line or in a multi-line string. | ||
| 554 | Includes the default indentation and those which would close all | 619 | Includes the default indentation and those which would close all |
| 555 | enclosing blocks. Assumes the line has already been indented per | 620 | enclosing blocks. Elements of the list are actually pairs: |
| 556 | `python-indent-line'. Elements of the list are actually pairs: | ||
| 557 | \(INDENTATION . TEXT), where TEXT is the initial text of the | 621 | \(INDENTATION . TEXT), where TEXT is the initial text of the |
| 558 | corresponding block opening (or nil)." | 622 | corresponding block opening (or nil)." |
| 559 | (save-excursion | 623 | (save-excursion |
| 560 | (let ((levels (list (cons (current-indentation) | 624 | (let ((initial "") |
| 561 | (save-excursion | 625 | levels indent) |
| 562 | (if (python-beginning-of-block) | 626 | ;; Only one possibility immediately following a block open |
| 563 | (python-initial-text))))))) | 627 | ;; statement, assuming it doesn't have a `suite' on the same line. |
| 564 | ;; Only one possibility if we immediately follow a block open or | 628 | (cond |
| 565 | ;; are in a continuation line. | 629 | ((save-excursion (and (python-previous-statement) |
| 566 | (unless (or (python-continuation-line-p) | 630 | (python-open-block-statement-p t) |
| 567 | (save-excursion (and (python-previous-statement) | 631 | (setq indent (current-indentation)) |
| 568 | (python-open-block-statement-p t)))) | 632 | ;; Check we don't have something like: |
| 569 | (while (python-beginning-of-block) | 633 | ;; if ...: ... |
| 570 | (push (cons (current-indentation) (python-initial-text)) | 634 | (if (progn (python-end-of-statement) |
| 571 | levels))) | 635 | (python-skip-comments/blanks t) |
| 572 | levels))) | 636 | (eq ?: (char-before))) |
| 637 | (setq indent (+ python-indent indent))))) | ||
| 638 | (push (cons indent initial) levels)) | ||
| 639 | ;; Only one possibility for comment line immediately following | ||
| 640 | ;; another. | ||
| 641 | ((save-excursion | ||
| 642 | (when (python-comment-line-p) | ||
| 643 | (forward-line -1) | ||
| 644 | (if (python-comment-line-p) | ||
| 645 | (push (cons (current-indentation) initial) levels))))) | ||
| 646 | ;; Fixme: Maybe have a case here which indents (only) first | ||
| 647 | ;; line after a lambda. | ||
| 648 | (t | ||
| 649 | (let ((start (car (assoc (python-first-word) python-block-pairs)))) | ||
| 650 | (python-previous-statement) | ||
| 651 | ;; Is this a valid indentation for the line of interest? | ||
| 652 | (unless (or (if start ; potentially only outdentable | ||
| 653 | ;; Check for things like: | ||
| 654 | ;; if ...: ... | ||
| 655 | ;; else ...: | ||
| 656 | ;; where the second line need not be outdented. | ||
| 657 | (not (member (python-first-word) | ||
| 658 | (cdr (assoc start | ||
| 659 | python-block-pairs))))) | ||
| 660 | ;; Not sensible to indent to the same level as | ||
| 661 | ;; previous `return' &c. | ||
| 662 | (python-close-block-statement-p)) | ||
| 663 | (push (cons (current-indentation) (python-initial-text)) | ||
| 664 | levels)) | ||
| 665 | (while (python-beginning-of-block) | ||
| 666 | (when (or (not start) | ||
| 667 | (member (python-first-word) | ||
| 668 | (cdr (assoc start python-block-pairs)))) | ||
| 669 | (push (cons (current-indentation) (python-initial-text)) | ||
| 670 | levels)))))) | ||
| 671 | (prog1 (or levels (setq levels '((0 . "")))) | ||
| 672 | (setq python-indent-list levels | ||
| 673 | python-indent-list-length (length python-indent-list)))))) | ||
| 573 | 674 | ||
| 574 | ;; This is basically what `python-indent-line' would be if we didn't | 675 | ;; This is basically what `python-indent-line' would be if we didn't |
| 575 | ;; do the cycling. | 676 | ;; do the cycling. |
| 576 | (defun python-indent-line-1 () | 677 | (defun python-indent-line-1 (&optional leave) |
| 577 | "Subroutine of `python-indent-line'." | 678 | "Subroutine of `python-indent-line'. |
| 679 | Does non-repeated indentation. LEAVE non-nil means leave | ||
| 680 | indentation if it is valid, i.e. one of the positions returned by | ||
| 681 | `python-calculate-indentation'." | ||
| 578 | (let ((target (python-calculate-indentation)) | 682 | (let ((target (python-calculate-indentation)) |
| 579 | (pos (- (point-max) (point)))) | 683 | (pos (- (point-max) (point)))) |
| 580 | (if (= target (current-indentation)) | 684 | (if (or (= target (current-indentation)) |
| 685 | ;; Maybe keep a valid indentation. | ||
| 686 | (and leave python-indent-list | ||
| 687 | (assq (current-indentation) python-indent-list))) | ||
| 581 | (if (< (current-column) (current-indentation)) | 688 | (if (< (current-column) (current-indentation)) |
| 582 | (back-to-indentation)) | 689 | (back-to-indentation)) |
| 583 | (beginning-of-line) | 690 | (beginning-of-line) |
| @@ -589,29 +696,41 @@ corresponding block opening (or nil)." | |||
| 589 | (defun python-indent-line () | 696 | (defun python-indent-line () |
| 590 | "Indent current line as Python code. | 697 | "Indent current line as Python code. |
| 591 | When invoked via `indent-for-tab-command', cycle through possible | 698 | When invoked via `indent-for-tab-command', cycle through possible |
| 592 | indentations for current line. The cycle is broken by a command different | 699 | indentations for current line. The cycle is broken by a command |
| 593 | from `indent-for-tab-command', i.e. successive TABs do the cycling." | 700 | different from `indent-for-tab-command', i.e. successive TABs do |
| 701 | the cycling." | ||
| 594 | (interactive) | 702 | (interactive) |
| 595 | ;; Don't do extra work if invoked via `indent-region', for instance. | 703 | (if (and (eq this-command 'indent-for-tab-command) |
| 596 | (if (not (eq this-command 'indent-for-tab-command)) | 704 | (eq last-command this-command)) |
| 597 | (python-indent-line-1) | 705 | (if (= 1 python-indent-list-length) |
| 598 | (if (eq last-command this-command) | 706 | (message "Sole indentation") |
| 599 | (if (= 1 python-indent-list-length) | 707 | (progn (setq python-indent-index |
| 600 | (message "Sole indentation") | 708 | (% (1+ python-indent-index) python-indent-list-length)) |
| 601 | (progn (setq python-indent-index (% (1+ python-indent-index) | 709 | (beginning-of-line) |
| 602 | python-indent-list-length)) | 710 | (delete-horizontal-space) |
| 603 | (beginning-of-line) | 711 | (indent-to (car (nth python-indent-index python-indent-list))) |
| 604 | (delete-horizontal-space) | 712 | (if (python-block-end-p) |
| 605 | (indent-to (car (nth python-indent-index python-indent-list))) | 713 | (let ((text (cdr (nth python-indent-index |
| 606 | (if (python-block-end-p) | 714 | python-indent-list)))) |
| 607 | (let ((text (cdr (nth python-indent-index | 715 | (if text |
| 608 | python-indent-list)))) | 716 | (message "Closes: %s" text)))))) |
| 609 | (if text | 717 | (python-indent-line-1) |
| 610 | (message "Closes: %s" text)))))) | 718 | (setq python-indent-index (1- python-indent-list-length)))) |
| 611 | (python-indent-line-1) | 719 | |
| 612 | (setq python-indent-list (python-indentation-levels) | 720 | (defun python-indent-region (start end) |
| 613 | python-indent-list-length (length python-indent-list) | 721 | "`indent-region-function' for Python. |
| 614 | python-indent-index (1- python-indent-list-length))))) | 722 | Leaves validly-indented lines alone, i.e. doesn't indent to |
| 723 | another valid position." | ||
| 724 | (save-excursion | ||
| 725 | (goto-char end) | ||
| 726 | (setq end (point-marker)) | ||
| 727 | (goto-char start) | ||
| 728 | (or (bolp) (forward-line 1)) | ||
| 729 | (while (< (point) end) | ||
| 730 | (or (and (bolp) (eolp)) | ||
| 731 | (python-indent-line-1 t)) | ||
| 732 | (forward-line 1)) | ||
| 733 | (move-marker end nil))) | ||
| 615 | 734 | ||
| 616 | (defun python-block-end-p () | 735 | (defun python-block-end-p () |
| 617 | "Non-nil if this is a line in a statement closing a block, | 736 | "Non-nil if this is a line in a statement closing a block, |
| @@ -622,40 +741,41 @@ or a blank line indented to where it would close a block." | |||
| 622 | (save-excursion | 741 | (save-excursion |
| 623 | (python-previous-statement) | 742 | (python-previous-statement) |
| 624 | (current-indentation)))))) | 743 | (current-indentation)))))) |
| 625 | |||
| 626 | ;; Fixme: Define an indent-region-function. It should probably leave | ||
| 627 | ;; lines alone if the indentation is already at one of the allowed | ||
| 628 | ;; levels. Otherwise, M-C-\ typically keeps indenting more deeply | ||
| 629 | ;; down a function. | ||
| 630 | 744 | ||
| 631 | ;;;; Movement. | 745 | ;;;; Movement. |
| 632 | 746 | ||
| 747 | ;; Fixme: Define {for,back}ward-sexp-function? Maybe skip units like | ||
| 748 | ;; block, statement, depending on context. | ||
| 749 | |||
| 633 | (defun python-beginning-of-defun () | 750 | (defun python-beginning-of-defun () |
| 634 | "`beginning-of-defun-function' for Python. | 751 | "`beginning-of-defun-function' for Python. |
| 635 | Finds beginning of innermost nested class or method definition. | 752 | Finds beginning of innermost nested class or method definition. |
| 636 | Returns the name of the definition found at the end, or nil if reached | 753 | Returns the name of the definition found at the end, or nil if |
| 637 | start of buffer." | 754 | reached start of buffer." |
| 638 | (let ((ci (current-indentation)) | 755 | (let ((ci (current-indentation)) |
| 639 | (def-re (rx (and line-start (0+ space) (or "def" "class") | 756 | (def-re (rx line-start (0+ space) (or "def" "class") (1+ space) |
| 640 | (1+ space) | 757 | (group (1+ (or word (syntax symbol)))))) |
| 641 | (group (1+ (or word (syntax symbol))))))) | 758 | found lep) ;; def-line |
| 642 | found lep def-line) | ||
| 643 | (if (python-comment-line-p) | 759 | (if (python-comment-line-p) |
| 644 | (setq ci most-positive-fixnum)) | 760 | (setq ci most-positive-fixnum)) |
| 645 | (while (and (not (bobp)) (not found)) | 761 | (while (and (not (bobp)) (not found)) |
| 646 | ;; Treat bol at beginning of function as outside function so | 762 | ;; Treat bol at beginning of function as outside function so |
| 647 | ;; that successive C-M-a makes progress backwards. | 763 | ;; that successive C-M-a makes progress backwards. |
| 648 | (setq def-line (looking-at def-re)) | 764 | ;;(setq def-line (looking-at def-re)) |
| 649 | (unless (bolp) (end-of-line)) | 765 | (unless (bolp) (end-of-line)) |
| 650 | (setq lep (line-end-position)) | 766 | (setq lep (line-end-position)) |
| 651 | (if (and (re-search-backward def-re nil 'move) | 767 | (if (and (re-search-backward def-re nil 'move) |
| 652 | ;; Must be less indented or matching top level, or | 768 | ;; Must be less indented or matching top level, or |
| 653 | ;; equally indented if we started on a definition line. | 769 | ;; equally indented if we started on a definition line. |
| 654 | (let ((in (current-indentation))) | 770 | (let ((in (current-indentation))) |
| 655 | (or (and (zerop ci) (zerop in)) | 771 | (or (and (zerop ci) (zerop in)) |
| 656 | (= lep (line-end-position)) ; on initial line | 772 | (= lep (line-end-position)) ; on initial line |
| 657 | (and def-line (= in ci)) | 773 | ;; Not sure why it was like this -- fails in case of |
| 658 | (< in ci))) | 774 | ;; last internal function followed by first |
| 775 | ;; non-def statement of the main body. | ||
| 776 | ;;(and def-line (= in ci)) | ||
| 777 | (= in ci) | ||
| 778 | (< in ci))) | ||
| 659 | (not (python-in-string/comment))) | 779 | (not (python-in-string/comment))) |
| 660 | (setq found t))))) | 780 | (setq found t))))) |
| 661 | 781 | ||
| @@ -663,7 +783,7 @@ start of buffer." | |||
| 663 | "`end-of-defun-function' for Python. | 783 | "`end-of-defun-function' for Python. |
| 664 | Finds end of innermost nested class or method definition." | 784 | Finds end of innermost nested class or method definition." |
| 665 | (let ((orig (point)) | 785 | (let ((orig (point)) |
| 666 | (pattern (rx (and line-start (0+ space) (or "def" "class") space)))) | 786 | (pattern (rx line-start (0+ space) (or "def" "class") space))) |
| 667 | ;; Go to start of current block and check whether it's at top | 787 | ;; Go to start of current block and check whether it's at top |
| 668 | ;; level. If it is, and not a block start, look forward for | 788 | ;; level. If it is, and not a block start, look forward for |
| 669 | ;; definition statement. | 789 | ;; definition statement. |
| @@ -692,8 +812,9 @@ Finds end of innermost nested class or method definition." | |||
| 692 | (python-end-of-block) | 812 | (python-end-of-block) |
| 693 | ;; Count trailing space in defun (but not trailing comments). | 813 | ;; Count trailing space in defun (but not trailing comments). |
| 694 | (skip-syntax-forward " >") | 814 | (skip-syntax-forward " >") |
| 695 | (beginning-of-line)) | 815 | (unless (eobp) ; e.g. missing final newline |
| 696 | ;; Catch pathological case like this, where the beginning-of-defun | 816 | (beginning-of-line))) |
| 817 | ;; Catch pathological cases like this, where the beginning-of-defun | ||
| 697 | ;; skips to a definition we're not in: | 818 | ;; skips to a definition we're not in: |
| 698 | ;; if ...: | 819 | ;; if ...: |
| 699 | ;; ... | 820 | ;; ... |
| @@ -706,26 +827,43 @@ Finds end of innermost nested class or method definition." | |||
| 706 | 827 | ||
| 707 | (defun python-beginning-of-statement () | 828 | (defun python-beginning-of-statement () |
| 708 | "Go to start of current statement. | 829 | "Go to start of current statement. |
| 709 | Accounts for continuation lines, multi-line strings, and multi-line bracketed | 830 | Accounts for continuation lines, multi-line strings, and |
| 710 | expressions." | 831 | multi-line bracketed expressions." |
| 711 | (beginning-of-line) | 832 | (beginning-of-line) |
| 712 | (python-beginning-of-string) | 833 | (python-beginning-of-string) |
| 713 | (catch 'foo | 834 | (while (python-continuation-line-p) |
| 714 | (while (python-continuation-line-p) | 835 | (beginning-of-line) |
| 715 | (beginning-of-line) | 836 | (if (python-backslash-continuation-line-p) |
| 716 | (if (python-backslash-continuation-line-p) | 837 | (progn |
| 838 | (forward-line -1) | ||
| 717 | (while (python-backslash-continuation-line-p) | 839 | (while (python-backslash-continuation-line-p) |
| 718 | (forward-line -1)) | 840 | (forward-line -1))) |
| 719 | (python-beginning-of-string) | 841 | (python-beginning-of-string) |
| 720 | ;; Skip forward out of nested brackets. | 842 | (python-skip-out))) |
| 721 | (condition-case () ; beware invalid syntax | ||
| 722 | (let ((depth (syntax-ppss-depth (syntax-ppss)))) | ||
| 723 | ;; Beware negative depths. | ||
| 724 | (if (> depth 0) (backward-up-list depth)) | ||
| 725 | t) | ||
| 726 | (error (throw 'foo nil)))))) | ||
| 727 | (back-to-indentation)) | 843 | (back-to-indentation)) |
| 728 | 844 | ||
| 845 | (defun python-skip-out (&optional forward syntax) | ||
| 846 | "Skip out of any nested brackets. | ||
| 847 | Skip forward if FORWARD is non-nil, else backward. | ||
| 848 | If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point. | ||
| 849 | Return non-nil iff skipping was done." | ||
| 850 | (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss)))) | ||
| 851 | (forward (if forward -1 1))) | ||
| 852 | (unless (zerop depth) | ||
| 853 | (if (> depth 0) | ||
| 854 | ;; Skip forward out of nested brackets. | ||
| 855 | (condition-case () ; beware invalid syntax | ||
| 856 | (progn (backward-up-list (* forward depth)) t) | ||
| 857 | (error nil)) | ||
| 858 | ;; Invalid syntax (too many closed brackets). | ||
| 859 | ;; Skip out of as many as possible. | ||
| 860 | (let (done) | ||
| 861 | (while (condition-case () | ||
| 862 | (progn (backward-up-list forward) | ||
| 863 | (setq done t)) | ||
| 864 | (error nil))) | ||
| 865 | done))))) | ||
| 866 | |||
| 729 | (defun python-end-of-statement () | 867 | (defun python-end-of-statement () |
| 730 | "Go to the end of the current statement and return point. | 868 | "Go to the end of the current statement and return point. |
| 731 | Usually this is the start of the next line, but if this is a | 869 | Usually this is the start of the next line, but if this is a |
| @@ -745,13 +883,7 @@ On a comment line, go to end of line." | |||
| 745 | (condition-case () ; beware invalid syntax | 883 | (condition-case () ; beware invalid syntax |
| 746 | (progn (forward-sexp) t) | 884 | (progn (forward-sexp) t) |
| 747 | (error (end-of-line)))) | 885 | (error (end-of-line)))) |
| 748 | ((> (syntax-ppss-depth s) 0) | 886 | ((python-skip-out t s)))) |
| 749 | ;; Skip forward out of nested brackets. | ||
| 750 | (condition-case () ; beware invalid syntax | ||
| 751 | (progn (backward-up-list | ||
| 752 | (- (syntax-ppss-depth s))) | ||
| 753 | t) | ||
| 754 | (error (end-of-line)))))) | ||
| 755 | (end-of-line)) | 887 | (end-of-line)) |
| 756 | (unless comment | 888 | (unless comment |
| 757 | (eq ?\\ (char-before)))) ; Line continued? | 889 | (eq ?\\ (char-before)))) ; Line continued? |
| @@ -785,7 +917,8 @@ Return count of statements left to move." | |||
| 785 | (while (and (> count 0) (not (eobp))) | 917 | (while (and (> count 0) (not (eobp))) |
| 786 | (python-end-of-statement) | 918 | (python-end-of-statement) |
| 787 | (python-skip-comments/blanks) | 919 | (python-skip-comments/blanks) |
| 788 | (setq count (1- count))) | 920 | (unless (eobp) |
| 921 | (setq count (1- count)))) | ||
| 789 | count)) | 922 | count)) |
| 790 | 923 | ||
| 791 | (defun python-beginning-of-block (&optional arg) | 924 | (defun python-beginning-of-block (&optional arg) |
| @@ -802,7 +935,8 @@ Otherwise return non-nil." | |||
| 802 | ((< arg 0) (python-end-of-block (- arg))) | 935 | ((< arg 0) (python-end-of-block (- arg))) |
| 803 | (t | 936 | (t |
| 804 | (let ((point (point))) | 937 | (let ((point (point))) |
| 805 | (if (python-comment-line-p) | 938 | (if (or (python-comment-line-p) |
| 939 | (python-blank-line-p)) | ||
| 806 | (python-skip-comments/blanks t)) | 940 | (python-skip-comments/blanks t)) |
| 807 | (python-beginning-of-statement) | 941 | (python-beginning-of-statement) |
| 808 | (let ((ci (current-indentation))) | 942 | (let ((ci (current-indentation))) |
| @@ -830,32 +964,31 @@ Otherwise return non-nil." | |||
| 830 | 964 | ||
| 831 | (defun python-end-of-block (&optional arg) | 965 | (defun python-end-of-block (&optional arg) |
| 832 | "Go to end of current block. | 966 | "Go to end of current block. |
| 833 | With numeric arg, do it that many times. If ARG is negative, call | 967 | With numeric arg, do it that many times. If ARG is negative, |
| 834 | `python-beginning-of-block' instead. | 968 | call `python-beginning-of-block' instead. |
| 835 | If current statement is in column zero and doesn't open a block, don't | 969 | If current statement is in column zero and doesn't open a block, |
| 836 | move and return nil. Otherwise return t." | 970 | don't move and return nil. Otherwise return t." |
| 837 | (interactive "p") | 971 | (interactive "p") |
| 838 | (unless arg (setq arg 1)) | 972 | (unless arg (setq arg 1)) |
| 839 | (if (< arg 0) | 973 | (if (< arg 0) |
| 840 | (python-beginning-of-block (- arg))) | 974 | (python-beginning-of-block (- arg)) |
| 841 | (while (and (> arg 0) | 975 | (while (and (> arg 0) |
| 842 | (let* ((point (point)) | 976 | (let* ((point (point)) |
| 843 | (_ (if (python-comment-line-p) | 977 | (_ (if (python-comment-line-p) |
| 844 | (python-skip-comments/blanks t))) | 978 | (python-skip-comments/blanks t))) |
| 845 | (ci (current-indentation)) | 979 | (ci (current-indentation)) |
| 846 | (open (python-open-block-statement-p))) | 980 | (open (python-open-block-statement-p))) |
| 847 | (if (and (zerop ci) (not open)) | 981 | (if (and (zerop ci) (not open)) |
| 848 | (not (goto-char point)) | 982 | (not (goto-char point)) |
| 849 | (catch 'done | 983 | (catch 'done |
| 850 | (while (zerop (python-next-statement)) | 984 | (while (zerop (python-next-statement)) |
| 851 | (when (or (and open (<= (current-indentation) ci)) | 985 | (when (or (and open (<= (current-indentation) ci)) |
| 852 | (< (current-indentation) ci)) | 986 | (< (current-indentation) ci)) |
| 853 | (python-skip-comments/blanks t) | 987 | (python-skip-comments/blanks t) |
| 854 | (beginning-of-line 2) | 988 | (beginning-of-line 2) |
| 855 | (throw 'done t))) | 989 | (throw 'done t))))))) |
| 856 | (not (goto-char point)))))) | 990 | (setq arg (1- arg))) |
| 857 | (setq arg (1- arg))) | 991 | (zerop arg))) |
| 858 | (zerop arg)) | ||
| 859 | 992 | ||
| 860 | ;;;; Imenu. | 993 | ;;;; Imenu. |
| 861 | 994 | ||
| @@ -868,14 +1001,23 @@ The nested menus are headed by an item referencing the outer | |||
| 868 | definition; it has a space prepended to the name so that it sorts | 1001 | definition; it has a space prepended to the name so that it sorts |
| 869 | first with `imenu--sort-by-name' (though, unfortunately, sub-menus | 1002 | first with `imenu--sort-by-name' (though, unfortunately, sub-menus |
| 870 | precede it)." | 1003 | precede it)." |
| 871 | (unless (boundp 'python-recursing) ; dynamically bound below | 1004 | (unless (boundp 'python-recursing) ; dynamically bound below |
| 872 | (goto-char (point-min))) ; normal call from Imenu | 1005 | ;; Normal call from Imenu. |
| 873 | (let (index-alist ; accumulated value to return | 1006 | (goto-char (point-min)) |
| 874 | name) | 1007 | ;; Without this, we can get an infloop if the buffer isn't all |
| 1008 | ;; fontified. I guess this is really a bug in syntax.el. OTOH, | ||
| 1009 | ;; _with_ this, imenu doesn't immediately work; I can't figure out | ||
| 1010 | ;; what's going on, but it must be something to do with timers in | ||
| 1011 | ;; font-lock. | ||
| 1012 | ;; This can't be right, especially not when jit-lock is not used. --Stef | ||
| 1013 | ;; (unless (get-text-property (1- (point-max)) 'fontified) | ||
| 1014 | ;; (font-lock-fontify-region (point-min) (point-max))) | ||
| 1015 | ) | ||
| 1016 | (let (index-alist) ; accumulated value to return | ||
| 875 | (while (re-search-forward | 1017 | (while (re-search-forward |
| 876 | (rx (and line-start (0+ space) ; leading space | 1018 | (rx line-start (0+ space) ; leading space |
| 877 | (or (group "def") (group "class")) ; type | 1019 | (or (group "def") (group "class")) ; type |
| 878 | (1+ space) (group (1+ (or word ?_))))) ; name | 1020 | (1+ space) (group (1+ (or word ?_)))) ; name |
| 879 | nil t) | 1021 | nil t) |
| 880 | (unless (python-in-string/comment) | 1022 | (unless (python-in-string/comment) |
| 881 | (let ((pos (match-beginning 0)) | 1023 | (let ((pos (match-beginning 0)) |
| @@ -890,7 +1032,22 @@ precede it)." | |||
| 890 | (progn (push (cons (concat " " name) pos) sublist) | 1032 | (progn (push (cons (concat " " name) pos) sublist) |
| 891 | (push (cons name sublist) index-alist)) | 1033 | (push (cons name sublist) index-alist)) |
| 892 | (push (cons name pos) index-alist))))))) | 1034 | (push (cons name pos) index-alist))))))) |
| 893 | (nreverse index-alist))) | 1035 | (unless (boundp 'python-recursing) |
| 1036 | ;; Look for module variables. | ||
| 1037 | (let (vars) | ||
| 1038 | (goto-char (point-min)) | ||
| 1039 | (while (re-search-forward | ||
| 1040 | (rx line-start (group (1+ (or word ?_))) (0+ space) "=") | ||
| 1041 | nil t) | ||
| 1042 | (unless (python-in-string/comment) | ||
| 1043 | (push (cons (match-string 1) (match-beginning 1)) | ||
| 1044 | vars))) | ||
| 1045 | (setq index-alist (nreverse index-alist)) | ||
| 1046 | (if vars | ||
| 1047 | (push (cons "Module variables" | ||
| 1048 | (nreverse vars)) | ||
| 1049 | index-alist)))) | ||
| 1050 | index-alist)) | ||
| 894 | 1051 | ||
| 895 | ;;;; `Electric' commands. | 1052 | ;;;; `Electric' commands. |
| 896 | 1053 | ||
| @@ -910,20 +1067,26 @@ just insert a single colon." | |||
| 910 | 1067 | ||
| 911 | (defun python-backspace (arg) | 1068 | (defun python-backspace (arg) |
| 912 | "Maybe delete a level of indentation on the current line. | 1069 | "Maybe delete a level of indentation on the current line. |
| 913 | If not at the end of line's indentation, or on a comment line, just call | 1070 | Do so if point is at the end of the line's indentation. |
| 914 | `backward-delete-char-untabify'. With ARG, repeat that many times." | 1071 | Otherwise just call `backward-delete-char-untabify'. |
| 1072 | Repeat ARG times." | ||
| 915 | (interactive "*p") | 1073 | (interactive "*p") |
| 916 | (if (or (/= (current-indentation) (current-column)) | 1074 | (if (or (/= (current-indentation) (current-column)) |
| 917 | (bolp) | 1075 | (bolp) |
| 918 | (python-continuation-line-p)) | 1076 | (python-continuation-line-p)) |
| 919 | (backward-delete-char-untabify arg) | 1077 | (backward-delete-char-untabify arg) |
| 920 | (let ((indent 0)) | 1078 | ;; Look for the largest valid indentation which is smaller than |
| 921 | (save-excursion | 1079 | ;; the current indentation. |
| 922 | (while (and (> arg 0) (python-beginning-of-block)) | 1080 | (let ((indent 0) |
| 923 | (setq arg (1- arg))) | 1081 | (ci (current-indentation)) |
| 924 | (when (zerop arg) | 1082 | (indents (python-indentation-levels)) |
| 925 | (setq indent (current-indentation)) | 1083 | initial) |
| 926 | (message "Closes %s" (python-initial-text)))) | 1084 | (dolist (x indents) |
| 1085 | (if (< (car x) ci) | ||
| 1086 | (setq indent (max indent (car x))))) | ||
| 1087 | (setq initial (cdr (assq indent indents))) | ||
| 1088 | (if (> (length initial) 0) | ||
| 1089 | (message "Closes %s" initial)) | ||
| 927 | (delete-horizontal-space) | 1090 | (delete-horizontal-space) |
| 928 | (indent-to indent)))) | 1091 | (indent-to indent)))) |
| 929 | (put 'python-backspace 'delete-selection 'supersede) | 1092 | (put 'python-backspace 'delete-selection 'supersede) |
| @@ -931,7 +1094,7 @@ If not at the end of line's indentation, or on a comment line, just call | |||
| 931 | ;;;; pychecker | 1094 | ;;;; pychecker |
| 932 | 1095 | ||
| 933 | (defcustom python-check-command "pychecker --stdlib" | 1096 | (defcustom python-check-command "pychecker --stdlib" |
| 934 | "*Command used to check a Python file." | 1097 | "Command used to check a Python file." |
| 935 | :type 'string | 1098 | :type 'string |
| 936 | :group 'python) | 1099 | :group 'python) |
| 937 | 1100 | ||
| @@ -963,66 +1126,54 @@ See `python-check-command' for the default." | |||
| 963 | ;; Fixme: Make sure we can work with IPython. | 1126 | ;; Fixme: Make sure we can work with IPython. |
| 964 | 1127 | ||
| 965 | (defcustom python-python-command "python" | 1128 | (defcustom python-python-command "python" |
| 966 | "*Shell command to run Python interpreter. | 1129 | "Shell command to run Python interpreter. |
| 967 | Any arguments can't contain whitespace. | 1130 | Any arguments can't contain whitespace. |
| 968 | Note that IPython may not work properly; it must at least be used with the | 1131 | Note that IPython may not work properly; it must at least be used |
| 969 | `-cl' flag, i.e. use `ipython -cl'." | 1132 | with the `-cl' flag, i.e. use `ipython -cl'." |
| 970 | :group 'python | 1133 | :group 'python |
| 971 | :type 'string) | 1134 | :type 'string) |
| 972 | 1135 | ||
| 973 | (defcustom python-jython-command "jython" | 1136 | (defcustom python-jython-command "jython" |
| 974 | "*Shell command to run Jython interpreter. | 1137 | "Shell command to run Jython interpreter. |
| 975 | Any arguments can't contain whitespace." | 1138 | Any arguments can't contain whitespace." |
| 976 | :group 'python | 1139 | :group 'python |
| 977 | :type 'string) | 1140 | :type 'string) |
| 978 | 1141 | ||
| 979 | (defvar python-command python-python-command | 1142 | (defvar python-command python-python-command |
| 980 | "Actual command used to run Python. | 1143 | "Actual command used to run Python. |
| 981 | May be `python-python-command' or `python-jython-command'. | 1144 | May be `python-python-command' or `python-jython-command', possibly |
| 982 | Additional arguments are added when the command is used by `run-python' | 1145 | modified by the user. Additional arguments are added when the command |
| 983 | et al.") | 1146 | is used by `run-python' et al.") |
| 984 | 1147 | ||
| 985 | (defvar python-buffer nil | 1148 | (defvar python-buffer nil |
| 986 | "The current python process buffer." | 1149 | "*The current python process buffer. |
| 987 | ;; Fixme: a single process is currently assumed, so that this doc | 1150 | |
| 988 | ;; is misleading. | 1151 | Commands that send text from source buffers to Python processes have |
| 989 | 1152 | to choose a process to send to. This is determined by buffer-local | |
| 990 | ;; "*The current python process buffer. | 1153 | value of `python-buffer'. If its value in the current buffer, |
| 991 | ;; To run multiple Python processes, start the first with \\[run-python]. | 1154 | i.e. both any local value and the default one, is nil, `run-python' |
| 992 | ;; It will be in a buffer named *Python*. Rename that with | 1155 | and commands that send to the Python process will start a new process. |
| 993 | ;; \\[rename-buffer]. Now start a new process with \\[run-python]. It | 1156 | |
| 994 | ;; will be in a new buffer, named *Python*. Switch between the different | 1157 | Whenever \\[run-python] starts a new process, it resets the default |
| 995 | ;; process buffers with \\[switch-to-buffer]. | 1158 | value of `python-buffer' to be the new process's buffer and sets the |
| 996 | 1159 | buffer-local value similarly if the current buffer is in Python mode | |
| 997 | ;; Commands that send text from source buffers to Python processes have | 1160 | or Inferior Python mode, so that source buffer stays associated with a |
| 998 | ;; to choose a process to send to. This is determined by global variable | 1161 | specific sub-process. |
| 999 | ;; `python-buffer'. Suppose you have three inferior Pythons running: | 1162 | |
| 1000 | ;; Buffer Process | 1163 | Use \\[python-set-proc] to set the default value from a buffer with a |
| 1001 | ;; foo python | 1164 | local value.") |
| 1002 | ;; bar python<2> | 1165 | (make-variable-buffer-local 'python-buffer) |
| 1003 | ;; *Python* python<3> | ||
| 1004 | ;; If you do a \\[python-send-region-and-go] command on some Python source | ||
| 1005 | ;; code, what process does it go to? | ||
| 1006 | |||
| 1007 | ;; - In a process buffer (foo, bar, or *Python*), send it to that process. | ||
| 1008 | ;; - In some other buffer (e.g. a source file), send it to the process | ||
| 1009 | ;; attached to `python-buffer'. | ||
| 1010 | ;; Process selection is done by function `python-proc'. | ||
| 1011 | |||
| 1012 | ;; Whenever \\[run-python] starts a new process, it resets `python-buffer' | ||
| 1013 | ;; to be the new process's buffer. If you only run one process, this will | ||
| 1014 | ;; do the right thing. If you run multiple processes, you can change | ||
| 1015 | ;; `python-buffer' to another process buffer with \\[set-variable]." | ||
| 1016 | ) | ||
| 1017 | 1166 | ||
| 1018 | (defconst python-compilation-regexp-alist | 1167 | (defconst python-compilation-regexp-alist |
| 1019 | ;; FIXME: maybe these should move to compilation-error-regexp-alist-alist. | 1168 | ;; FIXME: maybe these should move to compilation-error-regexp-alist-alist. |
| 1020 | `((,(rx (and line-start (1+ (any " \t")) "File \"" | 1169 | ;; The first already is (for CAML), but the second isn't. Anyhow, |
| 1021 | (group (1+ (not (any "\"<")))) ; avoid `<stdin>' &c | 1170 | ;; these are specific to the inferior buffer. -- fx |
| 1022 | "\", line " (group (1+ digit)))) | 1171 | `((,(rx line-start (1+ (any " \t")) "File \"" |
| 1172 | (group (1+ (not (any "\"<")))) ; avoid `<stdin>' &c | ||
| 1173 | "\", line " (group (1+ digit))) | ||
| 1023 | 1 2) | 1174 | 1 2) |
| 1024 | (,(rx (and " in file " (group (1+ not-newline)) " on line " | 1175 | (,(rx " in file " (group (1+ not-newline)) " on line " |
| 1025 | (group (1+ digit)))) | 1176 | (group (1+ digit))) |
| 1026 | 1 2)) | 1177 | 1 2)) |
| 1027 | "`compilation-error-regexp-alist' for inferior Python.") | 1178 | "`compilation-error-regexp-alist' for inferior Python.") |
| 1028 | 1179 | ||
| @@ -1040,9 +1191,9 @@ et al.") | |||
| 1040 | ;; (define-key map "\C-c\C-f" 'python-describe-symbol) | 1191 | ;; (define-key map "\C-c\C-f" 'python-describe-symbol) |
| 1041 | map)) | 1192 | map)) |
| 1042 | 1193 | ||
| 1043 | ;; Fixme: This should inherit some stuff from python-mode, but I'm not | 1194 | ;; Fixme: This should inherit some stuff from `python-mode', but I'm |
| 1044 | ;; sure how much: at least some keybindings, like C-c C-f; syntax?; | 1195 | ;; not sure how much: at least some keybindings, like C-c C-f; |
| 1045 | ;; font-locking, e.g. for triple-quoted strings? | 1196 | ;; syntax?; font-locking, e.g. for triple-quoted strings? |
| 1046 | (define-derived-mode inferior-python-mode comint-mode "Inferior Python" | 1197 | (define-derived-mode inferior-python-mode comint-mode "Inferior Python" |
| 1047 | "Major mode for interacting with an inferior Python process. | 1198 | "Major mode for interacting with an inferior Python process. |
| 1048 | A Python process can be started with \\[run-python]. | 1199 | A Python process can be started with \\[run-python]. |
| @@ -1050,14 +1201,15 @@ A Python process can be started with \\[run-python]. | |||
| 1050 | Hooks `comint-mode-hook' and `inferior-python-mode-hook' are run in | 1201 | Hooks `comint-mode-hook' and `inferior-python-mode-hook' are run in |
| 1051 | that order. | 1202 | that order. |
| 1052 | 1203 | ||
| 1053 | You can send text to the inferior Python process from other buffers containing | 1204 | You can send text to the inferior Python process from other buffers |
| 1054 | Python source. | 1205 | containing Python source. |
| 1055 | * `python-switch-to-python' switches the current buffer to the Python | 1206 | * \\[python-switch-to-python] switches the current buffer to the Python |
| 1056 | process buffer. | 1207 | process buffer. |
| 1057 | * `python-send-region' sends the current region to the Python process. | 1208 | * \\[python-send-region] sends the current region to the Python process. |
| 1058 | * `python-send-region-and-go' switches to the Python process buffer | 1209 | * \\[python-send-region-and-go] switches to the Python process buffer |
| 1059 | after sending the text. | 1210 | after sending the text. |
| 1060 | For running multiple processes in multiple buffers, see `python-buffer'. | 1211 | For running multiple processes in multiple buffers, see `run-python' and |
| 1212 | `python-buffer'. | ||
| 1061 | 1213 | ||
| 1062 | \\{inferior-python-mode-map}" | 1214 | \\{inferior-python-mode-map}" |
| 1063 | :group 'python | 1215 | :group 'python |
| @@ -1069,13 +1221,13 @@ For running multiple processes in multiple buffers, see `python-buffer'. | |||
| 1069 | ;; Still required by `comint-redirect-send-command', for instance | 1221 | ;; Still required by `comint-redirect-send-command', for instance |
| 1070 | ;; (and we need to match things like `>>> ... >>> '): | 1222 | ;; (and we need to match things like `>>> ... >>> '): |
| 1071 | (set (make-local-variable 'comint-prompt-regexp) | 1223 | (set (make-local-variable 'comint-prompt-regexp) |
| 1072 | (rx (and line-start (1+ (and (repeat 3 (any ">.")) ?\s))))) | 1224 | (rx line-start (1+ (and (repeat 3 (any ">.")) " ")))) |
| 1073 | (set (make-local-variable 'compilation-error-regexp-alist) | 1225 | (set (make-local-variable 'compilation-error-regexp-alist) |
| 1074 | python-compilation-regexp-alist) | 1226 | python-compilation-regexp-alist) |
| 1075 | (compilation-shell-minor-mode 1)) | 1227 | (compilation-shell-minor-mode 1)) |
| 1076 | 1228 | ||
| 1077 | (defcustom inferior-python-filter-regexp "\\`\\s-*\\S-?\\S-?\\s-*\\'" | 1229 | (defcustom inferior-python-filter-regexp "\\`\\s-*\\S-?\\S-?\\s-*\\'" |
| 1078 | "*Input matching this regexp is not saved on the history list. | 1230 | "Input matching this regexp is not saved on the history list. |
| 1079 | Default ignores all inputs of 0, 1, or 2 non-blank characters." | 1231 | Default ignores all inputs of 0, 1, or 2 non-blank characters." |
| 1080 | :type 'regexp | 1232 | :type 'regexp |
| 1081 | :group 'python) | 1233 | :group 'python) |
| @@ -1098,98 +1250,134 @@ Don't save anything for STR matching `inferior-python-filter-regexp'." | |||
| 1098 | (defvar python-preoutput-result nil | 1250 | (defvar python-preoutput-result nil |
| 1099 | "Data from last `_emacs_out' line seen by the preoutput filter.") | 1251 | "Data from last `_emacs_out' line seen by the preoutput filter.") |
| 1100 | 1252 | ||
| 1101 | (defvar python-preoutput-continuation nil | ||
| 1102 | "If non-nil, funcall this when `python-preoutput-filter' sees `_emacs_ok'.") | ||
| 1103 | |||
| 1104 | (defvar python-preoutput-leftover nil) | 1253 | (defvar python-preoutput-leftover nil) |
| 1254 | (defvar python-preoutput-skip-next-prompt nil) | ||
| 1105 | 1255 | ||
| 1106 | ;; Using this stops us getting lines in the buffer like | 1256 | ;; Using this stops us getting lines in the buffer like |
| 1107 | ;; >>> ... ... >>> | 1257 | ;; >>> ... ... >>> |
| 1108 | ;; Also look for (and delete) an `_emacs_ok' string and call | ||
| 1109 | ;; `python-preoutput-continuation' if we get it. | ||
| 1110 | (defun python-preoutput-filter (s) | 1258 | (defun python-preoutput-filter (s) |
| 1111 | "`comint-preoutput-filter-functions' function: ignore prompts not at bol." | 1259 | "`comint-preoutput-filter-functions' function: ignore prompts not at bol." |
| 1112 | (when python-preoutput-leftover | 1260 | (when python-preoutput-leftover |
| 1113 | (setq s (concat python-preoutput-leftover s)) | 1261 | (setq s (concat python-preoutput-leftover s)) |
| 1114 | (setq python-preoutput-leftover nil)) | 1262 | (setq python-preoutput-leftover nil)) |
| 1115 | (cond ((and (string-match (rx (and string-start (repeat 3 (any ".>")) | 1263 | (let ((start 0) |
| 1116 | " " string-end)) | 1264 | (res "")) |
| 1117 | s) | 1265 | ;; First process whole lines. |
| 1118 | (/= (let ((inhibit-field-text-motion t)) | 1266 | (while (string-match "\n" s start) |
| 1119 | (line-beginning-position)) | 1267 | (let ((line (substring s start (setq start (match-end 0))))) |
| 1120 | (point))) | 1268 | ;; Skip prompt if needed. |
| 1121 | "") | 1269 | (when (and python-preoutput-skip-next-prompt |
| 1122 | ((string= s "_emacs_ok\n") | 1270 | (string-match comint-prompt-regexp line)) |
| 1123 | (when python-preoutput-continuation | 1271 | (setq python-preoutput-skip-next-prompt nil) |
| 1124 | (funcall python-preoutput-continuation) | 1272 | (setq line (substring line (match-end 0)))) |
| 1125 | (setq python-preoutput-continuation nil)) | 1273 | ;; Recognize special _emacs_out lines. |
| 1126 | "") | 1274 | (if (and (string-match "\\`_emacs_out \\(.*\\)\n\\'" line) |
| 1127 | ((string-match "_emacs_out \\(.*\\)\n" s) | 1275 | (local-variable-p 'python-preoutput-result)) |
| 1128 | (setq python-preoutput-result (match-string 1 s)) | 1276 | (progn |
| 1129 | "") | 1277 | (setq python-preoutput-result (match-string 1 line)) |
| 1130 | ((string-match ".*\n" s) | 1278 | (set (make-local-variable 'python-preoutput-skip-next-prompt) t)) |
| 1131 | s) | 1279 | (setq res (concat res line))))) |
| 1132 | ((or (eq t (compare-strings s nil nil "_emacs_ok\n" nil (length s))) | 1280 | ;; Then process the remaining partial line. |
| 1133 | (let ((end (min (length "_emacs_out ") (length s)))) | 1281 | (unless (zerop start) (setq s (substring s start))) |
| 1134 | (eq t (compare-strings s nil end "_emacs_out " nil end)))) | 1282 | (cond ((and (string-match comint-prompt-regexp s) |
| 1135 | (setq python-preoutput-leftover s) | 1283 | ;; Drop this prompt if it follows an _emacs_out... |
| 1136 | "") | 1284 | (or python-preoutput-skip-next-prompt |
| 1137 | (t s))) | 1285 | ;; ... or if it's not gonna be inserted at BOL. |
| 1286 | ;; Maybe we could be more selective here. | ||
| 1287 | (if (zerop (length res)) | ||
| 1288 | (not (bolp)) | ||
| 1289 | (string-match res ".\\'")))) | ||
| 1290 | ;; The need for this seems to be system-dependent: | ||
| 1291 | ;; What is this all about, exactly? --Stef | ||
| 1292 | ;; (if (and (eq ?. (aref s 0))) | ||
| 1293 | ;; (accept-process-output (get-buffer-process (current-buffer)) 1)) | ||
| 1294 | (setq python-preoutput-skip-next-prompt nil) | ||
| 1295 | res) | ||
| 1296 | ((let ((end (min (length "_emacs_out ") (length s)))) | ||
| 1297 | (eq t (compare-strings s nil end "_emacs_out " nil end))) | ||
| 1298 | ;; The leftover string is a prefix of _emacs_out so we don't know | ||
| 1299 | ;; yet whether it's an _emacs_out or something else: wait until we | ||
| 1300 | ;; get more output so we can resolve this ambiguity. | ||
| 1301 | (set (make-local-variable 'python-preoutput-leftover) s) | ||
| 1302 | res) | ||
| 1303 | (t (concat res s))))) | ||
| 1304 | |||
| 1305 | (autoload 'comint-check-proc "comint") | ||
| 1138 | 1306 | ||
| 1139 | ;;;###autoload | 1307 | ;;;###autoload |
| 1140 | (defun run-python (&optional cmd noshow) | 1308 | (defun run-python (&optional cmd noshow new) |
| 1141 | "Run an inferior Python process, input and output via buffer *Python*. | 1309 | "Run an inferior Python process, input and output via buffer *Python*. |
| 1142 | CMD is the Python command to run. NOSHOW non-nil means don't show the | 1310 | CMD is the Python command to run. NOSHOW non-nil means don't show the |
| 1143 | buffer automatically. | 1311 | buffer automatically. |
| 1144 | If there is a process already running in `*Python*', switch to | 1312 | |
| 1145 | that buffer. Interactively, a prefix arg allows you to edit the initial | 1313 | Normally, if there is a process already running in `python-buffer', |
| 1146 | command line (default is `python-command'); `-i' etc. args will be added | 1314 | switch to that buffer. Interactively, a prefix arg allows you to edit |
| 1147 | to this as appropriate. Runs the hook `inferior-python-mode-hook' | 1315 | the initial command line (default is `python-command'); `-i' etc. args |
| 1148 | \(after the `comint-mode-hook' is run). | 1316 | will be added to this as appropriate. A new process is started if: |
| 1149 | \(Type \\[describe-mode] in the process buffer for a list of commands.)" | 1317 | one isn't running attached to `python-buffer', or interactively the |
| 1150 | (interactive (list (if current-prefix-arg | 1318 | default `python-command', or argument NEW is non-nil. See also the |
| 1151 | (read-string "Run Python: " python-command) | 1319 | documentation for `python-buffer'. |
| 1152 | python-command))) | 1320 | |
| 1321 | Runs the hook `inferior-python-mode-hook' \(after the | ||
| 1322 | `comint-mode-hook' is run). \(Type \\[describe-mode] in the process | ||
| 1323 | buffer for a list of commands.)" | ||
| 1324 | (interactive (if current-prefix-arg | ||
| 1325 | (list (read-string "Run Python: " python-command) nil t) | ||
| 1326 | (list python-command))) | ||
| 1153 | (unless cmd (setq cmd python-python-command)) | 1327 | (unless cmd (setq cmd python-python-command)) |
| 1154 | (setq python-command cmd) | 1328 | (setq python-command cmd) |
| 1155 | ;; Fixme: Consider making `python-buffer' buffer-local as a buffer | 1329 | ;; Fixme: Consider making `python-buffer' buffer-local as a buffer |
| 1156 | ;; (not a name) in Python buffers from which `run-python' &c is | 1330 | ;; (not a name) in Python buffers from which `run-python' &c is |
| 1157 | ;; invoked. Would support multiple processes better. | 1331 | ;; invoked. Would support multiple processes better. |
| 1158 | (unless (comint-check-proc python-buffer) | 1332 | (when (or new (not (comint-check-proc python-buffer))) |
| 1159 | (let* ((cmdlist (append (python-args-to-list cmd) '("-i"))) | 1333 | (save-current-buffer |
| 1160 | (path (getenv "PYTHONPATH")) | 1334 | (let* ((cmdlist (append (python-args-to-list cmd) '("-i"))) |
| 1161 | (process-environment ; to import emacs.py | 1335 | (path (getenv "PYTHONPATH")) |
| 1162 | (cons (concat "PYTHONPATH=" data-directory | 1336 | (process-environment ; to import emacs.py |
| 1163 | (if path (concat ":" path))) | 1337 | (cons (concat "PYTHONPATH=" data-directory |
| 1164 | process-environment))) | 1338 | (if path (concat ":" path))) |
| 1165 | (set-buffer (apply 'make-comint "Python" (car cmdlist) nil | 1339 | process-environment))) |
| 1166 | (cdr cmdlist))) | 1340 | (set-buffer (apply 'make-comint-in-buffer "Python" |
| 1167 | (setq python-buffer (buffer-name))) | 1341 | (generate-new-buffer "*Python*") |
| 1168 | (inferior-python-mode) | 1342 | (car cmdlist) nil (cdr cmdlist))) |
| 1169 | ;; Load function defintions we need. | 1343 | (setq-default python-buffer (current-buffer)) |
| 1170 | ;; Before the preoutput function was used, this was done via -c in | 1344 | (setq python-buffer (current-buffer))) |
| 1171 | ;; cmdlist, but that loses the banner and doesn't run the startup | 1345 | (accept-process-output (get-buffer-process python-buffer) 5) |
| 1172 | ;; file. The code might be inline here, but there's enough that it | 1346 | (inferior-python-mode))) |
| 1173 | ;; seems worth putting in a separate file, and it's probably cleaner | 1347 | (if (derived-mode-p 'python-mode) |
| 1174 | ;; to put it in a module. | 1348 | (setq python-buffer (default-value 'python-buffer))) ; buffer-local |
| 1175 | (python-send-string "import emacs")) | 1349 | ;; Load function definitions we need. |
| 1176 | (unless noshow (pop-to-buffer python-buffer))) | 1350 | ;; Before the preoutput function was used, this was done via -c in |
| 1351 | ;; cmdlist, but that loses the banner and doesn't run the startup | ||
| 1352 | ;; file. The code might be inline here, but there's enough that it | ||
| 1353 | ;; seems worth putting in a separate file, and it's probably cleaner | ||
| 1354 | ;; to put it in a module. | ||
| 1355 | ;; Ensure we're at a prompt before doing anything else. | ||
| 1356 | (python-send-receive "import emacs; print '_emacs_out ()'") | ||
| 1357 | ;; Without this, help output goes into the inferior python buffer if | ||
| 1358 | ;; the process isn't already running. | ||
| 1359 | (sit-for 1 t) ;Should we use accept-process-output instead? --Stef | ||
| 1360 | (unless noshow (pop-to-buffer python-buffer t))) | ||
| 1177 | 1361 | ||
| 1178 | ;; Fixme: We typically lose if the inferior isn't in the normal REPL, | 1362 | ;; Fixme: We typically lose if the inferior isn't in the normal REPL, |
| 1179 | ;; e.g. prompt is `help> '. Probably raise an error if the form of | 1363 | ;; e.g. prompt is `help> '. Probably raise an error if the form of |
| 1180 | ;; the prompt is unexpected; actually, it needs to be `>>> ', not | 1364 | ;; the prompt is unexpected. Actually, it needs to be `>>> ', not |
| 1181 | ;; `... ', i.e. we're not inputting a block &c. However, this may not | 1365 | ;; `... ', i.e. we're not inputting a block &c. However, this may not |
| 1182 | ;; be the place to do it, e.g. we might actually want to send commands | 1366 | ;; be the place to check it, e.g. we might actually want to send |
| 1183 | ;; having set up such a state. | 1367 | ;; commands having set up such a state. |
| 1184 | 1368 | ||
| 1185 | (defun python-send-command (command) | 1369 | (defun python-send-command (command) |
| 1186 | "Like `python-send-string' but resets `compilation-minor-mode'." | 1370 | "Like `python-send-string' but resets `compilation-shell-minor-mode'. |
| 1187 | (goto-char (point-max)) | 1371 | COMMAND should be a single statement." |
| 1372 | (assert (not (string-match "\n" command))) | ||
| 1188 | (let ((end (marker-position (process-mark (python-proc))))) | 1373 | (let ((end (marker-position (process-mark (python-proc))))) |
| 1374 | (with-current-buffer python-buffer (goto-char (point-max))) | ||
| 1189 | (compilation-forget-errors) | 1375 | (compilation-forget-errors) |
| 1190 | (python-send-string command) | 1376 | ;; Must wait until this has completed before re-setting variables below. |
| 1191 | (set-marker compilation-parsing-end end) | 1377 | (python-send-receive (concat command "; print '_emacs_out ()'")) |
| 1192 | (setq compilation-last-buffer (current-buffer)))) | 1378 | (with-current-buffer python-buffer |
| 1379 | (set-marker compilation-parsing-end end) | ||
| 1380 | (setq compilation-last-buffer (current-buffer))))) | ||
| 1193 | 1381 | ||
| 1194 | (defun python-send-region (start end) | 1382 | (defun python-send-region (start end) |
| 1195 | "Send the region to the inferior Python process." | 1383 | "Send the region to the inferior Python process." |
| @@ -1202,8 +1390,8 @@ to this as appropriate. Runs the hook `inferior-python-mode-hook' | |||
| 1202 | ;; filter). This function also catches exceptions and truncates | 1390 | ;; filter). This function also catches exceptions and truncates |
| 1203 | ;; tracebacks not to mention the frame of the function itself. | 1391 | ;; tracebacks not to mention the frame of the function itself. |
| 1204 | ;; | 1392 | ;; |
| 1205 | ;; The compilation-minor-mode parsing takes care of relating the | 1393 | ;; The `compilation-shell-minor-mode' parsing takes care of relating |
| 1206 | ;; reference to the temporary file to the source. | 1394 | ;; the reference to the temporary file to the source. |
| 1207 | ;; | 1395 | ;; |
| 1208 | ;; Fixme: Write a `coding' header to the temp file if the region is | 1396 | ;; Fixme: Write a `coding' header to the temp file if the region is |
| 1209 | ;; non-ASCII. | 1397 | ;; non-ASCII. |
| @@ -1220,18 +1408,22 @@ to this as appropriate. Runs the hook `inferior-python-mode-hook' | |||
| 1220 | (set-marker orig-start (line-beginning-position 0))) | 1408 | (set-marker orig-start (line-beginning-position 0))) |
| 1221 | (write-region "if True:\n" nil f nil 'nomsg)) | 1409 | (write-region "if True:\n" nil f nil 'nomsg)) |
| 1222 | (write-region start end f t 'nomsg) | 1410 | (write-region start end f t 'nomsg) |
| 1223 | (with-current-buffer (process-buffer (python-proc)) ;Runs python if needed. | 1411 | (python-send-command command) |
| 1224 | (python-send-command command) | 1412 | (with-current-buffer (process-buffer (python-proc)) |
| 1225 | ;; Tell compile.el to redirect error locations in file `f' to | 1413 | ;; Tell compile.el to redirect error locations in file `f' to |
| 1226 | ;; positions past marker `orig-start'. It has to be done *after* | 1414 | ;; positions past marker `orig-start'. It has to be done *after* |
| 1227 | ;; python-send-command's call to compilation-forget-errors. | 1415 | ;; `python-send-command''s call to `compilation-forget-errors'. |
| 1228 | (compilation-fake-loc orig-start f)))) | 1416 | (compilation-fake-loc orig-start f)))) |
| 1229 | 1417 | ||
| 1230 | (defun python-send-string (string) | 1418 | (defun python-send-string (string) |
| 1231 | "Evaluate STRING in inferior Python process." | 1419 | "Evaluate STRING in inferior Python process." |
| 1232 | (interactive "sPython command: ") | 1420 | (interactive "sPython command: ") |
| 1233 | (comint-send-string (python-proc) string) | 1421 | (comint-send-string (python-proc) string) |
| 1234 | (comint-send-string (python-proc) "\n\n")) | 1422 | (comint-send-string (python-proc) |
| 1423 | ;; If the string is single-line or if it ends with \n, | ||
| 1424 | ;; only add a single \n, otherwise add 2, so as to | ||
| 1425 | ;; make sure we terminate the multiline instruction. | ||
| 1426 | (if (string-match "\n.+\\'" string) "\n\n" "\n"))) | ||
| 1235 | 1427 | ||
| 1236 | (defun python-send-buffer () | 1428 | (defun python-send-buffer () |
| 1237 | "Send the current buffer to the inferior Python process." | 1429 | "Send the current buffer to the inferior Python process." |
| @@ -1247,10 +1439,10 @@ to this as appropriate. Runs the hook `inferior-python-mode-hook' | |||
| 1247 | (progn (end-of-defun) (point))))) | 1439 | (progn (end-of-defun) (point))))) |
| 1248 | 1440 | ||
| 1249 | (defun python-switch-to-python (eob-p) | 1441 | (defun python-switch-to-python (eob-p) |
| 1250 | "Switch to the Python process buffer. | 1442 | "Switch to the Python process buffer, maybe starting new process. |
| 1251 | With prefix arg, position cursor at end of buffer." | 1443 | With prefix arg, position cursor at end of buffer." |
| 1252 | (interactive "P") | 1444 | (interactive "P") |
| 1253 | (pop-to-buffer (process-buffer (python-proc))) ;Runs python if needed. | 1445 | (pop-to-buffer (process-buffer (python-proc)) t) ;Runs python if needed. |
| 1254 | (when eob-p | 1446 | (when eob-p |
| 1255 | (push-mark) | 1447 | (push-mark) |
| 1256 | (goto-char (point-max)))) | 1448 | (goto-char (point-max)))) |
| @@ -1263,10 +1455,10 @@ Then switch to the process buffer." | |||
| 1263 | (python-switch-to-python t)) | 1455 | (python-switch-to-python t)) |
| 1264 | 1456 | ||
| 1265 | (defcustom python-source-modes '(python-mode jython-mode) | 1457 | (defcustom python-source-modes '(python-mode jython-mode) |
| 1266 | "*Used to determine if a buffer contains Python source code. | 1458 | "Used to determine if a buffer contains Python source code. |
| 1267 | If it's loaded into a buffer that is in one of these major modes, it's | 1459 | If a file is loaded into a buffer that is in one of these major modes, |
| 1268 | considered a Python source file by `python-load-file'. | 1460 | it is considered Python source by `python-load-file', which uses the |
| 1269 | Used by these commands to determine defaults." | 1461 | value to determine defaults." |
| 1270 | :type '(repeat function) | 1462 | :type '(repeat function) |
| 1271 | :group 'python) | 1463 | :group 'python) |
| 1272 | 1464 | ||
| @@ -1274,6 +1466,8 @@ Used by these commands to determine defaults." | |||
| 1274 | "Caches (directory . file) pair used in the last `python-load-file' command. | 1466 | "Caches (directory . file) pair used in the last `python-load-file' command. |
| 1275 | Used for determining the default in the next one.") | 1467 | Used for determining the default in the next one.") |
| 1276 | 1468 | ||
| 1469 | (autoload 'comint-get-source "comint") | ||
| 1470 | |||
| 1277 | (defun python-load-file (file-name) | 1471 | (defun python-load-file (file-name) |
| 1278 | "Load a Python file FILE-NAME into the inferior Python process. | 1472 | "Load a Python file FILE-NAME into the inferior Python process. |
| 1279 | If the file has extension `.py' import or reload it as a module. | 1473 | If the file has extension `.py' import or reload it as a module. |
| @@ -1297,17 +1491,27 @@ module-qualified names." | |||
| 1297 | (format "execfile(%S)" file-name))) | 1491 | (format "execfile(%S)" file-name))) |
| 1298 | (message "%s loaded" file-name))) | 1492 | (message "%s loaded" file-name))) |
| 1299 | 1493 | ||
| 1300 | ;; Fixme: If we need to start the process, wait until we've got the OK | ||
| 1301 | ;; from the startup. | ||
| 1302 | (defun python-proc () | 1494 | (defun python-proc () |
| 1303 | "Return the current Python process. | 1495 | "Return the current Python process. |
| 1304 | See variable `python-buffer'. Starts a new process if necessary." | 1496 | See variable `python-buffer'. Starts a new process if necessary." |
| 1305 | (or (if python-buffer | 1497 | ;; Fixme: Maybe should look for another active process if there |
| 1306 | (get-buffer-process (if (eq major-mode 'inferior-python-mode) | 1498 | ;; isn't one for `python-buffer'. |
| 1307 | (current-buffer) | 1499 | (unless (comint-check-proc python-buffer) |
| 1308 | python-buffer))) | 1500 | (run-python nil t)) |
| 1309 | (progn (run-python nil t) | 1501 | (get-buffer-process (or (if (derived-mode-p 'inferior-python-mode) |
| 1310 | (python-proc)))) | 1502 | (current-buffer) |
| 1503 | python-buffer)))) | ||
| 1504 | |||
| 1505 | (defun python-set-proc () | ||
| 1506 | "Set the default value of `python-buffer' to correspond to this buffer. | ||
| 1507 | If the current buffer has a local value of `python-buffer', set the | ||
| 1508 | default (global) value to that. The associated Python process is | ||
| 1509 | the one that gets input from \\[python-send-region] et al when used | ||
| 1510 | in a buffer that doesn't have a local value of `python-buffer'." | ||
| 1511 | (interactive) | ||
| 1512 | (if (local-variable-p 'python-buffer) | ||
| 1513 | (setq-default python-buffer python-buffer) | ||
| 1514 | (error "No local value of `python-buffer'"))) | ||
| 1311 | 1515 | ||
| 1312 | ;;;; Context-sensitive help. | 1516 | ;;;; Context-sensitive help. |
| 1313 | 1517 | ||
| @@ -1322,16 +1526,22 @@ Otherwise inherits from `python-mode-syntax-table'.") | |||
| 1322 | (defvar view-return-to-alist) | 1526 | (defvar view-return-to-alist) |
| 1323 | (eval-when-compile (autoload 'help-buffer "help-fns")) | 1527 | (eval-when-compile (autoload 'help-buffer "help-fns")) |
| 1324 | 1528 | ||
| 1529 | (defvar python-imports) ; forward declaration | ||
| 1530 | |||
| 1325 | ;; Fixme: Should this actually be used instead of info-look, i.e. be | 1531 | ;; Fixme: Should this actually be used instead of info-look, i.e. be |
| 1326 | ;; bound to C-h S? Can we use other pydoc stuff before python 2.2? | 1532 | ;; bound to C-h S? [Probably not, since info-look may work in cases |
| 1533 | ;; where this doesn't.] | ||
| 1327 | (defun python-describe-symbol (symbol) | 1534 | (defun python-describe-symbol (symbol) |
| 1328 | "Get help on SYMBOL using `help'. | 1535 | "Get help on SYMBOL using `help'. |
| 1329 | Interactively, prompt for symbol. | 1536 | Interactively, prompt for symbol. |
| 1330 | 1537 | ||
| 1331 | Symbol may be anything recognized by the interpreter's `help' command -- | 1538 | Symbol may be anything recognized by the interpreter's `help' |
| 1332 | e.g. `CALLS' -- not just variables in scope. | 1539 | command -- e.g. `CALLS' -- not just variables in scope in the |
| 1333 | This only works for Python version 2.2 or newer since earlier interpreters | 1540 | interpreter. This only works for Python version 2.2 or newer |
| 1334 | don't support `help'." | 1541 | since earlier interpreters don't support `help'. |
| 1542 | |||
| 1543 | In some cases where this doesn't find documentation, \\[info-lookup-symbol] | ||
| 1544 | will." | ||
| 1335 | ;; Note that we do this in the inferior process, not a separate one, to | 1545 | ;; Note that we do this in the inferior process, not a separate one, to |
| 1336 | ;; ensure the environment is appropriate. | 1546 | ;; ensure the environment is appropriate. |
| 1337 | (interactive | 1547 | (interactive |
| @@ -1343,53 +1553,65 @@ don't support `help'." | |||
| 1343 | "Describe symbol: ") | 1553 | "Describe symbol: ") |
| 1344 | nil nil symbol)))) | 1554 | nil nil symbol)))) |
| 1345 | (if (equal symbol "") (error "No symbol")) | 1555 | (if (equal symbol "") (error "No symbol")) |
| 1346 | (let* ((func `(lambda () | 1556 | ;; Ensure we have a suitable help buffer. |
| 1347 | (comint-redirect-send-command | 1557 | ;; Fixme: Maybe process `Related help topics' a la help xrefs and |
| 1348 | (format "emacs.ehelp(%S, globals(), locals())\n" ,symbol) | 1558 | ;; allow C-c C-f in help buffer. |
| 1349 | "*Help*" nil)))) | 1559 | (let ((temp-buffer-show-hook ; avoid xref stuff |
| 1350 | ;; Ensure we have a suitable help buffer. | 1560 | (lambda () |
| 1351 | ;; Fixme: Maybe process `Related help topics' a la help xrefs and | 1561 | (toggle-read-only 1) |
| 1352 | ;; allow C-c C-f in help buffer. | 1562 | (setq view-return-to-alist |
| 1353 | (let ((temp-buffer-show-hook ; avoid xref stuff | 1563 | (list (cons (selected-window) help-return-method)))))) |
| 1354 | (lambda () | 1564 | (with-output-to-temp-buffer (help-buffer) |
| 1355 | (toggle-read-only 1) | 1565 | (with-current-buffer standard-output |
| 1356 | (setq view-return-to-alist | 1566 | ;; Fixme: Is this actually useful? |
| 1357 | (list (cons (selected-window) help-return-method)))))) | 1567 | (help-setup-xref (list 'python-describe-symbol symbol) (interactive-p)) |
| 1358 | (help-setup-xref (list 'python-describe-symbol symbol) (interactive-p)) | 1568 | (set (make-local-variable 'comint-redirect-subvert-readonly) t) |
| 1359 | (with-output-to-temp-buffer (help-buffer) | 1569 | (print-help-return-message)))) |
| 1360 | (with-current-buffer standard-output | 1570 | (comint-redirect-send-command-to-process (format "emacs.ehelp(%S, %s)" |
| 1361 | (set (make-local-variable 'comint-redirect-subvert-readonly) t) | 1571 | symbol python-imports) |
| 1362 | (print-help-return-message)))) | 1572 | "*Help*" (python-proc) nil nil)) |
| 1363 | (if (and python-buffer (get-buffer python-buffer)) | ||
| 1364 | (with-current-buffer python-buffer | ||
| 1365 | (funcall func)) | ||
| 1366 | (setq python-preoutput-continuation func) | ||
| 1367 | (run-python nil t)))) | ||
| 1368 | 1573 | ||
| 1369 | (add-to-list 'debug-ignored-errors "^No symbol") | 1574 | (add-to-list 'debug-ignored-errors "^No symbol") |
| 1370 | 1575 | ||
| 1371 | (defun python-send-receive (string) | 1576 | (defun python-send-receive (string) |
| 1372 | "Send STRING to inferior Python (if any) and return result. | 1577 | "Send STRING to inferior Python (if any) and return result. |
| 1373 | The result is what follows `_emacs_out' in the output (or nil)." | 1578 | The result is what follows `_emacs_out' in the output." |
| 1579 | (python-send-string string) | ||
| 1374 | (let ((proc (python-proc))) | 1580 | (let ((proc (python-proc))) |
| 1375 | (python-send-string string) | 1581 | (with-current-buffer (process-buffer proc) |
| 1376 | (setq python-preoutput-result nil) | 1582 | (set (make-local-variable 'python-preoutput-result) nil) |
| 1377 | (while (progn | 1583 | (while (progn |
| 1378 | (accept-process-output proc 5) | 1584 | (accept-process-output proc 5) |
| 1379 | python-preoutput-leftover)) | 1585 | (null python-preoutput-result))) |
| 1380 | python-preoutput-result)) | 1586 | (prog1 python-preoutput-result |
| 1381 | 1587 | (kill-local-variable 'python-preoutput-result))))) | |
| 1382 | ;; Fixme: try to make it work with point in the arglist. Also, is | 1588 | |
| 1383 | ;; there anything reasonable we can do with random methods? | 1589 | ;; Fixme: Is there anything reasonable we can do with random methods? |
| 1384 | ;; (Currently only works with functions.) | 1590 | ;; (Currently only works with functions.) |
| 1385 | (defun python-eldoc-function () | 1591 | (defun python-eldoc-function () |
| 1386 | "`eldoc-print-current-symbol-info' for Python. | 1592 | "`eldoc-print-current-symbol-info' for Python. |
| 1387 | Only works when point is in a function name, not its arglist, for instance. | 1593 | Only works when point is in a function name, not its arg list, for |
| 1388 | Assumes an inferior Python is running." | 1594 | instance. Assumes an inferior Python is running." |
| 1389 | (let ((symbol (with-syntax-table python-dotty-syntax-table | 1595 | (let ((symbol (with-syntax-table python-dotty-syntax-table |
| 1390 | (current-word)))) | 1596 | (current-word)))) |
| 1391 | (when symbol | 1597 | ;; First try the symbol we're on. |
| 1392 | (python-send-receive (format "emacs.eargs(%S)" symbol))))) | 1598 | (or (and symbol |
| 1599 | (python-send-receive (format "emacs.eargs(%S, %s)" | ||
| 1600 | symbol python-imports))) | ||
| 1601 | ;; Try moving to symbol before enclosing parens. | ||
| 1602 | (let ((s (syntax-ppss))) | ||
| 1603 | (unless (zerop (car s)) | ||
| 1604 | (when (eq ?\( (char-after (nth 1 s))) | ||
| 1605 | (save-excursion | ||
| 1606 | (goto-char (nth 1 s)) | ||
| 1607 | (skip-syntax-backward "-") | ||
| 1608 | (let ((point (point))) | ||
| 1609 | (skip-chars-backward "a-zA-Z._") | ||
| 1610 | (if (< (point) point) | ||
| 1611 | (python-send-receive | ||
| 1612 | (format "emacs.eargs(%S, %s)" | ||
| 1613 | (buffer-substring-no-properties (point) point) | ||
| 1614 | python-imports))))))))))) | ||
| 1393 | 1615 | ||
| 1394 | ;;;; Info-look functionality. | 1616 | ;;;; Info-look functionality. |
| 1395 | 1617 | ||
| @@ -1443,7 +1665,7 @@ Used with `eval-after-load'." | |||
| 1443 | ("(python-lib)Miscellaneous Index" nil "")))))) | 1665 | ("(python-lib)Miscellaneous Index" nil "")))))) |
| 1444 | (eval-after-load "info-look" '(python-after-info-look)) | 1666 | (eval-after-load "info-look" '(python-after-info-look)) |
| 1445 | 1667 | ||
| 1446 | ;;;; Miscellancy. | 1668 | ;;;; Miscellany. |
| 1447 | 1669 | ||
| 1448 | (defcustom python-jython-packages '("java" "javax" "org" "com") | 1670 | (defcustom python-jython-packages '("java" "javax" "org" "com") |
| 1449 | "Packages implying `jython-mode'. | 1671 | "Packages implying `jython-mode'. |
| @@ -1473,8 +1695,8 @@ The criterion is either a match for `jython-mode' via | |||
| 1473 | (jython-mode) | 1695 | (jython-mode) |
| 1474 | (if (catch 'done | 1696 | (if (catch 'done |
| 1475 | (while (re-search-forward | 1697 | (while (re-search-forward |
| 1476 | (rx (and line-start (or "import" "from") (1+ space) | 1698 | (rx line-start (or "import" "from") (1+ space) |
| 1477 | (group (1+ (not (any " \t\n.")))))) | 1699 | (group (1+ (not (any " \t\n."))))) |
| 1478 | (+ (point-min) 10000) ; Probably not worth customizing. | 1700 | (+ (point-min) 10000) ; Probably not worth customizing. |
| 1479 | t) | 1701 | t) |
| 1480 | (if (member (match-string 1) python-jython-packages) | 1702 | (if (member (match-string 1) python-jython-packages) |
| @@ -1562,7 +1784,7 @@ END lie." | |||
| 1562 | "`outline-level' function for Python mode. | 1784 | "`outline-level' function for Python mode. |
| 1563 | The level is the number of `python-indent' steps of indentation | 1785 | The level is the number of `python-indent' steps of indentation |
| 1564 | of current line." | 1786 | of current line." |
| 1565 | (/ (current-indentation) python-indent)) | 1787 | (1+ (/ (current-indentation) python-indent))) |
| 1566 | 1788 | ||
| 1567 | ;; Fixme: Consider top-level assignments, imports, &c. | 1789 | ;; Fixme: Consider top-level assignments, imports, &c. |
| 1568 | (defun python-current-defun () | 1790 | (defun python-current-defun () |
| @@ -1577,10 +1799,8 @@ of current line." | |||
| 1577 | (python-beginning-of-block) | 1799 | (python-beginning-of-block) |
| 1578 | (end-of-line) | 1800 | (end-of-line) |
| 1579 | (beginning-of-defun) | 1801 | (beginning-of-defun) |
| 1580 | (if (looking-at (rx (and (0+ space) (or "def" "class") (1+ space) | 1802 | (if (looking-at (rx (0+ space) (or "def" "class") (1+ space) |
| 1581 | (group (1+ (or word (syntax symbol)))) | 1803 | (group (1+ (or word (syntax symbol)))))) |
| 1582 | ;; Greediness makes this unnecessary? --Stef | ||
| 1583 | symbol-end))) | ||
| 1584 | (push (match-string 1) accum))) | 1804 | (push (match-string 1) accum))) |
| 1585 | (if accum (mapconcat 'identity accum "."))))) | 1805 | (if accum (mapconcat 'identity accum "."))))) |
| 1586 | 1806 | ||
| @@ -1593,17 +1813,68 @@ Uses `python-beginning-of-block', `python-end-of-block'." | |||
| 1593 | (push-mark (point) nil t) | 1813 | (push-mark (point) nil t) |
| 1594 | (python-end-of-block) | 1814 | (python-end-of-block) |
| 1595 | (exchange-point-and-mark)) | 1815 | (exchange-point-and-mark)) |
| 1816 | |||
| 1817 | ;; Fixme: Provide a find-function-like command to find source of a | ||
| 1818 | ;; definition (separate from BicycleRepairMan). Complicated by | ||
| 1819 | ;; finding the right qualified name. | ||
| 1596 | 1820 | ||
| 1597 | ;;;; Completion. | 1821 | ;;;; Completion. |
| 1598 | 1822 | ||
| 1823 | (defvar python-imports nil | ||
| 1824 | "String of top-level import statements updated by `python-find-imports'.") | ||
| 1825 | (make-variable-buffer-local 'python-imports) | ||
| 1826 | |||
| 1827 | ;; Fixme: Should font-lock try to run this when it deals with an import? | ||
| 1828 | ;; Maybe not a good idea if it gets run multiple times when the | ||
| 1829 | ;; statement is being edited, and is more likely to end up with | ||
| 1830 | ;; something syntactically incorrect. | ||
| 1831 | ;; However, what we should do is to trundle up the block tree from point | ||
| 1832 | ;; to extract imports that appear to be in scope, and add those. | ||
| 1833 | (defun python-find-imports () | ||
| 1834 | "Find top-level imports, updating `python-imports'." | ||
| 1835 | (interactive) | ||
| 1836 | (save-excursion | ||
| 1837 | (let (lines) | ||
| 1838 | (goto-char (point-min)) | ||
| 1839 | (while (re-search-forward "^import\\>\\|^from\\>" nil t) | ||
| 1840 | (unless (syntax-ppss-context (syntax-ppss)) | ||
| 1841 | (push (buffer-substring (line-beginning-position) | ||
| 1842 | (line-beginning-position 2)) | ||
| 1843 | lines))) | ||
| 1844 | (setq python-imports | ||
| 1845 | (if lines | ||
| 1846 | (apply #'concat | ||
| 1847 | ;; This is probably best left out since you're unlikely to need the | ||
| 1848 | ;; doc for a function in the buffer and the import will lose if the | ||
| 1849 | ;; Python sub-process' working directory isn't the same as the | ||
| 1850 | ;; buffer's. | ||
| 1851 | ;; (if buffer-file-name | ||
| 1852 | ;; (concat | ||
| 1853 | ;; "import " | ||
| 1854 | ;; (file-name-sans-extension | ||
| 1855 | ;; (file-name-nondirectory buffer-file-name)))) | ||
| 1856 | (nreverse lines)) | ||
| 1857 | "None")) | ||
| 1858 | (when lines | ||
| 1859 | (set-text-properties 0 (length python-imports) nil python-imports) | ||
| 1860 | ;; The output ends up in the wrong place if the string we | ||
| 1861 | ;; send contains newlines (from the imports). | ||
| 1862 | (setq python-imports | ||
| 1863 | (replace-regexp-in-string "\n" "\\n" | ||
| 1864 | (format "%S" python-imports) t t)))))) | ||
| 1865 | |||
| 1866 | ;; Fixme: This fails the first time if the sub-process isn't already | ||
| 1867 | ;; running. Presumably a timing issue with i/o to the process. | ||
| 1599 | (defun python-symbol-completions (symbol) | 1868 | (defun python-symbol-completions (symbol) |
| 1600 | "Return a list of completions of the string SYMBOL from Python process. | 1869 | "Return a list of completions of the string SYMBOL from Python process. |
| 1601 | The list is sorted." | 1870 | The list is sorted. |
| 1871 | Uses `python-imports' to load modules against which to complete." | ||
| 1602 | (when symbol | 1872 | (when symbol |
| 1603 | (let ((completions | 1873 | (let ((completions |
| 1604 | (condition-case () | 1874 | (condition-case () |
| 1605 | (car (read-from-string (python-send-receive | 1875 | (car (read-from-string |
| 1606 | (format "emacs.complete(%S)" symbol)))) | 1876 | (python-send-receive |
| 1877 | (format "emacs.complete(%S,%s)" symbol python-imports)))) | ||
| 1607 | (error nil)))) | 1878 | (error nil)))) |
| 1608 | (sort | 1879 | (sort |
| 1609 | ;; We can get duplicates from the above -- don't know why. | 1880 | ;; We can get duplicates from the above -- don't know why. |
| @@ -1615,15 +1886,12 @@ The list is sorted." | |||
| 1615 | (let ((end (point)) | 1886 | (let ((end (point)) |
| 1616 | (start (save-excursion | 1887 | (start (save-excursion |
| 1617 | (and (re-search-backward | 1888 | (and (re-search-backward |
| 1618 | (rx (and (or buffer-start (regexp "[^[:alnum:]._]")) | 1889 | (rx (or buffer-start (regexp "[^[:alnum:]._]")) |
| 1619 | (group (1+ (regexp "[[:alnum:]._]"))) | 1890 | (group (1+ (regexp "[[:alnum:]._]"))) point) |
| 1620 | point)) | ||
| 1621 | nil t) | 1891 | nil t) |
| 1622 | (match-beginning 1))))) | 1892 | (match-beginning 1))))) |
| 1623 | (if start (buffer-substring-no-properties start end)))) | 1893 | (if start (buffer-substring-no-properties start end)))) |
| 1624 | 1894 | ||
| 1625 | ;; Fixme: We should have an abstraction of this sort of thing in the | ||
| 1626 | ;; core. | ||
| 1627 | (defun python-complete-symbol () | 1895 | (defun python-complete-symbol () |
| 1628 | "Perform completion on the Python symbol preceding point. | 1896 | "Perform completion on the Python symbol preceding point. |
| 1629 | Repeating the command scrolls the completion window." | 1897 | Repeating the command scrolls the completion window." |
| @@ -1658,11 +1926,9 @@ Repeating the command scrolls the completion window." | |||
| 1658 | (display-completion-list completions symbol)) | 1926 | (display-completion-list completions symbol)) |
| 1659 | (message "Making completion list...%s" "done")))))))) | 1927 | (message "Making completion list...%s" "done")))))))) |
| 1660 | 1928 | ||
| 1661 | (eval-when-compile (require 'hippie-exp)) | ||
| 1662 | |||
| 1663 | (defun python-try-complete (old) | 1929 | (defun python-try-complete (old) |
| 1664 | "Completion function for Python for use with `hippie-expand'." | 1930 | "Completion function for Python for use with `hippie-expand'." |
| 1665 | (when (eq major-mode 'python-mode) ; though we only add it locally | 1931 | (when (derived-mode-p 'python-mode) ; though we only add it locally |
| 1666 | (unless old | 1932 | (unless old |
| 1667 | (let ((symbol (python-partial-symbol))) | 1933 | (let ((symbol (python-partial-symbol))) |
| 1668 | (he-init-string (- (point) (length symbol)) (point)) | 1934 | (he-init-string (- (point) (length symbol)) (point)) |
| @@ -1680,16 +1946,212 @@ Repeating the command scrolls the completion window." | |||
| 1680 | (if old (he-reset-string)) | 1946 | (if old (he-reset-string)) |
| 1681 | nil))) | 1947 | nil))) |
| 1682 | 1948 | ||
| 1949 | ;;;; FFAP support | ||
| 1950 | |||
| 1951 | (defun python-module-path (module) | ||
| 1952 | "Function for `ffap-alist' to return path to MODULE." | ||
| 1953 | (python-send-receive (format "emacs.modpath (%S)" module))) | ||
| 1954 | |||
| 1955 | (eval-after-load "ffap" | ||
| 1956 | '(push '(python-mode . python-module-path) ffap-alist)) | ||
| 1957 | |||
| 1958 | ;;;; Skeletons | ||
| 1959 | |||
| 1960 | (defvar python-skeletons nil | ||
| 1961 | "Alist of named skeletons for Python mode. | ||
| 1962 | Elements are of the form (NAME . EXPANDER-FUNCTION).") | ||
| 1963 | |||
| 1964 | (defvar python-mode-abbrev-table nil | ||
| 1965 | "Abbrev table for Python mode. | ||
| 1966 | The default contents correspond to the elements of `python-skeletons'.") | ||
| 1967 | (define-abbrev-table 'python-mode-abbrev-table ()) | ||
| 1968 | |||
| 1969 | (eval-when-compile | ||
| 1970 | ;; Define a user-level skeleton and add it to `python-skeletons' and | ||
| 1971 | ;; the abbrev table. | ||
| 1972 | (defmacro def-python-skeleton (name &rest elements) | ||
| 1973 | (let* ((name (symbol-name name)) | ||
| 1974 | (function (intern (concat "python-insert-" name)))) | ||
| 1975 | `(progn | ||
| 1976 | (add-to-list 'python-skeletons ',(cons name function)) | ||
| 1977 | (define-abbrev python-mode-abbrev-table ,name "" ',function nil t) | ||
| 1978 | (define-skeleton ,function | ||
| 1979 | ,(format "Insert Python \"%s\" template." name) | ||
| 1980 | ,@elements))))) | ||
| 1981 | (put 'def-python-skeleton 'lisp-indent-function 2) | ||
| 1982 | |||
| 1983 | ;; From `skeleton-further-elements': | ||
| 1984 | ;; `<': outdent a level; | ||
| 1985 | ;; `^': delete indentation on current line and also previous newline. | ||
| 1986 | ;; Not quote like `delete-indentation'. Assumes point is at | ||
| 1987 | ;; beginning of indentation. | ||
| 1988 | |||
| 1989 | (def-python-skeleton if | ||
| 1990 | "Condition: " | ||
| 1991 | "if " str ":" \n | ||
| 1992 | > _ \n | ||
| 1993 | ("other condition, %s: " | ||
| 1994 | < ; Avoid wrong indentation after block opening. | ||
| 1995 | "elif " str ":" \n | ||
| 1996 | > _ \n nil) | ||
| 1997 | (python-else) | ^) | ||
| 1998 | |||
| 1999 | (define-skeleton python-else | ||
| 2000 | "Auxiliary skeleton." | ||
| 2001 | nil | ||
| 2002 | (unless (eq ?y (read-char "Add `else' clause? (y for yes or RET for no) ")) | ||
| 2003 | (signal 'quit t)) | ||
| 2004 | < "else:" \n | ||
| 2005 | > _ \n) | ||
| 2006 | |||
| 2007 | (def-python-skeleton while | ||
| 2008 | "Condition: " | ||
| 2009 | "while " str ":" \n | ||
| 2010 | > _ \n | ||
| 2011 | (python-else) | ^) | ||
| 2012 | |||
| 2013 | (def-python-skeleton for | ||
| 2014 | "Target, %s: " | ||
| 2015 | "for " str " in " (skeleton-read "Expression, %s: ") ":" \n | ||
| 2016 | > _ \n | ||
| 2017 | (python-else) | ^) | ||
| 2018 | |||
| 2019 | (def-python-skeleton try/except | ||
| 2020 | nil | ||
| 2021 | "try:" \n | ||
| 2022 | > _ \n | ||
| 2023 | ("Exception, %s: " | ||
| 2024 | < "except " str (python-target) ":" \n | ||
| 2025 | > _ \n nil) | ||
| 2026 | < "except:" \n | ||
| 2027 | > _ \n | ||
| 2028 | (python-else) | ^) | ||
| 2029 | |||
| 2030 | (define-skeleton python-target | ||
| 2031 | "Auxiliary skeleton." | ||
| 2032 | "Target, %s: " ", " str | -2) | ||
| 2033 | |||
| 2034 | (def-python-skeleton try/finally | ||
| 2035 | nil | ||
| 2036 | "try:" \n | ||
| 2037 | > _ \n | ||
| 2038 | < "finally:" \n | ||
| 2039 | > _ \n) | ||
| 2040 | |||
| 2041 | (def-python-skeleton def | ||
| 2042 | "Name: " | ||
| 2043 | "def " str " (" ("Parameter, %s: " (unless (equal ?\( (char-before)) ", ") | ||
| 2044 | str) "):" \n | ||
| 2045 | "\"\"\"" @ " \"\"\"" \n ; Fixme: syntaxification wrong for """""" | ||
| 2046 | > _ \n) | ||
| 2047 | |||
| 2048 | (def-python-skeleton class | ||
| 2049 | "Name: " | ||
| 2050 | "class " str " (" ("Inheritance, %s: " | ||
| 2051 | (unless (equal ?\( (char-before)) ", ") | ||
| 2052 | str) | ||
| 2053 | & ")" | -2 ; close list or remove opening | ||
| 2054 | ":" \n | ||
| 2055 | "\"\"\"" @ " \"\"\"" \n | ||
| 2056 | > _ \n) | ||
| 2057 | |||
| 2058 | (defvar python-default-template "if" | ||
| 2059 | "Default template to expand by `python-insert-template'. | ||
| 2060 | Updated on each expansion.") | ||
| 2061 | |||
| 2062 | (defun python-expand-template (name) | ||
| 2063 | "Expand template named NAME. | ||
| 2064 | Interactively, prompt for the name with completion." | ||
| 2065 | (interactive | ||
| 2066 | (list (completing-read (format "Template to expand (default %s): " | ||
| 2067 | python-default-template) | ||
| 2068 | python-skeletons nil t))) | ||
| 2069 | (if (equal "" name) | ||
| 2070 | (setq name python-default-template) | ||
| 2071 | (setq python-default-template name)) | ||
| 2072 | (let ((func (cdr (assoc name python-skeletons)))) | ||
| 2073 | (if func | ||
| 2074 | (funcall func) | ||
| 2075 | (error "Undefined template: %s" name)))) | ||
| 2076 | |||
| 2077 | ;;;; Bicycle Repair Man support | ||
| 2078 | |||
| 2079 | (autoload 'pymacs-load "pymacs" nil t) | ||
| 2080 | (autoload 'brm-init "bikemacs") | ||
| 2081 | |||
| 2082 | ;; I'm not sure how useful BRM really is, and it's certainly dangerous | ||
| 2083 | ;; the way it modifies files outside Emacs... Also note that the | ||
| 2084 | ;; current BRM loses with tabs used for indentation -- I submitted a | ||
| 2085 | ;; fix <URL:http://www.loveshack.ukfsn.org/emacs/bikeemacs.py.diff>. | ||
| 2086 | (defun python-setup-brm () | ||
| 2087 | "Set up Bicycle Repair Man refactoring tool (if available). | ||
| 2088 | |||
| 2089 | Note that the `refactoring' features change files independently of | ||
| 2090 | Emacs and may modify and save the contents of the current buffer | ||
| 2091 | without confirmation." | ||
| 2092 | (interactive) | ||
| 2093 | (condition-case data | ||
| 2094 | (unless (fboundp 'brm-rename) | ||
| 2095 | (pymacs-load "bikeemacs" "brm-") ; first line of normal recipe | ||
| 2096 | (let ((py-mode-map (make-sparse-keymap)) ; it assumes this | ||
| 2097 | (features (cons 'python-mode features))) ; and requires this | ||
| 2098 | (brm-init)) ; second line of normal recipe | ||
| 2099 | (remove-hook 'python-mode-hook ; undo this from `brm-init' | ||
| 2100 | '(lambda () (easy-menu-add brm-menu))) | ||
| 2101 | (easy-menu-define | ||
| 2102 | python-brm-menu python-mode-map | ||
| 2103 | "Bicycle Repair Man" | ||
| 2104 | '("BicycleRepairMan" | ||
| 2105 | :help "Interface to navigation and refactoring tool" | ||
| 2106 | "Queries" | ||
| 2107 | ["Find References" brm-find-references | ||
| 2108 | :help "Find references to name at point in compilation buffer"] | ||
| 2109 | ["Find Definition" brm-find-definition | ||
| 2110 | :help "Find definition of name at point"] | ||
| 2111 | "-" | ||
| 2112 | "Refactoring" | ||
| 2113 | ["Rename" brm-rename | ||
| 2114 | :help "Replace name at point with a new name everywhere"] | ||
| 2115 | ["Extract Method" brm-extract-method | ||
| 2116 | :active (and mark-active (not buffer-read-only)) | ||
| 2117 | :help "Replace statements in region with a method"] | ||
| 2118 | ["Extract Local Variable" brm-extract-local-variable | ||
| 2119 | :active (and mark-active (not buffer-read-only)) | ||
| 2120 | :help "Replace expression in region with an assignment"] | ||
| 2121 | ["Inline Local Variable" brm-inline-local-variable | ||
| 2122 | :help | ||
| 2123 | "Substitute uses of variable at point with its definition"] | ||
| 2124 | ;; Fixme: Should check for anything to revert. | ||
| 2125 | ["Undo Last Refactoring" brm-undo :help ""]))) | ||
| 2126 | (error (error "Bicyclerepairman setup failed: %s" data)))) | ||
| 2127 | |||
| 1683 | ;;;; Modes. | 2128 | ;;;; Modes. |
| 1684 | 2129 | ||
| 1685 | (defvar outline-heading-end-regexp) | 2130 | (defvar outline-heading-end-regexp) |
| 1686 | (defvar eldoc-documentation-function) | 2131 | (defvar eldoc-documentation-function) |
| 1687 | 2132 | ||
| 2133 | ;; Stuff to allow expanding abbrevs with non-word constituents. | ||
| 2134 | (defun python-abbrev-pc-hook () | ||
| 2135 | "Set the syntax table before possibly expanding abbrevs." | ||
| 2136 | (remove-hook 'post-command-hook 'python-abbrev-pc-hook t) | ||
| 2137 | (set-syntax-table python-mode-syntax-table)) | ||
| 2138 | |||
| 2139 | (defvar python-abbrev-syntax-table | ||
| 2140 | (copy-syntax-table python-mode-syntax-table) | ||
| 2141 | "Syntax table used when expanding abbrevs.") | ||
| 2142 | |||
| 2143 | (defun python-pea-hook () | ||
| 2144 | "Reset the syntax table after possibly expanding abbrevs." | ||
| 2145 | (set-syntax-table python-abbrev-syntax-table) | ||
| 2146 | (add-hook 'post-command-hook 'python-abbrev-pc-hook nil t)) | ||
| 2147 | (modify-syntax-entry ?/ "w" python-abbrev-syntax-table) | ||
| 2148 | |||
| 2149 | (defvar python-mode-running) ;Dynamically scoped var. | ||
| 2150 | |||
| 1688 | ;;;###autoload | 2151 | ;;;###autoload |
| 1689 | (define-derived-mode python-mode fundamental-mode "Python" | 2152 | (define-derived-mode python-mode fundamental-mode "Python" |
| 1690 | "Major mode for editing Python files. | 2153 | "Major mode for editing Python files. |
| 1691 | Turns on Font Lock mode unconditionally since it is required for correct | 2154 | Font Lock mode is currently required for correct parsing of the source. |
| 1692 | parsing of the source. | ||
| 1693 | See also `jython-mode', which is actually invoked if the buffer appears to | 2155 | See also `jython-mode', which is actually invoked if the buffer appears to |
| 1694 | contain Jython code. See also `run-python' and associated Python mode | 2156 | contain Jython code. See also `run-python' and associated Python mode |
| 1695 | commands for running Python under Emacs. | 2157 | commands for running Python under Emacs. |
| @@ -1703,21 +2165,27 @@ the end of definitions at that level, when they move up a level. | |||
| 1703 | Colon is electric: it outdents the line if appropriate, e.g. for | 2165 | Colon is electric: it outdents the line if appropriate, e.g. for |
| 1704 | an else statement. \\[python-backspace] at the beginning of an indented statement | 2166 | an else statement. \\[python-backspace] at the beginning of an indented statement |
| 1705 | deletes a level of indentation to close the current block; otherwise it | 2167 | deletes a level of indentation to close the current block; otherwise it |
| 1706 | deletes a charcter backward. TAB indents the current line relative to | 2168 | deletes a character backward. TAB indents the current line relative to |
| 1707 | the preceding code. Successive TABs, with no intervening command, cycle | 2169 | the preceding code. Successive TABs, with no intervening command, cycle |
| 1708 | through the possibilities for indentation on the basis of enclosing blocks. | 2170 | through the possibilities for indentation on the basis of enclosing blocks. |
| 1709 | 2171 | ||
| 1710 | \\[fill-paragraph] fills comments and multiline strings appropriately, but has no | 2172 | \\[fill-paragraph] fills comments and multi-line strings appropriately, but has no |
| 1711 | effect outside them. | 2173 | effect outside them. |
| 1712 | 2174 | ||
| 1713 | Supports Eldoc mode (only for functions, using a Python process), | 2175 | Supports Eldoc mode (only for functions, using a Python process), |
| 1714 | Info-Look and Imenu. In Outline minor mode, `class' and `def' | 2176 | Info-Look and Imenu. In Outline minor mode, `class' and `def' |
| 1715 | lines count as headers. | 2177 | lines count as headers. Symbol completion is available in the |
| 2178 | same way as in the Python shell using the `rlcompleter' module | ||
| 2179 | and this is added to the Hippie Expand functions locally if | ||
| 2180 | Hippie Expand mode is turned on. Completion of symbols of the | ||
| 2181 | form x.y only works if the components are literal | ||
| 2182 | module/attribute names, not variables. An abbrev table is set up | ||
| 2183 | with skeleton expansions for compound statement templates. | ||
| 1716 | 2184 | ||
| 1717 | \\{python-mode-map}" | 2185 | \\{python-mode-map}" |
| 1718 | :group 'python | 2186 | :group 'python |
| 1719 | (set (make-local-variable 'font-lock-defaults) | 2187 | (set (make-local-variable 'font-lock-defaults) |
| 1720 | '(python-font-lock-keywords nil nil ((?_ . "w")) nil | 2188 | '(python-font-lock-keywords nil nil nil nil |
| 1721 | (font-lock-syntactic-keywords | 2189 | (font-lock-syntactic-keywords |
| 1722 | . python-font-lock-syntactic-keywords) | 2190 | . python-font-lock-syntactic-keywords) |
| 1723 | ;; This probably isn't worth it. | 2191 | ;; This probably isn't worth it. |
| @@ -1726,15 +2194,17 @@ lines count as headers. | |||
| 1726 | )) | 2194 | )) |
| 1727 | (set (make-local-variable 'parse-sexp-lookup-properties) t) | 2195 | (set (make-local-variable 'parse-sexp-lookup-properties) t) |
| 1728 | (set (make-local-variable 'comment-start) "# ") | 2196 | (set (make-local-variable 'comment-start) "# ") |
| 1729 | (set (make-local-variable 'comment-indent-function) #'python-comment-indent) | ||
| 1730 | (set (make-local-variable 'indent-line-function) #'python-indent-line) | 2197 | (set (make-local-variable 'indent-line-function) #'python-indent-line) |
| 2198 | (set (make-local-variable 'indent-region-function) #'python-indent-region) | ||
| 1731 | (set (make-local-variable 'paragraph-start) "\\s-*$") | 2199 | (set (make-local-variable 'paragraph-start) "\\s-*$") |
| 1732 | (set (make-local-variable 'fill-paragraph-function) 'python-fill-paragraph) | 2200 | (set (make-local-variable 'fill-paragraph-function) 'python-fill-paragraph) |
| 1733 | (set (make-local-variable 'require-final-newline) mode-require-final-newline) | 2201 | (set (make-local-variable 'require-final-newline) mode-require-final-newline) |
| 1734 | (set (make-local-variable 'add-log-current-defun-function) | 2202 | (set (make-local-variable 'add-log-current-defun-function) |
| 1735 | #'python-current-defun) | 2203 | #'python-current-defun) |
| 1736 | ;; Fixme: Generalize to do all blocks? | 2204 | (set (make-local-variable 'outline-regexp) |
| 1737 | (set (make-local-variable 'outline-regexp) "\\s-*\\(def\\|class\\)\\>") | 2205 | (rx (* space) (or "class" "def" "elif" "else" "except" "finally" |
| 2206 | "for" "if" "try" "while") | ||
| 2207 | symbol-end)) | ||
| 1738 | (set (make-local-variable 'outline-heading-end-regexp) ":\\s-*\n") | 2208 | (set (make-local-variable 'outline-heading-end-regexp) ":\\s-*\n") |
| 1739 | (set (make-local-variable 'outline-level) #'python-outline-level) | 2209 | (set (make-local-variable 'outline-level) #'python-outline-level) |
| 1740 | (set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil) | 2210 | (set (make-local-variable 'open-paren-in-column-0-is-defun-start) nil) |
| @@ -1746,30 +2216,45 @@ lines count as headers. | |||
| 1746 | (set (make-local-variable 'eldoc-documentation-function) | 2216 | (set (make-local-variable 'eldoc-documentation-function) |
| 1747 | #'python-eldoc-function) | 2217 | #'python-eldoc-function) |
| 1748 | (add-hook 'eldoc-mode-hook | 2218 | (add-hook 'eldoc-mode-hook |
| 1749 | '(lambda () (run-python nil t)) nil t) ; need it running | 2219 | (lambda () (run-python nil t)) ; need it running |
| 1750 | (unless (assoc 'python-mode hs-special-modes-alist) | 2220 | nil t) |
| 1751 | (setq | 2221 | ;; Fixme: should be in hideshow. This seems to be of limited use |
| 1752 | hs-special-modes-alist | 2222 | ;; since it isn't (can't be) indentation-based. Also hide-level |
| 1753 | (cons (list | 2223 | ;; doesn't seem to work properly. |
| 1754 | 'python-mode "^\\s-*def\\>" nil "#" | 2224 | (add-to-list 'hs-special-modes-alist |
| 1755 | (lambda (arg)(python-end-of-defun)(skip-chars-backward " \t\n")) | 2225 | `(python-mode "^\\s-*def\\>" nil "#" |
| 1756 | nil) | 2226 | ,(lambda (arg) |
| 1757 | hs-special-modes-alist))) | 2227 | (python-end-of-defun) |
| 2228 | (skip-chars-backward " \t\n")) | ||
| 2229 | nil)) | ||
| 2230 | (set (make-local-variable 'skeleton-further-elements) | ||
| 2231 | '((< '(backward-delete-char-untabify (min python-indent | ||
| 2232 | (current-column)))) | ||
| 2233 | (^ '(- (1+ (current-indentation)))))) | ||
| 2234 | (add-hook 'pre-abbrev-expand-hook 'python-pea-hook nil t) | ||
| 1758 | (if (featurep 'hippie-exp) | 2235 | (if (featurep 'hippie-exp) |
| 1759 | (set (make-local-variable 'hippie-expand-try-functions-list) | 2236 | (set (make-local-variable 'hippie-expand-try-functions-list) |
| 1760 | (cons 'python-try-complete hippie-expand-try-functions-list))) | 2237 | (cons 'python-try-complete hippie-expand-try-functions-list))) |
| 2238 | ;; Python defines TABs as being 8-char wide. | ||
| 2239 | (set (make-local-variable 'tab-width) 8) | ||
| 1761 | (when python-guess-indent (python-guess-indent)) | 2240 | (when python-guess-indent (python-guess-indent)) |
| 2241 | ;; Let's make it harder for the user to shoot himself in the foot. | ||
| 2242 | (unless (= tab-width python-indent) | ||
| 2243 | (setq indent-tabs-mode nil)) | ||
| 1762 | (set (make-local-variable 'python-command) python-python-command) | 2244 | (set (make-local-variable 'python-command) python-python-command) |
| 2245 | (python-find-imports) | ||
| 1763 | (unless (boundp 'python-mode-running) ; kill the recursion from jython-mode | 2246 | (unless (boundp 'python-mode-running) ; kill the recursion from jython-mode |
| 1764 | (let ((python-mode-running t)) | 2247 | (let ((python-mode-running t)) |
| 1765 | (python-maybe-jython)))) | 2248 | (python-maybe-jython)))) |
| 1766 | 2249 | ||
| 1767 | (custom-add-option 'python-mode-hook 'imenu-add-menubar-index) | 2250 | (custom-add-option 'python-mode-hook 'imenu-add-menubar-index) |
| 1768 | (custom-add-option 'python-mode-hook | 2251 | (custom-add-option 'python-mode-hook |
| 1769 | '(lambda () | 2252 | (lambda () |
| 1770 | "Turn on Indent Tabs mode." | 2253 | "Turn off Indent Tabs mode." |
| 1771 | (set (make-local-variable 'indent-tabs-mode) t))) | 2254 | (set (make-local-variable 'indent-tabs-mode) nil))) |
| 1772 | (custom-add-option 'python-mode-hook 'turn-on-eldoc-mode) | 2255 | (custom-add-option 'python-mode-hook 'turn-on-eldoc-mode) |
| 2256 | (custom-add-option 'python-mode-hook 'abbrev-mode) | ||
| 2257 | (custom-add-option 'python-mode-hook 'python-setup-brm) | ||
| 1773 | 2258 | ||
| 1774 | ;;;###autoload | 2259 | ;;;###autoload |
| 1775 | (define-derived-mode jython-mode python-mode "Jython" | 2260 | (define-derived-mode jython-mode python-mode "Jython" |
| @@ -1780,5 +2265,6 @@ Runs `jython-mode-hook' after `python-mode-hook'." | |||
| 1780 | (set (make-local-variable 'python-command) python-jython-command)) | 2265 | (set (make-local-variable 'python-command) python-jython-command)) |
| 1781 | 2266 | ||
| 1782 | (provide 'python) | 2267 | (provide 'python) |
| 2268 | (provide 'python-21) | ||
| 1783 | ;; arch-tag: 6fce1d99-a704-4de9-ba19-c6e4912b0554 | 2269 | ;; arch-tag: 6fce1d99-a704-4de9-ba19-c6e4912b0554 |
| 1784 | ;;; python.el ends here | 2270 | ;;; python.el ends here |
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 6098c8be067..f828c36917b 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/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el index 987b37cf2c2..cf887394e6b 100644 --- a/lisp/progmodes/vhdl-mode.el +++ b/lisp/progmodes/vhdl-mode.el | |||
| @@ -14112,8 +14112,8 @@ if required." | |||
| 14112 | (defun vhdl-speedbar-display-directory (directory depth &optional rescan) | 14112 | (defun vhdl-speedbar-display-directory (directory depth &optional rescan) |
| 14113 | "Display directory and hierarchy information in speedbar." | 14113 | "Display directory and hierarchy information in speedbar." |
| 14114 | (setq vhdl-speedbar-show-projects nil) | 14114 | (setq vhdl-speedbar-show-projects nil) |
| 14115 | (setq speedbar-ignored-path-regexp | 14115 | (setq speedbar-ignored-directory-regexp |
| 14116 | (speedbar-extension-list-to-regex speedbar-ignored-path-expressions)) | 14116 | (speedbar-extension-list-to-regex speedbar-ignored-directory-expressions)) |
| 14117 | (setq directory (abbreviate-file-name (file-name-as-directory directory))) | 14117 | (setq directory (abbreviate-file-name (file-name-as-directory directory))) |
| 14118 | (setq speedbar-last-selected-file nil) | 14118 | (setq speedbar-last-selected-file nil) |
| 14119 | (speedbar-with-writable | 14119 | (speedbar-with-writable |
| @@ -14133,7 +14133,7 @@ if required." | |||
| 14133 | (defun vhdl-speedbar-display-projects (project depth &optional rescan) | 14133 | (defun vhdl-speedbar-display-projects (project depth &optional rescan) |
| 14134 | "Display projects and hierarchy information in speedbar." | 14134 | "Display projects and hierarchy information in speedbar." |
| 14135 | (setq vhdl-speedbar-show-projects t) | 14135 | (setq vhdl-speedbar-show-projects t) |
| 14136 | (setq speedbar-ignored-path-regexp ".") | 14136 | (setq speedbar-ignored-directory-regexp ".") |
| 14137 | (setq speedbar-last-selected-file nil) | 14137 | (setq speedbar-last-selected-file nil) |
| 14138 | (setq vhdl-speedbar-last-selected-project nil) | 14138 | (setq vhdl-speedbar-last-selected-project nil) |
| 14139 | (speedbar-with-writable | 14139 | (speedbar-with-writable |
diff --git a/lisp/rect.el b/lisp/rect.el index be3a65ccd6a..9515733ef2b 100644 --- a/lisp/rect.el +++ b/lisp/rect.el | |||
| @@ -181,12 +181,9 @@ the function is called." | |||
| 181 | 181 | ||
| 182 | ;; this one is untouched --dv | 182 | ;; this one is untouched --dv |
| 183 | (defun spaces-string (n) | 183 | (defun spaces-string (n) |
| 184 | "Returns a string with N spaces." | ||
| 184 | (if (<= n 8) (aref spaces-strings n) | 185 | (if (<= n 8) (aref spaces-strings n) |
| 185 | (let ((val "")) | 186 | (make-string n ? ))) |
| 186 | (while (> n 8) | ||
| 187 | (setq val (concat " " val) | ||
| 188 | n (- n 8))) | ||
| 189 | (concat val (aref spaces-strings n))))) | ||
| 190 | 187 | ||
| 191 | ;;;###autoload | 188 | ;;;###autoload |
| 192 | (defun delete-rectangle (start end &optional fill) | 189 | (defun delete-rectangle (start end &optional fill) |
diff --git a/lisp/simple.el b/lisp/simple.el index 67cd341bf1f..f07006b5cc8 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -887,7 +887,9 @@ and the greater of them is not at the start of a line." | |||
| 887 | 887 | ||
| 888 | (defun line-number-at-pos (&optional pos) | 888 | (defun line-number-at-pos (&optional pos) |
| 889 | "Return (narrowed) buffer line number at position POS. | 889 | "Return (narrowed) buffer line number at position POS. |
| 890 | If POS is nil, use current buffer location." | 890 | If POS is nil, use current buffer location. |
| 891 | Counting starts at (point-min), so the value refers | ||
| 892 | to the contents of the accessible portion of the buffer." | ||
| 891 | (let ((opoint (or pos (point))) start) | 893 | (let ((opoint (or pos (point))) start) |
| 892 | (save-excursion | 894 | (save-excursion |
| 893 | (goto-char (point-min)) | 895 | (goto-char (point-min)) |
| @@ -3689,7 +3691,10 @@ because what we really need is for `move-to-column' | |||
| 3689 | and `current-column' to be able to ignore invisible text." | 3691 | and `current-column' to be able to ignore invisible text." |
| 3690 | (if (zerop col) | 3692 | (if (zerop col) |
| 3691 | (beginning-of-line) | 3693 | (beginning-of-line) |
| 3692 | (move-to-column col)) | 3694 | (let ((opoint (point))) |
| 3695 | (move-to-column col) | ||
| 3696 | ;; move-to-column doesn't respect field boundaries. | ||
| 3697 | (goto-char (constrain-to-field (point) opoint)))) | ||
| 3693 | 3698 | ||
| 3694 | (when (and line-move-ignore-invisible | 3699 | (when (and line-move-ignore-invisible |
| 3695 | (not (bolp)) (line-move-invisible-p (1- (point)))) | 3700 | (not (bolp)) (line-move-invisible-p (1- (point)))) |
| @@ -3759,7 +3764,8 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." | |||
| 3759 | (interactive "p") | 3764 | (interactive "p") |
| 3760 | (or arg (setq arg 1)) | 3765 | (or arg (setq arg 1)) |
| 3761 | 3766 | ||
| 3762 | (let ((orig (point))) | 3767 | (let ((orig (point)) |
| 3768 | start first-vis first-vis-field-value) | ||
| 3763 | 3769 | ||
| 3764 | ;; Move by lines, if ARG is not 1 (the default). | 3770 | ;; Move by lines, if ARG is not 1 (the default). |
| 3765 | (if (/= arg 1) | 3771 | (if (/= arg 1) |
| @@ -3770,10 +3776,24 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." | |||
| 3770 | (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) | 3776 | (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) |
| 3771 | (goto-char (previous-char-property-change (point))) | 3777 | (goto-char (previous-char-property-change (point))) |
| 3772 | (skip-chars-backward "^\n")) | 3778 | (skip-chars-backward "^\n")) |
| 3773 | 3779 | (setq start (point)) | |
| 3774 | ;; Take care of fields. | 3780 | |
| 3775 | (goto-char (constrain-to-field (point) orig | 3781 | ;; Now find first visible char in the line |
| 3776 | (/= arg 1) t nil)))) | 3782 | (while (and (not (eobp)) (line-move-invisible-p (point))) |
| 3783 | (goto-char (next-char-property-change (point)))) | ||
| 3784 | (setq first-vis (point)) | ||
| 3785 | |||
| 3786 | ;; See if fields would stop us from reaching FIRST-VIS. | ||
| 3787 | (setq first-vis-field-value | ||
| 3788 | (constrain-to-field first-vis orig (/= arg 1) t nil)) | ||
| 3789 | |||
| 3790 | (goto-char (if (/= first-vis-field-value first-vis) | ||
| 3791 | ;; If yes, obey them. | ||
| 3792 | first-vis-field-value | ||
| 3793 | ;; Otherwise, move to START with attention to fields. | ||
| 3794 | ;; (It is possible that fields never matter in this case.) | ||
| 3795 | (constrain-to-field (point) orig | ||
| 3796 | (/= arg 1) t nil))))) | ||
| 3777 | 3797 | ||
| 3778 | 3798 | ||
| 3779 | ;;; Many people have said they rarely use this feature, and often type | 3799 | ;;; Many people have said they rarely use this feature, and often type |
diff --git a/lisp/startup.el b/lisp/startup.el index 5a6b4089770..b96503603c2 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -1249,11 +1249,16 @@ where FACE is a valid face specification, as it can be used with | |||
| 1249 | "GNU Emacs is one component of the GNU/Linux operating system." | 1249 | "GNU Emacs is one component of the GNU/Linux operating system." |
| 1250 | "GNU Emacs is one component of the GNU operating system.")) | 1250 | "GNU Emacs is one component of the GNU operating system.")) |
| 1251 | (insert "\n") | 1251 | (insert "\n") |
| 1252 | (unless (equal (buffer-name fancy-splash-outer-buffer) "*scratch*") | 1252 | (if fancy-splash-outer-buffer |
| 1253 | (fancy-splash-insert :face 'variable-pitch | 1253 | (fancy-splash-insert |
| 1254 | (substitute-command-keys | 1254 | :face 'variable-pitch |
| 1255 | "Type \\[recenter] to begin editing your file.\n")))) | 1255 | (substitute-command-keys |
| 1256 | 1256 | (concat | |
| 1257 | "Type \\[recenter] to begin editing" | ||
| 1258 | (if (equal (buffer-name fancy-splash-outer-buffer) | ||
| 1259 | "*scratch*") | ||
| 1260 | ".\n" | ||
| 1261 | " your file.\n")))))) | ||
| 1257 | 1262 | ||
| 1258 | (defun fancy-splash-tail () | 1263 | (defun fancy-splash-tail () |
| 1259 | "Insert the tail part of the splash screen into the current buffer." | 1264 | "Insert the tail part of the splash screen into the current buffer." |
| @@ -1333,55 +1338,74 @@ mouse." | |||
| 1333 | (if (frame-live-p frame) | 1338 | (if (frame-live-p frame) |
| 1334 | (run-at-time 0 nil 'fancy-splash-exit))) | 1339 | (run-at-time 0 nil 'fancy-splash-exit))) |
| 1335 | 1340 | ||
| 1336 | (defun fancy-splash-screens () | 1341 | (defun fancy-splash-screens (&optional hide-on-input) |
| 1337 | "Display fancy splash screens when Emacs starts." | 1342 | "Display fancy splash screens when Emacs starts." |
| 1338 | (setq fancy-splash-help-echo (startup-echo-area-message)) | 1343 | (setq fancy-splash-help-echo (startup-echo-area-message)) |
| 1339 | (let ((old-hourglass display-hourglass) | 1344 | (if hide-on-input |
| 1340 | (fancy-splash-outer-buffer (current-buffer)) | 1345 | (let ((old-hourglass display-hourglass) |
| 1341 | splash-buffer | 1346 | (fancy-splash-outer-buffer (current-buffer)) |
| 1342 | (old-minor-mode-map-alist minor-mode-map-alist) | 1347 | splash-buffer |
| 1343 | (old-emulation-mode-map-alists emulation-mode-map-alists) | 1348 | (old-minor-mode-map-alist minor-mode-map-alist) |
| 1344 | (frame (fancy-splash-frame)) | 1349 | (old-emulation-mode-map-alists emulation-mode-map-alists) |
| 1345 | timer) | 1350 | (frame (fancy-splash-frame)) |
| 1346 | (save-selected-window | 1351 | timer) |
| 1347 | (select-frame frame) | 1352 | (save-selected-window |
| 1348 | (switch-to-buffer "GNU Emacs") | 1353 | (select-frame frame) |
| 1349 | (setq tab-width 20) | 1354 | (switch-to-buffer "GNU Emacs") |
| 1350 | (setq splash-buffer (current-buffer)) | 1355 | (setq tab-width 20) |
| 1351 | (catch 'stop-splashing | 1356 | (setq splash-buffer (current-buffer)) |
| 1352 | (unwind-protect | 1357 | (catch 'stop-splashing |
| 1353 | (let* ((map (make-sparse-keymap)) | 1358 | (unwind-protect |
| 1354 | (overriding-local-map map) | 1359 | (let* ((map (make-sparse-keymap)) |
| 1355 | ;; Catch if our frame is deleted; the delete-frame | 1360 | (overriding-local-map map) |
| 1356 | ;; event is unreliable and is handled by | 1361 | ;; Catch if our frame is deleted; the delete-frame |
| 1357 | ;; `special-event-map' anyway. | 1362 | ;; event is unreliable and is handled by |
| 1358 | (delete-frame-functions (cons 'fancy-splash-delete-frame | 1363 | ;; `special-event-map' anyway. |
| 1359 | delete-frame-functions))) | 1364 | (delete-frame-functions (cons 'fancy-splash-delete-frame |
| 1360 | (define-key map [t] 'fancy-splash-default-action) | 1365 | delete-frame-functions))) |
| 1361 | (define-key map [mouse-movement] 'ignore) | 1366 | (define-key map [t] 'fancy-splash-default-action) |
| 1362 | (define-key map [mode-line t] 'ignore) | 1367 | (define-key map [mouse-movement] 'ignore) |
| 1363 | (define-key map [select-window] 'ignore) | 1368 | (define-key map [mode-line t] 'ignore) |
| 1364 | (setq cursor-type nil | 1369 | (define-key map [select-window] 'ignore) |
| 1365 | display-hourglass nil | 1370 | (setq cursor-type nil |
| 1366 | minor-mode-map-alist nil | 1371 | display-hourglass nil |
| 1367 | emulation-mode-map-alists nil | 1372 | minor-mode-map-alist nil |
| 1368 | buffer-undo-list t | 1373 | emulation-mode-map-alists nil |
| 1369 | mode-line-format (propertize "---- %b %-" | 1374 | buffer-undo-list t |
| 1370 | 'face 'mode-line-buffer-id) | 1375 | mode-line-format (propertize "---- %b %-" |
| 1371 | fancy-splash-stop-time (+ (float-time) | 1376 | 'face 'mode-line-buffer-id) |
| 1372 | fancy-splash-max-time) | 1377 | fancy-splash-stop-time (+ (float-time) |
| 1373 | timer (run-with-timer 0 fancy-splash-delay | 1378 | fancy-splash-max-time) |
| 1374 | #'fancy-splash-screens-1 | 1379 | timer (run-with-timer 0 fancy-splash-delay |
| 1375 | splash-buffer)) | 1380 | #'fancy-splash-screens-1 |
| 1376 | (recursive-edit)) | 1381 | splash-buffer)) |
| 1377 | (cancel-timer timer) | 1382 | (recursive-edit)) |
| 1378 | (setq display-hourglass old-hourglass | 1383 | (cancel-timer timer) |
| 1379 | minor-mode-map-alist old-minor-mode-map-alist | 1384 | (setq display-hourglass old-hourglass |
| 1380 | emulation-mode-map-alists old-emulation-mode-map-alists) | 1385 | minor-mode-map-alist old-minor-mode-map-alist |
| 1381 | (kill-buffer splash-buffer) | 1386 | emulation-mode-map-alists old-emulation-mode-map-alists) |
| 1382 | (when (frame-live-p frame) | 1387 | (kill-buffer splash-buffer) |
| 1383 | (select-frame frame) | 1388 | (when (frame-live-p frame) |
| 1384 | (switch-to-buffer fancy-splash-outer-buffer))))))) | 1389 | (select-frame frame) |
| 1390 | (switch-to-buffer fancy-splash-outer-buffer)))))) | ||
| 1391 | ;; If hide-on-input is non-nil, don't hide the buffer on input. | ||
| 1392 | (if (or (window-minibuffer-p) | ||
| 1393 | (window-dedicated-p (selected-window))) | ||
| 1394 | (pop-to-buffer (current-buffer)) | ||
| 1395 | (switch-to-buffer "GNU Emacs")) | ||
| 1396 | (erase-buffer) | ||
| 1397 | (if pure-space-overflow | ||
| 1398 | (insert "\ | ||
| 1399 | Warning Warning!!! Pure space overflow !!!Warning Warning | ||
| 1400 | \(See the node Pure Storage in the Lisp manual for details.)\n")) | ||
| 1401 | (let (fancy-splash-outer-buffer) | ||
| 1402 | (fancy-splash-head) | ||
| 1403 | (dolist (text fancy-splash-text) | ||
| 1404 | (apply #'fancy-splash-insert text)) | ||
| 1405 | (fancy-splash-tail) | ||
| 1406 | (set-buffer-modified-p nil) | ||
| 1407 | (goto-char (point-min))))) | ||
| 1408 | |||
| 1385 | 1409 | ||
| 1386 | (defun fancy-splash-frame () | 1410 | (defun fancy-splash-frame () |
| 1387 | "Return the frame to use for the fancy splash screen. | 1411 | "Return the frame to use for the fancy splash screen. |
| @@ -1412,14 +1436,16 @@ we put it on this frame." | |||
| 1412 | (> window-height (+ image-height 19))))))) | 1436 | (> window-height (+ image-height 19))))))) |
| 1413 | 1437 | ||
| 1414 | 1438 | ||
| 1415 | (defun normal-splash-screen () | 1439 | (defun normal-splash-screen (&optional hide-on-input) |
| 1416 | "Display splash screen when Emacs starts." | 1440 | "Display splash screen when Emacs starts." |
| 1417 | (let ((prev-buffer (current-buffer))) | 1441 | (let ((prev-buffer (current-buffer))) |
| 1418 | (unwind-protect | 1442 | (unwind-protect |
| 1419 | (with-current-buffer (get-buffer-create "GNU Emacs") | 1443 | (with-current-buffer (get-buffer-create "GNU Emacs") |
| 1444 | (erase-buffer) | ||
| 1420 | (set (make-local-variable 'tab-width) 8) | 1445 | (set (make-local-variable 'tab-width) 8) |
| 1421 | (set (make-local-variable 'mode-line-format) | 1446 | (if hide-on-input |
| 1422 | (propertize "---- %b %-" 'face 'mode-line-buffer-id)) | 1447 | (set (make-local-variable 'mode-line-format) |
| 1448 | (propertize "---- %b %-" 'face 'mode-line-buffer-id))) | ||
| 1423 | 1449 | ||
| 1424 | (if pure-space-overflow | 1450 | (if pure-space-overflow |
| 1425 | (insert "\ | 1451 | (insert "\ |
| @@ -1435,9 +1461,13 @@ Warning Warning!!! Pure space overflow !!!Warning Warning | |||
| 1435 | ", one component of the GNU/Linux operating system.\n" | 1461 | ", one component of the GNU/Linux operating system.\n" |
| 1436 | ", a part of the GNU operating system.\n")) | 1462 | ", a part of the GNU operating system.\n")) |
| 1437 | 1463 | ||
| 1438 | (unless (equal (buffer-name prev-buffer) "*scratch*") | 1464 | (if hide-on-input |
| 1439 | (insert (substitute-command-keys | 1465 | (insert (substitute-command-keys |
| 1440 | "\nType \\[recenter] to begin editing your file.\n"))) | 1466 | (concat |
| 1467 | "\nType \\[recenter] to begin editing" | ||
| 1468 | (if (equal (buffer-name prev-buffer) "*scratch*") | ||
| 1469 | ".\n" | ||
| 1470 | " your file.\n"))))) | ||
| 1441 | 1471 | ||
| 1442 | (if (display-mouse-p) | 1472 | (if (display-mouse-p) |
| 1443 | ;; The user can use the mouse to activate menus | 1473 | ;; The user can use the mouse to activate menus |
| @@ -1548,20 +1578,23 @@ Type \\[describe-distribution] for information on getting the latest version.")) | |||
| 1548 | "type M-x recover-session RET\nto recover" | 1578 | "type M-x recover-session RET\nto recover" |
| 1549 | " the files you were editing.")) | 1579 | " the files you were editing.")) |
| 1550 | 1580 | ||
| 1551 | ;; Display the input that we set up in the buffer. | 1581 | ;; Display the input that we set up in the buffer. |
| 1552 | (set-buffer-modified-p nil) | 1582 | (set-buffer-modified-p nil) |
| 1553 | (goto-char (point-min)) | 1583 | (goto-char (point-min)) |
| 1554 | (if (or (window-minibuffer-p) | 1584 | (if (or (window-minibuffer-p) |
| 1555 | (window-dedicated-p (selected-window))) | 1585 | (window-dedicated-p (selected-window))) |
| 1556 | ;; There's no point is using pop-to-buffer since creating | 1586 | ;; If hide-on-input is nil, creating a new frame will |
| 1557 | ;; a new frame will generate enough events that the | 1587 | ;; generate enough events that the subsequent `sit-for' |
| 1558 | ;; subsequent `sit-for' will immediately return anyway. | 1588 | ;; will immediately return anyway. |
| 1559 | nil ;; (pop-to-buffer (current-buffer)) | 1589 | (pop-to-buffer (current-buffer)) |
| 1560 | (save-window-excursion | 1590 | (if hide-on-input |
| 1561 | (switch-to-buffer (current-buffer)) | 1591 | (save-window-excursion |
| 1562 | (sit-for 120)))) | 1592 | (switch-to-buffer (current-buffer)) |
| 1563 | ;; Unwind ... ensure splash buffer is killed | 1593 | (sit-for 120)) |
| 1564 | (kill-buffer "GNU Emacs")))) | 1594 | (switch-to-buffer (current-buffer))))) |
| 1595 | ;; Unwind ... ensure splash buffer is killed | ||
| 1596 | (if hide-on-input | ||
| 1597 | (kill-buffer "GNU Emacs"))))) | ||
| 1565 | 1598 | ||
| 1566 | 1599 | ||
| 1567 | (defun startup-echo-area-message () | 1600 | (defun startup-echo-area-message () |
| @@ -1615,7 +1648,7 @@ Type \\[describe-distribution] for information on getting the latest version.")) | |||
| 1615 | (message "%s" (startup-echo-area-message)))))) | 1648 | (message "%s" (startup-echo-area-message)))))) |
| 1616 | 1649 | ||
| 1617 | 1650 | ||
| 1618 | (defun display-splash-screen () | 1651 | (defun display-splash-screen (&optional hide-on-input) |
| 1619 | "Display splash screen according to display. | 1652 | "Display splash screen according to display. |
| 1620 | Fancy splash screens are used on graphic displays, | 1653 | Fancy splash screens are used on graphic displays, |
| 1621 | normal otherwise." | 1654 | normal otherwise." |
| @@ -1623,8 +1656,8 @@ normal otherwise." | |||
| 1623 | ;; Prevent recursive calls from server-process-filter. | 1656 | ;; Prevent recursive calls from server-process-filter. |
| 1624 | (if (not (get-buffer "GNU Emacs")) | 1657 | (if (not (get-buffer "GNU Emacs")) |
| 1625 | (if (use-fancy-splash-screens-p) | 1658 | (if (use-fancy-splash-screens-p) |
| 1626 | (fancy-splash-screens) | 1659 | (fancy-splash-screens hide-on-input) |
| 1627 | (normal-splash-screen)))) | 1660 | (normal-splash-screen hide-on-input)))) |
| 1628 | 1661 | ||
| 1629 | (defun command-line-1 (command-line-args-left) | 1662 | (defun command-line-1 (command-line-args-left) |
| 1630 | (display-startup-echo-area-message) | 1663 | (display-startup-echo-area-message) |
| @@ -1888,7 +1921,7 @@ normal otherwise." | |||
| 1888 | ;; If user typed input during all that work, | 1921 | ;; If user typed input during all that work, |
| 1889 | ;; abort the startup screen. Otherwise, display it now. | 1922 | ;; abort the startup screen. Otherwise, display it now. |
| 1890 | (unless (input-pending-p) | 1923 | (unless (input-pending-p) |
| 1891 | (display-splash-screen)))) | 1924 | (display-splash-screen t)))) |
| 1892 | 1925 | ||
| 1893 | 1926 | ||
| 1894 | (defun command-line-normalize-file-name (file) | 1927 | (defun command-line-normalize-file-name (file) |
diff --git a/lisp/t-mouse.el b/lisp/t-mouse.el index 17d486749b3..06b77840c0d 100644 --- a/lisp/t-mouse.el +++ b/lisp/t-mouse.el | |||
| @@ -292,9 +292,7 @@ Turn it on to use emacs mouse commands, and off to use t-mouse commands." | |||
| 292 | "-f"))) | 292 | "-f"))) |
| 293 | (setq t-mouse-filter-accumulator "") | 293 | (setq t-mouse-filter-accumulator "") |
| 294 | (set-process-filter t-mouse-process 't-mouse-process-filter) | 294 | (set-process-filter t-mouse-process 't-mouse-process-filter) |
| 295 | ; use commented line instead for emacs 21.4 onwards | 295 | (set-process-query-on-exit-flag t-mouse-process nil))) |
| 296 | (process-kill-without-query t-mouse-process))) | ||
| 297 | ; (set-process-query-on-exit-flag t-mouse-process nil))) | ||
| 298 | ;; Turn it off | 296 | ;; Turn it off |
| 299 | (setq mouse-position-function nil) | 297 | (setq mouse-position-function nil) |
| 300 | (delete-process t-mouse-process) | 298 | (delete-process t-mouse-process) |
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index c66c59a0889..9e3393b04a1 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el | |||
| @@ -1539,7 +1539,7 @@ in `selection-converter-alist', which see." | |||
| 1539 | (put 'autosave-now 'mac-apple-event-id "asav") ; kAEAutosaveNow | 1539 | (put 'autosave-now 'mac-apple-event-id "asav") ; kAEAutosaveNow |
| 1540 | ;; kAEInternetEventClass | 1540 | ;; kAEInternetEventClass |
| 1541 | (put 'get-url 'mac-apple-event-id "GURL") ; kAEGetURL | 1541 | (put 'get-url 'mac-apple-event-id "GURL") ; kAEGetURL |
| 1542 | ;; Converted HICommand events | 1542 | ;; Converted HI command events |
| 1543 | (put 'about 'mac-apple-event-id "abou") ; kHICommandAbout | 1543 | (put 'about 'mac-apple-event-id "abou") ; kHICommandAbout |
| 1544 | 1544 | ||
| 1545 | (defmacro mac-event-spec (event) | 1545 | (defmacro mac-event-spec (event) |
| @@ -1739,7 +1739,7 @@ Currently the `mailto' scheme is supported." | |||
| 1739 | 1739 | ||
| 1740 | (define-key mac-apple-event-map [internet-event get-url] 'mac-ae-get-url) | 1740 | (define-key mac-apple-event-map [internet-event get-url] 'mac-ae-get-url) |
| 1741 | 1741 | ||
| 1742 | (define-key mac-apple-event-map [hicommand about] 'display-splash-screen) | 1742 | (define-key mac-apple-event-map [hi-command about] 'display-splash-screen) |
| 1743 | 1743 | ||
| 1744 | ;;; Converted Carbon Events | 1744 | ;;; Converted Carbon Events |
| 1745 | (defun mac-handle-toolbar-switch-mode (event) | 1745 | (defun mac-handle-toolbar-switch-mode (event) |
| @@ -2208,7 +2208,8 @@ See also `mac-dnd-known-types'." | |||
| 2208 | ;; If dropping in an ordinary window which we could use, | 2208 | ;; If dropping in an ordinary window which we could use, |
| 2209 | ;; let dnd-open-file-other-window specify what to do. | 2209 | ;; let dnd-open-file-other-window specify what to do. |
| 2210 | (progn | 2210 | (progn |
| 2211 | (goto-char (posn-point (event-start event))) | 2211 | (when (not mouse-yank-at-point) |
| 2212 | (goto-char (posn-point (event-start event)))) | ||
| 2212 | (funcall handler window action data)) | 2213 | (funcall handler window action data)) |
| 2213 | ;; If we can't display the file here, | 2214 | ;; If we can't display the file here, |
| 2214 | ;; make a new window for it. | 2215 | ;; make a new window for it. |
| @@ -2561,8 +2562,8 @@ ascii:-*-Monaco-*-*-*-*-12-*-*-*-*-*-mac-roman") | |||
| 2561 | 2562 | ||
| 2562 | ;; Initiate drag and drop | 2563 | ;; Initiate drag and drop |
| 2563 | 2564 | ||
| 2564 | (global-set-key [drag-n-drop] 'mac-dnd-handle-drag-n-drop-event) | 2565 | (define-key special-event-map [drag-n-drop] 'mac-dnd-handle-drag-n-drop-event) |
| 2565 | (global-set-key [M-drag-n-drop] 'mac-dnd-handle-drag-n-drop-event) | 2566 | (define-key special-event-map [M-drag-n-drop] 'mac-dnd-handle-drag-n-drop-event) |
| 2566 | 2567 | ||
| 2567 | 2568 | ||
| 2568 | ;;;; Non-toolkit Scroll bars | 2569 | ;;;; Non-toolkit Scroll bars |
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 9730aca9b9d..fe774a4125f 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el | |||
| @@ -2386,7 +2386,7 @@ order until succeed.") | |||
| 2386 | 2386 | ||
| 2387 | (defun x-clipboard-yank () | 2387 | (defun x-clipboard-yank () |
| 2388 | "Insert the clipboard contents, or the last stretch of killed text." | 2388 | "Insert the clipboard contents, or the last stretch of killed text." |
| 2389 | (interactive) | 2389 | (interactive "*") |
| 2390 | (let ((clipboard-text (x-selection-value 'CLIPBOARD)) | 2390 | (let ((clipboard-text (x-selection-value 'CLIPBOARD)) |
| 2391 | (x-select-enable-clipboard t)) | 2391 | (x-select-enable-clipboard t)) |
| 2392 | (if (and clipboard-text (> (length clipboard-text) 0)) | 2392 | (if (and clipboard-text (> (length clipboard-text) 0)) |
| @@ -2518,8 +2518,9 @@ order until succeed.") | |||
| 2518 | 2518 | ||
| 2519 | ;; Override Paste so it looks at CLIPBOARD first. | 2519 | ;; Override Paste so it looks at CLIPBOARD first. |
| 2520 | (define-key menu-bar-edit-menu [paste] | 2520 | (define-key menu-bar-edit-menu [paste] |
| 2521 | (cons "Paste" (cons "Paste text from clipboard or kill ring" | 2521 | '(menu-item "Paste" x-clipboard-yank |
| 2522 | 'x-clipboard-yank))) | 2522 | :enable (not buffer-read-only) |
| 2523 | :help "Paste (yank) text most recently cut/copied")) | ||
| 2523 | 2524 | ||
| 2524 | (setq x-initialized t)) | 2525 | (setq x-initialized t)) |
| 2525 | 2526 | ||
| @@ -2531,7 +2532,7 @@ order until succeed.") | |||
| 2531 | 2532 | ||
| 2532 | ;; Initiate drag and drop | 2533 | ;; Initiate drag and drop |
| 2533 | (add-hook 'after-make-frame-functions 'x-dnd-init-frame) | 2534 | (add-hook 'after-make-frame-functions 'x-dnd-init-frame) |
| 2534 | (global-set-key [drag-n-drop] 'x-dnd-handle-drag-n-drop-event) | 2535 | (define-key special-event-map [drag-n-drop] 'x-dnd-handle-drag-n-drop-event) |
| 2535 | 2536 | ||
| 2536 | ;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78 | 2537 | ;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78 |
| 2537 | ;;; x-win.el ends here | 2538 | ;;; x-win.el ends here |
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 9c4b8b1190b..2e498a8de86 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el | |||
| @@ -159,8 +159,37 @@ | |||
| 159 | (define-key xterm-function-map "\e[4~" [select]) | 159 | (define-key xterm-function-map "\e[4~" [select]) |
| 160 | (define-key xterm-function-map "\e[29~" [print]) | 160 | (define-key xterm-function-map "\e[29~" [print]) |
| 161 | 161 | ||
| 162 | ;; These keys are available in xterm starting from version 214 | 162 | ;; These keys are available in xterm starting from version 216 |
| 163 | ;; if the modifyOtherKeys resource is set to 1. | 163 | ;; if the modifyOtherKeys resource is set to 1. |
| 164 | |||
| 165 | (define-key xterm-function-map "\e[27;5;39~" [?\C-\']) | ||
| 166 | (define-key xterm-function-map "\e[27;5;45~" [?\C--]) | ||
| 167 | |||
| 168 | (define-key xterm-function-map "\e[27;5;48~" [?\C-0]) | ||
| 169 | (define-key xterm-function-map "\e[27;5;49~" [?\C-1]) | ||
| 170 | ;; Not all C-DIGIT keys have a distinct binding. | ||
| 171 | (define-key xterm-function-map "\e[27;5;57~" [?\C-9]) | ||
| 172 | |||
| 173 | (define-key xterm-function-map "\e[27;5;59~" [?\C-\;]) | ||
| 174 | (define-key xterm-function-map "\e[27;5;61~" [?\C-=]) | ||
| 175 | |||
| 176 | |||
| 177 | (define-key xterm-function-map "\e[27;6;33~" [?\C-!]) | ||
| 178 | (define-key xterm-function-map "\e[27;6;34~" [?\C-\"]) | ||
| 179 | (define-key xterm-function-map "\e[27;6;35~" [?\C-#]) | ||
| 180 | (define-key xterm-function-map "\e[27;6;36~" [?\C-$]) | ||
| 181 | (define-key xterm-function-map "\e[27;6;37~" [?\C-%]) | ||
| 182 | (define-key xterm-function-map "\e[27;6;38~" [(C-&)]) | ||
| 183 | (define-key xterm-function-map "\e[27;6;40~" [?\C-(]) | ||
| 184 | (define-key xterm-function-map "\e[27;6;41~" [?\C-)]) | ||
| 185 | (define-key xterm-function-map "\e[27;6;42~" [?\C-*]) | ||
| 186 | (define-key xterm-function-map "\e[27;6;43~" [?\C-+]) | ||
| 187 | |||
| 188 | (define-key xterm-function-map "\e[27;6;58~" [?\C-:]) | ||
| 189 | (define-key xterm-function-map "\e[27;6;60~" [?\C-<]) | ||
| 190 | (define-key xterm-function-map "\e[27;6;62~" [?\C->]) | ||
| 191 | (define-key xterm-function-map "\e[27;6;63~" [(C-\?)]) | ||
| 192 | |||
| 164 | (define-key xterm-function-map "\e[27;5;9~" [C-tab]) | 193 | (define-key xterm-function-map "\e[27;5;9~" [C-tab]) |
| 165 | (define-key xterm-function-map "\e[27;5;13~" [C-return]) | 194 | (define-key xterm-function-map "\e[27;5;13~" [C-return]) |
| 166 | (define-key xterm-function-map "\e[27;5;44~" [?\C-,]) | 195 | (define-key xterm-function-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 | |||
| 96 | If this variable is t, the serial number is incremented upon each save of | ||
| 97 | the file. If it is `ask', Emacs asks for confirmation whether it should | ||
| 98 | increment the serial upon saving. If nil, serials must be incremented | ||
| 99 | manually 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 | |||
| 214 | This 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..ecbcd86d043 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 | |||
| 1132 | file identifier are | 1131 | file 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'. |
| 2155 | When org-mode is exporting an org-mode file to HTML, links to | 2165 | When 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 | |||
| 5200 | that the match should indeed be shown." | 5209 | that 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. | |||
| 5625 | For time difference computation, a year is assumed to be exactly 365 | 5633 | For time difference computation, a year is assumed to be exactly 365 |
| 5626 | days in order to avoid rounding problems." | 5634 | days 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. |
| 5942 | Puts the resulting times in minutes as a text property on each headline." | 5953 | Puts 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. | ||
| 6098 | Otherwise, 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. | ||
| 6127 | Key is a symbol specifying the range and can be one of `today', `yesterday', | ||
| 6128 | `thisweek', `lastweek', `thismonth', `lastmonth', `thisyear', `lastyear'. | ||
| 6129 | A week starts Monday 0:00 and ends Sunday 24:00. | ||
| 6130 | The range is determined relative to TIME. TIME defaults to the current time. | ||
| 6131 | The return value is a cons cell with two internal times like the ones | ||
| 6132 | returned by `current time' or `encode-time'. if AS-STRINGS is non-nil, | ||
| 6133 | the 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) |
| @@ -9359,6 +9467,7 @@ onto the ring." | |||
| 9359 | "Follow a Gnus link to GROUP and ARTICLE." | 9467 | "Follow a Gnus link to GROUP and ARTICLE." |
| 9360 | (require 'gnus) | 9468 | (require 'gnus) |
| 9361 | (funcall (cdr (assq 'gnus org-link-frame-setup))) | 9469 | (funcall (cdr (assq 'gnus org-link-frame-setup))) |
| 9470 | (if gnus-other-frame-object (select-frame gnus-other-frame-object)) | ||
| 9362 | (if group (gnus-fetch-group group)) | 9471 | (if group (gnus-fetch-group group)) |
| 9363 | (if article | 9472 | (if article |
| 9364 | (or (gnus-summary-goto-article article nil 'force) | 9473 | (or (gnus-summary-goto-article article nil 'force) |
| @@ -10234,13 +10343,13 @@ to be run from that hook to fucntion properly." | |||
| 10234 | (org-startup-with-deadline-check nil)) | 10343 | (org-startup-with-deadline-check nil)) |
| 10235 | (org-mode)) | 10344 | (org-mode)) |
| 10236 | (if (and file (string-match "\\S-" file) (not (file-directory-p file))) | 10345 | (if (and file (string-match "\\S-" file) (not (file-directory-p file))) |
| 10237 | (set (make-local-variable 'org-default-notes-file) file)) | 10346 | (org-set-local 'org-default-notes-file file)) |
| 10238 | (goto-char (point-min)) | 10347 | (goto-char (point-min)) |
| 10239 | (if (re-search-forward "%\\?" nil t) (replace-match ""))) | 10348 | (if (re-search-forward "%\\?" nil t) (replace-match ""))) |
| 10240 | (let ((org-startup-folded nil) | 10349 | (let ((org-startup-folded nil) |
| 10241 | (org-startup-with-deadline-check nil)) | 10350 | (org-startup-with-deadline-check nil)) |
| 10242 | (org-mode))) | 10351 | (org-mode))) |
| 10243 | (set (make-local-variable 'org-finish-function) 'remember-buffer)) | 10352 | (org-set-local 'org-finish-function 'remember-buffer)) |
| 10244 | 10353 | ||
| 10245 | ;;;###autoload | 10354 | ;;;###autoload |
| 10246 | (defun org-remember-handler () | 10355 | (defun org-remember-handler () |
| @@ -11492,10 +11601,10 @@ it can be edited in place." | |||
| 11492 | '(invisible t org-cwidth t display t | 11601 | '(invisible t org-cwidth t display t |
| 11493 | intangible t)) | 11602 | intangible t)) |
| 11494 | (goto-char p) | 11603 | (goto-char p) |
| 11495 | (set (make-local-variable 'org-finish-function) | 11604 | (org-set-local 'org-finish-function |
| 11496 | 'org-table-finish-edit-field) | 11605 | 'org-table-finish-edit-field) |
| 11497 | (set (make-local-variable 'org-window-configuration) cw) | 11606 | (org-set-local 'org-window-configuration cw) |
| 11498 | (set (make-local-variable 'org-field-marker) pos) | 11607 | (org-set-local 'org-field-marker pos) |
| 11499 | (message "Edit and finish with C-c C-c")))) | 11608 | (message "Edit and finish with C-c C-c")))) |
| 11500 | 11609 | ||
| 11501 | (defun org-table-finish-edit-field () | 11610 | (defun org-table-finish-edit-field () |
| @@ -12098,10 +12207,11 @@ not overwrite the stored one." | |||
| 12098 | (setq formula (car tmp) | 12207 | (setq formula (car tmp) |
| 12099 | fmt (concat (cdr (assoc "%" org-table-local-parameters)) | 12208 | fmt (concat (cdr (assoc "%" org-table-local-parameters)) |
| 12100 | (nth 1 tmp))) | 12209 | (nth 1 tmp))) |
| 12101 | (while (string-match "[pnfse]\\(-?[0-9]+\\)" fmt) | 12210 | (while (string-match "\\([pnfse]\\)\\(-?[0-9]+\\)" fmt) |
| 12102 | (setq c (string-to-char (match-string 1 fmt)) | 12211 | (setq c (string-to-char (match-string 1 fmt)) |
| 12103 | n (string-to-number (or (match-string 1 fmt) ""))) | 12212 | n (string-to-number (match-string 2 fmt))) |
| 12104 | (if (= c ?p) (setq modes (org-set-calc-mode 'calc-internal-prec n)) | 12213 | (if (= c ?p) |
| 12214 | (setq modes (org-set-calc-mode 'calc-internal-prec n)) | ||
| 12105 | (setq modes (org-set-calc-mode | 12215 | (setq modes (org-set-calc-mode |
| 12106 | 'calc-float-format | 12216 | 'calc-float-format |
| 12107 | (list (cdr (assoc c '((?n . float) (?f . fix) | 12217 | (list (cdr (assoc c '((?n . float) (?f . fix) |
| @@ -12314,8 +12424,8 @@ Parameters get priority." | |||
| 12314 | (switch-to-buffer-other-window "*Edit Formulas*") | 12424 | (switch-to-buffer-other-window "*Edit Formulas*") |
| 12315 | (erase-buffer) | 12425 | (erase-buffer) |
| 12316 | (fundamental-mode) | 12426 | (fundamental-mode) |
| 12317 | (set (make-local-variable 'org-pos) pos) | 12427 | (org-set-local 'org-pos pos) |
| 12318 | (set (make-local-variable 'org-window-configuration) wc) | 12428 | (org-set-local 'org-window-configuration wc) |
| 12319 | (use-local-map org-edit-formulas-map) | 12429 | (use-local-map org-edit-formulas-map) |
| 12320 | (setq s "# Edit formulas and finish with `C-c C-c'. | 12430 | (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. | 12431 | # Use `C-u C-c C-c' to also appy them immediately to the entire table. |
| @@ -12481,15 +12591,15 @@ table editor in arbitrary modes.") | |||
| 12481 | (let ((c (assq 'orgtbl-mode minor-mode-map-alist))) | 12591 | (let ((c (assq 'orgtbl-mode minor-mode-map-alist))) |
| 12482 | (and c (setq minor-mode-map-alist | 12592 | (and c (setq minor-mode-map-alist |
| 12483 | (cons c (delq c minor-mode-map-alist))))) | 12593 | (cons c (delq c minor-mode-map-alist))))) |
| 12484 | (set (make-local-variable (quote org-table-may-need-update)) t) | 12594 | (org-set-local (quote org-table-may-need-update) t) |
| 12485 | (org-add-hook 'before-change-functions 'org-before-change-function | 12595 | (org-add-hook 'before-change-functions 'org-before-change-function |
| 12486 | nil 'local) | 12596 | nil 'local) |
| 12487 | (set (make-local-variable 'org-old-auto-fill-inhibit-regexp) | 12597 | (org-set-local 'org-old-auto-fill-inhibit-regexp |
| 12488 | auto-fill-inhibit-regexp) | 12598 | auto-fill-inhibit-regexp) |
| 12489 | (set (make-local-variable 'auto-fill-inhibit-regexp) | 12599 | (org-set-local 'auto-fill-inhibit-regexp |
| 12490 | (if auto-fill-inhibit-regexp | 12600 | (if auto-fill-inhibit-regexp |
| 12491 | (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp) | 12601 | (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp) |
| 12492 | "[ \t]*|")) | 12602 | "[ \t]*|")) |
| 12493 | (org-add-to-invisibility-spec '(org-cwidth)) | 12603 | (org-add-to-invisibility-spec '(org-cwidth)) |
| 12494 | (easy-menu-add orgtbl-mode-menu) | 12604 | (easy-menu-add orgtbl-mode-menu) |
| 12495 | (run-hooks 'orgtbl-mode-hook)) | 12605 | (run-hooks 'orgtbl-mode-hook)) |
| @@ -13388,7 +13498,7 @@ underlined headlines. The default is 3." | |||
| 13388 | (set (make-local-variable (cdr x)) | 13498 | (set (make-local-variable (cdr x)) |
| 13389 | (plist-get opt-plist (car x)))) | 13499 | (plist-get opt-plist (car x)))) |
| 13390 | org-export-plist-vars) | 13500 | org-export-plist-vars) |
| 13391 | (set (make-local-variable 'org-odd-levels-only) odd) | 13501 | (org-set-local 'org-odd-levels-only odd) |
| 13392 | (setq umax (if arg (prefix-numeric-value arg) | 13502 | (setq umax (if arg (prefix-numeric-value arg) |
| 13393 | org-export-headline-levels)) | 13503 | org-export-headline-levels)) |
| 13394 | 13504 | ||
| @@ -13594,22 +13704,15 @@ command." | |||
| 13594 | (goto-char (point-min))))) | 13704 | (goto-char (point-min))))) |
| 13595 | 13705 | ||
| 13596 | (defun org-find-visible () | 13706 | (defun org-find-visible () |
| 13597 | (if (featurep 'noutline) | 13707 | (let ((s (point))) |
| 13598 | (let ((s (point))) | 13708 | (while (and (not (= (point-max) (setq s (next-overlay-change s)))) |
| 13599 | (while (and (not (= (point-max) (setq s (next-overlay-change s)))) | 13709 | (get-char-property s 'invisible))) |
| 13600 | (get-char-property s 'invisible))) | 13710 | s)) |
| 13601 | s) | ||
| 13602 | (skip-chars-forward "^\n") | ||
| 13603 | (point))) | ||
| 13604 | (defun org-find-invisible () | 13711 | (defun org-find-invisible () |
| 13605 | (if (featurep 'noutline) | 13712 | (let ((s (point))) |
| 13606 | (let ((s (point))) | 13713 | (while (and (not (= (point-max) (setq s (next-overlay-change s)))) |
| 13607 | (while (and (not (= (point-max) (setq s (next-overlay-change s)))) | 13714 | (not (get-char-property s 'invisible)))) |
| 13608 | (not (get-char-property s 'invisible)))) | 13715 | s)) |
| 13609 | s) | ||
| 13610 | (skip-chars-forward "^\r") | ||
| 13611 | (point))) | ||
| 13612 | |||
| 13613 | 13716 | ||
| 13614 | ;; HTML | 13717 | ;; HTML |
| 13615 | 13718 | ||
| @@ -13859,14 +13962,16 @@ lang=\"%s\" xml:lang=\"%s\"> | |||
| 13859 | (insert (or (plist-get opt-plist :preamble) "")) | 13962 | (insert (or (plist-get opt-plist :preamble) "")) |
| 13860 | 13963 | ||
| 13861 | (when (plist-get opt-plist :auto-preamble) | 13964 | (when (plist-get opt-plist :auto-preamble) |
| 13862 | (if title (insert (concat "<h1 class=\"title\">" | 13965 | (if title (insert (format org-export-html-title-format |
| 13863 | (org-html-expand title) "</h1>\n"))) | 13966 | (org-html-expand title)))) |
| 13864 | |||
| 13865 | (if text (insert "<p>\n" (org-html-expand text) "</p>"))) | 13967 | (if text (insert "<p>\n" (org-html-expand text) "</p>"))) |
| 13866 | 13968 | ||
| 13867 | (if org-export-with-toc | 13969 | (if org-export-with-toc |
| 13868 | (progn | 13970 | (progn |
| 13869 | (insert (format "<h2>%s</h2>\n" (nth 3 lang-words))) | 13971 | (insert (format "<h%d>%s</h%d>\n" |
| 13972 | org-export-html-toplevel-hlevel | ||
| 13973 | (nth 3 lang-words) | ||
| 13974 | org-export-html-toplevel-hlevel)) | ||
| 13870 | (insert "<ul>\n<li>") | 13975 | (insert "<ul>\n<li>") |
| 13871 | (setq lines | 13976 | (setq lines |
| 13872 | (mapcar '(lambda (line) | 13977 | (mapcar '(lambda (line) |
| @@ -14553,7 +14658,7 @@ When TITLE is nil, just close all open levels." | |||
| 14553 | (insert "<ul>\n<li>" title "<br/>\n"))) | 14658 | (insert "<ul>\n<li>" title "<br/>\n"))) |
| 14554 | (if org-export-with-section-numbers | 14659 | (if org-export-with-section-numbers |
| 14555 | (setq title (concat (org-section-number level) " " title))) | 14660 | (setq title (concat (org-section-number level) " " title))) |
| 14556 | (setq level (+ level 1)) | 14661 | (setq level (+ level org-export-html-toplevel-hlevel -1)) |
| 14557 | (if with-toc | 14662 | (if with-toc |
| 14558 | (insert (format "\n<h%d><a name=\"sec-%d\">%s</a></h%d>\n" | 14663 | (insert (format "\n<h%d><a name=\"sec-%d\">%s</a></h%d>\n" |
| 14559 | level head-count title level)) | 14664 | level head-count title level)) |
| @@ -15763,6 +15868,10 @@ See the individual commands for more information." | |||
| 15763 | "--" | 15868 | "--" |
| 15764 | ("TODO Lists" | 15869 | ("TODO Lists" |
| 15765 | ["TODO/DONE/-" org-todo t] | 15870 | ["TODO/DONE/-" org-todo t] |
| 15871 | ("Select keyword" | ||
| 15872 | ["Next keyword" org-shiftright (org-on-heading-p)] | ||
| 15873 | ["Previous keyword" org-shiftleft (org-on-heading-p)] | ||
| 15874 | ["Complete Keyword" org-complete (assq :todo-keyword (org-context))]) | ||
| 15766 | ["Show TODO Tree" org-show-todo-tree t] | 15875 | ["Show TODO Tree" org-show-todo-tree t] |
| 15767 | ["Global TODO list" org-todo-list t] | 15876 | ["Global TODO list" org-todo-list t] |
| 15768 | "--" | 15877 | "--" |
| @@ -16042,31 +16151,32 @@ return nil." | |||
| 16042 | ;; In the paragraph separator we include headlines, because filling | 16151 | ;; In the paragraph separator we include headlines, because filling |
| 16043 | ;; text in a line directly attached to a headline would otherwise | 16152 | ;; text in a line directly attached to a headline would otherwise |
| 16044 | ;; fill the headline as well. | 16153 | ;; fill the headline as well. |
| 16045 | (set (make-local-variable 'comment-start-skip) "^#+[ \t]*") | 16154 | (org-set-local 'comment-start-skip "^#+[ \t]*") |
| 16046 | (set (make-local-variable 'paragraph-separate) "\f\\|\\*\\|[ ]*$\\|[ \t]*[:|]") | 16155 | (org-set-local 'paragraph-separate "\f\\|\\*\\|[ ]*$\\|[ \t]*[:|]") |
| 16047 | ;; The paragraph starter includes hand-formatted lists. | 16156 | ;; The paragraph starter includes hand-formatted lists. |
| 16048 | (set (make-local-variable 'paragraph-start) | 16157 | (org-set-local 'paragraph-start |
| 16049 | "\f\\|[ ]*$\\|\\([*\f]+\\)\\|[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)\\|[ \t]*[:|]") | 16158 | "\f\\|[ ]*$\\|\\([*\f]+\\)\\|[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)\\|[ \t]*[:|]") |
| 16050 | ;; Inhibit auto-fill for headers, tables and fixed-width lines. | 16159 | ;; 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 | 16160 | ;; But only if the user has not turned off tables or fixed-width regions |
| 16052 | (set (make-local-variable 'auto-fill-inhibit-regexp) | 16161 | (org-set-local |
| 16053 | (concat "\\*\\|#" | 16162 | 'auto-fill-inhibit-regexp |
| 16054 | "\\|[ \t]*" org-keyword-time-regexp | 16163 | (concat "\\*\\|#" |
| 16055 | (if (or org-enable-table-editor org-enable-fixed-width-editor) | 16164 | "\\|[ \t]*" org-keyword-time-regexp |
| 16056 | (concat | 16165 | (if (or org-enable-table-editor org-enable-fixed-width-editor) |
| 16057 | "\\|[ \t]*[" | 16166 | (concat |
| 16058 | (if org-enable-table-editor "|" "") | 16167 | "\\|[ \t]*[" |
| 16059 | (if org-enable-fixed-width-editor ":" "") | 16168 | (if org-enable-table-editor "|" "") |
| 16060 | "]")))) | 16169 | (if org-enable-fixed-width-editor ":" "") |
| 16170 | "]")))) | ||
| 16061 | ;; We use our own fill-paragraph function, to make sure that tables | 16171 | ;; We use our own fill-paragraph function, to make sure that tables |
| 16062 | ;; and fixed-width regions are not wrapped. That function will pass | 16172 | ;; and fixed-width regions are not wrapped. That function will pass |
| 16063 | ;; through to `fill-paragraph' when appropriate. | 16173 | ;; through to `fill-paragraph' when appropriate. |
| 16064 | (set (make-local-variable 'fill-paragraph-function) 'org-fill-paragraph) | 16174 | (org-set-local 'fill-paragraph-function 'org-fill-paragraph) |
| 16065 | ;; Adaptive filling: To get full control, first make sure that | 16175 | ; Adaptive filling: To get full control, first make sure that |
| 16066 | ;; `adaptive-fill-regexp' never matches. Then install our own matcher. | 16176 | ;; `adaptive-fill-regexp' never matches. Then install our own matcher. |
| 16067 | (set (make-local-variable 'adaptive-fill-regexp) "\000") | 16177 | (org-set-local 'adaptive-fill-regexp "\000") |
| 16068 | (set (make-local-variable 'adaptive-fill-function) | 16178 | (org-set-local 'adaptive-fill-function |
| 16069 | 'org-adaptive-fill-function)) | 16179 | 'org-adaptive-fill-function)) |
| 16070 | 16180 | ||
| 16071 | (defun org-fill-paragraph (&optional justify) | 16181 | (defun org-fill-paragraph (&optional justify) |
| 16072 | "Re-align a table, pass through to fill-paragraph if no table." | 16182 | "Re-align a table, pass through to fill-paragraph if no table." |
| @@ -16145,18 +16255,7 @@ that can be added." | |||
| 16145 | t) | 16255 | t) |
| 16146 | "\\'")))) | 16256 | "\\'")))) |
| 16147 | 16257 | ||
| 16148 | ;; Functions needed for compatibility with old outline.el. | 16258 | ;; 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 | 16259 | ||
| 16161 | ;; C-a should go to the beginning of a *visible* line, also in the | 16260 | ;; 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? | 16261 | ;; new outline.el. I guess this should be patched into Emacs? |
| @@ -16174,60 +16273,26 @@ to a visible line beginning. This makes the function of C-a more intuitive." | |||
| 16174 | (beginning-of-line 1)) | 16273 | (beginning-of-line 1)) |
| 16175 | (forward-char 1)))) | 16274 | (forward-char 1)))) |
| 16176 | 16275 | ||
| 16177 | (when org-noutline-p | 16276 | (define-key org-mode-map "\C-a" 'org-beginning-of-line) |
| 16178 | (define-key org-mode-map "\C-a" 'org-beginning-of-line)) | ||
| 16179 | 16277 | ||
| 16180 | (defun org-invisible-p () | 16278 | (defun org-invisible-p () |
| 16181 | "Check if point is at a character currently not visible." | 16279 | "Check if point is at a character currently not visible." |
| 16182 | (if org-noutline-p | 16280 | ;; Early versions of noutline don't have `outline-invisible-p'. |
| 16183 | ;; Early versions of noutline don't have `outline-invisible-p'. | 16281 | (if (fboundp 'outline-invisible-p) |
| 16184 | (if (fboundp 'outline-invisible-p) | 16282 | (outline-invisible-p) |
| 16185 | (outline-invisible-p) | 16283 | (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 | 16284 | ||
| 16191 | (defun org-invisible-p2 () | 16285 | (defun org-invisible-p2 () |
| 16192 | "Check if point is at a character currently not visible." | 16286 | "Check if point is at a character currently not visible." |
| 16193 | (save-excursion | 16287 | (save-excursion |
| 16194 | (if org-noutline-p | 16288 | (if (and (eolp) (not (bobp))) (backward-char 1)) |
| 16195 | (progn | 16289 | ;; Early versions of noutline don't have `outline-invisible-p'. |
| 16196 | (if (and (eolp) (not (bobp))) (backward-char 1)) | 16290 | (if (fboundp 'outline-invisible-p) |
| 16197 | ;; Early versions of noutline don't have `outline-invisible-p'. | 16291 | (outline-invisible-p) |
| 16198 | (if (fboundp 'outline-invisible-p) | 16292 | (get-char-property (point) 'invisible)))) |
| 16199 | (outline-invisible-p) | 16293 | |
| 16200 | (get-char-property (point) 'invisible))) | 16294 | (defalias 'org-back-to-heading 'outline-back-to-heading) |
| 16201 | (skip-chars-backward "^\r\n") | 16295 | (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. | ||
| 16206 | Only 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. | ||
| 16222 | If 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 | 16296 | ||
| 16232 | (defun org-on-target-p () | 16297 | (defun org-on-target-p () |
| 16233 | (let ((pos (point))) | 16298 | (let ((pos (point))) |
| @@ -16243,47 +16308,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. | 16308 | "Move to the heading line of which the present line is a subheading. |
| 16244 | This function considers both visible and invisible heading lines. | 16309 | This function considers both visible and invisible heading lines. |
| 16245 | With argument, move up ARG levels." | 16310 | With argument, move up ARG levels." |
| 16246 | (if org-noutline-p | 16311 | (if (fboundp 'outline-up-heading-all) |
| 16247 | (if (fboundp 'outline-up-heading-all) | 16312 | (outline-up-heading-all arg) ; emacs 21 version of outline.el |
| 16248 | (outline-up-heading-all arg) ; emacs 21 version of outline.el | 16313 | (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 | 16314 | ||
| 16261 | (defun org-show-hidden-entry () | 16315 | (defun org-show-hidden-entry () |
| 16262 | "Show an entry where even the heading is hidden." | 16316 | "Show an entry where even the heading is hidden." |
| 16263 | (save-excursion | 16317 | (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))) | 16318 | (org-show-entry))) |
| 16269 | 16319 | ||
| 16270 | (defun org-check-occur-regexp (regexp) | ||
| 16271 | "If REGEXP starts with \"^\", modify it to check for \\r as well. | ||
| 16272 | Of 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) | 16320 | (defun org-flag-heading (flag &optional entry) |
| 16280 | "Flag the current heading. FLAG non-nil means make invisible. | 16321 | "Flag the current heading. FLAG non-nil means make invisible. |
| 16281 | When ENTRY is non-nil, show the entire entry." | 16322 | When ENTRY is non-nil, show the entire entry." |
| 16282 | (save-excursion | 16323 | (save-excursion |
| 16283 | (org-back-to-heading t) | 16324 | (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 | 16325 | ;; Check if we should show the entire entry |
| 16288 | (if entry | 16326 | (if entry |
| 16289 | (progn | 16327 | (progn |
| @@ -16293,9 +16331,7 @@ When ENTRY is non-nil, show the entire entry." | |||
| 16293 | (org-flag-heading nil)))) | 16331 | (org-flag-heading nil)))) |
| 16294 | (outline-flag-region (max 1 (1- (point))) | 16332 | (outline-flag-region (max 1 (1- (point))) |
| 16295 | (save-excursion (outline-end-of-heading) (point)) | 16333 | (save-excursion (outline-end-of-heading) (point)) |
| 16296 | (if org-noutline-p | 16334 | flag)))) |
| 16297 | flag | ||
| 16298 | (if flag ?\r ?\n)))))) | ||
| 16299 | 16335 | ||
| 16300 | (defun org-end-of-subtree (&optional invisible-OK) | 16336 | (defun org-end-of-subtree (&optional invisible-OK) |
| 16301 | ;; This is an exact copy of the original function, but it uses | 16337 | ;; This is an exact copy of the original function, but it uses |
| @@ -16324,7 +16360,7 @@ When ENTRY is non-nil, show the entire entry." | |||
| 16324 | (point) | 16360 | (point) |
| 16325 | (save-excursion | 16361 | (save-excursion |
| 16326 | (outline-end-of-subtree) (outline-next-heading) (point)) | 16362 | (outline-end-of-subtree) (outline-next-heading) (point)) |
| 16327 | (if org-noutline-p nil ?\n))) | 16363 | nil)) |
| 16328 | 16364 | ||
| 16329 | (defun org-show-entry () | 16365 | (defun org-show-entry () |
| 16330 | "Show the body directly following this heading. | 16366 | "Show the body directly following this heading. |
| @@ -16337,16 +16373,16 @@ Show the heading too, if it is currently invisible." | |||
| 16337 | (save-excursion | 16373 | (save-excursion |
| 16338 | (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move) | 16374 | (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move) |
| 16339 | (or (match-beginning 1) (point-max))) | 16375 | (or (match-beginning 1) (point-max))) |
| 16340 | (if org-noutline-p nil ?\n)))) | 16376 | nil))) |
| 16341 | 16377 | ||
| 16342 | (defun org-make-options-regexp (kwds) | 16378 | (defun org-make-options-regexp (kwds) |
| 16343 | "Make a regular expression for keyword lines." | 16379 | "Make a regular expression for keyword lines." |
| 16344 | (concat | 16380 | (concat |
| 16345 | (if org-noutline-p "^" "[\n\r]") | 16381 | "^" |
| 16346 | "#?[ \t]*\\+\\(" | 16382 | "#?[ \t]*\\+\\(" |
| 16347 | (mapconcat 'regexp-quote kwds "\\|") | 16383 | (mapconcat 'regexp-quote kwds "\\|") |
| 16348 | "\\):[ \t]*" | 16384 | "\\):[ \t]*" |
| 16349 | (if org-noutline-p "\\(.+\\)" "\\([^\n\r]+\\)"))) | 16385 | "\\(.+\\)")) |
| 16350 | 16386 | ||
| 16351 | ;; Make `bookmark-jump' show the jump location if it was hidden. | 16387 | ;; Make `bookmark-jump' show the jump location if it was hidden. |
| 16352 | (eval-after-load "bookmark" | 16388 | (eval-after-load "bookmark" |
diff --git a/lisp/tumme.el b/lisp/tumme.el index 3bd1d41886e..788a29958a8 100644 --- a/lisp/tumme.el +++ b/lisp/tumme.el | |||
| @@ -172,12 +172,12 @@ | |||
| 172 | :group 'multimedia) | 172 | :group 'multimedia) |
| 173 | 173 | ||
| 174 | (defcustom tumme-dir "~/.emacs.d/tumme/" | 174 | (defcustom tumme-dir "~/.emacs.d/tumme/" |
| 175 | "*Directory where thumbnail images are stored." | 175 | "Directory where thumbnail images are stored." |
| 176 | :type 'string | 176 | :type 'string |
| 177 | :group 'tumme) | 177 | :group 'tumme) |
| 178 | 178 | ||
| 179 | (defcustom tumme-thumbnail-storage 'use-tumme-dir | 179 | (defcustom tumme-thumbnail-storage 'use-tumme-dir |
| 180 | "*How to store tumme's thumbnail files. | 180 | "How to store tumme's thumbnail files. |
| 181 | Tumme can store thumbnail files in one of two ways and this is | 181 | Tumme can store thumbnail files in one of two ways and this is |
| 182 | controlled by this variable. \"Use tumme dir\" means that the | 182 | controlled by this variable. \"Use tumme dir\" means that the |
| 183 | thumbnails are stored in a central directory. \"Per directory\" | 183 | thumbnails are stored in a central directory. \"Per directory\" |
| @@ -193,17 +193,17 @@ that allows sharing of thumbnails across different programs." | |||
| 193 | :group 'tumme) | 193 | :group 'tumme) |
| 194 | 194 | ||
| 195 | (defcustom tumme-db-file "~/.emacs.d/tumme/.tumme_db" | 195 | (defcustom tumme-db-file "~/.emacs.d/tumme/.tumme_db" |
| 196 | "*Database file where file names and their associated tags are stored." | 196 | "Database file where file names and their associated tags are stored." |
| 197 | :type 'string | 197 | :type 'string |
| 198 | :group 'tumme) | 198 | :group 'tumme) |
| 199 | 199 | ||
| 200 | (defcustom tumme-temp-image-file "~/.emacs.d/tumme/.tumme_temp" | 200 | (defcustom tumme-temp-image-file "~/.emacs.d/tumme/.tumme_temp" |
| 201 | "*Name of temporary image file used by various commands." | 201 | "Name of temporary image file used by various commands." |
| 202 | :type 'string | 202 | :type 'string |
| 203 | :group 'tumme) | 203 | :group 'tumme) |
| 204 | 204 | ||
| 205 | (defcustom tumme-gallery-dir "~/.emacs.d/tumme/.tumme_gallery" | 205 | (defcustom tumme-gallery-dir "~/.emacs.d/tumme/.tumme_gallery" |
| 206 | "*Directory to store generated gallery html pages. | 206 | "Directory to store generated gallery html pages. |
| 207 | This path needs to be \"shared\" to the public so that it can access | 207 | This path needs to be \"shared\" to the public so that it can access |
| 208 | the index.html page that tumme creates." | 208 | the index.html page that tumme creates." |
| 209 | :type 'string | 209 | :type 'string |
| @@ -211,7 +211,7 @@ the index.html page that tumme creates." | |||
| 211 | 211 | ||
| 212 | (defcustom tumme-gallery-image-root-url | 212 | (defcustom tumme-gallery-image-root-url |
| 213 | "http://your.own.server/tummepics" | 213 | "http://your.own.server/tummepics" |
| 214 | "*URL where the full size images are to be found. | 214 | "URL where the full size images are to be found. |
| 215 | Note that this path has to be configured in your web server. Tumme | 215 | Note that this path has to be configured in your web server. Tumme |
| 216 | expects to find pictures in this directory." | 216 | expects to find pictures in this directory." |
| 217 | :type 'string | 217 | :type 'string |
| @@ -219,7 +219,7 @@ expects to find pictures in this directory." | |||
| 219 | 219 | ||
| 220 | (defcustom tumme-gallery-thumb-image-root-url | 220 | (defcustom tumme-gallery-thumb-image-root-url |
| 221 | "http://your.own.server/tummethumbs" | 221 | "http://your.own.server/tummethumbs" |
| 222 | "*URL where the thumbnail images are to be found. | 222 | "URL where the thumbnail images are to be found. |
| 223 | Note that this path has to be configured in your web server. Tumme | 223 | Note that this path has to be configured in your web server. Tumme |
| 224 | expects to find pictures in this directory." | 224 | expects to find pictures in this directory." |
| 225 | :type 'string | 225 | :type 'string |
| @@ -227,14 +227,14 @@ expects to find pictures in this directory." | |||
| 227 | 227 | ||
| 228 | (defcustom tumme-cmd-create-thumbnail-program | 228 | (defcustom tumme-cmd-create-thumbnail-program |
| 229 | "convert" | 229 | "convert" |
| 230 | "*Executable used to create thumbnail. | 230 | "Executable used to create thumbnail. |
| 231 | Used together with `tumme-cmd-create-thumbnail-options'." | 231 | Used together with `tumme-cmd-create-thumbnail-options'." |
| 232 | :type 'string | 232 | :type 'string |
| 233 | :group 'tumme) | 233 | :group 'tumme) |
| 234 | 234 | ||
| 235 | (defcustom tumme-cmd-create-thumbnail-options | 235 | (defcustom tumme-cmd-create-thumbnail-options |
| 236 | "%p -size %wx%h \"%f\" -resize %wx%h +profile \"*\" jpeg:\"%t\"" | 236 | "%p -size %wx%h \"%f\" -resize %wx%h +profile \"*\" jpeg:\"%t\"" |
| 237 | "*Format of command used to create thumbnail image. | 237 | "Format of command used to create thumbnail image. |
| 238 | Available options are %p which is replaced by | 238 | Available options are %p which is replaced by |
| 239 | `tumme-cmd-create-thumbnail-program', %w which is replaced by | 239 | `tumme-cmd-create-thumbnail-program', %w which is replaced by |
| 240 | `tumme-thumb-width', %h which is replaced by `tumme-thumb-height', | 240 | `tumme-thumb-width', %h which is replaced by `tumme-thumb-height', |
| @@ -245,14 +245,14 @@ which is replaced by the file name of the thumbnail file." | |||
| 245 | 245 | ||
| 246 | (defcustom tumme-cmd-create-temp-image-program | 246 | (defcustom tumme-cmd-create-temp-image-program |
| 247 | "convert" | 247 | "convert" |
| 248 | "*Executable used to create temporary image. | 248 | "Executable used to create temporary image. |
| 249 | Used together with `tumme-cmd-create-temp-image-options'." | 249 | Used together with `tumme-cmd-create-temp-image-options'." |
| 250 | :type 'string | 250 | :type 'string |
| 251 | :group 'tumme) | 251 | :group 'tumme) |
| 252 | 252 | ||
| 253 | (defcustom tumme-cmd-create-temp-image-options | 253 | (defcustom tumme-cmd-create-temp-image-options |
| 254 | "%p -size %wx%h \"%f\" -resize %wx%h +profile \"*\" jpeg:\"%t\"" | 254 | "%p -size %wx%h \"%f\" -resize %wx%h +profile \"*\" jpeg:\"%t\"" |
| 255 | "*Format of command used to create temporary image for display window. | 255 | "Format of command used to create temporary image for display window. |
| 256 | Available options are %p which is replaced by | 256 | Available options are %p which is replaced by |
| 257 | `tumme-cmd-create-temp-image-program', %w and %h which is replaced by | 257 | `tumme-cmd-create-temp-image-program', %w and %h which is replaced by |
| 258 | the calculated max size for width and height in the image display window, | 258 | the calculated max size for width and height in the image display window, |
| @@ -262,13 +262,13 @@ is replaced by the file name of the temporary file." | |||
| 262 | :group 'tumme) | 262 | :group 'tumme) |
| 263 | 263 | ||
| 264 | (defcustom tumme-cmd-pngnq-program (executable-find "pngnq") | 264 | (defcustom tumme-cmd-pngnq-program (executable-find "pngnq") |
| 265 | "*The file name of the `pngnq' program. | 265 | "The file name of the `pngnq' program. |
| 266 | It quantizes colors of PNG images down to 256 colors." | 266 | It quantizes colors of PNG images down to 256 colors." |
| 267 | :type '(choice (const :tag "Not Set" nil) string) | 267 | :type '(choice (const :tag "Not Set" nil) string) |
| 268 | :group 'tumme) | 268 | :group 'tumme) |
| 269 | 269 | ||
| 270 | (defcustom tumme-cmd-pngcrush-program (executable-find "pngcrush") | 270 | (defcustom tumme-cmd-pngcrush-program (executable-find "pngcrush") |
| 271 | "*The file name of the `pngcrush' program. | 271 | "The file name of the `pngcrush' program. |
| 272 | It optimizes the compression of PNG images. Also it adds PNG textual chunks | 272 | It optimizes the compression of PNG images. Also it adds PNG textual chunks |
| 273 | with the information required by the Thumbnail Managing Standard." | 273 | with the information required by the Thumbnail Managing Standard." |
| 274 | :type '(choice (const :tag "Not Set" nil) string) | 274 | :type '(choice (const :tag "Not Set" nil) string) |
| @@ -305,20 +305,20 @@ with the information required by the Thumbnail Managing Standard." | |||
| 305 | "-text b \"Thumb::URI\" \"file://%f\" " | 305 | "-text b \"Thumb::URI\" \"file://%f\" " |
| 306 | "%q %t" | 306 | "%q %t" |
| 307 | " ; rm %q"))) | 307 | " ; rm %q"))) |
| 308 | "*Command to create thumbnails according to the Thumbnail Managing Standard." | 308 | "Command to create thumbnails according to the Thumbnail Managing Standard." |
| 309 | :type 'string | 309 | :type 'string |
| 310 | :group 'tumme) | 310 | :group 'tumme) |
| 311 | 311 | ||
| 312 | (defcustom tumme-cmd-rotate-thumbnail-program | 312 | (defcustom tumme-cmd-rotate-thumbnail-program |
| 313 | "mogrify" | 313 | "mogrify" |
| 314 | "*Executable used to rotate thumbnail. | 314 | "Executable used to rotate thumbnail. |
| 315 | Used together with `tumme-cmd-rotate-thumbnail-options'." | 315 | Used together with `tumme-cmd-rotate-thumbnail-options'." |
| 316 | :type 'string | 316 | :type 'string |
| 317 | :group 'tumme) | 317 | :group 'tumme) |
| 318 | 318 | ||
| 319 | (defcustom tumme-cmd-rotate-thumbnail-options | 319 | (defcustom tumme-cmd-rotate-thumbnail-options |
| 320 | "%p -rotate %d \"%t\"" | 320 | "%p -rotate %d \"%t\"" |
| 321 | "*Format of command used to rotate thumbnail image. | 321 | "Format of command used to rotate thumbnail image. |
| 322 | Available options are %p which is replaced by | 322 | Available options are %p which is replaced by |
| 323 | `tumme-cmd-rotate-thumbnail-program', %d which is replaced by the | 323 | `tumme-cmd-rotate-thumbnail-program', %d which is replaced by the |
| 324 | number of (positive) degrees to rotate the image, normally 90 or 270 | 324 | number of (positive) degrees to rotate the image, normally 90 or 270 |
| @@ -329,14 +329,14 @@ of the thumbnail file." | |||
| 329 | 329 | ||
| 330 | (defcustom tumme-cmd-rotate-original-program | 330 | (defcustom tumme-cmd-rotate-original-program |
| 331 | "jpegtran" | 331 | "jpegtran" |
| 332 | "*Executable used to rotate original image. | 332 | "Executable used to rotate original image. |
| 333 | Used together with `tumme-cmd-rotate-original-options'." | 333 | Used together with `tumme-cmd-rotate-original-options'." |
| 334 | :type 'string | 334 | :type 'string |
| 335 | :group 'tumme) | 335 | :group 'tumme) |
| 336 | 336 | ||
| 337 | (defcustom tumme-cmd-rotate-original-options | 337 | (defcustom tumme-cmd-rotate-original-options |
| 338 | "%p -rotate %d -copy all \"%o\" > %t" | 338 | "%p -rotate %d -copy all \"%o\" > %t" |
| 339 | "*Format of command used to rotate original image. | 339 | "Format of command used to rotate original image. |
| 340 | Available options are %p which is replaced by | 340 | Available options are %p which is replaced by |
| 341 | `tumme-cmd-rotate-original-program', %d which is replaced by the | 341 | `tumme-cmd-rotate-original-program', %d which is replaced by the |
| 342 | number of (positive) degrees to rotate the image, normally 90 or | 342 | number of (positive) degrees to rotate the image, normally 90 or |
| @@ -348,7 +348,7 @@ original image file name and %t which is replaced by | |||
| 348 | 348 | ||
| 349 | (defcustom tumme-temp-rotate-image-file | 349 | (defcustom tumme-temp-rotate-image-file |
| 350 | "~/.emacs.d/tumme/.tumme_rotate_temp" | 350 | "~/.emacs.d/tumme/.tumme_rotate_temp" |
| 351 | "*Temporary file for rotate operations." | 351 | "Temporary file for rotate operations." |
| 352 | :type 'string | 352 | :type 'string |
| 353 | :group 'tumme) | 353 | :group 'tumme) |
| 354 | 354 | ||
| @@ -361,14 +361,14 @@ original file with `tumme-temp-rotate-image-file'." | |||
| 361 | 361 | ||
| 362 | (defcustom tumme-cmd-write-exif-data-program | 362 | (defcustom tumme-cmd-write-exif-data-program |
| 363 | "exiftool" | 363 | "exiftool" |
| 364 | "*Program used to write EXIF data to image. | 364 | "Program used to write EXIF data to image. |
| 365 | Used together with `tumme-cmd-write-exif-data-options'." | 365 | Used together with `tumme-cmd-write-exif-data-options'." |
| 366 | :type 'string | 366 | :type 'string |
| 367 | :group 'tumme) | 367 | :group 'tumme) |
| 368 | 368 | ||
| 369 | (defcustom tumme-cmd-write-exif-data-options | 369 | (defcustom tumme-cmd-write-exif-data-options |
| 370 | "%p -%t=\"%v\" \"%f\"" | 370 | "%p -%t=\"%v\" \"%f\"" |
| 371 | "*Format of command used to write EXIF data. | 371 | "Format of command used to write EXIF data. |
| 372 | Available options are %p which is replaced by | 372 | Available options are %p which is replaced by |
| 373 | `tumme-cmd-write-exif-data-program', %f which is replaced by the | 373 | `tumme-cmd-write-exif-data-program', %f which is replaced by the |
| 374 | image file name, %t which is replaced by the tag name and %v | 374 | image file name, %t which is replaced by the tag name and %v |
| @@ -378,14 +378,14 @@ which is replaced by the tag value." | |||
| 378 | 378 | ||
| 379 | (defcustom tumme-cmd-read-exif-data-program | 379 | (defcustom tumme-cmd-read-exif-data-program |
| 380 | "exiftool" | 380 | "exiftool" |
| 381 | "*Program used to read EXIF data to image. | 381 | "Program used to read EXIF data to image. |
| 382 | Used together with `tumme-cmd-read-exif-data-program-options'." | 382 | Used together with `tumme-cmd-read-exif-data-program-options'." |
| 383 | :type 'string | 383 | :type 'string |
| 384 | :group 'tumme) | 384 | :group 'tumme) |
| 385 | 385 | ||
| 386 | (defcustom tumme-cmd-read-exif-data-options | 386 | (defcustom tumme-cmd-read-exif-data-options |
| 387 | "%p -s -s -s -%t \"%f\"" | 387 | "%p -s -s -s -%t \"%f\"" |
| 388 | "*Format of command used to read EXIF data. | 388 | "Format of command used to read EXIF data. |
| 389 | Available options are %p which is replaced by | 389 | Available options are %p which is replaced by |
| 390 | `tumme-cmd-write-exif-data-options', %f which is replaced | 390 | `tumme-cmd-write-exif-data-options', %f which is replaced |
| 391 | by the image file name and %t which is replaced by the tag name." | 391 | by the image file name and %t which is replaced by the tag name." |
| @@ -394,7 +394,7 @@ by the image file name and %t which is replaced by the tag name." | |||
| 394 | 394 | ||
| 395 | (defcustom tumme-gallery-hidden-tags | 395 | (defcustom tumme-gallery-hidden-tags |
| 396 | (list "private" "hidden" "pending") | 396 | (list "private" "hidden" "pending") |
| 397 | "*List of \"hidden\" tags. | 397 | "List of \"hidden\" tags. |
| 398 | Used by `tumme-gallery-generate' to leave out \"hidden\" images." | 398 | Used by `tumme-gallery-generate' to leave out \"hidden\" images." |
| 399 | :type '(repeat string) | 399 | :type '(repeat string) |
| 400 | :group 'tumme) | 400 | :group 'tumme) |
| @@ -416,18 +416,18 @@ This is the default size for both `tumme-thumb-width' and `tumme-thumb-height'." | |||
| 416 | :group 'tumme) | 416 | :group 'tumme) |
| 417 | 417 | ||
| 418 | (defcustom tumme-thumb-relief 2 | 418 | (defcustom tumme-thumb-relief 2 |
| 419 | "*Size of button-like border around thumbnails." | 419 | "Size of button-like border around thumbnails." |
| 420 | :type 'integer | 420 | :type 'integer |
| 421 | :group 'tumme) | 421 | :group 'tumme) |
| 422 | 422 | ||
| 423 | (defcustom tumme-thumb-margin 2 | 423 | (defcustom tumme-thumb-margin 2 |
| 424 | "*Size of the margin around thumbnails. | 424 | "Size of the margin around thumbnails. |
| 425 | This is where you see the cursor." | 425 | This is where you see the cursor." |
| 426 | :type 'integer | 426 | :type 'integer |
| 427 | :group 'tumme) | 427 | :group 'tumme) |
| 428 | 428 | ||
| 429 | (defcustom tumme-line-up-method 'dynamic | 429 | (defcustom tumme-line-up-method 'dynamic |
| 430 | "*Default method for line-up of thumbnails in thumbnail buffer. | 430 | "Default method for line-up of thumbnails in thumbnail buffer. |
| 431 | Used by `tumme-display-thumbs' and other functions that needs to | 431 | Used by `tumme-display-thumbs' and other functions that needs to |
| 432 | line-up thumbnails. Dynamic means to use the available width of the | 432 | line-up thumbnails. Dynamic means to use the available width of the |
| 433 | window containing the thumbnail buffer, Fixed means to use | 433 | window containing the thumbnail buffer, Fixed means to use |
| @@ -441,19 +441,19 @@ line-up means that no automatic line-up will be done." | |||
| 441 | :group 'tumme) | 441 | :group 'tumme) |
| 442 | 442 | ||
| 443 | (defcustom tumme-thumbs-per-row 3 | 443 | (defcustom tumme-thumbs-per-row 3 |
| 444 | "*Number of thumbnails to display per row in thumb buffer." | 444 | "Number of thumbnails to display per row in thumb buffer." |
| 445 | :type 'integer | 445 | :type 'integer |
| 446 | :group 'tumme) | 446 | :group 'tumme) |
| 447 | 447 | ||
| 448 | (defcustom tumme-display-window-width-correction 1 | 448 | (defcustom tumme-display-window-width-correction 1 |
| 449 | "*Number to be used to correct image display window width. | 449 | "Number to be used to correct image display window width. |
| 450 | Change if the default (1) does not work (i.e. if the image does not | 450 | Change if the default (1) does not work (i.e. if the image does not |
| 451 | completely fit)." | 451 | completely fit)." |
| 452 | :type 'integer | 452 | :type 'integer |
| 453 | :group 'tumme) | 453 | :group 'tumme) |
| 454 | 454 | ||
| 455 | (defcustom tumme-display-window-height-correction 0 | 455 | (defcustom tumme-display-window-height-correction 0 |
| 456 | "*Number to be used to correct image display window height. | 456 | "Number to be used to correct image display window height. |
| 457 | Change if the default (0) does not work (i.e. if the image does not | 457 | Change if the default (0) does not work (i.e. if the image does not |
| 458 | completely fit)." | 458 | completely fit)." |
| 459 | :type 'integer | 459 | :type 'integer |
| @@ -487,7 +487,7 @@ dired and you might want to turn it off." | |||
| 487 | :group 'tumme) | 487 | :group 'tumme) |
| 488 | 488 | ||
| 489 | (defcustom tumme-display-properties-format "%b: %f (%t): %c" | 489 | (defcustom tumme-display-properties-format "%b: %f (%t): %c" |
| 490 | "*Display format for thumbnail properties. | 490 | "Display format for thumbnail properties. |
| 491 | %b is replaced with associated dired buffer name, %f with file name | 491 | %b is replaced with associated dired buffer name, %f with file name |
| 492 | \(without path) of original image file, %t with the list of tags and %c | 492 | \(without path) of original image file, %t with the list of tags and %c |
| 493 | with the comment." | 493 | with the comment." |
| @@ -500,20 +500,20 @@ with the comment." | |||
| 500 | (cond ((executable-find "display")) | 500 | (cond ((executable-find "display")) |
| 501 | ((executable-find "xli")) | 501 | ((executable-find "xli")) |
| 502 | ((executable-find "qiv") "qiv -t")) | 502 | ((executable-find "qiv") "qiv -t")) |
| 503 | "*Name of external viewer. | 503 | "Name of external viewer. |
| 504 | Including parameters. Used when displaying original image from | 504 | Including parameters. Used when displaying original image from |
| 505 | `tumme-thumbnail-mode'." | 505 | `tumme-thumbnail-mode'." |
| 506 | :type 'string | 506 | :type 'string |
| 507 | :group 'tumme) | 507 | :group 'tumme) |
| 508 | 508 | ||
| 509 | (defcustom tumme-main-image-directory "~/pics/" | 509 | (defcustom tumme-main-image-directory "~/pics/" |
| 510 | "*Name of main image directory, if any. | 510 | "Name of main image directory, if any. |
| 511 | Used by `tumme-copy-with-exif-file-name'." | 511 | Used by `tumme-copy-with-exif-file-name'." |
| 512 | :type 'string | 512 | :type 'string |
| 513 | :group 'tumme) | 513 | :group 'tumme) |
| 514 | 514 | ||
| 515 | (defcustom tumme-show-all-from-dir-max-files 50 | 515 | (defcustom tumme-show-all-from-dir-max-files 50 |
| 516 | "*Maximum number of files to show using `tumme-show-all-from-dir'. | 516 | "Maximum number of files to show using `tumme-show-all-from-dir'. |
| 517 | before warning the user." | 517 | before warning the user." |
| 518 | :type 'integer | 518 | :type 'integer |
| 519 | :group 'tumme) | 519 | :group 'tumme) |
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 901fac01208..e4b54f9fc92 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,3 +1,20 @@ | |||
| 1 | 2006-08-25 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * url-handlers.el (url-file-local-copy): Tell url-copy-file that the | ||
| 4 | dest file will already exist. | ||
| 5 | |||
| 6 | 2006-07-31 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 7 | |||
| 8 | * url-util.el (url-hexify-string): Only utf-8 encode if it's | ||
| 9 | a multibyte string. | ||
| 10 | (url-normalize-url): Remove unused var `grok'. | ||
| 11 | (url-truncate-url-for-viewing): Remove unused var `tail'. | ||
| 12 | |||
| 13 | 2006-07-30 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 14 | |||
| 15 | * url-util.el (url-hexify-string): Rewrite. | ||
| 16 | Suggested by David Smith <davidsmith@acm.org>. | ||
| 17 | |||
| 1 | 2006-07-12 Michael Olson <mwolson@gnu.org> | 18 | 2006-07-12 Michael Olson <mwolson@gnu.org> |
| 2 | 19 | ||
| 3 | * url-irc.el (url-irc-erc): Call erc-handle-irc-url. | 20 | * url-irc.el (url-irc-erc): Call erc-handle-irc-url. |
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el index 6c6d85a1e03..97d10003620 100644 --- a/lisp/url/url-handlers.el +++ b/lisp/url/url-handlers.el | |||
| @@ -213,7 +213,7 @@ A prefix arg makes KEEP-TIME non-nil." | |||
| 213 | Returns the name of the local copy, or nil, if FILE is directly | 213 | Returns the name of the local copy, or nil, if FILE is directly |
| 214 | accessible." | 214 | accessible." |
| 215 | (let ((filename (make-temp-file "url"))) | 215 | (let ((filename (make-temp-file "url"))) |
| 216 | (url-copy-file url filename) | 216 | (url-copy-file url filename 'ok-if-already-exists) |
| 217 | filename)) | 217 | filename)) |
| 218 | 218 | ||
| 219 | (defun url-insert (buffer &optional beg end) | 219 | (defun url-insert (buffer &optional beg end) |
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index f33a58950fc..0aeb141c017 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el | |||
| @@ -163,7 +163,7 @@ Also replaces the \" character, so that the result may be safely used as | |||
| 163 | (defun url-normalize-url (url) | 163 | (defun url-normalize-url (url) |
| 164 | "Return a 'normalized' version of URL. | 164 | "Return a 'normalized' version of URL. |
| 165 | Strips out default port numbers, etc." | 165 | Strips out default port numbers, etc." |
| 166 | (let (type data grok retval) | 166 | (let (type data retval) |
| 167 | (setq data (url-generic-parse-url url) | 167 | (setq data (url-generic-parse-url url) |
| 168 | type (url-type data)) | 168 | type (url-type data)) |
| 169 | (if (member type '("www" "about" "mailto" "info")) | 169 | (if (member type '("www" "about" "mailto" "info")) |
| @@ -352,17 +352,31 @@ forbidden in URL encoding." | |||
| 352 | This is taken from RFC 2396.") | 352 | This is taken from RFC 2396.") |
| 353 | 353 | ||
| 354 | ;;;###autoload | 354 | ;;;###autoload |
| 355 | (defun url-hexify-string (str) | 355 | (defun url-hexify-string (string) |
| 356 | "Escape characters in a string." | 356 | "Return a new string that is STRING URI-encoded. |
| 357 | (mapconcat | 357 | First, STRING is converted to utf-8, if necessary. Then, for each |
| 358 | (lambda (char) | 358 | character in the utf-8 string, those found in `url-unreserved-chars' |
| 359 | ;; Fixme: use a char table instead. | 359 | are left as-is, all others are represented as a three-character |
| 360 | (if (not (memq char url-unreserved-chars)) | 360 | string: \"%\" followed by two lowercase hex digits." |
| 361 | (if (> char 255) | 361 | ;; To go faster and avoid a lot of consing, we could do: |
| 362 | (error "Hexifying multibyte character %s" str) | 362 | ;; |
| 363 | (format "%%%02X" char)) | 363 | ;; (defconst url-hexify-table |
| 364 | (char-to-string char))) | 364 | ;; (let ((map (make-vector 256 nil))) |
| 365 | str "")) | 365 | ;; (dotimes (byte 256) (aset map byte |
| 366 | ;; (if (memq byte url-unreserved-chars) | ||
| 367 | ;; (char-to-string byte) | ||
| 368 | ;; (format "%%%02x" byte)))) | ||
| 369 | ;; map)) | ||
| 370 | ;; | ||
| 371 | ;; (mapconcat (curry 'aref url-hexify-table) ...) | ||
| 372 | (mapconcat (lambda (byte) | ||
| 373 | (if (memq byte url-unreserved-chars) | ||
| 374 | (char-to-string byte) | ||
| 375 | (format "%%%02x" byte))) | ||
| 376 | (if (multibyte-string-p string) | ||
| 377 | (encode-coding-string string 'utf-8) | ||
| 378 | string) | ||
| 379 | "")) | ||
| 366 | 380 | ||
| 367 | ;;;###autoload | 381 | ;;;###autoload |
| 368 | (defun url-file-extension (fname &optional x) | 382 | (defun url-file-extension (fname &optional x) |
| @@ -389,7 +403,6 @@ then return the basename of the file with the extension stripped off." | |||
| 389 | WIDTH defaults to the current frame width." | 403 | WIDTH defaults to the current frame width." |
| 390 | (let* ((fr-width (or width (frame-width))) | 404 | (let* ((fr-width (or width (frame-width))) |
| 391 | (str-width (length url)) | 405 | (str-width (length url)) |
| 392 | (tail (file-name-nondirectory url)) | ||
| 393 | (fname nil) | 406 | (fname nil) |
| 394 | (modified 0) | 407 | (modified 0) |
| 395 | (urlobj nil)) | 408 | (urlobj nil)) |
| @@ -397,8 +410,7 @@ WIDTH defaults to the current frame width." | |||
| 397 | (if (and (>= str-width fr-width) | 410 | (if (and (>= str-width fr-width) |
| 398 | (string-match "?" url)) | 411 | (string-match "?" url)) |
| 399 | (setq url (concat (substring url 0 (match-beginning 0)) "?...") | 412 | (setq url (concat (substring url 0 (match-beginning 0)) "?...") |
| 400 | str-width (length url) | 413 | str-width (length url))) |
| 401 | tail (file-name-nondirectory url))) | ||
| 402 | (if (< str-width fr-width) | 414 | (if (< str-width fr-width) |
| 403 | nil ; Hey, we are done! | 415 | nil ; Hey, we are done! |
| 404 | (setq urlobj (url-generic-parse-url url) | 416 | (setq urlobj (url-generic-parse-url url) |
diff --git a/lisp/wdired.el b/lisp/wdired.el index 1363181524c..bc70e0ddcfd 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el | |||
| @@ -238,6 +238,8 @@ in disk. | |||
| 238 | 238 | ||
| 239 | See `wdired-mode'." | 239 | See `wdired-mode'." |
| 240 | (interactive) | 240 | (interactive) |
| 241 | (or (eq major-mode 'dired-mode) | ||
| 242 | (error "Not a Dired buffer")) | ||
| 241 | (set (make-local-variable 'wdired-old-content) | 243 | (set (make-local-variable 'wdired-old-content) |
| 242 | (buffer-substring (point-min) (point-max))) | 244 | (buffer-substring (point-min) (point-max))) |
| 243 | (set (make-local-variable 'wdired-old-point) (point)) | 245 | (set (make-local-variable 'wdired-old-point) (point)) |
| @@ -328,6 +330,8 @@ non-nil means return old filename." | |||
| 328 | 330 | ||
| 329 | (defun wdired-change-to-dired-mode () | 331 | (defun wdired-change-to-dired-mode () |
| 330 | "Change the mode back to dired." | 332 | "Change the mode back to dired." |
| 333 | (or (eq major-mode 'wdired-mode) | ||
| 334 | (error "Not a Wdired buffer")) | ||
| 331 | (let ((inhibit-read-only t)) | 335 | (let ((inhibit-read-only t)) |
| 332 | (remove-text-properties (point-min) (point-max) | 336 | (remove-text-properties (point-min) (point-max) |
| 333 | '(read-only nil local-map nil))) | 337 | '(read-only nil local-map nil))) |
diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 449606607f6..bb829278ef3 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el | |||
| @@ -518,13 +518,15 @@ and: | |||
| 518 | ;;;###autoload | 518 | ;;;###autoload |
| 519 | (defun whitespace-cleanup () | 519 | (defun whitespace-cleanup () |
| 520 | "Cleanup the five different kinds of whitespace problems. | 520 | "Cleanup the five different kinds of whitespace problems. |
| 521 | It normally applies to the whole buffer, but in Transient Mark mode | ||
| 522 | when the mark is active it applies to the region. | ||
| 521 | See `whitespace-buffer' docstring for a summary of the problems." | 523 | See `whitespace-buffer' docstring for a summary of the problems." |
| 522 | (interactive) | 524 | (interactive) |
| 523 | (if (and transient-mark-mode mark-active) | 525 | (if (and transient-mark-mode mark-active) |
| 524 | (whitespace-cleanup-region (region-beginning) (region-end)) | 526 | (whitespace-cleanup-region (region-beginning) (region-end)) |
| 525 | (whitespace-cleanup-internal))) | 527 | (whitespace-cleanup-internal))) |
| 526 | 528 | ||
| 527 | (defun whitespace-cleanup-internal () | 529 | (defun whitespace-cleanup-internal (&optional region-only) |
| 528 | ;; If this buffer really contains a file, then run, else quit. | 530 | ;; If this buffer really contains a file, then run, else quit. |
| 529 | (whitespace-check-whitespace-mode current-prefix-arg) | 531 | (whitespace-check-whitespace-mode current-prefix-arg) |
| 530 | (if (and buffer-file-name whitespace-mode) | 532 | (if (and buffer-file-name whitespace-mode) |
| @@ -569,9 +571,12 @@ See `whitespace-buffer' docstring for a summary of the problems." | |||
| 569 | ;; Call this recursively till everything is taken care of | 571 | ;; Call this recursively till everything is taken care of |
| 570 | (if whitespace-any | 572 | (if whitespace-any |
| 571 | (whitespace-cleanup-internal) | 573 | (whitespace-cleanup-internal) |
| 574 | ;; if we are done, talk to the user | ||
| 572 | (progn | 575 | (progn |
| 573 | (if (not whitespace-silent) | 576 | (unless whitespace-silent |
| 574 | (message "%s clean" buffer-file-name)) | 577 | (if region-only |
| 578 | (message "The region is now clean") | ||
| 579 | (message "%s is now clean" buffer-file-name))) | ||
| 575 | (whitespace-update-modeline))) | 580 | (whitespace-update-modeline))) |
| 576 | (setq tab-width whitespace-tabwith-saved)))) | 581 | (setq tab-width whitespace-tabwith-saved)))) |
| 577 | 582 | ||
| @@ -582,7 +587,7 @@ See `whitespace-buffer' docstring for a summary of the problems." | |||
| 582 | (save-excursion | 587 | (save-excursion |
| 583 | (save-restriction | 588 | (save-restriction |
| 584 | (narrow-to-region s e) | 589 | (narrow-to-region s e) |
| 585 | (whitespace-cleanup-internal)) | 590 | (whitespace-cleanup-internal t)) |
| 586 | (whitespace-buffer t))) | 591 | (whitespace-buffer t))) |
| 587 | 592 | ||
| 588 | (defun whitespace-buffer-leading () | 593 | (defun whitespace-buffer-leading () |
diff --git a/lisp/window.el b/lisp/window.el index 2ae1a2c9e79..7810ba4c5be 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -246,9 +246,10 @@ then the smallest tree containing that window is returned." | |||
| 246 | (windowp window-or-frame)) | 246 | (windowp window-or-frame)) |
| 247 | (error "Not a frame or window: %s" window-or-frame))) | 247 | (error "Not a frame or window: %s" window-or-frame))) |
| 248 | (let ((subtree (bw-find-tree-sub window-or-frame))) | 248 | (let ((subtree (bw-find-tree-sub window-or-frame))) |
| 249 | (if (integerp subtree) | 249 | (when subtree |
| 250 | nil | 250 | (if (integerp subtree) |
| 251 | (bw-get-tree-1 subtree)))) | 251 | nil |
| 252 | (bw-get-tree-1 subtree))))) | ||
| 252 | 253 | ||
| 253 | (defun bw-get-tree-1 (split) | 254 | (defun bw-get-tree-1 (split) |
| 254 | (if (windowp split) | 255 | (if (windowp split) |
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index 04ef4f0b6dc..717fcf207da 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el | |||
| @@ -122,6 +122,12 @@ any protocol specific data.") | |||
| 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 | (when (eq 'x (window-system frame)) | 124 | (when (eq 'x (window-system frame)) |
| 125 | (x-register-dnd-atom "DndProtocol" frame) | ||
| 126 | (x-register-dnd-atom "_MOTIF_DRAG_AND_DROP_MESSAGE" frame) | ||
| 127 | (x-register-dnd-atom "XdndEnter" frame) | ||
| 128 | (x-register-dnd-atom "XdndPosition" frame) | ||
| 129 | (x-register-dnd-atom "XdndLeave" frame) | ||
| 130 | (x-register-dnd-atom "XdndDrop" frame) | ||
| 125 | (x-dnd-init-xdnd-for-frame frame) | 131 | (x-dnd-init-xdnd-for-frame frame) |
| 126 | (x-dnd-init-motif-for-frame frame))) | 132 | (x-dnd-init-motif-for-frame frame))) |
| 127 | 133 | ||
| @@ -320,7 +326,8 @@ nil if not." | |||
| 320 | ;; If dropping in an ordinary window which we could use, | 326 | ;; If dropping in an ordinary window which we could use, |
| 321 | ;; let dnd-open-file-other-window specify what to do. | 327 | ;; let dnd-open-file-other-window specify what to do. |
| 322 | (progn | 328 | (progn |
| 323 | (goto-char (posn-point (event-start event))) | 329 | (when (not mouse-yank-at-point) |
| 330 | (goto-char (posn-point (event-start event)))) | ||
| 324 | (funcall handler window action data)) | 331 | (funcall handler window action data)) |
| 325 | ;; If we can't display the file here, | 332 | ;; If we can't display the file here, |
| 326 | ;; make a new window for it. | 333 | ;; make a new window for it. |
diff --git a/lispintro/ChangeLog b/lispintro/ChangeLog index d2316d59aa6..98617568720 100644 --- a/lispintro/ChangeLog +++ b/lispintro/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2006-08-21 Robert J. Chassell <bob@rattlesnake.com> | ||
| 2 | |||
| 3 | * emacs-lisp-intro.texi: deleted in directory copy of texinfo.tex | ||
| 4 | and pointed towards ../man/texinfo.tex so only one file | ||
| 5 | needs updating. Added comment of what to do when building on own. | ||
| 6 | |||
| 7 | * texinfo.tex: changed to version 2006-02-13.16 | ||
| 8 | to enable a DVI build using the more recent versions of TeX. | ||
| 9 | |||
| 1 | 2006-05-25 David Kastrup <dak@gnu.org> | 10 | 2006-05-25 David Kastrup <dak@gnu.org> |
| 2 | 11 | ||
| 3 | * emacs-lisp-intro.texi (setcar): replace an antelope rather than | 12 | * emacs-lisp-intro.texi (setcar): replace an antelope rather than |
diff --git a/lispintro/emacs-lisp-intro.texi b/lispintro/emacs-lisp-intro.texi index 5d513256daf..cb04acc2062 100644 --- a/lispintro/emacs-lisp-intro.texi +++ b/lispintro/emacs-lisp-intro.texi | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | \input texinfo @c -*-texinfo-*- | 1 | \input ../man/texinfo @c -*-texinfo-*- |
| 2 | @c change above to \input texinfo if building on own. | ||
| 2 | @comment %**start of header | 3 | @comment %**start of header |
| 3 | @setfilename ../info/eintr | 4 | @setfilename ../info/eintr |
| 4 | @c setfilename emacs-lisp-intro.info | 5 | @c setfilename emacs-lisp-intro.info |
diff --git a/lispintro/texinfo.tex b/lispintro/texinfo.tex deleted file mode 100644 index e960fb32992..00000000000 --- a/lispintro/texinfo.tex +++ /dev/null | |||
| @@ -1,6777 +0,0 @@ | |||
| 1 | % texinfo.tex -- TeX macros to handle Texinfo files. | ||
| 2 | % | ||
| 3 | % Load plain if necessary, i.e., if running under initex. | ||
| 4 | \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi | ||
| 5 | % | ||
| 6 | \def\texinfoversion{2003-12-30.09} | ||
| 7 | % | ||
| 8 | % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, | ||
| 9 | % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. | ||
| 10 | % | ||
| 11 | % This texinfo.tex file is free software; you can redistribute it and/or | ||
| 12 | % modify it under the terms of the GNU General Public License as | ||
| 13 | % published by the Free Software Foundation; either version 2, or (at | ||
| 14 | % your option) any later version. | ||
| 15 | % | ||
| 16 | % This texinfo.tex file is distributed in the hope that it will be | ||
| 17 | % useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
| 18 | % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 19 | % General Public License for more details. | ||
| 20 | % | ||
| 21 | % You should have received a copy of the GNU General Public License | ||
| 22 | % along with this texinfo.tex file; see the file COPYING. If not, write | ||
| 23 | % to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| 24 | % Boston, MA 02110-1301, USA. | ||
| 25 | % | ||
| 26 | % In other words, you are welcome to use, share and improve this program. | ||
| 27 | % You are forbidden to forbid anyone else to use, share and improve | ||
| 28 | % what you give them. Help stamp out software-hoarding! | ||
| 29 | % | ||
| 30 | % Please try the latest version of texinfo.tex before submitting bug | ||
| 31 | % reports; you can get the latest version from: | ||
| 32 | % ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex | ||
| 33 | % (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) | ||
| 34 | % ftp://tug.org/tex/texinfo.tex | ||
| 35 | % (and all CTAN mirrors, see http://www.ctan.org), | ||
| 36 | % and /home/gd/gnu/doc/texinfo.tex on the GNU machines. | ||
| 37 | % | ||
| 38 | % The GNU Texinfo home page is http://www.gnu.org/software/texinfo. | ||
| 39 | % | ||
| 40 | % The texinfo.tex in any given Texinfo distribution could well be out | ||
| 41 | % of date, so if that's what you're using, please check. | ||
| 42 | % | ||
| 43 | % Send bug reports to bug-texinfo@gnu.org. Please include including a | ||
| 44 | % complete document in each bug report with which we can reproduce the | ||
| 45 | % problem. Patches are, of course, greatly appreciated. | ||
| 46 | % | ||
| 47 | % To process a Texinfo manual with TeX, it's most reliable to use the | ||
| 48 | % texi2dvi shell script that comes with the distribution. For a simple | ||
| 49 | % manual foo.texi, however, you can get away with this: | ||
| 50 | % tex foo.texi | ||
| 51 | % texindex foo.?? | ||
| 52 | % tex foo.texi | ||
| 53 | % tex foo.texi | ||
| 54 | % dvips foo.dvi -o # or whatever; this makes foo.ps. | ||
| 55 | % The extra TeX runs get the cross-reference information correct. | ||
| 56 | % Sometimes one run after texindex suffices, and sometimes you need more | ||
| 57 | % than two; texi2dvi does it as many times as necessary. | ||
| 58 | % | ||
| 59 | % It is possible to adapt texinfo.tex for other languages, to some | ||
| 60 | % extent. You can get the existing language-specific files from the | ||
| 61 | % full Texinfo distribution. | ||
| 62 | |||
| 63 | \message{Loading texinfo [version \texinfoversion]:} | ||
| 64 | |||
| 65 | % If in a .fmt file, print the version number | ||
| 66 | % and turn on active characters that we couldn't do earlier because | ||
| 67 | % they might have appeared in the input file name. | ||
| 68 | \everyjob{\message{[Texinfo version \texinfoversion]}% | ||
| 69 | \catcode`+=\active \catcode`\_=\active} | ||
| 70 | |||
| 71 | \message{Basics,} | ||
| 72 | \chardef\other=12 | ||
| 73 | |||
| 74 | % We never want plain's \outer definition of \+ in Texinfo. | ||
| 75 | % For @tex, we can use \tabalign. | ||
| 76 | \let\+ = \relax | ||
| 77 | |||
| 78 | % Save some plain tex macros whose names we will redefine. | ||
| 79 | \let\ptexb=\b | ||
| 80 | \let\ptexbullet=\bullet | ||
| 81 | \let\ptexc=\c | ||
| 82 | \let\ptexcomma=\, | ||
| 83 | \let\ptexdot=\. | ||
| 84 | \let\ptexdots=\dots | ||
| 85 | \let\ptexend=\end | ||
| 86 | \let\ptexequiv=\equiv | ||
| 87 | \let\ptexexclam=\! | ||
| 88 | \let\ptexgtr=> | ||
| 89 | \let\ptexhat=^ | ||
| 90 | \let\ptexi=\i | ||
| 91 | \let\ptexindent=\indent | ||
| 92 | \let\ptexlbrace=\{ | ||
| 93 | \let\ptexless=< | ||
| 94 | \let\ptexplus=+ | ||
| 95 | \let\ptexrbrace=\} | ||
| 96 | \let\ptexslash=\/ | ||
| 97 | \let\ptexstar=\* | ||
| 98 | \let\ptext=\t | ||
| 99 | |||
| 100 | % If this character appears in an error message or help string, it | ||
| 101 | % starts a new line in the output. | ||
| 102 | \newlinechar = `^^J | ||
| 103 | |||
| 104 | % Set up fixed words for English if not already set. | ||
| 105 | \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi | ||
| 106 | \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi | ||
| 107 | \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi | ||
| 108 | \ifx\putwordin\undefined \gdef\putwordin{in}\fi | ||
| 109 | \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi | ||
| 110 | \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi | ||
| 111 | \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi | ||
| 112 | \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi | ||
| 113 | \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi | ||
| 114 | \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi | ||
| 115 | \ifx\putwordof\undefined \gdef\putwordof{of}\fi | ||
| 116 | \ifx\putwordon\undefined \gdef\putwordon{on}\fi | ||
| 117 | \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi | ||
| 118 | \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi | ||
| 119 | \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi | ||
| 120 | \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi | ||
| 121 | \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi | ||
| 122 | \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi | ||
| 123 | \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi | ||
| 124 | % | ||
| 125 | \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi | ||
| 126 | \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi | ||
| 127 | \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi | ||
| 128 | \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi | ||
| 129 | \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi | ||
| 130 | \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi | ||
| 131 | \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi | ||
| 132 | \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi | ||
| 133 | \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi | ||
| 134 | \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi | ||
| 135 | \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi | ||
| 136 | \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi | ||
| 137 | % | ||
| 138 | \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi | ||
| 139 | \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi | ||
| 140 | \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi | ||
| 141 | \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi | ||
| 142 | \ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi | ||
| 143 | \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi | ||
| 144 | \ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi | ||
| 145 | |||
| 146 | % In some macros, we cannot use the `\? notation---the left quote is | ||
| 147 | % in some cases the escape char. | ||
| 148 | \chardef\colonChar = `\: | ||
| 149 | \chardef\commaChar = `\, | ||
| 150 | \chardef\dotChar = `\. | ||
| 151 | \chardef\equalChar = `\= | ||
| 152 | \chardef\exclamChar= `\! | ||
| 153 | \chardef\questChar = `\? | ||
| 154 | \chardef\semiChar = `\; | ||
| 155 | \chardef\spaceChar = `\ % | ||
| 156 | \chardef\underChar = `\_ | ||
| 157 | |||
| 158 | % Ignore a token. | ||
| 159 | % | ||
| 160 | \def\gobble#1{} | ||
| 161 | |||
| 162 | % True if #1 is the empty string, i.e., called like `\ifempty{}'. | ||
| 163 | % | ||
| 164 | \def\ifempty#1{\ifemptyx #1\emptymarkA\emptymarkB}% | ||
| 165 | \def\ifemptyx#1#2\emptymarkB{\ifx #1\emptymarkA}% | ||
| 166 | |||
| 167 | % Hyphenation fixes. | ||
| 168 | \hyphenation{ap-pen-dix} | ||
| 169 | \hyphenation{eshell} | ||
| 170 | \hyphenation{mini-buf-fer mini-buf-fers} | ||
| 171 | \hyphenation{time-stamp} | ||
| 172 | \hyphenation{white-space} | ||
| 173 | |||
| 174 | % Margin to add to right of even pages, to left of odd pages. | ||
| 175 | \newdimen\bindingoffset | ||
| 176 | \newdimen\normaloffset | ||
| 177 | \newdimen\pagewidth \newdimen\pageheight | ||
| 178 | |||
| 179 | % Sometimes it is convenient to have everything in the transcript file | ||
| 180 | % and nothing on the terminal. We don't just call \tracingall here, | ||
| 181 | % since that produces some useless output on the terminal. We also make | ||
| 182 | % some effort to order the tracing commands to reduce output in the log | ||
| 183 | % file; cf. trace.sty in LaTeX. | ||
| 184 | % | ||
| 185 | \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% | ||
| 186 | \def\loggingall{% | ||
| 187 | \tracingstats2 | ||
| 188 | \tracingpages1 | ||
| 189 | \tracinglostchars2 % 2 gives us more in etex | ||
| 190 | \tracingparagraphs1 | ||
| 191 | \tracingoutput1 | ||
| 192 | \tracingmacros2 | ||
| 193 | \tracingrestores1 | ||
| 194 | \showboxbreadth\maxdimen \showboxdepth\maxdimen | ||
| 195 | \ifx\eTeXversion\undefined\else % etex gives us more logging | ||
| 196 | \tracingscantokens1 | ||
| 197 | \tracingifs1 | ||
| 198 | \tracinggroups1 | ||
| 199 | \tracingnesting2 | ||
| 200 | \tracingassigns1 | ||
| 201 | \fi | ||
| 202 | \tracingcommands3 % 3 gives us more in etex | ||
| 203 | \errorcontextlines\maxdimen | ||
| 204 | }% | ||
| 205 | |||
| 206 | % add check for \lastpenalty to plain's definitions. If the last thing | ||
| 207 | % we did was a \nobreak, we don't want to insert more space. | ||
| 208 | % | ||
| 209 | \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount | ||
| 210 | \removelastskip\penalty-50\smallskip\fi\fi} | ||
| 211 | \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount | ||
| 212 | \removelastskip\penalty-100\medskip\fi\fi} | ||
| 213 | \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount | ||
| 214 | \removelastskip\penalty-200\bigskip\fi\fi} | ||
| 215 | |||
| 216 | % For @cropmarks command. | ||
| 217 | % Do @cropmarks to get crop marks. | ||
| 218 | % | ||
| 219 | \newif\ifcropmarks | ||
| 220 | \let\cropmarks = \cropmarkstrue | ||
| 221 | % | ||
| 222 | % Dimensions to add cropmarks at corners. | ||
| 223 | % Added by P. A. MacKay, 12 Nov. 1986 | ||
| 224 | % | ||
| 225 | \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines | ||
| 226 | \newdimen\cornerlong \cornerlong=1pc | ||
| 227 | \newdimen\cornerthick \cornerthick=.3pt | ||
| 228 | \newdimen\topandbottommargin \topandbottommargin=.75in | ||
| 229 | |||
| 230 | % Main output routine. | ||
| 231 | \chardef\PAGE = 255 | ||
| 232 | \output = {\onepageout{\pagecontents\PAGE}} | ||
| 233 | |||
| 234 | \newbox\headlinebox | ||
| 235 | \newbox\footlinebox | ||
| 236 | |||
| 237 | % \onepageout takes a vbox as an argument. Note that \pagecontents | ||
| 238 | % does insertions, but you have to call it yourself. | ||
| 239 | \def\onepageout#1{% | ||
| 240 | \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi | ||
| 241 | % | ||
| 242 | \ifodd\pageno \advance\hoffset by \bindingoffset | ||
| 243 | \else \advance\hoffset by -\bindingoffset\fi | ||
| 244 | % | ||
| 245 | % Do this outside of the \shipout so @code etc. will be expanded in | ||
| 246 | % the headline as they should be, not taken literally (outputting ''code). | ||
| 247 | \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% | ||
| 248 | \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% | ||
| 249 | % | ||
| 250 | {% | ||
| 251 | % Have to do this stuff outside the \shipout because we want it to | ||
| 252 | % take effect in \write's, yet the group defined by the \vbox ends | ||
| 253 | % before the \shipout runs. | ||
| 254 | % | ||
| 255 | \escapechar = `\\ % use backslash in output files. | ||
| 256 | \indexdummies % don't expand commands in the output. | ||
| 257 | \normalturnoffactive % \ in index entries must not stay \, e.g., if | ||
| 258 | % the page break happens to be in the middle of an example. | ||
| 259 | \shipout\vbox{% | ||
| 260 | % Do this early so pdf references go to the beginning of the page. | ||
| 261 | \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi | ||
| 262 | % | ||
| 263 | \ifcropmarks \vbox to \outervsize\bgroup | ||
| 264 | \hsize = \outerhsize | ||
| 265 | \vskip-\topandbottommargin | ||
| 266 | \vtop to0pt{% | ||
| 267 | \line{\ewtop\hfil\ewtop}% | ||
| 268 | \nointerlineskip | ||
| 269 | \line{% | ||
| 270 | \vbox{\moveleft\cornerthick\nstop}% | ||
| 271 | \hfill | ||
| 272 | \vbox{\moveright\cornerthick\nstop}% | ||
| 273 | }% | ||
| 274 | \vss}% | ||
| 275 | \vskip\topandbottommargin | ||
| 276 | \line\bgroup | ||
| 277 | \hfil % center the page within the outer (page) hsize. | ||
| 278 | \ifodd\pageno\hskip\bindingoffset\fi | ||
| 279 | \vbox\bgroup | ||
| 280 | \fi | ||
| 281 | % | ||
| 282 | \unvbox\headlinebox | ||
| 283 | \pagebody{#1}% | ||
| 284 | \ifdim\ht\footlinebox > 0pt | ||
| 285 | % Only leave this space if the footline is nonempty. | ||
| 286 | % (We lessened \vsize for it in \oddfootingxxx.) | ||
| 287 | % The \baselineskip=24pt in plain's \makefootline has no effect. | ||
| 288 | \vskip 2\baselineskip | ||
| 289 | \unvbox\footlinebox | ||
| 290 | \fi | ||
| 291 | % | ||
| 292 | \ifcropmarks | ||
| 293 | \egroup % end of \vbox\bgroup | ||
| 294 | \hfil\egroup % end of (centering) \line\bgroup | ||
| 295 | \vskip\topandbottommargin plus1fill minus1fill | ||
| 296 | \boxmaxdepth = \cornerthick | ||
| 297 | \vbox to0pt{\vss | ||
| 298 | \line{% | ||
| 299 | \vbox{\moveleft\cornerthick\nsbot}% | ||
| 300 | \hfill | ||
| 301 | \vbox{\moveright\cornerthick\nsbot}% | ||
| 302 | }% | ||
| 303 | \nointerlineskip | ||
| 304 | \line{\ewbot\hfil\ewbot}% | ||
| 305 | }% | ||
| 306 | \egroup % \vbox from first cropmarks clause | ||
| 307 | \fi | ||
| 308 | }% end of \shipout\vbox | ||
| 309 | }% end of group with \normalturnoffactive | ||
| 310 | \advancepageno | ||
| 311 | \ifnum\outputpenalty>-20000 \else\dosupereject\fi | ||
| 312 | } | ||
| 313 | |||
| 314 | \newinsert\margin \dimen\margin=\maxdimen | ||
| 315 | |||
| 316 | \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} | ||
| 317 | {\catcode`\@ =11 | ||
| 318 | \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi | ||
| 319 | % marginal hacks, juha@viisa.uucp (Juha Takala) | ||
| 320 | \ifvoid\margin\else % marginal info is present | ||
| 321 | \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi | ||
| 322 | \dimen@=\dp#1 \unvbox#1 | ||
| 323 | \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi | ||
| 324 | \ifr@ggedbottom \kern-\dimen@ \vfil \fi} | ||
| 325 | } | ||
| 326 | |||
| 327 | % Here are the rules for the cropmarks. Note that they are | ||
| 328 | % offset so that the space between them is truly \outerhsize or \outervsize | ||
| 329 | % (P. A. MacKay, 12 November, 1986) | ||
| 330 | % | ||
| 331 | \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} | ||
| 332 | \def\nstop{\vbox | ||
| 333 | {\hrule height\cornerthick depth\cornerlong width\cornerthick}} | ||
| 334 | \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} | ||
| 335 | \def\nsbot{\vbox | ||
| 336 | {\hrule height\cornerlong depth\cornerthick width\cornerthick}} | ||
| 337 | |||
| 338 | % Parse an argument, then pass it to #1. The argument is the rest of | ||
| 339 | % the input line (except we remove a trailing comment). #1 should be a | ||
| 340 | % macro which expects an ordinary undelimited TeX argument. | ||
| 341 | % | ||
| 342 | \def\parsearg#1{% | ||
| 343 | \let\next = #1% | ||
| 344 | \begingroup | ||
| 345 | \obeylines | ||
| 346 | \futurelet\temp\parseargx | ||
| 347 | } | ||
| 348 | |||
| 349 | % If the next token is an obeyed space (from an @example environment or | ||
| 350 | % the like), remove it and recurse. Otherwise, we're done. | ||
| 351 | \def\parseargx{% | ||
| 352 | % \obeyedspace is defined far below, after the definition of \sepspaces. | ||
| 353 | \ifx\obeyedspace\temp | ||
| 354 | \expandafter\parseargdiscardspace | ||
| 355 | \else | ||
| 356 | \expandafter\parseargline | ||
| 357 | \fi | ||
| 358 | } | ||
| 359 | |||
| 360 | % Remove a single space (as the delimiter token to the macro call). | ||
| 361 | {\obeyspaces % | ||
| 362 | \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} | ||
| 363 | |||
| 364 | {\obeylines % | ||
| 365 | \gdef\parseargline#1^^M{% | ||
| 366 | \endgroup % End of the group started in \parsearg. | ||
| 367 | % | ||
| 368 | % First remove any @c comment, then any @comment. | ||
| 369 | % Result of each macro is put in \toks0. | ||
| 370 | \argremovec #1\c\relax % | ||
| 371 | \expandafter\argremovecomment \the\toks0 \comment\relax % | ||
| 372 | % | ||
| 373 | % Call the caller's macro, saved as \next in \parsearg. | ||
| 374 | \expandafter\next\expandafter{\the\toks0}% | ||
| 375 | }% | ||
| 376 | } | ||
| 377 | |||
| 378 | % Since all \c{,omment} does is throw away the argument, we can let TeX | ||
| 379 | % do that for us. The \relax here is matched by the \relax in the call | ||
| 380 | % in \parseargline; it could be more or less anything, its purpose is | ||
| 381 | % just to delimit the argument to the \c. | ||
| 382 | \def\argremovec#1\c#2\relax{\toks0 = {#1}} | ||
| 383 | \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} | ||
| 384 | |||
| 385 | % \argremovec{,omment} might leave us with trailing spaces, though; e.g., | ||
| 386 | % @end itemize @c foo | ||
| 387 | % will have two active spaces as part of the argument with the | ||
| 388 | % `itemize'. Here we remove all active spaces from #1, and assign the | ||
| 389 | % result to \toks0. | ||
| 390 | % | ||
| 391 | % This loses if there are any *other* active characters besides spaces | ||
| 392 | % in the argument -- _ ^ +, for example -- since they get expanded. | ||
| 393 | % Fortunately, Texinfo does not define any such commands. (If it ever | ||
| 394 | % does, the catcode of the characters in questionwill have to be changed | ||
| 395 | % here.) But this means we cannot call \removeactivespaces as part of | ||
| 396 | % \argremovec{,omment}, since @c uses \parsearg, and thus the argument | ||
| 397 | % that \parsearg gets might well have any character at all in it. | ||
| 398 | % | ||
| 399 | \def\removeactivespaces#1{% | ||
| 400 | \begingroup | ||
| 401 | \ignoreactivespaces | ||
| 402 | \edef\temp{#1}% | ||
| 403 | \global\toks0 = \expandafter{\temp}% | ||
| 404 | \endgroup | ||
| 405 | } | ||
| 406 | |||
| 407 | % Change the active space to expand to nothing. | ||
| 408 | % | ||
| 409 | \begingroup | ||
| 410 | \obeyspaces | ||
| 411 | \gdef\ignoreactivespaces{\obeyspaces\let =\empty} | ||
| 412 | \endgroup | ||
| 413 | |||
| 414 | |||
| 415 | \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} | ||
| 416 | |||
| 417 | %% These are used to keep @begin/@end levels from running away | ||
| 418 | %% Call \inENV within environments (after a \begingroup) | ||
| 419 | \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} | ||
| 420 | \def\ENVcheck{% | ||
| 421 | \ifENV\errmessage{Still within an environment; press RETURN to continue} | ||
| 422 | \endgroup\fi} % This is not perfect, but it should reduce lossage | ||
| 423 | |||
| 424 | % @begin foo is the same as @foo, for now. | ||
| 425 | \newhelp\EMsimple{Press RETURN to continue.} | ||
| 426 | |||
| 427 | \outer\def\begin{\parsearg\beginxxx} | ||
| 428 | |||
| 429 | \def\beginxxx #1{% | ||
| 430 | \expandafter\ifx\csname #1\endcsname\relax | ||
| 431 | {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else | ||
| 432 | \csname #1\endcsname\fi} | ||
| 433 | |||
| 434 | % @end foo executes the definition of \Efoo. | ||
| 435 | % | ||
| 436 | \def\end{\parsearg\endxxx} | ||
| 437 | \def\endxxx #1{% | ||
| 438 | \removeactivespaces{#1}% | ||
| 439 | \edef\endthing{\the\toks0}% | ||
| 440 | % | ||
| 441 | \expandafter\ifx\csname E\endthing\endcsname\relax | ||
| 442 | \expandafter\ifx\csname \endthing\endcsname\relax | ||
| 443 | % There's no \foo, i.e., no ``environment'' foo. | ||
| 444 | \errhelp = \EMsimple | ||
| 445 | \errmessage{Undefined command `@end \endthing'}% | ||
| 446 | \else | ||
| 447 | \unmatchedenderror\endthing | ||
| 448 | \fi | ||
| 449 | \else | ||
| 450 | % Everything's ok; the right environment has been started. | ||
| 451 | \csname E\endthing\endcsname | ||
| 452 | \fi | ||
| 453 | } | ||
| 454 | |||
| 455 | % There is an environment #1, but it hasn't been started. Give an error. | ||
| 456 | % | ||
| 457 | \def\unmatchedenderror#1{% | ||
| 458 | \errhelp = \EMsimple | ||
| 459 | \errmessage{This `@end #1' doesn't have a matching `@#1'}% | ||
| 460 | } | ||
| 461 | |||
| 462 | % Define the control sequence \E#1 to give an unmatched @end error. | ||
| 463 | % | ||
| 464 | \def\defineunmatchedend#1{% | ||
| 465 | \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% | ||
| 466 | } | ||
| 467 | |||
| 468 | |||
| 469 | %% Simple single-character @ commands | ||
| 470 | |||
| 471 | % @@ prints an @ | ||
| 472 | % Kludge this until the fonts are right (grr). | ||
| 473 | \def\@{{\tt\char64}} | ||
| 474 | |||
| 475 | % This is turned off because it was never documented | ||
| 476 | % and you can use @w{...} around a quote to suppress ligatures. | ||
| 477 | %% Define @` and @' to be the same as ` and ' | ||
| 478 | %% but suppressing ligatures. | ||
| 479 | %\def\`{{`}} | ||
| 480 | %\def\'{{'}} | ||
| 481 | |||
| 482 | % Used to generate quoted braces. | ||
| 483 | \def\mylbrace {{\tt\char123}} | ||
| 484 | \def\myrbrace {{\tt\char125}} | ||
| 485 | \let\{=\mylbrace | ||
| 486 | \let\}=\myrbrace | ||
| 487 | \begingroup | ||
| 488 | % Definitions to produce \{ and \} commands for indices, | ||
| 489 | % and @{ and @} for the aux file. | ||
| 490 | \catcode`\{ = \other \catcode`\} = \other | ||
| 491 | \catcode`\[ = 1 \catcode`\] = 2 | ||
| 492 | \catcode`\! = 0 \catcode`\\ = \other | ||
| 493 | !gdef!lbracecmd[\{]% | ||
| 494 | !gdef!rbracecmd[\}]% | ||
| 495 | !gdef!lbraceatcmd[@{]% | ||
| 496 | !gdef!rbraceatcmd[@}]% | ||
| 497 | !endgroup | ||
| 498 | |||
| 499 | % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent | ||
| 500 | % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. | ||
| 501 | \let\, = \c | ||
| 502 | \let\dotaccent = \. | ||
| 503 | \def\ringaccent#1{{\accent23 #1}} | ||
| 504 | \let\tieaccent = \t | ||
| 505 | \let\ubaraccent = \b | ||
| 506 | \let\udotaccent = \d | ||
| 507 | |||
| 508 | % Other special characters: @questiondown @exclamdown | ||
| 509 | % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. | ||
| 510 | \def\questiondown{?`} | ||
| 511 | \def\exclamdown{!`} | ||
| 512 | |||
| 513 | % Dotless i and dotless j, used for accents. | ||
| 514 | \def\imacro{i} | ||
| 515 | \def\jmacro{j} | ||
| 516 | \def\dotless#1{% | ||
| 517 | \def\temp{#1}% | ||
| 518 | \ifx\temp\imacro \ptexi | ||
| 519 | \else\ifx\temp\jmacro \j | ||
| 520 | \else \errmessage{@dotless can be used only with i or j}% | ||
| 521 | \fi\fi | ||
| 522 | } | ||
| 523 | |||
| 524 | % Be sure we're in horizontal mode when doing a tie, since we make space | ||
| 525 | % equivalent to this in @example-like environments. Otherwise, a space | ||
| 526 | % at the beginning of a line will start with \penalty -- and | ||
| 527 | % since \penalty is valid in vertical mode, we'd end up putting the | ||
| 528 | % penalty on the vertical list instead of in the new paragraph. | ||
| 529 | {\catcode`@ = 11 | ||
| 530 | % Avoid using \@M directly, because that causes trouble | ||
| 531 | % if the definition is written into an index file. | ||
| 532 | \global\let\tiepenalty = \@M | ||
| 533 | \gdef\tie{\leavevmode\penalty\tiepenalty\ } | ||
| 534 | } | ||
| 535 | |||
| 536 | % @: forces normal size whitespace following. | ||
| 537 | \def\:{\spacefactor=1000 } | ||
| 538 | |||
| 539 | % @* forces a line break. | ||
| 540 | \def\*{\hfil\break\hbox{}\ignorespaces} | ||
| 541 | |||
| 542 | % @/ allows a line break. | ||
| 543 | \let\/=\allowbreak | ||
| 544 | |||
| 545 | % @. is an end-of-sentence period. | ||
| 546 | \def\.{.\spacefactor=3000 } | ||
| 547 | |||
| 548 | % @! is an end-of-sentence bang. | ||
| 549 | \def\!{!\spacefactor=3000 } | ||
| 550 | |||
| 551 | % @? is an end-of-sentence query. | ||
| 552 | \def\?{?\spacefactor=3000 } | ||
| 553 | |||
| 554 | % @w prevents a word break. Without the \leavevmode, @w at the | ||
| 555 | % beginning of a paragraph, when TeX is still in vertical mode, would | ||
| 556 | % produce a whole line of output instead of starting the paragraph. | ||
| 557 | \def\w#1{\leavevmode\hbox{#1}} | ||
| 558 | |||
| 559 | % @group ... @end group forces ... to be all on one page, by enclosing | ||
| 560 | % it in a TeX vbox. We use \vtop instead of \vbox to construct the box | ||
| 561 | % to keep its height that of a normal line. According to the rules for | ||
| 562 | % \topskip (p.114 of the TeXbook), the glue inserted is | ||
| 563 | % max (\topskip - \ht (first item), 0). If that height is large, | ||
| 564 | % therefore, no glue is inserted, and the space between the headline and | ||
| 565 | % the text is small, which looks bad. | ||
| 566 | % | ||
| 567 | % Another complication is that the group might be very large. This can | ||
| 568 | % cause the glue on the previous page to be unduly stretched, because it | ||
| 569 | % does not have much material. In this case, it's better to add an | ||
| 570 | % explicit \vfill so that the extra space is at the bottom. The | ||
| 571 | % threshold for doing this is if the group is more than \vfilllimit | ||
| 572 | % percent of a page (\vfilllimit can be changed inside of @tex). | ||
| 573 | % | ||
| 574 | \newbox\groupbox | ||
| 575 | \def\vfilllimit{0.7} | ||
| 576 | % | ||
| 577 | \def\group{\begingroup | ||
| 578 | \ifnum\catcode13=\active \else | ||
| 579 | \errhelp = \groupinvalidhelp | ||
| 580 | \errmessage{@group invalid in context where filling is enabled}% | ||
| 581 | \fi | ||
| 582 | % | ||
| 583 | % The \vtop we start below produces a box with normal height and large | ||
| 584 | % depth; thus, TeX puts \baselineskip glue before it, and (when the | ||
| 585 | % next line of text is done) \lineskip glue after it. (See p.82 of | ||
| 586 | % the TeXbook.) Thus, space below is not quite equal to space | ||
| 587 | % above. But it's pretty close. | ||
| 588 | \def\Egroup{% | ||
| 589 | \egroup % End the \vtop. | ||
| 590 | % \dimen0 is the vertical size of the group's box. | ||
| 591 | \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox | ||
| 592 | % \dimen2 is how much space is left on the page (more or less). | ||
| 593 | \dimen2 = \pageheight \advance\dimen2 by -\pagetotal | ||
| 594 | % if the group doesn't fit on the current page, and it's a big big | ||
| 595 | % group, force a page break. | ||
| 596 | \ifdim \dimen0 > \dimen2 | ||
| 597 | \ifdim \pagetotal < \vfilllimit\pageheight | ||
| 598 | \page | ||
| 599 | \fi | ||
| 600 | \fi | ||
| 601 | \copy\groupbox | ||
| 602 | \endgroup % End the \group. | ||
| 603 | }% | ||
| 604 | % | ||
| 605 | \setbox\groupbox = \vtop\bgroup | ||
| 606 | % We have to put a strut on the last line in case the @group is in | ||
| 607 | % the midst of an example, rather than completely enclosing it. | ||
| 608 | % Otherwise, the interline space between the last line of the group | ||
| 609 | % and the first line afterwards is too small. But we can't put the | ||
| 610 | % strut in \Egroup, since there it would be on a line by itself. | ||
| 611 | % Hence this just inserts a strut at the beginning of each line. | ||
| 612 | \everypar = {\strut}% | ||
| 613 | % | ||
| 614 | % Since we have a strut on every line, we don't need any of TeX's | ||
| 615 | % normal interline spacing. | ||
| 616 | \offinterlineskip | ||
| 617 | % | ||
| 618 | % OK, but now we have to do something about blank | ||
| 619 | % lines in the input in @example-like environments, which normally | ||
| 620 | % just turn into \lisppar, which will insert no space now that we've | ||
| 621 | % turned off the interline space. Simplest is to make them be an | ||
| 622 | % empty paragraph. | ||
| 623 | \ifx\par\lisppar | ||
| 624 | \edef\par{\leavevmode \par}% | ||
| 625 | % | ||
| 626 | % Reset ^^M's definition to new definition of \par. | ||
| 627 | \obeylines | ||
| 628 | \fi | ||
| 629 | % | ||
| 630 | % Do @comment since we are called inside an environment such as | ||
| 631 | % @example, where each end-of-line in the input causes an | ||
| 632 | % end-of-line in the output. We don't want the end-of-line after | ||
| 633 | % the `@group' to put extra space in the output. Since @group | ||
| 634 | % should appear on a line by itself (according to the Texinfo | ||
| 635 | % manual), we don't worry about eating any user text. | ||
| 636 | \comment | ||
| 637 | } | ||
| 638 | % | ||
| 639 | % TeX puts in an \escapechar (i.e., `@') at the beginning of the help | ||
| 640 | % message, so this ends up printing `@group can only ...'. | ||
| 641 | % | ||
| 642 | \newhelp\groupinvalidhelp{% | ||
| 643 | group can only be used in environments such as @example,^^J% | ||
| 644 | where each line of input produces a line of output.} | ||
| 645 | |||
| 646 | % @need space-in-mils | ||
| 647 | % forces a page break if there is not space-in-mils remaining. | ||
| 648 | |||
| 649 | \newdimen\mil \mil=0.001in | ||
| 650 | |||
| 651 | \def\need{\parsearg\needx} | ||
| 652 | |||
| 653 | % Old definition--didn't work. | ||
| 654 | %\def\needx #1{\par % | ||
| 655 | %% This method tries to make TeX break the page naturally | ||
| 656 | %% if the depth of the box does not fit. | ||
| 657 | %{\baselineskip=0pt% | ||
| 658 | %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak | ||
| 659 | %\prevdepth=-1000pt | ||
| 660 | %}} | ||
| 661 | |||
| 662 | \def\needx#1{% | ||
| 663 | % Ensure vertical mode, so we don't make a big box in the middle of a | ||
| 664 | % paragraph. | ||
| 665 | \par | ||
| 666 | % | ||
| 667 | % If the @need value is less than one line space, it's useless. | ||
| 668 | \dimen0 = #1\mil | ||
| 669 | \dimen2 = \ht\strutbox | ||
| 670 | \advance\dimen2 by \dp\strutbox | ||
| 671 | \ifdim\dimen0 > \dimen2 | ||
| 672 | % | ||
| 673 | % Do a \strut just to make the height of this box be normal, so the | ||
| 674 | % normal leading is inserted relative to the preceding line. | ||
| 675 | % And a page break here is fine. | ||
| 676 | \vtop to #1\mil{\strut\vfil}% | ||
| 677 | % | ||
| 678 | % TeX does not even consider page breaks if a penalty added to the | ||
| 679 | % main vertical list is 10000 or more. But in order to see if the | ||
| 680 | % empty box we just added fits on the page, we must make it consider | ||
| 681 | % page breaks. On the other hand, we don't want to actually break the | ||
| 682 | % page after the empty box. So we use a penalty of 9999. | ||
| 683 | % | ||
| 684 | % There is an extremely small chance that TeX will actually break the | ||
| 685 | % page at this \penalty, if there are no other feasible breakpoints in | ||
| 686 | % sight. (If the user is using lots of big @group commands, which | ||
| 687 | % almost-but-not-quite fill up a page, TeX will have a hard time doing | ||
| 688 | % good page breaking, for example.) However, I could not construct an | ||
| 689 | % example where a page broke at this \penalty; if it happens in a real | ||
| 690 | % document, then we can reconsider our strategy. | ||
| 691 | \penalty9999 | ||
| 692 | % | ||
| 693 | % Back up by the size of the box, whether we did a page break or not. | ||
| 694 | \kern -#1\mil | ||
| 695 | % | ||
| 696 | % Do not allow a page break right after this kern. | ||
| 697 | \nobreak | ||
| 698 | \fi | ||
| 699 | } | ||
| 700 | |||
| 701 | % @br forces paragraph break | ||
| 702 | |||
| 703 | \let\br = \par | ||
| 704 | |||
| 705 | % @dots{} output an ellipsis using the current font. | ||
| 706 | % We do .5em per period so that it has the same spacing in a typewriter | ||
| 707 | % font as three actual period characters. | ||
| 708 | % | ||
| 709 | \def\dots{% | ||
| 710 | \leavevmode | ||
| 711 | \hbox to 1.5em{% | ||
| 712 | \hskip 0pt plus 0.25fil minus 0.25fil | ||
| 713 | .\hss.\hss.% | ||
| 714 | \hskip 0pt plus 0.5fil minus 0.5fil | ||
| 715 | }% | ||
| 716 | } | ||
| 717 | |||
| 718 | % @enddots{} is an end-of-sentence ellipsis. | ||
| 719 | % | ||
| 720 | \def\enddots{% | ||
| 721 | \leavevmode | ||
| 722 | \hbox to 2em{% | ||
| 723 | \hskip 0pt plus 0.25fil minus 0.25fil | ||
| 724 | .\hss.\hss.\hss.% | ||
| 725 | \hskip 0pt plus 0.5fil minus 0.5fil | ||
| 726 | }% | ||
| 727 | \spacefactor=3000 | ||
| 728 | } | ||
| 729 | |||
| 730 | % @page forces the start of a new page. | ||
| 731 | % | ||
| 732 | \def\page{\par\vfill\supereject} | ||
| 733 | |||
| 734 | % @exdent text.... | ||
| 735 | % outputs text on separate line in roman font, starting at standard page margin | ||
| 736 | |||
| 737 | % This records the amount of indent in the innermost environment. | ||
| 738 | % That's how much \exdent should take out. | ||
| 739 | \newskip\exdentamount | ||
| 740 | |||
| 741 | % This defn is used inside fill environments such as @defun. | ||
| 742 | \def\exdent{\parsearg\exdentyyy} | ||
| 743 | \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} | ||
| 744 | |||
| 745 | % This defn is used inside nofill environments such as @example. | ||
| 746 | \def\nofillexdent{\parsearg\nofillexdentyyy} | ||
| 747 | \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount | ||
| 748 | \leftline{\hskip\leftskip{\rm#1}}}} | ||
| 749 | |||
| 750 | % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current | ||
| 751 | % paragraph. For more general purposes, use the \margin insertion | ||
| 752 | % class. WHICH is `l' or `r'. | ||
| 753 | % | ||
| 754 | \newskip\inmarginspacing \inmarginspacing=1cm | ||
| 755 | \def\strutdepth{\dp\strutbox} | ||
| 756 | % | ||
| 757 | \def\doinmargin#1#2{\strut\vadjust{% | ||
| 758 | \nobreak | ||
| 759 | \kern-\strutdepth | ||
| 760 | \vtop to \strutdepth{% | ||
| 761 | \baselineskip=\strutdepth | ||
| 762 | \vss | ||
| 763 | % if you have multiple lines of stuff to put here, you'll need to | ||
| 764 | % make the vbox yourself of the appropriate size. | ||
| 765 | \ifx#1l% | ||
| 766 | \llap{\ignorespaces #2\hskip\inmarginspacing}% | ||
| 767 | \else | ||
| 768 | \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% | ||
| 769 | \fi | ||
| 770 | \null | ||
| 771 | }% | ||
| 772 | }} | ||
| 773 | \def\inleftmargin{\doinmargin l} | ||
| 774 | \def\inrightmargin{\doinmargin r} | ||
| 775 | % | ||
| 776 | % @inmargin{TEXT [, RIGHT-TEXT]} | ||
| 777 | % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; | ||
| 778 | % else use TEXT for both). | ||
| 779 | % | ||
| 780 | \def\inmargin#1{\parseinmargin #1,,\finish} | ||
| 781 | \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. | ||
| 782 | \setbox0 = \hbox{\ignorespaces #2}% | ||
| 783 | \ifdim\wd0 > 0pt | ||
| 784 | \def\lefttext{#1}% have both texts | ||
| 785 | \def\righttext{#2}% | ||
| 786 | \else | ||
| 787 | \def\lefttext{#1}% have only one text | ||
| 788 | \def\righttext{#1}% | ||
| 789 | \fi | ||
| 790 | % | ||
| 791 | \ifodd\pageno | ||
| 792 | \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin | ||
| 793 | \else | ||
| 794 | \def\temp{\inleftmargin\lefttext}% | ||
| 795 | \fi | ||
| 796 | \temp | ||
| 797 | } | ||
| 798 | |||
| 799 | % @include file insert text of that file as input. | ||
| 800 | % Allow normal characters that we make active in the argument (a file name). | ||
| 801 | \def\include{\begingroup | ||
| 802 | \catcode`\\=\other | ||
| 803 | \catcode`~=\other | ||
| 804 | \catcode`^=\other | ||
| 805 | \catcode`_=\other | ||
| 806 | \catcode`|=\other | ||
| 807 | \catcode`<=\other | ||
| 808 | \catcode`>=\other | ||
| 809 | \catcode`+=\other | ||
| 810 | \parsearg\includezzz} | ||
| 811 | % Restore active chars for included file. | ||
| 812 | \def\includezzz#1{\endgroup\begingroup | ||
| 813 | % Read the included file in a group so nested @include's work. | ||
| 814 | \def\thisfile{#1}% | ||
| 815 | \let\value=\expandablevalue | ||
| 816 | \input\thisfile | ||
| 817 | \endgroup} | ||
| 818 | |||
| 819 | \def\thisfile{} | ||
| 820 | |||
| 821 | % @center line | ||
| 822 | % outputs that line, centered. | ||
| 823 | % | ||
| 824 | \def\center{\parsearg\docenter} | ||
| 825 | \def\docenter#1{{% | ||
| 826 | \ifhmode \hfil\break \fi | ||
| 827 | \advance\hsize by -\leftskip | ||
| 828 | \advance\hsize by -\rightskip | ||
| 829 | \line{\hfil \ignorespaces#1\unskip \hfil}% | ||
| 830 | \ifhmode \break \fi | ||
| 831 | }} | ||
| 832 | |||
| 833 | % @sp n outputs n lines of vertical space | ||
| 834 | |||
| 835 | \def\sp{\parsearg\spxxx} | ||
| 836 | \def\spxxx #1{\vskip #1\baselineskip} | ||
| 837 | |||
| 838 | % @comment ...line which is ignored... | ||
| 839 | % @c is the same as @comment | ||
| 840 | % @ignore ... @end ignore is another way to write a comment | ||
| 841 | |||
| 842 | \def\comment{\begingroup \catcode`\^^M=\other% | ||
| 843 | \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% | ||
| 844 | \commentxxx} | ||
| 845 | {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} | ||
| 846 | |||
| 847 | \let\c=\comment | ||
| 848 | |||
| 849 | % @paragraphindent NCHARS | ||
| 850 | % We'll use ems for NCHARS, close enough. | ||
| 851 | % NCHARS can also be the word `asis' or `none'. | ||
| 852 | % We cannot feasibly implement @paragraphindent asis, though. | ||
| 853 | % | ||
| 854 | \def\asisword{asis} % no translation, these are keywords | ||
| 855 | \def\noneword{none} | ||
| 856 | % | ||
| 857 | \def\paragraphindent{\parsearg\doparagraphindent} | ||
| 858 | \def\doparagraphindent#1{% | ||
| 859 | \def\temp{#1}% | ||
| 860 | \ifx\temp\asisword | ||
| 861 | \else | ||
| 862 | \ifx\temp\noneword | ||
| 863 | \defaultparindent = 0pt | ||
| 864 | \else | ||
| 865 | \defaultparindent = #1em | ||
| 866 | \fi | ||
| 867 | \fi | ||
| 868 | \parindent = \defaultparindent | ||
| 869 | } | ||
| 870 | |||
| 871 | % @exampleindent NCHARS | ||
| 872 | % We'll use ems for NCHARS like @paragraphindent. | ||
| 873 | % It seems @exampleindent asis isn't necessary, but | ||
| 874 | % I preserve it to make it similar to @paragraphindent. | ||
| 875 | \def\exampleindent{\parsearg\doexampleindent} | ||
| 876 | \def\doexampleindent#1{% | ||
| 877 | \def\temp{#1}% | ||
| 878 | \ifx\temp\asisword | ||
| 879 | \else | ||
| 880 | \ifx\temp\noneword | ||
| 881 | \lispnarrowing = 0pt | ||
| 882 | \else | ||
| 883 | \lispnarrowing = #1em | ||
| 884 | \fi | ||
| 885 | \fi | ||
| 886 | } | ||
| 887 | |||
| 888 | % @firstparagraphindent WORD | ||
| 889 | % If WORD is `none', then suppress indentation of the first paragraph | ||
| 890 | % after a section heading. If WORD is `insert', then do indentat such | ||
| 891 | % paragraphs. | ||
| 892 | % | ||
| 893 | % The paragraph indentation is suppressed or not by calling | ||
| 894 | % \suppressfirstparagraphindent, which the sectioning commands do. We | ||
| 895 | % switch the definition of this back and forth according to WORD. By | ||
| 896 | % default, we suppress indentation. | ||
| 897 | % | ||
| 898 | \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} | ||
| 899 | \newdimen\currentparindent | ||
| 900 | % | ||
| 901 | \def\insertword{insert} | ||
| 902 | % | ||
| 903 | \def\firstparagraphindent{\parsearg\dofirstparagraphindent} | ||
| 904 | \def\dofirstparagraphindent#1{% | ||
| 905 | \def\temp{#1}% | ||
| 906 | \ifx\temp\noneword | ||
| 907 | \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent | ||
| 908 | \else\ifx\temp\insertword | ||
| 909 | \let\suppressfirstparagraphindent = \relax | ||
| 910 | \else | ||
| 911 | \errhelp = \EMsimple | ||
| 912 | \errmessage{Unknown @firstparagraphindent option `\temp'}% | ||
| 913 | \fi\fi | ||
| 914 | } | ||
| 915 | |||
| 916 | % Here is how we actually suppress indentation. Redefine \everypar to | ||
| 917 | % \kern backwards by \parindent, and then reset itself to empty. | ||
| 918 | % | ||
| 919 | % We also make \indent itself not actually do anything until the next | ||
| 920 | % paragraph. | ||
| 921 | % | ||
| 922 | \gdef\dosuppressfirstparagraphindent{% | ||
| 923 | \gdef\indent{% | ||
| 924 | \global\let\indent=\ptexindent | ||
| 925 | \global\everypar = {}% | ||
| 926 | }% | ||
| 927 | \global\everypar = {% | ||
| 928 | \kern-\parindent | ||
| 929 | \global\let\indent=\ptexindent | ||
| 930 | \global\everypar = {}% | ||
| 931 | }% | ||
| 932 | }% | ||
| 933 | |||
| 934 | |||
| 935 | % @asis just yields its argument. Used with @table, for example. | ||
| 936 | % | ||
| 937 | \def\asis#1{#1} | ||
| 938 | |||
| 939 | % @math outputs its argument in math mode. | ||
| 940 | % We don't use $'s directly in the definition of \math because we need | ||
| 941 | % to set catcodes according to plain TeX first, to allow for subscripts, | ||
| 942 | % superscripts, special math chars, etc. | ||
| 943 | % | ||
| 944 | \let\implicitmath = $%$ font-lock fix | ||
| 945 | % | ||
| 946 | % One complication: _ usually means subscripts, but it could also mean | ||
| 947 | % an actual _ character, as in @math{@var{some_variable} + 1}. So make | ||
| 948 | % _ within @math be active (mathcode "8000), and distinguish by seeing | ||
| 949 | % if the current family is \slfam, which is what @var uses. | ||
| 950 | % | ||
| 951 | {\catcode\underChar = \active | ||
| 952 | \gdef\mathunderscore{% | ||
| 953 | \catcode\underChar=\active | ||
| 954 | \def_{\ifnum\fam=\slfam \_\else\sb\fi}% | ||
| 955 | }} | ||
| 956 | % | ||
| 957 | % Another complication: we want \\ (and @\) to output a \ character. | ||
| 958 | % FYI, plain.tex uses \\ as a temporary control sequence (why?), but | ||
| 959 | % this is not advertised and we don't care. Texinfo does not | ||
| 960 | % otherwise define @\. | ||
| 961 | % | ||
| 962 | % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. | ||
| 963 | \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} | ||
| 964 | % | ||
| 965 | \def\math{% | ||
| 966 | \tex | ||
| 967 | \mathcode`\_="8000 \mathunderscore | ||
| 968 | \let\\ = \mathbackslash | ||
| 969 | \mathactive | ||
| 970 | \implicitmath\finishmath} | ||
| 971 | \def\finishmath#1{#1\implicitmath\Etex} | ||
| 972 | |||
| 973 | % Some active characters (such as <) are spaced differently in math. | ||
| 974 | % We have to reset their definitions in case the @math was an | ||
| 975 | % argument to a command which set the catcodes (such as @item or @section). | ||
| 976 | % | ||
| 977 | { | ||
| 978 | \catcode`^ = \active | ||
| 979 | \catcode`< = \active | ||
| 980 | \catcode`> = \active | ||
| 981 | \catcode`+ = \active | ||
| 982 | \gdef\mathactive{% | ||
| 983 | \let^ = \ptexhat | ||
| 984 | \let< = \ptexless | ||
| 985 | \let> = \ptexgtr | ||
| 986 | \let+ = \ptexplus | ||
| 987 | } | ||
| 988 | } | ||
| 989 | |||
| 990 | % @bullet and @minus need the same treatment as @math, just above. | ||
| 991 | \def\bullet{\implicitmath\ptexbullet\implicitmath} | ||
| 992 | \def\minus{\implicitmath-\implicitmath} | ||
| 993 | |||
| 994 | % @refill is a no-op. | ||
| 995 | \let\refill=\relax | ||
| 996 | |||
| 997 | % If working on a large document in chapters, it is convenient to | ||
| 998 | % be able to disable indexing, cross-referencing, and contents, for test runs. | ||
| 999 | % This is done with @novalidate (before @setfilename). | ||
| 1000 | % | ||
| 1001 | \newif\iflinks \linkstrue % by default we want the aux files. | ||
| 1002 | \let\novalidate = \linksfalse | ||
| 1003 | |||
| 1004 | % @setfilename is done at the beginning of every texinfo file. | ||
| 1005 | % So open here the files we need to have open while reading the input. | ||
| 1006 | % This makes it possible to make a .fmt file for texinfo. | ||
| 1007 | \def\setfilename{% | ||
| 1008 | \iflinks | ||
| 1009 | \readauxfile | ||
| 1010 | \fi % \openindices needs to do some work in any case. | ||
| 1011 | \openindices | ||
| 1012 | \fixbackslash % Turn off hack to swallow `\input texinfo'. | ||
| 1013 | \global\let\setfilename=\comment % Ignore extra @setfilename cmds. | ||
| 1014 | % | ||
| 1015 | % If texinfo.cnf is present on the system, read it. | ||
| 1016 | % Useful for site-wide @afourpaper, etc. | ||
| 1017 | % Just to be on the safe side, close the input stream before the \input. | ||
| 1018 | \openin 1 texinfo.cnf | ||
| 1019 | \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi | ||
| 1020 | \closein1 | ||
| 1021 | \temp | ||
| 1022 | % | ||
| 1023 | \comment % Ignore the actual filename. | ||
| 1024 | } | ||
| 1025 | |||
| 1026 | % Called from \setfilename. | ||
| 1027 | % | ||
| 1028 | \def\openindices{% | ||
| 1029 | \newindex{cp}% | ||
| 1030 | \newcodeindex{fn}% | ||
| 1031 | \newcodeindex{vr}% | ||
| 1032 | \newcodeindex{tp}% | ||
| 1033 | \newcodeindex{ky}% | ||
| 1034 | \newcodeindex{pg}% | ||
| 1035 | } | ||
| 1036 | |||
| 1037 | % @bye. | ||
| 1038 | \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} | ||
| 1039 | |||
| 1040 | |||
| 1041 | \message{pdf,} | ||
| 1042 | % adobe `portable' document format | ||
| 1043 | \newcount\tempnum | ||
| 1044 | \newcount\lnkcount | ||
| 1045 | \newtoks\filename | ||
| 1046 | \newcount\filenamelength | ||
| 1047 | \newcount\pgn | ||
| 1048 | \newtoks\toksA | ||
| 1049 | \newtoks\toksB | ||
| 1050 | \newtoks\toksC | ||
| 1051 | \newtoks\toksD | ||
| 1052 | \newbox\boxA | ||
| 1053 | \newcount\countA | ||
| 1054 | \newif\ifpdf | ||
| 1055 | \newif\ifpdfmakepagedest | ||
| 1056 | |||
| 1057 | \ifx\pdfoutput\undefined | ||
| 1058 | \pdffalse | ||
| 1059 | \let\pdfmkdest = \gobble | ||
| 1060 | \let\pdfurl = \gobble | ||
| 1061 | \let\endlink = \relax | ||
| 1062 | \let\linkcolor = \relax | ||
| 1063 | \let\pdfmakeoutlines = \relax | ||
| 1064 | \else | ||
| 1065 | \pdftrue | ||
| 1066 | \pdfoutput = 1 | ||
| 1067 | \input pdfcolor | ||
| 1068 | \def\dopdfimage#1#2#3{% | ||
| 1069 | \def\imagewidth{#2}% | ||
| 1070 | \def\imageheight{#3}% | ||
| 1071 | % without \immediate, pdftex seg faults when the same image is | ||
| 1072 | % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) | ||
| 1073 | \ifnum\pdftexversion < 14 | ||
| 1074 | \immediate\pdfimage | ||
| 1075 | \else | ||
| 1076 | \immediate\pdfximage | ||
| 1077 | \fi | ||
| 1078 | \ifx\empty\imagewidth\else width \imagewidth \fi | ||
| 1079 | \ifx\empty\imageheight\else height \imageheight \fi | ||
| 1080 | \ifnum\pdftexversion<13 | ||
| 1081 | #1.pdf% | ||
| 1082 | \else | ||
| 1083 | {#1.pdf}% | ||
| 1084 | \fi | ||
| 1085 | \ifnum\pdftexversion < 14 \else | ||
| 1086 | \pdfrefximage \pdflastximage | ||
| 1087 | \fi} | ||
| 1088 | \def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}} | ||
| 1089 | \def\pdfmkpgn#1{#1} | ||
| 1090 | \let\linkcolor = \Blue % was Cyan, but that seems light? | ||
| 1091 | \def\endlink{\Black\pdfendlink} | ||
| 1092 | % Adding outlines to PDF; macros for calculating structure of outlines | ||
| 1093 | % come from Petr Olsak | ||
| 1094 | \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% | ||
| 1095 | \else \csname#1\endcsname \fi} | ||
| 1096 | \def\advancenumber#1{\tempnum=\expnumber{#1}\relax | ||
| 1097 | \advance\tempnum by1 | ||
| 1098 | \expandafter\xdef\csname#1\endcsname{\the\tempnum}} | ||
| 1099 | \def\pdfmakeoutlines{{% | ||
| 1100 | \openin 1 \jobname.toc | ||
| 1101 | \ifeof 1\else\begingroup | ||
| 1102 | \closein 1 | ||
| 1103 | % Thanh's hack / proper braces in bookmarks | ||
| 1104 | \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace | ||
| 1105 | \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace | ||
| 1106 | % | ||
| 1107 | \def\chapentry ##1##2##3{} | ||
| 1108 | \def\secentry ##1##2##3##4{\advancenumber{chap##2}} | ||
| 1109 | \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} | ||
| 1110 | \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} | ||
| 1111 | \let\appendixentry = \chapentry | ||
| 1112 | \let\unnumbchapentry = \chapentry | ||
| 1113 | \let\unnumbsecentry = \secentry | ||
| 1114 | \let\unnumbsubsecentry = \subsecentry | ||
| 1115 | \let\unnumbsubsubsecentry = \subsubsecentry | ||
| 1116 | \input \jobname.toc | ||
| 1117 | \def\chapentry ##1##2##3{% | ||
| 1118 | \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} | ||
| 1119 | \def\secentry ##1##2##3##4{% | ||
| 1120 | \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} | ||
| 1121 | \def\subsecentry ##1##2##3##4##5{% | ||
| 1122 | \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} | ||
| 1123 | \def\subsubsecentry ##1##2##3##4##5##6{% | ||
| 1124 | \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} | ||
| 1125 | \let\appendixentry = \chapentry | ||
| 1126 | \let\unnumbchapentry = \chapentry | ||
| 1127 | \let\unnumbsecentry = \secentry | ||
| 1128 | \let\unnumbsubsecentry = \subsecentry | ||
| 1129 | \let\unnumbsubsubsecentry = \subsubsecentry | ||
| 1130 | % | ||
| 1131 | % Make special characters normal for writing to the pdf file. | ||
| 1132 | % | ||
| 1133 | \indexnofonts | ||
| 1134 | \let\tt=\relax | ||
| 1135 | \turnoffactive | ||
| 1136 | \input \jobname.toc | ||
| 1137 | \endgroup\fi | ||
| 1138 | }} | ||
| 1139 | \def\makelinks #1,{% | ||
| 1140 | \def\params{#1}\def\E{END}% | ||
| 1141 | \ifx\params\E | ||
| 1142 | \let\nextmakelinks=\relax | ||
| 1143 | \else | ||
| 1144 | \let\nextmakelinks=\makelinks | ||
| 1145 | \ifnum\lnkcount>0,\fi | ||
| 1146 | \picknum{#1}% | ||
| 1147 | \startlink attr{/Border [0 0 0]} | ||
| 1148 | goto name{\pdfmkpgn{\the\pgn}}% | ||
| 1149 | \linkcolor #1% | ||
| 1150 | \advance\lnkcount by 1% | ||
| 1151 | \endlink | ||
| 1152 | \fi | ||
| 1153 | \nextmakelinks | ||
| 1154 | } | ||
| 1155 | \def\picknum#1{\expandafter\pn#1} | ||
| 1156 | \def\pn#1{% | ||
| 1157 | \def\p{#1}% | ||
| 1158 | \ifx\p\lbrace | ||
| 1159 | \let\nextpn=\ppn | ||
| 1160 | \else | ||
| 1161 | \let\nextpn=\ppnn | ||
| 1162 | \def\first{#1} | ||
| 1163 | \fi | ||
| 1164 | \nextpn | ||
| 1165 | } | ||
| 1166 | \def\ppn#1{\pgn=#1\gobble} | ||
| 1167 | \def\ppnn{\pgn=\first} | ||
| 1168 | \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,} | ||
| 1169 | \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} | ||
| 1170 | \def\skipspaces#1{\def\PP{#1}\def\D{|}% | ||
| 1171 | \ifx\PP\D\let\nextsp\relax | ||
| 1172 | \else\let\nextsp\skipspaces | ||
| 1173 | \ifx\p\space\else\addtokens{\filename}{\PP}% | ||
| 1174 | \advance\filenamelength by 1 | ||
| 1175 | \fi | ||
| 1176 | \fi | ||
| 1177 | \nextsp} | ||
| 1178 | \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} | ||
| 1179 | \ifnum\pdftexversion < 14 | ||
| 1180 | \let \startlink \pdfannotlink | ||
| 1181 | \else | ||
| 1182 | \let \startlink \pdfstartlink | ||
| 1183 | \fi | ||
| 1184 | \def\pdfurl#1{% | ||
| 1185 | \begingroup | ||
| 1186 | \normalturnoffactive\def\@{@}% | ||
| 1187 | \let\value=\expandablevalue | ||
| 1188 | \leavevmode\Red | ||
| 1189 | \startlink attr{/Border [0 0 0]}% | ||
| 1190 | user{/Subtype /Link /A << /S /URI /URI (#1) >>}% | ||
| 1191 | % #1 | ||
| 1192 | \endgroup} | ||
| 1193 | \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} | ||
| 1194 | \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} | ||
| 1195 | \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} | ||
| 1196 | \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} | ||
| 1197 | \def\maketoks{% | ||
| 1198 | \expandafter\poptoks\the\toksA|ENDTOKS| | ||
| 1199 | \ifx\first0\adn0 | ||
| 1200 | \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 | ||
| 1201 | \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 | ||
| 1202 | \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 | ||
| 1203 | \else | ||
| 1204 | \ifnum0=\countA\else\makelink\fi | ||
| 1205 | \ifx\first.\let\next=\done\else | ||
| 1206 | \let\next=\maketoks | ||
| 1207 | \addtokens{\toksB}{\the\toksD} | ||
| 1208 | \ifx\first,\addtokens{\toksB}{\space}\fi | ||
| 1209 | \fi | ||
| 1210 | \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi | ||
| 1211 | \next} | ||
| 1212 | \def\makelink{\addtokens{\toksB}% | ||
| 1213 | {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} | ||
| 1214 | \def\pdflink#1{% | ||
| 1215 | \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} | ||
| 1216 | \linkcolor #1\endlink} | ||
| 1217 | \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} | ||
| 1218 | \fi % \ifx\pdfoutput | ||
| 1219 | |||
| 1220 | |||
| 1221 | \message{fonts,} | ||
| 1222 | % Font-change commands. | ||
| 1223 | |||
| 1224 | % Texinfo sort of supports the sans serif font style, which plain TeX does not. | ||
| 1225 | % So we set up a \sf analogous to plain's \rm, etc. | ||
| 1226 | \newfam\sffam | ||
| 1227 | \def\sf{\fam=\sffam \tensf} | ||
| 1228 | \let\li = \sf % Sometimes we call it \li, not \sf. | ||
| 1229 | |||
| 1230 | % We don't need math for this one. | ||
| 1231 | \def\ttsl{\tenttsl} | ||
| 1232 | |||
| 1233 | % Default leading. | ||
| 1234 | \newdimen\textleading \textleading = 13.2pt | ||
| 1235 | |||
| 1236 | % Set the baselineskip to #1, and the lineskip and strut size | ||
| 1237 | % correspondingly. There is no deep meaning behind these magic numbers | ||
| 1238 | % used as factors; they just match (closely enough) what Knuth defined. | ||
| 1239 | % | ||
| 1240 | \def\lineskipfactor{.08333} | ||
| 1241 | \def\strutheightpercent{.70833} | ||
| 1242 | \def\strutdepthpercent {.29167} | ||
| 1243 | % | ||
| 1244 | \def\setleading#1{% | ||
| 1245 | \normalbaselineskip = #1\relax | ||
| 1246 | \normallineskip = \lineskipfactor\normalbaselineskip | ||
| 1247 | \normalbaselines | ||
| 1248 | \setbox\strutbox =\hbox{% | ||
| 1249 | \vrule width0pt height\strutheightpercent\baselineskip | ||
| 1250 | depth \strutdepthpercent \baselineskip | ||
| 1251 | }% | ||
| 1252 | } | ||
| 1253 | |||
| 1254 | % Set the font macro #1 to the font named #2, adding on the | ||
| 1255 | % specified font prefix (normally `cm'). | ||
| 1256 | % #3 is the font's design size, #4 is a scale factor | ||
| 1257 | \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} | ||
| 1258 | |||
| 1259 | % Use cm as the default font prefix. | ||
| 1260 | % To specify the font prefix, you must define \fontprefix | ||
| 1261 | % before you read in texinfo.tex. | ||
| 1262 | \ifx\fontprefix\undefined | ||
| 1263 | \def\fontprefix{cm} | ||
| 1264 | \fi | ||
| 1265 | % Support font families that don't use the same naming scheme as CM. | ||
| 1266 | \def\rmshape{r} | ||
| 1267 | \def\rmbshape{bx} %where the normal face is bold | ||
| 1268 | \def\bfshape{b} | ||
| 1269 | \def\bxshape{bx} | ||
| 1270 | \def\ttshape{tt} | ||
| 1271 | \def\ttbshape{tt} | ||
| 1272 | \def\ttslshape{sltt} | ||
| 1273 | \def\itshape{ti} | ||
| 1274 | \def\itbshape{bxti} | ||
| 1275 | \def\slshape{sl} | ||
| 1276 | \def\slbshape{bxsl} | ||
| 1277 | \def\sfshape{ss} | ||
| 1278 | \def\sfbshape{ss} | ||
| 1279 | \def\scshape{csc} | ||
| 1280 | \def\scbshape{csc} | ||
| 1281 | |||
| 1282 | \newcount\mainmagstep | ||
| 1283 | \ifx\bigger\relax | ||
| 1284 | % not really supported. | ||
| 1285 | \mainmagstep=\magstep1 | ||
| 1286 | \setfont\textrm\rmshape{12}{1000} | ||
| 1287 | \setfont\texttt\ttshape{12}{1000} | ||
| 1288 | \else | ||
| 1289 | \mainmagstep=\magstephalf | ||
| 1290 | \setfont\textrm\rmshape{10}{\mainmagstep} | ||
| 1291 | \setfont\texttt\ttshape{10}{\mainmagstep} | ||
| 1292 | \fi | ||
| 1293 | % Instead of cmb10, you may want to use cmbx10. | ||
| 1294 | % cmbx10 is a prettier font on its own, but cmb10 | ||
| 1295 | % looks better when embedded in a line with cmr10 | ||
| 1296 | % (in Bob's opinion). | ||
| 1297 | \setfont\textbf\bfshape{10}{\mainmagstep} | ||
| 1298 | \setfont\textit\itshape{10}{\mainmagstep} | ||
| 1299 | \setfont\textsl\slshape{10}{\mainmagstep} | ||
| 1300 | \setfont\textsf\sfshape{10}{\mainmagstep} | ||
| 1301 | \setfont\textsc\scshape{10}{\mainmagstep} | ||
| 1302 | \setfont\textttsl\ttslshape{10}{\mainmagstep} | ||
| 1303 | \font\texti=cmmi10 scaled \mainmagstep | ||
| 1304 | \font\textsy=cmsy10 scaled \mainmagstep | ||
| 1305 | |||
| 1306 | % A few fonts for @defun, etc. | ||
| 1307 | \setfont\defbf\bxshape{10}{\magstep1} %was 1314 | ||
| 1308 | \setfont\deftt\ttshape{10}{\magstep1} | ||
| 1309 | \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} | ||
| 1310 | |||
| 1311 | % Fonts for indices, footnotes, small examples (9pt). | ||
| 1312 | \setfont\smallrm\rmshape{9}{1000} | ||
| 1313 | \setfont\smalltt\ttshape{9}{1000} | ||
| 1314 | \setfont\smallbf\bfshape{10}{900} | ||
| 1315 | \setfont\smallit\itshape{9}{1000} | ||
| 1316 | \setfont\smallsl\slshape{9}{1000} | ||
| 1317 | \setfont\smallsf\sfshape{9}{1000} | ||
| 1318 | \setfont\smallsc\scshape{10}{900} | ||
| 1319 | \setfont\smallttsl\ttslshape{10}{900} | ||
| 1320 | \font\smalli=cmmi9 | ||
| 1321 | \font\smallsy=cmsy9 | ||
| 1322 | |||
| 1323 | % Fonts for small examples (8pt). | ||
| 1324 | \setfont\smallerrm\rmshape{8}{1000} | ||
| 1325 | \setfont\smallertt\ttshape{8}{1000} | ||
| 1326 | \setfont\smallerbf\bfshape{10}{800} | ||
| 1327 | \setfont\smallerit\itshape{8}{1000} | ||
| 1328 | \setfont\smallersl\slshape{8}{1000} | ||
| 1329 | \setfont\smallersf\sfshape{8}{1000} | ||
| 1330 | \setfont\smallersc\scshape{10}{800} | ||
| 1331 | \setfont\smallerttsl\ttslshape{10}{800} | ||
| 1332 | \font\smalleri=cmmi8 | ||
| 1333 | \font\smallersy=cmsy8 | ||
| 1334 | |||
| 1335 | % Fonts for title page: | ||
| 1336 | \setfont\titlerm\rmbshape{12}{\magstep3} | ||
| 1337 | \setfont\titleit\itbshape{10}{\magstep4} | ||
| 1338 | \setfont\titlesl\slbshape{10}{\magstep4} | ||
| 1339 | \setfont\titlett\ttbshape{12}{\magstep3} | ||
| 1340 | \setfont\titlettsl\ttslshape{10}{\magstep4} | ||
| 1341 | \setfont\titlesf\sfbshape{17}{\magstep1} | ||
| 1342 | \let\titlebf=\titlerm | ||
| 1343 | \setfont\titlesc\scbshape{10}{\magstep4} | ||
| 1344 | \font\titlei=cmmi12 scaled \magstep3 | ||
| 1345 | \font\titlesy=cmsy10 scaled \magstep4 | ||
| 1346 | \def\authorrm{\secrm} | ||
| 1347 | \def\authortt{\sectt} | ||
| 1348 | |||
| 1349 | % Chapter (and unnumbered) fonts (17.28pt). | ||
| 1350 | \setfont\chaprm\rmbshape{12}{\magstep2} | ||
| 1351 | \setfont\chapit\itbshape{10}{\magstep3} | ||
| 1352 | \setfont\chapsl\slbshape{10}{\magstep3} | ||
| 1353 | \setfont\chaptt\ttbshape{12}{\magstep2} | ||
| 1354 | \setfont\chapttsl\ttslshape{10}{\magstep3} | ||
| 1355 | \setfont\chapsf\sfbshape{17}{1000} | ||
| 1356 | \let\chapbf=\chaprm | ||
| 1357 | \setfont\chapsc\scbshape{10}{\magstep3} | ||
| 1358 | \font\chapi=cmmi12 scaled \magstep2 | ||
| 1359 | \font\chapsy=cmsy10 scaled \magstep3 | ||
| 1360 | |||
| 1361 | % Section fonts (14.4pt). | ||
| 1362 | \setfont\secrm\rmbshape{12}{\magstep1} | ||
| 1363 | \setfont\secit\itbshape{10}{\magstep2} | ||
| 1364 | \setfont\secsl\slbshape{10}{\magstep2} | ||
| 1365 | \setfont\sectt\ttbshape{12}{\magstep1} | ||
| 1366 | \setfont\secttsl\ttslshape{10}{\magstep2} | ||
| 1367 | \setfont\secsf\sfbshape{12}{\magstep1} | ||
| 1368 | \let\secbf\secrm | ||
| 1369 | \setfont\secsc\scbshape{10}{\magstep2} | ||
| 1370 | \font\seci=cmmi12 scaled \magstep1 | ||
| 1371 | \font\secsy=cmsy10 scaled \magstep2 | ||
| 1372 | |||
| 1373 | % Subsection fonts (13.15pt). | ||
| 1374 | \setfont\ssecrm\rmbshape{12}{\magstephalf} | ||
| 1375 | \setfont\ssecit\itbshape{10}{1315} | ||
| 1376 | \setfont\ssecsl\slbshape{10}{1315} | ||
| 1377 | \setfont\ssectt\ttbshape{12}{\magstephalf} | ||
| 1378 | \setfont\ssecttsl\ttslshape{10}{1315} | ||
| 1379 | \setfont\ssecsf\sfbshape{12}{\magstephalf} | ||
| 1380 | \let\ssecbf\ssecrm | ||
| 1381 | \setfont\ssecsc\scbshape{10}{\magstep1} | ||
| 1382 | \font\sseci=cmmi12 scaled \magstephalf | ||
| 1383 | \font\ssecsy=cmsy10 scaled 1315 | ||
| 1384 | % The smallcaps and symbol fonts should actually be scaled \magstep1.5, | ||
| 1385 | % but that is not a standard magnification. | ||
| 1386 | |||
| 1387 | % In order for the font changes to affect most math symbols and letters, | ||
| 1388 | % we have to define the \textfont of the standard families. Since | ||
| 1389 | % texinfo doesn't allow for producing subscripts and superscripts except | ||
| 1390 | % in the main text, we don't bother to reset \scriptfont and | ||
| 1391 | % \scriptscriptfont (which would also require loading a lot more fonts). | ||
| 1392 | % | ||
| 1393 | \def\resetmathfonts{% | ||
| 1394 | \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy | ||
| 1395 | \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf | ||
| 1396 | \textfont\ttfam=\tentt \textfont\sffam=\tensf | ||
| 1397 | } | ||
| 1398 | |||
| 1399 | % The font-changing commands redefine the meanings of \tenSTYLE, instead | ||
| 1400 | % of just \STYLE. We do this so that font changes will continue to work | ||
| 1401 | % in math mode, where it is the current \fam that is relevant in most | ||
| 1402 | % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam | ||
| 1403 | % \tenbf}, for example. By redefining \tenbf, we obviate the need to | ||
| 1404 | % redefine \bf itself. | ||
| 1405 | \def\textfonts{% | ||
| 1406 | \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl | ||
| 1407 | \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc | ||
| 1408 | \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl | ||
| 1409 | \resetmathfonts \setleading{\textleading}} | ||
| 1410 | \def\titlefonts{% | ||
| 1411 | \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl | ||
| 1412 | \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc | ||
| 1413 | \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy | ||
| 1414 | \let\tenttsl=\titlettsl | ||
| 1415 | \resetmathfonts \setleading{25pt}} | ||
| 1416 | \def\titlefont#1{{\titlefonts\rm #1}} | ||
| 1417 | \def\chapfonts{% | ||
| 1418 | \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl | ||
| 1419 | \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc | ||
| 1420 | \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl | ||
| 1421 | \resetmathfonts \setleading{19pt}} | ||
| 1422 | \def\secfonts{% | ||
| 1423 | \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl | ||
| 1424 | \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc | ||
| 1425 | \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl | ||
| 1426 | \resetmathfonts \setleading{16pt}} | ||
| 1427 | \def\subsecfonts{% | ||
| 1428 | \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl | ||
| 1429 | \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc | ||
| 1430 | \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl | ||
| 1431 | \resetmathfonts \setleading{15pt}} | ||
| 1432 | \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? | ||
| 1433 | \def\smallfonts{% | ||
| 1434 | \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl | ||
| 1435 | \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc | ||
| 1436 | \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy | ||
| 1437 | \let\tenttsl=\smallttsl | ||
| 1438 | \resetmathfonts \setleading{10.5pt}} | ||
| 1439 | \def\smallerfonts{% | ||
| 1440 | \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl | ||
| 1441 | \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc | ||
| 1442 | \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy | ||
| 1443 | \let\tenttsl=\smallerttsl | ||
| 1444 | \resetmathfonts \setleading{9.5pt}} | ||
| 1445 | |||
| 1446 | % Set the fonts to use with the @small... environments. | ||
| 1447 | \let\smallexamplefonts = \smallfonts | ||
| 1448 | |||
| 1449 | % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample | ||
| 1450 | % can fit this many characters: | ||
| 1451 | % 8.5x11=86 smallbook=72 a4=90 a5=69 | ||
| 1452 | % If we use \smallerfonts (8pt), then we can fit this many characters: | ||
| 1453 | % 8.5x11=90+ smallbook=80 a4=90+ a5=77 | ||
| 1454 | % For me, subjectively, the few extra characters that fit aren't worth | ||
| 1455 | % the additional smallness of 8pt. So I'm making the default 9pt. | ||
| 1456 | % | ||
| 1457 | % By the way, for comparison, here's what fits with @example (10pt): | ||
| 1458 | % 8.5x11=71 smallbook=60 a4=75 a5=58 | ||
| 1459 | % | ||
| 1460 | % I wish we used A4 paper on this side of the Atlantic. | ||
| 1461 | % | ||
| 1462 | % --karl, 24jan03. | ||
| 1463 | |||
| 1464 | |||
| 1465 | % Set up the default fonts, so we can use them for creating boxes. | ||
| 1466 | % | ||
| 1467 | \textfonts | ||
| 1468 | |||
| 1469 | % Define these so they can be easily changed for other fonts. | ||
| 1470 | \def\angleleft{$\langle$} | ||
| 1471 | \def\angleright{$\rangle$} | ||
| 1472 | |||
| 1473 | % Count depth in font-changes, for error checks | ||
| 1474 | \newcount\fontdepth \fontdepth=0 | ||
| 1475 | |||
| 1476 | % Fonts for short table of contents. | ||
| 1477 | \setfont\shortcontrm\rmshape{12}{1000} | ||
| 1478 | \setfont\shortcontbf\bxshape{12}{1000} | ||
| 1479 | \setfont\shortcontsl\slshape{12}{1000} | ||
| 1480 | \setfont\shortconttt\ttshape{12}{1000} | ||
| 1481 | |||
| 1482 | %% Add scribe-like font environments, plus @l for inline lisp (usually sans | ||
| 1483 | %% serif) and @ii for TeX italic | ||
| 1484 | |||
| 1485 | % \smartitalic{ARG} outputs arg in italics, followed by an italic correction | ||
| 1486 | % unless the following character is such as not to need one. | ||
| 1487 | \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else | ||
| 1488 | \ptexslash\fi\fi\fi} | ||
| 1489 | \def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} | ||
| 1490 | \def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} | ||
| 1491 | |||
| 1492 | \let\i=\smartitalic | ||
| 1493 | \let\var=\smartslanted | ||
| 1494 | \let\dfn=\smartslanted | ||
| 1495 | \let\emph=\smartitalic | ||
| 1496 | \let\cite=\smartslanted | ||
| 1497 | |||
| 1498 | \def\b#1{{\bf #1}} | ||
| 1499 | \let\strong=\b | ||
| 1500 | |||
| 1501 | % We can't just use \exhyphenpenalty, because that only has effect at | ||
| 1502 | % the end of a paragraph. Restore normal hyphenation at the end of the | ||
| 1503 | % group within which \nohyphenation is presumably called. | ||
| 1504 | % | ||
| 1505 | \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} | ||
| 1506 | \def\restorehyphenation{\hyphenchar\font = `- } | ||
| 1507 | |||
| 1508 | % Set sfcode to normal for the chars that usually have another value. | ||
| 1509 | % Can't use plain's \frenchspacing because it uses the `\x notation, and | ||
| 1510 | % sometimes \x has an active definition that messes things up. | ||
| 1511 | % | ||
| 1512 | \catcode`@=11 | ||
| 1513 | \def\frenchspacing{% | ||
| 1514 | \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m | ||
| 1515 | \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m | ||
| 1516 | } | ||
| 1517 | \catcode`@=\other | ||
| 1518 | |||
| 1519 | \def\t#1{% | ||
| 1520 | {\tt \rawbackslash \frenchspacing #1}% | ||
| 1521 | \null | ||
| 1522 | } | ||
| 1523 | \let\ttfont=\t | ||
| 1524 | \def\samp#1{`\tclose{#1}'\null} | ||
| 1525 | \setfont\keyrm\rmshape{8}{1000} | ||
| 1526 | \font\keysy=cmsy9 | ||
| 1527 | \def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% | ||
| 1528 | \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% | ||
| 1529 | \vbox{\hrule\kern-0.4pt | ||
| 1530 | \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% | ||
| 1531 | \kern-0.4pt\hrule}% | ||
| 1532 | \kern-.06em\raise0.4pt\hbox{\angleright}}}} | ||
| 1533 | % The old definition, with no lozenge: | ||
| 1534 | %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} | ||
| 1535 | \def\ctrl #1{{\tt \rawbackslash \hat}#1} | ||
| 1536 | |||
| 1537 | % @file, @option are the same as @samp. | ||
| 1538 | \let\file=\samp | ||
| 1539 | \let\option=\samp | ||
| 1540 | |||
| 1541 | % @code is a modification of @t, | ||
| 1542 | % which makes spaces the same size as normal in the surrounding text. | ||
| 1543 | \def\tclose#1{% | ||
| 1544 | {% | ||
| 1545 | % Change normal interword space to be same as for the current font. | ||
| 1546 | \spaceskip = \fontdimen2\font | ||
| 1547 | % | ||
| 1548 | % Switch to typewriter. | ||
| 1549 | \tt | ||
| 1550 | % | ||
| 1551 | % But `\ ' produces the large typewriter interword space. | ||
| 1552 | \def\ {{\spaceskip = 0pt{} }}% | ||
| 1553 | % | ||
| 1554 | % Turn off hyphenation. | ||
| 1555 | \nohyphenation | ||
| 1556 | % | ||
| 1557 | \rawbackslash | ||
| 1558 | \frenchspacing | ||
| 1559 | #1% | ||
| 1560 | }% | ||
| 1561 | \null | ||
| 1562 | } | ||
| 1563 | |||
| 1564 | % We *must* turn on hyphenation at `-' and `_' in \code. | ||
| 1565 | % Otherwise, it is too hard to avoid overfull hboxes | ||
| 1566 | % in the Emacs manual, the Library manual, etc. | ||
| 1567 | |||
| 1568 | % Unfortunately, TeX uses one parameter (\hyphenchar) to control | ||
| 1569 | % both hyphenation at - and hyphenation within words. | ||
| 1570 | % We must therefore turn them both off (\tclose does that) | ||
| 1571 | % and arrange explicitly to hyphenate at a dash. | ||
| 1572 | % -- rms. | ||
| 1573 | { | ||
| 1574 | \catcode`\-=\active | ||
| 1575 | \catcode`\_=\active | ||
| 1576 | % | ||
| 1577 | \global\def\code{\begingroup | ||
| 1578 | \catcode`\-=\active \let-\codedash | ||
| 1579 | \catcode`\_=\active \let_\codeunder | ||
| 1580 | \codex | ||
| 1581 | } | ||
| 1582 | % | ||
| 1583 | % If we end up with any active - characters when handling the index, | ||
| 1584 | % just treat them as a normal -. | ||
| 1585 | \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} | ||
| 1586 | } | ||
| 1587 | |||
| 1588 | \def\realdash{-} | ||
| 1589 | \def\codedash{-\discretionary{}{}{}} | ||
| 1590 | \def\codeunder{% | ||
| 1591 | % this is all so @math{@code{var_name}+1} can work. In math mode, _ | ||
| 1592 | % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) | ||
| 1593 | % will therefore expand the active definition of _, which is us | ||
| 1594 | % (inside @code that is), therefore an endless loop. | ||
| 1595 | \ifusingtt{\ifmmode | ||
| 1596 | \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. | ||
| 1597 | \else\normalunderscore \fi | ||
| 1598 | \discretionary{}{}{}}% | ||
| 1599 | {\_}% | ||
| 1600 | } | ||
| 1601 | \def\codex #1{\tclose{#1}\endgroup} | ||
| 1602 | |||
| 1603 | % @kbd is like @code, except that if the argument is just one @key command, | ||
| 1604 | % then @kbd has no effect. | ||
| 1605 | |||
| 1606 | % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), | ||
| 1607 | % `example' (@kbd uses ttsl only inside of @example and friends), | ||
| 1608 | % or `code' (@kbd uses normal tty font always). | ||
| 1609 | \def\kbdinputstyle{\parsearg\kbdinputstylexxx} | ||
| 1610 | \def\kbdinputstylexxx#1{% | ||
| 1611 | \def\arg{#1}% | ||
| 1612 | \ifx\arg\worddistinct | ||
| 1613 | \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% | ||
| 1614 | \else\ifx\arg\wordexample | ||
| 1615 | \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% | ||
| 1616 | \else\ifx\arg\wordcode | ||
| 1617 | \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% | ||
| 1618 | \else | ||
| 1619 | \errhelp = \EMsimple | ||
| 1620 | \errmessage{Unknown @kbdinputstyle option `\arg'}% | ||
| 1621 | \fi\fi\fi | ||
| 1622 | } | ||
| 1623 | \def\worddistinct{distinct} | ||
| 1624 | \def\wordexample{example} | ||
| 1625 | \def\wordcode{code} | ||
| 1626 | |||
| 1627 | % Default is `distinct.' | ||
| 1628 | \kbdinputstyle distinct | ||
| 1629 | |||
| 1630 | \def\xkey{\key} | ||
| 1631 | \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% | ||
| 1632 | \ifx\one\xkey\ifx\threex\three \key{#2}% | ||
| 1633 | \else{\tclose{\kbdfont\look}}\fi | ||
| 1634 | \else{\tclose{\kbdfont\look}}\fi} | ||
| 1635 | |||
| 1636 | % For @url, @env, @command quotes seem unnecessary, so use \code. | ||
| 1637 | \let\url=\code | ||
| 1638 | \let\env=\code | ||
| 1639 | \let\command=\code | ||
| 1640 | |||
| 1641 | % @uref (abbreviation for `urlref') takes an optional (comma-separated) | ||
| 1642 | % second argument specifying the text to display and an optional third | ||
| 1643 | % arg as text to display instead of (rather than in addition to) the url | ||
| 1644 | % itself. First (mandatory) arg is the url. Perhaps eventually put in | ||
| 1645 | % a hypertex \special here. | ||
| 1646 | % | ||
| 1647 | \def\uref#1{\douref #1,,,\finish} | ||
| 1648 | \def\douref#1,#2,#3,#4\finish{\begingroup | ||
| 1649 | \unsepspaces | ||
| 1650 | \pdfurl{#1}% | ||
| 1651 | \setbox0 = \hbox{\ignorespaces #3}% | ||
| 1652 | \ifdim\wd0 > 0pt | ||
| 1653 | \unhbox0 % third arg given, show only that | ||
| 1654 | \else | ||
| 1655 | \setbox0 = \hbox{\ignorespaces #2}% | ||
| 1656 | \ifdim\wd0 > 0pt | ||
| 1657 | \ifpdf | ||
| 1658 | \unhbox0 % PDF: 2nd arg given, show only it | ||
| 1659 | \else | ||
| 1660 | \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url | ||
| 1661 | \fi | ||
| 1662 | \else | ||
| 1663 | \code{#1}% only url given, so show it | ||
| 1664 | \fi | ||
| 1665 | \fi | ||
| 1666 | \endlink | ||
| 1667 | \endgroup} | ||
| 1668 | |||
| 1669 | % rms does not like angle brackets --karl, 17may97. | ||
| 1670 | % So now @email is just like @uref, unless we are pdf. | ||
| 1671 | % | ||
| 1672 | %\def\email#1{\angleleft{\tt #1}\angleright} | ||
| 1673 | \ifpdf | ||
| 1674 | \def\email#1{\doemail#1,,\finish} | ||
| 1675 | \def\doemail#1,#2,#3\finish{\begingroup | ||
| 1676 | \unsepspaces | ||
| 1677 | \pdfurl{mailto:#1}% | ||
| 1678 | \setbox0 = \hbox{\ignorespaces #2}% | ||
| 1679 | \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi | ||
| 1680 | \endlink | ||
| 1681 | \endgroup} | ||
| 1682 | \else | ||
| 1683 | \let\email=\uref | ||
| 1684 | \fi | ||
| 1685 | |||
| 1686 | % Check if we are currently using a typewriter font. Since all the | ||
| 1687 | % Computer Modern typewriter fonts have zero interword stretch (and | ||
| 1688 | % shrink), and it is reasonable to expect all typewriter fonts to have | ||
| 1689 | % this property, we can check that font parameter. | ||
| 1690 | % | ||
| 1691 | \def\ifmonospace{\ifdim\fontdimen3\font=0pt } | ||
| 1692 | |||
| 1693 | % Typeset a dimension, e.g., `in' or `pt'. The only reason for the | ||
| 1694 | % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. | ||
| 1695 | % | ||
| 1696 | \def\dmn#1{\thinspace #1} | ||
| 1697 | |||
| 1698 | \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} | ||
| 1699 | |||
| 1700 | % @l was never documented to mean ``switch to the Lisp font'', | ||
| 1701 | % and it is not used as such in any manual I can find. We need it for | ||
| 1702 | % Polish suppressed-l. --karl, 22sep96. | ||
| 1703 | %\def\l#1{{\li #1}\null} | ||
| 1704 | |||
| 1705 | % Explicit font changes: @r, @sc, undocumented @ii. | ||
| 1706 | \def\r#1{{\rm #1}} % roman font | ||
| 1707 | \def\sc#1{{\smallcaps#1}} % smallcaps font | ||
| 1708 | \def\ii#1{{\it #1}} % italic font | ||
| 1709 | |||
| 1710 | % @acronym downcases the argument and prints in smallcaps. | ||
| 1711 | \def\acronym#1{{\smallcaps \lowercase{#1}}} | ||
| 1712 | |||
| 1713 | % @pounds{} is a sterling sign. | ||
| 1714 | \def\pounds{{\it\$}} | ||
| 1715 | |||
| 1716 | % @registeredsymbol - R in a circle. For now, only works in text size; | ||
| 1717 | % we'd have to redo the font mechanism to change the \scriptstyle and | ||
| 1718 | % \scriptscriptstyle font sizes to make it look right in headings. | ||
| 1719 | % Adapted from the plain.tex definition of \copyright. | ||
| 1720 | % | ||
| 1721 | \def\registeredsymbol{% | ||
| 1722 | $^{{\ooalign{\hfil\raise.07ex\hbox{$\scriptstyle\rm R$}\hfil\crcr\Orb}}% | ||
| 1723 | }$% | ||
| 1724 | } | ||
| 1725 | |||
| 1726 | |||
| 1727 | \message{page headings,} | ||
| 1728 | |||
| 1729 | \newskip\titlepagetopglue \titlepagetopglue = 1.5in | ||
| 1730 | \newskip\titlepagebottomglue \titlepagebottomglue = 2pc | ||
| 1731 | |||
| 1732 | % First the title page. Must do @settitle before @titlepage. | ||
| 1733 | \newif\ifseenauthor | ||
| 1734 | \newif\iffinishedtitlepage | ||
| 1735 | |||
| 1736 | % Do an implicit @contents or @shortcontents after @end titlepage if the | ||
| 1737 | % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. | ||
| 1738 | % | ||
| 1739 | \newif\ifsetcontentsaftertitlepage | ||
| 1740 | \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue | ||
| 1741 | \newif\ifsetshortcontentsaftertitlepage | ||
| 1742 | \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue | ||
| 1743 | |||
| 1744 | \def\shorttitlepage{\parsearg\shorttitlepagezzz} | ||
| 1745 | \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% | ||
| 1746 | \endgroup\page\hbox{}\page} | ||
| 1747 | |||
| 1748 | \def\titlepage{\begingroup \parindent=0pt \textfonts | ||
| 1749 | \let\subtitlerm=\tenrm | ||
| 1750 | \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% | ||
| 1751 | % | ||
| 1752 | \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines | ||
| 1753 | \let\tt=\authortt}% | ||
| 1754 | % | ||
| 1755 | % Leave some space at the very top of the page. | ||
| 1756 | \vglue\titlepagetopglue | ||
| 1757 | % | ||
| 1758 | % Now you can print the title using @title. | ||
| 1759 | \def\title{\parsearg\titlezzz}% | ||
| 1760 | \def\titlezzz##1{\leftline{\titlefonts\rm ##1} | ||
| 1761 | % print a rule at the page bottom also. | ||
| 1762 | \finishedtitlepagefalse | ||
| 1763 | \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% | ||
| 1764 | % No rule at page bottom unless we print one at the top with @title. | ||
| 1765 | \finishedtitlepagetrue | ||
| 1766 | % | ||
| 1767 | % Now you can put text using @subtitle. | ||
| 1768 | \def\subtitle{\parsearg\subtitlezzz}% | ||
| 1769 | \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% | ||
| 1770 | % | ||
| 1771 | % @author should come last, but may come many times. | ||
| 1772 | \def\author{\parsearg\authorzzz}% | ||
| 1773 | \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi | ||
| 1774 | {\authorfont \leftline{##1}}}% | ||
| 1775 | % | ||
| 1776 | % Most title ``pages'' are actually two pages long, with space | ||
| 1777 | % at the top of the second. We don't want the ragged left on the second. | ||
| 1778 | \let\oldpage = \page | ||
| 1779 | \def\page{% | ||
| 1780 | \iffinishedtitlepage\else | ||
| 1781 | \finishtitlepage | ||
| 1782 | \fi | ||
| 1783 | \oldpage | ||
| 1784 | \let\page = \oldpage | ||
| 1785 | \hbox{}}% | ||
| 1786 | % \def\page{\oldpage \hbox{}} | ||
| 1787 | } | ||
| 1788 | |||
| 1789 | \def\Etitlepage{% | ||
| 1790 | \iffinishedtitlepage\else | ||
| 1791 | \finishtitlepage | ||
| 1792 | \fi | ||
| 1793 | % It is important to do the page break before ending the group, | ||
| 1794 | % because the headline and footline are only empty inside the group. | ||
| 1795 | % If we use the new definition of \page, we always get a blank page | ||
| 1796 | % after the title page, which we certainly don't want. | ||
| 1797 | \oldpage | ||
| 1798 | \endgroup | ||
| 1799 | % | ||
| 1800 | % Need this before the \...aftertitlepage checks so that if they are | ||
| 1801 | % in effect the toc pages will come out with page numbers. | ||
| 1802 | \HEADINGSon | ||
| 1803 | % | ||
| 1804 | % If they want short, they certainly want long too. | ||
| 1805 | \ifsetshortcontentsaftertitlepage | ||
| 1806 | \shortcontents | ||
| 1807 | \contents | ||
| 1808 | \global\let\shortcontents = \relax | ||
| 1809 | \global\let\contents = \relax | ||
| 1810 | \fi | ||
| 1811 | % | ||
| 1812 | \ifsetcontentsaftertitlepage | ||
| 1813 | \contents | ||
| 1814 | \global\let\contents = \relax | ||
| 1815 | \global\let\shortcontents = \relax | ||
| 1816 | \fi | ||
| 1817 | } | ||
| 1818 | |||
| 1819 | \def\finishtitlepage{% | ||
| 1820 | \vskip4pt \hrule height 2pt width \hsize | ||
| 1821 | \vskip\titlepagebottomglue | ||
| 1822 | \finishedtitlepagetrue | ||
| 1823 | } | ||
| 1824 | |||
| 1825 | %%% Set up page headings and footings. | ||
| 1826 | |||
| 1827 | \let\thispage=\folio | ||
| 1828 | |||
| 1829 | \newtoks\evenheadline % headline on even pages | ||
| 1830 | \newtoks\oddheadline % headline on odd pages | ||
| 1831 | \newtoks\evenfootline % footline on even pages | ||
| 1832 | \newtoks\oddfootline % footline on odd pages | ||
| 1833 | |||
| 1834 | % Now make Tex use those variables | ||
| 1835 | \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline | ||
| 1836 | \else \the\evenheadline \fi}} | ||
| 1837 | \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline | ||
| 1838 | \else \the\evenfootline \fi}\HEADINGShook} | ||
| 1839 | \let\HEADINGShook=\relax | ||
| 1840 | |||
| 1841 | % Commands to set those variables. | ||
| 1842 | % For example, this is what @headings on does | ||
| 1843 | % @evenheading @thistitle|@thispage|@thischapter | ||
| 1844 | % @oddheading @thischapter|@thispage|@thistitle | ||
| 1845 | % @evenfooting @thisfile|| | ||
| 1846 | % @oddfooting ||@thisfile | ||
| 1847 | |||
| 1848 | \def\evenheading{\parsearg\evenheadingxxx} | ||
| 1849 | \def\oddheading{\parsearg\oddheadingxxx} | ||
| 1850 | \def\everyheading{\parsearg\everyheadingxxx} | ||
| 1851 | |||
| 1852 | \def\evenfooting{\parsearg\evenfootingxxx} | ||
| 1853 | \def\oddfooting{\parsearg\oddfootingxxx} | ||
| 1854 | \def\everyfooting{\parsearg\everyfootingxxx} | ||
| 1855 | |||
| 1856 | {\catcode`\@=0 % | ||
| 1857 | |||
| 1858 | \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} | ||
| 1859 | \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% | ||
| 1860 | \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} | ||
| 1861 | |||
| 1862 | \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} | ||
| 1863 | \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% | ||
| 1864 | \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} | ||
| 1865 | |||
| 1866 | \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% | ||
| 1867 | |||
| 1868 | \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} | ||
| 1869 | \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% | ||
| 1870 | \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} | ||
| 1871 | |||
| 1872 | \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} | ||
| 1873 | \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% | ||
| 1874 | \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% | ||
| 1875 | % | ||
| 1876 | % Leave some space for the footline. Hopefully ok to assume | ||
| 1877 | % @evenfooting will not be used by itself. | ||
| 1878 | \global\advance\pageheight by -\baselineskip | ||
| 1879 | \global\advance\vsize by -\baselineskip | ||
| 1880 | } | ||
| 1881 | |||
| 1882 | \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} | ||
| 1883 | % | ||
| 1884 | }% unbind the catcode of @. | ||
| 1885 | |||
| 1886 | % @headings double turns headings on for double-sided printing. | ||
| 1887 | % @headings single turns headings on for single-sided printing. | ||
| 1888 | % @headings off turns them off. | ||
| 1889 | % @headings on same as @headings double, retained for compatibility. | ||
| 1890 | % @headings after turns on double-sided headings after this page. | ||
| 1891 | % @headings doubleafter turns on double-sided headings after this page. | ||
| 1892 | % @headings singleafter turns on single-sided headings after this page. | ||
| 1893 | % By default, they are off at the start of a document, | ||
| 1894 | % and turned `on' after @end titlepage. | ||
| 1895 | |||
| 1896 | \def\headings #1 {\csname HEADINGS#1\endcsname} | ||
| 1897 | |||
| 1898 | \def\HEADINGSoff{ | ||
| 1899 | \global\evenheadline={\hfil} \global\evenfootline={\hfil} | ||
| 1900 | \global\oddheadline={\hfil} \global\oddfootline={\hfil}} | ||
| 1901 | \HEADINGSoff | ||
| 1902 | % When we turn headings on, set the page number to 1. | ||
| 1903 | % For double-sided printing, put current file name in lower left corner, | ||
| 1904 | % chapter name on inside top of right hand pages, document | ||
| 1905 | % title on inside top of left hand pages, and page numbers on outside top | ||
| 1906 | % edge of all pages. | ||
| 1907 | \def\HEADINGSdouble{ | ||
| 1908 | \global\pageno=1 | ||
| 1909 | \global\evenfootline={\hfil} | ||
| 1910 | \global\oddfootline={\hfil} | ||
| 1911 | \global\evenheadline={\line{\folio\hfil\thistitle}} | ||
| 1912 | \global\oddheadline={\line{\thischapter\hfil\folio}} | ||
| 1913 | \global\let\contentsalignmacro = \chapoddpage | ||
| 1914 | } | ||
| 1915 | \let\contentsalignmacro = \chappager | ||
| 1916 | |||
| 1917 | % For single-sided printing, chapter title goes across top left of page, | ||
| 1918 | % page number on top right. | ||
| 1919 | \def\HEADINGSsingle{ | ||
| 1920 | \global\pageno=1 | ||
| 1921 | \global\evenfootline={\hfil} | ||
| 1922 | \global\oddfootline={\hfil} | ||
| 1923 | \global\evenheadline={\line{\thischapter\hfil\folio}} | ||
| 1924 | \global\oddheadline={\line{\thischapter\hfil\folio}} | ||
| 1925 | \global\let\contentsalignmacro = \chappager | ||
| 1926 | } | ||
| 1927 | \def\HEADINGSon{\HEADINGSdouble} | ||
| 1928 | |||
| 1929 | \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} | ||
| 1930 | \let\HEADINGSdoubleafter=\HEADINGSafter | ||
| 1931 | \def\HEADINGSdoublex{% | ||
| 1932 | \global\evenfootline={\hfil} | ||
| 1933 | \global\oddfootline={\hfil} | ||
| 1934 | \global\evenheadline={\line{\folio\hfil\thistitle}} | ||
| 1935 | \global\oddheadline={\line{\thischapter\hfil\folio}} | ||
| 1936 | \global\let\contentsalignmacro = \chapoddpage | ||
| 1937 | } | ||
| 1938 | |||
| 1939 | \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} | ||
| 1940 | \def\HEADINGSsinglex{% | ||
| 1941 | \global\evenfootline={\hfil} | ||
| 1942 | \global\oddfootline={\hfil} | ||
| 1943 | \global\evenheadline={\line{\thischapter\hfil\folio}} | ||
| 1944 | \global\oddheadline={\line{\thischapter\hfil\folio}} | ||
| 1945 | \global\let\contentsalignmacro = \chappager | ||
| 1946 | } | ||
| 1947 | |||
| 1948 | % Subroutines used in generating headings | ||
| 1949 | % This produces Day Month Year style of output. | ||
| 1950 | % Only define if not already defined, in case a txi-??.tex file has set | ||
| 1951 | % up a different format (e.g., txi-cs.tex does this). | ||
| 1952 | \ifx\today\undefined | ||
| 1953 | \def\today{% | ||
| 1954 | \number\day\space | ||
| 1955 | \ifcase\month | ||
| 1956 | \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr | ||
| 1957 | \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug | ||
| 1958 | \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec | ||
| 1959 | \fi | ||
| 1960 | \space\number\year} | ||
| 1961 | \fi | ||
| 1962 | |||
| 1963 | % @settitle line... specifies the title of the document, for headings. | ||
| 1964 | % It generates no output of its own. | ||
| 1965 | \def\thistitle{\putwordNoTitle} | ||
| 1966 | \def\settitle{\parsearg\settitlezzz} | ||
| 1967 | \def\settitlezzz #1{\gdef\thistitle{#1}} | ||
| 1968 | |||
| 1969 | |||
| 1970 | \message{tables,} | ||
| 1971 | % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). | ||
| 1972 | |||
| 1973 | % default indentation of table text | ||
| 1974 | \newdimen\tableindent \tableindent=.8in | ||
| 1975 | % default indentation of @itemize and @enumerate text | ||
| 1976 | \newdimen\itemindent \itemindent=.3in | ||
| 1977 | % margin between end of table item and start of table text. | ||
| 1978 | \newdimen\itemmargin \itemmargin=.1in | ||
| 1979 | |||
| 1980 | % used internally for \itemindent minus \itemmargin | ||
| 1981 | \newdimen\itemmax | ||
| 1982 | |||
| 1983 | % Note @table, @vtable, and @vtable define @item, @itemx, etc., with | ||
| 1984 | % these defs. | ||
| 1985 | % They also define \itemindex | ||
| 1986 | % to index the item name in whatever manner is desired (perhaps none). | ||
| 1987 | |||
| 1988 | \newif\ifitemxneedsnegativevskip | ||
| 1989 | |||
| 1990 | \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} | ||
| 1991 | |||
| 1992 | \def\internalBitem{\smallbreak \parsearg\itemzzz} | ||
| 1993 | \def\internalBitemx{\itemxpar \parsearg\itemzzz} | ||
| 1994 | |||
| 1995 | \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} | ||
| 1996 | \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} | ||
| 1997 | |||
| 1998 | \def\internalBkitem{\smallbreak \parsearg\kitemzzz} | ||
| 1999 | \def\internalBkitemx{\itemxpar \parsearg\kitemzzz} | ||
| 2000 | |||
| 2001 | \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% | ||
| 2002 | \itemzzz {#1}} | ||
| 2003 | |||
| 2004 | \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% | ||
| 2005 | \itemzzz {#1}} | ||
| 2006 | |||
| 2007 | \def\itemzzz #1{\begingroup % | ||
| 2008 | \advance\hsize by -\rightskip | ||
| 2009 | \advance\hsize by -\tableindent | ||
| 2010 | \setbox0=\hbox{\itemfont{#1}}% | ||
| 2011 | \itemindex{#1}% | ||
| 2012 | \nobreak % This prevents a break before @itemx. | ||
| 2013 | % | ||
| 2014 | % If the item text does not fit in the space we have, put it on a line | ||
| 2015 | % by itself, and do not allow a page break either before or after that | ||
| 2016 | % line. We do not start a paragraph here because then if the next | ||
| 2017 | % command is, e.g., @kindex, the whatsit would get put into the | ||
| 2018 | % horizontal list on a line by itself, resulting in extra blank space. | ||
| 2019 | \ifdim \wd0>\itemmax | ||
| 2020 | % | ||
| 2021 | % Make this a paragraph so we get the \parskip glue and wrapping, | ||
| 2022 | % but leave it ragged-right. | ||
| 2023 | \begingroup | ||
| 2024 | \advance\leftskip by-\tableindent | ||
| 2025 | \advance\hsize by\tableindent | ||
| 2026 | \advance\rightskip by0pt plus1fil | ||
| 2027 | \leavevmode\unhbox0\par | ||
| 2028 | \endgroup | ||
| 2029 | % | ||
| 2030 | % We're going to be starting a paragraph, but we don't want the | ||
| 2031 | % \parskip glue -- logically it's part of the @item we just started. | ||
| 2032 | \nobreak \vskip-\parskip | ||
| 2033 | % | ||
| 2034 | % Stop a page break at the \parskip glue coming up. (Unfortunately | ||
| 2035 | % we can't prevent a possible page break at the following | ||
| 2036 | % \baselineskip glue.) However, if what follows is an environment | ||
| 2037 | % such as @example, there will be no \parskip glue; then | ||
| 2038 | % the negative vskip we just would cause the example and the item to | ||
| 2039 | % crash together. So we use this bizarre value of 10001 as a signal | ||
| 2040 | % to \aboveenvbreak to insert \parskip glue after all. | ||
| 2041 | % (Possibly there are other commands that could be followed by | ||
| 2042 | % @example which need the same treatment, but not section titles; or | ||
| 2043 | % maybe section titles are the only special case and they should be | ||
| 2044 | % penalty 10001...) | ||
| 2045 | \penalty 10001 | ||
| 2046 | \endgroup | ||
| 2047 | \itemxneedsnegativevskipfalse | ||
| 2048 | \else | ||
| 2049 | % The item text fits into the space. Start a paragraph, so that the | ||
| 2050 | % following text (if any) will end up on the same line. | ||
| 2051 | \noindent | ||
| 2052 | % Do this with kerns and \unhbox so that if there is a footnote in | ||
| 2053 | % the item text, it can migrate to the main vertical list and | ||
| 2054 | % eventually be printed. | ||
| 2055 | \nobreak\kern-\tableindent | ||
| 2056 | \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 | ||
| 2057 | \unhbox0 | ||
| 2058 | \nobreak\kern\dimen0 | ||
| 2059 | \endgroup | ||
| 2060 | \itemxneedsnegativevskiptrue | ||
| 2061 | \fi | ||
| 2062 | } | ||
| 2063 | |||
| 2064 | \def\item{\errmessage{@item while not in a table}} | ||
| 2065 | \def\itemx{\errmessage{@itemx while not in a table}} | ||
| 2066 | \def\kitem{\errmessage{@kitem while not in a table}} | ||
| 2067 | \def\kitemx{\errmessage{@kitemx while not in a table}} | ||
| 2068 | \def\xitem{\errmessage{@xitem while not in a table}} | ||
| 2069 | \def\xitemx{\errmessage{@xitemx while not in a table}} | ||
| 2070 | |||
| 2071 | % Contains a kludge to get @end[description] to work. | ||
| 2072 | \def\description{\tablez{\dontindex}{1}{}{}{}{}} | ||
| 2073 | |||
| 2074 | % @table, @ftable, @vtable. | ||
| 2075 | \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} | ||
| 2076 | {\obeylines\obeyspaces% | ||
| 2077 | \gdef\tablex #1^^M{% | ||
| 2078 | \tabley\dontindex#1 \endtabley}} | ||
| 2079 | |||
| 2080 | \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} | ||
| 2081 | {\obeylines\obeyspaces% | ||
| 2082 | \gdef\ftablex #1^^M{% | ||
| 2083 | \tabley\fnitemindex#1 \endtabley | ||
| 2084 | \def\Eftable{\endgraf\afterenvbreak\endgroup}% | ||
| 2085 | \let\Etable=\relax}} | ||
| 2086 | |||
| 2087 | \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} | ||
| 2088 | {\obeylines\obeyspaces% | ||
| 2089 | \gdef\vtablex #1^^M{% | ||
| 2090 | \tabley\vritemindex#1 \endtabley | ||
| 2091 | \def\Evtable{\endgraf\afterenvbreak\endgroup}% | ||
| 2092 | \let\Etable=\relax}} | ||
| 2093 | |||
| 2094 | \def\dontindex #1{} | ||
| 2095 | \def\fnitemindex #1{\doind {fn}{\code{#1}}}% | ||
| 2096 | \def\vritemindex #1{\doind {vr}{\code{#1}}}% | ||
| 2097 | |||
| 2098 | {\obeyspaces % | ||
| 2099 | \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% | ||
| 2100 | \tablez{#1}{#2}{#3}{#4}{#5}{#6}}} | ||
| 2101 | |||
| 2102 | \def\tablez #1#2#3#4#5#6{% | ||
| 2103 | \aboveenvbreak % | ||
| 2104 | \begingroup % | ||
| 2105 | \def\Edescription{\Etable}% Necessary kludge. | ||
| 2106 | \let\itemindex=#1% | ||
| 2107 | \ifnum 0#3>0 \advance \leftskip by #3\mil \fi % | ||
| 2108 | \ifnum 0#4>0 \tableindent=#4\mil \fi % | ||
| 2109 | \ifnum 0#5>0 \advance \rightskip by #5\mil \fi % | ||
| 2110 | \def\itemfont{#2}% | ||
| 2111 | \itemmax=\tableindent % | ||
| 2112 | \advance \itemmax by -\itemmargin % | ||
| 2113 | \advance \leftskip by \tableindent % | ||
| 2114 | \exdentamount=\tableindent | ||
| 2115 | \parindent = 0pt | ||
| 2116 | \parskip = \smallskipamount | ||
| 2117 | \ifdim \parskip=0pt \parskip=2pt \fi% | ||
| 2118 | \def\Etable{\endgraf\afterenvbreak\endgroup}% | ||
| 2119 | \let\item = \internalBitem % | ||
| 2120 | \let\itemx = \internalBitemx % | ||
| 2121 | \let\kitem = \internalBkitem % | ||
| 2122 | \let\kitemx = \internalBkitemx % | ||
| 2123 | \let\xitem = \internalBxitem % | ||
| 2124 | \let\xitemx = \internalBxitemx % | ||
| 2125 | } | ||
| 2126 | |||
| 2127 | % This is the counter used by @enumerate, which is really @itemize | ||
| 2128 | |||
| 2129 | \newcount \itemno | ||
| 2130 | |||
| 2131 | \def\itemize{\parsearg\itemizezzz} | ||
| 2132 | |||
| 2133 | \def\itemizezzz #1{% | ||
| 2134 | \begingroup % ended by the @end itemize | ||
| 2135 | \itemizey {#1}{\Eitemize} | ||
| 2136 | } | ||
| 2137 | |||
| 2138 | \def\itemizey#1#2{% | ||
| 2139 | \aboveenvbreak | ||
| 2140 | \itemmax=\itemindent | ||
| 2141 | \advance\itemmax by -\itemmargin | ||
| 2142 | \advance\leftskip by \itemindent | ||
| 2143 | \exdentamount=\itemindent | ||
| 2144 | \parindent=0pt | ||
| 2145 | \parskip=\smallskipamount | ||
| 2146 | \ifdim\parskip=0pt \parskip=2pt \fi | ||
| 2147 | \def#2{\endgraf\afterenvbreak\endgroup}% | ||
| 2148 | \def\itemcontents{#1}% | ||
| 2149 | % @itemize with no arg is equivalent to @itemize @bullet. | ||
| 2150 | \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi | ||
| 2151 | \let\item=\itemizeitem | ||
| 2152 | } | ||
| 2153 | |||
| 2154 | % \splitoff TOKENS\endmark defines \first to be the first token in | ||
| 2155 | % TOKENS, and \rest to be the remainder. | ||
| 2156 | % | ||
| 2157 | \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% | ||
| 2158 | |||
| 2159 | % Allow an optional argument of an uppercase letter, lowercase letter, | ||
| 2160 | % or number, to specify the first label in the enumerated list. No | ||
| 2161 | % argument is the same as `1'. | ||
| 2162 | % | ||
| 2163 | \def\enumerate{\parsearg\enumeratezzz} | ||
| 2164 | \def\enumeratezzz #1{\enumeratey #1 \endenumeratey} | ||
| 2165 | \def\enumeratey #1 #2\endenumeratey{% | ||
| 2166 | \begingroup % ended by the @end enumerate | ||
| 2167 | % | ||
| 2168 | % If we were given no argument, pretend we were given `1'. | ||
| 2169 | \def\thearg{#1}% | ||
| 2170 | \ifx\thearg\empty \def\thearg{1}\fi | ||
| 2171 | % | ||
| 2172 | % Detect if the argument is a single token. If so, it might be a | ||
| 2173 | % letter. Otherwise, the only valid thing it can be is a number. | ||
| 2174 | % (We will always have one token, because of the test we just made. | ||
| 2175 | % This is a good thing, since \splitoff doesn't work given nothing at | ||
| 2176 | % all -- the first parameter is undelimited.) | ||
| 2177 | \expandafter\splitoff\thearg\endmark | ||
| 2178 | \ifx\rest\empty | ||
| 2179 | % Only one token in the argument. It could still be anything. | ||
| 2180 | % A ``lowercase letter'' is one whose \lccode is nonzero. | ||
| 2181 | % An ``uppercase letter'' is one whose \lccode is both nonzero, and | ||
| 2182 | % not equal to itself. | ||
| 2183 | % Otherwise, we assume it's a number. | ||
| 2184 | % | ||
| 2185 | % We need the \relax at the end of the \ifnum lines to stop TeX from | ||
| 2186 | % continuing to look for a <number>. | ||
| 2187 | % | ||
| 2188 | \ifnum\lccode\expandafter`\thearg=0\relax | ||
| 2189 | \numericenumerate % a number (we hope) | ||
| 2190 | \else | ||
| 2191 | % It's a letter. | ||
| 2192 | \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax | ||
| 2193 | \lowercaseenumerate % lowercase letter | ||
| 2194 | \else | ||
| 2195 | \uppercaseenumerate % uppercase letter | ||
| 2196 | \fi | ||
| 2197 | \fi | ||
| 2198 | \else | ||
| 2199 | % Multiple tokens in the argument. We hope it's a number. | ||
| 2200 | \numericenumerate | ||
| 2201 | \fi | ||
| 2202 | } | ||
| 2203 | |||
| 2204 | % An @enumerate whose labels are integers. The starting integer is | ||
| 2205 | % given in \thearg. | ||
| 2206 | % | ||
| 2207 | \def\numericenumerate{% | ||
| 2208 | \itemno = \thearg | ||
| 2209 | \startenumeration{\the\itemno}% | ||
| 2210 | } | ||
| 2211 | |||
| 2212 | % The starting (lowercase) letter is in \thearg. | ||
| 2213 | \def\lowercaseenumerate{% | ||
| 2214 | \itemno = \expandafter`\thearg | ||
| 2215 | \startenumeration{% | ||
| 2216 | % Be sure we're not beyond the end of the alphabet. | ||
| 2217 | \ifnum\itemno=0 | ||
| 2218 | \errmessage{No more lowercase letters in @enumerate; get a bigger | ||
| 2219 | alphabet}% | ||
| 2220 | \fi | ||
| 2221 | \char\lccode\itemno | ||
| 2222 | }% | ||
| 2223 | } | ||
| 2224 | |||
| 2225 | % The starting (uppercase) letter is in \thearg. | ||
| 2226 | \def\uppercaseenumerate{% | ||
| 2227 | \itemno = \expandafter`\thearg | ||
| 2228 | \startenumeration{% | ||
| 2229 | % Be sure we're not beyond the end of the alphabet. | ||
| 2230 | \ifnum\itemno=0 | ||
| 2231 | \errmessage{No more uppercase letters in @enumerate; get a bigger | ||
| 2232 | alphabet} | ||
| 2233 | \fi | ||
| 2234 | \char\uccode\itemno | ||
| 2235 | }% | ||
| 2236 | } | ||
| 2237 | |||
| 2238 | % Call itemizey, adding a period to the first argument and supplying the | ||
| 2239 | % common last two arguments. Also subtract one from the initial value in | ||
| 2240 | % \itemno, since @item increments \itemno. | ||
| 2241 | % | ||
| 2242 | \def\startenumeration#1{% | ||
| 2243 | \advance\itemno by -1 | ||
| 2244 | \itemizey{#1.}\Eenumerate\flushcr | ||
| 2245 | } | ||
| 2246 | |||
| 2247 | % @alphaenumerate and @capsenumerate are abbreviations for giving an arg | ||
| 2248 | % to @enumerate. | ||
| 2249 | % | ||
| 2250 | \def\alphaenumerate{\enumerate{a}} | ||
| 2251 | \def\capsenumerate{\enumerate{A}} | ||
| 2252 | \def\Ealphaenumerate{\Eenumerate} | ||
| 2253 | \def\Ecapsenumerate{\Eenumerate} | ||
| 2254 | |||
| 2255 | % Definition of @item while inside @itemize. | ||
| 2256 | |||
| 2257 | \def\itemizeitem{% | ||
| 2258 | \advance\itemno by 1 | ||
| 2259 | {\let\par=\endgraf \smallbreak}% | ||
| 2260 | \ifhmode \errmessage{In hmode at itemizeitem}\fi | ||
| 2261 | {\parskip=0in \hskip 0pt | ||
| 2262 | \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% | ||
| 2263 | \vadjust{\penalty 1200}}% | ||
| 2264 | \flushcr} | ||
| 2265 | |||
| 2266 | % @multitable macros | ||
| 2267 | % Amy Hendrickson, 8/18/94, 3/6/96 | ||
| 2268 | % | ||
| 2269 | % @multitable ... @end multitable will make as many columns as desired. | ||
| 2270 | % Contents of each column will wrap at width given in preamble. Width | ||
| 2271 | % can be specified either with sample text given in a template line, | ||
| 2272 | % or in percent of \hsize, the current width of text on page. | ||
| 2273 | |||
| 2274 | % Table can continue over pages but will only break between lines. | ||
| 2275 | |||
| 2276 | % To make preamble: | ||
| 2277 | % | ||
| 2278 | % Either define widths of columns in terms of percent of \hsize: | ||
| 2279 | % @multitable @columnfractions .25 .3 .45 | ||
| 2280 | % @item ... | ||
| 2281 | % | ||
| 2282 | % Numbers following @columnfractions are the percent of the total | ||
| 2283 | % current hsize to be used for each column. You may use as many | ||
| 2284 | % columns as desired. | ||
| 2285 | |||
| 2286 | |||
| 2287 | % Or use a template: | ||
| 2288 | % @multitable {Column 1 template} {Column 2 template} {Column 3 template} | ||
| 2289 | % @item ... | ||
| 2290 | % using the widest term desired in each column. | ||
| 2291 | % | ||
| 2292 | % For those who want to use more than one line's worth of words in | ||
| 2293 | % the preamble, break the line within one argument and it | ||
| 2294 | % will parse correctly, i.e., | ||
| 2295 | % | ||
| 2296 | % @multitable {Column 1 template} {Column 2 template} {Column 3 | ||
| 2297 | % template} | ||
| 2298 | % Not: | ||
| 2299 | % @multitable {Column 1 template} {Column 2 template} | ||
| 2300 | % {Column 3 template} | ||
| 2301 | |||
| 2302 | % Each new table line starts with @item, each subsequent new column | ||
| 2303 | % starts with @tab. Empty columns may be produced by supplying @tab's | ||
| 2304 | % with nothing between them for as many times as empty columns are needed, | ||
| 2305 | % ie, @tab@tab@tab will produce two empty columns. | ||
| 2306 | |||
| 2307 | % @item, @tab, @multitable or @end multitable do not need to be on their | ||
| 2308 | % own lines, but it will not hurt if they are. | ||
| 2309 | |||
| 2310 | % Sample multitable: | ||
| 2311 | |||
| 2312 | % @multitable {Column 1 template} {Column 2 template} {Column 3 template} | ||
| 2313 | % @item first col stuff @tab second col stuff @tab third col | ||
| 2314 | % @item | ||
| 2315 | % first col stuff | ||
| 2316 | % @tab | ||
| 2317 | % second col stuff | ||
| 2318 | % @tab | ||
| 2319 | % third col | ||
| 2320 | % @item first col stuff @tab second col stuff | ||
| 2321 | % @tab Many paragraphs of text may be used in any column. | ||
| 2322 | % | ||
| 2323 | % They will wrap at the width determined by the template. | ||
| 2324 | % @item@tab@tab This will be in third column. | ||
| 2325 | % @end multitable | ||
| 2326 | |||
| 2327 | % Default dimensions may be reset by user. | ||
| 2328 | % @multitableparskip is vertical space between paragraphs in table. | ||
| 2329 | % @multitableparindent is paragraph indent in table. | ||
| 2330 | % @multitablecolmargin is horizontal space to be left between columns. | ||
| 2331 | % @multitablelinespace is space to leave between table items, baseline | ||
| 2332 | % to baseline. | ||
| 2333 | % 0pt means it depends on current normal line spacing. | ||
| 2334 | % | ||
| 2335 | \newskip\multitableparskip | ||
| 2336 | \newskip\multitableparindent | ||
| 2337 | \newdimen\multitablecolspace | ||
| 2338 | \newskip\multitablelinespace | ||
| 2339 | \multitableparskip=0pt | ||
| 2340 | \multitableparindent=6pt | ||
| 2341 | \multitablecolspace=12pt | ||
| 2342 | \multitablelinespace=0pt | ||
| 2343 | |||
| 2344 | % Macros used to set up halign preamble: | ||
| 2345 | % | ||
| 2346 | \let\endsetuptable\relax | ||
| 2347 | \def\xendsetuptable{\endsetuptable} | ||
| 2348 | \let\columnfractions\relax | ||
| 2349 | \def\xcolumnfractions{\columnfractions} | ||
| 2350 | \newif\ifsetpercent | ||
| 2351 | |||
| 2352 | % #1 is the part of the @columnfraction before the decimal point, which | ||
| 2353 | % is presumably either 0 or the empty string (but we don't check, we | ||
| 2354 | % just throw it away). #2 is the decimal part, which we use as the | ||
| 2355 | % percent of \hsize for this column. | ||
| 2356 | \def\pickupwholefraction#1.#2 {% | ||
| 2357 | \global\advance\colcount by 1 | ||
| 2358 | \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}% | ||
| 2359 | \setuptable | ||
| 2360 | } | ||
| 2361 | |||
| 2362 | \newcount\colcount | ||
| 2363 | \def\setuptable#1{% | ||
| 2364 | \def\firstarg{#1}% | ||
| 2365 | \ifx\firstarg\xendsetuptable | ||
| 2366 | \let\go = \relax | ||
| 2367 | \else | ||
| 2368 | \ifx\firstarg\xcolumnfractions | ||
| 2369 | \global\setpercenttrue | ||
| 2370 | \else | ||
| 2371 | \ifsetpercent | ||
| 2372 | \let\go\pickupwholefraction | ||
| 2373 | \else | ||
| 2374 | \global\advance\colcount by 1 | ||
| 2375 | \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a | ||
| 2376 | % separator; typically that is always in the input, anyway. | ||
| 2377 | \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% | ||
| 2378 | \fi | ||
| 2379 | \fi | ||
| 2380 | \ifx\go\pickupwholefraction | ||
| 2381 | % Put the argument back for the \pickupwholefraction call, so | ||
| 2382 | % we'll always have a period there to be parsed. | ||
| 2383 | \def\go{\pickupwholefraction#1}% | ||
| 2384 | \else | ||
| 2385 | \let\go = \setuptable | ||
| 2386 | \fi% | ||
| 2387 | \fi | ||
| 2388 | \go | ||
| 2389 | } | ||
| 2390 | |||
| 2391 | % @multitable ... @end multitable definitions: | ||
| 2392 | % | ||
| 2393 | \def\multitable{\parsearg\dotable} | ||
| 2394 | \def\dotable#1{\bgroup | ||
| 2395 | \vskip\parskip | ||
| 2396 | \let\item=\crcrwithfootnotes | ||
| 2397 | % A \tab used to include \hskip1sp. But then the space in a template | ||
| 2398 | % line is not enough. That is bad. So let's go back to just & until | ||
| 2399 | % we encounter the problem it was intended to solve again. --karl, | ||
| 2400 | % nathan@acm.org, 20apr99. | ||
| 2401 | \let\tab=&% | ||
| 2402 | \let\startfootins=\startsavedfootnote | ||
| 2403 | \tolerance=9500 | ||
| 2404 | \hbadness=9500 | ||
| 2405 | \setmultitablespacing | ||
| 2406 | \parskip=\multitableparskip | ||
| 2407 | \parindent=\multitableparindent | ||
| 2408 | \overfullrule=0pt | ||
| 2409 | \global\colcount=0 | ||
| 2410 | \def\Emultitable{% | ||
| 2411 | \global\setpercentfalse | ||
| 2412 | \crcrwithfootnotes\crcr | ||
| 2413 | \egroup\egroup | ||
| 2414 | }% | ||
| 2415 | % | ||
| 2416 | % To parse everything between @multitable and @item: | ||
| 2417 | \setuptable#1 \endsetuptable | ||
| 2418 | % | ||
| 2419 | % \everycr will reset column counter, \colcount, at the end of | ||
| 2420 | % each line. Every column entry will cause \colcount to advance by one. | ||
| 2421 | % The table preamble | ||
| 2422 | % looks at the current \colcount to find the correct column width. | ||
| 2423 | \everycr{\noalign{% | ||
| 2424 | % | ||
| 2425 | % \filbreak%% keeps underfull box messages off when table breaks over pages. | ||
| 2426 | % Maybe so, but it also creates really weird page breaks when the table | ||
| 2427 | % breaks over pages. Wouldn't \vfil be better? Wait until the problem | ||
| 2428 | % manifests itself, so it can be fixed for real --karl. | ||
| 2429 | \global\colcount=0\relax}}% | ||
| 2430 | % | ||
| 2431 | % This preamble sets up a generic column definition, which will | ||
| 2432 | % be used as many times as user calls for columns. | ||
| 2433 | % \vtop will set a single line and will also let text wrap and | ||
| 2434 | % continue for many paragraphs if desired. | ||
| 2435 | \halign\bgroup&\global\advance\colcount by 1\relax | ||
| 2436 | \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname | ||
| 2437 | % | ||
| 2438 | % In order to keep entries from bumping into each other | ||
| 2439 | % we will add a \leftskip of \multitablecolspace to all columns after | ||
| 2440 | % the first one. | ||
| 2441 | % | ||
| 2442 | % If a template has been used, we will add \multitablecolspace | ||
| 2443 | % to the width of each template entry. | ||
| 2444 | % | ||
| 2445 | % If the user has set preamble in terms of percent of \hsize we will | ||
| 2446 | % use that dimension as the width of the column, and the \leftskip | ||
| 2447 | % will keep entries from bumping into each other. Table will start at | ||
| 2448 | % left margin and final column will justify at right margin. | ||
| 2449 | % | ||
| 2450 | % Make sure we don't inherit \rightskip from the outer environment. | ||
| 2451 | \rightskip=0pt | ||
| 2452 | \ifnum\colcount=1 | ||
| 2453 | % The first column will be indented with the surrounding text. | ||
| 2454 | \advance\hsize by\leftskip | ||
| 2455 | \else | ||
| 2456 | \ifsetpercent \else | ||
| 2457 | % If user has not set preamble in terms of percent of \hsize | ||
| 2458 | % we will advance \hsize by \multitablecolspace. | ||
| 2459 | \advance\hsize by \multitablecolspace | ||
| 2460 | \fi | ||
| 2461 | % In either case we will make \leftskip=\multitablecolspace: | ||
| 2462 | \leftskip=\multitablecolspace | ||
| 2463 | \fi | ||
| 2464 | % Ignoring space at the beginning and end avoids an occasional spurious | ||
| 2465 | % blank line, when TeX decides to break the line at the space before the | ||
| 2466 | % box from the multistrut, so the strut ends up on a line by itself. | ||
| 2467 | % For example: | ||
| 2468 | % @multitable @columnfractions .11 .89 | ||
| 2469 | % @item @code{#} | ||
| 2470 | % @tab Legal holiday which is valid in major parts of the whole country. | ||
| 2471 | % Is automatically provided with highlighting sequences respectively marking | ||
| 2472 | % characters. | ||
| 2473 | \noindent\ignorespaces##\unskip\multistrut}\cr | ||
| 2474 | } | ||
| 2475 | |||
| 2476 | \def\setmultitablespacing{% test to see if user has set \multitablelinespace. | ||
| 2477 | % If so, do nothing. If not, give it an appropriate dimension based on | ||
| 2478 | % current baselineskip. | ||
| 2479 | \ifdim\multitablelinespace=0pt | ||
| 2480 | \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip | ||
| 2481 | \global\advance\multitablelinespace by-\ht0 | ||
| 2482 | %% strut to put in table in case some entry doesn't have descenders, | ||
| 2483 | %% to keep lines equally spaced | ||
| 2484 | \let\multistrut = \strut | ||
| 2485 | \else | ||
| 2486 | %% FIXME: what is \box0 supposed to be? | ||
| 2487 | \gdef\multistrut{\vrule height\multitablelinespace depth\dp0 | ||
| 2488 | width0pt\relax} \fi | ||
| 2489 | %% Test to see if parskip is larger than space between lines of | ||
| 2490 | %% table. If not, do nothing. | ||
| 2491 | %% If so, set to same dimension as multitablelinespace. | ||
| 2492 | \ifdim\multitableparskip>\multitablelinespace | ||
| 2493 | \global\multitableparskip=\multitablelinespace | ||
| 2494 | \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller | ||
| 2495 | %% than skip between lines in the table. | ||
| 2496 | \fi% | ||
| 2497 | \ifdim\multitableparskip=0pt | ||
| 2498 | \global\multitableparskip=\multitablelinespace | ||
| 2499 | \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller | ||
| 2500 | %% than skip between lines in the table. | ||
| 2501 | \fi} | ||
| 2502 | |||
| 2503 | % In case a @footnote appears inside an alignment, save the footnote | ||
| 2504 | % text to a box and make the \insert when a row of the table is | ||
| 2505 | % finished. Otherwise, the insertion is lost, it never migrates to the | ||
| 2506 | % main vertical list. --kasal, 22jan03. | ||
| 2507 | % | ||
| 2508 | \newbox\savedfootnotes | ||
| 2509 | % | ||
| 2510 | % \dotable \let's \startfootins to this, so that \dofootnote will call | ||
| 2511 | % it instead of starting the insertion right away. | ||
| 2512 | \def\startsavedfootnote{% | ||
| 2513 | \global\setbox\savedfootnotes = \vbox\bgroup | ||
| 2514 | \unvbox\savedfootnotes | ||
| 2515 | } | ||
| 2516 | \def\crcrwithfootnotes{% | ||
| 2517 | \crcr | ||
| 2518 | \ifvoid\savedfootnotes \else | ||
| 2519 | \noalign{\insert\footins{\box\savedfootnotes}}% | ||
| 2520 | \fi | ||
| 2521 | } | ||
| 2522 | |||
| 2523 | \message{conditionals,} | ||
| 2524 | % Prevent errors for section commands. | ||
| 2525 | % Used in @ignore and in failing conditionals. | ||
| 2526 | \def\ignoresections{% | ||
| 2527 | \let\chapter=\relax | ||
| 2528 | \let\unnumbered=\relax | ||
| 2529 | \let\top=\relax | ||
| 2530 | \let\unnumberedsec=\relax | ||
| 2531 | \let\unnumberedsection=\relax | ||
| 2532 | \let\unnumberedsubsec=\relax | ||
| 2533 | \let\unnumberedsubsection=\relax | ||
| 2534 | \let\unnumberedsubsubsec=\relax | ||
| 2535 | \let\unnumberedsubsubsection=\relax | ||
| 2536 | \let\section=\relax | ||
| 2537 | \let\subsec=\relax | ||
| 2538 | \let\subsubsec=\relax | ||
| 2539 | \let\subsection=\relax | ||
| 2540 | \let\subsubsection=\relax | ||
| 2541 | \let\appendix=\relax | ||
| 2542 | \let\appendixsec=\relax | ||
| 2543 | \let\appendixsection=\relax | ||
| 2544 | \let\appendixsubsec=\relax | ||
| 2545 | \let\appendixsubsection=\relax | ||
| 2546 | \let\appendixsubsubsec=\relax | ||
| 2547 | \let\appendixsubsubsection=\relax | ||
| 2548 | \let\contents=\relax | ||
| 2549 | \let\smallbook=\relax | ||
| 2550 | \let\titlepage=\relax | ||
| 2551 | } | ||
| 2552 | |||
| 2553 | % Used in nested conditionals, where we have to parse the Texinfo source | ||
| 2554 | % and so want to turn off most commands, in case they are used | ||
| 2555 | % incorrectly. | ||
| 2556 | % | ||
| 2557 | % We use \empty instead of \relax for the @def... commands, so that \end | ||
| 2558 | % doesn't throw an error. For instance: | ||
| 2559 | % @ignore | ||
| 2560 | % @deffn ... | ||
| 2561 | % @end deffn | ||
| 2562 | % @end ignore | ||
| 2563 | % | ||
| 2564 | % The @end deffn is going to get expanded, because we're trying to allow | ||
| 2565 | % nested conditionals. But we don't want to expand the actual @deffn, | ||
| 2566 | % since it might be syntactically correct and intended to be ignored. | ||
| 2567 | % Since \end checks for \relax, using \empty does not cause an error. | ||
| 2568 | % | ||
| 2569 | \def\ignoremorecommands{% | ||
| 2570 | \let\defcodeindex = \relax | ||
| 2571 | \let\defcv = \empty | ||
| 2572 | \let\defcvx = \empty | ||
| 2573 | \let\Edefcv = \empty | ||
| 2574 | \let\deffn = \empty | ||
| 2575 | \let\deffnx = \empty | ||
| 2576 | \let\Edeffn = \empty | ||
| 2577 | \let\defindex = \relax | ||
| 2578 | \let\defivar = \empty | ||
| 2579 | \let\defivarx = \empty | ||
| 2580 | \let\Edefivar = \empty | ||
| 2581 | \let\defmac = \empty | ||
| 2582 | \let\defmacx = \empty | ||
| 2583 | \let\Edefmac = \empty | ||
| 2584 | \let\defmethod = \empty | ||
| 2585 | \let\defmethodx = \empty | ||
| 2586 | \let\Edefmethod = \empty | ||
| 2587 | \let\defop = \empty | ||
| 2588 | \let\defopx = \empty | ||
| 2589 | \let\Edefop = \empty | ||
| 2590 | \let\defopt = \empty | ||
| 2591 | \let\defoptx = \empty | ||
| 2592 | \let\Edefopt = \empty | ||
| 2593 | \let\defspec = \empty | ||
| 2594 | \let\defspecx = \empty | ||
| 2595 | \let\Edefspec = \empty | ||
| 2596 | \let\deftp = \empty | ||
| 2597 | \let\deftpx = \empty | ||
| 2598 | \let\Edeftp = \empty | ||
| 2599 | \let\deftypefn = \empty | ||
| 2600 | \let\deftypefnx = \empty | ||
| 2601 | \let\Edeftypefn = \empty | ||
| 2602 | \let\deftypefun = \empty | ||
| 2603 | \let\deftypefunx = \empty | ||
| 2604 | \let\Edeftypefun = \empty | ||
| 2605 | \let\deftypeivar = \empty | ||
| 2606 | \let\deftypeivarx = \empty | ||
| 2607 | \let\Edeftypeivar = \empty | ||
| 2608 | \let\deftypemethod = \empty | ||
| 2609 | \let\deftypemethodx = \empty | ||
| 2610 | \let\Edeftypemethod = \empty | ||
| 2611 | \let\deftypeop = \empty | ||
| 2612 | \let\deftypeopx = \empty | ||
| 2613 | \let\Edeftypeop = \empty | ||
| 2614 | \let\deftypevar = \empty | ||
| 2615 | \let\deftypevarx = \empty | ||
| 2616 | \let\Edeftypevar = \empty | ||
| 2617 | \let\deftypevr = \empty | ||
| 2618 | \let\deftypevrx = \empty | ||
| 2619 | \let\Edeftypevr = \empty | ||
| 2620 | \let\defun = \empty | ||
| 2621 | \let\defunx = \empty | ||
| 2622 | \let\Edefun = \empty | ||
| 2623 | \let\defvar = \empty | ||
| 2624 | \let\defvarx = \empty | ||
| 2625 | \let\Edefvar = \empty | ||
| 2626 | \let\defvr = \empty | ||
| 2627 | \let\defvrx = \empty | ||
| 2628 | \let\Edefvr = \empty | ||
| 2629 | \let\clear = \relax | ||
| 2630 | \let\down = \relax | ||
| 2631 | \let\evenfooting = \relax | ||
| 2632 | \let\evenheading = \relax | ||
| 2633 | \let\everyfooting = \relax | ||
| 2634 | \let\everyheading = \relax | ||
| 2635 | \let\headings = \relax | ||
| 2636 | \let\include = \relax | ||
| 2637 | \let\item = \relax | ||
| 2638 | \let\lowersections = \relax | ||
| 2639 | \let\oddfooting = \relax | ||
| 2640 | \let\oddheading = \relax | ||
| 2641 | \let\printindex = \relax | ||
| 2642 | \let\pxref = \relax | ||
| 2643 | \let\raisesections = \relax | ||
| 2644 | \let\ref = \relax | ||
| 2645 | \let\set = \relax | ||
| 2646 | \let\setchapternewpage = \relax | ||
| 2647 | \let\setchapterstyle = \relax | ||
| 2648 | \let\settitle = \relax | ||
| 2649 | \let\up = \relax | ||
| 2650 | \let\verbatiminclude = \relax | ||
| 2651 | \let\xref = \relax | ||
| 2652 | } | ||
| 2653 | |||
| 2654 | % Ignore @ignore, @ifhtml, @ifinfo, and the like. | ||
| 2655 | % | ||
| 2656 | \def\direntry{\doignore{direntry}} | ||
| 2657 | \def\documentdescriptionword{documentdescription} | ||
| 2658 | \def\documentdescription{\doignore{documentdescription}} | ||
| 2659 | \def\html{\doignore{html}} | ||
| 2660 | \def\ifhtml{\doignore{ifhtml}} | ||
| 2661 | \def\ifinfo{\doignore{ifinfo}} | ||
| 2662 | \def\ifnottex{\nestedignore{ifnottex}} | ||
| 2663 | \def\ifplaintext{\doignore{ifplaintext}} | ||
| 2664 | \def\ifxml{\doignore{ifxml}} | ||
| 2665 | \def\ignore{\doignore{ignore}} | ||
| 2666 | \def\menu{\doignore{menu}} | ||
| 2667 | \def\xml{\doignore{xml}} | ||
| 2668 | |||
| 2669 | % @dircategory CATEGORY -- specify a category of the dir file | ||
| 2670 | % which this file should belong to. Ignore this in TeX. | ||
| 2671 | \let\dircategory = \comment | ||
| 2672 | |||
| 2673 | % Ignore text until a line `@end #1'. | ||
| 2674 | % | ||
| 2675 | \def\doignore#1{\begingroup | ||
| 2676 | % Don't complain about control sequences we have declared \outer. | ||
| 2677 | \ignoresections | ||
| 2678 | % | ||
| 2679 | % Define a command to swallow text until we reach `@end #1'. | ||
| 2680 | % This @ is a catcode 12 token (that is the normal catcode of @ in | ||
| 2681 | % this texinfo.tex file). We change the catcode of @ below to match. | ||
| 2682 | \long\def\doignoretext##1@end #1{\enddoignore}% | ||
| 2683 | % | ||
| 2684 | % Make sure that spaces turn into tokens that match what \doignoretext wants. | ||
| 2685 | \catcode\spaceChar = 10 | ||
| 2686 | % | ||
| 2687 | % Ignore braces, too, so mismatched braces don't cause trouble. | ||
| 2688 | \catcode`\{ = 9 | ||
| 2689 | \catcode`\} = 9 | ||
| 2690 | % | ||
| 2691 | % We must not have @c interpreted as a control sequence. | ||
| 2692 | \catcode`\@ = 12 | ||
| 2693 | % | ||
| 2694 | \def\ignoreword{#1}% | ||
| 2695 | \ifx\ignoreword\documentdescriptionword | ||
| 2696 | % The c kludge breaks documentdescription, since | ||
| 2697 | % `documentdescription' contains a `c'. Means not everything will | ||
| 2698 | % be ignored inside @documentdescription, but oh well... | ||
| 2699 | \else | ||
| 2700 | % Make the letter c a comment character so that the rest of the line | ||
| 2701 | % will be ignored. This way, the document can have (for example) | ||
| 2702 | % @c @end ifinfo | ||
| 2703 | % and the @end ifinfo will be properly ignored. | ||
| 2704 | % (We've just changed @ to catcode 12.) | ||
| 2705 | \catcode`\c = 14 | ||
| 2706 | \fi | ||
| 2707 | % | ||
| 2708 | % And now expand the command defined above. | ||
| 2709 | \doignoretext | ||
| 2710 | } | ||
| 2711 | |||
| 2712 | % What we do to finish off ignored text. | ||
| 2713 | % | ||
| 2714 | \def\enddoignore{\endgroup\ignorespaces}% | ||
| 2715 | |||
| 2716 | \newif\ifwarnedobs\warnedobsfalse | ||
| 2717 | \def\obstexwarn{% | ||
| 2718 | \ifwarnedobs\relax\else | ||
| 2719 | % We need to warn folks that they may have trouble with TeX 3.0. | ||
| 2720 | % This uses \immediate\write16 rather than \message to get newlines. | ||
| 2721 | \immediate\write16{} | ||
| 2722 | \immediate\write16{WARNING: for users of Unix TeX 3.0!} | ||
| 2723 | \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} | ||
| 2724 | \immediate\write16{If you are running another version of TeX, relax.} | ||
| 2725 | \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} | ||
| 2726 | \immediate\write16{ Then upgrade your TeX installation if you can.} | ||
| 2727 | \immediate\write16{ (See ftp://ftp.gnu.org/non-gnu/TeX.README.)} | ||
| 2728 | \immediate\write16{If you are stuck with version 3.0, run the} | ||
| 2729 | \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} | ||
| 2730 | \immediate\write16{ to use a workaround.} | ||
| 2731 | \immediate\write16{} | ||
| 2732 | \global\warnedobstrue | ||
| 2733 | \fi | ||
| 2734 | } | ||
| 2735 | |||
| 2736 | % **In TeX 3.0, setting text in \nullfont hangs tex. For a | ||
| 2737 | % workaround (which requires the file ``dummy.tfm'' to be installed), | ||
| 2738 | % uncomment the following line: | ||
| 2739 | %%%%%\font\nullfont=dummy\let\obstexwarn=\relax | ||
| 2740 | |||
| 2741 | % Ignore text, except that we keep track of conditional commands for | ||
| 2742 | % purposes of nesting, up to an `@end #1' command. | ||
| 2743 | % | ||
| 2744 | \def\nestedignore#1{% | ||
| 2745 | \obstexwarn | ||
| 2746 | % We must actually expand the ignored text to look for the @end | ||
| 2747 | % command, so that nested ignore constructs work. Thus, we put the | ||
| 2748 | % text into a \vbox and then do nothing with the result. To minimize | ||
| 2749 | % the chance of memory overflow, we follow the approach outlined on | ||
| 2750 | % page 401 of the TeXbook. | ||
| 2751 | % | ||
| 2752 | \setbox0 = \vbox\bgroup | ||
| 2753 | % Don't complain about control sequences we have declared \outer. | ||
| 2754 | \ignoresections | ||
| 2755 | % | ||
| 2756 | % Define `@end #1' to end the box, which will in turn undefine the | ||
| 2757 | % @end command again. | ||
| 2758 | \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% | ||
| 2759 | % | ||
| 2760 | % We are going to be parsing Texinfo commands. Most cause no | ||
| 2761 | % trouble when they are used incorrectly, but some commands do | ||
| 2762 | % complicated argument parsing or otherwise get confused, so we | ||
| 2763 | % undefine them. | ||
| 2764 | % | ||
| 2765 | % We can't do anything about stray @-signs, unfortunately; | ||
| 2766 | % they'll produce `undefined control sequence' errors. | ||
| 2767 | \ignoremorecommands | ||
| 2768 | % | ||
| 2769 | % Set the current font to be \nullfont, a TeX primitive, and define | ||
| 2770 | % all the font commands to also use \nullfont. We don't use | ||
| 2771 | % dummy.tfm, as suggested in the TeXbook, because some sites | ||
| 2772 | % might not have that installed. Therefore, math mode will still | ||
| 2773 | % produce output, but that should be an extremely small amount of | ||
| 2774 | % stuff compared to the main input. | ||
| 2775 | % | ||
| 2776 | \nullfont | ||
| 2777 | \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont | ||
| 2778 | \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont | ||
| 2779 | \let\tensf=\nullfont | ||
| 2780 | % Similarly for index fonts. | ||
| 2781 | \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont | ||
| 2782 | \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont | ||
| 2783 | \let\smallsf=\nullfont | ||
| 2784 | % Similarly for smallexample fonts. | ||
| 2785 | \let\smallerrm=\nullfont \let\smallerit=\nullfont \let\smallersl=\nullfont | ||
| 2786 | \let\smallerbf=\nullfont \let\smallertt=\nullfont \let\smallersc=\nullfont | ||
| 2787 | \let\smallersf=\nullfont | ||
| 2788 | % | ||
| 2789 | % Don't complain when characters are missing from the fonts. | ||
| 2790 | \tracinglostchars = 0 | ||
| 2791 | % | ||
| 2792 | % Don't bother to do space factor calculations. | ||
| 2793 | \frenchspacing | ||
| 2794 | % | ||
| 2795 | % Don't report underfull hboxes. | ||
| 2796 | \hbadness = 10000 | ||
| 2797 | % | ||
| 2798 | % Do minimal line-breaking. | ||
| 2799 | \pretolerance = 10000 | ||
| 2800 | % | ||
| 2801 | % Do not execute instructions in @tex. | ||
| 2802 | \def\tex{\doignore{tex}}% | ||
| 2803 | % Do not execute macro definitions. | ||
| 2804 | % `c' is a comment character, so the word `macro' will get cut off. | ||
| 2805 | \def\macro{\doignore{ma}}% | ||
| 2806 | } | ||
| 2807 | |||
| 2808 | % @set VAR sets the variable VAR to an empty value. | ||
| 2809 | % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. | ||
| 2810 | % | ||
| 2811 | % Since we want to separate VAR from REST-OF-LINE (which might be | ||
| 2812 | % empty), we can't just use \parsearg; we have to insert a space of our | ||
| 2813 | % own to delimit the rest of the line, and then take it out again if we | ||
| 2814 | % didn't need it. Make sure the catcode of space is correct to avoid | ||
| 2815 | % losing inside @example, for instance. | ||
| 2816 | % | ||
| 2817 | \def\set{\begingroup\catcode` =10 | ||
| 2818 | \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. | ||
| 2819 | \parsearg\setxxx} | ||
| 2820 | \def\setxxx#1{\setyyy#1 \endsetyyy} | ||
| 2821 | \def\setyyy#1 #2\endsetyyy{% | ||
| 2822 | \def\temp{#2}% | ||
| 2823 | \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty | ||
| 2824 | \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. | ||
| 2825 | \fi | ||
| 2826 | \endgroup | ||
| 2827 | } | ||
| 2828 | % Can't use \xdef to pre-expand #2 and save some time, since \temp or | ||
| 2829 | % \next or other control sequences that we've defined might get us into | ||
| 2830 | % an infinite loop. Consider `@set foo @cite{bar}'. | ||
| 2831 | \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} | ||
| 2832 | |||
| 2833 | % @clear VAR clears (i.e., unsets) the variable VAR. | ||
| 2834 | % | ||
| 2835 | \def\clear{\parsearg\clearxxx} | ||
| 2836 | \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} | ||
| 2837 | |||
| 2838 | % @value{foo} gets the text saved in variable foo. | ||
| 2839 | { | ||
| 2840 | \catcode`\_ = \active | ||
| 2841 | % | ||
| 2842 | % We might end up with active _ or - characters in the argument if | ||
| 2843 | % we're called from @code, as @code{@value{foo-bar_}}. So \let any | ||
| 2844 | % such active characters to their normal equivalents. | ||
| 2845 | \gdef\value{\begingroup | ||
| 2846 | \catcode`\-=\other \catcode`\_=\other | ||
| 2847 | \indexbreaks \let_\normalunderscore | ||
| 2848 | \valuexxx} | ||
| 2849 | } | ||
| 2850 | \def\valuexxx#1{\expandablevalue{#1}\endgroup} | ||
| 2851 | |||
| 2852 | % We have this subroutine so that we can handle at least some @value's | ||
| 2853 | % properly in indexes (we \let\value to this in \indexdummies). Ones | ||
| 2854 | % whose names contain - or _ still won't work, but we can't do anything | ||
| 2855 | % about that. The command has to be fully expandable (if the variable | ||
| 2856 | % is set), since the result winds up in the index file. This means that | ||
| 2857 | % if the variable's value contains other Texinfo commands, it's almost | ||
| 2858 | % certain it will fail (although perhaps we could fix that with | ||
| 2859 | % sufficient work to do a one-level expansion on the result, instead of | ||
| 2860 | % complete). | ||
| 2861 | % | ||
| 2862 | \def\expandablevalue#1{% | ||
| 2863 | \expandafter\ifx\csname SET#1\endcsname\relax | ||
| 2864 | {[No value for ``#1'']}% | ||
| 2865 | \message{Variable `#1', used in @value, is not set.}% | ||
| 2866 | \else | ||
| 2867 | \csname SET#1\endcsname | ||
| 2868 | \fi | ||
| 2869 | } | ||
| 2870 | |||
| 2871 | % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined | ||
| 2872 | % with @set. | ||
| 2873 | % | ||
| 2874 | \def\ifset{\parsearg\doifset} | ||
| 2875 | \def\doifset#1{% | ||
| 2876 | \expandafter\ifx\csname SET#1\endcsname\relax | ||
| 2877 | \let\next=\ifsetfail | ||
| 2878 | \else | ||
| 2879 | \let\next=\ifsetsucceed | ||
| 2880 | \fi | ||
| 2881 | \next | ||
| 2882 | } | ||
| 2883 | \def\ifsetsucceed{\conditionalsucceed{ifset}} | ||
| 2884 | \def\ifsetfail{\nestedignore{ifset}} | ||
| 2885 | \defineunmatchedend{ifset} | ||
| 2886 | |||
| 2887 | % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been | ||
| 2888 | % defined with @set, or has been undefined with @clear. | ||
| 2889 | % | ||
| 2890 | \def\ifclear{\parsearg\doifclear} | ||
| 2891 | \def\doifclear#1{% | ||
| 2892 | \expandafter\ifx\csname SET#1\endcsname\relax | ||
| 2893 | \let\next=\ifclearsucceed | ||
| 2894 | \else | ||
| 2895 | \let\next=\ifclearfail | ||
| 2896 | \fi | ||
| 2897 | \next | ||
| 2898 | } | ||
| 2899 | \def\ifclearsucceed{\conditionalsucceed{ifclear}} | ||
| 2900 | \def\ifclearfail{\nestedignore{ifclear}} | ||
| 2901 | \defineunmatchedend{ifclear} | ||
| 2902 | |||
| 2903 | % @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we | ||
| 2904 | % read the text following, through the first @end iftex (etc.). Make | ||
| 2905 | % `@end iftex' (etc.) valid only after an @iftex. | ||
| 2906 | % | ||
| 2907 | \def\iftex{\conditionalsucceed{iftex}} | ||
| 2908 | \def\ifnothtml{\conditionalsucceed{ifnothtml}} | ||
| 2909 | \def\ifnotinfo{\conditionalsucceed{ifnotinfo}} | ||
| 2910 | \def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}} | ||
| 2911 | \defineunmatchedend{iftex} | ||
| 2912 | \defineunmatchedend{ifnothtml} | ||
| 2913 | \defineunmatchedend{ifnotinfo} | ||
| 2914 | \defineunmatchedend{ifnotplaintext} | ||
| 2915 | |||
| 2916 | % True conditional. Since \set globally defines its variables, we can | ||
| 2917 | % just start and end a group (to keep the @end definition undefined at | ||
| 2918 | % the outer level). | ||
| 2919 | % | ||
| 2920 | \def\conditionalsucceed#1{\begingroup | ||
| 2921 | \expandafter\def\csname E#1\endcsname{\endgroup}% | ||
| 2922 | } | ||
| 2923 | |||
| 2924 | % @defininfoenclose. | ||
| 2925 | \let\definfoenclose=\comment | ||
| 2926 | |||
| 2927 | |||
| 2928 | \message{indexing,} | ||
| 2929 | % Index generation facilities | ||
| 2930 | |||
| 2931 | % Define \newwrite to be identical to plain tex's \newwrite | ||
| 2932 | % except not \outer, so it can be used within \newindex. | ||
| 2933 | {\catcode`\@=11 | ||
| 2934 | \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} | ||
| 2935 | |||
| 2936 | % \newindex {foo} defines an index named foo. | ||
| 2937 | % It automatically defines \fooindex such that | ||
| 2938 | % \fooindex ...rest of line... puts an entry in the index foo. | ||
| 2939 | % It also defines \fooindfile to be the number of the output channel for | ||
| 2940 | % the file that accumulates this index. The file's extension is foo. | ||
| 2941 | % The name of an index should be no more than 2 characters long | ||
| 2942 | % for the sake of vms. | ||
| 2943 | % | ||
| 2944 | \def\newindex#1{% | ||
| 2945 | \iflinks | ||
| 2946 | \expandafter\newwrite \csname#1indfile\endcsname | ||
| 2947 | \openout \csname#1indfile\endcsname \jobname.#1 % Open the file | ||
| 2948 | \fi | ||
| 2949 | \expandafter\xdef\csname#1index\endcsname{% % Define @#1index | ||
| 2950 | \noexpand\doindex{#1}} | ||
| 2951 | } | ||
| 2952 | |||
| 2953 | % @defindex foo == \newindex{foo} | ||
| 2954 | % | ||
| 2955 | \def\defindex{\parsearg\newindex} | ||
| 2956 | |||
| 2957 | % Define @defcodeindex, like @defindex except put all entries in @code. | ||
| 2958 | % | ||
| 2959 | \def\defcodeindex{\parsearg\newcodeindex} | ||
| 2960 | % | ||
| 2961 | \def\newcodeindex#1{% | ||
| 2962 | \iflinks | ||
| 2963 | \expandafter\newwrite \csname#1indfile\endcsname | ||
| 2964 | \openout \csname#1indfile\endcsname \jobname.#1 | ||
| 2965 | \fi | ||
| 2966 | \expandafter\xdef\csname#1index\endcsname{% | ||
| 2967 | \noexpand\docodeindex{#1}}% | ||
| 2968 | } | ||
| 2969 | |||
| 2970 | |||
| 2971 | % @synindex foo bar makes index foo feed into index bar. | ||
| 2972 | % Do this instead of @defindex foo if you don't want it as a separate index. | ||
| 2973 | % | ||
| 2974 | % @syncodeindex foo bar similar, but put all entries made for index foo | ||
| 2975 | % inside @code. | ||
| 2976 | % | ||
| 2977 | \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} | ||
| 2978 | \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} | ||
| 2979 | |||
| 2980 | % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), | ||
| 2981 | % #3 the target index (bar). | ||
| 2982 | \def\dosynindex#1#2#3{% | ||
| 2983 | % Only do \closeout if we haven't already done it, else we'll end up | ||
| 2984 | % closing the target index. | ||
| 2985 | \expandafter \ifx\csname donesynindex#2\endcsname \undefined | ||
| 2986 | % The \closeout helps reduce unnecessary open files; the limit on the | ||
| 2987 | % Acorn RISC OS is a mere 16 files. | ||
| 2988 | \expandafter\closeout\csname#2indfile\endcsname | ||
| 2989 | \expandafter\let\csname\donesynindex#2\endcsname = 1 | ||
| 2990 | \fi | ||
| 2991 | % redefine \fooindfile: | ||
| 2992 | \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname | ||
| 2993 | \expandafter\let\csname#2indfile\endcsname=\temp | ||
| 2994 | % redefine \fooindex: | ||
| 2995 | \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% | ||
| 2996 | } | ||
| 2997 | |||
| 2998 | % Define \doindex, the driver for all \fooindex macros. | ||
| 2999 | % Argument #1 is generated by the calling \fooindex macro, | ||
| 3000 | % and it is "foo", the name of the index. | ||
| 3001 | |||
| 3002 | % \doindex just uses \parsearg; it calls \doind for the actual work. | ||
| 3003 | % This is because \doind is more useful to call from other macros. | ||
| 3004 | |||
| 3005 | % There is also \dosubind {index}{topic}{subtopic} | ||
| 3006 | % which makes an entry in a two-level index such as the operation index. | ||
| 3007 | |||
| 3008 | \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} | ||
| 3009 | \def\singleindexer #1{\doind{\indexname}{#1}} | ||
| 3010 | |||
| 3011 | % like the previous two, but they put @code around the argument. | ||
| 3012 | \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} | ||
| 3013 | \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} | ||
| 3014 | |||
| 3015 | % Take care of Texinfo commands that can appear in an index entry. | ||
| 3016 | % Since there are some commands we want to expand, and others we don't, | ||
| 3017 | % we have to laboriously prevent expansion for those that we don't. | ||
| 3018 | % | ||
| 3019 | \def\indexdummies{% | ||
| 3020 | \def\@{@}% change to @@ when we switch to @ as escape char in index files. | ||
| 3021 | \def\ {\realbackslash\space }% | ||
| 3022 | % Need these in case \tex is in effect and \{ is a \delimiter again. | ||
| 3023 | % But can't use \lbracecmd and \rbracecmd because texindex assumes | ||
| 3024 | % braces and backslashes are used only as delimiters. | ||
| 3025 | \let\{ = \mylbrace | ||
| 3026 | \let\} = \myrbrace | ||
| 3027 | % | ||
| 3028 | % \definedummyword defines \#1 as \realbackslash #1\space, thus | ||
| 3029 | % effectively preventing its expansion. This is used only for control | ||
| 3030 | % words, not control letters, because the \space would be incorrect | ||
| 3031 | % for control characters, but is needed to separate the control word | ||
| 3032 | % from whatever follows. | ||
| 3033 | % | ||
| 3034 | % For control letters, we have \definedummyletter, which omits the | ||
| 3035 | % space. | ||
| 3036 | % | ||
| 3037 | % These can be used both for control words that take an argument and | ||
| 3038 | % those that do not. If it is followed by {arg} in the input, then | ||
| 3039 | % that will dutifully get written to the index (or wherever). | ||
| 3040 | % | ||
| 3041 | \def\definedummyword##1{% | ||
| 3042 | \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}% | ||
| 3043 | }% | ||
| 3044 | \def\definedummyletter##1{% | ||
| 3045 | \expandafter\def\csname ##1\endcsname{\realbackslash ##1}% | ||
| 3046 | }% | ||
| 3047 | % | ||
| 3048 | % Do the redefinitions. | ||
| 3049 | \commondummies | ||
| 3050 | } | ||
| 3051 | |||
| 3052 | % For the aux file, @ is the escape character. So we want to redefine | ||
| 3053 | % everything using @ instead of \realbackslash. When everything uses | ||
| 3054 | % @, this will be simpler. | ||
| 3055 | % | ||
| 3056 | \def\atdummies{% | ||
| 3057 | \def\@{@@}% | ||
| 3058 | \def\ {@ }% | ||
| 3059 | \let\{ = \lbraceatcmd | ||
| 3060 | \let\} = \rbraceatcmd | ||
| 3061 | % | ||
| 3062 | % (See comments in \indexdummies.) | ||
| 3063 | \def\definedummyword##1{% | ||
| 3064 | \expandafter\def\csname ##1\endcsname{@##1\space}% | ||
| 3065 | }% | ||
| 3066 | \def\definedummyletter##1{% | ||
| 3067 | \expandafter\def\csname ##1\endcsname{@##1}% | ||
| 3068 | }% | ||
| 3069 | % | ||
| 3070 | % Do the redefinitions. | ||
| 3071 | \commondummies | ||
| 3072 | } | ||
| 3073 | |||
| 3074 | % Called from \indexdummies and \atdummies. \definedummyword and | ||
| 3075 | % \definedummyletter must be defined first. | ||
| 3076 | % | ||
| 3077 | \def\commondummies{% | ||
| 3078 | % | ||
| 3079 | \normalturnoffactive | ||
| 3080 | % | ||
| 3081 | % Control letters and accents. | ||
| 3082 | \definedummyletter{_}% | ||
| 3083 | \definedummyletter{,}% | ||
| 3084 | \definedummyletter{"}% | ||
| 3085 | \definedummyletter{`}% | ||
| 3086 | \definedummyletter{'}% | ||
| 3087 | \definedummyletter{^}% | ||
| 3088 | \definedummyletter{~}% | ||
| 3089 | \definedummyletter{=}% | ||
| 3090 | \definedummyword{u}% | ||
| 3091 | \definedummyword{v}% | ||
| 3092 | \definedummyword{H}% | ||
| 3093 | \definedummyword{dotaccent}% | ||
| 3094 | \definedummyword{ringaccent}% | ||
| 3095 | \definedummyword{tieaccent}% | ||
| 3096 | \definedummyword{ubaraccent}% | ||
| 3097 | \definedummyword{udotaccent}% | ||
| 3098 | \definedummyword{dotless}% | ||
| 3099 | % | ||
| 3100 | % Other non-English letters. | ||
| 3101 | \definedummyword{AA}% | ||
| 3102 | \definedummyword{AE}% | ||
| 3103 | \definedummyword{L}% | ||
| 3104 | \definedummyword{OE}% | ||
| 3105 | \definedummyword{O}% | ||
| 3106 | \definedummyword{aa}% | ||
| 3107 | \definedummyword{ae}% | ||
| 3108 | \definedummyword{l}% | ||
| 3109 | \definedummyword{oe}% | ||
| 3110 | \definedummyword{o}% | ||
| 3111 | \definedummyword{ss}% | ||
| 3112 | % | ||
| 3113 | % Although these internal commands shouldn't show up, sometimes they do. | ||
| 3114 | \definedummyword{bf}% | ||
| 3115 | \definedummyword{gtr}% | ||
| 3116 | \definedummyword{hat}% | ||
| 3117 | \definedummyword{less}% | ||
| 3118 | \definedummyword{sf}% | ||
| 3119 | \definedummyword{sl}% | ||
| 3120 | \definedummyword{tclose}% | ||
| 3121 | \definedummyword{tt}% | ||
| 3122 | % | ||
| 3123 | % Texinfo font commands. | ||
| 3124 | \definedummyword{b}% | ||
| 3125 | \definedummyword{i}% | ||
| 3126 | \definedummyword{r}% | ||
| 3127 | \definedummyword{sc}% | ||
| 3128 | \definedummyword{t}% | ||
| 3129 | % | ||
| 3130 | \definedummyword{TeX}% | ||
| 3131 | \definedummyword{acronym}% | ||
| 3132 | \definedummyword{cite}% | ||
| 3133 | \definedummyword{code}% | ||
| 3134 | \definedummyword{command}% | ||
| 3135 | \definedummyword{dfn}% | ||
| 3136 | \definedummyword{dots}% | ||
| 3137 | \definedummyword{emph}% | ||
| 3138 | \definedummyword{env}% | ||
| 3139 | \definedummyword{file}% | ||
| 3140 | \definedummyword{kbd}% | ||
| 3141 | \definedummyword{key}% | ||
| 3142 | \definedummyword{math}% | ||
| 3143 | \definedummyword{option}% | ||
| 3144 | \definedummyword{samp}% | ||
| 3145 | \definedummyword{strong}% | ||
| 3146 | \definedummyword{uref}% | ||
| 3147 | \definedummyword{url}% | ||
| 3148 | \definedummyword{var}% | ||
| 3149 | \definedummyword{w}% | ||
| 3150 | % | ||
| 3151 | % Assorted special characters. | ||
| 3152 | \definedummyword{bullet}% | ||
| 3153 | \definedummyword{copyright}% | ||
| 3154 | \definedummyword{dots}% | ||
| 3155 | \definedummyword{enddots}% | ||
| 3156 | \definedummyword{equiv}% | ||
| 3157 | \definedummyword{error}% | ||
| 3158 | \definedummyword{expansion}% | ||
| 3159 | \definedummyword{minus}% | ||
| 3160 | \definedummyword{pounds}% | ||
| 3161 | \definedummyword{point}% | ||
| 3162 | \definedummyword{print}% | ||
| 3163 | \definedummyword{result}% | ||
| 3164 | % | ||
| 3165 | % Handle some cases of @value -- where the variable name does not | ||
| 3166 | % contain - or _, and the value does not contain any | ||
| 3167 | % (non-fully-expandable) commands. | ||
| 3168 | \let\value = \expandablevalue | ||
| 3169 | % | ||
| 3170 | % Normal spaces, not active ones. | ||
| 3171 | \unsepspaces | ||
| 3172 | % | ||
| 3173 | % No macro expansion. | ||
| 3174 | \turnoffmacros | ||
| 3175 | } | ||
| 3176 | |||
| 3177 | % If an index command is used in an @example environment, any spaces | ||
| 3178 | % therein should become regular spaces in the raw index file, not the | ||
| 3179 | % expansion of \tie (\leavevmode \penalty \@M \ ). | ||
| 3180 | {\obeyspaces | ||
| 3181 | \gdef\unsepspaces{\obeyspaces\let =\space}} | ||
| 3182 | |||
| 3183 | |||
| 3184 | % \indexnofonts is used when outputting the strings to sort the index | ||
| 3185 | % by, and when constructing control sequence names. It eliminates all | ||
| 3186 | % control sequences and just writes whatever the best ASCII sort string | ||
| 3187 | % would be for a given command (usually its argument). | ||
| 3188 | % | ||
| 3189 | \def\indexdummytex{TeX} | ||
| 3190 | \def\indexdummydots{...} | ||
| 3191 | % | ||
| 3192 | \def\indexnofonts{% | ||
| 3193 | \def\ { }% | ||
| 3194 | \def\@{@}% | ||
| 3195 | % how to handle braces? | ||
| 3196 | \def\_{\normalunderscore}% | ||
| 3197 | % | ||
| 3198 | \let\,=\asis | ||
| 3199 | \let\"=\asis | ||
| 3200 | \let\`=\asis | ||
| 3201 | \let\'=\asis | ||
| 3202 | \let\^=\asis | ||
| 3203 | \let\~=\asis | ||
| 3204 | \let\==\asis | ||
| 3205 | \let\u=\asis | ||
| 3206 | \let\v=\asis | ||
| 3207 | \let\H=\asis | ||
| 3208 | \let\dotaccent=\asis | ||
| 3209 | \let\ringaccent=\asis | ||
| 3210 | \let\tieaccent=\asis | ||
| 3211 | \let\ubaraccent=\asis | ||
| 3212 | \let\udotaccent=\asis | ||
| 3213 | \let\dotless=\asis | ||
| 3214 | % | ||
| 3215 | % Other non-English letters. | ||
| 3216 | \def\AA{AA}% | ||
| 3217 | \def\AE{AE}% | ||
| 3218 | \def\L{L}% | ||
| 3219 | \def\OE{OE}% | ||
| 3220 | \def\O{O}% | ||
| 3221 | \def\aa{aa}% | ||
| 3222 | \def\ae{ae}% | ||
| 3223 | \def\l{l}% | ||
| 3224 | \def\oe{oe}% | ||
| 3225 | \def\o{o}% | ||
| 3226 | \def\ss{ss}% | ||
| 3227 | \def\exclamdown{!}% | ||
| 3228 | \def\questiondown{?}% | ||
| 3229 | % | ||
| 3230 | % Don't no-op \tt, since it isn't a user-level command | ||
| 3231 | % and is used in the definitions of the active chars like <, >, |, etc. | ||
| 3232 | % Likewise with the other plain tex font commands. | ||
| 3233 | %\let\tt=\asis | ||
| 3234 | % | ||
| 3235 | % Texinfo font commands. | ||
| 3236 | \let\b=\asis | ||
| 3237 | \let\i=\asis | ||
| 3238 | \let\r=\asis | ||
| 3239 | \let\sc=\asis | ||
| 3240 | \let\t=\asis | ||
| 3241 | % | ||
| 3242 | \let\TeX=\indexdummytex | ||
| 3243 | \let\acronym=\asis | ||
| 3244 | \let\cite=\asis | ||
| 3245 | \let\code=\asis | ||
| 3246 | \let\command=\asis | ||
| 3247 | \let\dfn=\asis | ||
| 3248 | \let\dots=\indexdummydots | ||
| 3249 | \let\emph=\asis | ||
| 3250 | \let\env=\asis | ||
| 3251 | \let\file=\asis | ||
| 3252 | \let\kbd=\asis | ||
| 3253 | \let\key=\asis | ||
| 3254 | \let\math=\asis | ||
| 3255 | \let\option=\asis | ||
| 3256 | \let\samp=\asis | ||
| 3257 | \let\strong=\asis | ||
| 3258 | \let\uref=\asis | ||
| 3259 | \let\url=\asis | ||
| 3260 | \let\var=\asis | ||
| 3261 | \let\w=\asis | ||
| 3262 | } | ||
| 3263 | |||
| 3264 | \let\indexbackslash=0 %overridden during \printindex. | ||
| 3265 | \let\SETmarginindex=\relax % put index entries in margin (undocumented)? | ||
| 3266 | |||
| 3267 | % For \ifx comparisons. | ||
| 3268 | \def\emptymacro{\empty} | ||
| 3269 | |||
| 3270 | % Most index entries go through here, but \dosubind is the general case. | ||
| 3271 | % | ||
| 3272 | \def\doind#1#2{\dosubind{#1}{#2}\empty} | ||
| 3273 | |||
| 3274 | % Workhorse for all \fooindexes. | ||
| 3275 | % #1 is name of index, #2 is stuff to put there, #3 is subentry -- | ||
| 3276 | % \empty if called from \doind, as we usually are. The main exception | ||
| 3277 | % is with defuns, which call us directly. | ||
| 3278 | % | ||
| 3279 | \def\dosubind#1#2#3{% | ||
| 3280 | % Put the index entry in the margin if desired. | ||
| 3281 | \ifx\SETmarginindex\relax\else | ||
| 3282 | \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% | ||
| 3283 | \fi | ||
| 3284 | {% | ||
| 3285 | \count255=\lastpenalty | ||
| 3286 | {% | ||
| 3287 | \indexdummies % Must do this here, since \bf, etc expand at this stage | ||
| 3288 | \escapechar=`\\ | ||
| 3289 | {% | ||
| 3290 | \let\folio = 0% We will expand all macros now EXCEPT \folio. | ||
| 3291 | \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now | ||
| 3292 | % so it will be output as is; and it will print as backslash. | ||
| 3293 | % | ||
| 3294 | % The main index entry text. | ||
| 3295 | \toks0 = {#2}% | ||
| 3296 | % | ||
| 3297 | % If third arg is present, precede it with space in sort key. | ||
| 3298 | \def\thirdarg{#3}% | ||
| 3299 | \ifx\thirdarg\emptymacro \else | ||
| 3300 | % If the third (subentry) arg is present, add it to the index | ||
| 3301 | % line to write. | ||
| 3302 | \toks0 = \expandafter{\the\toks0 \space #3}% | ||
| 3303 | \fi | ||
| 3304 | % | ||
| 3305 | % Process the index entry with all font commands turned off, to | ||
| 3306 | % get the string to sort by. | ||
| 3307 | {\indexnofonts | ||
| 3308 | \edef\temp{\the\toks0}% need full expansion | ||
| 3309 | \xdef\indexsorttmp{\temp}% | ||
| 3310 | }% | ||
| 3311 | % | ||
| 3312 | % Set up the complete index entry, with both the sort key and | ||
| 3313 | % the original text, including any font commands. We write | ||
| 3314 | % three arguments to \entry to the .?? file (four in the | ||
| 3315 | % subentry case), texindex reduces to two when writing the .??s | ||
| 3316 | % sorted result. | ||
| 3317 | \edef\temp{% | ||
| 3318 | \write\csname#1indfile\endcsname{% | ||
| 3319 | \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% | ||
| 3320 | }% | ||
| 3321 | % | ||
| 3322 | % If a skip is the last thing on the list now, preserve it | ||
| 3323 | % by backing up by \lastskip, doing the \write, then inserting | ||
| 3324 | % the skip again. Otherwise, the whatsit generated by the | ||
| 3325 | % \write will make \lastskip zero. The result is that sequences | ||
| 3326 | % like this: | ||
| 3327 | % @end defun | ||
| 3328 | % @tindex whatever | ||
| 3329 | % @defun ... | ||
| 3330 | % will have extra space inserted, because the \medbreak in the | ||
| 3331 | % start of the @defun won't see the skip inserted by the @end of | ||
| 3332 | % the previous defun. | ||
| 3333 | % | ||
| 3334 | % But don't do any of this if we're not in vertical mode. We | ||
| 3335 | % don't want to do a \vskip and prematurely end a paragraph. | ||
| 3336 | % | ||
| 3337 | % Avoid page breaks due to these extra skips, too. | ||
| 3338 | % | ||
| 3339 | \iflinks | ||
| 3340 | \ifvmode | ||
| 3341 | \skip0 = \lastskip | ||
| 3342 | \ifdim\lastskip = 0pt \else \nobreak\vskip-\skip0 \fi | ||
| 3343 | \fi | ||
| 3344 | % | ||
| 3345 | \temp % do the write | ||
| 3346 | % | ||
| 3347 | \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi | ||
| 3348 | \fi | ||
| 3349 | }% | ||
| 3350 | }% | ||
| 3351 | \penalty\count255 | ||
| 3352 | }% | ||
| 3353 | } | ||
| 3354 | |||
| 3355 | % The index entry written in the file actually looks like | ||
| 3356 | % \entry {sortstring}{page}{topic} | ||
| 3357 | % or | ||
| 3358 | % \entry {sortstring}{page}{topic}{subtopic} | ||
| 3359 | % The texindex program reads in these files and writes files | ||
| 3360 | % containing these kinds of lines: | ||
| 3361 | % \initial {c} | ||
| 3362 | % before the first topic whose initial is c | ||
| 3363 | % \entry {topic}{pagelist} | ||
| 3364 | % for a topic that is used without subtopics | ||
| 3365 | % \primary {topic} | ||
| 3366 | % for the beginning of a topic that is used with subtopics | ||
| 3367 | % \secondary {subtopic}{pagelist} | ||
| 3368 | % for each subtopic. | ||
| 3369 | |||
| 3370 | % Define the user-accessible indexing commands | ||
| 3371 | % @findex, @vindex, @kindex, @cindex. | ||
| 3372 | |||
| 3373 | \def\findex {\fnindex} | ||
| 3374 | \def\kindex {\kyindex} | ||
| 3375 | \def\cindex {\cpindex} | ||
| 3376 | \def\vindex {\vrindex} | ||
| 3377 | \def\tindex {\tpindex} | ||
| 3378 | \def\pindex {\pgindex} | ||
| 3379 | |||
| 3380 | \def\cindexsub {\begingroup\obeylines\cindexsub} | ||
| 3381 | {\obeylines % | ||
| 3382 | \gdef\cindexsub "#1" #2^^M{\endgroup % | ||
| 3383 | \dosubind{cp}{#2}{#1}}} | ||
| 3384 | |||
| 3385 | % Define the macros used in formatting output of the sorted index material. | ||
| 3386 | |||
| 3387 | % @printindex causes a particular index (the ??s file) to get printed. | ||
| 3388 | % It does not print any chapter heading (usually an @unnumbered). | ||
| 3389 | % | ||
| 3390 | \def\printindex{\parsearg\doprintindex} | ||
| 3391 | \def\doprintindex#1{\begingroup | ||
| 3392 | \dobreak \chapheadingskip{10000}% | ||
| 3393 | % | ||
| 3394 | \smallfonts \rm | ||
| 3395 | \tolerance = 9500 | ||
| 3396 | \everypar = {}% don't want the \kern\-parindent from indentation suppression. | ||
| 3397 | \indexbreaks | ||
| 3398 | % | ||
| 3399 | % See if the index file exists and is nonempty. | ||
| 3400 | % Change catcode of @ here so that if the index file contains | ||
| 3401 | % \initial {@} | ||
| 3402 | % as its first line, TeX doesn't complain about mismatched braces | ||
| 3403 | % (because it thinks @} is a control sequence). | ||
| 3404 | \catcode`\@ = 11 | ||
| 3405 | \openin 1 \jobname.#1s | ||
| 3406 | \ifeof 1 | ||
| 3407 | % \enddoublecolumns gets confused if there is no text in the index, | ||
| 3408 | % and it loses the chapter title and the aux file entries for the | ||
| 3409 | % index. The easiest way to prevent this problem is to make sure | ||
| 3410 | % there is some text. | ||
| 3411 | \putwordIndexNonexistent | ||
| 3412 | \else | ||
| 3413 | % | ||
| 3414 | % If the index file exists but is empty, then \openin leaves \ifeof | ||
| 3415 | % false. We have to make TeX try to read something from the file, so | ||
| 3416 | % it can discover if there is anything in it. | ||
| 3417 | \read 1 to \temp | ||
| 3418 | \ifeof 1 | ||
| 3419 | \putwordIndexIsEmpty | ||
| 3420 | \else | ||
| 3421 | % Index files are almost Texinfo source, but we use \ as the escape | ||
| 3422 | % character. It would be better to use @, but that's too big a change | ||
| 3423 | % to make right now. | ||
| 3424 | \def\indexbackslash{\rawbackslashxx}% | ||
| 3425 | \catcode`\\ = 0 | ||
| 3426 | \escapechar = `\\ | ||
| 3427 | \begindoublecolumns | ||
| 3428 | \input \jobname.#1s | ||
| 3429 | \enddoublecolumns | ||
| 3430 | \fi | ||
| 3431 | \fi | ||
| 3432 | \closein 1 | ||
| 3433 | \endgroup} | ||
| 3434 | |||
| 3435 | % These macros are used by the sorted index file itself. | ||
| 3436 | % Change them to control the appearance of the index. | ||
| 3437 | |||
| 3438 | \def\initial#1{{% | ||
| 3439 | % Some minor font changes for the special characters. | ||
| 3440 | \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt | ||
| 3441 | % | ||
| 3442 | % Remove any glue we may have, we'll be inserting our own. | ||
| 3443 | \removelastskip | ||
| 3444 | % | ||
| 3445 | % We like breaks before the index initials, so insert a bonus. | ||
| 3446 | \penalty -300 | ||
| 3447 | % | ||
| 3448 | % Typeset the initial. Making this add up to a whole number of | ||
| 3449 | % baselineskips increases the chance of the dots lining up from column | ||
| 3450 | % to column. It still won't often be perfect, because of the stretch | ||
| 3451 | % we need before each entry, but it's better. | ||
| 3452 | % | ||
| 3453 | % No shrink because it confuses \balancecolumns. | ||
| 3454 | \vskip 1.67\baselineskip plus .5\baselineskip | ||
| 3455 | \leftline{\secbf #1}% | ||
| 3456 | \vskip .33\baselineskip plus .1\baselineskip | ||
| 3457 | % | ||
| 3458 | % Do our best not to break after the initial. | ||
| 3459 | \nobreak | ||
| 3460 | }} | ||
| 3461 | |||
| 3462 | % This typesets a paragraph consisting of #1, dot leaders, and then #2 | ||
| 3463 | % flush to the right margin. It is used for index and table of contents | ||
| 3464 | % entries. The paragraph is indented by \leftskip. | ||
| 3465 | % | ||
| 3466 | \def\entry#1#2{\begingroup | ||
| 3467 | % | ||
| 3468 | % Start a new paragraph if necessary, so our assignments below can't | ||
| 3469 | % affect previous text. | ||
| 3470 | \par | ||
| 3471 | % | ||
| 3472 | % Do not fill out the last line with white space. | ||
| 3473 | \parfillskip = 0in | ||
| 3474 | % | ||
| 3475 | % No extra space above this paragraph. | ||
| 3476 | \parskip = 0in | ||
| 3477 | % | ||
| 3478 | % Do not prefer a separate line ending with a hyphen to fewer lines. | ||
| 3479 | \finalhyphendemerits = 0 | ||
| 3480 | % | ||
| 3481 | % \hangindent is only relevant when the entry text and page number | ||
| 3482 | % don't both fit on one line. In that case, bob suggests starting the | ||
| 3483 | % dots pretty far over on the line. Unfortunately, a large | ||
| 3484 | % indentation looks wrong when the entry text itself is broken across | ||
| 3485 | % lines. So we use a small indentation and put up with long leaders. | ||
| 3486 | % | ||
| 3487 | % \hangafter is reset to 1 (which is the value we want) at the start | ||
| 3488 | % of each paragraph, so we need not do anything with that. | ||
| 3489 | \hangindent = 2em | ||
| 3490 | % | ||
| 3491 | % When the entry text needs to be broken, just fill out the first line | ||
| 3492 | % with blank space. | ||
| 3493 | \rightskip = 0pt plus1fil | ||
| 3494 | % | ||
| 3495 | % A bit of stretch before each entry for the benefit of balancing columns. | ||
| 3496 | \vskip 0pt plus1pt | ||
| 3497 | % | ||
| 3498 | % Start a ``paragraph'' for the index entry so the line breaking | ||
| 3499 | % parameters we've set above will have an effect. | ||
| 3500 | \noindent | ||
| 3501 | % | ||
| 3502 | % Insert the text of the index entry. TeX will do line-breaking on it. | ||
| 3503 | #1% | ||
| 3504 | % The following is kludged to not output a line of dots in the index if | ||
| 3505 | % there are no page numbers. The next person who breaks this will be | ||
| 3506 | % cursed by a Unix daemon. | ||
| 3507 | \def\tempa{{\rm }}% | ||
| 3508 | \def\tempb{#2}% | ||
| 3509 | \edef\tempc{\tempa}% | ||
| 3510 | \edef\tempd{\tempb}% | ||
| 3511 | \ifx\tempc\tempd\ \else% | ||
| 3512 | % | ||
| 3513 | % If we must, put the page number on a line of its own, and fill out | ||
| 3514 | % this line with blank space. (The \hfil is overwhelmed with the | ||
| 3515 | % fill leaders glue in \indexdotfill if the page number does fit.) | ||
| 3516 | \hfil\penalty50 | ||
| 3517 | \null\nobreak\indexdotfill % Have leaders before the page number. | ||
| 3518 | % | ||
| 3519 | % The `\ ' here is removed by the implicit \unskip that TeX does as | ||
| 3520 | % part of (the primitive) \par. Without it, a spurious underfull | ||
| 3521 | % \hbox ensues. | ||
| 3522 | \ifpdf | ||
| 3523 | \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. | ||
| 3524 | \else | ||
| 3525 | \ #2% The page number ends the paragraph. | ||
| 3526 | \fi | ||
| 3527 | \fi% | ||
| 3528 | \par | ||
| 3529 | \endgroup} | ||
| 3530 | |||
| 3531 | % Like \dotfill except takes at least 1 em. | ||
| 3532 | \def\indexdotfill{\cleaders | ||
| 3533 | \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} | ||
| 3534 | |||
| 3535 | \def\primary #1{\line{#1\hfil}} | ||
| 3536 | |||
| 3537 | \newskip\secondaryindent \secondaryindent=0.5cm | ||
| 3538 | \def\secondary#1#2{{% | ||
| 3539 | \parfillskip=0in | ||
| 3540 | \parskip=0in | ||
| 3541 | \hangindent=1in | ||
| 3542 | \hangafter=1 | ||
| 3543 | \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill | ||
| 3544 | \ifpdf | ||
| 3545 | \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. | ||
| 3546 | \else | ||
| 3547 | #2 | ||
| 3548 | \fi | ||
| 3549 | \par | ||
| 3550 | }} | ||
| 3551 | |||
| 3552 | % Define two-column mode, which we use to typeset indexes. | ||
| 3553 | % Adapted from the TeXbook, page 416, which is to say, | ||
| 3554 | % the manmac.tex format used to print the TeXbook itself. | ||
| 3555 | \catcode`\@=11 | ||
| 3556 | |||
| 3557 | \newbox\partialpage | ||
| 3558 | \newdimen\doublecolumnhsize | ||
| 3559 | |||
| 3560 | \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns | ||
| 3561 | % Grab any single-column material above us. | ||
| 3562 | \output = {% | ||
| 3563 | % | ||
| 3564 | % Here is a possibility not foreseen in manmac: if we accumulate a | ||
| 3565 | % whole lot of material, we might end up calling this \output | ||
| 3566 | % routine twice in a row (see the doublecol-lose test, which is | ||
| 3567 | % essentially a couple of indexes with @setchapternewpage off). In | ||
| 3568 | % that case we just ship out what is in \partialpage with the normal | ||
| 3569 | % output routine. Generally, \partialpage will be empty when this | ||
| 3570 | % runs and this will be a no-op. See the indexspread.tex test case. | ||
| 3571 | \ifvoid\partialpage \else | ||
| 3572 | \onepageout{\pagecontents\partialpage}% | ||
| 3573 | \fi | ||
| 3574 | % | ||
| 3575 | \global\setbox\partialpage = \vbox{% | ||
| 3576 | % Unvbox the main output page. | ||
| 3577 | \unvbox\PAGE | ||
| 3578 | \kern-\topskip \kern\baselineskip | ||
| 3579 | }% | ||
| 3580 | }% | ||
| 3581 | \eject % run that output routine to set \partialpage | ||
| 3582 | % | ||
| 3583 | % Use the double-column output routine for subsequent pages. | ||
| 3584 | \output = {\doublecolumnout}% | ||
| 3585 | % | ||
| 3586 | % Change the page size parameters. We could do this once outside this | ||
| 3587 | % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 | ||
| 3588 | % format, but then we repeat the same computation. Repeating a couple | ||
| 3589 | % of assignments once per index is clearly meaningless for the | ||
| 3590 | % execution time, so we may as well do it in one place. | ||
| 3591 | % | ||
| 3592 | % First we halve the line length, less a little for the gutter between | ||
| 3593 | % the columns. We compute the gutter based on the line length, so it | ||
| 3594 | % changes automatically with the paper format. The magic constant | ||
| 3595 | % below is chosen so that the gutter has the same value (well, +-<1pt) | ||
| 3596 | % as it did when we hard-coded it. | ||
| 3597 | % | ||
| 3598 | % We put the result in a separate register, \doublecolumhsize, so we | ||
| 3599 | % can restore it in \pagesofar, after \hsize itself has (potentially) | ||
| 3600 | % been clobbered. | ||
| 3601 | % | ||
| 3602 | \doublecolumnhsize = \hsize | ||
| 3603 | \advance\doublecolumnhsize by -.04154\hsize | ||
| 3604 | \divide\doublecolumnhsize by 2 | ||
| 3605 | \hsize = \doublecolumnhsize | ||
| 3606 | % | ||
| 3607 | % Double the \vsize as well. (We don't need a separate register here, | ||
| 3608 | % since nobody clobbers \vsize.) | ||
| 3609 | \vsize = 2\vsize | ||
| 3610 | } | ||
| 3611 | |||
| 3612 | % The double-column output routine for all double-column pages except | ||
| 3613 | % the last. | ||
| 3614 | % | ||
| 3615 | \def\doublecolumnout{% | ||
| 3616 | \splittopskip=\topskip \splitmaxdepth=\maxdepth | ||
| 3617 | % Get the available space for the double columns -- the normal | ||
| 3618 | % (undoubled) page height minus any material left over from the | ||
| 3619 | % previous page. | ||
| 3620 | \dimen@ = \vsize | ||
| 3621 | \divide\dimen@ by 2 | ||
| 3622 | \advance\dimen@ by -\ht\partialpage | ||
| 3623 | % | ||
| 3624 | % box0 will be the left-hand column, box2 the right. | ||
| 3625 | \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ | ||
| 3626 | \onepageout\pagesofar | ||
| 3627 | \unvbox255 | ||
| 3628 | \penalty\outputpenalty | ||
| 3629 | } | ||
| 3630 | % | ||
| 3631 | % Re-output the contents of the output page -- any previous material, | ||
| 3632 | % followed by the two boxes we just split, in box0 and box2. | ||
| 3633 | \def\pagesofar{% | ||
| 3634 | \unvbox\partialpage | ||
| 3635 | % | ||
| 3636 | \hsize = \doublecolumnhsize | ||
| 3637 | \wd0=\hsize \wd2=\hsize | ||
| 3638 | \hbox to\pagewidth{\box0\hfil\box2}% | ||
| 3639 | } | ||
| 3640 | % | ||
| 3641 | % All done with double columns. | ||
| 3642 | \def\enddoublecolumns{% | ||
| 3643 | \output = {% | ||
| 3644 | % Split the last of the double-column material. Leave it on the | ||
| 3645 | % current page, no automatic page break. | ||
| 3646 | \balancecolumns | ||
| 3647 | % | ||
| 3648 | % If we end up splitting too much material for the current page, | ||
| 3649 | % though, there will be another page break right after this \output | ||
| 3650 | % invocation ends. Having called \balancecolumns once, we do not | ||
| 3651 | % want to call it again. Therefore, reset \output to its normal | ||
| 3652 | % definition right away. (We hope \balancecolumns will never be | ||
| 3653 | % called on to balance too much material, but if it is, this makes | ||
| 3654 | % the output somewhat more palatable.) | ||
| 3655 | \global\output = {\onepageout{\pagecontents\PAGE}}% | ||
| 3656 | }% | ||
| 3657 | \eject | ||
| 3658 | \endgroup % started in \begindoublecolumns | ||
| 3659 | % | ||
| 3660 | % \pagegoal was set to the doubled \vsize above, since we restarted | ||
| 3661 | % the current page. We're now back to normal single-column | ||
| 3662 | % typesetting, so reset \pagegoal to the normal \vsize (after the | ||
| 3663 | % \endgroup where \vsize got restored). | ||
| 3664 | \pagegoal = \vsize | ||
| 3665 | } | ||
| 3666 | % | ||
| 3667 | % Called at the end of the double column material. | ||
| 3668 | \def\balancecolumns{% | ||
| 3669 | \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. | ||
| 3670 | \dimen@ = \ht0 | ||
| 3671 | \advance\dimen@ by \topskip | ||
| 3672 | \advance\dimen@ by-\baselineskip | ||
| 3673 | \divide\dimen@ by 2 % target to split to | ||
| 3674 | %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% | ||
| 3675 | \splittopskip = \topskip | ||
| 3676 | % Loop until we get a decent breakpoint. | ||
| 3677 | {% | ||
| 3678 | \vbadness = 10000 | ||
| 3679 | \loop | ||
| 3680 | \global\setbox3 = \copy0 | ||
| 3681 | \global\setbox1 = \vsplit3 to \dimen@ | ||
| 3682 | \ifdim\ht3>\dimen@ | ||
| 3683 | \global\advance\dimen@ by 1pt | ||
| 3684 | \repeat | ||
| 3685 | }% | ||
| 3686 | %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% | ||
| 3687 | \setbox0=\vbox to\dimen@{\unvbox1}% | ||
| 3688 | \setbox2=\vbox to\dimen@{\unvbox3}% | ||
| 3689 | % | ||
| 3690 | \pagesofar | ||
| 3691 | } | ||
| 3692 | \catcode`\@ = \other | ||
| 3693 | |||
| 3694 | |||
| 3695 | \message{sectioning,} | ||
| 3696 | % Chapters, sections, etc. | ||
| 3697 | |||
| 3698 | \newcount\chapno | ||
| 3699 | \newcount\secno \secno=0 | ||
| 3700 | \newcount\subsecno \subsecno=0 | ||
| 3701 | \newcount\subsubsecno \subsubsecno=0 | ||
| 3702 | |||
| 3703 | % This counter is funny since it counts through charcodes of letters A, B, ... | ||
| 3704 | \newcount\appendixno \appendixno = `\@ | ||
| 3705 | % \def\appendixletter{\char\the\appendixno} | ||
| 3706 | % We do the following for the sake of pdftex, which needs the actual | ||
| 3707 | % letter in the expansion, not just typeset. | ||
| 3708 | \def\appendixletter{% | ||
| 3709 | \ifnum\appendixno=`A A% | ||
| 3710 | \else\ifnum\appendixno=`B B% | ||
| 3711 | \else\ifnum\appendixno=`C C% | ||
| 3712 | \else\ifnum\appendixno=`D D% | ||
| 3713 | \else\ifnum\appendixno=`E E% | ||
| 3714 | \else\ifnum\appendixno=`F F% | ||
| 3715 | \else\ifnum\appendixno=`G G% | ||
| 3716 | \else\ifnum\appendixno=`H H% | ||
| 3717 | \else\ifnum\appendixno=`I I% | ||
| 3718 | \else\ifnum\appendixno=`J J% | ||
| 3719 | \else\ifnum\appendixno=`K K% | ||
| 3720 | \else\ifnum\appendixno=`L L% | ||
| 3721 | \else\ifnum\appendixno=`M M% | ||
| 3722 | \else\ifnum\appendixno=`N N% | ||
| 3723 | \else\ifnum\appendixno=`O O% | ||
| 3724 | \else\ifnum\appendixno=`P P% | ||
| 3725 | \else\ifnum\appendixno=`Q Q% | ||
| 3726 | \else\ifnum\appendixno=`R R% | ||
| 3727 | \else\ifnum\appendixno=`S S% | ||
| 3728 | \else\ifnum\appendixno=`T T% | ||
| 3729 | \else\ifnum\appendixno=`U U% | ||
| 3730 | \else\ifnum\appendixno=`V V% | ||
| 3731 | \else\ifnum\appendixno=`W W% | ||
| 3732 | \else\ifnum\appendixno=`X X% | ||
| 3733 | \else\ifnum\appendixno=`Y Y% | ||
| 3734 | \else\ifnum\appendixno=`Z Z% | ||
| 3735 | % The \the is necessary, despite appearances, because \appendixletter is | ||
| 3736 | % expanded while writing the .toc file. \char\appendixno is not | ||
| 3737 | % expandable, thus it is written literally, thus all appendixes come out | ||
| 3738 | % with the same letter (or @) in the toc without it. | ||
| 3739 | \else\char\the\appendixno | ||
| 3740 | \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi | ||
| 3741 | \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} | ||
| 3742 | |||
| 3743 | % Each @chapter defines this as the name of the chapter. | ||
| 3744 | % page headings and footings can use it. @section does likewise. | ||
| 3745 | \def\thischapter{} | ||
| 3746 | \def\thissection{} | ||
| 3747 | |||
| 3748 | \newcount\absseclevel % used to calculate proper heading level | ||
| 3749 | \newcount\secbase\secbase=0 % @raise/lowersections modify this count | ||
| 3750 | |||
| 3751 | % @raisesections: treat @section as chapter, @subsection as section, etc. | ||
| 3752 | \def\raisesections{\global\advance\secbase by -1} | ||
| 3753 | \let\up=\raisesections % original BFox name | ||
| 3754 | |||
| 3755 | % @lowersections: treat @chapter as section, @section as subsection, etc. | ||
| 3756 | \def\lowersections{\global\advance\secbase by 1} | ||
| 3757 | \let\down=\lowersections % original BFox name | ||
| 3758 | |||
| 3759 | % Choose a numbered-heading macro | ||
| 3760 | % #1 is heading level if unmodified by @raisesections or @lowersections | ||
| 3761 | % #2 is text for heading | ||
| 3762 | \def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 | ||
| 3763 | \ifcase\absseclevel | ||
| 3764 | \chapterzzz{#2} | ||
| 3765 | \or | ||
| 3766 | \seczzz{#2} | ||
| 3767 | \or | ||
| 3768 | \numberedsubseczzz{#2} | ||
| 3769 | \or | ||
| 3770 | \numberedsubsubseczzz{#2} | ||
| 3771 | \else | ||
| 3772 | \ifnum \absseclevel<0 | ||
| 3773 | \chapterzzz{#2} | ||
| 3774 | \else | ||
| 3775 | \numberedsubsubseczzz{#2} | ||
| 3776 | \fi | ||
| 3777 | \fi | ||
| 3778 | \suppressfirstparagraphindent | ||
| 3779 | } | ||
| 3780 | |||
| 3781 | % like \numhead, but chooses appendix heading levels | ||
| 3782 | \def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 | ||
| 3783 | \ifcase\absseclevel | ||
| 3784 | \appendixzzz{#2} | ||
| 3785 | \or | ||
| 3786 | \appendixsectionzzz{#2} | ||
| 3787 | \or | ||
| 3788 | \appendixsubseczzz{#2} | ||
| 3789 | \or | ||
| 3790 | \appendixsubsubseczzz{#2} | ||
| 3791 | \else | ||
| 3792 | \ifnum \absseclevel<0 | ||
| 3793 | \appendixzzz{#2} | ||
| 3794 | \else | ||
| 3795 | \appendixsubsubseczzz{#2} | ||
| 3796 | \fi | ||
| 3797 | \fi | ||
| 3798 | \suppressfirstparagraphindent | ||
| 3799 | } | ||
| 3800 | |||
| 3801 | % like \numhead, but chooses numberless heading levels | ||
| 3802 | \def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 | ||
| 3803 | \ifcase\absseclevel | ||
| 3804 | \unnumberedzzz{#2} | ||
| 3805 | \or | ||
| 3806 | \unnumberedseczzz{#2} | ||
| 3807 | \or | ||
| 3808 | \unnumberedsubseczzz{#2} | ||
| 3809 | \or | ||
| 3810 | \unnumberedsubsubseczzz{#2} | ||
| 3811 | \else | ||
| 3812 | \ifnum \absseclevel<0 | ||
| 3813 | \unnumberedzzz{#2} | ||
| 3814 | \else | ||
| 3815 | \unnumberedsubsubseczzz{#2} | ||
| 3816 | \fi | ||
| 3817 | \fi | ||
| 3818 | \suppressfirstparagraphindent | ||
| 3819 | } | ||
| 3820 | |||
| 3821 | % @chapter, @appendix, @unnumbered. | ||
| 3822 | \def\thischaptername{No Chapter Title} | ||
| 3823 | \outer\def\chapter{\parsearg\chapteryyy} | ||
| 3824 | \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz | ||
| 3825 | \def\chapterzzz #1{% | ||
| 3826 | \secno=0 \subsecno=0 \subsubsecno=0 | ||
| 3827 | \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% | ||
| 3828 | \chapmacro {#1}{\the\chapno}% | ||
| 3829 | \gdef\thissection{#1}% | ||
| 3830 | \gdef\thischaptername{#1}% | ||
| 3831 | % We don't substitute the actual chapter name into \thischapter | ||
| 3832 | % because we don't want its macros evaluated now. | ||
| 3833 | \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% | ||
| 3834 | \writetocentry{chap}{#1}{{\the\chapno}} | ||
| 3835 | \donoderef | ||
| 3836 | \global\let\section = \numberedsec | ||
| 3837 | \global\let\subsection = \numberedsubsec | ||
| 3838 | \global\let\subsubsection = \numberedsubsubsec | ||
| 3839 | } | ||
| 3840 | |||
| 3841 | % we use \chapno to avoid indenting back | ||
| 3842 | \def\appendixbox#1{% | ||
| 3843 | \setbox0 = \hbox{\putwordAppendix{} \the\chapno}% | ||
| 3844 | \hbox to \wd0{#1\hss}} | ||
| 3845 | |||
| 3846 | \outer\def\appendix{\parsearg\appendixyyy} | ||
| 3847 | \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz | ||
| 3848 | \def\appendixzzz #1{% | ||
| 3849 | \secno=0 \subsecno=0 \subsubsecno=0 | ||
| 3850 | \global\advance \appendixno by 1 | ||
| 3851 | \message{\putwordAppendix\space \appendixletter}% | ||
| 3852 | \chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}% | ||
| 3853 | \gdef\thissection{#1}% | ||
| 3854 | \gdef\thischaptername{#1}% | ||
| 3855 | \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% | ||
| 3856 | \writetocentry{appendix}{#1}{{\appendixletter}} | ||
| 3857 | \appendixnoderef | ||
| 3858 | \global\let\section = \appendixsec | ||
| 3859 | \global\let\subsection = \appendixsubsec | ||
| 3860 | \global\let\subsubsection = \appendixsubsubsec | ||
| 3861 | } | ||
| 3862 | |||
| 3863 | % @centerchap is like @unnumbered, but the heading is centered. | ||
| 3864 | \outer\def\centerchap{\parsearg\centerchapyyy} | ||
| 3865 | \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} | ||
| 3866 | |||
| 3867 | % @top is like @unnumbered. | ||
| 3868 | \outer\def\top{\parsearg\unnumberedyyy} | ||
| 3869 | |||
| 3870 | \outer\def\unnumbered{\parsearg\unnumberedyyy} | ||
| 3871 | \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz | ||
| 3872 | \def\unnumberedzzz #1{% | ||
| 3873 | \secno=0 \subsecno=0 \subsubsecno=0 | ||
| 3874 | % | ||
| 3875 | % This used to be simply \message{#1}, but TeX fully expands the | ||
| 3876 | % argument to \message. Therefore, if #1 contained @-commands, TeX | ||
| 3877 | % expanded them. For example, in `@unnumbered The @cite{Book}', TeX | ||
| 3878 | % expanded @cite (which turns out to cause errors because \cite is meant | ||
| 3879 | % to be executed, not expanded). | ||
| 3880 | % | ||
| 3881 | % Anyway, we don't want the fully-expanded definition of @cite to appear | ||
| 3882 | % as a result of the \message, we just want `@cite' itself. We use | ||
| 3883 | % \the<toks register> to achieve this: TeX expands \the<toks> only once, | ||
| 3884 | % simply yielding the contents of <toks register>. (We also do this for | ||
| 3885 | % the toc entries.) | ||
| 3886 | \toks0 = {#1}\message{(\the\toks0)}% | ||
| 3887 | % | ||
| 3888 | \unnumbchapmacro {#1}% | ||
| 3889 | \gdef\thischapter{#1}\gdef\thissection{#1}% | ||
| 3890 | \writetocentry{unnumbchap}{#1}{{\the\chapno}} | ||
| 3891 | \unnumbnoderef | ||
| 3892 | \global\let\section = \unnumberedsec | ||
| 3893 | \global\let\subsection = \unnumberedsubsec | ||
| 3894 | \global\let\subsubsection = \unnumberedsubsubsec | ||
| 3895 | } | ||
| 3896 | |||
| 3897 | % Sections. | ||
| 3898 | \outer\def\numberedsec{\parsearg\secyyy} | ||
| 3899 | \def\secyyy #1{\numhead1{#1}} % normally calls seczzz | ||
| 3900 | \def\seczzz #1{% | ||
| 3901 | \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % | ||
| 3902 | \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% | ||
| 3903 | \writetocentry{sec}{#1}{{\the\chapno}{\the\secno}} | ||
| 3904 | \donoderef | ||
| 3905 | \nobreak | ||
| 3906 | } | ||
| 3907 | |||
| 3908 | \outer\def\appendixsection{\parsearg\appendixsecyyy} | ||
| 3909 | \outer\def\appendixsec{\parsearg\appendixsecyyy} | ||
| 3910 | \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz | ||
| 3911 | \def\appendixsectionzzz #1{% | ||
| 3912 | \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % | ||
| 3913 | \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% | ||
| 3914 | \writetocentry{sec}{#1}{{\appendixletter}{\the\secno}} | ||
| 3915 | \appendixnoderef | ||
| 3916 | \nobreak | ||
| 3917 | } | ||
| 3918 | |||
| 3919 | \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} | ||
| 3920 | \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz | ||
| 3921 | \def\unnumberedseczzz #1{% | ||
| 3922 | \plainsecheading {#1}\gdef\thissection{#1}% | ||
| 3923 | \writetocentry{unnumbsec}{#1}{{\the\chapno}{\the\secno}} | ||
| 3924 | \unnumbnoderef | ||
| 3925 | \nobreak | ||
| 3926 | } | ||
| 3927 | |||
| 3928 | % Subsections. | ||
| 3929 | \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} | ||
| 3930 | \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz | ||
| 3931 | \def\numberedsubseczzz #1{% | ||
| 3932 | \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % | ||
| 3933 | \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% | ||
| 3934 | \writetocentry{subsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}} | ||
| 3935 | \donoderef | ||
| 3936 | \nobreak | ||
| 3937 | } | ||
| 3938 | |||
| 3939 | \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} | ||
| 3940 | \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz | ||
| 3941 | \def\appendixsubseczzz #1{% | ||
| 3942 | \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % | ||
| 3943 | \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% | ||
| 3944 | \writetocentry{subsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}} | ||
| 3945 | \appendixnoderef | ||
| 3946 | \nobreak | ||
| 3947 | } | ||
| 3948 | |||
| 3949 | \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} | ||
| 3950 | \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz | ||
| 3951 | \def\unnumberedsubseczzz #1{% | ||
| 3952 | \plainsubsecheading {#1}\gdef\thissection{#1}% | ||
| 3953 | \writetocentry{unnumbsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}} | ||
| 3954 | \unnumbnoderef | ||
| 3955 | \nobreak | ||
| 3956 | } | ||
| 3957 | |||
| 3958 | % Subsubsections. | ||
| 3959 | \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} | ||
| 3960 | \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz | ||
| 3961 | \def\numberedsubsubseczzz #1{% | ||
| 3962 | \gdef\thissection{#1}\global\advance \subsubsecno by 1 % | ||
| 3963 | \subsubsecheading {#1} | ||
| 3964 | {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% | ||
| 3965 | \writetocentry{subsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}} | ||
| 3966 | \donoderef | ||
| 3967 | \nobreak | ||
| 3968 | } | ||
| 3969 | |||
| 3970 | \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} | ||
| 3971 | \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz | ||
| 3972 | \def\appendixsubsubseczzz #1{% | ||
| 3973 | \gdef\thissection{#1}\global\advance \subsubsecno by 1 % | ||
| 3974 | \subsubsecheading {#1} | ||
| 3975 | {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% | ||
| 3976 | \writetocentry{subsubsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}} | ||
| 3977 | \appendixnoderef | ||
| 3978 | \nobreak | ||
| 3979 | } | ||
| 3980 | |||
| 3981 | \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} | ||
| 3982 | \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz | ||
| 3983 | \def\unnumberedsubsubseczzz #1{% | ||
| 3984 | \plainsubsubsecheading {#1}\gdef\thissection{#1}% | ||
| 3985 | \writetocentry{unnumbsubsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}} | ||
| 3986 | \unnumbnoderef | ||
| 3987 | \nobreak | ||
| 3988 | } | ||
| 3989 | |||
| 3990 | % These are variants which are not "outer", so they can appear in @ifinfo. | ||
| 3991 | % Actually, they should now be obsolete; ordinary section commands should work. | ||
| 3992 | \def\infotop{\parsearg\unnumberedzzz} | ||
| 3993 | \def\infounnumbered{\parsearg\unnumberedzzz} | ||
| 3994 | \def\infounnumberedsec{\parsearg\unnumberedseczzz} | ||
| 3995 | \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} | ||
| 3996 | \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} | ||
| 3997 | |||
| 3998 | \def\infoappendix{\parsearg\appendixzzz} | ||
| 3999 | \def\infoappendixsec{\parsearg\appendixseczzz} | ||
| 4000 | \def\infoappendixsubsec{\parsearg\appendixsubseczzz} | ||
| 4001 | \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} | ||
| 4002 | |||
| 4003 | \def\infochapter{\parsearg\chapterzzz} | ||
| 4004 | \def\infosection{\parsearg\sectionzzz} | ||
| 4005 | \def\infosubsection{\parsearg\subsectionzzz} | ||
| 4006 | \def\infosubsubsection{\parsearg\subsubsectionzzz} | ||
| 4007 | |||
| 4008 | % These macros control what the section commands do, according | ||
| 4009 | % to what kind of chapter we are in (ordinary, appendix, or unnumbered). | ||
| 4010 | % Define them by default for a numbered chapter. | ||
| 4011 | \global\let\section = \numberedsec | ||
| 4012 | \global\let\subsection = \numberedsubsec | ||
| 4013 | \global\let\subsubsection = \numberedsubsubsec | ||
| 4014 | |||
| 4015 | % Define @majorheading, @heading and @subheading | ||
| 4016 | |||
| 4017 | % NOTE on use of \vbox for chapter headings, section headings, and such: | ||
| 4018 | % 1) We use \vbox rather than the earlier \line to permit | ||
| 4019 | % overlong headings to fold. | ||
| 4020 | % 2) \hyphenpenalty is set to 10000 because hyphenation in a | ||
| 4021 | % heading is obnoxious; this forbids it. | ||
| 4022 | % 3) Likewise, headings look best if no \parindent is used, and | ||
| 4023 | % if justification is not attempted. Hence \raggedright. | ||
| 4024 | |||
| 4025 | |||
| 4026 | \def\majorheading{\parsearg\majorheadingzzz} | ||
| 4027 | \def\majorheadingzzz #1{% | ||
| 4028 | {\advance\chapheadingskip by 10pt \chapbreak }% | ||
| 4029 | {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | ||
| 4030 | \parindent=0pt\raggedright | ||
| 4031 | \rm #1\hfill}}\bigskip \par\penalty 200} | ||
| 4032 | |||
| 4033 | \def\chapheading{\parsearg\chapheadingzzz} | ||
| 4034 | \def\chapheadingzzz #1{\chapbreak % | ||
| 4035 | {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | ||
| 4036 | \parindent=0pt\raggedright | ||
| 4037 | \rm #1\hfill}}\bigskip \par\penalty 200} | ||
| 4038 | |||
| 4039 | % @heading, @subheading, @subsubheading. | ||
| 4040 | \def\heading{\parsearg\plainsecheading} | ||
| 4041 | \def\subheading{\parsearg\plainsubsecheading} | ||
| 4042 | \def\subsubheading{\parsearg\plainsubsubsecheading} | ||
| 4043 | |||
| 4044 | % These macros generate a chapter, section, etc. heading only | ||
| 4045 | % (including whitespace, linebreaking, etc. around it), | ||
| 4046 | % given all the information in convenient, parsed form. | ||
| 4047 | |||
| 4048 | %%% Args are the skip and penalty (usually negative) | ||
| 4049 | \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} | ||
| 4050 | |||
| 4051 | \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} | ||
| 4052 | |||
| 4053 | %%% Define plain chapter starts, and page on/off switching for it | ||
| 4054 | % Parameter controlling skip before chapter headings (if needed) | ||
| 4055 | |||
| 4056 | \newskip\chapheadingskip | ||
| 4057 | |||
| 4058 | \def\chapbreak{\dobreak \chapheadingskip {-4000}} | ||
| 4059 | \def\chappager{\par\vfill\supereject} | ||
| 4060 | \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} | ||
| 4061 | |||
| 4062 | \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} | ||
| 4063 | |||
| 4064 | \def\CHAPPAGoff{% | ||
| 4065 | \global\let\contentsalignmacro = \chappager | ||
| 4066 | \global\let\pchapsepmacro=\chapbreak | ||
| 4067 | \global\let\pagealignmacro=\chappager} | ||
| 4068 | |||
| 4069 | \def\CHAPPAGon{% | ||
| 4070 | \global\let\contentsalignmacro = \chappager | ||
| 4071 | \global\let\pchapsepmacro=\chappager | ||
| 4072 | \global\let\pagealignmacro=\chappager | ||
| 4073 | \global\def\HEADINGSon{\HEADINGSsingle}} | ||
| 4074 | |||
| 4075 | \def\CHAPPAGodd{ | ||
| 4076 | \global\let\contentsalignmacro = \chapoddpage | ||
| 4077 | \global\let\pchapsepmacro=\chapoddpage | ||
| 4078 | \global\let\pagealignmacro=\chapoddpage | ||
| 4079 | \global\def\HEADINGSon{\HEADINGSdouble}} | ||
| 4080 | |||
| 4081 | \CHAPPAGon | ||
| 4082 | |||
| 4083 | \def\CHAPFplain{ | ||
| 4084 | \global\let\chapmacro=\chfplain | ||
| 4085 | \global\let\unnumbchapmacro=\unnchfplain | ||
| 4086 | \global\let\centerchapmacro=\centerchfplain} | ||
| 4087 | |||
| 4088 | % Plain chapter opening. | ||
| 4089 | % #1 is the text, #2 the chapter number or empty if unnumbered. | ||
| 4090 | \def\chfplain#1#2{% | ||
| 4091 | \pchapsepmacro | ||
| 4092 | {% | ||
| 4093 | \chapfonts \rm | ||
| 4094 | \def\chapnum{#2}% | ||
| 4095 | \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% | ||
| 4096 | \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright | ||
| 4097 | \hangindent = \wd0 \centerparametersmaybe | ||
| 4098 | \unhbox0 #1\par}% | ||
| 4099 | }% | ||
| 4100 | \nobreak\bigskip % no page break after a chapter title | ||
| 4101 | \nobreak | ||
| 4102 | } | ||
| 4103 | |||
| 4104 | % Plain opening for unnumbered. | ||
| 4105 | \def\unnchfplain#1{\chfplain{#1}{}} | ||
| 4106 | |||
| 4107 | % @centerchap -- centered and unnumbered. | ||
| 4108 | \let\centerparametersmaybe = \relax | ||
| 4109 | \def\centerchfplain#1{{% | ||
| 4110 | \def\centerparametersmaybe{% | ||
| 4111 | \advance\rightskip by 3\rightskip | ||
| 4112 | \leftskip = \rightskip | ||
| 4113 | \parfillskip = 0pt | ||
| 4114 | }% | ||
| 4115 | \chfplain{#1}{}% | ||
| 4116 | }} | ||
| 4117 | |||
| 4118 | \CHAPFplain % The default | ||
| 4119 | |||
| 4120 | \def\unnchfopen #1{% | ||
| 4121 | \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | ||
| 4122 | \parindent=0pt\raggedright | ||
| 4123 | \rm #1\hfill}}\bigskip \par\nobreak | ||
| 4124 | } | ||
| 4125 | |||
| 4126 | \def\chfopen #1#2{\chapoddpage {\chapfonts | ||
| 4127 | \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% | ||
| 4128 | \par\penalty 5000 % | ||
| 4129 | } | ||
| 4130 | |||
| 4131 | \def\centerchfopen #1{% | ||
| 4132 | \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 | ||
| 4133 | \parindent=0pt | ||
| 4134 | \hfill {\rm #1}\hfill}}\bigskip \par\nobreak | ||
| 4135 | } | ||
| 4136 | |||
| 4137 | \def\CHAPFopen{ | ||
| 4138 | \global\let\chapmacro=\chfopen | ||
| 4139 | \global\let\unnumbchapmacro=\unnchfopen | ||
| 4140 | \global\let\centerchapmacro=\centerchfopen} | ||
| 4141 | |||
| 4142 | |||
| 4143 | % Section titles. | ||
| 4144 | \newskip\secheadingskip | ||
| 4145 | \def\secheadingbreak{\dobreak \secheadingskip {-1000}} | ||
| 4146 | \def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} | ||
| 4147 | \def\plainsecheading#1{\sectionheading{sec}{}{#1}} | ||
| 4148 | |||
| 4149 | % Subsection titles. | ||
| 4150 | \newskip \subsecheadingskip | ||
| 4151 | \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} | ||
| 4152 | \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} | ||
| 4153 | \def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} | ||
| 4154 | |||
| 4155 | % Subsubsection titles. | ||
| 4156 | \let\subsubsecheadingskip = \subsecheadingskip | ||
| 4157 | \let\subsubsecheadingbreak = \subsecheadingbreak | ||
| 4158 | \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} | ||
| 4159 | \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} | ||
| 4160 | |||
| 4161 | |||
| 4162 | % Print any size section title. | ||
| 4163 | % | ||
| 4164 | % #1 is the section type (sec/subsec/subsubsec), #2 is the section | ||
| 4165 | % number (maybe empty), #3 the text. | ||
| 4166 | \def\sectionheading#1#2#3{% | ||
| 4167 | {% | ||
| 4168 | \expandafter\advance\csname #1headingskip\endcsname by \parskip | ||
| 4169 | \csname #1headingbreak\endcsname | ||
| 4170 | }% | ||
| 4171 | {% | ||
| 4172 | % Switch to the right set of fonts. | ||
| 4173 | \csname #1fonts\endcsname \rm | ||
| 4174 | % | ||
| 4175 | % Only insert the separating space if we have a section number. | ||
| 4176 | \def\secnum{#2}% | ||
| 4177 | \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% | ||
| 4178 | % | ||
| 4179 | \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright | ||
| 4180 | \hangindent = \wd0 % zero if no section number | ||
| 4181 | \unhbox0 #3}% | ||
| 4182 | }% | ||
| 4183 | % Add extra space after the heading -- either a line space or a | ||
| 4184 | % paragraph space, whichever is more. (Some people like to set | ||
| 4185 | % \parskip to large values for some reason.) Don't allow stretch, though. | ||
| 4186 | \nobreak | ||
| 4187 | \ifdim\parskip>\normalbaselineskip | ||
| 4188 | \kern\parskip | ||
| 4189 | \else | ||
| 4190 | \kern\normalbaselineskip | ||
| 4191 | \fi | ||
| 4192 | \nobreak | ||
| 4193 | } | ||
| 4194 | |||
| 4195 | |||
| 4196 | \message{toc,} | ||
| 4197 | % Table of contents. | ||
| 4198 | \newwrite\tocfile | ||
| 4199 | |||
| 4200 | % Write an entry to the toc file, opening it if necessary. | ||
| 4201 | % Called from @chapter, etc. We supply {\folio} at the end of the | ||
| 4202 | % argument, which will end up as the last argument to the \...entry macro. | ||
| 4203 | % | ||
| 4204 | % Usage: \writetocentry{chap}{The Name of The Game}{{\the\chapno}} | ||
| 4205 | % We open the .toc file for writing here instead of at @setfilename (or | ||
| 4206 | % any other fixed time) so that @contents can be anywhere in the document. | ||
| 4207 | % | ||
| 4208 | \newif\iftocfileopened | ||
| 4209 | \def\writetocentry#1#2#3{% | ||
| 4210 | \iftocfileopened\else | ||
| 4211 | \immediate\openout\tocfile = \jobname.toc | ||
| 4212 | \global\tocfileopenedtrue | ||
| 4213 | \fi | ||
| 4214 | % | ||
| 4215 | \iflinks | ||
| 4216 | \toks0 = {#2}% | ||
| 4217 | \edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}#3{\folio}}}% | ||
| 4218 | \temp | ||
| 4219 | \fi | ||
| 4220 | % | ||
| 4221 | % Tell \shipout to create a page destination if we're doing pdf, which | ||
| 4222 | % will be the target of the links in the table of contents. We can't | ||
| 4223 | % just do it on every page because the title pages are numbered 1 and | ||
| 4224 | % 2 (the page numbers aren't printed), and so are the first two pages | ||
| 4225 | % of the document. Thus, we'd have two destinations named `1', and | ||
| 4226 | % two named `2'. | ||
| 4227 | \ifpdf \pdfmakepagedesttrue \fi | ||
| 4228 | } | ||
| 4229 | |||
| 4230 | \newskip\contentsrightmargin \contentsrightmargin=1in | ||
| 4231 | \newcount\savepageno | ||
| 4232 | \newcount\lastnegativepageno \lastnegativepageno = -1 | ||
| 4233 | |||
| 4234 | % Finish up the main text and prepare to read what we've written | ||
| 4235 | % to \tocfile. | ||
| 4236 | % | ||
| 4237 | \def\startcontents#1{% | ||
| 4238 | % If @setchapternewpage on, and @headings double, the contents should | ||
| 4239 | % start on an odd page, unlike chapters. Thus, we maintain | ||
| 4240 | % \contentsalignmacro in parallel with \pagealignmacro. | ||
| 4241 | % From: Torbjorn Granlund <tege@matematik.su.se> | ||
| 4242 | \contentsalignmacro | ||
| 4243 | \immediate\closeout\tocfile | ||
| 4244 | % | ||
| 4245 | % Don't need to put `Contents' or `Short Contents' in the headline. | ||
| 4246 | % It is abundantly clear what they are. | ||
| 4247 | \unnumbchapmacro{#1}\def\thischapter{}% | ||
| 4248 | \savepageno = \pageno | ||
| 4249 | \begingroup % Set up to handle contents files properly. | ||
| 4250 | \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 | ||
| 4251 | % We can't do this, because then an actual ^ in a section | ||
| 4252 | % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. | ||
| 4253 | %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi | ||
| 4254 | \raggedbottom % Worry more about breakpoints than the bottom. | ||
| 4255 | \advance\hsize by -\contentsrightmargin % Don't use the full line length. | ||
| 4256 | % | ||
| 4257 | % Roman numerals for page numbers. | ||
| 4258 | \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi | ||
| 4259 | } | ||
| 4260 | |||
| 4261 | |||
| 4262 | % Normal (long) toc. | ||
| 4263 | \def\contents{% | ||
| 4264 | \startcontents{\putwordTOC}% | ||
| 4265 | \openin 1 \jobname.toc | ||
| 4266 | \ifeof 1 \else | ||
| 4267 | \closein 1 | ||
| 4268 | \input \jobname.toc | ||
| 4269 | \fi | ||
| 4270 | \vfill \eject | ||
| 4271 | \contentsalignmacro % in case @setchapternewpage odd is in effect | ||
| 4272 | \pdfmakeoutlines | ||
| 4273 | \endgroup | ||
| 4274 | \lastnegativepageno = \pageno | ||
| 4275 | \global\pageno = \savepageno | ||
| 4276 | } | ||
| 4277 | |||
| 4278 | % And just the chapters. | ||
| 4279 | \def\summarycontents{% | ||
| 4280 | \startcontents{\putwordShortTOC}% | ||
| 4281 | % | ||
| 4282 | \let\chapentry = \shortchapentry | ||
| 4283 | \let\appendixentry = \shortappendixentry | ||
| 4284 | \let\unnumbchapentry = \shortunnumberedentry | ||
| 4285 | % We want a true roman here for the page numbers. | ||
| 4286 | \secfonts | ||
| 4287 | \let\rm=\shortcontrm \let\bf=\shortcontbf | ||
| 4288 | \let\sl=\shortcontsl \let\tt=\shortconttt | ||
| 4289 | \rm | ||
| 4290 | \hyphenpenalty = 10000 | ||
| 4291 | \advance\baselineskip by 1pt % Open it up a little. | ||
| 4292 | \def\secentry ##1##2##3##4{} | ||
| 4293 | \def\subsecentry ##1##2##3##4##5{} | ||
| 4294 | \def\subsubsecentry ##1##2##3##4##5##6{} | ||
| 4295 | \let\unnumbsecentry = \secentry | ||
| 4296 | \let\unnumbsubsecentry = \subsecentry | ||
| 4297 | \let\unnumbsubsubsecentry = \subsubsecentry | ||
| 4298 | \openin 1 \jobname.toc | ||
| 4299 | \ifeof 1 \else | ||
| 4300 | \closein 1 | ||
| 4301 | \input \jobname.toc | ||
| 4302 | \fi | ||
| 4303 | \vfill \eject | ||
| 4304 | \contentsalignmacro % in case @setchapternewpage odd is in effect | ||
| 4305 | \endgroup | ||
| 4306 | \lastnegativepageno = \pageno | ||
| 4307 | \global\pageno = \savepageno | ||
| 4308 | } | ||
| 4309 | \let\shortcontents = \summarycontents | ||
| 4310 | |||
| 4311 | \ifpdf | ||
| 4312 | \pdfcatalog{/PageMode /UseOutlines}% | ||
| 4313 | \fi | ||
| 4314 | |||
| 4315 | % These macros generate individual entries in the table of contents. | ||
| 4316 | % The first argument is the chapter or section name. | ||
| 4317 | % The last argument is the page number. | ||
| 4318 | % The arguments in between are the chapter number, section number, ... | ||
| 4319 | |||
| 4320 | % Chapters, in the main contents. | ||
| 4321 | \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} | ||
| 4322 | % | ||
| 4323 | % Chapters, in the short toc. | ||
| 4324 | % See comments in \dochapentry re vbox and related settings. | ||
| 4325 | \def\shortchapentry#1#2#3{% | ||
| 4326 | \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% | ||
| 4327 | } | ||
| 4328 | |||
| 4329 | % Appendices, in the main contents. | ||
| 4330 | \def\appendixentry#1#2#3{% | ||
| 4331 | \dochapentry{\appendixbox{\putwordAppendix{} #2}\labelspace#1}{#3}} | ||
| 4332 | % | ||
| 4333 | % Appendices, in the short toc. | ||
| 4334 | \let\shortappendixentry = \shortchapentry | ||
| 4335 | |||
| 4336 | % Typeset the label for a chapter or appendix for the short contents. | ||
| 4337 | % The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter. | ||
| 4338 | % We could simplify the code here by writing out an \appendixentry | ||
| 4339 | % command in the toc file for appendices, instead of using \chapentry | ||
| 4340 | % for both, but it doesn't seem worth it. | ||
| 4341 | % | ||
| 4342 | \newdimen\shortappendixwidth | ||
| 4343 | % | ||
| 4344 | \def\shortchaplabel#1{% | ||
| 4345 | % This space should be enough, since a single number is .5em, and the | ||
| 4346 | % widest letter (M) is 1em, at least in the Computer Modern fonts. | ||
| 4347 | % But use \hss just in case. | ||
| 4348 | % (This space doesn't include the extra space that gets added after | ||
| 4349 | % the label; that gets put in by \shortchapentry above.) | ||
| 4350 | \dimen0 = 1em | ||
| 4351 | \hbox to \dimen0{#1\hss}% | ||
| 4352 | } | ||
| 4353 | |||
| 4354 | % Unnumbered chapters. | ||
| 4355 | \def\unnumbchapentry#1#2#3{\dochapentry{#1}{#3}} | ||
| 4356 | \def\shortunnumberedentry#1#2#3{\tocentry{#1}{\doshortpageno\bgroup#3\egroup}} | ||
| 4357 | |||
| 4358 | % Sections. | ||
| 4359 | \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} | ||
| 4360 | \def\unnumbsecentry#1#2#3#4{\dosecentry{#1}{#4}} | ||
| 4361 | |||
| 4362 | % Subsections. | ||
| 4363 | \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} | ||
| 4364 | \def\unnumbsubsecentry#1#2#3#4#5{\dosubsecentry{#1}{#5}} | ||
| 4365 | |||
| 4366 | % And subsubsections. | ||
| 4367 | \def\subsubsecentry#1#2#3#4#5#6{% | ||
| 4368 | \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} | ||
| 4369 | \def\unnumbsubsubsecentry#1#2#3#4#5#6{\dosubsubsecentry{#1}{#6}} | ||
| 4370 | |||
| 4371 | % This parameter controls the indentation of the various levels. | ||
| 4372 | \newdimen\tocindent \tocindent = 3pc | ||
| 4373 | |||
| 4374 | % Now for the actual typesetting. In all these, #1 is the text and #2 is the | ||
| 4375 | % page number. | ||
| 4376 | % | ||
| 4377 | % If the toc has to be broken over pages, we want it to be at chapters | ||
| 4378 | % if at all possible; hence the \penalty. | ||
| 4379 | \def\dochapentry#1#2{% | ||
| 4380 | \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip | ||
| 4381 | \begingroup | ||
| 4382 | \chapentryfonts | ||
| 4383 | \tocentry{#1}{\dopageno\bgroup#2\egroup}% | ||
| 4384 | \endgroup | ||
| 4385 | \nobreak\vskip .25\baselineskip plus.1\baselineskip | ||
| 4386 | } | ||
| 4387 | |||
| 4388 | \def\dosecentry#1#2{\begingroup | ||
| 4389 | \secentryfonts \leftskip=\tocindent | ||
| 4390 | \tocentry{#1}{\dopageno\bgroup#2\egroup}% | ||
| 4391 | \endgroup} | ||
| 4392 | |||
| 4393 | \def\dosubsecentry#1#2{\begingroup | ||
| 4394 | \subsecentryfonts \leftskip=2\tocindent | ||
| 4395 | \tocentry{#1}{\dopageno\bgroup#2\egroup}% | ||
| 4396 | \endgroup} | ||
| 4397 | |||
| 4398 | \def\dosubsubsecentry#1#2{\begingroup | ||
| 4399 | \subsubsecentryfonts \leftskip=3\tocindent | ||
| 4400 | \tocentry{#1}{\dopageno\bgroup#2\egroup}% | ||
| 4401 | \endgroup} | ||
| 4402 | |||
| 4403 | % Final typesetting of a toc entry; we use the same \entry macro as for | ||
| 4404 | % the index entries, but we want to suppress hyphenation here. (We | ||
| 4405 | % can't do that in the \entry macro, since index entries might consist | ||
| 4406 | % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) | ||
| 4407 | \def\tocentry#1#2{\begingroup | ||
| 4408 | \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks | ||
| 4409 | % Do not use \turnoffactive in these arguments. Since the toc is | ||
| 4410 | % typeset in cmr, characters such as _ would come out wrong; we | ||
| 4411 | % have to do the usual translation tricks. | ||
| 4412 | \entry{#1}{#2}% | ||
| 4413 | \endgroup} | ||
| 4414 | |||
| 4415 | % Space between chapter (or whatever) number and the title. | ||
| 4416 | \def\labelspace{\hskip1em \relax} | ||
| 4417 | |||
| 4418 | \def\dopageno#1{{\rm #1}} | ||
| 4419 | \def\doshortpageno#1{{\rm #1}} | ||
| 4420 | |||
| 4421 | \def\chapentryfonts{\secfonts \rm} | ||
| 4422 | \def\secentryfonts{\textfonts} | ||
| 4423 | \let\subsecentryfonts = \textfonts | ||
| 4424 | \let\subsubsecentryfonts = \textfonts | ||
| 4425 | |||
| 4426 | |||
| 4427 | \message{environments,} | ||
| 4428 | % @foo ... @end foo. | ||
| 4429 | |||
| 4430 | % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. | ||
| 4431 | % | ||
| 4432 | % Since these characters are used in examples, it should be an even number of | ||
| 4433 | % \tt widths. Each \tt character is 1en, so two makes it 1em. | ||
| 4434 | % | ||
| 4435 | \def\point{$\star$} | ||
| 4436 | \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} | ||
| 4437 | \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} | ||
| 4438 | \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} | ||
| 4439 | \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} | ||
| 4440 | |||
| 4441 | % The @error{} command. | ||
| 4442 | % Adapted from the TeXbook's \boxit. | ||
| 4443 | % | ||
| 4444 | \newbox\errorbox | ||
| 4445 | % | ||
| 4446 | {\tentt \global\dimen0 = 3em}% Width of the box. | ||
| 4447 | \dimen2 = .55pt % Thickness of rules | ||
| 4448 | % The text. (`r' is open on the right, `e' somewhat less so on the left.) | ||
| 4449 | \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} | ||
| 4450 | % | ||
| 4451 | \global\setbox\errorbox=\hbox to \dimen0{\hfil | ||
| 4452 | \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. | ||
| 4453 | \advance\hsize by -2\dimen2 % Rules. | ||
| 4454 | \vbox{ | ||
| 4455 | \hrule height\dimen2 | ||
| 4456 | \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. | ||
| 4457 | \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. | ||
| 4458 | \kern3pt\vrule width\dimen2}% Space to right. | ||
| 4459 | \hrule height\dimen2} | ||
| 4460 | \hfil} | ||
| 4461 | % | ||
| 4462 | \def\error{\leavevmode\lower.7ex\copy\errorbox} | ||
| 4463 | |||
| 4464 | % @tex ... @end tex escapes into raw Tex temporarily. | ||
| 4465 | % One exception: @ is still an escape character, so that @end tex works. | ||
| 4466 | % But \@ or @@ will get a plain tex @ character. | ||
| 4467 | |||
| 4468 | \def\tex{\begingroup | ||
| 4469 | \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 | ||
| 4470 | \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 | ||
| 4471 | \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie | ||
| 4472 | \catcode `\%=14 | ||
| 4473 | \catcode `\+=\other | ||
| 4474 | \catcode `\"=\other | ||
| 4475 | \catcode `\==\other | ||
| 4476 | \catcode `\|=\other | ||
| 4477 | \catcode `\<=\other | ||
| 4478 | \catcode `\>=\other | ||
| 4479 | \escapechar=`\\ | ||
| 4480 | % | ||
| 4481 | \let\b=\ptexb | ||
| 4482 | \let\bullet=\ptexbullet | ||
| 4483 | \let\c=\ptexc | ||
| 4484 | \let\,=\ptexcomma | ||
| 4485 | \let\.=\ptexdot | ||
| 4486 | \let\dots=\ptexdots | ||
| 4487 | \let\equiv=\ptexequiv | ||
| 4488 | \let\!=\ptexexclam | ||
| 4489 | \let\i=\ptexi | ||
| 4490 | \let\indent=\ptexindent | ||
| 4491 | \let\{=\ptexlbrace | ||
| 4492 | \let\+=\tabalign | ||
| 4493 | \let\}=\ptexrbrace | ||
| 4494 | \let\/=\ptexslash | ||
| 4495 | \let\*=\ptexstar | ||
| 4496 | \let\t=\ptext | ||
| 4497 | % | ||
| 4498 | \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% | ||
| 4499 | \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% | ||
| 4500 | \def\@{@}% | ||
| 4501 | \let\Etex=\endgroup} | ||
| 4502 | |||
| 4503 | % Define @lisp ... @end lisp. | ||
| 4504 | % @lisp does a \begingroup so it can rebind things, | ||
| 4505 | % including the definition of @end lisp (which normally is erroneous). | ||
| 4506 | |||
| 4507 | % Amount to narrow the margins by for @lisp. | ||
| 4508 | \newskip\lispnarrowing \lispnarrowing=0.4in | ||
| 4509 | |||
| 4510 | % This is the definition that ^^M gets inside @lisp, @example, and other | ||
| 4511 | % such environments. \null is better than a space, since it doesn't | ||
| 4512 | % have any width. | ||
| 4513 | \def\lisppar{\null\endgraf} | ||
| 4514 | |||
| 4515 | % Make each space character in the input produce a normal interword | ||
| 4516 | % space in the output. Don't allow a line break at this space, as this | ||
| 4517 | % is used only in environments like @example, where each line of input | ||
| 4518 | % should produce a line of output anyway. | ||
| 4519 | % | ||
| 4520 | {\obeyspaces % | ||
| 4521 | \gdef\sepspaces{\obeyspaces\let =\tie}} | ||
| 4522 | |||
| 4523 | % Define \obeyedspace to be our active space, whatever it is. This is | ||
| 4524 | % for use in \parsearg. | ||
| 4525 | {\sepspaces% | ||
| 4526 | \global\let\obeyedspace= } | ||
| 4527 | |||
| 4528 | % This space is always present above and below environments. | ||
| 4529 | \newskip\envskipamount \envskipamount = 0pt | ||
| 4530 | |||
| 4531 | % Make spacing and below environment symmetrical. We use \parskip here | ||
| 4532 | % to help in doing that, since in @example-like environments \parskip | ||
| 4533 | % is reset to zero; thus the \afterenvbreak inserts no space -- but the | ||
| 4534 | % start of the next paragraph will insert \parskip. | ||
| 4535 | % | ||
| 4536 | \def\aboveenvbreak{{% | ||
| 4537 | % =10000 instead of <10000 because of a special case in \itemzzz, q.v. | ||
| 4538 | \ifnum \lastpenalty=10000 \else | ||
| 4539 | \advance\envskipamount by \parskip | ||
| 4540 | \endgraf | ||
| 4541 | \ifdim\lastskip<\envskipamount | ||
| 4542 | \removelastskip | ||
| 4543 | % it's not a good place to break if the last penalty was \nobreak | ||
| 4544 | % or better ... | ||
| 4545 | \ifnum\lastpenalty>10000 \else \penalty-50 \fi | ||
| 4546 | \vskip\envskipamount | ||
| 4547 | \fi | ||
| 4548 | \fi | ||
| 4549 | }} | ||
| 4550 | |||
| 4551 | \let\afterenvbreak = \aboveenvbreak | ||
| 4552 | |||
| 4553 | % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. | ||
| 4554 | \let\nonarrowing=\relax | ||
| 4555 | |||
| 4556 | % @cartouche ... @end cartouche: draw rectangle w/rounded corners around | ||
| 4557 | % environment contents. | ||
| 4558 | \font\circle=lcircle10 | ||
| 4559 | \newdimen\circthick | ||
| 4560 | \newdimen\cartouter\newdimen\cartinner | ||
| 4561 | \newskip\normbskip\newskip\normpskip\newskip\normlskip | ||
| 4562 | \circthick=\fontdimen8\circle | ||
| 4563 | % | ||
| 4564 | \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth | ||
| 4565 | \def\ctr{{\hskip 6pt\circle\char'010}} | ||
| 4566 | \def\cbl{{\circle\char'012\hskip -6pt}} | ||
| 4567 | \def\cbr{{\hskip 6pt\circle\char'011}} | ||
| 4568 | \def\carttop{\hbox to \cartouter{\hskip\lskip | ||
| 4569 | \ctl\leaders\hrule height\circthick\hfil\ctr | ||
| 4570 | \hskip\rskip}} | ||
| 4571 | \def\cartbot{\hbox to \cartouter{\hskip\lskip | ||
| 4572 | \cbl\leaders\hrule height\circthick\hfil\cbr | ||
| 4573 | \hskip\rskip}} | ||
| 4574 | % | ||
| 4575 | \newskip\lskip\newskip\rskip | ||
| 4576 | |||
| 4577 | \def\cartouche{% | ||
| 4578 | \par % can't be in the midst of a paragraph. | ||
| 4579 | \begingroup | ||
| 4580 | \lskip=\leftskip \rskip=\rightskip | ||
| 4581 | \leftskip=0pt\rightskip=0pt %we want these *outside*. | ||
| 4582 | \cartinner=\hsize \advance\cartinner by-\lskip | ||
| 4583 | \advance\cartinner by-\rskip | ||
| 4584 | \cartouter=\hsize | ||
| 4585 | \advance\cartouter by 18.4pt % allow for 3pt kerns on either | ||
| 4586 | % side, and for 6pt waste from | ||
| 4587 | % each corner char, and rule thickness | ||
| 4588 | \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip | ||
| 4589 | % Flag to tell @lisp, etc., not to narrow margin. | ||
| 4590 | \let\nonarrowing=\comment | ||
| 4591 | \vbox\bgroup | ||
| 4592 | \baselineskip=0pt\parskip=0pt\lineskip=0pt | ||
| 4593 | \carttop | ||
| 4594 | \hbox\bgroup | ||
| 4595 | \hskip\lskip | ||
| 4596 | \vrule\kern3pt | ||
| 4597 | \vbox\bgroup | ||
| 4598 | \hsize=\cartinner | ||
| 4599 | \kern3pt | ||
| 4600 | \begingroup | ||
| 4601 | \baselineskip=\normbskip | ||
| 4602 | \lineskip=\normlskip | ||
| 4603 | \parskip=\normpskip | ||
| 4604 | \vskip -\parskip | ||
| 4605 | \def\Ecartouche{% | ||
| 4606 | \endgroup | ||
| 4607 | \kern3pt | ||
| 4608 | \egroup | ||
| 4609 | \kern3pt\vrule | ||
| 4610 | \hskip\rskip | ||
| 4611 | \egroup | ||
| 4612 | \cartbot | ||
| 4613 | \egroup | ||
| 4614 | \endgroup | ||
| 4615 | }} | ||
| 4616 | |||
| 4617 | |||
| 4618 | % This macro is called at the beginning of all the @example variants, | ||
| 4619 | % inside a group. | ||
| 4620 | \def\nonfillstart{% | ||
| 4621 | \aboveenvbreak | ||
| 4622 | \inENV % This group ends at the end of the body | ||
| 4623 | \hfuzz = 12pt % Don't be fussy | ||
| 4624 | \sepspaces % Make spaces be word-separators rather than space tokens. | ||
| 4625 | \let\par = \lisppar % don't ignore blank lines | ||
| 4626 | \obeylines % each line of input is a line of output | ||
| 4627 | \parskip = 0pt | ||
| 4628 | \parindent = 0pt | ||
| 4629 | \emergencystretch = 0pt % don't try to avoid overfull boxes | ||
| 4630 | % @cartouche defines \nonarrowing to inhibit narrowing | ||
| 4631 | % at next level down. | ||
| 4632 | \ifx\nonarrowing\relax | ||
| 4633 | \advance \leftskip by \lispnarrowing | ||
| 4634 | \exdentamount=\lispnarrowing | ||
| 4635 | \let\exdent=\nofillexdent | ||
| 4636 | \let\nonarrowing=\relax | ||
| 4637 | \fi | ||
| 4638 | } | ||
| 4639 | |||
| 4640 | % Define the \E... control sequence only if we are inside the particular | ||
| 4641 | % environment, so the error checking in \end will work. | ||
| 4642 | % | ||
| 4643 | % To end an @example-like environment, we first end the paragraph (via | ||
| 4644 | % \afterenvbreak's vertical glue), and then the group. That way we keep | ||
| 4645 | % the zero \parskip that the environments set -- \parskip glue will be | ||
| 4646 | % inserted at the beginning of the next paragraph in the document, after | ||
| 4647 | % the environment. | ||
| 4648 | % | ||
| 4649 | \def\nonfillfinish{\afterenvbreak\endgroup} | ||
| 4650 | |||
| 4651 | % @lisp: indented, narrowed, typewriter font. | ||
| 4652 | \def\lisp{\begingroup | ||
| 4653 | \nonfillstart | ||
| 4654 | \let\Elisp = \nonfillfinish | ||
| 4655 | \tt | ||
| 4656 | \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. | ||
| 4657 | \gobble % eat return | ||
| 4658 | } | ||
| 4659 | |||
| 4660 | % @example: Same as @lisp. | ||
| 4661 | \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} | ||
| 4662 | |||
| 4663 | % @smallexample and @smalllisp: use smaller fonts. | ||
| 4664 | % Originally contributed by Pavel@xerox. | ||
| 4665 | \def\smalllisp{\begingroup | ||
| 4666 | \def\Esmalllisp{\nonfillfinish\endgroup}% | ||
| 4667 | \def\Esmallexample{\nonfillfinish\endgroup}% | ||
| 4668 | \smallexamplefonts | ||
| 4669 | \lisp | ||
| 4670 | } | ||
| 4671 | \let\smallexample = \smalllisp | ||
| 4672 | |||
| 4673 | |||
| 4674 | % @display: same as @lisp except keep current font. | ||
| 4675 | % | ||
| 4676 | \def\display{\begingroup | ||
| 4677 | \nonfillstart | ||
| 4678 | \let\Edisplay = \nonfillfinish | ||
| 4679 | \gobble | ||
| 4680 | } | ||
| 4681 | % | ||
| 4682 | % @smalldisplay: @display plus smaller fonts. | ||
| 4683 | % | ||
| 4684 | \def\smalldisplay{\begingroup | ||
| 4685 | \def\Esmalldisplay{\nonfillfinish\endgroup}% | ||
| 4686 | \smallexamplefonts \rm | ||
| 4687 | \display | ||
| 4688 | } | ||
| 4689 | |||
| 4690 | % @format: same as @display except don't narrow margins. | ||
| 4691 | % | ||
| 4692 | \def\format{\begingroup | ||
| 4693 | \let\nonarrowing = t | ||
| 4694 | \nonfillstart | ||
| 4695 | \let\Eformat = \nonfillfinish | ||
| 4696 | \gobble | ||
| 4697 | } | ||
| 4698 | % | ||
| 4699 | % @smallformat: @format plus smaller fonts. | ||
| 4700 | % | ||
| 4701 | \def\smallformat{\begingroup | ||
| 4702 | \def\Esmallformat{\nonfillfinish\endgroup}% | ||
| 4703 | \smallexamplefonts \rm | ||
| 4704 | \format | ||
| 4705 | } | ||
| 4706 | |||
| 4707 | % @flushleft (same as @format). | ||
| 4708 | % | ||
| 4709 | \def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} | ||
| 4710 | |||
| 4711 | % @flushright. | ||
| 4712 | % | ||
| 4713 | \def\flushright{\begingroup | ||
| 4714 | \let\nonarrowing = t | ||
| 4715 | \nonfillstart | ||
| 4716 | \let\Eflushright = \nonfillfinish | ||
| 4717 | \advance\leftskip by 0pt plus 1fill | ||
| 4718 | \gobble | ||
| 4719 | } | ||
| 4720 | |||
| 4721 | |||
| 4722 | % @quotation does normal linebreaking (hence we can't use \nonfillstart) | ||
| 4723 | % and narrows the margins. | ||
| 4724 | % | ||
| 4725 | \def\quotation{% | ||
| 4726 | \begingroup\inENV %This group ends at the end of the @quotation body | ||
| 4727 | {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip | ||
| 4728 | \parindent=0pt | ||
| 4729 | % We have retained a nonzero parskip for the environment, since we're | ||
| 4730 | % doing normal filling. So to avoid extra space below the environment... | ||
| 4731 | \def\Equotation{\parskip = 0pt \nonfillfinish}% | ||
| 4732 | % | ||
| 4733 | % @cartouche defines \nonarrowing to inhibit narrowing at next level down. | ||
| 4734 | \ifx\nonarrowing\relax | ||
| 4735 | \advance\leftskip by \lispnarrowing | ||
| 4736 | \advance\rightskip by \lispnarrowing | ||
| 4737 | \exdentamount = \lispnarrowing | ||
| 4738 | \let\nonarrowing = \relax | ||
| 4739 | \fi | ||
| 4740 | } | ||
| 4741 | |||
| 4742 | |||
| 4743 | % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>} | ||
| 4744 | % If we want to allow any <char> as delimiter, | ||
| 4745 | % we need the curly braces so that makeinfo sees the @verb command, eg: | ||
| 4746 | % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org | ||
| 4747 | % | ||
| 4748 | % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. | ||
| 4749 | % | ||
| 4750 | % [Knuth] p.344; only we need to do the other characters Texinfo sets | ||
| 4751 | % active too. Otherwise, they get lost as the first character on a | ||
| 4752 | % verbatim line. | ||
| 4753 | \def\dospecials{% | ||
| 4754 | \do\ \do\\\do\{\do\}\do\$\do\&% | ||
| 4755 | \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% | ||
| 4756 | \do\<\do\>\do\|\do\@\do+\do\"% | ||
| 4757 | } | ||
| 4758 | % | ||
| 4759 | % [Knuth] p. 380 | ||
| 4760 | \def\uncatcodespecials{% | ||
| 4761 | \def\do##1{\catcode`##1=12}\dospecials} | ||
| 4762 | % | ||
| 4763 | % [Knuth] pp. 380,381,391 | ||
| 4764 | % Disable Spanish ligatures ?` and !` of \tt font | ||
| 4765 | \begingroup | ||
| 4766 | \catcode`\`=\active\gdef`{\relax\lq} | ||
| 4767 | \endgroup | ||
| 4768 | % | ||
| 4769 | % Setup for the @verb command. | ||
| 4770 | % | ||
| 4771 | % Eight spaces for a tab | ||
| 4772 | \begingroup | ||
| 4773 | \catcode`\^^I=\active | ||
| 4774 | \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} | ||
| 4775 | \endgroup | ||
| 4776 | % | ||
| 4777 | \def\setupverb{% | ||
| 4778 | \tt % easiest (and conventionally used) font for verbatim | ||
| 4779 | \def\par{\leavevmode\endgraf}% | ||
| 4780 | \catcode`\`=\active | ||
| 4781 | \tabeightspaces | ||
| 4782 | % Respect line breaks, | ||
| 4783 | % print special symbols as themselves, and | ||
| 4784 | % make each space count | ||
| 4785 | % must do in this order: | ||
| 4786 | \obeylines \uncatcodespecials \sepspaces | ||
| 4787 | } | ||
| 4788 | |||
| 4789 | % Setup for the @verbatim environment | ||
| 4790 | % | ||
| 4791 | % Real tab expansion | ||
| 4792 | \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount | ||
| 4793 | % | ||
| 4794 | \def\starttabbox{\setbox0=\hbox\bgroup} | ||
| 4795 | \begingroup | ||
| 4796 | \catcode`\^^I=\active | ||
| 4797 | \gdef\tabexpand{% | ||
| 4798 | \catcode`\^^I=\active | ||
| 4799 | \def^^I{\leavevmode\egroup | ||
| 4800 | \dimen0=\wd0 % the width so far, or since the previous tab | ||
| 4801 | \divide\dimen0 by\tabw | ||
| 4802 | \multiply\dimen0 by\tabw % compute previous multiple of \tabw | ||
| 4803 | \advance\dimen0 by\tabw % advance to next multiple of \tabw | ||
| 4804 | \wd0=\dimen0 \box0 \starttabbox | ||
| 4805 | }% | ||
| 4806 | } | ||
| 4807 | \endgroup | ||
| 4808 | \def\setupverbatim{% | ||
| 4809 | % Easiest (and conventionally used) font for verbatim | ||
| 4810 | \tt | ||
| 4811 | \def\par{\leavevmode\egroup\box0\endgraf}% | ||
| 4812 | \catcode`\`=\active | ||
| 4813 | \tabexpand | ||
| 4814 | % Respect line breaks, | ||
| 4815 | % print special symbols as themselves, and | ||
| 4816 | % make each space count | ||
| 4817 | % must do in this order: | ||
| 4818 | \obeylines \uncatcodespecials \sepspaces | ||
| 4819 | \everypar{\starttabbox}% | ||
| 4820 | } | ||
| 4821 | |||
| 4822 | % Do the @verb magic: verbatim text is quoted by unique | ||
| 4823 | % delimiter characters. Before first delimiter expect a | ||
| 4824 | % right brace, after last delimiter expect closing brace: | ||
| 4825 | % | ||
| 4826 | % \def\doverb'{'<char>#1<char>'}'{#1} | ||
| 4827 | % | ||
| 4828 | % [Knuth] p. 382; only eat outer {} | ||
| 4829 | \begingroup | ||
| 4830 | \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12 | ||
| 4831 | \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] | ||
| 4832 | \endgroup | ||
| 4833 | % | ||
| 4834 | \def\verb{\begingroup\setupverb\doverb} | ||
| 4835 | % | ||
| 4836 | % | ||
| 4837 | % Do the @verbatim magic: define the macro \doverbatim so that | ||
| 4838 | % the (first) argument ends when '@end verbatim' is reached, ie: | ||
| 4839 | % | ||
| 4840 | % \def\doverbatim#1@end verbatim{#1} | ||
| 4841 | % | ||
| 4842 | % For Texinfo it's a lot easier than for LaTeX, | ||
| 4843 | % because texinfo's \verbatim doesn't stop at '\end{verbatim}': | ||
| 4844 | % we need not redefine '\', '{' and '}'. | ||
| 4845 | % | ||
| 4846 | % Inspired by LaTeX's verbatim command set [latex.ltx] | ||
| 4847 | %% Include LaTeX hack for completeness -- never know | ||
| 4848 | %% \begingroup | ||
| 4849 | %% \catcode`|=0 \catcode`[=1 | ||
| 4850 | %% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active | ||
| 4851 | %% \catcode`\\=12|gdef|doverbatim#1@end verbatim[ | ||
| 4852 | %% #1|endgroup|def|Everbatim[]|end[verbatim]] | ||
| 4853 | %% |endgroup | ||
| 4854 | % | ||
| 4855 | \begingroup | ||
| 4856 | \catcode`\ =\active | ||
| 4857 | \obeylines % | ||
| 4858 | % ignore everything up to the first ^^M, that's the newline at the end | ||
| 4859 | % of the @verbatim input line itself. Otherwise we get an extra blank | ||
| 4860 | % line in the output. | ||
| 4861 | \gdef\doverbatim#1^^M#2@end verbatim{#2\end{verbatim}}% | ||
| 4862 | \endgroup | ||
| 4863 | % | ||
| 4864 | \def\verbatim{% | ||
| 4865 | \def\Everbatim{\nonfillfinish\endgroup}% | ||
| 4866 | \begingroup | ||
| 4867 | \nonfillstart | ||
| 4868 | \advance\leftskip by -\defbodyindent | ||
| 4869 | \begingroup\setupverbatim\doverbatim | ||
| 4870 | } | ||
| 4871 | |||
| 4872 | % @verbatiminclude FILE - insert text of file in verbatim environment. | ||
| 4873 | % | ||
| 4874 | % Allow normal characters that we make active in the argument (a file name). | ||
| 4875 | \def\verbatiminclude{% | ||
| 4876 | \begingroup | ||
| 4877 | \catcode`\\=\other | ||
| 4878 | \catcode`~=\other | ||
| 4879 | \catcode`^=\other | ||
| 4880 | \catcode`_=\other | ||
| 4881 | \catcode`|=\other | ||
| 4882 | \catcode`<=\other | ||
| 4883 | \catcode`>=\other | ||
| 4884 | \catcode`+=\other | ||
| 4885 | \parsearg\doverbatiminclude | ||
| 4886 | } | ||
| 4887 | \def\setupverbatiminclude{% | ||
| 4888 | \begingroup | ||
| 4889 | \nonfillstart | ||
| 4890 | \advance\leftskip by -\defbodyindent | ||
| 4891 | \begingroup\setupverbatim | ||
| 4892 | } | ||
| 4893 | % | ||
| 4894 | \def\doverbatiminclude#1{% | ||
| 4895 | % Restore active chars for included file. | ||
| 4896 | \endgroup | ||
| 4897 | \begingroup | ||
| 4898 | \let\value=\expandablevalue | ||
| 4899 | \def\thisfile{#1}% | ||
| 4900 | \expandafter\expandafter\setupverbatiminclude\input\thisfile | ||
| 4901 | \endgroup | ||
| 4902 | \nonfillfinish | ||
| 4903 | \endgroup | ||
| 4904 | } | ||
| 4905 | |||
| 4906 | % @copying ... @end copying. | ||
| 4907 | % Save the text away for @insertcopying later. Many commands won't be | ||
| 4908 | % allowed in this context, but that's ok. | ||
| 4909 | % | ||
| 4910 | % We save the uninterpreted tokens, rather than creating a box. | ||
| 4911 | % Saving the text in a box would be much easier, but then all the | ||
| 4912 | % typesetting commands (@smallbook, font changes, etc.) have to be done | ||
| 4913 | % beforehand -- and a) we want @copying to be done first in the source | ||
| 4914 | % file; b) letting users define the frontmatter in as flexible order as | ||
| 4915 | % possible is very desirable. | ||
| 4916 | % | ||
| 4917 | \def\copying{\begingroup | ||
| 4918 | % Define a command to swallow text until we reach `@end copying'. | ||
| 4919 | % \ is the escape char in this texinfo.tex file, so it is the | ||
| 4920 | % delimiter for the command; @ will be the escape char when we read | ||
| 4921 | % it, but that doesn't matter. | ||
| 4922 | \long\def\docopying##1\end copying{\gdef\copyingtext{##1}\enddocopying}% | ||
| 4923 | % | ||
| 4924 | % We must preserve ^^M's in the input file; see \insertcopying below. | ||
| 4925 | \catcode`\^^M = \active | ||
| 4926 | \docopying | ||
| 4927 | } | ||
| 4928 | |||
| 4929 | % What we do to finish off the copying text. | ||
| 4930 | % | ||
| 4931 | \def\enddocopying{\endgroup\ignorespaces} | ||
| 4932 | |||
| 4933 | % @insertcopying. Here we must play games with ^^M's. On the one hand, | ||
| 4934 | % we need them to delimit commands such as `@end quotation', so they | ||
| 4935 | % must be active. On the other hand, we certainly don't want every | ||
| 4936 | % end-of-line to be a \par, as would happen with the normal active | ||
| 4937 | % definition of ^^M. On the third hand, two ^^M's in a row should still | ||
| 4938 | % generate a \par. | ||
| 4939 | % | ||
| 4940 | % Our approach is to make ^^M insert a space and a penalty1 normally; | ||
| 4941 | % then it can also check if \lastpenalty=1. If it does, then manually | ||
| 4942 | % do \par. | ||
| 4943 | % | ||
| 4944 | % This messes up the normal definitions of @c[omment], so we redefine | ||
| 4945 | % it. Similarly for @ignore. (These commands are used in the gcc | ||
| 4946 | % manual for man page generation.) | ||
| 4947 | % | ||
| 4948 | % Seems pretty fragile, most line-oriented commands will presumably | ||
| 4949 | % fail, but for the limited use of getting the copying text (which | ||
| 4950 | % should be quite simple) inserted, we can hope it's ok. | ||
| 4951 | % | ||
| 4952 | {\catcode`\^^M=\active % | ||
| 4953 | \gdef\insertcopying{\begingroup % | ||
| 4954 | \parindent = 0pt % looks wrong on title page | ||
| 4955 | \def^^M{% | ||
| 4956 | \ifnum \lastpenalty=1 % | ||
| 4957 | \par % | ||
| 4958 | \else % | ||
| 4959 | \space \penalty 1 % | ||
| 4960 | \fi % | ||
| 4961 | }% | ||
| 4962 | % | ||
| 4963 | % Fix @c[omment] for catcode 13 ^^M's. | ||
| 4964 | \def\c##1^^M{\ignorespaces}% | ||
| 4965 | \let\comment = \c % | ||
| 4966 | % | ||
| 4967 | % Don't bother jumping through all the hoops that \doignore does, it | ||
| 4968 | % would be very hard since the catcodes are already set. | ||
| 4969 | \long\def\ignore##1\end ignore{\ignorespaces}% | ||
| 4970 | % | ||
| 4971 | \copyingtext % | ||
| 4972 | \endgroup}% | ||
| 4973 | } | ||
| 4974 | |||
| 4975 | \message{defuns,} | ||
| 4976 | % @defun etc. | ||
| 4977 | |||
| 4978 | % Allow user to change definition object font (\df) internally | ||
| 4979 | \def\setdeffont#1 {\csname DEF#1\endcsname} | ||
| 4980 | |||
| 4981 | \newskip\defbodyindent \defbodyindent=.4in | ||
| 4982 | \newskip\defargsindent \defargsindent=50pt | ||
| 4983 | \newskip\deflastargmargin \deflastargmargin=18pt | ||
| 4984 | |||
| 4985 | \newcount\parencount | ||
| 4986 | |||
| 4987 | % We want ()&[] to print specially on the defun line. | ||
| 4988 | % | ||
| 4989 | \def\activeparens{% | ||
| 4990 | \catcode`\(=\active \catcode`\)=\active | ||
| 4991 | \catcode`\&=\active | ||
| 4992 | \catcode`\[=\active \catcode`\]=\active | ||
| 4993 | } | ||
| 4994 | |||
| 4995 | % Make control sequences which act like normal parenthesis chars. | ||
| 4996 | \let\lparen = ( \let\rparen = ) | ||
| 4997 | |||
| 4998 | {\activeparens % Now, smart parens don't turn on until &foo (see \amprm) | ||
| 4999 | |||
| 5000 | % Be sure that we always have a definition for `(', etc. For example, | ||
| 5001 | % if the fn name has parens in it, \boldbrax will not be in effect yet, | ||
| 5002 | % so TeX would otherwise complain about undefined control sequence. | ||
| 5003 | \global\let(=\lparen \global\let)=\rparen | ||
| 5004 | \global\let[=\lbrack \global\let]=\rbrack | ||
| 5005 | |||
| 5006 | \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } | ||
| 5007 | \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} | ||
| 5008 | % This is used to turn on special parens | ||
| 5009 | % but make & act ordinary (given that it's active). | ||
| 5010 | \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} | ||
| 5011 | |||
| 5012 | % Definitions of (, ) and & used in args for functions. | ||
| 5013 | % This is the definition of ( outside of all parentheses. | ||
| 5014 | \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested | ||
| 5015 | \global\advance\parencount by 1 | ||
| 5016 | } | ||
| 5017 | % | ||
| 5018 | % This is the definition of ( when already inside a level of parens. | ||
| 5019 | \gdef\opnested{\char`\(\global\advance\parencount by 1 } | ||
| 5020 | % | ||
| 5021 | \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. | ||
| 5022 | % also in that case restore the outer-level definition of (. | ||
| 5023 | \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi | ||
| 5024 | \global\advance \parencount by -1 } | ||
| 5025 | % If we encounter &foo, then turn on ()-hacking afterwards | ||
| 5026 | \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } | ||
| 5027 | % | ||
| 5028 | \gdef\normalparens{\boldbrax\let&=\ampnr} | ||
| 5029 | } % End of definition inside \activeparens | ||
| 5030 | %% These parens (in \boldbrax) actually are a little bolder than the | ||
| 5031 | %% contained text. This is especially needed for [ and ] | ||
| 5032 | \def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } | ||
| 5033 | \def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } | ||
| 5034 | \let\ampnr = \& | ||
| 5035 | \def\lbrb{{\bf\char`\[}} | ||
| 5036 | \def\rbrb{{\bf\char`\]}} | ||
| 5037 | |||
| 5038 | % Active &'s sneak into the index arguments, so make sure it's defined. | ||
| 5039 | { | ||
| 5040 | \catcode`& = \active | ||
| 5041 | \global\let& = \ampnr | ||
| 5042 | } | ||
| 5043 | |||
| 5044 | % \defname, which formats the name of the @def (not the args). | ||
| 5045 | % #1 is the function name. | ||
| 5046 | % #2 is the type of definition, such as "Function". | ||
| 5047 | % | ||
| 5048 | \def\defname#1#2{% | ||
| 5049 | % How we'll output the type name. Putting it in brackets helps | ||
| 5050 | % distinguish it from the body text that may end up on the next line | ||
| 5051 | % just below it. | ||
| 5052 | \ifempty{#2}% | ||
| 5053 | \def\defnametype{}% | ||
| 5054 | \else | ||
| 5055 | \def\defnametype{[\rm #2]}% | ||
| 5056 | \fi | ||
| 5057 | % | ||
| 5058 | % Get the values of \leftskip and \rightskip as they were outside the @def... | ||
| 5059 | \dimen2=\leftskip | ||
| 5060 | \advance\dimen2 by -\defbodyindent | ||
| 5061 | % | ||
| 5062 | % Figure out values for the paragraph shape. | ||
| 5063 | \setbox0=\hbox{\hskip \deflastargmargin{\defnametype}}% | ||
| 5064 | \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line | ||
| 5065 | \dimen1=\hsize \advance \dimen1 by -\defargsindent % size for continuations | ||
| 5066 | \parshape 2 0in \dimen0 \defargsindent \dimen1 | ||
| 5067 | % | ||
| 5068 | % Output arg 2 ("Function" or some such) but stuck inside a box of | ||
| 5069 | % width 0 so it does not interfere with linebreaking. | ||
| 5070 | \noindent | ||
| 5071 | % | ||
| 5072 | {% Adjust \hsize to exclude the ambient margins, | ||
| 5073 | % so that \rightline will obey them. | ||
| 5074 | \advance \hsize by -\dimen2 | ||
| 5075 | \dimen3 = 0pt % was -1.25pc | ||
| 5076 | \rlap{\rightline{\defnametype\kern\dimen3}}% | ||
| 5077 | }% | ||
| 5078 | % | ||
| 5079 | % Allow all lines to be underfull without complaint: | ||
| 5080 | \tolerance=10000 \hbadness=10000 | ||
| 5081 | \advance\leftskip by -\defbodyindent | ||
| 5082 | \exdentamount=\defbodyindent | ||
| 5083 | {\df #1}\enskip % output function name | ||
| 5084 | % \defunargs will be called next to output the arguments, if any. | ||
| 5085 | } | ||
| 5086 | |||
| 5087 | % Common pieces to start any @def... | ||
| 5088 | % #1 is the \E... control sequence to end the definition (which we define). | ||
| 5089 | % #2 is the \...x control sequence (which our caller defines). | ||
| 5090 | % #3 is the control sequence to process the header, such as \defunheader. | ||
| 5091 | % | ||
| 5092 | \def\parsebodycommon#1#2#3{% | ||
| 5093 | \begingroup\inENV | ||
| 5094 | % If there are two @def commands in a row, we'll have a \nobreak, | ||
| 5095 | % which is there to keep the function description together with its | ||
| 5096 | % header. But if there's nothing but headers, we want to allow a | ||
| 5097 | % break after all. Check for penalty 10002 (inserted by | ||
| 5098 | % \defargscommonending) instead of 10000, since the sectioning | ||
| 5099 | % commands insert a \penalty10000, and we don't want to allow a break | ||
| 5100 | % between a section heading and a defun. | ||
| 5101 | \ifnum\lastpenalty=10002 \penalty0 \fi | ||
| 5102 | \medbreak | ||
| 5103 | % | ||
| 5104 | % Define the \E... end token that this defining construct specifies | ||
| 5105 | % so that it will exit this group. | ||
| 5106 | \def#1{\endgraf\endgroup\medbreak}% | ||
| 5107 | % | ||
| 5108 | \parindent=0in | ||
| 5109 | \advance\leftskip by \defbodyindent | ||
| 5110 | \exdentamount=\defbodyindent | ||
| 5111 | } | ||
| 5112 | |||
| 5113 | % Common part of the \...x definitions. | ||
| 5114 | % | ||
| 5115 | \def\defxbodycommon{% | ||
| 5116 | % As with \parsebodycommon above, allow line break if we have multiple | ||
| 5117 | % x headers in a row. It's not a great place, though. | ||
| 5118 | \ifnum\lastpenalty=10000 \penalty1000 \fi | ||
| 5119 | % | ||
| 5120 | \begingroup\obeylines | ||
| 5121 | } | ||
| 5122 | |||
| 5123 | % Process body of @defun, @deffn, @defmac, etc. | ||
| 5124 | % | ||
| 5125 | \def\defparsebody#1#2#3{% | ||
| 5126 | \parsebodycommon{#1}{#2}{#3}% | ||
| 5127 | \def#2{\defxbodycommon \activeparens \spacesplit#3}% | ||
| 5128 | \catcode\equalChar=\active | ||
| 5129 | \begingroup\obeylines\activeparens | ||
| 5130 | \spacesplit#3% | ||
| 5131 | } | ||
| 5132 | |||
| 5133 | % #1, #2, #3 are the common arguments (see \parsebodycommon above). | ||
| 5134 | % #4, delimited by the space, is the class name. | ||
| 5135 | % | ||
| 5136 | \def\defmethparsebody#1#2#3#4 {% | ||
| 5137 | \parsebodycommon{#1}{#2}{#3}% | ||
| 5138 | \def#2##1 {\defxbodycommon \activeparens \spacesplit{#3{##1}}}% | ||
| 5139 | \begingroup\obeylines\activeparens | ||
| 5140 | % The \empty here prevents misinterpretation of a construct such as | ||
| 5141 | % @deffn {whatever} {Enharmonic comma} | ||
| 5142 | % See comments at \deftpparsebody, although in our case we don't have | ||
| 5143 | % to remove the \empty afterwards, since it is empty. | ||
| 5144 | \spacesplit{#3{#4}}\empty | ||
| 5145 | } | ||
| 5146 | |||
| 5147 | % Used for @deftypemethod and @deftypeivar. | ||
| 5148 | % #1, #2, #3 are the common arguments (see \defparsebody). | ||
| 5149 | % #4, delimited by a space, is the class name. | ||
| 5150 | % #5 is the method's return type. | ||
| 5151 | % | ||
| 5152 | \def\deftypemethparsebody#1#2#3#4 #5 {% | ||
| 5153 | \parsebodycommon{#1}{#2}{#3}% | ||
| 5154 | \def#2##1 ##2 {\defxbodycommon \activeparens \spacesplit{#3{##1}{##2}}}% | ||
| 5155 | \begingroup\obeylines\activeparens | ||
| 5156 | \spacesplit{#3{#4}{#5}}% | ||
| 5157 | } | ||
| 5158 | |||
| 5159 | % Used for @deftypeop. The change from \deftypemethparsebody is an | ||
| 5160 | % extra argument at the beginning which is the `category', instead of it | ||
| 5161 | % being the hardwired string `Method' or `Instance Variable'. We have | ||
| 5162 | % to account for this both in the \...x definition and in parsing the | ||
| 5163 | % input at hand. Thus also need a control sequence (passed as #5) for | ||
| 5164 | % the \E... definition to assign the category name to. | ||
| 5165 | % | ||
| 5166 | \def\deftypeopparsebody#1#2#3#4#5 #6 {% | ||
| 5167 | \parsebodycommon{#1}{#2}{#3}% | ||
| 5168 | \def#2##1 ##2 ##3 {\def#4{##1}% | ||
| 5169 | \defxbodycommon \activeparens \spacesplit{#3{##2}{##3}}}% | ||
| 5170 | \begingroup\obeylines\activeparens | ||
| 5171 | \spacesplit{#3{#5}{#6}}% | ||
| 5172 | } | ||
| 5173 | |||
| 5174 | % For @defop. | ||
| 5175 | \def\defopparsebody #1#2#3#4#5 {% | ||
| 5176 | \parsebodycommon{#1}{#2}{#3}% | ||
| 5177 | \def#2##1 ##2 {\def#4{##1}% | ||
| 5178 | \defxbodycommon \activeparens \spacesplit{#3{##2}}}% | ||
| 5179 | \begingroup\obeylines\activeparens | ||
| 5180 | \spacesplit{#3{#5}}% | ||
| 5181 | } | ||
| 5182 | |||
| 5183 | % These parsing functions are similar to the preceding ones | ||
| 5184 | % except that they do not make parens into active characters. | ||
| 5185 | % These are used for "variables" since they have no arguments. | ||
| 5186 | % | ||
| 5187 | \def\defvarparsebody #1#2#3{% | ||
| 5188 | \parsebodycommon{#1}{#2}{#3}% | ||
| 5189 | \def#2{\defxbodycommon \spacesplit#3}% | ||
| 5190 | \catcode\equalChar=\active | ||
| 5191 | \begingroup\obeylines | ||
| 5192 | \spacesplit#3% | ||
| 5193 | } | ||
| 5194 | |||
| 5195 | % @defopvar. | ||
| 5196 | \def\defopvarparsebody #1#2#3#4#5 {% | ||
| 5197 | \parsebodycommon{#1}{#2}{#3}% | ||
| 5198 | \def#2##1 ##2 {\def#4{##1}% | ||
| 5199 | \defxbodycommon \spacesplit{#3{##2}}}% | ||
| 5200 | \begingroup\obeylines | ||
| 5201 | \spacesplit{#3{#5}}% | ||
| 5202 | } | ||
| 5203 | |||
| 5204 | \def\defvrparsebody#1#2#3#4 {% | ||
| 5205 | \parsebodycommon{#1}{#2}{#3}% | ||
| 5206 | \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}% | ||
| 5207 | \begingroup\obeylines | ||
| 5208 | \spacesplit{#3{#4}}% | ||
| 5209 | } | ||
| 5210 | |||
| 5211 | % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the | ||
| 5212 | % type is just `struct', because we lose the braces in `{struct | ||
| 5213 | % termios}' when \spacesplit reads its undelimited argument. Sigh. | ||
| 5214 | % \let\deftpparsebody=\defvrparsebody | ||
| 5215 | % | ||
| 5216 | % So, to get around this, we put \empty in with the type name. That | ||
| 5217 | % way, TeX won't find exactly `{...}' as an undelimited argument, and | ||
| 5218 | % won't strip off the braces. | ||
| 5219 | % | ||
| 5220 | \def\deftpparsebody #1#2#3#4 {% | ||
| 5221 | \parsebodycommon{#1}{#2}{#3}% | ||
| 5222 | \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}% | ||
| 5223 | \begingroup\obeylines | ||
| 5224 | \spacesplit{\parsetpheaderline{#3{#4}}}\empty | ||
| 5225 | } | ||
| 5226 | |||
| 5227 | % Fine, but then we have to eventually remove the \empty *and* the | ||
| 5228 | % braces (if any). That's what this does. | ||
| 5229 | % | ||
| 5230 | \def\removeemptybraces\empty#1\relax{#1} | ||
| 5231 | |||
| 5232 | % After \spacesplit has done its work, this is called -- #1 is the final | ||
| 5233 | % thing to call, #2 the type name (which starts with \empty), and #3 | ||
| 5234 | % (which might be empty) the arguments. | ||
| 5235 | % | ||
| 5236 | \def\parsetpheaderline#1#2#3{% | ||
| 5237 | #1{\removeemptybraces#2\relax}{#3}% | ||
| 5238 | }% | ||
| 5239 | |||
| 5240 | % Split up #2 (the rest of the input line) at the first space token. | ||
| 5241 | % call #1 with two arguments: | ||
| 5242 | % the first is all of #2 before the space token, | ||
| 5243 | % the second is all of #2 after that space token. | ||
| 5244 | % If #2 contains no space token, all of it is passed as the first arg | ||
| 5245 | % and the second is passed as empty. | ||
| 5246 | % | ||
| 5247 | {\obeylines % | ||
| 5248 | \gdef\spacesplit#1#2^^M{\endgroup\spacesplitx{#1}#2 \relax\spacesplitx}% | ||
| 5249 | \long\gdef\spacesplitx#1#2 #3#4\spacesplitx{% | ||
| 5250 | \ifx\relax #3% | ||
| 5251 | #1{#2}{}% | ||
| 5252 | \else % | ||
| 5253 | #1{#2}{#3#4}% | ||
| 5254 | \fi}% | ||
| 5255 | } | ||
| 5256 | |||
| 5257 | % Define @defun. | ||
| 5258 | |||
| 5259 | % This is called to end the arguments processing for all the @def... commands. | ||
| 5260 | % | ||
| 5261 | \def\defargscommonending{% | ||
| 5262 | \interlinepenalty = 10000 | ||
| 5263 | \advance\rightskip by 0pt plus 1fil | ||
| 5264 | \endgraf | ||
| 5265 | \nobreak\vskip -\parskip | ||
| 5266 | \penalty 10002 % signal to \parsebodycommon. | ||
| 5267 | } | ||
| 5268 | |||
| 5269 | % This expands the args and terminates the paragraph they comprise. | ||
| 5270 | % | ||
| 5271 | \def\defunargs#1{\functionparens \sl | ||
| 5272 | % Expand, preventing hyphenation at `-' chars. | ||
| 5273 | % Note that groups don't affect changes in \hyphenchar. | ||
| 5274 | % Set the font temporarily and use \font in case \setfont made \tensl a macro. | ||
| 5275 | {\tensl\hyphenchar\font=0}% | ||
| 5276 | #1% | ||
| 5277 | {\tensl\hyphenchar\font=45}% | ||
| 5278 | \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% | ||
| 5279 | \defargscommonending | ||
| 5280 | } | ||
| 5281 | |||
| 5282 | \def\deftypefunargs #1{% | ||
| 5283 | % Expand, preventing hyphenation at `-' chars. | ||
| 5284 | % Note that groups don't affect changes in \hyphenchar. | ||
| 5285 | % Use \boldbraxnoamp, not \functionparens, so that & is not special. | ||
| 5286 | \boldbraxnoamp | ||
| 5287 | \tclose{#1}% avoid \code because of side effects on active chars | ||
| 5288 | \defargscommonending | ||
| 5289 | } | ||
| 5290 | |||
| 5291 | % Do complete processing of one @defun or @defunx line already parsed. | ||
| 5292 | |||
| 5293 | % @deffn Command forward-char nchars | ||
| 5294 | |||
| 5295 | \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} | ||
| 5296 | |||
| 5297 | \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% | ||
| 5298 | \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % | ||
| 5299 | \catcode\equalChar=\other % Turn off change made in \defparsebody | ||
| 5300 | } | ||
| 5301 | |||
| 5302 | % @defun == @deffn Function | ||
| 5303 | |||
| 5304 | \def\defun{\defparsebody\Edefun\defunx\defunheader} | ||
| 5305 | |||
| 5306 | \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index | ||
| 5307 | \begingroup\defname {#1}{\putwordDeffunc}% | ||
| 5308 | \defunargs {#2}\endgroup % | ||
| 5309 | \catcode\equalChar=\other % Turn off change made in \defparsebody | ||
| 5310 | } | ||
| 5311 | |||
| 5312 | % @deftypefun int foobar (int @var{foo}, float @var{bar}) | ||
| 5313 | |||
| 5314 | \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} | ||
| 5315 | |||
| 5316 | % #1 is the data type. #2 is the name and args. | ||
| 5317 | \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} | ||
| 5318 | % #1 is the data type, #2 the name, #3 the args. | ||
| 5319 | \def\deftypefunheaderx #1#2 #3\relax{% | ||
| 5320 | \doind {fn}{\code{#2}}% Make entry in function index | ||
| 5321 | \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}% | ||
| 5322 | \deftypefunargs {#3}\endgroup % | ||
| 5323 | \catcode\equalChar=\other % Turn off change made in \defparsebody | ||
| 5324 | } | ||
| 5325 | |||
| 5326 | % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) | ||
| 5327 | |||
| 5328 | \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} | ||
| 5329 | |||
| 5330 | % \defheaderxcond#1\relax$.$ | ||
| 5331 | % puts #1 in @code, followed by a space, but does nothing if #1 is null. | ||
| 5332 | \def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi} | ||
| 5333 | |||
| 5334 | % #1 is the classification. #2 is the data type. #3 is the name and args. | ||
| 5335 | \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} | ||
| 5336 | % #1 is the classification, #2 the data type, #3 the name, #4 the args. | ||
| 5337 | \def\deftypefnheaderx #1#2#3 #4\relax{% | ||
| 5338 | \doind {fn}{\code{#3}}% Make entry in function index | ||
| 5339 | \begingroup | ||
| 5340 | \normalparens % notably, turn off `&' magic, which prevents | ||
| 5341 | % at least some C++ text from working | ||
| 5342 | \defname {\defheaderxcond#2\relax$.$#3}{#1}% | ||
| 5343 | \deftypefunargs {#4}\endgroup % | ||
| 5344 | \catcode\equalChar=\other % Turn off change made in \defparsebody | ||
| 5345 | } | ||
| 5346 | |||
| 5347 | % @defmac == @deffn Macro | ||
| 5348 | |||
| 5349 | \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} | ||
| 5350 | |||
| 5351 | \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index | ||
| 5352 | \begingroup\defname {#1}{\putwordDefmac}% | ||
| 5353 | \defunargs {#2}\endgroup % | ||
| 5354 | \catcode\equalChar=\other % Turn off change made in \defparsebody | ||
| 5355 | } | ||
| 5356 | |||
| 5357 | % @defspec == @deffn Special Form | ||
| 5358 | |||
| 5359 | \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} | ||
| 5360 | |||
| 5361 | \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index | ||
| 5362 | \begingroup\defname {#1}{\putwordDefspec}% | ||
| 5363 | \defunargs {#2}\endgroup % | ||
| 5364 | \catcode\equalChar=\other % Turn off change made in \defparsebody | ||
| 5365 | } | ||
| 5366 | |||
| 5367 | % @defop CATEGORY CLASS OPERATION ARG... | ||
| 5368 | % | ||
| 5369 | \def\defop #1 {\def\defoptype{#1}% | ||
| 5370 | \defopparsebody\Edefop\defopx\defopheader\defoptype} | ||
| 5371 | % | ||
| 5372 | \def\defopheader#1#2#3{% | ||
| 5373 | \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry | ||
| 5374 | \begingroup | ||
| 5375 | \defname{#2}{\defoptype\ \putwordon\ #1}% | ||
| 5376 | \defunargs{#3}% | ||
| 5377 | \endgroup | ||
| 5378 | } | ||
| 5379 | |||
| 5380 | % @deftypeop CATEGORY CLASS TYPE OPERATION ARG... | ||
| 5381 | % | ||
| 5382 | \def\deftypeop #1 {\def\deftypeopcategory{#1}% | ||
| 5383 | \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader | ||
| 5384 | \deftypeopcategory} | ||
| 5385 | % | ||
| 5386 | % #1 is the class name, #2 the data type, #3 the operation name, #4 the args. | ||
| 5387 | \def\deftypeopheader#1#2#3#4{% | ||
| 5388 | \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index | ||
| 5389 | \begingroup | ||
| 5390 | \defname{\defheaderxcond#2\relax$.$#3} | ||
| 5391 | {\deftypeopcategory\ \putwordon\ \code{#1}}% | ||
| 5392 | \deftypefunargs{#4}% | ||
| 5393 | \endgroup | ||
| 5394 | } | ||
| 5395 | |||
| 5396 | % @deftypemethod CLASS TYPE METHOD ARG... | ||
| 5397 | % | ||
| 5398 | \def\deftypemethod{% | ||
| 5399 | \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} | ||
| 5400 | % | ||
| 5401 | % #1 is the class name, #2 the data type, #3 the method name, #4 the args. | ||
| 5402 | \def\deftypemethodheader#1#2#3#4{% | ||
| 5403 | \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index | ||
| 5404 | \begingroup | ||
| 5405 | \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}% | ||
| 5406 | \deftypefunargs{#4}% | ||
| 5407 | \endgroup | ||
| 5408 | } | ||
| 5409 | |||
| 5410 | % @deftypeivar CLASS TYPE VARNAME | ||
| 5411 | % | ||
| 5412 | \def\deftypeivar{% | ||
| 5413 | \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader} | ||
| 5414 | % | ||
| 5415 | % #1 is the class name, #2 the data type, #3 the variable name. | ||
| 5416 | \def\deftypeivarheader#1#2#3{% | ||
| 5417 | \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index | ||
| 5418 | \begingroup | ||
| 5419 | \defname{\defheaderxcond#2\relax$.$#3} | ||
| 5420 | {\putwordInstanceVariableof\ \code{#1}}% | ||
| 5421 | \defvarargs{#3}% | ||
| 5422 | \endgroup | ||
| 5423 | } | ||
| 5424 | |||
| 5425 | % @defmethod == @defop Method | ||
| 5426 | % | ||
| 5427 | \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} | ||
| 5428 | % | ||
| 5429 | % #1 is the class name, #2 the method name, #3 the args. | ||
| 5430 | \def\defmethodheader#1#2#3{% | ||
| 5431 | \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index | ||
| 5432 | \begingroup | ||
| 5433 | \defname{#2}{\putwordMethodon\ \code{#1}}% | ||
| 5434 | \defunargs{#3}% | ||
| 5435 | \endgroup | ||
| 5436 | } | ||
| 5437 | |||
| 5438 | % @defcv {Class Option} foo-class foo-flag | ||
| 5439 | |||
| 5440 | \def\defcv #1 {\def\defcvtype{#1}% | ||
| 5441 | \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} | ||
| 5442 | |||
| 5443 | \def\defcvarheader #1#2#3{% | ||
| 5444 | \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry | ||
| 5445 | \begingroup | ||
| 5446 | \defname{#2}{\defcvtype\ \putwordof\ #1}% | ||
| 5447 | \defvarargs{#3}% | ||
| 5448 | \endgroup | ||
| 5449 | } | ||
| 5450 | |||
| 5451 | % @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME | ||
| 5452 | % | ||
| 5453 | \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} | ||
| 5454 | % | ||
| 5455 | \def\defivarheader#1#2#3{% | ||
| 5456 | \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index | ||
| 5457 | \begingroup | ||
| 5458 | \defname{#2}{\putwordInstanceVariableof\ #1}% | ||
| 5459 | \defvarargs{#3}% | ||
| 5460 | \endgroup | ||
| 5461 | } | ||
| 5462 | |||
| 5463 | % @defvar | ||
| 5464 | % First, define the processing that is wanted for arguments of @defvar. | ||
| 5465 | % This is actually simple: just print them in roman. | ||
| 5466 | % This must expand the args and terminate the paragraph they make up | ||
| 5467 | \def\defvarargs #1{\normalparens #1% | ||
| 5468 | \defargscommonending | ||
| 5469 | } | ||
| 5470 | |||
| 5471 | % @defvr Counter foo-count | ||
| 5472 | |||
| 5473 | \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} | ||
| 5474 | |||
| 5475 | \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% | ||
| 5476 | \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} | ||
| 5477 | |||
| 5478 | % @defvar == @defvr Variable | ||
| 5479 | |||
| 5480 | \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} | ||
| 5481 | |||
| 5482 | \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index | ||
| 5483 | \begingroup\defname {#1}{\putwordDefvar}% | ||
| 5484 | \defvarargs {#2}\endgroup % | ||
| 5485 | } | ||
| 5486 | |||
| 5487 | % @defopt == @defvr {User Option} | ||
| 5488 | |||
| 5489 | \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} | ||
| 5490 | |||
| 5491 | \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index | ||
| 5492 | \begingroup\defname {#1}{\putwordDefopt}% | ||
| 5493 | \defvarargs {#2}\endgroup % | ||
| 5494 | } | ||
| 5495 | |||
| 5496 | % @deftypevar int foobar | ||
| 5497 | |||
| 5498 | \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} | ||
| 5499 | |||
| 5500 | % #1 is the data type. #2 is the name, perhaps followed by text that | ||
| 5501 | % is actually part of the data type, which should not be put into the index. | ||
| 5502 | \def\deftypevarheader #1#2{% | ||
| 5503 | \dovarind#2 \relax% Make entry in variables index | ||
| 5504 | \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}% | ||
| 5505 | \defargscommonending | ||
| 5506 | \endgroup} | ||
| 5507 | \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} | ||
| 5508 | |||
| 5509 | % @deftypevr {Global Flag} int enable | ||
| 5510 | |||
| 5511 | \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} | ||
| 5512 | |||
| 5513 | \def\deftypevrheader #1#2#3{\dovarind#3 \relax% | ||
| 5514 | \begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1} | ||
| 5515 | \defargscommonending | ||
| 5516 | \endgroup} | ||
| 5517 | |||
| 5518 | % Now define @deftp | ||
| 5519 | % Args are printed in bold, a slight difference from @defvar. | ||
| 5520 | |||
| 5521 | \def\deftpargs #1{\bf \defvarargs{#1}} | ||
| 5522 | |||
| 5523 | % @deftp Class window height width ... | ||
| 5524 | |||
| 5525 | \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} | ||
| 5526 | |||
| 5527 | \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% | ||
| 5528 | \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} | ||
| 5529 | |||
| 5530 | % These definitions are used if you use @defunx (etc.) | ||
| 5531 | % anywhere other than immediately after a @defun or @defunx. | ||
| 5532 | % | ||
| 5533 | \def\defcvx#1 {\errmessage{@defcvx in invalid context}} | ||
| 5534 | \def\deffnx#1 {\errmessage{@deffnx in invalid context}} | ||
| 5535 | \def\defivarx#1 {\errmessage{@defivarx in invalid context}} | ||
| 5536 | \def\defmacx#1 {\errmessage{@defmacx in invalid context}} | ||
| 5537 | \def\defmethodx#1 {\errmessage{@defmethodx in invalid context}} | ||
| 5538 | \def\defoptx #1 {\errmessage{@defoptx in invalid context}} | ||
| 5539 | \def\defopx#1 {\errmessage{@defopx in invalid context}} | ||
| 5540 | \def\defspecx#1 {\errmessage{@defspecx in invalid context}} | ||
| 5541 | \def\deftpx#1 {\errmessage{@deftpx in invalid context}} | ||
| 5542 | \def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}} | ||
| 5543 | \def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}} | ||
| 5544 | \def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}} | ||
| 5545 | \def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}} | ||
| 5546 | \def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}} | ||
| 5547 | \def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}} | ||
| 5548 | \def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}} | ||
| 5549 | \def\defunx#1 {\errmessage{@defunx in invalid context}} | ||
| 5550 | \def\defvarx#1 {\errmessage{@defvarx in invalid context}} | ||
| 5551 | \def\defvrx#1 {\errmessage{@defvrx in invalid context}} | ||
| 5552 | |||
| 5553 | |||
| 5554 | \message{macros,} | ||
| 5555 | % @macro. | ||
| 5556 | |||
| 5557 | % To do this right we need a feature of e-TeX, \scantokens, | ||
| 5558 | % which we arrange to emulate with a temporary file in ordinary TeX. | ||
| 5559 | \ifx\eTeXversion\undefined | ||
| 5560 | \newwrite\macscribble | ||
| 5561 | \def\scanmacro#1{% | ||
| 5562 | \begingroup \newlinechar`\^^M | ||
| 5563 | % Undo catcode changes of \startcontents and \doprintindex | ||
| 5564 | \catcode`\@=0 \catcode`\\=\other \escapechar=`\@ | ||
| 5565 | % Append \endinput to make sure that TeX does not see the ending newline. | ||
| 5566 | \toks0={#1\endinput}% | ||
| 5567 | \immediate\openout\macscribble=\jobname.tmp | ||
| 5568 | \immediate\write\macscribble{\the\toks0}% | ||
| 5569 | \immediate\closeout\macscribble | ||
| 5570 | \let\xeatspaces\eatspaces | ||
| 5571 | \input \jobname.tmp | ||
| 5572 | \endgroup | ||
| 5573 | } | ||
| 5574 | \else | ||
| 5575 | \def\scanmacro#1{% | ||
| 5576 | \begingroup \newlinechar`\^^M | ||
| 5577 | % Undo catcode changes of \startcontents and \doprintindex | ||
| 5578 | \catcode`\@=0 \catcode`\\=\other \escapechar=`\@ | ||
| 5579 | \let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} | ||
| 5580 | \fi | ||
| 5581 | |||
| 5582 | \newcount\paramno % Count of parameters | ||
| 5583 | \newtoks\macname % Macro name | ||
| 5584 | \newif\ifrecursive % Is it recursive? | ||
| 5585 | \def\macrolist{} % List of all defined macros in the form | ||
| 5586 | % \do\macro1\do\macro2... | ||
| 5587 | |||
| 5588 | % Utility routines. | ||
| 5589 | % Thisdoes \let #1 = #2, except with \csnames. | ||
| 5590 | \def\cslet#1#2{% | ||
| 5591 | \expandafter\expandafter | ||
| 5592 | \expandafter\let | ||
| 5593 | \expandafter\expandafter | ||
| 5594 | \csname#1\endcsname | ||
| 5595 | \csname#2\endcsname} | ||
| 5596 | |||
| 5597 | % Trim leading and trailing spaces off a string. | ||
| 5598 | % Concepts from aro-bend problem 15 (see CTAN). | ||
| 5599 | {\catcode`\@=11 | ||
| 5600 | \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} | ||
| 5601 | \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} | ||
| 5602 | \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} | ||
| 5603 | \def\unbrace#1{#1} | ||
| 5604 | \unbrace{\gdef\trim@@@ #1 } #2@{#1} | ||
| 5605 | } | ||
| 5606 | |||
| 5607 | % Trim a single trailing ^^M off a string. | ||
| 5608 | {\catcode`\^^M=\other \catcode`\Q=3% | ||
| 5609 | \gdef\eatcr #1{\eatcra #1Q^^MQ}% | ||
| 5610 | \gdef\eatcra#1^^MQ{\eatcrb#1Q}% | ||
| 5611 | \gdef\eatcrb#1Q#2Q{#1}% | ||
| 5612 | } | ||
| 5613 | |||
| 5614 | % Macro bodies are absorbed as an argument in a context where | ||
| 5615 | % all characters are catcode 10, 11 or 12, except \ which is active | ||
| 5616 | % (as in normal texinfo). It is necessary to change the definition of \. | ||
| 5617 | |||
| 5618 | % It's necessary to have hard CRs when the macro is executed. This is | ||
| 5619 | % done by making ^^M (\endlinechar) catcode 12 when reading the macro | ||
| 5620 | % body, and then making it the \newlinechar in \scanmacro. | ||
| 5621 | |||
| 5622 | \def\macrobodyctxt{% | ||
| 5623 | \catcode`\~=\other | ||
| 5624 | \catcode`\^=\other | ||
| 5625 | \catcode`\_=\other | ||
| 5626 | \catcode`\|=\other | ||
| 5627 | \catcode`\<=\other | ||
| 5628 | \catcode`\>=\other | ||
| 5629 | \catcode`\+=\other | ||
| 5630 | \catcode`\{=\other | ||
| 5631 | \catcode`\}=\other | ||
| 5632 | \catcode`\@=\other | ||
| 5633 | \catcode`\^^M=\other | ||
| 5634 | \usembodybackslash} | ||
| 5635 | |||
| 5636 | \def\macroargctxt{% | ||
| 5637 | \catcode`\~=\other | ||
| 5638 | \catcode`\^=\other | ||
| 5639 | \catcode`\_=\other | ||
| 5640 | \catcode`\|=\other | ||
| 5641 | \catcode`\<=\other | ||
| 5642 | \catcode`\>=\other | ||
| 5643 | \catcode`\+=\other | ||
| 5644 | \catcode`\@=\other | ||
| 5645 | \catcode`\\=\other} | ||
| 5646 | |||
| 5647 | % \mbodybackslash is the definition of \ in @macro bodies. | ||
| 5648 | % It maps \foo\ => \csname macarg.foo\endcsname => #N | ||
| 5649 | % where N is the macro parameter number. | ||
| 5650 | % We define \csname macarg.\endcsname to be \realbackslash, so | ||
| 5651 | % \\ in macro replacement text gets you a backslash. | ||
| 5652 | |||
| 5653 | {\catcode`@=0 @catcode`@\=@active | ||
| 5654 | @gdef@usembodybackslash{@let\=@mbodybackslash} | ||
| 5655 | @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} | ||
| 5656 | } | ||
| 5657 | \expandafter\def\csname macarg.\endcsname{\realbackslash} | ||
| 5658 | |||
| 5659 | \def\macro{\recursivefalse\parsearg\macroxxx} | ||
| 5660 | \def\rmacro{\recursivetrue\parsearg\macroxxx} | ||
| 5661 | |||
| 5662 | \def\macroxxx#1{% | ||
| 5663 | \getargs{#1}% now \macname is the macname and \argl the arglist | ||
| 5664 | \ifx\argl\empty % no arguments | ||
| 5665 | \paramno=0% | ||
| 5666 | \else | ||
| 5667 | \expandafter\parsemargdef \argl;% | ||
| 5668 | \fi | ||
| 5669 | \if1\csname ismacro.\the\macname\endcsname | ||
| 5670 | \message{Warning: redefining \the\macname}% | ||
| 5671 | \else | ||
| 5672 | \expandafter\ifx\csname \the\macname\endcsname \relax | ||
| 5673 | \else \errmessage{Macro name \the\macname\space already defined}\fi | ||
| 5674 | \global\cslet{macsave.\the\macname}{\the\macname}% | ||
| 5675 | \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% | ||
| 5676 | % Add the macroname to \macrolist | ||
| 5677 | \toks0 = \expandafter{\macrolist\do}% | ||
| 5678 | \xdef\macrolist{\the\toks0 | ||
| 5679 | \expandafter\noexpand\csname\the\macname\endcsname}% | ||
| 5680 | \fi | ||
| 5681 | \begingroup \macrobodyctxt | ||
| 5682 | \ifrecursive \expandafter\parsermacbody | ||
| 5683 | \else \expandafter\parsemacbody | ||
| 5684 | \fi} | ||
| 5685 | |||
| 5686 | \def\unmacro{\parsearg\dounmacro} | ||
| 5687 | \def\dounmacro#1{% | ||
| 5688 | \if1\csname ismacro.#1\endcsname | ||
| 5689 | \global\cslet{#1}{macsave.#1}% | ||
| 5690 | \global\expandafter\let \csname ismacro.#1\endcsname=0% | ||
| 5691 | % Remove the macro name from \macrolist: | ||
| 5692 | \begingroup | ||
| 5693 | \expandafter\let\csname#1\endcsname \relax | ||
| 5694 | \let\do\unmacrodo | ||
| 5695 | \xdef\macrolist{\macrolist}% | ||
| 5696 | \endgroup | ||
| 5697 | \else | ||
| 5698 | \errmessage{Macro #1 not defined}% | ||
| 5699 | \fi | ||
| 5700 | } | ||
| 5701 | |||
| 5702 | % Called by \do from \dounmacro on each macro. The idea is to omit any | ||
| 5703 | % macro definitions that have been changed to \relax. | ||
| 5704 | % | ||
| 5705 | \def\unmacrodo#1{% | ||
| 5706 | \ifx#1\relax | ||
| 5707 | % remove this | ||
| 5708 | \else | ||
| 5709 | \noexpand\do \noexpand #1% | ||
| 5710 | \fi | ||
| 5711 | } | ||
| 5712 | |||
| 5713 | % This makes use of the obscure feature that if the last token of a | ||
| 5714 | % <parameter list> is #, then the preceding argument is delimited by | ||
| 5715 | % an opening brace, and that opening brace is not consumed. | ||
| 5716 | \def\getargs#1{\getargsxxx#1{}} | ||
| 5717 | \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} | ||
| 5718 | \def\getmacname #1 #2\relax{\macname={#1}} | ||
| 5719 | \def\getmacargs#1{\def\argl{#1}} | ||
| 5720 | |||
| 5721 | % Parse the optional {params} list. Set up \paramno and \paramlist | ||
| 5722 | % so \defmacro knows what to do. Define \macarg.blah for each blah | ||
| 5723 | % in the params list, to be ##N where N is the position in that list. | ||
| 5724 | % That gets used by \mbodybackslash (above). | ||
| 5725 | |||
| 5726 | % We need to get `macro parameter char #' into several definitions. | ||
| 5727 | % The technique used is stolen from LaTeX: let \hash be something | ||
| 5728 | % unexpandable, insert that wherever you need a #, and then redefine | ||
| 5729 | % it to # just before using the token list produced. | ||
| 5730 | % | ||
| 5731 | % The same technique is used to protect \eatspaces till just before | ||
| 5732 | % the macro is used. | ||
| 5733 | |||
| 5734 | \def\parsemargdef#1;{\paramno=0\def\paramlist{}% | ||
| 5735 | \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} | ||
| 5736 | \def\parsemargdefxxx#1,{% | ||
| 5737 | \if#1;\let\next=\relax | ||
| 5738 | \else \let\next=\parsemargdefxxx | ||
| 5739 | \advance\paramno by 1% | ||
| 5740 | \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname | ||
| 5741 | {\xeatspaces{\hash\the\paramno}}% | ||
| 5742 | \edef\paramlist{\paramlist\hash\the\paramno,}% | ||
| 5743 | \fi\next} | ||
| 5744 | |||
| 5745 | % These two commands read recursive and nonrecursive macro bodies. | ||
| 5746 | % (They're different since rec and nonrec macros end differently.) | ||
| 5747 | |||
| 5748 | \long\def\parsemacbody#1@end macro% | ||
| 5749 | {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% | ||
| 5750 | \long\def\parsermacbody#1@end rmacro% | ||
| 5751 | {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% | ||
| 5752 | |||
| 5753 | % This defines the macro itself. There are six cases: recursive and | ||
| 5754 | % nonrecursive macros of zero, one, and many arguments. | ||
| 5755 | % Much magic with \expandafter here. | ||
| 5756 | % \xdef is used so that macro definitions will survive the file | ||
| 5757 | % they're defined in; @include reads the file inside a group. | ||
| 5758 | \def\defmacro{% | ||
| 5759 | \let\hash=##% convert placeholders to macro parameter chars | ||
| 5760 | \ifrecursive | ||
| 5761 | \ifcase\paramno | ||
| 5762 | % 0 | ||
| 5763 | \expandafter\xdef\csname\the\macname\endcsname{% | ||
| 5764 | \noexpand\scanmacro{\temp}}% | ||
| 5765 | \or % 1 | ||
| 5766 | \expandafter\xdef\csname\the\macname\endcsname{% | ||
| 5767 | \bgroup\noexpand\macroargctxt | ||
| 5768 | \noexpand\braceorline | ||
| 5769 | \expandafter\noexpand\csname\the\macname xxx\endcsname}% | ||
| 5770 | \expandafter\xdef\csname\the\macname xxx\endcsname##1{% | ||
| 5771 | \egroup\noexpand\scanmacro{\temp}}% | ||
| 5772 | \else % many | ||
| 5773 | \expandafter\xdef\csname\the\macname\endcsname{% | ||
| 5774 | \bgroup\noexpand\macroargctxt | ||
| 5775 | \noexpand\csname\the\macname xx\endcsname}% | ||
| 5776 | \expandafter\xdef\csname\the\macname xx\endcsname##1{% | ||
| 5777 | \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% | ||
| 5778 | \expandafter\expandafter | ||
| 5779 | \expandafter\xdef | ||
| 5780 | \expandafter\expandafter | ||
| 5781 | \csname\the\macname xxx\endcsname | ||
| 5782 | \paramlist{\egroup\noexpand\scanmacro{\temp}}% | ||
| 5783 | \fi | ||
| 5784 | \else | ||
| 5785 | \ifcase\paramno | ||
| 5786 | % 0 | ||
| 5787 | \expandafter\xdef\csname\the\macname\endcsname{% | ||
| 5788 | \noexpand\norecurse{\the\macname}% | ||
| 5789 | \noexpand\scanmacro{\temp}\egroup}% | ||
| 5790 | \or % 1 | ||
| 5791 | \expandafter\xdef\csname\the\macname\endcsname{% | ||
| 5792 | \bgroup\noexpand\macroargctxt | ||
| 5793 | \noexpand\braceorline | ||
| 5794 | \expandafter\noexpand\csname\the\macname xxx\endcsname}% | ||
| 5795 | \expandafter\xdef\csname\the\macname xxx\endcsname##1{% | ||
| 5796 | \egroup | ||
| 5797 | \noexpand\norecurse{\the\macname}% | ||
| 5798 | \noexpand\scanmacro{\temp}\egroup}% | ||
| 5799 | \else % many | ||
| 5800 | \expandafter\xdef\csname\the\macname\endcsname{% | ||
| 5801 | \bgroup\noexpand\macroargctxt | ||
| 5802 | \expandafter\noexpand\csname\the\macname xx\endcsname}% | ||
| 5803 | \expandafter\xdef\csname\the\macname xx\endcsname##1{% | ||
| 5804 | \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% | ||
| 5805 | \expandafter\expandafter | ||
| 5806 | \expandafter\xdef | ||
| 5807 | \expandafter\expandafter | ||
| 5808 | \csname\the\macname xxx\endcsname | ||
| 5809 | \paramlist{% | ||
| 5810 | \egroup | ||
| 5811 | \noexpand\norecurse{\the\macname}% | ||
| 5812 | \noexpand\scanmacro{\temp}\egroup}% | ||
| 5813 | \fi | ||
| 5814 | \fi} | ||
| 5815 | |||
| 5816 | \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} | ||
| 5817 | |||
| 5818 | % \braceorline decides whether the next nonwhitespace character is a | ||
| 5819 | % {. If so it reads up to the closing }, if not, it reads the whole | ||
| 5820 | % line. Whatever was read is then fed to the next control sequence | ||
| 5821 | % as an argument (by \parsebrace or \parsearg) | ||
| 5822 | \def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} | ||
| 5823 | \def\braceorlinexxx{% | ||
| 5824 | \ifx\nchar\bgroup\else | ||
| 5825 | \expandafter\parsearg | ||
| 5826 | \fi \next} | ||
| 5827 | |||
| 5828 | % We mant to disable all macros during \shipout so that they are not | ||
| 5829 | % expanded by \write. | ||
| 5830 | \def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}% | ||
| 5831 | \edef\next{\macrolist}\expandafter\endgroup\next} | ||
| 5832 | |||
| 5833 | |||
| 5834 | % @alias. | ||
| 5835 | % We need some trickery to remove the optional spaces around the equal | ||
| 5836 | % sign. Just make them active and then expand them all to nothing. | ||
| 5837 | \def\alias{\begingroup\obeyspaces\parsearg\aliasxxx} | ||
| 5838 | \def\aliasxxx #1{\aliasyyy#1\relax} | ||
| 5839 | \def\aliasyyy #1=#2\relax{\ignoreactivespaces | ||
| 5840 | \edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=% | ||
| 5841 | \expandafter\noexpand\csname#2\endcsname}% | ||
| 5842 | \expandafter\endgroup\next} | ||
| 5843 | |||
| 5844 | |||
| 5845 | \message{cross references,} | ||
| 5846 | % @xref etc. | ||
| 5847 | |||
| 5848 | \newwrite\auxfile | ||
| 5849 | |||
| 5850 | \newif\ifhavexrefs % True if xref values are known. | ||
| 5851 | \newif\ifwarnedxrefs % True if we warned once that they aren't known. | ||
| 5852 | |||
| 5853 | % @inforef is relatively simple. | ||
| 5854 | \def\inforef #1{\inforefzzz #1,,,,**} | ||
| 5855 | \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, | ||
| 5856 | node \samp{\ignorespaces#1{}}} | ||
| 5857 | |||
| 5858 | % @node's job is to define \lastnode. | ||
| 5859 | \def\node{\ENVcheck\parsearg\nodezzz} | ||
| 5860 | \def\nodezzz#1{\nodexxx #1,\finishnodeparse} | ||
| 5861 | \def\nodexxx#1,#2\finishnodeparse{\gdef\lastnode{#1}} | ||
| 5862 | \let\nwnode=\node | ||
| 5863 | \let\lastnode=\relax | ||
| 5864 | |||
| 5865 | % The sectioning commands (@chapter, etc.) call these. | ||
| 5866 | \def\donoderef{% | ||
| 5867 | \ifx\lastnode\relax\else | ||
| 5868 | \expandafter\expandafter\expandafter\setref{\lastnode}% | ||
| 5869 | {Ysectionnumberandtype}% | ||
| 5870 | \global\let\lastnode=\relax | ||
| 5871 | \fi | ||
| 5872 | } | ||
| 5873 | \def\unnumbnoderef{% | ||
| 5874 | \ifx\lastnode\relax\else | ||
| 5875 | \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% | ||
| 5876 | \global\let\lastnode=\relax | ||
| 5877 | \fi | ||
| 5878 | } | ||
| 5879 | \def\appendixnoderef{% | ||
| 5880 | \ifx\lastnode\relax\else | ||
| 5881 | \expandafter\expandafter\expandafter\setref{\lastnode}% | ||
| 5882 | {Yappendixletterandtype}% | ||
| 5883 | \global\let\lastnode=\relax | ||
| 5884 | \fi | ||
| 5885 | } | ||
| 5886 | |||
| 5887 | |||
| 5888 | % @anchor{NAME} -- define xref target at arbitrary point. | ||
| 5889 | % | ||
| 5890 | \newcount\savesfregister | ||
| 5891 | \gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} | ||
| 5892 | \gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} | ||
| 5893 | \gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} | ||
| 5894 | |||
| 5895 | % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an | ||
| 5896 | % anchor), namely NAME-title (the corresponding @chapter/etc. name), | ||
| 5897 | % NAME-pg (the page number), and NAME-snt (section number and type). | ||
| 5898 | % Called from \foonoderef. | ||
| 5899 | % | ||
| 5900 | % We have to set \indexdummies so commands such as @code in a section | ||
| 5901 | % title aren't expanded. It would be nicer not to expand the titles in | ||
| 5902 | % the first place, but there's so many layers that that is hard to do. | ||
| 5903 | % | ||
| 5904 | % Likewise, use \turnoffactive so that punctuation chars such as underscore | ||
| 5905 | % and backslash work in node names. | ||
| 5906 | % | ||
| 5907 | \def\setref#1#2{{% | ||
| 5908 | \atdummies | ||
| 5909 | \pdfmkdest{#1}% | ||
| 5910 | % | ||
| 5911 | \turnoffactive | ||
| 5912 | \dosetq{#1-title}{Ytitle}% | ||
| 5913 | \dosetq{#1-pg}{Ypagenumber}% | ||
| 5914 | \dosetq{#1-snt}{#2}% | ||
| 5915 | }} | ||
| 5916 | |||
| 5917 | % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is | ||
| 5918 | % the node name, #2 the name of the Info cross-reference, #3 the printed | ||
| 5919 | % node name, #4 the name of the Info file, #5 the name of the printed | ||
| 5920 | % manual. All but the node name can be omitted. | ||
| 5921 | % | ||
| 5922 | \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} | ||
| 5923 | \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} | ||
| 5924 | \def\ref#1{\xrefX[#1,,,,,,,]} | ||
| 5925 | \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup | ||
| 5926 | \unsepspaces | ||
| 5927 | \def\printedmanual{\ignorespaces #5}% | ||
| 5928 | \def\printednodename{\ignorespaces #3}% | ||
| 5929 | \setbox1=\hbox{\printedmanual}% | ||
| 5930 | \setbox0=\hbox{\printednodename}% | ||
| 5931 | \ifdim \wd0 = 0pt | ||
| 5932 | % No printed node name was explicitly given. | ||
| 5933 | \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax | ||
| 5934 | % Use the node name inside the square brackets. | ||
| 5935 | \def\printednodename{\ignorespaces #1}% | ||
| 5936 | \else | ||
| 5937 | % Use the actual chapter/section title appear inside | ||
| 5938 | % the square brackets. Use the real section title if we have it. | ||
| 5939 | \ifdim \wd1 > 0pt | ||
| 5940 | % It is in another manual, so we don't have it. | ||
| 5941 | \def\printednodename{\ignorespaces #1}% | ||
| 5942 | \else | ||
| 5943 | \ifhavexrefs | ||
| 5944 | % We know the real title if we have the xref values. | ||
| 5945 | \def\printednodename{\refx{#1-title}{}}% | ||
| 5946 | \else | ||
| 5947 | % Otherwise just copy the Info node name. | ||
| 5948 | \def\printednodename{\ignorespaces #1}% | ||
| 5949 | \fi% | ||
| 5950 | \fi | ||
| 5951 | \fi | ||
| 5952 | \fi | ||
| 5953 | % | ||
| 5954 | % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not | ||
| 5955 | % insert empty discretionaries after hyphens, which means that it will | ||
| 5956 | % not find a line break at a hyphen in a node names. Since some manuals | ||
| 5957 | % are best written with fairly long node names, containing hyphens, this | ||
| 5958 | % is a loss. Therefore, we give the text of the node name again, so it | ||
| 5959 | % is as if TeX is seeing it for the first time. | ||
| 5960 | \ifpdf | ||
| 5961 | \leavevmode | ||
| 5962 | \getfilename{#4}% | ||
| 5963 | {\turnoffactive \otherbackslash | ||
| 5964 | \ifnum\filenamelength>0 | ||
| 5965 | \startlink attr{/Border [0 0 0]}% | ||
| 5966 | goto file{\the\filename.pdf} name{#1}% | ||
| 5967 | \else | ||
| 5968 | \startlink attr{/Border [0 0 0]}% | ||
| 5969 | goto name{#1}% | ||
| 5970 | \fi | ||
| 5971 | }% | ||
| 5972 | \linkcolor | ||
| 5973 | \fi | ||
| 5974 | % | ||
| 5975 | \ifdim \wd1 > 0pt | ||
| 5976 | \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}% | ||
| 5977 | \else | ||
| 5978 | % _ (for example) has to be the character _ for the purposes of the | ||
| 5979 | % control sequence corresponding to the node, but it has to expand | ||
| 5980 | % into the usual \leavevmode...\vrule stuff for purposes of | ||
| 5981 | % printing. So we \turnoffactive for the \refx-snt, back on for the | ||
| 5982 | % printing, back off for the \refx-pg. | ||
| 5983 | {\turnoffactive \otherbackslash | ||
| 5984 | % Only output a following space if the -snt ref is nonempty; for | ||
| 5985 | % @unnumbered and @anchor, it won't be. | ||
| 5986 | \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% | ||
| 5987 | \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi | ||
| 5988 | }% | ||
| 5989 | % output the `[mynode]' via a macro. | ||
| 5990 | \xrefprintnodename\printednodename | ||
| 5991 | % | ||
| 5992 | % But we always want a comma and a space: | ||
| 5993 | ,\space | ||
| 5994 | % | ||
| 5995 | % output the `page 3'. | ||
| 5996 | \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}% | ||
| 5997 | \fi | ||
| 5998 | \endlink | ||
| 5999 | \endgroup} | ||
| 6000 | |||
| 6001 | % This macro is called from \xrefX for the `[nodename]' part of xref | ||
| 6002 | % output. It's a separate macro only so it can be changed more easily, | ||
| 6003 | % since not square brackets don't work in some documents. Particularly | ||
| 6004 | % one that Bob is working on :). | ||
| 6005 | % | ||
| 6006 | \def\xrefprintnodename#1{[#1]} | ||
| 6007 | |||
| 6008 | % \dosetq is called from \setref to do the actual \write (\iflinks). | ||
| 6009 | % | ||
| 6010 | \def\dosetq#1#2{% | ||
| 6011 | {\let\folio=0% | ||
| 6012 | \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% | ||
| 6013 | \iflinks \next \fi | ||
| 6014 | }% | ||
| 6015 | } | ||
| 6016 | |||
| 6017 | % \internalsetq{foo}{page} expands into | ||
| 6018 | % CHARACTERS @xrdef{foo}{...expansion of \page...} | ||
| 6019 | \def\internalsetq#1#2{@xrdef{#1}{\csname #2\endcsname}} | ||
| 6020 | |||
| 6021 | % Things to be expanded by \internalsetq. | ||
| 6022 | % | ||
| 6023 | \def\Ypagenumber{\folio} | ||
| 6024 | \def\Ytitle{\thissection} | ||
| 6025 | \def\Ynothing{} | ||
| 6026 | \def\Ysectionnumberandtype{% | ||
| 6027 | \ifnum\secno=0 | ||
| 6028 | \putwordChapter@tie \the\chapno | ||
| 6029 | \else \ifnum\subsecno=0 | ||
| 6030 | \putwordSection@tie \the\chapno.\the\secno | ||
| 6031 | \else \ifnum\subsubsecno=0 | ||
| 6032 | \putwordSection@tie \the\chapno.\the\secno.\the\subsecno | ||
| 6033 | \else | ||
| 6034 | \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno | ||
| 6035 | \fi\fi\fi | ||
| 6036 | } | ||
| 6037 | |||
| 6038 | \def\Yappendixletterandtype{% | ||
| 6039 | \ifnum\secno=0 | ||
| 6040 | \putwordAppendix@tie @char\the\appendixno{}% | ||
| 6041 | \else \ifnum\subsecno=0 | ||
| 6042 | \putwordSection@tie @char\the\appendixno.\the\secno | ||
| 6043 | \else \ifnum\subsubsecno=0 | ||
| 6044 | \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno | ||
| 6045 | \else | ||
| 6046 | \putwordSection@tie | ||
| 6047 | @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno | ||
| 6048 | \fi\fi\fi | ||
| 6049 | } | ||
| 6050 | |||
| 6051 | % Use TeX 3.0's \inputlineno to get the line number, for better error | ||
| 6052 | % messages, but if we're using an old version of TeX, don't do anything. | ||
| 6053 | % | ||
| 6054 | \ifx\inputlineno\thisisundefined | ||
| 6055 | \let\linenumber = \empty % Pre-3.0. | ||
| 6056 | \else | ||
| 6057 | \def\linenumber{\the\inputlineno:\space} | ||
| 6058 | \fi | ||
| 6059 | |||
| 6060 | % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. | ||
| 6061 | % If its value is nonempty, SUFFIX is output afterward. | ||
| 6062 | % | ||
| 6063 | \def\refx#1#2{% | ||
| 6064 | {% | ||
| 6065 | \indexnofonts | ||
| 6066 | \otherbackslash | ||
| 6067 | \expandafter\global\expandafter\let\expandafter\thisrefX | ||
| 6068 | \csname X#1\endcsname | ||
| 6069 | }% | ||
| 6070 | \ifx\thisrefX\relax | ||
| 6071 | % If not defined, say something at least. | ||
| 6072 | \angleleft un\-de\-fined\angleright | ||
| 6073 | \iflinks | ||
| 6074 | \ifhavexrefs | ||
| 6075 | \message{\linenumber Undefined cross reference `#1'.}% | ||
| 6076 | \else | ||
| 6077 | \ifwarnedxrefs\else | ||
| 6078 | \global\warnedxrefstrue | ||
| 6079 | \message{Cross reference values unknown; you must run TeX again.}% | ||
| 6080 | \fi | ||
| 6081 | \fi | ||
| 6082 | \fi | ||
| 6083 | \else | ||
| 6084 | % It's defined, so just use it. | ||
| 6085 | \thisrefX | ||
| 6086 | \fi | ||
| 6087 | #2% Output the suffix in any case. | ||
| 6088 | } | ||
| 6089 | |||
| 6090 | % This is the macro invoked by entries in the aux file. | ||
| 6091 | % | ||
| 6092 | \def\xrdef#1{\expandafter\gdef\csname X#1\endcsname} | ||
| 6093 | |||
| 6094 | % Read the last existing aux file, if any. No error if none exists. | ||
| 6095 | \def\readauxfile{\begingroup | ||
| 6096 | \catcode`\^^@=\other | ||
| 6097 | \catcode`\^^A=\other | ||
| 6098 | \catcode`\^^B=\other | ||
| 6099 | \catcode`\^^C=\other | ||
| 6100 | \catcode`\^^D=\other | ||
| 6101 | \catcode`\^^E=\other | ||
| 6102 | \catcode`\^^F=\other | ||
| 6103 | \catcode`\^^G=\other | ||
| 6104 | \catcode`\^^H=\other | ||
| 6105 | \catcode`\^^K=\other | ||
| 6106 | \catcode`\^^L=\other | ||
| 6107 | \catcode`\^^N=\other | ||
| 6108 | \catcode`\^^P=\other | ||
| 6109 | \catcode`\^^Q=\other | ||
| 6110 | \catcode`\^^R=\other | ||
| 6111 | \catcode`\^^S=\other | ||
| 6112 | \catcode`\^^T=\other | ||
| 6113 | \catcode`\^^U=\other | ||
| 6114 | \catcode`\^^V=\other | ||
| 6115 | \catcode`\^^W=\other | ||
| 6116 | \catcode`\^^X=\other | ||
| 6117 | \catcode`\^^Z=\other | ||
| 6118 | \catcode`\^^[=\other | ||
| 6119 | \catcode`\^^\=\other | ||
| 6120 | \catcode`\^^]=\other | ||
| 6121 | \catcode`\^^^=\other | ||
| 6122 | \catcode`\^^_=\other | ||
| 6123 | % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. | ||
| 6124 | % in xref tags, i.e., node names. But since ^^e4 notation isn't | ||
| 6125 | % supported in the main text, it doesn't seem desirable. Furthermore, | ||
| 6126 | % that is not enough: for node names that actually contain a ^ | ||
| 6127 | % character, we would end up writing a line like this: 'xrdef {'hat | ||
| 6128 | % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first | ||
| 6129 | % argument, and \hat is not an expandable control sequence. It could | ||
| 6130 | % all be worked out, but why? Either we support ^^ or we don't. | ||
| 6131 | % | ||
| 6132 | % The other change necessary for this was to define \auxhat: | ||
| 6133 | % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter | ||
| 6134 | % and then to call \auxhat in \setq. | ||
| 6135 | % | ||
| 6136 | \catcode`\^=\other | ||
| 6137 | % | ||
| 6138 | % Special characters. Should be turned off anyway, but... | ||
| 6139 | \catcode`\~=\other | ||
| 6140 | \catcode`\[=\other | ||
| 6141 | \catcode`\]=\other | ||
| 6142 | \catcode`\"=\other | ||
| 6143 | \catcode`\_=\other | ||
| 6144 | \catcode`\|=\other | ||
| 6145 | \catcode`\<=\other | ||
| 6146 | \catcode`\>=\other | ||
| 6147 | \catcode`\$=\other | ||
| 6148 | \catcode`\#=\other | ||
| 6149 | \catcode`\&=\other | ||
| 6150 | \catcode`\%=\other | ||
| 6151 | \catcode`+=\other % avoid \+ for paranoia even though we've turned it off | ||
| 6152 | % | ||
| 6153 | % Make the characters 128-255 be printing characters | ||
| 6154 | {% | ||
| 6155 | \count 1=128 | ||
| 6156 | \def\loop{% | ||
| 6157 | \catcode\count 1=\other | ||
| 6158 | \advance\count 1 by 1 | ||
| 6159 | \ifnum \count 1<256 \loop \fi | ||
| 6160 | }% | ||
| 6161 | }% | ||
| 6162 | % | ||
| 6163 | % Turn off \ as an escape so we do not lose on | ||
| 6164 | % entries which were dumped with control sequences in their names. | ||
| 6165 | % For example, @xrdef{$\leq $-fun}{page ...} made by @defun ^^ | ||
| 6166 | % Reference to such entries still does not work the way one would wish, | ||
| 6167 | % but at least they do not bomb out when the aux file is read in. | ||
| 6168 | \catcode`\\=\other | ||
| 6169 | % | ||
| 6170 | % @ is our escape character in .aux files. | ||
| 6171 | \catcode`\{=1 | ||
| 6172 | \catcode`\}=2 | ||
| 6173 | \catcode`\@=0 | ||
| 6174 | % | ||
| 6175 | \openin 1 \jobname.aux | ||
| 6176 | \ifeof 1 \else | ||
| 6177 | \closein 1 | ||
| 6178 | \input \jobname.aux | ||
| 6179 | \global\havexrefstrue | ||
| 6180 | \global\warnedobstrue | ||
| 6181 | \fi | ||
| 6182 | % Open the new aux file. TeX will close it automatically at exit. | ||
| 6183 | \openout\auxfile=\jobname.aux | ||
| 6184 | \endgroup} | ||
| 6185 | |||
| 6186 | |||
| 6187 | % Footnotes. | ||
| 6188 | |||
| 6189 | \newcount \footnoteno | ||
| 6190 | |||
| 6191 | % The trailing space in the following definition for supereject is | ||
| 6192 | % vital for proper filling; pages come out unaligned when you do a | ||
| 6193 | % pagealignmacro call if that space before the closing brace is | ||
| 6194 | % removed. (Generally, numeric constants should always be followed by a | ||
| 6195 | % space to prevent strange expansion errors.) | ||
| 6196 | \def\supereject{\par\penalty -20000\footnoteno =0 } | ||
| 6197 | |||
| 6198 | % @footnotestyle is meaningful for info output only. | ||
| 6199 | \let\footnotestyle=\comment | ||
| 6200 | |||
| 6201 | \let\ptexfootnote=\footnote | ||
| 6202 | |||
| 6203 | {\catcode `\@=11 | ||
| 6204 | % | ||
| 6205 | % Auto-number footnotes. Otherwise like plain. | ||
| 6206 | \gdef\footnote{% | ||
| 6207 | \let\indent=\ptexindent | ||
| 6208 | \global\advance\footnoteno by \@ne | ||
| 6209 | \edef\thisfootno{$^{\the\footnoteno}$}% | ||
| 6210 | % | ||
| 6211 | % In case the footnote comes at the end of a sentence, preserve the | ||
| 6212 | % extra spacing after we do the footnote number. | ||
| 6213 | \let\@sf\empty | ||
| 6214 | \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi | ||
| 6215 | % | ||
| 6216 | % Remove inadvertent blank space before typesetting the footnote number. | ||
| 6217 | \unskip | ||
| 6218 | \thisfootno\@sf | ||
| 6219 | \dofootnote | ||
| 6220 | }% | ||
| 6221 | |||
| 6222 | % Don't bother with the trickery in plain.tex to not require the | ||
| 6223 | % footnote text as a parameter. Our footnotes don't need to be so general. | ||
| 6224 | % | ||
| 6225 | % Oh yes, they do; otherwise, @ifset and anything else that uses | ||
| 6226 | % \parseargline fail inside footnotes because the tokens are fixed when | ||
| 6227 | % the footnote is read. --karl, 16nov96. | ||
| 6228 | % | ||
| 6229 | % The start of the footnote looks usually like this: | ||
| 6230 | \gdef\startfootins{\insert\footins\bgroup} | ||
| 6231 | % | ||
| 6232 | % ... but this macro is redefined inside @multitable. | ||
| 6233 | % | ||
| 6234 | \gdef\dofootnote{% | ||
| 6235 | \startfootins | ||
| 6236 | % We want to typeset this text as a normal paragraph, even if the | ||
| 6237 | % footnote reference occurs in (for example) a display environment. | ||
| 6238 | % So reset some parameters. | ||
| 6239 | \hsize=\pagewidth | ||
| 6240 | \interlinepenalty\interfootnotelinepenalty | ||
| 6241 | \splittopskip\ht\strutbox % top baseline for broken footnotes | ||
| 6242 | \splitmaxdepth\dp\strutbox | ||
| 6243 | \floatingpenalty\@MM | ||
| 6244 | \leftskip\z@skip | ||
| 6245 | \rightskip\z@skip | ||
| 6246 | \spaceskip\z@skip | ||
| 6247 | \xspaceskip\z@skip | ||
| 6248 | \parindent\defaultparindent | ||
| 6249 | % | ||
| 6250 | \smallfonts \rm | ||
| 6251 | % | ||
| 6252 | % Because we use hanging indentation in footnotes, a @noindent appears | ||
| 6253 | % to exdent this text, so make it be a no-op. makeinfo does not use | ||
| 6254 | % hanging indentation so @noindent can still be needed within footnote | ||
| 6255 | % text after an @example or the like (not that this is good style). | ||
| 6256 | \let\noindent = \relax | ||
| 6257 | % | ||
| 6258 | % Hang the footnote text off the number. Use \everypar in case the | ||
| 6259 | % footnote extends for more than one paragraph. | ||
| 6260 | \everypar = {\hang}% | ||
| 6261 | \textindent{\thisfootno}% | ||
| 6262 | % | ||
| 6263 | % Don't crash into the line above the footnote text. Since this | ||
| 6264 | % expands into a box, it must come within the paragraph, lest it | ||
| 6265 | % provide a place where TeX can split the footnote. | ||
| 6266 | \footstrut | ||
| 6267 | \futurelet\next\fo@t | ||
| 6268 | } | ||
| 6269 | }%end \catcode `\@=11 | ||
| 6270 | |||
| 6271 | % @| inserts a changebar to the left of the current line. It should | ||
| 6272 | % surround any changed text. This approach does *not* work if the | ||
| 6273 | % change spans more than two lines of output. To handle that, we would | ||
| 6274 | % have adopt a much more difficult approach (putting marks into the main | ||
| 6275 | % vertical list for the beginning and end of each change). | ||
| 6276 | % | ||
| 6277 | \def\|{% | ||
| 6278 | % \vadjust can only be used in horizontal mode. | ||
| 6279 | \leavevmode | ||
| 6280 | % | ||
| 6281 | % Append this vertical mode material after the current line in the output. | ||
| 6282 | \vadjust{% | ||
| 6283 | % We want to insert a rule with the height and depth of the current | ||
| 6284 | % leading; that is exactly what \strutbox is supposed to record. | ||
| 6285 | \vskip-\baselineskip | ||
| 6286 | % | ||
| 6287 | % \vadjust-items are inserted at the left edge of the type. So | ||
| 6288 | % the \llap here moves out into the left-hand margin. | ||
| 6289 | \llap{% | ||
| 6290 | % | ||
| 6291 | % For a thicker or thinner bar, change the `1pt'. | ||
| 6292 | \vrule height\baselineskip width1pt | ||
| 6293 | % | ||
| 6294 | % This is the space between the bar and the text. | ||
| 6295 | \hskip 12pt | ||
| 6296 | }% | ||
| 6297 | }% | ||
| 6298 | } | ||
| 6299 | |||
| 6300 | % For a final copy, take out the rectangles | ||
| 6301 | % that mark overfull boxes (in case you have decided | ||
| 6302 | % that the text looks ok even though it passes the margin). | ||
| 6303 | % | ||
| 6304 | \def\finalout{\overfullrule=0pt} | ||
| 6305 | |||
| 6306 | % @image. We use the macros from epsf.tex to support this. | ||
| 6307 | % If epsf.tex is not installed and @image is used, we complain. | ||
| 6308 | % | ||
| 6309 | % Check for and read epsf.tex up front. If we read it only at @image | ||
| 6310 | % time, we might be inside a group, and then its definitions would get | ||
| 6311 | % undone and the next image would fail. | ||
| 6312 | \openin 1 = epsf.tex | ||
| 6313 | \ifeof 1 \else | ||
| 6314 | \closein 1 | ||
| 6315 | % Do not bother showing banner with epsf.tex v2.7k (available in | ||
| 6316 | % doc/epsf.tex and on ctan). | ||
| 6317 | \def\epsfannounce{\toks0 = }% | ||
| 6318 | \input epsf.tex | ||
| 6319 | \fi | ||
| 6320 | % | ||
| 6321 | % We will only complain once about lack of epsf.tex. | ||
| 6322 | \newif\ifwarnednoepsf | ||
| 6323 | \newhelp\noepsfhelp{epsf.tex must be installed for images to | ||
| 6324 | work. It is also included in the Texinfo distribution, or you can get | ||
| 6325 | it from ftp://tug.org/tex/epsf.tex.} | ||
| 6326 | % | ||
| 6327 | \def\image#1{% | ||
| 6328 | \ifx\epsfbox\undefined | ||
| 6329 | \ifwarnednoepsf \else | ||
| 6330 | \errhelp = \noepsfhelp | ||
| 6331 | \errmessage{epsf.tex not found, images will be ignored}% | ||
| 6332 | \global\warnednoepsftrue | ||
| 6333 | \fi | ||
| 6334 | \else | ||
| 6335 | \imagexxx #1,,,,,\finish | ||
| 6336 | \fi | ||
| 6337 | } | ||
| 6338 | % | ||
| 6339 | % Arguments to @image: | ||
| 6340 | % #1 is (mandatory) image filename; we tack on .eps extension. | ||
| 6341 | % #2 is (optional) width, #3 is (optional) height. | ||
| 6342 | % #4 is (ignored optional) html alt text. | ||
| 6343 | % #5 is (ignored optional) extension. | ||
| 6344 | % #6 is just the usual extra ignored arg for parsing this stuff. | ||
| 6345 | \newif\ifimagevmode | ||
| 6346 | \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup | ||
| 6347 | \catcode`\^^M = 5 % in case we're inside an example | ||
| 6348 | \normalturnoffactive % allow _ et al. in names | ||
| 6349 | % If the image is by itself, center it. | ||
| 6350 | \ifvmode | ||
| 6351 | \imagevmodetrue | ||
| 6352 | \nobreak\bigskip | ||
| 6353 | % Usually we'll have text after the image which will insert | ||
| 6354 | % \parskip glue, so insert it here too to equalize the space | ||
| 6355 | % above and below. | ||
| 6356 | \nobreak\vskip\parskip | ||
| 6357 | \nobreak | ||
| 6358 | \line\bgroup\hss | ||
| 6359 | \fi | ||
| 6360 | % | ||
| 6361 | % Output the image. | ||
| 6362 | \ifpdf | ||
| 6363 | \dopdfimage{#1}{#2}{#3}% | ||
| 6364 | \else | ||
| 6365 | % \epsfbox itself resets \epsf?size at each figure. | ||
| 6366 | \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi | ||
| 6367 | \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi | ||
| 6368 | \epsfbox{#1.eps}% | ||
| 6369 | \fi | ||
| 6370 | % | ||
| 6371 | \ifimagevmode \hss \egroup \bigbreak \fi % space after the image | ||
| 6372 | \endgroup} | ||
| 6373 | |||
| 6374 | |||
| 6375 | \message{localization,} | ||
| 6376 | % and i18n. | ||
| 6377 | |||
| 6378 | % @documentlanguage is usually given very early, just after | ||
| 6379 | % @setfilename. If done too late, it may not override everything | ||
| 6380 | % properly. Single argument is the language abbreviation. | ||
| 6381 | % It would be nice if we could set up a hyphenation file here. | ||
| 6382 | % | ||
| 6383 | \def\documentlanguage{\parsearg\dodocumentlanguage} | ||
| 6384 | \def\dodocumentlanguage#1{% | ||
| 6385 | \tex % read txi-??.tex file in plain TeX. | ||
| 6386 | % Read the file if it exists. | ||
| 6387 | \openin 1 txi-#1.tex | ||
| 6388 | \ifeof1 | ||
| 6389 | \errhelp = \nolanghelp | ||
| 6390 | \errmessage{Cannot read language file txi-#1.tex}% | ||
| 6391 | \let\temp = \relax | ||
| 6392 | \else | ||
| 6393 | \def\temp{\input txi-#1.tex }% | ||
| 6394 | \fi | ||
| 6395 | \temp | ||
| 6396 | \endgroup | ||
| 6397 | } | ||
| 6398 | \newhelp\nolanghelp{The given language definition file cannot be found or | ||
| 6399 | is empty. Maybe you need to install it? In the current directory | ||
| 6400 | should work if nowhere else does.} | ||
| 6401 | |||
| 6402 | |||
| 6403 | % @documentencoding should change something in TeX eventually, most | ||
| 6404 | % likely, but for now just recognize it. | ||
| 6405 | \let\documentencoding = \comment | ||
| 6406 | |||
| 6407 | |||
| 6408 | % Page size parameters. | ||
| 6409 | % | ||
| 6410 | \newdimen\defaultparindent \defaultparindent = 15pt | ||
| 6411 | |||
| 6412 | \chapheadingskip = 15pt plus 4pt minus 2pt | ||
| 6413 | \secheadingskip = 12pt plus 3pt minus 2pt | ||
| 6414 | \subsecheadingskip = 9pt plus 2pt minus 2pt | ||
| 6415 | |||
| 6416 | % Prevent underfull vbox error messages. | ||
| 6417 | \vbadness = 10000 | ||
| 6418 | |||
| 6419 | % Don't be so finicky about underfull hboxes, either. | ||
| 6420 | \hbadness = 2000 | ||
| 6421 | |||
| 6422 | % Following George Bush, just get rid of widows and orphans. | ||
| 6423 | \widowpenalty=10000 | ||
| 6424 | \clubpenalty=10000 | ||
| 6425 | |||
| 6426 | % Use TeX 3.0's \emergencystretch to help line breaking, but if we're | ||
| 6427 | % using an old version of TeX, don't do anything. We want the amount of | ||
| 6428 | % stretch added to depend on the line length, hence the dependence on | ||
| 6429 | % \hsize. We call this whenever the paper size is set. | ||
| 6430 | % | ||
| 6431 | \def\setemergencystretch{% | ||
| 6432 | \ifx\emergencystretch\thisisundefined | ||
| 6433 | % Allow us to assign to \emergencystretch anyway. | ||
| 6434 | \def\emergencystretch{\dimen0}% | ||
| 6435 | \else | ||
| 6436 | \emergencystretch = .15\hsize | ||
| 6437 | \fi | ||
| 6438 | } | ||
| 6439 | |||
| 6440 | % Parameters in order: 1) textheight; 2) textwidth; 3) voffset; | ||
| 6441 | % 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8) | ||
| 6442 | % physical page width. | ||
| 6443 | % | ||
| 6444 | % We also call \setleading{\textleading}, so the caller should define | ||
| 6445 | % \textleading. The caller should also set \parskip. | ||
| 6446 | % | ||
| 6447 | \def\internalpagesizes#1#2#3#4#5#6#7#8{% | ||
| 6448 | \voffset = #3\relax | ||
| 6449 | \topskip = #6\relax | ||
| 6450 | \splittopskip = \topskip | ||
| 6451 | % | ||
| 6452 | \vsize = #1\relax | ||
| 6453 | \advance\vsize by \topskip | ||
| 6454 | \outervsize = \vsize | ||
| 6455 | \advance\outervsize by 2\topandbottommargin | ||
| 6456 | \pageheight = \vsize | ||
| 6457 | % | ||
| 6458 | \hsize = #2\relax | ||
| 6459 | \outerhsize = \hsize | ||
| 6460 | \advance\outerhsize by 0.5in | ||
| 6461 | \pagewidth = \hsize | ||
| 6462 | % | ||
| 6463 | \normaloffset = #4\relax | ||
| 6464 | \bindingoffset = #5\relax | ||
| 6465 | % | ||
| 6466 | \ifpdf | ||
| 6467 | \pdfpageheight #7\relax | ||
| 6468 | \pdfpagewidth #8\relax | ||
| 6469 | \fi | ||
| 6470 | % | ||
| 6471 | \setleading{\textleading} | ||
| 6472 | % | ||
| 6473 | \parindent = \defaultparindent | ||
| 6474 | \setemergencystretch | ||
| 6475 | } | ||
| 6476 | |||
| 6477 | % @letterpaper (the default). | ||
| 6478 | \def\letterpaper{{\globaldefs = 1 | ||
| 6479 | \parskip = 3pt plus 2pt minus 1pt | ||
| 6480 | \textleading = 13.2pt | ||
| 6481 | % | ||
| 6482 | % If page is nothing but text, make it come out even. | ||
| 6483 | \internalpagesizes{46\baselineskip}{6in}% | ||
| 6484 | {\voffset}{.25in}% | ||
| 6485 | {\bindingoffset}{36pt}% | ||
| 6486 | {11in}{8.5in}% | ||
| 6487 | }} | ||
| 6488 | |||
| 6489 | % Use @smallbook to reset parameters for 7x9.5 (or so) format. | ||
| 6490 | \def\smallbook{{\globaldefs = 1 | ||
| 6491 | \parskip = 2pt plus 1pt | ||
| 6492 | \textleading = 12pt | ||
| 6493 | % | ||
| 6494 | \internalpagesizes{7.5in}{5in}% | ||
| 6495 | {\voffset}{.25in}% | ||
| 6496 | {\bindingoffset}{16pt}% | ||
| 6497 | {9.25in}{7in}% | ||
| 6498 | % | ||
| 6499 | \lispnarrowing = 0.3in | ||
| 6500 | \tolerance = 700 | ||
| 6501 | \hfuzz = 1pt | ||
| 6502 | \contentsrightmargin = 0pt | ||
| 6503 | \defbodyindent = .5cm | ||
| 6504 | }} | ||
| 6505 | |||
| 6506 | % Use @afourpaper to print on European A4 paper. | ||
| 6507 | \def\afourpaper{{\globaldefs = 1 | ||
| 6508 | \parskip = 3pt plus 2pt minus 1pt | ||
| 6509 | \textleading = 13.2pt | ||
| 6510 | % | ||
| 6511 | % Double-side printing via postscript on Laserjet 4050 | ||
| 6512 | % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. | ||
| 6513 | % To change the settings for a different printer or situation, adjust | ||
| 6514 | % \normaloffset until the front-side and back-side texts align. Then | ||
| 6515 | % do the same for \bindingoffset. You can set these for testing in | ||
| 6516 | % your texinfo source file like this: | ||
| 6517 | % @tex | ||
| 6518 | % \global\normaloffset = -6mm | ||
| 6519 | % \global\bindingoffset = 10mm | ||
| 6520 | % @end tex | ||
| 6521 | \internalpagesizes{51\baselineskip}{160mm} | ||
| 6522 | {\voffset}{\hoffset}% | ||
| 6523 | {\bindingoffset}{44pt}% | ||
| 6524 | {297mm}{210mm}% | ||
| 6525 | % | ||
| 6526 | \tolerance = 700 | ||
| 6527 | \hfuzz = 1pt | ||
| 6528 | \contentsrightmargin = 0pt | ||
| 6529 | \defbodyindent = 5mm | ||
| 6530 | }} | ||
| 6531 | |||
| 6532 | % Use @afivepaper to print on European A5 paper. | ||
| 6533 | % From romildo@urano.iceb.ufop.br, 2 July 2000. | ||
| 6534 | % He also recommends making @example and @lisp be small. | ||
| 6535 | \def\afivepaper{{\globaldefs = 1 | ||
| 6536 | \parskip = 2pt plus 1pt minus 0.1pt | ||
| 6537 | \textleading = 12.5pt | ||
| 6538 | % | ||
| 6539 | \internalpagesizes{160mm}{120mm}% | ||
| 6540 | {\voffset}{\hoffset}% | ||
| 6541 | {\bindingoffset}{8pt}% | ||
| 6542 | {210mm}{148mm}% | ||
| 6543 | % | ||
| 6544 | \lispnarrowing = 0.2in | ||
| 6545 | \tolerance = 800 | ||
| 6546 | \hfuzz = 1.2pt | ||
| 6547 | \contentsrightmargin = 0pt | ||
| 6548 | \defbodyindent = 2mm | ||
| 6549 | \tableindent = 12mm | ||
| 6550 | }} | ||
| 6551 | |||
| 6552 | % A specific text layout, 24x15cm overall, intended for A4 paper. | ||
| 6553 | \def\afourlatex{{\globaldefs = 1 | ||
| 6554 | \afourpaper | ||
| 6555 | \internalpagesizes{237mm}{150mm}% | ||
| 6556 | {\voffset}{4.6mm}% | ||
| 6557 | {\bindingoffset}{7mm}% | ||
| 6558 | {297mm}{210mm}% | ||
| 6559 | % | ||
| 6560 | % Must explicitly reset to 0 because we call \afourpaper. | ||
| 6561 | \globaldefs = 0 | ||
| 6562 | }} | ||
| 6563 | |||
| 6564 | % Use @afourwide to print on A4 paper in landscape format. | ||
| 6565 | \def\afourwide{{\globaldefs = 1 | ||
| 6566 | \afourpaper | ||
| 6567 | \internalpagesizes{241mm}{165mm}% | ||
| 6568 | {\voffset}{-2.95mm}% | ||
| 6569 | {\bindingoffset}{7mm}% | ||
| 6570 | {297mm}{210mm}% | ||
| 6571 | \globaldefs = 0 | ||
| 6572 | }} | ||
| 6573 | |||
| 6574 | % @pagesizes TEXTHEIGHT[,TEXTWIDTH] | ||
| 6575 | % Perhaps we should allow setting the margins, \topskip, \parskip, | ||
| 6576 | % and/or leading, also. Or perhaps we should compute them somehow. | ||
| 6577 | % | ||
| 6578 | \def\pagesizes{\parsearg\pagesizesxxx} | ||
| 6579 | \def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} | ||
| 6580 | \def\pagesizesyyy#1,#2,#3\finish{{% | ||
| 6581 | \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi | ||
| 6582 | \globaldefs = 1 | ||
| 6583 | % | ||
| 6584 | \parskip = 3pt plus 2pt minus 1pt | ||
| 6585 | \setleading{\textleading}% | ||
| 6586 | % | ||
| 6587 | \dimen0 = #1 | ||
| 6588 | \advance\dimen0 by \voffset | ||
| 6589 | % | ||
| 6590 | \dimen2 = \hsize | ||
| 6591 | \advance\dimen2 by \normaloffset | ||
| 6592 | % | ||
| 6593 | \internalpagesizes{#1}{\hsize}% | ||
| 6594 | {\voffset}{\normaloffset}% | ||
| 6595 | {\bindingoffset}{44pt}% | ||
| 6596 | {\dimen0}{\dimen2}% | ||
| 6597 | }} | ||
| 6598 | |||
| 6599 | % Set default to letter. | ||
| 6600 | % | ||
| 6601 | \letterpaper | ||
| 6602 | |||
| 6603 | |||
| 6604 | \message{and turning on texinfo input format.} | ||
| 6605 | |||
| 6606 | % Define macros to output various characters with catcode for normal text. | ||
| 6607 | \catcode`\"=\other | ||
| 6608 | \catcode`\~=\other | ||
| 6609 | \catcode`\^=\other | ||
| 6610 | \catcode`\_=\other | ||
| 6611 | \catcode`\|=\other | ||
| 6612 | \catcode`\<=\other | ||
| 6613 | \catcode`\>=\other | ||
| 6614 | \catcode`\+=\other | ||
| 6615 | \catcode`\$=\other | ||
| 6616 | \def\normaldoublequote{"} | ||
| 6617 | \def\normaltilde{~} | ||
| 6618 | \def\normalcaret{^} | ||
| 6619 | \def\normalunderscore{_} | ||
| 6620 | \def\normalverticalbar{|} | ||
| 6621 | \def\normalless{<} | ||
| 6622 | \def\normalgreater{>} | ||
| 6623 | \def\normalplus{+} | ||
| 6624 | \def\normaldollar{$}%$ font-lock fix | ||
| 6625 | |||
| 6626 | % This macro is used to make a character print one way in ttfont | ||
| 6627 | % where it can probably just be output, and another way in other fonts, | ||
| 6628 | % where something hairier probably needs to be done. | ||
| 6629 | % | ||
| 6630 | % #1 is what to print if we are indeed using \tt; #2 is what to print | ||
| 6631 | % otherwise. Since all the Computer Modern typewriter fonts have zero | ||
| 6632 | % interword stretch (and shrink), and it is reasonable to expect all | ||
| 6633 | % typewriter fonts to have this, we can check that font parameter. | ||
| 6634 | % | ||
| 6635 | \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} | ||
| 6636 | |||
| 6637 | % Same as above, but check for italic font. Actually this also catches | ||
| 6638 | % non-italic slanted fonts since it is impossible to distinguish them from | ||
| 6639 | % italic fonts. But since this is only used by $ and it uses \sl anyway | ||
| 6640 | % this is not a problem. | ||
| 6641 | \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} | ||
| 6642 | |||
| 6643 | % Turn off all special characters except @ | ||
| 6644 | % (and those which the user can use as if they were ordinary). | ||
| 6645 | % Most of these we simply print from the \tt font, but for some, we can | ||
| 6646 | % use math or other variants that look better in normal text. | ||
| 6647 | |||
| 6648 | \catcode`\"=\active | ||
| 6649 | \def\activedoublequote{{\tt\char34}} | ||
| 6650 | \let"=\activedoublequote | ||
| 6651 | \catcode`\~=\active | ||
| 6652 | \def~{{\tt\char126}} | ||
| 6653 | \chardef\hat=`\^ | ||
| 6654 | \catcode`\^=\active | ||
| 6655 | \def^{{\tt \hat}} | ||
| 6656 | |||
| 6657 | \catcode`\_=\active | ||
| 6658 | \def_{\ifusingtt\normalunderscore\_} | ||
| 6659 | % Subroutine for the previous macro. | ||
| 6660 | \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } | ||
| 6661 | |||
| 6662 | \catcode`\|=\active | ||
| 6663 | \def|{{\tt\char124}} | ||
| 6664 | \chardef \less=`\< | ||
| 6665 | \catcode`\<=\active | ||
| 6666 | \def<{{\tt \less}} | ||
| 6667 | \chardef \gtr=`\> | ||
| 6668 | \catcode`\>=\active | ||
| 6669 | \def>{{\tt \gtr}} | ||
| 6670 | \catcode`\+=\active | ||
| 6671 | \def+{{\tt \char 43}} | ||
| 6672 | \catcode`\$=\active | ||
| 6673 | \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix | ||
| 6674 | |||
| 6675 | % Set up an active definition for =, but don't enable it most of the time. | ||
| 6676 | {\catcode`\==\active | ||
| 6677 | \global\def={{\tt \char 61}}} | ||
| 6678 | |||
| 6679 | \catcode`+=\active | ||
| 6680 | \catcode`\_=\active | ||
| 6681 | |||
| 6682 | % If a .fmt file is being used, characters that might appear in a file | ||
| 6683 | % name cannot be active until we have parsed the command line. | ||
| 6684 | % So turn them off again, and have \everyjob (or @setfilename) turn them on. | ||
| 6685 | % \otherifyactive is called near the end of this file. | ||
| 6686 | \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} | ||
| 6687 | |||
| 6688 | \catcode`\@=0 | ||
| 6689 | |||
| 6690 | % \rawbackslashxx outputs one backslash character in current font, | ||
| 6691 | % as in \char`\\. | ||
| 6692 | \global\chardef\rawbackslashxx=`\\ | ||
| 6693 | |||
| 6694 | % \rawbackslash defines an active \ to do \rawbackslashxx. | ||
| 6695 | % \otherbackslash defines an active \ to be a literal `\' character with | ||
| 6696 | % catcode other. | ||
| 6697 | {\catcode`\\=\active | ||
| 6698 | @gdef@rawbackslash{@let\=@rawbackslashxx} | ||
| 6699 | @gdef@otherbackslash{@let\=@realbackslash} | ||
| 6700 | } | ||
| 6701 | |||
| 6702 | % \realbackslash is an actual character `\' with catcode other. | ||
| 6703 | {\catcode`\\=\other @gdef@realbackslash{\}} | ||
| 6704 | |||
| 6705 | % \normalbackslash outputs one backslash in fixed width font. | ||
| 6706 | \def\normalbackslash{{\tt\rawbackslashxx}} | ||
| 6707 | |||
| 6708 | \catcode`\\=\active | ||
| 6709 | |||
| 6710 | % Used sometimes to turn off (effectively) the active characters | ||
| 6711 | % even after parsing them. | ||
| 6712 | @def@turnoffactive{% | ||
| 6713 | @let"=@normaldoublequote | ||
| 6714 | @let\=@realbackslash | ||
| 6715 | @let~=@normaltilde | ||
| 6716 | @let^=@normalcaret | ||
| 6717 | @let_=@normalunderscore | ||
| 6718 | @let|=@normalverticalbar | ||
| 6719 | @let<=@normalless | ||
| 6720 | @let>=@normalgreater | ||
| 6721 | @let+=@normalplus | ||
| 6722 | @let$=@normaldollar %$ font-lock fix | ||
| 6723 | } | ||
| 6724 | |||
| 6725 | % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of | ||
| 6726 | % the literal character `\'. (Thus, \ is not expandable when this is in | ||
| 6727 | % effect.) | ||
| 6728 | % | ||
| 6729 | @def@normalturnoffactive{@turnoffactive @let\=@normalbackslash} | ||
| 6730 | |||
| 6731 | % Make _ and + \other characters, temporarily. | ||
| 6732 | % This is canceled by @fixbackslash. | ||
| 6733 | @otherifyactive | ||
| 6734 | |||
| 6735 | % If a .fmt file is being used, we don't want the `\input texinfo' to show up. | ||
| 6736 | % That is what \eatinput is for; after that, the `\' should revert to printing | ||
| 6737 | % a backslash. | ||
| 6738 | % | ||
| 6739 | @gdef@eatinput input texinfo{@fixbackslash} | ||
| 6740 | @global@let\ = @eatinput | ||
| 6741 | |||
| 6742 | % On the other hand, perhaps the file did not have a `\input texinfo'. Then | ||
| 6743 | % the first `\{ in the file would cause an error. This macro tries to fix | ||
| 6744 | % that, assuming it is called before the first `\' could plausibly occur. | ||
| 6745 | % Also back turn on active characters that might appear in the input | ||
| 6746 | % file name, in case not using a pre-dumped format. | ||
| 6747 | % | ||
| 6748 | @gdef@fixbackslash{% | ||
| 6749 | @ifx\@eatinput @let\ = @normalbackslash @fi | ||
| 6750 | @catcode`+=@active | ||
| 6751 | @catcode`@_=@active | ||
| 6752 | } | ||
| 6753 | |||
| 6754 | % Say @foo, not \foo, in error messages. | ||
| 6755 | @escapechar = `@@ | ||
| 6756 | |||
| 6757 | % These look ok in all fonts, so just make them not special. | ||
| 6758 | @catcode`@& = @other | ||
| 6759 | @catcode`@# = @other | ||
| 6760 | @catcode`@% = @other | ||
| 6761 | |||
| 6762 | @c Set initial fonts. | ||
| 6763 | @textfonts | ||
| 6764 | @rm | ||
| 6765 | |||
| 6766 | |||
| 6767 | @c Local variables: | ||
| 6768 | @c eval: (add-hook 'write-file-hooks 'time-stamp) | ||
| 6769 | @c page-delimiter: "^\\\\message" | ||
| 6770 | @c time-stamp-start: "def\\\\texinfoversion{" | ||
| 6771 | @c time-stamp-format: "%:y-%02m-%02d.%02H" | ||
| 6772 | @c time-stamp-end: "}" | ||
| 6773 | @c End: | ||
| 6774 | |||
| 6775 | @ignore | ||
| 6776 | arch-tag: 53261dd3-7df7-4ec3-9d90-af7a955d3c87 | ||
| 6777 | @end ignore | ||
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 09757fca10b..cc3ccac3c7a 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,129 @@ | |||
| 1 | 2006-08-27 Michael Olson <mwolson@gnu.org> | ||
| 2 | |||
| 3 | * processes.texi (Transaction Queues): Remove stray quote | ||
| 4 | character. | ||
| 5 | |||
| 6 | 2006-08-25 Richard Stallman <rms@gnu.org> | ||
| 7 | |||
| 8 | * os.texi (Idle Timers): run-with-idle-timer allows Lisp time value. | ||
| 9 | Add xref. | ||
| 10 | |||
| 11 | 2006-08-24 Chong Yidong <cyd@stupidchicken.com> | ||
| 12 | |||
| 13 | * os.texi (Timers): Avoid waiting inside timers. | ||
| 14 | |||
| 15 | 2006-08-21 Lute Kamstra <lute@gnu.org> | ||
| 16 | |||
| 17 | * Makefile.in: Use ../man/texinfo.tex to build elisp.dvi. | ||
| 18 | |||
| 19 | 2006-08-20 Richard Stallman <rms@gnu.org> | ||
| 20 | |||
| 21 | * os.texi (Idle Timers): New node, split out from Timers. | ||
| 22 | Document current-idle-time. | ||
| 23 | * commands.texi (Reading One Event): Update xref. | ||
| 24 | * elisp.texi (Top): Update subnode menu. | ||
| 25 | |||
| 26 | 2006-08-16 Richard Stallman <rms@gnu.org> | ||
| 27 | |||
| 28 | * keymaps.texi (Extended Menu Items): Show format of cached | ||
| 29 | bindings in extended menu items. | ||
| 30 | |||
| 31 | * customize.texi (Variable Definitions): Explain when the | ||
| 32 | standard value expression is evaluated. | ||
| 33 | |||
| 34 | 2006-08-15 Chong Yidong <cyd@stupidchicken.com> | ||
| 35 | |||
| 36 | * commands.texi (Reading One Event): Explain idleness in | ||
| 37 | `read-event'. | ||
| 38 | |||
| 39 | 2006-08-12 Chong Yidong <cyd@stupidchicken.com> | ||
| 40 | |||
| 41 | * text.texi (Near Point): Say "cursor" not "terminal cursor". | ||
| 42 | (Commands for Insertion): Removed split-line since it's not | ||
| 43 | relevant for Lisp programming. | ||
| 44 | (Yank Commands): Rewrite introduction. | ||
| 45 | (Undo): Clarify. | ||
| 46 | (Maintaining Undo): Clarify. Document undo-ask-before-discard. | ||
| 47 | (Filling): Remove redundant comment. Clarify return value of | ||
| 48 | current-justification. | ||
| 49 | (Margins): Minor clarifications. | ||
| 50 | (Adaptive Fill): Update default value of adaptive-fill-regexp. | ||
| 51 | (Sorting): Update definition of sort-lines. | ||
| 52 | (Columns): Clarify behavior of sort-columns. | ||
| 53 | (Indent Tabs): Link to Tab Stops in Emacs manual. | ||
| 54 | (Special Properties): Clarify. | ||
| 55 | (Clickable Text): Mention Buttons package. | ||
| 56 | |||
| 57 | 2006-08-12 Kevin Ryde <user42@zip.com.au> | ||
| 58 | |||
| 59 | * os.texi (Time Parsing): Add %z to description of | ||
| 60 | format-time-string, as per docstring. Add cross reference to | ||
| 61 | glibc manual for strftime. | ||
| 62 | |||
| 63 | 2006-08-08 Richard Stallman <rms@gnu.org> | ||
| 64 | |||
| 65 | * modes.texi: Clean up wording in previous change. | ||
| 66 | |||
| 67 | 2006-08-07 Chong Yidong <cyd@stupidchicken.com> | ||
| 68 | |||
| 69 | * modes.texi (Hooks): Clarify. | ||
| 70 | (Major Mode Basics): Mention define-derived-mode explicitly. | ||
| 71 | (Major Mode Conventions): Rebinding RET is OK for some modes. | ||
| 72 | Mention change-major-mode-hook and after-change-major-mode-hook. | ||
| 73 | (Example Major Modes): Moved to end of Modes section. | ||
| 74 | (Mode Line Basics): Clarify. | ||
| 75 | (Mode Line Data): Mention help-echo and local-map in strings. | ||
| 76 | Explain reason for treatment of non-risky variables. | ||
| 77 | (Properties in Mode): Clarify. | ||
| 78 | (Faces for Font Lock): Add font-lock-negation-char-face. | ||
| 79 | |||
| 80 | 2006-08-04 Eli Zaretskii <eliz@gnu.org> | ||
| 81 | |||
| 82 | * strings.texi (Formatting Strings): Warn against arbitrary | ||
| 83 | strings as first arg to `format'. | ||
| 84 | |||
| 85 | 2006-07-31 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 86 | |||
| 87 | * text.texi (Clickable Text): Mention `help-echo' text property. | ||
| 88 | Update intro, examples and associated explanations. | ||
| 89 | |||
| 90 | 2006-07-31 Richard Stallman <rms@gnu.org> | ||
| 91 | |||
| 92 | * commands.texi: Update xrefs. | ||
| 93 | (Event Mod): New node, cut out from old Translating Input. | ||
| 94 | |||
| 95 | * maps.texi: Update xrefs. | ||
| 96 | |||
| 97 | * keymaps.texi (Translation Keymaps): New node. | ||
| 98 | Update xrefs from Translating Input to Translation Keymaps. | ||
| 99 | |||
| 100 | * elisp.texi (Top): Update subnode menu. | ||
| 101 | |||
| 102 | * display.texi (Face Functions): Fix explanations of FRAME=t or nil. | ||
| 103 | |||
| 104 | * os.texi (System Interface): Fix menu descriptions of some nodes. | ||
| 105 | (Translating Input): Node deleted. | ||
| 106 | |||
| 107 | 2006-07-31 Nick Roberts <nickrob@snap.net.nz> | ||
| 108 | |||
| 109 | * modes.texi (Minor Mode Conventions): Update link for add-to-list. | ||
| 110 | |||
| 111 | * lists.texi (Sets And Lists): Likewise. | ||
| 112 | |||
| 113 | 2006-07-30 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 114 | |||
| 115 | * text.texi (Fields): Mention POS | ||
| 116 | requirement when narrowing is in effect. | ||
| 117 | |||
| 118 | 2006-07-28 Richard Stallman <rms@gnu.org> | ||
| 119 | |||
| 120 | * display.texi (Face Attributes): Simplify wording. | ||
| 121 | (Attribute Functions): Clarify meaning of new-frame default | ||
| 122 | attribute settings. | ||
| 123 | |||
| 124 | * customize.texi (Common Keywords): Document how to use | ||
| 125 | :package-version in a package not in Emacs. | ||
| 126 | |||
| 1 | 2006-07-28 Kim F. Storm <storm@cua.dk> | 127 | 2006-07-28 Kim F. Storm <storm@cua.dk> |
| 2 | 128 | ||
| 3 | * commands.texi (Reading One Event): Fix last change. | 129 | * commands.texi (Reading One Event): Fix last change. |
| @@ -248,7 +374,7 @@ | |||
| 248 | 374 | ||
| 249 | * anti.texi, customize.texi, display.texi, internals.texi: | 375 | * anti.texi, customize.texi, display.texi, internals.texi: |
| 250 | * minibuf.texi, modes.texi, tips.texi: | 376 | * minibuf.texi, modes.texi, tips.texi: |
| 251 | Fix overfull/underfull boxes. | 377 | Fix overfull/underfull boxes. |
| 252 | 378 | ||
| 253 | 2006-07-05 Thien-Thi Nguyen <ttn@gnu.org> | 379 | 2006-07-05 Thien-Thi Nguyen <ttn@gnu.org> |
| 254 | 380 | ||
| @@ -325,7 +451,7 @@ | |||
| 325 | 451 | ||
| 326 | 2006-06-09 Aidan Kehoe <kehoea@parhasard.net> | 452 | 2006-06-09 Aidan Kehoe <kehoea@parhasard.net> |
| 327 | 453 | ||
| 328 | * objects.texi (Character Type): Describe the\uABCD and \U00ABCDEF | 454 | * objects.texi (Character Type): Describe the \uABCD and \U00ABCDEF |
| 329 | syntax. | 455 | syntax. |
| 330 | 456 | ||
| 331 | 2006-06-07 Eli Zaretskii <eliz@gnu.org> | 457 | 2006-06-07 Eli Zaretskii <eliz@gnu.org> |
| @@ -637,7 +763,7 @@ | |||
| 637 | 2006-04-13 Bill Wohler <wohler@newt.com> | 763 | 2006-04-13 Bill Wohler <wohler@newt.com> |
| 638 | 764 | ||
| 639 | * customize.texi (Common Keywords): Use dotted notation for | 765 | * customize.texi (Common Keywords): Use dotted notation for |
| 640 | :package-version value. Specify its values. Improve documentation | 766 | :package-version value. Specify its values. Improve documentation |
| 641 | for customize-package-emacs-version-alist. | 767 | for customize-package-emacs-version-alist. |
| 642 | 768 | ||
| 643 | 2006-04-12 Bill Wohler <wohler@newt.com> | 769 | 2006-04-12 Bill Wohler <wohler@newt.com> |
| @@ -1682,7 +1808,7 @@ | |||
| 1682 | (Jumping): Clarify description of `h' command. | 1808 | (Jumping): Clarify description of `h' command. |
| 1683 | Eliminate redundant @ref. | 1809 | Eliminate redundant @ref. |
| 1684 | (Breaks): New node. | 1810 | (Breaks): New node. |
| 1685 | (Breakpoints): is now a subsubsection. | 1811 | (Breakpoints): Is now a subsubsection. |
| 1686 | (Global Break Condition): Mention `C-x X X'. | 1812 | (Global Break Condition): Mention `C-x X X'. |
| 1687 | (Edebug Views): Clarify `v' and `p'. Mention `C-x X w'. | 1813 | (Edebug Views): Clarify `v' and `p'. Mention `C-x X w'. |
| 1688 | (Trace Buffer): Clarify STRING arg of `edebug-tracing'. | 1814 | (Trace Buffer): Clarify STRING arg of `edebug-tracing'. |
| @@ -2932,7 +3058,7 @@ | |||
| 2932 | 3058 | ||
| 2933 | 2004-10-24 Jason Rumney <jasonr@gnu.org> | 3059 | 2004-10-24 Jason Rumney <jasonr@gnu.org> |
| 2934 | 3060 | ||
| 2935 | * commands.texi (Misc Events): Remove mouse-wheel. Add wheel-up | 3061 | * commands.texi (Misc Events): Remove mouse-wheel. Add wheel-up |
| 2936 | and wheel-down. | 3062 | and wheel-down. |
| 2937 | 3063 | ||
| 2938 | 2004-10-24 Kai Grossjohann <kai.grossjohann@gmx.net> | 3064 | 2004-10-24 Kai Grossjohann <kai.grossjohann@gmx.net> |
| @@ -3161,7 +3287,7 @@ | |||
| 3161 | except while processing `frame-title-format' or `icon-title-format'. | 3287 | except while processing `frame-title-format' or `icon-title-format'. |
| 3162 | (Deleting Frames): Correct description of `delete-frame'. | 3288 | (Deleting Frames): Correct description of `delete-frame'. |
| 3163 | Non-nil return values of `frame-live-p' are like those of `framep'. | 3289 | Non-nil return values of `frame-live-p' are like those of `framep'. |
| 3164 | (Frames and Windows): mention return value of | 3290 | (Frames and Windows): Mention return value of |
| 3165 | `set-frame-selected-window'. | 3291 | `set-frame-selected-window'. |
| 3166 | (Visibility of Frames): Mention `force' argument to | 3292 | (Visibility of Frames): Mention `force' argument to |
| 3167 | `make-frame-invisible'. `frame-visible-p' returns t for all | 3293 | `make-frame-invisible'. `frame-visible-p' returns t for all |
| @@ -3488,7 +3614,7 @@ | |||
| 3488 | 3614 | ||
| 3489 | 2004-03-07 Thien-Thi Nguyen <ttn@gnu.org> | 3615 | 2004-03-07 Thien-Thi Nguyen <ttn@gnu.org> |
| 3490 | 3616 | ||
| 3491 | * customize.texi: Fix typo. Remove eol whitespace. | 3617 | * customize.texi: Fix typo. Remove eol whitespace. |
| 3492 | 3618 | ||
| 3493 | 2004-03-04 Richard M. Stallman <rms@gnu.org> | 3619 | 2004-03-04 Richard M. Stallman <rms@gnu.org> |
| 3494 | 3620 | ||
| @@ -3524,7 +3650,7 @@ | |||
| 3524 | * text.texi: Various small changes in addition to the following: | 3650 | * text.texi: Various small changes in addition to the following: |
| 3525 | (User-Level Deletion): Mention optional BACKWARD-ONLY argument | 3651 | (User-Level Deletion): Mention optional BACKWARD-ONLY argument |
| 3526 | to delete-horizontal-space. | 3652 | to delete-horizontal-space. |
| 3527 | (Kill Functions, Yanking, Low-Level Kill Ring): clarify and correct | 3653 | (Kill Functions, Yanking, Low-Level Kill Ring): Clarify and correct |
| 3528 | description of yank-handler text property at various places. | 3654 | description of yank-handler text property at various places. |
| 3529 | 3655 | ||
| 3530 | * frames.texi (Window System Selections): Add anchor. | 3656 | * frames.texi (Window System Selections): Add anchor. |
| @@ -4551,7 +4677,7 @@ | |||
| 4551 | * loading.texi (Unloading): Fix recent change for load-history. | 4677 | * loading.texi (Unloading): Fix recent change for load-history. |
| 4552 | 4678 | ||
| 4553 | * customize.texi (Simple Types): Clarify description of custom | 4679 | * customize.texi (Simple Types): Clarify description of custom |
| 4554 | type 'number. Describe new custom type 'float. | 4680 | type 'number. Describe new custom type 'float. |
| 4555 | 4681 | ||
| 4556 | 2002-12-04 Markus Rost <rost@math.ohio-state.edu> | 4682 | 2002-12-04 Markus Rost <rost@math.ohio-state.edu> |
| 4557 | 4683 | ||
| @@ -5081,7 +5207,7 @@ Mon Apr 17 18:56:50 1989 Robert J. Chassell (bob@rice-chex.ai.mit.edu) | |||
| 5081 | Tue Apr 11 12:23:28 1989 Robert J. Chassell (bob@rice-chex.ai.mit.edu) | 5207 | Tue Apr 11 12:23:28 1989 Robert J. Chassell (bob@rice-chex.ai.mit.edu) |
| 5082 | 5208 | ||
| 5083 | * Applied Karl Berry's patches to *.texinfo files, but not to | 5209 | * Applied Karl Berry's patches to *.texinfo files, but not to |
| 5084 | texinfo.tex; those diffs are in `berry-texinfo-tex-diffs'. (Karl's | 5210 | texinfo.tex; those diffs are in `berry-texinfo-tex-diffs'. (Karl's |
| 5085 | new title page format is also not applied, since it requires | 5211 | new title page format is also not applied, since it requires |
| 5086 | texinfo.tex changes.) | 5212 | texinfo.tex changes.) |
| 5087 | 5213 | ||
diff --git a/lispref/Makefile.in b/lispref/Makefile.in index e3d09fe2c6f..1eea23e122e 100644 --- a/lispref/Makefile.in +++ b/lispref/Makefile.in | |||
| @@ -27,6 +27,7 @@ srcdir = @srcdir@ | |||
| 27 | VPATH=@srcdir@ | 27 | VPATH=@srcdir@ |
| 28 | 28 | ||
| 29 | infodir = $(srcdir)/../info | 29 | infodir = $(srcdir)/../info |
| 30 | usermanualdir = $(srcdir)/../man | ||
| 30 | 31 | ||
| 31 | TEXI2DVI = texi2dvi | 32 | TEXI2DVI = texi2dvi |
| 32 | SHELL = /bin/sh | 33 | SHELL = /bin/sh |
| @@ -103,7 +104,7 @@ $(infodir)/elisp: $(srcs) | |||
| 103 | $(MAKEINFO) -I. -I$(srcdir) $(srcdir)/elisp.texi -o $(infodir)/elisp | 104 | $(MAKEINFO) -I. -I$(srcdir) $(srcdir)/elisp.texi -o $(infodir)/elisp |
| 104 | 105 | ||
| 105 | elisp.dvi: $(srcs) | 106 | elisp.dvi: $(srcs) |
| 106 | $(TEXI2DVI) -I $(srcdir) $(srcdir)/elisp.texi | 107 | $(TEXI2DVI) -I $(srcdir) -I $(usermanualdir) $(srcdir)/elisp.texi |
| 107 | 108 | ||
| 108 | # This is for use in a separate distro of the Emacs Lisp manual. | 109 | # This is for use in a separate distro of the Emacs Lisp manual. |
| 109 | install: elisp | 110 | install: elisp |
diff --git a/lispref/commands.texi b/lispref/commands.texi index 10cd97400f8..514b55205a1 100644 --- a/lispref/commands.texi +++ b/lispref/commands.texi | |||
| @@ -1087,7 +1087,7 @@ Lisp programs by representing the former as the integer 9, and the | |||
| 1087 | latter as the symbol @code{tab}. | 1087 | latter as the symbol @code{tab}. |
| 1088 | 1088 | ||
| 1089 | Most of the time, it's not useful to distinguish the two. So normally | 1089 | Most of the time, it's not useful to distinguish the two. So normally |
| 1090 | @code{function-key-map} (@pxref{Translating Input}) is set up to map | 1090 | @code{function-key-map} (@pxref{Translation Keymaps}) is set up to map |
| 1091 | @code{tab} into 9. Thus, a key binding for character code 9 (the | 1091 | @code{tab} into 9. Thus, a key binding for character code 9 (the |
| 1092 | character @kbd{C-i}) also applies to @code{tab}. Likewise for the other | 1092 | character @kbd{C-i}) also applies to @code{tab}. Likewise for the other |
| 1093 | symbols in this group. The function @code{read-char} likewise converts | 1093 | symbols in this group. The function @code{read-char} likewise converts |
| @@ -2051,14 +2051,14 @@ functions for event input are also available for use in Lisp programs. | |||
| 2051 | See also @code{momentary-string-display} in @ref{Temporary Displays}, | 2051 | See also @code{momentary-string-display} in @ref{Temporary Displays}, |
| 2052 | and @code{sit-for} in @ref{Waiting}. @xref{Terminal Input}, for | 2052 | and @code{sit-for} in @ref{Waiting}. @xref{Terminal Input}, for |
| 2053 | functions and variables for controlling terminal input modes and | 2053 | functions and variables for controlling terminal input modes and |
| 2054 | debugging terminal input. @xref{Translating Input}, for features you | 2054 | debugging terminal input. |
| 2055 | can use for translating or modifying input events while reading them. | ||
| 2056 | 2055 | ||
| 2057 | For higher-level input facilities, see @ref{Minibuffers}. | 2056 | For higher-level input facilities, see @ref{Minibuffers}. |
| 2058 | 2057 | ||
| 2059 | @menu | 2058 | @menu |
| 2060 | * Key Sequence Input:: How to read one key sequence. | 2059 | * Key Sequence Input:: How to read one key sequence. |
| 2061 | * Reading One Event:: How to read just one event. | 2060 | * Reading One Event:: How to read just one event. |
| 2061 | * Event Mod:: How Emacs modifies events as they are read. | ||
| 2062 | * Invoking the Input Method:: How reading an event uses the input method. | 2062 | * Invoking the Input Method:: How reading an event uses the input method. |
| 2063 | * Quoted Character Input:: Asking the user to specify a character. | 2063 | * Quoted Character Input:: Asking the user to specify a character. |
| 2064 | * Event Input Misc:: How to reread or throw away input events. | 2064 | * Event Input Misc:: How to reread or throw away input events. |
| @@ -2088,7 +2088,7 @@ events---characters, symbols, and lists. The elements of the string or | |||
| 2088 | vector are the events in the key sequence. | 2088 | vector are the events in the key sequence. |
| 2089 | 2089 | ||
| 2090 | Reading a key sequence includes translating the events in various | 2090 | Reading a key sequence includes translating the events in various |
| 2091 | ways. @xref{Translating Input}. | 2091 | ways. @xref{Translation Keymaps}. |
| 2092 | 2092 | ||
| 2093 | The argument @var{prompt} is either a string to be displayed in the | 2093 | The argument @var{prompt} is either a string to be displayed in the |
| 2094 | echo area as a prompt, or @code{nil}, meaning not to display a prompt. | 2094 | echo area as a prompt, or @code{nil}, meaning not to display a prompt. |
| @@ -2229,6 +2229,15 @@ number of seconds; on these systems, @var{seconds} is rounded down. | |||
| 2229 | If @var{seconds} is @code{nil}, @code{read-event} waits as long as | 2229 | If @var{seconds} is @code{nil}, @code{read-event} waits as long as |
| 2230 | necessary for input to arrive. | 2230 | necessary for input to arrive. |
| 2231 | 2231 | ||
| 2232 | If @var{seconds} is @code{nil}, Emacs is considered idle while waiting | ||
| 2233 | for user input to arrive. Idle timers---those created with | ||
| 2234 | @code{run-with-idle-timer} (@pxref{Idle Timers})---can run during this | ||
| 2235 | period. However, if @var{seconds} is non-@code{nil}, the state of | ||
| 2236 | idleness remains unchanged. If Emacs is non-idle when | ||
| 2237 | @code{read-event} is called, it remains non-idle throughout the | ||
| 2238 | operation of @code{read-event}; if Emacs is idle (which can happen if | ||
| 2239 | the call happens inside an idle timer), it remains idle. | ||
| 2240 | |||
| 2232 | If @code{read-event} gets an event that is defined as a help character, | 2241 | If @code{read-event} gets an event that is defined as a help character, |
| 2233 | then in some cases @code{read-event} processes the event directly without | 2242 | then in some cases @code{read-event} processes the event directly without |
| 2234 | returning. @xref{Help Functions}. Certain other events, called | 2243 | returning. @xref{Help Functions}. Certain other events, called |
| @@ -2290,6 +2299,87 @@ This variable holds the total number of input events received so far | |||
| 2290 | from the terminal---not counting those generated by keyboard macros. | 2299 | from the terminal---not counting those generated by keyboard macros. |
| 2291 | @end defvar | 2300 | @end defvar |
| 2292 | 2301 | ||
| 2302 | @node Event Mod | ||
| 2303 | @subsection Modifying and Translating Input Events | ||
| 2304 | |||
| 2305 | Emacs modifies every event it reads according to | ||
| 2306 | @code{extra-keyboard-modifiers}, then translates it through | ||
| 2307 | @code{keyboard-translate-table} (if applicable), before returning it | ||
| 2308 | from @code{read-event}. | ||
| 2309 | |||
| 2310 | @c Emacs 19 feature | ||
| 2311 | @defvar extra-keyboard-modifiers | ||
| 2312 | This variable lets Lisp programs ``press'' the modifier keys on the | ||
| 2313 | keyboard. The value is a character. Only the modifiers of the | ||
| 2314 | character matter. Each time the user types a keyboard key, it is | ||
| 2315 | altered as if those modifier keys were held down. For instance, if | ||
| 2316 | you bind @code{extra-keyboard-modifiers} to @code{?\C-\M-a}, then all | ||
| 2317 | keyboard input characters typed during the scope of the binding will | ||
| 2318 | have the control and meta modifiers applied to them. The character | ||
| 2319 | @code{?\C-@@}, equivalent to the integer 0, does not count as a control | ||
| 2320 | character for this purpose, but as a character with no modifiers. | ||
| 2321 | Thus, setting @code{extra-keyboard-modifiers} to zero cancels any | ||
| 2322 | modification. | ||
| 2323 | |||
| 2324 | When using a window system, the program can ``press'' any of the | ||
| 2325 | modifier keys in this way. Otherwise, only the @key{CTL} and @key{META} | ||
| 2326 | keys can be virtually pressed. | ||
| 2327 | |||
| 2328 | Note that this variable applies only to events that really come from | ||
| 2329 | the keyboard, and has no effect on mouse events or any other events. | ||
| 2330 | @end defvar | ||
| 2331 | |||
| 2332 | @defvar keyboard-translate-table | ||
| 2333 | This variable is the translate table for keyboard characters. It lets | ||
| 2334 | you reshuffle the keys on the keyboard without changing any command | ||
| 2335 | bindings. Its value is normally a char-table, or else @code{nil}. | ||
| 2336 | (It can also be a string or vector, but this is considered obsolete.) | ||
| 2337 | |||
| 2338 | If @code{keyboard-translate-table} is a char-table | ||
| 2339 | (@pxref{Char-Tables}), then each character read from the keyboard is | ||
| 2340 | looked up in this char-table. If the value found there is | ||
| 2341 | non-@code{nil}, then it is used instead of the actual input character. | ||
| 2342 | |||
| 2343 | Note that this translation is the first thing that happens to a | ||
| 2344 | character after it is read from the terminal. Record-keeping features | ||
| 2345 | such as @code{recent-keys} and dribble files record the characters after | ||
| 2346 | translation. | ||
| 2347 | |||
| 2348 | Note also that this translation is done before the characters are | ||
| 2349 | supplied to input methods (@pxref{Input Methods}). Use | ||
| 2350 | @code{translation-table-for-input} (@pxref{Translation of Characters}), | ||
| 2351 | if you want to translate characters after input methods operate. | ||
| 2352 | @end defvar | ||
| 2353 | |||
| 2354 | @defun keyboard-translate from to | ||
| 2355 | This function modifies @code{keyboard-translate-table} to translate | ||
| 2356 | character code @var{from} into character code @var{to}. It creates | ||
| 2357 | the keyboard translate table if necessary. | ||
| 2358 | @end defun | ||
| 2359 | |||
| 2360 | Here's an example of using the @code{keyboard-translate-table} to | ||
| 2361 | make @kbd{C-x}, @kbd{C-c} and @kbd{C-v} perform the cut, copy and paste | ||
| 2362 | operations: | ||
| 2363 | |||
| 2364 | @example | ||
| 2365 | (keyboard-translate ?\C-x 'control-x) | ||
| 2366 | (keyboard-translate ?\C-c 'control-c) | ||
| 2367 | (keyboard-translate ?\C-v 'control-v) | ||
| 2368 | (global-set-key [control-x] 'kill-region) | ||
| 2369 | (global-set-key [control-c] 'kill-ring-save) | ||
| 2370 | (global-set-key [control-v] 'yank) | ||
| 2371 | @end example | ||
| 2372 | |||
| 2373 | @noindent | ||
| 2374 | On a graphical terminal that supports extended @acronym{ASCII} input, | ||
| 2375 | you can still get the standard Emacs meanings of one of those | ||
| 2376 | characters by typing it with the shift key. That makes it a different | ||
| 2377 | character as far as keyboard translation is concerned, but it has the | ||
| 2378 | same usual meaning. | ||
| 2379 | |||
| 2380 | @xref{Translation Keymaps}, for mechanisms that translate event sequences | ||
| 2381 | at the level of @code{read-key-sequence}. | ||
| 2382 | |||
| 2293 | @node Invoking the Input Method | 2383 | @node Invoking the Input Method |
| 2294 | @subsection Invoking the Input Method | 2384 | @subsection Invoking the Input Method |
| 2295 | 2385 | ||
diff --git a/lispref/customize.texi b/lispref/customize.texi index 3aca1a90bcf..9e10e547b56 100644 --- a/lispref/customize.texi +++ b/lispref/customize.texi | |||
| @@ -133,18 +133,21 @@ version. The value @var{version} must be a string. | |||
| 133 | 133 | ||
| 134 | @item :package-version '(@var{package} . @var{version}) | 134 | @item :package-version '(@var{package} . @var{version}) |
| 135 | This option specifies that the item was first introduced in | 135 | This option specifies that the item was first introduced in |
| 136 | @var{package} version @var{version}, or that its default value was | 136 | @var{package} version @var{version}, or that its meaning or default |
| 137 | changed in that version. This keyword takes priority over :version. | 137 | value was changed in that version. The value of @var{package} is a |
| 138 | The value of @var{package} is a symbol and @var{version} is a string. | 138 | symbol and @var{version} is a string. |
| 139 | The @var{package} and @var{version} must appear in the alist | ||
| 140 | @code{customize-package-emacs-version-alist}. Since @var{package} must | ||
| 141 | be unique and the user might see it in an error message, a good choice | ||
| 142 | is the official name of the package, such as MH-E or Gnus. | ||
| 143 | 139 | ||
| 140 | This keyword takes priority over @code{:version}. | ||
| 141 | |||
| 142 | @var{package} should be the official name of the package, such as MH-E | ||
| 143 | or Gnus. If the package @var{package} is released as part of Emacs, | ||
| 144 | @var{package} and @var{version} should appear in the value of | ||
| 145 | @code{customize-package-emacs-version-alist}. | ||
| 144 | @end table | 146 | @end table |
| 145 | 147 | ||
| 146 | Packages that use the @code{:package-version} keyword must also update | 148 | Packages distributed as part of Emacs that use the |
| 147 | the @code{customize-package-emacs-version-alist} variable. | 149 | @code{:package-version} keyword must also update the |
| 150 | @code{customize-package-emacs-version-alist} variable. | ||
| 148 | 151 | ||
| 149 | @defvar customize-package-emacs-version-alist | 152 | @defvar customize-package-emacs-version-alist |
| 150 | This alist provides a mapping for the versions of Emacs that are | 153 | This alist provides a mapping for the versions of Emacs that are |
| @@ -248,19 +251,30 @@ turn this feature back on, if someone would like to do the work. | |||
| 248 | 251 | ||
| 249 | Use @code{defcustom} to declare user-editable variables. | 252 | Use @code{defcustom} to declare user-editable variables. |
| 250 | 253 | ||
| 251 | @defmac defcustom option default doc [keyword value]@dots{} | 254 | @defmac defcustom option standard doc [keyword value]@dots{} |
| 252 | Declare @var{option} as a customizable user option variable. Do not | 255 | This construct declares @var{option} as a customizable user option |
| 253 | quote @var{option}. The argument @var{doc} specifies the documentation | 256 | variable. You should not quote @var{option}. The argument @var{doc} |
| 254 | string for the variable. There is no need to start it with a @samp{*} | 257 | specifies the documentation string for the variable. There is no need |
| 255 | because @code{defcustom} automatically marks @var{option} as a | 258 | to start it with a @samp{*}, because @code{defcustom} automatically |
| 256 | @dfn{user option} (@pxref{Defining Variables}). | 259 | marks @var{option} as a @dfn{user option} (@pxref{Defining |
| 257 | 260 | Variables}). | |
| 258 | If @var{option} is void, @code{defcustom} initializes it to | 261 | |
| 259 | @var{default}. @var{default} should be an expression to compute the | 262 | The argument @var{standard} is an expression that specifies the |
| 260 | value; be careful in writing it, because it can be evaluated on more | 263 | standard value for @var{option}. Evaluating the @code{defcustom} form |
| 261 | than one occasion. You should normally avoid using backquotes in | 264 | evaluates @var{standard}, but does not necessarily install the |
| 262 | @var{default} because they are not expanded when editing the value, | 265 | standard value. If @var{option} already has a default value, |
| 263 | causing list values to appear to have the wrong structure. | 266 | @code{defcustom} does not change it. If the user has saved a |
| 267 | customization for @var{option}, @code{defcustom} installs the user's | ||
| 268 | customized value as @var{option}'s default value. If neither of those | ||
| 269 | cases applies, @code{defcustom} installs the result of evaluating | ||
| 270 | @var{standard} as the default value. | ||
| 271 | |||
| 272 | The expression @var{standard} can be evaluated at various other times, | ||
| 273 | too---whenever the customization facility needs to know @var{option}'s | ||
| 274 | standard value. So be sure to use an expression which is harmless to | ||
| 275 | evaluate at any time. We recommend avoiding backquotes in | ||
| 276 | @var{standard}, because they are not expanded when editing the value, | ||
| 277 | so list values will appear to have the wrong structure. | ||
| 264 | 278 | ||
| 265 | If you specify the @code{:set} option, to make the variable take other | 279 | If you specify the @code{:set} option, to make the variable take other |
| 266 | special actions when set through the customization buffer, the | 280 | special actions when set through the customization buffer, the |
| @@ -403,7 +417,7 @@ type of @var{symbol}. | |||
| 403 | @end defun | 417 | @end defun |
| 404 | 418 | ||
| 405 | Internally, @code{defcustom} uses the symbol property | 419 | Internally, @code{defcustom} uses the symbol property |
| 406 | @code{standard-value} to record the expression for the default value, | 420 | @code{standard-value} to record the expression for the standard value, |
| 407 | and @code{saved-value} to record the value saved by the user with the | 421 | and @code{saved-value} to record the value saved by the user with the |
| 408 | customization buffer. Both properties are actually lists whose car is | 422 | customization buffer. Both properties are actually lists whose car is |
| 409 | an expression which evaluates to the value. | 423 | an expression which evaluates to the value. |
diff --git a/lispref/display.texi b/lispref/display.texi index 678ca657b5b..e762c14a7f0 100644 --- a/lispref/display.texi +++ b/lispref/display.texi | |||
| @@ -1857,9 +1857,9 @@ as if they had a light background. | |||
| 1857 | 1857 | ||
| 1858 | The effect of using a face is determined by a fixed set of @dfn{face | 1858 | The effect of using a face is determined by a fixed set of @dfn{face |
| 1859 | attributes}. This table lists all the face attributes, and what they | 1859 | attributes}. This table lists all the face attributes, and what they |
| 1860 | mean. Note that in general, more than one face can be specified for a | 1860 | mean. You can specify more than one face for a given piece of text; |
| 1861 | given piece of text; when that happens, the attributes of all the faces | 1861 | Emacs merges the attributes of all the faces to determine how to |
| 1862 | are merged to specify how to display the text. @xref{Displaying Faces}. | 1862 | display the text. @xref{Displaying Faces}. |
| 1863 | 1863 | ||
| 1864 | Any attribute in a face can have the value @code{unspecified}. This | 1864 | Any attribute in a face can have the value @code{unspecified}. This |
| 1865 | means the face doesn't specify that attribute. In face merging, when | 1865 | means the face doesn't specify that attribute. In face merging, when |
| @@ -2048,15 +2048,13 @@ suitable for use with @code{:stipple} (see above). It returns | |||
| 2048 | @node Attribute Functions | 2048 | @node Attribute Functions |
| 2049 | @subsection Face Attribute Functions | 2049 | @subsection Face Attribute Functions |
| 2050 | 2050 | ||
| 2051 | You can modify the attributes of an existing face with the following | 2051 | This section describes the functions for accessing and modifying the |
| 2052 | functions. If you specify @var{frame}, they affect just that frame; | 2052 | attributes of an existing face. |
| 2053 | otherwise, they affect all frames as well as the defaults that apply to | ||
| 2054 | new frames. | ||
| 2055 | 2053 | ||
| 2056 | @defun set-face-attribute face frame &rest arguments | 2054 | @defun set-face-attribute face frame &rest arguments |
| 2057 | This function sets one or more attributes of face @var{face} | 2055 | This function sets one or more attributes of face @var{face} for frame |
| 2058 | for frame @var{frame}. If @var{frame} is @code{nil}, it sets | 2056 | @var{frame}. The attributes you specify this way override whatever |
| 2059 | the attribute for all frames, and the defaults for new frames. | 2057 | the @code{defface} says. |
| 2060 | 2058 | ||
| 2061 | The extra arguments @var{arguments} specify the attributes to set, and | 2059 | The extra arguments @var{arguments} specify the attributes to set, and |
| 2062 | the values for them. They should consist of alternating attribute names | 2060 | the values for them. They should consist of alternating attribute names |
| @@ -2073,6 +2071,13 @@ Thus, | |||
| 2073 | @noindent | 2071 | @noindent |
| 2074 | sets the attributes @code{:width}, @code{:weight} and @code{:underline} | 2072 | sets the attributes @code{:width}, @code{:weight} and @code{:underline} |
| 2075 | to the corresponding values. | 2073 | to the corresponding values. |
| 2074 | |||
| 2075 | If @var{frame} is @code{t}, this function sets the default attributes | ||
| 2076 | for new frames. Default attribute values specified this way override | ||
| 2077 | the @code{defface} for newly created frames. | ||
| 2078 | |||
| 2079 | If @var{frame} is @code{nil}, this function sets the attributes for | ||
| 2080 | all existing frames, and the default for new frames. | ||
| 2076 | @end defun | 2081 | @end defun |
| 2077 | 2082 | ||
| 2078 | @defun face-attribute face attribute &optional frame inherit | 2083 | @defun face-attribute face attribute &optional frame inherit |
| @@ -2080,8 +2085,10 @@ This returns the value of the @var{attribute} attribute of face | |||
| 2080 | @var{face} on @var{frame}. If @var{frame} is @code{nil}, | 2085 | @var{face} on @var{frame}. If @var{frame} is @code{nil}, |
| 2081 | that means the selected frame (@pxref{Input Focus}). | 2086 | that means the selected frame (@pxref{Input Focus}). |
| 2082 | 2087 | ||
| 2083 | If @var{frame} is @code{t}, the value is the default for | 2088 | If @var{frame} is @code{t}, this returns whatever new-frames default |
| 2084 | @var{face} for new frames. | 2089 | value you previously specified with @code{set-face-attribute} for the |
| 2090 | @var{attribute} attribute of @var{face}. If you have not specified | ||
| 2091 | one, it returns @code{nil}. | ||
| 2085 | 2092 | ||
| 2086 | If @var{inherit} is @code{nil}, only attributes directly defined by | 2093 | If @var{inherit} is @code{nil}, only attributes directly defined by |
| 2087 | @var{face} are considered, so the return value may be | 2094 | @var{face} are considered, so the return value may be |
| @@ -2135,6 +2142,8 @@ face attribute @var{attribute}, returns @var{value1} unchanged. | |||
| 2135 | The functions above did not exist before Emacs 21. For compatibility | 2142 | The functions above did not exist before Emacs 21. For compatibility |
| 2136 | with older Emacs versions, you can use the following functions to set | 2143 | with older Emacs versions, you can use the following functions to set |
| 2137 | and examine the face attributes which existed in those versions. | 2144 | and examine the face attributes which existed in those versions. |
| 2145 | They use values of @code{t} and @code{nil} for @var{frame} | ||
| 2146 | just like @code{set-face-attribute} and @code{face-attribute}. | ||
| 2138 | 2147 | ||
| 2139 | @defun set-face-foreground face color &optional frame | 2148 | @defun set-face-foreground face color &optional frame |
| 2140 | @defunx set-face-background face color &optional frame | 2149 | @defunx set-face-background face color &optional frame |
| @@ -2191,9 +2200,10 @@ This function swaps the foreground and background colors of face | |||
| 2191 | @end defun | 2200 | @end defun |
| 2192 | 2201 | ||
| 2193 | These functions examine the attributes of a face. If you don't | 2202 | These functions examine the attributes of a face. If you don't |
| 2194 | specify @var{frame}, they refer to the default data for new frames. | 2203 | specify @var{frame}, they refer to the selected frame; @code{t} refers |
| 2195 | They return the symbol @code{unspecified} if the face doesn't define any | 2204 | to the default data for new frames. They return the symbol |
| 2196 | value for that attribute. | 2205 | @code{unspecified} if the face doesn't define any value for that |
| 2206 | attribute. | ||
| 2197 | 2207 | ||
| 2198 | @defun face-foreground face &optional frame inherit | 2208 | @defun face-foreground face &optional frame inherit |
| 2199 | @defunx face-background face &optional frame inherit | 2209 | @defunx face-background face &optional frame inherit |
diff --git a/lispref/elisp.texi b/lispref/elisp.texi index db92bdc97ee..41a2f1cdde0 100644 --- a/lispref/elisp.texi +++ b/lispref/elisp.texi | |||
| @@ -1039,8 +1039,10 @@ Operating System Interface | |||
| 1039 | * Processor Run Time:: Getting the run time used by Emacs. | 1039 | * Processor Run Time:: Getting the run time used by Emacs. |
| 1040 | * Time Calculations:: Adding, subtracting, comparing times, etc. | 1040 | * Time Calculations:: Adding, subtracting, comparing times, etc. |
| 1041 | * Timers:: Setting a timer to call a function at a certain time. | 1041 | * Timers:: Setting a timer to call a function at a certain time. |
| 1042 | * Terminal Input:: Recording terminal input for debugging. | 1042 | * Idle Timers:: Setting a timer to call a function when Emacs has |
| 1043 | * Terminal Output:: Recording terminal output for debugging. | 1043 | been idle for a certain length of time. |
| 1044 | * Terminal Input:: Accessing and recordingo terminal input. | ||
| 1045 | * Terminal Output:: Controlling and recording terminal output. | ||
| 1044 | * Sound Output:: Playing sounds on the computer's speaker. | 1046 | * Sound Output:: Playing sounds on the computer's speaker. |
| 1045 | * X11 Keysyms:: Operating on key symbols for X Windows | 1047 | * X11 Keysyms:: Operating on key symbols for X Windows |
| 1046 | * Batch Mode:: Running Emacs without terminal interaction. | 1048 | * Batch Mode:: Running Emacs without terminal interaction. |
diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi index f93c94b8dfe..13f4550a082 100644 --- a/lispref/keymaps.texi +++ b/lispref/keymaps.texi | |||
| @@ -33,6 +33,7 @@ found. The whole process is called @dfn{key lookup}. | |||
| 33 | * Functions for Key Lookup:: How to request key lookup. | 33 | * Functions for Key Lookup:: How to request key lookup. |
| 34 | * Changing Key Bindings:: Redefining a key in a keymap. | 34 | * Changing Key Bindings:: Redefining a key in a keymap. |
| 35 | * Remapping Commands:: Bindings that translate one command to another. | 35 | * Remapping Commands:: Bindings that translate one command to another. |
| 36 | * Translation Keymaps:: Keymaps for translating sequences of events. | ||
| 36 | * Key Binding Commands:: Interactive interfaces for redefining keys. | 37 | * Key Binding Commands:: Interactive interfaces for redefining keys. |
| 37 | * Scanning Keymaps:: Looking through all keymaps, for printing help. | 38 | * Scanning Keymaps:: Looking through all keymaps, for printing help. |
| 38 | * Menu Keymaps:: Defining a menu as a keymap. | 39 | * Menu Keymaps:: Defining a menu as a keymap. |
| @@ -642,7 +643,7 @@ only when the mode is used for the first time in a session. | |||
| 642 | and exit commands. @xref{Intro to Minibuffers}. | 643 | and exit commands. @xref{Intro to Minibuffers}. |
| 643 | 644 | ||
| 644 | Emacs has other keymaps that are used in a different way---translating | 645 | Emacs has other keymaps that are used in a different way---translating |
| 645 | events within @code{read-key-sequence}. @xref{Translating Input}. | 646 | events within @code{read-key-sequence}. @xref{Translation Keymaps}. |
| 646 | 647 | ||
| 647 | @xref{Standard Keymaps}, for a list of standard keymaps. | 648 | @xref{Standard Keymaps}, for a list of standard keymaps. |
| 648 | 649 | ||
| @@ -682,7 +683,7 @@ An error is signaled if @var{key} is not a string or a vector. | |||
| 682 | @node Searching Keymaps | 683 | @node Searching Keymaps |
| 683 | @section Searching the Active Keymaps | 684 | @section Searching the Active Keymaps |
| 684 | 685 | ||
| 685 | After translation of the input events (@pxref{Translating Input}) | 686 | After translation of event subsequences (@pxref{Translation Keymaps}) |
| 686 | Emacs looks for them in the active keymaps. Here is a pseudo-Lisp | 687 | Emacs looks for them in the active keymaps. Here is a pseudo-Lisp |
| 687 | description of the order in which the active keymaps are searched: | 688 | description of the order in which the active keymaps are searched: |
| 688 | 689 | ||
| @@ -1472,6 +1473,125 @@ given the current active keymaps. If @var{command} is not remapped | |||
| 1472 | @code{nil}. | 1473 | @code{nil}. |
| 1473 | @end defun | 1474 | @end defun |
| 1474 | 1475 | ||
| 1476 | @node Translation Keymaps | ||
| 1477 | @section Keymaps for Translating Sequences of Events | ||
| 1478 | |||
| 1479 | This section describes keymaps that are used during reading a key | ||
| 1480 | sequence, to translate certain event sequences into others. | ||
| 1481 | @code{read-key-sequence} checks every subsequence of the key sequence | ||
| 1482 | being read, as it is read, against @code{function-key-map} and then | ||
| 1483 | against @code{key-translation-map}. | ||
| 1484 | |||
| 1485 | @defvar function-key-map | ||
| 1486 | This variable holds a keymap that describes the character sequences sent | ||
| 1487 | by function keys on an ordinary character terminal. This keymap has the | ||
| 1488 | same structure as other keymaps, but is used differently: it specifies | ||
| 1489 | translations to make while reading key sequences, rather than bindings | ||
| 1490 | for key sequences. | ||
| 1491 | |||
| 1492 | If @code{function-key-map} ``binds'' a key sequence @var{k} to a vector | ||
| 1493 | @var{v}, then when @var{k} appears as a subsequence @emph{anywhere} in a | ||
| 1494 | key sequence, it is replaced with the events in @var{v}. | ||
| 1495 | |||
| 1496 | For example, VT100 terminals send @kbd{@key{ESC} O P} when the | ||
| 1497 | keypad @key{PF1} key is pressed. Therefore, we want Emacs to translate | ||
| 1498 | that sequence of events into the single event @code{pf1}. We accomplish | ||
| 1499 | this by ``binding'' @kbd{@key{ESC} O P} to @code{[pf1]} in | ||
| 1500 | @code{function-key-map}, when using a VT100. | ||
| 1501 | |||
| 1502 | Thus, typing @kbd{C-c @key{PF1}} sends the character sequence @kbd{C-c | ||
| 1503 | @key{ESC} O P}; later the function @code{read-key-sequence} translates | ||
| 1504 | this back into @kbd{C-c @key{PF1}}, which it returns as the vector | ||
| 1505 | @code{[?\C-c pf1]}. | ||
| 1506 | |||
| 1507 | Entries in @code{function-key-map} are ignored if they conflict with | ||
| 1508 | bindings made in the minor mode, local, or global keymaps. The intent | ||
| 1509 | is that the character sequences that function keys send should not have | ||
| 1510 | command bindings in their own right---but if they do, the ordinary | ||
| 1511 | bindings take priority. | ||
| 1512 | |||
| 1513 | The value of @code{function-key-map} is usually set up automatically | ||
| 1514 | according to the terminal's Terminfo or Termcap entry, but sometimes | ||
| 1515 | those need help from terminal-specific Lisp files. Emacs comes with | ||
| 1516 | terminal-specific files for many common terminals; their main purpose is | ||
| 1517 | to make entries in @code{function-key-map} beyond those that can be | ||
| 1518 | deduced from Termcap and Terminfo. @xref{Terminal-Specific}. | ||
| 1519 | @end defvar | ||
| 1520 | |||
| 1521 | @defvar key-translation-map | ||
| 1522 | This variable is another keymap used just like @code{function-key-map} | ||
| 1523 | to translate input events into other events. It differs from | ||
| 1524 | @code{function-key-map} in two ways: | ||
| 1525 | |||
| 1526 | @itemize @bullet | ||
| 1527 | @item | ||
| 1528 | @code{key-translation-map} goes to work after @code{function-key-map} is | ||
| 1529 | finished; it receives the results of translation by | ||
| 1530 | @code{function-key-map}. | ||
| 1531 | |||
| 1532 | @item | ||
| 1533 | Non-prefix bindings in @code{key-translation-map} override actual key | ||
| 1534 | bindings. For example, if @kbd{C-x f} has a non-prefix binding in | ||
| 1535 | @code{key-translation-map}, that translation takes effect even though | ||
| 1536 | @kbd{C-x f} also has a key binding in the global map. | ||
| 1537 | @end itemize | ||
| 1538 | |||
| 1539 | Note however that actual key bindings can have an effect on | ||
| 1540 | @code{key-translation-map}, even though they are overridden by it. | ||
| 1541 | Indeed, actual key bindings override @code{function-key-map} and thus | ||
| 1542 | may alter the key sequence that @code{key-translation-map} receives. | ||
| 1543 | Clearly, it is better to avoid this type of situation. | ||
| 1544 | |||
| 1545 | The intent of @code{key-translation-map} is for users to map one | ||
| 1546 | character set to another, including ordinary characters normally bound | ||
| 1547 | to @code{self-insert-command}. | ||
| 1548 | @end defvar | ||
| 1549 | |||
| 1550 | @cindex key translation function | ||
| 1551 | You can use @code{function-key-map} or @code{key-translation-map} for | ||
| 1552 | more than simple aliases, by using a function, instead of a key | ||
| 1553 | sequence, as the ``translation'' of a key. Then this function is called | ||
| 1554 | to compute the translation of that key. | ||
| 1555 | |||
| 1556 | The key translation function receives one argument, which is the prompt | ||
| 1557 | that was specified in @code{read-key-sequence}---or @code{nil} if the | ||
| 1558 | key sequence is being read by the editor command loop. In most cases | ||
| 1559 | you can ignore the prompt value. | ||
| 1560 | |||
| 1561 | If the function reads input itself, it can have the effect of altering | ||
| 1562 | the event that follows. For example, here's how to define @kbd{C-c h} | ||
| 1563 | to turn the character that follows into a Hyper character: | ||
| 1564 | |||
| 1565 | @example | ||
| 1566 | @group | ||
| 1567 | (defun hyperify (prompt) | ||
| 1568 | (let ((e (read-event))) | ||
| 1569 | (vector (if (numberp e) | ||
| 1570 | (logior (lsh 1 24) e) | ||
| 1571 | (if (memq 'hyper (event-modifiers e)) | ||
| 1572 | e | ||
| 1573 | (add-event-modifier "H-" e)))))) | ||
| 1574 | |||
| 1575 | (defun add-event-modifier (string e) | ||
| 1576 | (let ((symbol (if (symbolp e) e (car e)))) | ||
| 1577 | (setq symbol (intern (concat string | ||
| 1578 | (symbol-name symbol)))) | ||
| 1579 | @end group | ||
| 1580 | @group | ||
| 1581 | (if (symbolp e) | ||
| 1582 | symbol | ||
| 1583 | (cons symbol (cdr e))))) | ||
| 1584 | |||
| 1585 | (define-key function-key-map "\C-ch" 'hyperify) | ||
| 1586 | @end group | ||
| 1587 | @end example | ||
| 1588 | |||
| 1589 | If you have enabled keyboard character set decoding using | ||
| 1590 | @code{set-keyboard-coding-system}, decoding is done after the | ||
| 1591 | translations listed above. @xref{Terminal I/O Encoding}. However, in | ||
| 1592 | future Emacs versions, character set decoding may be done at an | ||
| 1593 | earlier stage. | ||
| 1594 | |||
| 1475 | @node Key Binding Commands | 1595 | @node Key Binding Commands |
| 1476 | @section Commands for Binding Keys | 1596 | @section Commands for Binding Keys |
| 1477 | 1597 | ||
| @@ -1896,7 +2016,7 @@ binding, like this: | |||
| 1896 | 2016 | ||
| 1897 | @c This line is not too long--rms. | 2017 | @c This line is not too long--rms. |
| 1898 | @example | 2018 | @example |
| 1899 | (@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}) |
| 1900 | @end example | 2020 | @end example |
| 1901 | 2021 | ||
| 1902 | @noindent | 2022 | @noindent |
| @@ -2020,6 +2140,13 @@ operates on menu data structures, so you should write it so it can | |||
| 2020 | safely be called at any time. | 2140 | safely be called at any time. |
| 2021 | @end table | 2141 | @end table |
| 2022 | 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 | |||
| 2023 | @node Menu Separators | 2150 | @node Menu Separators |
| 2024 | @subsubsection Menu Separators | 2151 | @subsubsection Menu Separators |
| 2025 | @cindex menu separators | 2152 | @cindex menu separators |
diff --git a/lispref/lists.texi b/lispref/lists.texi index cb60baef900..1c6247d818c 100644 --- a/lispref/lists.texi +++ b/lispref/lists.texi | |||
| @@ -1489,7 +1489,7 @@ several @code{equal} occurrences of an element in @var{list}, | |||
| 1489 | @code{delete-dups} keeps the first one. | 1489 | @code{delete-dups} keeps the first one. |
| 1490 | @end defun | 1490 | @end defun |
| 1491 | 1491 | ||
| 1492 | See also the function @code{add-to-list}, in @ref{Setting Variables}, | 1492 | See also the function @code{add-to-list}, in @ref{List Variables}, |
| 1493 | for another way to add an element to a list stored in a variable. | 1493 | for another way to add an element to a list stored in a variable. |
| 1494 | 1494 | ||
| 1495 | @node Association Lists | 1495 | @node Association Lists |
diff --git a/lispref/maps.texi b/lispref/maps.texi index ec7728f7840..cdbd655eb3c 100644 --- a/lispref/maps.texi +++ b/lispref/maps.texi | |||
| @@ -115,7 +115,7 @@ Properties menu. | |||
| 115 | @item function-key-map | 115 | @item function-key-map |
| 116 | The keymap for translating keypad and function keys.@* | 116 | The keymap for translating keypad and function keys.@* |
| 117 | If there are none, then it contains an empty sparse keymap. | 117 | If there are none, then it contains an empty sparse keymap. |
| 118 | @xref{Translating Input}. | 118 | @xref{Translation Keymaps}. |
| 119 | 119 | ||
| 120 | @item fundamental-mode-map | 120 | @item fundamental-mode-map |
| 121 | @vindex fundamental-mode-map | 121 | @vindex fundamental-mode-map |
| @@ -158,7 +158,7 @@ search. | |||
| 158 | 158 | ||
| 159 | @item key-translation-map | 159 | @item key-translation-map |
| 160 | A keymap for translating keys. This one overrides ordinary key | 160 | A keymap for translating keys. This one overrides ordinary key |
| 161 | bindings, unlike @code{function-key-map}. @xref{Translating Input}. | 161 | bindings, unlike @code{function-key-map}. @xref{Translation Keymaps}. |
| 162 | 162 | ||
| 163 | @item kmacro-map | 163 | @item kmacro-map |
| 164 | @vindex kmacro-map | 164 | @vindex kmacro-map |
diff --git a/lispref/modes.texi b/lispref/modes.texi index b0c057ec1c9..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 |
| 46 | contain lists of functions to be called with no arguments. When the | 46 | contain lists of functions to be called with no arguments. By |
| 47 | hook name ends in @samp{-hook}, that tells you it is normal. We try to | 47 | convention, whenever the hook name ends in @samp{-hook}, that tells |
| 48 | make all hooks normal, as much as possible, so that you can use them in | 48 | you it is normal. We try to make all hooks normal, as much as |
| 49 | a uniform way. | 49 | possible, 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 | 52 | the @dfn{mode hook} as the one of the last steps of initialization. |
| 53 | for a user to customize the behavior of the mode, by overriding the | 53 | This makes it easy for a user to customize the behavior of the mode, |
| 54 | buffer-local variable assignments already made by the mode. Most | 54 | by overriding the buffer-local variable assignments already made by |
| 55 | minor modes also run a mode hook at their end. But hooks are used in | 55 | the mode. Most minor mode functions also run a mode hook at the end. |
| 56 | other contexts too. For example, the hook @code{suspend-hook} runs | 56 | But hooks are used in other contexts too. For example, the hook |
| 57 | just 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 |
| 60 | calling @code{add-hook} (see below). The hook functions may be any of | 61 | calling @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 |
| 68 | indicates it is probably an @dfn{abnormal hook}. Then you should look at its | 69 | indicates it is probably an @dfn{abnormal hook}. That means the hook |
| 69 | documentation to see how to use the hook properly. | 70 | functions are called with arguments, or their return values are used |
| 71 | in some way. The hook's documentation says how the functions are | ||
| 72 | called. You can use @code{add-hook} to add a function to an abnormal | ||
| 73 | hook, but you must write the function to follow the hook's calling | ||
| 74 | convention. | ||
| 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 |
| 72 | then 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 |
| 73 | these functions are called with arguments or their values are used in | 78 | its value is just a single function, not a list of functions. |
| 74 | some way. You can use @code{add-hook} to add a function to the list, | ||
| 75 | but you must take care in writing the function. (A few of these | ||
| 76 | variables, notably those ending in @samp{-hooks}, are actually | ||
| 77 | normal hooks which were named before we established the convention of | ||
| 78 | using @samp{-hook} for them.) | ||
| 79 | |||
| 80 | If the variable's name ends in @samp{-function}, then its value | ||
| 81 | is 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 |
| 84 | in Lisp Interaction mode: | 81 | in Lisp Interaction mode: |
| @@ -96,12 +93,13 @@ arguments, and runs each hook in turn. Each argument should be a | |||
| 96 | symbol that is a normal hook variable. These arguments are processed | 93 | symbol that is a normal hook variable. These arguments are processed |
| 97 | in the order specified. | 94 | in the order specified. |
| 98 | 95 | ||
| 99 | If a hook variable has a non-@code{nil} value, that value may be a | 96 | If a hook variable has a non-@code{nil} value, that value should be a |
| 100 | function or a list of functions. (The former option is considered | 97 | list of functions. @code{run-hooks} calls all the functions, one by |
| 101 | obsolete.) If the value is a function (either a lambda expression or | 98 | one, with no arguments. |
| 102 | a symbol with a function definition), it is called. If it is a list | 99 | |
| 103 | that isn't a function, its elements are called, consecutively. All | 100 | The hook variable's value can also be a single function---either a |
| 104 | the hook functions are called with no arguments. | 101 | lambda 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 | |||
| 214 | idea. In practice, writing a major mode is easy (in contrast to | 212 | idea. In practice, writing a major mode is easy (in contrast to |
| 215 | writing a minor mode, which is often difficult). | 213 | writing 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 |
| 218 | the old one to serve two purposes, since it may become harder to use and | 216 | modify the old one to serve two purposes, since it may become harder |
| 219 | maintain. Instead, copy and rename an existing major mode definition | 217 | to use and maintain. Instead, copy and rename an existing major mode |
| 220 | and alter the copy---or define a @dfn{derived mode} (@pxref{Derived | 218 | definition and alter the copy---or use @code{define-derived-mode} to |
| 221 | Modes}). For example, Rmail Edit mode, which is in | 219 | define 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 | 220 | Rmail Edit mode is a major mode that is very similar to Text mode |
| 223 | Text mode except that it provides two additional commands. Its | 221 | except that it provides two additional commands. Its definition is |
| 224 | definition is distinct from that of Text mode, but uses that of Text mode. | 222 | distinct 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, |
| 227 | it is convenient to use @code{define-derived-mode} with a @code{nil} | 225 | it is convenient to use @code{define-derived-mode} with a @code{nil} |
| @@ -287,8 +285,10 @@ Documentation}. | |||
| 287 | 285 | ||
| 288 | @item | 286 | @item |
| 289 | The major mode command should start by calling | 287 | The 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 |
| 291 | buffer-local variables of the major mode previously in effect. | 289 | @code{change-major-mode-hook}, then gets rid of the buffer-local |
| 290 | variables of the major mode previously in effect. @xref{Creating | ||
| 291 | Buffer-Local}. | ||
| 292 | 292 | ||
| 293 | @item | 293 | @item |
| 294 | The major mode command should set the variable @code{major-mode} to the | 294 | The 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 | |||
| 355 | letters and other printing characters as special commands. | 355 | letters and other printing characters as special commands. |
| 356 | 356 | ||
| 357 | @item | 357 | @item |
| 358 | Major modes must not define @key{RET} to do anything other than insert | 358 | Major modes modes for editing text should not define @key{RET} to do |
| 359 | a newline. The command to insert a newline and then indent is | 359 | anything other than insert a newline. However, it is ok for |
| 360 | @kbd{C-j}. Please keep this distinction uniform for all major modes. | 360 | specialized modes for text that users don't directly edit, such as |
| 361 | Dired and Info modes, to redefine @key{RET} to do something entirely | ||
| 362 | different. | ||
| 361 | 363 | ||
| 362 | @item | 364 | @item |
| 363 | Major modes should not alter options that are primarily a matter of user | 365 | Major 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 |
| 430 | Each major mode should have a @dfn{mode hook} named | 432 | Each 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 |
| 432 | hook, with @code{run-mode-hooks}, as the very last thing it | 434 | should do is to call @code{run-mode-hooks}. This runs the mode hook, |
| 433 | does. @xref{Mode Hooks}. | 435 | and then runs the normal hook @code{after-change-major-mode-hook}. |
| 436 | @xref{Mode Hooks}. | ||
| 434 | 437 | ||
| 435 | @item | 438 | @item |
| 436 | The major mode command may start by calling some other major mode | 439 | The 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. | |||
| 488 | Even if you never load the file more than once, someone else will. | 491 | Even 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. | ||
| 495 | Here are excerpts from @file{text-mode.el} that illustrate many of | ||
| 496 | the 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'. | ||
| 520 | Many other modes, such as Mail mode, Outline mode | ||
| 521 | and Indented Text mode, inherit all the commands | ||
| 522 | defined 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. | ||
| 532 | In this mode, paragraphs are delimited only by blank or white lines. | ||
| 533 | You can thus get the full benefit of adaptive filling | ||
| 534 | (see the variable `adaptive-fill-mode'). | ||
| 535 | \\@{text-mode-map@} | ||
| 536 | Turning 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 | ||
| 565 | Turning 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 | ||
| 595 | Interaction mode) have more features than Text mode and the code is | ||
| 596 | correspondingly 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 | ||
| 652 | function sets various variables; it is called by each of the major Lisp | ||
| 653 | mode 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 | ||
| 667 | ordinary text, the @code{paragraph-start} variable needs to be set | ||
| 668 | specially to handle Lisp. Also, comments are indented in a special | ||
| 669 | fashion in Lisp and the Lisp modes need their own mode-specific | ||
| 670 | @code{comment-indent-function}. The code to set these variables is the | ||
| 671 | rest 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 | ||
| 689 | example, Lisp mode binds @kbd{C-c C-z} to @code{run-lisp}, but the other | ||
| 690 | Lisp modes do not. However, all Lisp modes have some commands in | ||
| 691 | common. 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 | ||
| 709 | And 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 | ||
| 726 | Lisp mode. | ||
| 727 | |||
| 728 | @smallexample | ||
| 729 | @group | ||
| 730 | (defun lisp-mode () | ||
| 731 | "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp. | ||
| 732 | Commands: | ||
| 733 | Delete converts tabs to spaces as it moves back. | ||
| 734 | Blank lines separate paragraphs. Semicolons start comments. | ||
| 735 | \\@{lisp-mode-map@} | ||
| 736 | Note that `run-lisp' may be used either to start an inferior Lisp job | ||
| 737 | or to switch back to an existing one. | ||
| 738 | @end group | ||
| 739 | |||
| 740 | @group | ||
| 741 | Entry to this mode calls the value of `lisp-mode-hook' | ||
| 742 | if 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 |
| 1077 | comment syntax and Font Lock mode. They are primarily useful for | 805 | comment syntax and Font Lock mode. To define a generic mode, use the |
| 1078 | configuration files. To define a generic mode, use the macro | 806 | macro @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 | 807 | for some examples of the use of @code{define-generic-mode}. |
| 1080 | examples 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 |
| 1083 | This macro creates a new generic mode. The argument @var{mode} (an | 810 | This macro defines a generic mode command named @var{mode} (a symbol, |
| 1084 | unquoted symbol) is the major mode command. The optional argument | 811 | not quoted). The optional argument @var{docstring} is the |
| 1085 | @var{docstring} is the documentation for the mode command. If you do | 812 | documentation for the mode command. If you do not supply it, |
| 1086 | not supply it, @code{define-generic-mode} uses a default documentation | 813 | @code{define-generic-mode} generates one by default. |
| 1087 | string instead. | 814 | |
| 1088 | 815 | The 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 | 816 | either a character, a string of one or two characters, or a cons cell. |
| 1090 | character, a string of one or two characters, or a cons cell. A | 817 | A character or a string is set up in the mode's syntax table as a |
| 1091 | character 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 |
| 1093 | up as a ``comment starter'' and the @sc{cdr} as a ``comment ender.'' | 819 | up 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 |
| 1095 | of the line.) Note that the syntax table has limitations about what | 821 | of the line.) Note that the syntax table mechanism has limitations |
| 1096 | comment starters and enders are actually possible. @xref{Syntax | 822 | about what comment starters and enders are actually possible. |
| 1097 | Tables}. | 823 | @xref{Syntax Tables}. |
| 1098 | 824 | ||
| 1099 | @var{keyword-list} is a list of keywords to highlight with | 825 | The argument @var{keyword-list} is a list of keywords to highlight |
| 1100 | @code{font-lock-keyword-face}. Each keyword should be a string. | 826 | with @code{font-lock-keyword-face}. Each keyword should be a string. |
| 1101 | @var{font-lock-list} is a list of additional expressions to highlight. | 827 | Meanwhile, @var{font-lock-list} is a list of additional expressions to |
| 1102 | Each element of this list should have the same form as an element of | 828 | highlight. Each element of this list should have the same form as an |
| 1103 | @code{font-lock-keywords}. @xref{Search-based Fontification}. | 829 | element of @code{font-lock-keywords}. @xref{Search-based |
| 1104 | 830 | Fontification}. | |
| 1105 | @var{auto-mode-list} is a list of regular expressions to add to the | 831 | |
| 1106 | variable @code{auto-mode-alist}. These regular expressions are added | 832 | The argument @var{auto-mode-list} is a list of regular expressions to |
| 1107 | when Emacs runs the macro expansion. | 833 | add to the variable @code{auto-mode-alist}. They are added by the execution |
| 1108 | 834 | of 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 | |
| 1110 | additional setup. The mode command calls these functions just before | 836 | Finally, @var{function-list} is a list of functions for the mode |
| 1111 | it runs the mode hook variable @code{@var{mode}-hook}. | 837 | command to call for additional setup. It calls these functions just |
| 838 | before 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 |
| 1118 | hook and finally the mode independent normal hook | 845 | the mode-independent normal hook @code{after-change-major-mode-hook}. |
| 1119 | @code{after-change-major-mode-hook}. If the major mode is a derived | 846 | It does this by calling @code{run-mode-hooks}. If the major mode is a |
| 1120 | mode, that is if it calls another major mode (the parent mode) in its | 847 | derived mode, that is if it calls another major mode (the parent mode) |
| 1121 | body, then the parent's mode hook is run just before the derived | 848 | in its body, it should do this inside @code{delay-mode-hooks} so that |
| 1122 | mode's hook. Neither the parent's mode hook nor | 849 | the 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 | 850 | call to @code{run-mode-hooks} runs the parent's mode hook too. |
| 1124 | call to the parent mode. This applies recursively if the parent mode | 851 | @xref{Major Mode Conventions}. |
| 1125 | has itself a parent. That is, the mode hooks of all major modes | 852 | |
| 1126 | called directly or indirectly by the major mode function are all run | 853 | Emacs versions before Emacs 22 did not have @code{delay-mode-hooks}. |
| 1127 | in sequence at the end, just before | 854 | When user-implemented major modes have not been updated to use it, |
| 1128 | @code{after-change-major-mode-hook}. | 855 | they won't entirely follow these conventions: they may run the |
| 1129 | 856 | parent'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 |
| 1131 | implemented by users do not follow them yet. So if you put a function | 858 | mode, please correct it to follow these conventions. |
| 1132 | onto @code{after-change-major-mode-hook}, keep in mind that some modes | ||
| 1133 | will 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 | ||
| 1135 | fails to work. Please fix the major mode.'' In most cases, that is | ||
| 1136 | good enough, so go ahead and use @code{after-change-major-mode-hook}. | ||
| 1137 | However, if a certain feature needs to be completely reliable, | ||
| 1138 | it 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 |
| 1141 | automatically makes sure these conventions are followed. If you | 861 | automatically makes sure these conventions are followed. If you |
| 1142 | define a major mode ``from scratch,'' not using | 862 | define a major mode ``by hand,'' not using @code{define-derived-mode}, |
| 1143 | @code{define-derived-mode}, make sure the major mode command follows | 863 | use the following functions to handle these conventions automatically. |
| 1144 | these and other conventions. @xref{Major Mode Conventions}. You use | ||
| 1145 | these functions to do it properly. | ||
| 1146 | 864 | ||
| 1147 | @defun run-mode-hooks &rest hookvars | 865 | @defun run-mode-hooks &rest hookvars |
| 1148 | Major modes should run their mode hook using this function. It is | 866 | Major modes should run their mode hook using this function. It is |
| 1149 | similar to @code{run-hooks} (@pxref{Hooks}), but it also runs | 867 | similar 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 | ||
| 1152 | When the call to this function is dynamically inside a | 870 | When 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. |
| 1154 | Instead, it arranges for the next call to @code{run-mode-hooks} to run | 872 | Instead, it arranges for the next call to @code{run-mode-hooks} to run |
| 1155 | @var{hookvars}. | 873 | them. |
| 1156 | @end defun | 874 | @end defun |
| 1157 | 875 | ||
| 1158 | @defmac delay-mode-hooks body@dots{} | 876 | @defmac delay-mode-hooks body@dots{} |
| 1159 | This macro executes @var{body} like @code{progn}, but all calls to | 877 | When 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}. |
| 1161 | They will be run by the first call to @code{run-mode-hooks} after exit | 879 | |
| 1162 | from @code{delay-mode-hooks}. This is the proper way for a major mode | 880 | This macro executes @var{body}, but tells all @code{run-mode-hooks} |
| 1163 | command to invoke its parent mode. | 881 | calls during the execution of @var{body} to delay running their hooks. |
| 882 | The hooks will actually run during the next call to | ||
| 883 | @code{run-mode-hooks} after the end of the @code{delay-mode-hooks} | ||
| 884 | construct. | ||
| 1164 | @end defmac | 885 | @end defmac |
| 1165 | 886 | ||
| 1166 | @defvar after-change-major-mode-hook | 887 | @defvar after-change-major-mode-hook |
| 1167 | Every major mode function should run this normal hook at its very end. | 888 | This is a normal hook run by @code{run-mode-hooks}. It is run at the |
| 1168 | It normally does not need to do so explicitly. Indeed, a major mode | 889 | very end of every properly-written major mode function. |
| 1169 | function should normally run its mode hook with @code{run-mode-hooks} | ||
| 1170 | as 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. | ||
| 896 | Here are excerpts from @file{text-mode.el} that illustrate many of | ||
| 897 | the 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'. | ||
| 921 | Many other modes, such as Mail mode, Outline mode | ||
| 922 | and Indented Text mode, inherit all the commands | ||
| 923 | defined 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. | ||
| 933 | In this mode, paragraphs are delimited only by blank or white lines. | ||
| 934 | You can thus get the full benefit of adaptive filling | ||
| 935 | (see the variable `adaptive-fill-mode'). | ||
| 936 | \\@{text-mode-map@} | ||
| 937 | Turning 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 | ||
| 966 | Turning 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 | ||
| 996 | Interaction mode) have more features than Text mode and the code is | ||
| 997 | correspondingly 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, | ||
| 1053 | each 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 | ||
| 1066 | commands to treat only blank lines as paragraph separators. And the | ||
| 1067 | modes 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 | ||
| 1086 | example, Lisp mode binds @kbd{C-c C-z} to @code{run-lisp}, but the other | ||
| 1087 | Lisp modes do not. However, all Lisp modes have some commands in | ||
| 1088 | common. 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 | ||
| 1106 | And 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 | ||
| 1123 | Lisp mode. | ||
| 1124 | |||
| 1125 | @smallexample | ||
| 1126 | @group | ||
| 1127 | (defun lisp-mode () | ||
| 1128 | "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp. | ||
| 1129 | Commands: | ||
| 1130 | Delete converts tabs to spaces as it moves back. | ||
| 1131 | Blank lines separate paragraphs. Semicolons start comments. | ||
| 1132 | \\@{lisp-mode-map@} | ||
| 1133 | Note that `run-lisp' may be used either to start an inferior Lisp job | ||
| 1134 | or to switch back to an existing one. | ||
| 1135 | @end group | ||
| 1136 | |||
| 1137 | @group | ||
| 1138 | Entry to this mode calls the value of `lisp-mode-hook' | ||
| 1139 | if 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 |
| @@ -1295,7 +1284,7 @@ check for an existing element, to avoid duplication. For example: | |||
| 1295 | @end smallexample | 1284 | @end smallexample |
| 1296 | 1285 | ||
| 1297 | @noindent | 1286 | @noindent |
| 1298 | or like this, using @code{add-to-list} (@pxref{Setting Variables}): | 1287 | or like this, using @code{add-to-list} (@pxref{List Variables}): |
| 1299 | 1288 | ||
| 1300 | @smallexample | 1289 | @smallexample |
| 1301 | @group | 1290 | @group |
| @@ -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 |
| 1537 | display the mode line of the current buffer. All windows for the same | 1526 | displayed on the mode line of the current buffer. The value of |
| 1538 | buffer use the same @code{mode-line-format}, so their mode lines | 1527 | @code{header-line-format} specifies the buffer's header line in the |
| 1539 | appear the same---except for scrolling percentages, and line and | 1528 | same way. All windows for the same buffer use the same |
| 1540 | column numbers, since those depend on point and on how the window is | 1529 | @code{mode-line-format} and @code{header-line-format}. |
| 1541 | scrolled. The value of @code{header-line-format} specifies the | 1530 | |
| 1542 | buffer's header line in the same way, with a mode line construct. | 1531 | For efficiency, Emacs does not continuously recompute the mode |
| 1543 | 1532 | line and header line of a window. It does so when circumstances | |
| 1544 | For efficiency, Emacs does not recompute the mode line and header | ||
| 1545 | line of a window in every redisplay. It does so when circumstances | ||
| 1546 | appear to call for it---for instance, if you change the window | 1533 | appear to call for it---for instance, if you change the window |
| 1547 | configuration, switch buffers, narrow or widen the buffer, scroll, or | 1534 | configuration, switch buffers, narrow or widen the buffer, scroll, or |
| 1548 | change the buffer's modification status. If you modify any of the | 1535 | change 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 | |||
| 1552 | update of the mode line so as to display the new information or | 1539 | update of the mode line so as to display the new information or |
| 1553 | display it in the new way. | 1540 | display 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 |
| 1557 | Force redisplay of the current buffer's mode line and header line. | 1543 | Force redisplay of the current buffer's mode line and header line. |
| 1558 | The next redisplay will update the mode line and header line based on | 1544 | The 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} |
| 1592 | A string as a mode-line construct appears verbatim in the mode line | 1578 | A string as a mode-line construct appears verbatim except for |
| 1593 | except for @dfn{@code{%}-constructs} in it. These stand for | 1579 | @dfn{@code{%}-constructs} in it. These stand for substitution of |
| 1594 | substitution of other data; see @ref{%-Constructs}. | 1580 | other data; see @ref{%-Constructs}. |
| 1595 | 1581 | ||
| 1596 | If the string has @code{face} properties, they are copied into the | 1582 | If parts of the string have @code{face} properties, they control |
| 1597 | mode line contents too (@pxref{Properties in Mode}). Any characters | 1583 | display of the text just as they would text in the buffer. Any |
| 1598 | in the mode line which have no @code{face} properties are displayed, | 1584 | characters which have no @code{face} properties are displayed, by |
| 1599 | by default, in the face @code{mode-line} or @code{mode-line-inactive} | 1585 | default, 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 | ||
| 1588 | special meanings. @xref{Properties in Mode}. | ||
| 1601 | 1589 | ||
| 1602 | @item @var{symbol} | 1590 | @item @var{symbol} |
| 1603 | A symbol as a mode-line construct stands for its value. The value of | 1591 | A 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 | |||
| 1612 | non-@code{nil} @code{risky-local-variable} property), all text | 1600 | non-@code{nil} @code{risky-local-variable} property), all text |
| 1613 | properties specified in @var{symbol}'s value are ignored. This | 1601 | properties specified in @var{symbol}'s value are ignored. This |
| 1614 | includes the text properties of strings in @var{symbol}'s value, as | 1602 | includes the text properties of strings in @var{symbol}'s value, as |
| 1615 | well as all @code{:eval} and @code{:propertize} forms in it. | 1603 | well as all @code{:eval} and @code{:propertize} forms in it. (The |
| 1604 | reason for this is security: non-risky variables could be set | ||
| 1605 | automatically 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 | |||
| 2055 | property. | 2045 | property. |
| 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 |
| 2059 | keymap, it can bind character keys and function keys; but that has no | 2049 | keymap only takes real effect for mouse clicks; binding character keys |
| 2060 | effect, since it is impossible to move point into the mode line. This | 2050 | and function keys to it has no effect, since it is impossible to move |
| 2061 | keymap can only take real effect for mouse clicks. | 2051 | point 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 |
| 2064 | non-@code{nil} @code{risky-local-variable} property, any text | 2054 | non-@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 |
| 2890 | Used (typically) for preprocessor commands. | 2880 | Used (typically) for preprocessor commands. |
| 2891 | 2881 | ||
| 2882 | @item font-lock-negation-char-face | ||
| 2883 | @vindex font-lock-negation-char-face | ||
| 2884 | Used (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 |
| 2894 | Used (typically) for constructs that are peculiar, or that greatly | 2888 | Used (typically) for constructs that are peculiar, or that greatly |
| @@ -3044,7 +3038,7 @@ closely related, and often getting one of them to work will appear to | |||
| 3044 | make the other also work. However, for reliable results you must | 3038 | make the other also work. However, for reliable results you must |
| 3045 | attend explicitly to both aspects. | 3039 | attend explicitly to both aspects. |
| 3046 | 3040 | ||
| 3047 | There are two ways to ensure correct identification of multiline | 3041 | There are three ways to ensure correct identification of multiline |
| 3048 | constructs: | 3042 | constructs: |
| 3049 | 3043 | ||
| 3050 | @itemize | 3044 | @itemize |
| @@ -3055,6 +3049,10 @@ property on the construct when it is added to the buffer. | |||
| 3055 | Use @code{font-lock-fontify-region-function} hook to extend the scan | 3049 | Use @code{font-lock-fontify-region-function} hook to extend the scan |
| 3056 | so that the scanned text never starts or ends in the middle of a | 3050 | so that the scanned text never starts or ends in the middle of a |
| 3057 | multiline construct. | 3051 | multiline construct. |
| 3052 | @item | ||
| 3053 | Add a function to @code{font-lock-extend-region-functions} that does | ||
| 3054 | the @emph{identification} and extends the scan so that the scanned | ||
| 3055 | text never starts or ends in the middle of a multiline construct. | ||
| 3058 | @end itemize | 3056 | @end itemize |
| 3059 | 3057 | ||
| 3060 | There are three ways to do rehighlighting of multiline constructs: | 3058 | There are three ways to do rehighlighting of multiline constructs: |
| @@ -3144,7 +3142,7 @@ earlier line. | |||
| 3144 | You can enlarge (or even reduce) the region to fontify by setting | 3142 | You can enlarge (or even reduce) the region to fontify by setting |
| 3145 | one the following variables: | 3143 | one the following variables: |
| 3146 | 3144 | ||
| 3147 | @defvar font-lock-extend-region-function | 3145 | @defvar font-lock-extend-after-change-region-function |
| 3148 | This buffer-local variable is either @code{nil} or a function for | 3146 | This buffer-local variable is either @code{nil} or a function for |
| 3149 | Font-Lock to call to determine the region to scan and fontify. | 3147 | Font-Lock to call to determine the region to scan and fontify. |
| 3150 | 3148 | ||
diff --git a/lispref/os.texi b/lispref/os.texi index e3634746988..f6682548e5b 100644 --- a/lispref/os.texi +++ b/lispref/os.texi | |||
| @@ -28,8 +28,10 @@ pertaining to the terminal and the screen. | |||
| 28 | * Processor Run Time:: Getting the run time used by Emacs. | 28 | * Processor Run Time:: Getting the run time used by Emacs. |
| 29 | * Time Calculations:: Adding, subtracting, comparing times, etc. | 29 | * Time Calculations:: Adding, subtracting, comparing times, etc. |
| 30 | * Timers:: Setting a timer to call a function at a certain time. | 30 | * Timers:: Setting a timer to call a function at a certain time. |
| 31 | * Terminal Input:: Recording terminal input for debugging. | 31 | * Idle Timers:: Setting a timer to call a function when Emacs has |
| 32 | * Terminal Output:: Recording terminal output for debugging. | 32 | been idle for a certain length of time. |
| 33 | * Terminal Input:: Accessing and recording terminal input. | ||
| 34 | * Terminal Output:: Controlling and recording terminal output. | ||
| 33 | * Sound Output:: Playing sounds on the computer's speaker. | 35 | * Sound Output:: Playing sounds on the computer's speaker. |
| 34 | * X11 Keysyms:: Operating on key symbols for X Windows | 36 | * X11 Keysyms:: Operating on key symbols for X Windows |
| 35 | * Batch Mode:: Running Emacs without terminal interaction. | 37 | * Batch Mode:: Running Emacs without terminal interaction. |
| @@ -1256,7 +1258,9 @@ This stands for the year without century (00-99). | |||
| 1256 | @item %Y | 1258 | @item %Y |
| 1257 | This stands for the year with century. | 1259 | This stands for the year with century. |
| 1258 | @item %Z | 1260 | @item %Z |
| 1259 | This stands for the time zone abbreviation. | 1261 | This stands for the time zone abbreviation (e.g., @samp{EST}). |
| 1262 | @item %z | ||
| 1263 | This stands for the time zone numerical offset (e.g., @samp{-0500}). | ||
| 1260 | @end table | 1264 | @end table |
| 1261 | 1265 | ||
| 1262 | You can also specify the field width and type of padding for any of | 1266 | You can also specify the field width and type of padding for any of |
| @@ -1286,12 +1290,14 @@ If @var{universal} is non-@code{nil}, that means to describe the time as | |||
| 1286 | Universal Time; @code{nil} means describe it using what Emacs believes | 1290 | Universal Time; @code{nil} means describe it using what Emacs believes |
| 1287 | is the local time zone (see @code{current-time-zone}). | 1291 | is the local time zone (see @code{current-time-zone}). |
| 1288 | 1292 | ||
| 1289 | This function uses the C library function @code{strftime} to do most of | 1293 | This function uses the C library function @code{strftime} |
| 1290 | the work. In order to communicate with that function, it first encodes | 1294 | (@pxref{Formatting Calendar Time,,, libc, The GNU C Library Reference |
| 1291 | its argument using the coding system specified by | 1295 | Manual}) to do most of the work. In order to communicate with that |
| 1292 | @code{locale-coding-system} (@pxref{Locales}); after @code{strftime} | 1296 | function, it first encodes its argument using the coding system |
| 1293 | returns the resulting string, @code{format-time-string} decodes the | 1297 | specified by @code{locale-coding-system} (@pxref{Locales}); after |
| 1294 | string using that same coding system. | 1298 | @code{strftime} returns the resulting string, |
| 1299 | @code{format-time-string} decodes the string using that same coding | ||
| 1300 | system. | ||
| 1295 | @end defun | 1301 | @end defun |
| 1296 | 1302 | ||
| 1297 | @defun seconds-to-time seconds | 1303 | @defun seconds-to-time seconds |
| @@ -1388,6 +1394,13 @@ both before and after changing the buffer, to separate the timer's | |||
| 1388 | changes from user commands' changes and prevent a single undo entry | 1394 | changes from user commands' changes and prevent a single undo entry |
| 1389 | from growing to be quite large. | 1395 | from growing to be quite large. |
| 1390 | 1396 | ||
| 1397 | Timer functions should also avoid calling functions that cause Emacs | ||
| 1398 | to wait, such as @code{sit-for} (@pxref{Waiting}). This can lead to | ||
| 1399 | unpredictable effects, since other timers (or even the same timer) can | ||
| 1400 | run while waiting. If a timer function needs to perform an action | ||
| 1401 | after a certain time has elapsed, it can do this by scheduling a new | ||
| 1402 | timer. | ||
| 1403 | |||
| 1391 | If a timer function calls functions that can change the match data, | 1404 | If a timer function calls functions that can change the match data, |
| 1392 | it should save and restore the match data. @xref{Saving Match Data}. | 1405 | it should save and restore the match data. @xref{Saving Match Data}. |
| 1393 | 1406 | ||
| @@ -1469,10 +1482,26 @@ calls one of those primitives. So use @code{with-timeout} only with a | |||
| 1469 | a timer to avoid waiting too long for an answer. @xref{Yes-or-No | 1482 | a timer to avoid waiting too long for an answer. @xref{Yes-or-No |
| 1470 | Queries}. | 1483 | Queries}. |
| 1471 | 1484 | ||
| 1485 | @defun cancel-timer timer | ||
| 1486 | This cancels the requested action for @var{timer}, which should be a | ||
| 1487 | timer---usually, one previously returned by @code{run-at-time} or | ||
| 1488 | @code{run-with-idle-timer}. This cancels the effect of that call to | ||
| 1489 | one of these functions; the arrival of the specified time will not | ||
| 1490 | cause anything special to happen. | ||
| 1491 | @end defun | ||
| 1492 | |||
| 1493 | @node Idle Timers | ||
| 1494 | @section Idle Timers | ||
| 1495 | |||
| 1496 | Here is how to set up a timer that runs when Emacs is idle for a | ||
| 1497 | certain length of time. Aside from how to set them up, idle timers | ||
| 1498 | work just like ordinary timers. | ||
| 1499 | |||
| 1472 | @deffn Command run-with-idle-timer secs repeat function &rest args | 1500 | @deffn Command run-with-idle-timer secs repeat function &rest args |
| 1473 | Set up a timer which runs when Emacs has been idle for @var{secs} | 1501 | Set up a timer which runs when Emacs has been idle for @var{secs} |
| 1474 | seconds. The value of @var{secs} may be an integer or a floating point | 1502 | seconds. The value of @var{secs} may be an integer or a floating point |
| 1475 | number. | 1503 | number; a value of the type returned by @code{current-idle-time} |
| 1504 | is also allowed. | ||
| 1476 | 1505 | ||
| 1477 | If @var{repeat} is @code{nil}, the timer runs just once, the first time | 1506 | If @var{repeat} is @code{nil}, the timer runs just once, the first time |
| 1478 | Emacs remains idle for a long enough time. More often @var{repeat} is | 1507 | Emacs remains idle for a long enough time. More often @var{repeat} is |
| @@ -1480,7 +1509,7 @@ non-@code{nil}, which means to run the timer @emph{each time} Emacs | |||
| 1480 | remains idle for @var{secs} seconds. | 1509 | remains idle for @var{secs} seconds. |
| 1481 | 1510 | ||
| 1482 | The function @code{run-with-idle-timer} returns a timer value which you | 1511 | The function @code{run-with-idle-timer} returns a timer value which you |
| 1483 | can use in calling @code{cancel-timer} (see below). | 1512 | can use in calling @code{cancel-timer} (@pxref{Timers}). |
| 1484 | @end deffn | 1513 | @end deffn |
| 1485 | 1514 | ||
| 1486 | @cindex idleness | 1515 | @cindex idleness |
| @@ -1504,11 +1533,49 @@ minutes, and even if there have been garbage collections and autosaves. | |||
| 1504 | input. Then it becomes idle again, and all the idle timers that are | 1533 | input. Then it becomes idle again, and all the idle timers that are |
| 1505 | set up to repeat will subsequently run another time, one by one. | 1534 | set up to repeat will subsequently run another time, one by one. |
| 1506 | 1535 | ||
| 1507 | @defun cancel-timer timer | 1536 | @c Emacs 19 feature |
| 1508 | Cancel the requested action for @var{timer}, which should be a value | 1537 | @defun current-idle-time |
| 1509 | previously returned by @code{run-at-time} or @code{run-with-idle-timer}. | 1538 | This function returns the length of time Emacs has been idle, as a |
| 1510 | This cancels the effect of that call to one of these functions; the | 1539 | list of three integers: @code{(@var{high} @var{low} @var{microsec})}. |
| 1511 | arrival of the specified time will not cause anything special to happen. | 1540 | The integers @var{high} and @var{low} combine to give the number of |
| 1541 | seconds of idleness, which is | ||
| 1542 | @ifnottex | ||
| 1543 | @var{high} * 2**16 + @var{low}. | ||
| 1544 | @end ifnottex | ||
| 1545 | @tex | ||
| 1546 | $high*2^{16}+low$. | ||
| 1547 | @end tex | ||
| 1548 | |||
| 1549 | The third element, @var{microsec}, gives the microseconds since the | ||
| 1550 | start of the current second (or 0 for systems that return time with | ||
| 1551 | the resolution of only one second). | ||
| 1552 | |||
| 1553 | The main use of this function is when an idle timer function wants to | ||
| 1554 | ``take a break'' for a while. It can set up another idle timer to | ||
| 1555 | call the same function again, after a few seconds more idleness. | ||
| 1556 | Here's an example: | ||
| 1557 | |||
| 1558 | @smallexample | ||
| 1559 | (defvar resume-timer nil | ||
| 1560 | "Timer that `timer-function' used to reschedule itself, or nil.") | ||
| 1561 | |||
| 1562 | (defun timer-function () | ||
| 1563 | ;; @r{If the user types a command while @code{resume-timer}} | ||
| 1564 | ;; @r{is active, the next time this function is called from} | ||
| 1565 | ;; @r{its main idle timer, deactivate @code{resume-timer}.} | ||
| 1566 | (when resume-timer | ||
| 1567 | (cancel-timer resume-timer)) | ||
| 1568 | ...@var{do the work for a while}... | ||
| 1569 | (when @var{taking-a-break} | ||
| 1570 | (setq resume-timer | ||
| 1571 | (run-with-idle-timer | ||
| 1572 | ;; Compute an idle time @var{break-length} | ||
| 1573 | ;; more than the current value. | ||
| 1574 | (time-add (current-idle-time) | ||
| 1575 | (seconds-to-time @var{break-length})) | ||
| 1576 | nil | ||
| 1577 | 'timer-function)))) | ||
| 1578 | @end smallexample | ||
| 1512 | @end defun | 1579 | @end defun |
| 1513 | 1580 | ||
| 1514 | @node Terminal Input | 1581 | @node Terminal Input |
| @@ -1521,8 +1588,6 @@ functions. | |||
| 1521 | 1588 | ||
| 1522 | @menu | 1589 | @menu |
| 1523 | * Input Modes:: Options for how input is processed. | 1590 | * Input Modes:: Options for how input is processed. |
| 1524 | * Translating Input:: Low level conversion of some characters or events | ||
| 1525 | into others. | ||
| 1526 | * Recording Input:: Saving histories of recent or all input events. | 1591 | * Recording Input:: Saving histories of recent or all input events. |
| 1527 | @end menu | 1592 | @end menu |
| 1528 | 1593 | ||
| @@ -1587,204 +1652,6 @@ is the character Emacs currently uses for quitting, usually @kbd{C-g}. | |||
| 1587 | @end table | 1652 | @end table |
| 1588 | @end defun | 1653 | @end defun |
| 1589 | 1654 | ||
| 1590 | @node Translating Input | ||
| 1591 | @subsection Translating Input Events | ||
| 1592 | @cindex translating input events | ||
| 1593 | |||
| 1594 | This section describes features for translating input events into | ||
| 1595 | other input events before they become part of key sequences. These | ||
| 1596 | features apply to each event in the order they are described here: each | ||
| 1597 | event is first modified according to @code{extra-keyboard-modifiers}, | ||
| 1598 | then translated through @code{keyboard-translate-table} (if applicable), | ||
| 1599 | and finally decoded with the specified keyboard coding system. If it is | ||
| 1600 | being read as part of a key sequence, it is then added to the sequence | ||
| 1601 | being read; then subsequences containing it are checked first with | ||
| 1602 | @code{function-key-map} and then with @code{key-translation-map}. | ||
| 1603 | |||
| 1604 | @c Emacs 19 feature | ||
| 1605 | @defvar extra-keyboard-modifiers | ||
| 1606 | This variable lets Lisp programs ``press'' the modifier keys on the | ||
| 1607 | keyboard. The value is a character. Only the modifiers of the | ||
| 1608 | character matter. Each time the user types a keyboard key, it is | ||
| 1609 | altered as if those modifier keys were held down. For instance, if | ||
| 1610 | you bind @code{extra-keyboard-modifiers} to @code{?\C-\M-a}, then all | ||
| 1611 | keyboard input characters typed during the scope of the binding will | ||
| 1612 | have the control and meta modifiers applied to them. The character | ||
| 1613 | @code{?\C-@@}, equivalent to the integer 0, does not count as a control | ||
| 1614 | character for this purpose, but as a character with no modifiers. | ||
| 1615 | Thus, setting @code{extra-keyboard-modifiers} to zero cancels any | ||
| 1616 | modification. | ||
| 1617 | |||
| 1618 | When using a window system, the program can ``press'' any of the | ||
| 1619 | modifier keys in this way. Otherwise, only the @key{CTL} and @key{META} | ||
| 1620 | keys can be virtually pressed. | ||
| 1621 | |||
| 1622 | Note that this variable applies only to events that really come from | ||
| 1623 | the keyboard, and has no effect on mouse events or any other events. | ||
| 1624 | @end defvar | ||
| 1625 | |||
| 1626 | @defvar keyboard-translate-table | ||
| 1627 | This variable is the translate table for keyboard characters. It lets | ||
| 1628 | you reshuffle the keys on the keyboard without changing any command | ||
| 1629 | bindings. Its value is normally a char-table, or else @code{nil}. | ||
| 1630 | (It can also be a string or vector, but this is considered obsolete.) | ||
| 1631 | |||
| 1632 | If @code{keyboard-translate-table} is a char-table | ||
| 1633 | (@pxref{Char-Tables}), then each character read from the keyboard is | ||
| 1634 | looked up in this char-table. If the value found there is | ||
| 1635 | non-@code{nil}, then it is used instead of the actual input character. | ||
| 1636 | |||
| 1637 | Note that this translation is the first thing that happens to a | ||
| 1638 | character after it is read from the terminal. Record-keeping features | ||
| 1639 | such as @code{recent-keys} and dribble files record the characters after | ||
| 1640 | translation. | ||
| 1641 | |||
| 1642 | Note also that this translation is done before the characters are | ||
| 1643 | supplied to input methods (@pxref{Input Methods}). Use | ||
| 1644 | @code{translation-table-for-input} (@pxref{Translation of Characters}), | ||
| 1645 | if you want to translate characters after input methods operate. | ||
| 1646 | @end defvar | ||
| 1647 | |||
| 1648 | @defun keyboard-translate from to | ||
| 1649 | This function modifies @code{keyboard-translate-table} to translate | ||
| 1650 | character code @var{from} into character code @var{to}. It creates | ||
| 1651 | the keyboard translate table if necessary. | ||
| 1652 | @end defun | ||
| 1653 | |||
| 1654 | Here's an example of using the @code{keyboard-translate-table} to | ||
| 1655 | make @kbd{C-x}, @kbd{C-c} and @kbd{C-v} perform the cut, copy and paste | ||
| 1656 | operations: | ||
| 1657 | |||
| 1658 | @example | ||
| 1659 | (keyboard-translate ?\C-x 'control-x) | ||
| 1660 | (keyboard-translate ?\C-c 'control-c) | ||
| 1661 | (keyboard-translate ?\C-v 'control-v) | ||
| 1662 | (global-set-key [control-x] 'kill-region) | ||
| 1663 | (global-set-key [control-c] 'kill-ring-save) | ||
| 1664 | (global-set-key [control-v] 'yank) | ||
| 1665 | @end example | ||
| 1666 | |||
| 1667 | @noindent | ||
| 1668 | On a graphical terminal that supports extended @acronym{ASCII} input, | ||
| 1669 | you can still get the standard Emacs meanings of one of those | ||
| 1670 | characters by typing it with the shift key. That makes it a different | ||
| 1671 | character as far as keyboard translation is concerned, but it has the | ||
| 1672 | same usual meaning. | ||
| 1673 | |||
| 1674 | The remaining translation features translate subsequences of key | ||
| 1675 | sequences being read. They are implemented in @code{read-key-sequence} | ||
| 1676 | and have no effect on input read with @code{read-event}. | ||
| 1677 | |||
| 1678 | @defvar function-key-map | ||
| 1679 | This variable holds a keymap that describes the character sequences sent | ||
| 1680 | by function keys on an ordinary character terminal. This keymap has the | ||
| 1681 | same structure as other keymaps, but is used differently: it specifies | ||
| 1682 | translations to make while reading key sequences, rather than bindings | ||
| 1683 | for key sequences. | ||
| 1684 | |||
| 1685 | If @code{function-key-map} ``binds'' a key sequence @var{k} to a vector | ||
| 1686 | @var{v}, then when @var{k} appears as a subsequence @emph{anywhere} in a | ||
| 1687 | key sequence, it is replaced with the events in @var{v}. | ||
| 1688 | |||
| 1689 | For example, VT100 terminals send @kbd{@key{ESC} O P} when the | ||
| 1690 | keypad @key{PF1} key is pressed. Therefore, we want Emacs to translate | ||
| 1691 | that sequence of events into the single event @code{pf1}. We accomplish | ||
| 1692 | this by ``binding'' @kbd{@key{ESC} O P} to @code{[pf1]} in | ||
| 1693 | @code{function-key-map}, when using a VT100. | ||
| 1694 | |||
| 1695 | Thus, typing @kbd{C-c @key{PF1}} sends the character sequence @kbd{C-c | ||
| 1696 | @key{ESC} O P}; later the function @code{read-key-sequence} translates | ||
| 1697 | this back into @kbd{C-c @key{PF1}}, which it returns as the vector | ||
| 1698 | @code{[?\C-c pf1]}. | ||
| 1699 | |||
| 1700 | Entries in @code{function-key-map} are ignored if they conflict with | ||
| 1701 | bindings made in the minor mode, local, or global keymaps. The intent | ||
| 1702 | is that the character sequences that function keys send should not have | ||
| 1703 | command bindings in their own right---but if they do, the ordinary | ||
| 1704 | bindings take priority. | ||
| 1705 | |||
| 1706 | The value of @code{function-key-map} is usually set up automatically | ||
| 1707 | according to the terminal's Terminfo or Termcap entry, but sometimes | ||
| 1708 | those need help from terminal-specific Lisp files. Emacs comes with | ||
| 1709 | terminal-specific files for many common terminals; their main purpose is | ||
| 1710 | to make entries in @code{function-key-map} beyond those that can be | ||
| 1711 | deduced from Termcap and Terminfo. @xref{Terminal-Specific}. | ||
| 1712 | @end defvar | ||
| 1713 | |||
| 1714 | @defvar key-translation-map | ||
| 1715 | This variable is another keymap used just like @code{function-key-map} | ||
| 1716 | to translate input events into other events. It differs from | ||
| 1717 | @code{function-key-map} in two ways: | ||
| 1718 | |||
| 1719 | @itemize @bullet | ||
| 1720 | @item | ||
| 1721 | @code{key-translation-map} goes to work after @code{function-key-map} is | ||
| 1722 | finished; it receives the results of translation by | ||
| 1723 | @code{function-key-map}. | ||
| 1724 | |||
| 1725 | @item | ||
| 1726 | Non-prefix bindings in @code{key-translation-map} override actual key | ||
| 1727 | bindings. For example, if @kbd{C-x f} has a non-prefix binding in | ||
| 1728 | @code{key-translation-map}, that translation takes effect even though | ||
| 1729 | @kbd{C-x f} also has a key binding in the global map. | ||
| 1730 | @end itemize | ||
| 1731 | |||
| 1732 | Note however that actual key bindings can have an effect on | ||
| 1733 | @code{key-translation-map}, even though they are overridden by it. | ||
| 1734 | Indeed, actual key bindings override @code{function-key-map} and thus | ||
| 1735 | may alter the key sequence that @code{key-translation-map} receives. | ||
| 1736 | Clearly, it is better to avoid this type of situation. | ||
| 1737 | |||
| 1738 | The intent of @code{key-translation-map} is for users to map one | ||
| 1739 | character set to another, including ordinary characters normally bound | ||
| 1740 | to @code{self-insert-command}. | ||
| 1741 | @end defvar | ||
| 1742 | |||
| 1743 | @cindex key translation function | ||
| 1744 | You can use @code{function-key-map} or @code{key-translation-map} for | ||
| 1745 | more than simple aliases, by using a function, instead of a key | ||
| 1746 | sequence, as the ``translation'' of a key. Then this function is called | ||
| 1747 | to compute the translation of that key. | ||
| 1748 | |||
| 1749 | The key translation function receives one argument, which is the prompt | ||
| 1750 | that was specified in @code{read-key-sequence}---or @code{nil} if the | ||
| 1751 | key sequence is being read by the editor command loop. In most cases | ||
| 1752 | you can ignore the prompt value. | ||
| 1753 | |||
| 1754 | If the function reads input itself, it can have the effect of altering | ||
| 1755 | the event that follows. For example, here's how to define @kbd{C-c h} | ||
| 1756 | to turn the character that follows into a Hyper character: | ||
| 1757 | |||
| 1758 | @example | ||
| 1759 | @group | ||
| 1760 | (defun hyperify (prompt) | ||
| 1761 | (let ((e (read-event))) | ||
| 1762 | (vector (if (numberp e) | ||
| 1763 | (logior (lsh 1 24) e) | ||
| 1764 | (if (memq 'hyper (event-modifiers e)) | ||
| 1765 | e | ||
| 1766 | (add-event-modifier "H-" e)))))) | ||
| 1767 | |||
| 1768 | (defun add-event-modifier (string e) | ||
| 1769 | (let ((symbol (if (symbolp e) e (car e)))) | ||
| 1770 | (setq symbol (intern (concat string | ||
| 1771 | (symbol-name symbol)))) | ||
| 1772 | @end group | ||
| 1773 | @group | ||
| 1774 | (if (symbolp e) | ||
| 1775 | symbol | ||
| 1776 | (cons symbol (cdr e))))) | ||
| 1777 | |||
| 1778 | (define-key function-key-map "\C-ch" 'hyperify) | ||
| 1779 | @end group | ||
| 1780 | @end example | ||
| 1781 | |||
| 1782 | Finally, if you have enabled keyboard character set decoding using | ||
| 1783 | @code{set-keyboard-coding-system}, decoding is done after the | ||
| 1784 | translations listed above. @xref{Terminal I/O Encoding}. In future | ||
| 1785 | Emacs versions, character set decoding may be done before the other | ||
| 1786 | translations. | ||
| 1787 | |||
| 1788 | @node Recording Input | 1655 | @node Recording Input |
| 1789 | @subsection Recording Input | 1656 | @subsection Recording Input |
| 1790 | 1657 | ||
diff --git a/lispref/processes.texi b/lispref/processes.texi index a6f43cfa95d..f957ebcac4b 100644 --- a/lispref/processes.texi +++ b/lispref/processes.texi | |||
| @@ -1520,7 +1520,7 @@ text at the end of the entire answer, but nothing before; that's how | |||
| 1520 | 1520 | ||
| 1521 | If the argument @var{delay-question} is non-nil, delay sending this | 1521 | If the argument @var{delay-question} is non-nil, delay sending this |
| 1522 | question until the process has finished replying to any previous | 1522 | question until the process has finished replying to any previous |
| 1523 | questions. This produces more reliable results with some processes." | 1523 | questions. This produces more reliable results with some processes. |
| 1524 | 1524 | ||
| 1525 | The return value of @code{tq-enqueue} itself is not meaningful. | 1525 | The return value of @code{tq-enqueue} itself is not meaningful. |
| 1526 | @end defun | 1526 | @end defun |
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 | |||
| 700 | arguments @var{objects} are the computed values to be formatted. | 700 | arguments @var{objects} are the computed values to be formatted. |
| 701 | 701 | ||
| 702 | The characters in @var{string}, other than the format specifications, | 702 | The characters in @var{string}, other than the format specifications, |
| 703 | are copied directly into the output; if they have text properties, | 703 | are copied directly into the output, including their text properties, |
| 704 | these are copied into the output also. | 704 | if 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 | ||
| 723 | specifications, you should @emph{never} pass an arbitrary string as | ||
| 724 | the first argument. This is particularly true when the string is | ||
| 725 | generated by some Lisp code. Unless the string is @emph{known} to | ||
| 726 | never include any @samp{%} characters, pass @code{"%s"}, described | ||
| 727 | below, 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 |
| 723 | format specifications correspond to successive values from | 734 | format 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 898f33443b5..4d2f278bee8 100644 --- a/lispref/text.texi +++ b/lispref/text.texi | |||
| @@ -103,9 +103,9 @@ This function returns the character following point in the current | |||
| 103 | buffer. This is similar to @code{(char-after (point))}. However, if | 103 | buffer. This is similar to @code{(char-after (point))}. However, if |
| 104 | point is at the end of the buffer, then @code{following-char} returns 0. | 104 | point is at the end of the buffer, then @code{following-char} returns 0. |
| 105 | 105 | ||
| 106 | Remember that point is always between characters, and the terminal | 106 | Remember that point is always between characters, and the cursor |
| 107 | cursor normally appears over the character following point. Therefore, | 107 | normally appears over the character following point. Therefore, the |
| 108 | the character returned by @code{following-char} is the character the | 108 | character returned by @code{following-char} is the character the |
| 109 | cursor is over. | 109 | cursor is over. |
| 110 | 110 | ||
| 111 | In this example, point is between the @samp{a} and the @samp{c}. | 111 | In 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} | |||
| 526 | is the numeric prefix argument. | 526 | is the numeric prefix argument. |
| 527 | @end deffn | 527 | @end deffn |
| 528 | 528 | ||
| 529 | @deffn Command split-line | ||
| 530 | This command splits the current line, moving the portion of the line | ||
| 531 | after point down vertically so that it is on the next line directly | ||
| 532 | below where it was before. Whitespace is inserted as needed at the | ||
| 533 | beginning of the lower line, using the @code{indent-to} function. | ||
| 534 | @code{split-line} returns the position of point. | ||
| 535 | |||
| 536 | Programs hardly ever use this function. | ||
| 537 | @end deffn | ||
| 538 | |||
| 539 | @defvar overwrite-mode | 529 | @defvar overwrite-mode |
| 540 | This variable controls whether overwrite mode is in effect. The value | 530 | This variable controls whether overwrite mode is in effect. The value |
| 541 | should be @code{overwrite-mode-textual}, @code{overwrite-mode-binary}, | 531 | should 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 |
| 982 | from the kill ring. The text properties are copied too. | 972 | intended primarily for the user but useful also in Lisp programs. |
| 973 | Both @code{yank} and @code{yank-pop} honor the | ||
| 974 | @code{yank-excluded-properties} variable and @code{yank-handler} text | ||
| 975 | property (@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. | |||
| 1213 | to the buffer's text so that they can be undone. (The buffers that | 1206 | to the buffer's text so that they can be undone. (The buffers that |
| 1214 | don't have one are usually special-purpose buffers for which Emacs | 1207 | don't have one are usually special-purpose buffers for which Emacs |
| 1215 | assumes that undoing is not useful. In particular, any buffer whose | 1208 | assumes that undoing is not useful. In particular, any buffer whose |
| 1216 | name begins with a space has its undo recording off by default, | 1209 | name begins with a space has its undo recording off by default; |
| 1217 | see @ref{Buffer Names}.) All the primitives that modify the | 1210 | see @ref{Buffer Names}.) All the primitives that modify the |
| 1218 | text in the buffer automatically add elements to the front of the undo | 1211 | text in the buffer automatically add elements to the front of the undo |
| 1219 | list, which is in the variable @code{buffer-undo-list}. | 1212 | list, 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 |
| 1319 | This is the basic function for undoing elements of an undo list. | 1312 | This is the basic function for undoing elements of an undo list. |
| 1320 | It undoes the first @var{count} elements of @var{list}, returning | 1313 | It undoes the first @var{count} elements of @var{list}, returning |
| 1321 | the rest of @var{list}. You could write this function in Lisp, | 1314 | the rest of @var{list}. |
| 1322 | but 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 |
| 1325 | changes the buffer. Undo commands avoid confusion by saving the undo | 1317 | changes 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'' | |||
| 1372 | of an undo list measures the cons cells that make up the list, plus the | 1364 | of an undo list measures the cons cells that make up the list, plus the |
| 1373 | strings of deleted text.) Three variables control the range of acceptable | 1365 | strings of deleted text.) Three variables control the range of acceptable |
| 1374 | sizes: @code{undo-limit}, @code{undo-strong-limit} and | 1366 | sizes: @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 |
| 1368 | number of bytes occupied, which includes both saved text and other | ||
| 1369 | data. | ||
| 1376 | 1370 | ||
| 1377 | @defopt undo-limit | 1371 | @defopt undo-limit |
| 1378 | This is the soft limit for the acceptable size of an undo list. The | 1372 | This 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. | |||
| 1392 | This is a last ditch limit to prevent memory overflow. | 1386 | This is a last ditch limit to prevent memory overflow. |
| 1393 | @end defopt | 1387 | @end defopt |
| 1394 | 1388 | ||
| 1389 | @defopt undo-ask-before-discard | ||
| 1390 | If this variable is non-@code{nil}, when the undo info exceeds | ||
| 1391 | @code{undo-outer-limit}, Emacs asks in the echo area whether to | ||
| 1392 | discard the info. The default value is @code{nil}, which means to | ||
| 1393 | discard it automatically. | ||
| 1394 | |||
| 1395 | This option is mainly intended for debugging. Garbage collection is | ||
| 1396 | inhibited while the question is asked, which means that Emacs might | ||
| 1397 | leak 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 | |||
| 1481 | between paragraphs are removed. This function justifies as well as | 1486 | between paragraphs are removed. This function justifies as well as |
| 1482 | filling when @var{justify} is non-@code{nil}. | 1487 | filling when @var{justify} is non-@code{nil}. |
| 1483 | 1488 | ||
| 1484 | In an interactive call, any prefix argument requests justification. | ||
| 1485 | |||
| 1486 | If @var{nosqueeze} is non-@code{nil}, that means to leave whitespace | 1489 | If @var{nosqueeze} is non-@code{nil}, that means to leave whitespace |
| 1487 | other than line breaks untouched. If @var{squeeze-after} is | 1490 | other than line breaks untouched. If @var{squeeze-after} is |
| 1488 | non-@code{nil}, it specifies a position in the region, and means don't | 1491 | non-@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 |
| 1523 | This function returns the proper justification style to use for filling | 1526 | This function returns the proper justification style to use for filling |
| 1524 | the text around point. | 1527 | the text around point. |
| 1528 | |||
| 1529 | This returns the value of the @code{justification} text property at | ||
| 1530 | point, or the variable @var{default-justification} if there is no such | ||
| 1531 | text property. However, it returns @code{nil} rather than @code{none} | ||
| 1532 | to 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 |
| 1572 | This buffer-local variable specifies a string of text that appears at | 1580 | This buffer-local variable, if non-@code{nil}, specifies a string of |
| 1573 | the beginning | 1581 | text that appears at the beginning of normal text lines and should be |
| 1574 | of normal text lines and should be disregarded when filling them. Any | 1582 | disregarded when filling them. Any line that fails to start with the |
| 1575 | line that fails to start with the fill prefix is considered the start of | 1583 | fill prefix is considered the start of a paragraph; so is any line |
| 1576 | a paragraph; so is any line that starts with the fill prefix followed by | 1584 | that starts with the fill prefix followed by additional whitespace. |
| 1577 | additional whitespace. Lines that start with the fill prefix but no | 1585 | Lines that start with the fill prefix but no additional whitespace are |
| 1578 | additional whitespace are ordinary text lines that can be filled | 1586 | ordinary text lines that can be filled together. The resulting filled |
| 1579 | together. The resulting filled lines also start with the fill prefix. | 1587 | lines also start with the fill prefix. |
| 1580 | 1588 | ||
| 1581 | The fill prefix follows the left margin whitespace, if any. | 1589 | The 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 |
| 1663 | This variable gives major modes a way to specify not to break a line | 1671 | This variable gives major modes a way to specify not to break a line |
| 1664 | at certain places. Its value should be a list of functions, but a | 1672 | at certain places. Its value should be a list of functions. Whenever |
| 1665 | single function is also supported for compatibility. Whenever filling | 1673 | filling considers breaking the line at a certain place in the buffer, |
| 1666 | considers breaking the line at a certain place in the buffer, it calls | 1674 | it calls each of these functions with no arguments and with point |
| 1667 | each of these functions with no arguments and with point located at | 1675 | located at that place. If any of the functions returns |
| 1668 | that place. If any of the functions returns non-@code{nil}, then the | 1676 | non-@code{nil}, then the line won't be broken there. |
| 1669 | line 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 | |||
| 1733 | starting after the left margin whitespace (if any) on a line; the | 1740 | starting after the left margin whitespace (if any) on a line; the |
| 1734 | characters it matches are that line's candidate for the fill prefix. | 1741 | characters 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 |
| 1737 | default value. This matches a number enclosed in parentheses or | 1744 | default value. This matches a number enclosed in parentheses or |
| 1738 | followed by a period, or certain punctuation characters, or any | 1745 | followed by a period, or certain punctuation characters, or any |
| 1739 | sequence of these intermingled with whitespace. In particular, it | 1746 | sequence 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 | |||
| 2054 | containing position @var{beg}, and the entire line containing position | 2062 | containing 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 | ||
| 2057 | Note that @code{sort-columns} uses the @code{sort} utility program, | 2065 | Note that @code{sort-columns} rejects text that contains tabs, because |
| 2058 | and so cannot work properly on text containing tab characters. Use | 2066 | tabs could be split across the specified columns. Use @kbd{M-x |
| 2059 | @kbd{M-x untabify} to convert tabs to spaces before sorting. | 2067 | untabify} to convert tabs to spaces before sorting. |
| 2068 | |||
| 2069 | When possible, this command actually works by calling the @code{sort} | ||
| 2070 | utility 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 | |||
| 2391 | affect the display of tab characters in the buffer (@pxref{Usual | 2402 | affect the display of tab characters in the buffer (@pxref{Usual |
| 2392 | Display}). Note that the @key{TAB} character as input uses this tab | 2403 | Display}). Note that the @key{TAB} character as input uses this tab |
| 2393 | stop feature only in a few major modes, such as Text mode. | 2404 | stop 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 |
| 2396 | This command inserts spaces or tabs before point, up to the next tab | 2408 | This 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)} |
| 3081 | The @code{keymap} property specifies an additional keymap for | 3093 | The @code{keymap} property specifies an additional keymap for |
| 3082 | commands. The property's value for the character before point applies | 3094 | commands. When this keymap applies, it is used for key lookup before |
| 3083 | if it is non-@code{nil} and rear-sticky, and the property's value for | 3095 | the minor mode keymaps and before the buffer's local map. |
| 3084 | the character after point applies if it is non-@code{nil} and | 3096 | @xref{Active Keymaps}. If the property value is a symbol, the |
| 3097 | symbol's function definition is used as the keymap. | ||
| 3098 | |||
| 3099 | The property's value for the character before point applies if it is | ||
| 3100 | non-@code{nil} and rear-sticky, and the property's value for the | ||
| 3101 | character after point applies if it is non-@code{nil} and | ||
| 3085 | front-sticky. (For mouse clicks, the position of the click is used | 3102 | front-sticky. (For mouse clicks, the position of the click is used |
| 3086 | instead of the position of point.) If the property value is a symbol, | 3103 | instead of the position of point.) |
| 3087 | the symbol's function definition is used as the keymap. | ||
| 3088 | |||
| 3089 | When this keymap applies, it is used for key lookup before the minor | ||
| 3090 | mode keymaps and before the buffer's local map. @xref{Active | ||
| 3091 | Keymaps}. | ||
| 3092 | 3104 | ||
| 3093 | @item local-map | 3105 | @item local-map |
| 3094 | @kindex local-map @r{(text property)} | 3106 | @kindex local-map @r{(text property)} |
| 3095 | This property works like @code{keymap} except that it specifies a | 3107 | This property works like @code{keymap} except that it specifies a |
| 3096 | keymap to use @emph{instead of} the buffer's local map. For most | 3108 | keymap to use @emph{instead of} the buffer's local map. For most |
| 3097 | purposes (perhaps all purposes), the @code{keymap} is superior. | 3109 | purposes (perhaps all purposes), it is better to use the @code{keymap} |
| 3110 | property. | ||
| 3098 | 3111 | ||
| 3099 | @item syntax-table | 3112 | @item syntax-table |
| 3100 | The @code{syntax-table} property overrides what the syntax table says | 3113 | The @code{syntax-table} property overrides what the syntax table says |
| @@ -3479,26 +3492,39 @@ 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 make that text highlight when the mouse moves over it, and (2) | 3496 | the mouse or via keyboard commands, to produce some result. Many |
| 3484 | to make a mouse button do something when you click on that text. | 3497 | major modes use clickable text to implement features such as |
| 3498 | hyper-links. The @code{button} package provides an easy way to insert | ||
| 3499 | and manipulate clickable text. @xref{Buttons}. | ||
| 3500 | |||
| 3501 | In this section, we will explain how to manually set up clickable | ||
| 3502 | text in a buffer using text properties. This involves two things: (1) | ||
| 3503 | indicating clickability when the mouse moves over the text, and (2) | ||
| 3504 | making @kbd{RET} or a mouse click on that text do something. | ||
| 3485 | 3505 | ||
| 3486 | For highlighting, use the @code{mouse-face} text property. Here is | 3506 | Indicating clickability usually involves highlighting the text, and |
| 3487 | an example of how Dired does it: | 3507 | often involves displaying helpful information about the action, such |
| 3508 | as which mouse button to press, or a short summary of the action. | ||
| 3509 | This can be done with the @code{mouse-face} and @code{help-echo} | ||
| 3510 | text properties. @xref{Special Properties}. | ||
| 3511 | Here is an example of how Dired does it: | ||
| 3488 | 3512 | ||
| 3489 | @smallexample | 3513 | @smallexample |
| 3490 | (condition-case nil | 3514 | (condition-case nil |
| 3491 | (if (dired-move-to-filename) | 3515 | (if (dired-move-to-filename) |
| 3492 | (put-text-property (point) | 3516 | (add-text-properties |
| 3493 | (save-excursion | 3517 | (point) |
| 3494 | (dired-move-to-end-of-filename) | 3518 | (save-excursion |
| 3495 | (point)) | 3519 | (dired-move-to-end-of-filename) |
| 3496 | 'mouse-face 'highlight)) | 3520 | (point)) |
| 3521 | '(mouse-face highlight | ||
| 3522 | help-echo "mouse-2: visit this file in other window"))) | ||
| 3497 | (error nil)) | 3523 | (error nil)) |
| 3498 | @end smallexample | 3524 | @end smallexample |
| 3499 | 3525 | ||
| 3500 | @noindent | 3526 | @noindent |
| 3501 | The first two arguments to @code{put-text-property} specify the | 3527 | The first two arguments to @code{add-text-properties} specify the |
| 3502 | beginning and end of the text. | 3528 | beginning and end of the text. |
| 3503 | 3529 | ||
| 3504 | The usual way to make the mouse do something when you click it | 3530 | The usual way to make the mouse do something when you click it |
| @@ -3508,24 +3534,34 @@ is done by the command definition. Here is how Dired does it: | |||
| 3508 | 3534 | ||
| 3509 | @smallexample | 3535 | @smallexample |
| 3510 | (defun dired-mouse-find-file-other-window (event) | 3536 | (defun dired-mouse-find-file-other-window (event) |
| 3511 | "In dired, visit the file or directory name you click on." | 3537 | "In Dired, visit the file or directory name you click on." |
| 3512 | (interactive "e") | 3538 | (interactive "e") |
| 3513 | (let (file) | 3539 | (let (window pos file) |
| 3514 | (save-excursion | 3540 | (save-excursion |
| 3515 | (set-buffer (window-buffer (posn-window (event-end event)))) | 3541 | (setq window (posn-window (event-end event)) |
| 3516 | (save-excursion | 3542 | pos (posn-point (event-end event))) |
| 3517 | (goto-char (posn-point (event-end event))) | 3543 | (if (not (windowp window)) |
| 3518 | (setq file (dired-get-filename)))) | 3544 | (error "No file chosen")) |
| 3519 | (select-window (posn-window (event-end event))) | 3545 | (set-buffer (window-buffer window)) |
| 3520 | (find-file-other-window (file-name-sans-versions file t)))) | 3546 | (goto-char pos) |
| 3547 | (setq file (dired-get-file-for-visit))) | ||
| 3548 | (if (file-directory-p file) | ||
| 3549 | (or (and (cdr dired-subdir-alist) | ||
| 3550 | (dired-goto-subdir file)) | ||
| 3551 | (progn | ||
| 3552 | (select-window window) | ||
| 3553 | (dired-other-window file))) | ||
| 3554 | (select-window window) | ||
| 3555 | (find-file-other-window (file-name-sans-versions file t))))) | ||
| 3521 | @end smallexample | 3556 | @end smallexample |
| 3522 | 3557 | ||
| 3523 | @noindent | 3558 | @noindent |
| 3524 | The reason for the outer @code{save-excursion} construct is to avoid | 3559 | The reason for the @code{save-excursion} construct is to avoid |
| 3525 | changing the current buffer; the reason for the inner one is to avoid | 3560 | changing the current buffer. In this case, |
| 3526 | permanently altering point in the buffer you click on. In this case, | 3561 | Dired uses the functions @code{posn-window} and @code{posn-point} |
| 3527 | Dired uses the function @code{dired-get-filename} to determine which | 3562 | to determine which buffer the click happened in and where, and |
| 3528 | file to visit, based on the position found in the event. | 3563 | in that buffer, @code{dired-get-file-for-visit} to determine which |
| 3564 | file to visit. | ||
| 3529 | 3565 | ||
| 3530 | Instead of defining a mouse command for the major mode, you can define | 3566 | Instead of defining a mouse command for the major mode, you can define |
| 3531 | a key binding for the clickable text itself, using the @code{keymap} | 3567 | a key binding for the clickable text itself, using the @code{keymap} |
| @@ -3697,7 +3733,8 @@ field nor the following field; the field functions treat it as belonging | |||
| 3697 | to an empty field whose beginning and end are both at @var{pos}. | 3733 | to an empty field whose beginning and end are both at @var{pos}. |
| 3698 | 3734 | ||
| 3699 | In all of these functions, if @var{pos} is omitted or @code{nil}, the | 3735 | In all of these functions, if @var{pos} is omitted or @code{nil}, the |
| 3700 | value of point is used by default. | 3736 | value of point is used by default. If narrowing is in effect, then |
| 3737 | @var{pos} should fall within the accessible portion. @xref{Narrowing}. | ||
| 3701 | 3738 | ||
| 3702 | @defun field-beginning &optional pos escape-from-edge limit | 3739 | @defun field-beginning &optional pos escape-from-edge limit |
| 3703 | This function returns the beginning of the field specified by @var{pos}. | 3740 | This function returns the beginning of the field specified by @var{pos}. |
diff --git a/man/ChangeLog b/man/ChangeLog index 6385b4393a0..ee0dac8359c 100644 --- a/man/ChangeLog +++ b/man/ChangeLog | |||
| @@ -1,3 +1,138 @@ | |||
| 1 | 2006-08-25 Kim F. Storm <storm@cua.dk> | ||
| 2 | |||
| 3 | * display.texi (Display Custom): Add variables overline-margin | ||
| 4 | and x-underline-at-descent-line. | ||
| 5 | |||
| 6 | 2006-08-25 Richard Stallman <rms@gnu.org> | ||
| 7 | |||
| 8 | * entering.texi (Exiting): Rewrite to give graphical displays | ||
| 9 | priority over text terminals. | ||
| 10 | |||
| 11 | * search.texi (Incremental Search): Move index entries. | ||
| 12 | |||
| 13 | 2006-08-23 Chong Yidong <cyd@stupidchicken.com> | ||
| 14 | |||
| 15 | * custom.texi (Init File): Reference Find Init to avoid "home | ||
| 16 | directory" confusion. | ||
| 17 | |||
| 18 | 2006-08-22 Nick Roberts <nickrob@snap.net.nz> | ||
| 19 | |||
| 20 | * building.texi (Other GDB-UI Buffers): Describe how to edit | ||
| 21 | a value in the locals buffer. | ||
| 22 | |||
| 23 | 2006-08-21 Richard Stallman <rms@gnu.org> | ||
| 24 | |||
| 25 | * search.texi (Basic Isearch): Add `isearch' index entry. | ||
| 26 | |||
| 27 | 2006-08-16 Richard Stallman <rms@gnu.org> | ||
| 28 | |||
| 29 | * misc.texi (Saving Emacs Sessions): Clean up wording. | ||
| 30 | |||
| 31 | * mark.texi (Marking Objects): Mention term "select all". | ||
| 32 | |||
| 33 | * emacs.texi (Top): Update subnode menu. | ||
| 34 | |||
| 35 | * help.texi (Help Mode): Move node up in file. | ||
| 36 | |||
| 37 | 2006-08-15 Carsten Dominik <dominik@science.uva.nl> | ||
| 38 | |||
| 39 | * org.texi (Installation, Activation): Split from Installation and | ||
| 40 | Activation. | ||
| 41 | (Clocking work time): Documented new features. | ||
| 42 | |||
| 43 | 2006-08-15 Nick Roberts <nickrob@snap.net.nz> | ||
| 44 | |||
| 45 | * building.texi (Stack Buffer): Explain fringe arrow. | ||
| 46 | |||
| 47 | 2006-08-13 Alex Schroeder <alex@gnu.org> | ||
| 48 | |||
| 49 | * rcirc.texi (Configuration): Use correct variable in rcirc-authinfo | ||
| 50 | example. | ||
| 51 | |||
| 52 | 2006-08-12 Eli Zaretskii <eliz@gnu.org> | ||
| 53 | |||
| 54 | * faq.texi (How to add fonts): New node. | ||
| 55 | |||
| 56 | * misc.texi (Saving Emacs Sessions): Clarify when desktop is restored | ||
| 57 | on startup. | ||
| 58 | |||
| 59 | 2006-08-11 Romain Francoise <romain@orebokech.com> | ||
| 60 | |||
| 61 | * ack.texi (Acknowledgments): Delete mention to zone-mode.el. | ||
| 62 | |||
| 63 | 2006-08-10 Sven Joachim <svenjoac@gmx.de> (tiny change) | ||
| 64 | |||
| 65 | * mule.texi (Recognize Coding, Text Coding): Fix typos. | ||
| 66 | |||
| 67 | 2006-08-10 Richard Stallman <rms@gnu.org> | ||
| 68 | |||
| 69 | * text.texi (Format Faces): Substantial rewrites to deal | ||
| 70 | with face merging. Empty regions don't count. Clarify | ||
| 71 | face property inheritance. | ||
| 72 | |||
| 73 | 2006-08-08 Romain Francoise <romain@orebokech.com> | ||
| 74 | |||
| 75 | * dired.texi (Marks vs Flags): Fix typo reported by Ari Roponen | ||
| 76 | <arjuropo@cc.jyu.fi>. | ||
| 77 | |||
| 78 | 2006-08-05 Romain Francoise <romain@orebokech.com> | ||
| 79 | |||
| 80 | * faq.texi (New in Emacs 22): Expand. | ||
| 81 | |||
| 82 | 2006-08-04 Eli Zaretskii <eliz@gnu.org> | ||
| 83 | |||
| 84 | * cmdargs.texi (Window Size X) <--geometry>: Only width and height | ||
| 85 | apply to all frames. | ||
| 86 | |||
| 87 | 2006-08-03 Michael Olson <mwolson@gnu.org> | ||
| 88 | |||
| 89 | * erc.texi: Update for ERC 5.1.4. | ||
| 90 | |||
| 91 | 2006-08-01 Richard Stallman <rms@gnu.org> | ||
| 92 | |||
| 93 | * help.texi (Name Help): Add index entries for describe-variable. | ||
| 94 | |||
| 95 | 2006-08-01 Nick Roberts <nickrob@snap.net.nz> | ||
| 96 | |||
| 97 | * building.texi (GDB Graphical Interface): Shorten node names. | ||
| 98 | (GDB-UI Layout): Use GDB-related. | ||
| 99 | (Other GDB-UI Buffers): Simplify English. | ||
| 100 | |||
| 101 | 2006-07-31 Richard Stallman <rms@gnu.org> | ||
| 102 | |||
| 103 | * search.texi (Query Replace): Add xref for Dired's Q command. | ||
| 104 | |||
| 105 | 2006-07-28 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 106 | |||
| 107 | * gnus.texi (Oort Gnus): Mention that the Lisp files are now installed | ||
| 108 | in .../site-lisp/gnus/ by default. | ||
| 109 | [ From gnus-news.texi in the trunk. ] | ||
| 110 | |||
| 111 | 2006-07-27 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 112 | |||
| 113 | * gnus.texi (MIME Commands): Additions for yEnc. | ||
| 114 | |||
| 115 | 2006-07-31 Nick Roberts <nickrob@snap.net.nz> | ||
| 116 | |||
| 117 | * building.texi (GDB commands in Fringe): Rename to... | ||
| 118 | (Source Buffers): ..this and move forward. Describe hollow arrow and | ||
| 119 | new option gdb-find-source-frame. | ||
| 120 | |||
| 121 | 2006-07-29 Richard Stallman <rms@gnu.org> | ||
| 122 | |||
| 123 | * dired.texi (Operating on Files): Simplify previous change | ||
| 124 | and fix Texinfo usage. | ||
| 125 | |||
| 126 | 2006-07-29 Eli Zaretskii <eliz@gnu.org> | ||
| 127 | |||
| 128 | * dired.texi (Operating on Files): Add cross-references. State the | ||
| 129 | Unix commands that do similar things. | ||
| 130 | |||
| 131 | 2006-07-28 Richard Stallman <rms@gnu.org> | ||
| 132 | |||
| 133 | * mark.texi (Transient Mark): Clarify that region never disappears | ||
| 134 | when Transient Mark mode is off, and not when it is on. | ||
| 135 | |||
| 1 | 2006-07-27 Richard Stallman <rms@gnu.org> | 136 | 2006-07-27 Richard Stallman <rms@gnu.org> |
| 2 | 137 | ||
| 3 | * search.texi (Non-ASCII Isearch): Clarify. Mention C-q. | 138 | * search.texi (Non-ASCII Isearch): Clarify. Mention C-q. |
| @@ -6,15 +141,15 @@ | |||
| 6 | 141 | ||
| 7 | * xresources.texi (GTK styles): Fix texinfo usage. | 142 | * xresources.texi (GTK styles): Fix texinfo usage. |
| 8 | 143 | ||
| 9 | * pgg.texi, org.texi, info.texi, forms.texi, flymake.texi: | 144 | * pgg.texi, org.texi, info.texi, forms.texi, flymake.texi: |
| 10 | * faq.texi: Move periods and commas inside quotes. | 145 | * faq.texi: Move periods and commas inside quotes. |
| 11 | 146 | ||
| 12 | * commands.texi (User Input): Explain why we teach keyboard cmds. | 147 | * commands.texi (User Input): Explain why we teach keyboard cmds. |
| 13 | 148 | ||
| 14 | * xresources.texi, xresmini.texi, search.texi, programs.texi: | 149 | * xresources.texi, xresmini.texi, search.texi, programs.texi: |
| 15 | * misc.texi, kmacro.texi, killing.texi, glossary.texi: | 150 | * misc.texi, kmacro.texi, killing.texi, glossary.texi: |
| 16 | * fortran-xtra.texi, files.texi, emacs.texi, emacs-xtra.texi: | 151 | * fortran-xtra.texi, files.texi, emacs.texi, emacs-xtra.texi: |
| 17 | * doclicense.texi, display.texi, dired.texi, basic.texi: | 152 | * doclicense.texi, display.texi, dired.texi, basic.texi: |
| 18 | * anti.texi, ack.texi: Move periods and commas inside quotes. | 153 | * anti.texi, ack.texi: Move periods and commas inside quotes. |
| 19 | 154 | ||
| 20 | 2006-07-22 Eli Zaretskii <eliz@gnu.org> | 155 | 2006-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 |
| 420 | John Heidemann wrote @file{mouse-copy.el} and @file{mouse-drag.el}, | 420 | John Heidemann wrote @file{mouse-copy.el} and @file{mouse-drag.el}, |
| 421 | which provide alternative mouse-based editing and scrolling features. | 421 | which provide alternative mouse-based editing and scrolling features. |
| 422 | He also contributed @file{zone-mode.el}, a major mode for editing DNS | ||
| 423 | zone files. | ||
| 424 | 422 | ||
| 425 | @item | 423 | @item |
| 426 | Jon K Hellan wrote @file{utf7.el}, support for mail-safe transformation | 424 | Jon K Hellan wrote @file{utf7.el}, support for mail-safe transformation |
diff --git a/man/building.texi b/man/building.texi index 549c69da544..01cdf88fe39 100644 --- a/man/building.texi +++ b/man/building.texi | |||
| @@ -833,17 +833,17 @@ Emacs session. If you have customized @code{gud-gdb-command-name} in | |||
| 833 | that way, you can use @kbd{M-x gdba} to invoke GDB in graphical mode. | 833 | that way, you can use @kbd{M-x gdba} to invoke GDB in graphical mode. |
| 834 | 834 | ||
| 835 | @menu | 835 | @menu |
| 836 | * GDB User Interface Layout:: Control the number of displayed buffers. | 836 | * GDB-UI Layout:: Control the number of displayed buffers. |
| 837 | * Source Buffers:: Use the mouse in the fringe/margin to | ||
| 838 | control your program. | ||
| 837 | * Breakpoints Buffer:: A breakpoint control panel. | 839 | * Breakpoints Buffer:: A breakpoint control panel. |
| 838 | * Stack Buffer:: Select a frame from the call stack. | 840 | * Stack Buffer:: Select a frame from the call stack. |
| 839 | * Other GDB User Interface Buffers:: Input/output, locals, registers, | 841 | * Other GDB-UI Buffers:: Input/output, locals, registers, |
| 840 | assembler, threads and memory buffers. | 842 | assembler, threads and memory buffers. |
| 841 | * GDB commands in the Fringe:: Use the mouse in the fringe/margin to | ||
| 842 | control your program. | ||
| 843 | * Watch Expressions:: Monitor variable values in the speedbar. | 843 | * Watch Expressions:: Monitor variable values in the speedbar. |
| 844 | @end menu | 844 | @end menu |
| 845 | 845 | ||
| 846 | @node GDB User Interface Layout | 846 | @node GDB-UI Layout |
| 847 | @subsubsection GDB User Interface Layout | 847 | @subsubsection GDB User Interface Layout |
| 848 | @cindex GDB User Interface layout | 848 | @cindex GDB User Interface layout |
| 849 | 849 | ||
| @@ -863,7 +863,7 @@ displays the following frame layout: | |||
| 863 | +--------------------------------+--------------------------------+ | 863 | +--------------------------------+--------------------------------+ |
| 864 | | GUD buffer (I/O of GDB) | Locals buffer | | 864 | | GUD buffer (I/O of GDB) | Locals buffer | |
| 865 | |--------------------------------+--------------------------------+ | 865 | |--------------------------------+--------------------------------+ |
| 866 | | Source buffer | I/O buffer for debugged pgm | | 866 | | Primary Source buffer | I/O buffer for debugged pgm | |
| 867 | |--------------------------------+--------------------------------+ | 867 | |--------------------------------+--------------------------------+ |
| 868 | | Stack buffer | Breakpoints buffer | | 868 | | Stack buffer | Breakpoints buffer | |
| 869 | +--------------------------------+--------------------------------+ | 869 | +--------------------------------+--------------------------------+ |
| @@ -871,8 +871,8 @@ displays the following frame layout: | |||
| 871 | @end smallexample | 871 | @end smallexample |
| 872 | 872 | ||
| 873 | However, if @code{gdb-use-separate-io-buffer} is @code{nil}, the I/O | 873 | However, if @code{gdb-use-separate-io-buffer} is @code{nil}, the I/O |
| 874 | buffer does not appear and the source buffer occupies the full width | 874 | buffer does not appear and the primary source buffer occupies the full |
| 875 | of the frame. | 875 | width of the frame. |
| 876 | 876 | ||
| 877 | @findex gdb-restore-windows | 877 | @findex gdb-restore-windows |
| 878 | If you change the window layout, for example, while editing and | 878 | If you change the window layout, for example, while editing and |
| @@ -884,7 +884,7 @@ layout with the command @code{gdb-restore-windows}. | |||
| 884 | containing just the GUD buffer and a source file, type @kbd{M-x | 884 | containing just the GUD buffer and a source file, type @kbd{M-x |
| 885 | gdb-many-windows}. | 885 | gdb-many-windows}. |
| 886 | 886 | ||
| 887 | You may also specify additional GUD-related buffers to display, | 887 | You may also specify additional GDB-related buffers to display, |
| 888 | either in the same frame or a different one. Select the buffers you | 888 | either in the same frame or a different one. Select the buffers you |
| 889 | want with the @samp{GUD->GDB-windows} and @samp{GUD->GDB-Frames} | 889 | want with the @samp{GUD->GDB-windows} and @samp{GUD->GDB-Frames} |
| 890 | sub-menus. If the menu-bar is unavailable, type @code{M-x | 890 | sub-menus. If the menu-bar is unavailable, type @code{M-x |
| @@ -904,6 +904,61 @@ as well as GDB's breakpoints. You do need to check that the | |||
| 904 | breakpoints in recently edited source files are still in the right | 904 | breakpoints in recently edited source files are still in the right |
| 905 | places. | 905 | places. |
| 906 | 906 | ||
| 907 | @node Source Buffers | ||
| 908 | @subsubsection Source Buffers | ||
| 909 | @cindex GDB commands in Fringe | ||
| 910 | |||
| 911 | @c @findex gdb-mouse-set-clear-breakpoint | ||
| 912 | @c @findex gdb-mouse-toggle-breakpoint | ||
| 913 | Many GDB commands can be entered using keybindings or the tool bar but | ||
| 914 | sometimes it is quicker to use the fringe. These commands either | ||
| 915 | manipulate breakpoints or control program execution. When there is no | ||
| 916 | fringe, you can use the margin but this is only present when the | ||
| 917 | source file already has a breakpoint. | ||
| 918 | |||
| 919 | You can click @kbd{Mouse-1} in the fringe or display margin of a | ||
| 920 | source buffer to set a breakpoint there and, on a graphical display, a | ||
| 921 | red bullet will appear on that line. If a breakpoint already exists | ||
| 922 | on that line, the same click will remove it. You can also enable or | ||
| 923 | disable a breakpoint by clicking @kbd{C-Mouse-1} on the bullet. | ||
| 924 | |||
| 925 | A solid arrow in the left fringe of a source buffer indicates the line | ||
| 926 | of the innermost frame where the debugged program has stopped. A | ||
| 927 | hollow arrow indicates the current execution line of higher level | ||
| 928 | frames. | ||
| 929 | |||
| 930 | If you drag the arrow in the fringe with @kbd{Mouse-1} | ||
| 931 | (@code{gdb-mouse-until}), execution will continue to the line where | ||
| 932 | you release the button, provided it is still in the same frame. | ||
| 933 | Alternatively, you can click @kbd{Mouse-3} at some point in the fringe | ||
| 934 | of this buffer and execution will advance to there. A similar command | ||
| 935 | (@code{gdb-mouse-jump}) allows you to jump to a source line without | ||
| 936 | executing the intermediate lines by clicking @kbd{C-Mouse-3}. This | ||
| 937 | command allows you to go backwards which can be useful for running | ||
| 938 | through code that has already executed, in order to examine its | ||
| 939 | execution in more detail. | ||
| 940 | |||
| 941 | @table @kbd | ||
| 942 | @item Mouse-1 | ||
| 943 | Set or clear a breakpoint. | ||
| 944 | |||
| 945 | @item C-Mouse-1 | ||
| 946 | Enable or disable a breakpoint. | ||
| 947 | |||
| 948 | @item Mouse-3 | ||
| 949 | Continue execution to here. | ||
| 950 | |||
| 951 | @item C-Mouse-3 | ||
| 952 | Jump to here. | ||
| 953 | @end table | ||
| 954 | |||
| 955 | If the variable @code{gdb-find-source-frame} is non-@code{nil} and | ||
| 956 | execution stops in a frame for which there is no source code e.g after | ||
| 957 | an interrupt, then Emacs finds and displays the first frame further up | ||
| 958 | stack for which there is source. If it is @code{nil} then the source | ||
| 959 | buffer continues to display the last frame which maybe more useful, | ||
| 960 | for example, when re-setting a breakpoint. | ||
| 961 | |||
| 907 | @node Breakpoints Buffer | 962 | @node Breakpoints Buffer |
| 908 | @subsubsection Breakpoints Buffer | 963 | @subsubsection Breakpoints Buffer |
| 909 | 964 | ||
| @@ -918,7 +973,7 @@ breakpoint}, the breakpoint which point is on. | |||
| 918 | @findex gdb-toggle-breakpoint | 973 | @findex gdb-toggle-breakpoint |
| 919 | Enable/disable the current breakpoint (@code{gdb-toggle-breakpoint}). | 974 | Enable/disable the current breakpoint (@code{gdb-toggle-breakpoint}). |
| 920 | On a graphical display, this changes the color of a bullet in the | 975 | On a graphical display, this changes the color of a bullet in the |
| 921 | margin of the source buffer at the relevant line. This is red when | 976 | margin of a source buffer at the relevant line. This is red when |
| 922 | the breakpoint is enabled and grey when it is disabled. Text-only | 977 | the breakpoint is enabled and grey when it is disabled. Text-only |
| 923 | terminals correspondingly display a @samp{B} or @samp{b}. | 978 | terminals correspondingly display a @samp{B} or @samp{b}. |
| 924 | 979 | ||
| @@ -946,34 +1001,35 @@ of the nested subroutine calls (@dfn{stack frames}) now active in the | |||
| 946 | program. @xref{Backtrace,, Backtraces, gdb, The GNU debugger}. | 1001 | program. @xref{Backtrace,, Backtraces, gdb, The GNU debugger}. |
| 947 | 1002 | ||
| 948 | @findex gdb-frames-select | 1003 | @findex gdb-frames-select |
| 949 | The selected frame number is displayed in reverse contrast. To | 1004 | An arrow in the fringe points to the selected frame or, if the fringe is |
| 950 | select a frame in GDB, move point in the stack buffer to that stack | 1005 | not present, the number of the selected frame is displayed in reverse |
| 951 | frame and type @key{RET} (@code{gdb-frames-select}), or click | 1006 | contrast. To select a frame in GDB, move point in the stack buffer to |
| 1007 | that stack frame and type @key{RET} (@code{gdb-frames-select}), or click | ||
| 952 | @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, |
| 953 | selecting a stack frame updates it to display the local variables of | 1009 | selecting a stack frame updates it to display the local variables of the |
| 954 | the new frame. | 1010 | new frame. |
| 955 | 1011 | ||
| 956 | @node Other GDB User Interface Buffers | 1012 | @node Other GDB-UI Buffers |
| 957 | @subsubsection Other Buffers | 1013 | @subsubsection Other Buffers |
| 958 | 1014 | ||
| 959 | @table @asis | 1015 | @table @asis |
| 960 | @item Input/Output Buffer | 1016 | @item Input/Output Buffer |
| 961 | @vindex gdb-use-separate-io-buffer | 1017 | @vindex gdb-use-separate-io-buffer |
| 962 | If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil}, | 1018 | If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil}, |
| 963 | the executable program that is being debugged takes its input and | 1019 | the program being debugged takes its input and displays its output |
| 964 | displays its output here. Otherwise it uses the GUD buffer for that. | 1020 | here. Otherwise it uses the GUD buffer for that. To toggle whether |
| 965 | To toggle whether GUD mode uses this buffer, do @kbd{M-x | 1021 | GUD mode uses this buffer, do @kbd{M-x gdb-use-separate-io-buffer}. |
| 966 | gdb-use-separate-io-buffer}. That takes effect when you next | 1022 | This takes effect when you next restart the program you are debugging. |
| 967 | restart the program you are debugging. | ||
| 968 | 1023 | ||
| 969 | The history and replay commands from Shell mode are available here, | 1024 | The history and replay commands from Shell mode are available here, |
| 970 | as are the commands to send signals to the program you are debugging. | 1025 | as are the commands to send signals to the debugged program. |
| 971 | @xref{Shell Mode}. | 1026 | @xref{Shell Mode}. |
| 972 | 1027 | ||
| 973 | @item Locals Buffer | 1028 | @item Locals Buffer |
| 974 | The locals buffer displays the values of local variables of the | 1029 | The locals buffer displays the values of local variables of the |
| 975 | current frame for simple data types (@pxref{Frame Info, Frame Info, | 1030 | current frame for simple data types (@pxref{Frame Info, Frame Info, |
| 976 | Information on a frame, gdb, The GNU debugger}). | 1031 | Information on a frame, gdb, The GNU debugger}). Press @key{RET} or |
| 1032 | click @kbd{Mouse-2} on the value if you want to edit it. | ||
| 977 | 1033 | ||
| 978 | Arrays and structures display their type only. With GDB 6.4 or later, | 1034 | Arrays and structures display their type only. With GDB 6.4 or later, |
| 979 | move point to their name and press @key{RET}, or alternatively click | 1035 | move point to their name and press @key{RET}, or alternatively click |
| @@ -985,7 +1041,7 @@ of GDB, use @kbd{Mouse-2} or @key{RET} on the type description | |||
| 985 | @findex toggle-gdb-all-registers | 1041 | @findex toggle-gdb-all-registers |
| 986 | The registers buffer displays the values held by the registers | 1042 | The registers buffer displays the values held by the registers |
| 987 | (@pxref{Registers,,, gdb, The GNU debugger}). Press @key{RET} or | 1043 | (@pxref{Registers,,, gdb, The GNU debugger}). Press @key{RET} or |
| 988 | click @kbd{Mouse-2} on a register if you want to change its value. | 1044 | click @kbd{Mouse-2} on a register if you want to edit its value. |
| 989 | With GDB 6.4 or later, recently changed register values display with | 1045 | With GDB 6.4 or later, recently changed register values display with |
| 990 | @code{font-lock-warning-face}. With earlier versions of GDB, you can | 1046 | @code{font-lock-warning-face}. With earlier versions of GDB, you can |
| 991 | press @key{SPC} to toggle the display of floating point registers | 1047 | press @key{SPC} to toggle the display of floating point registers |
| @@ -1003,10 +1059,10 @@ The threads buffer displays a summary of all threads currently in your | |||
| 1003 | program (@pxref{Threads, Threads, Debugging programs with multiple | 1059 | program (@pxref{Threads, Threads, Debugging programs with multiple |
| 1004 | threads, gdb, The GNU debugger}). Move point to any thread in the | 1060 | threads, gdb, The GNU debugger}). Move point to any thread in the |
| 1005 | list and press @key{RET} to select it (@code{gdb-threads-select}) and | 1061 | list and press @key{RET} to select it (@code{gdb-threads-select}) and |
| 1006 | display the associated source in the source buffer. Alternatively, | 1062 | display the associated source in the primary source buffer. |
| 1007 | click @kbd{Mouse-2} on a thread to select it. If the locals buffer is | 1063 | Alternatively, click @kbd{Mouse-2} on a thread to select it. If the |
| 1008 | visible, its contents update to display the variables that are local | 1064 | locals buffer is visible, its contents update to display the variables |
| 1009 | in the new thread. | 1065 | that are local in the new thread. |
| 1010 | 1066 | ||
| 1011 | @item Memory Buffer | 1067 | @item Memory Buffer |
| 1012 | The memory buffer lets you examine sections of program memory | 1068 | The memory buffer lets you examine sections of program memory |
| @@ -1017,49 +1073,6 @@ displays. Click @kbd{Mouse-3} on the header line to select the | |||
| 1017 | display format or unit size for these data items. | 1073 | display format or unit size for these data items. |
| 1018 | @end table | 1074 | @end table |
| 1019 | 1075 | ||
| 1020 | @node GDB commands in the Fringe | ||
| 1021 | @subsubsection GDB commands in the Fringe | ||
| 1022 | @cindex GDB commands in the Fringe | ||
| 1023 | |||
| 1024 | @c @findex gdb-mouse-set-clear-breakpoint | ||
| 1025 | @c @findex gdb-mouse-toggle-breakpoint | ||
| 1026 | Many GDB commands can be entered using keybindings or the tool bar but | ||
| 1027 | sometimes it is quicker to use the fringe. These commands either | ||
| 1028 | manipulate breakpoints or control program execution. When there is no | ||
| 1029 | fringe, you can use the margin but this is only present when the | ||
| 1030 | source file already has a breakpoint. | ||
| 1031 | |||
| 1032 | You can click @kbd{Mouse-1} in the fringe or display margin of a | ||
| 1033 | source buffer to set a breakpoint there and, on a graphical display, a | ||
| 1034 | red bullet will appear on that line. If a breakpoint already exists | ||
| 1035 | on that line, the same click will remove it. You can also enable or | ||
| 1036 | disable a breakpoint by clicking @kbd{C-Mouse-1} on the bullet. | ||
| 1037 | |||
| 1038 | If you drag the debugger arrow in the fringe with @kbd{Mouse-1} | ||
| 1039 | (@code{gdb-mouse-until}), execution will continue to the line where | ||
| 1040 | you release the button, provided it is still in the same frame. | ||
| 1041 | Alternatively, you can click @kbd{Mouse-3} at some point in the fringe | ||
| 1042 | of this buffer and execution will advance to there. A similar command | ||
| 1043 | (@code{gdb-mouse-jump}) allows you to jump to a source line without | ||
| 1044 | executing the intermediate lines by clicking @kbd{C-Mouse-3}. This | ||
| 1045 | command allows you to go backwards which can be useful for running | ||
| 1046 | through code that has already executed, in order to examine its | ||
| 1047 | execution in more detail. | ||
| 1048 | |||
| 1049 | @table @kbd | ||
| 1050 | @item Mouse-1 | ||
| 1051 | Set or clear a breakpoint. | ||
| 1052 | |||
| 1053 | @item C-Mouse-1 | ||
| 1054 | Enable or disable a breakpoint. | ||
| 1055 | |||
| 1056 | @item Mouse-3 | ||
| 1057 | Continue execution to here. | ||
| 1058 | |||
| 1059 | @item C-Mouse-3 | ||
| 1060 | Jump to here. | ||
| 1061 | @end table | ||
| 1062 | |||
| 1063 | @node Watch Expressions | 1076 | @node Watch Expressions |
| 1064 | @subsubsection Watch Expressions | 1077 | @subsubsection Watch Expressions |
| 1065 | @cindex Watching expressions in GDB | 1078 | @cindex Watching expressions in GDB |
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 |
| 1014 | Specify the size @var{width} and @var{height} (measured in character | 1014 | Specify the size @var{width} and @var{height} (measured in character |
| 1015 | columns and lines), and positions @var{xoffset} and @var{yoffset} | 1015 | columns 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 |
| 1017 | apply to all frames, whereas @var{xoffset} and @var{yoffset} only to | ||
| 1018 | the initial frame. | ||
| 1017 | 1019 | ||
| 1018 | @item -fs | 1020 | @item -fs |
| 1019 | @opindex -fs | 1021 | @opindex -fs |
diff --git a/man/custom.texi b/man/custom.texi index dbe2a1b328c..682cb5b9310 100644 --- a/man/custom.texi +++ b/man/custom.texi | |||
| @@ -2063,9 +2063,8 @@ Reference Manual}. | |||
| 2063 | @cindex rebinding keys, permanently | 2063 | @cindex rebinding keys, permanently |
| 2064 | @cindex startup (init file) | 2064 | @cindex startup (init file) |
| 2065 | 2065 | ||
| 2066 | When Emacs is started, it normally loads a Lisp program from the | 2066 | When Emacs is started, it normally loads a Lisp program from the file |
| 2067 | file @file{.emacs} or @file{.emacs.el} in your home directory | 2067 | @file{.emacs} or @file{.emacs.el} in your home directory (@pxref{Find Init}). |
| 2068 | (see @ref{General Variables, HOME}, if you don't know where that is). | ||
| 2069 | We call this file your @dfn{init file} because it specifies how to | 2068 | We call this file your @dfn{init file} because it specifies how to |
| 2070 | initialize Emacs for you. You can use the command line switch | 2069 | initialize Emacs for you. You can use the command line switch |
| 2071 | @samp{-q} to prevent loading your init file, and @samp{-u} (or | 2070 | @samp{-q} to prevent loading your init file, and @samp{-u} (or |
diff --git a/man/dired.texi b/man/dired.texi index 97597ffcd81..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 |
| 326 | file with some other character (usually @samp{*}). Most Dired | 326 | file with some other character (usually @samp{*}). Most Dired |
| 327 | commands to operate on files use the files marked with @samp{*}. The | 327 | commands to operate on files use the files marked with @samp{*}. The |
| 328 | only command that operates on flagged flies is @kbd{x}, which expunges | 328 | only command that operates on flagged files is @kbd{x}, which expunges |
| 329 | them. | 329 | them. |
| 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 |
| @@ -550,34 +550,38 @@ next window, that other buffer's directory is suggested instead. | |||
| 550 | @item C @var{new} @key{RET} | 550 | @item C @var{new} @key{RET} |
| 551 | Copy the specified files (@code{dired-do-copy}). The argument @var{new} | 551 | Copy the specified files (@code{dired-do-copy}). The argument @var{new} |
| 552 | is the directory to copy into, or (if copying a single file) the new | 552 | is the directory to copy into, or (if copying a single file) the new |
| 553 | name. | 553 | name. This is like the shell command @code{cp}. |
| 554 | 554 | ||
| 555 | @vindex dired-copy-preserve-time | 555 | @vindex dired-copy-preserve-time |
| 556 | If @code{dired-copy-preserve-time} is non-@code{nil}, then copying | 556 | If @code{dired-copy-preserve-time} is non-@code{nil}, then copying |
| 557 | with this command preserves the modification time of the old file in | 557 | with this command preserves the modification time of the old file in |
| 558 | the copy. | 558 | the copy, like @samp{cp -p}. |
| 559 | 559 | ||
| 560 | @vindex dired-recursive-copies | 560 | @vindex dired-recursive-copies |
| 561 | @cindex recursive copying | 561 | @cindex recursive copying |
| 562 | The variable @code{dired-recursive-copies} controls whether to copy | 562 | The variable @code{dired-recursive-copies} controls whether to copy |
| 563 | directories recursively. The default is @code{nil}, which means that | 563 | directories recursively (like @samp{cp -r}). The default is |
| 564 | directories cannot be copied. | 564 | @code{nil}, which means that directories cannot be copied. |
| 565 | 565 | ||
| 566 | @item D | 566 | @item D |
| 567 | @findex dired-do-delete | 567 | @findex dired-do-delete |
| 568 | @kindex D @r{(Dired)} | 568 | @kindex D @r{(Dired)} |
| 569 | Delete the specified files (@code{dired-do-delete}). Like the other | 569 | Delete the specified files (@code{dired-do-delete}). This is like the |
| 570 | commands in this section, this command operates on the @emph{marked} | 570 | shell command @code{rm}. |
| 571 | files, or the next @var{n} files. By contrast, @kbd{x} | 571 | |
| 572 | Like the other commands in this section, this command operates on the | ||
| 573 | @emph{marked} files, or the next @var{n} files. By contrast, @kbd{x} | ||
| 572 | (@code{dired-do-flagged-delete}) deletes all @dfn{flagged} files. | 574 | (@code{dired-do-flagged-delete}) deletes all @dfn{flagged} files. |
| 573 | 575 | ||
| 574 | @findex dired-do-rename | 576 | @findex dired-do-rename |
| 575 | @kindex R @r{(Dired)} | 577 | @kindex R @r{(Dired)} |
| 576 | @cindex renaming files (in Dired) | 578 | @cindex renaming files (in Dired) |
| 579 | @cindex moving files (in Dired) | ||
| 577 | @item R @var{new} @key{RET} | 580 | @item R @var{new} @key{RET} |
| 578 | Rename the specified files (@code{dired-do-rename}). The argument | 581 | Rename the specified files (@code{dired-do-rename}). If you rename a |
| 579 | @var{new} is the directory to rename into, or (if renaming a single | 582 | single file, the argument @var{new} is the new name of the file. If |
| 580 | file) the new name. | 583 | you rename several files, the argument @var{new} is the directory into |
| 584 | which to move the files (this is like the shell command @code{mv}). | ||
| 581 | 585 | ||
| 582 | Dired automatically changes the visited file name of buffers associated | 586 | Dired automatically changes the visited file name of buffers associated |
| 583 | with renamed files so that they refer to the new names. | 587 | with renamed files so that they refer to the new names. |
| @@ -586,17 +590,19 @@ with renamed files so that they refer to the new names. | |||
| 586 | @kindex H @r{(Dired)} | 590 | @kindex H @r{(Dired)} |
| 587 | @cindex hard links (in Dired) | 591 | @cindex hard links (in Dired) |
| 588 | @item H @var{new} @key{RET} | 592 | @item H @var{new} @key{RET} |
| 589 | Make hard links to the specified files (@code{dired-do-hardlink}). The | 593 | Make hard links to the specified files (@code{dired-do-hardlink}). |
| 590 | argument @var{new} is the directory to make the links in, or (if making | 594 | This is like the shell command @code{ln}. The argument @var{new} is |
| 591 | just one link) the name to give the link. | 595 | the directory to make the links in, or (if making just one link) the |
| 596 | name to give the link. | ||
| 592 | 597 | ||
| 593 | @findex dired-do-symlink | 598 | @findex dired-do-symlink |
| 594 | @kindex S @r{(Dired)} | 599 | @kindex S @r{(Dired)} |
| 595 | @cindex symbolic links (creation in Dired) | 600 | @cindex symbolic links (creation in Dired) |
| 596 | @item S @var{new} @key{RET} | 601 | @item S @var{new} @key{RET} |
| 597 | Make symbolic links to the specified files (@code{dired-do-symlink}). | 602 | Make symbolic links to the specified files (@code{dired-do-symlink}). |
| 598 | The argument @var{new} is the directory to make the links in, or (if | 603 | This is like @samp{ln -s}. The argument @var{new} is the directory to |
| 599 | making just one link) the name to give the link. | 604 | make the links in, or (if making just one link) the name to give the |
| 605 | link. | ||
| 600 | 606 | ||
| 601 | @findex dired-do-chmod | 607 | @findex dired-do-chmod |
| 602 | @kindex M @r{(Dired)} | 608 | @kindex M @r{(Dired)} |
| @@ -631,7 +637,8 @@ different places). | |||
| 631 | @cindex changing file time (in Dired) | 637 | @cindex changing file time (in Dired) |
| 632 | @item T @var{timestamp} @key{RET} | 638 | @item T @var{timestamp} @key{RET} |
| 633 | Touch the specified files (@code{dired-do-touch}). This means | 639 | Touch the specified files (@code{dired-do-touch}). This means |
| 634 | updating their modification times to the present time. | 640 | updating their modification times to the present time. This is like |
| 641 | the shell command @code{touch}. | ||
| 635 | 642 | ||
| 636 | @findex dired-do-print | 643 | @findex dired-do-print |
| 637 | @kindex P @r{(Dired)} | 644 | @kindex P @r{(Dired)} |
diff --git a/man/display.texi b/man/display.texi index 57276ac7557..2a0abd4bef6 100644 --- a/man/display.texi +++ b/man/display.texi | |||
| @@ -1215,6 +1215,17 @@ page for other output. On such terminals, you might want to set the variable | |||
| 1215 | assume, when resumed, that the screen page it is using still contains | 1215 | assume, when resumed, that the screen page it is using still contains |
| 1216 | what Emacs last wrote there. | 1216 | what Emacs last wrote there. |
| 1217 | 1217 | ||
| 1218 | @vindex overline-margin | ||
| 1219 | On graphical display, this variables specifies the number of pixes | ||
| 1220 | the overline is shown above the text. The value includes the height of | ||
| 1221 | the overline itself (1 pixel). The default value is 2 pixels. | ||
| 1222 | |||
| 1223 | @vindex x-underline-at-descent-line | ||
| 1224 | On graphical display, the underline is normally drawn at the | ||
| 1225 | baseline level of the font. If @code{x-underline-at-descent-line} is | ||
| 1226 | non-@code{nil}, the underline is drawn at the same position as the | ||
| 1227 | font's decent line. | ||
| 1228 | |||
| 1218 | @ignore | 1229 | @ignore |
| 1219 | arch-tag: 2219f910-2ff0-4521-b059-1bd231a536c4 | 1230 | arch-tag: 2219f910-2ff0-4521-b059-1bd231a536c4 |
| 1220 | @end ignore | 1231 | @end ignore |
diff --git a/man/emacs.texi b/man/emacs.texi index a5c8371c7db..b2f028052e5 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/entering.texi b/man/entering.texi index bef6a5a4db0..dca85d44812 100644 --- a/man/entering.texi +++ b/man/entering.texi | |||
| @@ -69,20 +69,19 @@ already running Emacs. @xref{Emacs Server}. | |||
| 69 | @cindex leaving Emacs | 69 | @cindex leaving Emacs |
| 70 | @cindex quitting Emacs | 70 | @cindex quitting Emacs |
| 71 | 71 | ||
| 72 | There are two commands for exiting Emacs, and three kinds of exiting: | 72 | There are two commands for exiting Emacs, and three kinds of |
| 73 | @dfn{suspending} Emacs, @dfn{Iconifying} Emacs, and @dfn{killing} | 73 | exiting: @dfn{iconifying} Emacs, @dfn{suspending} Emacs, and |
| 74 | Emacs. | 74 | @dfn{killing} Emacs. |
| 75 | 75 | ||
| 76 | @dfn{Suspending} means stopping Emacs temporarily and returning | 76 | @dfn{Iconifying} means replacing the Emacs frame with a small box or |
| 77 | control to its parent process (usually a shell), allowing you to resume | 77 | ``icon'' on the screen. This is the usual way to exit Emacs when |
| 78 | editing later in the same Emacs job, with the same buffers, same kill | 78 | you're using a graphical display---if you bother to ``exit'' at all. |
| 79 | ring, same undo history, and so on. This is the usual way to exit Emacs | 79 | (Just switching to another application is usually sufficient.) |
| 80 | when running on a text terminal. | ||
| 81 | 80 | ||
| 82 | @dfn{Iconifying} means replacing the Emacs frame with a small box | 81 | @dfn{Suspending} means stopping Emacs temporarily and returning |
| 83 | somewhere on the screen. This is the usual way to exit Emacs when you're | 82 | control to its parent process (usually a shell), allowing you to |
| 84 | using a graphics terminal---if you bother to ``exit'' at all. (Just switching | 83 | resume editing later in the same Emacs job. This is the usual way to |
| 85 | to another application is usually sufficient.) | 84 | exit Emacs when running it on a text terminal. |
| 86 | 85 | ||
| 87 | @dfn{Killing} Emacs means destroying the Emacs job. You can run Emacs | 86 | @dfn{Killing} Emacs means destroying the Emacs job. You can run Emacs |
| 88 | again later, but you will get a fresh Emacs; there is no way to resume | 87 | again later, but you will get a fresh Emacs; there is no way to resume |
| @@ -97,12 +96,18 @@ Kill Emacs (@code{save-buffers-kill-emacs}). | |||
| 97 | @end table | 96 | @end table |
| 98 | 97 | ||
| 99 | @kindex C-z | 98 | @kindex C-z |
| 100 | @findex suspend-emacs | 99 | @findex iconify-or-deiconify-frame |
| 101 | To suspend or iconify Emacs, type @kbd{C-z} (@code{suspend-emacs}). | 100 | On graphical displays, @kbd{C-z} runs the command |
| 102 | On text terminals, this suspends Emacs. On graphical displays, | 101 | @code{iconify-or-deiconify-frame}, which temporarily iconifies (or |
| 103 | it iconifies the Emacs frame. | 102 | ``minimizes'') the selected Emacs frame (@pxref{Frames}). You can |
| 103 | then use the window manager to select some other application. (You | ||
| 104 | could select another application without iconifying Emacs first, but | ||
| 105 | getting the Emacs frame out of the way can make it more convenient to | ||
| 106 | find the other application.) | ||
| 104 | 107 | ||
| 105 | Suspending Emacs takes you back to the shell from which you invoked | 108 | @findex suspend-emacs |
| 109 | On a text terminal, @kbd{C-z} runs the command @code{suspend-emacs}. | ||
| 110 | Suspending Emacs takes you back to the shell from which you invoked | ||
| 106 | Emacs. You can resume Emacs with the shell command @command{%emacs} | 111 | Emacs. You can resume Emacs with the shell command @command{%emacs} |
| 107 | in most common shells. On systems that don't support suspending | 112 | in most common shells. On systems that don't support suspending |
| 108 | programs, @kbd{C-z} starts an inferior shell that communicates | 113 | programs, @kbd{C-z} starts an inferior shell that communicates |
| @@ -112,19 +117,12 @@ subshell. (The way to do that is probably with @kbd{C-d} or | |||
| 112 | systems, you can only get back to the shell from which Emacs was run | 117 | systems, you can only get back to the shell from which Emacs was run |
| 113 | (to log out, for example) when you kill Emacs. | 118 | (to log out, for example) when you kill Emacs. |
| 114 | 119 | ||
| 120 | @vindex cannot-suspend | ||
| 115 | Suspending can fail if you run Emacs under a shell that doesn't | 121 | Suspending can fail if you run Emacs under a shell that doesn't |
| 116 | support suspending programs, even if the system itself does support | 122 | support suspendion of its subjobs, even if the system itself does |
| 117 | it. In such a case, you can set the variable @code{cannot-suspend} to | 123 | support it. In such a case, you can set the variable |
| 118 | a non-@code{nil} value to force @kbd{C-z} to start an inferior shell. | 124 | @code{cannot-suspend} to a non-@code{nil} value to force @kbd{C-z} to |
| 119 | (One might also describe Emacs's parent shell as ``inferior'' for | 125 | start an inferior shell. |
| 120 | failing to support job control properly, but that is a matter of | ||
| 121 | taste.) | ||
| 122 | |||
| 123 | On graphical displays, @kbd{C-z} has a different meaning: it runs | ||
| 124 | the command @code{iconify-or-deiconify-frame}, which temporarily | ||
| 125 | iconifies (or ``minimizes'') the selected Emacs frame | ||
| 126 | (@pxref{Frames}). Then you can use the window manager to get back to | ||
| 127 | a shell window. | ||
| 128 | 126 | ||
| 129 | @kindex C-x C-c | 127 | @kindex C-x C-c |
| 130 | @findex save-buffers-kill-emacs | 128 | @findex save-buffers-kill-emacs |
diff --git a/man/erc.texi b/man/erc.texi index 29b0f059722..c4317f11511 100644 --- a/man/erc.texi +++ b/man/erc.texi | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | @syncodeindex fn cp | 12 | @syncodeindex fn cp |
| 13 | 13 | ||
| 14 | @copying | 14 | @copying |
| 15 | This manual is for ERC version 5.1.3. | 15 | This manual is for ERC version 5.1.4. |
| 16 | 16 | ||
| 17 | Copyright @copyright{} 2005, 2006 Free Software Foundation, Inc. | 17 | Copyright @copyright{} 2005, 2006 Free Software Foundation, Inc. |
| 18 | 18 | ||
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 |
| 1151 | Font-lock mode, auto-compression mode, and file name shadow mode are now | 1150 | Font Lock mode, auto-compression mode, and file name shadow mode are now |
| 1152 | enabled by default. It is now possible to follow links with | 1151 | enabled by default. On graphics displays it is now possible to follow |
| 1153 | @kbd{mouse-1}. | 1152 | links with @kbd{mouse-1}, and the modeline of the selected window is now |
| 1154 | 1153 | highlighted. Window fringes are now customizable. The minibuffer | |
| 1155 | @cindex Supported systems | 1154 | prompt is now displayed in a distinct face. |
| 1156 | Emacs 22 features support for GNU/Linux systems on S390 and X86-64 | 1155 | |
| 1157 | machines, as well as support for the Mac OS X and Cygwin operating | 1156 | Emacs now reads abbrev definitions automatically at startup. The |
| 1158 | systems. | 1157 | maximum size of buffers has been doubled and is now 256M on 32-bit |
| 1158 | machines. Grep mode is now separate from Compilation mode and has many | ||
| 1159 | new specific options and commands. | ||
| 1160 | |||
| 1161 | The original Emacs macro system has been replaced by the new Kmacro | ||
| 1162 | package, which provides many new commands and features and a simple | ||
| 1163 | interface that uses the function keys F3 and F4. Macros are now stored | ||
| 1164 | in a macro ring, and can be debugged and edited interactively. | ||
| 1165 | |||
| 1166 | The GUD (Grand Unified Debugger) package can now be used with a full | ||
| 1167 | graphical user interface to the debugger which provides many features | ||
| 1168 | found in traditional development environments, making it easy to | ||
| 1169 | manipulate breakpoints, add watch points, display the call stack, etc. | ||
| 1170 | Breakpoints 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 | |||
| 1164 | operation on X. Mouse wheel support is now enabled by default. | 1176 | operation on X. Mouse wheel support is now enabled by default. |
| 1165 | 1177 | ||
| 1166 | @cindex New modes | 1178 | @cindex New modes |
| 1167 | Many new modes and packages have been included in Emacs, such as Leim, | 1179 | Many new modes and packages have been included in Emacs, such as Calc, |
| 1168 | Calc, Tramp and URL, as well as IDO, CUA, rcirc, ERC, conf-mode, | 1180 | Tramp and URL, as well as IDO, CUA, rcirc, ERC, conf-mode, python-mode, |
| 1169 | python-mode, table, tumme, SES, ruler, Flymake, Org, PGG, etc. | 1181 | table, tumme, SES, ruler, Flymake, Org, PGG, wdired, t-mouse, longlines, |
| 1182 | dns-mode, savehist, Password, Printing, Reveal, etc. | ||
| 1183 | |||
| 1184 | @cindex Multilingual Environment | ||
| 1185 | Leim is now part of Emacs. Unicode support has been much improved, and | ||
| 1186 | the following input methods have been added: belarusian, bulgarian-bds, | ||
| 1187 | bulgarian-phonetic, chinese-sisheng, croatian, dutch, georgian, | ||
| 1188 | latin-alt-postfix, latin-postfix, latin-prefix, latvian-keyboard, | ||
| 1189 | lithuanian-numeric, lithuanian-keyboard, malayalam-inscript, rfc1345, | ||
| 1190 | russian-computer, sgml, slovenian, tamil-inscript ucs, | ||
| 1191 | ukrainian-computer, vietnamese-telex, and welsh. | ||
| 1192 | |||
| 1193 | The following language environment have also been added: Belarusian, | ||
| 1194 | Bulgarian, Chinese-EUC-TW, Croatian, French, Georgian, Italian, Latin-6, | ||
| 1195 | Latin-7, Latvian, Lithuanian, Malayalam, Russian, Russian, Slovenian, | ||
| 1196 | Swedish, Tajik, Tamil, UTF-8, Ukrainian, Ukrainian, Welsh, and | ||
| 1197 | Windows-1255. | ||
| 1198 | |||
| 1199 | @cindex Supported systems | ||
| 1200 | Emacs 22 features support for GNU/Linux systems on S390 and x86-64 | ||
| 1201 | machines, as well as support for the Mac OS X and Cygwin operating | ||
| 1202 | systems. | ||
| 1170 | 1203 | ||
| 1171 | @cindex Documentation | 1204 | @cindex Documentation |
| 1172 | @cindex Emacs Lisp Manual | 1205 | @cindex Emacs Lisp Manual |
| 1173 | In addition, Emacs 22 now includes the Emacs Lisp Reference Manual | 1206 | In 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 | ||
| 1209 | Many other changes have been made in Emacs 22, use @kbd{C-h n} to get a | ||
| 1210 | full 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 | |||
| 4876 | Enhancement to Emacs. @xref{Installing Emacs}, for information on where | 4913 | Enhancement to Emacs. @xref{Installing Emacs}, for information on where |
| 4877 | to find and download the latest version of Emacs. | 4914 | to 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. |
| 4897 | Joel has a screen font for PCs running MS-DOS or GNU/Linux. | 4934 | Joel has a screen font for PCs running MS-DOS or GNU/Linux. |
| 4898 | 4935 | ||
| 4899 | You might also try to query archie for files named with @file{hebrew}; | 4936 | You might also try querying @code{archie} for files named with |
| 4900 | several ftp sites in Israel may also have the necessary files. | 4937 | @file{hebrew}; several ftp sites in Israel may also have the necessary |
| 4938 | files. | ||
| 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 | |||
| 4945 | First, download and install the BDF font files and any auxiliary | ||
| 4946 | packages they need. The GNU Intlfonts distribution can be found on | ||
| 4947 | @uref{http://directory.fsf.org/localization/intlfonts.html, the GNU | ||
| 4948 | Software Directory Web site}. | ||
| 4949 | |||
| 4950 | Next, if you are on X Window system, issue the following two commands | ||
| 4951 | from 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 | ||
| 4960 | that is not @file{/usr/local/share/emacs/fonts}.) You also need to | ||
| 4961 | arrange for these two commands to run whenever you log in, e.g., by | ||
| 4962 | adding them to your window-system startup file, such as | ||
| 4963 | @file{~/.xsessionrc} or @file{~/.gnomerc}. | ||
| 4964 | |||
| 4965 | Now, 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 | |||
| 4974 | Finally, if you wish to use the installed fonts with @code{ps-print}, | ||
| 4975 | add the following line to your @file{~/.emacs}: | ||
| 4976 | |||
| 4977 | @lisp | ||
| 4978 | (setq ps-multibyte-buffer 'bdf-font-except-latin) | ||
| 4979 | @end lisp | ||
| 4980 | |||
| 4981 | A few additional steps are necessary for MS-Windows; they are listed | ||
| 4982 | below. | ||
| 4983 | |||
| 4984 | First, make sure @emph{all} the directories with BDF font files are | ||
| 4985 | mentioned in @code{bdf-directory-list}. On Unix and GNU/Linux | ||
| 4986 | systems, one normally runs @kbd{make install} to install the BDF fonts | ||
| 4987 | in the same directory. By contrast, Windows users typically don't run | ||
| 4988 | the Intlfonts installation command, but unpack the distribution in | ||
| 4989 | some directory, which leaves the BDF fonts in its subdirectories. For | ||
| 4990 | example, assume that you unpacked Intlfonts in @file{C:/Intlfonts}; | ||
| 4991 | then 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} | ||
| 5006 | Next, you need to set up the variable @code{w32-bdf-filename-alist} to | ||
| 5007 | an alist of the BDF fonts and their corresponding file names. | ||
| 5008 | Assuming you have set @code{bdf-directory-list} to name all the | ||
| 5009 | directories with the BDF font files, the following Lisp snippet will | ||
| 5010 | set 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 | |||
| 5017 | Now, 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 | |||
| 5033 | Many of the international bdf fonts from Intlfonts are type 0, and | ||
| 5034 | therefore 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 | |||
| 5050 | You can now use the Emacs font menu to select the @samp{bdf: 16-dot medium} | ||
| 5051 | fontset, 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/gnus.texi b/man/gnus.texi index 9092999dfc9..6e350bc4517 100644 --- a/man/gnus.texi +++ b/man/gnus.texi | |||
| @@ -9372,11 +9372,15 @@ default is @code{nil}. | |||
| 9372 | 9372 | ||
| 9373 | @item gnus-article-emulate-mime | 9373 | @item gnus-article-emulate-mime |
| 9374 | @vindex gnus-article-emulate-mime | 9374 | @vindex gnus-article-emulate-mime |
| 9375 | @cindex uuencode | ||
| 9376 | @cindex yEnc | ||
| 9375 | There are other, non-@acronym{MIME} encoding methods used. The most common | 9377 | There are other, non-@acronym{MIME} encoding methods used. The most common |
| 9376 | is @samp{uuencode}, but yEncode is also getting to be popular. If | 9378 | is @samp{uuencode}, but yEncode is also getting to be popular. If |
| 9377 | this variable is non-@code{nil}, Gnus will look in message bodies to | 9379 | this variable is non-@code{nil}, Gnus will look in message bodies to |
| 9378 | see if it finds these encodings, and if so, it'll run them through the | 9380 | see if it finds these encodings, and if so, it'll run them through the |
| 9379 | Gnus @acronym{MIME} machinery. The default is @code{t}. | 9381 | Gnus @acronym{MIME} machinery. The default is @code{t}. Only |
| 9382 | single-part yEnc encoded attachments can be decoded. There's no support | ||
| 9383 | for encoding in Gnus. | ||
| 9380 | 9384 | ||
| 9381 | @item gnus-unbuttonized-mime-types | 9385 | @item gnus-unbuttonized-mime-types |
| 9382 | @vindex gnus-unbuttonized-mime-types | 9386 | @vindex gnus-unbuttonized-mime-types |
| @@ -26075,6 +26079,14 @@ later entry for more information about marks. Note that downgrading | |||
| 26075 | isn't save in general. | 26079 | isn't save in general. |
| 26076 | 26080 | ||
| 26077 | @item | 26081 | @item |
| 26082 | Lisp files are now installed in @file{.../site-lisp/gnus/} by default. | ||
| 26083 | It defaulted to @file{.../site-lisp/} formerly. In addition to this, | ||
| 26084 | the new installer issues a warning if other Gnus installations which | ||
| 26085 | will shadow the latest one are detected. You can then remove those | ||
| 26086 | shadows manually or remove them using @code{make | ||
| 26087 | remove-installed-shadows}. | ||
| 26088 | |||
| 26089 | @item | ||
| 26078 | New @file{make.bat} for compiling and installing Gnus under MS Windows | 26090 | New @file{make.bat} for compiling and installing Gnus under MS Windows |
| 26079 | 26091 | ||
| 26080 | Use @file{make.bat} if you want to install Gnus under MS Windows, the | 26092 | Use @file{make.bat} if you want to install Gnus under MS Windows, the |
diff --git a/man/help.texi b/man/help.texi index 47600b711fa..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') |
| @@ -251,6 +251,8 @@ name is defined as a Lisp function. Type @kbd{C-g} to cancel the | |||
| 251 | @kbd{C-h f} command if you don't really want to view the | 251 | @kbd{C-h f} command if you don't really want to view the |
| 252 | documentation. | 252 | documentation. |
| 253 | 253 | ||
| 254 | @kindex C-h v | ||
| 255 | @findex describe-variable | ||
| 254 | @kbd{C-h v} (@code{describe-variable}) is like @kbd{C-h f} but | 256 | @kbd{C-h v} (@code{describe-variable}) is like @kbd{C-h f} but |
| 255 | describes Lisp variables instead of Lisp functions. Its default is | 257 | describes Lisp variables instead of Lisp functions. Its default is |
| 256 | the Lisp symbol around or before point, if that is the name of a | 258 | the Lisp symbol around or before point, if that is the name of a |
| @@ -388,6 +390,62 @@ display the most relevant ones first. | |||
| 388 | the variable @code{apropos-documentation-sort-by-scores} is | 390 | the variable @code{apropos-documentation-sort-by-scores} is |
| 389 | @code{nil}, apropos lists the symbols found in alphabetical order. | 391 | @code{nil}, apropos lists the symbols found in alphabetical order. |
| 390 | 392 | ||
| 393 | @node Help Mode | ||
| 394 | @section Help Mode Commands | ||
| 395 | |||
| 396 | Help buffers provide the same commands as View mode (@pxref{Misc File | ||
| 397 | Ops}), plus a few special commands of their own. | ||
| 398 | |||
| 399 | @table @kbd | ||
| 400 | @item @key{SPC} | ||
| 401 | Scroll forward. | ||
| 402 | @item @key{DEL} | ||
| 403 | Scroll backward. | ||
| 404 | @item @key{RET} | ||
| 405 | Follow a cross reference at point. | ||
| 406 | @item @key{TAB} | ||
| 407 | Move point forward to the next cross reference. | ||
| 408 | @item S-@key{TAB} | ||
| 409 | Move point back to the previous cross reference. | ||
| 410 | @item Mouse-1 | ||
| 411 | @itemx Mouse-2 | ||
| 412 | Follow a cross reference that you click on. | ||
| 413 | @item C-c C-c | ||
| 414 | Show all documentation about the symbol at point. | ||
| 415 | @end table | ||
| 416 | |||
| 417 | When a function name (@pxref{M-x,, Running Commands by Name}), | ||
| 418 | variable name (@pxref{Variables}), or face name (@pxref{Faces}) | ||
| 419 | appears in the documentation, it normally appears inside paired | ||
| 420 | single-quotes. To view the documentation of that command, variable or | ||
| 421 | face, you can click on the name with @kbd{Mouse-1} or @kbd{Mouse-2}, | ||
| 422 | or move point there and type @key{RET}. Use @kbd{C-c C-b} to retrace | ||
| 423 | your 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 | ||
| 431 | the @code{browse-url} command to view the page in the browser you | ||
| 432 | choose. @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 | ||
| 439 | the help text. @key{TAB} (@code{help-next-ref}) moves point down to | ||
| 440 | the next cross reference. @kbd{S-@key{TAB}} moves up to the previous | ||
| 441 | cross reference (@code{help-previous-ref}). | ||
| 442 | |||
| 443 | To view all documentation about any symbol name that appears in the | ||
| 444 | text, move point to the symbol name and type @kbd{C-c C-c} | ||
| 445 | (@code{help-follow-symbol}). This shows all available documentation | ||
| 446 | about the symbol as a variable, function and/or face. As above, use | ||
| 447 | @kbd{C-c C-b} to retrace your steps. | ||
| 448 | |||
| 391 | @node Library Keywords | 449 | @node Library Keywords |
| 392 | @section Keyword Search for Lisp Libraries | 450 | @section Keyword Search for Lisp Libraries |
| 393 | 451 | ||
| @@ -458,62 +516,6 @@ input method currently in use. @xref{Input Methods}. | |||
| 458 | coding systems---either a specified coding system, or the ones | 516 | coding systems---either a specified coding system, or the ones |
| 459 | currently in use. @xref{Coding Systems}. | 517 | currently in use. @xref{Coding Systems}. |
| 460 | 518 | ||
| 461 | @node Help Mode | ||
| 462 | @section Help Mode Commands | ||
| 463 | |||
| 464 | Help buffers provide the same commands as View mode (@pxref{Misc File | ||
| 465 | Ops}), plus a few special commands of their own. | ||
| 466 | |||
| 467 | @table @kbd | ||
| 468 | @item @key{SPC} | ||
| 469 | Scroll forward. | ||
| 470 | @item @key{DEL} | ||
| 471 | Scroll backward. | ||
| 472 | @item @key{RET} | ||
| 473 | Follow a cross reference at point. | ||
| 474 | @item @key{TAB} | ||
| 475 | Move point forward to the next cross reference. | ||
| 476 | @item S-@key{TAB} | ||
| 477 | Move point back to the previous cross reference. | ||
| 478 | @item Mouse-1 | ||
| 479 | @itemx Mouse-2 | ||
| 480 | Follow a cross reference that you click on. | ||
| 481 | @item C-c C-c | ||
| 482 | Show all documentation about the symbol at point. | ||
| 483 | @end table | ||
| 484 | |||
| 485 | When a function name (@pxref{M-x,, Running Commands by Name}), | ||
| 486 | variable name (@pxref{Variables}), or face name (@pxref{Faces}) | ||
| 487 | appears in the documentation, it normally appears inside paired | ||
| 488 | single-quotes. To view the documentation of that command, variable or | ||
| 489 | face, you can click on the name with @kbd{Mouse-1} or @kbd{Mouse-2}, | ||
| 490 | or move point there and type @key{RET}. Use @kbd{C-c C-b} to retrace | ||
| 491 | your steps. | ||
| 492 | |||
| 493 | @cindex URL, viewing in help | ||
| 494 | @cindex help, viewing web pages | ||
| 495 | @cindex viewing web pages in help | ||
| 496 | @cindex web pages, viewing in help | ||
| 497 | @findex browse-url | ||
| 498 | You can follow cross references to URLs (web pages) also. This uses | ||
| 499 | the @code{browse-url} command to view the page in the browser you | ||
| 500 | choose. @xref{Browse-URL}. | ||
| 501 | |||
| 502 | @kindex @key{TAB} @r{(Help mode)} | ||
| 503 | @findex help-next-ref | ||
| 504 | @kindex S-@key{TAB} @r{(Help mode)} | ||
| 505 | @findex help-previous-ref | ||
| 506 | There are convenient commands to move point to cross references in | ||
| 507 | the help text. @key{TAB} (@code{help-next-ref}) moves point down to | ||
| 508 | the next cross reference. @kbd{S-@key{TAB}} moves up to the previous | ||
| 509 | cross reference (@code{help-previous-ref}). | ||
| 510 | |||
| 511 | To view all documentation about any symbol name that appears in the | ||
| 512 | text, move point to the symbol name and type @kbd{C-c C-c} | ||
| 513 | (@code{help-follow-symbol}). This shows all available documentation | ||
| 514 | about the symbol as a variable, function and/or face. As above, use | ||
| 515 | @kbd{C-c C-b} to retrace your steps. | ||
| 516 | |||
| 517 | @node Misc Help | 519 | @node Misc Help |
| 518 | @section Other Help Commands | 520 | @section Other Help Commands |
| 519 | 521 | ||
diff --git a/man/mark.texi b/man/mark.texi index cf7b87366e8..2736dccd297 100644 --- a/man/mark.texi +++ b/man/mark.texi | |||
| @@ -139,21 +139,23 @@ have a text terminal where typing @kbd{C-@key{SPC}} does not produce | |||
| 139 | On a terminal that supports colors, Emacs has the ability to | 139 | On a terminal that supports colors, Emacs has the ability to |
| 140 | highlight the current region. But normally it does not. Why not? | 140 | highlight the current region. But normally it does not. Why not? |
| 141 | 141 | ||
| 142 | Once you have set the mark in a buffer, there is @emph{always} a | 142 | In the normal mode of use, every command that sets the mark also |
| 143 | region in that buffer. This is because every command that sets the | 143 | activates it, and nothing ever deactivates it. Thus, once you have |
| 144 | mark also activates it, and nothing ever deactivates it. Highlighting | 144 | set the mark in a buffer, there is @emph{always} a region in that |
| 145 | the region all the time would be a nuisance. So normally Emacs | 145 | buffer. Highlighting the region all the time would be a nuisance. So |
| 146 | highlights the region only immediately after you have selected one | 146 | normally Emacs highlights the region only immediately after you have |
| 147 | with the mouse. | 147 | selected one with the mouse. |
| 148 | 148 | ||
| 149 | If you want region highlighting, you can use Transient Mark mode. | 149 | If you want region highlighting, you can use Transient Mark mode. |
| 150 | This is a more rigid mode of operation in which the region always | 150 | This is a more rigid mode of operation in which the region ``lasts'' |
| 151 | ``lasts'' only until you use it; you explicitly must set up a region | 151 | only until you use it; operating on the region text deactivates the |
| 152 | for each command that uses one. In Transient Mark mode, most of the | 152 | mark, so there is no region any more. Therefore, you must explicitly |
| 153 | time there is no region; therefore, highlighting the region when it | 153 | set up a region for each command that uses one. |
| 154 | exists is useful and not annoying. When Transient Mark mode is | 154 | |
| 155 | enabled, Emacs always highlights the region whenever there is a | 155 | When Transient Mark mode is enabled, Emacs highlights the region, |
| 156 | region. | 156 | whenever there is a region. In Transient Mark mode, most of the time |
| 157 | there is no region; therefore, highlighting the region when it exists | ||
| 158 | is useful and not annoying. | ||
| 157 | 159 | ||
| 158 | @findex transient-mark-mode | 160 | @findex transient-mark-mode |
| 159 | To enable Transient Mark mode, type @kbd{M-x transient-mark-mode}. | 161 | To enable Transient Mark mode, type @kbd{M-x transient-mark-mode}. |
| @@ -367,7 +369,7 @@ negative) instead of the current page. | |||
| 367 | 369 | ||
| 368 | 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 |
| 369 | buffer as the region, by putting point at the beginning and the mark at | 371 | buffer as the region, by putting point at the beginning and the mark at |
| 370 | the end. | 372 | the end. (In some programs this is called ``select all.'') |
| 371 | 373 | ||
| 372 | In Transient Mark mode, all of these commands activate the mark. | 374 | In Transient Mark mode, all of these commands activate the mark. |
| 373 | 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 |
| 2001 | desktop-save}. You can also enable automatic desktop saving when | 2001 | desktop-save}. You can also enable automatic saving of the desktop |
| 2002 | you exit Emacs: use the Customization buffer (@pxref{Easy | 2002 | when you exit Emacs, and automatic restoration of the last saved |
| 2003 | desktop when Emacs starts: use the Customization buffer (@pxref{Easy | ||
| 2003 | Customization}) to set @code{desktop-save-mode} to @code{t} for future | 2004 | Customization}) to set @code{desktop-save-mode} to @code{t} for future |
| 2004 | sessions, or add this line in your @file{~/.emacs} file: | 2005 | sessions, 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}, |
| 2014 | then when Emacs starts, it looks for a saved desktop in the current | ||
| 2013 | directory. Thus, you can have separate saved desktops in different | 2015 | directory. Thus, you can have separate saved desktops in different |
| 2014 | directories, and the starting directory determines which one Emacs | 2016 | directories, and the starting directory determines which one Emacs |
| 2015 | reloads. You can save the current desktop and reload one saved in | 2017 | reloads. 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 |
| 2020 | don't want it to reload any saved desktop. This turns off | 2022 | don'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 |
| 2024 | the @samp{--no-init-file} option also disables desktop reloading, | ||
| 2025 | since 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 | |||
| 785 | correspondence. There is a special function | 785 | correspondence. 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 |
| 787 | example, to read and write all @samp{.txt} files using the coding system | 787 | example, 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 | |||
| 1003 | contains characters that the coding system cannot handle. | 1003 | contains 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 |
| 1007 | of @kbd{C-x C-f}. @kbd{C-x @key{RET} c} also affects commands that | 1007 | of @kbd{C-x C-f}. @kbd{C-x @key{RET} c} also affects commands that |
| 1008 | start subprocesses, including @kbd{M-x shell} (@pxref{Shell}). If the | 1008 | start subprocesses, including @kbd{M-x shell} (@pxref{Shell}). If the |
| 1009 | immediately following command does not use the coding system, then | 1009 | immediately 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.'' | |||
| 98 | Introduction | 98 | Introduction |
| 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 | ||
| 104 | Document Structure | 105 | Document 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 | ||
| 334 | XEmacs package, please skip this section and go directly to | ||
| 335 | @ref{Activation}. | ||
| 336 | |||
| 337 | If you have downloaded Org-mode from the Web, you must take the | ||
| 338 | following steps to install it: Go into the Org-mode distribution | ||
| 339 | directory and edit the top section of the file @file{Makefile}. You | ||
| 340 | must 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 | ||
| 342 | Info files are kept. If you don't have access to the system-wide | ||
| 343 | directories, create your own two directories for these files, enter them | ||
| 344 | into the Makefile, and make sure Emacs finds the Lisp files by adding | ||
| 345 | the 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 | ||
| 352 | the @file{xemacs} subdirectory of the Org-mode distribution. Use the | ||
| 353 | command:} | ||
| 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 | ||
| 360 | commands: | ||
| 361 | |||
| 362 | @example | ||
| 363 | make | ||
| 364 | make install | ||
| 365 | @end example | ||
| 366 | |||
| 367 | @noindent If you want to install the info documentation, use this command: | ||
| 368 | |||
| 369 | @example | ||
| 370 | make 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 | ||
| 333 | If Org-mode is part of the Emacs distribution or an XEmacs package, | 387 | Add the following lines to your @file{.emacs} file. The last two lines |
| 334 | you only need to copy the following lines to your @file{.emacs} file. | 388 | define @emph{global} keys for the commands @command{org-store-link} and |
| 335 | The 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 | ||
| 337 | choose 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 | ||
| 346 | Furthermore, you must activate @code{font-lock-mode} in org-mode | 398 | Furthermore, you must activate @code{font-lock-mode} in org-mode |
| 347 | buffers, because significant functionality depends on font-locking being | 399 | buffers, because significant functionality depends on font-locking being |
| 348 | active. You can do this with either one of the following two lines: | 400 | active. 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 | ||
| 354 | If you have downloaded Org-mode from the Web, you must take additional | ||
| 355 | action: Byte-compile @file{org.el} and @file{org-publish.el} and put | ||
| 356 | them 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 | |||
| 364 | If 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 | ||
| 366 | distribution. | ||
| 367 | |||
| 368 | @cindex org-mode, turning on | 407 | @cindex org-mode, turning on |
| 369 | With this setup, all files with extension @samp{.org} will be put into | 408 | With this setup, all files with extension @samp{.org} will be put |
| 370 | Org-mode. As an alternative, make the first line of a file look like | 409 | into Org-mode. As an alternative, make the first line of a file look |
| 371 | this: | 410 | like this: |
| 372 | 411 | ||
| 373 | @example | 412 | @example |
| 374 | MY PROJECTS -*- mode: org; -*- | 413 | MY PROJECTS -*- mode: org; -*- |
| @@ -378,7 +417,7 @@ MY PROJECTS -*- mode: org; -*- | |||
| 378 | the file's name is. See also the variable | 417 | the 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 | ||
| 829 | Org-mode supports these lists by tuning filling and wrapping commands | 868 | Org-mode supports these lists by tuning filling and wrapping commands to |
| 830 | to deal with them correctly. | 869 | deal with them correctly@footnote{Org-mode only changes the filling |
| 870 | settings 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 | ||
| 832 | The following commands act on items when the cursor is in the first line | 877 | The following commands act on items when the cursor is in the first line |
| 833 | of an item (the line with the bullet or number). | 878 | of 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 | ||
| 2161 | The second possibility is to use TODO keywords to indicate different | 2206 | The second possibility is to use TODO keywords to indicate different |
| 2162 | types of action items. For example, you might want to indicate that | 2207 | types of action items. For example, you might want to indicate that |
| 2163 | items are for ``work'' or ``home.'' If you are into David Allen's | 2208 | items 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 |
| 2166 | with several people on a single project, you might want to assign | 2211 | with several people on a single project, you might want to assign |
| @@ -2547,7 +2592,12 @@ keyword together with a timestamp. | |||
| 2547 | Stop the clock (clock-out). The inserts another timestamp at the same | 2592 | Stop the clock (clock-out). The inserts another timestamp at the same |
| 2548 | location where the clock was last started. It also directly computes | 2593 | location where the clock was last started. It also directly computes |
| 2549 | the resulting time in inserts it after the time range as @samp{=> | 2594 | the resulting time in inserts it after the time range as @samp{=> |
| 2550 | HH:MM}. | 2595 | HH:MM}. |
| 2596 | @kindex C-c C-y | ||
| 2597 | @item C-c C-y | ||
| 2598 | Recompute the time interval after changing one of the time stamps. This | ||
| 2599 | is only necessary if you edit the time stamps directly. If you change | ||
| 2600 | them 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 |
| 2553 | Changing the TODO state of an item to DONE automatically stops the clock | 2603 | Changing 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 | |||
| 2565 | automatically when the buffer is changed. | 2615 | automatically 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 |
| 2568 | Insert a dynamic block containing a clock report as an org-mode table | 2618 | Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock |
| 2569 | into the current file. | 2619 | report 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 | ||
| 2638 | So 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 |
| 2644 | and to use a specific time range you could write@footnote{Note that all | ||
| 2645 | parameters must be specified in a single line - the line is broken here | ||
| 2646 | only 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 | ||
| 2655 | Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if | ||
| 2656 | you have several clocktable blocks in a buffer. | ||
| 2582 | @end table | 2657 | @end table |
| 2583 | 2658 | ||
| 2584 | The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in | 2659 | The @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} |
| 4655 | Org-mode can make use of the cdlatex package to efficiently enter | 4730 | Org-mode can make use of the cdlatex package to efficiently enter |
| 4656 | La@TeX{} fragments into Org-mode files. | 4731 | La@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} |
| 4660 | Org mode cooperates with remember, see @ref{Remember}. | 4734 | Org 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 |
| 4787 | A blogging plug-in for @file{org-publish.el}. | 4861 | A 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 | |||
| 4805 | the content of the block. | 4879 | the 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. | |||
| 501 | Here is an example to illustrate how you would set it: | 501 | Here 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/search.texi b/man/search.texi index 282b36e3a50..ac11e58b268 100644 --- a/man/search.texi +++ b/man/search.texi | |||
| @@ -33,6 +33,8 @@ asks interactively which occurrences to replace. | |||
| 33 | 33 | ||
| 34 | @node Incremental Search | 34 | @node Incremental Search |
| 35 | @section Incremental Search | 35 | @section Incremental Search |
| 36 | @cindex incremental search | ||
| 37 | @cindex isearch | ||
| 36 | 38 | ||
| 37 | An incremental search begins searching as soon as you type the first | 39 | An incremental search begins searching as soon as you type the first |
| 38 | character of the search string. As you type in the search string, Emacs | 40 | character of the search string. As you type in the search string, Emacs |
| @@ -63,7 +65,6 @@ Incremental search backward (@code{isearch-backward}). | |||
| 63 | 65 | ||
| 64 | @node Basic Isearch | 66 | @node Basic Isearch |
| 65 | @subsection Basics of Incremental Search | 67 | @subsection Basics of Incremental Search |
| 66 | @cindex incremental search | ||
| 67 | 68 | ||
| 68 | @kindex C-s | 69 | @kindex C-s |
| 69 | @findex isearch-forward | 70 | @findex isearch-forward |
| @@ -1241,8 +1242,10 @@ line. | |||
| 1241 | used the minibuffer to read its arguments. @xref{Repetition, C-x ESC | 1242 | used the minibuffer to read its arguments. @xref{Repetition, C-x ESC |
| 1242 | ESC}. | 1243 | ESC}. |
| 1243 | 1244 | ||
| 1244 | See also @ref{Transforming File Names}, for Dired commands to rename, | 1245 | @xref{Operating on Files}, for the Dired @kbd{Q} command which |
| 1245 | copy, or link files by replacing regexp matches in file names. | 1246 | performs query replace on selected files. See also @ref{Transforming |
| 1247 | File Names}, for Dired commands to rename, copy, or link files by | ||
| 1248 | replacing regexp matches in file names. | ||
| 1246 | 1249 | ||
| 1247 | @node Other Repeating Search | 1250 | @node Other Repeating Search |
| 1248 | @section Other Search-and-Loop Commands | 1251 | @section Other Search-and-Loop Commands |
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 |
| 2071 | chosen face to the region. @xref{Faces}. You can also specify a face | 2071 | operate on the region if it is active and nonempty. Otherwise, they |
| 2072 | with these keyboard commands: | 2072 | specify to use that face for an immediately following self-inserting |
| 2073 | character. 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 |
| 2078 | Set the region, or the next inserted character, to the @code{default} face | 2079 | Remove all @code{face} properties from the region (which includes |
| 2079 | (@code{facemenu-set-default}). | 2080 | specified 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 |
| 2083 | Set the region, or the next inserted character, to the @code{bold} face | 2085 | Add the face @code{bold} to the region or to the following inserted |
| 2084 | (@code{facemenu-set-bold}). | 2086 | character (@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 |
| 2088 | Set the region, or the next inserted character, to the @code{italic} face | 2090 | Add the face @code{italic} to the region or to the following inserted |
| 2089 | (@code{facemenu-set-italic}). | 2091 | character (@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 |
| 2093 | Set the region, or the next inserted character, to the @code{bold-italic} face | 2095 | Add the face @code{bold-italic} to the region or to the following |
| 2094 | (@code{facemenu-set-bold-italic}). | 2096 | inserted 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 |
| 2098 | Set the region, or the next inserted character, to the @code{underline} face | 2100 | Add the face @code{underline} to the region or to the following inserted |
| 2099 | (@code{facemenu-set-underline}). | 2101 | character (@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} |
| 2103 | Set the region, or the next inserted character, to the face @var{face} | 2105 | Add the face @var{face} to the region or to the following inserted |
| 2104 | (@code{facemenu-set-face}). | 2106 | character (@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 |
| 2108 | mode, if the region is not active---then these commands specify a face | 2110 | following self-inserting character, disregarding the region. |
| 2109 | to use for any immediately following self-inserting input. | ||
| 2110 | @xref{Transient Mark}. This applies to both the keyboard commands and | ||
| 2111 | the menu commands. | ||
| 2112 | 2111 | ||
| 2113 | Specifying the @code{default} face also resets foreground and | 2112 | A self-inserting character normally inherits the @code{face} |
| 2114 | background color to their defaults.(@pxref{Format Colors}). | 2113 | property (and most other text properties) from the preceding character |
| 2114 | in the buffer. If you use the above commands to specify face for the | ||
| 2115 | next self-inserting character, or the next section's commands to | ||
| 2116 | specify a foreground or background color for it, then it does not | ||
| 2117 | inherit the @code{face} property from the preceding character; instead | ||
| 2118 | it uses whatever you specified. It will still inherit other text | ||
| 2119 | properties, 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 |
| 2117 | properties (as well as most other text properties) of the preceding | 2122 | self-inserting character that you type. But if you insert additional |
| 2118 | character. Specifying any face property, including foreground or | 2123 | characters after it, they will inherit from the first one. So it |
| 2119 | background color, for your next self-inserting character will prevent | 2124 | appears that these commands apply to all of them. |
| 2120 | it from inheriting any face properties from the preceding character, | ||
| 2121 | although it will still inherit other text properties. Characters | ||
| 2122 | inserted 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 |
| 2159 | Mark mode, if the region is not active---then it applies to any | 2161 | Mark mode, if the region is not active---then it applies to any |
| 2160 | immediately following self-inserting input. @xref{Transient Mark}. | 2162 | immediately following self-inserting input. Otherwise, the command |
| 2161 | Otherwise, the command applies to the region. | 2163 | applies 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 |
| 2164 | this item to specify a color that is not listed in the menu; it reads | 2166 | this item to specify a color that is not listed in the menu; it reads |
diff --git a/src/.gdbinit b/src/.gdbinit index acdb959a869..5dc126f8d36 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 79271fe23fa..c7a065c091e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,308 @@ | |||
| 1 | 2006-08-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | ||
| 2 | |||
| 3 | * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Undo previous | ||
| 4 | change. Move mutex lock/unlock operations inside BLOCK_INPUT. | ||
| 5 | |||
| 6 | * dired.c (directory_files_internal_unwind, directory_files_internal) | ||
| 7 | (file_name_completion): Add BLOCK_INPUT around opendir/closedir. | ||
| 8 | |||
| 9 | * image.c [MAC_OS] (image_load_qt_1): Use ComponentResult instead | ||
| 10 | of OSErr. | ||
| 11 | |||
| 12 | * keyboard.c (in_sighandler): Remove variable. | ||
| 13 | (Fcurrent_idle_time): Add missing `doc:'. | ||
| 14 | (input_available_signal, init_keyboard): Undo previous change. | ||
| 15 | |||
| 16 | * keyboard.h (in_sighandler): Remove extern. | ||
| 17 | |||
| 18 | * mac.c (create_apple_event_from_event_ref, select) | ||
| 19 | (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator) | ||
| 20 | (Fmac_set_file_type, cfstring_create_normalized) | ||
| 21 | (mac_get_system_locale, select_and_poll_event, sys_select): Use | ||
| 22 | OSStatus instead of OSErr. | ||
| 23 | |||
| 24 | * macfns.c [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): Don't | ||
| 25 | use FRAME_FILE_NAME. Use (FS)UpdateAlias. | ||
| 26 | (Fx_create_frame): Apply 2006-07-03 for xfns.c. | ||
| 27 | |||
| 28 | * macselect.c (get_scrap_from_symbol, clear_scrap, put_scrap_string) | ||
| 29 | (put_scrap_private_timestamp, scrap_has_target_type, get_scrap_string) | ||
| 30 | (get_scrap_private_timestamp, get_scrap_target_type_list) | ||
| 31 | (x_own_selection, x_get_foreign_selection) | ||
| 32 | (Fx_disown_selection_internal, Fx_selection_owner_p) | ||
| 33 | (Fx_selection_exists_p): Use OSStatus instead of OSErr. | ||
| 34 | |||
| 35 | * macterm.c (mac_draw_string_common, mac_query_char_extents) | ||
| 36 | (x_iconify_frame, XLoadQueryFont, install_window_handler) | ||
| 37 | (mac_handle_command_event, init_command_handler, init_menu_bar): | ||
| 38 | Use OSStatus instead of OSErr. | ||
| 39 | (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Don't use | ||
| 40 | FRAME_FILE_NAME. | ||
| 41 | (x_query_font): Apply 2006-08-04 change for xterm.c. | ||
| 42 | (Qhi_command): Rename from Qhicommand. All uses changed. | ||
| 43 | |||
| 44 | * macterm.h (struct mac_output) [TARGET_API_MAC_CARBON]: Remove member | ||
| 45 | file_name. | ||
| 46 | (FRAME_FILE_NAME): Remove macro. | ||
| 47 | (install_window_handler, create_apple_event_from_event_ref): | ||
| 48 | Return OSStatus instead of OSErr. | ||
| 49 | |||
| 50 | 2006-08-26 Kim F. Storm <storm@cua.dk> | ||
| 51 | |||
| 52 | * buffer.c (Fset_buffer_multibyte): | ||
| 53 | * editfns.c (Fcurrent_time, Fget_internal_run_time): | ||
| 54 | * macfns.c (Fxw_color_values): | ||
| 55 | * w32fns.c (Fxw_color_values): | ||
| 56 | * xfns.c (Fxw_color_values): Simplify; use list3. | ||
| 57 | |||
| 58 | * fileio.c (Fmake_directory_internal, Fdelete_directory) | ||
| 59 | (Fdelete_file): Simplify; use list1. | ||
| 60 | (Frename_file, Fadd_name_to_file, Fmake_symbolic_link): | ||
| 61 | Simplify; remove NO_ARG_ARRAY stuff, use list2. | ||
| 62 | |||
| 63 | 2006-08-25 Kim F. Storm <storm@cua.dk> | ||
| 64 | |||
| 65 | * keyboard.c (Fcurrent_idle_time): Simplify. | ||
| 66 | |||
| 67 | 2006-08-25 Richard Stallman <rms@gnu.org> | ||
| 68 | |||
| 69 | * fns.c (sxhash_string): Rotate properly; don't lose bits. | ||
| 70 | |||
| 71 | 2006-08-24 Francesc Rocher <francesc.rocher@gmail.com> | ||
| 72 | |||
| 73 | * xdisp.c (overline_margin): New variable. | ||
| 74 | (x_produce_glyphs): Use it. | ||
| 75 | (syms_of_xdisp): DEFVAR_INT it. | ||
| 76 | |||
| 77 | * xterm.c (x_underline_at_descent_line): New variable. | ||
| 78 | (syms_of_xterm): DEFVAR_BOOL it. | ||
| 79 | (x_draw_glyph_string): Use it. | ||
| 80 | Draw underline and overline up to the end of line if the face | ||
| 81 | extends to the end of line. | ||
| 82 | |||
| 83 | * macterm.c: Likewise. | ||
| 84 | |||
| 85 | * w32term.c: Likewise. | ||
| 86 | |||
| 87 | 2006-08-24 Nick Roberts <nickrob@snap.net.nz> | ||
| 88 | |||
| 89 | * buffer.c (Fswitch_to_buffer): Move buffer to front of | ||
| 90 | buffer-alist if necessary. | ||
| 91 | |||
| 92 | 2006-08-22 Kim F. Storm <storm@cua.dk> | ||
| 93 | |||
| 94 | * xdisp.c (update_tool_bar): Redisplay toolbar also when only | ||
| 95 | number of items changes. | ||
| 96 | |||
| 97 | 2006-08-22 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 98 | |||
| 99 | * buffer.c (Fset_buffer_multibyte): Record proper undo entry. | ||
| 100 | |||
| 101 | 2006-08-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 102 | |||
| 103 | * keyboard.c: Clarify difference between in_sighandler and | ||
| 104 | handling_signal. | ||
| 105 | |||
| 106 | 2006-08-21 Kim F. Storm <storm@cua.dk> | ||
| 107 | |||
| 108 | * macterm.c (x_draw_stretch_glyph_string): | ||
| 109 | * w32term.c (x_draw_stretch_glyph_string): | ||
| 110 | * xterm.c (x_draw_stretch_glyph_string): It is ok to draw a | ||
| 111 | stretch glyph in left marginal areas on header and mode lines. | ||
| 112 | |||
| 113 | 2006-08-21 Kenichi Handa <handa@m17n.org> | ||
| 114 | |||
| 115 | * keyboard.c (syms_of_keyboard): Docstring of | ||
| 116 | Vunread_post_input_method_events and Vunread_input_method_events | ||
| 117 | fixed. | ||
| 118 | |||
| 119 | 2006-08-20 Chong Yidong <cyd@stupidchicken.com> | ||
| 120 | |||
| 121 | * keyboard.c (show_help_echo): Preserve mouse movement flag if | ||
| 122 | tracking mouse. | ||
| 123 | |||
| 124 | 2006-08-20 Richard Stallman <rms@gnu.org> | ||
| 125 | |||
| 126 | * xfaces.c (load_pixmap): Add quotes in error message. | ||
| 127 | |||
| 128 | * keyboard.c (Fcurrent_idle_time): New function. | ||
| 129 | (syms_of_keyboard): defsubr it. | ||
| 130 | |||
| 131 | 2006-08-18 Nick Roberts <nickrob@snap.net.nz> | ||
| 132 | |||
| 133 | * window.c (Fset_window_fringes): Do nothing on a tty. | ||
| 134 | (Fwindow_fringes): Put ? operator after the line break. | ||
| 135 | |||
| 136 | 2006-08-16 Andreas Schwab <schwab@suse.de> | ||
| 137 | |||
| 138 | * print.c (debug_output_compilation_hack): Fix return type. | ||
| 139 | |||
| 140 | 2006-08-16 Richard Stallman <rms@gnu.org> | ||
| 141 | |||
| 142 | * print.c (debug_output_compilation_hack): New function. | ||
| 143 | |||
| 144 | 2006-08-16 Kenichi Handa <handa@m17n.org> | ||
| 145 | |||
| 146 | * fileio.c (choose_write_coding_system): Use LF for end-of-line | ||
| 147 | in auto-saving. | ||
| 148 | |||
| 149 | 2006-08-15 Chong Yidong <cyd@stupidchicken.com> | ||
| 150 | |||
| 151 | * keyboard.c (read_char): Don't change idle timer state at all if | ||
| 152 | end_time is supplied. | ||
| 153 | |||
| 154 | 2006-08-15 Kenichi Handa <handa@m17n.org> | ||
| 155 | |||
| 156 | * coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New arg RET. If SRC | ||
| 157 | is exhausted, return with RET. | ||
| 158 | (detect_coding_emacs_mule, detect_coding_iso2022) | ||
| 159 | (detect_coding_sjis, detect_coding_big5, detect_coding_utf_8) | ||
| 160 | (detect_coding_utf_16, detect_coding_ccl): Adjusted for the above | ||
| 161 | change. | ||
| 162 | |||
| 163 | 2006-08-14 Chong Yidong <cyd@stupidchicken.com> | ||
| 164 | |||
| 165 | * keyboard.c (read_char): Don't reset idle timers if a time limit | ||
| 166 | is supplied. | ||
| 167 | |||
| 168 | 2006-08-14 Kim F. Storm <storm@cua.dk> | ||
| 169 | |||
| 170 | * .gdbinit (pitx): Print iterator position. | ||
| 171 | Limit stack dump in case iterator is not initialized. | ||
| 172 | |||
| 173 | 2006-08-12 Eli Zaretskii <eliz@gnu.org> | ||
| 174 | |||
| 175 | * frame.c (Fmouse_position, Fmouse_pixel_position) | ||
| 176 | (Fset_mouse_position, Fset_mouse_pixel_position): Doc fix. | ||
| 177 | |||
| 178 | 2006-08-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 179 | |||
| 180 | * xselect.c (Fx_register_dnd_atom): New function. | ||
| 181 | (syms_of_xselect): Defsubr it. | ||
| 182 | (x_handle_dnd_message): Check that message_type is in | ||
| 183 | dpyinfo->x_dnd_atoms before generating lisp event. | ||
| 184 | |||
| 185 | * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track | ||
| 186 | of drag and drop Atoms. | ||
| 187 | |||
| 188 | * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms* | ||
| 189 | |||
| 190 | |||
| 191 | 2006-08-10 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 192 | |||
| 193 | * keyboard.c: Define in_sighandler. | ||
| 194 | (input_available_signal): Set in_sighandler. | ||
| 195 | (init_keyboard): Initialize in_sighandler. | ||
| 196 | |||
| 197 | * keyboard.h: Declare in_sighandler. | ||
| 198 | |||
| 199 | * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler | ||
| 200 | to check if mutex should be locked or not. | ||
| 201 | |||
| 202 | 2006-08-09 Richard Stallman <rms@gnu.org> | ||
| 203 | |||
| 204 | * keyboard.c (keyremap_step): No-op if fkey->parent = nil. | ||
| 205 | (read_key_sequence): Always start fkey.start and fkey.end at 0, | ||
| 206 | and likewise for keytran. | ||
| 207 | |||
| 208 | 2006-08-09 Kenichi Handa <handa@m17n.org> | ||
| 209 | |||
| 210 | * coding.c (syms_of_coding): Improve the docstring | ||
| 211 | file-coding-system-alist. | ||
| 212 | |||
| 213 | 2006-08-07 Andreas Schwab <schwab@suse.de> | ||
| 214 | |||
| 215 | * puresize.h (BASE_PURESIZE): Increase to 1120000. | ||
| 216 | |||
| 217 | 2006-08-06 Chong Yidong <cyd@stupidchicken.com> | ||
| 218 | |||
| 219 | * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars. | ||
| 220 | (Fkill_all_local_variables): Use it. | ||
| 221 | (syms_of_buffer): Defvar it. | ||
| 222 | |||
| 223 | 2006-08-05 Eli Zaretskii <eliz@gnu.org> | ||
| 224 | |||
| 225 | * w32.c (w32_valid_pointer_p): New function. | ||
| 226 | |||
| 227 | * w32.h: Add prototype for w32_valid_pointer_p. | ||
| 228 | |||
| 229 | * alloc.c: Include w32.h. | ||
| 230 | (valid_lisp_object_p) [WINDOWSNT]: Call w32_valid_pointer_p to do | ||
| 231 | the job. | ||
| 232 | |||
| 233 | * keyboard.c (kbd_buffer_get_event): Return Qnil when current time | ||
| 234 | is exactly equal to end_time, not only when it is past that. | ||
| 235 | |||
| 236 | 2006-08-04 Chong Yidong <cyd@stupidchicken.com> | ||
| 237 | |||
| 238 | * keyboard.c (read_char): Rebalance specpdl after receiving jump. | ||
| 239 | |||
| 240 | * process.c: Reapply 2006-08-01 change. | ||
| 241 | |||
| 242 | 2006-08-04 Eli Zaretskii <eliz@gnu.org> | ||
| 243 | |||
| 244 | * w32fns.c (w32_query_font): Fix last change: use stricmp. | ||
| 245 | |||
| 246 | 2006-08-04 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 247 | |||
| 248 | * editfns.c (Fsubst_char_in_region): Redo the setup work after running | ||
| 249 | the before-change-functions since they may have altered the buffer. | ||
| 250 | |||
| 251 | 2006-08-04 Ralf Angeli <angeli@caeruleus.net> | ||
| 252 | |||
| 253 | * w32fns.c (w32_createwindow): Handle -geometry command line option | ||
| 254 | and the geometry settings in the Registry. | ||
| 255 | |||
| 256 | 2006-08-04 Kenichi Handa <handa@m17n.org> | ||
| 257 | |||
| 258 | * w32fns.c (w32_query_font): Compare names by ignoring case. | ||
| 259 | |||
| 260 | * xterm.c (x_query_font): Compare names by ignoring case. | ||
| 261 | |||
| 262 | 2006-08-03 Jason Rumney <jasonr@gnu.org> | ||
| 263 | |||
| 264 | * w32menu.c (w32_menu_show, w32_dialog_show): Call Fsignal to quit | ||
| 265 | when no option selected. | ||
| 266 | |||
| 267 | 2006-08-03 Chong Yidong <cyd@stupidchicken.com> | ||
| 268 | |||
| 269 | * process.c: Revert last change. | ||
| 270 | |||
| 271 | 2006-08-01 Kim F. Storm <storm@cua.dk> | ||
| 272 | |||
| 273 | * process.c (wait_reading_process_output_unwind): New function. | ||
| 274 | Restores waiting_for_user_input_p to saved value. | ||
| 275 | (wait_reading_process_output): Unwind protect waiting_for_user_input_p | ||
| 276 | instead of save/restore old value on stack. | ||
| 277 | |||
| 278 | 2006-07-30 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 279 | |||
| 280 | * editfns.c: Undo 2006-06-27 change. | ||
| 281 | |||
| 282 | 2006-07-29 Eli Zaretskii <eliz@gnu.org> | ||
| 283 | |||
| 284 | * coding.c (Ffind_operation_coding_system): Revert the change from | ||
| 285 | 2006-05-29. | ||
| 286 | |||
| 287 | * alloc.c [WINDOWSNT]: Include fcntl.h, to fix last change. | ||
| 288 | |||
| 289 | 2006-07-28 Richard Stallman <rms@gnu.org> | ||
| 290 | |||
| 291 | * xfaces.c (lookup_named_face, Fdisplay_supports_face_attributes_p): | ||
| 292 | Add conditional aborts for clarity. | ||
| 293 | |||
| 294 | * xdisp.c (update_menu_bar): New arg HOOKS_RUN. Callers changed. | ||
| 295 | Used to avoid running the hooks over and over for each frame. | ||
| 296 | (prepare_menu_bars): Pass value from update_menu_bar | ||
| 297 | as HOOKS_RUN of next call. | ||
| 298 | |||
| 299 | * keyboard.c (safe_run_hooks_1): Don't crash if Vrun_hooks is nil. | ||
| 300 | |||
| 301 | 2006-07-28 Kim F. Storm <storm@cua.dk> | ||
| 302 | |||
| 303 | * alloc.c (valid_pointer_p): New function (from valid_lisp_object_p). | ||
| 304 | (valid_lisp_object_p): Use it to check for valid SUBRP obj. | ||
| 305 | |||
| 1 | 2006-07-26 Chong Yidong <cyd@stupidchicken.com> | 306 | 2006-07-26 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 307 | ||
| 3 | * keyboard.c (read_char): New arg END_TIME specifying timeout. | 308 | * keyboard.c (read_char): New arg END_TIME specifying timeout. |
| @@ -177,6 +482,14 @@ | |||
| 177 | (mac_initialize_display_info) [MAC_OSX]: Use CGDisplaySamplesPerPixel. | 482 | (mac_initialize_display_info) [MAC_OSX]: Use CGDisplaySamplesPerPixel. |
| 178 | (x_delete_display): Apply 2006-07-04 change for xterm.c. | 483 | (x_delete_display): Apply 2006-07-04 change for xterm.c. |
| 179 | 484 | ||
| 485 | 2006-07-17 Richard Stallman <rms@gnu.org> | ||
| 486 | |||
| 487 | * keyboard.c (Vcommand_error_function): New variable. | ||
| 488 | (syms_of_keyboard): Defvar it. | ||
| 489 | (cmd_error_internal): Simplify, and handle Vcommand_error_function. | ||
| 490 | |||
| 491 | * dispnew.c (init_display): Mention DISPLAY as well as TERM in err msg. | ||
| 492 | |||
| 180 | 2006-07-17 Kim F. Storm <storm@cua.dk> | 493 | 2006-07-17 Kim F. Storm <storm@cua.dk> |
| 181 | 494 | ||
| 182 | * xdisp.c (handle_single_display_spec): Ensure the right value of | 495 | * xdisp.c (handle_single_display_spec): Ensure the right value of |
| @@ -617,8 +930,8 @@ | |||
| 617 | 930 | ||
| 618 | 2006-06-14 Chong Yidong <cyd@stupidchicken.com> | 931 | 2006-06-14 Chong Yidong <cyd@stupidchicken.com> |
| 619 | 932 | ||
| 620 | * xdisp.c (back_to_previous_visible_line_start): Reset | 933 | * xdisp.c (back_to_previous_visible_line_start): |
| 621 | it->continuation_lines_width. | 934 | Reset it->continuation_lines_width. |
| 622 | 935 | ||
| 623 | 2006-06-14 Richard Stallman <rms@gnu.org> | 936 | 2006-06-14 Richard Stallman <rms@gnu.org> |
| 624 | 937 | ||
| @@ -689,8 +1002,8 @@ | |||
| 689 | 1002 | ||
| 690 | 2006-06-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 1003 | 2006-06-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 691 | 1004 | ||
| 692 | * macterm.c [USE_MAC_TSM] (mac_handle_text_input_event): Exclude | 1005 | * macterm.c [USE_MAC_TSM] (mac_handle_text_input_event): |
| 693 | 0x7f from ASCII range. | 1006 | Exclude 0x7f from ASCII range. |
| 694 | 1007 | ||
| 695 | 2006-06-05 Jason Rumney <jasonr@gnu.org> | 1008 | 2006-06-05 Jason Rumney <jasonr@gnu.org> |
| 696 | 1009 | ||
diff --git a/src/alloc.c b/src/alloc.c index e3609292749..5cfcda2e1e0 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -78,6 +78,11 @@ extern POINTER_TYPE *sbrk (); | |||
| 78 | #define O_WRONLY 1 | 78 | #define O_WRONLY 1 |
| 79 | #endif | 79 | #endif |
| 80 | 80 | ||
| 81 | #ifdef WINDOWSNT | ||
| 82 | #include <fcntl.h> | ||
| 83 | #include "w32.h" | ||
| 84 | #endif | ||
| 85 | |||
| 81 | #ifdef DOUG_LEA_MALLOC | 86 | #ifdef DOUG_LEA_MALLOC |
| 82 | 87 | ||
| 83 | #include <malloc.h> | 88 | #include <malloc.h> |
| @@ -125,17 +130,17 @@ static pthread_mutex_t alloc_mutex; | |||
| 125 | #define BLOCK_INPUT_ALLOC \ | 130 | #define BLOCK_INPUT_ALLOC \ |
| 126 | do \ | 131 | do \ |
| 127 | { \ | 132 | { \ |
| 128 | pthread_mutex_lock (&alloc_mutex); \ | 133 | if (pthread_self () == main_thread) \ |
| 129 | if (pthread_self () == main_thread) \ | 134 | BLOCK_INPUT; \ |
| 130 | BLOCK_INPUT; \ | 135 | pthread_mutex_lock (&alloc_mutex); \ |
| 131 | } \ | 136 | } \ |
| 132 | while (0) | 137 | while (0) |
| 133 | #define UNBLOCK_INPUT_ALLOC \ | 138 | #define UNBLOCK_INPUT_ALLOC \ |
| 134 | do \ | 139 | do \ |
| 135 | { \ | 140 | { \ |
| 136 | if (pthread_self () == main_thread) \ | 141 | pthread_mutex_unlock (&alloc_mutex); \ |
| 137 | UNBLOCK_INPUT; \ | 142 | if (pthread_self () == main_thread) \ |
| 138 | pthread_mutex_unlock (&alloc_mutex); \ | 143 | UNBLOCK_INPUT; \ |
| 139 | } \ | 144 | } \ |
| 140 | while (0) | 145 | while (0) |
| 141 | 146 | ||
| @@ -4608,6 +4613,32 @@ mark_stack () | |||
| 4608 | #endif /* GC_MARK_STACK != 0 */ | 4613 | #endif /* GC_MARK_STACK != 0 */ |
| 4609 | 4614 | ||
| 4610 | 4615 | ||
| 4616 | /* Determine whether it is safe to access memory at address P. */ | ||
| 4617 | int | ||
| 4618 | valid_pointer_p (p) | ||
| 4619 | void *p; | ||
| 4620 | { | ||
| 4621 | #ifdef WINDOWSNT | ||
| 4622 | return w32_valid_pointer_p (p, 16); | ||
| 4623 | #else | ||
| 4624 | int fd; | ||
| 4625 | |||
| 4626 | /* Obviously, we cannot just access it (we would SEGV trying), so we | ||
| 4627 | trick the o/s to tell us whether p is a valid pointer. | ||
| 4628 | Unfortunately, we cannot use NULL_DEVICE here, as emacs_write may | ||
| 4629 | not validate p in that case. */ | ||
| 4630 | |||
| 4631 | if ((fd = emacs_open ("__Valid__Lisp__Object__", O_CREAT | O_WRONLY | O_TRUNC, 0666)) >= 0) | ||
| 4632 | { | ||
| 4633 | int valid = (emacs_write (fd, (char *)p, 16) == 16); | ||
| 4634 | emacs_close (fd); | ||
| 4635 | unlink ("__Valid__Lisp__Object__"); | ||
| 4636 | return valid; | ||
| 4637 | } | ||
| 4638 | |||
| 4639 | return -1; | ||
| 4640 | #endif | ||
| 4641 | } | ||
| 4611 | 4642 | ||
| 4612 | /* Return 1 if OBJ is a valid lisp object. | 4643 | /* Return 1 if OBJ is a valid lisp object. |
| 4613 | Return 0 if OBJ is NOT a valid lisp object. | 4644 | Return 0 if OBJ is NOT a valid lisp object. |
| @@ -4620,9 +4651,7 @@ valid_lisp_object_p (obj) | |||
| 4620 | Lisp_Object obj; | 4651 | Lisp_Object obj; |
| 4621 | { | 4652 | { |
| 4622 | void *p; | 4653 | void *p; |
| 4623 | #if !GC_MARK_STACK | 4654 | #if GC_MARK_STACK |
| 4624 | int fd; | ||
| 4625 | #else | ||
| 4626 | struct mem_node *m; | 4655 | struct mem_node *m; |
| 4627 | #endif | 4656 | #endif |
| 4628 | 4657 | ||
| @@ -4634,26 +4663,22 @@ valid_lisp_object_p (obj) | |||
| 4634 | return 1; | 4663 | return 1; |
| 4635 | 4664 | ||
| 4636 | #if !GC_MARK_STACK | 4665 | #if !GC_MARK_STACK |
| 4637 | /* We need to determine whether it is safe to access memory at | 4666 | return valid_pointer_p (p); |
| 4638 | address P. Obviously, we cannot just access it (we would SEGV | ||
| 4639 | trying), so we trick the o/s to tell us whether p is a valid | ||
| 4640 | pointer. Unfortunately, we cannot use NULL_DEVICE here, as | ||
| 4641 | emacs_write may not validate p in that case. */ | ||
| 4642 | if ((fd = emacs_open ("__Valid__Lisp__Object__", O_CREAT | O_WRONLY | O_TRUNC, 0666)) >= 0) | ||
| 4643 | { | ||
| 4644 | int valid = (emacs_write (fd, (char *)p, 16) == 16); | ||
| 4645 | emacs_close (fd); | ||
| 4646 | unlink ("__Valid__Lisp__Object__"); | ||
| 4647 | return valid; | ||
| 4648 | } | ||
| 4649 | |||
| 4650 | return -1; | ||
| 4651 | #else | 4667 | #else |
| 4652 | 4668 | ||
| 4653 | m = mem_find (p); | 4669 | m = mem_find (p); |
| 4654 | 4670 | ||
| 4655 | if (m == MEM_NIL) | 4671 | if (m == MEM_NIL) |
| 4656 | return 0; | 4672 | { |
| 4673 | int valid = valid_pointer_p (p); | ||
| 4674 | if (valid <= 0) | ||
| 4675 | return valid; | ||
| 4676 | |||
| 4677 | if (SUBRP (obj)) | ||
| 4678 | return 1; | ||
| 4679 | |||
| 4680 | return 0; | ||
| 4681 | } | ||
| 4657 | 4682 | ||
| 4658 | switch (m->type) | 4683 | switch (m->type) |
| 4659 | { | 4684 | { |
diff --git a/src/buffer.c b/src/buffer.c index dc6bcd8f6d3..6a11569c85a 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -146,6 +146,9 @@ Lisp_Object Vinhibit_read_only; | |||
| 146 | Lisp_Object Vkill_buffer_query_functions; | 146 | Lisp_Object Vkill_buffer_query_functions; |
| 147 | Lisp_Object Qkill_buffer_query_functions; | 147 | Lisp_Object Qkill_buffer_query_functions; |
| 148 | 148 | ||
| 149 | /* Hook run before changing a major mode. */ | ||
| 150 | Lisp_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. */ |
| 150 | Lisp_Object Vfirst_change_hook; | 153 | Lisp_Object Vfirst_change_hook; |
| 151 | 154 | ||
| @@ -1711,9 +1714,18 @@ the window-buffer correspondences. */) | |||
| 1711 | char *err; | 1714 | char *err; |
| 1712 | 1715 | ||
| 1713 | if (EQ (buffer, Fwindow_buffer (selected_window))) | 1716 | if (EQ (buffer, Fwindow_buffer (selected_window))) |
| 1714 | /* Basically a NOP. Avoid signalling an error if the selected window | 1717 | { |
| 1715 | is dedicated, or a minibuffer, ... */ | 1718 | /* Basically a NOP. Avoid signalling an error in the case where |
| 1716 | return Fset_buffer (buffer); | 1719 | the selected window is dedicated, or a minibuffer. */ |
| 1720 | |||
| 1721 | /* But do put this buffer at the front of the buffer list, | ||
| 1722 | unless that has been inhibited. Note that even if | ||
| 1723 | BUFFER is at the front of the main buffer-list already, | ||
| 1724 | we still want to move it to the front of the frame's buffer list. */ | ||
| 1725 | if (NILP (norecord)) | ||
| 1726 | record_buffer (buffer); | ||
| 1727 | return Fset_buffer (buffer); | ||
| 1728 | } | ||
| 1717 | 1729 | ||
| 1718 | err = no_switch_window (selected_window); | 1730 | err = no_switch_window (selected_window); |
| 1719 | if (err) error (err); | 1731 | if (err) error (err); |
| @@ -2142,10 +2154,11 @@ current buffer is cleared. */) | |||
| 2142 | { | 2154 | { |
| 2143 | struct Lisp_Marker *tail, *markers; | 2155 | struct Lisp_Marker *tail, *markers; |
| 2144 | struct buffer *other; | 2156 | struct buffer *other; |
| 2145 | int undo_enabled_p = !EQ (current_buffer->undo_list, Qt); | ||
| 2146 | int begv, zv; | 2157 | int begv, zv; |
| 2147 | int narrowed = (BEG != BEGV || Z != ZV); | 2158 | int narrowed = (BEG != BEGV || Z != ZV); |
| 2148 | int modified_p = !NILP (Fbuffer_modified_p (Qnil)); | 2159 | int modified_p = !NILP (Fbuffer_modified_p (Qnil)); |
| 2160 | Lisp_Object old_undo = current_buffer->undo_list; | ||
| 2161 | struct gcpro gcpro1; | ||
| 2149 | 2162 | ||
| 2150 | if (current_buffer->base_buffer) | 2163 | if (current_buffer->base_buffer) |
| 2151 | error ("Cannot do `set-buffer-multibyte' on an indirect buffer"); | 2164 | error ("Cannot do `set-buffer-multibyte' on an indirect buffer"); |
| @@ -2154,10 +2167,11 @@ current buffer is cleared. */) | |||
| 2154 | if (NILP (flag) == NILP (current_buffer->enable_multibyte_characters)) | 2167 | if (NILP (flag) == NILP (current_buffer->enable_multibyte_characters)) |
| 2155 | return flag; | 2168 | return flag; |
| 2156 | 2169 | ||
| 2157 | /* It would be better to update the list, | 2170 | GCPRO1 (old_undo); |
| 2158 | but this is good enough for now. */ | 2171 | |
| 2159 | if (undo_enabled_p) | 2172 | /* Don't record these buffer changes. We will put a special undo entry |
| 2160 | current_buffer->undo_list = Qt; | 2173 | instead. */ |
| 2174 | current_buffer->undo_list = Qt; | ||
| 2161 | 2175 | ||
| 2162 | /* If the cached position is for this buffer, clear it out. */ | 2176 | /* If the cached position is for this buffer, clear it out. */ |
| 2163 | clear_charpos_cache (current_buffer); | 2177 | clear_charpos_cache (current_buffer); |
| @@ -2357,8 +2371,17 @@ current buffer is cleared. */) | |||
| 2357 | set_intervals_multibyte (1); | 2371 | set_intervals_multibyte (1); |
| 2358 | } | 2372 | } |
| 2359 | 2373 | ||
| 2360 | if (undo_enabled_p) | 2374 | if (!EQ (old_undo, Qt)) |
| 2361 | current_buffer->undo_list = Qnil; | 2375 | { |
| 2376 | /* Represent all the above changes by a special undo entry. */ | ||
| 2377 | extern Lisp_Object Qapply; | ||
| 2378 | current_buffer->undo_list = Fcons (list3 (Qapply, | ||
| 2379 | intern ("set-buffer-multibyte"), | ||
| 2380 | NILP (flag) ? Qt : Qnil), | ||
| 2381 | old_undo); | ||
| 2382 | } | ||
| 2383 | |||
| 2384 | UNGCPRO; | ||
| 2362 | 2385 | ||
| 2363 | /* Changing the multibyteness of a buffer means that all windows | 2386 | /* Changing the multibyteness of a buffer means that all windows |
| 2364 | showing that buffer must be updated thoroughly. */ | 2387 | showing that buffer must be updated thoroughly. */ |
| @@ -2416,7 +2439,7 @@ the normal hook `change-major-mode-hook'. */) | |||
| 2416 | Lisp_Object oalist; | 2439 | Lisp_Object oalist; |
| 2417 | 2440 | ||
| 2418 | if (!NILP (Vrun_hooks)) | 2441 | if (!NILP (Vrun_hooks)) |
| 2419 | call1 (Vrun_hooks, intern ("change-major-mode-hook")); | 2442 | call1 (Vrun_hooks, Qchange_major_mode_hook); |
| 2420 | oalist = current_buffer->local_var_alist; | 2443 | oalist = current_buffer->local_var_alist; |
| 2421 | 2444 | ||
| 2422 | /* Make sure none of the bindings in oalist | 2445 | /* Make sure none of the bindings in oalist |
| @@ -6028,6 +6051,13 @@ t means to use hollow box cursor. See `cursor-type' for other values. */); | |||
| 6028 | doc: /* List of functions called with no args to query before killing a buffer. */); | 6051 | doc: /* List of functions called with no args to query before killing a buffer. */); |
| 6029 | Vkill_buffer_query_functions = Qnil; | 6052 | Vkill_buffer_query_functions = Qnil; |
| 6030 | 6053 | ||
| 6054 | DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook, | ||
| 6055 | doc: /* Normal hook run before changing the major mode of a buffer. | ||
| 6056 | The function `kill-all-local-variables' runs this before doing anything else. */); | ||
| 6057 | Vchange_major_mode_hook = Qnil; | ||
| 6058 | Qchange_major_mode_hook = intern ("change-major-mode-hook"); | ||
| 6059 | staticpro (&Qchange_major_mode_hook); | ||
| 6060 | |||
| 6031 | defsubr (&Sbuffer_live_p); | 6061 | defsubr (&Sbuffer_live_p); |
| 6032 | defsubr (&Sbuffer_list); | 6062 | defsubr (&Sbuffer_list); |
| 6033 | defsubr (&Sget_buffer); | 6063 | defsubr (&Sget_buffer); |
diff --git a/src/coding.c b/src/coding.c index 5b067b9dd2f..53f37c580de 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -219,14 +219,15 @@ encode_coding_XXX (coding, source, destination, src_bytes, dst_bytes) | |||
| 219 | 219 | ||
| 220 | 220 | ||
| 221 | /* Like ONE_MORE_BYTE, but 8-bit bytes of data at SRC are in multibyte | 221 | /* Like ONE_MORE_BYTE, but 8-bit bytes of data at SRC are in multibyte |
| 222 | form if MULTIBYTEP is nonzero. */ | 222 | form if MULTIBYTEP is nonzero. In addition, if SRC is not less |
| 223 | than SRC_END, return with RET. */ | ||
| 223 | 224 | ||
| 224 | #define ONE_MORE_BYTE_CHECK_MULTIBYTE(c1, multibytep) \ | 225 | #define ONE_MORE_BYTE_CHECK_MULTIBYTE(c1, multibytep, ret) \ |
| 225 | do { \ | 226 | do { \ |
| 226 | if (src >= src_end) \ | 227 | if (src >= src_end) \ |
| 227 | { \ | 228 | { \ |
| 228 | coding->result = CODING_FINISH_INSUFFICIENT_SRC; \ | 229 | coding->result = CODING_FINISH_INSUFFICIENT_SRC; \ |
| 229 | goto label_end_of_loop; \ | 230 | return ret; \ |
| 230 | } \ | 231 | } \ |
| 231 | c1 = *src++; \ | 232 | c1 = *src++; \ |
| 232 | if (multibytep && c1 == LEADING_CODE_8_BIT_CONTROL) \ | 233 | if (multibytep && c1 == LEADING_CODE_8_BIT_CONTROL) \ |
| @@ -628,15 +629,15 @@ detect_coding_emacs_mule (src, src_end, multibytep) | |||
| 628 | 629 | ||
| 629 | while (1) | 630 | while (1) |
| 630 | { | 631 | { |
| 631 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); | 632 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, |
| 632 | 633 | CODING_CATEGORY_MASK_EMACS_MULE); | |
| 633 | if (composing) | 634 | if (composing) |
| 634 | { | 635 | { |
| 635 | if (c < 0xA0) | 636 | if (c < 0xA0) |
| 636 | composing = 0; | 637 | composing = 0; |
| 637 | else if (c == 0xA0) | 638 | else if (c == 0xA0) |
| 638 | { | 639 | { |
| 639 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); | 640 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0); |
| 640 | c &= 0x7F; | 641 | c &= 0x7F; |
| 641 | } | 642 | } |
| 642 | else | 643 | else |
| @@ -665,8 +666,6 @@ detect_coding_emacs_mule (src, src_end, multibytep) | |||
| 665 | } | 666 | } |
| 666 | } | 667 | } |
| 667 | } | 668 | } |
| 668 | label_end_of_loop: | ||
| 669 | return CODING_CATEGORY_MASK_EMACS_MULE; | ||
| 670 | } | 669 | } |
| 671 | 670 | ||
| 672 | 671 | ||
| @@ -1421,9 +1420,9 @@ detect_coding_iso2022 (src, src_end, multibytep) | |||
| 1421 | Lisp_Object safe_chars; | 1420 | Lisp_Object safe_chars; |
| 1422 | 1421 | ||
| 1423 | reg[0] = CHARSET_ASCII, reg[1] = reg[2] = reg[3] = -1; | 1422 | reg[0] = CHARSET_ASCII, reg[1] = reg[2] = reg[3] = -1; |
| 1424 | while (mask && src < src_end) | 1423 | while (mask) |
| 1425 | { | 1424 | { |
| 1426 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); | 1425 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, mask & mask_found); |
| 1427 | retry: | 1426 | retry: |
| 1428 | switch (c) | 1427 | switch (c) |
| 1429 | { | 1428 | { |
| @@ -1431,11 +1430,11 @@ detect_coding_iso2022 (src, src_end, multibytep) | |||
| 1431 | if (inhibit_iso_escape_detection) | 1430 | if (inhibit_iso_escape_detection) |
| 1432 | break; | 1431 | break; |
| 1433 | single_shifting = 0; | 1432 | single_shifting = 0; |
| 1434 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); | 1433 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, mask & mask_found); |
| 1435 | if (c >= '(' && c <= '/') | 1434 | if (c >= '(' && c <= '/') |
| 1436 | { | 1435 | { |
| 1437 | /* Designation sequence for a charset of dimension 1. */ | 1436 | /* Designation sequence for a charset of dimension 1. */ |
| 1438 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep); | 1437 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep, mask & mask_found); |
| 1439 | if (c1 < ' ' || c1 >= 0x80 | 1438 | if (c1 < ' ' || c1 >= 0x80 |
| 1440 | || (charset = iso_charset_table[0][c >= ','][c1]) < 0) | 1439 | || (charset = iso_charset_table[0][c >= ','][c1]) < 0) |
| 1441 | /* Invalid designation sequence. Just ignore. */ | 1440 | /* Invalid designation sequence. Just ignore. */ |
| @@ -1445,13 +1444,14 @@ detect_coding_iso2022 (src, src_end, multibytep) | |||
| 1445 | else if (c == '$') | 1444 | else if (c == '$') |
| 1446 | { | 1445 | { |
| 1447 | /* Designation sequence for a charset of dimension 2. */ | 1446 | /* Designation sequence for a charset of dimension 2. */ |
| 1448 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); | 1447 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, mask & mask_found); |
| 1449 | if (c >= '@' && c <= 'B') | 1448 | if (c >= '@' && c <= 'B') |
| 1450 | /* Designation for JISX0208.1978, GB2312, or JISX0208. */ | 1449 | /* Designation for JISX0208.1978, GB2312, or JISX0208. */ |
| 1451 | reg[0] = charset = iso_charset_table[1][0][c]; | 1450 | reg[0] = charset = iso_charset_table[1][0][c]; |
| 1452 | else if (c >= '(' && c <= '/') | 1451 | else if (c >= '(' && c <= '/') |
| 1453 | { | 1452 | { |
| 1454 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep); | 1453 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep, |
| 1454 | mask & mask_found); | ||
| 1455 | if (c1 < ' ' || c1 >= 0x80 | 1455 | if (c1 < ' ' || c1 >= 0x80 |
| 1456 | || (charset = iso_charset_table[1][c >= ','][c1]) < 0) | 1456 | || (charset = iso_charset_table[1][c >= ','][c1]) < 0) |
| 1457 | /* Invalid designation sequence. Just ignore. */ | 1457 | /* Invalid designation sequence. Just ignore. */ |
| @@ -1626,7 +1626,8 @@ detect_coding_iso2022 (src, src_end, multibytep) | |||
| 1626 | c = -1; | 1626 | c = -1; |
| 1627 | while (src < src_end) | 1627 | while (src < src_end) |
| 1628 | { | 1628 | { |
| 1629 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); | 1629 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, |
| 1630 | mask & mask_found); | ||
| 1630 | if (c < 0xA0) | 1631 | if (c < 0xA0) |
| 1631 | break; | 1632 | break; |
| 1632 | i++; | 1633 | i++; |
| @@ -1644,7 +1645,6 @@ detect_coding_iso2022 (src, src_end, multibytep) | |||
| 1644 | break; | 1645 | break; |
| 1645 | } | 1646 | } |
| 1646 | } | 1647 | } |
| 1647 | label_end_of_loop: | ||
| 1648 | return (mask & mask_found); | 1648 | return (mask & mask_found); |
| 1649 | } | 1649 | } |
| 1650 | 1650 | ||
| @@ -2915,20 +2915,18 @@ detect_coding_sjis (src, src_end, multibytep) | |||
| 2915 | 2915 | ||
| 2916 | while (1) | 2916 | while (1) |
| 2917 | { | 2917 | { |
| 2918 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); | 2918 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_SJIS); |
| 2919 | if (c < 0x80) | 2919 | if (c < 0x80) |
| 2920 | continue; | 2920 | continue; |
| 2921 | if (c == 0x80 || c == 0xA0 || c > 0xEF) | 2921 | if (c == 0x80 || c == 0xA0 || c > 0xEF) |
| 2922 | return 0; | 2922 | return 0; |
| 2923 | if (c <= 0x9F || c >= 0xE0) | 2923 | if (c <= 0x9F || c >= 0xE0) |
| 2924 | { | 2924 | { |
| 2925 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); | 2925 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0); |
| 2926 | if (c < 0x40 || c == 0x7F || c > 0xFC) | 2926 | if (c < 0x40 || c == 0x7F || c > 0xFC) |
| 2927 | return 0; | 2927 | return 0; |
| 2928 | } | 2928 | } |
| 2929 | } | 2929 | } |
| 2930 | label_end_of_loop: | ||
| 2931 | return CODING_CATEGORY_MASK_SJIS; | ||
| 2932 | } | 2930 | } |
| 2933 | 2931 | ||
| 2934 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". | 2932 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". |
| @@ -2947,17 +2945,15 @@ detect_coding_big5 (src, src_end, multibytep) | |||
| 2947 | 2945 | ||
| 2948 | while (1) | 2946 | while (1) |
| 2949 | { | 2947 | { |
| 2950 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); | 2948 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_BIG5); |
| 2951 | if (c < 0x80) | 2949 | if (c < 0x80) |
| 2952 | continue; | 2950 | continue; |
| 2953 | if (c < 0xA1 || c > 0xFE) | 2951 | if (c < 0xA1 || c > 0xFE) |
| 2954 | return 0; | 2952 | return 0; |
| 2955 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); | 2953 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0); |
| 2956 | if (c < 0x40 || (c > 0x7F && c < 0xA1) || c > 0xFE) | 2954 | if (c < 0x40 || (c > 0x7F && c < 0xA1) || c > 0xFE) |
| 2957 | return 0; | 2955 | return 0; |
| 2958 | } | 2956 | } |
| 2959 | label_end_of_loop: | ||
| 2960 | return CODING_CATEGORY_MASK_BIG5; | ||
| 2961 | } | 2957 | } |
| 2962 | 2958 | ||
| 2963 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". | 2959 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". |
| @@ -2985,7 +2981,7 @@ detect_coding_utf_8 (src, src_end, multibytep) | |||
| 2985 | 2981 | ||
| 2986 | while (1) | 2982 | while (1) |
| 2987 | { | 2983 | { |
| 2988 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); | 2984 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_UTF_8); |
| 2989 | if (UTF_8_1_OCTET_P (c)) | 2985 | if (UTF_8_1_OCTET_P (c)) |
| 2990 | continue; | 2986 | continue; |
| 2991 | else if (UTF_8_2_OCTET_LEADING_P (c)) | 2987 | else if (UTF_8_2_OCTET_LEADING_P (c)) |
| @@ -3003,16 +2999,13 @@ detect_coding_utf_8 (src, src_end, multibytep) | |||
| 3003 | 2999 | ||
| 3004 | do | 3000 | do |
| 3005 | { | 3001 | { |
| 3006 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); | 3002 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0); |
| 3007 | if (!UTF_8_EXTRA_OCTET_P (c)) | 3003 | if (!UTF_8_EXTRA_OCTET_P (c)) |
| 3008 | return 0; | 3004 | return 0; |
| 3009 | seq_maybe_bytes--; | 3005 | seq_maybe_bytes--; |
| 3010 | } | 3006 | } |
| 3011 | while (seq_maybe_bytes > 0); | 3007 | while (seq_maybe_bytes > 0); |
| 3012 | } | 3008 | } |
| 3013 | |||
| 3014 | label_end_of_loop: | ||
| 3015 | return CODING_CATEGORY_MASK_UTF_8; | ||
| 3016 | } | 3009 | } |
| 3017 | 3010 | ||
| 3018 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". | 3011 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". |
| @@ -3041,15 +3034,13 @@ detect_coding_utf_16 (src, src_end, multibytep) | |||
| 3041 | struct coding_system dummy_coding; | 3034 | struct coding_system dummy_coding; |
| 3042 | struct coding_system *coding = &dummy_coding; | 3035 | struct coding_system *coding = &dummy_coding; |
| 3043 | 3036 | ||
| 3044 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep); | 3037 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep, 0); |
| 3045 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c2, multibytep); | 3038 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c2, multibytep, 0); |
| 3046 | 3039 | ||
| 3047 | if ((c1 == 0xFF) && (c2 == 0xFE)) | 3040 | if ((c1 == 0xFF) && (c2 == 0xFE)) |
| 3048 | return CODING_CATEGORY_MASK_UTF_16_LE; | 3041 | return CODING_CATEGORY_MASK_UTF_16_LE; |
| 3049 | else if ((c1 == 0xFE) && (c2 == 0xFF)) | 3042 | else if ((c1 == 0xFE) && (c2 == 0xFF)) |
| 3050 | return CODING_CATEGORY_MASK_UTF_16_BE; | 3043 | return CODING_CATEGORY_MASK_UTF_16_BE; |
| 3051 | |||
| 3052 | label_end_of_loop: | ||
| 3053 | return 0; | 3044 | return 0; |
| 3054 | } | 3045 | } |
| 3055 | 3046 | ||
| @@ -3318,12 +3309,10 @@ detect_coding_ccl (src, src_end, multibytep) | |||
| 3318 | valid = coding_system_table[CODING_CATEGORY_IDX_CCL]->spec.ccl.valid_codes; | 3309 | valid = coding_system_table[CODING_CATEGORY_IDX_CCL]->spec.ccl.valid_codes; |
| 3319 | while (1) | 3310 | while (1) |
| 3320 | { | 3311 | { |
| 3321 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); | 3312 | ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_CCL); |
| 3322 | if (! valid[c]) | 3313 | if (! valid[c]) |
| 3323 | return 0; | 3314 | return 0; |
| 3324 | } | 3315 | } |
| 3325 | label_end_of_loop: | ||
| 3326 | return CODING_CATEGORY_MASK_CCL; | ||
| 3327 | } | 3316 | } |
| 3328 | 3317 | ||
| 3329 | 3318 | ||
| @@ -7547,7 +7536,10 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS ...) */) | |||
| 7547 | return Fcons (val, val); | 7536 | return Fcons (val, val); |
| 7548 | if (! NILP (Ffboundp (val))) | 7537 | if (! NILP (Ffboundp (val))) |
| 7549 | { | 7538 | { |
| 7550 | val = safe_call1 (val, Flist (nargs, args)); | 7539 | /* We use call1 rather than safe_call1 |
| 7540 | so as to get bug reports about functions called here | ||
| 7541 | which don't handle the current interface. */ | ||
| 7542 | val = call1 (val, Flist (nargs, args)); | ||
| 7551 | if (CONSP (val)) | 7543 | if (CONSP (val)) |
| 7552 | return val; | 7544 | return val; |
| 7553 | if (SYMBOLP (val) && ! NILP (Fcoding_system_p (val))) | 7545 | if (SYMBOLP (val) && ! NILP (Fcoding_system_p (val))) |
| @@ -7971,8 +7963,9 @@ the file contents. | |||
| 7971 | If VAL is a cons of coding systems, the car part is used for decoding, | 7963 | If VAL is a cons of coding systems, the car part is used for decoding, |
| 7972 | and the cdr part is used for encoding. | 7964 | and the cdr part is used for encoding. |
| 7973 | If VAL is a function symbol, the function must return a coding system | 7965 | If VAL is a function symbol, the function must return a coding system |
| 7974 | or a cons of coding systems which are used as above. The function gets | 7966 | or a cons of coding systems which are used as above. The function is |
| 7975 | the arguments with which `find-operation-coding-system' was called. | 7967 | called with an argument that is a list of the arguments with which |
| 7968 | `find-operation-coding-system' was called. | ||
| 7976 | 7969 | ||
| 7977 | See also the function `find-operation-coding-system' | 7970 | See also the function `find-operation-coding-system' |
| 7978 | and the variable `auto-coding-alist'. */); | 7971 | and the variable `auto-coding-alist'. */); |
diff --git a/src/dired.c b/src/dired.c index 17a80a3ce4b..b469d682c41 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -134,7 +134,9 @@ directory_files_internal_unwind (dh) | |||
| 134 | Lisp_Object dh; | 134 | Lisp_Object dh; |
| 135 | { | 135 | { |
| 136 | DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer; | 136 | DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer; |
| 137 | BLOCK_INPUT; | ||
| 137 | closedir (d); | 138 | closedir (d); |
| 139 | UNBLOCK_INPUT; | ||
| 138 | return Qnil; | 140 | return Qnil; |
| 139 | } | 141 | } |
| 140 | 142 | ||
| @@ -196,7 +198,9 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format) | |||
| 196 | /* Now *bufp is the compiled form of MATCH; don't call anything | 198 | /* Now *bufp is the compiled form of MATCH; don't call anything |
| 197 | which might compile a new regexp until we're done with the loop! */ | 199 | which might compile a new regexp until we're done with the loop! */ |
| 198 | 200 | ||
| 201 | BLOCK_INPUT; | ||
| 199 | d = opendir (SDATA (dirfilename)); | 202 | d = opendir (SDATA (dirfilename)); |
| 203 | UNBLOCK_INPUT; | ||
| 200 | if (d == NULL) | 204 | if (d == NULL) |
| 201 | report_file_error ("Opening directory", Fcons (directory, Qnil)); | 205 | report_file_error ("Opening directory", Fcons (directory, Qnil)); |
| 202 | 206 | ||
| @@ -321,7 +325,9 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format) | |||
| 321 | } | 325 | } |
| 322 | } | 326 | } |
| 323 | 327 | ||
| 328 | BLOCK_INPUT; | ||
| 324 | closedir (d); | 329 | closedir (d); |
| 330 | UNBLOCK_INPUT; | ||
| 325 | 331 | ||
| 326 | /* Discard the unwind protect. */ | 332 | /* Discard the unwind protect. */ |
| 327 | specpdl_ptr = specpdl + count; | 333 | specpdl_ptr = specpdl + count; |
| @@ -508,7 +514,9 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 508 | { | 514 | { |
| 509 | int inner_count = SPECPDL_INDEX (); | 515 | int inner_count = SPECPDL_INDEX (); |
| 510 | 516 | ||
| 517 | BLOCK_INPUT; | ||
| 511 | d = opendir (SDATA (Fdirectory_file_name (encoded_dir))); | 518 | d = opendir (SDATA (Fdirectory_file_name (encoded_dir))); |
| 519 | UNBLOCK_INPUT; | ||
| 512 | if (!d) | 520 | if (!d) |
| 513 | report_file_error ("Opening directory", Fcons (dirname, Qnil)); | 521 | report_file_error ("Opening directory", Fcons (dirname, Qnil)); |
| 514 | 522 | ||
diff --git a/src/editfns.c b/src/editfns.c index aea044db068..c43528c4863 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -629,10 +629,7 @@ find_field (pos, merge_at_boundary, beg_limit, beg, end_limit, end) | |||
| 629 | DEFUN ("delete-field", Fdelete_field, Sdelete_field, 0, 1, 0, | 629 | DEFUN ("delete-field", Fdelete_field, Sdelete_field, 0, 1, 0, |
| 630 | doc: /* Delete the field surrounding POS. | 630 | doc: /* Delete the field surrounding POS. |
| 631 | A field is a region of text with the same `field' property. | 631 | A field is a region of text with the same `field' property. |
| 632 | If POS is nil, the value of point is used for POS. | 632 | If POS is nil, the value of point is used for POS. */) |
| 633 | |||
| 634 | An `args-out-of-range' error is signaled if POS is outside the | ||
| 635 | buffer's accessible portion. */) | ||
| 636 | (pos) | 633 | (pos) |
| 637 | Lisp_Object pos; | 634 | Lisp_Object pos; |
| 638 | { | 635 | { |
| @@ -646,10 +643,7 @@ buffer's accessible portion. */) | |||
| 646 | DEFUN ("field-string", Ffield_string, Sfield_string, 0, 1, 0, | 643 | DEFUN ("field-string", Ffield_string, Sfield_string, 0, 1, 0, |
| 647 | doc: /* Return the contents of the field surrounding POS as a string. | 644 | doc: /* Return the contents of the field surrounding POS as a string. |
| 648 | A field is a region of text with the same `field' property. | 645 | A field is a region of text with the same `field' property. |
| 649 | If POS is nil, the value of point is used for POS. | 646 | If POS is nil, the value of point is used for POS. */) |
| 650 | |||
| 651 | An `args-out-of-range' error is signaled if POS is outside the | ||
| 652 | buffer's accessible portion. */) | ||
| 653 | (pos) | 647 | (pos) |
| 654 | Lisp_Object pos; | 648 | Lisp_Object pos; |
| 655 | { | 649 | { |
| @@ -661,10 +655,7 @@ buffer's accessible portion. */) | |||
| 661 | DEFUN ("field-string-no-properties", Ffield_string_no_properties, Sfield_string_no_properties, 0, 1, 0, | 655 | DEFUN ("field-string-no-properties", Ffield_string_no_properties, Sfield_string_no_properties, 0, 1, 0, |
| 662 | doc: /* Return the contents of the field around POS, without text-properties. | 656 | doc: /* Return the contents of the field around POS, without text-properties. |
| 663 | A field is a region of text with the same `field' property. | 657 | A field is a region of text with the same `field' property. |
| 664 | If POS is nil, the value of point is used for POS. | 658 | If POS is nil, the value of point is used for POS. */) |
| 665 | |||
| 666 | An `args-out-of-range' error is signaled if POS is outside the | ||
| 667 | buffer's accessible portion. */) | ||
| 668 | (pos) | 659 | (pos) |
| 669 | Lisp_Object pos; | 660 | Lisp_Object pos; |
| 670 | { | 661 | { |
| @@ -680,10 +671,7 @@ If POS is nil, the value of point is used for POS. | |||
| 680 | If ESCAPE-FROM-EDGE is non-nil and POS is at the beginning of its | 671 | If ESCAPE-FROM-EDGE is non-nil and POS is at the beginning of its |
| 681 | field, then the beginning of the *previous* field is returned. | 672 | field, then the beginning of the *previous* field is returned. |
| 682 | If LIMIT is non-nil, it is a buffer position; if the beginning of the field | 673 | If LIMIT is non-nil, it is a buffer position; if the beginning of the field |
| 683 | is before LIMIT, then LIMIT will be returned instead. | 674 | is before LIMIT, then LIMIT will be returned instead. */) |
| 684 | |||
| 685 | An `args-out-of-range' error is signaled if POS is outside the | ||
| 686 | buffer's accessible portion. */) | ||
| 687 | (pos, escape_from_edge, limit) | 675 | (pos, escape_from_edge, limit) |
| 688 | Lisp_Object pos, escape_from_edge, limit; | 676 | Lisp_Object pos, escape_from_edge, limit; |
| 689 | { | 677 | { |
| @@ -699,10 +687,7 @@ If POS is nil, the value of point is used for POS. | |||
| 699 | If ESCAPE-FROM-EDGE is non-nil and POS is at the end of its field, | 687 | If ESCAPE-FROM-EDGE is non-nil and POS is at the end of its field, |
| 700 | then the end of the *following* field is returned. | 688 | then the end of the *following* field is returned. |
| 701 | If LIMIT is non-nil, it is a buffer position; if the end of the field | 689 | If LIMIT is non-nil, it is a buffer position; if the end of the field |
| 702 | is after LIMIT, then LIMIT will be returned instead. | 690 | is after LIMIT, then LIMIT will be returned instead. */) |
| 703 | |||
| 704 | An `args-out-of-range' error is signaled if POS is outside the | ||
| 705 | buffer's accessible portion. */) | ||
| 706 | (pos, escape_from_edge, limit) | 691 | (pos, escape_from_edge, limit) |
| 707 | Lisp_Object pos, escape_from_edge, limit; | 692 | Lisp_Object pos, escape_from_edge, limit; |
| 708 | { | 693 | { |
| @@ -1450,14 +1435,11 @@ resolution finer than a second. */) | |||
| 1450 | () | 1435 | () |
| 1451 | { | 1436 | { |
| 1452 | EMACS_TIME t; | 1437 | EMACS_TIME t; |
| 1453 | Lisp_Object result[3]; | ||
| 1454 | 1438 | ||
| 1455 | EMACS_GET_TIME (t); | 1439 | EMACS_GET_TIME (t); |
| 1456 | XSETINT (result[0], (EMACS_SECS (t) >> 16) & 0xffff); | 1440 | return list3 (make_number ((EMACS_SECS (t) >> 16) & 0xffff), |
| 1457 | XSETINT (result[1], (EMACS_SECS (t) >> 0) & 0xffff); | 1441 | make_number ((EMACS_SECS (t) >> 0) & 0xffff), |
| 1458 | XSETINT (result[2], EMACS_USECS (t)); | 1442 | make_number (EMACS_USECS (t))); |
| 1459 | |||
| 1460 | return Flist (3, result); | ||
| 1461 | } | 1443 | } |
| 1462 | 1444 | ||
| 1463 | DEFUN ("get-internal-run-time", Fget_internal_run_time, Sget_internal_run_time, | 1445 | DEFUN ("get-internal-run-time", Fget_internal_run_time, Sget_internal_run_time, |
| @@ -1475,7 +1457,6 @@ systems that do not provide resolution finer than a second. */) | |||
| 1475 | { | 1457 | { |
| 1476 | #ifdef HAVE_GETRUSAGE | 1458 | #ifdef HAVE_GETRUSAGE |
| 1477 | struct rusage usage; | 1459 | struct rusage usage; |
| 1478 | Lisp_Object result[3]; | ||
| 1479 | int secs, usecs; | 1460 | int secs, usecs; |
| 1480 | 1461 | ||
| 1481 | if (getrusage (RUSAGE_SELF, &usage) < 0) | 1462 | if (getrusage (RUSAGE_SELF, &usage) < 0) |
| @@ -1491,11 +1472,9 @@ systems that do not provide resolution finer than a second. */) | |||
| 1491 | secs++; | 1472 | secs++; |
| 1492 | } | 1473 | } |
| 1493 | 1474 | ||
| 1494 | XSETINT (result[0], (secs >> 16) & 0xffff); | 1475 | return list3 (make_number ((secs >> 16) & 0xffff), |
| 1495 | XSETINT (result[1], (secs >> 0) & 0xffff); | 1476 | make_number ((secs >> 0) & 0xffff), |
| 1496 | XSETINT (result[2], usecs); | 1477 | make_number (usecs)); |
| 1497 | |||
| 1498 | return Flist (3, result); | ||
| 1499 | #else | 1478 | #else |
| 1500 | return Fcurrent_time (); | 1479 | return Fcurrent_time (); |
| 1501 | #endif | 1480 | #endif |
| @@ -2706,6 +2685,10 @@ Both characters must have the same length of multi-byte form. */) | |||
| 2706 | Lisp_Object start, end, fromchar, tochar, noundo; | 2685 | Lisp_Object start, end, fromchar, tochar, noundo; |
| 2707 | { | 2686 | { |
| 2708 | register int pos, pos_byte, stop, i, len, end_byte; | 2687 | register int pos, pos_byte, stop, i, len, end_byte; |
| 2688 | /* Keep track of the first change in the buffer: | ||
| 2689 | if 0 we haven't found it yet. | ||
| 2690 | if < 0 we've found it and we've run the before-change-function. | ||
| 2691 | if > 0 we've actually performed it and the value is its position. */ | ||
| 2709 | int changed = 0; | 2692 | int changed = 0; |
| 2710 | unsigned char fromstr[MAX_MULTIBYTE_LENGTH], tostr[MAX_MULTIBYTE_LENGTH]; | 2693 | unsigned char fromstr[MAX_MULTIBYTE_LENGTH], tostr[MAX_MULTIBYTE_LENGTH]; |
| 2711 | unsigned char *p; | 2694 | unsigned char *p; |
| @@ -2718,6 +2701,8 @@ Both characters must have the same length of multi-byte form. */) | |||
| 2718 | int last_changed = 0; | 2701 | int last_changed = 0; |
| 2719 | int multibyte_p = !NILP (current_buffer->enable_multibyte_characters); | 2702 | int multibyte_p = !NILP (current_buffer->enable_multibyte_characters); |
| 2720 | 2703 | ||
| 2704 | restart: | ||
| 2705 | |||
| 2721 | validate_region (&start, &end); | 2706 | validate_region (&start, &end); |
| 2722 | CHECK_NUMBER (fromchar); | 2707 | CHECK_NUMBER (fromchar); |
| 2723 | CHECK_NUMBER (tochar); | 2708 | CHECK_NUMBER (tochar); |
| @@ -2755,7 +2740,7 @@ Both characters must have the same length of multi-byte form. */) | |||
| 2755 | That's faster than getting rid of things, | 2740 | That's faster than getting rid of things, |
| 2756 | and it prevents even the entry for a first change. | 2741 | and it prevents even the entry for a first change. |
| 2757 | Also inhibit locking the file. */ | 2742 | Also inhibit locking the file. */ |
| 2758 | if (!NILP (noundo)) | 2743 | if (!changed && !NILP (noundo)) |
| 2759 | { | 2744 | { |
| 2760 | record_unwind_protect (subst_char_in_region_unwind, | 2745 | record_unwind_protect (subst_char_in_region_unwind, |
| 2761 | current_buffer->undo_list); | 2746 | current_buffer->undo_list); |
| @@ -2789,10 +2774,14 @@ Both characters must have the same length of multi-byte form. */) | |||
| 2789 | && (len == 2 || (p[2] == fromstr[2] | 2774 | && (len == 2 || (p[2] == fromstr[2] |
| 2790 | && (len == 3 || p[3] == fromstr[3])))))) | 2775 | && (len == 3 || p[3] == fromstr[3])))))) |
| 2791 | { | 2776 | { |
| 2792 | if (! changed) | 2777 | if (changed < 0) |
| 2778 | /* We've already seen this and run the before-change-function; | ||
| 2779 | this time we only need to record the actual position. */ | ||
| 2780 | changed = pos; | ||
| 2781 | else if (!changed) | ||
| 2793 | { | 2782 | { |
| 2794 | changed = pos; | 2783 | changed = -1; |
| 2795 | modify_region (current_buffer, changed, XINT (end)); | 2784 | modify_region (current_buffer, pos, XINT (end)); |
| 2796 | 2785 | ||
| 2797 | if (! NILP (noundo)) | 2786 | if (! NILP (noundo)) |
| 2798 | { | 2787 | { |
| @@ -2801,6 +2790,10 @@ Both characters must have the same length of multi-byte form. */) | |||
| 2801 | if (MODIFF - 1 == current_buffer->auto_save_modified) | 2790 | if (MODIFF - 1 == current_buffer->auto_save_modified) |
| 2802 | current_buffer->auto_save_modified++; | 2791 | current_buffer->auto_save_modified++; |
| 2803 | } | 2792 | } |
| 2793 | |||
| 2794 | /* The before-change-function may have moved the gap | ||
| 2795 | or even modified the buffer so we should start over. */ | ||
| 2796 | goto restart; | ||
| 2804 | } | 2797 | } |
| 2805 | 2798 | ||
| 2806 | /* Take care of the case where the new character | 2799 | /* Take care of the case where the new character |
| @@ -2853,7 +2846,7 @@ Both characters must have the same length of multi-byte form. */) | |||
| 2853 | pos++; | 2846 | pos++; |
| 2854 | } | 2847 | } |
| 2855 | 2848 | ||
| 2856 | if (changed) | 2849 | if (changed > 0) |
| 2857 | { | 2850 | { |
| 2858 | signal_after_change (changed, | 2851 | signal_after_change (changed, |
| 2859 | last_changed - changed, last_changed - changed); | 2852 | last_changed - changed, last_changed - changed); |
diff --git a/src/fileio.c b/src/fileio.c index 8ac528cafb9..62d539dcfca 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2650,7 +2650,7 @@ DEFUN ("make-directory-internal", Fmake_directory_internal, | |||
| 2650 | #else | 2650 | #else |
| 2651 | if (mkdir (dir, 0777) != 0) | 2651 | if (mkdir (dir, 0777) != 0) |
| 2652 | #endif | 2652 | #endif |
| 2653 | report_file_error ("Creating directory", Flist (1, &directory)); | 2653 | report_file_error ("Creating directory", list1 (directory)); |
| 2654 | 2654 | ||
| 2655 | return Qnil; | 2655 | return Qnil; |
| 2656 | } | 2656 | } |
| @@ -2676,7 +2676,7 @@ DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete | |||
| 2676 | dir = SDATA (encoded_dir); | 2676 | dir = SDATA (encoded_dir); |
| 2677 | 2677 | ||
| 2678 | if (rmdir (dir) != 0) | 2678 | if (rmdir (dir) != 0) |
| 2679 | report_file_error ("Removing directory", Flist (1, &directory)); | 2679 | report_file_error ("Removing directory", list1 (directory)); |
| 2680 | 2680 | ||
| 2681 | return Qnil; | 2681 | return Qnil; |
| 2682 | } | 2682 | } |
| @@ -2707,7 +2707,7 @@ If file has multiple names, it continues to exist with the other names. */) | |||
| 2707 | encoded_file = ENCODE_FILE (filename); | 2707 | encoded_file = ENCODE_FILE (filename); |
| 2708 | 2708 | ||
| 2709 | if (0 > unlink (SDATA (encoded_file))) | 2709 | if (0 > unlink (SDATA (encoded_file))) |
| 2710 | report_file_error ("Removing old name", Flist (1, &filename)); | 2710 | report_file_error ("Removing old name", list1 (filename)); |
| 2711 | return Qnil; | 2711 | return Qnil; |
| 2712 | } | 2712 | } |
| 2713 | 2713 | ||
| @@ -2741,9 +2741,6 @@ This is what happens in interactive use with M-x. */) | |||
| 2741 | (file, newname, ok_if_already_exists) | 2741 | (file, newname, ok_if_already_exists) |
| 2742 | Lisp_Object file, newname, ok_if_already_exists; | 2742 | Lisp_Object file, newname, ok_if_already_exists; |
| 2743 | { | 2743 | { |
| 2744 | #ifdef NO_ARG_ARRAY | ||
| 2745 | Lisp_Object args[2]; | ||
| 2746 | #endif | ||
| 2747 | Lisp_Object handler; | 2744 | Lisp_Object handler; |
| 2748 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; | 2745 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; |
| 2749 | Lisp_Object encoded_file, encoded_newname, symlink_target; | 2746 | Lisp_Object encoded_file, encoded_newname, symlink_target; |
| @@ -2812,15 +2809,7 @@ This is what happens in interactive use with M-x. */) | |||
| 2812 | Fdelete_file (file); | 2809 | Fdelete_file (file); |
| 2813 | } | 2810 | } |
| 2814 | else | 2811 | else |
| 2815 | #ifdef NO_ARG_ARRAY | 2812 | report_file_error ("Renaming", list2 (file, newname)); |
| 2816 | { | ||
| 2817 | args[0] = file; | ||
| 2818 | args[1] = newname; | ||
| 2819 | report_file_error ("Renaming", Flist (2, args)); | ||
| 2820 | } | ||
| 2821 | #else | ||
| 2822 | report_file_error ("Renaming", Flist (2, &file)); | ||
| 2823 | #endif | ||
| 2824 | } | 2813 | } |
| 2825 | UNGCPRO; | 2814 | UNGCPRO; |
| 2826 | return Qnil; | 2815 | return Qnil; |
| @@ -2836,9 +2825,6 @@ This is what happens in interactive use with M-x. */) | |||
| 2836 | (file, newname, ok_if_already_exists) | 2825 | (file, newname, ok_if_already_exists) |
| 2837 | Lisp_Object file, newname, ok_if_already_exists; | 2826 | Lisp_Object file, newname, ok_if_already_exists; |
| 2838 | { | 2827 | { |
| 2839 | #ifdef NO_ARG_ARRAY | ||
| 2840 | Lisp_Object args[2]; | ||
| 2841 | #endif | ||
| 2842 | Lisp_Object handler; | 2828 | Lisp_Object handler; |
| 2843 | Lisp_Object encoded_file, encoded_newname; | 2829 | Lisp_Object encoded_file, encoded_newname; |
| 2844 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 2830 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| @@ -2878,15 +2864,7 @@ This is what happens in interactive use with M-x. */) | |||
| 2878 | 2864 | ||
| 2879 | unlink (SDATA (newname)); | 2865 | unlink (SDATA (newname)); |
| 2880 | if (0 > link (SDATA (encoded_file), SDATA (encoded_newname))) | 2866 | if (0 > link (SDATA (encoded_file), SDATA (encoded_newname))) |
| 2881 | { | 2867 | report_file_error ("Adding new name", list2 (file, newname)); |
| 2882 | #ifdef NO_ARG_ARRAY | ||
| 2883 | args[0] = file; | ||
| 2884 | args[1] = newname; | ||
| 2885 | report_file_error ("Adding new name", Flist (2, args)); | ||
| 2886 | #else | ||
| 2887 | report_file_error ("Adding new name", Flist (2, &file)); | ||
| 2888 | #endif | ||
| 2889 | } | ||
| 2890 | 2868 | ||
| 2891 | UNGCPRO; | 2869 | UNGCPRO; |
| 2892 | return Qnil; | 2870 | return Qnil; |
| @@ -2904,9 +2882,6 @@ This happens for interactive use with M-x. */) | |||
| 2904 | (filename, linkname, ok_if_already_exists) | 2882 | (filename, linkname, ok_if_already_exists) |
| 2905 | Lisp_Object filename, linkname, ok_if_already_exists; | 2883 | Lisp_Object filename, linkname, ok_if_already_exists; |
| 2906 | { | 2884 | { |
| 2907 | #ifdef NO_ARG_ARRAY | ||
| 2908 | Lisp_Object args[2]; | ||
| 2909 | #endif | ||
| 2910 | Lisp_Object handler; | 2885 | Lisp_Object handler; |
| 2911 | Lisp_Object encoded_filename, encoded_linkname; | 2886 | Lisp_Object encoded_filename, encoded_linkname; |
| 2912 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 2887 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| @@ -2962,13 +2937,7 @@ This happens for interactive use with M-x. */) | |||
| 2962 | } | 2937 | } |
| 2963 | } | 2938 | } |
| 2964 | 2939 | ||
| 2965 | #ifdef NO_ARG_ARRAY | 2940 | report_file_error ("Making symbolic link", list2 (filename, linkname)); |
| 2966 | args[0] = filename; | ||
| 2967 | args[1] = linkname; | ||
| 2968 | report_file_error ("Making symbolic link", Flist (2, args)); | ||
| 2969 | #else | ||
| 2970 | report_file_error ("Making symbolic link", Flist (2, &filename)); | ||
| 2971 | #endif | ||
| 2972 | } | 2941 | } |
| 2973 | UNGCPRO; | 2942 | UNGCPRO; |
| 2974 | return Qnil; | 2943 | return Qnil; |
| @@ -4847,6 +4816,8 @@ choose_write_coding_system (start, end, filename, | |||
| 4847 | /* ... but with the special flag to indicate not to strip off | 4816 | /* ... but with the special flag to indicate not to strip off |
| 4848 | leading code of eight-bit-control chars. */ | 4817 | leading code of eight-bit-control chars. */ |
| 4849 | coding->flags = 1; | 4818 | coding->flags = 1; |
| 4819 | /* We force LF for end-of-line because that is faster. */ | ||
| 4820 | coding->eol_type = CODING_EOL_LF; | ||
| 4850 | goto done_setup_coding; | 4821 | goto done_setup_coding; |
| 4851 | } | 4822 | } |
| 4852 | else if (!NILP (Vcoding_system_for_write)) | 4823 | else if (!NILP (Vcoding_system_for_write)) |
| @@ -5030,7 +5030,7 @@ sxhash_string (ptr, len) | |||
| 5030 | c = *p++; | 5030 | c = *p++; |
| 5031 | if (c >= 0140) | 5031 | if (c >= 0140) |
| 5032 | c -= 40; | 5032 | c -= 40; |
| 5033 | hash = ((hash << 3) + (hash >> 28) + c); | 5033 | hash = ((hash << 4) + (hash >> 28) + c); |
| 5034 | } | 5034 | } |
| 5035 | 5035 | ||
| 5036 | return hash & INTMASK; | 5036 | return hash & INTMASK; |
diff --git a/src/frame.c b/src/frame.c index fd10c3e273c..021e9bf604f 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -1679,7 +1679,8 @@ The functions are run with one arg, the frame to be deleted. */) | |||
| 1679 | DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, | 1679 | DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, |
| 1680 | doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. | 1680 | doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. |
| 1681 | The position is given in character cells, where (0, 0) is the | 1681 | The position is given in character cells, where (0, 0) is the |
| 1682 | upper-left corner. | 1682 | upper-left corner of the frame, X is the horizontal offset, and Y is |
| 1683 | the vertical offset. | ||
| 1683 | If Emacs is running on a mouseless terminal or hasn't been programmed | 1684 | If Emacs is running on a mouseless terminal or hasn't been programmed |
| 1684 | to read the mouse position, it returns the selected frame for FRAME | 1685 | to read the mouse position, it returns the selected frame for FRAME |
| 1685 | and nil for X and Y. | 1686 | and nil for X and Y. |
| @@ -1727,7 +1728,8 @@ DEFUN ("mouse-pixel-position", Fmouse_pixel_position, | |||
| 1727 | Smouse_pixel_position, 0, 0, 0, | 1728 | Smouse_pixel_position, 0, 0, 0, |
| 1728 | doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. | 1729 | doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. |
| 1729 | The position is given in pixel units, where (0, 0) is the | 1730 | The position is given in pixel units, where (0, 0) is the |
| 1730 | upper-left corner. | 1731 | upper-left corner of the frame, X is the horizontal offset, and Y is |
| 1732 | the vertical offset. | ||
| 1731 | If Emacs is running on a mouseless terminal or hasn't been programmed | 1733 | If Emacs is running on a mouseless terminal or hasn't been programmed |
| 1732 | to read the mouse position, it returns the selected frame for FRAME | 1734 | to read the mouse position, it returns the selected frame for FRAME |
| 1733 | and nil for X and Y. */) | 1735 | and nil for X and Y. */) |
| @@ -1760,6 +1762,10 @@ Coordinates are relative to the frame, not a window, | |||
| 1760 | so the coordinates of the top left character in the frame | 1762 | so the coordinates of the top left character in the frame |
| 1761 | may be nonzero due to left-hand scroll bars or the menu bar. | 1763 | may be nonzero due to left-hand scroll bars or the menu bar. |
| 1762 | 1764 | ||
| 1765 | The position is given in character cells, where (0, 0) is the | ||
| 1766 | upper-left corner of the frame, X is the horizontal offset, and Y is | ||
| 1767 | the vertical offset. | ||
| 1768 | |||
| 1763 | This function is a no-op for an X frame that is not visible. | 1769 | This function is a no-op for an X frame that is not visible. |
| 1764 | If you have just created a frame, you must wait for it to become visible | 1770 | If you have just created a frame, you must wait for it to become visible |
| 1765 | before calling this function on it, like this. | 1771 | before calling this function on it, like this. |
| @@ -1792,6 +1798,9 @@ before calling this function on it, like this. | |||
| 1792 | DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position, | 1798 | DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position, |
| 1793 | Sset_mouse_pixel_position, 3, 3, 0, | 1799 | Sset_mouse_pixel_position, 3, 3, 0, |
| 1794 | doc: /* Move the mouse pointer to pixel position (X,Y) in FRAME. | 1800 | doc: /* Move the mouse pointer to pixel position (X,Y) in FRAME. |
| 1801 | The position is given in pixels, where (0, 0) is the upper-left corner | ||
| 1802 | of the frame, X is the horizontal offset, and Y is the vertical offset. | ||
| 1803 | |||
| 1795 | Note, this is a no-op for an X frame that is not visible. | 1804 | Note, this is a no-op for an X frame that is not visible. |
| 1796 | If you have just created a frame, you must wait for it to become visible | 1805 | If you have just created a frame, you must wait for it to become visible |
| 1797 | before calling this function on it, like this. | 1806 | before calling this function on it, like this. |
diff --git a/src/image.c b/src/image.c index 490ede60e35..a3ae6ceb3ce 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -2398,7 +2398,7 @@ image_load_qt_1 (f, img, type, fss, dh) | |||
| 2398 | FSSpec *fss; | 2398 | FSSpec *fss; |
| 2399 | Handle dh; | 2399 | Handle dh; |
| 2400 | { | 2400 | { |
| 2401 | OSErr err; | 2401 | ComponentResult err; |
| 2402 | GraphicsImportComponent gi; | 2402 | GraphicsImportComponent gi; |
| 2403 | Rect rect; | 2403 | Rect rect; |
| 2404 | int width, height; | 2404 | int width, height; |
diff --git a/src/keyboard.c b/src/keyboard.c index f1bfea0f18c..681018bbab9 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1458,6 +1458,72 @@ DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, | |||
| 1458 | return Qnil; | 1458 | return Qnil; |
| 1459 | } | 1459 | } |
| 1460 | 1460 | ||
| 1461 | #ifdef HAVE_MOUSE | ||
| 1462 | |||
| 1463 | /* Restore mouse tracking enablement. See Ftrack_mouse for the only use | ||
| 1464 | of this function. */ | ||
| 1465 | |||
| 1466 | static Lisp_Object | ||
| 1467 | tracking_off (old_value) | ||
| 1468 | Lisp_Object old_value; | ||
| 1469 | { | ||
| 1470 | do_mouse_tracking = old_value; | ||
| 1471 | if (NILP (old_value)) | ||
| 1472 | { | ||
| 1473 | /* Redisplay may have been preempted because there was input | ||
| 1474 | available, and it assumes it will be called again after the | ||
| 1475 | input has been processed. If the only input available was | ||
| 1476 | the sort that we have just disabled, then we need to call | ||
| 1477 | redisplay. */ | ||
| 1478 | if (!readable_events (READABLE_EVENTS_DO_TIMERS_NOW)) | ||
| 1479 | { | ||
| 1480 | redisplay_preserve_echo_area (6); | ||
| 1481 | get_input_pending (&input_pending, | ||
| 1482 | READABLE_EVENTS_DO_TIMERS_NOW); | ||
| 1483 | } | ||
| 1484 | } | ||
| 1485 | return Qnil; | ||
| 1486 | } | ||
| 1487 | |||
| 1488 | DEFUN ("track-mouse", Ftrack_mouse, Strack_mouse, 0, UNEVALLED, 0, | ||
| 1489 | doc: /* Evaluate BODY with mouse movement events enabled. | ||
| 1490 | Within a `track-mouse' form, mouse motion generates input events that | ||
| 1491 | you can read with `read-event'. | ||
| 1492 | Normally, mouse motion is ignored. | ||
| 1493 | usage: (track-mouse BODY ...) */) | ||
| 1494 | (args) | ||
| 1495 | Lisp_Object args; | ||
| 1496 | { | ||
| 1497 | int count = SPECPDL_INDEX (); | ||
| 1498 | Lisp_Object val; | ||
| 1499 | |||
| 1500 | record_unwind_protect (tracking_off, do_mouse_tracking); | ||
| 1501 | |||
| 1502 | do_mouse_tracking = Qt; | ||
| 1503 | |||
| 1504 | val = Fprogn (args); | ||
| 1505 | return unbind_to (count, val); | ||
| 1506 | } | ||
| 1507 | |||
| 1508 | /* If mouse has moved on some frame, return one of those frames. | ||
| 1509 | Return 0 otherwise. */ | ||
| 1510 | |||
| 1511 | static FRAME_PTR | ||
| 1512 | some_mouse_moved () | ||
| 1513 | { | ||
| 1514 | Lisp_Object tail, frame; | ||
| 1515 | |||
| 1516 | FOR_EACH_FRAME (tail, frame) | ||
| 1517 | { | ||
| 1518 | if (XFRAME (frame)->mouse_moved) | ||
| 1519 | return XFRAME (frame); | ||
| 1520 | } | ||
| 1521 | |||
| 1522 | return 0; | ||
| 1523 | } | ||
| 1524 | |||
| 1525 | #endif /* HAVE_MOUSE */ | ||
| 1526 | |||
| 1461 | /* This is the actual command reading loop, | 1527 | /* This is the actual command reading loop, |
| 1462 | sans error-handling encapsulation. */ | 1528 | sans error-handling encapsulation. */ |
| 1463 | 1529 | ||
| @@ -2106,6 +2172,8 @@ static Lisp_Object | |||
| 2106 | safe_run_hooks_1 (hook) | 2172 | safe_run_hooks_1 (hook) |
| 2107 | Lisp_Object hook; | 2173 | Lisp_Object hook; |
| 2108 | { | 2174 | { |
| 2175 | if (NILP (Vrun_hooks)) | ||
| 2176 | return Qnil; | ||
| 2109 | return call1 (Vrun_hooks, Vinhibit_quit); | 2177 | return call1 (Vrun_hooks, Vinhibit_quit); |
| 2110 | } | 2178 | } |
| 2111 | 2179 | ||
| @@ -2388,7 +2456,17 @@ show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo) | |||
| 2388 | 2456 | ||
| 2389 | #ifdef HAVE_MOUSE | 2457 | #ifdef HAVE_MOUSE |
| 2390 | if (!noninteractive && STRINGP (help)) | 2458 | if (!noninteractive && STRINGP (help)) |
| 2391 | help = call1 (Qmouse_fixup_help_message, help); | 2459 | { |
| 2460 | /* The mouse-fixup-help-message Lisp function can call | ||
| 2461 | mouse_position_hook, which resets the mouse_moved flags. | ||
| 2462 | This causes trouble if we are trying to read a mouse motion | ||
| 2463 | event (i.e., if we are inside a `track-mouse' form), so we | ||
| 2464 | restore the mouse_moved flag. */ | ||
| 2465 | FRAME_PTR f = NILP (do_mouse_tracking) ? NULL : some_mouse_moved (); | ||
| 2466 | help = call1 (Qmouse_fixup_help_message, help); | ||
| 2467 | if (f) | ||
| 2468 | f->mouse_moved = 1; | ||
| 2469 | } | ||
| 2392 | #endif | 2470 | #endif |
| 2393 | 2471 | ||
| 2394 | if (STRINGP (help) || NILP (help)) | 2472 | if (STRINGP (help) || NILP (help)) |
| @@ -2483,7 +2561,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) | |||
| 2483 | EMACS_TIME *end_time; | 2561 | EMACS_TIME *end_time; |
| 2484 | { | 2562 | { |
| 2485 | volatile Lisp_Object c; | 2563 | volatile Lisp_Object c; |
| 2486 | int count; | 2564 | int count, jmpcount; |
| 2487 | jmp_buf local_getcjmp; | 2565 | jmp_buf local_getcjmp; |
| 2488 | jmp_buf save_jump; | 2566 | jmp_buf save_jump; |
| 2489 | volatile int key_already_recorded = 0; | 2567 | volatile int key_already_recorded = 0; |
| @@ -2714,12 +2792,14 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) | |||
| 2714 | around any call to sit_for or kbd_buffer_get_event; | 2792 | around any call to sit_for or kbd_buffer_get_event; |
| 2715 | it *must not* be in effect when we call redisplay. */ | 2793 | it *must not* be in effect when we call redisplay. */ |
| 2716 | 2794 | ||
| 2795 | jmpcount = SPECPDL_INDEX (); | ||
| 2717 | if (_setjmp (local_getcjmp)) | 2796 | if (_setjmp (local_getcjmp)) |
| 2718 | { | 2797 | { |
| 2719 | /* Handle quits while reading the keyboard. */ | 2798 | /* Handle quits while reading the keyboard. */ |
| 2720 | /* We must have saved the outer value of getcjmp here, | 2799 | /* We must have saved the outer value of getcjmp here, |
| 2721 | so restore it now. */ | 2800 | so restore it now. */ |
| 2722 | restore_getcjmp (save_jump); | 2801 | restore_getcjmp (save_jump); |
| 2802 | unbind_to (jmpcount, Qnil); | ||
| 2723 | XSETINT (c, quit_char); | 2803 | XSETINT (c, quit_char); |
| 2724 | internal_last_event_frame = selected_frame; | 2804 | internal_last_event_frame = selected_frame; |
| 2725 | Vlast_event_frame = internal_last_event_frame; | 2805 | Vlast_event_frame = internal_last_event_frame; |
| @@ -2760,7 +2840,12 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) | |||
| 2760 | goto non_reread; | 2840 | goto non_reread; |
| 2761 | } | 2841 | } |
| 2762 | 2842 | ||
| 2763 | timer_start_idle (); | 2843 | /* Start idle timers if no time limit is supplied. We don't do it |
| 2844 | if a time limit is supplied to avoid an infinite recursion in the | ||
| 2845 | situation where an idle timer calls `sit-for'. */ | ||
| 2846 | |||
| 2847 | if (!end_time) | ||
| 2848 | timer_start_idle (); | ||
| 2764 | 2849 | ||
| 2765 | /* If in middle of key sequence and minibuffer not active, | 2850 | /* If in middle of key sequence and minibuffer not active, |
| 2766 | start echoing if enough time elapses. */ | 2851 | start echoing if enough time elapses. */ |
| @@ -2830,7 +2915,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) | |||
| 2830 | c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); | 2915 | c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); |
| 2831 | 2916 | ||
| 2832 | /* Now that we have read an event, Emacs is not idle. */ | 2917 | /* Now that we have read an event, Emacs is not idle. */ |
| 2833 | timer_stop_idle (); | 2918 | if (!end_time) |
| 2919 | timer_stop_idle (); | ||
| 2834 | 2920 | ||
| 2835 | goto exit; | 2921 | goto exit; |
| 2836 | } | 2922 | } |
| @@ -2973,7 +3059,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) | |||
| 2973 | /* Actually read a character, waiting if necessary. */ | 3059 | /* Actually read a character, waiting if necessary. */ |
| 2974 | save_getcjmp (save_jump); | 3060 | save_getcjmp (save_jump); |
| 2975 | restore_getcjmp (local_getcjmp); | 3061 | restore_getcjmp (local_getcjmp); |
| 2976 | timer_start_idle (); | 3062 | if (!end_time) |
| 3063 | timer_start_idle (); | ||
| 2977 | c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time); | 3064 | c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time); |
| 2978 | restore_getcjmp (save_jump); | 3065 | restore_getcjmp (save_jump); |
| 2979 | 3066 | ||
| @@ -3025,7 +3112,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) | |||
| 3025 | 3112 | ||
| 3026 | non_reread: | 3113 | non_reread: |
| 3027 | 3114 | ||
| 3028 | timer_stop_idle (); | 3115 | if (!end_time) |
| 3116 | timer_stop_idle (); | ||
| 3029 | RESUME_POLLING; | 3117 | RESUME_POLLING; |
| 3030 | 3118 | ||
| 3031 | if (NILP (c)) | 3119 | if (NILP (c)) |
| @@ -3063,7 +3151,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) | |||
| 3063 | last_input_char = c; | 3151 | last_input_char = c; |
| 3064 | Fcommand_execute (tem, Qnil, Fvector (1, &last_input_char), Qt); | 3152 | Fcommand_execute (tem, Qnil, Fvector (1, &last_input_char), Qt); |
| 3065 | 3153 | ||
| 3066 | if (CONSP (c) && EQ (XCAR (c), Qselect_window)) | 3154 | if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time) |
| 3067 | /* We stopped being idle for this event; undo that. This | 3155 | /* We stopped being idle for this event; undo that. This |
| 3068 | prevents automatic window selection (under | 3156 | prevents automatic window selection (under |
| 3069 | mouse_autoselect_window from acting as a real input event, for | 3157 | mouse_autoselect_window from acting as a real input event, for |
| @@ -3272,7 +3360,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) | |||
| 3272 | show_help_echo (help, window, object, position, 0); | 3360 | show_help_echo (help, window, object, position, 0); |
| 3273 | 3361 | ||
| 3274 | /* We stopped being idle for this event; undo that. */ | 3362 | /* We stopped being idle for this event; undo that. */ |
| 3275 | timer_resume_idle (); | 3363 | if (!end_time) |
| 3364 | timer_resume_idle (); | ||
| 3276 | goto retry; | 3365 | goto retry; |
| 3277 | } | 3366 | } |
| 3278 | 3367 | ||
| @@ -3556,72 +3645,6 @@ restore_getcjmp (temp) | |||
| 3556 | bcopy (temp, getcjmp, sizeof getcjmp); | 3645 | bcopy (temp, getcjmp, sizeof getcjmp); |
| 3557 | } | 3646 | } |
| 3558 | 3647 | ||
| 3559 | #ifdef HAVE_MOUSE | ||
| 3560 | |||
| 3561 | /* Restore mouse tracking enablement. See Ftrack_mouse for the only use | ||
| 3562 | of this function. */ | ||
| 3563 | |||
| 3564 | static Lisp_Object | ||
| 3565 | tracking_off (old_value) | ||
| 3566 | Lisp_Object old_value; | ||
| 3567 | { | ||
| 3568 | do_mouse_tracking = old_value; | ||
| 3569 | if (NILP (old_value)) | ||
| 3570 | { | ||
| 3571 | /* Redisplay may have been preempted because there was input | ||
| 3572 | available, and it assumes it will be called again after the | ||
| 3573 | input has been processed. If the only input available was | ||
| 3574 | the sort that we have just disabled, then we need to call | ||
| 3575 | redisplay. */ | ||
| 3576 | if (!readable_events (READABLE_EVENTS_DO_TIMERS_NOW)) | ||
| 3577 | { | ||
| 3578 | redisplay_preserve_echo_area (6); | ||
| 3579 | get_input_pending (&input_pending, | ||
| 3580 | READABLE_EVENTS_DO_TIMERS_NOW); | ||
| 3581 | } | ||
| 3582 | } | ||
| 3583 | return Qnil; | ||
| 3584 | } | ||
| 3585 | |||
| 3586 | DEFUN ("track-mouse", Ftrack_mouse, Strack_mouse, 0, UNEVALLED, 0, | ||
| 3587 | doc: /* Evaluate BODY with mouse movement events enabled. | ||
| 3588 | Within a `track-mouse' form, mouse motion generates input events that | ||
| 3589 | you can read with `read-event'. | ||
| 3590 | Normally, mouse motion is ignored. | ||
| 3591 | usage: (track-mouse BODY ...) */) | ||
| 3592 | (args) | ||
| 3593 | Lisp_Object args; | ||
| 3594 | { | ||
| 3595 | int count = SPECPDL_INDEX (); | ||
| 3596 | Lisp_Object val; | ||
| 3597 | |||
| 3598 | record_unwind_protect (tracking_off, do_mouse_tracking); | ||
| 3599 | |||
| 3600 | do_mouse_tracking = Qt; | ||
| 3601 | |||
| 3602 | val = Fprogn (args); | ||
| 3603 | return unbind_to (count, val); | ||
| 3604 | } | ||
| 3605 | |||
| 3606 | /* If mouse has moved on some frame, return one of those frames. | ||
| 3607 | Return 0 otherwise. */ | ||
| 3608 | |||
| 3609 | static FRAME_PTR | ||
| 3610 | some_mouse_moved () | ||
| 3611 | { | ||
| 3612 | Lisp_Object tail, frame; | ||
| 3613 | |||
| 3614 | FOR_EACH_FRAME (tail, frame) | ||
| 3615 | { | ||
| 3616 | if (XFRAME (frame)->mouse_moved) | ||
| 3617 | return XFRAME (frame); | ||
| 3618 | } | ||
| 3619 | |||
| 3620 | return 0; | ||
| 3621 | } | ||
| 3622 | |||
| 3623 | #endif /* HAVE_MOUSE */ | ||
| 3624 | |||
| 3625 | /* Low level keyboard/mouse input. | 3648 | /* Low level keyboard/mouse input. |
| 3626 | kbd_buffer_store_event places events in kbd_buffer, and | 3649 | kbd_buffer_store_event places events in kbd_buffer, and |
| 3627 | kbd_buffer_get_event retrieves them. */ | 3650 | kbd_buffer_get_event retrieves them. */ |
| @@ -4056,13 +4079,15 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time) | |||
| 4056 | { | 4079 | { |
| 4057 | EMACS_TIME duration; | 4080 | EMACS_TIME duration; |
| 4058 | EMACS_GET_TIME (duration); | 4081 | EMACS_GET_TIME (duration); |
| 4059 | EMACS_SUB_TIME (duration, *end_time, duration); | 4082 | if (EMACS_TIME_GE (duration, *end_time)) |
| 4060 | if (EMACS_TIME_NEG_P (duration)) | 4083 | return Qnil; /* finished waiting */ |
| 4061 | return Qnil; | ||
| 4062 | else | 4084 | else |
| 4063 | wait_reading_process_output (EMACS_SECS (duration), | 4085 | { |
| 4064 | EMACS_USECS (duration), | 4086 | EMACS_SUB_TIME (duration, *end_time, duration); |
| 4065 | -1, 1, Qnil, NULL, 0); | 4087 | wait_reading_process_output (EMACS_SECS (duration), |
| 4088 | EMACS_USECS (duration), | ||
| 4089 | -1, 1, Qnil, NULL, 0); | ||
| 4090 | } | ||
| 4066 | } | 4091 | } |
| 4067 | else | 4092 | else |
| 4068 | wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0); | 4093 | wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0); |
| @@ -4635,6 +4660,32 @@ timer_check (do_it_now) | |||
| 4635 | UNGCPRO; | 4660 | UNGCPRO; |
| 4636 | return nexttime; | 4661 | return nexttime; |
| 4637 | } | 4662 | } |
| 4663 | |||
| 4664 | DEFUN ("current-idle-time", Fcurrent_idle_time, Scurrent_idle_time, 0, 0, 0, | ||
| 4665 | doc: /* Return the current length of Emacs idleness. | ||
| 4666 | The value is returned as a list of three integers. The first has the | ||
| 4667 | most significant 16 bits of the seconds, while the second has the | ||
| 4668 | least significant 16 bits. The third integer gives the microsecond | ||
| 4669 | count. | ||
| 4670 | |||
| 4671 | The microsecond count is zero on systems that do not provide | ||
| 4672 | resolution finer than a second. */) | ||
| 4673 | () | ||
| 4674 | { | ||
| 4675 | if (! EMACS_TIME_NEG_P (timer_idleness_start_time)) | ||
| 4676 | { | ||
| 4677 | EMACS_TIME now, idleness_now; | ||
| 4678 | |||
| 4679 | EMACS_GET_TIME (now); | ||
| 4680 | EMACS_SUB_TIME (idleness_now, now, timer_idleness_start_time); | ||
| 4681 | |||
| 4682 | return list3 (make_number ((EMACS_SECS (idleness_now) >> 16) & 0xffff), | ||
| 4683 | make_number ((EMACS_SECS (idleness_now) >> 0) & 0xffff), | ||
| 4684 | make_number (EMACS_USECS (idleness_now))); | ||
| 4685 | } | ||
| 4686 | |||
| 4687 | return Qnil; | ||
| 4688 | } | ||
| 4638 | 4689 | ||
| 4639 | /* Caches for modify_event_symbol. */ | 4690 | /* Caches for modify_event_symbol. */ |
| 4640 | static Lisp_Object accent_key_syms; | 4691 | static Lisp_Object accent_key_syms; |
| @@ -8565,7 +8616,15 @@ follow_key (key, nmaps, current, defs, next) | |||
| 8565 | such as Vfunction_key_map and Vkey_translation_map. */ | 8616 | such as Vfunction_key_map and Vkey_translation_map. */ |
| 8566 | typedef struct keyremap | 8617 | typedef struct keyremap |
| 8567 | { | 8618 | { |
| 8568 | Lisp_Object map, parent; | 8619 | /* This is the map originally specified for this use. */ |
| 8620 | Lisp_Object parent; | ||
| 8621 | /* This is a submap reached by looking up, in PARENT, | ||
| 8622 | the events from START to END. */ | ||
| 8623 | Lisp_Object map; | ||
| 8624 | /* Positions [START, END) in the key sequence buffer | ||
| 8625 | are the key that we have scanned so far. | ||
| 8626 | Those events are the ones that we will replace | ||
| 8627 | if PAREHT maps them into a key sequence. */ | ||
| 8569 | int start, end; | 8628 | int start, end; |
| 8570 | } keyremap; | 8629 | } keyremap; |
| 8571 | 8630 | ||
| @@ -8638,7 +8697,11 @@ keyremap_step (keybuf, bufsize, fkey, input, doit, diff, prompt) | |||
| 8638 | Lisp_Object next, key; | 8697 | Lisp_Object next, key; |
| 8639 | 8698 | ||
| 8640 | key = keybuf[fkey->end++]; | 8699 | key = keybuf[fkey->end++]; |
| 8641 | next = access_keymap_keyremap (fkey->map, key, prompt, doit); | 8700 | |
| 8701 | if (KEYMAPP (fkey->parent)) | ||
| 8702 | next = access_keymap_keyremap (fkey->map, key, prompt, doit); | ||
| 8703 | else | ||
| 8704 | next = Qnil; | ||
| 8642 | 8705 | ||
| 8643 | /* If keybuf[fkey->start..fkey->end] is bound in the | 8706 | /* If keybuf[fkey->start..fkey->end] is bound in the |
| 8644 | map and we're in a position to do the key remapping, replace it with | 8707 | map and we're in a position to do the key remapping, replace it with |
| @@ -8878,9 +8941,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, | |||
| 8878 | reinitialize fkey and keytran before each replay. */ | 8941 | reinitialize fkey and keytran before each replay. */ |
| 8879 | fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map; | 8942 | fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map; |
| 8880 | keytran.map = keytran.parent = current_kboard->Vlocal_key_translation_map; | 8943 | keytran.map = keytran.parent = current_kboard->Vlocal_key_translation_map; |
| 8881 | /* If there is no translation map, turn off scanning. */ | 8944 | fkey.start = fkey.end = 0; |
| 8882 | fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; | 8945 | keytran.start = keytran.end = 0; |
| 8883 | keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; | ||
| 8884 | 8946 | ||
| 8885 | starting_buffer = current_buffer; | 8947 | starting_buffer = current_buffer; |
| 8886 | first_unbound = bufsize + 1; | 8948 | first_unbound = bufsize + 1; |
| @@ -9687,8 +9749,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, | |||
| 9687 | 9749 | ||
| 9688 | keybuf[t - 1] = new_key; | 9750 | keybuf[t - 1] = new_key; |
| 9689 | mock_input = max (t, mock_input); | 9751 | mock_input = max (t, mock_input); |
| 9690 | fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; | 9752 | fkey.start = fkey.end = 0; |
| 9691 | keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; | 9753 | keytran.start = keytran.end = 0; |
| 9692 | 9754 | ||
| 9693 | goto replay_sequence; | 9755 | goto replay_sequence; |
| 9694 | } | 9756 | } |
| @@ -11494,6 +11556,7 @@ syms_of_keyboard () | |||
| 11494 | menu_bar_items_vector = Qnil; | 11556 | menu_bar_items_vector = Qnil; |
| 11495 | staticpro (&menu_bar_items_vector); | 11557 | staticpro (&menu_bar_items_vector); |
| 11496 | 11558 | ||
| 11559 | defsubr (&Scurrent_idle_time); | ||
| 11497 | defsubr (&Sevent_convert_list); | 11560 | defsubr (&Sevent_convert_list); |
| 11498 | defsubr (&Sread_key_sequence); | 11561 | defsubr (&Sread_key_sequence); |
| 11499 | defsubr (&Sread_key_sequence_vector); | 11562 | defsubr (&Sread_key_sequence_vector); |
| @@ -11555,14 +11618,16 @@ These events are processed first, before actual keyboard input. */); | |||
| 11555 | 11618 | ||
| 11556 | DEFVAR_LISP ("unread-post-input-method-events", &Vunread_post_input_method_events, | 11619 | DEFVAR_LISP ("unread-post-input-method-events", &Vunread_post_input_method_events, |
| 11557 | doc: /* List of events to be processed as input by input methods. | 11620 | doc: /* List of events to be processed as input by input methods. |
| 11558 | These events are processed after `unread-command-events', but | 11621 | These events are processed before `unread-command-events' |
| 11559 | before actual keyboard input. */); | 11622 | and actual keyboard input without given to `input-method-function'. */); |
| 11560 | Vunread_post_input_method_events = Qnil; | 11623 | Vunread_post_input_method_events = Qnil; |
| 11561 | 11624 | ||
| 11562 | DEFVAR_LISP ("unread-input-method-events", &Vunread_input_method_events, | 11625 | DEFVAR_LISP ("unread-input-method-events", &Vunread_input_method_events, |
| 11563 | doc: /* List of events to be processed as input by input methods. | 11626 | doc: /* List of events to be processed as input by input methods. |
| 11564 | These events are processed after `unread-command-events', but | 11627 | These events are processed after `unread-command-events', but |
| 11565 | before actual keyboard input. */); | 11628 | before actual keyboard input. |
| 11629 | If there's an active input method, the events are given to | ||
| 11630 | `input-method-function'. */); | ||
| 11566 | Vunread_input_method_events = Qnil; | 11631 | Vunread_input_method_events = Qnil; |
| 11567 | 11632 | ||
| 11568 | DEFVAR_LISP ("meta-prefix-char", &meta_prefix_char, | 11633 | DEFVAR_LISP ("meta-prefix-char", &meta_prefix_char, |
| @@ -831,7 +831,7 @@ create_apple_event (class, id, result) | |||
| 831 | return err; | 831 | return err; |
| 832 | } | 832 | } |
| 833 | 833 | ||
| 834 | OSErr | 834 | OSStatus |
| 835 | create_apple_event_from_event_ref (event, num_params, names, types, result) | 835 | create_apple_event_from_event_ref (event, num_params, names, types, result) |
| 836 | EventRef event; | 836 | EventRef event; |
| 837 | UInt32 num_params; | 837 | UInt32 num_params; |
| @@ -839,7 +839,7 @@ create_apple_event_from_event_ref (event, num_params, names, types, result) | |||
| 839 | EventParamType *types; | 839 | EventParamType *types; |
| 840 | AppleEvent *result; | 840 | AppleEvent *result; |
| 841 | { | 841 | { |
| 842 | OSErr err; | 842 | OSStatus err; |
| 843 | UInt32 i, size; | 843 | UInt32 i, size; |
| 844 | CFStringRef string; | 844 | CFStringRef string; |
| 845 | CFDataRef data; | 845 | CFDataRef data; |
| @@ -2424,7 +2424,7 @@ select (n, rfds, wfds, efds, timeout) | |||
| 2424 | SELECT_TYPE *efds; | 2424 | SELECT_TYPE *efds; |
| 2425 | struct timeval *timeout; | 2425 | struct timeval *timeout; |
| 2426 | { | 2426 | { |
| 2427 | OSErr err; | 2427 | OSStatus err; |
| 2428 | #if TARGET_API_MAC_CARBON | 2428 | #if TARGET_API_MAC_CARBON |
| 2429 | EventTimeout timeout_sec = | 2429 | EventTimeout timeout_sec = |
| 2430 | (timeout | 2430 | (timeout |
| @@ -4192,7 +4192,7 @@ DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 1, | |||
| 4192 | (filename) | 4192 | (filename) |
| 4193 | Lisp_Object filename; | 4193 | Lisp_Object filename; |
| 4194 | { | 4194 | { |
| 4195 | OSErr status; | 4195 | OSStatus status; |
| 4196 | #ifdef MAC_OSX | 4196 | #ifdef MAC_OSX |
| 4197 | FSRef fref; | 4197 | FSRef fref; |
| 4198 | #else | 4198 | #else |
| @@ -4246,7 +4246,7 @@ DEFUN ("mac-get-file-type", Fmac_get_file_type, Smac_get_file_type, 1, 1, 0, | |||
| 4246 | (filename) | 4246 | (filename) |
| 4247 | Lisp_Object filename; | 4247 | Lisp_Object filename; |
| 4248 | { | 4248 | { |
| 4249 | OSErr status; | 4249 | OSStatus status; |
| 4250 | #ifdef MAC_OSX | 4250 | #ifdef MAC_OSX |
| 4251 | FSRef fref; | 4251 | FSRef fref; |
| 4252 | #else | 4252 | #else |
| @@ -4302,7 +4302,7 @@ assumed. Return non-nil if successful. */) | |||
| 4302 | (filename, code) | 4302 | (filename, code) |
| 4303 | Lisp_Object filename, code; | 4303 | Lisp_Object filename, code; |
| 4304 | { | 4304 | { |
| 4305 | OSErr status; | 4305 | OSStatus status; |
| 4306 | #ifdef MAC_OSX | 4306 | #ifdef MAC_OSX |
| 4307 | FSRef fref; | 4307 | FSRef fref; |
| 4308 | #else | 4308 | #else |
| @@ -4362,7 +4362,7 @@ CODE must be a 4-character string. Return non-nil if successful. */) | |||
| 4362 | (filename, code) | 4362 | (filename, code) |
| 4363 | Lisp_Object filename, code; | 4363 | Lisp_Object filename, code; |
| 4364 | { | 4364 | { |
| 4365 | OSErr status; | 4365 | OSStatus status; |
| 4366 | #ifdef MAC_OSX | 4366 | #ifdef MAC_OSX |
| 4367 | FSRef fref; | 4367 | FSRef fref; |
| 4368 | #else | 4368 | #else |
| @@ -4775,7 +4775,7 @@ cfstring_create_normalized (str, symbol) | |||
| 4775 | UnicodeMapping map; | 4775 | UnicodeMapping map; |
| 4776 | CFIndex length; | 4776 | CFIndex length; |
| 4777 | UniChar *in_text, *buffer = NULL, *out_buf = NULL; | 4777 | UniChar *in_text, *buffer = NULL, *out_buf = NULL; |
| 4778 | OSErr err = noErr; | 4778 | OSStatus err = noErr; |
| 4779 | ByteCount out_read, out_size, out_len; | 4779 | ByteCount out_read, out_size, out_len; |
| 4780 | 4780 | ||
| 4781 | map.unicodeEncoding = CreateTextEncoding (kTextEncodingUnicodeDefault, | 4781 | map.unicodeEncoding = CreateTextEncoding (kTextEncodingUnicodeDefault, |
| @@ -4910,7 +4910,7 @@ On successful conversion, return the result string, else return nil. */) | |||
| 4910 | static Lisp_Object | 4910 | static Lisp_Object |
| 4911 | mac_get_system_locale () | 4911 | mac_get_system_locale () |
| 4912 | { | 4912 | { |
| 4913 | OSErr err; | 4913 | OSStatus err; |
| 4914 | LangCode lang; | 4914 | LangCode lang; |
| 4915 | RegionCode region; | 4915 | RegionCode region; |
| 4916 | LocaleRef locale; | 4916 | LocaleRef locale; |
| @@ -4987,7 +4987,7 @@ select_and_poll_event (n, rfds, wfds, efds, timeout) | |||
| 4987 | struct timeval *timeout; | 4987 | struct timeval *timeout; |
| 4988 | { | 4988 | { |
| 4989 | int r; | 4989 | int r; |
| 4990 | OSErr err; | 4990 | OSStatus err; |
| 4991 | 4991 | ||
| 4992 | r = select (n, rfds, wfds, efds, timeout); | 4992 | r = select (n, rfds, wfds, efds, timeout); |
| 4993 | if (r != -1) | 4993 | if (r != -1) |
| @@ -5017,7 +5017,7 @@ sys_select (n, rfds, wfds, efds, timeout) | |||
| 5017 | SELECT_TYPE *efds; | 5017 | SELECT_TYPE *efds; |
| 5018 | struct timeval *timeout; | 5018 | struct timeval *timeout; |
| 5019 | { | 5019 | { |
| 5020 | OSErr err; | 5020 | OSStatus err; |
| 5021 | int i, r; | 5021 | int i, r; |
| 5022 | EMACS_TIME select_timeout; | 5022 | EMACS_TIME select_timeout; |
| 5023 | 5023 | ||
diff --git a/src/macfns.c b/src/macfns.c index 8716f072411..2d004be9962 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -1945,63 +1945,80 @@ static void | |||
| 1945 | mac_update_proxy_icon (f) | 1945 | mac_update_proxy_icon (f) |
| 1946 | struct frame *f; | 1946 | struct frame *f; |
| 1947 | { | 1947 | { |
| 1948 | OSStatus err; | ||
| 1948 | Lisp_Object file_name = | 1949 | Lisp_Object file_name = |
| 1949 | XBUFFER (XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer)->filename; | 1950 | XBUFFER (XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer)->filename; |
| 1950 | Window w = FRAME_MAC_WINDOW (f); | 1951 | Window w = FRAME_MAC_WINDOW (f); |
| 1951 | 1952 | AliasHandle alias = NULL; | |
| 1952 | if (FRAME_FILE_NAME (f) == NULL && !STRINGP (file_name)) | ||
| 1953 | return; | ||
| 1954 | if (FRAME_FILE_NAME (f) && STRINGP (file_name) | ||
| 1955 | && strcmp (FRAME_FILE_NAME (f), SDATA (file_name)) == 0) | ||
| 1956 | return; | ||
| 1957 | |||
| 1958 | if (FRAME_FILE_NAME (f)) | ||
| 1959 | { | ||
| 1960 | xfree (FRAME_FILE_NAME (f)); | ||
| 1961 | FRAME_FILE_NAME (f) = NULL; | ||
| 1962 | } | ||
| 1963 | 1953 | ||
| 1964 | BLOCK_INPUT; | 1954 | BLOCK_INPUT; |
| 1965 | 1955 | ||
| 1956 | err = GetWindowProxyAlias (w, &alias); | ||
| 1957 | if (err == errWindowDoesNotHaveProxy && !STRINGP (file_name)) | ||
| 1958 | goto out; | ||
| 1959 | |||
| 1966 | if (STRINGP (file_name)) | 1960 | if (STRINGP (file_name)) |
| 1967 | { | 1961 | { |
| 1968 | OSStatus err; | ||
| 1969 | AEDesc desc; | 1962 | AEDesc desc; |
| 1963 | #ifdef MAC_OSX | ||
| 1964 | FSRef fref; | ||
| 1965 | #else | ||
| 1966 | FSSpec fss; | ||
| 1967 | #endif | ||
| 1968 | Boolean changed; | ||
| 1970 | Lisp_Object encoded_file_name = ENCODE_FILE (file_name); | 1969 | Lisp_Object encoded_file_name = ENCODE_FILE (file_name); |
| 1971 | 1970 | ||
| 1972 | #ifdef MAC_OS8 | 1971 | #ifdef MAC_OSX |
| 1972 | err = AECoercePtr (TYPE_FILE_NAME, SDATA (encoded_file_name), | ||
| 1973 | SBYTES (encoded_file_name), typeFSRef, &desc); | ||
| 1974 | #else | ||
| 1973 | SetPortWindowPort (w); | 1975 | SetPortWindowPort (w); |
| 1974 | #endif | ||
| 1975 | err = AECoercePtr (TYPE_FILE_NAME, SDATA (encoded_file_name), | 1976 | err = AECoercePtr (TYPE_FILE_NAME, SDATA (encoded_file_name), |
| 1976 | SBYTES (encoded_file_name), typeAlias, &desc); | 1977 | SBYTES (encoded_file_name), typeFSS, &desc); |
| 1978 | #endif | ||
| 1977 | if (err == noErr) | 1979 | if (err == noErr) |
| 1978 | { | 1980 | { |
| 1979 | Size size = AEGetDescDataSize (&desc); | 1981 | #ifdef MAC_OSX |
| 1980 | AliasHandle alias = (AliasHandle) NewHandle (size); | 1982 | err = AEGetDescData (&desc, &fref, sizeof (FSRef)); |
| 1981 | 1983 | #else | |
| 1982 | if (alias == NULL) | 1984 | err = AEGetDescData (&desc, &fss, sizeof (FSSpec)); |
| 1983 | err = memFullErr; | 1985 | #endif |
| 1984 | else | ||
| 1985 | { | ||
| 1986 | HLock ((Handle) alias); | ||
| 1987 | err = AEGetDescData (&desc, *alias, size); | ||
| 1988 | HUnlock ((Handle) alias); | ||
| 1989 | if (err == noErr) | ||
| 1990 | err = SetWindowProxyAlias (w, alias); | ||
| 1991 | DisposeHandle ((Handle) alias); | ||
| 1992 | } | ||
| 1993 | AEDisposeDesc (&desc); | 1986 | AEDisposeDesc (&desc); |
| 1994 | } | 1987 | } |
| 1995 | if (err == noErr) | 1988 | if (err == noErr) |
| 1996 | { | 1989 | { |
| 1997 | FRAME_FILE_NAME (f) = xmalloc (SBYTES (file_name) + 1); | 1990 | if (alias) |
| 1998 | strcpy (FRAME_FILE_NAME (f), SDATA (file_name)); | 1991 | { |
| 1992 | #ifdef MAC_OSX | ||
| 1993 | err = FSUpdateAlias (NULL, &fref, alias, &changed); | ||
| 1994 | #else | ||
| 1995 | err = UpdateAlias (NULL, &fss, alias, &changed); | ||
| 1996 | #endif | ||
| 1997 | } | ||
| 1998 | if (err != noErr || alias == NULL) | ||
| 1999 | { | ||
| 2000 | if (alias) | ||
| 2001 | DisposeHandle ((Handle) alias); | ||
| 2002 | #ifdef MAC_OSX | ||
| 2003 | err = FSNewAliasMinimal (&fref, &alias); | ||
| 2004 | #else | ||
| 2005 | err = NewAliasMinimal (&fss, &alias); | ||
| 2006 | #endif | ||
| 2007 | changed = true; | ||
| 2008 | } | ||
| 1999 | } | 2009 | } |
| 2010 | if (err == noErr) | ||
| 2011 | if (changed) | ||
| 2012 | err = SetWindowProxyAlias (w, alias); | ||
| 2000 | } | 2013 | } |
| 2001 | 2014 | ||
| 2002 | if (FRAME_FILE_NAME (f) == NULL) | 2015 | if (alias) |
| 2016 | DisposeHandle ((Handle) alias); | ||
| 2017 | |||
| 2018 | if (err != noErr || !STRINGP (file_name)) | ||
| 2003 | RemoveWindowProxy (w); | 2019 | RemoveWindowProxy (w); |
| 2004 | 2020 | ||
| 2021 | out: | ||
| 2005 | UNBLOCK_INPUT; | 2022 | UNBLOCK_INPUT; |
| 2006 | } | 2023 | } |
| 2007 | #endif | 2024 | #endif |
| @@ -2566,7 +2583,6 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 2566 | f->output_data.mac = (struct mac_output *) xmalloc (sizeof (struct mac_output)); | 2583 | f->output_data.mac = (struct mac_output *) xmalloc (sizeof (struct mac_output)); |
| 2567 | bzero (f->output_data.mac, sizeof (struct mac_output)); | 2584 | bzero (f->output_data.mac, sizeof (struct mac_output)); |
| 2568 | FRAME_FONTSET (f) = -1; | 2585 | FRAME_FONTSET (f) = -1; |
| 2569 | record_unwind_protect (unwind_create_frame, frame); | ||
| 2570 | 2586 | ||
| 2571 | f->icon_name | 2587 | f->icon_name |
| 2572 | = mac_get_arg (parms, Qicon_name, "iconName", "Title", RES_TYPE_STRING); | 2588 | = mac_get_arg (parms, Qicon_name, "iconName", "Title", RES_TYPE_STRING); |
| @@ -2574,6 +2590,9 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 2574 | f->icon_name = Qnil; | 2590 | f->icon_name = Qnil; |
| 2575 | 2591 | ||
| 2576 | /* FRAME_MAC_DISPLAY_INFO (f) = dpyinfo; */ | 2592 | /* FRAME_MAC_DISPLAY_INFO (f) = dpyinfo; */ |
| 2593 | |||
| 2594 | /* With FRAME_MAC_DISPLAY_INFO set up, this unwind-protect is safe. */ | ||
| 2595 | record_unwind_protect (unwind_create_frame, frame); | ||
| 2577 | #if GLYPH_DEBUG | 2596 | #if GLYPH_DEBUG |
| 2578 | image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; | 2597 | image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; |
| 2579 | dpyinfo_refcount = dpyinfo->reference_count; | 2598 | dpyinfo_refcount = dpyinfo->reference_count; |
| @@ -2876,14 +2895,9 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, | |||
| 2876 | CHECK_STRING (color); | 2895 | CHECK_STRING (color); |
| 2877 | 2896 | ||
| 2878 | if (mac_defined_color (f, SDATA (color), &foo, 0)) | 2897 | if (mac_defined_color (f, SDATA (color), &foo, 0)) |
| 2879 | { | 2898 | return list3 (make_number (foo.red), |
| 2880 | Lisp_Object rgb[3]; | 2899 | make_number (foo.green), |
| 2881 | 2900 | make_number (foo.blue)); | |
| 2882 | rgb[0] = make_number (foo.red); | ||
| 2883 | rgb[1] = make_number (foo.green); | ||
| 2884 | rgb[2] = make_number (foo.blue); | ||
| 2885 | return Flist (3, rgb); | ||
| 2886 | } | ||
| 2887 | else | 2901 | else |
| 2888 | return Qnil; | 2902 | return Qnil; |
| 2889 | } | 2903 | } |
diff --git a/src/macselect.c b/src/macselect.c index 67a28cf9e64..fd72bd3cb14 100644 --- a/src/macselect.c +++ b/src/macselect.c | |||
| @@ -31,15 +31,15 @@ typedef int ScrapRef; | |||
| 31 | typedef ResType ScrapFlavorType; | 31 | typedef ResType ScrapFlavorType; |
| 32 | #endif /* !TARGET_API_MAC_CARBON */ | 32 | #endif /* !TARGET_API_MAC_CARBON */ |
| 33 | 33 | ||
| 34 | static OSErr get_scrap_from_symbol P_ ((Lisp_Object, int, ScrapRef *)); | 34 | static OSStatus get_scrap_from_symbol P_ ((Lisp_Object, int, ScrapRef *)); |
| 35 | static ScrapFlavorType get_flavor_type_from_symbol P_ ((Lisp_Object)); | 35 | static ScrapFlavorType get_flavor_type_from_symbol P_ ((Lisp_Object)); |
| 36 | static int valid_scrap_target_type_p P_ ((Lisp_Object)); | 36 | static int valid_scrap_target_type_p P_ ((Lisp_Object)); |
| 37 | static OSErr clear_scrap P_ ((ScrapRef *)); | 37 | static OSStatus clear_scrap P_ ((ScrapRef *)); |
| 38 | static OSErr put_scrap_string P_ ((ScrapRef, Lisp_Object, Lisp_Object)); | 38 | static OSStatus put_scrap_string P_ ((ScrapRef, Lisp_Object, Lisp_Object)); |
| 39 | static OSErr put_scrap_private_timestamp P_ ((ScrapRef, unsigned long)); | 39 | static OSStatus put_scrap_private_timestamp P_ ((ScrapRef, unsigned long)); |
| 40 | static ScrapFlavorType scrap_has_target_type P_ ((ScrapRef, Lisp_Object)); | 40 | static ScrapFlavorType scrap_has_target_type P_ ((ScrapRef, Lisp_Object)); |
| 41 | static Lisp_Object get_scrap_string P_ ((ScrapRef, Lisp_Object)); | 41 | static Lisp_Object get_scrap_string P_ ((ScrapRef, Lisp_Object)); |
| 42 | static OSErr get_scrap_private_timestamp P_ ((ScrapRef, unsigned long *)); | 42 | static OSStatus get_scrap_private_timestamp P_ ((ScrapRef, unsigned long *)); |
| 43 | static Lisp_Object get_scrap_target_type_list P_ ((ScrapRef)); | 43 | static Lisp_Object get_scrap_target_type_list P_ ((ScrapRef)); |
| 44 | static void x_own_selection P_ ((Lisp_Object, Lisp_Object)); | 44 | static void x_own_selection P_ ((Lisp_Object, Lisp_Object)); |
| 45 | static Lisp_Object x_get_local_selection P_ ((Lisp_Object, Lisp_Object, int)); | 45 | static Lisp_Object x_get_local_selection P_ ((Lisp_Object, Lisp_Object, int)); |
| @@ -108,13 +108,13 @@ static Lisp_Object Vmac_service_selection; | |||
| 108 | reference is set to *SCRAP, and it becomes NULL if there's no | 108 | reference is set to *SCRAP, and it becomes NULL if there's no |
| 109 | corresponding scrap. Clear the scrap if CLEAR_P is non-zero. */ | 109 | corresponding scrap. Clear the scrap if CLEAR_P is non-zero. */ |
| 110 | 110 | ||
| 111 | static OSErr | 111 | static OSStatus |
| 112 | get_scrap_from_symbol (sym, clear_p, scrap) | 112 | get_scrap_from_symbol (sym, clear_p, scrap) |
| 113 | Lisp_Object sym; | 113 | Lisp_Object sym; |
| 114 | int clear_p; | 114 | int clear_p; |
| 115 | ScrapRef *scrap; | 115 | ScrapRef *scrap; |
| 116 | { | 116 | { |
| 117 | OSErr err = noErr; | 117 | OSStatus err = noErr; |
| 118 | Lisp_Object str = Fget (sym, Qmac_scrap_name); | 118 | Lisp_Object str = Fget (sym, Qmac_scrap_name); |
| 119 | 119 | ||
| 120 | if (!STRINGP (str)) | 120 | if (!STRINGP (str)) |
| @@ -172,7 +172,7 @@ valid_scrap_target_type_p (sym) | |||
| 172 | 172 | ||
| 173 | /* Clear the scrap whose reference is *SCRAP. */ | 173 | /* Clear the scrap whose reference is *SCRAP. */ |
| 174 | 174 | ||
| 175 | static INLINE OSErr | 175 | static INLINE OSStatus |
| 176 | clear_scrap (scrap) | 176 | clear_scrap (scrap) |
| 177 | ScrapRef *scrap; | 177 | ScrapRef *scrap; |
| 178 | { | 178 | { |
| @@ -190,7 +190,7 @@ clear_scrap (scrap) | |||
| 190 | /* Put Lisp String STR to the scrap SCRAP. The target type is | 190 | /* Put Lisp String STR to the scrap SCRAP. The target type is |
| 191 | specified by TYPE. */ | 191 | specified by TYPE. */ |
| 192 | 192 | ||
| 193 | static OSErr | 193 | static OSStatus |
| 194 | put_scrap_string (scrap, type, str) | 194 | put_scrap_string (scrap, type, str) |
| 195 | ScrapRef scrap; | 195 | ScrapRef scrap; |
| 196 | Lisp_Object type, str; | 196 | Lisp_Object type, str; |
| @@ -211,7 +211,7 @@ put_scrap_string (scrap, type, str) | |||
| 211 | /* Put TIMESTAMP to the scrap SCRAP. The timestamp is used for | 211 | /* Put TIMESTAMP to the scrap SCRAP. The timestamp is used for |
| 212 | checking if the scrap is owned by the process. */ | 212 | checking if the scrap is owned by the process. */ |
| 213 | 213 | ||
| 214 | static INLINE OSErr | 214 | static INLINE OSStatus |
| 215 | put_scrap_private_timestamp (scrap, timestamp) | 215 | put_scrap_private_timestamp (scrap, timestamp) |
| 216 | ScrapRef scrap; | 216 | ScrapRef scrap; |
| 217 | unsigned long timestamp; | 217 | unsigned long timestamp; |
| @@ -233,7 +233,7 @@ scrap_has_target_type (scrap, type) | |||
| 233 | ScrapRef scrap; | 233 | ScrapRef scrap; |
| 234 | Lisp_Object type; | 234 | Lisp_Object type; |
| 235 | { | 235 | { |
| 236 | OSErr err; | 236 | OSStatus err; |
| 237 | ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type); | 237 | ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type); |
| 238 | 238 | ||
| 239 | if (flavor_type) | 239 | if (flavor_type) |
| @@ -264,7 +264,7 @@ get_scrap_string (scrap, type) | |||
| 264 | ScrapRef scrap; | 264 | ScrapRef scrap; |
| 265 | Lisp_Object type; | 265 | Lisp_Object type; |
| 266 | { | 266 | { |
| 267 | OSErr err; | 267 | OSStatus err; |
| 268 | Lisp_Object result = Qnil; | 268 | Lisp_Object result = Qnil; |
| 269 | ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type); | 269 | ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type); |
| 270 | #if TARGET_API_MAC_CARBON | 270 | #if TARGET_API_MAC_CARBON |
| @@ -310,12 +310,12 @@ get_scrap_string (scrap, type) | |||
| 310 | 310 | ||
| 311 | /* Get timestamp from the scrap SCRAP and set to *TIMPSTAMP. */ | 311 | /* Get timestamp from the scrap SCRAP and set to *TIMPSTAMP. */ |
| 312 | 312 | ||
| 313 | static OSErr | 313 | static OSStatus |
| 314 | get_scrap_private_timestamp (scrap, timestamp) | 314 | get_scrap_private_timestamp (scrap, timestamp) |
| 315 | ScrapRef scrap; | 315 | ScrapRef scrap; |
| 316 | unsigned long *timestamp; | 316 | unsigned long *timestamp; |
| 317 | { | 317 | { |
| 318 | OSErr err = noErr; | 318 | OSStatus err = noErr; |
| 319 | #if TARGET_API_MAC_CARBON | 319 | #if TARGET_API_MAC_CARBON |
| 320 | ScrapFlavorFlags flags; | 320 | ScrapFlavorFlags flags; |
| 321 | 321 | ||
| @@ -365,7 +365,7 @@ get_scrap_target_type_list (scrap) | |||
| 365 | { | 365 | { |
| 366 | Lisp_Object result = Qnil, rest, target_type; | 366 | Lisp_Object result = Qnil, rest, target_type; |
| 367 | #if TARGET_API_MAC_CARBON | 367 | #if TARGET_API_MAC_CARBON |
| 368 | OSErr err; | 368 | OSStatus err; |
| 369 | UInt32 count, i, type; | 369 | UInt32 count, i, type; |
| 370 | ScrapFlavorInfo *flavor_info = NULL; | 370 | ScrapFlavorInfo *flavor_info = NULL; |
| 371 | Lisp_Object strings = Qnil; | 371 | Lisp_Object strings = Qnil; |
| @@ -425,7 +425,7 @@ static void | |||
| 425 | x_own_selection (selection_name, selection_value) | 425 | x_own_selection (selection_name, selection_value) |
| 426 | Lisp_Object selection_name, selection_value; | 426 | Lisp_Object selection_name, selection_value; |
| 427 | { | 427 | { |
| 428 | OSErr err; | 428 | OSStatus err; |
| 429 | ScrapRef scrap; | 429 | ScrapRef scrap; |
| 430 | struct gcpro gcpro1, gcpro2; | 430 | struct gcpro gcpro1, gcpro2; |
| 431 | Lisp_Object rest, handler_fn, value, type; | 431 | Lisp_Object rest, handler_fn, value, type; |
| @@ -671,7 +671,7 @@ static Lisp_Object | |||
| 671 | x_get_foreign_selection (selection_symbol, target_type, time_stamp) | 671 | x_get_foreign_selection (selection_symbol, target_type, time_stamp) |
| 672 | Lisp_Object selection_symbol, target_type, time_stamp; | 672 | Lisp_Object selection_symbol, target_type, time_stamp; |
| 673 | { | 673 | { |
| 674 | OSErr err; | 674 | OSStatus err; |
| 675 | ScrapRef scrap; | 675 | ScrapRef scrap; |
| 676 | Lisp_Object result = Qnil; | 676 | Lisp_Object result = Qnil; |
| 677 | 677 | ||
| @@ -765,7 +765,7 @@ Disowning it means there is no such selection. */) | |||
| 765 | Lisp_Object selection; | 765 | Lisp_Object selection; |
| 766 | Lisp_Object time; | 766 | Lisp_Object time; |
| 767 | { | 767 | { |
| 768 | OSErr err; | 768 | OSStatus err; |
| 769 | ScrapRef scrap; | 769 | ScrapRef scrap; |
| 770 | Lisp_Object local_selection_data; | 770 | Lisp_Object local_selection_data; |
| 771 | 771 | ||
| @@ -828,7 +828,7 @@ and t is the same as `SECONDARY'. */) | |||
| 828 | (selection) | 828 | (selection) |
| 829 | Lisp_Object selection; | 829 | Lisp_Object selection; |
| 830 | { | 830 | { |
| 831 | OSErr err; | 831 | OSStatus err; |
| 832 | ScrapRef scrap; | 832 | ScrapRef scrap; |
| 833 | Lisp_Object result = Qnil, local_selection_data; | 833 | Lisp_Object result = Qnil, local_selection_data; |
| 834 | 834 | ||
| @@ -873,7 +873,7 @@ and t is the same as `SECONDARY'. */) | |||
| 873 | (selection) | 873 | (selection) |
| 874 | Lisp_Object selection; | 874 | Lisp_Object selection; |
| 875 | { | 875 | { |
| 876 | OSErr err; | 876 | OSStatus err; |
| 877 | ScrapRef scrap; | 877 | ScrapRef scrap; |
| 878 | Lisp_Object result = Qnil, rest; | 878 | Lisp_Object result = Qnil, rest; |
| 879 | 879 | ||
| @@ -931,7 +931,7 @@ struct suspended_ae_info | |||
| 931 | struct suspended_ae_info *next; | 931 | struct suspended_ae_info *next; |
| 932 | }; | 932 | }; |
| 933 | 933 | ||
| 934 | /* List of deferred apple events at the startup time. */ | 934 | /* List of apple events deferred at the startup time. */ |
| 935 | static struct suspended_ae_info *deferred_apple_events = NULL; | 935 | static struct suspended_ae_info *deferred_apple_events = NULL; |
| 936 | 936 | ||
| 937 | /* List of suspended apple events, in order of expiration_tick. */ | 937 | /* List of suspended apple events, in order of expiration_tick. */ |
diff --git a/src/macterm.c b/src/macterm.c index c0128b496d3..76efa80d606 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -902,7 +902,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char) | |||
| 902 | #if USE_ATSUI | 902 | #if USE_ATSUI |
| 903 | if (GC_FONT (gc)->mac_style) | 903 | if (GC_FONT (gc)->mac_style) |
| 904 | { | 904 | { |
| 905 | OSErr err; | 905 | OSStatus err; |
| 906 | ATSUTextLayout text_layout; | 906 | ATSUTextLayout text_layout; |
| 907 | 907 | ||
| 908 | xassert (bytes_per_char == 2); | 908 | xassert (bytes_per_char == 2); |
| @@ -1129,7 +1129,7 @@ mac_draw_image_string_16 (f, gc, x, y, buf, nchars, bg_width) | |||
| 1129 | the font of the current graphics port. If CG_GLYPH is not NULL, | 1129 | the font of the current graphics port. If CG_GLYPH is not NULL, |
| 1130 | *CG_GLYPH is set to the glyph ID or 0 if it cannot be obtained. */ | 1130 | *CG_GLYPH is set to the glyph ID or 0 if it cannot be obtained. */ |
| 1131 | 1131 | ||
| 1132 | static OSErr | 1132 | static OSStatus |
| 1133 | mac_query_char_extents (style, c, | 1133 | mac_query_char_extents (style, c, |
| 1134 | font_ascent_return, font_descent_return, | 1134 | font_ascent_return, font_descent_return, |
| 1135 | overall_return, cg_glyph) | 1135 | overall_return, cg_glyph) |
| @@ -1147,7 +1147,7 @@ mac_query_char_extents (style, c, | |||
| 1147 | void *cg_glyph; | 1147 | void *cg_glyph; |
| 1148 | #endif | 1148 | #endif |
| 1149 | { | 1149 | { |
| 1150 | OSErr err = noErr; | 1150 | OSStatus err = noErr; |
| 1151 | int width; | 1151 | int width; |
| 1152 | Rect char_bounds; | 1152 | Rect char_bounds; |
| 1153 | 1153 | ||
| @@ -1193,7 +1193,7 @@ mac_query_char_extents (style, c, | |||
| 1193 | #if USE_CG_TEXT_DRAWING | 1193 | #if USE_CG_TEXT_DRAWING |
| 1194 | if (err == noErr && cg_glyph) | 1194 | if (err == noErr && cg_glyph) |
| 1195 | { | 1195 | { |
| 1196 | OSErr err1; | 1196 | OSStatus err1; |
| 1197 | ATSUGlyphInfoArray glyph_info_array; | 1197 | ATSUGlyphInfoArray glyph_info_array; |
| 1198 | ByteCount count = sizeof (ATSUGlyphInfoArray); | 1198 | ByteCount count = sizeof (ATSUGlyphInfoArray); |
| 1199 | 1199 | ||
| @@ -3583,7 +3583,9 @@ x_draw_stretch_glyph_string (s) | |||
| 3583 | int background_width = s->background_width; | 3583 | int background_width = s->background_width; |
| 3584 | int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); | 3584 | int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); |
| 3585 | 3585 | ||
| 3586 | if (x < left_x) | 3586 | /* Don't draw into left margin, fringe or scrollbar area |
| 3587 | except for header line and mode line. */ | ||
| 3588 | if (x < left_x && !s->row->mode_line_p) | ||
| 3587 | { | 3589 | { |
| 3588 | background_width -= left_x - x; | 3590 | background_width -= left_x - x; |
| 3589 | x = left_x; | 3591 | x = left_x; |
| @@ -3677,14 +3679,14 @@ x_draw_glyph_string (s) | |||
| 3677 | 3679 | ||
| 3678 | if (s->face->underline_defaulted_p) | 3680 | if (s->face->underline_defaulted_p) |
| 3679 | mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, | 3681 | mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, |
| 3680 | s->width, h); | 3682 | s->background_width, h); |
| 3681 | else | 3683 | else |
| 3682 | { | 3684 | { |
| 3683 | XGCValues xgcv; | 3685 | XGCValues xgcv; |
| 3684 | XGetGCValues (s->display, s->gc, GCForeground, &xgcv); | 3686 | XGetGCValues (s->display, s->gc, GCForeground, &xgcv); |
| 3685 | XSetForeground (s->display, s->gc, s->face->underline_color); | 3687 | XSetForeground (s->display, s->gc, s->face->underline_color); |
| 3686 | mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, | 3688 | mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, |
| 3687 | s->width, h); | 3689 | s->background_width, h); |
| 3688 | XSetForeground (s->display, s->gc, xgcv.foreground); | 3690 | XSetForeground (s->display, s->gc, xgcv.foreground); |
| 3689 | } | 3691 | } |
| 3690 | } | 3692 | } |
| @@ -3696,14 +3698,14 @@ x_draw_glyph_string (s) | |||
| 3696 | 3698 | ||
| 3697 | if (s->face->overline_color_defaulted_p) | 3699 | if (s->face->overline_color_defaulted_p) |
| 3698 | mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, | 3700 | mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, |
| 3699 | s->width, h); | 3701 | s->background_width, h); |
| 3700 | else | 3702 | else |
| 3701 | { | 3703 | { |
| 3702 | XGCValues xgcv; | 3704 | XGCValues xgcv; |
| 3703 | XGetGCValues (s->display, s->gc, GCForeground, &xgcv); | 3705 | XGetGCValues (s->display, s->gc, GCForeground, &xgcv); |
| 3704 | XSetForeground (s->display, s->gc, s->face->overline_color); | 3706 | XSetForeground (s->display, s->gc, s->face->overline_color); |
| 3705 | mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, | 3707 | mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, |
| 3706 | s->width, h); | 3708 | s->background_width, h); |
| 3707 | XSetForeground (s->display, s->gc, xgcv.foreground); | 3709 | XSetForeground (s->display, s->gc, xgcv.foreground); |
| 3708 | } | 3710 | } |
| 3709 | } | 3711 | } |
| @@ -6312,7 +6314,7 @@ void | |||
| 6312 | x_iconify_frame (f) | 6314 | x_iconify_frame (f) |
| 6313 | struct frame *f; | 6315 | struct frame *f; |
| 6314 | { | 6316 | { |
| 6315 | OSErr err; | 6317 | OSStatus err; |
| 6316 | 6318 | ||
| 6317 | /* A deactivate event does not occur when the last visible frame is | 6319 | /* A deactivate event does not occur when the last visible frame is |
| 6318 | iconified. So if we clear the highlight here, it will not be | 6320 | iconified. So if we clear the highlight here, it will not be |
| @@ -6376,11 +6378,6 @@ x_free_frame_resources (f) | |||
| 6376 | if (FRAME_SIZE_HINTS (f)) | 6378 | if (FRAME_SIZE_HINTS (f)) |
| 6377 | xfree (FRAME_SIZE_HINTS (f)); | 6379 | xfree (FRAME_SIZE_HINTS (f)); |
| 6378 | 6380 | ||
| 6379 | #if TARGET_API_MAC_CARBON | ||
| 6380 | if (FRAME_FILE_NAME (f)) | ||
| 6381 | xfree (FRAME_FILE_NAME (f)); | ||
| 6382 | #endif | ||
| 6383 | |||
| 6384 | xfree (f->output_data.mac); | 6381 | xfree (f->output_data.mac); |
| 6385 | f->output_data.mac = NULL; | 6382 | f->output_data.mac = NULL; |
| 6386 | 6383 | ||
| @@ -7198,7 +7195,7 @@ init_font_name_table () | |||
| 7198 | if (!NILP (assq_no_quit (make_number (kTextEncodingMacUnicode), | 7195 | if (!NILP (assq_no_quit (make_number (kTextEncodingMacUnicode), |
| 7199 | text_encoding_info_alist))) | 7196 | text_encoding_info_alist))) |
| 7200 | { | 7197 | { |
| 7201 | OSErr err; | 7198 | OSStatus err; |
| 7202 | struct Lisp_Hash_Table *h; | 7199 | struct Lisp_Hash_Table *h; |
| 7203 | unsigned hash_code; | 7200 | unsigned hash_code; |
| 7204 | ItemCount nfonts, i; | 7201 | ItemCount nfonts, i; |
| @@ -7780,7 +7777,7 @@ XLoadQueryFont (Display *dpy, char *fontname) | |||
| 7780 | #if USE_ATSUI | 7777 | #if USE_ATSUI |
| 7781 | if (strcmp (charset, "iso10646-1") == 0) /* XXX */ | 7778 | if (strcmp (charset, "iso10646-1") == 0) /* XXX */ |
| 7782 | { | 7779 | { |
| 7783 | OSErr err; | 7780 | OSStatus err; |
| 7784 | ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag, | 7781 | ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag, |
| 7785 | kATSUQDBoldfaceTag, kATSUQDItalicTag}; | 7782 | kATSUQDBoldfaceTag, kATSUQDItalicTag}; |
| 7786 | ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed), | 7783 | ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed), |
| @@ -7863,7 +7860,7 @@ XLoadQueryFont (Display *dpy, char *fontname) | |||
| 7863 | #if USE_ATSUI | 7860 | #if USE_ATSUI |
| 7864 | if (font->mac_style) | 7861 | if (font->mac_style) |
| 7865 | { | 7862 | { |
| 7866 | OSErr err; | 7863 | OSStatus err; |
| 7867 | UniChar c; | 7864 | UniChar c; |
| 7868 | 7865 | ||
| 7869 | font->min_byte1 = 0; | 7866 | font->min_byte1 = 0; |
| @@ -8342,8 +8339,8 @@ x_query_font (f, fontname) | |||
| 8342 | 8339 | ||
| 8343 | for (i = 0; i < dpyinfo->n_fonts; i++) | 8340 | for (i = 0; i < dpyinfo->n_fonts; i++) |
| 8344 | if (dpyinfo->font_table[i].name | 8341 | if (dpyinfo->font_table[i].name |
| 8345 | && (!strcmp (dpyinfo->font_table[i].name, fontname) | 8342 | && (!xstricmp (dpyinfo->font_table[i].name, fontname) |
| 8346 | || !strcmp (dpyinfo->font_table[i].full_name, fontname))) | 8343 | || !xstricmp (dpyinfo->font_table[i].full_name, fontname))) |
| 8347 | return (dpyinfo->font_table + i); | 8344 | return (dpyinfo->font_table + i); |
| 8348 | return NULL; | 8345 | return NULL; |
| 8349 | } | 8346 | } |
| @@ -8537,7 +8534,7 @@ Point saved_menu_event_location; | |||
| 8537 | 8534 | ||
| 8538 | /* Apple Events */ | 8535 | /* Apple Events */ |
| 8539 | #if USE_CARBON_EVENTS | 8536 | #if USE_CARBON_EVENTS |
| 8540 | static Lisp_Object Qhicommand; | 8537 | static Lisp_Object Qhi_command; |
| 8541 | #ifdef MAC_OSX | 8538 | #ifdef MAC_OSX |
| 8542 | extern Lisp_Object Qwindow; | 8539 | extern Lisp_Object Qwindow; |
| 8543 | static Lisp_Object Qtoolbar_switch_mode; | 8540 | static Lisp_Object Qtoolbar_switch_mode; |
| @@ -8579,7 +8576,7 @@ static Lisp_Object Qservice, Qpaste, Qperform; | |||
| 8579 | static pascal OSStatus mac_handle_window_event (EventHandlerCallRef, | 8576 | static pascal OSStatus mac_handle_window_event (EventHandlerCallRef, |
| 8580 | EventRef, void *); | 8577 | EventRef, void *); |
| 8581 | #endif | 8578 | #endif |
| 8582 | OSErr install_window_handler (WindowPtr); | 8579 | OSStatus install_window_handler (WindowPtr); |
| 8583 | 8580 | ||
| 8584 | extern void init_emacs_passwd_dir (); | 8581 | extern void init_emacs_passwd_dir (); |
| 8585 | extern int emacs_main (int, char **, char **); | 8582 | extern int emacs_main (int, char **, char **); |
| @@ -9380,15 +9377,15 @@ mac_handle_command_event (next_handler, event, data) | |||
| 9380 | if (err != noErr || command.commandID == 0) | 9377 | if (err != noErr || command.commandID == 0) |
| 9381 | return eventNotHandledErr; | 9378 | return eventNotHandledErr; |
| 9382 | 9379 | ||
| 9383 | /* A HICommand event is mapped to an Apple event whose event class | 9380 | /* A HI command event is mapped to an Apple event whose event class |
| 9384 | symbol is `hicommand' and event ID is its command ID. */ | 9381 | symbol is `hi-command' and event ID is its command ID. */ |
| 9385 | err = mac_store_event_ref_as_apple_event (0, command.commandID, | 9382 | err = mac_store_event_ref_as_apple_event (0, command.commandID, |
| 9386 | Qhicommand, Qnil, | 9383 | Qhi_command, Qnil, |
| 9387 | event, num_params, names, types); | 9384 | event, num_params, names, types); |
| 9388 | return err == noErr ? noErr : eventNotHandledErr; | 9385 | return err == noErr ? noErr : eventNotHandledErr; |
| 9389 | } | 9386 | } |
| 9390 | 9387 | ||
| 9391 | static OSErr | 9388 | static OSStatus |
| 9392 | init_command_handler () | 9389 | init_command_handler () |
| 9393 | { | 9390 | { |
| 9394 | EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}}; | 9391 | EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}}; |
| @@ -9889,11 +9886,11 @@ mac_store_service_event (event) | |||
| 9889 | #endif /* USE_CARBON_EVENTS */ | 9886 | #endif /* USE_CARBON_EVENTS */ |
| 9890 | 9887 | ||
| 9891 | 9888 | ||
| 9892 | OSErr | 9889 | OSStatus |
| 9893 | install_window_handler (window) | 9890 | install_window_handler (window) |
| 9894 | WindowPtr window; | 9891 | WindowPtr window; |
| 9895 | { | 9892 | { |
| 9896 | OSErr err = noErr; | 9893 | OSStatus err = noErr; |
| 9897 | #if USE_CARBON_EVENTS | 9894 | #if USE_CARBON_EVENTS |
| 9898 | EventTypeSpec specs_window[] = | 9895 | EventTypeSpec specs_window[] = |
| 9899 | {{kEventClassWindow, kEventWindowUpdate}, | 9896 | {{kEventClassWindow, kEventWindowUpdate}, |
| @@ -11327,7 +11324,7 @@ static void | |||
| 11327 | init_menu_bar () | 11324 | init_menu_bar () |
| 11328 | { | 11325 | { |
| 11329 | #ifdef MAC_OSX | 11326 | #ifdef MAC_OSX |
| 11330 | OSErr err; | 11327 | OSStatus err; |
| 11331 | MenuRef menu; | 11328 | MenuRef menu; |
| 11332 | MenuItemIndex menu_index; | 11329 | MenuItemIndex menu_index; |
| 11333 | 11330 | ||
| @@ -11511,7 +11508,7 @@ syms_of_macterm () | |||
| 11511 | Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); | 11508 | Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); |
| 11512 | 11509 | ||
| 11513 | #if USE_CARBON_EVENTS | 11510 | #if USE_CARBON_EVENTS |
| 11514 | Qhicommand = intern ("hicommand"); staticpro (&Qhicommand); | 11511 | Qhi_command = intern ("hi-command"); staticpro (&Qhi_command); |
| 11515 | #ifdef MAC_OSX | 11512 | #ifdef MAC_OSX |
| 11516 | Qtoolbar_switch_mode = intern ("toolbar-switch-mode"); | 11513 | Qtoolbar_switch_mode = intern ("toolbar-switch-mode"); |
| 11517 | staticpro (&Qtoolbar_switch_mode); | 11514 | staticpro (&Qtoolbar_switch_mode); |
diff --git a/src/macterm.h b/src/macterm.h index fd71e36d28d..659a13bbb17 100644 --- a/src/macterm.h +++ b/src/macterm.h | |||
| @@ -335,11 +335,6 @@ struct mac_output { | |||
| 335 | /* Hints for the size and the position of a window. */ | 335 | /* Hints for the size and the position of a window. */ |
| 336 | XSizeHints *size_hints; | 336 | XSizeHints *size_hints; |
| 337 | 337 | ||
| 338 | #if TARGET_API_MAC_CARBON | ||
| 339 | /* File name for the proxy icon of this frame. Might be NULL. */ | ||
| 340 | char *file_name; | ||
| 341 | #endif | ||
| 342 | |||
| 343 | #if USE_CG_DRAWING | 338 | #if USE_CG_DRAWING |
| 344 | /* Quartz 2D graphics context. */ | 339 | /* Quartz 2D graphics context. */ |
| 345 | CGContextRef cg_context; | 340 | CGContextRef cg_context; |
| @@ -362,8 +357,6 @@ typedef struct mac_output mac_output; | |||
| 362 | 357 | ||
| 363 | #define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints) | 358 | #define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints) |
| 364 | 359 | ||
| 365 | #define FRAME_FILE_NAME(f) ((f)->output_data.mac->file_name) | ||
| 366 | |||
| 367 | /* This gives the mac_display_info structure for the display F is on. */ | 360 | /* This gives the mac_display_info structure for the display F is on. */ |
| 368 | #define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info) | 361 | #define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info) |
| 369 | #define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info) | 362 | #define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info) |
| @@ -631,7 +624,7 @@ extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *)); | |||
| 631 | extern int mac_font_panel_visible_p P_ ((void)); | 624 | extern int mac_font_panel_visible_p P_ ((void)); |
| 632 | extern OSStatus mac_show_hide_font_panel P_ ((void)); | 625 | extern OSStatus mac_show_hide_font_panel P_ ((void)); |
| 633 | extern OSStatus mac_set_font_info_for_selection P_ ((struct frame *, int, int)); | 626 | extern OSStatus mac_set_font_info_for_selection P_ ((struct frame *, int, int)); |
| 634 | extern OSErr install_window_handler P_ ((WindowPtr)); | 627 | extern OSStatus install_window_handler P_ ((WindowPtr)); |
| 635 | extern void remove_window_handler P_ ((WindowPtr)); | 628 | extern void remove_window_handler P_ ((WindowPtr)); |
| 636 | extern void do_menu_choice P_ ((SInt32)); | 629 | extern void do_menu_choice P_ ((SInt32)); |
| 637 | extern OSStatus mac_post_mouse_moved_event P_ ((void)); | 630 | extern OSStatus mac_post_mouse_moved_event P_ ((void)); |
| @@ -672,10 +665,10 @@ extern void mac_clear_font_name_table P_ ((void)); | |||
| 672 | extern Lisp_Object mac_aedesc_to_lisp P_ ((const AEDesc *)); | 665 | extern Lisp_Object mac_aedesc_to_lisp P_ ((const AEDesc *)); |
| 673 | extern OSErr mac_ae_put_lisp P_ ((AEDescList *, UInt32, Lisp_Object)); | 666 | extern OSErr mac_ae_put_lisp P_ ((AEDescList *, UInt32, Lisp_Object)); |
| 674 | #if TARGET_API_MAC_CARBON | 667 | #if TARGET_API_MAC_CARBON |
| 675 | extern OSErr create_apple_event_from_event_ref P_ ((EventRef, UInt32, | 668 | extern OSStatus create_apple_event_from_event_ref P_ ((EventRef, UInt32, |
| 676 | EventParamName *, | 669 | EventParamName *, |
| 677 | EventParamType *, | 670 | EventParamType *, |
| 678 | AppleEvent *)); | 671 | AppleEvent *)); |
| 679 | extern OSErr create_apple_event_from_drag_ref P_ ((DragRef, UInt32, | 672 | extern OSErr create_apple_event_from_drag_ref P_ ((DragRef, UInt32, |
| 680 | FlavorType *, | 673 | FlavorType *, |
| 681 | AppleEvent *)); | 674 | AppleEvent *)); |
diff --git a/src/print.c b/src/print.c index 5f42683753d..d5ff1be6b31 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 | |||
| 930 | void | ||
| 931 | debug_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/process.c b/src/process.c index 9dadc1ab4ab..f8ae50e8652 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4163,6 +4163,14 @@ server_accept_connection (server, channel) | |||
| 4163 | when not inside wait_reading_process_output. */ | 4163 | when not inside wait_reading_process_output. */ |
| 4164 | static int waiting_for_user_input_p; | 4164 | static int waiting_for_user_input_p; |
| 4165 | 4165 | ||
| 4166 | static Lisp_Object | ||
| 4167 | wait_reading_process_output_unwind (data) | ||
| 4168 | Lisp_Object data; | ||
| 4169 | { | ||
| 4170 | waiting_for_user_input_p = XINT (data); | ||
| 4171 | return Qnil; | ||
| 4172 | } | ||
| 4173 | |||
| 4166 | /* This is here so breakpoints can be put on it. */ | 4174 | /* This is here so breakpoints can be put on it. */ |
| 4167 | static void | 4175 | static void |
| 4168 | wait_reading_process_output_1 () | 4176 | wait_reading_process_output_1 () |
| @@ -4245,9 +4253,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4245 | EMACS_TIME timeout, end_time; | 4253 | EMACS_TIME timeout, end_time; |
| 4246 | int wait_channel = -1; | 4254 | int wait_channel = -1; |
| 4247 | int got_some_input = 0; | 4255 | int got_some_input = 0; |
| 4248 | /* Either nil or a cons cell, the car of which is of interest and | 4256 | int count = SPECPDL_INDEX (); |
| 4249 | may be changed outside of this routine. */ | ||
| 4250 | int saved_waiting_for_user_input_p = waiting_for_user_input_p; | ||
| 4251 | 4257 | ||
| 4252 | FD_ZERO (&Available); | 4258 | FD_ZERO (&Available); |
| 4253 | #ifdef NON_BLOCKING_CONNECT | 4259 | #ifdef NON_BLOCKING_CONNECT |
| @@ -4258,6 +4264,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4258 | if (wait_proc != NULL) | 4264 | if (wait_proc != NULL) |
| 4259 | wait_channel = XINT (wait_proc->infd); | 4265 | wait_channel = XINT (wait_proc->infd); |
| 4260 | 4266 | ||
| 4267 | record_unwind_protect (wait_reading_process_output_unwind, | ||
| 4268 | make_number (waiting_for_user_input_p)); | ||
| 4261 | waiting_for_user_input_p = read_kbd; | 4269 | waiting_for_user_input_p = read_kbd; |
| 4262 | 4270 | ||
| 4263 | /* Since we may need to wait several times, | 4271 | /* Since we may need to wait several times, |
| @@ -4884,7 +4892,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, | |||
| 4884 | } /* end for each file descriptor */ | 4892 | } /* end for each file descriptor */ |
| 4885 | } /* end while exit conditions not met */ | 4893 | } /* end while exit conditions not met */ |
| 4886 | 4894 | ||
| 4887 | waiting_for_user_input_p = saved_waiting_for_user_input_p; | 4895 | unbind_to (count, Qnil); |
| 4888 | 4896 | ||
| 4889 | /* If calling from keyboard input, do not quit | 4897 | /* If calling from keyboard input, do not quit |
| 4890 | since we want to return C-g as an input character. | 4898 | since we want to return C-g as an input character. |
diff --git a/src/puresize.h b/src/puresize.h index 5d39be5a541..d5a33e3cda5 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 (1126000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) | 46 | #define BASE_PURESIZE (1130000 + 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. */ |
| @@ -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. */ | ||
| 330 | int | ||
| 331 | w32_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 | |||
| 326 | static char startup_dir[MAXPATHLEN]; | 348 | static char startup_dir[MAXPATHLEN]; |
| 327 | 349 | ||
| 328 | /* Get the current working directory. */ | 350 | /* Get the current working directory. */ |
| @@ -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. */ |
| 111 | extern char * w32_strerror (int error_no); | 111 | extern char * w32_strerror (int error_no); |
| 112 | 112 | ||
| 113 | /* Validate a pointer. */ | ||
| 114 | extern 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. */ |
| 114 | extern BOOL w32_get_long_filename (char * name, char * buf, int size); | 117 | extern BOOL w32_get_long_filename (char * name, char * buf, int size); |
| 115 | 118 | ||
diff --git a/src/w32fns.c b/src/w32fns.c index 68fcced88c2..8c6a60d47bf 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -2066,7 +2066,8 @@ w32_createwindow (f) | |||
| 2066 | { | 2066 | { |
| 2067 | HWND hwnd; | 2067 | HWND hwnd; |
| 2068 | RECT rect; | 2068 | RECT rect; |
| 2069 | Lisp_Object top, left; | 2069 | Lisp_Object top = Qunbound; |
| 2070 | Lisp_Object left = Qunbound; | ||
| 2070 | 2071 | ||
| 2071 | rect.left = rect.top = 0; | 2072 | rect.left = rect.top = 0; |
| 2072 | rect.right = FRAME_PIXEL_WIDTH (f); | 2073 | rect.right = FRAME_PIXEL_WIDTH (f); |
| @@ -2079,13 +2080,41 @@ w32_createwindow (f) | |||
| 2079 | 2080 | ||
| 2080 | if (!hprevinst) | 2081 | if (!hprevinst) |
| 2081 | { | 2082 | { |
| 2083 | Lisp_Object ifa; | ||
| 2084 | |||
| 2082 | w32_init_class (hinst); | 2085 | w32_init_class (hinst); |
| 2086 | |||
| 2087 | /* Handle the -geometry command line option and the geometry | ||
| 2088 | settings in the registry. They are decoded and put into | ||
| 2089 | initial-frame-alist by w32-win.el:x-handle-geometry. */ | ||
| 2090 | ifa = Fsymbol_value (intern ("initial-frame-alist")); | ||
| 2091 | if (CONSP (ifa)) | ||
| 2092 | { | ||
| 2093 | Lisp_Object lt = Fassq (Qleft, ifa); | ||
| 2094 | Lisp_Object tp = Fassq (Qtop, ifa); | ||
| 2095 | |||
| 2096 | if (!NILP (lt)) | ||
| 2097 | { | ||
| 2098 | lt = XCDR (lt); | ||
| 2099 | if (INTEGERP (lt)) | ||
| 2100 | left = lt; | ||
| 2101 | } | ||
| 2102 | if (!NILP (tp)) | ||
| 2103 | { | ||
| 2104 | tp = XCDR (tp); | ||
| 2105 | if (INTEGERP (tp)) | ||
| 2106 | top = tp; | ||
| 2107 | } | ||
| 2108 | } | ||
| 2083 | } | 2109 | } |
| 2084 | 2110 | ||
| 2085 | /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero | 2111 | if (EQ (left, Qunbound) && EQ (top, Qunbound)) |
| 2086 | for anything that is not a number and is not Qunbound. */ | 2112 | { |
| 2087 | left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); | 2113 | /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero |
| 2088 | top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); | 2114 | for anything that is not a number and is not Qunbound. */ |
| 2115 | left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); | ||
| 2116 | top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); | ||
| 2117 | } | ||
| 2089 | 2118 | ||
| 2090 | FRAME_W32_WINDOW (f) = hwnd | 2119 | FRAME_W32_WINDOW (f) = hwnd |
| 2091 | = CreateWindow (EMACS_CLASS, | 2120 | = CreateWindow (EMACS_CLASS, |
| @@ -6207,7 +6236,7 @@ w32_query_font (struct frame *f, char *fontname) | |||
| 6207 | 6236 | ||
| 6208 | for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++) | 6237 | for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++) |
| 6209 | { | 6238 | { |
| 6210 | if (strcmp(pfi->name, fontname) == 0) return pfi; | 6239 | if (stricmp(pfi->name, fontname) == 0) return pfi; |
| 6211 | } | 6240 | } |
| 6212 | 6241 | ||
| 6213 | return NULL; | 6242 | return NULL; |
| @@ -6326,17 +6355,12 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, | |||
| 6326 | CHECK_STRING (color); | 6355 | CHECK_STRING (color); |
| 6327 | 6356 | ||
| 6328 | if (w32_defined_color (f, SDATA (color), &foo, 0)) | 6357 | if (w32_defined_color (f, SDATA (color), &foo, 0)) |
| 6329 | { | 6358 | return list3 (make_number ((GetRValue (foo.pixel) << 8) |
| 6330 | Lisp_Object rgb[3]; | 6359 | | GetRValue (foo.pixel)), |
| 6331 | 6360 | make_number ((GetGValue (foo.pixel) << 8) | |
| 6332 | rgb[0] = make_number ((GetRValue (foo.pixel) << 8) | 6361 | | GetGValue (foo.pixel)), |
| 6333 | | GetRValue (foo.pixel)); | 6362 | make_number ((GetBValue (foo.pixel) << 8) |
| 6334 | rgb[1] = make_number ((GetGValue (foo.pixel) << 8) | 6363 | | GetBValue (foo.pixel))); |
| 6335 | | GetGValue (foo.pixel)); | ||
| 6336 | rgb[2] = make_number ((GetBValue (foo.pixel) << 8) | ||
| 6337 | | GetBValue (foo.pixel)); | ||
| 6338 | return Flist (3, rgb); | ||
| 6339 | } | ||
| 6340 | else | 6364 | else |
| 6341 | return Qnil; | 6365 | return Qnil; |
| 6342 | } | 6366 | } |
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/w32term.c b/src/w32term.c index b564ed3bd2b..2870955b94f 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -91,6 +91,10 @@ static Lisp_Object last_window; | |||
| 91 | (Not yet supported, see TODO in x_draw_glyph_string.) */ | 91 | (Not yet supported, see TODO in x_draw_glyph_string.) */ |
| 92 | int x_use_underline_position_properties; | 92 | int x_use_underline_position_properties; |
| 93 | 93 | ||
| 94 | /* Non-zero means to draw the underline at the same place as the descent line. */ | ||
| 95 | |||
| 96 | int x_underline_at_descent_line; | ||
| 97 | |||
| 94 | extern unsigned int msh_mousewheel; | 98 | extern unsigned int msh_mousewheel; |
| 95 | 99 | ||
| 96 | extern void free_frame_menubar (); | 100 | extern void free_frame_menubar (); |
| @@ -2418,7 +2422,9 @@ x_draw_stretch_glyph_string (s) | |||
| 2418 | int background_width = s->background_width; | 2422 | int background_width = s->background_width; |
| 2419 | int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); | 2423 | int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); |
| 2420 | 2424 | ||
| 2421 | if (x < left_x) | 2425 | /* Don't draw into left margin, fringe or scrollbar area |
| 2426 | except for header line and mode line. */ | ||
| 2427 | if (x < left_x && !s->row->mode_line_p) | ||
| 2422 | { | 2428 | { |
| 2423 | background_width -= left_x - x; | 2429 | background_width -= left_x - x; |
| 2424 | x = left_x; | 2430 | x = left_x; |
| @@ -2507,21 +2513,27 @@ x_draw_glyph_string (s) | |||
| 2507 | && (s->font->bdf || !s->font->tm.tmUnderlined)) | 2513 | && (s->font->bdf || !s->font->tm.tmUnderlined)) |
| 2508 | { | 2514 | { |
| 2509 | unsigned long h = 1; | 2515 | unsigned long h = 1; |
| 2510 | unsigned long dy = s->height - h; | 2516 | unsigned long dy = 0; |
| 2511 | 2517 | ||
| 2512 | /* TODO: Use font information for positioning and thickness | 2518 | if (x_underline_at_descent_line) |
| 2513 | of underline. See OUTLINETEXTMETRIC, and xterm.c. | 2519 | dy = s->height - h; |
| 2514 | Note: If you make this work, don't forget to change the | 2520 | else |
| 2515 | doc string of x-use-underline-position-properties below. */ | 2521 | { |
| 2522 | /* TODO: Use font information for positioning and thickness of | ||
| 2523 | underline. See OUTLINETEXTMETRIC, and xterm.c. Note: If | ||
| 2524 | you make this work, don't forget to change the doc string of | ||
| 2525 | x-use-underline-position-properties below. */ | ||
| 2526 | dy = s->height - h; | ||
| 2527 | } | ||
| 2516 | if (s->face->underline_defaulted_p) | 2528 | if (s->face->underline_defaulted_p) |
| 2517 | { | 2529 | { |
| 2518 | w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x, | 2530 | w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x, |
| 2519 | s->y + dy, s->width, 1); | 2531 | s->y + dy, s->background_width, 1); |
| 2520 | } | 2532 | } |
| 2521 | else | 2533 | else |
| 2522 | { | 2534 | { |
| 2523 | w32_fill_area (s->f, s->hdc, s->face->underline_color, s->x, | 2535 | w32_fill_area (s->f, s->hdc, s->face->underline_color, s->x, |
| 2524 | s->y + dy, s->width, 1); | 2536 | s->y + dy, s->background_width, 1); |
| 2525 | } | 2537 | } |
| 2526 | } | 2538 | } |
| 2527 | 2539 | ||
| @@ -2533,12 +2545,12 @@ x_draw_glyph_string (s) | |||
| 2533 | if (s->face->overline_color_defaulted_p) | 2545 | if (s->face->overline_color_defaulted_p) |
| 2534 | { | 2546 | { |
| 2535 | w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x, | 2547 | w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x, |
| 2536 | s->y + dy, s->width, h); | 2548 | s->y + dy, s->background_width, h); |
| 2537 | } | 2549 | } |
| 2538 | else | 2550 | else |
| 2539 | { | 2551 | { |
| 2540 | w32_fill_area (s->f, s->hdc, s->face->overline_color, s->x, | 2552 | w32_fill_area (s->f, s->hdc, s->face->overline_color, s->x, |
| 2541 | s->y + dy, s->width, h); | 2553 | s->y + dy, s->background_width, h); |
| 2542 | } | 2554 | } |
| 2543 | } | 2555 | } |
| 2544 | 2556 | ||
| @@ -6509,6 +6521,14 @@ to 4.1, set this to nil. | |||
| 6509 | NOTE: Not supported on MS-Windows yet. */); | 6521 | NOTE: Not supported on MS-Windows yet. */); |
| 6510 | x_use_underline_position_properties = 0; | 6522 | x_use_underline_position_properties = 0; |
| 6511 | 6523 | ||
| 6524 | DEFVAR_BOOL ("x-underline-at-descent-line", | ||
| 6525 | &x_underline_at_descent_line, | ||
| 6526 | doc: /* *Non-nil means to draw the underline at the same place as the descent line. | ||
| 6527 | nil means to draw the underline according to the value of the variable | ||
| 6528 | `x-use-underline-position-properties', which is usually at the baseline | ||
| 6529 | level. The default value is nil. */); | ||
| 6530 | x_underline_at_descent_line = 0; | ||
| 6531 | |||
| 6512 | DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, | 6532 | DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, |
| 6513 | doc: /* If not nil, Emacs uses toolkit scroll bars. */); | 6533 | doc: /* If not nil, Emacs uses toolkit scroll bars. */); |
| 6514 | Vx_toolkit_scroll_bars = Qt; | 6534 | Vx_toolkit_scroll_bars = Qt; |
diff --git a/src/window.c b/src/window.c index 879777d25e1..a3e7b93e878 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -6658,10 +6658,12 @@ display marginal areas and the text area. */) | |||
| 6658 | CHECK_NATNUM (left_width); | 6658 | CHECK_NATNUM (left_width); |
| 6659 | if (!NILP (right_width)) | 6659 | if (!NILP (right_width)) |
| 6660 | CHECK_NATNUM (right_width); | 6660 | CHECK_NATNUM (right_width); |
| 6661 | 6661 | ||
| 6662 | if (!EQ (w->left_fringe_width, left_width) | 6662 | /* Do nothing on a tty. */ |
| 6663 | || !EQ (w->right_fringe_width, right_width) | 6663 | if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) |
| 6664 | || !EQ (w->fringes_outside_margins, outside_margins)) | 6664 | && (!EQ (w->left_fringe_width, left_width) |
| 6665 | || !EQ (w->right_fringe_width, right_width) | ||
| 6666 | || !EQ (w->fringes_outside_margins, outside_margins))) | ||
| 6665 | { | 6667 | { |
| 6666 | w->left_fringe_width = left_width; | 6668 | w->left_fringe_width = left_width; |
| 6667 | w->right_fringe_width = right_width; | 6669 | w->right_fringe_width = right_width; |
| @@ -6689,10 +6691,11 @@ Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */) | |||
| 6689 | Lisp_Object window; | 6691 | Lisp_Object window; |
| 6690 | { | 6692 | { |
| 6691 | struct window *w = decode_window (window); | 6693 | struct window *w = decode_window (window); |
| 6694 | |||
| 6692 | return Fcons (make_number (WINDOW_LEFT_FRINGE_WIDTH (w)), | 6695 | return Fcons (make_number (WINDOW_LEFT_FRINGE_WIDTH (w)), |
| 6693 | Fcons (make_number (WINDOW_RIGHT_FRINGE_WIDTH (w)), | 6696 | Fcons (make_number (WINDOW_RIGHT_FRINGE_WIDTH (w)), |
| 6694 | Fcons ((WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) ? | 6697 | Fcons ((WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) |
| 6695 | Qt : Qnil), Qnil))); | 6698 | ? Qt : Qnil), Qnil))); |
| 6696 | } | 6699 | } |
| 6697 | 6700 | ||
| 6698 | 6701 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 76ab430386c..7e65b91fd13 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -701,6 +701,10 @@ Lisp_Object Vresize_mini_windows; | |||
| 701 | 701 | ||
| 702 | struct buffer *displayed_buffer; | 702 | struct buffer *displayed_buffer; |
| 703 | 703 | ||
| 704 | /* Space between overline and text. */ | ||
| 705 | |||
| 706 | EMACS_INT overline_margin; | ||
| 707 | |||
| 704 | /* Value returned from text property handlers (see below). */ | 708 | /* Value returned from text property handlers (see below). */ |
| 705 | 709 | ||
| 706 | enum prop_handled | 710 | enum prop_handled |
| @@ -887,7 +891,7 @@ static void redisplay_window P_ ((Lisp_Object, int)); | |||
| 887 | static Lisp_Object redisplay_window_error (); | 891 | static Lisp_Object redisplay_window_error (); |
| 888 | static Lisp_Object redisplay_window_0 P_ ((Lisp_Object)); | 892 | static Lisp_Object redisplay_window_0 P_ ((Lisp_Object)); |
| 889 | static Lisp_Object redisplay_window_1 P_ ((Lisp_Object)); | 893 | static Lisp_Object redisplay_window_1 P_ ((Lisp_Object)); |
| 890 | static void update_menu_bar P_ ((struct frame *, int)); | 894 | static int update_menu_bar P_ ((struct frame *, int, int)); |
| 891 | static int try_window_reusing_current_matrix P_ ((struct window *)); | 895 | static int try_window_reusing_current_matrix P_ ((struct window *)); |
| 892 | static int try_window_id P_ ((struct window *)); | 896 | static int try_window_id P_ ((struct window *)); |
| 893 | static int display_line P_ ((struct it *)); | 897 | static int display_line P_ ((struct it *)); |
| @@ -9038,6 +9042,9 @@ prepare_menu_bars () | |||
| 9038 | { | 9042 | { |
| 9039 | Lisp_Object tail, frame; | 9043 | Lisp_Object tail, frame; |
| 9040 | int count = SPECPDL_INDEX (); | 9044 | int count = SPECPDL_INDEX (); |
| 9045 | /* 1 means that update_menu_bar has run its hooks | ||
| 9046 | so any further calls to update_menu_bar shouldn't do so again. */ | ||
| 9047 | int menu_bar_hooks_run = 0; | ||
| 9041 | 9048 | ||
| 9042 | record_unwind_save_match_data (); | 9049 | record_unwind_save_match_data (); |
| 9043 | 9050 | ||
| @@ -9069,7 +9076,7 @@ prepare_menu_bars () | |||
| 9069 | } | 9076 | } |
| 9070 | 9077 | ||
| 9071 | GCPRO1 (tail); | 9078 | GCPRO1 (tail); |
| 9072 | update_menu_bar (f, 0); | 9079 | menu_bar_hooks_run = update_menu_bar (f, 0, menu_bar_hooks_run); |
| 9073 | #ifdef HAVE_WINDOW_SYSTEM | 9080 | #ifdef HAVE_WINDOW_SYSTEM |
| 9074 | update_tool_bar (f, 0); | 9081 | update_tool_bar (f, 0); |
| 9075 | #ifdef MAC_OS | 9082 | #ifdef MAC_OS |
| @@ -9084,7 +9091,7 @@ prepare_menu_bars () | |||
| 9084 | else | 9091 | else |
| 9085 | { | 9092 | { |
| 9086 | struct frame *sf = SELECTED_FRAME (); | 9093 | struct frame *sf = SELECTED_FRAME (); |
| 9087 | update_menu_bar (sf, 1); | 9094 | update_menu_bar (sf, 1, 0); |
| 9088 | #ifdef HAVE_WINDOW_SYSTEM | 9095 | #ifdef HAVE_WINDOW_SYSTEM |
| 9089 | update_tool_bar (sf, 1); | 9096 | update_tool_bar (sf, 1); |
| 9090 | #ifdef MAC_OS | 9097 | #ifdef MAC_OS |
| @@ -9105,12 +9112,18 @@ prepare_menu_bars () | |||
| 9105 | before we start to fill in any display lines, because it can call | 9112 | before we start to fill in any display lines, because it can call |
| 9106 | eval. | 9113 | eval. |
| 9107 | 9114 | ||
| 9108 | If SAVE_MATCH_DATA is non-zero, we must save and restore it here. */ | 9115 | If SAVE_MATCH_DATA is non-zero, we must save and restore it here. |
| 9109 | 9116 | ||
| 9110 | static void | 9117 | If HOOKS_RUN is 1, that means a previous call to update_menu_bar |
| 9111 | update_menu_bar (f, save_match_data) | 9118 | already ran the menu bar hooks for this redisplay, so there |
| 9119 | is no need to run them again. The return value is the | ||
| 9120 | updated value of this flag, to pass to the next call. */ | ||
| 9121 | |||
| 9122 | static int | ||
| 9123 | update_menu_bar (f, save_match_data, hooks_run) | ||
| 9112 | struct frame *f; | 9124 | struct frame *f; |
| 9113 | int save_match_data; | 9125 | int save_match_data; |
| 9126 | int hooks_run; | ||
| 9114 | { | 9127 | { |
| 9115 | Lisp_Object window; | 9128 | Lisp_Object window; |
| 9116 | register struct window *w; | 9129 | register struct window *w; |
| @@ -9175,15 +9188,21 @@ update_menu_bar (f, save_match_data) | |||
| 9175 | specbind (Qoverriding_local_map, Qnil); | 9188 | specbind (Qoverriding_local_map, Qnil); |
| 9176 | } | 9189 | } |
| 9177 | 9190 | ||
| 9178 | /* Run the Lucid hook. */ | 9191 | if (!hooks_run) |
| 9179 | safe_run_hooks (Qactivate_menubar_hook); | 9192 | { |
| 9193 | /* Run the Lucid hook. */ | ||
| 9194 | safe_run_hooks (Qactivate_menubar_hook); | ||
| 9180 | 9195 | ||
| 9181 | /* If it has changed current-menubar from previous value, | 9196 | /* If it has changed current-menubar from previous value, |
| 9182 | really recompute the menu-bar from the value. */ | 9197 | really recompute the menu-bar from the value. */ |
| 9183 | if (! NILP (Vlucid_menu_bar_dirty_flag)) | 9198 | if (! NILP (Vlucid_menu_bar_dirty_flag)) |
| 9184 | call0 (Qrecompute_lucid_menubar); | 9199 | call0 (Qrecompute_lucid_menubar); |
| 9200 | |||
| 9201 | safe_run_hooks (Qmenu_bar_update_hook); | ||
| 9202 | |||
| 9203 | hooks_run = 1; | ||
| 9204 | } | ||
| 9185 | 9205 | ||
| 9186 | safe_run_hooks (Qmenu_bar_update_hook); | ||
| 9187 | FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); | 9206 | FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); |
| 9188 | 9207 | ||
| 9189 | /* Redisplay the menu bar in case we changed it. */ | 9208 | /* Redisplay the menu bar in case we changed it. */ |
| @@ -9212,6 +9231,8 @@ update_menu_bar (f, save_match_data) | |||
| 9212 | set_buffer_internal_1 (prev); | 9231 | set_buffer_internal_1 (prev); |
| 9213 | } | 9232 | } |
| 9214 | } | 9233 | } |
| 9234 | |||
| 9235 | return hooks_run; | ||
| 9215 | } | 9236 | } |
| 9216 | 9237 | ||
| 9217 | 9238 | ||
| @@ -9376,7 +9397,8 @@ update_tool_bar (f, save_match_data) | |||
| 9376 | &new_n_tool_bar); | 9397 | &new_n_tool_bar); |
| 9377 | 9398 | ||
| 9378 | /* Redisplay the tool-bar if we changed it. */ | 9399 | /* Redisplay the tool-bar if we changed it. */ |
| 9379 | if (NILP (Fequal (new_tool_bar, f->tool_bar_items))) | 9400 | if (new_n_tool_bar != f->n_tool_bar_items |
| 9401 | || NILP (Fequal (new_tool_bar, f->tool_bar_items))) | ||
| 9380 | { | 9402 | { |
| 9381 | /* Redisplay that happens asynchronously due to an expose event | 9403 | /* Redisplay that happens asynchronously due to an expose event |
| 9382 | may access f->tool_bar_items. Make sure we update both | 9404 | may access f->tool_bar_items. Make sure we update both |
| @@ -20354,7 +20376,7 @@ x_produce_glyphs (it) | |||
| 20354 | /* If face has an overline, add the height of the overline | 20376 | /* If face has an overline, add the height of the overline |
| 20355 | (1 pixel) and a 1 pixel margin to the character height. */ | 20377 | (1 pixel) and a 1 pixel margin to the character height. */ |
| 20356 | if (face->overline_p) | 20378 | if (face->overline_p) |
| 20357 | it->ascent += 2; | 20379 | it->ascent += overline_margin; |
| 20358 | 20380 | ||
| 20359 | if (it->constrain_row_ascent_descent_p) | 20381 | if (it->constrain_row_ascent_descent_p) |
| 20360 | { | 20382 | { |
| @@ -20556,7 +20578,7 @@ x_produce_glyphs (it) | |||
| 20556 | /* If face has an overline, add the height of the overline | 20578 | /* If face has an overline, add the height of the overline |
| 20557 | (1 pixel) and a 1 pixel margin to the character height. */ | 20579 | (1 pixel) and a 1 pixel margin to the character height. */ |
| 20558 | if (face->overline_p) | 20580 | if (face->overline_p) |
| 20559 | it->ascent += 2; | 20581 | it->ascent += overline_margin; |
| 20560 | 20582 | ||
| 20561 | take_vertical_position_into_account (it); | 20583 | take_vertical_position_into_account (it); |
| 20562 | 20584 | ||
| @@ -20831,7 +20853,7 @@ x_produce_glyphs (it) | |||
| 20831 | /* If face has an overline, add the height of the overline | 20853 | /* If face has an overline, add the height of the overline |
| 20832 | (1 pixel) and a 1 pixel margin to the character height. */ | 20854 | (1 pixel) and a 1 pixel margin to the character height. */ |
| 20833 | if (face->overline_p) | 20855 | if (face->overline_p) |
| 20834 | it->ascent += 2; | 20856 | it->ascent += overline_margin; |
| 20835 | 20857 | ||
| 20836 | take_vertical_position_into_account (it); | 20858 | take_vertical_position_into_account (it); |
| 20837 | 20859 | ||
| @@ -24108,6 +24130,12 @@ whose contents depend on various data. */); | |||
| 24108 | doc: /* Inhibit try_cursor_movement display optimization. */); | 24130 | doc: /* Inhibit try_cursor_movement display optimization. */); |
| 24109 | inhibit_try_cursor_movement = 0; | 24131 | inhibit_try_cursor_movement = 0; |
| 24110 | #endif /* GLYPH_DEBUG */ | 24132 | #endif /* GLYPH_DEBUG */ |
| 24133 | |||
| 24134 | DEFVAR_INT ("overline-margin", &overline_margin, | ||
| 24135 | doc: /* *Space between overline and text, in pixels. | ||
| 24136 | The default value is 2: the height of the overline (1 pixel) plus 1 pixel | ||
| 24137 | margin to the caracter height. */); | ||
| 24138 | overline_margin = 2; | ||
| 24111 | } | 24139 | } |
| 24112 | 24140 | ||
| 24113 | 24141 | ||
diff --git a/src/xfaces.c b/src/xfaces.c index 18e5d9a6119..6373100484a 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -1192,7 +1192,7 @@ load_pixmap (f, name, w_ptr, h_ptr) | |||
| 1192 | 1192 | ||
| 1193 | if (bitmap_id < 0) | 1193 | if (bitmap_id < 0) |
| 1194 | { | 1194 | { |
| 1195 | add_to_log ("Invalid or undefined bitmap %s", name, Qnil); | 1195 | add_to_log ("Invalid or undefined bitmap `%s'", name, Qnil); |
| 1196 | bitmap_id = 0; | 1196 | bitmap_id = 0; |
| 1197 | 1197 | ||
| 1198 | if (w_ptr) | 1198 | if (w_ptr) |
| @@ -5734,6 +5734,8 @@ lookup_named_face (f, symbol, c, signal_p) | |||
| 5734 | if (!realize_basic_faces (f)) | 5734 | if (!realize_basic_faces (f)) |
| 5735 | return -1; | 5735 | return -1; |
| 5736 | default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); | 5736 | default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); |
| 5737 | if (default_face == NULL) | ||
| 5738 | abort (); /* realize_basic_faces must have set it up */ | ||
| 5737 | } | 5739 | } |
| 5738 | 5740 | ||
| 5739 | if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p)) | 5741 | if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p)) |
| @@ -6238,6 +6240,8 @@ face for italic. */) | |||
| 6238 | if (! realize_basic_faces (f)) | 6240 | if (! realize_basic_faces (f)) |
| 6239 | error ("Cannot realize default face"); | 6241 | error ("Cannot realize default face"); |
| 6240 | def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); | 6242 | def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); |
| 6243 | if (def_face == NULL) | ||
| 6244 | abort (); /* realize_basic_faces must have set it up */ | ||
| 6241 | } | 6245 | } |
| 6242 | 6246 | ||
| 6243 | /* Dispatch to the appropriate handler. */ | 6247 | /* Dispatch to the appropriate handler. */ |
diff --git a/src/xfns.c b/src/xfns.c index 3cadc8504f4..d5b8a01cf20 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -3495,14 +3495,9 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, | |||
| 3495 | CHECK_STRING (color); | 3495 | CHECK_STRING (color); |
| 3496 | 3496 | ||
| 3497 | if (x_defined_color (f, SDATA (color), &foo, 0)) | 3497 | if (x_defined_color (f, SDATA (color), &foo, 0)) |
| 3498 | { | 3498 | return list3 (make_number (foo.red), |
| 3499 | Lisp_Object rgb[3]; | 3499 | make_number (foo.green), |
| 3500 | 3500 | make_number (foo.blue)); | |
| 3501 | rgb[0] = make_number (foo.red); | ||
| 3502 | rgb[1] = make_number (foo.green); | ||
| 3503 | rgb[2] = make_number (foo.blue); | ||
| 3504 | return Flist (3, rgb); | ||
| 3505 | } | ||
| 3506 | else | 3501 | else |
| 3507 | return Qnil; | 3502 | return Qnil; |
| 3508 | } | 3503 | } |
diff --git a/src/xselect.c b/src/xselect.c index 211d207bac4..cd49e05171b 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -2709,8 +2709,48 @@ If the value is 0 or the atom is not known, return the empty string. */) | |||
| 2709 | return ret; | 2709 | return ret; |
| 2710 | } | 2710 | } |
| 2711 | 2711 | ||
| 2712 | /* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. | 2712 | DEFUN ("x-register-dnd-atom", Fx_register_dnd_atom, |
| 2713 | TODO: Check if this client event really is a DND event? */ | 2713 | Sx_register_dnd_atom, 1, 2, 0, |
| 2714 | doc: /* Request that dnd events are made for ClientMessages with ATOM. | ||
| 2715 | ATOM can be a symbol or a string. The ATOM is interned on the display that | ||
| 2716 | FRAME is on. If FRAME is nil, the selected frame is used. */) | ||
| 2717 | (atom, frame) | ||
| 2718 | Lisp_Object atom, frame; | ||
| 2719 | { | ||
| 2720 | Atom x_atom; | ||
| 2721 | struct frame *f = check_x_frame (frame); | ||
| 2722 | size_t i; | ||
| 2723 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | ||
| 2724 | |||
| 2725 | |||
| 2726 | if (SYMBOLP (atom)) | ||
| 2727 | x_atom = symbol_to_x_atom (dpyinfo, FRAME_X_DISPLAY (f), atom); | ||
| 2728 | else if (STRINGP (atom)) | ||
| 2729 | { | ||
| 2730 | BLOCK_INPUT; | ||
| 2731 | x_atom = XInternAtom (FRAME_X_DISPLAY (f), (char *) SDATA (atom), False); | ||
| 2732 | UNBLOCK_INPUT; | ||
| 2733 | } | ||
| 2734 | else | ||
| 2735 | error ("ATOM must be a symbol or a string"); | ||
| 2736 | |||
| 2737 | for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) | ||
| 2738 | if (dpyinfo->x_dnd_atoms[i] == x_atom) | ||
| 2739 | return Qnil; | ||
| 2740 | |||
| 2741 | if (dpyinfo->x_dnd_atoms_length == dpyinfo->x_dnd_atoms_size) | ||
| 2742 | { | ||
| 2743 | dpyinfo->x_dnd_atoms_size *= 2; | ||
| 2744 | dpyinfo->x_dnd_atoms = xrealloc (dpyinfo->x_dnd_atoms, | ||
| 2745 | sizeof (*dpyinfo->x_dnd_atoms) | ||
| 2746 | * dpyinfo->x_dnd_atoms_size); | ||
| 2747 | } | ||
| 2748 | |||
| 2749 | dpyinfo->x_dnd_atoms[dpyinfo->x_dnd_atoms_length++] = x_atom; | ||
| 2750 | return Qnil; | ||
| 2751 | } | ||
| 2752 | |||
| 2753 | /* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. */ | ||
| 2714 | 2754 | ||
| 2715 | int | 2755 | int |
| 2716 | x_handle_dnd_message (f, event, dpyinfo, bufp) | 2756 | x_handle_dnd_message (f, event, dpyinfo, bufp) |
| @@ -2726,6 +2766,12 @@ x_handle_dnd_message (f, event, dpyinfo, bufp) | |||
| 2726 | int x, y; | 2766 | int x, y; |
| 2727 | unsigned char *data = (unsigned char *) event->data.b; | 2767 | unsigned char *data = (unsigned char *) event->data.b; |
| 2728 | int idata[5]; | 2768 | int idata[5]; |
| 2769 | size_t i; | ||
| 2770 | |||
| 2771 | for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) | ||
| 2772 | if (dpyinfo->x_dnd_atoms[i] == event->message_type) break; | ||
| 2773 | |||
| 2774 | if (i == dpyinfo->x_dnd_atoms_length) return 0; | ||
| 2729 | 2775 | ||
| 2730 | XSETFRAME (frame, f); | 2776 | XSETFRAME (frame, f); |
| 2731 | 2777 | ||
| @@ -2899,6 +2945,7 @@ syms_of_xselect () | |||
| 2899 | 2945 | ||
| 2900 | defsubr (&Sx_get_atom_name); | 2946 | defsubr (&Sx_get_atom_name); |
| 2901 | defsubr (&Sx_send_client_message); | 2947 | defsubr (&Sx_send_client_message); |
| 2948 | defsubr (&Sx_register_dnd_atom); | ||
| 2902 | 2949 | ||
| 2903 | reading_selection_reply = Fcons (Qnil, Qnil); | 2950 | reading_selection_reply = Fcons (Qnil, Qnil); |
| 2904 | staticpro (&reading_selection_reply); | 2951 | staticpro (&reading_selection_reply); |
diff --git a/src/xterm.c b/src/xterm.c index 5df7896a2b3..466037c75a2 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -181,6 +181,10 @@ static Lisp_Object last_window; | |||
| 181 | 181 | ||
| 182 | int x_use_underline_position_properties; | 182 | int x_use_underline_position_properties; |
| 183 | 183 | ||
| 184 | /* Non-zero means to draw the underline at the same place as the descent line. */ | ||
| 185 | |||
| 186 | int x_underline_at_descent_line; | ||
| 187 | |||
| 184 | /* This is a chain of structures for all the X displays currently in | 188 | /* This is a chain of structures for all the X displays currently in |
| 185 | use. */ | 189 | use. */ |
| 186 | 190 | ||
| @@ -2601,7 +2605,9 @@ x_draw_stretch_glyph_string (s) | |||
| 2601 | int background_width = s->background_width; | 2605 | int background_width = s->background_width; |
| 2602 | int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); | 2606 | int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); |
| 2603 | 2607 | ||
| 2604 | if (x < left_x) | 2608 | /* Don't draw into left margin, fringe or scrollbar area |
| 2609 | except for header line and mode line. */ | ||
| 2610 | if (x < left_x && !s->row->mode_line_p) | ||
| 2605 | { | 2611 | { |
| 2606 | background_width -= left_x - x; | 2612 | background_width -= left_x - x; |
| 2607 | x = left_x; | 2613 | x = left_x; |
| @@ -2695,32 +2701,35 @@ x_draw_glyph_string (s) | |||
| 2695 | if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h)) | 2701 | if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h)) |
| 2696 | h = 1; | 2702 | h = 1; |
| 2697 | 2703 | ||
| 2698 | /* Get the underline position. This is the recommended | 2704 | if (x_underline_at_descent_line) |
| 2699 | vertical offset in pixels from the baseline to the top of | ||
| 2700 | the underline. This is a signed value according to the | ||
| 2701 | specs, and its default is | ||
| 2702 | |||
| 2703 | ROUND ((maximum descent) / 2), with | ||
| 2704 | ROUND(x) = floor (x + 0.5) */ | ||
| 2705 | |||
| 2706 | if (x_use_underline_position_properties | ||
| 2707 | && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem)) | ||
| 2708 | y = s->ybase + (long) tem; | ||
| 2709 | else if (s->face->font) | ||
| 2710 | y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2; | ||
| 2711 | else | ||
| 2712 | y = s->y + s->height - h; | 2705 | y = s->y + s->height - h; |
| 2706 | else | ||
| 2707 | { | ||
| 2708 | /* Get the underline position. This is the recommended | ||
| 2709 | vertical offset in pixels from the baseline to the top of | ||
| 2710 | the underline. This is a signed value according to the | ||
| 2711 | specs, and its default is | ||
| 2712 | |||
| 2713 | ROUND ((maximum descent) / 2), with | ||
| 2714 | ROUND(x) = floor (x + 0.5) */ | ||
| 2715 | |||
| 2716 | if (x_use_underline_position_properties | ||
| 2717 | && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem)) | ||
| 2718 | y = s->ybase + (long) tem; | ||
| 2719 | else if (s->face->font) | ||
| 2720 | y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2; | ||
| 2721 | } | ||
| 2713 | 2722 | ||
| 2714 | if (s->face->underline_defaulted_p) | 2723 | if (s->face->underline_defaulted_p) |
| 2715 | XFillRectangle (s->display, s->window, s->gc, | 2724 | XFillRectangle (s->display, s->window, s->gc, |
| 2716 | s->x, y, s->width, h); | 2725 | s->x, y, s->background_width, h); |
| 2717 | else | 2726 | else |
| 2718 | { | 2727 | { |
| 2719 | XGCValues xgcv; | 2728 | XGCValues xgcv; |
| 2720 | XGetGCValues (s->display, s->gc, GCForeground, &xgcv); | 2729 | XGetGCValues (s->display, s->gc, GCForeground, &xgcv); |
| 2721 | XSetForeground (s->display, s->gc, s->face->underline_color); | 2730 | XSetForeground (s->display, s->gc, s->face->underline_color); |
| 2722 | XFillRectangle (s->display, s->window, s->gc, | 2731 | XFillRectangle (s->display, s->window, s->gc, |
| 2723 | s->x, y, s->width, h); | 2732 | s->x, y, s->background_width, h); |
| 2724 | XSetForeground (s->display, s->gc, xgcv.foreground); | 2733 | XSetForeground (s->display, s->gc, xgcv.foreground); |
| 2725 | } | 2734 | } |
| 2726 | } | 2735 | } |
| @@ -2732,14 +2741,14 @@ x_draw_glyph_string (s) | |||
| 2732 | 2741 | ||
| 2733 | if (s->face->overline_color_defaulted_p) | 2742 | if (s->face->overline_color_defaulted_p) |
| 2734 | XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, | 2743 | XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, |
| 2735 | s->width, h); | 2744 | s->background_width, h); |
| 2736 | else | 2745 | else |
| 2737 | { | 2746 | { |
| 2738 | XGCValues xgcv; | 2747 | XGCValues xgcv; |
| 2739 | XGetGCValues (s->display, s->gc, GCForeground, &xgcv); | 2748 | XGetGCValues (s->display, s->gc, GCForeground, &xgcv); |
| 2740 | XSetForeground (s->display, s->gc, s->face->overline_color); | 2749 | XSetForeground (s->display, s->gc, s->face->overline_color); |
| 2741 | XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, | 2750 | XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, |
| 2742 | s->width, h); | 2751 | s->background_width, h); |
| 2743 | XSetForeground (s->display, s->gc, xgcv.foreground); | 2752 | XSetForeground (s->display, s->gc, xgcv.foreground); |
| 2744 | } | 2753 | } |
| 2745 | } | 2754 | } |
| @@ -10096,8 +10105,8 @@ x_query_font (f, fontname) | |||
| 10096 | 10105 | ||
| 10097 | for (i = 0; i < dpyinfo->n_fonts; i++) | 10106 | for (i = 0; i < dpyinfo->n_fonts; i++) |
| 10098 | if (dpyinfo->font_table[i].name | 10107 | if (dpyinfo->font_table[i].name |
| 10099 | && (!strcmp (dpyinfo->font_table[i].name, fontname) | 10108 | && (!strcasecmp (dpyinfo->font_table[i].name, fontname) |
| 10100 | || !strcmp (dpyinfo->font_table[i].full_name, fontname))) | 10109 | || !strcasecmp (dpyinfo->font_table[i].full_name, fontname))) |
| 10101 | return (dpyinfo->font_table + i); | 10110 | return (dpyinfo->font_table + i); |
| 10102 | return NULL; | 10111 | return NULL; |
| 10103 | } | 10112 | } |
| @@ -10644,6 +10653,11 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10644 | 10653 | ||
| 10645 | dpyinfo->cut_buffers_initialized = 0; | 10654 | dpyinfo->cut_buffers_initialized = 0; |
| 10646 | 10655 | ||
| 10656 | dpyinfo->x_dnd_atoms_size = 8; | ||
| 10657 | dpyinfo->x_dnd_atoms_length = 0; | ||
| 10658 | dpyinfo->x_dnd_atoms = xmalloc (sizeof (*dpyinfo->x_dnd_atoms) | ||
| 10659 | * dpyinfo->x_dnd_atoms_size); | ||
| 10660 | |||
| 10647 | connection = ConnectionNumber (dpyinfo->display); | 10661 | connection = ConnectionNumber (dpyinfo->display); |
| 10648 | dpyinfo->connection = connection; | 10662 | dpyinfo->connection = connection; |
| 10649 | 10663 | ||
| @@ -11104,6 +11118,14 @@ UNDERLINE_POSITION font properties, for example 7x13 on XFree prior | |||
| 11104 | to 4.1, set this to nil. */); | 11118 | to 4.1, set this to nil. */); |
| 11105 | x_use_underline_position_properties = 1; | 11119 | x_use_underline_position_properties = 1; |
| 11106 | 11120 | ||
| 11121 | DEFVAR_BOOL ("x-underline-at-descent-line", | ||
| 11122 | &x_underline_at_descent_line, | ||
| 11123 | doc: /* *Non-nil means to draw the underline at the same place as the descent line. | ||
| 11124 | nil means to draw the underline according to the value of the variable | ||
| 11125 | `x-use-underline-position-properties', which is usually at the baseline | ||
| 11126 | level. The default value is nil. */); | ||
| 11127 | x_underline_at_descent_line = 0; | ||
| 11128 | |||
| 11107 | DEFVAR_BOOL ("x-mouse-click-focus-ignore-position", | 11129 | DEFVAR_BOOL ("x-mouse-click-focus-ignore-position", |
| 11108 | &x_mouse_click_focus_ignore_position, | 11130 | &x_mouse_click_focus_ignore_position, |
| 11109 | doc: /* Non-nil means that a mouse click to focus a frame does not move point. | 11131 | doc: /* Non-nil means that a mouse click to focus a frame does not move point. |
diff --git a/src/xterm.h b/src/xterm.h index 6bbcdc6389d..8f7055d95d5 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 |