diff --git a/ChangeLog b/ChangeLog index b34b4d6d09c..892a4a18ba3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-08-16 Andreas Schwab + + * configure.in (PKG_CHECK_MODULES): Use AS_MESSAGE_LOG_FD instead + of hardcoding it. + +2006-08-16 Richard Stallman + + * INSTALL.CVS: Clean up wording. + 2006-07-14 Eli Zaretskii * 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 before it builds the final Emacs binary. Normally, it is not necessary to use "make bootstrap" after every CVS -update. Unless there are problems, we suggest the following -procedure: +update. Unless there are problems, we suggest using the following +alternative procedure after you have done "make bootstrap" at least +once: $ ./configure $ make diff --git a/admin/ChangeLog b/admin/ChangeLog index 51c8fa9100b..97602d53653 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,7 @@ +2006-08-13 Chong Yidong + + * FOR-RELEASE: Elisp manual checking completed. + 2006-07-17 Reiner Steib * FOR-RELEASE: Update refcard section. diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index cb5df6149c7..35070c082b1 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -31,11 +31,6 @@ and KDE projects, to use the new Emacs icons in etc/images/icons. * BUGS -** bojohan's and johnsu01@wjsullivan.net's 18 July bug reports that - "C-n doesn't work in Customize Option buffer in -nw with long value - displayed". Yidong proposed a fix, but needs a field expert to check - it. - ** Markus Gritsch's report about Emacs looping on Windoze with the following .emacs file, and then reduce Emacs frame width to "something quite narrow": (setq-default truncate-lines t) @@ -44,74 +39,16 @@ and KDE projects, to use the new Emacs icons in etc/images/icons. '(hscroll-step 1) ) -** David Kastrup's report on strange scrolling of large images. - ** Jorgen Schaefer 's June 18 bug report about fields and invisible overlays needs attention from a field expert. ** Implement buffer-chars-modified-tick. +** henman@it.to-be.co.jp 09 Aug 2006: ispell.el problem. + + * DOCUMENTATION -** Check the Emacs Lisp manual. - -Each manual section should be checked for factual correctness -regarding recent changes by at least two people. After each file -name, on the same line or the following line, come the names of the -people who have checked it. - -SECTION READERS ----------------------------------- -lispref/abbrevs.texi "Luc Teirlinck" Chong Yidong -lispref/advice.texi Joakim Verona Chong Yidong -lispref/anti.texi Chong Yidong Kim F. Storm -lispref/backups.texi "Luc Teirlinck" Chong Yidong -lispref/buffers.texi "Luc Teirlinck" Chong Yidong -lispref/calendar.texi Joakim Verona Chong Yidong -lispref/commands.texi "Luc Teirlinck" Chong Yidong -lispref/compile.texi "Luc Teirlinck" Chong Yidong -lispref/control.texi "Luc Teirlinck" Chong Yidong -lispref/customize.texi Chong Yidong "Luc Teirlinck" -lispref/debugging.texi Joakim Verona Lute Kamstra -lispref/display.texi Chong Yidong Jason Rumney -lispref/edebug.texi Chong Yidong "Luc Teirlinck" -lispref/elisp.texi "Luc Teirlinck" Lute Kamstra -lispref/errors.texi "Luc Teirlinck" Chong Yidong -lispref/eval.texi "Luc Teirlinck" Chong Yidong -lispref/files.texi "Luc Teirlinck" Chong Yidong -lispref/frames.texi "Luc Teirlinck" Chong Yidong -lispref/functions.texi "Luc Teirlinck" Chong Yidong -lispref/hash.texi "Luc Teirlinck" Chong Yidong -lispref/help.texi "Luc Teirlinck" Chong Yidong -lispref/hooks.texi Lute Kamstra Chong Yidong -lispref/internals.texi "Luc Teirlinck" Chong Yidong -lispref/intro.texi "Luc Teirlinck" Josh Varner -lispref/keymaps.texi "Luc Teirlinck" Chong Yidong -lispref/lists.texi "Luc Teirlinck" Chong Yidong -lispref/loading.texi "Luc Teirlinck" Chong Yidong -lispref/locals.texi Chong Yidong Nick Roberts -lispref/macros.texi "Luc Teirlinck" Chong Yidong -lispref/maps.texi Chong Yidong Kim F. Storm -lispref/markers.texi "Luc Teirlinck" Chong Yidong -lispref/minibuf.texi "Luc Teirlinck" Chong Yidong -lispref/modes.texi Chong Yidong -lispref/nonascii.texi "Luc Teirlinck" Chong Yidong -lispref/numbers.texi "Luc Teirlinck" Chong Yidong -lispref/objects.texi "Luc Teirlinck" Chong Yidong -lispref/os.texi "Luc Teirlinck" Chong Yidong -lispref/positions.texi "Luc Teirlinck" Chong Yidong -lispref/processes.texi Chong Yidong ttn -lispref/searching.texi "Luc Teirlinck" Chong Yidong -lispref/sequences.texi "Luc Teirlinck" Chong Yidong -lispref/streams.texi "Luc Teirlinck" Chong Yidong -lispref/strings.texi "Luc Teirlinck" Chong Yidong -lispref/symbols.texi "Luc Teirlinck" Chong Yidong -lispref/syntax.texi "Luc Teirlinck" Chong Yidong -lispref/text.texi Chong Yidong -lispref/tips.texi "Luc Teirlinck" Chong Yidong -lispref/variables.texi "Luc Teirlinck" Chong Yidong -lispref/windows.texi "Luc Teirlinck" Chong Yidong - ** Check the Emacs Tutorial. The first line of every tutorial must begin with text ending in a period diff --git a/configure.in b/configure.in index 6df5b292749..c1899fd32cf 100644 --- a/configure.in +++ b/configure.in @@ -1509,7 +1509,7 @@ AC_DEFUN([PKG_CHECK_MODULES], [ if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then AC_MSG_CHECKING(for $2) - if $PKG_CONFIG --exists "$2" 2>&5; then + if $PKG_CONFIG --exists "$2" 2>&AS_MESSAGE_LOG_FD; then AC_MSG_RESULT(yes) succeeded=yes diff --git a/etc/ChangeLog b/etc/ChangeLog index ae887b33da9..32d7525e153 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,24 @@ +2006-08-15 Carsten Dominik + + * orgcard.tex: Version number change. + +2006-08-12 Werner Lemberg + + * TUTORIAL.de: Synchronize with TUTORIAL. + +2006-08-10 Romain Francoise + + * NEWS: Mention that zone-mode.el is now obsolete. + +2006-08-09 Richard Stallman + + * TUTORIAL: Don't say which side scroll bar is on. + +2006-08-06 Nick Roberts + + * DEBUG (Note): Add note about following a longjmp call. + Add local variables list for outline mode. + 2006-08-03 Michael Olson * ERC-NEWS: Update for ERC 5.1.4. @@ -186,7 +207,7 @@ 2006-05-29 Jan Dj,Ad(Brv - * NEWS: Mention F10 for Gtk+/Leddtif/Lucid menus. + * NEWS: Mention F10 for Gtk+/Lesstif/Lucid menus. 2006-05-26 Eli Zaretskii diff --git a/etc/DEBUG b/etc/DEBUG index 63327b3ce5c..bc81d1d5dc2 100644 --- a/etc/DEBUG +++ b/etc/DEBUG @@ -272,6 +272,13 @@ related data structures in a terse and user-friendly format: The above commands also exist in a version with an `x' suffix which takes an object of the relevant type as argument. +** Following longjmp call. + +Recent versions of glibc (2.4+?) encrypt stored values for setjmp/longjmp which +prevents GDB from being able to follow a longjmp call using `next'. To +disable this protection you need to set the environment variable +LD_POINTER_GUARD to 0. + ** Using GDB in Emacs 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, and look at those registers directly, to see the actual current values of these variables. + +Local variables: +mode: outline +paragraph-separate: "[ ]*$" +end: + ;;; arch-tag: fbf32980-e35d-481f-8e4c-a2eca2586e6b diff --git a/etc/NEWS b/etc/NEWS index e49ef100b1a..241396ade7a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1846,9 +1846,8 @@ type "C-h i m org RET" to read that manual. A reference card is available in `etc/orgcard.tex' and `etc/orgcard.ps'. +++ -** The new package dns-mode.el add syntax highlight of DNS master files. -The key binding C-c C-s (`dns-mode-soa-increment-serial') can be used -to increment the SOA serial. +** The new package dns-mode.el adds syntax highlighting of DNS master files. +It is a modern replacement for zone-mode.el, which is now obsolete. --- ** The new global minor mode `file-name-shadow-mode' modifies the way @@ -2069,6 +2068,7 @@ using hi-lock-mode in an initialization file will turn on Hi Lock in all buffers and no warning will be issued (for compatibility with the behavior in older versions of Emacs). +--- ** Changes in Allout *** Topic cryptography added, enabling easy gpg topic encryption and @@ -2077,11 +2077,19 @@ clear-text within a single file to your heart's content, using symmetric and/or public key modes. Time-limited key caching, user-provided symmetric key hinting and consistency verification, auto-encryption of pending topics on save, and more, make it easy to use encryption in -powerful ways. +powerful ways. Encryption behavior customization is collected in the +allout-encryption customization group. *** `allout-view-change-hook' marked as being deprecated - use -`allout-exposure-change-hook' instead. Both are currently being used, but -`allout-view-change-hook' will be ignored in a subsequent allout version. +`allout-exposure-change-hook' instead. Both are still invoked, but +`allout-view-change-hook' will eventually be ignored. The new +`allout-exposure-change-hook' is called with args that were passed to +`allout-flag-region', making it easier to use. + +*** Other allout functions which change the outline structure also have +hooks, enabling cooperative allout enhancements. See +`allout-structure-added-hook', `allout-structure-deleted-hook', and +`allout-structure-shifted-hook'. *** Default command prefix changed to "\C-c " (control-c space), to avoid intruding on user's keybinding space. Customize the @@ -2092,23 +2100,43 @@ concealed text, instead of selective-display. This simplifies the code, in particular avoiding the need for kludges for isearch dynamic-display, discretionary handling of edits of concealed text, undo concerns, etc. +*** Some previously rough topic-header format edge cases are reconciled. +Level 1 topics use the mode's comment format, and lines starting with the +asterisk - for instance, the comment close of some languages (eg, c's "*/" +or mathematica's "*)") - at the beginning of line are no longer are +interpreted as level 1 topics in those modes. (Yay!) + *** Many substantial fixes and refinements, including: - - repaired inhibition of inadvertent edits to concealed text - - repaired retention of topic body hanging indent upon topic depth shifts + - repaired regexp-quoting of custom header prefixes, so any literals + will now work (for instance, mathematica's "(*" is now properly + accepted). + - repaired inhibition of inadvertent edits to concealed text. - refuse to create "containment discontinuities", where a topic is shifted deeper than the offspring-depth of its' container - auto-fill-mode is now left inactive when allout-mode starts, if it already was inactive. also, `allout-inhibit-auto-fill' custom configuration variable makes it easy to disable auto fill in allout outlines in general or on a per-buffer basis. - - new hook `allout-mode-deactivate-hook', for coordinating with - deactivation of allout-mode. + - mode hook changes: new hook `allout-mode-deactivate-hook', for + coordinating with deactivation of allout-mode. `allout-mode-hook' is + now run after the `allout-mode' variable is changed, as is the new + `allout-mode-deactivate-hook'. + - allout now tolerates fielded text in outlines without disruption. + - hot-spot navigation now is modularized with a new function, + `allout-hotspot-key-handler', enabling easier articulation and + enhancement of the functionality by allout addons. + - topic body navigation is easier, where repeated beginning of line and + end of line key commands cycle through the actually beginning/end of + line and then beginning/end of topic, etc. see new customization vars + `allout-beginning-of-line-cycles' and `allout-end-of-line-cycles'. + - repaired retention of topic body hanging indent upon topic depth shifts - bulleting variation is simpler and more accommodating, both in the default behavior and in ability to vary when creating new topics - mode deactivation now does cleans up effectively, more properly restoring affected variables and hooks to former state, removing - overlays, etc. + overlays, etc. see `allout-add-resumptions' and + `allout-do-resumptions', which replace the old `allout-resumptions'. - included a few unit-tests for interior functionality. developers can have them automatically run at the end of module load by customizing the option `allout-run-unit-tests-on-load'. @@ -3587,6 +3615,9 @@ variable `calculator-radix-grouping-mode'. --- ** iso-acc.el is now obsolete. Use one of the latin input methods instead. +--- +** zone-mode.el is now obsolete. Use dns-mode.el instead. + --- ** cplus-md.el has been deleted. diff --git a/etc/TUTORIAL b/etc/TUTORIAL index 5748d0d4e5e..630cc4f9765 100644 --- a/etc/TUTORIAL +++ b/etc/TUTORIAL @@ -217,7 +217,7 @@ This should have scrolled the screen up by 8 lines. If you would like to scroll it down again, you can give an argument to M-v. If you are using a windowed display, such as X11 or MS-Windows, there -should be a tall rectangular area called a scroll bar at the left hand +should be a tall rectangular area called a scroll bar at the side of the Emacs window. You can scroll the text by clicking the mouse in the scroll bar. 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 einem numerischen Argument ein. Wenn Sie eine graphische Oberfläche wie X oder MS-Windows verwenden, -dann befindet sich ein schmaler, langgezogener rechteckiger Bereich im -Regelfall auf der linken Seite des Emacs-Fensters. Dieser Bereich +dann befindet sich ein schmaler, langgezogener rechteckiger Bereich auf +der linken oder rechten Seite des Emacs-Fensters. Dieser Bereich wird Scrollbar genannt (`Verschiebungsbalken'). Sie können Text verschieben, indem Sie mit der Maus auf den Scrollbar klicken. 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 @@ % Reference Card for Org Mode -\def\orgversionnumber{4.43} +\def\orgversionnumber{4.44} \def\year{2006} % %**start of header diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index f61188fb8d5..3328f010846 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,18 @@ +2006-08-09 Jan Dj,Ad(Brv + + * etags.c (readline): expect sscanf returns >= 1. + (readline): Change position on %n and \" in sscanf. + +2006-08-07 Masatake YAMATO + + * etags.c (readline): expect sscanf returns 2, + not 1. + +2006-08-07 Masatake YAMATO + + * etags.c (TEX_mode): Check getc retruns EOF. + File ended without newline causes infinite loop. + 2002-07-30 Adrian Aichner (tiny change) * etags.c: It's XEmacs, not Xemacs: change all the occurences. diff --git a/lib-src/etags.c b/lib-src/etags.c index d60c12c2bcc..49a18be1df5 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -5165,7 +5165,7 @@ TEX_mode (inf) { /* Skip to next line if we hit the TeX comment char. */ if (c == '%') - while (c != '\n') + while (c != '\n' && c != EOF) c = getc (inf); else if (c == TEX_LESC || c == TEX_SESC ) break; @@ -6259,9 +6259,10 @@ readline (lbp, stream) int start, lno; if (DEBUG) start = 0; /* shut up the compiler */ - if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) == 1) + if (sscanf (lbp->buffer, "#line %d %n\"", &lno, &start) >= 1 + && lbp->buffer[start] == '"') { - char *endp = lbp->buffer + start; + char *endp = lbp->buffer + ++start; assert (start > 0); while ((endp = etags_strchr (endp, '"')) != NULL diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dabcdb2f911..53f8448edfc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,294 @@ +2006-08-16 Richard Stallman + + * term/x-win.el (x-clipboard-yank): Specify * in interactive spec. + (special-event-map): Process drag-n-drop events this way. + + * simple.el (move-beginning-of-line): Test whether fields + would prevent motion back to line's first visible character. + If so, stop where the fields would stop the motion. + + * newcomment.el (comment-indent): Fully update INDENT + before checking to see if it will change the text. + + * cus-edit.el (custom-newline): New function. + (custom-mode-map): Bind newline to custom-newline. + + * compare-w.el (compare-windows): Factor compare-ignore-whitespace + into ignore-whitespace. + Check each buffer for its skip-function. + Handle compare-windows-skip-whitespace special-case test + by returning t from default skip function. + +2006-08-15 Carsten Dominik + + * textmodes/org.el (org-clock-special-range, + org-clock-update-time-maybe): New functions. + (org-stamp-time-of-day-regexp): Allow weekday to be of word chars, + not only a-z. + (org-agenda-get-blocks): Allow multiple blocks per headline. + (org-timestamp-change): Call `org-clock-update-time-maybe'. + (org-export-html-title-format) + (org-export-html-toplevel-hlevel): New options. + (org-export-language-setup): Added support for Czech. + (org-mode, org-insert-todo-heading, org-find-visible) + (org-find-invisible, org-invisible-p, org-invisible-p2) + (org-back-to-heading, org-on-heading-p, org-up-heading-all) + (org-show-subtree, org-show-entry, org-make-options-regexp): + Removed compatibility support for old outline-mode. + (org-check-occur-regexp): Funtion removed. + (org-on-heading-p, org-back-to-heading): Made defalias. + (org-set-local): New defsubst. + (org-set-regexps-and-options, org-mode) + (org-set-font-lock-defaults, org-edit-agenda-file-list) + (org-timeline, org-agenda-list, org-todo-list, org-tags-view) + (org-remember-apply-template, org-table-edit-field) + (org-table-edit-formulas, orgtbl-mode, org-export-as-ascii) + (org-set-autofill-regexps): Use `org-set-local'. + (org-table-eval-formula): Fixed bug with parsing of display flags. + +2006-08-15 Nick Roberts + + * progmodes/gdb-ui.el (gdb-info-stack-custom): Indicate selected + frame with fringe arrow. Suggested by Simon Marshall + . + (gdb-stack-position): New variable. + (gdb-starting, gdb-exited): Reset gdb-stack-position to nil. + (gdb-frames-mode): Set gdb-stack-position to nil. Add to + overlay-arrow-variable-list + (gdb-reset): Delete gdb-stack-position from above list. + +2006-08-14 Jan Dj,Ad(Brv + + * term/x-win.el (menu-bar-edit-menu): Disable paste if buffer is + read only. + +2006-08-13 Romain Francoise + + * cus-theme.el (customize-create-theme) + (custom-theme-visit-theme): End `y-or-n-p' prompt with a space. + + * filesets.el (filesets-add-buffer): Ditto. + + * pcvs.el (cvs-change-cvsroot): Ditto. + +2006-08-13 Nick Roberts + + * progmodes/gdb-ui.el (gdb-frame-separate-io-buffer) + (gdb-use-separate-io-buffer, menu): Avoid using `inferior' in text. + (gdb-memory-mode, gdb-locals-watch-map): Don't quote lambda + expressions. + (gdb-info-breakpoints-custom): Use gdb-breakpoint-regexp. + Only search till end of line. + Add face to function names in case of no filename. + Add face to variable names of watchpoints. + +2006-08-12 Robert Thorpe (tiny change) + + * cus-start.el : Move to the `indent' + customization group. + +2006-08-12 Ken Manheimer + + * allout.el (allout-prior-bindings, allout-added-bindings): + Remove, after long deprecation. + (allout-beginning-of-line-cycles, allout-end-of-line-cycles): + Add customization vars controlling allout-beginning-of-line and + allout-end-of-line conveniences. + (allout-header-prefix, allout-use-mode-specific-leader) + (allout-use-mode-specific-leader, allout-mode-leaders): Revised + docstrings. + (allout-infer-header-lead): Change to be an alias for + allout-infer-header-lead-and-primary-bullet. + (allout-infer-header-lead-and-primary-bullet): New version of + allout-infer-header-lead which assigns the primary bullet to the + same as the header lead, when its being changed. + (allout-infer-body-reindent): Apply regexp-quote instead of + unconditionally prepending "\\", so that all literal + allout-header-prefix and allout-primary-bullet strings are + properly handled. + (allout-add-resumptions): Add optional qualifier for extending or + appending to existing values, rather than replacing them. + (allout-view-change-hook): Clarify docstring. + (allout-exposure-change-hook): Take explicit arguments, via + run-hook-with-args. + (allout-structure-added-hook) + (allout-structure-deleted-hook) + (allout-structure-shifted-hook): New hooks analogous to + allout-exposure-change-hook for other kinds of structural outline + edits. + (allout-encryption-plaintext-sanitization-regexps): New encryption + customization variable, by which cooperating modes can provde + massage of the plaintext without actually being passed it. + (allout-encryption-ciphertext-rejection-regexps) + (allout-encryption-ciphertext-rejection-ceiling): New encryption + customization variables, by which cooperating modes can prohibit + rare but possible ciphertext patterns from fouling their + operation, with actually being passed the ciphertext. + (allout-mode): Run activation and deactivation hooks after the + minor-mode variable has been toggled, to clarify the mode + disposition. The new encryption ciphertext rejection variable is + used to ensure that the ciphertext does not contain text that + would be recognized as outline structural elements by allout. + Substite allout-beginning-of-line and allout-end-of-line for + conventionall beginning-of-line and end-of-line bindings. + If allout-old-style-prefixes is non-nil, don't nullify it on mode + activation! + (allout-beginning-of-line): Respect `allout-beginning-of-line-cycles'. + (allout-end-of-line): Respect `allout-end-of-line-cycles'. + (allout-chart-subtree): Implement new mode, charting only the + visible items in the subtree, when new 'visible' parameter is + non-nil. + (allout-end-of-subtree): Properly handle the last item in the + buffer. + (allout-pre-command-business, allout-command-counter): Increment + an advertised counter so that cooperating enhancements can track + revisions of items. + (allout-open-topic): Run allout-structure-added-hook with suitable + arguments. + (allout-shift-in): Run allout-structure-shifted-hook with suitable + arguments. + (allout-shift-out): Fix doubling for negative args and ensure call + of allout-structure-shifted-hook by solely using allout-shift-in. + (allout-kill-line, allout-kill-topic): Run + allout-structure-deleted-hook with suitable arguments. + (allout-yank-processing): Run allout-structure-added-hook with + proper arguments. + (allout-yank): Enclose activity in allout-unprotected. + (allout-flag-region): Run allout-exposure-change-hook with + suitable arguments, instead of making the callee infer the + arguments. + (allout-encrypt-string): Support + allout-encryption-plaintext-sanitization-regexps, + allout-encryption-ciphertext-rejection-regexps, and + allout-encryption-ciphertext-rejection-ceiling. Indicate correct + en/de cryption mode in symmetric encryption failure message. + (allout-obtain-passphrase): Use copy-sequence to get a distinct + copy of the passphrase, and don't zero it or we'll corrupt the + stashed copy. + (allout-create-encryption-passphrase-verifier) + (allout-verify-passphrase): Respect the new signature for + allout-encrypt-string. + (allout-get-configvar-values): Convenience for getting a + configuration variable value and handling its absence gracefully. + +2006-08-11 Romain Francoise + + * obsolete/zone-mode.el: Delete. + +2006-08-11 Stefan Monnier + + * textmodes/dns-mode.el (dns-mode): Use before-save-hook. + +2006-08-11 Thien-Thi Nguyen + + * emacs-lisp/bindat.el (bindat-ip-to-string): + Use `format-network-address' if possible. + +2006-08-11 Jan Dj,Ad(Brv + + * x-dnd.el (x-dnd-init-frame): Call x-register-dnd-atom. + +2006-08-10 Chong Yidong + + * emacs-lisp/edebug.el (edebug-recursive-edit): Don't save and + restore unread-command-events here. + (edebug-display): Do it here, to detect sit-for interruptions. + +2006-08-10 Romain Francoise + + * textmodes/dns-mode.el: Alias `zone-mode' to `dns-mode'. + (dns-mode-soa-auto-increment-serial): New user option. + (dns-mode-soa-maybe-increment-serial): New function. + (dns-mode): Add the latter to `write-contents-functions'. + + * obsolete/zone-mode.el: Move to obsolete/ from net/. + Delete autoload cookies. + +2006-08-10 John Wiegley + + * eshell/em-glob.el (eshell-glob-chars-list) + (eshell-glob-translate-alist): Add support for [^g] in character globs. + +2006-08-10 Richard Stallman + + * facemenu.el (facemenu-add-face): Pass frame to facemenu-active-faces. + (facemenu-set-face): Doc fix. + (facemenu-listed-faces): Doc fix. + +2006-08-09 Chong Yidong + + * avoid.el (mouse-avoidance-animating-pointer): New var. + (mouse-avoidance-nudge-mouse): Use it. + (mouse-avoidance-banish): Rename from mouse-avoidance-banish-hook. + (mouse-avoidance-exile): Rename from mouse-avoidance-exile-hook + (mouse-avoidance-fancy): Rename from mouse-avoidance-fancy-hook. + Don't activate if currently animating. All callers changed. + +2006-08-09 John Wiegley + + * calendar/timeclock.el (timeclock-use-elapsed): Added a new + variable, which causes timeclock to report elapsed time worked, + instead of just work remaining. + +2006-08-09 Kenichi Handa + + * international/latexenc.el (latexenc-find-file-coding-system): + Fix for the case that the 2nd element of arg-list is a cons. + +2006-08-08 Chong Yidong + + * info.el (Info-fontify-node): Handle preceding `in' for note + reference hiding rules. + +2006-08-08 Stefan Monnier + + * progmodes/sh-script.el (sh-quoted-subshell): Make sure we don't + mistake a closing " for an opening one. + +2006-08-07 Dan Nicolaescu + + * term/xterm.el (terminal-init-xterm): Add more key bindings. + +2006-08-07 Stefan Monnier + + * complete.el (PC-do-completion): Filter out completions matching + completion-ignored-extensions before checking whether there are + multiple completions. + Don't use `list' unnecessarily when building completion tables. + +2006-08-06 Richard Stallman + + * help.el (describe-mode): Make minor mode list more concise. + +2006-08-05 Chong Yidong + + * bindings.el: Give mode-line-format, mode-line-modes, and + mode-line-position `standard-value' properties. + +2006-08-05 Eli Zaretskii + + * buff-menu.el (list-buffers-noselect): For Info buffers, use + "(file)node" instead of the file name. + +2006-08-05 Richard Stallman + + * faces.el (escape-glyph): Doc fix. + +2006-08-04 Kenichi Handa + + * international/mule-diag.el (describe-font): Improve docstring + and error message. Use frame-parameter (not frame-parameters). + +2006-08-03 Stefan Monnier + + * progmodes/gud.el (gdb-script-font-lock-syntactic-keywords): + Correctly mark the end-of-docstring char. + +2006-08-03 Chong Yidong + + * simple.el (line-move-to-column): Constrain move-to-column to + current field. + 2006-08-03 Stefan Monnier * font-lock.el (font-lock-beg, font-lock-end) @@ -173,9 +464,9 @@ 2006-07-26 Mathias Dahl - * tumme.el (tumme-backward-image): Add prefix argument. Add error + * tumme.el (tumme-backward-image): Add prefix argument. Add error when at first image. - (tumme-forward-image): Add prefix argument. Add error when at last + (tumme-forward-image): Add prefix argument. Add error when at last image. 2006-07-25 Stefan Monnier @@ -239,8 +530,8 @@ 2006-07-24 Daiki Ueno * pgg-def.el (pgg-truncate-key-identifier): Truncate the key ID to 8 - letters from the end. Thanks to "David Smith" and - andreas@altroot.de (Andreas V,Av(Bgele) + letters from the end. Thanks to "David Smith" + and andreas@altroot.de (Andreas V,Av(Bgele). 2006-07-23 Thien-Thi Nguyen @@ -279,7 +570,7 @@ 2006-07-21 Dan Nicolaescu * term/xterm.el (terminal-init-xterm): Fix key bindings - syntax. Bind S-return, C-M-., C-TAB, S-TAB and C-S-TAB. + syntax. Bind S-return, C-M-., C-TAB, S-TAB and C-S-TAB. 2006-07-21 Eli Zaretskii @@ -315,7 +606,7 @@ * calc.el (calc-previous-alg-entry): Remove variable. - * calc-aent.el (calc-alg-entry-history, calc-quick-calc-history): + * calc-aent.el (calc-alg-entry-history, calc-quick-calc-history): New variables. (calc-alg-entry): Use `calc-alg-entry-history'. (calc-do-quick-calc): Use `calc-quick-calc-history'. @@ -639,8 +930,8 @@ 2006-07-10 Chong Yidong - * progmodes/cc-awk.el (defconst): Use eval-and-compile to avoid - compilation error. + * progmodes/cc-awk.el (c-awk-escaped-nls*): Use eval-and-compile to + avoid compilation error. * subr.el (sit-for): New function. 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." (put 'allout-show-bodies 'safe-local-variable (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil))))) +;;;_ = allout-beginning-of-line-cycles +(defcustom allout-beginning-of-line-cycles t + "*If non-nil, \\[allout-beginning-of-line] will cycle through smart-placement options. + +Cycling only happens on when the command is repeated, not when it +follows a different command. + +Smart-placement means that repeated calls to this function will +advance as follows: + + - if the cursor is on a non-headline body line and not on the first column: + then it goes to the first column + - if the cursor is on the first column of a non-headline body line: + then it goes to the start of the headline within the item body + - if the cursor is on the headline and not the start of the headline: + then it goes to the start of the headline + - if the cursor is on the start of the headline: + then it goes to the bullet character \(for hotspot navigation\) + - if the cursor is on the bullet character: + then it goes to the first column of that line \(the headline\) + - if the cursor is on the first column of the headline: + then it goes to the start of the headline within the item body. + +In this fashion, you can use the beginning-of-line command to do +its normal job and then, when repeated, advance through the +entry, cycling back to start. + +If this configuration variable is nil, then the cursor is just +advanced to the beginning of the line and remains there on +repeated calls." + :type 'boolean :group 'allout) +;;;_ = allout-end-of-line-cycles +(defcustom allout-end-of-line-cycles t + "*If non-nil, \\[allout-end-of-line] will cycle through smart-placement options. + +Cycling only happens on when the command is repeated, not when it +follows a different command. + +Smart-placement means that repeated calls to this function will +advance as follows: + + - if the cursor is not on the end-of-line, + then it goes to the end-of-line + - if the cursor is on the end-of-line but not the end-of-entry, + then it goes to the end-of-entry, exposing it if necessary + - if the cursor is on the end-of-entry, + then it goes to the end of the head line + +In this fashion, you can use the end-of-line command to do its +normal job and then, when repeated, advance through the entry, +cycling back to start. + +If this configuration variable is nil, then the cursor is just +advanced to the end of the line and remains there on repeated +calls." + :type 'boolean :group 'allout) + ;;;_ = allout-header-prefix (defcustom allout-header-prefix "." +;; this string is treated as literal match. it will be `regexp-quote'd, so +;; one cannot use regular expressions to match varying header prefixes. "*Leading string which helps distinguish topic headers. Outline topic header lines are identified by a leading topic header prefix, which mostly have the value of this var at their front. -\(Level 1 topics are exceptions. They consist of only a single -character, which is typically set to the `allout-primary-bullet'. Many -outlines start at level 2 to avoid this discrepancy." +Level 1 topics are exceptions. They consist of only a single +character, which is typically set to the `allout-primary-bullet'." :type 'string :group 'allout) (make-variable-buffer-local 'allout-header-prefix) @@ -300,11 +358,13 @@ strings." (defcustom allout-use-mode-specific-leader t "*When non-nil, use mode-specific topic-header prefixes. -Allout outline mode will use the mode-specific `allout-mode-leaders' -and/or comment-start string, if any, to lead the topic prefix string, -so topic headers look like comments in the programming language. +Allout outline mode will use the mode-specific `allout-mode-leaders' or +comment-start string, if any, to lead the topic prefix string, so topic +headers look like comments in the programming language. It will also use +the comment-start string, with an '_' appended, for `allout-primary-bullet'. -String values are used as they stand. +String values are used as literals, not regular expressions, so +do not escape any regulare-expression characters. Value t means to first check for assoc value in `allout-mode-leaders' 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 \(`.'). Set to the symbol for either of `allout-mode-leaders' or `comment-start' to use only one of them, respectively. -Value nil means to always use the default \(`.'). +Value nil means to always use the default \(`.') and leave +`allout-primary-bullet' unaltered. -comment-start strings that do not end in spaces are tripled, and an -`_' underscore is tacked on the end, to distinguish them from regular -comment strings. comment-start strings that do end in spaces are not -tripled, but an underscore is substituted for the space. [This -presumes that the space is for appearance, not comment syntax. You -can use `allout-mode-leaders' to override this behavior, when -incorrect.]" +comment-start strings that do not end in spaces are tripled in +the header-prefix, and an `_' underscore is tacked on the end, to +distinguish them from regular comment strings. comment-start +strings that do end in spaces are not tripled, but an underscore +is substituted for the space. [This presumes that the space is +for appearance, not comment syntax. You can use +`allout-mode-leaders' to override this behavior, when +undesired.]" :type '(choice (const t) (const nil) string (const allout-mode-leaders) (const comment-start)) @@ -334,13 +396,14 @@ incorrect.]" (defvar allout-mode-leaders '() "Specific allout-prefix leading strings per major modes. -Entries will be used instead or in lieu of mode-specific -comment-start strings. See also `allout-use-mode-specific-leader'. +Use this if the mode's comment-start string isn't what you +prefer, or if the mode lacks a comment-start string. See +`allout-use-mode-specific-leader' for more details. If you're constructing a string that will comment-out outline structuring so it can be included in program code, append an extra character, like an \"_\" underscore, to distinguish the lead string -from regular comments that start at bol.") +from regular comments that start at the beginning-of-line.") ;;;_ = allout-old-style-prefixes (defcustom allout-old-style-prefixes nil @@ -828,9 +891,9 @@ language comments. Returns the leading string." (setq allout-reindent-bodies nil) (allout-reset-header-lead header-lead) header-lead) -;;;_ > allout-infer-header-lead () -(defun allout-infer-header-lead () - "Determine appropriate `allout-header-prefix'. +;;;_ > allout-infer-header-lead-and-primary-bullet () +(defun allout-infer-header-lead-and-primary-bullet () + "Determine appropriate `allout-header-prefix' and `allout-primary-bullet'. Works according to settings of: @@ -874,10 +937,14 @@ invoking it directly." "_"))))))) (if (not leader) nil - (if (string= leader allout-header-prefix) - nil ; no change, nothing to do. - (setq allout-header-prefix leader) - allout-header-prefix)))) + (setq allout-header-prefix leader) + (if (not allout-old-style-prefixes) + ;; setting allout-primary-bullet makes the top level topics use - + ;; actually, be - the special prefix: + (setq allout-primary-bullet leader)) + allout-header-prefix))) +(defalias 'allout-infer-header-lead + 'allout-infer-header-lead-and-primary-bullet) ;;;_ > allout-infer-body-reindent () (defun allout-infer-body-reindent () "Determine proper setting for `allout-reindent-bodies'. @@ -930,13 +997,13 @@ Works with respect to `allout-plain-bullets-string' and (setq allout-plain-bullets-string-len (length allout-plain-bullets-string)) (setq allout-header-subtraction (1- (length allout-header-prefix))) ;; Produce the new allout-regexp: - (setq allout-regexp (concat "\\(\\" - allout-header-prefix - "[ \t]*[" - allout-bullets-string - "]\\)\\|\\" - allout-primary-bullet - "+\\|\^l")) + (setq allout-regexp (concat "\\(" + (regexp-quote allout-header-prefix) + "[ \t]*[" + allout-bullets-string + "]\\)\\|" + (regexp-quote allout-primary-bullet) + "+\\|\^l")) (setq allout-line-boundary-regexp (concat "\\(\n\\)\\(" allout-regexp "\\)")) (setq allout-bob-regexp @@ -965,16 +1032,6 @@ See doc string for allout-keybindings-list for format of binding list." (car (cdr cell))))))) keymap-list) map)) -;;;_ = allout-prior-bindings - being deprecated. -(defvar allout-prior-bindings nil - "Variable for use in V18, with allout-added-bindings, for -resurrecting, on mode deactivation, bindings that existed before -activation. Being deprecated.") -;;;_ = allout-added-bindings - being deprecated -(defvar allout-added-bindings nil - "Variable for use in V18, with allout-prior-bindings, for -resurrecting, on mode deactivation, bindings that existed before -activation. Being deprecated.") ;;;_ : Menu bar (defvar allout-mode-exposure-menu) (defvar allout-mode-editing-menu) @@ -1050,43 +1107,65 @@ See `allout-add-resumptions' and `allout-do-resumptions'.") (make-variable-buffer-local 'allout-mode-prior-settings) ;;;_ > allout-add-resumptions (&rest pairs) (defun allout-add-resumptions (&rest pairs) - "Set name/value pairs. + "Set name/value PAIRS. Old settings are preserved for later resumption using `allout-do-resumptions'. +The new values are set as a buffer local. On resumption, the prior buffer +scope of the variable is restored along with its value. If it was a void +buffer-local value, then it is left as nil on resumption. + The pairs are lists whose car is the name of the variable and car of the -cdr is the new value: '(some-var some-value)'. +cdr is the new value: '(some-var some-value)'. The pairs can actually be +triples, where the third element qualifies the disposition of the setting, +as described further below. -The new value is set as a buffer local. +If the optional third element is the symbol 'extend, then the new value +created by `cons'ing the second element of the pair onto the front of the +existing value. -If the variable was not previously buffer-local, then that is noted and the -`allout-do-resumptions' will just `kill-local-variable' of that binding. +If the optional third element is the symbol 'append, then the new value is +extended from the existing one by `append'ing a list containing the second +element of the pair onto the end of the existing value. -If it previously was buffer-local, the old value is noted and resurrected -by `allout-do-resumptions'. \(If the local value was previously void, then -it is left as nil on resumption.\) +Extension, and resumptions in general, should not be used for hook +functions - use the 'local mode of `add-hook' for that, instead. The settings are stored on `allout-mode-prior-settings'." (while pairs (let* ((pair (pop pairs)) (name (car pair)) - (value (cadr pair))) + (value (cadr pair)) + (qualifier (if (> (length pair) 2) + (caddr pair))) + prior-value) (if (not (symbolp name)) (error "Pair's name, %S, must be a symbol, not %s" name (type-of name))) + (setq prior-value (condition-case err + (symbol-value name) + (void-variable nil))) (when (not (assoc name allout-mode-prior-settings)) ;; Not already added as a resumption, create the prior setting entry. (if (local-variable-p name) ;; is already local variable - preserve the prior value: - (push (list name (condition-case err - (symbol-value name) - (void-variable nil))) - allout-mode-prior-settings) + (push (list name prior-value) allout-mode-prior-settings) ;; wasn't local variable, indicate so for resumption by killing ;; local value, and make it local: (push (list name) allout-mode-prior-settings) (make-local-variable name))) - (set name value)))) + (if qualifier + (cond ((eq qualifier 'extend) + (if (not (listp prior-value)) + (error "extension of non-list prior value attempted") + (set name (cons value prior-value)))) + ((eq qualifier 'append) + (if (not (listp prior-value)) + (error "appending of non-list prior value attempted") + (set name (append prior-value (list value))))) + (t (error "unrecognized setting qualifier `%s' encountered" + qualifier))) + (set name value))))) ;;;_ > allout-do-resumptions () (defun allout-do-resumptions () "Resume all name/value settings registered by `allout-add-resumptions'. @@ -1121,18 +1200,67 @@ their settings before allout-mode was started." "Symbol for use as allout invisible-text overlay category.") ;;;_ x allout-view-change-hook (defvar allout-view-change-hook nil - "*\(Deprecated\) Hook that's run after allout outline exposure changes. + "*\(Deprecated\) A hook run after allout outline exposure changes. -Switch to using `allout-exposure-change-hook' instead. Both -variables are currently respected, but this one will be ignored -in a subsequent allout version.") +Switch to using `allout-exposure-change-hook' instead. Both hooks are +currently respected, but the other conveys the details of the exposure +change via explicit parameters, and this one will eventually be disabled in +a subsequent allout version.") ;;;_ = allout-exposure-change-hook (defvar allout-exposure-change-hook nil - "*Hook that's run after allout outline exposure changes. + "*Hook that's run after allout outline subtree exposure changes. -This variable will replace `allout-view-change-hook' in a subsequent allout -version, though both are currently respected.") +It is run at the conclusion of `allout-flag-region'. +Functions on the hook must take three arguments: + + - from - integer indicating the point at the start of the change. + - to - integer indicating the point of the end of the change. + - flag - change mode: nil for exposure, otherwise concealment. + +This hook might be invoked multiple times by a single command. + +This hook is replacing `allout-view-change-hook', which is being deprecated +and eventually will not be invoked.") +;;;_ = allout-structure-added-hook +(defvar allout-structure-added-hook nil + "*Hook that's run after addition of items to the outline. + +Functions on the hook should take two arguments: + + - new-start - integer indicating the point at the start of the first new item. + - new-end - integer indicating the point of the end of the last new item. + +Some edits that introduce new items may missed by this hook - +specifically edits that native allout routines do not control. + +This hook might be invoked multiple times by a single command.") +;;;_ = allout-structure-deleted-hook +(defvar allout-structure-deleted-hook nil + "*Hook that's run after disciplined deletion of subtrees from the outline. + +Functions on the hook must take two arguments: + + - depth - integer indicating the depth of the subtree that was deleted. + - removed-from - integer indicating the point where the subtree was removed. + +Some edits that remove or invalidate items may missed by this hook - +specifically edits that native allout routines do not control. + +This hook might be invoked multiple times by a single command.") +;;;_ = allout-structure-shifted-hook +(defvar allout-structure-shifted-hook nil + "*Hook that's run after shifting of items in the outline. + +Functions on the hook should take two arguments: + + - depth-change - integer indicating depth increase, negative for decrease + - start - integer indicating the start point of the shifted parent item. + +Some edits that shift items can be missed by this hook - specifically edits +that native allout routines do not control. + +This hook might be invoked multiple times by a single command.") ;;;_ = allout-outside-normal-auto-fill-function (defvar allout-outside-normal-auto-fill-function nil "Value of normal-auto-fill-function outside of allout mode. @@ -1186,6 +1314,42 @@ state, if file variable adjustments are enabled. See This is used to decrypt the topic that was currently being edited, if it was encrypted automatically as part of a file write or autosave.") (make-variable-buffer-local 'allout-after-save-decrypt) +;;;_ = allout-encryption-plaintext-sanitization-regexps +(defvar allout-encryption-plaintext-sanitization-regexps nil + "List of regexps whose matches are removed from plaintext before encryption. + +This is for the sake of removing artifacts, like escapes, that are added on +and not actually part of the original plaintext. The removal is done just +prior to encryption. + +Entries must be symbols that are bound to the desired values. + +Each value can be a regexp or a list with a regexp followed by a +substitution string. If it's just a regexp, all its matches are removed +before the text is encrypted. If it's a regexp and a substitution, the +substition is used against the regexp matches, a la `replace-match'.") +(make-variable-buffer-local 'allout-encryption-text-removal-regexps) +;;;_ = allout-encryption-ciphertext-rejection-regexps +(defvar allout-encryption-ciphertext-rejection-regexps nil + "Variable for regexps matching plaintext to remove before encryption. + +This is for the sake of redoing encryption in cases where the ciphertext +incidentally contains strings that would disrupt mode operation - +for example, a line that happens to look like an allout-mode topic prefix. + +Entries must be symbols that are bound to the desired regexp values. + +The encryption will be retried up to +`allout-encryption-ciphertext-rejection-limit' times, after which an error +is raised.") + +(make-variable-buffer-local 'allout-encryption-ciphertext-rejection-regexps) +;;;_ = allout-encryption-ciphertext-rejection-ceiling +(defvar allout-encryption-ciphertext-rejection-ceiling 5 + "Limit on number of times encryption ciphertext is rejected. + +See `allout-encryption-ciphertext-rejection-regexps' for rejection reasons.") +(make-variable-buffer-local 'allout-encryption-ciphertext-rejection-ceiling) ;;;_ > allout-mode-p () ;; Must define this macro above any uses, or byte compilation will lack ;; 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." (remove-overlays (point-min) (point-max) 'category 'allout-exposure-category) - (run-hooks 'allout-mode-deactivate-hook) - (setq allout-mode nil)) + (setq allout-mode nil) + (run-hooks 'allout-mode-deactivate-hook)) ;; Activation: ((not active) (setq allout-explicitly-deactivated nil) (if allout-old-style-prefixes ;; Inhibit all the fancy formatting: - (allout-add-resumptions '((allout-primary-bullet "*") - (allout-old-style-prefixes ())))) + (allout-add-resumptions '(allout-primary-bullet "*"))) (allout-overlay-preparations) ; Doesn't hurt to redo this. @@ -1654,15 +1817,28 @@ OPEN: A topic that is not closed, though its offspring or body may be." (allout-infer-body-reindent) (set-allout-regexp) + (allout-add-resumptions + '(allout-encryption-ciphertext-rejection-regexps + allout-line-boundary-regexp + extend) + '(allout-encryption-ciphertext-rejection-regexps + allout-bob-regexp + extend)) ;; Produce map from current version of allout-keybindings-list: (setq allout-mode-map (produce-allout-mode-map allout-keybindings-list)) (substitute-key-definition 'beginning-of-line - 'move-beginning-of-line + 'allout-beginning-of-line + allout-mode-map global-map) + (substitute-key-definition 'move-beginning-of-line + 'allout-beginning-of-line allout-mode-map global-map) (substitute-key-definition 'end-of-line - 'move-end-of-line + 'allout-end-of-line + allout-mode-map global-map) + (substitute-key-definition 'move-end-of-line + 'allout-end-of-line allout-mode-map global-map) (produce-allout-mode-menubar-entries) (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." (if allout-layout (setq do-layout t)) - (run-hooks 'allout-mode-hook) - (setq allout-mode t)) + (setq allout-mode t) + (run-hooks 'allout-mode-hook)) ;; Reactivation: ((setq do-layout t) @@ -2044,6 +2220,52 @@ Outermost is first." (while (allout-hidden-p) (end-of-line) (if (allout-hidden-p) (forward-char 1))))) +;;;_ > allout-beginning-of-line () +(defun allout-beginning-of-line () + "Beginning-of-line with `allout-beginning-of-line-cycles' behavior, if set." + + (interactive) + + (if (or (not allout-beginning-of-line-cycles) + (not (equal last-command this-command))) + (move-beginning-of-line 1) + (let ((beginning-of-body (save-excursion + (allout-beginning-of-current-entry) + (point)))) + (cond ((= (current-column) 0) + (allout-beginning-of-current-entry)) + ((< (point) beginning-of-body) + (allout-beginning-of-current-line)) + ((= (point) beginning-of-body) + (goto-char (allout-current-bullet-pos))) + (t (allout-beginning-of-current-line) + (if (< (point) beginning-of-body) + ;; we were on the headline after its start: + (allout-beginning-of-current-entry))))))) +;;;_ > allout-end-of-line () +(defun allout-end-of-line () + "End-of-line with `allout-end-of-line-cycles' behavior, if set." + + (interactive) + + (if (or (not allout-end-of-line-cycles) + (not (equal last-command this-command))) + (allout-end-of-current-line) + (let ((end-of-entry (save-excursion + (allout-end-of-entry) + (point)))) + (cond ((not (eolp)) + (allout-end-of-current-line)) + ((or (allout-hidden-p) (save-excursion + (forward-char -1) + (allout-hidden-p))) + (allout-back-to-current-heading) + (allout-show-current-entry) + (allout-end-of-entry)) + ((>= (point) end-of-entry) + (allout-back-to-current-heading) + (allout-end-of-current-line)) + (t (allout-end-of-entry)))))) ;;;_ > allout-next-heading () (defsubst allout-next-heading () "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." ;;; for assessment or adjustment of the subtree, without redundant ;;; traversal of the structure. -;;;_ > allout-chart-subtree (&optional levels orig-depth prev-depth) -(defun allout-chart-subtree (&optional levels orig-depth prev-depth) +;;;_ > allout-chart-subtree (&optional levels visible orig-depth prev-depth) +(defun allout-chart-subtree (&optional levels visible orig-depth prev-depth) "Produce a location \"chart\" of subtopics of the containing topic. Optional argument LEVELS specifies the depth \(relative to start -depth) for the chart. Subsequent optional args are not for public -use. +depth) for the chart. + +When optional argument VISIBLE is non-nil, the chart includes +only the visible subelements of the charted subjects. + +The remaining optional args are not for internal use by the function. Point is left at the end of the subtree. @@ -2141,7 +2367,9 @@ starting point, and PREV-DEPTH is depth of prior topic." ; position to first offspring: (progn (setq orig-depth (allout-depth)) (or prev-depth (setq prev-depth (1+ orig-depth))) - (allout-next-heading))) + (if visible + (allout-next-visible-heading 1) + (allout-next-heading)))) ;; Loop over the current levels' siblings. Besides being more ;; efficient than tail-recursing over a level, it avoids exceeding @@ -2163,8 +2391,12 @@ starting point, and PREV-DEPTH is depth of prior topic." ;; next heading at lesser depth: (while (and (<= curr-depth (allout-recent-depth)) - (allout-next-heading)))) - (allout-next-heading))) + (if visible + (allout-next-visible-heading 1) + (allout-next-heading))))) + (if visible + (allout-next-visible-heading 1) + (allout-next-heading)))) ((and (< prev-depth curr-depth) (or (not levels) @@ -2173,8 +2405,9 @@ starting point, and PREV-DEPTH is depth of prior topic." (setq chart (cons (allout-chart-subtree (and levels (1- levels)) - orig-depth - curr-depth) + visible + orig-depth + curr-depth) chart)) ;; ... then continue with this one. ) @@ -2369,7 +2602,9 @@ Returns the value of point." (while (and (not (eobp)) (> (allout-recent-depth) level)) (allout-next-heading)) - (and (not (eobp)) (forward-char -1)) + (if (eobp) + (allout-end-of-entry) + (forward-char -1)) (if (and (not include-trailing-blank) (= ?\n (preceding-char))) (forward-char -1)) (setq allout-recent-end-of-subtree (point)))) @@ -2675,6 +2910,13 @@ hot-spot operation, where literal characters typed over a topic bullet are mapped to the command of the corresponding control-key on the `allout-mode-map'.") (make-variable-buffer-local 'allout-post-goto-bullet) +;;;_ = allout-command-counter +(defvar allout-command-counter 0 + "Counter that monotonically increases in allout-mode buffers. + +Set by `allout-pre-command-business', to support allout addons in +coordinating with allout activity.") +(make-variable-buffer-local 'allout-command-counter) ;;;_ > allout-post-command-business () (defun allout-post-command-business () "Outline `post-command-hook' function. @@ -2692,7 +2934,7 @@ are mapped to the command of the corresponding control-key on the allout-after-save-decrypt) (allout-after-saves-handler)) - ;; Implement -post-goto-bullet, if set: + ;; Implement allout-post-goto-bullet, if set: (if (and allout-post-goto-bullet (allout-current-bullet-pos)) (progn (goto-char (allout-current-bullet-pos)) @@ -2701,7 +2943,9 @@ are mapped to the command of the corresponding control-key on the ;;;_ > allout-pre-command-business () (defun allout-pre-command-business () "Outline `pre-command-hook' function for outline buffers. -Implements special behavior when cursor is on bullet character. + +Among other things, implements special behavior when the cursor is on the +topic bullet character. When the cursor is on the bullet character, self-insert characters are reinterpreted as the corresponding control-character in the @@ -2709,7 +2953,7 @@ reinterpreted as the corresponding control-character in the the cursor which has moved as a result of such reinterpretation is positioned on the bullet character of the destination topic. -The upshot is that you can get easy, single (ie, unmodified) key +The upshot is that you can get easy, single \(ie, unmodified\) key outline maneuvering operations by positioning the cursor on the bullet char. When in this mode you can use regular cursor-positioning command/keystrokes to relocate the cursor off of a bullet character to @@ -2717,6 +2961,9 @@ return to regular interpretation of self-insert characters." (if (not (allout-mode-p)) nil + ;; Increment allout-command-counter + (setq allout-command-counter (1+ allout-command-counter)) + ;; Do hot-spot navigation. (if (and (eq this-command 'self-insert-command) (eq (point)(allout-current-bullet-pos))) (allout-hotspot-key-handler)))) @@ -2990,6 +3237,8 @@ case.) If OFFER-RECENT-BULLET is true, offer to use the bullet of the prior sibling. +Runs + Nuances: - Creation of new topics is with respect to the visible topic @@ -3040,7 +3289,8 @@ Nuances: allout-numbered-bullet)))) (point))) dbl-space - doing-beginning) + doing-beginning + start end) (if (not opening-on-blank) ; Positioning and vertical @@ -3141,8 +3391,10 @@ Nuances: (not (bolp))) (forward-char 1)))) )) + (setq start (point)) (insert (concat (allout-make-topic-prefix opening-numbered t depth) " ")) + (setq end (1+ (point))) (allout-rebullet-heading (and offer-recent-bullet ref-bullet) depth nil nil t) @@ -3150,6 +3402,8 @@ Nuances: (save-excursion (goto-char ref-topic) (allout-show-children))) (end-of-line) + + (run-hook-with-args 'allout-structure-added-hook start end) ) ) ;;;_ > allout-open-subtopic (arg) @@ -3548,6 +3802,7 @@ discontinuity. The first topic in the file can be adjusted to any positive depth, however." (interactive "p") (if (> arg 0) + ;; refuse to create a containment discontinuity: (save-excursion (allout-back-to-current-heading) (if (not (bobp)) @@ -3564,7 +3819,20 @@ depth, however." (1+ predecessor-depth))) (error (concat "Disallowed shift deeper than" " containing topic's children."))))))) - (allout-rebullet-topic arg)) + (let ((where (point)) + has-successor) + (if (and (< arg 0) + (allout-current-topic-collapsed-p) + (save-excursion (allout-next-sibling))) + (setq has-successor t)) + (allout-rebullet-topic arg) + (when (< arg 0) + (save-excursion + (if (allout-ascend) + (allout-show-children))) + (if has-successor + (allout-show-children))) + (run-hook-with-args 'allout-structure-shifted-hook arg where))) ;;;_ > allout-shift-out (arg) (defun allout-shift-out (arg) "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 discontinuity. The first topic in the file can be adjusted to any positive depth, however." (interactive "p") - (if (< arg 0) - (allout-shift-in (* arg -1))) - (allout-rebullet-topic (* arg -1))) + (allout-shift-in (* arg -1))) ;;;_ : Surgery (kill-ring) functions with special provisions for outlines: ;;;_ > allout-kill-line (&optional arg) (defun allout-kill-line (&optional arg) @@ -3610,7 +3876,8 @@ depth, however." (save-excursion ; Renumber subsequent topics if needed: (if (not (looking-at allout-regexp)) (allout-next-heading)) - (allout-renumber-to-depth depth)))))) + (allout-renumber-to-depth depth))) + (run-hook-with-args 'allout-structure-deleted-hook depth (point))))) ;;;_ > allout-kill-topic () (defun allout-kill-topic () "Kill topic together with subtopics. @@ -3656,7 +3923,8 @@ when yank with allout-yank into an outline as a heading." (allout-unprotected (kill-region beg (point))) (sit-for 0) (save-excursion - (allout-renumber-to-depth depth)))) + (allout-renumber-to-depth depth)) + (run-hook-with-args 'allout-structure-deleted-hook depth (point)))) ;;;_ > allout-yank-processing () (defun allout-yank-processing (&optional arg) @@ -3683,112 +3951,113 @@ however, are left exactly like normal, non-allout-specific yanks." ; region around subject: (if (< (allout-mark-marker t) (point)) (exchange-point-and-mark)) - (let* ((inhibit-field-text-motion t) - (subj-beg (point)) - (into-bol (bolp)) - (subj-end (allout-mark-marker t)) - (was-collapsed (get-text-property subj-beg 'allout-was-collapsed)) - ;; 'resituate' if yanking an entire topic into topic header: - (resituate (and (allout-e-o-prefix-p) - (looking-at (concat "\\(" allout-regexp "\\)")) - (allout-prefix-data (match-beginning 1) + (allout-unprotected + (let* ((subj-beg (point)) + (into-bol (bolp)) + (subj-end (allout-mark-marker t)) + (was-collapsed (get-text-property subj-beg 'allout-was-collapsed)) + ;; 'resituate' if yanking an entire topic into topic header: + (resituate (and (allout-e-o-prefix-p) + (looking-at (concat "\\(" allout-regexp "\\)")) + (allout-prefix-data (match-beginning 1) (match-end 1)))) - ;; `rectify-numbering' if resituating (where several topics may - ;; be resituating) or yanking a topic into a topic slot (bol): - (rectify-numbering (or resituate - (and into-bol (looking-at allout-regexp))))) - (if resituate + ;; `rectify-numbering' if resituating (where several topics may + ;; be resituating) or yanking a topic into a topic slot (bol): + (rectify-numbering (or resituate + (and into-bol (looking-at allout-regexp))))) + (if resituate ; The yanked stuff is a topic: - (let* ((prefix-len (- (match-end 1) subj-beg)) - (subj-depth (allout-recent-depth)) - (prefix-bullet (allout-recent-bullet)) - (adjust-to-depth - ;; Nil if adjustment unnecessary, otherwise depth to which - ;; adjustment should be made: - (save-excursion - (and (goto-char subj-end) - (eolp) - (goto-char subj-beg) - (and (looking-at allout-regexp) - (progn - (beginning-of-line) - (not (= (point) subj-beg))) - (looking-at allout-regexp) - (allout-prefix-data (match-beginning 0) + (let* ((prefix-len (- (match-end 1) subj-beg)) + (subj-depth (allout-recent-depth)) + (prefix-bullet (allout-recent-bullet)) + (adjust-to-depth + ;; Nil if adjustment unnecessary, otherwise depth to which + ;; adjustment should be made: + (save-excursion + (and (goto-char subj-end) + (eolp) + (goto-char subj-beg) + (and (looking-at allout-regexp) + (progn + (beginning-of-line) + (not (= (point) subj-beg))) + (looking-at allout-regexp) + (allout-prefix-data (match-beginning 0) (match-end 0))) - (allout-recent-depth)))) - (more t)) - (setq rectify-numbering allout-numbered-bullet) - (if adjust-to-depth + (allout-recent-depth)))) + (more t)) + (setq rectify-numbering allout-numbered-bullet) + (if adjust-to-depth ; Do the adjustment: - (progn - (message "... yanking") (sit-for 0) - (save-restriction - (narrow-to-region subj-beg subj-end) + (progn + (message "... yanking") (sit-for 0) + (save-restriction + (narrow-to-region subj-beg subj-end) ; Trim off excessive blank ; line at end, if any: - (goto-char (point-max)) - (if (looking-at "^$") - (allout-unprotected (delete-char -1))) + (goto-char (point-max)) + (if (looking-at "^$") + (allout-unprotected (delete-char -1))) ; Work backwards, with each ; shallowest level, ; successively excluding the ; last processed topic from ; the narrow region: - (while more - (allout-back-to-current-heading) + (while more + (allout-back-to-current-heading) ; go as high as we can in each bunch: - (while (allout-ascend-to-depth (1- (allout-depth)))) - (save-excursion - (allout-rebullet-topic-grunt (- adjust-to-depth + (while (allout-ascend-to-depth (1- (allout-depth)))) + (save-excursion + (allout-rebullet-topic-grunt (- adjust-to-depth subj-depth)) - (allout-depth)) - (if (setq more (not (bobp))) - (progn (widen) - (forward-char -1) - (narrow-to-region subj-beg (point)))))) - (message "") - ;; Preserve new bullet if it's a distinctive one, otherwise - ;; use old one: - (if (string-match (regexp-quote prefix-bullet) - allout-distinctive-bullets-string) + (allout-depth)) + (if (setq more (not (bobp))) + (progn (widen) + (forward-char -1) + (narrow-to-region subj-beg (point)))))) + (message "") + ;; Preserve new bullet if it's a distinctive one, otherwise + ;; use old one: + (if (string-match (regexp-quote prefix-bullet) + allout-distinctive-bullets-string) ; Delete from bullet of old to ; before bullet of new: - (progn - (beginning-of-line) - (delete-region (point) subj-beg) - (set-marker (allout-mark-marker t) subj-end) - (goto-char subj-beg) - (allout-end-of-prefix)) + (progn + (beginning-of-line) + (delete-region (point) subj-beg) + (set-marker (allout-mark-marker t) subj-end) + (goto-char subj-beg) + (allout-end-of-prefix)) ; Delete base subj prefix, ; leaving old one: - (delete-region (point) (+ (point) - prefix-len - (- adjust-to-depth subj-depth))) + (delete-region (point) (+ (point) + prefix-len + (- adjust-to-depth subj-depth))) ; and delete residual subj ; prefix digits and space: - (while (looking-at "[0-9]") (delete-char 1)) - (if (looking-at " ") (delete-char 1)))) - (exchange-point-and-mark)))) - (if rectify-numbering - (progn - (save-excursion + (while (looking-at "[0-9]") (delete-char 1)) + (if (looking-at " ") (delete-char 1)))) + (exchange-point-and-mark)))) + (if rectify-numbering + (progn + (save-excursion ; Give some preliminary feedback: - (message "... reconciling numbers") (sit-for 0) + (message "... reconciling numbers") (sit-for 0) ; ... and renumber, in case necessary: - (goto-char subj-beg) - (if (allout-goto-prefix) - (allout-rebullet-heading nil ;;; solicit + (goto-char subj-beg) + (if (allout-goto-prefix) + (allout-rebullet-heading nil ;;; solicit (allout-depth) ;;; depth - nil ;;; number-control - nil ;;; index + nil ;;; number-control + nil ;;; index t)) - (message "")))) - (when (and (or into-bol resituate) was-collapsed) - (remove-text-properties subj-beg (1+ subj-beg) '(allout-was-collapsed)) - (allout-hide-current-subtree)) - (if (not resituate) - (exchange-point-and-mark)))) + (message "")))) + (when (and (or into-bol resituate) was-collapsed) + (remove-text-properties subj-beg (1+ subj-beg) '(allout-was-collapsed)) + (allout-hide-current-subtree)) + (if (not resituate) + (exchange-point-and-mark)) + (run-hook-with-args 'allout-structure-added-hook subj-beg subj-end)))) ;;;_ > allout-yank (&optional arg) (defun allout-yank (&optional arg) "`allout-mode' yank, with depth and numbering adjustment of yanked topics. @@ -3820,10 +4089,10 @@ works with normal `yank' in non-outline buffers." (interactive "*P") (setq this-command 'yank) - (yank arg) + (allout-unprotected + (yank arg)) (if (allout-mode-p) - (allout-yank-processing)) -) + (allout-yank-processing))) ;;;_ > allout-yank-pop (&optional arg) (defun allout-yank-pop (&optional arg) "Yank-pop like `allout-yank' when popping to bare outline prefixes. @@ -3882,9 +4151,13 @@ by pops to non-distinctive yanks. Bug..." ;;;_ - Fundamental ;;;_ > allout-flag-region (from to flag) (defun allout-flag-region (from to flag) - "Conceal text from FROM to TO if FLAG is non-nil, else reveal it. + "Conceal text between FROM and TO if FLAG is non-nil, else reveal it. + +Exposure-change hook `allout-exposure-change-hook' is run with the same +arguments as this function, after the exposure changes are made. \(The old +`allout-view-change-hook' is being deprecated, and eventually will not be +invoked.\)" -Text is shown if flag is nil and hidden otherwise." ;; We use outline invisibility spec. (remove-overlays from to 'category 'allout-exposure-category) (when flag @@ -3895,7 +4168,7 @@ Text is shown if flag is nil and hidden otherwise." (while props (overlay-put o (pop props) (pop props))))))) (run-hooks 'allout-view-change-hook) - (run-hooks 'allout-exposure-change-hook)) + (run-hook-with-args 'allout-exposure-change-hook from to flag)) ;;;_ > allout-flag-current-subtree (flag) (defun allout-flag-current-subtree (flag) "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 default, they are treated as being uncollapsed." (save-excursion (and - (= (progn (allout-back-to-current-heading) - (move-end-of-line 1) - (point)) - (allout-end-of-current-subtree (not (looking-at "\n\n")))) + ;; Is the topic all on one line (allowing for trailing blank line)? + (>= (progn (allout-back-to-current-heading) + (move-end-of-line 1) + (point)) + (allout-end-of-current-subtree (not (looking-at "\n\n")))) + (or include-single-liners (progn (backward-char 1) (allout-hidden-p)))))) ;;;_ > allout-hide-current-subtree (&optional just-close) @@ -5097,8 +5372,8 @@ See `allout-toggle-current-subtree-encryption' for more details." ;;; fetch-pass &optional retried verifying ;;; passphrase) (defun allout-encrypt-string (text decrypt allout-buffer key-type for-key - fetch-pass &optional retried verifying - passphrase) + fetch-pass &optional retried rejected + verifying passphrase) "Encrypt or decrypt message TEXT. 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. Optional PASSPHRASE enables explicit delivery of the decryption passphrase, for verification purposes. +Optional REJECTED is for internal use - conveys the number of +rejections due to matches against +`allout-encryption-ciphertext-rejection-regexps', as limited by +`allout-encryption-ciphertext-rejection-ceiling'. + Returns the resulting string, or nil if the transformation fails." (require 'pgg) @@ -5141,6 +5421,17 @@ Returns the resulting string, or nil if the transformation fails." target-prompt-id (or (buffer-file-name allout-buffer) target-prompt-id)))) + (strip-plaintext-regexps + (if (not decrypt) + (allout-get-configvar-values + 'allout-encryption-plaintext-sanitization-regexps))) + (reject-ciphertext-regexps + (if (not decrypt) + (allout-get-configvar-values + 'allout-encryption-ciphertext-rejection-regexps))) + (rejected (or rejected 0)) + (rejections-left (- allout-encryption-ciphertext-rejection-ceiling + rejected)) result-text status) (if (and fetch-pass (not passphrase)) @@ -5161,10 +5452,19 @@ Returns the resulting string, or nil if the transformation fails." key-type allout-buffer retried fetch-pass))) + (with-temp-buffer (insert text) + (when (and strip-plaintext-regexps (not decrypt)) + (dolist (re strip-plaintext-regexps) + (let ((re (if (listp re) (car re) re)) + (replacement (if (listp re) (cadr re) ""))) + (goto-char (point-min)) + (while (re-search-forward re nil t) + (replace-match replacement nil nil))))) + (cond ;; symmetric: @@ -5183,7 +5483,8 @@ Returns the resulting string, or nil if the transformation fails." (if verifying (throw 'encryption-failed nil) (pgg-remove-passphrase-from-cache target-cache-id t) - (error "Symmetric-cipher encryption failed - %s" + (error "Symmetric-cipher %scryption failed - %s" + (if decrypt "de" "en") "try again with different passphrase.")))) ;; encrypt 'keypair: @@ -5208,48 +5509,68 @@ Returns the resulting string, or nil if the transformation fails." (if status (pgg-situate-output (point-min) (point-max)) (error (pgg-remove-passphrase-from-cache target-cache-id t) - (error "decryption failed")))) - ) + (error "decryption failed"))))) (setq result-text (buffer-substring 1 (- (point-max) (if decrypt 0 1)))) - - ;; validate result - non-empty - (cond ((not result-text) - (if verifying - nil - ;; transform was fruitless, retry w/new passphrase. - (pgg-remove-passphrase-from-cache target-cache-id t) - (allout-encrypt-string text allout-buffer decrypt nil - (if retried (1+ retried) 1) - passphrase))) - - ;; Barf if encryption yields extraordinary control chars: - ((and (not decrypt) - (string-match "[\C-a\C-k\C-o-\C-z\C-@]" - result-text)) - (error (concat "encryption produced unusable" - " non-armored text - reconfigure!"))) - - ;; valid result and just verifying or non-symmetric: - ((or verifying (not (equal key-type 'symmetric))) - (if (or verifying decrypt) - (pgg-add-passphrase-to-cache target-cache-id - passphrase t)) - result-text) - - ;; valid result and regular symmetric - "register" - ;; passphrase with mnemonic aids/cache. - (t - (set-buffer allout-buffer) - (if passphrase - (pgg-add-passphrase-to-cache target-cache-id - passphrase t)) - (allout-update-passphrase-mnemonic-aids for-key passphrase - allout-buffer) - result-text) - ) ) + + ;; validate result - non-empty + (cond ((not result-text) + (if verifying + nil + ;; transform was fruitless, retry w/new passphrase. + (pgg-remove-passphrase-from-cache target-cache-id t) + (allout-encrypt-string text decrypt allout-buffer + key-type for-key nil + (if retried (1+ retried) 1) + rejected verifying nil))) + + ;; Retry (within limit) if ciphertext contains rejections: + ((and (not decrypt) + ;; Check for disqualification of this ciphertext: + (let ((regexps reject-ciphertext-regexps) + reject-it) + (while (and regexps (not reject-it)) + (setq reject-it (string-match (car regexps) + result-text)) + (pop regexps)) + reject-it)) + (setq rejections-left (1- rejections-left)) + (if (<= rejections-left 0) + (error (concat "Ciphertext rejected too many times" + " (%s), per `%s'") + allout-encryption-ciphertext-rejection-ceiling + 'allout-encryption-ciphertext-rejection-regexps) + (allout-encrypt-string text decrypt allout-buffer + key-type for-key nil + retried (1+ rejected) + verifying passphrase))) + ;; Barf if encryption yields extraordinary control chars: + ((and (not decrypt) + (string-match "[\C-a\C-k\C-o-\C-z\C-@]" + result-text)) + (error (concat "Encryption produced non-armored text, which" + "conflicts with allout mode - reconfigure!"))) + + ;; valid result and just verifying or non-symmetric: + ((or verifying (not (equal key-type 'symmetric))) + (if (or verifying decrypt) + (pgg-add-passphrase-to-cache target-cache-id + passphrase t)) + result-text) + + ;; valid result and regular symmetric - "register" + ;; passphrase with mnemonic aids/cache. + (t + (set-buffer allout-buffer) + (if passphrase + (pgg-add-passphrase-to-cache target-cache-id + passphrase t)) + (allout-update-passphrase-mnemonic-aids for-key passphrase + allout-buffer) + result-text) + ) ) ) ) @@ -5313,7 +5634,6 @@ of the availability of a cached copy." (pgg-read-passphrase-from-cache cache-id t))) (got-pass (or cached (pgg-read-passphrase full-prompt cache-id t))) - confirmation) (if (not got-pass) @@ -5321,14 +5641,14 @@ of the availability of a cached copy." ;; Duplicate our handle on the passphrase so it's not clobbered by ;; deactivate-passwd memory clearing: - (setq got-pass (format "%s" got-pass)) + (setq got-pass (copy-sequence got-pass)) (cond (verifier-string (save-window-excursion (if (allout-encrypt-string verifier-string 'decrypt allout-buffer 'symmetric - for-key nil 0 'verifying - got-pass) + for-key nil 0 0 'verifying + (copy-sequence got-pass)) (setq confirmation (format "%s" got-pass)))) (if (and (not confirmation) @@ -5365,15 +5685,7 @@ of the availability of a cached copy." ;; recurse to this routine: (pgg-read-passphrase prompt-sans-hint cache-id t)) (pgg-remove-passphrase-from-cache cache-id t) - (error "Confirmation failed."))) - ;; reduce opportunity for memory cherry-picking by zeroing duplicate: - (dotimes (i (length got-pass)) - (aset got-pass i 0)) - ) - ) - ) - ) - ) + (error "Confirmation failed.")))))))) ;;;_ > allout-encrypted-topic-p () (defun allout-encrypted-topic-p () "True if the current topic is encryptable and encrypted." @@ -5426,7 +5738,7 @@ An error is raised if the text is not encrypted." (dotimes (i (length spew)) (aset spew i (1+ (random 254)))) (allout-encrypt-string spew nil (current-buffer) 'symmetric - nil nil 0 passphrase)) + nil nil 0 0 passphrase)) ) ;;;_ > allout-update-passphrase-mnemonic-aids (for-key passphrase ;;; outline-buffer) @@ -5505,7 +5817,7 @@ Derived from value of `allout-passphrase-verifier-string'." allout-passphrase-verifier-string (allout-encrypt-string (allout-get-encryption-passphrase-verifier) 'decrypt allout-buffer 'symmetric - key nil 0 'verifying passphrase) + key nil 0 0 'verifying passphrase) t))) ;;;_ > allout-next-topic-pending-encryption (&optional except-mark) (defun allout-next-topic-pending-encryption (&optional except-mark) @@ -5808,6 +6120,25 @@ If BEG is bigger than END we return 0." (goto-char (1+ (match-beginning 0))) (setq count (1+ count))) count)))) +;;;_ > allout-get-configvar-values (varname) +(defun allout-get-configvar-values (configvar-name) + "Return a list of values of the symbols in list bound to CONFIGVAR-NAME. + +The user is prompted for removal of symbols that are unbound, and they +otherwise are ignored. + +CONFIGVAR-NAME should be the name of the configuration variable, +not its value." + + (let ((configvar-value (symbol-value configvar-name)) + got) + (dolist (sym configvar-value) + (if (not (boundp sym)) + (if (yes-or-no-p (format "%s entry `%s' is unbound - remove it? " + configvar-name sym)) + (delq sym (symbol-value configvar-name))) + (push (symbol-value sym) got))) + (reverse got))) ;;;_ > allout-mark-marker to accommodate divergent emacsen: (defun allout-mark-marker (&optional force buffer) "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'." (defvar mouse-avoidance-pointer-shapes nil) (defvar mouse-avoidance-n-pointer-shapes 0) (defvar mouse-avoidance-old-pointer-shape nil) +(defvar mouse-avoidance-animating-pointer nil) ;; This timer is used to run something when Emacs is idle. (defvar mouse-avoidance-timer nil) @@ -243,16 +244,19 @@ You can redefine this if you want the mouse banished to a different corner." (+ (cdr mouse-avoidance-state) deltay))) (if (or (eq mouse-avoidance-mode 'animate) (eq mouse-avoidance-mode 'proteus)) - (let ((i 0.0)) + (let ((i 0.0) + (incr (max .1 (/ 1.0 mouse-avoidance-nudge-dist)))) + (setq mouse-avoidance-animating-pointer t) (while (<= i 1) (mouse-avoidance-set-mouse-position (cons (+ (car cur-pos) (round (* i deltax))) (+ (cdr cur-pos) (round (* i deltay))))) - (setq i (+ i (max .1 (/ 1.0 mouse-avoidance-nudge-dist)))) + (setq i (+ i incr)) (if (eq mouse-avoidance-mode 'proteus) (mouse-avoidance-set-pointer-shape (mouse-avoidance-random-shape))) - (sit-for mouse-avoidance-animation-delay))) + (sit-for mouse-avoidance-animation-delay)) + (setq mouse-avoidance-animating-pointer nil)) (mouse-avoidance-set-mouse-position (cons (+ (car (cdr cur)) deltax) (+ (cdr (cdr cur)) deltay)))))) @@ -294,11 +298,11 @@ redefine this function to suit your own tastes." (memq 'drag modifiers) (memq 'down modifiers))))))) -(defun mouse-avoidance-banish-hook () +(defun mouse-avoidance-banish () (if (not (mouse-avoidance-ignore-p)) (mouse-avoidance-banish-mouse))) -(defun mouse-avoidance-exile-hook () +(defun mouse-avoidance-exile () ;; For exile mode, the state is nil when the mouse is in its normal ;; position, and set to the old mouse-position when the mouse is in exile. (if (not (mouse-avoidance-ignore-p)) @@ -317,9 +321,10 @@ redefine this function to suit your own tastes." ;; but clear state anyway, to be ready for another move (setq mouse-avoidance-state nil)))))) -(defun mouse-avoidance-fancy-hook () +(defun mouse-avoidance-fancy () ;; Used for the "fancy" modes, ie jump et al. - (if (and (not (mouse-avoidance-ignore-p)) + (if (and (not mouse-avoidance-animating-pointer) + (not (mouse-avoidance-ignore-p)) (mouse-avoidance-too-close-p (mouse-position))) (let ((old-pos (mouse-position))) (mouse-avoidance-nudge-mouse) @@ -375,14 +380,14 @@ definition of \"random distance\".)" (eq mode 'animate) (eq mode 'proteus)) (setq mouse-avoidance-timer - (run-with-idle-timer 0.1 t 'mouse-avoidance-fancy-hook)) + (run-with-idle-timer 0.1 t 'mouse-avoidance-fancy)) (setq mouse-avoidance-mode mode mouse-avoidance-state (cons 0 0) mouse-avoidance-old-pointer-shape (and (boundp 'x-pointer-shape) x-pointer-shape))) ((eq mode 'exile) (setq mouse-avoidance-timer - (run-with-idle-timer 0.1 t 'mouse-avoidance-exile-hook)) + (run-with-idle-timer 0.1 t 'mouse-avoidance-exile)) (setq mouse-avoidance-mode mode mouse-avoidance-state nil)) ((or (eq mode 'banish) @@ -390,7 +395,7 @@ definition of \"random distance\".)" (and (null mode) (null mouse-avoidance-mode)) (and mode (> (prefix-numeric-value mode) 0))) (setq mouse-avoidance-timer - (run-with-idle-timer 0.1 t 'mouse-avoidance-banish-hook)) + (run-with-idle-timer 0.1 t 'mouse-avoidance-banish)) (setq mouse-avoidance-mode 'banish)) (t (setq mouse-avoidance-mode nil))) (force-mode-line-update)) diff --git a/lisp/bindings.el b/lisp/bindings.el index 1accc5b2662..dacde69fa02 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -280,52 +280,62 @@ Keymap to display on minor modes.") ;; mouse-1: select window, mouse-2: delete others, mouse-3: delete, ;; drag-mouse-1: resize, C-mouse-2: split horizontally" "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete this") - (dashes (propertize "--" 'help-echo help-echo))) - (setq-default mode-line-format - (list - "%e" - (propertize "-" 'help-echo help-echo) - 'mode-line-mule-info - 'mode-line-modified - 'mode-line-frame-identification - 'mode-line-buffer-identification - (propertize " " 'help-echo help-echo) - 'mode-line-position - '(vc-mode vc-mode) - (propertize " " 'help-echo help-echo) - 'mode-line-modes - `(which-func-mode ("" which-func-format ,dashes)) - `(global-mode-string (,dashes global-mode-string)) - (propertize "-%-" 'help-echo help-echo))) + (dashes (propertize "--" 'help-echo help-echo)) + (standard-mode-line-format + (list + "%e" + (propertize "-" 'help-echo help-echo) + 'mode-line-mule-info + 'mode-line-modified + 'mode-line-frame-identification + 'mode-line-buffer-identification + (propertize " " 'help-echo help-echo) + 'mode-line-position + '(vc-mode vc-mode) + (propertize " " 'help-echo help-echo) + 'mode-line-modes + `(which-func-mode ("" which-func-format ,dashes)) + `(global-mode-string (,dashes global-mode-string)) + (propertize "-%-" 'help-echo help-echo))) + (standard-mode-line-modes + (list + (propertize "%[(" 'help-echo help-echo) + `(:propertize ("" mode-name) + help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes" + mouse-face mode-line-highlight + local-map ,mode-line-major-mode-keymap) + '("" mode-line-process) + `(:propertize ("" minor-mode-alist) + mouse-face mode-line-highlight + help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes" + local-map ,mode-line-minor-mode-keymap) + (propertize "%n" 'help-echo "mouse-2: widen" + 'mouse-face 'mode-line-highlight + 'local-map (make-mode-line-mouse-map + 'mouse-2 #'mode-line-widen)) + (propertize ")%]--" 'help-echo help-echo))) + (standard-mode-line-position + `((-3 ,(propertize "%p" 'help-echo help-echo)) + (size-indication-mode + (8 ,(propertize " of %I" 'help-echo help-echo))) + (line-number-mode + ((column-number-mode + (10 ,(propertize " (%l,%c)" 'help-echo help-echo)) + (6 ,(propertize " L%l" 'help-echo help-echo)))) + ((column-number-mode + (5 ,(propertize " C%c" 'help-echo help-echo)))))))) - (setq-default mode-line-modes - (list - (propertize "%[(" 'help-echo help-echo) - `(:propertize ("" mode-name) - help-echo "mouse-1: major mode, mouse-2: major mode help, mouse-3: toggle minor modes" - mouse-face mode-line-highlight - local-map ,mode-line-major-mode-keymap) - '("" mode-line-process) - `(:propertize ("" minor-mode-alist) - mouse-face mode-line-highlight - help-echo "mouse-2: minor mode help, mouse-3: toggle minor modes" - local-map ,mode-line-minor-mode-keymap) - (propertize "%n" 'help-echo "mouse-2: widen" - 'mouse-face 'mode-line-highlight - 'local-map (make-mode-line-mouse-map - 'mouse-2 #'mode-line-widen)) - (propertize ")%]--" 'help-echo help-echo))) + (setq-default mode-line-format standard-mode-line-format) + (put 'mode-line-format 'standard-value + (list `(quote ,standard-mode-line-format))) - (setq-default mode-line-position - `((-3 ,(propertize "%p" 'help-echo help-echo)) - (size-indication-mode - (8 ,(propertize " of %I" 'help-echo help-echo))) - (line-number-mode - ((column-number-mode - (10 ,(propertize " (%l,%c)" 'help-echo help-echo)) - (6 ,(propertize " L%l" 'help-echo help-echo)))) - ((column-number-mode - (5 ,(propertize " C%c" 'help-echo help-echo)))))))) + (setq-default mode-line-modes standard-mode-line-modes) + (put 'mode-line-modes 'standard-value + (list `(quote ,standard-mode-line-modes))) + + (setq-default mode-line-position standard-mode-line-position) + (put 'mode-line-position 'standard-value + (list `(quote ,standard-mode-line-position)))) (defvar mode-line-buffer-identification-keymap nil "\ Keymap for what is displayed by `mode-line-buffer-identification'.") diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index e9e7e9a2bb8..398b362d4e4 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el @@ -117,6 +117,7 @@ file buffers. It affects both manual reverting and reverting by Auto Revert Mode.") (defvar Info-current-file) ;; from info.el +(defvar Info-current-node) ;; from info.el (make-variable-buffer-local 'Buffer-menu-files-only) @@ -786,7 +787,12 @@ For more information, see the function `buffer-menu'." ((eq file 'toc) (setq file "*Info TOC*")) ((not (stringp file)) ;; avoid errors - (setq file nil)))))) + (setq file nil)) + (t + (setq file (concat "(" + (file-name-nondirectory file) + ")" + Info-current-node))))))) (push (list buffer bits name (buffer-size) mode file) list)))))) ;; 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 @@ :group 'timeclock) (defcustom timeclock-relative t - "*Whether to maken reported time relative to `timeclock-workday'. + "*Whether to make reported time relative to `timeclock-workday'. For example, if the length of a normal workday is eight hours, and you work four hours on Monday, then the amount of time \"remaining\" on Tuesday is twelve hours -- relative to an averaged work period of @@ -251,7 +251,10 @@ each day.") This value is not accurate enough to be useful by itself. Rather, call `timeclock-workday-elapsed', to determine how much time has been worked so far today. Also, if `timeclock-relative' is nil, this value -will be the same as `timeclock-discrepancy'.") ; ? gm +will be the same as `timeclock-discrepancy'.") + +(defvar timeclock-use-elapsed nil + "Non-nil if the modeline should display time elapsed, not remaining.") (defvar timeclock-last-period nil "Integer representing the number of seconds in the last period. @@ -424,7 +427,9 @@ If SHOW-SECONDS is non-nil, display second resolution. If TODAY-ONLY is non-nil, the display will be relative only to time worked today, ignoring the time worked on previous days." (interactive "P") - (let ((remainder (timeclock-workday-remaining)) ; today-only? + (let ((remainder (timeclock-workday-remaining + (or today-only + (not timeclock-relative)))) (last-in (equal (car timeclock-last-event) "i")) status) (setq status @@ -619,7 +624,10 @@ relative only to the time worked today, and not to past time." The value of `timeclock-relative' affects the display as described in that variable's documentation." (interactive) - (let ((remainder (timeclock-workday-remaining (not timeclock-relative))) + (let ((remainder + (if timeclock-use-elapsed + (timeclock-workday-elapsed) + (timeclock-workday-remaining (not timeclock-relative)))) (last-in (equal (car timeclock-last-event) "i"))) (when (and (< remainder 0) (not (and timeclock-day-over diff --git a/lisp/compare-w.el b/lisp/compare-w.el index e61f24a0c7c..3aa01424fb5 100644 --- a/lisp/compare-w.el +++ b/lisp/compare-w.el @@ -167,16 +167,14 @@ on first call it advances points to the next difference, on second call it synchronizes points by skipping the difference, on third call it again advances points to the next difference and so on." (interactive "P") + (if compare-ignore-whitespace + (setq ignore-whitespace (not ignore-whitespace))) (let* (p1 p2 maxp1 maxp2 b1 b2 w2 (progress 1) (opoint1 (point)) opoint2 - (skip-func (if (if ignore-whitespace ; XOR - (not compare-ignore-whitespace) - compare-ignore-whitespace) - (if (stringp compare-windows-whitespace) - 'compare-windows-skip-whitespace - compare-windows-whitespace))) + skip-func-1 + skip-func-2 (sync-func (if (stringp compare-windows-sync) 'compare-windows-sync-regexp compare-windows-sync))) @@ -190,8 +188,19 @@ on third call it again advances points to the next difference and so on." b2 (window-buffer w2)) (setq opoint2 p2) (setq maxp1 (point-max)) - (save-excursion - (set-buffer b2) + + (setq skip-func-1 (if ignore-whitespace + (if (stringp compare-windows-whitespace) + (lambda () (compare-windows-skip-whitespace) + t) + compare-windows-whitespace))) + + (with-current-buffer b2 + (setq skip-func-2 (if ignore-whitespace + (if (stringp compare-windows-whitespace) + (lambda () (compare-windows-skip-whitespace) + t) + compare-windows-whitespace))) (push-mark p2 t) (setq maxp2 (point-max))) (push-mark) @@ -199,17 +208,16 @@ on third call it again advances points to the next difference and so on." (while (> progress 0) ;; If both windows have whitespace next to point, ;; optionally skip over it. - (and skip-func + (and skip-func-1 (save-excursion (let (p1a p2a w1 w2 result1 result2) - (setq result1 (funcall skip-func opoint1)) + (setq result1 (funcall skip-func-1 opoint1)) (setq p1a (point)) (set-buffer b2) (goto-char p2) - (setq result2 (funcall skip-func opoint2)) + (setq result2 (funcall skip-func-2 opoint2)) (setq p2a (point)) - (if (or (stringp compare-windows-whitespace) - (and result1 result2 (eq result1 result2))) + (if (and result1 result2 (eq result1 result2)) (setq p1 p1a p2 p2a))))) diff --git a/lisp/complete.el b/lisp/complete.el index c49ad488536..90c1ceceb32 100644 --- a/lisp/complete.el +++ b/lisp/complete.el @@ -543,8 +543,8 @@ of `minibuffer-completion-table' and the minibuffer contents.") (let ((compl (all-completions (if env-on (file-name-nondirectory (substring str 0 p)) (substring str 0 p)) - table - pred))) + table + pred))) (setq p compl) (while p (and (string-match regex (car p)) @@ -553,6 +553,34 @@ of `minibuffer-completion-table' and the minibuffer contents.") (setq poss (cons (car p) poss)))) (setq p (cdr p))))) + ;; Handle completion-ignored-extensions + (and filename + (not (eq mode 'help)) + (let ((p2 poss)) + + ;; Build a regular expression representing the extensions list + (or (equal completion-ignored-extensions PC-ignored-extensions) + (setq PC-ignored-regexp + (concat "\\(" + (mapconcat + 'regexp-quote + (setq PC-ignored-extensions + completion-ignored-extensions) + "\\|") + "\\)\\'"))) + + ;; Check if there are any without an ignored extension. + ;; Also ignore `.' and `..'. + (setq p nil) + (while p2 + (or (string-match PC-ignored-regexp (car p2)) + (string-match "\\(\\`\\|/\\)[.][.]?/?\\'" (car p2)) + (setq p (cons (car p2) p))) + (setq p2 (cdr p2))) + + ;; If there are "good" names, use them + (and p (setq poss p)))) + ;; Now we have a list of possible completions (cond @@ -575,34 +603,6 @@ of `minibuffer-completion-table' and the minibuffer contents.") ((or (cdr (setq helpposs poss)) (memq mode '(help word))) - ;; Handle completion-ignored-extensions - (and filename - (not (eq mode 'help)) - (let ((p2 poss)) - - ;; Build a regular expression representing the extensions list - (or (equal completion-ignored-extensions PC-ignored-extensions) - (setq PC-ignored-regexp - (concat "\\(" - (mapconcat - 'regexp-quote - (setq PC-ignored-extensions - completion-ignored-extensions) - "\\|") - "\\)\\'"))) - - ;; Check if there are any without an ignored extension. - ;; Also ignore `.' and `..'. - (setq p nil) - (while p2 - (or (string-match PC-ignored-regexp (car p2)) - (string-match "\\(\\`\\|/\\)[.][.]?/?\\'" (car p2)) - (setq p (cons (car p2) p))) - (setq p2 (cdr p2))) - - ;; If there are "good" names, use them - (and p (setq poss p)))) - ;; Is the actual string one of the possible completions? (setq p (and (not (eq mode 'help)) poss)) (while (and p @@ -623,7 +623,8 @@ of `minibuffer-completion-table' and the minibuffer contents.") ;; Check if next few letters are the same in all cases (if (and (not (eq mode 'help)) - (setq prefix (try-completion (PC-chunk-after basestr skip) (mapcar 'list poss)))) + (setq prefix (try-completion (PC-chunk-after basestr skip) + poss))) (let ((first t) i) ;; Retain capitalization of user input even if ;; completion-ignore-case is set. @@ -669,13 +670,9 @@ of `minibuffer-completion-table' and the minibuffer contents.") (+ beg (length dirname)) end) skip) (mapcar - (function - (lambda (x) - (list - (and (string-match skip x) - (substring - x - (match-end 0)))))) + (lambda (x) + (when (string-match skip x) + (substring x (match-end 0)))) poss))) (or (> i 0) (> (length prefix) 0)) (or (not (eq mode 'word)) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 0493dd0894c..609b5572a08 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4436,6 +4436,7 @@ The format is suitable for use with `easy-menu-define'." (let ((map (make-keymap))) (set-keymap-parent map widget-keymap) (define-key map [remap self-insert-command] 'custom-no-edit) + (define-key map "\^m" 'custom-newline) (define-key map " " 'scroll-up) (define-key map "\177" 'scroll-down) (define-key map "\C-c\C-c" 'Custom-set) @@ -4452,6 +4453,14 @@ The format is suitable for use with `easy-menu-define'." (interactive "@d") (error "You can't edit this part of the Custom buffer")) +(defun custom-newline (pos &optional event) + "Invoke button at POS, or refuse to allow editing of Custom buffer." + (interactive "@d") + (let ((button (get-char-property pos 'button))) + (if button + (widget-apply-action button event) + (error "You can't edit this part of the Custom buffer")))) + (easy-menu-define Custom-mode-menu custom-mode-map "Menu used in customization buffers." diff --git a/lisp/cus-start.el b/lisp/cus-start.el index e35a75da598..2fce89c73c2 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -178,7 +178,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of ;; fringe.c (overflow-newline-into-fringe fringe boolean) ;; indent.c - (indent-tabs-mode fill boolean) + (indent-tabs-mode indent boolean) ;; keyboard.c (meta-prefix-char keyboard character) (auto-save-interval auto-save integer) diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index 53f530505ae..b4fe1e4b0bf 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el @@ -99,7 +99,7 @@ the directory " custom-theme-directory "\n\n") (widget-insert " ") (widget-create 'push-button :notify (lambda (&rest ignore) - (when (y-or-n-p "Discard current changes?") + (when (y-or-n-p "Discard current changes? ") (kill-buffer (current-buffer)) (customize-create-theme))) "Reset Buffer") @@ -137,7 +137,7 @@ the directory " custom-theme-directory "\n\n") (widget-insert "\n") (widget-create 'push-button :notify (lambda (&rest ignore) - (when (y-or-n-p "Discard current changes?") + (when (y-or-n-p "Discard current changes? ") (kill-buffer (current-buffer)) (customize-create-theme))) "Reset Buffer") @@ -290,7 +290,7 @@ Optional EVENT is the location for the menu." (defun custom-theme-visit-theme () (interactive) (when (or (null custom-theme-variables) - (if (y-or-n-p "Discard current changes?") + (if (y-or-n-p "Discard current changes? ") (progn (customize-create-theme) t))) (let ((theme (call-interactively 'custom-theme-merge-theme))) (unless (eq theme 'user) diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index d05eed2c4a2..1b37f3f772f 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el @@ -619,9 +619,12 @@ If optional second arg SEP is a string, use that as separator." (bindat-format-vector vect "%02x" (if (stringp sep) sep ":"))) (defun bindat-ip-to-string (ip) - "Format vector IP as an ip address in dotted notation." - (format "%d.%d.%d.%d" - (aref ip 0) (aref ip 1) (aref ip 2) (aref ip 3))) + "Format vector IP as an ip address in dotted notation. +The port (if any) is omitted. IP can be a string, as well." + (if (vectorp ip) + (format-network-address ip t) + (format "%d.%d.%d.%d" + (aref ip 0) (aref ip 1) (aref ip 2) (aref ip 3)))) (provide 'bindat) 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 `::::} '." (edebug-outside-buffer (current-buffer)) (edebug-outside-point (point)) (edebug-outside-mark (edebug-mark)) + (edebug-outside-unread-command-events unread-command-events) edebug-outside-windows ; window or screen configuration edebug-buffer-points @@ -2574,6 +2575,7 @@ MSG is printed after `::::} '." (overlay-arrow-string overlay-arrow-string) (cursor-in-echo-area nil) (default-cursor-in-non-selected-windows t) + (unread-command-events unread-command-events) ;; any others?? ) (if (not (buffer-name edebug-buffer)) @@ -2662,6 +2664,7 @@ MSG is printed after `::::} '." (t (message ""))) + (setq unread-command-events nil) (if (eq 'after edebug-arg-mode) (progn ;; Display result of previous evaluation. @@ -2681,8 +2684,7 @@ MSG is printed after `::::} '." ((eq edebug-execution-mode 'trace) (edebug-sit-for edebug-sit-for-seconds)) ; Force update and pause. ((eq edebug-execution-mode 'Trace-fast) - (edebug-sit-for 0)) ; Force update and continue. - ) + (edebug-sit-for 0))) ; Force update and continue. (unwind-protect (if (or edebug-stop @@ -2778,6 +2780,7 @@ MSG is printed after `::::} '." (with-timeout-unsuspend edebug-with-timeout-suspend) ;; Reset global variables to outside values in case they were changed. (setq + unread-command-events edebug-outside-unread-command-events overlay-arrow-position edebug-outside-o-a-p overlay-arrow-string edebug-outside-o-a-s cursor-in-echo-area edebug-outside-c-i-e-a @@ -2868,7 +2871,6 @@ MSG is printed after `::::} '." (edebug-outside-last-input-event last-input-event) (edebug-outside-last-command-event last-command-event) - (edebug-outside-unread-command-events unread-command-events) (edebug-outside-last-event-frame last-event-frame) (edebug-outside-last-nonmenu-event last-nonmenu-event) (edebug-outside-track-mouse track-mouse) @@ -2890,7 +2892,6 @@ MSG is printed after `::::} '." ;; More for Emacs 19 (last-input-event nil) (last-command-event nil) - (unread-command-events nil) (last-event-frame nil) (last-nonmenu-event nil) (track-mouse nil) @@ -2950,7 +2951,6 @@ MSG is printed after `::::} '." last-command edebug-outside-last-command this-command edebug-outside-this-command unread-command-char edebug-outside-unread-command-char - unread-command-events edebug-outside-unread-command-events current-prefix-arg edebug-outside-current-prefix-arg last-input-char edebug-outside-last-input-char last-input-event edebug-outside-last-input-event diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 0129bd43976..72754aa1cd3 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,41 @@ +2006-08-13 Romain Francoise + + * erc-match.el (erc-log-matches-make-buffer): End `y-or-n-p' + prompt with a space. + +2006-08-07 Michael Olson + + * erc-backend.el (erc-process-sentinel-1): Use erc-display-message + in several places instead of inserting text. + (erc-process-sentinel): Move to the input-marker before removing + the prompt. + + * erc.el (erc-port): Fix customization options. + (erc-display-message): Handle null type explicitly. Previously, + this was relying on a chance side-effect. Cosmetic indentation + tweak. + (english): Add 'finished and 'terminated entries to the catalog. + Add initial and terminal newlines to 'disconnected and + 'disconnected-noreconnect entries. Avoid long lines. + +2006-08-06 Michael Olson + + * erc.el (erc-arrange-session-in-multiple-windows): Fix bug with + multi-tty Emacs. + (erc-select-startup-file): Fix bug introduced by recent change. + +2006-08-05 Michael Olson + + * erc-log.el (erc-log-standardize-name): New function that returns + a filename that is safe for use for a log file. + (erc-current-logfile): Use it. + + * erc.el (erc-startup-file-list): Search in ~/.emacs.d first, + since that is a fairly standard directory. + (erc-select-startup-file): Re-write to use + convert-standard-filename, which will ensure that MS-DOS systems + look for the _ercrc.el file. + 2006-08-02 Michael Olson * erc.el (erc-version-string): Release ERC 5.1.4. diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 705ca7a9e63..5acbcb05ab8 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -493,11 +493,7 @@ action." (if erc-server-quitting ;; normal quit (progn - (let ((string "\n\n*** ERC finished ***\n") - (inhibit-read-only t)) - (erc-put-text-property 0 (length string) - 'face 'erc-error-face string) - (insert string)) + (erc-display-message nil 'error (current-buffer) 'finished) (when erc-kill-server-buffer-on-quit (set-buffer-modified-p nil) (kill-buffer (current-buffer)))) @@ -519,12 +515,8 @@ action." (erc erc-session-server erc-session-port erc-server-current-nick erc-session-user-full-name t erc-session-password) ;; terminate, do not reconnect - (let ((string (concat "\n\n*** ERC terminated: " event - "\n")) - (inhibit-read-only t)) - (erc-put-text-property 0 (length string) - 'face 'erc-error-face string) - (insert string))))) + (erc-display-message nil 'error (current-buffer) + 'terminated ?e event)))) (defun erc-process-sentinel (cproc event) "Sentinel function for ERC process." @@ -545,6 +537,7 @@ action." (run-hook-with-args 'erc-disconnected-hook (erc-current-nick) (system-name) "") ;; Remove the prompt + (goto-char (or (marker-position erc-input-marker) (point-max))) (forward-line 0) (erc-remove-text-properties-region (point) (point-max)) (delete-region (point) (point-max)) diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index 418e45060bd..2fe29e82fe5 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -71,8 +71,6 @@ ;; markers. ;;; TODO: -;; * Erc needs a generalised make-safe-file-name function, so that -;; generated file names don't contain any invalid file characters. ;; ;; * Really, we need to lock the logfiles somehow, so that if a user ;; is running multiple emacsen and/or on the same channel as more @@ -293,17 +291,27 @@ is writeable (it will be created as necessary) and (funcall erc-enable-logging (or buffer (current-buffer))) erc-enable-logging))) +(defun erc-log-standardize-name (filename) + "Make FILENAME safe to use as the name of an ERC log. +This will not work with full paths, only names. + +Any unsafe characters in the name are replaced with \"!\". The +filename is downcased." + (downcase (erc-replace-regexp-in-string + "[/\\]" "!" (convert-standard-filename filename)))) + (defun erc-current-logfile (&optional buffer) "Return the logfile to use for BUFFER. If BUFFER is nil, the value of `current-buffer' is used. This is determined by `erc-generate-log-file-name-function'. The result is converted to lowercase, as IRC is case-insensitive" (expand-file-name - (downcase (funcall erc-generate-log-file-name-function - (or buffer (current-buffer)) - (or (erc-default-target) (buffer-name buffer)) - (erc-current-nick) - erc-session-server erc-session-port)) + (erc-log-standardize-name + (funcall erc-generate-log-file-name-function + (or buffer (current-buffer)) + (or (erc-default-target) (buffer-name buffer)) + (erc-current-nick) + erc-session-server erc-session-port)) erc-log-channels-directory)) (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 (unless buffer-already (insert " == Type \"q\" to dismiss messages ==\n") (erc-view-mode-enter nil (lambda (buffer) - (when (y-or-n-p "Discard messages?") + (when (y-or-n-p "Discard messages? ") (kill-buffer buffer))))) buffer))) diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 4317b831d56..41d59576251 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -157,8 +157,8 @@ parameters and authentication." This can be either a string or a number." :group 'erc :type '(choice (const :tag "None" nil) - (const :tag "Port number" number) - (const :tag "Port string" string))) + (integer :tag "Port number") + (string :tag "Port string"))) (defcustom erc-nick nil "Nickname to use if one is not provided. @@ -822,7 +822,8 @@ See `erc-server-flood-margin' for other flood-related parameters.") ;; Script parameters (defcustom erc-startup-file-list - '("~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc") + '("~/.emacs.d/.ercrc.el" "~/.emacs.d/.ercrc" + "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc") "List of files to try for a startup script. The first existent and readable one will get executed. @@ -2362,6 +2363,8 @@ See also `erc-format-message' and `erc-display-line'." msg))) (setq string (cond + ((null type) + string) ((listp type) (mapc (lambda (type) (setq string @@ -2374,7 +2377,7 @@ See also `erc-format-message' and `erc-display-line'." (if (not (erc-response-p parsed)) (erc-display-line string buffer) (unless (member (erc-response.command parsed) erc-hide-list) - (erc-put-text-property 0 (length string) 'erc-parsed parsed string) + (erc-put-text-property 0 (length string) 'erc-parsed parsed string) (erc-put-text-property 0 (length string) 'rear-sticky t string) (erc-display-line string buffer))))) @@ -5241,13 +5244,11 @@ If FILE is found, return the path to it." (defun erc-select-startup-file () "Select an ERC startup file. See also `erc-startup-file-list'." - (let ((l erc-startup-file-list) - (f nil)) - (while (and (not f) l) - (if (file-readable-p (car l)) - (setq f (car l))) - (setq l (cdr l))) - f)) + (catch 'found + (dolist (f erc-startup-file-list) + (setq f (convert-standard-filename f)) + (when (file-readable-p f) + (throw 'found f))))) (defun erc-find-script-file (file) "Search for FILE in `default-directory', and any in `erc-script-path'." @@ -5894,7 +5895,8 @@ All windows are opened in the current frame." (setq bufs (cdr bufs)) (while bufs (split-window) - (switch-to-buffer-other-window (car bufs)) + (other-window 1) + (switch-to-buffer (car bufs)) (setq bufs (cdr bufs)) (balance-windows))))) @@ -5946,12 +5948,17 @@ All windows are opened in the current frame." (ctcp-request-to . "==> CTCP request from %n (%u@%h) to %t: %r") (ctcp-too-many . "Too many CTCP queries in single message. Ignoring") (flood-ctcp-off . "FLOOD PROTECTION: Automatic CTCP responses turned off.") - (flood-strict-mode . "FLOOD PROTECTION: Switched to Strict Flood Control mode.") - (disconnected . "Connection failed! Re-establishing connection...") - (disconnected-noreconnect . "Connection failed! Not re-establishing connection.") + (flood-strict-mode + . "FLOOD PROTECTION: Switched to Strict Flood Control mode.") + (disconnected . "\n\nConnection failed! Re-establishing connection...\n") + (disconnected-noreconnect + . "\n\nConnection failed! Not re-establishing connection.\n") + (finished . "\n\n*** ERC finished ***\n") + (terminated . "\n\n*** ERC terminated: %e\n") (login . "Logging in as \'%n\'...") (nick-in-use . "%n is in use. Choose new nickname: ") - (nick-too-long . "WARNING: Nick length (%i) exceeds max NICKLEN(%l) defined by server") + (nick-too-long + . "WARNING: Nick length (%i) exceeds max NICKLEN(%l) defined by server") (no-default-channel . "No default channel") (no-invitation . "You've got no invitation") (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." :type 'boolean :group 'eshell-glob) -(defcustom eshell-glob-chars-list '(?\] ?\[ ?* ?? ?~ ?\( ?\) ?| ?#) +(defcustom eshell-glob-chars-list '(?\] ?\[ ?* ?? ?~ ?\( ?\) ?| ?# ?^) "*List of additional characters used in extended globbing." :type '(repeat character) :group 'eshell-glob) @@ -105,6 +105,7 @@ This option slows down recursive glob processing by quite a bit." (defcustom eshell-glob-translate-alist '((?\] . "]") (?\[ . "[") + (?^ . "^") (?? . ".") (?* . ".*") (?~ . "~") 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." (defcustom facemenu-listed-faces nil "*List of faces to include in the Face menu. -Each element should be a symbol, which is the name of a face. +Each element should be a symbol, the name of a face. The \"basic \" faces in `facemenu-keybindings' are automatically -added to the Face menu, and are not included in this list. +added to the Face menu, and need not be in this list. -You can set this list before loading facemenu.el, or add a face to it before -creating that face if you want it to be listed. If you change the -variable so as to eliminate faces that have already been added to the menu, -call `facemenu-update' to recalculate the menu contents. +This value takes effect when you load facemenu.el. If the +list includes symbols which are not defined as faces, they +are ignored; however, subsequently defining or creating +those faces adds them to the menu then. You can call +`facemenu-update' to recalculate the menu contents, such as +if you change the value of this variable, -If this variable is t, all faces will be added to the menu. This -is useful for setting temporarily if you want to add faces to the -menu when they are created." +If this variable is t, all faces that you apply to text +using the face menu commands (even by name), and all faces +that you define or create, are added to the menu. You may +find it useful to set this variable to t temporarily while +you define some faces, so that they will be added. However, +if the value is no longer t and you call `facemenu-update', +it will remove any faces not explicitly in the list." :type '(choice (const :tag "List all faces" t) (const :tag "None" nil) (repeat symbol)) @@ -320,19 +326,24 @@ variables." ;;;###autoload (defun facemenu-set-face (face &optional start end) - "Add FACE to the region or next character typed. -This adds FACE to the top of the face list; any faces lower on the list that -will not show through at all will be removed. + "Apply FACE to the region or next character typed. -Interactively, reads the face name with the minibuffer. +If the region is active (normally true except in Transient +Mark mode) and nonempty, and there is no prefix argument, +this command applies FACE to the region. Otherwise, it applies FACE +to the faces to use for the next character +inserted. (Moving point or switching buffers before typing +a character to insert cancels the specification.) -If the region is active (normally true except in Transient Mark mode) -and there is no prefix argument, this command sets the region to the -requested face. +If FACE is `default', to \"apply\" it means clearing +the list of faces to be used. For any other value of FACE, +to \"apply\" it means putting FACE at the front of the list +of faces to be used, and removing any faces further +along in the list that would be completely overridden by +preceding faces (including FACE). -Otherwise, this command specifies the face for the next character -inserted. Moving point or switching buffers before -typing a character to insert cancels the specification." +This command can also add FACE to the menu of faces, +if `facemenu-listed-faces' says to do that." (interactive (list (progn (barf-if-buffer-read-only) (read-face-name "Use face")) @@ -612,7 +623,12 @@ effect. See `facemenu-remove-face-function'." (cons face (if (listp prev) prev - (list prev))))))) + (list prev))) + ;; Specify the selected frame + ;; because nil would mean to use + ;; the new-frame default settings, + ;; and those are usually nil. + (selected-frame))))) (setq part-start part-end))) (setq self-insert-face (if (eq last-command self-insert-face-command) (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." (nreverse active-list))) (defun facemenu-add-new-face (face) - "Add FACE (a face) to the Face menu. - -This is called whenever you create a new face." + "Add FACE (a face) to the Face menu if `facemenu-listed-faces' says so. +This is called whenever you create a new face, and at other times." (let* (name symbol menu docstring diff --git a/lisp/faces.el b/lisp/faces.el index 4627b5ff594..f2d3e0ddb44 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2066,7 +2066,7 @@ created." ;; red4 is too dark, but some say blue is too loud. ;; brown seems to work ok. -- rms. (t :foreground "brown")) - "Face for characters displayed as ^-sequences or \-sequences." + "Face for characters displayed as sequences using `^' or `\\'." :group 'basic-faces :version "22.1") 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." filesets-data nil))) (entry (or (assoc name filesets-data) (when (y-or-n-p - (format "Fileset %s does not exist. Create it?" + (format "Fileset %s does not exist. Create it? " name)) (progn (add-to-list 'filesets-data (list name '(:files))) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index b05b7ecc2e6..82f9be4cb4c 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -976,7 +976,7 @@ The value of this variable is used when Font Lock mode is turned on." ;; multi-line strings and comments; regexps are not appropriate for the job.) (defvar font-lock-extend-after-change-region-function nil - "A function that determines the region to fontify after a change. + "A function that determines the region to refontify after a change. This variable is either nil, or is a function that determines the region to refontify after a change. @@ -985,7 +985,7 @@ Font-lock calls this function after each buffer change. The function is given three parameters, the standard BEG, END, and OLD-LEN from `after-change-functions'. It should return either a cons of the beginning -and end buffer positions \(in that order) of the region to fontify, or nil +and end buffer positions \(in that order) of the region to refontify, or nil \(which directs the caller to fontify a default region). This function should preserve the match-data. The region it returns may start or end in the middle of a line.") @@ -1044,6 +1044,12 @@ a very meaningful entity to highlight.") (defvar font-lock-beg) (defvar font-lock-end) (defvar font-lock-extend-region-functions '(font-lock-extend-region-wholelines + ;; This use of font-lock-multiline property is unreliable but is just + ;; a handy heuristic: in case you don't have a function that does + ;; /identification/ of multiline elements, you may still occasionally + ;; discover them by accident (or you may /identify/ them but not in all + ;; cases), in which case the font-lock-multiline property can help make + ;; sure you will properly *re*identify them during refontification. font-lock-extend-region-multiline) "Special hook run just before proceeding to fontify a region. This is used to allow major modes to help font-lock find safe buffer positions @@ -1167,6 +1173,13 @@ what properties to clear before refontifying a region.") (defvar jit-lock-start) (defvar jit-lock-end) (defun font-lock-extend-jit-lock-region-after-change (beg end old-len) + "Function meant for `jit-lock-after-change-extend-region-functions'. +This function does 2 things: +- extend the region so that it not only includes the part that was modified + but also the surrounding text whose highlighting may change as a consequence. +- anticipate (part of) the region extension that will happen later in + `font-lock-default-fontify-region', in order to avoid the need for + double-redisplay in `jit-lock-fontify-now'." (save-excursion ;; First extend the region as font-lock-after-change-function would. (let ((region (if font-lock-extend-after-change-region-function @@ -1177,6 +1190,16 @@ what properties to clear before refontifying a region.") end (max jit-lock-end (cdr region)))) ;; Then extend the region obeying font-lock-multiline properties, ;; indicating which part of the buffer needs to be refontified. + ;; !!! This is the *main* user of font-lock-multiline property !!! + ;; font-lock-after-change-function could/should also do that, but it + ;; doesn't need to because font-lock-default-fontify-region does + ;; it anyway. Here OTOH we have no guarantee that + ;; font-lock-default-fontify-region will be executed on this region + ;; any time soon. + ;; Note: contrary to font-lock-default-fontify-region, we do not do + ;; any loop here because we are not looking for a safe spot: we just + ;; mark the text whose appearance may need to change as a result of + ;; the buffer modification. (when (and (> beg (point-min)) (get-text-property (1- beg) 'font-lock-multiline)) (setq beg (or (previous-single-property-change @@ -1186,8 +1209,11 @@ what properties to clear before refontifying a region.") 'font-lock-multiline nil) (point-max))) ;; Finally, pre-enlarge the region to a whole number of lines, to try - ;; and predict what font-lock-default-fontify-region will do, so as to + ;; and anticipate what font-lock-default-fontify-region will do, so as to ;; avoid double-redisplay. + ;; We could just run `font-lock-extend-region-functions', but since + ;; the only purpose is to avoid the double-redisplay, we prefer to + ;; do here only the part that is cheap and most likely to be useful. (when (memq 'font-lock-extend-region-wholelines font-lock-extend-region-functions) (goto-char beg) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 750956b9f8b..6ddd513610a 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,27 @@ +2006-08-13 Romain Francoise + + * mm-extern.el (mm-extern-mail-server): End `y-or-n-p' prompt with a + space. + +2006-08-09 Katsumi Yamaoka + + * compface.el (uncompface): Use binary rather than raw-text-unix. + +2006-08-09 Katsumi Yamaoka + + * compface.el (uncompface): Make sure the eol conversion doesn't take + place when communicating with the external programs. Reported by + ARISAWA Akihiro . + +2006-07-31 Katsumi Yamaoka + + * nnheader.el (nnheader-insert-head): Fix typo in comment. + +2006-07-31 Andreas Seltenreich + + * nnweb.el (nnweb-google-parse-1): Update regexp for author and date. + Make it more robust by parsing author and date independently. + 2006-07-28 Katsumi Yamaoka * nnheader.el (nnheader-insert-head): Make it work with Mac as well. diff --git a/lisp/gnus/compface.el b/lisp/gnus/compface.el index f6bd9bfd720..33e05046e84 100644 --- a/lisp/gnus/compface.el +++ b/lisp/gnus/compface.el @@ -34,24 +34,28 @@ GNU/Linux system these might be in packages with names like `compface' or `faces-xface' and `netpbm' or `libgr-progs', for instance." (with-temp-buffer (insert face) - (and (eq 0 (apply 'call-process-region (point-min) (point-max) - "uncompface" - 'delete '(t nil) nil)) - (progn - (goto-char (point-min)) - (insert "/* Width=48, Height=48 */\n") - ;; I just can't get "icontopbm" to work correctly on its - ;; own in XEmacs. And Emacs doesn't understand un-raw pbm - ;; files. - (if (not (featurep 'xemacs)) - (eq 0 (call-process-region (point-min) (point-max) - "icontopbm" - 'delete '(t nil))) - (shell-command-on-region (point-min) (point-max) - "icontopbm | pnmnoraw" - (current-buffer) t) - t)) - (buffer-string)))) + (let ((coding-system-for-read 'raw-text) + ;; At least "icontopbm" doesn't work with Windows because + ;; the line-break code is converted into CRLF by default. + (coding-system-for-write 'binary)) + (and (eq 0 (apply 'call-process-region (point-min) (point-max) + "uncompface" + 'delete '(t nil) nil)) + (progn + (goto-char (point-min)) + (insert "/* Width=48, Height=48 */\n") + ;; I just can't get "icontopbm" to work correctly on its + ;; own in XEmacs. And Emacs doesn't understand un-raw pbm + ;; files. + (if (not (featurep 'xemacs)) + (eq 0 (call-process-region (point-min) (point-max) + "icontopbm" + 'delete '(t nil))) + (shell-command-on-region (point-min) (point-max) + "icontopbm | pnmnoraw" + (current-buffer) t) + t)) + (buffer-string))))) (provide 'compface) 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 @@ (subject (or (cdr (assq 'subject params)) "none")) (buf (current-buffer)) info) - (if (y-or-n-p (format "Send a request message to %s?" server)) + (if (y-or-n-p (format "Send a request message to %s? " server)) (save-window-excursion (message-mail server subject) (message-goto-body) diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index 79732cd3d88..82e1d3ab554 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -598,7 +598,7 @@ the line could be found." (nth 1 (mm-insert-file-contents file nil beg (incf beg nnheader-head-chop-length)))) - ;; CRLF of CR might be used for the line-break code. + ;; CRLF or CR might be used for the line-break code. (prog1 (not (re-search-forward "\n\r?\n\\|\r\r" nil t)) (goto-char (point-max))) (or (null nnheader-max-head-length) diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el index 7c0c8e0e444..d020d533aea 100644 --- a/lisp/gnus/nnweb.el +++ b/lisp/gnus/nnweb.el @@ -366,14 +366,15 @@ Valid types include `google', `dejanews', and `gmane'.") (mm-url-decode-entities) (search-backward " - ") (when (looking-at - " - \\([a-zA-Z]+\\) \\([0-9]+\\)\\(?: \\([0-9]\\{4\\}\\)\\)?[^\n]+by ?\n?\\([^<\n]+\\)\n") - (setq From (match-string 4) - Date (format "%s %s 00:00:00 %s" + "\\W+\\(\\w+\\) \\([0-9]+\\)\\(?: \\([0-9]\\{4\\}\\)\\)?") + (setq Date (format "%s %s 00:00:00 %s" (match-string 1) (match-string 2) (or (match-string 3) - (substring (current-time-string) -4))))) - + (substring (current-time-string) -4)))) + (goto-char (match-end 0))) + (when (looking-at "[^b]+by\\W+\\([^<\n]+\\)") + (setq From (match-string 1))) (widen) (forward-line 1) (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." (sort minor-modes (lambda (a b) (string-lessp (cadr a) (cadr b))))) (when minor-modes - (princ "Summary of minor modes:\n") + (princ "Enabled minor modes:\n") (make-local-variable 'help-button-cache) (with-current-buffer standard-output (dolist (mode minor-modes) (let ((mode-function (nth 0 mode)) (pretty-minor-mode (nth 1 mode)) (indicator (nth 2 mode))) - (setq indicator (if (zerop (length indicator)) - "no indicator" - (format "indicator%s" indicator))) (add-text-properties 0 (length pretty-minor-mode) '(face bold) pretty-minor-mode) (save-excursion @@ -840,16 +837,22 @@ whose documentation describes the minor mode." (push (point-marker) help-button-cache) ;; Document the minor modes fully. (insert pretty-minor-mode) - (princ (format " minor mode (%s):\n" indicator)) + (princ (format " minor mode (%s):\n" + (if (zerop (length indicator)) + "no indicator" + (format "indicator%s" + indicator)))) (princ (documentation mode-function))) - (princ " ") (insert-button pretty-minor-mode 'action (car help-button-cache) 'follow-link t 'help-echo "mouse-2, RET: show full information") - (princ (format " minor mode (%s):\n" indicator))))) - (princ "\n(Full information about these minor modes -follows the description of the major mode.)\n\n")) + (newline))) + (forward-line -1) + (fill-paragraph nil) + (forward-line 1)) + + (princ "\n(Information about these minor modes follows the major mode info.)\n\n")) ;; Document the major mode. (let ((mode mode-name)) (with-current-buffer standard-output diff --git a/lisp/info.el b/lisp/info.el index def9a12ab0f..34509e72f25 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -3806,6 +3806,8 @@ the variable `Info-file-list-for-emacs'." (setq other-tag (cond ((save-match-data (looking-back "\\ -;; Keywords: DNS, languages - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. - -;;; Commentary: - -;;; -;;; See the comments in ``define-derived-mode zone-mode'' -;;; (the last function in this file) -;;; for what this mode is and how to use it automatically. -;;; - -;;; -;;; Credits: -;;; Zone-mode was written by John Heidemann , -;;; with bug fixes from Simon Leinen . -;;; - -;;; Code: - -(defun zone-mode-update-serial () - "Update the serial number in a zone." - (interactive) - (save-excursion - (goto-char (point-min)) - (while (re-search-forward "\\b\\([0-9]+\\)\\([0-9][0-9]\\)\\([ \t]+;[ \t]+[Ss]erial\\)" (point-max) t) - (let* ((old-date (match-string 1)) - (old-seq (match-string 2)) - (old-seq-num (string-to-number (match-string 2))) - (old-flag (match-string 3)) - (cur-date (format-time-string "%Y%m%d")) - (new-seq - (cond - ((not (string= old-date cur-date)) - "00") ;; reset sequence number - ((>= old-seq-num 99) - (error "Serial number's sequence cannot increment beyond 99")) - (t - (format "%02d" (1+ old-seq-num))))) - (old-serial (concat old-date old-seq)) - (new-serial (concat cur-date new-seq))) - (if (string-lessp new-serial old-serial) - (error "Serial numbers want to move backwards from %s to %s" old-serial new-serial) - (replace-match (concat cur-date new-seq old-flag) t t)))))) - -;;;###autoload -(defun zone-mode-update-serial-hook () - "Update the serial number in a zone if the file was modified." - (interactive) - (if (buffer-modified-p (current-buffer)) - (zone-mode-update-serial)) - nil ;; so we can run from write-file-hooks - ) - -(defvar zone-mode-syntax-table nil - "Zone-mode's syntax table.") - -(defun zone-mode-load-time-setup () - "Initialize `zone-mode' stuff." - (setq zone-mode-syntax-table (make-syntax-table)) - (modify-syntax-entry ?\; "<" zone-mode-syntax-table) - (modify-syntax-entry ?\n ">" zone-mode-syntax-table)) - -;;;###autoload -(define-derived-mode zone-mode fundamental-mode "zone" - "A mode for editing DNS zone files. - -Zone-mode does two things: - - - automatically update the serial number for a zone - when saving the file - - - fontification" - - (add-hook 'write-file-functions 'zone-mode-update-serial-hook nil t) - - (if (null zone-mode-syntax-table) - (zone-mode-load-time-setup)) ;; should have been run at load-time - - ;; font-lock support: - (set-syntax-table zone-mode-syntax-table) - (make-local-variable 'comment-start) - (setq comment-start ";") - (make-local-variable 'comment-start-skip) - ;; Look within the line for a ; following an even number of backslashes - ;; after either a non-backslash or the line beginning. - (setq comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+[ \t]*") - (make-local-variable 'comment-column) - (setq comment-column 40) - (make-local-variable 'font-lock-defaults) - (setq font-lock-defaults - '(nil nil nil nil beginning-of-line))) - -(zone-mode-load-time-setup) - -(provide 'zone-mode) - -;;; arch-tag: 6a2940ef-fd4f-4de7-b979-b027b09821fe -;;; zone-mode.el ends here diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 5dfa1eb8959..358c834de73 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -599,11 +599,16 @@ If CONTINUE is non-nil, use the `comment-continue' markers if any." (if (and other (<= other max) (> other min)) ;; There is a comment and it's in the range: bingo. (setq indent other)))))))) + ;; Update INDENT to leave at least one space + ;; after other nonwhite text on the line. + (save-excursion + (skip-chars-backward " \t") + (unless (bolp) + (setq indent (max indent (1+ (current-column)))))) + ;; If that's different from comment's current position, change it. (unless (= (current-column) indent) - ;; If that's different from current, change it. (delete-region (point) (progn (skip-chars-backward " \t") (point))) - (indent-to (if (bolp) indent - (max indent (1+ (current-column))))))) + (indent-to indent))) (goto-char cpos) (set-marker cpos nil)))) 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." (interactive "DNew repository: ") (if (or (file-directory-p (expand-file-name "CVSROOT" newroot)) (y-or-n-p (concat "Warning: no CVSROOT found inside repository." - " Change cvs-cvsroot anyhow?"))) + " Change cvs-cvsroot anyhow? "))) (setq cvs-cvsroot newroot))) ;;;; diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index e6c6380bf88..b5334ba5bc5 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -115,6 +115,7 @@ address for root variables.") (defvar gdb-main-file nil "Source file from which program execution begins.") (defvar gud-old-arrow nil) (defvar gdb-overlay-arrow-position nil) +(defvar gdb-stack-position nil) (defvar gdb-server-prefix nil) (defvar gdb-flush-pending-output nil) (defvar gdb-location-alist nil @@ -321,7 +322,7 @@ of the inferior. Non-nil means display the layout shown for :version "22.1") (defcustom gdb-use-separate-io-buffer nil - "Non-nil means display output from the inferior in a separate buffer." + "Non-nil means display output from the debugged program in a separate buffer." :type 'boolean :group 'gud :version "22.1") @@ -353,14 +354,14 @@ With arg, display additional buffers iff arg is positive." (error nil)))) (defun gdb-use-separate-io-buffer (arg) - "Toggle separate IO for inferior. + "Toggle separate IO for debugged program. With arg, use separate IO iff arg is positive." (interactive "P") (setq gdb-use-separate-io-buffer (if (null arg) (not gdb-use-separate-io-buffer) (> (prefix-numeric-value arg) 0))) - (message (format "Separate inferior IO %sabled" + (message (format "Separate IO %sabled" (if gdb-use-separate-io-buffer "en" "dis"))) (if (and gud-comint-buffer (buffer-name gud-comint-buffer)) @@ -1030,7 +1031,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'." (minibuffer . nil))) (defun gdb-frame-separate-io-buffer () - "Display IO of inferior in a new frame." + "Display IO of debugged program in a new frame." (interactive) (if gdb-use-separate-io-buffer (let ((special-display-regexps (append special-display-regexps '(".*"))) @@ -1296,6 +1297,7 @@ not GDB." (setq gud-old-arrow gud-overlay-arrow-position) (setq gud-overlay-arrow-position nil) (setq gdb-overlay-arrow-position nil) + (setq gdb-stack-position nil) (if gdb-use-separate-io-buffer (setq gdb-output-sink 'inferior)))) (t @@ -1330,6 +1332,7 @@ directives." (setq gdb-active-process nil) (setq gud-overlay-arrow-position nil) (setq gdb-overlay-arrow-position nil) + (setq gdb-stack-position nil) (setq gud-old-arrow nil) (setq gdb-inferior-status "exited") (gdb-force-mode-line-update @@ -1776,9 +1779,8 @@ static char *magick[] = { (goto-char (point-min)) (while (< (point) (- (point-max) 1)) (forward-line 1) - (if (looking-at "[^\t].*?breakpoint") + (if (looking-at gdb-breakpoint-regexp) (progn - (looking-at "\\([0-9]+\\)\\s-+\\S-+\\s-+\\S-+\\s-+\\(.\\)") (setq bptno (match-string 1)) (setq flag (char-after (match-beginning 2))) (add-text-properties @@ -1786,43 +1788,55 @@ static char *magick[] = { (if (eq flag ?y) '(face font-lock-warning-face) '(face font-lock-type-face))) - (beginning-of-line) - (if (re-search-forward " in \\(.*\\) at\\s-+" nil t) - (progn + (let ((bl (point)) + (el (line-end-position))) + (if (re-search-forward " in \\(.*\\) at\\s-+" el t) + (progn + (add-text-properties + (match-beginning 1) (match-end 1) + '(face font-lock-function-name-face)) + (looking-at "\\(\\S-+\\):\\([0-9]+\\)") + (let ((line (match-string 2)) + (file (match-string 1))) + (add-text-properties bl el + '(mouse-face highlight + help-echo "mouse-2, RET: visit breakpoint")) + (unless (file-exists-p file) + (setq file (cdr (assoc bptno gdb-location-alist)))) + (if (and file + (not (string-equal file "File not found"))) + (with-current-buffer + (find-file-noselect file 'nowarn) + (set (make-local-variable 'gud-minor-mode) + 'gdba) + (set (make-local-variable 'tool-bar-map) + gud-tool-bar-map) + ;; Only want one breakpoint icon at each + ;; location. + (save-excursion + (goto-line (string-to-number line)) + (gdb-put-breakpoint-icon (eq flag ?y) bptno))) + (gdb-enqueue-input + (list + (concat gdb-server-prefix "list " + (match-string-no-properties 1) ":1\n") + 'ignore)) + (gdb-enqueue-input + (list (concat gdb-server-prefix "info source\n") + `(lambda () (gdb-get-location + ,bptno ,line ,flag))))))) + (if (re-search-forward + "<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" + el t) + (add-text-properties + (match-beginning 1) (match-end 1) + '(face font-lock-function-name-face)) + (end-of-line) + (re-search-backward "\\s-\\(\\S-*\\)" + bl t) (add-text-properties (match-beginning 1) (match-end 1) - '(face font-lock-function-name-face)) - (looking-at "\\(\\S-+\\):\\([0-9]+\\)") - (let ((line (match-string 2)) - (file (match-string 1))) - (add-text-properties (line-beginning-position) - (line-end-position) - '(mouse-face highlight - help-echo "mouse-2, RET: visit breakpoint")) - (unless (file-exists-p file) - (setq file (cdr (assoc bptno gdb-location-alist)))) - (if (and file - (not (string-equal file "File not found"))) - (with-current-buffer - (find-file-noselect file 'nowarn) - (set (make-local-variable 'gud-minor-mode) - 'gdba) - (set (make-local-variable 'tool-bar-map) - gud-tool-bar-map) - ;; Only want one breakpoint icon at each - ;; location. - (save-excursion - (goto-line (string-to-number line)) - (gdb-put-breakpoint-icon (eq flag ?y) bptno))) - (gdb-enqueue-input - (list - (concat gdb-server-prefix "list " - (match-string-no-properties 1) ":1\n") - 'ignore)) - (gdb-enqueue-input - (list (concat gdb-server-prefix "info source\n") - `(lambda () (gdb-get-location - ,bptno ,line ,flag)))))))))) + '(face font-lock-variable-name-face))))))) (end-of-line)))))) (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))) @@ -2026,8 +2040,14 @@ static char *magick[] = { (goto-char bl) (when (looking-at "^#\\([0-9]+\\)") (when (string-equal (match-string 1) gdb-frame-number) - (put-text-property bl (+ bl 4) - 'face '(:inverse-video t))) + (if (> (car (window-fringes)) 0) + (progn + (or gdb-stack-position + (setq gdb-stack-position (make-marker))) + (set-marker gdb-stack-position (point))) + (set-marker gdb-stack-position nil) + (put-text-property bl (+ bl 4) + 'face '(:inverse-video t)))) (when (re-search-forward (concat (if (string-equal (match-string 1) "0") "" " in ") @@ -2098,6 +2118,8 @@ static char *magick[] = { (kill-all-local-variables) (setq major-mode 'gdb-frames-mode) (setq mode-name "Frames") + (setq gdb-stack-position nil) + (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position) (setq buffer-read-only t) (use-local-map gdb-frames-mode-map) (run-mode-hooks 'gdb-frames-mode-hook) @@ -2549,18 +2571,18 @@ corresponding to the mode line clicked." 'local-map (gdb-make-header-line-mouse-map 'mouse-1 - #'(lambda () (interactive) - (let ((gdb-memory-address - ;; Let GDB do the arithmetic. - (concat - gdb-memory-address " - " - (number-to-string - (* gdb-memory-repeat-count - (cond ((string= gdb-memory-unit "b") 1) - ((string= gdb-memory-unit "h") 2) - ((string= gdb-memory-unit "w") 4) - ((string= gdb-memory-unit "g") 8))))))) - (gdb-invalidate-memory))))) + (lambda () (interactive) + (let ((gdb-memory-address + ;; Let GDB do the arithmetic. + (concat + gdb-memory-address " - " + (number-to-string + (* gdb-memory-repeat-count + (cond ((string= gdb-memory-unit "b") 1) + ((string= gdb-memory-unit "h") 2) + ((string= gdb-memory-unit "w") 4) + ((string= gdb-memory-unit "g") 8))))))) + (gdb-invalidate-memory))))) "|" (propertize "+" 'face font-lock-warning-face @@ -2568,9 +2590,9 @@ corresponding to the mode line clicked." 'mouse-face 'mode-line-highlight 'local-map (gdb-make-header-line-mouse-map 'mouse-1 - #'(lambda () (interactive) - (let ((gdb-memory-address nil)) - (gdb-invalidate-memory))))) + (lambda () (interactive) + (let ((gdb-memory-address nil)) + (gdb-invalidate-memory))))) "]: " (propertize gdb-memory-address 'face font-lock-warning-face @@ -2635,13 +2657,13 @@ corresponding to the mode line clicked." (defvar gdb-locals-watch-map (let ((map (make-sparse-keymap))) - (define-key map "\r" '(lambda () (interactive) - (beginning-of-line) - (gud-watch))) - (define-key map [mouse-2] '(lambda (event) (interactive "e") - (mouse-set-point event) - (beginning-of-line) - (gud-watch))) + (define-key map "\r" (lambda () (interactive) + (beginning-of-line) + (gud-watch))) + (define-key map [mouse-2] (lambda (event) (interactive "e") + (mouse-set-point event) + (beginning-of-line) + (gud-watch))) map) "Keymap to create watch expression of a complex data type local variable.") @@ -2764,7 +2786,7 @@ corresponding to the mode line clicked." (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer)) (define-key menu [threads] '("Threads" . gdb-display-threads-buffer)) (define-key menu [inferior] - '(menu-item "Inferior IO" gdb-display-separate-io-buffer + '(menu-item "Separate IO" gdb-display-separate-io-buffer :enable gdb-use-separate-io-buffer)) (define-key menu [memory] '("Memory" . gdb-display-memory-buffer)) (define-key menu [registers] '("Registers" . gdb-display-registers-buffer)) @@ -2783,7 +2805,7 @@ corresponding to the mode line clicked." (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer)) (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer)) (define-key menu [inferior] - '(menu-item "Inferior IO" gdb-frame-separate-io-buffer + '(menu-item "Separate IO" gdb-frame-separate-io-buffer :enable gdb-use-separate-io-buffer)) (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer)) @@ -2802,9 +2824,9 @@ corresponding to the mode line clicked." :help "Toggle look for source frame." :button (:toggle . gdb-find-source-frame))) (define-key menu [gdb-use-separate-io] - '(menu-item "Separate Inferior IO" gdb-use-separate-io-buffer + '(menu-item "Separate IO" gdb-use-separate-io-buffer :visible (eq gud-minor-mode 'gdba) - :help "Toggle separate IO for inferior." + :help "Toggle separate IO for debugged program." :button (:toggle . gdb-use-separate-io-buffer))) (define-key menu [gdb-many-windows] '(menu-item "Display Other Windows" gdb-many-windows @@ -2901,12 +2923,13 @@ Kills the gdb buffers, and resets variables and the source buffers." (setq gud-minor-mode nil) (kill-local-variable 'tool-bar-map) (kill-local-variable 'gdb-define-alist)))))) - (when (markerp gdb-overlay-arrow-position) - (move-marker gdb-overlay-arrow-position nil) - (setq gdb-overlay-arrow-position nil)) + (setq gdb-overlay-arrow-position nil) (setq overlay-arrow-variable-list (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)) (setq fringe-indicator-alist '((overlay-arrow . right-triangle))) + (setq gdb-stack-position nil) + (setq overlay-arrow-variable-list + (delq 'gdb-stack-position overlay-arrow-variable-list)) (if (boundp 'speedbar-frame) (speedbar-timer-fn)) (setq gud-running nil) (setq gdb-active-process nil) @@ -3128,8 +3151,7 @@ BUFFER nil or omitted means use the current buffer." '((overlay-arrow . hollow-right-triangle)))) (or gdb-overlay-arrow-position (setq gdb-overlay-arrow-position (make-marker))) - (set-marker gdb-overlay-arrow-position - (point) (current-buffer)))))) + (set-marker gdb-overlay-arrow-position (point)))))) ;; remove all breakpoint-icons in assembler buffer before updating. (gdb-remove-breakpoint-icons (point-min) (point-max)))) (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 97e54135a6f..84b40e8ba80 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -3180,7 +3180,15 @@ class of the file (using s to separate nested class ids)." (defvar gdb-script-font-lock-syntactic-keywords '(("^document\\s-.*\\(\n\\)" (1 "< b")) ;; It would be best to change the \n in front, but it's more difficult. - ("^en\\(d\\)\\>" (1 "> b")))) + ("^end\\>" + (0 (progn + (unless (eq (match-beginning 0) (point-min)) + (put-text-property (1- (match-beginning 0)) (match-beginning 0) + 'syntax-table (eval-when-compile + (string-to-syntax "> b"))) + (put-text-property (1- (match-beginning 0)) (match-end 0) + 'font-lock-multiline t) + nil)))))) (defun gdb-script-font-lock-syntactic-face (state) (cond diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index f748bb4b040..a08f999f089 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -986,7 +986,9 @@ subshells can nest." ;; FIXME: This can (and often does) match multiple lines, yet it makes no ;; effort to handle multiline cases correctly, so it ends up being ;; rather flakey. - (when (re-search-forward "\"\\(?:\\(?:.\\|\n\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" limit t) + (when (and (re-search-forward "\"\\(?:\\(?:.\\|\n\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" limit t) + ;; Make sure the " we matched is an opening quote. + (eq ?\" (nth 3 (syntax-ppss)))) ;; bingo we have a $( or a ` inside a "" (let ((char (char-after (point))) (continue t) @@ -1081,9 +1083,6 @@ This is used to flag quote characters in subshell constructs inside strings ("\\(\\\\\\)'" 1 ,sh-st-punc) ;; Make sure $@ and @? are correctly recognized as sexps. ("\\$\\([?@]\\)" 1 ,sh-st-symbol) - ;; highlight (possibly nested) subshells inside "" quoted regions correctly. - (sh-quoted-subshell - (1 (sh-apply-quoted-subshell) t t)) ;; Find HEREDOC starters and add a corresponding rule for the ender. (sh-font-lock-here-doc (2 (sh-font-lock-open-heredoc @@ -1093,7 +1092,11 @@ This is used to flag quote characters in subshell constructs inside strings (and (match-beginning 3) (/= (match-beginning 3) (match-end 3)))) nil t)) ;; Distinguish the special close-paren in `case'. - (")" 0 (sh-font-lock-paren (match-beginning 0))))) + (")" 0 (sh-font-lock-paren (match-beginning 0))) + ;; highlight (possibly nested) subshells inside "" quoted regions correctly. + ;; This should be at the very end because it uses syntax-ppss. + (sh-quoted-subshell + (1 (sh-apply-quoted-subshell) t t)))) (defun sh-font-lock-syntactic-face-function (state) (let ((q (nth 3 state))) diff --git a/lisp/simple.el b/lisp/simple.el index 204684a3d5b..86b3af702e4 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3697,7 +3697,10 @@ because what we really need is for `move-to-column' and `current-column' to be able to ignore invisible text." (if (zerop col) (beginning-of-line) - (move-to-column col)) + (let ((opoint (point))) + (move-to-column col) + ;; move-to-column doesn't respect field boundaries. + (goto-char (constrain-to-field (point) opoint)))) (when (and line-move-ignore-invisible (not (bolp)) (line-move-invisible-p (1- (point)))) @@ -3767,7 +3770,8 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." (interactive "p") (or arg (setq arg 1)) - (let ((orig (point))) + (let ((orig (point)) + start first-vis first-vis-field-value) ;; Move by lines, if ARG is not 1 (the default). (if (/= arg 1) @@ -3778,10 +3782,24 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) (goto-char (previous-char-property-change (point))) (skip-chars-backward "^\n")) + (setq start (point)) - ;; Take care of fields. - (goto-char (constrain-to-field (point) orig - (/= arg 1) t nil)))) + ;; Now find first visible char in the line + (while (and (not (eobp)) (line-move-invisible-p (point))) + (goto-char (next-char-property-change (point)))) + (setq first-vis (point)) + + ;; See if fields would stop us from reaching FIRST-VIS. + (setq first-vis-field-value + (constrain-to-field first-vis orig (/= arg 1) t nil)) + + (goto-char (if (/= first-vis-field-value first-vis) + ;; If yes, obey them. + first-vis-field-value + ;; Otherwise, move to START with attention to fields. + ;; (It is possible that fields never matter in this case.) + (constrain-to-field (point) orig + (/= arg 1) t nil))))) ;;; Many people have said they rarely use this feature, and often type diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 21515e02612..9229ec549e6 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -2484,7 +2484,7 @@ order until succeed.") ;; Override Paste so it looks at CLIPBOARD first. (defun x-clipboard-yank () "Insert the clipboard contents, or the last stretch of killed text." - (interactive) + (interactive "*") (let ((clipboard-text (x-selection-value 'CLIPBOARD)) (x-select-enable-clipboard t)) (if (and clipboard-text (> (length clipboard-text) 0)) @@ -2492,12 +2492,13 @@ order until succeed.") (yank))) (define-key menu-bar-edit-menu [paste] - (cons "Paste" (cons "Paste text from clipboard or kill ring" - 'x-clipboard-yank))) + '(menu-item "Paste" x-clipboard-yank + :enable (not buffer-read-only) + :help "Paste (yank) text most recently cut/copied")) ;; Initiate drag and drop (add-hook 'after-make-frame-functions 'x-dnd-init-frame) -(global-set-key [drag-n-drop] 'x-dnd-handle-drag-n-drop-event) +(define-key special-event-map [drag-n-drop] 'x-dnd-handle-drag-n-drop-event) ;; Let F10 do menu bar navigation. (and (fboundp 'menu-bar-open) diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 7622f23752b..9ea51a2f774 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -228,8 +228,37 @@ (define-key map "\e[4~" [select]) (define-key map "\e[29~" [print]) - ;; These keys are available in xterm starting from version 214 + ;; These keys are available in xterm starting from version 216 ;; if the modifyOtherKeys resource is set to 1. + + (define-key map "\e[27;5;39~" [?\C-\']) + (define-key map "\e[27;5;45~" [?\C--]) + + (define-key map "\e[27;5;48~" [?\C-0]) + (define-key map "\e[27;5;49~" [?\C-1]) + ;; Not all C-DIGIT keys have a distinct binding. + (define-key map "\e[27;5;57~" [?\C-9]) + + (define-key map "\e[27;5;59~" [?\C-\;]) + (define-key map "\e[27;5;61~" [?\C-=]) + + + (define-key map "\e[27;6;33~" [?\C-!]) + (define-key map "\e[27;6;34~" [?\C-\"]) + (define-key map "\e[27;6;35~" [?\C-#]) + (define-key map "\e[27;6;36~" [?\C-$]) + (define-key map "\e[27;6;37~" [?\C-%]) + (define-key map "\e[27;6;38~" [(C-&)]) + (define-key map "\e[27;6;40~" [?\C-(]) + (define-key map "\e[27;6;41~" [?\C-)]) + (define-key map "\e[27;6;42~" [?\C-*]) + (define-key map "\e[27;6;43~" [?\C-+]) + + (define-key map "\e[27;6;58~" [?\C-:]) + (define-key map "\e[27;6;60~" [?\C-<]) + (define-key map "\e[27;6;62~" [?\C->]) + (define-key map "\e[27;6;63~" [(C-\?)]) + (define-key map "\e[27;5;9~" [C-tab]) (define-key map "\e[27;5;13~" [C-return]) (define-key map "\e[27;5;44~" [?\C-,]) diff --git a/lisp/textmodes/dns-mode.el b/lisp/textmodes/dns-mode.el index a323d4c4468..21fe137118f 100644 --- a/lisp/textmodes/dns-mode.el +++ b/lisp/textmodes/dns-mode.el @@ -90,6 +90,18 @@ :type 'sexp :group 'dns-mode) +(defcustom dns-mode-soa-auto-increment-serial t + "Whether to increment the SOA serial number automatically. + +If this variable is t, the serial number is incremented upon each save of +the file. If it is `ask', Emacs asks for confirmation whether it should +increment the serial upon saving. If nil, serials must be incremented +manually with \\[dns-mode-soa-increment-serial]." + :type '(choice (const :tag "Always" t) + (const :tag "Ask" ask) + (const :tag "Never" nil)) + :group 'dns-mode) + ;; Syntax table. (defvar dns-mode-syntax-table @@ -135,8 +147,12 @@ Turning on DNS mode runs `dns-mode-hook'." (unless (featurep 'xemacs) (set (make-local-variable 'font-lock-defaults) '(dns-mode-font-lock-keywords nil nil ((?_ . "w"))))) + (add-hook 'before-save-hook 'dns-mode-soa-maybe-increment-serial + nil t) (easy-menu-add dns-mode-menu dns-mode-map)) +;;;###autoload (defalias 'zone-mode 'dns-mode) + ;; Tools. ;;;###autoload @@ -192,6 +208,21 @@ Turning on DNS mode runs `dns-mode-hook'." (message "Replaced old serial %s with %s" serial new)) (error "Cannot locate serial number in SOA record")))))) +(defun dns-mode-soa-maybe-increment-serial () + "Increment SOA serial if needed. + +This function is run from `before-save-hook'." + (when (and (buffer-modified-p) + dns-mode-soa-auto-increment-serial + (or (eq dns-mode-soa-auto-increment-serial t) + (y-or-n-p "Increment SOA serial? "))) + ;; If `dns-mode-soa-increment-serial' signals an error saving will + ;; fail but that probably means that the serial should be fixed to + ;; comply with the RFC anyway! -rfr + (progn (dns-mode-soa-increment-serial) + ;; We return nil in case this is used in write-contents-functions. + nil))) + ;;;###autoload(add-to-list 'auto-mode-alist '("\\.soa\\'" . dns-mode)) (provide 'dns-mode) diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el index 4cda0d6b3a0..1fcac6855d9 100644 --- a/lisp/textmodes/org.el +++ b/lisp/textmodes/org.el @@ -5,7 +5,7 @@ ;; Author: Carsten Dominik ;; Keywords: outlines, hypermedia, calendar, wp ;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ -;; Version: 4.43 +;; Version: 4.44 ;; ;; This file is part of GNU Emacs. ;; @@ -90,10 +90,12 @@ ;; ;; Recent changes ;; -------------- -;; Version 4.43 -;; - Big fixes +;; Version 4.44 +;; - Clock table can be done for a limited time interval. +;; - Obsolete support for the old outline mode has been removed. +;; - Bug fixes and code cleaning. ;; -;; Version 4.42 +;; Version 4.43 ;; - Bug fixes ;; - `s' key in the agenda saves all org-mode buffers. ;; @@ -212,16 +214,13 @@ ;;; Customization variables -(defvar org-version "4.43" +(defvar org-version "4.44" "The version number of the file org.el.") (defun org-version () (interactive) (message "Org-mode version %s" org-version)) -;; The following constant is for compatibility with different versions -;; of outline.el. -(defconst org-noutline-p (featurep 'noutline) - "Are we using the new outline mode?") +;; Compatibility constants (defconst org-xemacs-p (featurep 'xemacs)) ; not used by org.el itself (defconst org-format-transports-properties-p (let ((x "a")) @@ -1132,7 +1131,7 @@ files and the cdr the corresponding command. Possible values for the file identifier are \"ext\" A string identifying an extension `directory' Matches a directory - `remote' Matches a remove file, accessible through tramp or efs. + `remote' Matches a remote file, accessible through tramp or efs. Remote files most likely should be visited through emacs because external applications cannot handle such paths. t Default for all remaining files @@ -1831,6 +1830,7 @@ Org-mode files lives." (defcustom org-export-language-setup '(("en" "Author" "Date" "Table of Contents") + ("cs" "Autor" "Datum" "Obsah") ("da" "Ophavsmand" "Dato" "Indhold") ("de" "Autor" "Datum" "Inhaltsverzeichnis") ("es" "Autor" "Fecha" "\xccndice") @@ -2150,6 +2150,16 @@ you can \"misuse\" it to add arbitrary text to the header." :group 'org-export-html :type 'string) +(defcustom org-export-html-title-format "

%s

\n" + "Format for typesetting the document title in HTML export." + :group 'org-export-html + :type 'string) + +(defcustom org-export-html-toplevel-hlevel 2 + "The level for level 1 headings in HTML export." + :group 'org-export-html + :type 'string) + (defcustom org-export-html-link-org-files-as-html t "Non-nil means, make file links to `file.org' point to `file.html'. 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.") (remove-text-properties 0 (length s) org-rm-props s) s) +(defsubst org-set-local (var value) + "Make VAR local in current buffer and set it to VALUE." + (set (make-variable-buffer-local var) value)) + (defsubst org-mode-p () "Check if the current buffer is in Org-mode." (eq major-mode 'org-mode)) @@ -2703,7 +2717,7 @@ Also put tags into group 4 if tags are present.") (when (org-mode-p) (let ((re (org-make-options-regexp '("CATEGORY" "SEQ_TODO" "PRI_TODO" "TYP_TODO" - "STARTUP" "ARCHIVE" "TAGS"))) + "STARTUP" "ARCHIVE" "TAGS" "CALC"))) (splitre "[ \t]+") kwds int key value cat arch tags) (save-excursion @@ -2755,10 +2769,10 @@ Also put tags into group 4 if tags are present.") (remove-text-properties 0 (length arch) '(face t fontified t) arch))) ))) - (and cat (set (make-local-variable 'org-category) cat)) - (and kwds (set (make-local-variable 'org-todo-keywords) kwds)) - (and arch (set (make-local-variable 'org-archive-location) arch)) - (and int (set (make-local-variable 'org-todo-interpretation) int)) + (and cat (org-set-local 'org-category cat)) + (and kwds (org-set-local 'org-todo-keywords kwds)) + (and arch (org-set-local 'org-archive-location arch)) + (and int (org-set-local 'org-todo-interpretation int)) (when tags (let (e tgs) (while (setq e (pop tags)) @@ -2770,7 +2784,7 @@ Also put tags into group 4 if tags are present.") (string-to-char (match-string 2 e))) tgs)) (t (push (list e) tgs)))) - (set (make-local-variable 'org-tag-alist) nil) + (org-set-local 'org-tag-alist nil) (while (setq e (pop tgs)) (or (and (stringp (car e)) (assoc (car e) org-tag-alist)) @@ -2928,15 +2942,11 @@ The following commands are available: ;; Need to do this here because define-derived-mode sets up ;; the keymap so late. (if (featurep 'xemacs) - (if org-noutline-p - (progn - (easy-menu-remove outline-mode-menu-heading) - (easy-menu-remove outline-mode-menu-show) - (easy-menu-remove outline-mode-menu-hide)) - (delete-menu-item '("Headings")) - (delete-menu-item '("Show")) - (delete-menu-item '("Hide")) - (set-menubar-dirty-flag)) + (progn + ;; Assume this is Greg's port, it used easymenu + (easy-menu-remove outline-mode-menu-heading) + (easy-menu-remove outline-mode-menu-show) + (easy-menu-remove outline-mode-menu-hide)) (define-key org-mode-map [menu-bar headings] 'undefined) (define-key org-mode-map [menu-bar hide] 'undefined) (define-key org-mode-map [menu-bar show] 'undefined)) @@ -2947,7 +2957,7 @@ The following commands are available: (if org-descriptive-links (org-add-to-invisibility-spec '(org-link))) (org-add-to-invisibility-spec '(org-cwidth)) (when (featurep 'xemacs) - (set (make-local-variable 'line-move-ignore-invisible) t)) + (org-set-local 'line-move-ignore-invisible t)) (setq outline-regexp "\\*+") ;;(setq outline-regexp "\\(?:\\*+\\|[ \t]*\\(?:[-+*]\\|[0-9]+[.)]\\) \\)") (setq outline-level 'org-outline-level) @@ -2958,12 +2968,14 @@ The following commands are available: 4 (string-to-vector org-ellipsis)) (setq buffer-display-table org-display-table)) (org-set-regexps-and-options) + ;; Calc embedded + (org-set-local 'calc-embedded-open-mode "# ") (modify-syntax-entry ?# "<") (if org-startup-truncated (setq truncate-lines t)) - (set (make-local-variable 'font-lock-unfontify-region-function) - 'org-unfontify-region) + (org-set-local 'font-lock-unfontify-region-function + 'org-unfontify-region) ;; Activate before-change-function - (set (make-local-variable 'org-table-may-need-update) t) + (org-set-local 'org-table-may-need-update t) (org-add-hook 'before-change-functions 'org-before-change-function nil 'local) ;; Check for running clock before killing a buffer @@ -3107,7 +3119,7 @@ that will be added to PLIST. Returns the string that was modified." org-ts-regexp "\\)?") "Regular expression matching a time stamp or time stamp range.") -(defvar org-§emph-face nil) +(defvar org-§emph-face nil) (defun org-do-emphasis-faces (limit) "Run through the buffer and add overlays to links." @@ -3340,10 +3352,9 @@ between words." ))) (setq org-font-lock-extra-keywords (delq nil org-font-lock-extra-keywords)) ;; Now set the full font-lock-keywords - (set (make-local-variable 'org-font-lock-keywords) - org-font-lock-extra-keywords) - (set (make-local-variable 'font-lock-defaults) - '(org-font-lock-keywords t nil nil backward-paragraph)) + (org-set-local 'org-font-lock-keywords org-font-lock-extra-keywords) + (org-set-local 'font-lock-defaults + '(org-font-lock-keywords t nil nil backward-paragraph)) (kill-local-variable 'font-lock-keywords) nil)) (defvar org-m nil) @@ -3812,9 +3823,7 @@ state (TODO by default). Also with prefix arg, force first state." (org-insert-heading) (save-excursion (org-back-to-heading) - (if org-noutline-p - (outline-previous-heading) - (outline-previous-visible-heading t)) + (outline-previous-heading) (looking-at org-todo-line-regexp)) (if (or arg (not (match-beginning 2)) @@ -4703,7 +4712,7 @@ the children that do not contain any open TODO items." (pc '(:org-comment t)) (pall '(:org-archived t :org-comment t)) (rea (concat ":" org-archive-tag ":")) - bmp file re) + bmp file re) (save-excursion (while (setq file (pop files)) (org-check-agenda-file file) @@ -4775,7 +4784,7 @@ If not found, stay at current position and return nil." pos)) (defconst org-dblock-start-re - "^#\\+BEGIN:[ \t]+\\(\\S-+\\)[ \t]+\\(.*\\)" + "^#\\+BEGIN:[ \t]+\\(\\S-+\\)\\([ \t]+\\(.*\\)\\)?" "Matches the startline of a dynamic block, with parameters.") (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." (let* ((begdel (1+ (match-end 0))) (name (match-string 1)) (params (append (list :name name) - (read (concat "(" (match-string 2) ")"))))) + (read (concat "(" (match-string 3) ")"))))) (unless (re-search-forward org-dblock-end-re nil t) (error "Dynamic block not terminated")) (delete-region begdel (match-beginning 0)) @@ -5200,7 +5209,6 @@ If CALLBACK is non-nil, it is a function which is called to confirm that the match should indeed be shown." (interactive "sRegexp: ") (org-remove-occur-highlights nil nil t) - (setq regexp (org-check-occur-regexp regexp)) (let ((cnt 0)) (save-excursion (goto-char (point-min)) @@ -5625,56 +5633,58 @@ next column. For time difference computation, a year is assumed to be exactly 365 days in order to avoid rounding problems." (interactive "P") - (save-excursion - (unless (org-at-date-range-p) - (goto-char (point-at-bol)) - (re-search-forward org-tr-regexp (point-at-eol) t)) - (if (not (org-at-date-range-p)) - (error "Not at a time-stamp range, and none found in current line"))) - (let* ((ts1 (match-string 1)) - (ts2 (match-string 2)) - (havetime (or (> (length ts1) 15) (> (length ts2) 15))) - (match-end (match-end 0)) - (time1 (org-time-string-to-time ts1)) - (time2 (org-time-string-to-time ts2)) - (t1 (time-to-seconds time1)) - (t2 (time-to-seconds time2)) - (diff (abs (- t2 t1))) - (negative (< (- t2 t1) 0)) - ;; (ys (floor (* 365 24 60 60))) - (ds (* 24 60 60)) - (hs (* 60 60)) - (fy "%dy %dd %02d:%02d") - (fy1 "%dy %dd") - (fd "%dd %02d:%02d") - (fd1 "%dd") - (fh "%02d:%02d") - y d h m align) - (if havetime - (setq ; y (floor (/ diff ys)) diff (mod diff ys) - y 0 - d (floor (/ diff ds)) diff (mod diff ds) - h (floor (/ diff hs)) diff (mod diff hs) - m (floor (/ diff 60))) - (setq ; y (floor (/ diff ys)) diff (mod diff ys) - y 0 - d (floor (+ (/ diff ds) 0.5)) - h 0 m 0)) - (if (not to-buffer) - (message (org-make-tdiff-string y d h m)) - (when (org-at-table-p) - (goto-char match-end) - (setq align t) - (and (looking-at " *|") (goto-char (match-end 0)))) - (if (looking-at - "\\( *-? *[0-9]+y\\)?\\( *[0-9]+d\\)? *[0-9][0-9]:[0-9][0-9]") - (replace-match "")) - (if negative (insert " -")) - (if (> y 0) (insert " " (format (if havetime fy fy1) y d h m)) - (if (> d 0) (insert " " (format (if havetime fd fd1) d h m)) - (insert " " (format fh h m)))) - (if align (org-table-align)) - (message "Time difference inserted")))) + (or + (org-clock-update-time-maybe) + (save-excursion + (unless (org-at-date-range-p) + (goto-char (point-at-bol)) + (re-search-forward org-tr-regexp (point-at-eol) t)) + (if (not (org-at-date-range-p)) + (error "Not at a time-stamp range, and none found in current line"))) + (let* ((ts1 (match-string 1)) + (ts2 (match-string 2)) + (havetime (or (> (length ts1) 15) (> (length ts2) 15))) + (match-end (match-end 0)) + (time1 (org-time-string-to-time ts1)) + (time2 (org-time-string-to-time ts2)) + (t1 (time-to-seconds time1)) + (t2 (time-to-seconds time2)) + (diff (abs (- t2 t1))) + (negative (< (- t2 t1) 0)) + ;; (ys (floor (* 365 24 60 60))) + (ds (* 24 60 60)) + (hs (* 60 60)) + (fy "%dy %dd %02d:%02d") + (fy1 "%dy %dd") + (fd "%dd %02d:%02d") + (fd1 "%dd") + (fh "%02d:%02d") + y d h m align) + (if havetime + (setq ; y (floor (/ diff ys)) diff (mod diff ys) + y 0 + d (floor (/ diff ds)) diff (mod diff ds) + h (floor (/ diff hs)) diff (mod diff hs) + m (floor (/ diff 60))) + (setq ; y (floor (/ diff ys)) diff (mod diff ys) + y 0 + d (floor (+ (/ diff ds) 0.5)) + h 0 m 0)) + (if (not to-buffer) + (message (org-make-tdiff-string y d h m)) + (when (org-at-table-p) + (goto-char match-end) + (setq align t) + (and (looking-at " *|") (goto-char (match-end 0)))) + (if (looking-at + "\\( *-? *[0-9]+y\\)?\\( *[0-9]+d\\)? *[0-9][0-9]:[0-9][0-9]") + (replace-match "")) + (if negative (insert " -")) + (if (> y 0) (insert " " (format (if havetime fy fy1) y d h m)) + (if (> d 0) (insert " " (format (if havetime fd fd1) d h m)) + (insert " " (format fh h m)))) + (if align (org-table-align)) + (message "Time difference inserted"))))) (defun org-make-tdiff-string (y d h m) (let ((fmt "") @@ -5817,6 +5827,7 @@ in the timestamp determines what will be changed." (setcar (nthcdr 2 time0) (or (nth 1 time0) 0)) (setq time (apply 'encode-time time0)))) (insert (setq org-last-changed-timestamp (format-time-string fmt time))) + (org-clock-update-time-maybe) (goto-char pos) ;; Try to recenter the calendar window, if any (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." "Holds the file total time in minutes, after a call to `org-clock-sum'.") (make-variable-buffer-local 'org-clock-file-total-minutes) -(defun org-clock-sum () +(defun org-clock-sum (&optional tstart tend) "Sum the times for each subtree. Puts the resulting times in minutes as a text property on each headline." (interactive) (let* ((bmp (buffer-modified-p)) (re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*" org-clock-string - ".*=>[ \t]*\\([0-9]+\\):\\([0-9]+\\)[ \t]*$")) + "[ \t]*\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)")) (lmax 30) (ltimes (make-vector lmax 0)) (t1 0) (level 0) + ts te dt time) (remove-text-properties (point-min) (point-max) '(:org-clock-minutes t)) (save-excursion @@ -5956,8 +5968,16 @@ Puts the resulting times in minutes as a text property on each headline." (while (re-search-backward re nil t) (if (match-end 2) ;; A time - (setq t1 (+ t1 (* 60 (string-to-number (match-string 2))) - (string-to-number (match-string 3)))) + (setq ts (match-string 2) + te (match-string 3) + ts (time-to-seconds + (apply 'encode-time (org-parse-time-string ts))) + te (time-to-seconds + (apply 'encode-time (org-parse-time-string te))) + ts (if tstart (max ts tstart) ts) + te (if tend (min te tend) te) + dt (- te ts) + t1 (if (> dt 0) (+ t1 (floor (/ dt 60))) t1)) ;; A headline (setq level (- (match-end 1) (match-beginning 1))) (when (or (> t1 0) (> (aref ltimes level) 0)) @@ -6069,26 +6089,112 @@ The BEGIN line can contain parameters. Allowed are: (interactive) (org-remove-clock-overlays) (unless (org-find-dblock "clocktable") - (org-create-dblock (list :name "clocktable" - :maxlevel 2 :emphasize nil))) + (org-create-dblock (list :name "clocktable" + :maxlevel 2 :emphasize nil))) (org-update-dblock)) +(defun org-clock-update-time-maybe () + "If this is a CLOCK line, update it and return t. +Otherwise, return nil." + (interactive) + (save-excursion + (beginning-of-line 1) + (skip-chars-forward " \t") + (when (looking-at org-clock-string) + (let ((re (concat "[ \t]*" org-clock-string + " *[[<]\\([^]>]+\\)[]>]-+[[<]\\([^]>]+\\)[]>]" + "\\([ \t]*=>.*\\)?")) + ts te h m s) + (if (not (looking-at re)) + nil + (and (match-end 3) (delete-region (match-beginning 3) (match-end 3))) + (end-of-line 1) + (setq ts (match-string 1) + te (match-string 2)) + (setq s (- (time-to-seconds + (apply 'encode-time (org-parse-time-string te))) + (time-to-seconds + (apply 'encode-time (org-parse-time-string ts)))) + h (floor (/ s 3600)) + s (- s (* 3600 h)) + m (floor (/ s 60)) + s (- s (* 60 s))) + (insert " => " (format "%2d:%02d" h m)) + t))))) + +(defun org-clock-special-range (key &optional time as-strings) + "Return two times bordering a special time range. +Key is a symbol specifying the range and can be one of `today', `yesterday', +`thisweek', `lastweek', `thismonth', `lastmonth', `thisyear', `lastyear'. +A week starts Monday 0:00 and ends Sunday 24:00. +The range is determined relative to TIME. TIME defaults to the current time. +The return value is a cons cell with two internal times like the ones +returned by `current time' or `encode-time'. if AS-STRINGS is non-nil, +the returned times will be formatted strings." + (let* ((tm (decode-time (or time (current-time)))) + (s 0) (m (nth 1 tm)) (h (nth 2 tm)) + (d (nth 3 tm)) (month (nth 4 tm)) (y (nth 5 tm)) + (dow (nth 6 tm)) + s1 m1 h1 d1 month1 y1 diff ts te fm) + (cond + ((eq key 'today) + (setq h 0 m 0 h1 24 m1 0)) + ((eq key 'yesterday) + (setq d (1- d) h 0 m 0 h1 24 m1 0)) + ((eq key 'thisweek) + (setq diff (if (= dow 0) 6 (1- dow)) + m 0 h 0 d (- d diff) d1 (+ 7 d))) + ((eq key 'lastweek) + (setq diff (+ 7 (if (= dow 0) 6 (1- dow))) + m 0 h 0 d (- d diff) d1 (+ 7 d))) + ((eq key 'thismonth) + (setq d 1 h 0 m 0 d1 1 month1 (1+ month) h1 0 m1 0)) + ((eq key 'lastmonth) + (setq d 1 h 0 m 0 d1 1 month (1- month) month1 (1+ month) h1 0 m1 0)) + ((eq key 'thisyear) + (setq m 0 h 0 d 1 month 1 y1 (1+ y))) + ((eq key 'lastyear) + (setq m 0 h 0 d 1 month 1 y (1- y) y1 (1+ y))) + (t (error "No such time block %s" key))) + (setq ts (encode-time s m h d month y) + te (encode-time (or s1 s) (or m1 m) (or h1 h) + (or d1 d) (or month1 month) (or y1 y))) + (setq fm (cdr org-time-stamp-formats)) + (if as-strings + (cons (format-time-string fm ts) (format-time-string fm te)) + (cons ts te)))) + (defun org-dblock-write:clocktable (params) "Write the standard clocktable." (let ((hlchars '((1 . "*") (2 . ?/))) (emph nil) (ins (make-marker)) - ipos time h m p level hlc hdl maxlevel) + ipos time h m p level hlc hdl maxlevel + ts te cc block) (setq maxlevel (or (plist-get params :maxlevel) 3) - emph (plist-get params :emphasize)) + emph (plist-get params :emphasize) + ts (plist-get params :tstart) + te (plist-get params :tend) + block (plist-get params :block)) + (when block + (setq cc (org-clock-special-range block nil t) + ts (car cc) te (cdr cc))) + (if ts (setq ts (time-to-seconds + (apply 'encode-time (org-parse-time-string ts))))) + (if te (setq te (time-to-seconds + (apply 'encode-time (org-parse-time-string te))))) (move-marker ins (point)) (setq ipos (point)) (insert-before-markers "Clock summary at [" (substring (format-time-string (cdr org-time-stamp-formats)) 1 -1) - "]\n|L|Headline|Time|\n") - (org-clock-sum) + "]." + (if block + (format " Considered range is /%s/." block) + "") + "\n\n|L|Headline|Time|\n") + (org-clock-sum ts te) (setq h (/ org-clock-file-total-minutes 60) m (- org-clock-file-total-minutes (* 60 h))) (insert-before-markers "|-\n|0|" "*Total file time*| " @@ -6475,7 +6581,7 @@ the buffer and restores the previous window configuration." (if (stringp org-agenda-files) (let ((cw (current-window-configuration))) (find-file org-agenda-files) - (set (make-local-variable 'org-window-configuration) cw) + (org-set-local 'org-window-configuration cw) (org-add-hook 'after-save-hook (lambda () (set-window-configuration @@ -6603,7 +6709,7 @@ dates." (setq buffer-read-only nil) (erase-buffer) (org-agenda-mode) (setq buffer-read-only nil) - (set (make-local-variable 'org-agenda-type) 'timeline) + (org-set-local 'org-agenda-type 'timeline) (if doclosed (push :closed args)) (push :timestamp args) (if dotodo (push :todo args)) @@ -6701,9 +6807,9 @@ NDAYS defaults to `org-agenda-ndays'." (setq buffer-read-only nil) (erase-buffer) (org-agenda-mode) (setq buffer-read-only nil) - (set (make-local-variable 'org-agenda-type) 'agenda) - (set (make-local-variable 'starting-day) (car day-numbers)) - (set (make-local-variable 'include-all-loc) include-all) + (org-set-local 'org-agenda-type 'agenda) + (org-set-local 'starting-day (car day-numbers)) + (org-set-local 'include-all-loc include-all) (when (and (or include-all org-agenda-include-all-todo) (member today day-numbers)) (setq files thefiles @@ -6812,11 +6918,11 @@ for a keyword. A numeric prefix directly selects the Nth keyword in (setq buffer-read-only nil) (erase-buffer) (org-agenda-mode) (setq buffer-read-only nil) - (set (make-local-variable 'org-agenda-type) 'todo) - (set (make-local-variable 'last-arg) arg) - (set (make-local-variable 'org-todo-keywords) kwds) - (set (make-local-variable 'org-agenda-redo-command) - '(org-todo-list (or current-prefix-arg last-arg) t)) + (org-set-local 'org-agenda-type 'todo) + (org-set-local 'last-arg arg) + (org-set-local 'org-todo-keywords kwds) + (org-set-local 'org-agenda-redo-command + '(org-todo-list (or current-prefix-arg last-arg) t)) (setq files (org-agenda-files) rtnall nil) (org-prepare-agenda-buffers files) @@ -7704,11 +7810,12 @@ the documentation of `org-diary'." (abbreviate-file-name buffer-file-name)))) (regexp org-tr-regexp) (d0 (calendar-absolute-from-gregorian date)) - marker hdmarker ee txt d1 d2 s1 s2 timestr category tags) + marker hdmarker ee txt d1 d2 s1 s2 timestr category tags pos) (goto-char (point-min)) (while (re-search-forward regexp nil t) (catch :skip (org-agenda-skip) + (setq pos (point)) (setq timestr (match-string 0) s1 (match-string 1) s2 (match-string 2) @@ -7736,7 +7843,8 @@ the documentation of `org-diary'." 'org-marker marker 'org-hd-marker hdmarker 'priority (org-get-priority txt) 'category category) (push txt ee))) - (outline-next-heading))) + (goto-char pos))) +; (outline-next-heading))) ;FIXME: correct to be removed?????? ;; Sort the entries by expiration date. (nreverse ee))) @@ -7757,7 +7865,7 @@ groups carry important information: (defconst org-stamp-time-of-day-regexp (concat - "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} +[a-zA-Z]+ +\\)" + "<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} +\\sw+ +\\)" "\\([012][0-9]:[0-5][0-9]\\)>" "\\(--?" "<\\1\\([012][0-9]:[0-5][0-9]\\)>\\)?") @@ -8620,10 +8728,10 @@ The prefix arg TODO-ONLY limits the search to TODO entries." (setq buffer-read-only nil) (erase-buffer) (org-agenda-mode) (setq buffer-read-only nil) - (set (make-local-variable 'org-agenda-type) 'tags) - (set (make-local-variable 'org-agenda-redo-command) - (list 'org-tags-view (list 'quote todo-only) - (list 'if 'current-prefix-arg nil match) t)) + (org-set-local 'org-agenda-type 'tags) + (org-set-local 'org-agenda-redo-command + (list 'org-tags-view (list 'quote todo-only) + (list 'if 'current-prefix-arg nil match) t)) (setq files (org-agenda-files) rtnall nil) (org-prepare-agenda-buffers files) @@ -10234,13 +10342,13 @@ to be run from that hook to fucntion properly." (org-startup-with-deadline-check nil)) (org-mode)) (if (and file (string-match "\\S-" file) (not (file-directory-p file))) - (set (make-local-variable 'org-default-notes-file) file)) + (org-set-local 'org-default-notes-file file)) (goto-char (point-min)) (if (re-search-forward "%\\?" nil t) (replace-match ""))) (let ((org-startup-folded nil) (org-startup-with-deadline-check nil)) (org-mode))) - (set (make-local-variable 'org-finish-function) 'remember-buffer)) + (org-set-local 'org-finish-function 'remember-buffer)) ;;;###autoload (defun org-remember-handler () @@ -11492,10 +11600,10 @@ it can be edited in place." '(invisible t org-cwidth t display t intangible t)) (goto-char p) - (set (make-local-variable 'org-finish-function) - 'org-table-finish-edit-field) - (set (make-local-variable 'org-window-configuration) cw) - (set (make-local-variable 'org-field-marker) pos) + (org-set-local 'org-finish-function + 'org-table-finish-edit-field) + (org-set-local 'org-window-configuration cw) + (org-set-local 'org-field-marker pos) (message "Edit and finish with C-c C-c")))) (defun org-table-finish-edit-field () @@ -12098,10 +12206,11 @@ not overwrite the stored one." (setq formula (car tmp) fmt (concat (cdr (assoc "%" org-table-local-parameters)) (nth 1 tmp))) - (while (string-match "[pnfse]\\(-?[0-9]+\\)" fmt) + (while (string-match "\\([pnfse]\\)\\(-?[0-9]+\\)" fmt) (setq c (string-to-char (match-string 1 fmt)) - n (string-to-number (or (match-string 1 fmt) ""))) - (if (= c ?p) (setq modes (org-set-calc-mode 'calc-internal-prec n)) + n (string-to-number (match-string 2 fmt))) + (if (= c ?p) + (setq modes (org-set-calc-mode 'calc-internal-prec n)) (setq modes (org-set-calc-mode 'calc-float-format (list (cdr (assoc c '((?n . float) (?f . fix) @@ -12314,8 +12423,8 @@ Parameters get priority." (switch-to-buffer-other-window "*Edit Formulas*") (erase-buffer) (fundamental-mode) - (set (make-local-variable 'org-pos) pos) - (set (make-local-variable 'org-window-configuration) wc) + (org-set-local 'org-pos pos) + (org-set-local 'org-window-configuration wc) (use-local-map org-edit-formulas-map) (setq s "# Edit formulas and finish with `C-c C-c'. # Use `C-u C-c C-c' to also appy them immediately to the entire table. @@ -12481,15 +12590,15 @@ table editor in arbitrary modes.") (let ((c (assq 'orgtbl-mode minor-mode-map-alist))) (and c (setq minor-mode-map-alist (cons c (delq c minor-mode-map-alist))))) - (set (make-local-variable (quote org-table-may-need-update)) t) + (org-set-local (quote org-table-may-need-update) t) (org-add-hook 'before-change-functions 'org-before-change-function nil 'local) - (set (make-local-variable 'org-old-auto-fill-inhibit-regexp) - auto-fill-inhibit-regexp) - (set (make-local-variable 'auto-fill-inhibit-regexp) - (if auto-fill-inhibit-regexp - (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp) - "[ \t]*|")) + (org-set-local 'org-old-auto-fill-inhibit-regexp + auto-fill-inhibit-regexp) + (org-set-local 'auto-fill-inhibit-regexp + (if auto-fill-inhibit-regexp + (concat "\\([ \t]*|\\|" auto-fill-inhibit-regexp) + "[ \t]*|")) (org-add-to-invisibility-spec '(org-cwidth)) (easy-menu-add orgtbl-mode-menu) (run-hooks 'orgtbl-mode-hook)) @@ -13388,7 +13497,7 @@ underlined headlines. The default is 3." (set (make-local-variable (cdr x)) (plist-get opt-plist (car x)))) org-export-plist-vars) - (set (make-local-variable 'org-odd-levels-only) odd) + (org-set-local 'org-odd-levels-only odd) (setq umax (if arg (prefix-numeric-value arg) org-export-headline-levels)) @@ -13594,22 +13703,15 @@ command." (goto-char (point-min))))) (defun org-find-visible () - (if (featurep 'noutline) - (let ((s (point))) - (while (and (not (= (point-max) (setq s (next-overlay-change s)))) - (get-char-property s 'invisible))) - s) - (skip-chars-forward "^\n") - (point))) + (let ((s (point))) + (while (and (not (= (point-max) (setq s (next-overlay-change s)))) + (get-char-property s 'invisible))) + s)) (defun org-find-invisible () - (if (featurep 'noutline) - (let ((s (point))) - (while (and (not (= (point-max) (setq s (next-overlay-change s)))) - (not (get-char-property s 'invisible)))) - s) - (skip-chars-forward "^\r") - (point))) - + (let ((s (point))) + (while (and (not (= (point-max) (setq s (next-overlay-change s)))) + (not (get-char-property s 'invisible)))) + s)) ;; HTML @@ -13859,14 +13961,16 @@ lang=\"%s\" xml:lang=\"%s\"> (insert (or (plist-get opt-plist :preamble) "")) (when (plist-get opt-plist :auto-preamble) - (if title (insert (concat "

" - (org-html-expand title) "

\n"))) - + (if title (insert (format org-export-html-title-format + (org-html-expand title)))) (if text (insert "

\n" (org-html-expand text) "

"))) (if org-export-with-toc (progn - (insert (format "

%s

\n" (nth 3 lang-words))) + (insert (format "%s\n" + org-export-html-toplevel-hlevel + (nth 3 lang-words) + org-export-html-toplevel-hlevel)) (insert "
    \n
  • ") (setq lines (mapcar '(lambda (line) @@ -14553,7 +14657,7 @@ When TITLE is nil, just close all open levels." (insert "
      \n
    • " title "
      \n"))) (if org-export-with-section-numbers (setq title (concat (org-section-number level) " " title))) - (setq level (+ level 1)) + (setq level (+ level org-export-html-toplevel-hlevel -1)) (if with-toc (insert (format "\n%s\n" level head-count title level)) @@ -15763,6 +15867,10 @@ See the individual commands for more information." "--" ("TODO Lists" ["TODO/DONE/-" org-todo t] + ("Select keyword" + ["Next keyword" org-shiftright (org-on-heading-p)] + ["Previous keyword" org-shiftleft (org-on-heading-p)] + ["Complete Keyword" org-complete (assq :todo-keyword (org-context))]) ["Show TODO Tree" org-show-todo-tree t] ["Global TODO list" org-todo-list t] "--" @@ -16042,31 +16150,32 @@ return nil." ;; In the paragraph separator we include headlines, because filling ;; text in a line directly attached to a headline would otherwise ;; fill the headline as well. - (set (make-local-variable 'comment-start-skip) "^#+[ \t]*") - (set (make-local-variable 'paragraph-separate) "\f\\|\\*\\|[ ]*$\\|[ \t]*[:|]") + (org-set-local 'comment-start-skip "^#+[ \t]*") + (org-set-local 'paragraph-separate "\f\\|\\*\\|[ ]*$\\|[ \t]*[:|]") ;; The paragraph starter includes hand-formatted lists. - (set (make-local-variable 'paragraph-start) - "\f\\|[ ]*$\\|\\([*\f]+\\)\\|[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)\\|[ \t]*[:|]") + (org-set-local 'paragraph-start + "\f\\|[ ]*$\\|\\([*\f]+\\)\\|[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)\\|[ \t]*[:|]") ;; Inhibit auto-fill for headers, tables and fixed-width lines. ;; But only if the user has not turned off tables or fixed-width regions - (set (make-local-variable 'auto-fill-inhibit-regexp) - (concat "\\*\\|#" - "\\|[ \t]*" org-keyword-time-regexp - (if (or org-enable-table-editor org-enable-fixed-width-editor) - (concat - "\\|[ \t]*[" - (if org-enable-table-editor "|" "") - (if org-enable-fixed-width-editor ":" "") - "]")))) + (org-set-local + 'auto-fill-inhibit-regexp + (concat "\\*\\|#" + "\\|[ \t]*" org-keyword-time-regexp + (if (or org-enable-table-editor org-enable-fixed-width-editor) + (concat + "\\|[ \t]*[" + (if org-enable-table-editor "|" "") + (if org-enable-fixed-width-editor ":" "") + "]")))) ;; We use our own fill-paragraph function, to make sure that tables ;; and fixed-width regions are not wrapped. That function will pass ;; through to `fill-paragraph' when appropriate. - (set (make-local-variable 'fill-paragraph-function) 'org-fill-paragraph) - ;; Adaptive filling: To get full control, first make sure that + (org-set-local 'fill-paragraph-function 'org-fill-paragraph) + ; Adaptive filling: To get full control, first make sure that ;; `adaptive-fill-regexp' never matches. Then install our own matcher. - (set (make-local-variable 'adaptive-fill-regexp) "\000") - (set (make-local-variable 'adaptive-fill-function) - 'org-adaptive-fill-function)) + (org-set-local 'adaptive-fill-regexp "\000") + (org-set-local 'adaptive-fill-function + 'org-adaptive-fill-function)) (defun org-fill-paragraph (&optional justify) "Re-align a table, pass through to fill-paragraph if no table." @@ -16145,18 +16254,7 @@ that can be added." t) "\\'")))) -;; Functions needed for compatibility with old outline.el. - -;; Programming for the old outline.el (that uses selective display -;; instead of `invisible' text properties) is a nightmare, mostly -;; because regular expressions can no longer be anchored at -;; beginning/end of line. Therefore a number of function need special -;; treatment when the old outline.el is being used. - -;; The following functions capture almost the entire compatibility code -;; between the different versions of outline-mode. The only other -;; places where this is important are the font-lock-keywords, and in -;; `org-export-visible'. Search for `org-noutline-p' to find them. +;; Functions extending outline functionality ;; C-a should go to the beginning of a *visible* line, also in the ;; new outline.el. I guess this should be patched into Emacs? @@ -16174,60 +16272,26 @@ to a visible line beginning. This makes the function of C-a more intuitive." (beginning-of-line 1)) (forward-char 1)))) -(when org-noutline-p - (define-key org-mode-map "\C-a" 'org-beginning-of-line)) +(define-key org-mode-map "\C-a" 'org-beginning-of-line) (defun org-invisible-p () "Check if point is at a character currently not visible." - (if org-noutline-p - ;; Early versions of noutline don't have `outline-invisible-p'. - (if (fboundp 'outline-invisible-p) - (outline-invisible-p) - (get-char-property (point) 'invisible)) - (save-excursion - (skip-chars-backward "^\r\n") - (equal (char-before) ?\r)))) + ;; Early versions of noutline don't have `outline-invisible-p'. + (if (fboundp 'outline-invisible-p) + (outline-invisible-p) + (get-char-property (point) 'invisible))) (defun org-invisible-p2 () "Check if point is at a character currently not visible." (save-excursion - (if org-noutline-p - (progn - (if (and (eolp) (not (bobp))) (backward-char 1)) - ;; Early versions of noutline don't have `outline-invisible-p'. - (if (fboundp 'outline-invisible-p) - (outline-invisible-p) - (get-char-property (point) 'invisible))) - (skip-chars-backward "^\r\n") - (equal (char-before) ?\r)))) + (if (and (eolp) (not (bobp))) (backward-char 1)) + ;; Early versions of noutline don't have `outline-invisible-p'. + (if (fboundp 'outline-invisible-p) + (outline-invisible-p) + (get-char-property (point) 'invisible)))) -(defun org-back-to-heading (&optional invisible-ok) - "Move to previous heading line, or beg of this line if it's a heading. -Only visible heading lines are considered, unless INVISIBLE-OK is non-nil." - (if org-noutline-p - (outline-back-to-heading invisible-ok) - (if (and (or (bobp) (memq (char-before) '(?\n ?\r))) - (looking-at outline-regexp)) - t - (if (re-search-backward (concat (if invisible-ok "\\([\r\n]\\|^\\)" "^") - outline-regexp) - nil t) - (if invisible-ok - (progn (goto-char (or (match-end 1) (match-beginning 0))) - (looking-at outline-regexp))) - (error "Before first heading"))))) - -(defun org-on-heading-p (&optional invisible-ok) - "Return t if point is on a (visible) heading line. -If INVISIBLE-OK is non-nil, an invisible heading line is ok too." - (if org-noutline-p - (outline-on-heading-p 'invisible-ok) - (save-excursion - (skip-chars-backward "^\n\r") - (and (looking-at outline-regexp) - (or invisible-ok - (bobp) - (equal (char-before) ?\n)))))) +(defalias 'org-back-to-heading 'outline-back-to-heading) +(defalias 'org-on-heading-p 'outline-on-heading-p) (defun org-on-target-p () (let ((pos (point))) @@ -16243,47 +16307,20 @@ If INVISIBLE-OK is non-nil, an invisible heading line is ok too." "Move to the heading line of which the present line is a subheading. This function considers both visible and invisible heading lines. With argument, move up ARG levels." - (if org-noutline-p - (if (fboundp 'outline-up-heading-all) - (outline-up-heading-all arg) ; emacs 21 version of outline.el - (outline-up-heading arg t)) ; emacs 22 version of outline.el - (org-back-to-heading t) - (looking-at outline-regexp) - (if (<= (- (match-end 0) (match-beginning 0)) arg) - (error "Cannot move up %d levels" arg) - (re-search-backward - (concat "[\n\r]" (regexp-quote - (make-string (- (match-end 0) (match-beginning 0) arg) - ?*)) - "[^*]")) - (forward-char 1)))) + (if (fboundp 'outline-up-heading-all) + (outline-up-heading-all arg) ; emacs 21 version of outline.el + (outline-up-heading arg t))) ; emacs 22 version of outline.el (defun org-show-hidden-entry () "Show an entry where even the heading is hidden." (save-excursion - (if (not org-noutline-p) - (progn - (org-back-to-heading t) - (org-flag-heading nil))) (org-show-entry))) -(defun org-check-occur-regexp (regexp) - "If REGEXP starts with \"^\", modify it to check for \\r as well. -Of course, only for the old outline mode." - (if org-noutline-p - regexp - (if (string-match "^\\^" regexp) - (concat "[\n\r]" (substring regexp 1)) - regexp))) - (defun org-flag-heading (flag &optional entry) "Flag the current heading. FLAG non-nil means make invisible. When ENTRY is non-nil, show the entire entry." (save-excursion (org-back-to-heading t) - (if (not org-noutline-p) - ;; Make the current headline visible - (outline-flag-region (max 1 (1- (point))) (point) (if flag ?\r ?\n))) ;; Check if we should show the entire entry (if entry (progn @@ -16293,9 +16330,7 @@ When ENTRY is non-nil, show the entire entry." (org-flag-heading nil)))) (outline-flag-region (max 1 (1- (point))) (save-excursion (outline-end-of-heading) (point)) - (if org-noutline-p - flag - (if flag ?\r ?\n)))))) + flag)))) (defun org-end-of-subtree (&optional invisible-OK) ;; This is an exact copy of the original function, but it uses @@ -16324,7 +16359,7 @@ When ENTRY is non-nil, show the entire entry." (point) (save-excursion (outline-end-of-subtree) (outline-next-heading) (point)) - (if org-noutline-p nil ?\n))) + nil)) (defun org-show-entry () "Show the body directly following this heading. @@ -16337,16 +16372,16 @@ Show the heading too, if it is currently invisible." (save-excursion (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move) (or (match-beginning 1) (point-max))) - (if org-noutline-p nil ?\n)))) + nil))) (defun org-make-options-regexp (kwds) "Make a regular expression for keyword lines." (concat - (if org-noutline-p "^" "[\n\r]") + "^" "#?[ \t]*\\+\\(" (mapconcat 'regexp-quote kwds "\\|") "\\):[ \t]*" - (if org-noutline-p "\\(.+\\)" "\\([^\n\r]+\\)"))) + "\\(.+\\)")) ;; Make `bookmark-jump' show the jump location if it was hidden. (eval-after-load "bookmark" diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index 693a2d7fa4b..81fe9a8e868 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el @@ -121,6 +121,12 @@ any protocol specific data.") (defun x-dnd-init-frame (&optional frame) "Setup drag and drop for FRAME (i.e. create appropriate properties)." + (x-register-dnd-atom "DndProtocol" frame) + (x-register-dnd-atom "_MOTIF_DRAG_AND_DROP_MESSAGE" frame) + (x-register-dnd-atom "XdndEnter" frame) + (x-register-dnd-atom "XdndPosition" frame) + (x-register-dnd-atom "XdndLeave" frame) + (x-register-dnd-atom "XdndDrop" frame) (x-dnd-init-xdnd-for-frame frame) (x-dnd-init-motif-for-frame frame)) diff --git a/lispref/ChangeLog b/lispref/ChangeLog index f64f9eb56df..d09689ce637 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,62 @@ +2006-08-16 Richard Stallman + + * keymaps.texi (Extended Menu Items): Show format of cached + bindings in extended menu items. + + * customize.texi (Variable Definitions): Explain when the + standard value expression is evaluated. + +2006-08-15 Chong Yidong + + * commands.texi (Reading One Event): Explain idleness in + `read-event'. + +2006-08-12 Chong Yidong + + * text.texi (Near Point): Say "cursor" not "terminal cursor". + (Commands for Insertion): Removed split-line since it's not + relevant for Lisp programming. + (Yank Commands): Rewrite introduction. + (Undo): Clarify. + (Maintaining Undo): Clarify. Document undo-ask-before-discard. + (Filling): Remove redundant comment. Clarify return value of + current-justification. + (Margins): Minor clarifications. + (Adaptive Fill): Update default value of adaptive-fill-regexp. + (Sorting): Update definition of sort-lines. + (Columns): Clarify behavior of sort-columns. + (Indent Tabs): Link to Tab Stops in Emacs manual. + (Special Properties): Clarify. + (Clickable Text): Mention Buttons package. + +2006-08-12 Kevin Ryde + + * os.texi (Time Parsing): Add %z to description of + format-time-string, as per docstring. Add cross reference to + glibc manual for strftime. + +2006-08-08 Richard Stallman + + * modes.texi: Clean up wording in previous change. + +2006-08-07 Chong Yidong + + * modes.texi (Hooks): Clarify. + (Major Mode Basics): Mention define-derived-mode explicitly. + (Major Mode Conventions): Rebinding RET is OK for some modes. + Mention change-major-mode-hook and after-change-major-mode-hook. + (Example Major Modes): Moved to end of Modes section. + (Mode Line Basics): Clarify. + (Mode Line Data): Mention help-echo and local-map in strings. + Explain reason for treatment of non-risky variables. + (Properties in Mode): Clarify. + (Faces for Font Lock): Add font-lock-negation-char-face. + +2006-08-04 Eli Zaretskii + + * strings.texi (Formatting Strings): Warn against arbitrary + strings as first arg to `format'. + 2006-07-31 Thien-Thi Nguyen * text.texi (Clickable Text): Mention `help-echo' text property. @@ -290,7 +349,7 @@ * anti.texi, customize.texi, display.texi, internals.texi: * minibuf.texi, modes.texi, tips.texi: - Fix overfull/underfull boxes. + Fix overfull/underfull boxes. 2006-07-05 Thien-Thi Nguyen @@ -367,7 +426,7 @@ 2006-06-09 Aidan Kehoe - * objects.texi (Character Type): Describe the\uABCD and \U00ABCDEF + * objects.texi (Character Type): Describe the \uABCD and \U00ABCDEF syntax. 2006-06-07 Eli Zaretskii @@ -679,7 +738,7 @@ 2006-04-13 Bill Wohler * customize.texi (Common Keywords): Use dotted notation for - :package-version value. Specify its values. Improve documentation + :package-version value. Specify its values. Improve documentation for customize-package-emacs-version-alist. 2006-04-12 Bill Wohler @@ -1724,7 +1783,7 @@ (Jumping): Clarify description of `h' command. Eliminate redundant @ref. (Breaks): New node. - (Breakpoints): is now a subsubsection. + (Breakpoints): Is now a subsubsection. (Global Break Condition): Mention `C-x X X'. (Edebug Views): Clarify `v' and `p'. Mention `C-x X w'. (Trace Buffer): Clarify STRING arg of `edebug-tracing'. @@ -2974,7 +3033,7 @@ 2004-10-24 Jason Rumney - * commands.texi (Misc Events): Remove mouse-wheel. Add wheel-up + * commands.texi (Misc Events): Remove mouse-wheel. Add wheel-up and wheel-down. 2004-10-24 Kai Grossjohann @@ -3203,7 +3262,7 @@ except while processing `frame-title-format' or `icon-title-format'. (Deleting Frames): Correct description of `delete-frame'. Non-nil return values of `frame-live-p' are like those of `framep'. - (Frames and Windows): mention return value of + (Frames and Windows): Mention return value of `set-frame-selected-window'. (Visibility of Frames): Mention `force' argument to `make-frame-invisible'. `frame-visible-p' returns t for all @@ -3530,7 +3589,7 @@ 2004-03-07 Thien-Thi Nguyen - * customize.texi: Fix typo. Remove eol whitespace. + * customize.texi: Fix typo. Remove eol whitespace. 2004-03-04 Richard M. Stallman @@ -3566,7 +3625,7 @@ * text.texi: Various small changes in addition to the following: (User-Level Deletion): Mention optional BACKWARD-ONLY argument to delete-horizontal-space. - (Kill Functions, Yanking, Low-Level Kill Ring): clarify and correct + (Kill Functions, Yanking, Low-Level Kill Ring): Clarify and correct description of yank-handler text property at various places. * frames.texi (Window System Selections): Add anchor. @@ -4593,7 +4652,7 @@ * loading.texi (Unloading): Fix recent change for load-history. * customize.texi (Simple Types): Clarify description of custom - type 'number. Describe new custom type 'float. + type 'number. Describe new custom type 'float. 2002-12-04 Markus Rost @@ -5123,7 +5182,7 @@ Mon Apr 17 18:56:50 1989 Robert J. Chassell (bob@rice-chex.ai.mit.edu) Tue Apr 11 12:23:28 1989 Robert J. Chassell (bob@rice-chex.ai.mit.edu) * Applied Karl Berry's patches to *.texinfo files, but not to - texinfo.tex; those diffs are in `berry-texinfo-tex-diffs'. (Karl's + texinfo.tex; those diffs are in `berry-texinfo-tex-diffs'. (Karl's new title page format is also not applied, since it requires texinfo.tex changes.) diff --git a/lispref/commands.texi b/lispref/commands.texi index 8e34fe360bf..2a091524bed 100644 --- a/lispref/commands.texi +++ b/lispref/commands.texi @@ -2229,6 +2229,15 @@ number of seconds; on these systems, @var{seconds} is rounded down. If @var{seconds} is @code{nil}, @code{read-event} waits as long as necessary for input to arrive. +If @var{seconds} is @code{nil}, Emacs is considered idle while waiting +for user input to arrive. Idle timers---those created with +@code{run-with-idle-timer} (@pxref{Timers})---can run during this +period. However, if @var{seconds} is non-@code{nil}, the state of +idleness remains unchanged. If Emacs is non-idle when +@code{read-event} is called, it remains non-idle throughout the +operation of @code{read-event}; if Emacs is idle (which can happen if +the call happens inside an idle timer), it remains idle. + If @code{read-event} gets an event that is defined as a help character, then in some cases @code{read-event} processes the event directly without returning. @xref{Help Functions}. Certain other events, called diff --git a/lispref/customize.texi b/lispref/customize.texi index e3e78c46bb4..9e10e547b56 100644 --- a/lispref/customize.texi +++ b/lispref/customize.texi @@ -251,19 +251,30 @@ turn this feature back on, if someone would like to do the work. Use @code{defcustom} to declare user-editable variables. -@defmac defcustom option default doc [keyword value]@dots{} -Declare @var{option} as a customizable user option variable. Do not -quote @var{option}. The argument @var{doc} specifies the documentation -string for the variable. There is no need to start it with a @samp{*} -because @code{defcustom} automatically marks @var{option} as a -@dfn{user option} (@pxref{Defining Variables}). +@defmac defcustom option standard doc [keyword value]@dots{} +This construct declares @var{option} as a customizable user option +variable. You should not quote @var{option}. The argument @var{doc} +specifies the documentation string for the variable. There is no need +to start it with a @samp{*}, because @code{defcustom} automatically +marks @var{option} as a @dfn{user option} (@pxref{Defining +Variables}). -If @var{option} is void, @code{defcustom} initializes it to -@var{default}. @var{default} should be an expression to compute the -value; be careful in writing it, because it can be evaluated on more -than one occasion. You should normally avoid using backquotes in -@var{default} because they are not expanded when editing the value, -causing list values to appear to have the wrong structure. +The argument @var{standard} is an expression that specifies the +standard value for @var{option}. Evaluating the @code{defcustom} form +evaluates @var{standard}, but does not necessarily install the +standard value. If @var{option} already has a default value, +@code{defcustom} does not change it. If the user has saved a +customization for @var{option}, @code{defcustom} installs the user's +customized value as @var{option}'s default value. If neither of those +cases applies, @code{defcustom} installs the result of evaluating +@var{standard} as the default value. + +The expression @var{standard} can be evaluated at various other times, +too---whenever the customization facility needs to know @var{option}'s +standard value. So be sure to use an expression which is harmless to +evaluate at any time. We recommend avoiding backquotes in +@var{standard}, because they are not expanded when editing the value, +so list values will appear to have the wrong structure. If you specify the @code{:set} option, to make the variable take other special actions when set through the customization buffer, the @@ -406,7 +417,7 @@ type of @var{symbol}. @end defun Internally, @code{defcustom} uses the symbol property -@code{standard-value} to record the expression for the default value, +@code{standard-value} to record the expression for the standard value, and @code{saved-value} to record the value saved by the user with the customization buffer. Both properties are actually lists whose car is an expression which evaluates to the value. diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi index 44b92ddfcb8..13f4550a082 100644 --- a/lispref/keymaps.texi +++ b/lispref/keymaps.texi @@ -2016,7 +2016,7 @@ binding, like this: @c This line is not too long--rms. @example -(@var{item-string} @r{[}@var{help-string}@r{]} (@var{key-binding-data}) . @var{real-binding}) +(@var{item-string} @r{[}@var{help}@r{]} (@var{key-binding-data}) . @var{real-binding}) @end example @noindent @@ -2140,6 +2140,13 @@ operates on menu data structures, so you should write it so it can safely be called at any time. @end table + When an equivalent key binding is cached, the binding looks like this. + +@example +(menu-item @var{item-name} @var{real-binding} (@var{key-binding-data}) + . @var{item-property-list}) +@end example + @node Menu Separators @subsubsection Menu Separators @cindex menu separators diff --git a/lispref/modes.texi b/lispref/modes.texi index 38227633c6b..f8afcd8a829 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi @@ -43,18 +43,19 @@ up in the init file (@pxref{Init File}), but Lisp programs can set them also. @cindex normal hook Most of the hooks in Emacs are @dfn{normal hooks}. These variables -contain lists of functions to be called with no arguments. When the -hook name ends in @samp{-hook}, that tells you it is normal. We try to -make all hooks normal, as much as possible, so that you can use them in -a uniform way. +contain lists of functions to be called with no arguments. By +convention, whenever the hook name ends in @samp{-hook}, that tells +you it is normal. We try to make all hooks normal, as much as +possible, so that you can use them in a uniform way. - Every major mode function is supposed to run a normal hook called the -@dfn{mode hook} as the last step of initialization. This makes it easy -for a user to customize the behavior of the mode, by overriding the -buffer-local variable assignments already made by the mode. Most -minor modes also run a mode hook at their end. But hooks are used in -other contexts too. For example, the hook @code{suspend-hook} runs -just before Emacs suspends itself (@pxref{Suspending Emacs}). + Every major mode function is supposed to run a normal hook called +the @dfn{mode hook} as the one of the last steps of initialization. +This makes it easy for a user to customize the behavior of the mode, +by overriding the buffer-local variable assignments already made by +the mode. Most minor mode functions also run a mode hook at the end. +But hooks are used in other contexts too. For example, the hook +@code{suspend-hook} runs just before Emacs suspends itself +(@pxref{Suspending Emacs}). The recommended way to add a hook function to a normal hook is by 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}. @cindex abnormal hook If the hook variable's name does not end with @samp{-hook}, that -indicates it is probably an @dfn{abnormal hook}. Then you should look at its -documentation to see how to use the hook properly. +indicates it is probably an @dfn{abnormal hook}. That means the hook +functions are called with arguments, or their return values are used +in some way. The hook's documentation says how the functions are +called. You can use @code{add-hook} to add a function to an abnormal +hook, but you must write the function to follow the hook's calling +convention. - If the variable's name ends in @samp{-functions} or @samp{-hooks}, -then the value is a list of functions, but it is abnormal in that either -these functions are called with arguments or their values are used in -some way. You can use @code{add-hook} to add a function to the list, -but you must take care in writing the function. (A few of these -variables, notably those ending in @samp{-hooks}, are actually -normal hooks which were named before we established the convention of -using @samp{-hook} for them.) - - If the variable's name ends in @samp{-function}, then its value -is just a single function, not a list of functions. + By convention, abnormal hook names end in @samp{-functions} or +@samp{-hooks}. If the variable's name ends in @samp{-function}, then +its value is just a single function, not a list of functions. Here's an example that uses a mode hook to turn on Auto Fill mode when in Lisp Interaction mode: @@ -96,12 +93,13 @@ arguments, and runs each hook in turn. Each argument should be a symbol that is a normal hook variable. These arguments are processed in the order specified. -If a hook variable has a non-@code{nil} value, that value may be a -function or a list of functions. (The former option is considered -obsolete.) If the value is a function (either a lambda expression or -a symbol with a function definition), it is called. If it is a list -that isn't a function, its elements are called, consecutively. All -the hook functions are called with no arguments. +If a hook variable has a non-@code{nil} value, that value should be a +list of functions. @code{run-hooks} calls all the functions, one by +one, with no arguments. + +The hook variable's value can also be a single function---either a +lambda expression or a symbol with a function definition---which +@code{run-hooks} calls. But this usage is obsolete. @end defun @defun run-hook-with-args hook &rest args @@ -187,7 +185,6 @@ to another major mode in the same buffer. @menu * Major Mode Basics:: * Major Mode Conventions:: Coding conventions for keymaps, etc. -* Example Major Modes:: Text mode and Lisp modes. * Auto Major Mode:: How Emacs chooses the major mode automatically. * Mode Help:: Finding out how to use a mode. * Derived Modes:: Defining a new major mode based on another major @@ -195,6 +192,7 @@ to another major mode in the same buffer. * Generic Modes:: Defining a simple major mode that supports comment syntax and Font Lock mode. * Mode Hooks:: Hooks run at the end of major mode functions. +* Example Major Modes:: Text mode and Lisp modes. @end menu @node Major Mode Basics @@ -214,14 +212,14 @@ specialized editing task, creating a new major mode is usually a good idea. In practice, writing a major mode is easy (in contrast to writing a minor mode, which is often difficult). - If the new mode is similar to an old one, it is often unwise to modify -the old one to serve two purposes, since it may become harder to use and -maintain. Instead, copy and rename an existing major mode definition -and alter the copy---or define a @dfn{derived mode} (@pxref{Derived -Modes}). For example, Rmail Edit mode, which is in -@file{emacs/lisp/mail/rmailedit.el}, is a major mode that is very similar to -Text mode except that it provides two additional commands. Its -definition is distinct from that of Text mode, but uses that of Text mode. + If the new mode is similar to an old one, it is often unwise to +modify the old one to serve two purposes, since it may become harder +to use and maintain. Instead, copy and rename an existing major mode +definition and alter the copy---or use @code{define-derived-mode} to +define a @dfn{derived mode} (@pxref{Derived Modes}). For example, +Rmail Edit mode is a major mode that is very similar to Text mode +except that it provides two additional commands. Its definition is +distinct from that of Text mode, but uses that of Text mode. Even if the new mode is not an obvious derivative of any other mode, it is convenient to use @code{define-derived-mode} with a @code{nil} @@ -287,8 +285,10 @@ Documentation}. @item The major mode command should start by calling -@code{kill-all-local-variables}. This is what gets rid of the -buffer-local variables of the major mode previously in effect. +@code{kill-all-local-variables}. This runs the normal hook +@code{change-major-mode-hook}, then gets rid of the buffer-local +variables of the major mode previously in effect. @xref{Creating +Buffer-Local}. @item 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 letters and other printing characters as special commands. @item -Major modes must not define @key{RET} to do anything other than insert -a newline. The command to insert a newline and then indent is -@kbd{C-j}. Please keep this distinction uniform for all major modes. +Major modes modes for editing text should not define @key{RET} to do +anything other than insert a newline. However, it is ok for +specialized modes for text that users don't directly edit, such as +Dired and Info modes, to redefine @key{RET} to do something entirely +different. @item Major modes should not alter options that are primarily a matter of user @@ -427,10 +429,11 @@ other packages would interfere with them. @item @cindex mode hook @cindex major mode hook -Each major mode should have a @dfn{mode hook} named -@code{@var{modename}-mode-hook}. The major mode command should run that -hook, with @code{run-mode-hooks}, as the very last thing it -does. @xref{Mode Hooks}. +Each major mode should have a normal @dfn{mode hook} named +@code{@var{modename}-mode-hook}. The very last thing the major mode command +should do is to call @code{run-mode-hooks}. This runs the mode hook, +and then runs the normal hook @code{after-change-major-mode-hook}. +@xref{Mode Hooks}. @item 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. Even if you never load the file more than once, someone else will. @end itemize -@node Example Major Modes -@subsection Major Mode Examples - - Text mode is perhaps the simplest mode besides Fundamental mode. -Here are excerpts from @file{text-mode.el} that illustrate many of -the conventions listed above: - -@smallexample -@group -;; @r{Create the syntax table for this mode.} -(defvar text-mode-syntax-table - (let ((st (make-syntax-table))) - (modify-syntax-entry ?\" ". " st) - (modify-syntax-entry ?\\ ". " st) - ;; Add `p' so M-c on `hello' leads to `Hello', not `hello'. - (modify-syntax-entry ?' "w p" st) - st) - "Syntax table used while in `text-mode'.") -@end group - -;; @r{Create the keymap for this mode.} -@group -(defvar text-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "\e\t" 'ispell-complete-word) - (define-key map "\es" 'center-line) - (define-key map "\eS" 'center-paragraph) - map) - "Keymap for `text-mode'. -Many other modes, such as Mail mode, Outline mode -and Indented Text mode, inherit all the commands -defined in this map.") -@end group -@end smallexample - - Here is how the actual mode command is defined now: - -@smallexample -@group -(define-derived-mode text-mode nil "Text" - "Major mode for editing text written for humans to read. -In this mode, paragraphs are delimited only by blank or white lines. -You can thus get the full benefit of adaptive filling - (see the variable `adaptive-fill-mode'). -\\@{text-mode-map@} -Turning on Text mode runs the normal hook `text-mode-hook'." -@end group -@group - (make-local-variable 'text-mode-variant) - (setq text-mode-variant t) - ;; @r{These two lines are a feature added recently.} - (set (make-local-variable 'require-final-newline) - mode-require-final-newline) - (set (make-local-variable 'indent-line-function) 'indent-relative)) -@end group -@end smallexample - - But here is how it was defined formerly, before -@code{define-derived-mode} existed: - -@smallexample -@group -;; @r{This isn't needed nowadays, since @code{define-derived-mode} does it.} -(defvar text-mode-abbrev-table nil - "Abbrev table used while in text mode.") -(define-abbrev-table 'text-mode-abbrev-table ()) -@end group - -@group -(defun text-mode () - "Major mode for editing text intended for humans to read... - Special commands: \\@{text-mode-map@} -@end group -@group -Turning on text-mode runs the hook `text-mode-hook'." - (interactive) - (kill-all-local-variables) - (use-local-map text-mode-map) -@end group -@group - (setq local-abbrev-table text-mode-abbrev-table) - (set-syntax-table text-mode-syntax-table) -@end group -@group - ;; @r{These four lines are absent from the current version} - ;; @r{not because this is done some other way, but rather} - ;; @r{because nowadays Text mode uses the normal definition of paragraphs.} - (make-local-variable 'paragraph-start) - (setq paragraph-start (concat "[ \t]*$\\|" page-delimiter)) - (make-local-variable 'paragraph-separate) - (setq paragraph-separate paragraph-start) - (make-local-variable 'indent-line-function) - (setq indent-line-function 'indent-relative-maybe) -@end group -@group - (setq mode-name "Text") - (setq major-mode 'text-mode) - (run-mode-hooks 'text-mode-hook)) ; @r{Finally, this permits the user to} - ; @r{customize the mode with a hook.} -@end group -@end smallexample - -@cindex @file{lisp-mode.el} - The three Lisp modes (Lisp mode, Emacs Lisp mode, and Lisp -Interaction mode) have more features than Text mode and the code is -correspondingly more complicated. Here are excerpts from -@file{lisp-mode.el} that illustrate how these modes are written. - -@cindex syntax table example -@smallexample -@group -;; @r{Create mode-specific table variables.} -(defvar lisp-mode-syntax-table nil "") -(defvar lisp-mode-abbrev-table nil "") -@end group - -@group -(defvar emacs-lisp-mode-syntax-table - (let ((table (make-syntax-table))) - (let ((i 0)) -@end group - -@group - ;; @r{Set syntax of chars up to @samp{0} to say they are} - ;; @r{part of symbol names but not words.} - ;; @r{(The digit @samp{0} is @code{48} in the @acronym{ASCII} character set.)} - (while (< i ?0) - (modify-syntax-entry i "_ " table) - (setq i (1+ i))) - ;; @r{@dots{} similar code follows for other character ranges.} -@end group -@group - ;; @r{Then set the syntax codes for characters that are special in Lisp.} - (modify-syntax-entry ? " " table) - (modify-syntax-entry ?\t " " table) - (modify-syntax-entry ?\f " " table) - (modify-syntax-entry ?\n "> " table) -@end group -@group - ;; @r{Give CR the same syntax as newline, for selective-display.} - (modify-syntax-entry ?\^m "> " table) - (modify-syntax-entry ?\; "< " table) - (modify-syntax-entry ?` "' " table) - (modify-syntax-entry ?' "' " table) - (modify-syntax-entry ?, "' " table) -@end group -@group - ;; @r{@dots{}likewise for many other characters@dots{}} - (modify-syntax-entry ?\( "() " table) - (modify-syntax-entry ?\) ")( " table) - (modify-syntax-entry ?\[ "(] " table) - (modify-syntax-entry ?\] ")[ " table)) - table)) -@end group -@group -;; @r{Create an abbrev table for lisp-mode.} -(define-abbrev-table 'lisp-mode-abbrev-table ()) -@end group -@end smallexample - - Much code is shared among the three Lisp modes. The following -function sets various variables; it is called by each of the major Lisp -mode functions: - -@smallexample -@group -(defun lisp-mode-variables (lisp-syntax) - (when lisp-syntax - (set-syntax-table lisp-mode-syntax-table)) - (setq local-abbrev-table lisp-mode-abbrev-table) - @dots{} -@end group -@end smallexample - - Functions such as @code{forward-paragraph} use the value of the -@code{paragraph-start} variable. Since Lisp code is different from -ordinary text, the @code{paragraph-start} variable needs to be set -specially to handle Lisp. Also, comments are indented in a special -fashion in Lisp and the Lisp modes need their own mode-specific -@code{comment-indent-function}. The code to set these variables is the -rest of @code{lisp-mode-variables}. - -@smallexample -@group - (make-local-variable 'paragraph-start) - (setq paragraph-start (concat page-delimiter "\\|$" )) - (make-local-variable 'paragraph-separate) - (setq paragraph-separate paragraph-start) - @dots{} -@end group -@group - (make-local-variable 'comment-indent-function) - (setq comment-indent-function 'lisp-comment-indent)) - @dots{} -@end group -@end smallexample - - Each of the different Lisp modes has a slightly different keymap. For -example, Lisp mode binds @kbd{C-c C-z} to @code{run-lisp}, but the other -Lisp modes do not. However, all Lisp modes have some commands in -common. The following code sets up the common commands: - -@smallexample -@group -(defvar shared-lisp-mode-map () - "Keymap for commands shared by all sorts of Lisp modes.") - -;; @r{Putting this @code{if} after the @code{defvar} is an older style.} -(if shared-lisp-mode-map - () - (setq shared-lisp-mode-map (make-sparse-keymap)) - (define-key shared-lisp-mode-map "\e\C-q" 'indent-sexp) - (define-key shared-lisp-mode-map "\177" - 'backward-delete-char-untabify)) -@end group -@end smallexample - -@noindent -And here is the code to set up the keymap for Lisp mode: - -@smallexample -@group -(defvar lisp-mode-map () - "Keymap for ordinary Lisp mode...") - -(if lisp-mode-map - () - (setq lisp-mode-map (make-sparse-keymap)) - (set-keymap-parent lisp-mode-map shared-lisp-mode-map) - (define-key lisp-mode-map "\e\C-x" 'lisp-eval-defun) - (define-key lisp-mode-map "\C-c\C-z" 'run-lisp)) -@end group -@end smallexample - - Finally, here is the complete major mode function definition for -Lisp mode. - -@smallexample -@group -(defun lisp-mode () - "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp. -Commands: -Delete converts tabs to spaces as it moves back. -Blank lines separate paragraphs. Semicolons start comments. -\\@{lisp-mode-map@} -Note that `run-lisp' may be used either to start an inferior Lisp job -or to switch back to an existing one. -@end group - -@group -Entry to this mode calls the value of `lisp-mode-hook' -if that value is non-nil." - (interactive) - (kill-all-local-variables) -@end group -@group - (use-local-map lisp-mode-map) ; @r{Select the mode's keymap.} - (setq major-mode 'lisp-mode) ; @r{This is how @code{describe-mode}} - ; @r{finds out what to describe.} - (setq mode-name "Lisp") ; @r{This goes into the mode line.} - (lisp-mode-variables t) ; @r{This defines various variables.} - (make-local-variable 'comment-start-skip) - (setq comment-start-skip - "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") - (make-local-variable 'font-lock-keywords-case-fold-search) - (setq font-lock-keywords-case-fold-search t) -@end group -@group - (setq imenu-case-fold-search t) - (set-syntax-table lisp-mode-syntax-table) - (run-mode-hooks 'lisp-mode-hook)) ; @r{This permits the user to use a} - ; @r{hook to customize the mode.} -@end group -@end smallexample - @node Auto Major Mode @subsection How Emacs Chooses a Major Mode @@ -1073,104 +801,365 @@ Do not write an @code{interactive} spec in the definition; @subsection Generic Modes @cindex generic mode -@dfn{Generic modes} are simple major modes with basic support for -comment syntax and Font Lock mode. They are primarily useful for -configuration files. To define a generic mode, use the macro -@code{define-generic-mode}. See the file @file{generic-x.el} for some -examples of the use of @code{define-generic-mode}. + @dfn{Generic modes} are simple major modes with basic support for +comment syntax and Font Lock mode. To define a generic mode, use the +macro @code{define-generic-mode}. See the file @file{generic-x.el} +for some examples of the use of @code{define-generic-mode}. @defmac define-generic-mode mode comment-list keyword-list font-lock-list auto-mode-list function-list &optional docstring -This macro creates a new generic mode. The argument @var{mode} (an -unquoted symbol) is the major mode command. The optional argument -@var{docstring} is the documentation for the mode command. If you do -not supply it, @code{define-generic-mode} uses a default documentation -string instead. +This macro defines a generic mode command named @var{mode} (a symbol, +not quoted). The optional argument @var{docstring} is the +documentation for the mode command. If you do not supply it, +@code{define-generic-mode} generates one by default. -@var{comment-list} is a list in which each element is either a -character, a string of one or two characters, or a cons cell. A -character or a string is set up in the mode's syntax table as a +The argument @var{comment-list} is a list in which each element is +either a character, a string of one or two characters, or a cons cell. +A character or a string is set up in the mode's syntax table as a ``comment starter.'' If the entry is a cons cell, the @sc{car} is set up as a ``comment starter'' and the @sc{cdr} as a ``comment ender.'' (Use @code{nil} for the latter if you want comments to end at the end -of the line.) Note that the syntax table has limitations about what -comment starters and enders are actually possible. @xref{Syntax -Tables}. +of the line.) Note that the syntax table mechanism has limitations +about what comment starters and enders are actually possible. +@xref{Syntax Tables}. -@var{keyword-list} is a list of keywords to highlight with -@code{font-lock-keyword-face}. Each keyword should be a string. -@var{font-lock-list} is a list of additional expressions to highlight. -Each element of this list should have the same form as an element of -@code{font-lock-keywords}. @xref{Search-based Fontification}. +The argument @var{keyword-list} is a list of keywords to highlight +with @code{font-lock-keyword-face}. Each keyword should be a string. +Meanwhile, @var{font-lock-list} is a list of additional expressions to +highlight. Each element of this list should have the same form as an +element of @code{font-lock-keywords}. @xref{Search-based +Fontification}. -@var{auto-mode-list} is a list of regular expressions to add to the -variable @code{auto-mode-alist}. These regular expressions are added -when Emacs runs the macro expansion. +The argument @var{auto-mode-list} is a list of regular expressions to +add to the variable @code{auto-mode-alist}. They are added by the execution +of the @code{define-generic-mode} form, not by expanding the macro call. -@var{function-list} is a list of functions to call to do some -additional setup. The mode command calls these functions just before -it runs the mode hook variable @code{@var{mode}-hook}. +Finally, @var{function-list} is a list of functions for the mode +command to call for additional setup. It calls these functions just +before it runs the mode hook variable @code{@var{mode}-hook}. @end defmac @node Mode Hooks @subsection Mode Hooks - The two last things a major mode function should do is run its mode -hook and finally the mode independent normal hook -@code{after-change-major-mode-hook}. If the major mode is a derived -mode, that is if it calls another major mode (the parent mode) in its -body, then the parent's mode hook is run just before the derived -mode's hook. Neither the parent's mode hook nor -@code{after-change-major-mode-hook} are run at the end of the actual -call to the parent mode. This applies recursively if the parent mode -has itself a parent. That is, the mode hooks of all major modes -called directly or indirectly by the major mode function are all run -in sequence at the end, just before -@code{after-change-major-mode-hook}. + Every major mode function should finish by running its mode hook and +the mode-independent normal hook @code{after-change-major-mode-hook}. +It does this by calling @code{run-mode-hooks}. If the major mode is a +derived mode, that is if it calls another major mode (the parent mode) +in its body, it should do this inside @code{delay-mode-hooks} so that +the parent won't run these hooks itself. Instead, the derived mode's +call to @code{run-mode-hooks} runs the parent's mode hook too. +@xref{Major Mode Conventions}. - These conventions are new in Emacs 22, and some major modes -implemented by users do not follow them yet. So if you put a function -onto @code{after-change-major-mode-hook}, keep in mind that some modes -will fail to run it. If a user complains about that, you can respond, -``That major mode fails to follow Emacs conventions, and that's why it -fails to work. Please fix the major mode.'' In most cases, that is -good enough, so go ahead and use @code{after-change-major-mode-hook}. -However, if a certain feature needs to be completely reliable, -it should not use @code{after-change-major-mode-hook} as of yet. + Emacs versions before Emacs 22 did not have @code{delay-mode-hooks}. +When user-implemented major modes have not been updated to use it, +they won't entirely follow these conventions: they may run the +parent's mode hook too early, or fail to run +@code{after-change-major-mode-hook}. If you encounter such a major +mode, please correct it to follow these conventions. When you defined a major mode using @code{define-derived-mode}, it automatically makes sure these conventions are followed. If you -define a major mode ``from scratch,'' not using -@code{define-derived-mode}, make sure the major mode command follows -these and other conventions. @xref{Major Mode Conventions}. You use -these functions to do it properly. +define a major mode ``by hand,'' not using @code{define-derived-mode}, +use the following functions to handle these conventions automatically. @defun run-mode-hooks &rest hookvars Major modes should run their mode hook using this function. It is similar to @code{run-hooks} (@pxref{Hooks}), but it also runs @code{after-change-major-mode-hook}. -When the call to this function is dynamically inside a -@code{delay-mode-hooks} form, this function does not run any hooks. +When this function is called during the execution of a +@code{delay-mode-hooks} form, it does not run the hooks immediately. Instead, it arranges for the next call to @code{run-mode-hooks} to run -@var{hookvars}. +them. @end defun @defmac delay-mode-hooks body@dots{} -This macro executes @var{body} like @code{progn}, but all calls to -@code{run-mode-hooks} inside @var{body} delay running their hooks. -They will be run by the first call to @code{run-mode-hooks} after exit -from @code{delay-mode-hooks}. This is the proper way for a major mode -command to invoke its parent mode. +When one major mode command calls another, it should do so inside of +@code{delay-mode-hooks}. + +This macro executes @var{body}, but tells all @code{run-mode-hooks} +calls during the execution of @var{body} to delay running their hooks. +The hooks will actually run during the next call to +@code{run-mode-hooks} after the end of the @code{delay-mode-hooks} +construct. @end defmac @defvar after-change-major-mode-hook -Every major mode function should run this normal hook at its very end. -It normally does not need to do so explicitly. Indeed, a major mode -function should normally run its mode hook with @code{run-mode-hooks} -as the very last thing it does, and the last thing -@code{run-mode-hooks} does is run @code{after-change-major-mode-hook}. +This is a normal hook run by @code{run-mode-hooks}. It is run at the +very end of every properly-written major mode function. @end defvar +@node Example Major Modes +@subsection Major Mode Examples + + Text mode is perhaps the simplest mode besides Fundamental mode. +Here are excerpts from @file{text-mode.el} that illustrate many of +the conventions listed above: + +@smallexample +@group +;; @r{Create the syntax table for this mode.} +(defvar text-mode-syntax-table + (let ((st (make-syntax-table))) + (modify-syntax-entry ?\" ". " st) + (modify-syntax-entry ?\\ ". " st) + ;; Add `p' so M-c on `hello' leads to `Hello', not `hello'. + (modify-syntax-entry ?' "w p" st) + st) + "Syntax table used while in `text-mode'.") +@end group + +;; @r{Create the keymap for this mode.} +@group +(defvar text-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\e\t" 'ispell-complete-word) + (define-key map "\es" 'center-line) + (define-key map "\eS" 'center-paragraph) + map) + "Keymap for `text-mode'. +Many other modes, such as Mail mode, Outline mode +and Indented Text mode, inherit all the commands +defined in this map.") +@end group +@end smallexample + + Here is how the actual mode command is defined now: + +@smallexample +@group +(define-derived-mode text-mode nil "Text" + "Major mode for editing text written for humans to read. +In this mode, paragraphs are delimited only by blank or white lines. +You can thus get the full benefit of adaptive filling + (see the variable `adaptive-fill-mode'). +\\@{text-mode-map@} +Turning on Text mode runs the normal hook `text-mode-hook'." +@end group +@group + (make-local-variable 'text-mode-variant) + (setq text-mode-variant t) + ;; @r{These two lines are a feature added recently.} + (set (make-local-variable 'require-final-newline) + mode-require-final-newline) + (set (make-local-variable 'indent-line-function) 'indent-relative)) +@end group +@end smallexample + + But here is how it was defined formerly, before +@code{define-derived-mode} existed: + +@smallexample +@group +;; @r{This isn't needed nowadays, since @code{define-derived-mode} does it.} +(defvar text-mode-abbrev-table nil + "Abbrev table used while in text mode.") +(define-abbrev-table 'text-mode-abbrev-table ()) +@end group + +@group +(defun text-mode () + "Major mode for editing text intended for humans to read... + Special commands: \\@{text-mode-map@} +@end group +@group +Turning on text-mode runs the hook `text-mode-hook'." + (interactive) + (kill-all-local-variables) + (use-local-map text-mode-map) +@end group +@group + (setq local-abbrev-table text-mode-abbrev-table) + (set-syntax-table text-mode-syntax-table) +@end group +@group + ;; @r{These four lines are absent from the current version} + ;; @r{not because this is done some other way, but rather} + ;; @r{because nowadays Text mode uses the normal definition of paragraphs.} + (make-local-variable 'paragraph-start) + (setq paragraph-start (concat "[ \t]*$\\|" page-delimiter)) + (make-local-variable 'paragraph-separate) + (setq paragraph-separate paragraph-start) + (make-local-variable 'indent-line-function) + (setq indent-line-function 'indent-relative-maybe) +@end group +@group + (setq mode-name "Text") + (setq major-mode 'text-mode) + (run-mode-hooks 'text-mode-hook)) ; @r{Finally, this permits the user to} + ; @r{customize the mode with a hook.} +@end group +@end smallexample + +@cindex @file{lisp-mode.el} + The three Lisp modes (Lisp mode, Emacs Lisp mode, and Lisp +Interaction mode) have more features than Text mode and the code is +correspondingly more complicated. Here are excerpts from +@file{lisp-mode.el} that illustrate how these modes are written. + +@cindex syntax table example +@smallexample +@group +;; @r{Create mode-specific table variables.} +(defvar lisp-mode-syntax-table nil "") +(defvar lisp-mode-abbrev-table nil "") +@end group + +@group +(defvar emacs-lisp-mode-syntax-table + (let ((table (make-syntax-table))) + (let ((i 0)) +@end group + +@group + ;; @r{Set syntax of chars up to @samp{0} to say they are} + ;; @r{part of symbol names but not words.} + ;; @r{(The digit @samp{0} is @code{48} in the @acronym{ASCII} character set.)} + (while (< i ?0) + (modify-syntax-entry i "_ " table) + (setq i (1+ i))) + ;; @r{@dots{} similar code follows for other character ranges.} +@end group +@group + ;; @r{Then set the syntax codes for characters that are special in Lisp.} + (modify-syntax-entry ? " " table) + (modify-syntax-entry ?\t " " table) + (modify-syntax-entry ?\f " " table) + (modify-syntax-entry ?\n "> " table) +@end group +@group + ;; @r{Give CR the same syntax as newline, for selective-display.} + (modify-syntax-entry ?\^m "> " table) + (modify-syntax-entry ?\; "< " table) + (modify-syntax-entry ?` "' " table) + (modify-syntax-entry ?' "' " table) + (modify-syntax-entry ?, "' " table) +@end group +@group + ;; @r{@dots{}likewise for many other characters@dots{}} + (modify-syntax-entry ?\( "() " table) + (modify-syntax-entry ?\) ")( " table) + (modify-syntax-entry ?\[ "(] " table) + (modify-syntax-entry ?\] ")[ " table)) + table)) +@end group +@group +;; @r{Create an abbrev table for lisp-mode.} +(define-abbrev-table 'lisp-mode-abbrev-table ()) +@end group +@end smallexample + + The three modes for Lisp share much of their code. For instance, +each calls the following function to set various variables: + +@smallexample +@group +(defun lisp-mode-variables (lisp-syntax) + (when lisp-syntax + (set-syntax-table lisp-mode-syntax-table)) + (setq local-abbrev-table lisp-mode-abbrev-table) + @dots{} +@end group +@end smallexample + + In Lisp and most programming languages, we want the paragraph +commands to treat only blank lines as paragraph separators. And the +modes should undestand the Lisp conventions for comments. The rest of +@code{lisp-mode-variables} sets this up: + +@smallexample +@group + (make-local-variable 'paragraph-start) + (setq paragraph-start (concat page-delimiter "\\|$" )) + (make-local-variable 'paragraph-separate) + (setq paragraph-separate paragraph-start) + @dots{} +@end group +@group + (make-local-variable 'comment-indent-function) + (setq comment-indent-function 'lisp-comment-indent)) + @dots{} +@end group +@end smallexample + + Each of the different Lisp modes has a slightly different keymap. For +example, Lisp mode binds @kbd{C-c C-z} to @code{run-lisp}, but the other +Lisp modes do not. However, all Lisp modes have some commands in +common. The following code sets up the common commands: + +@smallexample +@group +(defvar shared-lisp-mode-map () + "Keymap for commands shared by all sorts of Lisp modes.") + +;; @r{Putting this @code{if} after the @code{defvar} is an older style.} +(if shared-lisp-mode-map + () + (setq shared-lisp-mode-map (make-sparse-keymap)) + (define-key shared-lisp-mode-map "\e\C-q" 'indent-sexp) + (define-key shared-lisp-mode-map "\177" + 'backward-delete-char-untabify)) +@end group +@end smallexample + +@noindent +And here is the code to set up the keymap for Lisp mode: + +@smallexample +@group +(defvar lisp-mode-map () + "Keymap for ordinary Lisp mode...") + +(if lisp-mode-map + () + (setq lisp-mode-map (make-sparse-keymap)) + (set-keymap-parent lisp-mode-map shared-lisp-mode-map) + (define-key lisp-mode-map "\e\C-x" 'lisp-eval-defun) + (define-key lisp-mode-map "\C-c\C-z" 'run-lisp)) +@end group +@end smallexample + + Finally, here is the complete major mode function definition for +Lisp mode. + +@smallexample +@group +(defun lisp-mode () + "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp. +Commands: +Delete converts tabs to spaces as it moves back. +Blank lines separate paragraphs. Semicolons start comments. +\\@{lisp-mode-map@} +Note that `run-lisp' may be used either to start an inferior Lisp job +or to switch back to an existing one. +@end group + +@group +Entry to this mode calls the value of `lisp-mode-hook' +if that value is non-nil." + (interactive) + (kill-all-local-variables) +@end group +@group + (use-local-map lisp-mode-map) ; @r{Select the mode's keymap.} + (setq major-mode 'lisp-mode) ; @r{This is how @code{describe-mode}} + ; @r{finds out what to describe.} + (setq mode-name "Lisp") ; @r{This goes into the mode line.} + (lisp-mode-variables t) ; @r{This defines various variables.} + (make-local-variable 'comment-start-skip) + (setq comment-start-skip + "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\)\\(;+\\|#|\\) *") + (make-local-variable 'font-lock-keywords-case-fold-search) + (setq font-lock-keywords-case-fold-search t) +@end group +@group + (setq imenu-case-fold-search t) + (set-syntax-table lisp-mode-syntax-table) + (run-mode-hooks 'lisp-mode-hook)) ; @r{This permits the user to use a} + ; @r{hook to customize the mode.} +@end group +@end smallexample + @node Minor Modes @section Minor Modes @cindex minor mode @@ -1533,16 +1522,14 @@ minor modes. @subsection Mode Line Basics @code{mode-line-format} is a buffer-local variable that holds a -@dfn{mode line construct}, a kind of template, which controls the -display the mode line of the current buffer. All windows for the same -buffer use the same @code{mode-line-format}, so their mode lines -appear the same---except for scrolling percentages, and line and -column numbers, since those depend on point and on how the window is -scrolled. The value of @code{header-line-format} specifies the -buffer's header line in the same way, with a mode line construct. +@dfn{mode line construct}, a kind of template, which controls what is +displayed on the mode line of the current buffer. The value of +@code{header-line-format} specifies the buffer's header line in the +same way. All windows for the same buffer use the same +@code{mode-line-format} and @code{header-line-format}. - For efficiency, Emacs does not recompute the mode line and header -line of a window in every redisplay. It does so when circumstances + For efficiency, Emacs does not continuously recompute the mode +line and header line of a window. It does so when circumstances appear to call for it---for instance, if you change the window configuration, switch buffers, narrow or widen the buffer, scroll, or 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 update of the mode line so as to display the new information or display it in the new way. -@c Emacs 19 feature @defun force-mode-line-update &optional all Force redisplay of the current buffer's mode line and header line. 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. @table @code @cindex percent symbol in mode line @item @var{string} -A string as a mode-line construct appears verbatim in the mode line -except for @dfn{@code{%}-constructs} in it. These stand for -substitution of other data; see @ref{%-Constructs}. +A string as a mode-line construct appears verbatim except for +@dfn{@code{%}-constructs} in it. These stand for substitution of +other data; see @ref{%-Constructs}. -If the string has @code{face} properties, they are copied into the -mode line contents too (@pxref{Properties in Mode}). Any characters -in the mode line which have no @code{face} properties are displayed, -by default, in the face @code{mode-line} or @code{mode-line-inactive} -(@pxref{Standard Faces,,, emacs, The GNU Emacs Manual}). +If parts of the string have @code{face} properties, they control +display of the text just as they would text in the buffer. Any +characters which have no @code{face} properties are displayed, by +default, in the face @code{mode-line} or @code{mode-line-inactive} +(@pxref{Standard Faces,,, emacs, The GNU Emacs Manual}). The +@code{help-echo} and @code{local-map} properties in @var{string} have +special meanings. @xref{Properties in Mode}. @item @var{symbol} 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 non-@code{nil} @code{risky-local-variable} property), all text properties specified in @var{symbol}'s value are ignored. This includes the text properties of strings in @var{symbol}'s value, as -well as all @code{:eval} and @code{:propertize} forms in it. +well as all @code{:eval} and @code{:propertize} forms in it. (The +reason for this is security: non-risky variables could be set +automatically from file variables without prompting the user.) @item (@var{string} @var{rest}@dots{}) @itemx (@var{list} @var{rest}@dots{}) @@ -2055,10 +2045,10 @@ structure, and make @var{form} evaluate to a string that has a text property. @end enumerate - You use the @code{local-map} property to specify a keymap. Like any -keymap, it can bind character keys and function keys; but that has no -effect, since it is impossible to move point into the mode line. This -keymap can only take real effect for mouse clicks. + You can use the @code{local-map} property to specify a keymap. This +keymap only takes real effect for mouse clicks; binding character keys +and function keys to it has no effect, since it is impossible to move +point into the mode line. When the mode line refers to a variable which does not have a non-@code{nil} @code{risky-local-variable} property, any text @@ -2889,6 +2879,10 @@ Used (typically) for constant names. @vindex font-lock-preprocessor-face Used (typically) for preprocessor commands. +@item font-lock-negation-char-face +@vindex font-lock-negation-char-face +Used (typically) for easily-overlooked negation characters. + @item font-lock-warning-face @vindex font-lock-warning-face Used (typically) for constructs that are peculiar, or that greatly @@ -3057,7 +3051,7 @@ so that the scanned text never starts or ends in the middle of a multiline construct. @item Add a function to @code{font-lock-extend-region-functions} that does -the \emph{identification} and extends the scan so that the scanned +the @emph{identification} and extends the scan so that the scanned text never starts or ends in the middle of a multiline construct. @end itemize diff --git a/lispref/os.texi b/lispref/os.texi index 30f66889387..ab277afdce6 100644 --- a/lispref/os.texi +++ b/lispref/os.texi @@ -1256,7 +1256,9 @@ This stands for the year without century (00-99). @item %Y This stands for the year with century. @item %Z -This stands for the time zone abbreviation. +This stands for the time zone abbreviation (e.g., @samp{EST}). +@item %z +This stands for the time zone numerical offset (e.g., @samp{-0500}). @end table You can also specify the field width and type of padding for any of @@ -1286,12 +1288,14 @@ If @var{universal} is non-@code{nil}, that means to describe the time as Universal Time; @code{nil} means describe it using what Emacs believes is the local time zone (see @code{current-time-zone}). -This function uses the C library function @code{strftime} to do most of -the work. In order to communicate with that function, it first encodes -its argument using the coding system specified by -@code{locale-coding-system} (@pxref{Locales}); after @code{strftime} -returns the resulting string, @code{format-time-string} decodes the -string using that same coding system. +This function uses the C library function @code{strftime} +(@pxref{Formatting Calendar Time,,, libc, The GNU C Library Reference +Manual}) to do most of the work. In order to communicate with that +function, it first encodes its argument using the coding system +specified by @code{locale-coding-system} (@pxref{Locales}); after +@code{strftime} returns the resulting string, +@code{format-time-string} decodes the string using that same coding +system. @end defun @defun seconds-to-time seconds diff --git a/lispref/strings.texi b/lispref/strings.texi index 46c01982f32..17a62b546b4 100644 --- a/lispref/strings.texi +++ b/lispref/strings.texi @@ -700,8 +700,8 @@ in the copy with encodings of the corresponding @var{objects}. The arguments @var{objects} are the computed values to be formatted. The characters in @var{string}, other than the format specifications, -are copied directly into the output; if they have text properties, -these are copied into the output also. +are copied directly into the output, including their text properties, +if any. @end defun @cindex @samp{%} in format @@ -719,6 +719,17 @@ For example: @end group @end example + Since @code{format} interprets @samp{%} characters as format +specifications, you should @emph{never} pass an arbitrary string as +the first argument. This is particularly true when the string is +generated by some Lisp code. Unless the string is @emph{known} to +never include any @samp{%} characters, pass @code{"%s"}, described +below, as the first argument, and the string as the second, like this: + +@example + (format "%s" @var{arbitrary-string}) +@end example + If @var{string} contains more than one format specification, the format specifications correspond to successive values from @var{objects}. Thus, the first format specification in @var{string} diff --git a/lispref/text.texi b/lispref/text.texi index 08e55f18f05..4d2f278bee8 100644 --- a/lispref/text.texi +++ b/lispref/text.texi @@ -103,9 +103,9 @@ This function returns the character following point in the current buffer. This is similar to @code{(char-after (point))}. However, if point is at the end of the buffer, then @code{following-char} returns 0. -Remember that point is always between characters, and the terminal -cursor normally appears over the character following point. Therefore, -the character returned by @code{following-char} is the character the +Remember that point is always between characters, and the cursor +normally appears over the character following point. Therefore, the +character returned by @code{following-char} is the character the cursor is over. 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} is the numeric prefix argument. @end deffn -@deffn Command split-line -This command splits the current line, moving the portion of the line -after point down vertically so that it is on the next line directly -below where it was before. Whitespace is inserted as needed at the -beginning of the lower line, using the @code{indent-to} function. -@code{split-line} returns the position of point. - -Programs hardly ever use this function. -@end deffn - @defvar overwrite-mode This variable controls whether overwrite mode is in effect. The value should be @code{overwrite-mode-textual}, @code{overwrite-mode-binary}, @@ -978,8 +968,11 @@ the @var{undo} value. @comment node-name, next, previous, up @subsection Functions for Yanking - @dfn{Yanking} means reinserting an entry of previously killed text -from the kill ring. The text properties are copied too. + This section describes higher-level commands for yanking, which are +intended primarily for the user but useful also in Lisp programs. +Both @code{yank} and @code{yank-pop} honor the +@code{yank-excluded-properties} variable and @code{yank-handler} text +property (@pxref{Yanking}). @deffn Command yank &optional arg @cindex inserting killed text @@ -1213,7 +1206,7 @@ value for @code{kill-ring-max} is 60. to the buffer's text so that they can be undone. (The buffers that don't have one are usually special-purpose buffers for which Emacs assumes that undoing is not useful. In particular, any buffer whose -name begins with a space has its undo recording off by default, +name begins with a space has its undo recording off by default; see @ref{Buffer Names}.) All the primitives that modify the text in the buffer automatically add elements to the front of the undo list, which is in the variable @code{buffer-undo-list}. @@ -1318,8 +1311,7 @@ they're being called for the sake of undoing. @defun primitive-undo count list This is the basic function for undoing elements of an undo list. It undoes the first @var{count} elements of @var{list}, returning -the rest of @var{list}. You could write this function in Lisp, -but it is convenient to have it in C. +the rest of @var{list}. @code{primitive-undo} adds elements to the buffer's undo list when it 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'' of an undo list measures the cons cells that make up the list, plus the strings of deleted text.) Three variables control the range of acceptable sizes: @code{undo-limit}, @code{undo-strong-limit} and -@code{undo-outer-limit}. +@code{undo-outer-limit}. In these variables, size is counted as the +number of bytes occupied, which includes both saved text and other +data. @defopt undo-limit 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. This is a last ditch limit to prevent memory overflow. @end defopt +@defopt undo-ask-before-discard +If this variable is non-@code{nil}, when the undo info exceeds +@code{undo-outer-limit}, Emacs asks in the echo area whether to +discard the info. The default value is @code{nil}, which means to +discard it automatically. + +This option is mainly intended for debugging. Garbage collection is +inhibited while the question is asked, which means that Emacs might +leak memory if the user waits too long before answering the question. +@end defopt + @node Filling @comment node-name, next, previous, up @section Filling @@ -1481,8 +1486,6 @@ it. If the region was made up of many paragraphs, the blank lines between paragraphs are removed. This function justifies as well as filling when @var{justify} is non-@code{nil}. -In an interactive call, any prefix argument requests justification. - If @var{nosqueeze} is non-@code{nil}, that means to leave whitespace other than line breaks untouched. If @var{squeeze-after} is 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 @defun current-justification This function returns the proper justification style to use for filling the text around point. + +This returns the value of the @code{justification} text property at +point, or the variable @var{default-justification} if there is no such +text property. However, it returns @code{nil} rather than @code{none} +to mean ``don't justify''. @end defun @defopt sentence-end-double-space @@ -1569,14 +1577,14 @@ newlines'' act as paragraph separators. @section Margins for Filling @defopt fill-prefix -This buffer-local variable specifies a string of text that appears at -the beginning -of normal text lines and should be disregarded when filling them. Any -line that fails to start with the fill prefix is considered the start of -a paragraph; so is any line that starts with the fill prefix followed by -additional whitespace. Lines that start with the fill prefix but no -additional whitespace are ordinary text lines that can be filled -together. The resulting filled lines also start with the fill prefix. +This buffer-local variable, if non-@code{nil}, specifies a string of +text that appears at the beginning of normal text lines and should be +disregarded when filling them. Any line that fails to start with the +fill prefix is considered the start of a paragraph; so is any line +that starts with the fill prefix followed by additional whitespace. +Lines that start with the fill prefix but no additional whitespace are +ordinary text lines that can be filled together. The resulting filled +lines also start with the fill prefix. The fill prefix follows the left margin whitespace, if any. @end defopt @@ -1661,12 +1669,11 @@ becomes buffer-local when set in any fashion. @defvar fill-nobreak-predicate This variable gives major modes a way to specify not to break a line -at certain places. Its value should be a list of functions, but a -single function is also supported for compatibility. Whenever filling -considers breaking the line at a certain place in the buffer, it calls -each of these functions with no arguments and with point located at -that place. If any of the functions returns non-@code{nil}, then the -line won't be broken there. +at certain places. Its value should be a list of functions. Whenever +filling considers breaking the line at a certain place in the buffer, +it calls each of these functions with no arguments and with point +located at that place. If any of the functions returns +non-@code{nil}, then the line won't be broken there. @end defvar @node Adaptive Fill @@ -1733,7 +1740,7 @@ Adaptive Fill mode matches this regular expression against the text starting after the left margin whitespace (if any) on a line; the characters it matches are that line's candidate for the fill prefix. -@w{@code{"[ \t]*\\([-|#;>*]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"}} is the +@w{@code{"[ \t]*\\([-!|#%;>*·•‣âƒâ—¦]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"}} is the default value. This matches a number enclosed in parentheses or followed by a period, or certain punctuation characters, or any sequence of these intermingled with whitespace. In particular, it @@ -1898,7 +1905,8 @@ the sort order." (save-restriction (narrow-to-region beg end) (goto-char (point-min)) - (sort-subr reverse 'forward-line 'end-of-line)))) + (let ((inhibit-field-text-motion t)) + (sort-subr reverse 'forward-line 'end-of-line))))) @end group @end example @@ -2054,9 +2062,12 @@ One unusual thing about this command is that the entire line containing position @var{beg}, and the entire line containing position @var{end}, are included in the region sorted. -Note that @code{sort-columns} uses the @code{sort} utility program, -and so cannot work properly on text containing tab characters. Use -@kbd{M-x untabify} to convert tabs to spaces before sorting. +Note that @code{sort-columns} rejects text that contains tabs, because +tabs could be split across the specified columns. Use @kbd{M-x +untabify} to convert tabs to spaces before sorting. + +When possible, this command actually works by calling the @code{sort} +utility program. @end deffn @node Columns @@ -2391,6 +2402,7 @@ spaces and tab characters to reach the next tab stop column; it does not affect the display of tab characters in the buffer (@pxref{Usual Display}). Note that the @key{TAB} character as input uses this tab stop feature only in a few major modes, such as Text mode. +@xref{Tab Stops,,, emacs, The GNU Emacs Manual}. @deffn Command tab-to-tab-stop 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. @cindex keymap of character @kindex keymap @r{(text property)} The @code{keymap} property specifies an additional keymap for -commands. The property's value for the character before point applies -if it is non-@code{nil} and rear-sticky, and the property's value for -the character after point applies if it is non-@code{nil} and -front-sticky. (For mouse clicks, the position of the click is used -instead of the position of point.) If the property value is a symbol, -the symbol's function definition is used as the keymap. +commands. When this keymap applies, it is used for key lookup before +the minor mode keymaps and before the buffer's local map. +@xref{Active Keymaps}. If the property value is a symbol, the +symbol's function definition is used as the keymap. -When this keymap applies, it is used for key lookup before the minor -mode keymaps and before the buffer's local map. @xref{Active -Keymaps}. +The property's value for the character before point applies if it is +non-@code{nil} and rear-sticky, and the property's value for the +character after point applies if it is non-@code{nil} and +front-sticky. (For mouse clicks, the position of the click is used +instead of the position of point.) @item local-map @kindex local-map @r{(text property)} This property works like @code{keymap} except that it specifies a keymap to use @emph{instead of} the buffer's local map. For most -purposes (perhaps all purposes), the @code{keymap} is superior. +purposes (perhaps all purposes), it is better to use the @code{keymap} +property. @item syntax-table The @code{syntax-table} property overrides what the syntax table says @@ -3479,9 +3492,16 @@ being called over and over for the same text. @subsection Defining Clickable Text @cindex clickable text - There are two parts of setting up @dfn{clickable text} in a buffer: -(1) to indicate clickability when the mouse moves over the text, and (2) -to make a mouse button do something when you click on that text. + @dfn{Clickable text} is text that can be clicked, with either the +the mouse or via keyboard commands, to produce some result. Many +major modes use clickable text to implement features such as +hyper-links. The @code{button} package provides an easy way to insert +and manipulate clickable text. @xref{Buttons}. + + In this section, we will explain how to manually set up clickable +text in a buffer using text properties. This involves two things: (1) +indicating clickability when the mouse moves over the text, and (2) +making @kbd{RET} or a mouse click on that text do something. Indicating clickability usually involves highlighting the text, and often involves displaying helpful information about the action, such diff --git a/man/ChangeLog b/man/ChangeLog index 4723b892276..4063ca3e2b0 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,63 @@ +2006-08-16 Richard Stallman + + * misc.texi (Saving Emacs Sessions): Clean up wording. + + * mark.texi (Marking Objects): Mention term "select all". + + * emacs.texi (Top): Update subnode menu. + + * help.texi (Help Mode): Move node up in file. + +2006-08-15 Carsten Dominik + + * org.texi (Installation, Activation): Split from Installation and + Activation. + (Clocking work time): Documented new features. + +2006-08-15 Nick Roberts + + * building.texi (Stack Buffer): Explain fringe arrow. + +2006-08-13 Alex Schroeder + + * rcirc.texi (Configuration): Use correct variable in rcirc-authinfo + example. + +2006-08-12 Eli Zaretskii + + * faq.texi (How to add fonts): New node. + + * misc.texi (Saving Emacs Sessions): Clarify when desktop is restored + on startup. + +2006-08-11 Romain Francoise + + * ack.texi (Acknowledgments): Delete mention to zone-mode.el. + +2006-08-10 Sven Joachim (tiny change) + + * mule.texi (Recognize Coding, Text Coding): Fix typos. + +2006-08-10 Richard Stallman + + * text.texi (Format Faces): Substantial rewrites to deal + with face merging. Empty regions don't count. Clarify + face property inheritance. + +2006-08-08 Romain Francoise + + * dired.texi (Marks vs Flags): Fix typo reported by Ari Roponen + . + +2006-08-05 Romain Francoise + + * faq.texi (New in Emacs 22): Expand. + +2006-08-04 Eli Zaretskii + + * cmdargs.texi (Window Size X) <--geometry>: Only width and height + apply to all frames. + 2006-08-03 Michael Olson * erc.texi: Update for ERC 5.1.4. @@ -10,7 +70,7 @@ * building.texi (GDB Graphical Interface): Shorten node names. (GDB-UI Layout): Use GDB-related. - (Stack Buffer): Simplify English. + (Other GDB-UI Buffers): Simplify English. 2006-07-31 Richard Stallman @@ -31,7 +91,7 @@ * building.texi (GDB commands in Fringe): Rename to... (Source Buffers): ..this and move forward. Describe hollow arrow and new option gdb-find-source-frame. - + 2006-07-29 Richard Stallman * dired.texi (Operating on Files): Simplify previous change @@ -45,7 +105,7 @@ 2006-07-28 Richard Stallman * mark.texi (Transient Mark): Clarify that region never disappears - when Transient Mark mode is off, and not when it is on. + when Transient Mark mode is off, and not when it is on. 2006-07-27 Richard Stallman @@ -55,15 +115,15 @@ * xresources.texi (GTK styles): Fix texinfo usage. - * pgg.texi, org.texi, info.texi, forms.texi, flymake.texi: + * pgg.texi, org.texi, info.texi, forms.texi, flymake.texi: * faq.texi: Move periods and commas inside quotes. * commands.texi (User Input): Explain why we teach keyboard cmds. - - * xresources.texi, xresmini.texi, search.texi, programs.texi: - * misc.texi, kmacro.texi, killing.texi, glossary.texi: - * fortran-xtra.texi, files.texi, emacs.texi, emacs-xtra.texi: - * doclicense.texi, display.texi, dired.texi, basic.texi: + + * xresources.texi, xresmini.texi, search.texi, programs.texi: + * misc.texi, kmacro.texi, killing.texi, glossary.texi: + * fortran-xtra.texi, files.texi, emacs.texi, emacs-xtra.texi: + * doclicense.texi, display.texi, dired.texi, basic.texi: * anti.texi, ack.texi: Move periods and commas inside quotes. 2006-07-22 Eli Zaretskii 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. @item John Heidemann wrote @file{mouse-copy.el} and @file{mouse-drag.el}, which provide alternative mouse-based editing and scrolling features. -He also contributed @file{zone-mode.el}, a major mode for editing DNS -zone files. @item Jon K Hellan wrote @file{utf7.el}, support for mail-safe transformation diff --git a/man/building.texi b/man/building.texi index 8b479960e71..68aeb023b76 100644 --- a/man/building.texi +++ b/man/building.texi @@ -1001,12 +1001,13 @@ of the nested subroutine calls (@dfn{stack frames}) now active in the program. @xref{Backtrace,, Backtraces, gdb, The GNU debugger}. @findex gdb-frames-select - The selected frame number is displayed in reverse contrast. To -select a frame in GDB, move point in the stack buffer to that stack -frame and type @key{RET} (@code{gdb-frames-select}), or click +An arrow in the fringe points to the selected frame or, if the fringe is +not present, the number of the selected frame is displayed in reverse +contrast. To select a frame in GDB, move point in the stack buffer to +that stack frame and type @key{RET} (@code{gdb-frames-select}), or click @kbd{Mouse-2} on a stack frame. If the locals buffer is visible, -selecting a stack frame updates it to display the local variables of -the new frame. +selecting a stack frame updates it to display the local variables of the +new frame. @node Other GDB-UI Buffers @subsubsection Other Buffers @@ -1018,7 +1019,7 @@ If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil}, the program being debugged takes its input and displays its output here. Otherwise it uses the GUD buffer for that. To toggle whether GUD mode uses this buffer, do @kbd{M-x gdb-use-separate-io-buffer}. -That takes effect when you next restart the program you are debugging. +This takes effect when you next restart the program you are debugging. The history and replay commands from Shell mode are available here, as are the commands to send signals to the debugged program. diff --git a/man/cmdargs.texi b/man/cmdargs.texi index a1b26bcdcb3..fc17d7ec695 100644 --- a/man/cmdargs.texi +++ b/man/cmdargs.texi @@ -1013,7 +1013,9 @@ position of the initial Emacs frame: @cindex geometry, command-line argument Specify the size @var{width} and @var{height} (measured in character columns and lines), and positions @var{xoffset} and @var{yoffset} -(measured in pixels). This applies to all frames. +(measured in pixels). The @var{width} and @var{height} parameters +apply to all frames, whereas @var{xoffset} and @var{yoffset} only to +the initial frame. @item -fs @opindex -fs diff --git a/man/dired.texi b/man/dired.texi index 3bb32c1ac74..0281c6b0107 100644 --- a/man/dired.texi +++ b/man/dired.texi @@ -325,7 +325,7 @@ for @file{..} and typing @kbd{f} there. Instead of flagging a file with @samp{D}, you can @dfn{mark} the file with some other character (usually @samp{*}). Most Dired commands to operate on files use the files marked with @samp{*}. The -only command that operates on flagged flies is @kbd{x}, which expunges +only command that operates on flagged files is @kbd{x}, which expunges them. Here are some commands for marking with @samp{*}, for unmarking, and diff --git a/man/emacs.texi b/man/emacs.texi index 5277a5cebbc..780b5c97b6e 100644 --- a/man/emacs.texi +++ b/man/emacs.texi @@ -272,9 +272,9 @@ Help * Key Help:: Asking what a key does in Emacs. * Name Help:: Asking about a command, variable or function name. * Apropos:: Asking what pertains to a given topic. +* Help Mode:: Special features of Help mode and Help buffers. * Library Keywords:: Finding Lisp libraries by keywords (topics). * Language Help:: Help relating to international language support. -* Help Mode:: Special features of Help mode and Help buffers. * Misc Help:: Other help commands. * Help Files:: Commands to display pre-written help files. * Help Echo:: Help on active text and tooltips (`balloon help') diff --git a/man/faq.texi b/man/faq.texi index 7890c13a4d8..54be5f38a65 100644 --- a/man/faq.texi +++ b/man/faq.texi @@ -1146,16 +1146,28 @@ and on @code{xterm} with @kbd{emacs -nw}. @cindex Emacs 22, new features in @cindex Recently introduced features -@c FIXME: Improve this node before the 22.1 release. @cindex Default features -Font-lock mode, auto-compression mode, and file name shadow mode are now -enabled by default. It is now possible to follow links with -@kbd{mouse-1}. +Font Lock mode, auto-compression mode, and file name shadow mode are now +enabled by default. On graphics displays it is now possible to follow +links with @kbd{mouse-1}, and the modeline of the selected window is now +highlighted. Window fringes are now customizable. The minibuffer +prompt is now displayed in a distinct face. -@cindex Supported systems -Emacs 22 features support for GNU/Linux systems on S390 and X86-64 -machines, as well as support for the Mac OS X and Cygwin operating -systems. +Emacs now reads abbrev definitions automatically at startup. The +maximum size of buffers has been doubled and is now 256M on 32-bit +machines. Grep mode is now separate from Compilation mode and has many +new specific options and commands. + +The original Emacs macro system has been replaced by the new Kmacro +package, which provides many new commands and features and a simple +interface that uses the function keys F3 and F4. Macros are now stored +in a macro ring, and can be debugged and edited interactively. + +The GUD (Grand Unified Debugger) package can now be used with a full +graphical user interface to the debugger which provides many features +found in traditional development environments, making it easy to +manipulate breakpoints, add watch points, display the call stack, etc. +Breakpoints are now displayed in the source buffer. @cindex GTK+ Toolkit @cindex Drag-and-drop @@ -1164,15 +1176,39 @@ Emacs can now be built with GTK+ widgets, and supports drag-and-drop operation on X. Mouse wheel support is now enabled by default. @cindex New modes -Many new modes and packages have been included in Emacs, such as Leim, -Calc, Tramp and URL, as well as IDO, CUA, rcirc, ERC, conf-mode, -python-mode, table, tumme, SES, ruler, Flymake, Org, PGG, etc. +Many new modes and packages have been included in Emacs, such as Calc, +Tramp and URL, as well as IDO, CUA, rcirc, ERC, conf-mode, python-mode, +table, tumme, SES, ruler, Flymake, Org, PGG, wdired, t-mouse, longlines, +dns-mode, savehist, Password, Printing, Reveal, etc. + +@cindex Multilingual Environment +Leim is now part of Emacs. Unicode support has been much improved, and +the following input methods have been added: belarusian, bulgarian-bds, +bulgarian-phonetic, chinese-sisheng, croatian, dutch, georgian, +latin-alt-postfix, latin-postfix, latin-prefix, latvian-keyboard, +lithuanian-numeric, lithuanian-keyboard, malayalam-inscript, rfc1345, +russian-computer, sgml, slovenian, tamil-inscript ucs, +ukrainian-computer, vietnamese-telex, and welsh. + +The following language environment have also been added: Belarusian, +Bulgarian, Chinese-EUC-TW, Croatian, French, Georgian, Italian, Latin-6, +Latin-7, Latvian, Lithuanian, Malayalam, Russian, Russian, Slovenian, +Swedish, Tajik, Tamil, UTF-8, Ukrainian, Ukrainian, Welsh, and +Windows-1255. + +@cindex Supported systems +Emacs 22 features support for GNU/Linux systems on S390 and x86-64 +machines, as well as support for the Mac OS X and Cygwin operating +systems. @cindex Documentation @cindex Emacs Lisp Manual In addition, Emacs 22 now includes the Emacs Lisp Reference Manual (@pxref{Emacs Lisp documentation}) and the Emacs Lisp Intro. +Many other changes have been made in Emacs 22, use @kbd{C-h n} to get a +full list. + @c ------------------------------------------------------------ @node Common requests, Bugs and problems, Status of Emacs, Top @chapter Common requests @@ -4837,6 +4873,7 @@ You can get the old behavior by binding @kbd{SPC} to * Inputting eight-bit characters:: * Kanji and Chinese characters:: * Right-to-left alphabets:: +* How to add fonts:: @end menu @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 Enhancement to Emacs. @xref{Installing Emacs}, for information on where to find and download the latest version of Emacs. -@node Right-to-left alphabets, , Kanji and Chinese characters, Alternate character sets +@node Right-to-left alphabets, How to add fonts, Kanji and Chinese characters, Alternate character sets @section Where is an Emacs that can handle Semitic (right-to-left) alphabets? @cindex Right-to-left alphabets @cindex Hebrew, handling with Emacs @@ -4896,8 +4933,128 @@ Emacs 18. Write to Joel if you want the patches or package. @file{hebrew.el} requires a Hebrew screen font, but no other hardware support. Joel has a screen font for PCs running MS-DOS or GNU/Linux. -You might also try to query archie for files named with @file{hebrew}; -several ftp sites in Israel may also have the necessary files. +You might also try querying @code{archie} for files named with +@file{hebrew}; several ftp sites in Israel may also have the necessary +files. + +@node How to add fonts, , Right-to-left alphabets, Alternate character sets +@section How do I add fonts for use with Emacs? +@cindex add fonts for use with Emacs +@cindex intlfonts + +First, download and install the BDF font files and any auxiliary +packages they need. The GNU Intlfonts distribution can be found on +@uref{http://directory.fsf.org/localization/intlfonts.html, the GNU +Software Directory Web site}. + +Next, if you are on X Window system, issue the following two commands +from the shell's prompt: + +@example + xset +fp /usr/local/share/emacs/fonts + xset fp rehash +@end example + +@noindent +(Modify the first command if you installed the fonts in a directory +that is not @file{/usr/local/share/emacs/fonts}.) You also need to +arrange for these two commands to run whenever you log in, e.g., by +adding them to your window-system startup file, such as +@file{~/.xsessionrc} or @file{~/.gnomerc}. + +Now, add the following line to your @file{~/.emacs} init file: + +@lisp + (add-to-list 'bdf-directory-list "/usr/share/emacs/fonts/bdf") +@end lisp + +@noindent +(Again, modify the file name if you installed the fonts elsewhere.) + +Finally, if you wish to use the installed fonts with @code{ps-print}, +add the following line to your @file{~/.emacs}: + +@lisp + (setq ps-multibyte-buffer 'bdf-font-except-latin) +@end lisp + +A few additional steps are necessary for MS-Windows; they are listed +below. + +First, make sure @emph{all} the directories with BDF font files are +mentioned in @code{bdf-directory-list}. On Unix and GNU/Linux +systems, one normally runs @kbd{make install} to install the BDF fonts +in the same directory. By contrast, Windows users typically don't run +the Intlfonts installation command, but unpack the distribution in +some directory, which leaves the BDF fonts in its subdirectories. For +example, assume that you unpacked Intlfonts in @file{C:/Intlfonts}; +then you should set @code{bdf-directory-list} as follows: + +@lisp + (setq bdf-directory-list + '("C:/Intlfonts/Asian" + "C:/Intlfonts/Chinese" "C:/Intlfonts/Chinese.X" + "C:/Intlfonts/Chinese.BIG" "C:/Intlfonts/Ethiopic" + "C:/Intlfonts/European" "C:/Intlfonts/European.BIG" + "C:/Intlfonts/Japanese" "C:/Intlfonts/Japanese.X" + "C:/Intlfonts/Japanese.BIG" "C:/Intlfonts/Korean.X" + "C:/Intlfonts/Misc")) +@end lisp + +@cindex @code{w32-bdf-filename-alist} +@cindex @code{w32-find-bdf-fonts} +Next, you need to set up the variable @code{w32-bdf-filename-alist} to +an alist of the BDF fonts and their corresponding file names. +Assuming you have set @code{bdf-directory-list} to name all the +directories with the BDF font files, the following Lisp snippet will +set up @code{w32-bdf-filename-alist}: + +@lisp + (setq w32-bdf-filename-alist + (w32-find-bdf-fonts bdf-directory-list)) +@end lisp + +Now, create fontsets for the BDF fonts: + +@lisp + (create-fontset-from-fontset-spec + "-*-fixed-medium-r-normal-*-16-*-*-*-c-*-fontset-bdf, + japanese-jisx0208:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1983-*, + katakana-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*, + latin-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*, + japanese-jisx0208-1978:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1978-*, + thai-tis620:-misc-fixed-medium-r-normal--16-160-72-72-m-80-tis620.2529-1, + lao:-misc-fixed-medium-r-normal--16-160-72-72-m-80-MuleLao-1, + tibetan-1-column:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-80-MuleTibetan-1, + ethiopic:-Admas-Ethiomx16f-Medium-R-Normal--16-150-100-100-M-160-Ethiopic-Unicode, + tibetan:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-160-MuleTibetan-0") +@end lisp + +Many of the international bdf fonts from Intlfonts are type 0, and +therefore need to be added to font-encoding-alist: + +@lisp + (setq font-encoding-alist + (append '(("MuleTibetan-0" (tibetan . 0)) + ("GB2312" (chinese-gb2312 . 0)) + ("JISX0208" (japanese-jisx0208 . 0)) + ("JISX0212" (japanese-jisx0212 . 0)) + ("VISCII" (vietnamese-viscii-lower . 0)) + ("KSC5601" (korean-ksc5601 . 0)) + ("MuleArabic-0" (arabic-digit . 0)) + ("MuleArabic-1" (arabic-1-column . 0)) + ("MuleArabic-2" (arabic-2-column . 0))) + font-encoding-alist)) +@end lisp + +You can now use the Emacs font menu to select the @samp{bdf: 16-dot medium} +fontset, or you can select it by setting the default font in your +@file{~/.emacs}: + +@lisp + (set-default-font "fontset-bdf") +@end lisp + @c ------------------------------------------------------------ @node Mail and news, Concept index, Alternate character sets, Top diff --git a/man/help.texi b/man/help.texi index 6696b3440dd..08f528f5151 100644 --- a/man/help.texi +++ b/man/help.texi @@ -74,9 +74,9 @@ This displays the available Emacs packages based on keywords. * Key Help:: Asking what a key does in Emacs. * Name Help:: Asking about a command, variable or function name. * Apropos:: Asking what pertains to a given topic. +* Help Mode:: Special features of Help mode and Help buffers. * Library Keywords:: Finding Lisp libraries by keywords (topics). * Language Help:: Help relating to international language support. -* Help Mode:: Special features of Help mode and Help buffers. * Misc Help:: Other help commands. * Help Files:: Commands to display pre-written help files. * Help Echo:: Help on active text and tooltips (`balloon help') @@ -390,6 +390,62 @@ display the most relevant ones first. the variable @code{apropos-documentation-sort-by-scores} is @code{nil}, apropos lists the symbols found in alphabetical order. +@node Help Mode +@section Help Mode Commands + + Help buffers provide the same commands as View mode (@pxref{Misc File +Ops}), plus a few special commands of their own. + +@table @kbd +@item @key{SPC} +Scroll forward. +@item @key{DEL} +Scroll backward. +@item @key{RET} +Follow a cross reference at point. +@item @key{TAB} +Move point forward to the next cross reference. +@item S-@key{TAB} +Move point back to the previous cross reference. +@item Mouse-1 +@itemx Mouse-2 +Follow a cross reference that you click on. +@item C-c C-c +Show all documentation about the symbol at point. +@end table + + When a function name (@pxref{M-x,, Running Commands by Name}), +variable name (@pxref{Variables}), or face name (@pxref{Faces}) +appears in the documentation, it normally appears inside paired +single-quotes. To view the documentation of that command, variable or +face, you can click on the name with @kbd{Mouse-1} or @kbd{Mouse-2}, +or move point there and type @key{RET}. Use @kbd{C-c C-b} to retrace +your steps. + +@cindex URL, viewing in help +@cindex help, viewing web pages +@cindex viewing web pages in help +@cindex web pages, viewing in help +@findex browse-url + You can follow cross references to URLs (web pages) also. This uses +the @code{browse-url} command to view the page in the browser you +choose. @xref{Browse-URL}. + +@kindex @key{TAB} @r{(Help mode)} +@findex help-next-ref +@kindex S-@key{TAB} @r{(Help mode)} +@findex help-previous-ref + There are convenient commands to move point to cross references in +the help text. @key{TAB} (@code{help-next-ref}) moves point down to +the next cross reference. @kbd{S-@key{TAB}} moves up to the previous +cross reference (@code{help-previous-ref}). + + To view all documentation about any symbol name that appears in the +text, move point to the symbol name and type @kbd{C-c C-c} +(@code{help-follow-symbol}). This shows all available documentation +about the symbol as a variable, function and/or face. As above, use +@kbd{C-c C-b} to retrace your steps. + @node Library Keywords @section Keyword Search for Lisp Libraries @@ -460,62 +516,6 @@ input method currently in use. @xref{Input Methods}. coding systems---either a specified coding system, or the ones currently in use. @xref{Coding Systems}. -@node Help Mode -@section Help Mode Commands - - Help buffers provide the same commands as View mode (@pxref{Misc File -Ops}), plus a few special commands of their own. - -@table @kbd -@item @key{SPC} -Scroll forward. -@item @key{DEL} -Scroll backward. -@item @key{RET} -Follow a cross reference at point. -@item @key{TAB} -Move point forward to the next cross reference. -@item S-@key{TAB} -Move point back to the previous cross reference. -@item Mouse-1 -@itemx Mouse-2 -Follow a cross reference that you click on. -@item C-c C-c -Show all documentation about the symbol at point. -@end table - - When a function name (@pxref{M-x,, Running Commands by Name}), -variable name (@pxref{Variables}), or face name (@pxref{Faces}) -appears in the documentation, it normally appears inside paired -single-quotes. To view the documentation of that command, variable or -face, you can click on the name with @kbd{Mouse-1} or @kbd{Mouse-2}, -or move point there and type @key{RET}. Use @kbd{C-c C-b} to retrace -your steps. - -@cindex URL, viewing in help -@cindex help, viewing web pages -@cindex viewing web pages in help -@cindex web pages, viewing in help -@findex browse-url - You can follow cross references to URLs (web pages) also. This uses -the @code{browse-url} command to view the page in the browser you -choose. @xref{Browse-URL}. - -@kindex @key{TAB} @r{(Help mode)} -@findex help-next-ref -@kindex S-@key{TAB} @r{(Help mode)} -@findex help-previous-ref - There are convenient commands to move point to cross references in -the help text. @key{TAB} (@code{help-next-ref}) moves point down to -the next cross reference. @kbd{S-@key{TAB}} moves up to the previous -cross reference (@code{help-previous-ref}). - - To view all documentation about any symbol name that appears in the -text, move point to the symbol name and type @kbd{C-c C-c} -(@code{help-follow-symbol}). This shows all available documentation -about the symbol as a variable, function and/or face. As above, use -@kbd{C-c C-b} to retrace your steps. - @node Misc Help @section Other Help Commands diff --git a/man/mark.texi b/man/mark.texi index 7429b67db2b..2736dccd297 100644 --- a/man/mark.texi +++ b/man/mark.texi @@ -369,7 +369,7 @@ negative) instead of the current page. Finally, @kbd{C-x h} (@code{mark-whole-buffer}) sets up the entire buffer as the region, by putting point at the beginning and the mark at -the end. +the end. (In some programs this is called ``select all.'') In Transient Mark mode, all of these commands activate the mark. 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. @findex desktop-save @vindex desktop-save-mode You can save the desktop manually with the command @kbd{M-x -desktop-save}. You can also enable automatic desktop saving when -you exit Emacs: use the Customization buffer (@pxref{Easy +desktop-save}. You can also enable automatic saving of the desktop +when you exit Emacs, and automatic restoration of the last saved +desktop when Emacs starts: use the Customization buffer (@pxref{Easy Customization}) to set @code{desktop-save-mode} to @code{t} for future sessions, or add this line in your @file{~/.emacs} file: @@ -2009,7 +2010,8 @@ sessions, or add this line in your @file{~/.emacs} file: @findex desktop-change-dir @findex desktop-revert - When Emacs starts, it looks for a saved desktop in the current + If you turn on @code{desktop-save-mode} in your @file{~/.emacs}, +then when Emacs starts, it looks for a saved desktop in the current directory. Thus, you can have separate saved desktops in different directories, and the starting directory determines which one Emacs 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 Specify the option @samp{--no-desktop} on the command line when you don't want it to reload any saved desktop. This turns off -@code{desktop-save-mode} for the current session. +@code{desktop-save-mode} for the current session. Starting Emacs with +the @samp{--no-init-file} option also disables desktop reloading, +since it bypasses the @file{.emacs} init file, where +@code{desktop-save-mode} is usually turned on. @vindex desktop-restore-eager 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 correspondence. There is a special function @code{modify-coding-system-alist} for adding elements to this list. For example, to read and write all @samp{.txt} files using the coding system -@code{china-iso-8bit}, you can execute this Lisp expression: +@code{chinese-iso-8bit}, you can execute this Lisp expression: @smallexample (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 contains characters that the coding system cannot handle. Other file commands affected by a specified coding system include -@kbd{C-x C-i} and @kbd{C-x C-v}, as well as the other-window variants +@kbd{C-x i} and @kbd{C-x C-v}, as well as the other-window variants of @kbd{C-x C-f}. @kbd{C-x @key{RET} c} also affects commands that start subprocesses, including @kbd{M-x shell} (@pxref{Shell}). If the 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 @@ @setfilename ../info/org @settitle Org Mode Manual -@set VERSION 4.43 -@set DATE July 2006 +@set VERSION 4.44 +@set DATE August 2006 @dircategory Emacs @direntry @@ -98,7 +98,8 @@ Software Foundation raise funds for GNU development.'' Introduction * Summary:: Brief summary of what Org-mode does -* Installation:: How to install Org-mode +* Installation:: How to install a downloaded version of Org-mode +* Activation:: How to activate Org-mode for certain buffers. * Feedback:: Bug reports, ideas, patches etc. Document Structure @@ -270,7 +271,8 @@ Extensions, Hooks and Hacking @menu * Summary:: Brief summary of what Org-mode does -* Installation:: How to install Org-mode +* Installation:: How to install a downloaded version of Org-mode +* Activation:: How to activate Org-mode for certain buffers. * Feedback:: Bug reports, ideas, patches etc. @end menu @@ -323,18 +325,68 @@ questions (FAQ), links to tutorials etc. This page is located at @page -@node Installation, Feedback, Summary, Introduction -@section Installation and Activation +@node Installation, Activation, Summary, Introduction +@section Installation @cindex installation +@cindex XEmacs + +@b{Important:} If Org-mode is part of the Emacs distribution or an +XEmacs package, please skip this section and go directly to +@ref{Activation}. + +If you have downloaded Org-mode from the Web, you must take the +following steps to install it: Go into the Org-mode distribution +directory and edit the top section of the file @file{Makefile}. You +must set the name of the Emacs binary (likely either @file{emacs} or +@file{xemacs}), and the paths to the directories where local Lisp and +Info files are kept. If you don't have access to the system-wide +directories, create your own two directories for these files, enter them +into the Makefile, and make sure Emacs finds the Lisp files by adding +the following line to @file{.emacs}: + +@example +(setq load-path (cons "~/path/to/lispdir" load-path)) +@end example + +@b{XEmacs users now need to install the file @file{noutline.el} from +the @file{xemacs} subdirectory of the Org-mode distribution. Use the +command:} + +@example +@b{make install-noutline} +@end example + +@noindent Now byte-compile and install the Lisp files with the shell +commands: + +@example +make +make install +@end example + +@noindent If you want to install the info documentation, use this command: + +@example +make install-info +@end example + +@noindent Then add to @file{.emacs}: + +@lisp +;; This line only if org-mode is not part of the X/Emacs distribution. +(require 'org-install) +@end lisp + +@node Activation, Feedback, Installation, Introduction +@section Activation +@cindex activation @cindex autoload @cindex global keybindings @cindex keybindings, global -If Org-mode is part of the Emacs distribution or an XEmacs package, -you only need to copy the following lines to your @file{.emacs} file. -The last two lines define @emph{global} keys for the commands -@command{org-store-link} and @command{org-agenda} - please -choose suitable keys yourself. +Add the following lines to your @file{.emacs} file. The last two lines +define @emph{global} keys for the commands @command{org-store-link} and +@command{org-agenda} - please choose suitable keys yourself. @lisp ;; The following lines are always needed. Choose your own keys. @@ -345,30 +397,17 @@ choose suitable keys yourself. Furthermore, you must activate @code{font-lock-mode} in org-mode buffers, because significant functionality depends on font-locking being -active. You can do this with either one of the following two lines: +active. You can do this with either one of the following two lines +(XEmacs user must use the second option): @lisp (global-font-lock-mode 1) ; for all buffers (add-hook 'org-mode-hook 'turn-on-font-lock) ; org-mode buffers only @end lisp -If you have downloaded Org-mode from the Web, you must take additional -action: Byte-compile @file{org.el} and @file{org-publish.el} and put -them together with @file{org-install.el} on your load path. Then add to -@file{.emacs}: - -@lisp -;; This line only if org-mode is not part of the X/Emacs distribution. -(require 'org-install) -@end lisp - -If you use Org-mode with XEmacs, you also need to install the file -@file{noutline.el} from the @file{xemacs} subdirectory of the Org-mode -distribution. - @cindex org-mode, turning on -With this setup, all files with extension @samp{.org} will be put into -Org-mode. As an alternative, make the first line of a file look like -this: +With this setup, all files with extension @samp{.org} will be put +into Org-mode. As an alternative, make the first line of a file look +like this: @example MY PROJECTS -*- mode: org; -*- @@ -378,7 +417,7 @@ MY PROJECTS -*- mode: org; -*- the file's name is. See also the variable @code{org-insert-mode-line-in-empty-file}. -@node Feedback, , Installation, Introduction +@node Feedback, , Activation, Introduction @section Feedback @cindex feedback @cindex bug reports @@ -826,8 +865,14 @@ But in the end, not individual scenes matter but the film as a whole. @end group @end example -Org-mode supports these lists by tuning filling and wrapping commands -to deal with them correctly. +Org-mode supports these lists by tuning filling and wrapping commands to +deal with them correctly@footnote{Org-mode only changes the filling +settings for Emacs. For XEmacs, you should use Kyle E. Jones' +@file{filladapt.el}. To turn is on, put into @file{.emacs}: +@example +(require 'filladapt) +@end example +}. The following commands act on items when the cursor is in the first line 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 The second possibility is to use TODO keywords to indicate different types of action items. For example, you might want to indicate that -items are for ``work'' or ``home.'' If you are into David Allen's +items are for ``work'' or ``home''. If you are into David Allen's @emph{Getting Things DONE}, you might want to use todo types @samp{NEXTACTION}, @samp{WAITING}, @samp{MAYBE}. Or, when you work with several people on a single project, you might want to assign @@ -2547,7 +2592,12 @@ keyword together with a timestamp. Stop the clock (clock-out). The inserts another timestamp at the same location where the clock was last started. It also directly computes the resulting time in inserts it after the time range as @samp{=> -HH:MM}. +HH:MM}. +@kindex C-c C-y +@item C-c C-y +Recompute the time interval after changing one of the time stamps. This +is only necessary if you edit the time stamps directly. If you change +them with @kbd{S-@key{cursor}} keys, the update is automatic. @kindex C-c C-t @item C-c C-t 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 automatically when the buffer is changed. @kindex C-c C-x C-r @item C-c C-x C-r -Insert a dynamic block containing a clock report as an org-mode table -into the current file. +Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock +report as an org-mode table into the current file. @example #+BEGIN: clocktable :maxlevel 2 :emphasize nil @@ -2578,7 +2628,32 @@ table. The @samp{BEGIN} line can specify options: @example :maxlevels @r{Maximum level depth to which times are listed in the table.} :emphasize @r{When @code{t}, emphasize level one and level two items} +:block @r{The time block to consider. This block is specified relative} + @r{to the current time and may be any of these keywords:} + @r{@code{today}, @code{yesterday}, @code{thisweek}, @code{lastweek},} + @r{@code{thismonth}, @code{lastmonth}, @code{thisyear}, or @code{lastyear}}. +:tstart @r{A time string specifying when to start considering times} +:tend @r{A time string specifying when to stop considering times} @end example +So to get a clock summary for the current day, you could write +@example +#+BEGIN: clocktable :maxlevel 2 :block today + +#+END: clocktable +@end example +and to use a specific time range you could write@footnote{Note that all +parameters must be specified in a single line - the line is broken here +only to fit it onto the manual.} +@example +#+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>" + :tend "<2006-08-10 Thu 12:00>" + +#+END: clocktable +@end example +@kindex C-u C-c C-x C-u +@item C-u C-c C-x C-u +Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if +you have several clocktable blocks in a buffer. @end table 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 @item @file{cdlatex.el} by Carsten Dominik @cindex @file{cdlatex.el} Org-mode can make use of the cdlatex package to efficiently enter -La@TeX{} fragments into Org-mode files. -@file{cdlatex.el} is not part of Emacs, find it on the web. +La@TeX{} fragments into Org-mode files. See @ref{CDLaTeX mode}. @item @file{remember.el} by John Wiegley @cindex @file{remember.el} 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, @url{http://dto.freeshell.org/e/org-publish.el}. @cindex @file{org-blog.el} @item @file{org-blog.el} by David O'Toole -A blogging plug-in for @file{org-publish.el}. +A blogging plug-in for @file{org-publish.el}.@* @url{http://dto.freeshell.org/notebook/OrgMode.html}. @cindex @file{org-blogging.el} @item @file{org-blogging.el} by Bastien Guerry @@ -4805,7 +4879,7 @@ to the block and can also specify parameters for the function producing the content of the block. @example -#+BEGIN: myblock :parameter1 value1 :parameter2 value2 ..... +#+BEGIN: myblock :parameter1 value1 :parameter2 value2 ... #+END: @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. Here is an example to illustrate how you would set it: @example -(setq rcirc-startup-channels-alist +(setq rcirc-authinfo '(("freenode" nickserv "bob" "p455w0rd") ("freenode" chanserv "bob" "#bobland" "passwd99") ("bitlbee" bitlbee "robert" "sekrit"))) diff --git a/man/texinfo.tex b/man/texinfo.tex index d41d40084b0..36c1acad97c 100644 --- a/man/texinfo.tex +++ b/man/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2006-06-19.13} +\def\texinfoversion{2006-07-17.16} % % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free @@ -327,9 +327,9 @@ \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. - % (We lessened \vsize for it in \oddfootingxxx.) + % (We lessened \vsize for it in \oddfootingyyy.) % The \baselineskip=24pt in plain's \makefootline has no effect. - \vskip 2\baselineskip + \vskip 24pt \unvbox\footlinebox \fi % @@ -2051,11 +2051,11 @@ % and arrange explicitly to hyphenate at a dash. % -- rms. { - \catcode`\-=\active - \catcode`\_=\active + \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active % \global\def\code{\begingroup - \catcode`\-=\active \catcode`\_=\active + \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active + \let'\singlequotechar \ifallowcodebreaks \let-\codedash \let_\codeunder @@ -2472,8 +2472,8 @@ % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. - \global\advance\pageheight by -\baselineskip - \global\advance\vsize by -\baselineskip + \global\advance\pageheight by -12pt + \global\advance\vsize by -12pt } \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} @@ -5042,7 +5042,7 @@ {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) -\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} +\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt} % \setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. @@ -5265,11 +5265,10 @@ % \maketwodispenvs {lisp}{example}{% \nonfillstart - \tt + \tt\quoteexpand \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } - % @display/@smalldisplay: same as @lisp except keep current font. % \makedispenv {display}{% @@ -5397,6 +5396,22 @@ \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % \def\starttabbox{\setbox0=\hbox\bgroup} + +% Allow an option to not replace quotes with a regular directed right +% quote/apostrophe (char 0x27), but instead use the undirected quote +% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it +% the default, but it works for pasting with more pdf viewers (at least +% evince), the lilypond developers report. xpdf does work with the +% regular 0x27. +% +\def\singlequotechar{% + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else + \char'15 + \fi +} +% \begingroup \catcode`\^^I=\active \gdef\tabexpand{% @@ -5409,7 +5424,13 @@ \wd0=\dimen0 \box0 \starttabbox }% } + \catcode`\'=\active + \gdef\quoteexpand{% + \catcode`\'=\active + \def'{\singlequotechar} + }% \endgroup +% \def\setupverbatim{% \let\nonarrowing = t% \nonfillstart @@ -5418,6 +5439,7 @@ \def\par{\leavevmode\egroup\box0\endgraf}% \catcode`\`=\active \tabexpand + \quoteexpand % Respect line breaks, % print special symbols as themselves, and % 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}). @subsection Faces in Formatted Text The Faces submenu lists various Emacs faces including @code{bold}, -@code{italic}, and @code{underline}. Selecting one of these adds the -chosen face to the region. @xref{Faces}. You can also specify a face -with these keyboard commands: +@code{italic}, and @code{underline} (@pxref{Faces}). These menu items +operate on the region if it is active and nonempty. Otherwise, they +specify to use that face for an immediately following self-inserting +character. Instead of the menu, you can use these keyboard commands: @table @kbd @kindex M-o d @r{(Enriched mode)} @findex facemenu-set-default @item M-o d -Set the region, or the next inserted character, to the @code{default} face -(@code{facemenu-set-default}). +Remove all @code{face} properties from the region (which includes +specified colors), or force the following inserted character to have no +@code{face} property (@code{facemenu-set-default}). @kindex M-o b @r{(Enriched mode)} @findex facemenu-set-bold @item M-o b -Set the region, or the next inserted character, to the @code{bold} face -(@code{facemenu-set-bold}). +Add the face @code{bold} to the region or to the following inserted +character (@code{facemenu-set-bold}). @kindex M-o i @r{(Enriched mode)} @findex facemenu-set-italic @item M-o i -Set the region, or the next inserted character, to the @code{italic} face -(@code{facemenu-set-italic}). +Add the face @code{italic} to the region or to the following inserted +character (@code{facemenu-set-italic}). @kindex M-o l @r{(Enriched mode)} @findex facemenu-set-bold-italic @item M-o l -Set the region, or the next inserted character, to the @code{bold-italic} face -(@code{facemenu-set-bold-italic}). +Add the face @code{bold-italic} to the region or to the following +inserted character (@code{facemenu-set-bold-italic}). @kindex M-o u @r{(Enriched mode)} @findex facemenu-set-underline @item M-o u -Set the region, or the next inserted character, to the @code{underline} face -(@code{facemenu-set-underline}). +Add the face @code{underline} to the region or to the following inserted +character (@code{facemenu-set-underline}). @kindex M-o o @r{(Enriched mode)} @findex facemenu-set-face @item M-o o @var{face} @key{RET} -Set the region, or the next inserted character, to the face @var{face} -(@code{facemenu-set-face}). +Add the face @var{face} to the region or to the following inserted +character (@code{facemenu-set-face}). @end table - If you use these commands with a prefix argument---or, in Transient Mark -mode, if the region is not active---then these commands specify a face -to use for any immediately following self-inserting input. -@xref{Transient Mark}. This applies to both the keyboard commands and -the menu commands. + With a prefix argument, all these commands apply to an immediately +following self-inserting character, disregarding the region. - Specifying the @code{default} face also resets foreground and -background color to their defaults.(@pxref{Format Colors}). + A self-inserting character normally inherits the @code{face} +property (and most other text properties) from the preceding character +in the buffer. If you use the above commands to specify face for the +next self-inserting character, or the next section's commands to +specify a foreground or background color for it, then it does not +inherit the @code{face} property from the preceding character; instead +it uses whatever you specified. It will still inherit other text +properties, though. - Any self-inserting character you type inherits, by default, the face -properties (as well as most other text properties) of the preceding -character. Specifying any face property, including foreground or -background color, for your next self-inserting character will prevent -it from inheriting any face properties from the preceding character, -although it will still inherit other text properties. Characters -inserted by yanking do not inherit text properties. + Strictly speaking, these commands apply only to the first following +self-inserting character that you type. But if you insert additional +characters after it, they will inherit from the first one. So it +appears that these commands apply to all of them. Enriched mode defines two additional faces: @code{excerpt} and @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. If you specify a color with a prefix argument---or, in Transient Mark mode, if the region is not active---then it applies to any -immediately following self-inserting input. @xref{Transient Mark}. -Otherwise, the command applies to the region. +immediately following self-inserting input. Otherwise, the command +applies to the region. Each color menu contains one additional item: @samp{Other}. You can use this item to specify a color that is not listed in the menu; it reads diff --git a/src/.gdbinit b/src/.gdbinit index 60730536ae9..e1ad68e9eb3 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -164,6 +164,10 @@ define pitx if ($it->current.pos.charpos != $it->current.pos.bytepos) printf "[%d]", $it->current.pos.bytepos end + printf " pos=%d", $it->position.charpos + if ($it->position.charpos != $it->position.bytepos) + printf "[%d]", $it->position.bytepos + end printf " start=%d", $it->start.pos.charpos if ($it->start.pos.charpos != $it->start.pos.bytepos) printf "[%d]", $it->start.pos.bytepos @@ -218,7 +222,7 @@ define pitx printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent printf "\n" set $i = 0 - while ($i < $it->sp) + while ($i < $it->sp && $i < 4) set $e = $it->stack[$i] printf "stack[%d]: ", $i output $e->method diff --git a/src/ChangeLog b/src/ChangeLog index 474ead0cde6..1d7e22867e3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,138 @@ +2006-08-16 Andreas Schwab + + * print.c (debug_output_compilation_hack): Fix return type. + +2006-08-16 Richard Stallman + + * print.c (debug_output_compilation_hack): New function. + +2006-08-16 Kenichi Handa + + * fileio.c (choose_write_coding_system): Use LF for end-of-line + in auto-saving. + +2006-08-15 Chong Yidong + + * keyboard.c (read_char): Don't change idle timer state at all if + end_time is supplied. + +2006-08-15 Kenichi Handa + + * coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New arg RET. If SRC + is exhausted, return with RET. + (detect_coding_emacs_mule, detect_coding_iso2022) + (detect_coding_sjis, detect_coding_big5, detect_coding_utf_8) + (detect_coding_utf_16, detect_coding_ccl): Adjusted for the above + change. + +2006-08-14 Chong Yidong + + * keyboard.c (read_char): Don't reset idle timers if a time limit + is supplied. + +2006-08-14 Kim F. Storm + + * .gdbinit (pitx): Print iterator position. + Limit stack dump in case iterator is not initialized. + +2006-08-12 Eli Zaretskii + + * frame.c (Fmouse_position, Fmouse_pixel_position) + (Fset_mouse_position, Fset_mouse_pixel_position): Doc fix. + +2006-08-11 Jan Dj,Ad(Brv + + * xselect.c (Fx_register_dnd_atom): New function. + (syms_of_xselect): Defsubr it. + (x_handle_dnd_message): Check that message_type is in + dpyinfo->x_dnd_atoms before generating lisp event. + + * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track + of drag and drop Atoms. + + * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms* + + +2006-08-10 Jan Dj,Ad(Brv + + * keyboard.c: Define in_sighandler. + (input_available_signal): Set in_sighandler. + (init_keyboard): Initialize in_sighandler. + + * keyboard.h: Declare in_sighandler. + + * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler + to check if mutex should be locked or not. + +2006-08-09 Richard Stallman + + * keyboard.c (keyremap_step): No-op if fkey->parent = nil. + (read_key_sequence): Always start fkey.start and fkey.end at 0, + and likewise for keytran. + +2006-08-09 Kenichi Handa + + * coding.c (syms_of_coding): Improve the docstring + file-coding-system-alist. + +2006-08-07 Andreas Schwab + + * puresize.h (BASE_PURESIZE): Increase to 1120000. + +2006-08-06 Chong Yidong + + * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars. + (Fkill_all_local_variables): Use it. + (syms_of_buffer): Defvar it. + +2006-08-05 Eli Zaretskii + + * w32.c (w32_valid_pointer_p): New function. + + * w32.h: Add prototype for w32_valid_pointer_p. + + * alloc.c: Include w32.h. + (valid_lisp_object_p) [WINDOWSNT]: Call w32_valid_pointer_p to do + the job. + + * keyboard.c (kbd_buffer_get_event): Return Qnil when current time + is exactly equal to end_time, not only when it is past that. + +2006-08-04 Chong Yidong + + * keyboard.c (read_char): Rebalance specpdl after receiving jump. + + * process.c: Reapply 2006-08-01 change. + +2006-08-04 Eli Zaretskii + + * w32fns.c (w32_query_font): Fix last change: use stricmp. + +2006-08-04 Stefan Monnier + + * editfns.c (Fsubst_char_in_region): Redo the setup work after running + the before-change-functions since they may have altered the buffer. + +2006-08-04 Ralf Angeli + + * w32fns.c (w32_createwindow): Handle -geometry command line option + and the geometry settings in the Registry. + +2006-08-04 Kenichi Handa + + * w32fns.c (w32_query_font): Compare names by ignoring case. + + * xterm.c (x_query_font): Compare names by ignoring case. + +2006-08-03 Jason Rumney + + * w32menu.c (w32_menu_show, w32_dialog_show): Call Fsignal to quit + when no option selected. + +2006-08-03 Chong Yidong + + * process.c: Revert last change. + 2006-08-01 Kim F. Storm * process.c (wait_reading_process_output_unwind): New function. diff --git a/src/alloc.c b/src/alloc.c index 171cdade81a..9cd87503c5a 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -80,6 +80,7 @@ extern POINTER_TYPE *sbrk (); #ifdef WINDOWSNT #include +#include "w32.h" #endif #ifdef DOUG_LEA_MALLOC @@ -129,17 +130,27 @@ static pthread_mutex_t alloc_mutex; #define BLOCK_INPUT_ALLOC \ do \ { \ - pthread_mutex_lock (&alloc_mutex); \ - if (pthread_self () == main_thread) \ - BLOCK_INPUT; \ + if (!in_sighandler) \ + { \ + pthread_mutex_lock (&alloc_mutex); \ + if (pthread_self () == main_thread) \ + BLOCK_INPUT; \ + else \ + sigblock (sigmask (SIGIO)); \ + } \ } \ while (0) #define UNBLOCK_INPUT_ALLOC \ do \ { \ - if (pthread_self () == main_thread) \ - UNBLOCK_INPUT; \ - pthread_mutex_unlock (&alloc_mutex); \ + if (!in_sighandler) \ + { \ + pthread_mutex_unlock (&alloc_mutex); \ + if (pthread_self () == main_thread) \ + UNBLOCK_INPUT; \ + else \ + sigunblock (sigmask (SIGIO)); \ + } \ } \ while (0) @@ -4572,6 +4583,9 @@ int valid_pointer_p (p) void *p; { +#ifdef WINDOWSNT + return w32_valid_pointer_p (p, 16); +#else int fd; /* Obviously, we cannot just access it (we would SEGV trying), so we @@ -4588,6 +4602,7 @@ valid_pointer_p (p) } return -1; +#endif } /* Return 1 if OBJ is a valid lisp object. diff --git a/src/buffer.c b/src/buffer.c index 6115f727deb..d26c4451d13 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -146,6 +146,9 @@ Lisp_Object Vinhibit_read_only; Lisp_Object Vkill_buffer_query_functions; Lisp_Object Qkill_buffer_query_functions; +/* Hook run before changing a major mode. */ +Lisp_Object Vchange_major_mode_hook, Qchange_major_mode_hook; + /* List of functions to call before changing an unmodified buffer. */ Lisp_Object Vfirst_change_hook; @@ -2402,7 +2405,7 @@ the normal hook `change-major-mode-hook'. */) Lisp_Object oalist; if (!NILP (Vrun_hooks)) - call1 (Vrun_hooks, intern ("change-major-mode-hook")); + call1 (Vrun_hooks, Qchange_major_mode_hook); oalist = current_buffer->local_var_alist; /* Make sure none of the bindings in oalist @@ -6014,6 +6017,13 @@ t means to use hollow box cursor. See `cursor-type' for other values. */); doc: /* List of functions called with no args to query before killing a buffer. */); Vkill_buffer_query_functions = Qnil; + DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook, + doc: /* Normal hook run before changing the major mode of a buffer. +The function `kill-all-local-variables' runs this before doing anything else. */); + Vchange_major_mode_hook = Qnil; + Qchange_major_mode_hook = intern ("change-major-mode-hook"); + staticpro (&Qchange_major_mode_hook); + defsubr (&Sbuffer_live_p); defsubr (&Sbuffer_list); defsubr (&Sget_buffer); diff --git a/src/editfns.c b/src/editfns.c index 02ea2d2abb8..aa6ad457676 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2712,6 +2712,10 @@ Both characters must have the same length of multi-byte form. */) Lisp_Object start, end, fromchar, tochar, noundo; { register int pos, pos_byte, stop, i, len, end_byte; + /* Keep track of the first change in the buffer: + if 0 we haven't found it yet. + if < 0 we've found it and we've run the before-change-function. + if > 0 we've actually performed it and the value is its position. */ int changed = 0; unsigned char fromstr[MAX_MULTIBYTE_LENGTH], tostr[MAX_MULTIBYTE_LENGTH]; unsigned char *p; @@ -2724,6 +2728,8 @@ Both characters must have the same length of multi-byte form. */) int last_changed = 0; int multibyte_p = !NILP (current_buffer->enable_multibyte_characters); + restart: + validate_region (&start, &end); CHECK_NUMBER (fromchar); CHECK_NUMBER (tochar); @@ -2761,7 +2767,7 @@ Both characters must have the same length of multi-byte form. */) That's faster than getting rid of things, and it prevents even the entry for a first change. Also inhibit locking the file. */ - if (!NILP (noundo)) + if (!changed && !NILP (noundo)) { record_unwind_protect (subst_char_in_region_unwind, current_buffer->undo_list); @@ -2795,10 +2801,14 @@ Both characters must have the same length of multi-byte form. */) && (len == 2 || (p[2] == fromstr[2] && (len == 3 || p[3] == fromstr[3])))))) { - if (! changed) + if (changed < 0) + /* We've already seen this and run the before-change-function; + this time we only need to record the actual position. */ + changed = pos; + else if (!changed) { - changed = pos; - modify_region (current_buffer, changed, XINT (end)); + changed = -1; + modify_region (current_buffer, pos, XINT (end)); if (! NILP (noundo)) { @@ -2807,6 +2817,10 @@ Both characters must have the same length of multi-byte form. */) if (MODIFF - 1 == current_buffer->auto_save_modified) current_buffer->auto_save_modified++; } + + /* The before-change-function may have moved the gap + or even modified the buffer so we should start over. */ + goto restart; } /* Take care of the case where the new character @@ -2859,7 +2873,7 @@ Both characters must have the same length of multi-byte form. */) pos++; } - if (changed) + if (changed > 0) { signal_after_change (changed, last_changed - changed, last_changed - changed); diff --git a/src/frame.c b/src/frame.c index 9bbdcd592aa..c57618696eb 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1439,7 +1439,8 @@ The functions are run with one arg, the frame to be deleted. */) DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. The position is given in character cells, where (0, 0) is the -upper-left corner. +upper-left corner of the frame, X is the horizontal offset, and Y is +the vertical offset. If Emacs is running on a mouseless terminal or hasn't been programmed to read the mouse position, it returns the selected frame for FRAME and nil for X and Y. @@ -1487,7 +1488,8 @@ DEFUN ("mouse-pixel-position", Fmouse_pixel_position, Smouse_pixel_position, 0, 0, 0, doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. The position is given in pixel units, where (0, 0) is the -upper-left corner. +upper-left corner of the frame, X is the horizontal offset, and Y is +the vertical offset. If Emacs is running on a mouseless terminal or hasn't been programmed to read the mouse position, it returns the selected frame for FRAME and nil for X and Y. */) @@ -1520,6 +1522,10 @@ Coordinates are relative to the frame, not a window, so the coordinates of the top left character in the frame may be nonzero due to left-hand scroll bars or the menu bar. +The position is given in character cells, where (0, 0) is the +upper-left corner of the frame, X is the horizontal offset, and Y is +the vertical offset. + This function is a no-op for an X frame that is not visible. If you have just created a frame, you must wait for it to become visible before calling this function on it, like this. @@ -1552,6 +1558,9 @@ before calling this function on it, like this. DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position, Sset_mouse_pixel_position, 3, 3, 0, doc: /* Move the mouse pointer to pixel position (X,Y) in FRAME. +The position is given in pixels, where (0, 0) is the upper-left corner +of the frame, X is the horizontal offset, and Y is the vertical offset. + Note, this is a no-op for an X frame that is not visible. If you have just created a frame, you must wait for it to become visible before calling this function on it, like this. diff --git a/src/keyboard.c b/src/keyboard.c index 45d5832a905..62c862f69d1 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -100,6 +100,9 @@ int interrupt_input_pending; /* File descriptor to use for input. */ extern int input_fd; +/* Nonzero if we are executing from the SIGIO signal handler. */ +int in_sighandler; + #ifdef HAVE_WINDOW_SYSTEM /* Make all keyboard buffers much bigger when using X windows. */ #ifdef MAC_OS8 @@ -2403,7 +2406,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) EMACS_TIME *end_time; { volatile Lisp_Object c; - int count; + int count, jmpcount; jmp_buf local_getcjmp; jmp_buf save_jump; volatile int key_already_recorded = 0; @@ -2629,11 +2632,13 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) around any call to sit_for or kbd_buffer_get_event; it *must not* be in effect when we call redisplay. */ + jmpcount = SPECPDL_INDEX (); if (_setjmp (local_getcjmp)) { /* We must have saved the outer value of getcjmp here, so restore it now. */ restore_getcjmp (save_jump); + unbind_to (jmpcount, Qnil); XSETINT (c, quit_char); internal_last_event_frame = selected_frame; Vlast_event_frame = internal_last_event_frame; @@ -2674,7 +2679,12 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) goto non_reread; } - timer_start_idle (); + /* Start idle timers if no time limit is supplied. We don't do it + if a time limit is supplied to avoid an infinite recursion in the + situation where an idle timer calls `sit-for'. */ + + if (!end_time) + timer_start_idle (); /* If in middle of key sequence and minibuffer not active, start echoing if enough time elapses. */ @@ -2744,7 +2754,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); /* Now that we have read an event, Emacs is not idle. */ - timer_stop_idle (); + if (!end_time) + timer_stop_idle (); goto exit; } @@ -2874,7 +2885,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) /* Actually read a character, waiting if necessary. */ save_getcjmp (save_jump); restore_getcjmp (local_getcjmp); - timer_start_idle (); + if (!end_time) + timer_start_idle (); c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time); restore_getcjmp (save_jump); @@ -2926,7 +2938,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) non_reread: - timer_stop_idle (); + if (!end_time) + timer_stop_idle (); RESUME_POLLING; if (NILP (c)) @@ -2960,7 +2973,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) last_input_char = c; Fcommand_execute (tem, Qnil, Fvector (1, &last_input_char), Qt); - if (CONSP (c) && EQ (XCAR (c), Qselect_window)) + if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time) /* We stopped being idle for this event; undo that. This prevents automatic window selection (under mouse_autoselect_window from acting as a real input event, for @@ -3166,7 +3179,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) show_help_echo (help, window, object, position, 0); /* We stopped being idle for this event; undo that. */ - timer_resume_idle (); + if (!end_time) + timer_resume_idle (); goto retry; } @@ -3952,13 +3966,15 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time) { EMACS_TIME duration; EMACS_GET_TIME (duration); - EMACS_SUB_TIME (duration, *end_time, duration); - if (EMACS_TIME_NEG_P (duration)) - return Qnil; + if (EMACS_TIME_GE (duration, *end_time)) + return Qnil; /* finished waiting */ else - wait_reading_process_output (EMACS_SECS (duration), - EMACS_USECS (duration), - -1, 1, Qnil, NULL, 0); + { + EMACS_SUB_TIME (duration, *end_time, duration); + wait_reading_process_output (EMACS_SECS (duration), + EMACS_USECS (duration), + -1, 1, Qnil, NULL, 0); + } } else wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0); @@ -6920,6 +6936,8 @@ input_available_signal (signo) SIGNAL_THREAD_CHECK (signo); #endif + in_sighandler = 1; + if (input_available_clear_time) EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); @@ -6931,6 +6949,7 @@ input_available_signal (signo) sigfree (); #endif errno = old_errno; + in_sighandler = 0; } #endif /* SIGIO */ @@ -8381,7 +8400,15 @@ follow_key (key, nmaps, current, defs, next) such as Vfunction_key_map and Vkey_translation_map. */ typedef struct keyremap { - Lisp_Object map, parent; + /* This is the map originally specified for this use. */ + Lisp_Object parent; + /* This is a submap reached by looking up, in PARENT, + the events from START to END. */ + Lisp_Object map; + /* Positions [START, END) in the key sequence buffer + are the key that we have scanned so far. + Those events are the ones that we will replace + if PAREHT maps them into a key sequence. */ int start, end; } keyremap; @@ -8454,7 +8481,11 @@ keyremap_step (keybuf, bufsize, fkey, input, doit, diff, prompt) Lisp_Object next, key; key = keybuf[fkey->end++]; - next = access_keymap_keyremap (fkey->map, key, prompt, doit); + + if (KEYMAPP (fkey->parent)) + next = access_keymap_keyremap (fkey->map, key, prompt, doit); + else + next = Qnil; /* If keybuf[fkey->start..fkey->end] is bound in the map and we're in a position to do the key remapping, replace it with @@ -8652,9 +8683,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, delayed_switch_frame = Qnil; fkey.map = fkey.parent = Vfunction_key_map; keytran.map = keytran.parent = Vkey_translation_map; - /* If there is no translation-map, turn off scanning. */ - fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; - keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; + fkey.start = fkey.end = 0; + keytran.start = keytran.end = 0; if (INTERACTIVE) { @@ -9481,8 +9511,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, keybuf[t - 1] = new_key; mock_input = max (t, mock_input); - fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; - keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; + fkey.start = fkey.end = 0; + keytran.start = keytran.end = 0; goto replay_sequence; } @@ -10786,6 +10816,7 @@ init_keyboard () do_mouse_tracking = Qnil; #endif input_pending = 0; + in_sighandler = 0; /* This means that command_loop_1 won't try to select anything the first time through. */ diff --git a/src/keyboard.h b/src/keyboard.h index 96ac7d2e856..f8d8f789c08 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -190,6 +190,9 @@ extern EMACS_INT num_nonmacro_input_events; /* Nonzero means polling for input is temporarily suppressed. */ extern int poll_suppress_count; +/* Nonzero if we are executing from the SIGIO signal handler. */ +extern int in_sighandler; + /* Keymap mapping ASCII function key sequences onto their preferred forms. Initialized by the terminal-specific lisp files. */ extern Lisp_Object Vfunction_key_map; diff --git a/src/print.c b/src/print.c index 6fdd41ada04..80fe22c7149 100644 --- a/src/print.c +++ b/src/print.c @@ -924,6 +924,15 @@ to make it write to the debugging output. */) return character; } +/* This function is never called. Its purpose is to prevent + print_output_debug_flag from being optimized away. */ + +void +debug_output_compilation_hack (x) + int x; +{ + print_output_debug_flag = x; +} #if defined(GNU_LINUX) diff --git a/src/puresize.h b/src/puresize.h index bae7cbb6d6a..5dd374af207 100644 --- a/src/puresize.h +++ b/src/puresize.h @@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA. */ #endif #ifndef BASE_PURESIZE -#define BASE_PURESIZE (1102000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) +#define BASE_PURESIZE (1120000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) #endif /* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ diff --git a/src/w32.c b/src/w32.c index c093eab599e..0da908ff932 100644 --- a/src/w32.c +++ b/src/w32.c @@ -323,6 +323,28 @@ w32_strerror (int error_no) return buf; } +/* Return 1 if P is a valid pointer to an object of size SIZE. Return + 0 if P is NOT a valid pointer. Return -1 if we cannot validate P. + + This is called from alloc.c:valid_pointer_p. */ +int +w32_valid_pointer_p (void *p, int size) +{ + SIZE_T done; + HANDLE h = OpenProcess (PROCESS_VM_READ, FALSE, GetCurrentProcessId ()); + + if (h) + { + unsigned char *buf = alloca (size); + int retval = ReadProcessMemory (h, p, buf, size, &done); + + CloseHandle (h); + return retval; + } + else + return -1; +} + static char startup_dir[MAXPATHLEN]; /* Get the current working directory. */ diff --git a/src/w32.h b/src/w32.h index 1d5dbee6d40..6ba25a42403 100644 --- a/src/w32.h +++ b/src/w32.h @@ -110,6 +110,9 @@ extern void delete_child (child_process *cp); /* Equivalent of strerror for W32 error codes. */ extern char * w32_strerror (int error_no); +/* Validate a pointer. */ +extern int w32_valid_pointer_p (void *, int); + /* Get long (aka "true") form of file name, if it exists. */ extern BOOL w32_get_long_filename (char * name, char * buf, int size); diff --git a/src/w32fns.c b/src/w32fns.c index 9c0198f288d..f0060de7933 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -2067,7 +2067,8 @@ w32_createwindow (f) { HWND hwnd; RECT rect; - Lisp_Object top, left; + Lisp_Object top = Qunbound; + Lisp_Object left = Qunbound; rect.left = rect.top = 0; rect.right = FRAME_PIXEL_WIDTH (f); @@ -2080,13 +2081,41 @@ w32_createwindow (f) if (!hprevinst) { + Lisp_Object ifa; + w32_init_class (hinst); + + /* Handle the -geometry command line option and the geometry + settings in the registry. They are decoded and put into + initial-frame-alist by w32-win.el:x-handle-geometry. */ + ifa = Fsymbol_value (intern ("initial-frame-alist")); + if (CONSP (ifa)) + { + Lisp_Object lt = Fassq (Qleft, ifa); + Lisp_Object tp = Fassq (Qtop, ifa); + + if (!NILP (lt)) + { + lt = XCDR (lt); + if (INTEGERP (lt)) + left = lt; + } + if (!NILP (tp)) + { + tp = XCDR (tp); + if (INTEGERP (tp)) + top = tp; + } + } } - /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero - for anything that is not a number and is not Qunbound. */ - left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); - top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); + if (EQ (left, Qunbound) && EQ (top, Qunbound)) + { + /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero + for anything that is not a number and is not Qunbound. */ + left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); + top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); + } FRAME_W32_WINDOW (f) = hwnd = CreateWindow (EMACS_CLASS, @@ -6269,7 +6298,7 @@ w32_query_font (struct frame *f, char *fontname) for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++) { - if (strcmp(pfi->name, fontname) == 0) return pfi; + if (stricmp(pfi->name, fontname) == 0) return pfi; } return NULL; diff --git a/src/w32menu.c b/src/w32menu.c index 389e6c5b856..11af1d66b6f 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -1994,6 +1994,9 @@ w32_menu_show (f, x, y, for_click, keymaps, title, error) } } } + else if (!for_click) + /* Make "Cancel" equivalent to C-g. */ + Fsignal (Qquit, Qnil); return Qnil; } @@ -2186,6 +2189,9 @@ w32_dialog_show (f, keymaps, title, header, error) } } } + else + /* Make "Cancel" equivalent to C-g. */ + Fsignal (Qquit, Qnil); return Qnil; } diff --git a/src/xselect.c b/src/xselect.c index fcac2860359..013a52dbdb1 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -2677,8 +2677,48 @@ If the value is 0 or the atom is not known, return the empty string. */) return ret; } -/* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. - TODO: Check if this client event really is a DND event? */ +DEFUN ("x-register-dnd-atom", Fx_register_dnd_atom, + Sx_register_dnd_atom, 1, 2, 0, + doc: /* Request that dnd events are made for ClientMessages with ATOM. +ATOM can be a symbol or a string. The ATOM is interned on the display that +FRAME is on. If FRAME is nil, the selected frame is used. */) + (atom, frame) + Lisp_Object atom, frame; +{ + Atom x_atom; + struct frame *f = check_x_frame (frame); + size_t i; + struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + + + if (SYMBOLP (atom)) + x_atom = symbol_to_x_atom (dpyinfo, FRAME_X_DISPLAY (f), atom); + else if (STRINGP (atom)) + { + BLOCK_INPUT; + x_atom = XInternAtom (FRAME_X_DISPLAY (f), (char *) SDATA (atom), False); + UNBLOCK_INPUT; + } + else + error ("ATOM must be a symbol or a string"); + + for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) + if (dpyinfo->x_dnd_atoms[i] == x_atom) + return Qnil; + + if (dpyinfo->x_dnd_atoms_length == dpyinfo->x_dnd_atoms_size) + { + dpyinfo->x_dnd_atoms_size *= 2; + dpyinfo->x_dnd_atoms = xrealloc (dpyinfo->x_dnd_atoms, + sizeof (*dpyinfo->x_dnd_atoms) + * dpyinfo->x_dnd_atoms_size); + } + + dpyinfo->x_dnd_atoms[dpyinfo->x_dnd_atoms_length++] = x_atom; + return Qnil; +} + +/* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. */ int x_handle_dnd_message (f, event, dpyinfo, bufp) @@ -2694,6 +2734,12 @@ x_handle_dnd_message (f, event, dpyinfo, bufp) int x, y; unsigned char *data = (unsigned char *) event->data.b; int idata[5]; + size_t i; + + for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) + if (dpyinfo->x_dnd_atoms[i] == event->message_type) break; + + if (i == dpyinfo->x_dnd_atoms_length) return 0; XSETFRAME (frame, f); @@ -2867,6 +2913,7 @@ syms_of_xselect () defsubr (&Sx_get_atom_name); defsubr (&Sx_send_client_message); + defsubr (&Sx_register_dnd_atom); reading_selection_reply = Fcons (Qnil, Qnil); staticpro (&reading_selection_reply); diff --git a/src/xterm.c b/src/xterm.c index 126d954a3a4..9cd945ae63b 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10362,8 +10362,8 @@ x_query_font (f, fontname) for (i = 0; i < dpyinfo->n_fonts; i++) if (dpyinfo->font_table[i].name - && (!strcmp (dpyinfo->font_table[i].name, fontname) - || !strcmp (dpyinfo->font_table[i].full_name, fontname))) + && (!strcasecmp (dpyinfo->font_table[i].name, fontname) + || !strcasecmp (dpyinfo->font_table[i].full_name, fontname))) return (dpyinfo->font_table + i); return NULL; } @@ -11044,6 +11044,11 @@ x_term_init (display_name, xrm_option, resource_name) dpyinfo->cut_buffers_initialized = 0; + dpyinfo->x_dnd_atoms_size = 8; + dpyinfo->x_dnd_atoms_length = 0; + dpyinfo->x_dnd_atoms = xmalloc (sizeof (*dpyinfo->x_dnd_atoms) + * dpyinfo->x_dnd_atoms_size); + connection = ConnectionNumber (dpyinfo->display); dpyinfo->connection = connection; diff --git a/src/xterm.h b/src/xterm.h index 8bc9782b02b..1c5d215f864 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -389,6 +389,12 @@ struct x_display_info X_WMTYPE_A, X_WMTYPE_B } wm_type; + + + /* Atoms that are drag and drop atoms */ + Atom *x_dnd_atoms; + size_t x_dnd_atoms_size; + size_t x_dnd_atoms_length; }; #ifdef HAVE_X_I18N