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 13469376c9b..13c6e13bac5 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE @@ -29,7 +29,9 @@ Reminders sent out on 2006-06-08. ** Send an email to the various distributions, including the GNOME and KDE projects, to use the new Emacs icons in etc/images/icons. -* BUGS +* WINDOWS SUPPORT BUGS. +These don't need to be fixed to start pretest, but we call the +attention of Windows users to fixing them. ** Markus Gritsch's report about Emacs looping on Windoze with the following .emacs file, and then reduce Emacs frame width to "something quite narrow": @@ -39,74 +41,24 @@ 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. +** Drew Adams 12 Aug bug rpt: overlay display artifact: trace left behind +Windows only bug. -** Jorgen Schaefer 's June 18 bug report about - fields and invisible overlays needs attention from a field expert. +* BUGS + +** Milan Zamazal's Aug 23 bug report about crashes with certain fonts. + +** C-g fails to interrupt accept-process-output in Gnus. ** Implement buffer-chars-modified-tick. +** henman@it.to-be.co.jp 09 Aug 2006: ispell.el problem. + +** Make key-binding use the maps specified by positions given in the events. + + * 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 1dd45cc6676..307208918ec 100644 --- a/configure.in +++ b/configure.in @@ -1500,7 +1500,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 627d536ee69..100460e9b93 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,79 @@ +2006-08-25 Richard Stallman + + * TUTORIAL: Give priority to graphical terminals over text terminals + regarding C-z. + +2006-08-21 Sun Yijiang + + * TUTORIAL.cn: Sync with the latest TUTORIAL. + +2006-08-20 Dave Love + + * emacs.py: Update to Dave Love's latest version. + (__all__): Fix args -> eargs. Add new `modpath' fun. + (eargs): Add `imports' arg. + (all_names): New fun. + (complete): Rewrite without using rlcompleter. + Remove `namespace' arg, add `imports' arg. + (ehelp): Replace g and l args with `imports'. + (eimport): Use __main__ rather than `emacs' namespace. + (modpath): New fun. + +2006-08-20 Slawomir Nowaczyk (tiny change) + + * emacs.py (eexecfile): Use the __main__ rather than `emacs' namespace. + +2006-08-18 Primoz PETERLIN + + * TUTORIAL.sl: Synchronize with TUTORIAL. + +2006-08-18 Mats Lidell + + * TUTORIAL.sv: Synchronize with TUTORIAL. + +2006-08-18 Alfredo Finelli + + * TUTORIAL.it: Synchronize with TUTORIAL. + +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. + +2006-08-01 Kenichi Handa + + * NEWS (find-operation-coding-system): Describe the more detail of + the change. + +2006-07-28 Reiner Steib + + * GNUS-NEWS: Regenerate from Oort Gnus node in texi/gnus.texi using + texi/gnus-news.el of the trunk. + +2006-07-29 Reiner Steib + + * NEWS: Fix typo. + 2006-07-17 Reiner Steib * ru-refcard.ps: Regenerate. @@ -168,7 +244,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/ERC-NEWS b/etc/ERC-NEWS index 778344c68c7..3a026ee1162 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS @@ -1,6 +1,27 @@ ERC NEWS -*- outline -*- -* Changes in ERC 5.2 (unreleased) +* Changes in ERC 5.1.4 + +** Make find-function and find-variable work in Emacs 22 for +names that are constructed by `define-erc-module'. + +** Fix bug introduced in ERC 5.1.3 that caused messages to go the +wrong buffer. + +** Changes and additions to modules + +*** Highlighting (erc-match.el) + +**** Don't activate view-mode. + +*** Logging (erc-log.el) + +**** When this module is activated, make sure logging is enabled on +already-opened buffers. Ditto for disabling logging when the module +is deactivated. + +**** Fix some errors that occur when exiting Emacs without first +quitting open IRC servers. * Changes in ERC 5.1.3 diff --git a/etc/GNUS-NEWS b/etc/GNUS-NEWS index f13b4fa5dd3..31f9ad6613e 100644 --- a/etc/GNUS-NEWS +++ b/etc/GNUS-NEWS @@ -1,152 +1,201 @@ GNUS NEWS -- history of user-visible changes. -Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Free Software Foundation, Inc. +Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006 Free Software Foundation, Inc. See the end for copying conditions. Please send Gnus bug reports to bugs@gnus.org. For older news, see Gnus info node "New Features". -* Changes in Oort Gnus - -** `F' (`gnus-article-followup-with-original') and `R' -(`gnus-article-reply-with-original') only yank the text in the region if the -region is active. - -** `gnus-group-read-ephemeral-group' can be called interactively, using `G M'. - -** In draft groups, `e' is now bound to `gnus-draft-edit-message'. -Use `B w' for `gnus-summary-edit-article' instead. - -** The revised Gnus FAQ is included in the manual. -See the info node "Frequently Asked Questions". +* Installation changes ** Upgrading from previous (stable) version if you have used Oort. If you have tried Oort (the unstable Gnus branch leading to this -release) but went back to a stable version, be careful when upgrading -to this version. In particular, you will probably want to remove all -.marks (nnml) and .mrk (nnfolder) files, so that flags are read from -your ~/.newsrc.eld instead of from the .marks/.mrk file where this +release) but went back to a stable version, be careful when upgrading to +this version. In particular, you will probably want to remove all +`.marks' (nnml) and `.mrk' (nnfolder) files, so that flags are read from +your `.newsrc.eld' instead of from the `.marks'/`.mrk' file where this release store flags. See a later entry for more information about -marks. Note that downgrading isn't safe in general. +marks. Note that downgrading isn't save in general. + +** Lisp files are now installed in `.../site-lisp/gnus/' by default. It +defaulted to `.../site-lisp/' formerly. In addition to this, the new +installer issues a warning if other Gnus installations which will shadow +the latest one are detected. You can then remove those shadows manually +or remove them using `make remove-installed-shadows'. + +** New `make.bat' for compiling and installing Gnus under MS Windows + +Use `make.bat' if you want to install Gnus under MS Windows, the first +argument to the batch-program should be the directory where `xemacs.exe' +respectively `emacs.exe' is located, iff you want to install Gnus after +compiling it, give `make.bat' `/copy' as the second parameter. + +`make.bat' has been rewritten from scratch, it now features automatic +recognition of XEmacs and GNU Emacs, generates `gnus-load.el', checks if +errors occur while compilation and generation of info files and reports +them at the end of the build process. It now uses `makeinfo' if it is +available and falls back to `infohack.el' otherwise. `make.bat' should +now install all files which are necessary to run Gnus and be generally a +complete replacement for the `configure; make; make install' cycle used +under Unix systems. + +The new `make.bat' makes `make-x.bat' and `xemacs.mak' superfluous, so +they have been removed. + +** `~/News/overview/' not used. + +As a result of the following change, the `~/News/overview/' directory is +not used any more. You can safely delete the entire hierarchy. + +** `(require 'gnus-load)' + +If you use a stand-alone Gnus distribution, you'd better add `(require +'gnus-load)' into your `~/.emacs' after adding the Gnus lisp directory +into load-path. + +File `gnus-load.el' contains autoload commands, functions and variables, +some of which may not be included in distributions of Emacsen. + + + +* New packages and libraries within Gnus + +** The revised Gnus FAQ is included in the manual, *Note Frequently Asked +Questions::. + +** TLS wrapper shipped with Gnus + +TLS/SSL is now supported in IMAP and NNTP via `tls.el' and GNUTLS. The +old TLS/SSL support via (external third party) `ssl.el' and OpenSSL +still works. + +** Improved anti-spam features. + +Gnus is now able to take out spam from your mail and news streams using +a wide variety of programs and filter rules. Among the supported +methods are RBL blocklists, bogofilter and white/blacklists. Hooks for +easy use of external packages such as SpamAssassin and Hashcash are also +new. *Note Thwarting Email Spam::. + +** Gnus supports server-side mail filtering using Sieve. + +Sieve rules can be added as Group Parameters for groups, and the +complete Sieve script is generated using `D g' from the Group buffer, +and then uploaded to the server using `C-c C-l' in the generated Sieve +buffer. *Note Sieve Commands::, and the new Sieve manual *Note Top: +(sieve)Top. + + + +* Changes in group mode + +** `gnus-group-read-ephemeral-group' can be called interactively, using `G +M'. + +** Retrieval of charters and control messages + +There are new commands for fetching newsgroup charters (`H c') and +control messages (`H C'). + +** The new variable `gnus-parameters' can be used to set group parameters. + +Earlier this was done only via `G p' (or `G c'), which stored the +parameters in `~/.newsrc.eld', but via this variable you can enjoy the +powers of customize, and simplified backups since you set the variable +in `~/.gnus.el' instead of `~/.newsrc.eld'. The variable maps regular +expressions matching group names to group parameters, a'la: +(setq gnus-parameters + '(("mail\\..*" + (gnus-show-threads nil) + (gnus-use-scoring nil)) + ("^nnimap:\\(foo.bar\\)$" + (to-group . "\\1")))) + +** Unread count correct in nnimap groups. + +The estimated number of unread articles in the group buffer should now +be correct for nnimap groups. This is achieved by calling +`nnimap-fixup-unread-after-getting-new-news' from the +`gnus-setup-news-hook' (called on startup) and +`gnus-after-getting-new-news-hook'. (called after getting new mail). If +you have modified those variables from the default, you may want to add +`nnimap-fixup-unread-after-getting-new-news' again. If you were happy +with the estimate and want to save some (minimal) time when getting new +mail, remove the function. + +** Group names are treated as UTF-8 by default. + +This is supposedly what USEFOR wanted to migrate to. See +`gnus-group-name-charset-group-alist' and +`gnus-group-name-charset-method-alist' for customization. + +** `gnus-group-charset-alist' and `gnus-group-ignored-charsets-alist'. + +The regexps in these variables are compared with full group names +instead of real group names in 5.8. Users who customize these variables +should change those regexps accordingly. For example: +("^han\\>" euc-kr) -> ("\\(^\\|:\\)han\\>" euc-kr) + + + +* Changes in summary and article mode + +** `F' (`gnus-article-followup-with-original') and `R' +(`gnus-article-reply-with-original') only yank the text in the region if +the region is active. + +** In draft groups, `e' is now bound to `gnus-draft-edit-message'. Use `B +w' for `gnus-summary-edit-article' instead. ** Article Buttons -More buttons for URLs, mail addresses, Message-IDs, Info links, man pages and -Emacs or Gnus related references, see the info node "Article Buttons". The -variables `gnus-button-*-level' can be used to control the appearance of all -article buttons, see the info node "Article Button Levels". - -** Dired integration - -`gnus-dired-minor-mode' installs key bindings in dired buffers to send a file -as an attachment (`C-c C-m C-a'), open a file using the approriate mailcap -entry (`C-c C-m C-l'), and print a file using the mailcap entry (`C-c C-m -C-p'). See the info node "Other modes". - - -** Gnus can display RSS newsfeeds as a newsgroup. To get started do `B -nnrss RET RET' in the Group buffer. +More buttons for URLs, mail addresses, Message-IDs, Info links, man +pages and Emacs or Gnus related references. *Note Article Buttons::. +The variables `gnus-button-*-level' can be used to control the +appearance of all article buttons. *Note Article Button Levels::. ** Single-part yenc encoded attachments can be decoded. ** Picons -The picons code has been reimplemented to work in Emacs 21 -- some of -the previous options have been removed or renamed. + +The picons code has been reimplemented to work in GNU Emacs--some of the +previous options have been removed or renamed. Picons are small "personal icons" representing users, domain and -newsgroups, which can be displayed in the Article buffer. To enable -picons, install the picons database from +newsgroups, which can be displayed in the Article buffer. *Note +Picons::. - http://www.cs.indiana.edu/picons/ftp/index.html - -and point `gnus-picon-databases' to that location. - -** If the new option `gnus-treat-body-boundary' is `head', a boundary +** If the new option `gnus-treat-body-boundary' is non-`nil', a boundary line is drawn at the end of the headers. -** Retrieval of charters and control messages -There are new commands for fetching newsgroup charters (`H c') and -control messages (`H C'). - -** Delayed articles -You can delay the sending of a message with `C-c C-j' in the Message -buffer. The messages are delivered at specified time. This is useful -for sending yourself reminders. Setup with (gnus-delay-initialize). - -** If `auto-compression-mode' is enabled, attachments are automatically -decompressed when activated. - -** If the new option `nnml-use-compressed-files' is non-nil, -the nnml back end allows compressed message files. - ** Signed article headers (X-PGP-Sig) can be verified with `W p'. -** The Summary Buffer uses an arrow in the fringe to indicate the -current article in Emacs 21 running on a graphical display. Customize -`gnus-summary-display-arrow' to disable it. +** The Summary Buffer uses an arrow in the fringe to indicate the current +article. Use `(setq gnus-summary-display-arrow nil)' to disable it. ** Warn about email replies to news + Do you often find yourself replying to news by email by mistake? Then the new option `gnus-confirm-mail-reply-to-news' is just the thing for you. -** If the new option `gnus-summary-display-while-building' is non-nil, +** If the new option `gnus-summary-display-while-building' is non-`nil', the summary buffer is shown and updated as it's being built. -** The new `recent' mark "." indicates newly arrived messages (as -opposed to old but unread messages). - -** The new option `gnus-gcc-mark-as-read' automatically marks -Gcc articles as read. - -** The nndoc back end now supports mailman digests and exim bounces. +** The new `recent' mark `.' indicates newly arrived messages (as opposed +to old but unread messages). ** Gnus supports RFC 2369 mailing list headers, and adds a number of -related commands in mailing list groups. +related commands in mailing list groups. *Note Mailing List::. -** The Date header can be displayed in a format that can be read aloud -in English, see `gnus-treat-date-english'. - -** The envelope sender address can be customized when using Sendmail, see -`message-sendmail-envelope-from'. +** The Date header can be displayed in a format that can be read aloud in +English. *Note Article Date::. ** diffs are automatically highlighted in groups matching `mm-uu-diff-groups-regexp' -** TLS wrapper shipped with Gnus - -TLS/SSL is now supported in IMAP and NNTP via tls.el and GNUTLS. The -old TLS/SSL support via (external third party) ssl.el and OpenSSL -still works. - -** New make.bat for compiling and installing Gnus under MS Windows - -Use make.bat if you want to install Gnus under MS Windows, the first -argument to the batch-program should be the directory where xemacs.exe -respectively emacs.exe is located, iff you want to install Gnus after -compiling it, give make.bat /copy as the second parameter. - -`make.bat' has been rewritten from scratch, it now features automatic -recognition of XEmacs and GNU Emacs, generates gnus-load.el, checks if -errors occur while compilation and generation of info files and reports -them at the end of the build process. It now uses makeinfo if it is -available and falls back to infohack.el otherwise. `make.bat' should now -install all files which are necessary to run Gnus and be generally a -complete replacement for the "configure; make; make install" cycle used -under Unix systems. - -The new make.bat makes make-x.bat superfluous, so it has been removed. - -** Support for non-ASCII domain names - -Message supports non-ASCII domain names in From:, To: and Cc: and will -encode them when you try to send a message. The variable -`message-use-idna' controls this. Gnus will also decode non-ASCII -domain names in From:, To: and Cc: when you view a message. The -variable `gnus-use-idna' controls this. - ** Better handling of Microsoft citation styles Gnus now tries to recognize the mangled header block that some Microsoft @@ -155,228 +204,184 @@ though it is not quoted in any way. The variable `gnus-cite-unsightly-citation-regexp' matches the start of these citations. -** gnus-article-skip-boring +The new command `W Y f' (`gnus-article-outlook-deuglify-article') allows +deuglifying broken Outlook (Express) articles. -If you set `gnus-article-skip-boring' to t, then Gnus will not scroll -down to show you a page that contains only boring text, which by -default means cited text and signature. You can customize what is -skippable using `gnus-article-boring-faces'. +** `gnus-article-skip-boring' -This feature is especially useful if you read many articles that -consist of a little new content at the top with a long, untrimmed -message cited below. +If you set `gnus-article-skip-boring' to `t', then Gnus will not scroll +down to show you a page that contains only boring text, which by default +means cited text and signature. You can customize what is skippable +using `gnus-article-boring-faces'. -** The format spec %C for positioning point has changed to %*. +This feature is especially useful if you read many articles that consist +of a little new content at the top with a long, untrimmed message cited +below. -** The new variable `gnus-parameters' can be used to set group parameters. +** Smileys (`:-)', `;-)' etc) are now displayed graphically in Emacs too. -Earlier this was done only via `G p' (or `G c'), which stored the -parameters in ~/.newsrc.eld, but via this variable you can enjoy the -powers of customize, and simplified backups since you set the variable -in ~/.emacs instead of ~/.newsrc.eld. The variable maps regular -expressions matching group names to group parameters, a'la: +Put `(setq gnus-treat-display-smileys nil)' in `~/.gnus.el' to disable +it. - (setq gnus-parameters - '(("mail\\..*" - (gnus-show-threads nil) - (gnus-use-scoring nil)) - ("^nnimap:\\(foo.bar\\)$" - (to-group . "\\1")))) +** Face headers handling. *Note Face::. -** Smileys (":-)", ";-)" etc) are now iconized for Emacs too. +** In the summary buffer, the new command `/ N' inserts new messages and `/ +o' inserts old messages. -Customize `gnus-treat-display-smileys' to disable it. +** Gnus decodes morse encoded messages if you press `W m'. -** Gnus no longer generates the Sender: header automatically. +** `gnus-summary-line-format' -Earlier it was generated iff the user configurable email address was -different from the Gnus guessed default user address. As the guessing -algorithm is rarely correct these days, and (more controversially) the -only use of the Sender: header was to check if you are entitled to -cancel/supersede news (which is now solved by Cancel Locks instead, -see another entry), generation of the header has been disabled by -default. See the variables `message-required-headers', -`message-required-news-headers', and `message-required-mail-headers'. - -** Features from third party message-utils.el added to message.el. - -Message now asks if you wish to remove "(was: )" from -subject lines (see `message-subject-trailing-was-query'). C-c M-m and -C-c M-f inserts markers indicating included text. C-c C-f a adds a -X-No-Archive: header. C-c C-f x inserts appropriate headers and a -note in the body for cross-postings and followups (see the variables -`message-cross-post-*'). - -** References and X-Draft-Headers are no longer generated when you -start composing messages and `message-generate-headers-first' is nil. - -** Improved anti-spam features. - -Gnus is now able to take out spam from your mail and news streams -using a wide variety of programs and filter rules. Among the supported -methods are RBL blocklists, bogofilter and white/blacklists. Hooks -for easy use of external packages such as SpamAssassin and Hashcash -are also new. - -** Easy inclusion of X-Faces headers. - -** In the summary buffer, the new command / N inserts new messages and -/ o inserts old messages. - -** Gnus decodes morse encoded messages if you press W m. - -** Unread count correct in nnimap groups. - -The estimated number of unread articles in the group buffer should now -be correct for nnimap groups. This is achieved by calling -`nnimap-fixup-unread-after-getting-new-news' from the -`gnus-setup-news-hook' (called on startup) and -`gnus-after-getting-new-news-hook' (called after getting new mail). -If you have modified those variables from the default, you may want to -add n-f-u-a-g-n-n again. If you were happy with the estimate and want -to save some (minimal) time when getting new mail, remove the -function. - -** Group Carbon Copy (GCC) quoting - -To support groups that contains SPC and other weird characters, groups -are quoted before they are placed in the Gcc: header. This means -variables such as `gnus-message-archive-group' should no longer -contain quote characters to make groups containing SPC work. Also, if -you are using the string "nnml:foo, nnml:bar" (indicating Gcc into two -groups) you must change it to return the list ("nnml:foo" "nnml:bar"), -otherwise the Gcc: line will be quoted incorrectly. Note that -returning the string "nnml:foo, nnml:bar" was incorrect earlier, it -just didn't generate any problems since it was inserted directly. - -** ~/News/overview/ not used. - -As a result of the following change, the ~/News/overview/ directory is -not used any more. You can safely delete the entire hierarchy. - -** gnus-agent - -The Gnus Agent has seen a major update. It is now enabled by default, -and all nntp and nnimap servers from `gnus-select-method' and -`gnus-secondary-select-method' are agentized by default. Earlier only -the server in `gnus-select-method' was agentized by the default, and the -agent was disabled by default. When the agent is enabled, headers are -now also retrieved from the Agent cache instead of the backends when -possible. Earlier this only happened in the unplugged state. You can -enroll or remove servers with `J a' and `J r' in the server buffer. -Gnus will not download articles into the Agent cache, unless you -instruct it to do so, though, by using `J u' or `J s' from the Group -buffer. You revert to the old behaviour of having the Agent disabled -by customizing `gnus-agent'. Note that putting `(gnus-agentize)' in -~/.gnus is not needed any more. - -** gnus-summary-line-format - -The default value changed to "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n". +The default value changed to `%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n'. Moreover `gnus-extra-headers', `nnmail-extra-headers' and `gnus-ignored-from-addresses' changed their default so that the users -name will be replaced by the recipient's name or the group name -posting to for NNTP groups. +name will be replaced by the recipient's name or the group name posting +to for NNTP groups. -** deuglify.el (gnus-article-outlook-deuglify-article) - -A new file from Raymond Scholz for deuglifying -broken Outlook (Express) articles. - -** (require 'gnus-load) - -If you use a stand-alone Gnus distribution, you'd better add -"(require 'gnus-load)" to your ~/.emacs after adding the Gnus -lisp directory into load-path. - -File gnus-load.el contains autoload commands, functions and variables, -some of which may not be included in distributions of Emacsen. - -** gnus-slave-unplugged - -A new command which starts gnus offline in slave mode. - -** message-insinuate-rmail - -Adding (message-insinuate-rmail) in .emacs and customizing -`mail-user-agent' to `gnus-user-agent' convinces Rmail to compose, -reply and forward messages in Message mode, where you can enjoy the -power of MML. - -** message-minibuffer-local-map - -The line below enables BBDB in resending a message: - -(define-key message-minibuffer-local-map [?\t] 'bbdb-complete-name) - -** Externalizing and deleting of attachments. - -If `gnus-gcc-externalize-attachments' (or -`message-fcc-externalize-attachments') is non-nil, attach local files -as external parts. +** Deleting of attachments. The command `gnus-mime-save-part-and-strip' (bound to `C-o' on MIME buttons) saves a part and replaces the part with an external one. `gnus-mime-delete-part' (bound to `d' on MIME buttons) removes a part. It works only on back ends that support editing. -** gnus-default-charset +** `gnus-default-charset' -The default value now guesses on the basis of your environment instead -of using Latin-1. Also the ".*" item in gnus-group-charset-alist is -removed. - -** gnus-posting-styles - -Add a new format of match like - - ((header "to" "larsi.*org") - (Organization "Somewhere, Inc.")) - -The old format like the lines below is obsolete, but still accepted. - - (header "to" "larsi.*org" - (Organization "Somewhere, Inc.")) - -** message-ignored-news-headers and message-ignored-mail-headers - -X-Draft-From and X-Gnus-Agent-Meta-Information have been added into -these two variables. If you customized those, perhaps you need add -those two headers too. - -** Gnus reads the NOV and articles in the Agent if plugged. - -If one reads an article while plugged, and the article already exists -in the Agent, it won't get downloaded once more. Customize -`gnus-agent-cache' to revert to the old behavior. - -** Gnus supports the "format=flowed" (RFC 2646) parameter. - -On composing messages, it is enabled by `use-hard-newlines'. Decoding -format=flowed was present but not documented in earlier versions. - -** The option `mm-fill-flowed' can be used to disable treatment of -format=flowed messages. Also, flowed text is disabled when sending -inline PGP signed messages. (New in Gnus 5.10.8) - -** The tool bar icons are now (de)activated correctly in the group -buffer, see the variable `gnus-group-update-tool-bar'. It's default -value depends on your Emacs version. (New in Gnus 5.10.8) - -** Gnus supports the generation of RFC 2298 Disposition Notification requests. - -This is invoked with the C-c M-n key binding from message mode. - -** Gnus supports Maildir groups. - -Gnus includes a new backend nnmaildir.el. +The default value is determined from the `current-language-environment' +variable, instead of `iso-8859-1'. Also the `.*' item in +`gnus-group-charset-alist' is removed. ** Printing capabilities are enhanced. -Gnus supports Muttprint natively with O P from the Summary and Article -buffers. Also, each individual MIME part can be printed using p on +Gnus supports Muttprint natively with `O P' from the Summary and Article +buffers. Also, each individual MIME part can be printed using `p' on the MIME button. +** Extended format specs. + +Format spec `%&user-date;' is added into +`gnus-summary-line-format-alist'. Also, user defined extended format +specs are supported. The extended format specs look like `%u&foo;', +which invokes function `gnus-user-format-function-FOO'. Because `&' is +used as the escape character, old user defined format `%u&' is no longer +supported. + +** `/ *' (`gnus-summary-limit-include-cached') is rewritten. + +It was aliased to `Y c' (`gnus-summary-insert-cached-articles'). The +new function filters out other articles. + +** Some limiting commands accept a `C-u' prefix to negate the match. + +If `C-u' is used on subject, author or extra headers, i.e., `/ s', `/ +a', and `/ x' (`gnus-summary-limit-to-{subject,author,extra}') +respectively, the result will be to display all articles that do not +match the expression. + +** Gnus inlines external parts (message/external). + + + +* Changes in Message mode and related Gnus features + +** Delayed articles + +You can delay the sending of a message with `C-c C-j' in the Message +buffer. The messages are delivered at specified time. This is useful +for sending yourself reminders. *Note Delayed Articles::. + +** If the new option `nnml-use-compressed-files' is non-`nil', the nnml +back end allows compressed message files. + +** The new option `gnus-gcc-mark-as-read' automatically marks Gcc articles +as read. + +** Externalizing of attachments + +If `gnus-gcc-externalize-attachments' or +`message-fcc-externalize-attachments' is non-`nil', attach local files +as external parts. + +** The envelope sender address can be customized when using Sendmail. + *Note Mail Variables: (message)Mail Variables. + +** Gnus no longer generate the Sender: header automatically. + +Earlier it was generated iff the user configurable email address was +different from the Gnus guessed default user address. As the guessing +algorithm is rarely correct these days, and (more controversially) the +only use of the Sender: header was to check if you are entitled to +cancel/supersede news (which is now solved by Cancel Locks instead, see +another entry), generation of the header has been disabled by default. +See the variables `message-required-headers', +`message-required-news-headers', and `message-required-mail-headers'. + +** Features from third party `message-utils.el' added to `message.el'. + +Message now asks if you wish to remove `(was: )' from +subject lines (see `message-subject-trailing-was-query'). `C-c M-m' and +`C-c M-f' inserts markers indicating included text. `C-c C-f a' adds a +X-No-Archive: header. `C-c C-f x' inserts appropriate headers and a +note in the body for cross-postings and followups (see the variables +`message-cross-post-*'). + +** References and X-Draft-From headers are no longer generated when you +start composing messages and `message-generate-headers-first' is `nil'. + +** Easy inclusion of X-Faces headers. *Note X-Face::. + +** Group Carbon Copy (GCC) quoting + +To support groups that contains SPC and other weird characters, groups +are quoted before they are placed in the Gcc: header. This means +variables such as `gnus-message-archive-group' should no longer contain +quote characters to make groups containing SPC work. Also, if you are +using the string `nnml:foo, nnml:bar' (indicating Gcc into two groups) +you must change it to return the list `("nnml:foo" "nnml:bar")', +otherwise the Gcc: line will be quoted incorrectly. Note that returning +the string `nnml:foo, nnml:bar' was incorrect earlier, it just didn't +generate any problems since it was inserted directly. + +** `message-insinuate-rmail' + +Adding `(message-insinuate-rmail)' and `(setq mail-user-agent +'gnus-user-agent)' in `.emacs' convinces Rmail to compose, reply and +forward messages in message-mode, where you can enjoy the power of MML. + +** `message-minibuffer-local-map' + +The line below enables BBDB in resending a message: +(define-key message-minibuffer-local-map [(tab)] + 'bbdb-complete-name) + +** `gnus-posting-styles' + +Add a new format of match like +((header "to" "larsi.*org") + (Organization "Somewhere, Inc.")) +The old format like the lines below is obsolete, but still accepted. +(header "to" "larsi.*org" + (Organization "Somewhere, Inc.")) + +** `message-ignored-news-headers' and `message-ignored-mail-headers' + +`X-Draft-From' and `X-Gnus-Agent-Meta-Information' have been added into +these two variables. If you customized those, perhaps you need add +those two headers too. + +** Gnus supports the "format=flowed" (RFC 2646) parameter. On composing +messages, it is enabled by `use-hard-newlines'. Decoding format=flowed +was present but not documented in earlier versions. + +** The option `mm-fill-flowed' can be used to disable treatment of +"format=flowed" messages. Also, flowed text is disabled when sending +inline PGP signed messages. (New in Gnus 5.10.7) + +** Gnus supports the generation of RFC 2298 Disposition Notification +requests. + +This is invoked with the `C-c M-n' key binding from message mode. + ** Message supports the Importance: (RFC 2156) header. In the message buffer, `C-c C-f C-i' or `C-c C-u' cycles through the @@ -384,151 +389,130 @@ valid values. ** Gnus supports Cancel Locks in News. -This means a header "Cancel-Lock" is inserted in news posting. It is -used to determine if you wrote a article or not (for cancelling and +This means a header `Cancel-Lock' is inserted in news posting. It is +used to determine if you wrote an article or not (for canceling and superseding). Gnus generates a random password string the first time -you post a message, and saves it using the Custom system. While the -variable is called `canlock-password', it is not security sensitive -data. Publishing your canlock string on the web will not allow anyone -to be able to anything she could not already do. The behaviour can be -changed by customizing `message-insert-canlock'. +you post a message, and saves it in your `~/.emacs' using the Custom +system. While the variable is called `canlock-password', it is not +security sensitive data. Publishing your canlock string on the web will +not allow anyone to be able to anything she could not already do. The +behavior can be changed by customizing `message-insert-canlock'. -** Gnus supports server-side mail filtering using Sieve. - -Sieve rules can be added as Group Parameters for groups, and the -complete Sieve script is generated using `D g' from the Group buffer, -and then uploaded to the server using `C-c C-l' in the generated Sieve -buffer. Search the online Gnus manual for "sieve", and see the new -Sieve manual, for more information. - -** Extended format specs. - -Format spec "%&user-date;" is added into -`gnus-summary-line-format-alist'. Also, user defined extended format -specs are supported. The extended format specs look like "%u&foo;", -which invokes function `gnus-user-format-function-foo'. Because "&" is -used as the escape character, old user defined format "%u&" is no -longer supported. - -** `/ *' (gnus-summary-limit-include-cached) is rewritten. - -It was aliased to `Y c' (gnus-summary-insert-cached-articles). The new -function filters out other articles. - -** Some limiting commands accept a C-u prefix to negate the match. - -If C-u is used on subject, author or extra headers, i.e., `/ s', `/ -a', and `/ x' (gnus-summary-limit-to-{subject,author,extra}) -respectively, the result will be to display all articles that do not -match the expression. - -** Group names are treated as UTF-8 by default. - -This is supposedly what USEFOR wanted to migrate to. See -`gnus-group-name-charset-group-alist' and -`gnus-group-name-charset-method-alist' for customization. - -** The nnml and nnfolder backends store marks for each group. - -This makes it possible to take backup of nnml/nnfolder servers/groups -separately of ~/.newsrc.eld, while preserving marks. It also makes it -possible to share articles and marks between users (without sharing -the ~/.newsrc.eld file) within e.g. a department. It works by storing -the marks stored in ~/.newsrc.eld in a per-group file ".marks" (for -nnml) and "groupname.mrk" (for nnfolder, named "groupname"). If the -nnml/nnfolder is moved to another machine, Gnus will automatically use -the .marks or .mrk file instead of the information in ~/.newsrc.eld. -The new server variables `nnml-marks-is-evil' and -`nnfolder-marks-is-evil' can be used to disable this feature. - -** The menu bar item (in Group and Summary buffer) named "Misc" has -been renamed to "Gnus". - -** The menu bar item (in Message mode) named "MML" has been renamed to -"Attachments". Note that this menu also contains security related -stuff, like signing and encryption. - -** gnus-group-charset-alist and gnus-group-ignored-charsets-alist. - -The regexps in these variables are compared with full group names -instead of real group names in 5.8. Users who customize these -variables should change those regexps accordingly. For example: - - ("^han\\>" euc-kr) -> ("\\(^\\|:\\)han\\>" euc-kr) - -** Gnus supports PGP (RFC 1991/2440), PGP/MIME (RFC 2015/3156) and -S/MIME (RFC 2630-2633). +** Gnus supports PGP (RFC 1991/2440), PGP/MIME (RFC 2015/3156) and S/MIME +(RFC 2630-2633). It needs an external S/MIME and OpenPGP implementation, but no -additional lisp libraries. This add several menu items to the -Attachments menu, and C-c RET key bindings, when composing messages. +additional Lisp libraries. This add several menu items to the +Attachments menu, and `C-c RET' key bindings, when composing messages. This also obsoletes `gnus-article-hide-pgp-hook'. -** Gnus inlines external parts (message/external). - ** MML (Mime compose) prefix changed from `M-m' to `C-c C-m'. This change was made to avoid conflict with the standard binding of `back-to-indentation', which is also useful in message mode. -** The default for message-forward-show-mml changed to symbol best. +** The default for `message-forward-show-mml' changed to the symbol `best'. -The behaviour for the `best' value is to show MML (i.e., convert MIME -to MML) when appropriate. MML will not be used when forwarding signed -or encrypted messages, as the conversion invalidate the digital -signature. +The behavior for the `best' value is to show MML (i.e., convert to MIME) +when appropriate. MML will not be used when forwarding signed or +encrypted messages, as the conversion invalidate the digital signature. + +** If `auto-compression-mode' is enabled, attachments are automatically +decompressed when activated. + +** Support for non-ASCII domain names + +Message supports non-ASCII domain names in From:, To: and Cc: and will +query you whether to perform encoding when you try to send a message. +The variable `message-use-idna' controls this. Gnus will also decode +non-ASCII domain names in From:, To: and Cc: when you view a message. +The variable `gnus-use-idna' controls this. + +** You can now drag and drop attachments to the Message buffer. See +`mml-dnd-protocol-alist' and `mml-dnd-attach-options'. *Note MIME: +(message)MIME. -** Bug fixes. -* Changes in Pterodactyl Gnus (5.8/5.9) +* Changes in back ends -The Gnus NEWS entries are short, but they reflect sweeping changes in -four areas: Article display treatment, MIME treatment, -internationalization and mail-fetching. +** Gnus can display RSS newsfeeds as a newsgroup. *Note RSS::. -** The mail-fetching functions have changed. See the manual for the -many details. In particular, all procmail fetching variables are gone. +** The nndoc back end now supports mailman digests and exim bounces. -If you used procmail like in +** Gnus supports Maildir groups. -(setq nnmail-use-procmail t) -(setq nnmail-spool-file 'procmail) -(setq nnmail-procmail-directory "~/mail/incoming/") -(setq nnmail-procmail-suffix "\\.in") +Gnus includes a new back end `nnmaildir.el'. *Note Maildir::. -this now has changed to +** The nnml and nnfolder back ends store marks for each groups. -(setq mail-sources - '((directory :path "~/mail/incoming/" - :suffix ".in"))) +This makes it possible to take backup of nnml/nnfolder servers/groups +separately of `~/.newsrc.eld', while preserving marks. It also makes it +possible to share articles and marks between users (without sharing the +`~/.newsrc.eld' file) within e.g. a department. It works by storing the +marks stored in `~/.newsrc.eld' in a per-group file `.marks' (for nnml) +and `GROUPNAME.mrk' (for nnfolder, named GROUPNAME). If the +nnml/nnfolder is moved to another machine, Gnus will automatically use +the `.marks' or `.mrk' file instead of the information in +`~/.newsrc.eld'. The new server variables `nnml-marks-is-evil' and +`nnfolder-marks-is-evil' can be used to disable this feature. -More information is available in the info doc at Select Methods -> -Getting Mail -> Mail Sources -** Gnus is now a MIME-capable reader. This affects many parts of -Gnus, and adds a slew of new commands. See the manual for details. + +* Appearance -** Gnus has also been multilingualized. This also affects too -many parts of Gnus to summarize here, and adds many new variables. +** The menu bar item (in Group and Summary buffer) named "Misc" has been +renamed to "Gnus". -** gnus-auto-select-first can now be a function to be -called to position point. +** The menu bar item (in Message mode) named "MML" has been renamed to +"Attachments". Note that this menu also contains security related +stuff, like signing and encryption (*note Security: (message)Security.). -** The user can now decide which extra headers should be included in -summary buffers and NOV files. +** The tool bars have been updated to use GNOME icons in Group, Summary and +Message mode. You can also customize the tool bars. This is a new +feature in Gnus 5.10.9. (Only for Emacs, not in XEmacs.) -** `gnus-article-display-hook' has been removed. Instead, a number -of variables starting with `gnus-treat-' have been added. +** The tool bar icons are now (de)activated correctly in the group buffer, +see the variable `gnus-group-update-tool-bar'. Its default value +depends on your Emacs version. This is a new feature in Gnus 5.10.9. -** The Gnus posting styles have been redone again and now works in a -subtly different manner. + +* Miscellaneous changes -** New web-based backends have been added: nnslashdot, nnwarchive -and nnultimate. nnweb has been revamped, again, to keep up with -ever-changing layouts. +** `gnus-agent' + +The Gnus Agent has seen a major updated and is now enabled by default, +and all nntp and nnimap servers from `gnus-select-method' and +`gnus-secondary-select-method' are agentized by default. Earlier only +the server in `gnus-select-method' was agentized by the default, and the +agent was disabled by default. When the agent is enabled, headers are +now also retrieved from the Agent cache instead of the back ends when +possible. Earlier this only happened in the unplugged state. You can +enroll or remove servers with `J a' and `J r' in the server buffer. +Gnus will not download articles into the Agent cache, unless you +instruct it to do so, though, by using `J u' or `J s' from the Group +buffer. You revert to the old behavior of having the Agent disabled +with `(setq gnus-agent nil)'. Note that putting `(gnus-agentize)' in +`~/.gnus.el' is not needed any more. + +** Gnus reads the NOV and articles in the Agent if plugged. + +If one reads an article while plugged, and the article already exists in +the Agent, it won't get downloaded once more. `(setq gnus-agent-cache +nil)' reverts to the old behavior. + +** Dired integration + +`gnus-dired-minor-mode' (see *Note Other modes::) installs key bindings +in dired buffers to send a file as an attachment, open a file using the +appropriate mailcap entry, and print a file using the mailcap entry. + +** The format spec `%C' for positioning point has changed to `%*'. + +** `gnus-slave-unplugged' + +A new command which starts Gnus offline in slave mode. -** Gnus can now read IMAP mail via nnimap. * For older news, see Gnus info node "New Features". @@ -536,8 +520,8 @@ ever-changing layouts. ---------------------------------------------------------------------- Copyright information: -Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 Free Software Foundation, Inc. +Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006 Free Software Foundation, Inc. Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the diff --git a/etc/NEWS b/etc/NEWS index c00d13937eb..aefb11ccb2d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -95,7 +95,6 @@ doesn't automatically select the right one. Its name is `pt-br-refcard.tex'. The corresponding PostScript file is also included. - --- ** A French translation of the `Emacs Survival Guide' is available. @@ -202,6 +201,13 @@ an interactively callable function. all frames you create. A position specified with --geometry only affects the initial frame. +--- +** Emacs built for MS-Windows now behaves like Emacs on X does, +wrt its frame position: if you don't specify a position (in your +.emacs init file, in the Registry, or with the --geometry command-line +option), Emacs leaves the frame position to the Windows' window +manager. + +++ ** Emacs can now be invoked in full-screen mode on a windowed display. When Emacs is invoked on a window system, the new command-line options @@ -241,8 +247,9 @@ according to the value of `save-abbrevs'. +++ ** If the environment variable EMAIL is defined, Emacs now uses its value -to compute the default value of `use-mail-address', in preference to +to compute the default value of `user-mail-address', in preference to concatenation of `user-login-name' with the name of your host machine. + * Incompatible Editing Changes in Emacs 22.1 @@ -832,6 +839,13 @@ The variable `automatic-hscrolling' was renamed to the window now works sensibly, by automatically adjusting the window's vscroll property. +*** New customize option `overline-margin' controls the space between +overline and text. + +*** New variable `x-underline-at-descent-line' controls the relative +position of the underline. When set, it overrides the +`x-use-underline-position-properties' variables. + +++ *** The new face `mode-line-inactive' is used to display the mode line of non-selected windows. The `mode-line' face is now used to display @@ -1764,9 +1778,8 @@ type "C-h i m org RET" to read that manual. A reference card is 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 @@ -1987,6 +2000,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 @@ -1995,11 +2009,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 @@ -2010,23 +2032,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'. @@ -3505,6 +3547,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. @@ -3654,8 +3699,10 @@ w32-use-full-screen-buffer to t. * Incompatible Lisp Changes in Emacs 22.1 -** The function find-operation-coding-system accepts a cons (FILENAME -. BUFFER) in an argument correponding to the target. +** The function find-operation-coding-system may be called with a cons +(FILENAME . BUFFER) in the second argument if the first argument +OPERATION is `insert-file-contents', and thus a function registered in +`file-coding-system-alist' is also called with such an argument. --- ** The variables post-command-idle-hook and post-command-idle-delay have @@ -4625,6 +4672,7 @@ keymap alist to this list. *** The definition of a key-binding passed to define-key can use XEmacs-style key-sequences, such as [(control a)]. + ** Abbrev changes: +++ @@ -5354,6 +5402,11 @@ text to being a piece of code, so you'd put a `jit-lock-defer-multiline' property over the second half of the command to force (deferred) refontification of `bar' whenever the `e' is added/removed. +*** `font-lock-extend-region-functions' makes it possible to alter the way +the fontification region is chosen. This can be used to prevent rounding +up to whole lines, or to extend the region to include all related lines +of multiline constructs so that such constructs get properly recognized. + ** Major mode mechanism changes: +++ @@ -5448,6 +5501,9 @@ been renamed to `disabled-command-function'. The variable *** `emacsserver' now runs `pre-command-hook' and `post-command-hook' when it receives a request from emacsclient. ++++ +*** `current-idle-time' reports how long Emacs has been idle. + ** Lisp file loading changes: +++ diff --git a/etc/TODO b/etc/TODO index de0097cde87..0c807662ae1 100644 --- a/etc/TODO +++ b/etc/TODO @@ -21,7 +21,7 @@ a window doesn't select it. but if you type M-n you should get the visited file name of the current buffer. -** whitespace-cleanup should work only on the region if the region is active. +** describe-face should show an example of text in the face. ** Distribute a bar cursor of width > 1 evenly between the two glyphs on each side of the bar (what to do at the edges?). @@ -125,6 +125,9 @@ current buffer. ** Internationalize Emacs's messages. +** Set up a facility to save backtraces when errors happen during +specified filters, specified timers, and specified hooks. + ** Install mmc@maruska.dyndns.org's no-flicker change. ** Add a "current vertical pixel level" value that goes with point, diff --git a/etc/TUTORIAL b/etc/TUTORIAL index 5748d0d4e5e..63e5d601fed 100644 --- a/etc/TUTORIAL +++ b/etc/TUTORIAL @@ -217,7 +217,7 @@ This should have scrolled the screen up by 8 lines. If you would like 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. @@ -644,18 +644,18 @@ session--this is the command C-x C-c. (Do not worry about losing changes you have made; C-x C-c offers to save each changed file before it kills the Emacs.) +If you are using a graphical display that supports multiple +applications in parallel, you don't need any special command to move +from Emacs to another application. You can do this with the mouse or +with window manager commands. However, if you're using a text +terminal which can only show one application at a time, you need to +"suspend" Emacs to move to any other program. + C-z is the command to exit Emacs *temporarily*--so that you can go -back to the same Emacs session afterward. - -On systems which allow it, C-z "suspends" Emacs; that is, it returns -to the shell but does not destroy the Emacs. In the most common -shells, you can resume Emacs with the `fg' command or with `%emacs'. - -On systems which do not implement suspending, C-z creates a subshell -running under Emacs to give you the chance to run other programs and -return to Emacs afterward; it does not truly "exit" from Emacs. In -this case, the shell command `exit' is the usual way to get back to -Emacs from the subshell. +back to the same Emacs session afterward. When Emacs is running on a +text terminal, C-z "suspends" Emacs; that is, it returns to the shell +but does not destroy the Emacs. In the most common shells, you can +resume Emacs with the `fg' command or with `%emacs'. The time to use C-x C-c is when you are about to log out. It's also the right thing to use to exit an Emacs invoked under mail handling diff --git a/etc/TUTORIAL.cn b/etc/TUTORIAL.cn index a1589aa0cd7..7ba8d808c2d 100644 --- a/etc/TUTORIAL.cn +++ b/etc/TUTORIAL.cn @@ -165,7 +165,7 @@ M-comma 大部分的 Emacs 命令接受数字参数,并且对于多数命令而言,这些数字参数的作 用是指定命令的重复次数。为一个命令指定数字参数(也就是重复次数)的方法 是:先输入 C-u,然后输入数字作为参数,最后再输入命令。如果你有META (或 -EDIT 或 ALT)键,那么还有另一种办法:按住 META 键不动,然后输入数字。不 +EDIT 或 ALT)键,那么还有另一种办法:按住 META 键不放,然后输入数字。不 过我们还是建议你用 C-u,因为它在任何终端机上都能用。这种数字参数也称为 “前缀参数”,意思是说这个参数是先于使用它的命令而输入的。 @@ -174,9 +174,9 @@ EDIT >> 为 C-n 或者 C-p 指定一个数字参数,这样你可以只用一个命令就把光标移动 到本行的附近。 -虽然大部分命令用数字参数来作为其重复次数,但是也有些命令例外,它们将数 -字参数另做它用。比如有些命令(目前还没学到)仅仅将前缀参数作为一个标 -志——只要有一个前缀参数出现,不管其值为何,命令的功能都会改变。 +虽然大部分命令把数字参数解释为其重复次数,但是也有些命令例外,它们将数 +字参数另做它用。比如有些命令(我们目前还没学到)仅仅将前缀参数作为一个 +标志——只要给出有一个前缀参数,不管其值为何,它都会改变命令的功能。 而 C-v 和 M-v 则属于另一种类型的例外。当给定一个参数时,它们将滚动你指 定的“行数”,而不是“屏数”。举例来说,C-u 8 C-v 将屏幕向下滚动 8 行, @@ -188,8 +188,8 @@ EDIT 以给定一个参数然后执行 M-v。 如果你正在使用一个窗口系统,比如 X11 或者微软的 Windows,那么在 Emacs -窗口的左边或者右边应该有一个长方形的区域叫“滚动条”,你可以用鼠标操纵 -滚动条来滚动文字。 +窗口的边缘应该有一个长方形的区域叫“滚动条”,你可以用鼠标操纵滚动条来 +滚动文字。 >> 试着在“滚动条内的反白区域”上按一下鼠标中键。 文字应该会滚动到鼠标所指示的位置。 @@ -202,10 +202,10 @@ EDIT * 在 EMACS 失去响应的时候(WHEN EMACS IS HUNG) ----------------------------------------------- -如果 Emacs 对你的命令失去响应,你可以很安全地用 C-g 来终止这个命令。 -C-g 也可以被用来终止一个执行过久的命令。 +如果 Emacs 对你的命令失去响应,你可以用 C-g 来安全地终止这条命令。C-g +也可以终止一条执行过久的命令。 -C-g 还可以被来取消数字参数和那些输入到一半的命令。 +C-g 还可以取消数字参数和只输入到一半的命令。 >> 输入 C-u 100 设定一个值为 100 的数字参数,然后按 C-g。 现在再按 C-f,光标应该只会移动一个字符,因为你已经用 C-g 取消了参数。 @@ -219,16 +219,16 @@ C-g ----------------------------------- 有一些 Emacs 命令被“禁用”了,以避免初学者在不了解其确切功能的情况下误 -用这些命令,造成麻烦。 +用它们,造成麻烦。 如果你用到了一个被禁用的命令,Emacs 会显示一个提示消息,告诉你这个命令 到底是干什么的,询问你是否要继续,并在得到你的肯定之后再执行这命令。 -你要是真的想执行被禁用的命令,那么在 Emacs 询问你的时候应该按空格。一般 -来说,如果你不想执行,按“n”就行了。 +如果你真的想用这条命令,在 Emacs 询问你的时候应该按空格。一般来说,如果 +你不想用,就按“n”。 >> 试试 C-x C-l (这是一个被禁用的命令) - 然后用 n 来回答问题。 + 然后用 n 来回答询问。 * 窗格(WINDOWS) @@ -245,7 +245,7 @@ Emacs >> 把光标移到本行然后输入 C-u 0 C-l。 >> 输入 CONTROL-h k CONTROL-f。观察当一个新窗格出现时当前窗格(用来显示 - CONTROL-f 命令的文档)是如何缩小的。 + CONTROL-f 命令的文档)是如何变小的。 >> 输入 C-x 1 关掉文档窗格。 @@ -265,33 +265,33 @@ Emacs 用法应该一样。一般来说 就是位于 键上方某处的一个大号 键,通常被标示为“Delete”、“Del”或者“Backspace”。 -如果你找到了标着“Backspace”的键,那么它应该就是 ;即便你又在 -键盘其它地方找到了一个标示为“Del”的键,那么它也应该不是 。 +如果你找到了“Backspace”键,那么它应该就是 ;哪怕你又在别的地 +方找到了一个“Del”键,那么它也应该不是 。 -一种更通用的说法是, 将位于光标前的一个字符删除。 +一种更通用的说法是, 将删除位于光标前的一个字符。 >> 现在就试试——敲点字,然后按几下 删除它们。 不用担心你会修改文件,你干什么都没关系,这里就是专给你练习用的。 如果一行文字很长、超出了窗格的宽度,显示不下的部分会在紧邻的下一行继续 -显示。这时会有一个反斜线(控制台下是反斜线,如果你用图形窗口系统,则应 -该是一个小小的转弯箭头)显示在右边沿,表明这是某一行的接续显示。 +显示。这时会有一个反斜线(在控制台下是反斜线,如果你用图形窗口系统,则 +应该是一个小小的转弯箭头)显示在右边沿,表明这是某一行的接续显示。 >> 输入文字,一直到屏幕的右边界,然后继续,你会看到一个接续行出现。 >> 用 删掉一些文字,直到此行长度小于窗格宽度,接续行就消失了。 -你可以像删除其他字符一样删除换行符。删除两行中间的换行符会将两行合并成 -一行。如果合并的结果使这一行太长,超出了窗格的宽度,它就会以一个接续行 -来显示。 +换行符跟其他字符一样可以被删除。两行中间的换行符被删除后,这两行将会合 +并成一行。如果合并后的这一行太长,超出了窗格宽度,它就会以一个接续行来 +显示。 ->> 移动光标到本行的开头并输入 。 - 这时本行与其前一行将被合并为一行。 +>> 移动光标到某行的开头并输入 。 + 这时该行将与其前一行一起被合并为一行。 >> 输入 重新插入你刚才删除的换行符。 -前面说过,大部分的 Emacs 命令都可以指定重复次数,这其中也包括输入字符的 -命令。重复执行输入字符的命令实际上就是输入多个一样的字符。 +前面讲过,大部分的 Emacs 命令都可以指定重复次数,这其中也包括输入字符的 +命令。重复执行输入字符的命令实际上就是输入多个相同的字符。 >> 试试 C-u 8 *,这将会插入 ********。 @@ -329,10 +329,10 @@ C-SPC 注意,“移除(kill)”和“删除(delete)”的不同在于被移除的东西可以找回 来,而被删除的就不行了。【实际上,移除掉的东西虽然看起来“消失”了,但 实际上被 Emacs 记录了下来,因此还可以找回来;而删除掉的东西虽然也可能还 -在内存里,但是已经被Emacs“抛弃”了,所以就找不回来了。】重新插入被移除 -的文字称为“召回(yank)”。一般而言,那些会去除很多文字的命令会把去除 -掉的文字储存起来(它们被设定成了“可召回”),而那些只是去除一个字符或 -者只是去除空白的命令就不会储存那些被去除掉的东西(因此你就无法召回)。 +在内存里,但是已经被 Emacs“抛弃”了,所以就找不回来了。】重新插入被移 +除的文字称为“召回(yank)”。一般而言,那些会去除很多文字的命令会把去 +除掉的文字储存起来(它们被设定成了“可召回”),而那些只是去除一个字符 +或者只是去除空白的命令就不会储存被去除掉的东西(自然你就无法召回了)。 >> 移动光标到一非空白行的行头,然后输入 C-k 移除那一行上的文字。 @@ -409,9 +409,9 @@ C-_ 也 存盘,就要在编辑前“寻找”到一个存盘文件。(这个过程通常也被称为“访问” 文件。) -寻找到一个文件意味着你可以在 Emacs 里查看这个文件的内容。从很多角度讲, +寻找到一个文件意味着你可以在 Emacs 里查看这个文件的内容。从很多方面讲, 这就等于你在直接编辑这个文件。但是你所做的修改只有在“存盘”的时候才会 -被写入文件。也正因为如此,你可以丢弃一个改到一半的文件而不必把这个残废 +被写入文件。也正因为如此,你可以丢弃一个改到一半的文件而不必把这个残缺 文件也保存到计算机上。最后就算你真正存了盘,Emacs 也会把存盘前的文件重 命名保存,以防你改完之后又想反悔。 @@ -572,10 +572,10 @@ replace-string 字符串替换命令需要两个参数——被替换的字符串和用来替换它的字符串。每个 参数的输入用换行符来结束。 ->> 将光标移到本行的下两行空白,然后输入 +>> 将光标移到本行下面第二行的空白处,然后输入 M-x repl schangedaltered。 - 【为了继续练习,保留一行原文如下: + 【以下保留一行原文,以应练习之需: Notice how this line has changed: you've replaced... 】 请注意这一行是怎么改变的:在光标之后的范围内,你已经将“changed”这个 @@ -617,7 +617,7 @@ replace-string 果位于文件的末尾,就显示 --Bot--。如果文件很小,一屏就足以显示全部内容, 那么状态栏会显示 --All--。 -L 和其后的数字给出了光标所在行的行号。 +“L” 和其后的数字给出了光标所在行的行号。 最开头的星号(*)表示你已经对文字做过改动。刚刚打开的文件肯定没有被改动 过,所以状态栏上显示的不是星号而是短线(-)。 @@ -690,14 +690,14 @@ Emacs 功后,光标会停留在搜索目标出现的地方。 Emacs 的搜索命令的独特之处在于,它是“渐进的(incremental)”,意思是搜 -索与输入同时进行:你在这边一个字一个字地输入你想搜索的东西,同时 Emacs -在那边就替你搜索了。 +索与输入同时进行:你在键盘上一字一句地输入搜索词的过程中,Emacs 就已经 +开始替你搜索了。 C-s 是向前搜索,C-r 是向后搜索。不过手别这么快!先等等别着急试。 -在你按下 C-s 之后,你会发现回显区里有“I-search”字样出现,这是在提示 -你目前 Emacs 正处于“渐进搜索”状态,正在等待你输入搜索字串。 -会结束搜索。 +在你按下 C-s 之后,你会发现回显区里有“I-search”字样出现,提示你目前 +Emacs 正处于“渐进搜索”状态,正在等待你输入搜索字串。按 会结 +束搜索。 >> 输入 C-s 开始一个搜索。注意敲慢一点,一次输入一个字符。 慢慢输入“cursor”整个词,每敲一个字就暂停一下,注意观察光标。 @@ -917,10 +917,10 @@ Emacs Emacs 快速指南(Tutorial)早有两个刘昭宏的中文译本,繁简各一。其简体版本 (TUTORIAL.cn)基本由繁体版本(TUTORIAL.zh)经词语替换而得。然而繁简中文 -不仅在用词习惯上有所不同,更有诸多表达方式和句法方面的差异。因此一直以来 -阅读 TUTORIAL.cn 都略觉晦涩和生硬。这次重新翻译 TUTORIAL.cn 的动机正是源 -于这种体验,希望我们的工作能够让本文更好的发挥其应有的作用。TUTORIAL.zh -的译文质量很高,在翻译过程中给予过我们很多借鉴和参考,在此对刘昭宏的工作 +不仅在用词习惯上有所不同,更有诸多表达方式与句法方面的差异,因此一直以来 +用户使用 TUTORIAL.cn 都会略觉生硬和晦涩。这次重新翻译 TUTORIAL.cn 的动机 +正是源于这种体验,希望我们的工作能够让本文更好地发挥其作用。TUTORIAL.zh +的译文质量很高,在翻译过程中给予过我们许多借鉴和参考,在此对刘昭宏的工作 表示感谢。 翻译过程中最大的挑战莫过于术语译词的选择了。经过水木社区 Emacs 板热心网 @@ -954,6 +954,10 @@ Emacs 中的“window”就只能译成“窗格”了。我们认为 Emacs 中 window 和 frame 的关系用窗格和窗口来类比是十分形象的。 + 《学习GNU Emacs》(第二版)一书对“window”和“frame”的翻译与本教程 + 刚好相反(分别译作“窗口”和“窗格”)。在此特别注明,以消除可能产生 + 的疑惑。 + [2] 对于“delete”和“kill”的区别,正文已经给出了详细的说明。“删除”和 “移除”相比较起来,前者更多地隐含着“破坏”和“不可恢复”的意思,而 后者更多地隐含着“被转移”和“可恢复”的意思。因此分别选择它们作为上 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鋍he 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鰊nen Text verschieben, indem Sie mit der Maus auf den Scrollbar klicken. diff --git a/etc/TUTORIAL.it b/etc/TUTORIAL.it index 46388e78cc3..84e10878fa8 100644 --- a/etc/TUTORIAL.it +++ b/etc/TUTORIAL.it @@ -219,9 +219,9 @@ La schermata si sposta di 8 righe verso l'alto. Se vuoi tornare di nuovo in basso puoi usare un argomento numerico con M-v. Quando si usa un sistema a finestre, come X11 o MS-Windows, ci dovrebbe -essere un'area rettangolare allungata chiamata barra di scorrimento sul -lato sinistro della finestra di Emacs. Si pu far scorrere il testo con -un click del mouse nella barra di scorrimento. +essere un'area rettangolare allungata chiamata barra di scorrimento a +un lato della finestra di Emacs. Si pu far scorrere il testo con un +click del mouse nella barra di scorrimento. >> Prova a premere il pulsante centrale del mouse sopra all'area evidenziata nella barra di scorrimento. Verr visualizzata una parte diff --git a/etc/TUTORIAL.sl b/etc/TUTORIAL.sl index 52d2d18766c..3cb38ace65b 100644 --- a/etc/TUTORIAL.sl +++ b/etc/TUTORIAL.sl @@ -222,7 +222,7 @@ To bi moralo zaslon premakniti navzgor za osem vrstic. premaknili nazaj, poskusite M-v z istim argumentom. 萫 uporabljate grafi鑞i vmesnik, denimo X11 ali MS Windows, imate -verjetno ob levem robu Emacsovega okna navpi鑞o pravokotno ploskev, +verjetno ob robu Emacsovega okna navpi鑞o pravokotno ploskev, imenovano drsnik. Pogled na besedilo lahko premikate tudi tako, da z mi筴o kliknete na drsnik. diff --git a/etc/TUTORIAL.sv b/etc/TUTORIAL.sv index a2e0cd9abea..732d1fa397e 100644 --- a/etc/TUTORIAL.sv +++ b/etc/TUTORIAL.sv @@ -224,7 +224,7 @@ Detta borde ha flyttat sk tillbaka igen 鋜 det bara att ge samma argument till M-v. Om du anv鋘der Emacs under ett f鰊stersystem, som X11 eller -MS-Windows, finns det troligen ett rektangul鋜t omr錮e p v鋘ster sida +MS-Windows, finns det troligen ett rektangul鋜t omr錮e p sidan av Emacs-f鰊stret, en s kallad rullningslist. Genom att klicka i den med musen kan du rulla texten. diff --git a/etc/emacs.py b/etc/emacs.py index 9538b0b7127..7614f0927df 100644 --- a/etc/emacs.py +++ b/etc/emacs.py @@ -1,7 +1,7 @@ """Definitions used by commands sent to inferior Python in python.el.""" -# Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. -# Author: Dave Love +# Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. +# Author: Dave Love # This file is part of GNU Emacs. @@ -20,17 +20,19 @@ # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. -import os, sys, traceback, inspect, rlcompleter, __main__ +import os, sys, traceback, inspect, __main__ +from sets import Set -__all__ = ["eexecfile", "args", "complete", "ehelp", "eimport"] +__all__ = ["eexecfile", "eargs", "complete", "ehelp", "eimport", "modpath"] def eexecfile (file): """Execute FILE and then remove it. + Execute the file within the __main__ namespace. If we get an exception, print a traceback with the top frame - (oursleves) excluded.""" + (ourselves) excluded.""" try: - try: execfile (file, globals (), globals ()) - except: + try: execfile (file, __main__.__dict__) + except: (type, value, tb) = sys.exc_info () # Lose the stack frame for this location. tb = tb.tb_next @@ -40,9 +42,10 @@ def eexecfile (file): finally: os.remove (file) -def eargs (name): +def eargs (name, imports): "Get arglist of NAME for Eldoc &c." try: + if imports: exec imports parts = name.split ('.') if len (parts) > 1: exec 'import ' + parts[0] # might fail @@ -56,8 +59,7 @@ def eargs (name): return if inspect.ismethod (func): func = func.im_func - if not inspect.isfunction (func): - return + if not inspect.isfunction (func): return (args, varargs, varkw, defaults) = inspect.getargspec (func) # No space between name and arglist for consistency with builtins. print '_emacs_out', \ @@ -65,41 +67,109 @@ def eargs (name): defaults) except: pass -def complete (text, namespace = None): - """Complete TEXT in NAMESPACE and print a Lisp list of completions. - NAMESPACE is currently not used.""" - if namespace is None: namespace = __main__.__dict__ - c = rlcompleter.Completer (namespace) - try: - if '.' in text: - matches = c.attr_matches (text) - else: - matches = c.global_matches (text) - print '_emacs_out (', - for elt in matches: - print '"%s"' % elt, - print ')' - except: - print '_emacs_out ()' +def all_names (object): + """Return (an approximation to) a list of all possible attribute + names reachable via the attributes of OBJECT, i.e. roughly the + leaves of the dictionary tree under it.""" -def ehelp (name, g, l): - """Get help on string NAME using globals G and locals L. + def do_object (object, names): + if inspect.ismodule (object): + do_module (object, names) + elif inspect.isclass (object): + do_class (object, names) + # Might have an object without its class in scope. + elif hasattr (object, '__class__'): + names.add ('__class__') + do_class (object.__class__, names) + # Probably not a good idea to try to enumerate arbitrary + # dictionaries... + return names + + def do_module (module, names): + if hasattr (module, '__all__'): # limited export list + names.union_update (module.__all__) + for i in module.__all__: + do_object (getattr (module, i), names) + else: # use all names + names.union_update (dir (module)) + for i in dir (module): + do_object (getattr (module, i), names) + return names + + def do_class (object, names): + ns = dir (object) + names.union_update (ns) + if hasattr (object, '__bases__'): # superclasses + for i in object.__bases__: do_object (i, names) + return names + + return do_object (object, Set ([])) + +def complete (name, imports): + """Complete TEXT in NAMESPACE and print a Lisp list of completions. + Exec IMPORTS first.""" + import __main__, keyword + + def class_members(object): + names = dir (object) + if hasattr (object, '__bases__'): + for super in object.__bases__: + names = class_members (super) + return names + + names = Set ([]) + base = None + try: + dict = __main__.__dict__.copy() + if imports: exec imports in dict + l = len (name) + if not "." in name: + for list in [dir (__builtins__), keyword.kwlist, dict.keys()]: + for elt in list: + if elt[:l] == name: names.add(elt) + else: + base = name[:name.rfind ('.')] + name = name[name.rfind('.')+1:] + try: + object = eval (base, dict) + names = Set (dir (object)) + if hasattr (object, '__class__'): + names.add('__class__') + names.union_update (class_members (object)) + except: names = all_names (dict) + except: return [] + l = len(name) + print '_emacs_out (', + for n in names: + if name == n[:l]: + if base: print '"%s.%s"' % (base, n), + else: print '"%s"' % n, + print ')' + +def ehelp (name, imports): + """Get help on string NAME. First try to eval name for, e.g. user definitions where we need the object. Otherwise try the string form.""" - try: help (eval (name, g, l)) + locls = {} + if imports: + try: exec imports in locls + except: pass + try: help (eval (name, globals(), locls)) except: help (name) def eimport (mod, dir): """Import module MOD with directory DIR at the head of the search path. NB doesn't load from DIR if MOD shadows a system module.""" + from __main__ import __dict__ + path0 = sys.path[0] sys.path[0] = dir try: try: - if globals().has_key(mod) and inspect.ismodule (eval (mod)): - reload(eval (mod)) + if __dict__.has_key(mod) and inspect.ismodule (__dict__[mod]): + reload (__dict__[mod]) else: - globals ()[mod] = __import__ (mod) + __dict__[mod] = __import__ (mod) except: (type, value, tb) = sys.exc_info () print "Traceback (most recent call last):" @@ -107,6 +177,17 @@ def eimport (mod, dir): finally: sys.path[0] = path0 -print '_emacs_ok' # ready for input and can call continuation +def modpath (module): + """Return the source file for the given MODULE (or None). +Assumes that MODULE.py and MODULE.pyc are in the same directory.""" + try: + path = __import__ (module).__file__ + if path[-4:] == '.pyc' and os.path.exists (path[0:-1]): + path = path[:-1] + print "_emacs_out", path + except: + print "_emacs_out ()" + +# print '_emacs_ok' # ready for input and can call continuation # arch-tag: d90408f3-90e2-4de4-99c2-6eb9c7b9ca46 diff --git a/etc/orgcard.tex b/etc/orgcard.tex index 951d0167c2e..ef2e847b5f1 100644 --- a/etc/orgcard.tex +++ b/etc/orgcard.tex @@ -1,5 +1,5 @@ % 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 6be0910d27a..3328f010846 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,29 @@ +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. + +2006-07-30 Francesco Potort,Al(B + + * etags.c [ETAGS_REGEXPS]: Now is unconditionally defined. + [LONG_OPTIONS]: Changed to NO_LONG_OPTIONS, which is undefined. + (Objc_suffixes): Suggest using --lang=c for full help. + (C_entries): Initialise savetoken to 0 to shut up the compiler. + 2006-07-20 Andreas Schwab * fakemail.c (fatal): Drop second parameter and treat first diff --git a/lib-src/etags.c b/lib-src/etags.c index b5ff33c8b4c..49a18be1df5 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -41,7 +41,7 @@ * configuration file containing regexp definitions for etags. */ -char pot_etags_version[] = "@(#) pot revision number is 17.18"; +char pot_etags_version[] = "@(#) pot revision number is 17.20"; #define TRUE 1 #define FALSE 0 @@ -59,12 +59,10 @@ char pot_etags_version[] = "@(#) pot revision number is 17.18"; /* On some systems, Emacs defines static as nothing for the sake of unexec. We don't want that here since we don't use unexec. */ # undef static -# define ETAGS_REGEXPS /* use the regexp features */ -# define LONG_OPTIONS /* accept long options */ -# ifndef PTR /* for Xemacs */ +# ifndef PTR /* for XEmacs */ # define PTR void * # endif -# ifndef __P /* for Xemacs */ +# ifndef __P /* for XEmacs */ # define __P(args) args # endif #else /* no config.h */ @@ -82,14 +80,7 @@ char pot_etags_version[] = "@(#) pot revision number is 17.18"; # define _GNU_SOURCE 1 /* enables some compiler checks on GNU */ #endif -#ifdef LONG_OPTIONS -# undef LONG_OPTIONS -# define LONG_OPTIONS TRUE -#else -# define LONG_OPTIONS FALSE -#endif - -/* WIN32_NATIVE is for Xemacs. +/* WIN32_NATIVE is for XEmacs. MSDOS, WINDOWSNT, DOS_NT are for Emacs. */ #ifdef WIN32_NATIVE # undef MSDOS @@ -167,25 +158,25 @@ char pot_etags_version[] = "@(#) pot revision number is 17.18"; # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif -#if LONG_OPTIONS -# include -#else +#ifdef NO_LONG_OPTIONS /* define this if you don't have GNU getopt */ +# define NO_LONG_OPTIONS TRUE # define getopt_long(argc,argv,optstr,lopts,lind) getopt (argc, argv, optstr) extern char *optarg; extern int optind, opterr; -#endif /* LONG_OPTIONS */ +#else +# define NO_LONG_OPTIONS FALSE +# include +#endif /* NO_LONG_OPTIONS */ -#ifdef ETAGS_REGEXPS -# ifndef HAVE_CONFIG_H /* this is a standalone compilation */ -# ifdef __CYGWIN__ /* compiling on Cygwin */ +#ifndef HAVE_CONFIG_H /* this is a standalone compilation */ +# ifdef __CYGWIN__ /* compiling on Cygwin */ !!! NOTICE !!! the regex.h distributed with Cygwin is not compatible with etags, alas! If you want regular expression support, you should delete this notice and arrange to use the GNU regex.h and regex.c. -# endif # endif -# include -#endif /* ETAGS_REGEXPS */ +#endif +#include /* Define CTAGS to make the program "ctags" compatible with the usual one. Leave it undefined to make the program "etags", which makes emacs-style @@ -312,7 +303,6 @@ typedef struct char *what; /* the argument itself */ } argument; -#ifdef ETAGS_REGEXPS /* Structure defining a regular expression. */ typedef struct regexp { @@ -327,7 +317,6 @@ typedef struct regexp bool ignore_case; /* ignore case when matching */ bool multi_line; /* do a multi-line match on the whole file */ } regexp; -#endif /* ETAGS_REGEXPS */ /* Many compilers barf on this: @@ -375,11 +364,9 @@ static long readline_internal __P((linebuffer *, FILE *)); static bool nocase_tail __P((char *)); static void get_tag __P((char *, char **)); -#ifdef ETAGS_REGEXPS static void analyse_regex __P((char *)); static void free_regexps __P((void)); static void regex_tag_multiline __P((void)); -#endif /* ETAGS_REGEXPS */ static void error __P((const char *, const char *)); static void suggest_asking_for_help __P((void)); void fatal __P((char *, char *)); @@ -485,14 +472,9 @@ static bool packages_only; /* --packages-only: in Ada, only tag packages*/ #define STDIN 0x1001 /* returned by getopt_long on --parse-stdin */ static bool parsing_stdin; /* --parse-stdin used */ -#ifdef ETAGS_REGEXPS static regexp *p_head; /* list of all regexps */ static bool need_filebuf; /* some regexes are multi-line */ -#else -# define need_filebuf FALSE -#endif /* ETAGS_REGEXPS */ -#if LONG_OPTIONS static struct option longopts[] = { { "append", no_argument, NULL, 'a' }, @@ -507,11 +489,9 @@ static struct option longopts[] = { "members", no_argument, &members, TRUE }, { "no-members", no_argument, &members, FALSE }, { "output", required_argument, NULL, 'o' }, -#ifdef ETAGS_REGEXPS { "regex", required_argument, NULL, 'r' }, { "no-regex", no_argument, NULL, 'R' }, { "ignore-case-regex", required_argument, NULL, 'c' }, -#endif /* ETAGS_REGEXPS */ { "parse-stdin", required_argument, NULL, STDIN }, { "version", no_argument, NULL, 'V' }, @@ -533,7 +513,6 @@ static struct option longopts[] = #endif { NULL } }; -#endif /* LONG_OPTIONS */ static compressor compressors[] = { @@ -681,13 +660,15 @@ static char *Objc_suffixes [] = static char Objc_help [] = "In Objective C code, tags include Objective C definitions for classes,\n\ class categories, methods and protocols. Tags for variables and\n\ -functions in classes are named `CLASS::VARIABLE' and `CLASS::FUNCTION'."; +functions in classes are named `CLASS::VARIABLE' and `CLASS::FUNCTION'.\n\ +(Use --help --lang=c --lang=objc --lang=java for full help.)"; static char *Pascal_suffixes [] = { "p", "pas", NULL }; static char Pascal_help [] = "In Pascal code, the tags are the functions and procedures defined\n\ in the file."; +/* " // this is for working around an Emacs highlighting bug... */ static char *Perl_suffixes [] = { "pl", "pm", NULL }; @@ -885,11 +866,11 @@ print_help (argbuffer) printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\ \n\ These are the options accepted by %s.\n", progname, progname); - if (LONG_OPTIONS) - puts ("You may use unambiguous abbreviations for the long option names."); + if (NO_LONG_OPTIONS) + puts ("WARNING: long option names do not work with this executable,\n\ +as it is not linked with GNU getopt."); else - puts ("Long option names do not work with this executable, as it is not\n\ -linked with GNU getopt."); + puts ("You may use unambiguous abbreviations for the long option names."); puts (" A - as file name means read names from stdin (one per line).\n\ Absolute names are stored in the output file as they are.\n\ Relative ones are stored relative to the output file's directory.\n"); @@ -949,7 +930,6 @@ Relative ones are stored relative to the output file's directory.\n"); puts ("--members\n\ Create tag entries for members of structures in some languages."); -#ifdef ETAGS_REGEXPS puts ("-r REGEXP, --regex=REGEXP or --regex=@regexfile\n\ Make a tag for each line matching a regular expression pattern\n\ in the following files. {LANGUAGE}REGEXP uses REGEXP for LANGUAGE\n\ @@ -964,7 +944,6 @@ Relative ones are stored relative to the output file's directory.\n"); causes dot to match any character, including newline."); puts ("-R, --no-regex\n\ Don't create tags from regexps for the following files."); -#endif /* ETAGS_REGEXPS */ puts ("-I, --ignore-indentation\n\ In C and C++ do not assume that a closing brace in the first\n\ column is the final brace of a function or structure definition."); @@ -1194,14 +1173,8 @@ main (argc, argv) /* When the optstring begins with a '-' getopt_long does not rearrange the non-options arguments to be at the end, but leaves them alone. */ - optstring = "-"; -#ifdef ETAGS_REGEXPS - optstring = "-r:Rc:"; -#endif /* ETAGS_REGEXPS */ - if (!LONG_OPTIONS) - optstring += 1; /* remove the initial '-' */ - optstring = concat (optstring, - "aCf:Il:o:SVhH", + optstring = concat (NO_LONG_OPTIONS ? "" : "-", + "ac:Cf:Il:o:r:RSVhH", (CTAGS) ? "BxdtTuvw" : "Di:"); while ((opt = getopt_long (argc, argv, optstring, longopts, NULL)) != EOF) @@ -1375,11 +1348,9 @@ main (argc, argv) case at_language: lang = argbuffer[i].lang; break; -#ifdef ETAGS_REGEXPS case at_regexp: analyse_regex (argbuffer[i].what); break; -#endif case at_filename: #ifdef VMS while ((this_file = gfnames (argbuffer[i].what, &got_err)) != NULL) @@ -1419,9 +1390,7 @@ main (argc, argv) } } -#ifdef ETAGS_REGEXPS free_regexps (); -#endif /* ETAGS_REGEXPS */ free (lb.buffer); free (filebuf.buffer); free (token_name.buffer); @@ -1979,9 +1948,7 @@ find_entries (inf) parser (inf); -#ifdef ETAGS_REGEXPS regex_tag_multiline (); -#endif /* ETAGS_REGEXPS */ } @@ -3239,7 +3206,7 @@ C_entries (c_ext, inf) int typdefbracelev; /* bracelev where a typedef struct body begun */ bool incomm, inquote, inchar, quotednl, midtoken; bool yacc_rules; /* in the rules part of a yacc file */ - struct tok savetoken; /* token saved during preprocessor handling */ + struct tok savetoken = {0}; /* token saved during preprocessor handling */ linebuffer_init (&lbs[0].lb); @@ -5198,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; @@ -5735,8 +5702,6 @@ erlang_atom (s) } -#ifdef ETAGS_REGEXPS - static char *scan_separators __P((char *)); static void add_regex __P((char *, language *)); static char *substitute __P((char *, char *, struct re_registers *)); @@ -6141,8 +6106,6 @@ regex_tag_multiline () } } -#endif /* ETAGS_REGEXPS */ - static bool nocase_tail (cp) @@ -6296,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 @@ -6405,7 +6369,6 @@ readline (lbp, stream) } } /* if #line directives should be considered */ -#ifdef ETAGS_REGEXPS { int match; regexp *rp; @@ -6462,7 +6425,6 @@ readline (lbp, stream) } } } -#endif /* ETAGS_REGEXPS */ } @@ -6623,7 +6585,7 @@ static void suggest_asking_for_help () { fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", - progname, LONG_OPTIONS ? "--help" : "-h"); + progname, NO_LONG_OPTIONS ? "-h" : "--help"); exit (EXIT_FAILURE); } diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 30aee0030ba..187f2ff3fae 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,707 @@ +2006-08-27 Michael Olson + + * emacs-lisp/tq.el: Small grammar fix in comments. + (tq-enqueue): Check for existence of queue rather than the + head queue item's question, which was a no-op. + (tq-filter, tq-process-buffer): Make sure the process buffer + exists before making it the current buffer. + +2006-08-27 YAMAMOTO Mitsuharu + + * term/mac-win.el (mac-apple-event-map): Rename hicommand to hi-command. + (mac-dnd-drop-data): Apply 2006-08-22 change for x-dnd-drop-data. + (special-event-map): Apply 2006-08-16 change for x-win.el. + +2006-08-26 Stefan Monnier + + * progmodes/python.el (python-send-receive): Wait in the + process's buffer so as to check the right buffer-local variables. + +2006-08-25 Stefan Monnier + + * emacs-lisp/checkdoc.el: Remove * in defcustoms. + (defgroup checkdoc): Move to beginning. + + * progmodes/python.el (python-preoutput-skip-next-prompt): New var. + (python-preoutput-continuation): Remove. + (python-preoutput-filter): Simplify correspondingly. + Remove handling of _emacs_ok. Make sure we skip _emacs_out's prompts. + Loop around to catch embedded _emacs_out output. + (run-python): Send the import&print command on a single line. + (python-send-command): Send command&print on a single line. + (python-send-string): Only add double \n if needed. + (python-send-receive): Loop until the result comes. + (python-mode-running): Defvar it. + (python-setup-brm): Remove unused var `menu'. + Only bind py-mode-map and `features' around brm-init. + (python-calculate-indentation): Remove unused var `point'. + (python-beginning-of-defun): Remove unused var `def-line'. + +2006-08-25 Richard Stallman + + * kmacro.el (kmacro-repeat-on-last-key): Doc fix. + +2006-08-25 Michael Kifer + + * viper.el (viper-set-hooks): Use frame bindings for + viper-vi-state-cursor-color. + (viper-non-hook-settings): Don't set default + mode-line-buffer-identification. + + * viper-util.el (viper-set-cursor-color-according-to-state): New fun. + (viper-set-cursor-color-according-to-state) + (viper-get-saved-cursor-color-in-replace-mode) + (viper-get-saved-cursor-color-in-insert-mode): Make conditional on + viper-emacs-state-cursor-color. + + * viper-cmd.el (viper-envelop-ESC-key): Bug fix. + (viper-undo): Use point if undo-beg-posn is nil. + (viper-insert-state-post-command-sentinel, viper-change-state-to-emacs) + (viper-after-change-undo-hook): Don't use + viper-emacs-state-cursor-color by default. + (viper-undo): More sensible positioning after undo. + + * viper-ex.el (ex-splice-args-in-1-letr-cmd): Get rid of caddr. + (viper-emacs-state-cursor-color): Default to nil, since this feature + doesn't work well yet. + + * ediff-mult.el (ediff-intersect-directories) + (ediff-get-directory-files-under-revision, ediff-dir-diff-copy-file): + always expand filenames. + +2006-08-24 Stefan Monnier + + * tumme.el: Remove * in defcustoms's docstrings. + +2006-08-24 Chong Yidong + + * emacs-lisp/timer.el (timer-set-idle-time, run-with-idle-timer): + Accept internal time format for SECS arg. + (timer-relative-time): Doc fix. + + * jit-lock.el: "Stealth fontification by requeuing timers" patch, + adapted from Martin Rudalics. + (jit-lock-stealth-repeat-timer, jit-lock-stealth-buffers): New vars. + (jit-lock-mode): Create jit-lock-stealth-repeat-timer. + (jit-lock-stealth-fontify): Reschedule as a idle timer instead of + using sit-for. + +2006-08-24 Francesc Rocher + + * cus-start.el (all): Add `overline-margin' and + `x-underline-at-descent-line'. + +2006-08-24 Kim F. Storm + + * progmodes/grep.el (grep-find-use-xargs): Use explicit value `exec' + to mean "use find -exec"; nil now unambiguously means auto-detect. + (grep-compute-defaults): Set grep-find-use-xargs to `exec' if not `gnu'. + Use shell-quote-argument to build grep-find-command and grep-find-template. + (rgrep): Use shell-quote-argument to properly quote arguments to find. + Reported by Tom Seddon. + +2006-08-23 Chong Yidong + + * startup.el (fancy-splash-head): Give instructions for dismissing + the splash screen for default startup too. + (display-startup-echo-area-message, fancy-splash-screens) + (use-fancy-splash-screens-p): New arg hide-on-input. If nil, show + all splash text at once and keep the splash buffer around. + (command-line-1): Give display-startup-echo-area-message a t arg. + +2006-08-23 Carsten Dominik + + * textmodes/org.el (org-follow-gnus-link): Make sure the dedicated + gnus frame is selected. + +2006-08-23 Nick Roberts + + * progmodes/gdb-ui.el (gdb-starting): Reset gdb-signalled to nil. + +2006-08-22 Kim F. Storm + + * ido.el (ido-set-matches-1): Fix full matching for subdirs. + Add suffix matching for subdirs. + +2006-08-22 Jorgen Schaefer (tiny change) + + * x-dnd.el (x-dnd-drop-data): Don't call goto-char if + mouse-yank-at-point is non-nil. + +2006-08-22 Nick Roberts + + * progmodes/gdb-ui.el (gdb-frame-memory-buffer): Make frame + a bit wider and remove fringes to fit initial output on line. + +2006-08-21 Stefan Monnier + + * frame.el (blink-cursor-end): Only ignore the error we care about. + (blink-cursor-mode): Use blink-cursor-end to simplify the code. + +2006-08-21 Richard Stallman + + * whitespace.el (whitespace-cleanup): Doc fix. + +2006-08-20 Ryan Yeske + + * net/rcirc.el (rcirc-show-maximum-output): New var. + (rcirc-buffer-process): If no buffer argument is supplied, use + current-buffer. + (rcirc-complete-nick): Complete to the last completed nick first. + (rcirc-mode): Preserve the value of `rcirc-urls' across + connections. Setup scroll function. + (rcirc-scroll-to-bottom): New function. + (rcirc-print): Use nick syntax around regexp work. + Notice dim-nicks speaking only if they say our nick. + (rcirc-update-activity-string): Do not show the modeline indicator + if there are no live rcirc processes. + (rcirc-cmd-ignore): Ignore case. + (rcirc-browse-url-at-point): Fix off-by-one error. + +2006-08-20 Stefan Monnier + + * progmodes/python.el: Remove * in defcustom docstrings. + (run-python, python-proc, python-try-complete): Use derived-mode-p. + (python-mode): Set tab-width and indent-tabs-mode. + +2006-08-20 Dave Love + + * progmodes/python.el: Update to Dave Love's latest version. + (python-font-lock-keywords, python-mode): Don't use + font-lock-syntax-table, but match symbol elements explicitly instead. + (python-mode-map): Add help, and a few more key bindings. + (python-skip-comments/blanks): Move out of comments as well. + (python-continuation-line-p): Behave better with unbalanced parens. + (python-blank-line-p): New fun. + (python-open-block-statement-p): Don't use a heuristic. + (python-outdent-p): Better handle blocks-in-the-same-line. + (python-calculate-indentation): Misc improvements. + (python-comment-indent): Remove. + (python-block-pairs): New var. + (python-first-word): New fun. + (python-indentation-levels): Handle more common cases. + (python-indent-line-1): Add `leave' argument. + (python-indent-region): New fun. + (python-skip-out): New fun. + (python-beginning-of-statement, python-end-of-statement): Use it. + (python-next-statement): Return correct count even at eob. + (python-end-of-block): Fix paren-typo. + (python-imenu-create-index): Add module variables. + (run-python): Add `new' arg. + Check we're at a prompt before returning. + (python-send-command): Move to end of buffer. + Wait for prompt to return. + (python-set-proc): New fun. + (python-imports): New var. + (python-describe-symbol): Use it. Adjust to new interface of `ehelp'. + (python-eldoc-function): Try to move out of arg list. + (python-outline-level): Offset by 1. + (python-find-imports): New fun. + (python-symbol-completions): Use python-imports. + (python-module-path, ffap-alist): Add support for ffap. + (python-skeletons, python-mode-abbrev-table, def-python-skeleton) + (pythin-insert-*, python-default-template, python-expand-template): + Add templates/skeletons. + (python-setup-brm): Support for Bicycle Repair Man. + (python-abbrev-syntax-table): New var. + (python-abbrev-pc-hook, python-pea-hook): New funs. + +2006-08-20 Chong Yidong + + * frame.el (blink-cursor-start): Set timer first. + (blink-cursor-end): Ignore timer cancelling errors. + Suggested by Ken Manheimer. + +2006-08-20 Juanma Barranquero + + * newcomment.el (comment-box): Call `comment-normalize-vars'. + Add autoload cookie. + +2006-08-20 Richard Stallman + + * simple.el (line-number-at-pos): Doc fix. + + * emacs-lisp/timer.el (run-with-idle-timer): Pass t to + timer-activate-when-idle, so timer can run before Emacs becomes + non-idle again. + +2006-08-18 Yoni Rabkin Katzenell (tiny change) + + * whitespace.el (whitespace-cleanup-internal): New optional arg + REGION-ONLY. If it's non-nil, modify the message to the user + accordingly. + (whitespace-cleanup-region): Call whitespace-cleanup-internal with + a non-nil argument. + +2006-08-18 Gustav H,Ae(Bllberg (tiny change) + + * rect.el (spaces-string): Simplify and add doc string. + +2006-08-17 Romain Francoise + + * progmodes/gdb-ui.el (gdb-edit-locals-value): Balance parens. + +2006-08-17 Richard Stallman + + * compare-w.el (compare-windows): lambda's take an arg and pass + it to compare-windows-skip-whitespace. + +2006-08-17 Martin Rudalics + + * jit-lock.el (jit-lock-fontify-now): Protect the modified status of + the right buffer. + +2006-08-17 Stefan Monnier + + * pcvs-parse.el (cvs-parse-table): Accept the new `...' format for + removed files. + +2006-08-17 Nick Roberts + + * progmodes/gdb-ui.el (gdb-locals-watch-map) + (gdb-locals-watch-map-1): Suppress keymap first. + (gdb-edit-locals-map-1): New variable. + (gdb-edit-locals-value): New function. + (gdb-stack-list-locals-handler): Use them. + +2006-08-16 Stefan Monnier + + * mouse.el (global-map): Allow yanking with mouse-2 at a spot whose + cursor would normally be drawn in the fringe. + + * font-lock.el (font-lock-extend-region-wholelines): Fix up typo. + Reported by Martin Rudalics . + +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): Add 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): + Remove 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): Fix 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): + Revise 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) + (font-lock-extend-region-functions): New vars. + (font-lock-extend-region-multiline) + (font-lock-extend-region-wholelines): New functions. + (font-lock-default-fontify-region): Use them. + (font-lock-extend-jit-lock-region-after-change): Only round up + if font-lock-default-fontify-region will do it as well. + + * font-lock.el (font-lock-extend-after-change-region-function): + Rename from font-lock-extend-region-function. + (font-lock-extend-region): Remove by inlining at call sites. + (font-lock-after-change-function): Don't needlessly round up to a whole + number of lines. + (font-lock-extend-jit-lock-region-after-change): Be more careful about + the boundary conditions and the interactions between the various ways + to extend the region. + +2006-08-02 Stefan Monnier + + * jit-lock.el (jit-lock-fontify-now): Preserve the buffer's + modification status when forcing the second redisplay. + +2006-08-03 Kim F. Storm + + * edmacro.el (edmacro-fix-menu-commands): Ignore switch-frame. + +2006-08-02 Stefan Monnier + + * pcvs-util.el (cvs-get-buffer-create): Obey `noreuse' even if `name' + doesn't look like a file name. + + * complete.el (PC-expand-many-files): Avoid signalling an error when + the current directory doesn't exist. Reported by Micha,Ak(Bl Cadilhac. + +2006-08-02 Andreas Schwab + + * bindings.el (mode-line-format): Simplify reference to vc-mode. + +2006-08-02 Nick Roberts + + * bindings.el (map): Make mode-line-buffer-identification-keymap + before defining propertized-buffer-identification. + +2006-08-01 Richard Stallman + + * bindings.el (mode-line-format): Adjust spacing around vc-mode. + +2006-08-02 Nick Roberts + + * progmodes/gdb-ui.el (gdb-find-source-frame): Make nil the + default value. + (gdb-find-source-frame): New function. + (menu): Add to menu bar. + +2006-08-01 Stefan Monnier + + * font-core.el (font-lock-extend-region-function) + (font-lock-extend-region): Move to font-lock.el. + + * font-lock.el (font-lock-extend-region-function) + (font-lock-extend-region): Move from font-core.el. Simplify. + + * jit-lock.el (jit-lock-fontify-now): Cause a second redisplay + if needed. + (jit-lock-start, jit-lock-end): New dynamic scoped vars. + (jit-lock-after-change-extend-region-functions): New hook. + (jit-lock-after-change): Use it instead of hard-coding font-lock code. + + * font-lock.el (font-lock-extend-jit-lock-region-after-change): New fun. + (font-lock-turn-on-thing-lock): Use it. + + * longlines.el (longlines-show-region): Make it work on read-only + buffers as well. + +2006-08-01 Nick Roberts + + * progmodes/gdb-ui.el (gdb-set-hollow): Check for gud-last-last-frame. + +2006-07-31 Richard Stallman + + * progmodes/vhdl-mode.el (vhdl-speedbar-display-directory) + (vhdl-speedbar-display-projects): Update old obsolete + speedbar variable names. + +2006-07-31 Nick Roberts + + * progmodes/gdb-ui.el (gdb-find-source-frame): New option. + (gdb-stopped): Use it. + + * t-mouse.el (t-mouse-mode): Use set-process-query-on-exit-flag. + +2006-07-29 Chong Yidong + + * loadhist.el (unload-feature): Handle new `(t . SYMBOL)' format + for load-history elements. + +2006-07-29 Eli Zaretskii + + * files.el (convert-standard-filename): For Cygwin, replace + characters not allowed in Windows file names. + (make-auto-save-file-name): Add Cygwin to the list of systems + where the auto-save file name needs to be run through + convert-standard-filename. + +2006-07-29 Lennart Borgman + + * window.el (bw-get-tree): Don't integerp subtree if it's nil. + +2006-07-28 Richard Stallman + + * bindings.el (mode-line-frame-identification) + (propertized-buffer-identification): Centralize the code + to initialize the variable. + + * progmodes/grep.el (grep-default-command): Catch errors from + wildcard-to-regexp. + +2006-07-29 Kim F. Storm + + * progmodes/grep.el (grep-tag-default): New function. + (grep-default-command, grep-read-regexp): Use it. + (grep-read-files): Use car of grep-files-history or grep-files-aliases + as default if nothing else applies. + +2006-07-28 Bill Atkins (tiny change) + + * wdired.el (wdired-change-to-wdired-mode, wdired-change-to-dired-mode): + Throw error if buffer is not in Dired and Wdired mode, respectively. + +2006-07-28 Chong Yidong + + * cus-edit.el (custom-no-edit): Revert 2006-07-27 change, so that + self-insert-command keys don't activate buttons. + (custom-mode-map): Just don't bind "\C-m" to `custom-no-edit'. + +2006-07-29 Nick Roberts + + * progmodes/gdb-ui.el (gdb-info-breakpoints-custom): Use different + faces for enable character. + 2006-07-28 Nick Roberts * Makefile.in (recompile): Update comment to reflect change @@ -31,9 +735,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 @@ -45,10 +749,10 @@ * tumme.el (tumme-track-original-file): Add `buffer-live-p' check. (tumme-format-properties-string): Handle empty `buf'. - (tumme-get-comment): Change variable names inside `let'. Add - missing `let' variable that cause font-lock problems. - (tumme-write-comments): Change variable names inside `let'. Add - missing `let' variable that cause font-lock problems. + (tumme-get-comment): Change variable names inside `let'. + Add missing `let' variable that cause font-lock problems. + (tumme-write-comments): Change variable names inside `let'. + Add missing `let' variable that cause font-lock problems. (tumme-forward-image): Rename from `tumme-forward-char'. (tumme-backward-image): Rename from `tumme-backward-char'. @@ -97,8 +801,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 @@ -137,7 +841,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 @@ -173,7 +877,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'. @@ -497,8 +1201,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 eea9184cee4..9671bf26f25 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -215,14 +215,6 @@ mnemonics of the following coding systems: (make-variable-buffer-local 'mode-line-mule-info) -(defvar mode-line-buffer-identification (purecopy '("%12b")) "\ -Mode-line control for identifying the buffer being displayed. -Its default value is (\"%12b\"). -Major modes that edit things other than ordinary files may change this -\(e.g. Info, Dired,...)") - -(make-variable-buffer-local 'mode-line-buffer-identification) - (defvar mode-line-frame-identification '(window-system " " "-%F ") "Mode-line control to describe the current frame.") @@ -294,56 +286,102 @@ 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-client - '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-client + '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))) - (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))) + (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-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-format standard-mode-line-format) + (put 'mode-line-format 'standard-value + (list `(quote ,standard-mode-line-format))) + + (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'.") +;; Add menu of buffer operations to the buffer identification part +;; of the mode line.or header line. +; +(let ((map (make-sparse-keymap))) + ;; Bind down- events so that the global keymap won't ``shine + ;; through''. + (define-key map [mode-line mouse-1] 'mode-line-previous-buffer) + (define-key map [header-line down-mouse-1] 'ignore) + (define-key map [header-line mouse-1] 'mode-line-previous-buffer) + (define-key map [header-line down-mouse-3] 'ignore) + (define-key map [mode-line mouse-3] 'mode-line-next-buffer) + (define-key map [header-line down-mouse-3] 'ignore) + (define-key map [header-line mouse-3] 'mode-line-next-buffer) + (setq mode-line-buffer-identification-keymap map)) + +(defun propertized-buffer-identification (fmt) + "Return a list suitable for `mode-line-buffer-identification'. +FMT is a format specifier such as \"%12b\". This function adds +text properties for face, help-echo, and local-map to it." + (list (propertize fmt + 'face 'mode-line-buffer-id + 'help-echo + (purecopy "mouse-1: previous buffer, mouse-3: next buffer") + 'mouse-face 'mode-line-highlight + 'local-map mode-line-buffer-identification-keymap))) + +(defvar mode-line-buffer-identification (propertized-buffer-identification "%12b") "\ +Mode-line control for identifying the buffer being displayed. +Its default value is (\"%12b\") with some text properties added. +Major modes that edit things other than ordinary files may change this +\(e.g. Info, Dired,...)") + +(make-variable-buffer-local 'mode-line-buffer-identification) + (defun unbury-buffer () "\ Switch to the last buffer in the buffer list." (interactive) @@ -449,35 +487,6 @@ Menu of mode operations in the mode line.") (let ((indicator (car (nth 4 (car (cdr event)))))) (describe-minor-mode-from-indicator indicator))) -;; Add menu of buffer operations to the buffer identification part -;; of the mode line.or header line. -; -(let ((map (make-sparse-keymap))) - ;; Bind down- events so that the global keymap won't ``shine - ;; through''. - (define-key map [mode-line mouse-1] 'mode-line-previous-buffer) - (define-key map [header-line down-mouse-1] 'ignore) - (define-key map [header-line mouse-1] 'mode-line-previous-buffer) - (define-key map [header-line down-mouse-3] 'ignore) - (define-key map [mode-line mouse-3] 'mode-line-next-buffer) - (define-key map [header-line down-mouse-3] 'ignore) - (define-key map [header-line mouse-3] 'mode-line-next-buffer) - (setq mode-line-buffer-identification-keymap map)) - -(defun propertized-buffer-identification (fmt) - "Return a list suitable for `mode-line-buffer-identification'. -FMT is a format specifier such as \"%12b\". This function adds -text properties for face, help-echo, and local-map to it." - (list (propertize fmt - 'face 'mode-line-buffer-id - 'help-echo - (purecopy "mouse-1: previous buffer, mouse-3: next buffer") - 'mouse-face 'mode-line-highlight - 'local-map mode-line-buffer-identification-keymap))) - -(setq-default mode-line-buffer-identification - (propertized-buffer-identification "%12b")) - (defvar minor-mode-alist nil "\ Alist saying how to show minor modes in the mode line. Each element looks like (VARIABLE STRING); diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index e9e7e9a2bb8..398b362d4e4 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el @@ -117,6 +117,7 @@ file buffers. It affects both manual reverting and reverting by 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..8dc0ac1e330 100644 --- a/lisp/compare-w.el +++ b/lisp/compare-w.el @@ -167,16 +167,14 @@ on first call it advances points to the next difference, 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,21 @@ 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 (pos) + (compare-windows-skip-whitespace pos) + t) + compare-windows-whitespace))) + + (with-current-buffer b2 + (setq skip-func-2 (if ignore-whitespace + (if (stringp compare-windows-whitespace) + (lambda (pos) + (compare-windows-skip-whitespace pos) + t) + compare-windows-whitespace))) (push-mark p2 t) (setq maxp2 (point-max))) (push-mark) @@ -199,17 +210,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 ca6231893c3..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)) @@ -811,6 +808,12 @@ or properties are considered." (defun PC-expand-many-files (name) (with-current-buffer (generate-new-buffer " *Glob Output*") (erase-buffer) + (when (and (file-name-absolute-p name) + (not (file-directory-p default-directory))) + ;; If the current working directory doesn't exist `shell-command' + ;; signals an error. So if the file names we're looking for don't + ;; depend on the working directory, switch to a valid directory first. + (setq default-directory "/")) (shell-command (concat "echo " name) t) (goto-char (point-min)) ;; CSH-style shells were known to output "No match", whereas diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 15f43080aff..609b5572a08 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4435,9 +4435,8 @@ The format is suitable for use with `easy-menu-define'." ;; Actually, this misfeature of dense keymaps was fixed on 2001-11-26. (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-no-edit) + (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) @@ -4450,6 +4449,11 @@ The format is suitable for use with `easy-menu-define'." "Keymap for `custom-mode'.") (defun custom-no-edit (pos &optional event) + "Invoke button at POS, or refuse to allow editing of Custom buffer." + (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))) diff --git a/lisp/cus-start.el b/lisp/cus-start.el index cceed27951e..b59cb57aaf6 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -175,7 +175,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of ;; 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) @@ -360,6 +360,7 @@ since it could result in memory overflow and make Emacs crash." (other :tag "Unlimited" t))) (unibyte-display-via-language-environment mule boolean) (blink-cursor-alist cursor alist "22.1") + (overline-margin display integer "22.1") ;; xfaces.c (scalable-fonts-allowed display boolean) ;; xfns.c @@ -371,6 +372,7 @@ since it could result in memory overflow and make Emacs crash." ;; xterm.c (mouse-autoselect-window display boolean "21.3") (x-use-underline-position-properties display boolean "21.3") + (x-underline-at-descent-line display boolean "22.1") (x-stretch-cursor display boolean "21.1"))) this symbol group type standard version native-p ;; This function turns a value diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index 53f530505ae..b4fe1e4b0bf 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el @@ -99,7 +99,7 @@ the directory " custom-theme-directory "\n\n") (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/ediff-mult.el b/lisp/ediff-mult.el index 71859a5d4c5..b33ad7c1859 100644 --- a/lisp/ediff-mult.el +++ b/lisp/ediff-mult.el @@ -648,8 +648,8 @@ behavior." (mapcar (lambda (elt) (ediff-make-new-meta-list-element - (concat auxdir1 elt) - (concat auxdir2 elt) + (expand-file-name (concat auxdir1 elt)) + (expand-file-name (concat auxdir2 elt)) (if lis3 (progn ;; The following is done because: In merging with @@ -660,7 +660,7 @@ behavior." ;; the second case, we insert nil. (setq elt (ediff-add-slash-if-directory auxdir3 elt)) (if (file-exists-p (concat auxdir3 elt)) - (concat auxdir3 elt)))))) + (expand-file-name (concat auxdir3 elt))))))) common))) ;; return result (cons common-part difflist) @@ -716,7 +716,7 @@ behavior." auxdir1 nil nil merge-autostore-dir nil) (mapcar (lambda (elt) (ediff-make-new-meta-list-element - (concat auxdir1 elt) nil nil)) + (expand-file-name (concat auxdir1 elt)) nil nil)) common)) )) @@ -1338,7 +1338,10 @@ Useful commands: ;; update ediff-meta-list by direct modification (nconc meta-list (list (ediff-make-new-meta-list-element - otherfile1 otherfile2 otherfile3))) + (expand-file-name otherfile1) + (expand-file-name otherfile2) + (if otherfile3 + (expand-file-name otherfile3))))) ) (ediff-update-meta-buffer meta-buf 'must-redraw) )) diff --git a/lisp/edmacro.el b/lisp/edmacro.el index 86bf29f0381..3b562bbdbdf 100644 --- a/lisp/edmacro.el +++ b/lisp/edmacro.el @@ -670,6 +670,7 @@ This function assumes that the events can be stored in a string." (cond ((atom ev) (push ev result)) ((eq (car ev) 'help-echo)) + ((eq (car ev) 'switch-frame)) ((equal ev '(menu-bar)) (push 'menu-bar result)) ((equal (cadadr ev) '(menu-bar)) diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index d05eed2c4a2..1b37f3f772f 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el @@ -619,9 +619,12 @@ If optional second arg SEP is a string, use that as separator." (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/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index bbeea5d703d..68603c905a5 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -193,8 +193,14 @@ (defvar compilation-error-regexp-alist) (defvar compilation-mode-font-lock-keywords) +(defgroup checkdoc nil + "Support for doc string checking in Emacs Lisp." + :prefix "checkdoc" + :group 'lisp + :version "20.3") + (defcustom checkdoc-autofix-flag 'semiautomatic - "*Non-nil means attempt auto-fixing of doc strings. + "Non-nil means attempt auto-fixing of doc strings. If this value is the symbol `query', then the user is queried before any change is made. If the value is `automatic', then all changes are made without asking unless the change is very-complex. If the value @@ -208,37 +214,39 @@ The value `never' is the same as nil, never ask or change anything." (other :tag "semiautomatic" semiautomatic))) (defcustom checkdoc-bouncy-flag t - "*Non-nil means to \"bounce\" to auto-fix locations. + "Non-nil means to \"bounce\" to auto-fix locations. Setting this to nil will silently make fixes that require no user interaction. See `checkdoc-autofix-flag' for auto-fixing details." :group 'checkdoc :type 'boolean) (defcustom checkdoc-force-docstrings-flag t - "*Non-nil means that all checkable definitions should have documentation. + "Non-nil means that all checkable definitions should have documentation. Style guide dictates that interactive functions MUST have documentation, and that it's good but not required practice to make non user visible items have doc strings." :group 'checkdoc :type 'boolean) +(put 'checkdoc-force-docstrings-flag 'safe-local-variable 'booleanp) (defcustom checkdoc-force-history-flag t - "*Non-nil means that files should have a History section or ChangeLog file. + "Non-nil means that files should have a History section or ChangeLog file. This helps document the evolution of, and recent changes to, the package." :group 'checkdoc :type 'boolean) (defcustom checkdoc-permit-comma-termination-flag nil - "*Non-nil means the first line of a docstring may end with a comma. + "Non-nil means the first line of a docstring may end with a comma. Ordinarily, a full sentence is required. This may be misleading when there is a substantial caveat to the one-line description -- the comma should be used when the first part could stand alone as a sentence, but it indicates that a modifying clause follows." :group 'checkdoc :type 'boolean) +(put 'checkdoc-permit-comma-termination-flag 'safe-local-variable 'booleanp) (defcustom checkdoc-spellcheck-documentation-flag nil - "*Non-nil means run Ispell on text based on value. + "Non-nil means run Ispell on text based on value. This is automatically set to nil if Ispell does not exist on your system. Possible values are: @@ -259,14 +267,14 @@ system. Possible values are: "List of words that are correct when spell-checking Lisp documentation.") (defcustom checkdoc-max-keyref-before-warn 10 - "*The number of \\ [command-to-keystroke] tokens allowed in a doc string. + "The number of \\ [command-to-keystroke] tokens allowed in a doc string. Any more than this and a warning is generated suggesting that the construct \\ {keymap} be used instead." :group 'checkdoc :type 'integer) (defcustom checkdoc-arguments-in-order-flag t - "*Non-nil means warn if arguments appear out of order. + "Non-nil means warn if arguments appear out of order. Setting this to nil will mean only checking that all the arguments appear in the proper form in the documentation, not that they are in the same order as they appear in the argument list. No mention is @@ -298,7 +306,7 @@ problem discovered. This is useful for adding additional checks.") A search leaves the cursor in front of the parameter list.") (defcustom checkdoc-verb-check-experimental-flag t - "*Non-nil means to attempt to check the voice of the doc string. + "Non-nil means to attempt to check the voice of the doc string. This check keys off some words which are commonly misused. See the variable `checkdoc-common-verbs-wrong-voice' if you wish to add your own." :group 'checkdoc @@ -2633,12 +2641,6 @@ function called to create the messages." (setq checkdoc-pending-errors nil) nil))) -(defgroup checkdoc nil - "Support for doc string checking in Emacs Lisp." - :prefix "checkdoc" - :group 'lisp - :version "20.3") - (custom-add-option 'emacs-lisp-mode-hook (lambda () (checkdoc-minor-mode 1))) @@ -2650,5 +2652,5 @@ function called to create the messages." (provide 'checkdoc) -;;; arch-tag: c49a7ec8-3bb7-46f2-bfbc-d5f26e033b26 +;; arch-tag: c49a7ec8-3bb7-46f2-bfbc-d5f26e033b26 ;;; checkdoc.el ends here diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 8645ec5a6ed..5107ee60274 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2556,6 +2556,7 @@ MSG is printed after `::::} '." (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/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index a98dd60fc21..82eac50c874 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -60,14 +60,22 @@ fire repeatedly that many seconds apart." (defun timer-set-idle-time (timer secs &optional repeat) "Set the trigger idle time of TIMER to SECS. +SECS may be an integer, floating point number, or the internal +time format (HIGH LOW USECS) returned by, e.g., `current-idle-time'. If optional third argument REPEAT is non-nil, make the timer fire each time Emacs is idle for that many seconds." (or (timerp timer) (error "Invalid timer")) - (aset timer 1 0) - (aset timer 2 0) - (aset timer 3 0) - (timer-inc-time timer secs) + (if (consp secs) + (progn (aset timer 1 (car secs)) + (aset timer 2 (if (consp (cdr secs)) (car (cdr secs)) (cdr secs))) + (aset timer 3 (or (and (consp (cdr secs)) (consp (cdr (cdr secs))) + (nth 2 secs)) + 0))) + (aset timer 1 0) + (aset timer 2 0) + (aset timer 3 0) + (timer-inc-time timer secs)) (aset timer 4 repeat) timer) @@ -104,7 +112,7 @@ of SECS seconds since the epoch. SECS may be a fraction." (defun timer-relative-time (time secs &optional usecs) "Advance TIME by SECS seconds and optionally USECS microseconds. -SECS may be a fraction." +SECS may be either an integer or a floating point number." (let ((high (car time)) (low (if (consp (cdr time)) (nth 1 time) (cdr time))) (micro (if (numberp (car-safe (cdr-safe (cdr time)))) @@ -412,7 +420,10 @@ This function is for compatibility; see also `run-with-timer'." (defun run-with-idle-timer (secs repeat function &rest args) "Perform an action the next time Emacs is idle for SECS seconds. The action is to call FUNCTION with arguments ARGS. -SECS may be an integer or a floating point number. +SECS may be an integer, a floating point number, or the internal +time format (HIGH LOW USECS) returned by, e.g., `current-idle-time'. +If Emacs is currently idle, and has been idle for N seconds (N < SECS), +then it will call FUNCTION in SECS - N seconds from now. If REPEAT is non-nil, do the action each time Emacs has been idle for exactly SECS seconds (that is, only once for each time Emacs becomes idle). @@ -425,7 +436,7 @@ This function returns a timer object which you can use in `cancel-timer'." (let ((timer (timer-create))) (timer-set-function timer function args) (timer-set-idle-time timer secs repeat) - (timer-activate-when-idle timer) + (timer-activate-when-idle timer t) timer)) (defun with-timeout-handler (tag) diff --git a/lisp/emacs-lisp/tq.el b/lisp/emacs-lisp/tq.el index 2126d7663fc..1e1e143f0f0 100644 --- a/lisp/emacs-lisp/tq.el +++ b/lisp/emacs-lisp/tq.el @@ -66,7 +66,7 @@ ;; regexp: regular expression that matches the end of a response from ;; the process (defun tq-queue-head-regexp (tq) (car (cdr (car (tq-queue tq))))) -;; closure: additional data to pass to function +;; closure: additional data to pass to the function (defun tq-queue-head-closure (tq) (car (cdr (cdr (car (tq-queue tq)))))) ;; fn: function to call upon receiving a complete response from the ;; process @@ -119,7 +119,7 @@ If DELAY-QUESTION is non-nil, delay sending this question until the process has finished replying to any previous questions. This produces more reliable results with some processes." (let ((sendp (or (not delay-question) - (not (tq-queue-head-question tq))))) + (not (tq-queue tq))))) (tq-queue-add tq (unless sendp question) regexp closure fn) (when sendp (process-send-string (tq-process tq) question)))) @@ -131,35 +131,39 @@ This produces more reliable results with some processes." (defun tq-filter (tq string) "Append STRING to the TQ's buffer; then process the new data." - (with-current-buffer (tq-buffer tq) - (goto-char (point-max)) - (insert string) - (tq-process-buffer tq))) + (let ((buffer (tq-buffer tq))) + (when (buffer-live-p buffer) + (with-current-buffer buffer + (goto-char (point-max)) + (insert string) + (tq-process-buffer tq))))) (defun tq-process-buffer (tq) "Check TQ's buffer for the regexp at the head of the queue." - (set-buffer (tq-buffer tq)) - (if (= 0 (buffer-size)) () - (if (tq-queue-empty tq) - (let ((buf (generate-new-buffer "*spurious*"))) - (copy-to-buffer buf (point-min) (point-max)) - (delete-region (point-min) (point)) - (pop-to-buffer buf nil) - (error "Spurious communication from process %s, see buffer %s" - (process-name (tq-process tq)) - (buffer-name buf))) - (goto-char (point-min)) - (if (re-search-forward (tq-queue-head-regexp tq) nil t) - (let ((answer (buffer-substring (point-min) (point)))) - (delete-region (point-min) (point)) - (unwind-protect - (condition-case nil - (funcall (tq-queue-head-fn tq) - (tq-queue-head-closure tq) - answer) - (error nil)) - (tq-queue-pop tq)) - (tq-process-buffer tq)))))) + (let ((buffer (tq-buffer tq))) + (when (buffer-live-p buffer) + (set-buffer buffer) + (if (= 0 (buffer-size)) () + (if (tq-queue-empty tq) + (let ((buf (generate-new-buffer "*spurious*"))) + (copy-to-buffer buf (point-min) (point-max)) + (delete-region (point-min) (point)) + (pop-to-buffer buf nil) + (error "Spurious communication from process %s, see buffer %s" + (process-name (tq-process tq)) + (buffer-name buf))) + (goto-char (point-min)) + (if (re-search-forward (tq-queue-head-regexp tq) nil t) + (let ((answer (buffer-substring (point-min) (point)))) + (delete-region (point-min) (point)) + (unwind-protect + (condition-case nil + (funcall (tq-queue-head-fn tq) + (tq-queue-head-closure tq) + answer) + (error nil)) + (tq-queue-pop tq)) + (tq-process-buffer tq)))))))) (provide 'tq) diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 0dce3b94ff0..af757a2a55c 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -46,6 +46,8 @@ (defvar mark-even-if-inactive) (defvar init-message) (defvar initial) +(defvar undo-beg-posn) +(defvar undo-end-posn) ;; loading happens only in non-interactive compilation ;; in order to spare non-viperized emacs from being viperized @@ -196,7 +198,7 @@ (viper-save-cursor-color 'before-insert-mode)) ;; set insert mode cursor color (viper-change-cursor-color viper-insert-state-cursor-color))) - (if (eq viper-current-state 'emacs-state) + (if (and viper-emacs-state-cursor-color (eq viper-current-state 'emacs-state)) (let ((has-saved-cursor-color-in-emacs-mode (stringp (viper-get-saved-cursor-color-in-emacs-mode)))) (or has-saved-cursor-color-in-emacs-mode @@ -722,12 +724,13 @@ (viper-set-replace-overlay (point-min) (point-min))) (viper-hide-replace-overlay) - (let ((has-saved-cursor-color-in-emacs-mode - (stringp (viper-get-saved-cursor-color-in-emacs-mode)))) - (or has-saved-cursor-color-in-emacs-mode - (string= (viper-get-cursor-color) viper-emacs-state-cursor-color) - (viper-save-cursor-color 'before-emacs-mode)) - (viper-change-cursor-color viper-emacs-state-cursor-color)) + (if viper-emacs-state-cursor-color + (let ((has-saved-cursor-color-in-emacs-mode + (stringp (viper-get-saved-cursor-color-in-emacs-mode)))) + (or has-saved-cursor-color-in-emacs-mode + (string= (viper-get-cursor-color) viper-emacs-state-cursor-color) + (viper-save-cursor-color 'before-emacs-mode)) + (viper-change-cursor-color viper-emacs-state-cursor-color))) (viper-change-state 'emacs-state) @@ -1030,10 +1033,13 @@ as a Meta key and any number of multiple escapes is allowed." (inhibit-quit t)) (if (viper-ESC-event-p event) (progn - ;; Emacs 22.50.8 introduced a bug, which makes even a single ESC into - ;; a fast keyseq. To guard against this, we added a check if there - ;; are other events as well - (if (and (viper-fast-keysequence-p) unread-command-events) + ;; Some versions of Emacs (eg., 22.50.8 have a bug, which makes even + ;; a single ESC into ;; a fast keyseq. To guard against this, we + ;; added a check if there are other events as well. Keep the next + ;; line for the next time the bug reappears, so that will remember to + ;; report it. + ;;(if (and (viper-fast-keysequence-p) unread-command-events) + (if (viper-fast-keysequence-p) ;; for Emacsen without the above bug (progn (let (minor-mode-map-alist emulation-mode-map-alists) (viper-set-unread-command-events event) @@ -1744,12 +1750,14 @@ invokes the command before that, etc." ;; Hook used in viper-undo (defun viper-after-change-undo-hook (beg end len) - (setq undo-beg-posn beg - undo-end-posn (or end beg)) - ;; some other hooks may be changing various text properties in - ;; the buffer in response to 'undo'; so remove this hook to avoid - ;; its repeated invocation - (remove-hook 'viper-undo-functions 'viper-after-change-undo-hook 'local)) + (if undo-in-progress + (setq undo-beg-posn beg + undo-end-posn (or end beg)) + ;; some other hooks may be changing various text properties in + ;; the buffer in response to 'undo'; so remove this hook to avoid + ;; its repeated invocation + (remove-hook 'viper-undo-functions 'viper-after-change-undo-hook 'local) + )) (defun viper-undo () "Undo previous change." @@ -1764,25 +1772,29 @@ invokes the command before that, etc." (undo-start) (undo-more 2) - (setq undo-beg-posn (or undo-beg-posn before-undo-pt) - undo-end-posn (or undo-end-posn undo-beg-posn)) + ;;(setq undo-beg-posn (or undo-beg-posn (point)) + ;; undo-end-posn (or undo-end-posn (point))) + ;;(setq undo-beg-posn (or undo-beg-posn before-undo-pt) + ;; undo-end-posn (or undo-end-posn undo-beg-posn)) - (goto-char undo-beg-posn) - (sit-for 0) - (if (and viper-keep-point-on-undo - (pos-visible-in-window-p before-undo-pt)) + (if (and undo-beg-posn undo-end-posn) (progn - (push-mark (point-marker) t) - (viper-sit-for-short 300) - (goto-char undo-end-posn) - (viper-sit-for-short 300) - (if (and (> (viper-chars-in-region undo-beg-posn before-undo-pt) 1) - (> (viper-chars-in-region undo-end-posn before-undo-pt) 1)) - (goto-char before-undo-pt) - (goto-char undo-beg-posn))) - (push-mark before-undo-pt t)) + (goto-char undo-beg-posn) + (sit-for 0) + (if (and viper-keep-point-on-undo + (pos-visible-in-window-p before-undo-pt)) + (progn + (push-mark (point-marker) t) + (viper-sit-for-short 300) + (goto-char undo-end-posn) + (viper-sit-for-short 300) + (if (pos-visible-in-window-p undo-beg-posn) + (goto-char before-undo-pt) + (goto-char undo-beg-posn))) + (push-mark before-undo-pt t)) + )) + (if (and (eolp) (not (bolp))) (backward-char 1)) - ;;(if (not modified) (set-buffer-modified-p t)) ) (setq this-command 'viper-undo)) @@ -3952,7 +3964,8 @@ Null string will repeat previous search." (let ((val (viper-p-val arg)) (com (viper-getcom arg)) debug-on-error) - (if (null viper-s-string) (error viper-NoPrevSearch)) + (if (or (null viper-s-string) (string= viper-s-string "")) + (error viper-NoPrevSearch)) (viper-search viper-s-string viper-s-forward arg) (if com (progn diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index e2824246fad..f9f08034582 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el @@ -208,12 +208,12 @@ ;; If this is a one-letter magic command, splice in args. (defun ex-splice-args-in-1-letr-cmd (key list) - (let ((onelet (ex-cmd-is-one-letter (assoc (substring key 0 1) list)))) - (if onelet + (let ((oneletter (ex-cmd-is-one-letter (assoc (substring key 0 1) list)))) + (if oneletter (list key - (append (cadr onelet) + (append (cadr oneletter) (if (< 1 (length key)) (list (substring key 1)))) - (caddr onelet))) + (car (cdr (cdr oneletter))) )) )) diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index 80938b0282a..465f6e5cfb8 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el @@ -434,7 +434,10 @@ delete the text being replaced, as in standard Vi." (if (fboundp 'make-variable-frame-local) (make-variable-frame-local 'viper-insert-state-cursor-color)) -(defcustom viper-emacs-state-cursor-color "Magenta" +;; viper-emacs-state-cursor-color doesn't work well. Causes cursor colors to be +;; confused in some cases. So, this var is nulled for now. +;; (defcustom viper-emacs-state-cursor-color "Magenta" +(defcustom viper-emacs-state-cursor-color nil "Cursor color when Viper is in emacs state." :type 'string :group 'viper) diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index 252088a476d..fe179be9cd1 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el @@ -137,10 +137,10 @@ (x-display-color-p) ; emacs )) -(defsubst viper-get-cursor-color () +(defun viper-get-cursor-color (&optional frame) (viper-cond-compile-for-xemacs-or-emacs (color-instance-name - (frame-property (selected-frame) 'cursor-color)) ; xemacs + (frame-property (or frame (selected-frame)) 'cursor-color)) ; xemacs (cdr (assoc 'cursor-color (frame-parameters))) ; emacs )) @@ -152,18 +152,31 @@ ;; cursor colors -(defun viper-change-cursor-color (new-color) +(defun viper-change-cursor-color (new-color &optional frame) (if (and (viper-window-display-p) (viper-color-display-p) (stringp new-color) (viper-color-defined-p new-color) (not (string= new-color (viper-get-cursor-color)))) (viper-cond-compile-for-xemacs-or-emacs (set-frame-property - (selected-frame) 'cursor-color (make-color-instance new-color)) + (or frame (selected-frame)) + 'cursor-color (make-color-instance new-color)) (modify-frame-parameters - (selected-frame) (list (cons 'cursor-color new-color))) + (or frame (selected-frame)) + (list (cons 'cursor-color new-color))) ) )) +(defun viper-set-cursor-color-according-to-state (&optional frame) + (cond ((eq viper-current-state 'replace-state) + (viper-change-cursor-color viper-replace-state-cursor-color frame)) + ((and (eq viper-current-state 'emacs-state) + viper-emacs-state-cursor-color) + (viper-change-cursor-color viper-emacs-state-cursor-color frame)) + ((eq viper-current-state 'insert-state) + (viper-change-cursor-color viper-insert-state-cursor-color frame)) + (t + (viper-change-cursor-color viper-vi-state-cursor-color frame)))) + ;; By default, saves current frame cursor color in the ;; viper-saved-cursor-color-in-replace-mode property of viper-replace-overlay (defun viper-save-cursor-color (before-which-mode) @@ -191,7 +204,7 @@ (if viper-emacs-p 'frame-parameter 'frame-property) (selected-frame) 'viper-saved-cursor-color-in-replace-mode) - (if (eq viper-current-state 'emacs-mode) + (if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color) viper-emacs-state-cursor-color viper-vi-state-cursor-color))) @@ -201,7 +214,7 @@ (if viper-emacs-p 'frame-parameter 'frame-property) (selected-frame) 'viper-saved-cursor-color-in-insert-mode) - (if (eq viper-current-state 'emacs-mode) + (if (and (eq viper-current-state 'emacs-mode) viper-emacs-state-cursor-color) viper-emacs-state-cursor-color viper-vi-state-cursor-color))) diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 8f858526da3..0ba7bdd041a 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -534,10 +534,6 @@ If Viper is enabled, turn it off. Otherwise, turn it on." (defun viper-mode () "Turn on Viper emulation of Vi in Emacs. See Info node `(viper)Viper'." (interactive) - (if (null viper-vi-state-cursor-color) - (modify-frame-parameters - (selected-frame) - (list (cons 'viper-vi-state-cursor-color (viper-get-cursor-color))))) (if (not noninteractive) (progn ;; if the user requested viper-mode explicitly @@ -618,7 +614,8 @@ This startup message appears whenever you load Viper, unless you type `y' now." (or (memq major-mode viper-emacs-state-mode-list) ; don't switch to Vi (memq major-mode viper-insert-state-mode-list) ; don't switch - (viper-change-state-to-vi))))) + (viper-change-state-to-vi)) + ))) ;; Apply a little heuristic to invoke vi state on major-modes @@ -862,8 +859,11 @@ It also can't undo some Viper settings." ;; info about the display and windows until emacs initialization is complete ;; So do it via the window-setup-hook (add-hook 'window-setup-hook - '(lambda () - (setq viper-vi-state-cursor-color (viper-get-cursor-color)))) + '(lambda () + (modify-frame-parameters + (selected-frame) + (list (cons 'viper-vi-state-cursor-color + (viper-get-cursor-color)))))) ;; Tell vc-diff to put *vc* in Vi mode (if (featurep 'vc) @@ -903,7 +903,6 @@ It also can't undo some Viper settings." (defadvice set-cursor-color (after viper-set-cursor-color-ad activate) "Change cursor color in VI state." - ;;(setq viper-vi-state-cursor-color (ad-get-arg 0)) (modify-frame-parameters (selected-frame) (list (cons 'viper-vi-state-cursor-color (ad-get-arg 0)))) @@ -1008,8 +1007,8 @@ It also can't undo some Viper settings." ;; these are primarily advices and Vi-ish variable settings (defun viper-non-hook-settings () - ;; Viper changes the default mode-line-buffer-identification - (setq-default mode-line-buffer-identification '(" %b")) + ;;;; Viper changes the default mode-line-buffer-identification + ;;(setq-default mode-line-buffer-identification '(" %b")) ;; setup emacs-supported vi-style feel (setq next-line-add-newlines nil diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 216d14d0aa6..72754aa1cd3 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,78 @@ +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. + + * Makefile, NEWS, erc.texi: Update for the 5.1.4 release. + + * erc.el (erc-active-buffer): Fix bug that caused messages to go + to the wrong buffer. Thanks to offby1 for the report. + + * erc-backend.el (erc-coding-system-for-target): Handle case where + target is nil. Thanks to Kai Fan for the patch. + +2006-07-29 Michael Olson + + * erc-log.el (erc-log-setup-logging): Don't offer to save the + buffer. It will be saved automatically killed. Thanks to Johan + Bockg氓rd and Tassilo Horn for pointing this out. + +2006-07-27 Johan Bockg氓rd + + * erc.el (define-erc-module): Make find-function and find-variable + find the names constructed by `define-erc-module' in Emacs 22. + +2006-07-14 Michael Olson + + * erc-log.el (log): Make sure that we enable logging on + already-opened buffers as well, in case the user toggles this + module after loading ERC. Also be sure to remove logging ability + from all ERC buffers when the module is disabled. + (erc-log-setup-logging): Set buffer-file-name to nil rather than + the empty string. This should fix some errors that occur when + quitting Emacs without first killing all ERC buffers. + (erc-log-disable-logging): New function that removes the logging + ability from the current buffer. + + * erc-spelling.el (spelling): Use dolist and buffer-live-p. + 2006-07-12 Michael Olson * erc-match.el (erc-log-matches): Bind inhibit-read-only rather diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el index 7dce9e4bf01..5acbcb05ab8 100644 --- a/lisp/erc/erc-backend.el +++ b/lisp/erc/erc-backend.el @@ -493,11 +493,7 @@ action." (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)) @@ -563,11 +556,12 @@ action." "Return the coding system or cons cell appropriate for TARGET. This is determined via `erc-encoding-coding-alist' or `erc-server-coding-system'." - (or (let ((case-fold-search t)) - (catch 'match - (dolist (pat erc-encoding-coding-alist) - (when (string-match (car pat) target) - (throw 'match (cdr pat)))))) + (or (when target + (let ((case-fold-search t)) + (catch 'match + (dolist (pat erc-encoding-coding-alist) + (when (string-match (car pat) target) + (throw 'match (cdr pat))))))) (and (functionp erc-server-coding-system) (funcall erc-server-coding-system)) erc-server-coding-system)) diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el index b316a8588bd..2fe29e82fe5 100644 --- a/lisp/erc/erc-log.el +++ b/lisp/erc/erc-log.el @@ -71,8 +71,6 @@ ;; 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 @@ -218,7 +216,10 @@ also be a predicate function. To only log when you are not set away, use: (add-hook 'erc-quit-hook 'erc-conditional-save-queries) (add-hook 'erc-part-hook 'erc-conditional-save-buffer) ;; append, so that 'erc-initialize-log-marker runs first - (add-hook 'erc-connect-pre-hook 'erc-log-setup-logging 'append)) + (add-hook 'erc-connect-pre-hook 'erc-log-setup-logging 'append) + (dolist (buffer (erc-buffer-list)) + (when (buffer-live-p buffer) + (with-current-buffer buffer (erc-log-setup-logging))))) ;; disable ((remove-hook 'erc-insert-post-hook 'erc-save-buffer-in-logs) (remove-hook 'erc-send-post-hook 'erc-save-buffer-in-logs) @@ -226,7 +227,10 @@ also be a predicate function. To only log when you are not set away, use: (remove-hook 'erc-kill-channel-hook 'erc-save-buffer-in-logs) (remove-hook 'erc-quit-hook 'erc-conditional-save-queries) (remove-hook 'erc-part-hook 'erc-conditional-save-buffer) - (remove-hook 'erc-connect-pre-hook 'erc-log-setup-logging))) + (remove-hook 'erc-connect-pre-hook 'erc-log-setup-logging) + (dolist (buffer (erc-buffer-list)) + (when (buffer-live-p buffer) + (with-current-buffer buffer (erc-log-disable-logging)))))) (define-key erc-mode-map "\C-c\C-l" 'erc-save-buffer-in-logs) @@ -236,8 +240,7 @@ also be a predicate function. To only log when you are not set away, use: This function is destined to be run from `erc-connect-pre-hook'." (when (erc-logging-enabled) (auto-save-mode -1) - (setq buffer-offer-save t - buffer-file-name "") + (setq buffer-file-name nil) (set (make-local-variable 'write-file-functions) '(erc-save-buffer-in-logs)) (when erc-log-insert-log-on-open @@ -245,6 +248,12 @@ This function is destined to be run from `erc-connect-pre-hook'." (move-marker erc-last-saved-position (1- (point-max))))))) +(defun erc-log-disable-logging () + "Disable logging in the current buffer." + (when (erc-logging-enabled) + (setq buffer-offer-save nil + erc-enable-logging nil))) + (defun erc-log-all-but-server-buffers (buffer) "Returns t if logging should be enabled in BUFFER. Returns nil iff `erc-server-buffer-p' returns t." @@ -282,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-spelling.el b/lisp/erc/erc-spelling.el index 3cbc786274d..7ed0f510539 100644 --- a/lisp/erc/erc-spelling.el +++ b/lisp/erc/erc-spelling.el @@ -40,15 +40,13 @@ ;; Use erc-connect-pre-hook instead of erc-mode-hook as pre-hook is ;; called AFTER the server buffer is initialized. ((add-hook 'erc-connect-pre-hook 'erc-spelling-init) - (mapc (lambda (buffer) - (when buffer - (with-current-buffer buffer (erc-spelling-init)))) - (erc-buffer-list))) + (dolist (buffer (erc-buffer-list)) + (when (buffer-live-p buffer) + (with-current-buffer buffer (erc-spelling-init))))) ((remove-hook 'erc-connect-pre-hook 'erc-spelling-init) - (mapc (lambda (buffer) - (when buffer - (with-current-buffer buffer (flyspell-mode 0)))) - (erc-buffer-list)))) + (dolist (buffer (erc-buffer-list)) + (when (buffer-live-p buffer) + (with-current-buffer buffer (flyspell-mode 0)))))) (defcustom erc-spelling-dictionaries nil "An alist mapping buffer names to dictionaries. diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index fd5a49eae4b..41d59576251 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -67,7 +67,7 @@ ;;; Code: -(defconst erc-version-string "Version 5.1.3" +(defconst erc-version-string "Version 5.1.4" "ERC version. This is used by function `erc-version'.") (eval-when-compile (require 'cl)) @@ -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. @@ -1243,7 +1244,11 @@ With arg, turn ERC %S mode on if and only if arg is positive. (format "erc-%s-mode" (downcase (symbol-name alias))))) (quote - ,mode)))))) + ,mode))) + ;; For find-function and find-variable. + (put ',mode 'definition-name ',name) + (put ',enable 'definition-name ',name) + (put ',disable 'definition-name ',name)))) (put 'define-erc-module 'doc-string-elt 3) @@ -1388,8 +1393,8 @@ server buffer") Defaults to the server buffer." (with-current-buffer (erc-server-buffer) (if (buffer-live-p erc-active-buffer) - erc-active-buffer) - (setq erc-active-buffer (current-buffer)))) + erc-active-buffer + (setq erc-active-buffer (current-buffer))))) (defun erc-set-active-buffer (buffer) "Set the value of `erc-active-buffer' to BUFFER." @@ -2358,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 @@ -2370,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))))) @@ -5237,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'." @@ -5890,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))))) @@ -5942,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 f501e0054d1..c893e47ca79 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2075,7 +2075,7 @@ terminal type to a different value." ;; 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/files.el b/lisp/files.el index 2b1446683be..e099d30a01f 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -540,13 +540,21 @@ is a valid DOS file name, but c:/bar/c:/foo is not. This function's standard definition is trivial; it just returns the argument. However, on Windows and DOS, replace invalid -characters. On DOS, make sure to obey the 8.3 limitations. On -Windows, turn Cygwin names into native names, and also turn -slashes into backslashes if the shell requires it (see +characters. On DOS, make sure to obey the 8.3 limitations. +In the native Windows build, turn Cygwin names into native names, +and also turn slashes into backslashes if the shell requires it (see `w32-shell-dos-semantics'). See Info node `(elisp)Standard File Names' for more details." - filename) + (if (eq system-type 'cygwin) + (let ((name (copy-sequence filename)) + (start 0)) + ;; Replace invalid filename characters with ! + (while (string-match "[?*:<>|\"\000-\037]" name start) + (aset name (match-beginning 0) ?!) + (setq start (match-end 0))) + name) + filename)) (defun read-directory-name (prompt &optional dir default-dirname mustmatch initial) "Read directory name, prompting with PROMPT and completing in directory DIR. @@ -4369,7 +4377,7 @@ See also `auto-save-file-name-p'." "#"))) ;; Make sure auto-save file names don't contain characters ;; invalid for the underlying filesystem. - (if (and (memq system-type '(ms-dos windows-nt)) + (if (and (memq system-type '(ms-dos windows-nt cygwin)) ;; Don't modify remote (ange-ftp) filenames (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" result))) (convert-standard-filename result) @@ -4404,7 +4412,7 @@ See also `auto-save-file-name-p'." ((file-writable-p default-directory) default-directory) ((file-writable-p "/var/tmp/") "/var/tmp/") ("~/"))))) - (if (and (memq system-type '(ms-dos windows-nt)) + (if (and (memq system-type '(ms-dos windows-nt cygwin)) ;; Don't modify remote (ange-ftp) filenames (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" fname))) ;; The call to convert-standard-filename is in case diff --git a/lisp/filesets.el b/lisp/filesets.el index 4ca5a9d1420..eb8cdb02617 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -1798,7 +1798,7 @@ User will be queried, if no fileset name is provided." 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-core.el b/lisp/font-core.el index d2cb8dccd10..85bbf60f0d9 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el @@ -83,34 +83,6 @@ where MAJOR-MODE is a symbol and FONT-LOCK-DEFAULTS is a list of default settings. See the variable `font-lock-defaults', which takes precedence.") (make-obsolete-variable 'font-lock-defaults-alist 'font-lock-defaults) -(defvar font-lock-extend-region-function nil - "A function that determines the region to fontify after a change. - -This buffer-local variable is either nil, or is a function that determines the -region to fontify. It is usually set by the major mode. The currently active -font-lock after-change function 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 -\(which directs the caller to fontify a default region). This function need -not preserve point or the match-data, but must preserve the current -restriction. The region it returns may start or end in the middle of a -line.") -(make-variable-buffer-local 'font-lock-extend-region-function) - -(defun font-lock-extend-region (beg end old-len) - "Determine the region to fontify after a buffer change. - -BEG END and OLD-LEN are the standard parameters from after-change-functions. -The return value is either nil \(which directs the caller to chose the region -itself), or a cons of the beginning and end \(in that order) of the region. -The region returned may start or end in the middle of a line." - (if font-lock-extend-region-function - (save-match-data - (save-excursion - (funcall font-lock-extend-region-function beg end old-len))))) - (defvar font-lock-function 'font-lock-default-function "A function which is called when `font-lock-mode' is toggled. It will be passed one argument, which is the current value of diff --git a/lisp/font-lock.el b/lisp/font-lock.el index f001a0bfaac..093780c3914 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -893,7 +893,11 @@ The value of this variable is used when Font Lock mode is turned on." (set (make-local-variable 'font-lock-fontified) t) ;; Use jit-lock. (jit-lock-register 'font-lock-fontify-region - (not font-lock-keywords-only)))))) + (not font-lock-keywords-only)) + ;; Tell jit-lock how we extend the region to refontify. + (add-hook 'jit-lock-after-change-extend-region-functions + 'font-lock-extend-jit-lock-region-after-change + nil t))))) (defun font-lock-turn-off-thing-lock () (cond ((and (boundp 'fast-lock-mode) fast-lock-mode) @@ -971,6 +975,21 @@ The value of this variable is used when Font Lock mode is turned on." ;; directives correctly and cleanly. (It is the same problem as fontifying ;; 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 refontify after a change. + +This variable is either nil, or is a function that determines the +region to refontify after a change. +It is usually set by the major mode via `font-lock-defaults'. +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 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.") + (defun font-lock-fontify-buffer () "Fontify the current buffer the way the function `font-lock-mode' would." (interactive) @@ -1021,6 +1040,59 @@ The value of this variable is used when Font Lock mode is turned on." Useful for things like RMAIL and Info where the whole buffer is not 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 +as beginning and end of the fontified region. Its most common use is to solve +the problem of /identification/ of multiline elements by providing a function +that tries to find such elements and move the boundaries such that they do +not fall in the middle of one. +Each function is called with no argument; it is expected to adjust the +dynamically bound variables `font-lock-beg' and `font-lock-end'; and return +non-nil iff it did make such an adjustment. +These functions are run in turn repeatedly until they all return nil. +Put first the functions more likely to cause a change and cheaper to compute.") +;; Mark it as a special hook which doesn't use any global setting +;; (i.e. doesn't obey the element t in the buffer-local value). +(make-variable-buffer-local 'font-lock-extend-region-functions) + +(defun font-lock-extend-region-multiline () + "Move fontification boundaries away from any `font-lock-multiline' property." + (let ((changed nil)) + (when (and (> font-lock-beg (point-min)) + (get-text-property (1- font-lock-beg) 'font-lock-multiline)) + (setq changed t) + (setq font-lock-beg (or (previous-single-property-change + font-lock-beg 'font-lock-multiline) + (point-min)))) + ;; + (when (get-text-property font-lock-end 'font-lock-multiline) + (setq changed t) + (setq font-lock-end (or (text-property-any font-lock-end (point-max) + 'font-lock-multiline nil) + (point-max)))) + changed)) + + +(defun font-lock-extend-region-wholelines () + "Move fontification boundaries to beginning of lines." + (let ((changed nil)) + (goto-char font-lock-beg) + (unless (bolp) (setq changed t font-lock-beg (line-beginning-position))) + (goto-char font-lock-end) + (unless (bolp) (setq changed t font-lock-end (line-beginning-position 2))) + changed)) + (defun font-lock-default-fontify-region (beg end loudly) (save-buffer-state ((parse-sexp-lookup-properties @@ -1032,24 +1104,21 @@ a very meaningful entity to highlight.") ;; Use the fontification syntax table, if any. (when font-lock-syntax-table (set-syntax-table font-lock-syntax-table)) - (goto-char beg) - (setq beg (line-beginning-position)) - ;; check to see if we should expand the beg/end area for - ;; proper multiline matches - (when (and (> beg (point-min)) - (get-text-property (1- beg) 'font-lock-multiline)) - ;; We are just after or in a multiline match. - (setq beg (or (previous-single-property-change - beg 'font-lock-multiline) - (point-min))) - (goto-char beg) - (setq beg (line-beginning-position))) - (setq end (or (text-property-any end (point-max) - 'font-lock-multiline nil) - (point-max))) - (goto-char end) - ;; Round up to a whole line. - (unless (bolp) (setq end (line-beginning-position 2))) + ;; Extend the region to fontify so that it starts and ends at + ;; safe places. + (let ((funs font-lock-extend-region-functions) + (font-lock-beg beg) + (font-lock-end end)) + (while funs + (setq funs (if (or (not (funcall (car funs))) + (eq funs font-lock-extend-region-functions)) + (cdr funs) + ;; If there's been a change, we should go through + ;; the list again since this new position may + ;; warrant a different answer from one of the fun + ;; we've already seen. + font-lock-extend-region-functions))) + (setq beg font-lock-beg end font-lock-end)) ;; Now do the fontification. (font-lock-unfontify-region beg end) (when font-lock-syntactic-keywords @@ -1083,19 +1152,77 @@ what properties to clear before refontifying a region.") ;; Called when any modification is made to buffer text. (defun font-lock-after-change-function (beg end old-len) - (let ((inhibit-point-motion-hooks t) - (inhibit-quit t) - (region (font-lock-extend-region beg end old-len))) - (save-excursion + (save-excursion + (let ((inhibit-point-motion-hooks t) + (inhibit-quit t) + (region (if font-lock-extend-after-change-region-function + (funcall font-lock-extend-after-change-region-function + beg end old-len)))) (save-match-data (if region ;; Fontify the region the major mode has specified. (setq beg (car region) end (cdr region)) ;; Fontify the whole lines which enclose the region. - (setq beg (progn (goto-char beg) (line-beginning-position)) - end (progn (goto-char end) (line-beginning-position 2)))) + ;; Actually, this is not needed because + ;; font-lock-default-fontify-region already rounds up to a whole + ;; number of lines. + ;; (setq beg (progn (goto-char beg) (line-beginning-position)) + ;; end (progn (goto-char end) (line-beginning-position 2))) + ) (font-lock-fontify-region beg end))))) +(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 + (funcall font-lock-extend-after-change-region-function + beg end old-len)))) + (if region + (setq beg (min jit-lock-start (car 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 + beg 'font-lock-multiline) + (point-min)))) + (setq end (or (text-property-any end (point-max) + 'font-lock-multiline nil) + (point-max))) + ;; Finally, pre-enlarge the region to a whole number of lines, to try + ;; 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) + (forward-line 0) + (setq jit-lock-start (min jit-lock-start (point))) + (goto-char end) + (forward-line 1) + (setq jit-lock-end (max jit-lock-end (point))))))) + (defun font-lock-fontify-block (&optional arg) "Fontify some lines the way `font-lock-fontify-buffer' would. The lines could be a function or paragraph, or a specified number of lines. diff --git a/lisp/format.el b/lisp/format.el index 58c69575d36..66eca0c2ac2 100644 --- a/lisp/format.el +++ b/lisp/format.el @@ -117,17 +117,17 @@ DOC-STR should be a single line providing more information about the REGEXP is a regular expression to match against the beginning of the file; it should match only files in that format. Use nil to avoid - matching at all for formats for which this isn't appropriate to + matching at all for formats for which it isn't appropriate to require explicit encoding/decoding. -FROM-FN is called to decode files in that format; it gets two args, BEGIN +FROM-FN is called to decode files in that format; it takes two args, BEGIN and END, and can make any modifications it likes, returning the new end. It must make sure that the beginning of the file no longer matches REGEXP, or else it will get called again. Alternatively, FROM-FN can be a string, which specifies a shell command (including options) to be used as a filter to perform the conversion. -TO-FN is called to encode a region into that format; it is passed three +TO-FN is called to encode a region into that format; it takes three arguments: BEGIN, END, and BUFFER. BUFFER is the original buffer that the data being written came from, which the function could use, for example, to find the values of local variables. TO-FN should either @@ -142,7 +142,7 @@ MODIFY, if non-nil, means the TO-FN wants to modify the region. If nil, MODE-FN, if specified, is called when visiting a file with that format. It is called with a single positive argument, on the assumption - that it turns on some Emacs mode. + that this would turn on some minor mode. PRESERVE, if non-nil, means that `format-write-file' should not remove this format from `buffer-file-formats'.") @@ -150,8 +150,8 @@ PRESERVE, if non-nil, means that `format-write-file' should not remove ;;; Basic Functions (called from Lisp) (defun format-encode-run-method (method from to &optional buffer) - "Translate using function or shell script METHOD the text from FROM to TO. -If METHOD is a string, it is a shell command; + "Translate using METHOD the text from FROM to TO. +If METHOD is a string, it is a shell command (including options); otherwise, it should be a Lisp function. BUFFER should be the buffer that the output originally came from." (if (stringp method) @@ -173,9 +173,9 @@ BUFFER should be the buffer that the output originally came from." (funcall method from to buffer))) (defun format-decode-run-method (method from to &optional buffer) - "Decode using function or shell script METHOD the text from FROM to TO. -If METHOD is a string, it is a shell command; otherwise, it should be -a Lisp function. Decoding is done for the given BUFFER." + "Decode using METHOD the text from FROM to TO. +If METHOD is a string, it is a shell command (including options); otherwise, +it should be a Lisp function. Decoding is done for the given BUFFER." (if (stringp method) (let ((error-buff (get-buffer-create "*Format Errors*")) (coding-system-for-write 'no-conversion) @@ -200,15 +200,15 @@ a Lisp function. Decoding is done for the given BUFFER." (defun format-annotate-function (format from to orig-buf format-count) "Return annotations for writing region as FORMAT. -FORMAT is a symbol naming one of the formats defined in `format-alist', -it must be a single symbol, not a list like `buffer-file-format'. +FORMAT is a symbol naming one of the formats defined in `format-alist'. +It must be a single symbol, not a list like `buffer-file-format'. FROM and TO delimit the region to be operated on in the current buffer. ORIG-BUF is the original buffer that the data came from. FORMAT-COUNT is an integer specifying how many times this function has been called in the process of decoding ORIG-BUF. -This function works like a function on `write-region-annotate-functions': +This function works like a function in `write-region-annotate-functions': it either returns a list of annotations, or returns with a different buffer current, which contains the modified text to write. In the latter case, this function's value is nil. @@ -253,7 +253,7 @@ If optional third arg VISIT-FLAG is true, set `buffer-file-format' to the reverted list of formats used, and call any mode functions defined for those formats. -Returns the new length of the decoded region. +Return the new length of the decoded region. For most purposes, consider using `format-decode-region' instead." (let ((mod (buffer-modified-p)) @@ -312,9 +312,9 @@ For most purposes, consider using `format-decode-region' instead." (defun format-decode-buffer (&optional format) "Translate the buffer from some FORMAT. -If the format is not specified, this function attempts to guess. -`buffer-file-format' is set to the format used, and any mode-functions -for the format are called." +If the format is not specified, attempt a regexp-based guess. +Set `buffer-file-format' to the format used, and call any +format-specific mode functions." (interactive (list (format-read "Translate buffer from format (default guess): "))) (save-excursion @@ -343,7 +343,7 @@ formats defined in `format-alist', or a list of such symbols." (defun format-encode-region (beg end &optional format) "Translate the region into some FORMAT. -FORMAT defaults to `buffer-file-format', it is a symbol naming +FORMAT defaults to `buffer-file-format'. It is a symbol naming one of the formats defined in `format-alist', or a list of such symbols." (interactive (list (region-beginning) (region-end) @@ -374,9 +374,9 @@ Make buffer visit that file and set the format as the default for future saves. If the buffer is already visiting a file, you can specify a directory name as FILENAME, to write a file of the same old name in that directory. -If optional third arg CONFIRM is non-nil, this function asks for -confirmation before overwriting an existing file. Interactively, -confirmation is required unless you supply a prefix argument." +If optional third arg CONFIRM is non-nil, ask for confirmation before +overwriting an existing file. Interactively, confirmation is required +unless you supply a prefix argument." (interactive ;; Same interactive spec as write-file, plus format question. (let* ((file (if buffer-file-name @@ -419,7 +419,7 @@ If FORMAT is nil then do not do any format conversion." "Insert the contents of file FILENAME using data format FORMAT. If FORMAT is nil then do not do any format conversion. The optional third and fourth arguments BEG and END specify -the part of the file to read. +the part (in bytes) of the file to read. The return value is like the value of `insert-file-contents': a list (ABSOLUTE-FILE-NAME SIZE)." @@ -456,10 +456,10 @@ Formats are defined in `format-alist'. Optional arg is the PROMPT to use." (defun format-replace-strings (alist &optional reverse beg end) "Do multiple replacements on the buffer. ALIST is a list of (FROM . TO) pairs, which should be proper arguments to -`search-forward' and `replace-match' respectively. -Optional 2nd arg REVERSE, if non-nil, means the pairs are (TO . FROM), so that -you can use the same list in both directions if it contains only literal -strings. +`search-forward' and `replace-match', respectively. +Optional second arg REVERSE, if non-nil, means the pairs are (TO . FROM), +so that you can use the same list in both directions if it contains only +literal strings. Optional args BEG and END specify a region of the buffer on which to operate." (save-excursion (save-restriction @@ -497,7 +497,7 @@ the value of `foo'." (defun format-make-relatively-unique (a b) "Delete common elements of lists A and B, return as pair. -Compares using `equal'." +Compare using `equal'." (let* ((acopy (copy-sequence a)) (bcopy (copy-sequence b)) (tail acopy)) @@ -511,9 +511,9 @@ Compares using `equal'." (defun format-common-tail (a b) "Given two lists that have a common tail, return it. -Compares with `equal', and returns the part of A that is equal to the +Compare with `equal', and return the part of A that is equal to the equivalent part of B. If even the last items of the two are not equal, -returns nil." +return nil." (let ((la (length a)) (lb (length b))) ;; Make sure they are the same length @@ -534,9 +534,9 @@ A proper list is a list ending with a nil cdr, not with an atom " (null list))) (defun format-reorder (items order) - "Arrange ITEMS to following partial ORDER. -Elements of ITEMS equal to elements of ORDER will be rearranged to follow the -ORDER. Unmatched items will go last." + "Arrange ITEMS to follow partial ORDER. +Elements of ITEMS equal to elements of ORDER will be rearranged +to follow the ORDER. Unmatched items will go last." (if order (let ((item (member (car order) items))) (if item @@ -793,7 +793,7 @@ yet known. ;; next-single-property-change instead of text-property-not-all, but then ;; we have to see if we passed TO. (defun format-property-increment-region (from to prop delta default) - "Over the region between FROM and TO increment property PROP by amount DELTA. + "In the region from FROM to TO increment property PROP by amount DELTA. DELTA may be negative. If property PROP is nil anywhere in the region, it is treated as though it were DEFAULT." (let ((cur from) val newval next) @@ -810,7 +810,7 @@ in the region, it is treated as though it were DEFAULT." (defun format-insert-annotations (list &optional offset) "Apply list of annotations to buffer as `write-region' would. -Inserts each element of the given LIST of buffer annotations at its +Insert each element of the given LIST of buffer annotations at its appropriate place. Use second arg OFFSET if the annotations' locations are not relative to the beginning of the buffer: annotations will be inserted at their location-OFFSET+1 \(ie, the offset is treated as the position of @@ -834,7 +834,7 @@ property is the name of the annotation that you want to use, as it is for the (defun format-annotate-region (from to translations format-fn ignore) "Generate annotations for text properties in the region. -Searches for changes between FROM and TO, and describes them with a list of +Search for changes between FROM and TO, and describe them with a list of annotations as defined by alist TRANSLATIONS and FORMAT-FN. IGNORE lists text properties not to consider; any text properties that are neither ignored nor listed in TRANSLATIONS are warned about. @@ -975,9 +975,9 @@ either strings, or lists of the form (PARAMETER VALUE)." "Return annotations for property PROP changing from OLD to NEW. These are searched for in the translations alist TRANSLATIONS (see `format-annotate-region' for the format). -If NEW does not appear in the list, but there is a default function, then that -function is called. -Returns a cons of the form (CLOSE . OPEN) +If NEW does not appear in the list, but there is a default function, +then call that function. +Return a cons of the form (CLOSE . OPEN) where CLOSE is a list of annotations to close and OPEN is a list of annotations to open. @@ -1016,7 +1016,7 @@ either strings, or lists of the form (PARAMETER VALUE)." (format-annotate-atomic-property-change prop-alist old new))))) (defun format-annotate-atomic-property-change (prop-alist old new) - "Internal function annotate a single property change. + "Internal function to annotate a single property change. PROP-ALIST is the relevant element of a TRANSLATIONS list. OLD and NEW are the values." (let (num-ann) diff --git a/lisp/frame.el b/lisp/frame.el index e965007c8b0..1ad42e387a8 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1362,49 +1362,19 @@ The function `blink-cursor-start' is called when the timer fires.") This timer calls `blink-cursor-timer-function' every `blink-cursor-interval' seconds.") -(define-minor-mode blink-cursor-mode - "Toggle blinking cursor mode. -With a numeric argument, turn blinking cursor mode on iff ARG is positive. -When blinking cursor mode is enabled, the cursor of the selected -window blinks. - -Note that this command is effective only when Emacs -displays through a window system, because then Emacs does its own -cursor display. On a text-only terminal, this is not implemented." - :init-value (not (or noninteractive - no-blinking-cursor - (eq system-type 'ms-dos) - (not (memq initial-window-system '(x w32 mac))))) - :initialize 'custom-initialize-safe-default - :group 'cursor - :global t - (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer)) - (if blink-cursor-timer (cancel-timer blink-cursor-timer)) - (setq blink-cursor-idle-timer nil - blink-cursor-timer nil) - (if blink-cursor-mode - (progn - ;; Hide the cursor. - ;;(internal-show-cursor nil nil) - (setq blink-cursor-idle-timer - (run-with-idle-timer blink-cursor-delay - blink-cursor-delay - 'blink-cursor-start))) - (internal-show-cursor nil t))) - -(define-obsolete-variable-alias 'blink-cursor 'blink-cursor-mode "22.1") - (defun blink-cursor-start () "Timer function called from the timer `blink-cursor-idle-timer'. This starts the timer `blink-cursor-timer', which makes the cursor blink if appropriate. It also arranges to cancel that timer when the next command starts, by installing a pre-command hook." (when (null blink-cursor-timer) - (add-hook 'pre-command-hook 'blink-cursor-end) - (internal-show-cursor nil nil) + ;; Set up the timer first, so that if this signals an error, + ;; blink-cursor-end is not added to pre-command-hook. (setq blink-cursor-timer (run-with-timer blink-cursor-interval blink-cursor-interval - 'blink-cursor-timer-function)))) + 'blink-cursor-timer-function)) + (add-hook 'pre-command-hook 'blink-cursor-end) + (internal-show-cursor nil nil))) (defun blink-cursor-timer-function () "Timer function of timer `blink-cursor-timer'." @@ -1417,10 +1387,38 @@ When run, it cancels the timer `blink-cursor-timer' and removes itself as a pre-command hook." (remove-hook 'pre-command-hook 'blink-cursor-end) (internal-show-cursor nil t) - (cancel-timer blink-cursor-timer) - (setq blink-cursor-timer nil)) + (when blink-cursor-timer + (cancel-timer blink-cursor-timer) + (setq blink-cursor-timer nil))) +(define-minor-mode blink-cursor-mode + "Toggle blinking cursor mode. +With a numeric argument, turn blinking cursor mode on iff ARG is positive. +When blinking cursor mode is enabled, the cursor of the selected +window blinks. +Note that this command is effective only when Emacs +displays through a window system, because then Emacs does its own +cursor display. On a text-only terminal, this is not implemented." + :init-value (not (or noninteractive + no-blinking-cursor + (eq system-type 'ms-dos) + (not (memq window-system '(x w32 mac))))) + :initialize 'custom-initialize-safe-default + :group 'cursor + :global t + (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer)) + (setq blink-cursor-idle-timer nil) + (blink-cursor-end) + (when blink-cursor-mode + ;; Hide the cursor. + ;;(internal-show-cursor nil nil) + (setq blink-cursor-idle-timer + (run-with-idle-timer blink-cursor-delay + blink-cursor-delay + 'blink-cursor-start)))) + +(define-obsolete-variable-alias 'blink-cursor 'blink-cursor-mode "22.1") ;; Hourglass pointer diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index beccd918c3e..6927e3bfbac 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,47 @@ +2006-08-23 Andreas Seltenreich + + [ Backported bug fix from No Gnus. ] + + * gnus.el (gnus-find-method-for-group): On killed/unknown groups, try + looking up the method using GROUP's prefix before inventing a new one. + It is used on killed/unknown groups in various places where returning + an all-new method isn't expected by the caller. + + * gnus-util.el (gnus-group-server): Copy required macro from No Gnus. + +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. + +2006-07-27 Katsumi Yamaoka + + * nnheader.el (nnheader-insert-head): Make it work even if the file + uses CRLF for the line-break code. + 2006-07-19 Andreas Seltenreich * mm-url.el (mm-url-insert-file-contents): Inhibit Connection: close diff --git a/lisp/gnus/compface.el b/lisp/gnus/compface.el index f6bd9bfd720..33e05046e84 100644 --- a/lisp/gnus/compface.el +++ b/lisp/gnus/compface.el @@ -34,24 +34,28 @@ GNU/Linux system these might be in packages with names like `compface' 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/gnus-util.el b/lisp/gnus/gnus-util.el index 6b525fc490c..6f706fabce5 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -607,6 +607,17 @@ If N, return the Nth ancestor instead." (substring gname (match-end 0)) gname))) +(defmacro gnus-group-server (group) + "Find the server name of a foreign newsgroup. +For example, (gnus-group-server \"nnimap+yxa:INBOX.foo\") would +yield \"nnimap:yxa\"." + `(let ((gname ,group)) + (if (string-match "^\\([^:+]+\\)\\(?:\\+\\([^:]*\\)\\)?:" gname) + (format "%s:%s" (match-string 1 gname) (or + (match-string 2 gname) + "")) + (format "%s:%s" (car gnus-select-method) (cadr gnus-select-method))))) + (defun gnus-make-sort-function (funs) "Return a composite sort condition based on the functions in FUNS." (cond diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 7a04c61151a..8554b1332f1 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -4079,8 +4079,13 @@ If NEWSGROUP is nil, return the global kill file name instead." (or gnus-override-method (and (not group) gnus-select-method) - (and (not (gnus-group-entry group)) ;; a new group - (gnus-group-name-to-method group)) + (and (not (gnus-group-entry group)) + ;; Killed or otherwise unknown group. + (or + ;; If we know a virtual server by that name, return its method. + (gnus-server-to-method (gnus-group-server group)) + ;; Guess a new method as last resort. + (gnus-group-name-to-method group))) (let ((info (or info (gnus-get-info group))) method) (if (or (not info) diff --git a/lisp/gnus/mm-extern.el b/lisp/gnus/mm-extern.el index c574bd6156e..f4c728541e9 100644 --- a/lisp/gnus/mm-extern.el +++ b/lisp/gnus/mm-extern.el @@ -97,7 +97,7 @@ (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 d564d42414e..82e1d3ab554 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -586,17 +586,27 @@ the line could be found." (if (eq nnheader-max-head-length t) ;; Just read the entire file. (nnheader-insert-file-contents file) - ;; Read 1K blocks until we find a separator. + ;; Read blocks of the size specified by `nnheader-head-chop-length' + ;; until we find a separator. (let ((beg 0) - format-alist) + (start (point)) + ;; Use `binary' to prevent the contents from being decoded, + ;; or it will change the number of characters that + ;; `insert-file-contents' returns. + (coding-system-for-read 'binary)) (while (and (eq nnheader-head-chop-length - (nth 1 (nnheader-insert-file-contents + (nth 1 (mm-insert-file-contents file nil beg (incf beg nnheader-head-chop-length)))) - (prog1 (not (search-forward "\n\n" nil t)) + ;; 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) - (< beg nnheader-max-head-length)))))) + (< beg nnheader-max-head-length)))) + ;; Finally decode the contents. + (when (mm-coding-system-p nnheader-file-coding-system) + (mm-decode-coding-region start (point-max) + nnheader-file-coding-system)))) t)) (defun nnheader-article-p () diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el index 7c0c8e0e444..d020d533aea 100644 --- a/lisp/gnus/nnweb.el +++ b/lisp/gnus/nnweb.el @@ -366,14 +366,15 @@ Valid types include `google', `dejanews', and `gmane'.") (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/ido.el b/lisp/ido.el index be1cba62f27..2d531728b67 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -1840,6 +1840,7 @@ If INITIAL is non-nil, it specifies the initial input string." (and d (cdr d))))))) (if (member ido-default-item ido-ignore-item-temp-list) (setq ido-default-item nil)) + (ido-trace "new default" ido-default-item) (setq ido-set-default-item nil)) (if ido-process-ignore-lists-inhibit @@ -3528,37 +3529,40 @@ for first matching file." (let* ((case-fold-search ido-case-fold) (slash (and (not ido-enable-prefix) (ido-final-slash ido-text))) (text (if slash (substring ido-text 0 -1) ido-text)) - (rexq (concat (if ido-enable-regexp text (regexp-quote text)) (if slash ".*/" ""))) + (rex0 (if ido-enable-regexp text (regexp-quote text))) + (rexq (concat rex0 (if slash ".*/" ""))) (re (if ido-enable-prefix (concat "\\`" rexq) rexq)) - (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" re)) - (concat "\\`" re "\\'"))) + (full-re (and do-full (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) + (concat "\\`" rex0 (if slash "/" "") "\\'"))) + (suffix-re (and do-full slash + (not ido-enable-regexp) (not (string-match "\$\\'" rex0)) + (concat rex0 "/\\'"))) (prefix-re (and full-re (not ido-enable-prefix) (concat "\\`" rexq))) (non-prefix-dot (or (not ido-enable-dot-prefix) (not ido-process-ignore-lists) ido-enable-prefix (= (length ido-text) 0))) - - full-matches - prefix-matches - matches) + full-matches suffix-matches prefix-matches matches) (setq ido-incomplete-regexp nil) (condition-case error (mapcar (lambda (item) (let ((name (ido-name item))) - (if (and (or non-prefix-dot - (if (= (aref ido-text 0) ?.) - (= (aref name 0) ?.) - (/= (aref name 0) ?.))) - (string-match re name)) - (cond - ((and full-re (string-match full-re name)) - (setq full-matches (cons item full-matches))) - ((and prefix-re (string-match prefix-re name)) - (setq prefix-matches (cons item prefix-matches))) - (t (setq matches (cons item matches)))))) - t) + (if (and (or non-prefix-dot + (if (= (aref ido-text 0) ?.) + (= (aref name 0) ?.) + (/= (aref name 0) ?.))) + (string-match re name)) + (cond + ((and full-re (string-match full-re name)) + (setq full-matches (cons item full-matches))) + ((and suffix-re (string-match suffix-re name)) + (setq suffix-matches (cons item suffix-matches))) + ((and prefix-re (string-match prefix-re name)) + (setq prefix-matches (cons item prefix-matches))) + (t (setq matches (cons item matches)))))) + t) items) (invalid-regexp (setq ido-incomplete-regexp t @@ -3566,10 +3570,15 @@ for first matching file." ;; special-case single match, and handle appropriately ;; elsewhere. matches (cdr error)))) - (if prefix-matches - (setq matches (nconc prefix-matches matches))) - (if full-matches - (setq matches (nconc full-matches matches))) + (when prefix-matches + (ido-trace "prefix match" prefix-matches) + (setq matches (nconc prefix-matches matches))) + (when suffix-matches + (ido-trace "suffix match" (list text suffix-re suffix-matches)) + (setq matches (nconc suffix-matches matches))) + (when full-matches + (ido-trace "full match" (list text full-re full-matches)) + (setq matches (nconc full-matches matches))) (when (and (null matches) ido-enable-flex-matching (> (length ido-text) 1) @@ -4096,12 +4105,13 @@ For details of keybindings, do `\\[describe-function] ido-find-file'." try-single-dir-match refresh) - (ido-trace "\nexhibit" this-command) - (ido-trace "dir" ido-current-directory) - (ido-trace "contents" contents) - (ido-trace "list" ido-cur-list) - (ido-trace "matches" ido-matches) - (ido-trace "rescan" ido-rescan) + (when ido-trace-enable + (ido-trace "\nexhibit" this-command) + (ido-trace "dir" ido-current-directory) + (ido-trace "contents" contents) + (ido-trace "list" ido-cur-list) + (ido-trace "matches" ido-matches) + (ido-trace "rescan" ido-rescan)) (save-excursion (goto-char (point-max)) diff --git a/lisp/info.el b/lisp/info.el index 87327d8656b..dc08557e28d 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -3805,6 +3805,8 @@ the variable `Info-file-list-for-emacs'." (setq other-tag (cond ((save-match-data (looking-back "\\