From dbc0543206eafc2e3bcad46e19629d817f496cf5 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Thu, 17 Feb 2011 16:47:29 +0900 Subject: [PATCH 01/35] Fix font-size handling bug. --- src/ChangeLog | 6 ++++++ src/font.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 68e9c76a437..6b3c5bc3ab4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-02-17 Kenichi Handa + + * font.c (font_open_entity): Be sure to set scaled_pixel_size. + (font_find_for_lface): Check if attrs[LFACE_HEIGHT_INDEX] is + integer. + 2011-02-13 Eli Zaretskii * xdisp.c (redisplay_internal): Resynchronize `w' if the selected diff --git a/src/font.c b/src/font.c index ebf0b547b9f..08309d3697b 100644 --- a/src/font.c +++ b/src/font.c @@ -3042,7 +3042,7 @@ font_open_entity (f, entity, pixel_size) Lisp_Object objlist, size, val, font_object; struct font *font; int min_width, height; - int scaled_pixel_size; + int scaled_pixel_size = pixel_size; font_assert (FONT_ENTITY_P (entity)); size = AREF (entity, FONT_SIZE_INDEX); @@ -3422,7 +3422,7 @@ font_find_for_lface (f, attrs, spec, c) XSETFRAME (frame, f); size = AREF (spec, FONT_SIZE_INDEX); pixel_size = font_pixel_size (f, spec); - if (pixel_size == 0) + if (pixel_size == 0 && INTEGERP (attrs[LFACE_HEIGHT_INDEX])) { double pt = XINT (attrs[LFACE_HEIGHT_INDEX]); From 6e7fa8e2d9458c05e2ea8dcbed74c4ed2a21c06e Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 19 Feb 2011 20:55:44 +0100 Subject: [PATCH 02/35] * tramp.texi: Use consistently "Emacs" (instead of "GNU Emacs") and "Debian GNU/Linux". * trampver.texi [xemacs]: Set emacsothername to "Emacs". --- doc/misc/ChangeLog | 7 +++++++ doc/misc/tramp.texi | 34 +++++++++++++++++----------------- doc/misc/trampver.texi | 2 +- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 8d1c5dc46ab..d2ba81618b3 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,10 @@ +2011-02-19 Michael Albinus + + * tramp.texi: Use consistently "Emacs" (instead of "GNU Emacs") and + "Debian GNU/Linux". + + * trampver.texi [xemacs]: Set emacsothername to "Emacs". + 2011-02-18 Eli Zaretskii * ada-mode.texi: Sync @dircategory with ../../info/dir. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 8a7cbf6a69d..f76df61335c 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -376,13 +376,12 @@ behind the scenes when you open a file with @value{tramp}. @cindex obtaining Tramp @value{tramp} is freely available on the Internet and the latest -release may be downloaded from -@uref{ftp://ftp.gnu.org/gnu/tramp/}. This release includes the full -documentation and code for @value{tramp}, suitable for installation. -But GNU Emacs (22 or later) includes @value{tramp} already, and there -is a @value{tramp} package for XEmacs, as well. So maybe it is easier -to just use those. But if you want the bleeding edge, read -on@dots{...} +release may be downloaded from @uref{ftp://ftp.gnu.org/gnu/tramp/}. +This release includes the full documentation and code for +@value{tramp}, suitable for installation. But Emacs (22 or later) +includes @value{tramp} already, and there is a @value{tramp} package +for XEmacs, as well. So maybe it is easier to just use those. But if +you want the bleeding edge, read on@dots{...} For the especially brave, @value{tramp} is available from CVS. The CVS version is the latest version of the code and may contain incomplete @@ -455,10 +454,10 @@ Storing files into IMAP mailboxes has been added in September 2009. @end ifset In December 2001, @value{tramp} has been added to the XEmacs package -repository. Being part of the GNU Emacs repository happened in June -2002, the first release including @value{tramp} was GNU Emacs 22.1. +repository. Being part of the Emacs repository happened in June 2002, +the first release including @value{tramp} was Emacs 22.1. -@value{tramp} is also a GNU/Linux Debian package since February 2001. +@value{tramp} is also a Debian GNU/Linux package since February 2001. @c Installation chapter is necessary only in case of standalone @@ -1762,9 +1761,10 @@ By default, this is set to a reasonable set of defaults for most machines. The symbol @code{tramp-default-remote-path} is a place holder, it is replaced by the list of directories received via the command @command{getconf PATH} on your remote machine. For example, -on GNU Debian this is @file{/bin:/usr/bin}, whereas on Solaris this is -@file{/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin}. It is -recommended to apply this symbol on top of @code{tramp-remote-path}. +on Debian GNU/Linux this is @file{/bin:/usr/bin}, whereas on Solaris +this is @file{/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin}. +It is recommended to apply this symbol on top of +@code{tramp-remote-path}. It is possible, however, that your local (or remote ;) system administrator has put the tools you want in some obscure local @@ -2757,8 +2757,8 @@ There is also a Savannah project page. @item Which systems does it work on? -The package has been used successfully on GNU Emacs 22, GNU Emacs 23, -XEmacs 21 (starting with 21.4), and SXEmacs 22. +The package has been used successfully on Emacs 22, Emacs 23, XEmacs +21 (starting with 21.4), and SXEmacs 22. The package was intended to work on Unix, and it really expects a Unix-like system on the remote end (except the @option{smb} and @@ -3597,9 +3597,9 @@ printed and deleted. But I have decided that this is too fragile to reliably work, so on some systems you'll have to do without the uuencode methods. -@item The @value{tramp} filename syntax differs between GNU Emacs and XEmacs. +@item The @value{tramp} filename syntax differs between Emacs and XEmacs. -The GNU Emacs maintainers wish to use a unified filename syntax for +The Emacs maintainers wish to use a unified filename syntax for Ange-FTP and @value{tramp} so that users don't have to learn a new syntax. It is sufficient to learn some extensions to the old syntax. diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index 3cde3eb4bfc..1cfcba637ae 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi @@ -70,7 +70,7 @@ @set postfixhop / @set ipv6prefix @set ipv6postfix -@set emacsothername GNU Emacs +@set emacsothername Emacs @set emacsotherdir emacs @set emacsotherfilename tramp-emacs.html @set japanesemanual tramp_ja-xemacs.html From 47301027bbbbd1babcfedf1ef38b2c776b33c462 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 19 Feb 2011 13:20:34 -0800 Subject: [PATCH 03/35] doc/misc minor stylistic changes. * doc/misc/edt.texi, erc.texi, gnus.texi, idlwave.texi, mh-e.texi: Standardize some Emacs/XEmacs terminology. --- doc/misc/ChangeLog | 5 +++++ doc/misc/edt.texi | 30 +++++++++++++++--------------- doc/misc/erc.texi | 2 +- doc/misc/gnus.texi | 4 ++-- doc/misc/idlwave.texi | 2 +- doc/misc/mh-e.texi | 6 +++--- 6 files changed, 27 insertions(+), 22 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index d2ba81618b3..1f153db305f 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,8 @@ +2011-02-19 Glenn Morris + + * edt.texi, erc.texi, gnus.texi, idlwave.texi, mh-e.texi: + Standardize some Emacs/XEmacs terminology. + 2011-02-19 Michael Albinus * tramp.texi: Use consistently "Emacs" (instead of "GNU Emacs") and diff --git a/doc/misc/edt.texi b/doc/misc/edt.texi index d5a28481352..68c2db73361 100644 --- a/doc/misc/edt.texi +++ b/doc/misc/edt.texi @@ -88,7 +88,7 @@ informing you that the emulation has been enabled: ``Default EDT keymap active''. You can have the EDT Emulation start up automatically, each time you -initiate a GNU Emacs session, by adding the following line to your +initiate an Emacs session, by adding the following line to your @file{.emacs} file: @example @@ -219,7 +219,7 @@ user quits without saving those buffers. @item Emulate EDT Keypad Mode commands closely so that current EDT users will -find that it easy and comfortable to use GNU Emacs with a small learning +find that it easy and comfortable to use Emacs with a small learning curve. @item @@ -238,7 +238,7 @@ Provide an easy way to restore @strong{all} original Emacs key bindings, just as they existed before the EDT emulation was first invoked. @item -Support GNU Emacs 19 and higher. XEmacs 19, and above, is also supported. +Support Emacs and XEmacs 19 and higher. @item Supports highlighting of marked text within the EDT emulation on all @@ -286,13 +286,13 @@ apply to you. @node Starting emulation @chapter How to Get Started -Start up GNU Emacs and enter @kbd{M-x edt-emulation-on} to begin the +Start up Emacs and enter @kbd{M-x edt-emulation-on} to begin the emulation. After initialization is complete, the following message will appear below the status line informing you that the emulation has been enabled: ``Default EDT keymap active''. You can have the EDT Emulation start up automatically, each time you -initiate a GNU Emacs session, by adding the following line to your +initiate an Emacs session, by adding the following line to your @file{.emacs} file: @example @@ -307,7 +307,7 @@ in the EDT Default Mode). It is easy to customize key bindings in the EDT Emulation (@pxref{Customizing}). Customizations are placed in a file called @file{edt-user.el}. The Emacs @file{etc/} directory contains an -example. If @file{edt-user.el} is found in your GNU Emacs load path +example. If @file{edt-user.el} is found in your Emacs load path during EDT Emulation initialization, then the following message will appear below the status line indicating that the emulation has been enabled, enhanced by your own customizations: ``User EDT custom keymap @@ -322,8 +322,8 @@ restores the original key bindings in effect just prior to invoking the emulation. Emacs binds keys to @acronym{ASCII} control characters and so does the -real EDT. Where EDT key bindings and GNU Emacs key bindings conflict, -the default GNU Emacs key bindings are retained by the EDT emulation by +real EDT. Where EDT key bindings and Emacs key bindings conflict, +the default Emacs key bindings are retained by the EDT emulation by default. If you are a diehard EDT user you may not like this. The @ref{Control keys} section explains how to change this so that the EDT bindings to @acronym{ASCII} control characters override the default @@ -365,7 +365,7 @@ older SunOS release configured with a Sun Type 5 keyboard: @example ! File: .xmodmaprc ! -! Set up Sun Type 5 keypad for use with the GNU Emacs EDT Emulation +! Set up Sun Type 5 keypad for use with the Emacs EDT Emulation ! keycode 53 = KP_Divide keycode 54 = KP_Multiply @@ -437,7 +437,7 @@ things up nicely. @example ! File: .xmodmaprc ! -! Set up PC keypad under GNU/Linux for the GNU Emacs EDT Emulation +! Set up PC keypad under GNU/Linux for the Emacs EDT Emulation ! clear mod2 keycode 77 = F12 @@ -519,7 +519,7 @@ assign Num_Lock back to mod2. @example ! File: .xmodmaprc ! -! Set up PC keypad under GNU/Linux for the GNU Emacs EDT Emulation +! Set up PC keypad under GNU/Linux for the Emacs EDT Emulation ! clear mod2 keycode 77 = F12 @@ -542,7 +542,7 @@ In general, you will find that this emulation of EDT replicates most, but not all, of EDT's most used Keypad Mode editing functions and behavior. It is not perfect, but most EDT users who have tried the emulation agree that it is quite good enough to make it easy for -die-hard EDT users to move over to using GNU Emacs. +die-hard EDT users to move over to using Emacs. Here's a list of the most important differences between EDT and this GNU Emacs EDT Emulation. The list is short but you must be aware of these @@ -784,7 +784,7 @@ terminals on the same system, you need not look at @file{edt-user.el2}. @end ignore First, you need to have your own private lisp directory, say -@file{~/lisp}, and you should add it to the GNU Emacs load path. +@file{~/lisp}, and you should add it to the Emacs load path. @strong{Please note:} A few sites have different load-path requirements, so the above directions may need some modification if your site has such @@ -899,8 +899,8 @@ Here are some examples: @node Control keys @section Enabling EDT Control Key Sequence Bindings -Where EDT key bindings and GNU Emacs key bindings conflict, the default -GNU Emacs key bindings are retained by default. Some diehard EDT users +Where EDT key bindings and Emacs key bindings conflict, the default +Emacs key bindings are retained by default. Some diehard EDT users may not like this. So, if the variable @code{edt-use-EDT-control-key-bindings} is set to true in a user's @file{.emacs} file, then the default EDT Emulation mode will enable most diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 8056845e4d3..aa7cb893fd7 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -36,7 +36,7 @@ and modified without restriction. @titlepage @title ERC manual @subtitle a full-featured IRC client -@subtitle for GNU Emacs and XEmacs +@subtitle for Emacs and XEmacs @c The following two commands @c start the copyright page. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index 6cd603d9d0a..a3b5ddde4a1 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -23156,7 +23156,7 @@ variables should be either strings or symbols naming functions that return a string. When the mouse passes over text with this property set, a balloon window will appear and display the string. Please refer to @ref{Tooltips, ,Tooltips, emacs, The Emacs Manual}, -(in GNU Emacs) or the doc string of @code{balloon-help-mode} (in +(in Emacs) or the doc string of @code{balloon-help-mode} (in XEmacs) for more information on this. (For technical reasons, the guillemets have been approximated as @samp{<<} and @samp{>>} in this paragraph.) @@ -28476,7 +28476,7 @@ to install Gnus after compiling it, give @file{make.bat} @code{/copy} as the second parameter. @file{make.bat} has been rewritten from scratch, it now features -automatic recognition of XEmacs and GNU Emacs, generates +automatic recognition of XEmacs and Emacs, generates @file{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 @code{makeinfo} if it is available and falls diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index 02924d7472f..54088cef210 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi @@ -4275,7 +4275,7 @@ browse-url-browser-function} or similar when attempting to load IDLWAVE under XEmacs.} You don't have the @samp{browse-url} (or other required) XEmacs package. -Unlike GNU Emacs, XEmacs distributes many packages separately from the +Unlike Emacs, XEmacs distributes many packages separately from the main program. IDLWAVE is actually among these, but is not always the most up to date. When installing IDLWAVE as an XEmacs package, it should prompt you for required additional packages. When installing it diff --git a/doc/misc/mh-e.texi b/doc/misc/mh-e.texi index a0ab0d7a4f9..17594701997 100644 --- a/doc/misc/mh-e.texi +++ b/doc/misc/mh-e.texi @@ -212,9 +212,9 @@ However, MH-E was the tip of the iceberg, and I discovered more and more niceties about GNU Emacs and MH@. Now I'm fully hooked on both of them. -The MH-E package is distributed with GNU Emacs@footnote{Version -@value{VERSION} of MH-E appeared in GNU Emacs 23.1. It is supported -in GNU Emacs 21 and 22, as well as XEmacs 21 (except for versions +The MH-E package is distributed with Emacs@footnote{Version +@value{VERSION} of MH-E appeared in Emacs 23.1. It is supported +in Emacs 21 and 22, as well as XEmacs 21 (except for versions 21.5.9-21.5.16). It is compatible with MH versions 6.8.4 and higher, all versions of nmh, and GNU mailutils 1.0 and higher.}, so you shouldn't have to do anything special to use it. Gnus is also From 1f459fa46cbd419bc55f8be03bce617d96af4da5 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 22 Feb 2011 09:19:08 +0900 Subject: [PATCH 04/35] Decode "encoded-words" of header components on replying. --- lisp/ChangeLog | 5 +++++ lisp/mail/rmail.el | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9d8446cef10..65b4ec8d400 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-02-21 Kenichi Handa + + * mail/rmail.el (rmail-start-mail): Decode "encoded-words" of + header components. + 2011-02-14 Chong Yidong * pgg-gpg.el (pgg-gpg-process-region): Bind diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 370999dabf8..94f5ce45054 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -3449,6 +3449,16 @@ does not pop any summary buffer." (setq yank-action (list 'insert-buffer replybuffer))) (setq others (cons (cons "cc" cc) others)) (setq others (cons (cons "in-reply-to" in-reply-to) others)) + (setq others + (mapcar #'(lambda (elt) + (cons (car elt) (if (stringp (cdr elt)) + (rfc2047-decode-string (cdr elt))))) + others)) + (if (stringp to) (setq to (rfc2047-decode-string to))) + (if (stringp in-reply-to) + (setq in-reply-to (rfc2047-decode-string in-reply-to))) + (if (stringp cc) (setq cc (rfc2047-decode-string cc))) + (if (stringp subject) (setq subject (rfc2047-decode-string subject))) (if same-window (compose-mail to subject others noerase nil From 31fdb5440874d2fa9fd6e8458dda6f508275fec6 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Tue, 22 Feb 2011 02:04:16 +0100 Subject: [PATCH 05/35] admin/notes/bugtracker (bugtracker_debbugs_url): Fix typo. --- admin/ChangeLog | 4 ++++ admin/notes/bugtracker | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/admin/ChangeLog b/admin/ChangeLog index 33b091ba0b9..d0e7b78f2e8 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,7 @@ +2011-02-22 Juanma Barranquero + + * notes/bugtracker (bugtracker_debbugs_url): Fix typo. + 2011-01-03 Glenn Morris * admin.el (set-copyright): Also handle \year in refcards/*.tex. diff --git a/admin/notes/bugtracker b/admin/notes/bugtracker index ca71214cdcc..204948261ba 100644 --- a/admin/notes/bugtracker +++ b/admin/notes/bugtracker @@ -459,7 +459,7 @@ Here "{id}" is a literal string, a placeholder that will be replaced by the bug number you specify after `--fixes debbugs:' in the bzr command line (123 in the example above). -In the bazaar.conf file, this setting should go into the [DEFAULTS] +In the bazaar.conf file, this setting should go into the [DEFAULT] section. In the locations.conf file, it should go into the branch-specific From 251ebe0f6446248399e2820a291365a33f0ead8b Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 22 Feb 2011 10:49:06 +0900 Subject: [PATCH 06/35] In rmail, decode "encoded-words" of header components on replying. --- lisp/ChangeLog | 5 +++++ lisp/mail/rmail.el | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e0c9f552c9f..a70330d1022 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-02-22 Kenichi Handa + + * mail/rmail.el (rmail-start-mail): Decode "encoded-words" of + header components. + 2011-02-19 Kenichi Handa * mail/rmailmm.el (rmail-mime-find-header-encoding): Be sure to diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index fc4b642e8bb..5e9baed1c2e 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -3449,6 +3449,16 @@ does not pop any summary buffer." (setq yank-action (list 'insert-buffer replybuffer))) (setq others (cons (cons "cc" cc) others)) (setq others (cons (cons "in-reply-to" in-reply-to) others)) + (setq others + (mapcar #'(lambda (elt) + (cons (car elt) (if (stringp (cdr elt)) + (rfc2047-decode-string (cdr elt))))) + others)) + (if (stringp to) (setq to (rfc2047-decode-string to))) + (if (stringp in-reply-to) + (setq in-reply-to (rfc2047-decode-string in-reply-to))) + (if (stringp cc) (setq cc (rfc2047-decode-string cc))) + (if (stringp subject) (setq subject (rfc2047-decode-string subject))) (if same-window (compose-mail to subject others noerase nil From e3b300a497971596f3cc6c0f3eb187c903d43dd0 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 22 Feb 2011 10:58:03 +0900 Subject: [PATCH 07/35] Fix font size handling. --- src/ChangeLog | 6 ++++++ src/font.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3a356bb81aa..f9c15811547 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-02-22 Kenichi Handa + + * font.c (font_open_entity): Be sure to set scaled_pixel_size. + (font_find_for_lface): Check if attrs[LFACE_HEIGHT_INDEX] is + integer. + 2011-02-19 Chong Yidong * Makefile.in (prefix-args${EXEEXT}): Compile with ALL_CFLAGS. diff --git a/src/font.c b/src/font.c index ebf0b547b9f..08309d3697b 100644 --- a/src/font.c +++ b/src/font.c @@ -3042,7 +3042,7 @@ font_open_entity (f, entity, pixel_size) Lisp_Object objlist, size, val, font_object; struct font *font; int min_width, height; - int scaled_pixel_size; + int scaled_pixel_size = pixel_size; font_assert (FONT_ENTITY_P (entity)); size = AREF (entity, FONT_SIZE_INDEX); @@ -3422,7 +3422,7 @@ font_find_for_lface (f, attrs, spec, c) XSETFRAME (frame, f); size = AREF (spec, FONT_SIZE_INDEX); pixel_size = font_pixel_size (f, spec); - if (pixel_size == 0) + if (pixel_size == 0 && INTEGERP (attrs[LFACE_HEIGHT_INDEX])) { double pt = XINT (attrs[LFACE_HEIGHT_INDEX]); From 7dde5efea355c6d1d49f35f5fa58f283ed18a044 Mon Sep 17 00:00:00 2001 From: Sam Steingold Date: Tue, 22 Feb 2011 15:08:00 -0500 Subject: [PATCH 08/35] * lisp/gnus/gnus-msg.el (gnus-setup-message): Also bind `winconf-name'. --- lisp/gnus/ChangeLog | 4 ++++ lisp/gnus/gnus-msg.el | 1 + 2 files changed, 5 insertions(+) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 3695b94b510..fae73613d1f 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,7 @@ +2011-02-22 Sam Steingold + + * gnus-msg.el (gnus-setup-message): Also bind `winconf-name'. + 2011-02-22 Lars Ingebrigtsen * gnus-msg.el (gnus-inews-add-send-actions): Restore the winconf name diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 29ac43115c8..4e88b871ac0 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -383,6 +383,7 @@ Thank you for your help in stamping out bugs. (defvar gnus-article-reply nil) (defmacro gnus-setup-message (config &rest forms) (let ((winconf (make-symbol "gnus-setup-message-winconf")) + (winconf-name (make-symbol "gnus-setup-message-winconf")) (buffer (make-symbol "gnus-setup-message-buffer")) (article (make-symbol "gnus-setup-message-article")) (yanked (make-symbol "gnus-setup-yanked-articles")) From c1449bffe23febaed03c89eaffce7f3ec5d88cce Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 23 Feb 2011 11:32:35 +0900 Subject: [PATCH 09/35] mail/rmailmm.el (rmail-mime-process-multipart): Do not signal an error when a multipart boundary in the nested multipart is found. --- lisp/ChangeLog | 5 +++++ lisp/mail/rmailmm.el | 43 ++++++++++++++++++++++++------------------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a70330d1022..75010513c12 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-02-23 Kenichi Handa + + * mail/rmailmm.el (rmail-mime-process-multipart): Do not signal an + error when a multipart boundary in the nested multipart is found. + 2011-02-22 Kenichi Handa * mail/rmail.el (rmail-start-mail): Decode "encoded-words" of diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el index e44dd877e4f..4aa3e81132f 100644 --- a/lisp/mail/rmailmm.el +++ b/lisp/mail/rmailmm.el @@ -852,28 +852,33 @@ The other arguments are the same as `rmail-mime-multipart-handler'." ((looking-at "[ \t]*\n") (setq next (copy-marker (match-end 0) t))) (t - (rmail-mm-get-boundary-error-message - "Malformed boundary" content-type content-disposition - content-transfer-encoding))) + ;; The original code signalled an error as below, but + ;; this line may be a boundary of nested multipart. So, + ;; we just set `next' to nil to skip this line + ;; (rmail-mm-get-boundary-error-message + ;; "Malformed boundary" content-type content-disposition + ;; content-transfer-encoding) + (setq next nil))) - (setq index (1+ index)) - ;; Handle the part. - (if parse-tag + (when next + (setq index (1+ index)) + ;; Handle the part. + (if parse-tag + (save-restriction + (narrow-to-region beg end) + (let ((child (rmail-mime-process + nil (format "%s/%d" parse-tag index) + content-type content-disposition))) + ;; Display a tagline. + (aset (aref (rmail-mime-entity-display child) 1) 1 + (aset (rmail-mime-entity-tagline child) 2 t)) + (push child entities))) + + (delete-region end next) (save-restriction (narrow-to-region beg end) - (let ((child (rmail-mime-process - nil (format "%s/%d" parse-tag index) - content-type content-disposition))) - ;; Display a tagline. - (aset (aref (rmail-mime-entity-display child) 1) 1 - (aset (rmail-mime-entity-tagline child) 2 t)) - (push child entities))) - - (delete-region end next) - (save-restriction - (narrow-to-region beg end) - (rmail-mime-show))) - (goto-char (setq beg next))) + (rmail-mime-show))) + (goto-char (setq beg next)))) (when parse-tag (setq entities (nreverse entities)) From 5582c6706a68bca9cc9a1215f257cc3fbe573c9a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 22 Feb 2011 19:24:23 -0800 Subject: [PATCH 10/35] * lisp/files.el (safe-local-eval-forms): Add the write-file-hooks version. This obsolete form is still supported, and present in some of the files synced from gnulib, for example. --- lisp/ChangeLog | 4 ++++ lisp/files.el | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c817a59a03a..5102204b571 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-02-23 Glenn Morris + + * files.el (safe-local-eval-forms): Add the write-file-hooks version. + 2011-02-22 Stefan Monnier * help-fns.el (describe-function-1): Don't signal an error just because diff --git a/lisp/files.el b/lisp/files.el index 014469ed8fc..3409ebe02e1 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2806,7 +2806,9 @@ symbol and VAL is a value that is considered safe." :type 'alist) (defcustom safe-local-eval-forms - '((add-hook 'write-file-functions 'time-stamp) + ;; This should be here at least as long as Emacs supports write-file-hooks. + '((add-hook 'write-file-hooks 'time-stamp) + (add-hook 'write-file-functions 'time-stamp) (add-hook 'before-save-hook 'time-stamp)) "Expressions that are considered safe in an `eval:' local variable. Add expressions to this list if you want Emacs to evaluate them, when @@ -2814,7 +2816,7 @@ they appear in an `eval' local variable specification, without first asking you for confirmation." :risky t :group 'find-file - :version "22.2" + :version "24.1" ; added write-file-hooks :type '(repeat sexp)) ;; Risky local variables: From 51a13bdd9324860db6381e6da121411467087bec Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 22 Feb 2011 19:32:42 -0800 Subject: [PATCH 11/35] * doc/misc/dired-x.texi (Features, Local Variables): Fix typos. (Features): Minor rephrasing. --- doc/misc/ChangeLog | 5 +++++ doc/misc/dired-x.texi | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 1f153db305f..a822338225a 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,8 @@ +2011-02-23 Glenn Morris + + * dired-x.texi (Features, Local Variables): Fix typos. + (Features): Minor rephrasing. + 2011-02-19 Glenn Morris * edt.texi, erc.texi, gnus.texi, idlwave.texi, mh-e.texi: diff --git a/doc/misc/dired-x.texi b/doc/misc/dired-x.texi index fada13faf15..2a49390041a 100644 --- a/doc/misc/dired-x.texi +++ b/doc/misc/dired-x.texi @@ -145,12 +145,12 @@ Guessing shell commands in Dired buffers. @xref{Shell Command Guessing}. @end itemize @item -Running Dired command in non-Dired buffers. +Running Dired commands in non-Dired buffers. @itemize @bullet @xref{Virtual Dired}. @end itemize @item -Finding a file mentioned in a buffer +Finding a file mentioned in a buffer. @itemize @bullet @xref{Find File At Point}. @end itemize @@ -164,10 +164,10 @@ Commands using file marking. @noindent @file{dired-x.el} binds some functions to keys in Dired Mode (@pxref{Key Index}) and also binds @kbd{C-x C-j} and @kbd{C-x 4 C-j} @emph{globally} to -@code{dired-jump} (@pxref{Miscellaneous Commands}). It may also bind @kbd{C-x -C-f} and @kbd{C-x 4 C-f} to @code{dired-x-find-file} and -@code{dired-x-find-file-other-window}, respectively (@pxref{Find File At -Point}). +@code{dired-jump} (@pxref{Miscellaneous Commands}). Optionally, it +also binds @kbd{C-x C-f} and @kbd{C-x 4 C-f} to +@code{dired-x-find-file} and @code{dired-x-find-file-other-window}, +respectively (@pxref{Find File At Point}). @node Technical Details, , Features, Introduction @section Technical Details @@ -548,7 +548,7 @@ omitted automatically @noindent You can set @code{dired-local-variables-file} to @code{nil} to suppress this. The value of @code{dired-enable-local-variables} controls if and how these -local variables are read. This variable exists so that if may override the +local variables are read. This variable exists so that it may override the default value of @code{enable-local-variables}. @noindent From 817b48a7bccb820203ae424aa14c559259a4f355 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 22 Feb 2011 19:44:13 -0800 Subject: [PATCH 12/35] Obsolete dired-x's directory local variables in favor of standard ones. * lisp/dired.el (dired-mode): Call hack-dir-local-variables-non-file-buffer. * lisp/dired-x.el (dired-omit-mode): Safe if boolean. (dired-enable-local-variables): Fix doc and custom type. Mark risky. (dired-enable-local-variables, dired-local-variables-file) (dired-hack-local-variables): Make obsolete. (dired-omit-here-always): Use dir-locals.el instead. * doc/misc/dired-x.texi (Features): Don't advertise obsolete local variables. Simplify layout. (Omitting Variables): Update local variables example. (Local Variables): Say this is obsolete. Fix description of dired-enable-local-variables possible values. * etc/NEWS: Relocate the existing entry about directory local variables in file-les buffers, and make it clearer. Mention above dired changes. --- doc/misc/ChangeLog | 8 +++++ doc/misc/dired-x.texi | 77 +++++++++++++++++-------------------------- etc/NEWS | 12 +++++-- lisp/ChangeLog | 7 ++++ lisp/dired-x.el | 74 ++++++++++++++++++++++++----------------- lisp/dired.el | 3 +- 6 files changed, 101 insertions(+), 80 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 217702b7c0f..67197450a5b 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,11 @@ +2011-02-23 Glenn Morris + + * dired-x.texi (Features): Don't advertise obsolete local variables. + Simplify layout. + (Omitting Variables): Update local variables example. + (Local Variables): Say this is obsolete. Fix description of + dired-enable-local-variables possible values. + 2011-02-21 Lars Ingebrigtsen * gnus.texi (Article Date): Clarify gnus-article-update-date-headers. diff --git a/doc/misc/dired-x.texi b/doc/misc/dired-x.texi index 003046d5a7c..f7c73237249 100644 --- a/doc/misc/dired-x.texi +++ b/doc/misc/dired-x.texi @@ -129,39 +129,24 @@ original @file{dired-x.el}). @section Features @cindex Features -Some features provided by Dired Extra +Some features provided by Dired Extra: @enumerate @item -Omitting uninteresting files from Dired listing. -@itemize @bullet -@xref{Omitting Files in Dired}. -@end itemize +Omitting uninteresting files from Dired listing +(@pxref{Omitting Files in Dired}). @item -Local variables for Dired directories. -@itemize @bullet -@xref{Local Variables}. -@end itemize +Guessing shell commands in Dired buffers +(@pxref{Shell Command Guessing}). @item -Guessing shell commands in Dired buffers. -@itemize @bullet -@xref{Shell Command Guessing}. -@end itemize -@item -Running Dired command in non-Dired buffers. -@itemize @bullet -@xref{Virtual Dired}. -@end itemize +Running Dired command in non-Dired buffers +(@pxref{Virtual Dired}). @item Finding a file mentioned in a buffer -@itemize @bullet -@xref{Find File At Point}. -@end itemize +(@pxref{Find File At Point}). @item -Commands using file marking. -@itemize @bullet -@xref{Advanced Mark Commands}. -@end itemize +Commands using file marking +(@pxref{Advanced Mark Commands}). @end enumerate @noindent @@ -351,27 +336,25 @@ inside your @code{dired-mode-hook} to have omitting initially turned on in @emph{every} Dired buffer (@pxref{Installation}). You can then use @kbd{M-o} to unomit in that buffer. -To enable omitting automatically only in certain directories one can use Dired -Local Variables and put +To enable omitting automatically only in certain directories you can add +a directory local setting +(@pxref{Directory Variables,,,emacs,The Gnu Emacs manual}) for Dired mode @example -Local Variables: -dired-omit-mode: t -End: +((dired-mode . ((dired-omit-mode . t)))) @end example @noindent -into a file @file{.dired} (the default value of -@code{dired-local-variables-file}) in that directory (@pxref{Local Variables}). +to a @file{.dir-locals.el} file in that directory. @table @code @findex dired-omit-here-always @item dired-omit-here-always This is an interactive function that creates a local variables file exactly -like the example above (if it does not already exist) in the file -@code{dired-local-variables-file} in the current directory and then refreshes -the directory listing (@pxref{Local Variables}). +like the example above (if it does not already exist) in the +@code{dir-locals-file} file in the current directory and then refreshes +the directory listing. @end table @vindex dired-omit-files @@ -490,7 +473,6 @@ Loading @file{dired-x.el} will install Dired Omit by putting call @code{dired-extra-startup}, which in turn calls @code{dired-omit-startup} in your @code{dired-mode-hook}. -@c FIXME does the standard dir-locals mechanism obsolete this? @node Local Variables, Shell Command Guessing, Omitting Files in Dired, Top @chapter Local Variables for Dired Directories @@ -498,10 +480,15 @@ in your @code{dired-mode-hook}. @vindex dired-local-variables-file @vindex dired-enable-local-variables @noindent -When Dired visits a directory, it looks for a file whose name is the value of -variable @code{dired-local-variables-file} (default: @file{.dired}). If such -a file is found, Dired will temporarily insert it into the Dired buffer and -run @code{hack-local-variables}. +This Dired-X feature is obsolete as of Emacs 24.1. The standard Emacs +directory local variables mechanism (@pxref{Directory +Variables,,,emacs,The Gnu Emacs manual}) replaces it. For an example of +the new mechanims, @pxref{Omitting Variables}. + +When Dired visits a directory, it looks for a file whose name is the +value of variable @code{dired-local-variables-file} (default: @file{.dired}). +If such a file is found, Dired will temporarily insert it into the Dired +buffer and run @code{hack-local-variables}. @noindent For example, if the user puts @@ -551,12 +538,10 @@ into the Dired buffer and run @code{hack-local-variables}. @item dired-enable-local-variables Default: @code{t} -Controls the use of local-variables lists in Dired. The value can be @code{t}, -@code{nil}, or something else. A value of @code{t} means local-variables -lists are obeyed in the @code{dired-local-variables-file}; @code{nil} means -they are ignored; anything else means query. This variable temporarily -overrides the value of @code{enable-local-variables} when the Dired Local -Variables are hacked. +Controls the use of local-variables lists in Dired. This variable +temporarily overrides the value of @code{enable-local-variables} when +the Dired Local Variables are hacked. It takes the same values as that +variable. A value of @code{nil} means to ignore any Dired Local Variables. @end table @node Shell Command Guessing, Virtual Dired, Local Variables, Top diff --git a/etc/NEWS b/etc/NEWS index 96cc97ac795..9119fa3b8e1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -347,6 +347,12 @@ Just set shell-dir-cookie-re to an appropriate regexp. ** browse-url has gotten a new variable that is used for mailto: URLs, `browse-url-mailto-function', which defaults to `browse-url-mail'. +** Directory local variables can apply to file-less buffers, in certain modes +(eg dired, vc-dir, log-edit). For example, adding +"(diff-mode . ((mode . whitespace)))" to your .dir-locals.el file, +will turn on `whitespace-mode' for *vc-diff* buffers. Modes should +call `hack-dir-local-variables-non-file-buffer' to support this. + ** ERC changes *** New vars `erc-autojoin-timing' and `erc-autojoin-delay'. @@ -412,9 +418,9 @@ choose a color via list-colors-display. *** dired-jump and dired-jump-other-window called with a prefix argument read a file name from the minibuffer instead of using buffer-file-name. -** Directory local variables can apply to file-less buffers. -For example, adding "(diff-mode . ((mode . whitespace)))" to your -.dir-locals.el file, will turn on `whitespace-mode' for *vc-diff* buffers. ++++ +*** The `dired local variables' feature provided by Dired-x is obsolete. +The standard directory local variables feature replaces it. ** SQL Mode enhancements. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5102204b571..14ef035445a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,12 @@ 2011-02-23 Glenn Morris + * dired.el (dired-mode): Call hack-dir-local-variables-non-file-buffer. + * dired-x.el (dired-omit-mode): Safe if boolean. + (dired-enable-local-variables): Fix doc and custom type. + (dired-enable-local-variables, dired-local-variables-file) + (dired-hack-local-variables): Make obsolete. + (dired-omit-here-always): Use dir-locals.el instead. + * files.el (safe-local-eval-forms): Add the write-file-hooks version. 2011-02-22 Stefan Monnier diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 8b1dbb1ef83..dcf8906976b 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -145,6 +145,8 @@ See Info node `(dired-x) Omitting Variables' for more information." (let ((dired-omit-size-limit nil)) (dired-omit-expunge)) (revert-buffer))) +(put 'dired-omit-mode 'safe-local-variable 'booleanp) + ;; For backward compatibility (define-obsolete-variable-alias 'dired-omit-files-p 'dired-omit-mode "22.1") @@ -185,15 +187,19 @@ If nil, there is no maximum size." (defcustom dired-enable-local-variables t "Control use of local-variables lists in Dired. -The value can be t, nil or something else. -A value of t means local-variables lists are obeyed; -nil means they are ignored; anything else means query. - This temporarily overrides the value of `enable-local-variables' when listing a directory. See also `dired-local-variables-file'." - :type 'boolean + :risky t + :type '(choice (const :tag "Query Unsafe" t) + (const :tag "Safe Only" :safe) + (const :tag "Do all" :all) + (const :tag "Ignore" nil) + (other :tag "Query" other)) :group 'dired-x) +(make-obsolete-variable 'dired-enable-local-variables + "use a standard `dir-locals-file' instead." "24.1") + (defcustom dired-guess-shell-gnutar (catch 'found (dolist (exe '("tar" "gtar")) @@ -723,26 +729,25 @@ Knows about the special cases in variable `dired-default-directory-alist'." ;;; LOCAL VARIABLES FOR DIRED BUFFERS. -;; Brief Description: -;;; +;; Brief Description (This feature is obsolete as of Emacs 24.1) +;; ;; * `dired-extra-startup' is part of the `dired-mode-hook'. -;;; +;; ;; * `dired-extra-startup' calls `dired-hack-local-variables' -;;; +;; ;; * `dired-hack-local-variables' checks the value of -;;; `dired-local-variables-file' -;;; +;; `dired-local-variables-file' +;; ;; * Check if `dired-local-variables-file' is a non-nil string and is a -;;; filename found in the directory of the Dired Buffer being created. -;;; +;; filename found in the directory of the Dired Buffer being created. +;; ;; * If `dired-local-variables-file' satisfies the above, then temporarily -;;; include it in the Dired Buffer at the bottom. -;;; +;; include it in the Dired Buffer at the bottom. +;; ;; * Set `enable-local-variables' temporarily to the user variable -;;; `dired-enable-local-variables' and run `hack-local-variables' on the -;;; Dired Buffer. +;; `dired-enable-local-variables' and run `hack-local-variables' on the +;; Dired Buffer. -;; FIXME do standard dir-locals obsolete this? (defcustom dired-local-variables-file (convert-standard-filename ".dired") "Filename, as string, containing local dired buffer variables to be hacked. If this file found in current directory, then it will be inserted into dired @@ -752,6 +757,8 @@ See also `dired-enable-local-variables'." :type 'file :group 'dired) +(make-obsolete-variable 'dired-local-variables-file 'dir-locals-file "24.1") + (defun dired-hack-local-variables () "Evaluate local variables in `dired-local-variables-file' for dired buffer." (and (stringp dired-local-variables-file) @@ -774,22 +781,29 @@ See also `dired-enable-local-variables'." ;; Delete this stuff: `eobp' is used to find last subdir by dired.el. (delete-region opoint (point-max))))) +(make-obsolete 'dired-hack-local-variables + 'hack-dir-local-variables-non-file-buffer "24.1") + +;; Not sure this is worth having a dedicated command for... (defun dired-omit-here-always () - "Create `dired-local-variables-file' for omitting and reverts directory. -Sets `dired-omit-mode' to t in a local variables file that is readable by -dired." + "Create `dir-locals-file' setting `dired-omit-mode' to t in `dired-mode'. +If in a Dired buffer, reverts it." (interactive) (if (file-exists-p dired-local-variables-file) - (message "File `./%s' already exists." dired-local-variables-file) - ;; Create `dired-local-variables-file'. - (with-current-buffer (get-buffer-create " *dot-dired*") - (erase-buffer) - (insert "Local Variables:\ndired-omit-mode: t\nEnd:\n") - (write-file dired-local-variables-file) - (kill-buffer)) + (error "Old-style dired-local-variables-file `./%s' found; +replace it with a dir-locals-file `./%s'" + dired-local-variables-file + dir-locals-file)) + (if (file-exists-p dir-locals-file) + (message "File `./%s' already exists." dir-locals-file) + (with-temp-buffer + (insert "((dired-mode . ((dired-omit-mode . t))))\n") + (write-file dir-locals-file)) ;; Run extra-hooks and revert directory. - (dired-extra-startup) - (dired-revert))) + (when (derived-mode-p 'dired-mode) + (hack-dir-local-variables-non-file-buffer) + (dired-extra-startup) + (dired-revert)))) ;;; GUESS SHELL COMMAND. diff --git a/lisp/dired.el b/lisp/dired.el index 910d59f2cce..3f31ba58139 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1860,6 +1860,7 @@ Keybindings: (set (make-local-variable 'desktop-save-buffer) 'dired-desktop-buffer-misc-data) (setq dired-switches-alist nil) + (hack-dir-local-variables-non-file-buffer) ; before sorting (dired-sort-other dired-actual-switches t) (when (featurep 'dnd) (set (make-local-variable 'dnd-protocol-alist) @@ -4072,7 +4073,7 @@ true then the type of the file linked to by FILE is printed instead. ;;;*** ;;;### (autoloads (dired-do-relsymlink dired-jump) "dired-x" "dired-x.el" -;;;;;; "86d436093caa9ae80f7b73915c6a4b4c") +;;;;;; "515e1dbc42acebd9a0175c4209b6673c") ;;; Generated autoloads from dired-x.el (autoload 'dired-jump "dired-x" "\ From 59af988b408a685b21600dedf0462298b8b7f16a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 22 Feb 2011 19:50:04 -0800 Subject: [PATCH 13/35] Add comments about fixing dates in merged ChangeLogs. --- admin/bzrmerge.el | 3 +++ admin/notes/bzr | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/admin/bzrmerge.el b/admin/bzrmerge.el index 77e64a862c8..33cbae22a6c 100644 --- a/admin/bzrmerge.el +++ b/admin/bzrmerge.el @@ -270,6 +270,9 @@ Does not make other difference." (sit-for 1) ;; (debug 'after-merge) ;; Check the conflicts. + ;; FIXME if using the helpful bzr changelog_merge plugin, + ;; there are normally no conflicts in ChangeLogs. + ;; But we still want the dates fixing, like bzrmerge-resolve does. (let ((conflicted nil) (files ())) (goto-char (point-min)) diff --git a/admin/notes/bzr b/admin/notes/bzr index 11f0af17a3b..11472e83fc3 100644 --- a/admin/notes/bzr +++ b/admin/notes/bzr @@ -112,9 +112,12 @@ and is due to a technical limitation of bzr. The log data for those revisions gets merged, the actual changes themselves do not. http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00609.html ) -Note that ChangeLog entries are automatically merged to the top with -today's date, but you still might want to check them to see that too -much is not being included, or whitespace between entries is not missing. +In particular, check the ChangeLog entries (eg in case too many +entries have been included or whitespace between entries needs fixing). +bzrmerge tries to fix up the dates to today's date, but it only does +this where there are conflicts. If you used the changelog_merge plugin, +there won't be any conflicts, and (at time of writing) you will need +to adjust dates by hand. Notes: From 4902e827bc04d0e1cb17820fe522992995166fc7 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 22 Feb 2011 20:00:52 -0800 Subject: [PATCH 14/35] Remove pointless setting of byte-compile-dynamic in tiny, tiny file. --- lisp/mail/mailclient.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/mail/mailclient.el b/lisp/mail/mailclient.el index ab9f3662745..b957d9f36c6 100644 --- a/lisp/mail/mailclient.el +++ b/lisp/mail/mailclient.el @@ -1,4 +1,4 @@ -;;; mailclient.el --- mail sending via system's mail client. -*- byte-compile-dynamic: t -*- +;;; mailclient.el --- mail sending via system's mail client. ;; Copyright (C) 2005-2011 Free Software Foundation From ed3d1631555ed03d1c5b1b7738e16e59ffa7a48e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 22 Feb 2011 20:24:13 -0800 Subject: [PATCH 15/35] * admin/notes/bzr: More details about merging ChangeLogs. --- admin/notes/bzr | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/notes/bzr b/admin/notes/bzr index 11472e83fc3..a6fbcf22bb2 100644 --- a/admin/notes/bzr +++ b/admin/notes/bzr @@ -117,7 +117,10 @@ entries have been included or whitespace between entries needs fixing). bzrmerge tries to fix up the dates to today's date, but it only does this where there are conflicts. If you used the changelog_merge plugin, there won't be any conflicts, and (at time of writing) you will need -to adjust dates by hand. +to adjust dates by hand. In any case, if someone made multiple +ChangeLog entries on different days in the branch, you may wish to +collapse them all to a single entry for that author in the trunk +(because in the trunk they all appear under the same date). Notes: From c9f50c819f057f38742d283c4f36b1ffcfd126d9 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 22 Feb 2011 20:27:42 -0800 Subject: [PATCH 16/35] Comment spelling fix. --- lisp/mail/mailheader.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/mail/mailheader.el b/lisp/mail/mailheader.el index 896400068cc..1277d1d4109 100644 --- a/lisp/mail/mailheader.el +++ b/lisp/mail/mailheader.el @@ -101,7 +101,7 @@ value." (cons (cdr header) (funcall (cdr rule) (cdr header)))))))) headers) -;; Advertized part of the interface; see mail-header, mail-header-set. +;; Advertised part of the interface; see mail-header, mail-header-set. (defvar headers) (defsubst mail-header (header &optional header-alist) From a94a2b9be3445aaea447d4e6f6483b1afc9ea910 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 22 Feb 2011 20:37:53 -0800 Subject: [PATCH 17/35] * etc/NEWS: Remove some sql-stuff that is not NEWS-worthy. --- etc/NEWS | 4 ---- 1 file changed, 4 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 9119fa3b8e1..f0d95dee846 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -424,10 +424,6 @@ The standard directory local variables feature replaces it. ** SQL Mode enhancements. -*** Several variables have been marked as safe local variables. The -variables `sql-product', `sql-user', `sql-server', `sql-database' and -`sql-port' can now be safely used as local variables. - *** `sql-dialect' is a synonym for `sql-product'. *** Added ability to login with a port on MySQL and Postgres. From 86485587de779e7e7474bea48ea16f8ba3313fc4 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 22 Feb 2011 20:47:11 -0800 Subject: [PATCH 18/35] * etc/NEWS: Typo fixes. --- etc/NEWS | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index f0d95dee846..217f5ab1d70 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -330,7 +330,7 @@ prompts for a number to count from and for a format string. ** The Landmark game is now invoked with `landmark', not `lm'. ** Prolog mode has been completely revamped, with lots of additional -functionality such as more intelligent indentation, electricty, support for +functionality such as more intelligent indentation, electricity, support for more variants, including Mercury, and a lot more. ** shell-mode can track your cwd by reading it from your prompt. @@ -532,7 +532,7 @@ objects shown and the details available are product specific. **** List all objects. Using `M-x sql-list-all', `C-c C-l a' or selecting "SQL->List all objects" will list all the objects in the database. At a minimum it -lists the tables and views in the database. Preceeding the command by +lists the tables and views in the database. Preceding the command by universal argument may provide additional details or extend the listing to include other schemas objects. The list will appear in a separate window in view-mode. @@ -540,7 +540,7 @@ separate window in view-mode. **** List Table details. Using `M-x sql-list-table', `C-c C-l t' or selecting "SQL->List Table details" will ask for the name of a database table or view and display -the list of columns in the relation. Preceeding the comand with the +the list of columns in the relation. Preceding the command with the universal argument may provide additional details about each column. The list will appear in a separate window in view-mode. @@ -555,7 +555,7 @@ In general, the SQL*Plus option SCAN should always be set OFF under SQL interactive mode and this option used in its place. *** SQL interactive mode will replace tabs with spaces. -This prevents the comand interpretter for MySQL and Postgres from +This prevents the command interpreter for MySQL and Postgres from listing object name completions when being sent text via `sql-send-*' functions. @@ -564,7 +564,7 @@ listing object name completions when being sent text via ** sregex.el is now obsolete, since rx.el is a strict superset. ** s-region.el and pc-select are now declared obsolete, -superceded by shift-select-mode enabled by default in 23.1. +superseded by shift-select-mode enabled by default in 23.1. ** pc-mode.el is also declared obsolete. ** gdb-mi @@ -802,10 +802,9 @@ displayed with a "spinning bar". runtime checks. ** New configure.bat option --distfiles to specify files to be - included in binary distribution +included in binary distribution -** New make target `dist' to create binary disttribution for Windows - platform +** New make target `dist' to create binary distribution for MS Windows ---------------------------------------------------------------------- From 0d327994db9eb1273b488d90dfbedd7c58e6c3ce Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 22 Feb 2011 23:27:09 -0800 Subject: [PATCH 19/35] Fix some mis-spellings of "precede" that are not in emacs-23 branch. --- lisp/allout-widgets.el | 2 +- lisp/allout.el | 2 +- lisp/progmodes/sql.el | 5 ++--- src/bidi.c | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el index 75e1e5882f6..cc5fd6d96fa 100644 --- a/lisp/allout-widgets.el +++ b/lisp/allout-widgets.el @@ -2013,7 +2013,7 @@ Optional FORCE means force reassignment of the region property." ;; item body), to bias the registered values. ;; ;; This is not necessary/useful when the item is being decorated, because - ;; that always must be preceeded by a fresh item parse. + ;; that always must be preceded by a fresh item parse. (if (not (eq field :body-end)) (widget-get item-widget :from) diff --git a/lisp/allout.el b/lisp/allout.el index 1a7d8cb1593..d881e1177fa 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -255,7 +255,7 @@ prevails." This is in contrast to the majority of allout-mode bindings on `allout-prefixed-bindings', whose bindings are created with a -preceeding command key. +preceding command key. Use vector format for the keys: - put literal keys after a '?' question mark, eg: '?a', '?.' diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 9e49f0e775b..1c1ffc41624 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -2801,7 +2801,7 @@ server/database name." (defun sql-rename-buffer (&optional new-name) "Rename a SQL interactive buffer. -Prompts for the new name if command is preceeded by +Prompts for the new name if command is preceded by \\[universal-argument]. If no buffer name is provided, then the `sql-alternate-buffer-name' is used. @@ -3262,7 +3262,7 @@ you must tell Emacs. Here's how to do that in your `~/.emacs' file: :abbrev-table sql-mode-abbrev-table (if sql-mode-menu (easy-menu-add sql-mode-menu)); XEmacs - + (set (make-local-variable 'comment-start) "--") ;; Make each buffer in sql-mode remember the "current" SQLi buffer. (make-local-variable 'sql-buffer) @@ -4257,4 +4257,3 @@ buffer. (provide 'sql) ;;; sql.el ends here - diff --git a/src/bidi.c b/src/bidi.c index 9740fe8f1d5..eeacf65bd5c 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -1520,7 +1520,7 @@ bidi_level_of_next_char (struct bidi_it *bidi_it) bidi_check_type (bidi_it->type); /* For L1 below, we need to know, for each WS character, whether - it belongs to a sequence of WS characters preceeding a newline + it belongs to a sequence of WS characters preceding a newline or a TAB or a paragraph separator. */ if (bidi_it->orig_type == NEUTRAL_WS && bidi_it->next_for_ws.type == UNKNOWN_BT) From 4a3988d518b3e9781f27b0d87c9de94c673efc45 Mon Sep 17 00:00:00 2001 From: Gnus developers Date: Wed, 23 Feb 2011 13:35:35 +0000 Subject: [PATCH 20/35] Merge changes made in Gnus trunk. auth.texi (Help for users): Mention ~/.netrc is also searched by default now. gnus-start.el (gnus-dribble-read-file): Set buffer-save-without-query, since we always want to save the dribble file, probably. nnmail.el (nnmail-article-group): Allow a final "" split to work on nnimap. gnus-sum.el (gnus-user-date-format-alist): Renamed back again from -summary- since it's a user-visible variable. nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the first time you use the new Gnus. auth-source.el: Don't load netrc.el. (auth-sources): Search ~/.netrc as well by default. (auth-source-debug): Add 'trivia option for extra output. (auth-source-do-trivia): Use it. (auth-source-search): Simplify logic to use `auth-source-search-backends'. Use `auth-source-do-trivia' where appropriate. Don't keep a running count at this level. Layer :create and :delete options appropriately on the first and second passes. Don't track the backend with the search results. (auth-source-search-backends): New function to search a list of backends for a processed spec. (auth-source-netrc-parse): Cache all netrc files, making auth-source-netrc-cache an alist keyed by the file name and using the file mtime as the caching criterion. Keep the obfuscated data secret with a lexical bind. (auth-source-netrc-search): Don't calculate the length of the results unnecessarily. (auth-source-search-backends): Fix bug. (auth-source-netrc-create): Rework prompts. nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): Lower case names of search constraints. (nnir-run-query): Cache and reuse search constraints for all imap servers. gnus-msg.el (gnus-setup-message): Define missing variable from last checkin. --- doc/misc/ChangeLog | 5 + doc/misc/auth.texi | 10 +- lisp/gnus/ChangeLog | 45 +++++++ lisp/gnus/auth-source.el | 275 +++++++++++++++++++-------------------- lisp/gnus/gnus-msg.el | 6 +- lisp/gnus/gnus-start.el | 5 +- lisp/gnus/gnus-sum.el | 8 +- lisp/gnus/nnimap.el | 1 + lisp/gnus/nnir.el | 26 ++-- lisp/gnus/nnmail.el | 3 +- 10 files changed, 218 insertions(+), 166 deletions(-) diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 530f7f1c123..6f4f86978da 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -19,6 +19,11 @@ (Local Variables): Say this is obsolete. Fix description of dired-enable-local-variables possible values. +2011-02-22 Teodor Zlatanov + + * auth.texi (Help for users): Mention ~/.netrc is also searched by + default now. + 2011-02-21 Lars Ingebrigtsen * gnus.texi (Article Date): Clarify gnus-article-update-date-headers. diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi index 27c6691dfa8..23ac23dce5b 100644 --- a/doc/misc/auth.texi +++ b/doc/misc/auth.texi @@ -127,8 +127,8 @@ you will be pwned as the kids say. ``Netrc'' files are usually called @code{.authinfo} or @code{.netrc}; nowadays @code{.authinfo} seems to be more popular and the auth-source -library encourages this confusion by making it the default, as you'll -see later. +library encourages this confusion by accepting both, as you'll see +later. If you have problems with the search, set @code{auth-source-debug} to @code{t} and see what host, port, and user the library is checking in @@ -159,7 +159,7 @@ and simplest configuration is: ;;; mostly equivalent (see below about fallbacks) but shorter: (setq auth-sources '((:source "~/.authinfo.gpg"))) ;;; even shorter and the @emph{default}: -(setq auth-sources '("~/.authinfo.gpg" "~/.authinfo")) +(setq auth-sources '("~/.authinfo.gpg" "~/.authinfo" "~/.netrc")) ;;; use the Secrets API @var{Login} collection (@pxref{Secret Service API}) (setq auth-sources '("secrets:Login")) @end lisp @@ -184,8 +184,8 @@ the defaults: any host and any port are looked up in the netrc file @code{~/.authinfo.gpg}, which is a GnuPG encrypted file (@pxref{GnuPG and EasyPG Assistant Configuration}). -If that fails, the unencrypted netrc file @code{~/.authinfo} will -be used. +If that fails, the unencrypted netrc files @code{~/.authinfo} and +@code{~/.netrc} will be used. The typical netrc line example is without a port. diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index fae73613d1f..c31c2767458 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,47 @@ +2011-02-23 Lars Ingebrigtsen + + * gnus-start.el (gnus-dribble-read-file): Set + buffer-save-without-query, since we always want to save the dribble + file, probably. + + * nnmail.el (nnmail-article-group): Allow a final "" split to work on + nnimap. + + * gnus-sum.el (gnus-user-date-format-alist): Renamed back again from + -summary- since it's a user-visible variable. + + * nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the + first time you use the new Gnus. + +2011-02-22 Teodor Zlatanov + + * auth-source.el: Don't load netrc.el. + (auth-sources): Search ~/.netrc as well by default. + (auth-source-debug): Add 'trivia option for extra output. + (auth-source-do-trivia): Use it. + (auth-source-search): Simplify logic to use + `auth-source-search-backends'. Use `auth-source-do-trivia' where + appropriate. Don't keep a running count at this level. Layer :create + and :delete options appropriately on the first and second passes. + Don't track the backend with the search results. + (auth-source-search-backends): New function to search a list of + backends for a processed spec. + (auth-source-netrc-parse): Cache all netrc files, making + auth-source-netrc-cache an alist keyed by the file name and using the + file mtime as the caching criterion. Keep the obfuscated data secret + with a lexical bind. + (auth-source-netrc-search): Don't calculate the length of the results + unnecessarily. + (auth-source-search-backends): Fix bug. + (auth-source-netrc-create): Rework prompts. + +2011-02-22 Andrew Cohen + + * nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key): + Lower case names of search constraints. + (nnir-run-query): Cache and reuse search constraints for all imap + servers. + 2011-02-22 Sam Steingold * gnus-msg.el (gnus-setup-message): Also bind `winconf-name'. @@ -6,6 +50,7 @@ * gnus-msg.el (gnus-inews-add-send-actions): Restore the winconf name after exit. + (gnus-setup-message): Define missing variable from last checkin. * gnus-sum.el (gnus-summary-show-article): When called with t as the value, show the raw article. diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index 57fecc7ae32..093012df535 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -42,7 +42,6 @@ (require 'password-cache) (require 'mm-util) (require 'gnus-util) -(require 'netrc) (require 'assoc) (eval-when-compile (require 'cl)) (require 'eieio) @@ -164,16 +163,19 @@ If the value is a function, debug messages are logged by calling :type `(choice :tag "auth-source debugging mode" (const :tag "Log using `message' to the *Messages* buffer" t) + (const :tag "Log all trivia with `message' to the *Messages* buffer" + trivia) (function :tag "Function that takes arguments like `message'") (const :tag "Don't log anything" nil))) -(defcustom auth-sources '("~/.authinfo.gpg" "~/.authinfo") +(defcustom auth-sources '("~/.authinfo.gpg" "~/.authinfo" "~/.netrc") "List of authentication sources. The default will get login and password information from \"~/.authinfo.gpg\", which you should set up with the EPA/EPG packages to be encrypted. If that file doesn't exist, it will -try the unencrypted version \"~/.authinfo\". +try the unencrypted version \"~/.authinfo\" and the famous +\"~/.netrc\" file. See the auth.info manual for details. @@ -256,6 +258,11 @@ If the value is not a list, symmetric encryption will be used." (when auth-source-debug (apply 'auth-source-do-warn msg))) +(defun auth-source-do-trivia (&rest msg) + (when (or (eq auth-source-debug 'trivia) + (functionp auth-source-debug)) + (apply 'auth-source-do-warn msg))) + (defun auth-source-do-warn (&rest msg) (apply ;; set logger to either the function in auth-source-debug or 'message @@ -500,7 +507,7 @@ must call it to obtain the actual value." unless (memq (nth i spec) ignored-keys) collect (nth i spec))) (found (auth-source-recall spec)) - filtered-backends accessor-key found-here goal matches backend) + filtered-backends accessor-key backend) (if (and found auth-source-do-cache) (auth-source-do-debug @@ -509,7 +516,7 @@ must call it to obtain the actual value." (assert (or (eq t create) (listp create)) t - "Invalid auth-source :create parameter (must be nil, t, or a list): %s %s") + "Invalid auth-source :create parameter (must be t or a list): %s %s") (setq filtered-backends (copy-sequence backends)) (dolist (backend backends) @@ -523,66 +530,64 @@ must call it to obtain the actual value." (return)) (invalid-slot-name)))) - (auth-source-do-debug + (auth-source-do-trivia "auth-source-search: found %d backends matching %S" (length filtered-backends) spec) ;; (debug spec "filtered" filtered-backends) - (setq goal max) ;; First go through all the backends without :create, so we can ;; query them all. - (let ((uspec (copy-sequence spec))) - (plist-put uspec :create nil) - (dolist (backend filtered-backends) - (let ((match (apply - (slot-value backend 'search-function) - :backend backend - uspec))) - (when match - (push (list backend match) matches))))) + (setq found (auth-source-search-backends filtered-backends + spec + ;; to exit early + max + ;; create and delete + nil delete)) + + (auth-source-do-debug + "auth-source-search: found %d results (max %d) matching %S" + (length found) max spec) + ;; If we didn't find anything, then we allow the backend(s) to ;; create the entries. (when (and create - (not matches)) - (dolist (backend filtered-backends) - (unless matches - (let ((match (apply - (slot-value backend 'search-function) - :backend backend - :create create - :delete delete - spec))) - (when match - (push (list backend match) matches)))))) + (not found)) + (setq found (auth-source-search-backends filtered-backends + spec + ;; to exit early + max + ;; create and delete + create delete)) + (auth-source-do-warn + "auth-source-search: CREATED %d results (max %d) matching %S" + (length found) max spec)) - (setq backend (caar matches) - found-here (cadar matches)) + (when (and found auth-source-do-cache) + (auth-source-remember spec found))) - (block nil - ;; if max is 0, as soon as we find something, return it - (when (and (zerop max) (> 0 (length found-here))) - (return t)) + found)) - ;; decrement the goal by the number of new results - (decf goal (length found-here)) - ;; and append the new results to the full list - (setq found (append found found-here)) - - (auth-source-do-debug - "auth-source-search: found %d results (max %d/%d) in %S matching %S" - (length found-here) max goal backend spec) - - ;; return full list if the goal is 0 or negative - (when (zerop (max 0 goal)) - (return found)) - - ;; change the :max parameter in the spec to the goal - (setq spec (plist-put spec :max goal)) - - (when (and found auth-source-do-cache) - (auth-source-remember spec found)))) - - found)) +(defun auth-source-search-backends (backends spec max create delete) + (let (matches) + (dolist (backend backends) + (when (> max (length matches)) ; when we need more matches... + (let ((bmatches (apply + (slot-value backend 'search-function) + :backend backend + ;; note we're overriding whatever the spec + ;; has for :create and :delete + :create create + :delete delete + spec))) + (when bmatches + (auth-source-do-trivia + "auth-source-search-backend: got %d (max %d) in %s:%s matching %S" + (length bmatches) max + (slot-value backend :type) + (slot-value backend :source) + spec) + (setq matches (append matches bmatches)))))) + matches)) ;;; (auth-source-search :max 1) ;;; (funcall (plist-get (nth 0 (auth-source-search :max 1)) :secret)) @@ -704,25 +709,35 @@ Note that the MAX parameter is used so we can exit the parse early." (when (file-exists-p file) (setq port (auth-source-ensure-strings port)) (with-temp-buffer - (let ((tokens '("machine" "host" "default" "login" "user" - "password" "account" "macdef" "force" - "port" "protocol")) - (max (or max 5000)) ; sanity check: default to stop at 5K - (modified 0) - alist elem result pair) - (if (and auth-source-netrc-cache - (equal (car auth-source-netrc-cache) - (nth 5 (file-attributes file)))) - (insert (base64-decode-string - (rot13-string (cdr auth-source-netrc-cache)))) - (insert-file-contents file) - (when (string-match "\\.gpg\\'" file) - ;; Store the contents of the file heavily encrypted in memory. - (setq auth-source-netrc-cache - (cons (nth 5 (file-attributes file)) - (rot13-string - (base64-encode-string - (buffer-string))))))) + (let* ((tokens '("machine" "host" "default" "login" "user" + "password" "account" "macdef" "force" + "port" "protocol")) + (max (or max 5000)) ; sanity check: default to stop at 5K + (modified 0) + (cached (cdr-safe (assoc file auth-source-netrc-cache))) + (cached-mtime (plist-get cached :mtime)) + (cached-secrets (plist-get cached :secret)) + alist elem result pair) + + (if (and (functionp cached-secrets) + (equal cached-mtime + (nth 5 (file-attributes file)))) + (progn + (auth-source-do-trivia + "auth-source-netrc-parse: using CACHED file data for %s" + file) + (insert (funcall cached-secrets))) + (insert-file-contents file) + ;; cache all netrc files (used to be just .gpg files) + ;; Store the contents of the file heavily encrypted in memory. + ;; (note for the irony-impaired: they are just obfuscated) + (aput 'auth-source-netrc-cache file + (list :mtime (nth 5 (file-attributes file)) + :secret (lexical-let ((v (rot13-string + (base64-encode-string + (buffer-string))))) + (lambda () (base64-decode-string + (rot13-string v))))))) (goto-char (point-min)) ;; Go through the file, line by line. (while (and (not (eobp)) @@ -868,7 +883,7 @@ See `auth-source-search' for details on SPEC." ;; if we need to create an entry AND none were found to match (when (and create - (= 0 (length results))) + (not results)) ;; create based on the spec and record the value (setq results (or @@ -897,7 +912,6 @@ See `auth-source-search' for details on SPEC." (required (append base-required create-extra)) (file (oref backend source)) (add "") - (show "") ;; `valist' is an alist valist ;; `artificial' will be returned if no creation is needed @@ -928,63 +942,29 @@ See `auth-source-search' for details on SPEC." ;; for each required element (dolist (r required) (let* ((data (aget valist r)) + ;; take the first element if the data is a list + (data (if (listp data) + (nth 0 data) + data)) + ;; this is the default to be offered (given-default (aget auth-source-creation-defaults r)) - ;; the defaults are simple + ;; the default supplementals are simple: for the user, + ;; try (user-login-name), otherwise take given-default (default (cond ((and (not given-default) (eq r 'user)) (user-login-name)) - ;; note we need this empty string - ((and (not given-default) (eq r 'port)) - "") - (t given-default))) - ;; the prompt's default string depends on the data so far - (default-string (if (and default (< 0 (length default))) - (format " (default %s)" default) - " (no default)")) - ;; the prompt should also show what's entered so far - (user-value (aget valist 'user)) - (host-value (aget valist 'host)) - (port-value (aget valist 'port)) - ;; note this handles lists by just printing them - ;; later we allow the user to use completing-read to pick - (info-so-far (concat (if user-value - (format "%s@" user-value) - "[USER?]") - (if host-value - (format "%s" host-value) - "[HOST?]") - (if port-value - ;; this distinguishes protocol between - (if (zerop (length port-value)) - "" ; 'entered as "no default"' vs. - (format ":%s" port-value)) ; given - ;; and this is when the protocol is unknown - "[PORT?]")))) + (t given-default)))) - ;; now prompt if the search SPEC did not include a required key; - ;; take the result and put it in `data' AND store it in `valist' - (aput 'valist r - (setq data - (cond - ((and (null data) (eq r 'secret)) - ;; special case prompt for passwords - (read-passwd (format "Password for %s: " info-so-far))) - ((null data) - (read-string - (format "Enter %s for %s%s: " - r info-so-far default-string) - nil nil default)) - ((listp data) - (completing-read - (format "Enter %s for %s (TAB to see the choices): " - r info-so-far) - data - nil ; no predicate - t ; require a match - ;; note the default is nil, but if the user - ;; hits RET we'll get "", which is handled OK later - nil)) - (t data)))) + ;; store the data, prompting for the password if needed + (setq data + (cond + ((and (null data) (eq r 'secret)) + ;; special case prompt for passwords + (read-passwd (format "Password for %s@%s:%s: " + (or (aget valist 'user) "[any user]") + (or (aget valist 'host) "[any host]") + (or (aget valist 'port) "[any port]")))) + (t data))) (when data (setq artificial (plist-put artificial @@ -997,7 +977,9 @@ See `auth-source-search' for details on SPEC." ;; when r is not an empty string... (when (and (stringp data) (< 0 (length data))) - (let ((printer (lambda (hide) + ;; this function is not strictly necessary but I think it + ;; makes the code clearer -tzz + (let ((printer (lambda () ;; append the key (the symbol name of r) ;; and the value in r (format "%s%s %S" @@ -1005,17 +987,14 @@ See `auth-source-search' for details on SPEC." (if (zerop (length add)) "" " ") ;; remap auth-source tokens to netrc (case r - ('user "login") - ('host "machine") + ('user "login") + ('host "machine") ('secret "password") - ('port "port") ; redundant but clearer + ('port "port") ; redundant but clearer (t (symbol-name r))) ;; the value will be printed in %S format - (if (and hide (eq r 'secret)) - "HIDDEN_SECRET" - data))))) - (setq add (concat add (funcall printer nil))) - (setq show (concat show (funcall printer t))))))) + data)))) + (setq add (concat add (funcall printer))))))) (with-temp-buffer (when (file-exists-p file) @@ -1032,17 +1011,35 @@ See `auth-source-search' for details on SPEC." (goto-char (point-max)) ;; ask AFTER we've successfully opened the file - (if (y-or-n-p (format "Add to file %s: line [%s]" file show)) + (let (done k) + (while (not done) + (setq k (read-char-choice + (format "Add to file %s? %s: " + file + "(y)es/(n)o but use it/(e)dit line/(s)kip file") + '(?y ?n ?e ?s))) + (case k + (?y (setq done t)) + (?n (setq add "" + done t)) + (?s (setq add "" + done 'skip)) + (?e (setq add (read-string "Line to add: " add))) + (t nil))) + + (when (< 0 (length add)) (progn (unless (bolp) (insert "\n")) (insert add "\n") (write-region (point-min) (point-max) file nil 'silent) - (auth-source-do-debug + (auth-source-do-warn "auth-source-netrc-create: wrote 1 new line to %s" file) - nil) - (list artificial))))) + nil)) + + (when (eq done t) + (list artificial)))))) ;;; Backend specific parsing: Secrets API backend diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 4e88b871ac0..093eec33fcd 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -383,7 +383,7 @@ Thank you for your help in stamping out bugs. (defvar gnus-article-reply nil) (defmacro gnus-setup-message (config &rest forms) (let ((winconf (make-symbol "gnus-setup-message-winconf")) - (winconf-name (make-symbol "gnus-setup-message-winconf")) + (winconf-name (make-symbol "gnus-setup-message-winconf-name")) (buffer (make-symbol "gnus-setup-message-buffer")) (article (make-symbol "gnus-setup-message-article")) (yanked (make-symbol "gnus-setup-yanked-articles")) @@ -434,7 +434,7 @@ Thank you for your help in stamping out bugs. (progn ,@forms) (gnus-inews-add-send-actions ,winconf ,buffer ,article ,config - ,yanked ,winconf-name) + ,yanked ',winconf-name) (setq gnus-message-buffer (current-buffer)) (set (make-local-variable 'gnus-message-group-art) (cons ,group ,article)) @@ -542,7 +542,7 @@ Gcc: header for archiving purposes." (gnus-post-method arg ,gnus-newsgroup-name))) (message-add-action `(progn - (setq gnus-current-window-configuration ,winconf-name) + (setq gnus-current-window-configuration ',winconf-name) (when (gnus-buffer-exists-p ,buffer) (set-window-configuration ,winconf))) 'exit 'postpone 'kill) diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index e5e2468058c..dea6aabc75b 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -864,6 +864,7 @@ prompt the user for the name of an NNTP server to use." (gnus-get-buffer-create (file-name-nondirectory dribble-file))) (set (make-local-variable 'file-precious-flag) t) + (setq buffer-save-without-query t) (erase-buffer) (setq buffer-file-name dribble-file) (auto-save-mode t) @@ -1717,8 +1718,8 @@ If SCAN, request a scan of that group as well." gnus-secondary-select-methods)) (when (and (not (assoc method type-cache)) (gnus-check-backend-function 'request-list (car method))) - (with-current-buffer nntp-server-buffer - (gnus-read-active-file-1 method nil)))) + (with-current-buffer nntp-server-buffer + (gnus-read-active-file-1 method nil)))) ;; Do the rest of the retrieval. (dolist (elem type-cache) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 2d78a5698df..abe6367f0d0 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -3853,7 +3853,7 @@ This function is intended to be used in ((< c (* 1000 10000)) (format "%1.1fM" (/ c (* 1024.0 1024)))) (t (format "%dM" (/ c (* 1024.0 1024))))))) -(defcustom gnus-summary-user-date-format-alist +(defcustom gnus-user-date-format-alist '(((gnus-seconds-today) . "Today, %H:%M") ((+ 86400 (gnus-seconds-today)) . "Yesterday, %H:%M") (604800 . "%A %H:%M") ; That's one week @@ -3880,11 +3880,9 @@ respectively." :version "24.1" :group 'gnus-summary-format :type '(alist :key-type sexp :value-type string)) -(make-obsolete-variable 'gnus-user-date-format-alist - 'gnus-summary-user-date-format-alist "24.1") (defun gnus-user-date (messy-date) - "Format the messy-date according to `gnus-summary-user-date-format-alist'. + "Format the messy-date according to `gnus-user-date-format-alist'. Returns \" ? \" if there's bad input or if another error occurs. Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"." (condition-case () @@ -3893,7 +3891,7 @@ Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"." ;;If we don't find something suitable we'll use this one (my-format "%b %d '%y")) (let* ((difference (- now messy-date)) - (templist gnus-summary-user-date-format-alist) + (templist gnus-user-date-format-alist) (top (eval (caar templist)))) (while (if (numberp top) (< top difference) (not top)) (progn diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 138875ba477..b2733407836 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1151,6 +1151,7 @@ textual parts.") (setf (nnimap-examined nnimap-object) group) (if (and qresyncp uidvalidity + active modseq) (push (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index 8e91c68b391..eaaac3f88ce 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -203,11 +203,12 @@ ;; Imap variables (defvar nnir-imap-search-arguments - '(("Whole message" . "TEXT") - ("Subject" . "SUBJECT") - ("To" . "TO") - ("From" . "FROM") - ("Imap" . "")) + '(("whole message" . "TEXT") + ("subject" . "SUBJECT") + ("to" . "TO") + ("from" . "FROM") + ("body" . "BODY") + ("imap" . "")) "Mapping from user readable keys to IMAP search items for use in nnir") (defvar nnir-imap-search-other "HEADER %S" @@ -335,7 +336,7 @@ result, `gnus-retrieve-headers' will be called instead." :type '(function) :group 'nnir) -(defcustom nnir-imap-default-search-key "Whole message" +(defcustom nnir-imap-default-search-key "whole message" "*The default IMAP search key for an nnir search. Must be one of the keys in `nnir-imap-search-arguments'. To use raw imap queries by default set this to \"Imap\"." @@ -1500,11 +1501,14 @@ Tested with Namazu 2.0.6 on a GNU/Linux system." (setq search-func (cadr (assoc nnir-search-engine nnir-engines))) (if search-func - (funcall search-func - (if nnir-extra-parms - (nnir-read-parms q nnir-search-engine) - q) - server (cadr x)) + (funcall + search-func + (if nnir-extra-parms + (or (and (eq nnir-search-engine 'imap) + (assq 'criteria q) q) + (setq q (nnir-read-parms q nnir-search-engine))) + q) + server (cadr x)) nil))) groups)))) diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index b2336e13b64..8906a036779 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -1215,7 +1215,8 @@ FUNC will be called with the group name to determine the article number." ;; This is the final group, which is used as a ;; catch-all. (when (and (not group-art) - (not nnmail-inhibit-default-split-group)) + (or (equal "" (nth 1 method)) + (not nnmail-inhibit-default-split-group))) (setq group-art (list (cons (car method) (funcall func (car method)))))))) From d41d18c098709249cb44dcf4bc5fcf8ed4057f29 Mon Sep 17 00:00:00 2001 From: Teodor Zlatanov Date: Wed, 23 Feb 2011 14:34:44 +0000 Subject: [PATCH 21/35] auth-source.el (auth-source-netrc-create): Use `read-char' instead of `read-char-choice' for backwards compatibility. --- lisp/gnus/ChangeLog | 5 +++++ lisp/gnus/auth-source.el | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index c31c2767458..0d8dfe0ea91 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2011-02-23 Teodor Zlatanov + + * auth-source.el (auth-source-netrc-create): Use `read-char' instead of + `read-char-choice' for backwards compatibility. + 2011-02-23 Lars Ingebrigtsen * gnus-start.el (gnus-dribble-read-file): Set diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index 093012df535..d349022e7b7 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -1011,13 +1011,12 @@ See `auth-source-search' for details on SPEC." (goto-char (point-max)) ;; ask AFTER we've successfully opened the file - (let (done k) + (let ((prompt (format "Add to file %s? %s: " + file + "(y)es/(n)o but use it/(e)dit line/(s)kip file")) + done k) (while (not done) - (setq k (read-char-choice - (format "Add to file %s? %s: " - file - "(y)es/(n)o but use it/(e)dit line/(s)kip file") - '(?y ?n ?e ?s))) + (setq k (read-char prompt)) (case k (?y (setq done t)) (?n (setq add "" From 617a0e834a8f3870e28308cd2d04cba6d945f62b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 23 Feb 2011 10:14:21 -0500 Subject: [PATCH 22/35] * src/print.c (print_object): Never print old-style backquotes. Obey escapeflag for hash tables as well. --- src/ChangeLog | 5 +++++ src/print.c | 32 ++++++-------------------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 194f1c44f84..3d22e15c3b3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-02-23 Stefan Monnier + + * print.c (print_object): Never print old-style backquotes. + Obey escapeflag for hash tables as well. + 2011-02-23 Kenichi Handa * font.c (font_open_entity): Be sure to set scaled_pixel_size. diff --git a/src/print.c b/src/print.c index 299cfd41814..29a4bfab790 100644 --- a/src/print.c +++ b/src/print.c @@ -1683,26 +1683,6 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag { PRINTCHAR ('('); - /* If the first element is a backquote form, - print it old-style so it won't be misunderstood. */ - if (print_quoted && CONSP (XCAR (obj)) - && CONSP (XCDR (XCAR (obj))) - && NILP (XCDR (XCDR (XCAR (obj)))) - && EQ (XCAR (XCAR (obj)), Qbackquote)) - { - Lisp_Object tem; - tem = XCAR (obj); - PRINTCHAR ('('); - - print_object (Qbackquote, printcharfun, 0); - PRINTCHAR (' '); - - print_object (XCAR (XCDR (tem)), printcharfun, 0); - PRINTCHAR (')'); - - obj = XCDR (obj); - } - { EMACS_INT print_length; int i; @@ -1906,25 +1886,25 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag if (!NILP (h->test)) { strout (" test ", -1, -1, printcharfun, 0); - print_object (h->test, printcharfun, 0); + print_object (h->test, printcharfun, escapeflag); } if (!NILP (h->weak)) { strout (" weakness ", -1, -1, printcharfun, 0); - print_object (h->weak, printcharfun, 0); + print_object (h->weak, printcharfun, escapeflag); } if (!NILP (h->rehash_size)) { strout (" rehash-size ", -1, -1, printcharfun, 0); - print_object (h->rehash_size, printcharfun, 0); + print_object (h->rehash_size, printcharfun, escapeflag); } if (!NILP (h->rehash_threshold)) { strout (" rehash-threshold ", -1, -1, printcharfun, 0); - print_object (h->rehash_threshold, printcharfun, 0); + print_object (h->rehash_threshold, printcharfun, escapeflag); } strout (" data ", -1, -1, printcharfun, 0); @@ -1943,9 +1923,9 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag if (!NILP (HASH_HASH (h, i))) { if (i) PRINTCHAR (' '); - print_object (HASH_KEY (h, i), printcharfun, 1); + print_object (HASH_KEY (h, i), printcharfun, escapeflag); PRINTCHAR (' '); - print_object (HASH_VALUE (h, i), printcharfun, 1); + print_object (HASH_VALUE (h, i), printcharfun, escapeflag); } if (size < real_size) From 53cfe624fc93b0f8aea0747f4d3493881404e77f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 23 Feb 2011 10:22:28 -0500 Subject: [PATCH 23/35] * lisp/emacs-lisp/bytecomp.el (byte-compile-disable-print-circle): Obsolete. --- etc/NEWS | 1 + lib-src/ChangeLog | 2 +- lisp/ChangeLog | 8 ++++++-- lisp/emacs-lisp/bytecomp.el | 1 + lisp/international/ja-dic-cnv.el | 2 +- lisp/international/titdic-cnv.el | 7 +++---- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 217f5ab1d70..cfb788940d0 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -712,6 +712,7 @@ sc.el, x-menu.el, rnews.el, rnewspost.el * Lisp changes in Emacs 24.1 +** byte-compile-disable-print-circle is obsolete. ** Removed the stack-trace-on-error variable. Also the debugger can now "continue" from an error, which means it will jump to the error handler as if the debugger had not been invoked instead of diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index fceeaba174c..2c98cdf59a6 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -611,7 +611,7 @@ autoconf, not cpp. (ALL_CFLAGS): Use them as make variables. -2010-04-07 Christoph (tiny change) +2010-04-07 Christoph Scholtes * makefile.w32-in (OTHER_PLATFORM_SUPPORT): Use parenthesis for macros for nmake compatibility. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index df3098332f9..33f39c00a60 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-02-23 Stefan Monnier + + * emacs-lisp/bytecomp.el (byte-compile-disable-print-circle): Obsolete. + 2011-02-23 Kenichi Handa * mail/rmailmm.el (rmail-mime-process-multipart): Do not signal an @@ -9055,7 +9059,7 @@ * htmlfontify.el (hfy-face-attr-for-class): Use append instead of nconc to avoid pure storage error (Bug#6239). -2010-06-27 Christoph (tiny change) +2010-06-27 Christoph Scholtes * bookmark.el (bookmark-bmenu-2-window, bookmark-bmenu-other-window) (bookmark-bmenu-other-window-with-mouse): Remove unnecessary @@ -11238,7 +11242,7 @@ * ido.el (ido-file-internal): Fix 2009-12-02 change. -2010-04-19 Christoph (tiny change) +2010-04-19 Christoph Scholtes * progmodes/grep.el (grep-compute-defaults): Fix handling of host default settings (Bug#5928). diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 199927d536e..2f113dfb479 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -227,6 +227,7 @@ the functions you loaded will not be able to run.") (defvar byte-compile-disable-print-circle nil "If non-nil, disable `print-circle' on printing a byte-compiled code.") +(make-obsolete-variable 'byte-compile-disable-print-circle nil "24.1") ;;;###autoload(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp) (defcustom byte-compile-dynamic-docstrings t diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el index 7e317ea09c0..c0fcf19d841 100644 --- a/lisp/international/ja-dic-cnv.el +++ b/lisp/international/ja-dic-cnv.el @@ -337,7 +337,7 @@ The name of generated file is specified by the variable `ja-dic-filename'." (erase-buffer) (buffer-disable-undo) (insert ";;; ja-dic.el --- dictionary for Japanese input method" - " -*-coding: euc-japan; byte-compile-disable-print-circle:t; -*-\n" + " -*-coding: euc-japan; -*-\n" ";;\tGenerated by the command `skkdic-convert'\n" ";;\tDate: " (current-time-string) "\n" ";;\tOriginal SKK dictionary file: " diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el index 935d66c613b..e68dc8bdc17 100644 --- a/lisp/international/titdic-cnv.el +++ b/lisp/international/titdic-cnv.el @@ -272,8 +272,7 @@ SPC, 6, 3, 4, or 7 specifing a tone (SPC:$(0?v(N(B, 6:$(0Dm(N(B, 3:$(0&9Vy (princ ";; Quail package `") (princ package) - (princ (format "' -*- coding:%s; " coding-system-for-write)) - (princ "byte-compile-disable-print-circle:t; -*-\n") + (princ (format "' -*- coding:%s -*-\n" coding-system-for-write)) (princ ";; Generated by the command `titdic-convert'\n;;\tDate: ") (princ (current-time-string)) (princ "\n;;\tOriginal TIT dictionary file: ") @@ -1154,8 +1153,8 @@ the generated Quail package is saved." (setq coding-system-for-write (coding-system-change-eol-conversion coding 'unix)) (with-temp-file (expand-file-name quailfile dirname) - (insert (format ";; Quail package `%s' -*- coding:%s; " name coding)) - (insert "byte-compile-disable-print-circle:t; -*-\n") + (insert (format ";; Quail package `%s' -*- coding:%s -*-\n" + name coding)) (insert ";; Generated by the command `miscdic-convert'\n") (insert ";; Date: " (current-time-string) "\n") (insert ";; Source dictionary file: " dicfile "\n") From 2c6584e8174f9ea276d0fae13e1a5f7d29f61d53 Mon Sep 17 00:00:00 2001 From: Ben Key Date: Wed, 23 Feb 2011 15:41:43 -0500 Subject: [PATCH 24/35] Fix handling of bar cursors in NS terminal. * nsterm.m (ns_draw_window_cursor): Obey the cursor_width argument directly, for bar cursors. * xdisp.c (set_frame_cursor_types): Don't write an undefined value into the frame's cursor_width. --- src/ChangeLog | 10 ++++++++++ src/nsterm.m | 52 +++++++++++++++++++++++++++++---------------------- src/xdisp.c | 2 +- 3 files changed, 41 insertions(+), 23 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3d22e15c3b3..ea1510b33db 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2011-02-23 Ben Key (tiny change) + + * nsterm.m (ns_draw_window_cursor): Obey the cursor_width argument + directly, for bar cursors. + +2011-02-23 Chong Yidong + + * xdisp.c (set_frame_cursor_types): Don't write an undefined value + into the frame's cursor_width. + 2011-02-23 Stefan Monnier * print.c (print_object): Never print old-style backquotes. diff --git a/src/nsterm.m b/src/nsterm.m index 038709869a9..8e77c89c3f7 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1072,7 +1072,7 @@ x_set_offset (struct frame *f, int xoff, int yoff, int change_grav) : f->left_pos; /* We use visibleFrame here to take menu bar into account. Ideally we should also adjust left/top with visibleFrame.origin. */ - + f->top_pos = f->size_hint_flags & YNegative ? ([screen visibleFrame].size.height + f->top_pos - FRAME_PIXEL_HEIGHT (f) - FRAME_NS_TITLEBAR_HEIGHT (f) @@ -1154,7 +1154,7 @@ x_set_window_size (struct frame *f, int change_grav, int cols, int rows) FRAME_TOOLBAR_HEIGHT (f) = 0; wr.size.width = pixelwidth + f->border_width; - wr.size.height = pixelheight + FRAME_NS_TITLEBAR_HEIGHT (f) + wr.size.height = pixelheight + FRAME_NS_TITLEBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); /* Do not try to constrain to this screen. We may have multiple @@ -2230,11 +2230,8 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x, int y, int cursor_type, int cursor_width, int on_p, int active_p) /* -------------------------------------------------------------------------- - External call (RIF): draw cursor - (modeled after x_draw_window_cursor - FIXME: cursor_width is effectively bogus -- it sometimes gets set - in xdisp.c set_frame_cursor_types, sometimes left uninitialized; - DON'T USE IT (no other terms do) + External call (RIF): draw cursor. + Note that CURSOR_WIDTH is meaningful only for (h)bar cursors. -------------------------------------------------------------------------- */ { NSRect r, s; @@ -2251,7 +2248,6 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, and mini-buffer. */ NSTRACE (dumpcursor); -//fprintf(stderr, "drawcursor (%d,%d) activep = %d\tonp = %d\tc_type = %d\twidth = %d\n",x,y, active_p,on_p,cursor_type,cursor_width); if (!on_p) return; @@ -2276,8 +2272,22 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, return; } + /* We draw the cursor (with NSRectFill), then draw the glyph on top + (other terminals do it the other way round). We must set + w->phys_cursor_width to the cursor width. For bar cursors, that + is CURSOR_WIDTH; for box cursors, it is the glyph width. */ get_phys_cursor_geometry (w, glyph_row, phys_cursor_glyph, &fx, &fy, &h); + /* The above get_phys_cursor_geometry call set w->phys_cursor_width + to the glyph width; replace with CURSOR_WIDTH for bar cursors. */ + if (cursor_type == BAR_CURSOR || cursor_type == HBAR_CURSOR) + { + if (cursor_width < 0) + cursor_width = FRAME_CURSOR_WIDTH (f); + cursor_width = min (cursor_width, 1); + w->phys_cursor_width = cursor_width; + } + r.origin.x = fx, r.origin.y = fy; r.size.height = h; r.size.width = w->phys_cursor_width; @@ -2285,7 +2295,7 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, /* FIXME: if we overwrite the internal border area, it does not get erased; fix by truncating cursor, but better would be to erase properly */ overspill = r.origin.x + r.size.width - - WINDOW_TEXT_TO_FRAME_PIXEL_X (w, WINDOW_BOX_RIGHT_EDGE_X (w) + WINDOW_TEXT_TO_FRAME_PIXEL_X (w, WINDOW_BOX_RIGHT_EDGE_X (w) - WINDOW_TOTAL_FRINGE_WIDTH (w) - FRAME_INTERNAL_BORDER_WIDTH (f)); if (overspill > 0) r.size.width -= overspill; @@ -2335,8 +2345,6 @@ ns_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, break; case BAR_CURSOR: s = r; - s.size.width = min (cursor_width, 2); //FIXME(see above) - /* If the character under cursor is R2L, draw the bar cursor on the right of its glyph, rather than on the left. */ cursor_glyph = get_phys_cursor_glyph (w); @@ -2984,7 +2992,7 @@ ns_draw_glyph_string (struct glyph_string *s) NS_FACE_BACKGROUND (s->face) = NS_FACE_FOREGROUND (s->face); NS_FACE_FOREGROUND (s->face) = tmp; } - + ns_tmp_font->font.driver->draw (s, 0, s->nchars, s->x, s->y, (ns_tmp_flags == NS_DUMPGLYPH_NORMAL && !s->background_filled_p) @@ -3010,9 +3018,9 @@ ns_draw_glyph_string (struct glyph_string *s) else ns_maybe_dumpglyphs_background (s, s->first_glyph->type == COMPOSITE_GLYPH); - /* ... */ + /* ... */ /* Not yet implemented. */ - /* ... */ + /* ... */ ns_unfocus (s->f); break; @@ -3785,7 +3793,7 @@ ns_term_init (Lisp_Object display_name) strncpy (terminal->name, SDATA (display_name), SBYTES (display_name)); terminal->name[SBYTES (display_name)] = 0; - UNBLOCK_INPUT; + UNBLOCK_INPUT; if (!inhibit_x_resources) { @@ -3802,7 +3810,7 @@ ns_term_init (Lisp_Object display_name) stringForKey: @"AppleHighlightColor"]; if (ns_selection_color == nil) ns_selection_color = NS_SELECTION_COLOR_DEFAULT; - + { NSColorList *cl = [NSColorList colorListNamed: @"Emacs"]; @@ -3898,7 +3906,7 @@ ns_term_init (Lisp_Object display_name) keyEquivalent: @"q" atIndex: 9]; - item = [mainMenu insertItemWithTitle: ns_app_name + item = [mainMenu insertItemWithTitle: ns_app_name action: @selector (menuDown:) keyEquivalent: @"" atIndex: 0]; @@ -4103,7 +4111,7 @@ ns_term_shutdown (int sig) -appShouldTerminate Cancel -> Nothing else Accept -> - + -terminate KEY_NS_POWER_OFF, (save-buffers-kill-emacs) ns_term_shutdown() @@ -4113,10 +4121,10 @@ ns_term_shutdown (int sig) - (void) terminate: (id)sender { struct frame *emacsframe = SELECTED_FRAME (); - + if (!emacs_event) return; - + emacs_event->kind = NS_NONKEY_EVENT; emacs_event->code = KEY_NS_POWER_OFF; emacs_event->arg = Qt; /* mark as non-key event */ @@ -4418,7 +4426,7 @@ ns_term_shutdown (int sig) code = ([[theEvent charactersIgnoringModifiers] length] == 0) ? 0 : [[theEvent charactersIgnoringModifiers] characterAtIndex: 0]; /* (Carbon way: [theEvent keyCode]) */ - + /* is it a "function key"? */ fnKeysym = ns_convert_key (code); if (fnKeysym) @@ -5446,7 +5454,7 @@ ns_term_shutdown (int sig) /* drawRect: may be called (at least in OS X 10.5) for invisible - views as well for some reason. Thus, do not infer visibility + views as well for some reason. Thus, do not infer visibility here. emacsframe->async_visible = 1; diff --git a/src/xdisp.c b/src/xdisp.c index e144237d34e..35f4859f1b3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -23252,7 +23252,7 @@ get_specified_cursor_type (Lisp_Object arg, int *width) void set_frame_cursor_types (struct frame *f, Lisp_Object arg) { - int width; + int width = 1; Lisp_Object tem; FRAME_DESIRED_CURSOR (f) = get_specified_cursor_type (arg, &width); From fa41748c1425908789f9c5e5beab7b4850e8b279 Mon Sep 17 00:00:00 2001 From: Gnus developers Date: Wed, 23 Feb 2011 22:59:34 +0000 Subject: [PATCH 25/35] Merge changes made in Gnus trunk. gnus-art.el (article-make-date-line): Ignore errors if time is invalid and not convertible. (article-make-date-line): Only add lapsed time if time is not nil. auth-source.el (auth-source-netrc-element-or-first): New function to DTRT for parameter extraction. (auth-source-netrc-create): Use it and fix multiple parameter print bug. Use the default passed from above (given-default) or the built-in (user-login-name for :user). --- lisp/gnus/ChangeLog | 11 +++++++++++ lisp/gnus/auth-source.el | 29 ++++++++++++++++++++++------- lisp/gnus/gnus-art.el | 3 ++- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 0d8dfe0ea91..45f0d68023d 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,7 +1,18 @@ +2011-02-23 Julien Danjou + + * gnus-art.el (article-make-date-line): Ignore errors if time is + invalid and not convertible. + (article-make-date-line): Only add lapsed time if time is not nil. + 2011-02-23 Teodor Zlatanov * auth-source.el (auth-source-netrc-create): Use `read-char' instead of `read-char-choice' for backwards compatibility. + (auth-source-netrc-element-or-first): New function to DTRT for + parameter extraction. + (auth-source-netrc-create): Use it and fix multiple parameter print + bug. Use the default passed from above (given-default) or the + built-in (user-login-name for :user). 2011-02-23 Lars Ingebrigtsen diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index d349022e7b7..a7f626c3cd3 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -898,6 +898,11 @@ See `auth-source-search' for details on SPEC." (plist-put spec :create nil))))) results)) +(defun auth-source-netrc-element-or-first (v) + (if (listp v) + (nth 0 v) + v)) + ;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t) ;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t :create-extra-keys '((A "default A") (B))) @@ -943,9 +948,7 @@ See `auth-source-search' for details on SPEC." (dolist (r required) (let* ((data (aget valist r)) ;; take the first element if the data is a list - (data (if (listp data) - (nth 0 data) - data)) + (data (auth-source-netrc-element-or-first data)) ;; this is the default to be offered (given-default (aget auth-source-creation-defaults r)) ;; the default supplementals are simple: for the user, @@ -961,10 +964,22 @@ See `auth-source-search' for details on SPEC." ((and (null data) (eq r 'secret)) ;; special case prompt for passwords (read-passwd (format "Password for %s@%s:%s: " - (or (aget valist 'user) "[any user]") - (or (aget valist 'host) "[any host]") - (or (aget valist 'port) "[any port]")))) - (t data))) + (or + (auth-source-netrc-element-or-first + (aget valist 'user)) + (plist-get artificial :user) + "[any user]") + (or + (auth-source-netrc-element-or-first + (aget valist 'host)) + (plist-get artificial :host) + "[any host]") + (or + (auth-source-netrc-element-or-first + (aget valist 'port)) + (plist-get artificial :port) + "[any port]")))) + (t (or data default)))) (when data (setq artificial (plist-put artificial diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 2a36c43130c..5b3489a72ee 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -3463,7 +3463,7 @@ possible values." combined-lapsed)) (error "Unknown conversion type: %s" type)) (condition-case () - (let ((time (date-to-time date))) + (let ((time (ignore-errors (date-to-time date)))) (cond ;; Convert to the local timezone. ((eq type 'local) @@ -3515,6 +3515,7 @@ possible values." (segments 3) lapsed-string) (while (and + time (setq lapsed-string (concat " (" (article-lapsed-string time segments) ")")) (> (+ (length date-string) From 2d8a57efcb7f5c2b39dd4319bc4f17c6bff20635 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 23 Feb 2011 19:53:27 -0800 Subject: [PATCH 26/35] Avoid some possible prompts from autoloads.el. * lisp/emacs-lisp/autoload.el (autoload-save-buffers) (autoload-find-destination, update-directory-autoloads): Avoid prompts when updating autoloads. --- lisp/ChangeLog | 6 ++++++ lisp/emacs-lisp/autoload.el | 16 ++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 33f39c00a60..28d09e7b2c8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-02-24 Glenn Morris + + * emacs-lisp/autoload.el (autoload-save-buffers) + (autoload-find-destination, update-directory-autoloads): + Avoid prompts when updating autoloads. + 2011-02-23 Stefan Monnier * emacs-lisp/bytecomp.el (byte-compile-disable-print-circle): Obsolete. diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 7b610d11b0f..d6e7ee9e3cb 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -537,7 +537,8 @@ Return non-nil if and only if FILE adds no autoloads to OUTFILE (defun autoload-save-buffers () (while autoload-modified-buffers (with-current-buffer (pop autoload-modified-buffers) - (save-buffer)))) + (let ((version-control 'never)) + (save-buffer))))) ;;;###autoload (defun update-file-autoloads (file &optional save-after) @@ -569,8 +570,9 @@ removes any prior now out-of-date autoload entries." (with-current-buffer ;; We used to use `raw-text' to read this file, but this causes ;; problems when the file contains non-ASCII characters. - (find-file-noselect - (autoload-ensure-default-file (autoload-generated-file))) + (let ((enable-local-variables :safe)) + (find-file-noselect + (autoload-ensure-default-file (autoload-generated-file)))) ;; This is to make generated-autoload-file have Unix EOLs, so ;; that it is portable to all platforms. (or (eq 0 (coding-system-eol-type buffer-file-coding-system)) @@ -656,8 +658,9 @@ directory or directories specified." (autoload-modified-buffers nil)) (with-current-buffer - (find-file-noselect - (autoload-ensure-default-file (autoload-generated-file))) + (let ((enable-local-variables :safe)) + (find-file-noselect + (autoload-ensure-default-file (autoload-generated-file)))) (save-excursion ;; Canonicalize file names and remove the autoload file itself. @@ -721,7 +724,8 @@ directory or directories specified." (current-buffer) nil nil no-autoloads this-time) (insert generate-autoload-section-trailer)) - (save-buffer) + (let ((version-control 'never)) + (save-buffer)) ;; In case autoload entries were added to other files because of ;; file-local autoload-generated-file settings. (autoload-save-buffers)))) From 3cbbfdc34f9ef2c32f485b8d3ce444689115fa3c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 23 Feb 2011 19:56:36 -0800 Subject: [PATCH 27/35] * admin/notes/bzr: Small updates. --- admin/notes/bzr | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/admin/notes/bzr b/admin/notes/bzr index a6fbcf22bb2..14a5c92a454 100644 --- a/admin/notes/bzr +++ b/admin/notes/bzr @@ -75,6 +75,12 @@ This will make merging ChangeLogs a lot smoother. It merges new entries to the top of the file, rather than trying to fit them in mid-way through. +Sigh. This plugin has a drawback. People often like to edit older +ChangeLog entries, not at the head of the file. Frequently they do +this in the same commit as making new entries. Using this plugin +will merge ALL changed entries (including older ones) to the top of +the destination file. + 1) Get clean, up-to-date copies of the emacs-23 and trunk branches. Check for any uncommitted changes with bzr status. @@ -121,6 +127,8 @@ to adjust dates by hand. In any case, if someone made multiple ChangeLog entries on different days in the branch, you may wish to collapse them all to a single entry for that author in the trunk (because in the trunk they all appear under the same date). +Obviously, if there are multiple changes to the same file by different +authors, don't break the logical ordering in doing this. Notes: From b36f2f1cb8fc121bf6fe44e5260d114a9f46d950 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 23 Feb 2011 19:59:04 -0800 Subject: [PATCH 28/35] Dired-X fix for bug#5216. * lisp/dired-x.el (dired-hack-local-variables): Handle interrupts during hacking local variables. --- lisp/ChangeLog | 3 +++ lisp/dired-x.el | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 28d09e7b2c8..6ce81a9214a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-02-24 Glenn Morris + * dired-x.el (dired-hack-local-variables): + Handle interrupts during hacking local variables. (Bug#5216) + * emacs-lisp/autoload.el (autoload-save-buffers) (autoload-find-destination, update-directory-autoloads): Avoid prompts when updating autoloads. diff --git a/lisp/dired-x.el b/lisp/dired-x.el index dcf8906976b..ce07676fc99 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -774,12 +774,13 @@ See also `dired-enable-local-variables'." (insert "\^L\n") (insert-file-contents dired-local-variables-file)) ;; Hack 'em. - (let ((buffer-file-name dired-local-variables-file)) - (hack-local-variables)) + (unwind-protect + (let ((buffer-file-name dired-local-variables-file)) + (hack-local-variables)) + ;; Delete this stuff: `eobp' is used to find last subdir by dired.el. + (delete-region opoint (point-max))) ;; Make sure that the modeline shows the proper information. - (dired-sort-set-modeline) - ;; Delete this stuff: `eobp' is used to find last subdir by dired.el. - (delete-region opoint (point-max))))) + (dired-sort-set-modeline)))) (make-obsolete 'dired-hack-local-variables 'hack-dir-local-variables-non-file-buffer "24.1") From 1e8dbdc6e86cd6ccda42c3c106f04190ba9acca0 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 23 Feb 2011 20:28:17 -0800 Subject: [PATCH 29/35] Replace some obsolete autoconf syntax. * configure.in: Replace obsolete AC_OUTPUT() with AC_CONFIG_FILES(), AC_CONFIG_COMMANDS(), and AC_OUTPUT sans arguments. --- ChangeLog | 5 +++++ configure.in | 30 +++++++++++++++++++----------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5aacf77688b..b57b3236023 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-02-24 Glenn Morris + + * configure.in: Replace obsolete AC_OUTPUT() with AC_CONFIG_FILES(), + AC_CONFIG_COMMANDS(), and AC_OUTPUT sans arguments. + 2011-02-22 Paul Eggert Assume S_ISLNK etc. work, since gnulib supports this. diff --git a/configure.in b/configure.in index fa5ae960c59..b832b79994e 100644 --- a/configure.in +++ b/configure.in @@ -3706,6 +3706,18 @@ fi test "${exec_prefix}" != NONE && exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`] +AC_CONFIG_FILES([Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \ + doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \ + doc/lispref/Makefile src/Makefile \ + lwlib/Makefile lisp/Makefile leim/Makefile test/automated/Makefile]) + +dnl Make the necessary directories, if they don't exist. +AC_CONFIG_COMMANDS([mkdirs], [ +for dir in etc lisp ; do + test -d ${dir} || mkdir ${dir} +done +]) + dnl You might wonder (I did) why epaths.h is generated by running make, dnl rather than just letting configure generate it from epaths.in. dnl One reason is that the various paths are not fully expanded (see above); @@ -3714,22 +3726,18 @@ dnl Secondly, the GNU Coding standards require that one should be able dnl to run `make prefix=/some/where/else' and override the values set dnl by configure. This also explains the `move-if-change' test and dnl the use of force in the `epaths-force' rule in Makefile.in. -AC_OUTPUT(Makefile lib/Makefile lib-src/Makefile oldXMenu/Makefile \ - doc/emacs/Makefile doc/misc/Makefile doc/lispintro/Makefile \ - doc/lispref/Makefile src/Makefile \ - lwlib/Makefile lisp/Makefile leim/Makefile test/automated/Makefile, [ - -### Make the necessary directories, if they don't exist. -for dir in etc lisp ; do - test -d ${dir} || mkdir ${dir} -done - +AC_CONFIG_COMMANDS([epaths], [ echo creating src/epaths.h ${MAKE-make} epaths-force +], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPPFLAGS="$CPPFLAGS"]) +AC_CONFIG_COMMANDS([gdbinit], [ if test ! -f src/.gdbinit && test -f $srcdir/src/.gdbinit; then echo creating src/.gdbinit echo source $srcdir/src/.gdbinit > src/.gdbinit fi +]) -], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPPFLAGS="$CPPFLAGS"]) +AC_OUTPUT + +dnl configure.in ends here From a22e7484fa1e26e3caf2658c91d5e245169b55a1 Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Thu, 24 Feb 2011 06:32:33 +0000 Subject: [PATCH 30/35] auth-source.el (auth-source-netrc-create): Use `read-char' with no argument that XEmacs doesn't support. --- lisp/gnus/ChangeLog | 5 +++++ lisp/gnus/auth-source.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 45f0d68023d..9dd315782ff 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2011-02-24 Katsumi Yamaoka + + * auth-source.el (auth-source-netrc-create): Use `read-char' with no + argument that XEmacs doesn't support. + 2011-02-23 Julien Danjou * gnus-art.el (article-make-date-line): Ignore errors if time is diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el index a7f626c3cd3..63ec93dd760 100644 --- a/lisp/gnus/auth-source.el +++ b/lisp/gnus/auth-source.el @@ -1031,7 +1031,8 @@ See `auth-source-search' for details on SPEC." "(y)es/(n)o but use it/(e)dit line/(s)kip file")) done k) (while (not done) - (setq k (read-char prompt)) + (message "%s" prompt) + (setq k (read-char)) (case k (?y (setq done t)) (?n (setq add "" From ebe401f69718e17144fc7f7a8ab36f7c12452f2a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 23 Feb 2011 23:47:06 -0800 Subject: [PATCH 31/35] Partial fix for bug#8095. * lisp/files.el (dir-locals-find-file): Doc fix. Fix the check for cache elements that have no associated file, and the mtime check for those that do. Still to do: some places that use dir-locals-find-file assume the result is always a file, which is not true. (The function name is misleading.) --- lisp/ChangeLog | 4 +++ lisp/files.el | 77 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 51 insertions(+), 30 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6ce81a9214a..d77e6b7ccd8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2011-02-24 Glenn Morris + * files.el (dir-locals-find-file): Doc fix. + Fix the check for cache elements that have no associated file, + and the mtime check for those that do. + * dired-x.el (dired-hack-local-variables): Handle interrupts during hacking local variables. (Bug#5216) diff --git a/lisp/files.el b/lisp/files.el index 3409ebe02e1..e4cc782b1d1 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3347,11 +3347,11 @@ Each element in this list has the form (DIR CLASS MTIME). DIR is the name of the directory. CLASS is the name of a variable class (a symbol). MTIME is the recorded modification time of the directory-local - variables file associated with this entry. This time is a list - of two integers (the same format as `file-attributes'), and is - used to test whether the cache entry is still valid. - Alternatively, MTIME can be nil, which means the entry is always - considered valid.") +variables file associated with this entry. This time is a list +of two integers (the same format as `file-attributes'), and is +used to test whether the cache entry is still valid. +Alternatively, MTIME can be nil, which means the entry is always +considered valid.") (defsubst dir-locals-get-class-variables (class) "Return the variable list for CLASS." @@ -3460,13 +3460,20 @@ across different environments and users.") (defun dir-locals-find-file (file) "Find the directory-local variables for FILE. This searches upward in the directory tree from FILE. -If the directory root of FILE has been registered in - `dir-locals-directory-cache' and the directory-local variables - file has not been modified, return the matching entry in - `dir-locals-directory-cache'. -Otherwise, if a directory-local variables file is found, return - the file name. -Otherwise, return nil." +It stops at the first directory that has been registered in +`dir-locals-directory-cache' or contains a `dir-locals-file'. +If it finds an entry in the cache, it checks that it is valid. +A cache entry with no modification time element (normally, one that +has been assigned directly using `dir-locals-set-directory-class', not +set from a file) is always valid. +A cache entry based on a `dir-locals-file' is valid if the modification +time stored in the cache matches the current file modification time. +If not, the cache entry is cleared so that the file will be re-read. + +This function returns either nil (no directory local variables found), +or the matching entry from `dir-locals-directory-cache' (a list), +or the full path to the `dir-locals-file' (a string) in the case +of no valid cache entry." (setq file (expand-file-name file)) (let* ((dir-locals-file-name (if (eq system-type 'ms-dos) @@ -3475,8 +3482,8 @@ Otherwise, return nil." (locals-file (locate-dominating-file file dir-locals-file-name)) (dir-elt nil)) ;; `locate-dominating-file' may have abbreviated the name. - (when locals-file - (setq locals-file (expand-file-name dir-locals-file-name locals-file))) + (if locals-file + (setq locals-file (expand-file-name dir-locals-file-name locals-file))) ;; Find the best cached value in `dir-locals-directory-cache'. (dolist (elt dir-locals-directory-cache) (when (and (eq t (compare-strings file nil (length (car elt)) @@ -3485,23 +3492,32 @@ Otherwise, return nil." '(windows-nt cygwin ms-dos)))) (> (length (car elt)) (length (car dir-elt)))) (setq dir-elt elt))) - (let ((use-cache (and dir-elt - (or (null locals-file) - (<= (length (file-name-directory locals-file)) - (length (car dir-elt))))))) - (if use-cache - ;; Check the validity of the cache. - (if (and (file-readable-p (car dir-elt)) - (or (null (nth 2 dir-elt)) + (if (and dir-elt + (or (null locals-file) + (<= (length (file-name-directory locals-file)) + (length (car dir-elt))))) + ;; Found a potential cache entry. Check validity. + ;; A cache entry with no MTIME is assumed to always be valid + ;; (ie, set directly, not from a dir-locals file). + ;; Note, we don't bother to check that there is a matching class + ;; element in dir-locals-class-alist, since that's done by + ;; dir-locals-set-directory-class. + (if (or (null (nth 2 dir-elt)) + (let ((cached-file (expand-file-name dir-locals-file-name + (car dir-elt)))) + (and (file-readable-p cached-file) (equal (nth 2 dir-elt) - (nth 5 (file-attributes (car dir-elt)))))) - ;; This cache entry is OK. - dir-elt - ;; This cache entry is invalid; clear it. - (setq dir-locals-directory-cache - (delq dir-elt dir-locals-directory-cache)) - locals-file) - locals-file)))) + (nth 5 (file-attributes cached-file)))))) + ;; This cache entry is OK. + dir-elt + ;; This cache entry is invalid; clear it. + (setq dir-locals-directory-cache + (delq dir-elt dir-locals-directory-cache)) + ;; Return the first existing dir-locals file. Might be the same + ;; as dir-elt's, might not (eg latter might have been deleted). + locals-file) + ;; No cache entry. + locals-file))) (defun dir-locals-read-from-file (file) "Load a variables FILE and register a new class and instance. @@ -3531,6 +3547,7 @@ and `file-local-variables-alist', without applying them." (dir-name nil)) (cond ((stringp variables-file) + ;; FIXME seems like the wrong dir-name. (setq dir-name (if (buffer-file-name) (file-name-directory (buffer-file-name)) default-directory)) From 07915ed93c1a21776f7371e615b43d0d79eaebfd Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 24 Feb 2011 00:02:45 -0800 Subject: [PATCH 32/35] More dir-locals fixes for files.el. * lisp/files.el (hack-local-variables-confirm, hack-local-variables-filter): Doc fix (say _which_ directory `dir-name' is). (hack-dir-local-variables): Fix setting of `dir-name'. Previous value seems clearly wrong. Eg put a risky variable in a dir-locals file, visit a file in a subdirectory, see which directory it says the risky variables come from. It should be the one with the associated directory variables, not the one containing the visited file. --- lisp/ChangeLog | 3 +++ lisp/files.el | 15 ++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d77e6b7ccd8..cb0708aa0fa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-02-24 Glenn Morris + * files.el (hack-dir-local-variables): Fix setting of `dir-name'. + (hack-local-variables-confirm, hack-local-variables-filter): Doc fix. + * files.el (dir-locals-find-file): Doc fix. Fix the check for cache elements that have no associated file, and the mtime check for those that do. diff --git a/lisp/files.el b/lisp/files.el index e4cc782b1d1..5890bf9b8c9 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2919,8 +2919,8 @@ variable to set.") ALL-VARS is the list of all variables to be set up. UNSAFE-VARS is the list of those that aren't marked as safe or risky. RISKY-VARS is the list of those that are marked as risky. -DIR-NAME is a directory name if these settings come from -directory-local variables, or nil otherwise." +If these settings come from directory-local variables, then +DIR-NAME is the name of the associated directory. Otherwise it is nil." (if noninteractive nil (save-window-excursion @@ -3062,8 +3062,8 @@ VARIABLES is the alist of variable-value settings. This alist is `enable-local-eval', `enable-local-variables', and (if necessary) user interaction. The results are added to `file-local-variables-alist', without applying them. -DIR-NAME is a directory name if these settings come from - directory-local variables, or nil otherwise." +If these settings come from directory-local variables, then +DIR-NAME is the name of the associated directory. Otherwise it is nil." ;; Find those variables that we may want to save to ;; `safe-local-variable-values'. (let (all-vars risky-vars unsafe-vars) @@ -3547,11 +3547,8 @@ and `file-local-variables-alist', without applying them." (dir-name nil)) (cond ((stringp variables-file) - ;; FIXME seems like the wrong dir-name. - (setq dir-name (if (buffer-file-name) - (file-name-directory (buffer-file-name)) - default-directory)) - (setq class (dir-locals-read-from-file variables-file))) + (setq dir-name (file-name-directory variables-file) + class (dir-locals-read-from-file variables-file))) ((consp variables-file) (setq dir-name (nth 0 variables-file)) (setq class (nth 1 variables-file)))) From 303f9ae0146c9bc42985e98a07b86be0cb1c6eca Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 24 Feb 2011 00:26:25 -0800 Subject: [PATCH 33/35] Fix for another bit of bug#8095, re dir-locals. * lisp/help-fns.el (describe-variable): Return consistent results when a dir-local from a file came from the cache or did not. If a dir-local has no associated file, say it came from a "directory". --- lisp/ChangeLog | 6 +++++- lisp/help-fns.el | 20 +++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cb0708aa0fa..05bddd0a7d9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,11 +1,15 @@ 2011-02-24 Glenn Morris + * help-fns.el (describe-variable): Return consistent results when a + dir-local from a file came from the cache or did not. (Bug#8095) + If a dir-local has no associated file, say it came from a "directory". + * files.el (hack-dir-local-variables): Fix setting of `dir-name'. (hack-local-variables-confirm, hack-local-variables-filter): Doc fix. * files.el (dir-locals-find-file): Doc fix. Fix the check for cache elements that have no associated file, - and the mtime check for those that do. + and the mtime check for those that do. (Bug#8095) * dired-x.el (dired-hack-local-variables): Handle interrupts during hacking local variables. (Bug#5216) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 1cd5526fcff..38e331dc992 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -748,15 +748,21 @@ it is displayed along with the global value." (setq extra-line t) (if (member (cons variable val) dir-local-variables-alist) (let ((file (and (buffer-file-name) - (not (file-remote-p (buffer-file-name))) - (dir-locals-find-file (buffer-file-name))))) + (not (file-remote-p (buffer-file-name))) + (dir-locals-find-file + (buffer-file-name)))) + (type "file")) (princ " This variable is a directory local variable") (when file - (princ (concat "\n from the file \"" - (if (consp file) - (car file) - file) - "\""))) + (if (consp file) ; result from cache + ;; If the cache element has an mtime, we + ;; assume it came from a file. + (if (nth 2 file) + (setq file (expand-file-name + dir-locals-file (car file))) + ;; Otherwise, assume it was set directly. + (setq type "directory"))) + (princ (format "\n from the %s \"%s\"" type file))) (princ ".\n")) (princ " This variable is a file local variable.\n"))) From 6a88f031c8a895c87143da01201502e966aa7641 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 24 Feb 2011 00:45:25 -0800 Subject: [PATCH 34/35] Yet more directory-local variables fixes. * lisp/files-x.el (modify-dir-local-variable): Handle dir-locals from the cache, and from non-file sources. --- lisp/ChangeLog | 3 +++ lisp/files-x.el | 22 ++++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 05bddd0a7d9..c44c491cad0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-02-24 Glenn Morris + * files-x.el (modify-dir-local-variable): Handle dir-locals from + the cache, and from non-file sources. + * help-fns.el (describe-variable): Return consistent results when a dir-local from a file came from the cache or did not. (Bug#8095) If a dir-local has no associated file, say it came from a "directory". diff --git a/lisp/files-x.el b/lisp/files-x.el index a3cb5331e67..a9c32477155 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -360,18 +360,28 @@ from the MODE alist ignoring the input argument VALUE." (catch 'exit (unless enable-local-variables (throw 'exit (message "Directory-local variables are disabled"))) - (let ((variables-file (or (and (buffer-file-name) (not (file-remote-p (buffer-file-name))) (dir-locals-find-file (buffer-file-name))) dir-locals-file)) variables) - + (if (consp variables-file) ; result from cache + ;; If cache element has an mtime, assume it came from a file. + ;; Otherwise, assume it was set directly. + (setq variables-file (if (nth 2 variables-file) + (expand-file-name dir-locals-file + (car variables-file)) + (cadr variables-file)))) + ;; I can't be bothered to handle this case right now. + ;; Dir locals were set directly from a class. You need to + ;; directly modify the class in dir-locals-class-alist. + (and variables-file (not (stringp variables-file)) + (throw 'exit (message "Directory locals were not set from a file"))) ;; Don't create ".dir-locals.el" for the deletion operation. - (when (and (eq op 'delete) - (not (file-exists-p variables-file))) - (throw 'exit (message "File .dir-locals.el not found"))) - + (and (eq op 'delete) + (or (not variables-file) + (not (file-exists-p variables-file))) + (throw 'exit (message "No .dir-locals.el file was found"))) (let ((auto-insert nil)) (find-file variables-file)) (widen) From b18947669cd182ec8487b317460f6df5878d0f11 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 24 Feb 2011 22:30:50 -0800 Subject: [PATCH 35/35] * dired.c (Ffile_attributes): Increase size of modes from 10 to 12 --- src/ChangeLog | 6 ++++++ src/dired.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index ea1510b33db..29a213a1e09 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-02-25 Paul Eggert + + * dired.c (Ffile_attributes): Increase size of modes from 10 to 12 + as per recent filemodestring API change. Reported by Jonas Ă–ster in + . + 2011-02-23 Ben Key (tiny change) * nsterm.m (ns_draw_window_cursor): Obey the cursor_width argument diff --git a/src/dired.c b/src/dired.c index eea4c7cfe40..ce2a3d105e5 100644 --- a/src/dired.c +++ b/src/dired.c @@ -937,7 +937,7 @@ so last access time will always be midnight of that day. */) Lisp_Object dirname; struct stat sdir; #endif /* BSD4_2 */ - char modes[10]; + char modes[12]; Lisp_Object handler; struct gcpro gcpro1; char *uname = NULL, *gname = NULL;