Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 103413. ------------------------------------------------------------ revno: 103413 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-02-23 23:47:06 -0800 message: 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.) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-24 03:59:04 +0000 +++ lisp/ChangeLog 2011-02-24 07:47:06 +0000 @@ -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) === modified file 'lisp/files.el' --- lisp/files.el 2011-02-23 03:24:23 +0000 +++ lisp/files.el 2011-02-24 07:47:06 +0000 @@ -3347,11 +3347,11 @@ 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 @@ (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 @@ (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 @@ '(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 @@ (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)) ------------------------------------------------------------ revno: 103412 committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2011-02-24 06:32:33 +0000 message: auth-source.el (auth-source-netrc-create): Use `read-char' with no argument that XEmacs doesn't support. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-02-23 22:59:34 +0000 +++ lisp/gnus/ChangeLog 2011-02-24 06:32:33 +0000 @@ -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 === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2011-02-23 22:59:34 +0000 +++ lisp/gnus/auth-source.el 2011-02-24 06:32:33 +0000 @@ -1031,7 +1031,8 @@ "(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 "" ------------------------------------------------------------ revno: 103411 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-02-23 20:28:17 -0800 message: Replace some obsolete autoconf syntax. * configure.in: Replace obsolete AC_OUTPUT() with AC_CONFIG_FILES(), AC_CONFIG_COMMANDS(), and AC_OUTPUT sans arguments. diff: === modified file 'ChangeLog' --- ChangeLog 2011-02-22 01:55:20 +0000 +++ ChangeLog 2011-02-24 04:28:17 +0000 @@ -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. === modified file 'configure.in' --- configure.in 2011-02-22 01:55:20 +0000 +++ configure.in 2011-02-24 04:28:17 +0000 @@ -3706,6 +3706,18 @@ 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 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 ------------------------------------------------------------ revno: 103410 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-02-23 19:59:04 -0800 message: Dired-X fix for bug#5216. * lisp/dired-x.el (dired-hack-local-variables): Handle interrupts during hacking local variables. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-24 03:53:27 +0000 +++ lisp/ChangeLog 2011-02-24 03:59:04 +0000 @@ -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. === modified file 'lisp/dired-x.el' --- lisp/dired-x.el 2011-02-23 03:44:13 +0000 +++ lisp/dired-x.el 2011-02-24 03:59:04 +0000 @@ -774,12 +774,13 @@ (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") ------------------------------------------------------------ revno: 103409 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-02-23 19:56:36 -0800 message: * admin/notes/bzr: Small updates. diff: === modified file 'admin/notes/bzr' --- admin/notes/bzr 2011-02-23 04:24:13 +0000 +++ admin/notes/bzr 2011-02-24 03:56:36 +0000 @@ -75,6 +75,12 @@ 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 @@ 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: ------------------------------------------------------------ revno: 103408 committer: Glenn Morris branch nick: trunk timestamp: Wed 2011-02-23 19:53:27 -0800 message: 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. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-23 15:22:28 +0000 +++ lisp/ChangeLog 2011-02-24 03:53:27 +0000 @@ -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. === modified file 'lisp/emacs-lisp/autoload.el' --- lisp/emacs-lisp/autoload.el 2011-01-26 08:36:39 +0000 +++ lisp/emacs-lisp/autoload.el 2011-02-24 03:53:27 +0000 @@ -537,7 +537,8 @@ (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 @@ (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 @@ (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 @@ (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)))) ------------------------------------------------------------ revno: 103407 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2011-02-23 22:59:34 +0000 message: 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). diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-02-23 14:34:44 +0000 +++ lisp/gnus/ChangeLog 2011-02-23 22:59:34 +0000 @@ -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 === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2011-02-23 14:34:44 +0000 +++ lisp/gnus/auth-source.el 2011-02-23 22:59:34 +0000 @@ -898,6 +898,11 @@ (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 @@ (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 @@ ((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 === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2011-02-22 13:31:15 +0000 +++ lisp/gnus/gnus-art.el 2011-02-23 22:59:34 +0000 @@ -3463,7 +3463,7 @@ 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 @@ (segments 3) lapsed-string) (while (and + time (setq lapsed-string (concat " (" (article-lapsed-string time segments) ")")) (> (+ (length date-string) ------------------------------------------------------------ revno: 103406 author: Ben Key committer: Chong Yidong branch nick: trunk timestamp: Wed 2011-02-23 15:41:43 -0500 message: 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. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-23 15:14:21 +0000 +++ src/ChangeLog 2011-02-23 20:41:43 +0000 @@ -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. === modified file 'src/nsterm.m' --- src/nsterm.m 2011-02-22 14:13:54 +0000 +++ src/nsterm.m 2011-02-23 20:41:43 +0000 @@ -1072,7 +1072,7 @@ : 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ /* 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 @@ 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_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 @@ else ns_maybe_dumpglyphs_background (s, s->first_glyph->type == COMPOSITE_GLYPH); - /* ... */ + /* ... */ /* Not yet implemented. */ - /* ... */ + /* ... */ ns_unfocus (s->f); break; @@ -3785,7 +3793,7 @@ 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 @@ stringForKey: @"AppleHighlightColor"]; if (ns_selection_color == nil) ns_selection_color = NS_SELECTION_COLOR_DEFAULT; - + { NSColorList *cl = [NSColorList colorListNamed: @"Emacs"]; @@ -3898,7 +3906,7 @@ 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 @@ -appShouldTerminate Cancel -> Nothing else Accept -> - + -terminate KEY_NS_POWER_OFF, (save-buffers-kill-emacs) ns_term_shutdown() @@ -4113,10 +4121,10 @@ - (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 @@ 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 @@ /* 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; === modified file 'src/xdisp.c' --- src/xdisp.c 2011-02-18 15:11:10 +0000 +++ src/xdisp.c 2011-02-23 20:41:43 +0000 @@ -23252,7 +23252,7 @@ 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); ------------------------------------------------------------ revno: 103405 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2011-02-23 10:22:28 -0500 message: * lisp/emacs-lisp/bytecomp.el (byte-compile-disable-print-circle): Obsolete. diff: === modified file 'etc/NEWS' --- etc/NEWS 2011-02-23 04:47:11 +0000 +++ etc/NEWS 2011-02-23 15:22:28 +0000 @@ -712,6 +712,7 @@ * 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 === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2011-02-22 18:08:53 +0000 +++ lib-src/ChangeLog 2011-02-23 15:22:28 +0000 @@ -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. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-02-23 04:19:28 +0000 +++ lisp/ChangeLog 2011-02-23 15:22:28 +0000 @@ -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). === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2011-01-25 04:08:28 +0000 +++ lisp/emacs-lisp/bytecomp.el 2011-02-23 15:22:28 +0000 @@ -227,6 +227,7 @@ (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 === modified file 'lisp/international/ja-dic-cnv.el' --- lisp/international/ja-dic-cnv.el 2011-01-15 23:16:57 +0000 +++ lisp/international/ja-dic-cnv.el 2011-02-23 15:22:28 +0000 @@ -337,7 +337,7 @@ (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: " === modified file 'lisp/international/titdic-cnv.el' --- lisp/international/titdic-cnv.el 2011-01-25 04:08:28 +0000 +++ lisp/international/titdic-cnv.el 2011-02-23 15:22:28 +0000 @@ -272,8 +272,7 @@ (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 @@ (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") ------------------------------------------------------------ revno: 103404 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2011-02-23 10:14:21 -0500 message: * src/print.c (print_object): Never print old-style backquotes. Obey escapeflag for hash tables as well. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-02-23 04:19:28 +0000 +++ src/ChangeLog 2011-02-23 15:14:21 +0000 @@ -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. === modified file 'src/print.c' --- src/print.c 2011-02-16 15:02:50 +0000 +++ src/print.c 2011-02-23 15:14:21 +0000 @@ -1683,26 +1683,6 @@ { 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 @@ 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 @@ 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) ------------------------------------------------------------ revno: 103403 author: Teodor Zlatanov committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2011-02-23 14:34:44 +0000 message: auth-source.el (auth-source-netrc-create): Use `read-char' instead of `read-char-choice' for backwards compatibility. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-02-23 13:35:35 +0000 +++ lisp/gnus/ChangeLog 2011-02-23 14:34:44 +0000 @@ -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 === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2011-02-23 13:35:35 +0000 +++ lisp/gnus/auth-source.el 2011-02-23 14:34:44 +0000 @@ -1011,13 +1011,12 @@ (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 "" ------------------------------------------------------------ revno: 103402 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Wed 2011-02-23 13:35:35 +0000 message: 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. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2011-02-23 04:19:28 +0000 +++ doc/misc/ChangeLog 2011-02-23 13:35:35 +0000 @@ -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. === modified file 'doc/misc/auth.texi' --- doc/misc/auth.texi 2011-02-19 19:40:59 +0000 +++ doc/misc/auth.texi 2011-02-23 13:35:35 +0000 @@ -127,8 +127,8 @@ ``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 @@ ;;; 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 @@ 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. === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-02-22 20:08:00 +0000 +++ lisp/gnus/ChangeLog 2011-02-23 13:35:35 +0000 @@ -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. === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2011-02-22 13:31:15 +0000 +++ lisp/gnus/auth-source.el 2011-02-23 13:35:35 +0000 @@ -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 @@ :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 @@ (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 @@ 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 @@ (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 @@ (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)))))) - - (setq backend (caar matches) - found-here (cadar matches)) - - (block nil - ;; if max is 0, as soon as we find something, return it - (when (and (zerop max) (> 0 (length found-here))) - (return t)) - - ;; 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)) + (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)) + + (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 @@ (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 @@ ;; 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 @@ (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 @@ ;; 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 @@ ;; 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 @@ (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 @@ (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 === modified file 'lisp/gnus/gnus-msg.el' --- lisp/gnus/gnus-msg.el 2011-02-22 20:08:00 +0000 +++ lisp/gnus/gnus-msg.el 2011-02-23 13:35:35 +0000 @@ -383,7 +383,7 @@ (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 @@ (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 @@ (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) === modified file 'lisp/gnus/gnus-start.el' --- lisp/gnus/gnus-start.el 2011-02-21 13:29:15 +0000 +++ lisp/gnus/gnus-start.el 2011-02-23 13:35:35 +0000 @@ -864,6 +864,7 @@ (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 @@ 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) === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2011-02-22 13:31:15 +0000 +++ lisp/gnus/gnus-sum.el 2011-02-23 13:35:35 +0000 @@ -3853,7 +3853,7 @@ ((< 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 @@ :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 @@ ;;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 === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2011-02-22 13:31:15 +0000 +++ lisp/gnus/nnimap.el 2011-02-23 13:35:35 +0000 @@ -1151,6 +1151,7 @@ (setf (nnimap-examined nnimap-object) group) (if (and qresyncp uidvalidity + active modseq) (push (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" === modified file 'lisp/gnus/nnir.el' --- lisp/gnus/nnir.el 2011-01-25 04:08:28 +0000 +++ lisp/gnus/nnir.el 2011-02-23 13:35:35 +0000 @@ -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 @@ :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 @@ (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)))) === modified file 'lisp/gnus/nnmail.el' --- lisp/gnus/nnmail.el 2011-01-30 03:00:34 +0000 +++ lisp/gnus/nnmail.el 2011-02-23 13:35:35 +0000 @@ -1215,7 +1215,8 @@ ;; 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)))))))) ------------------------------------------------------------ revno: 103401 committer: Glenn Morris branch nick: trunk timestamp: Tue 2011-02-22 23:27:09 -0800 message: Fix some mis-spellings of "precede" that are not in emacs-23 branch. diff: === modified file 'lisp/allout-widgets.el' --- lisp/allout-widgets.el 2011-02-17 21:47:18 +0000 +++ lisp/allout-widgets.el 2011-02-23 07:27:09 +0000 @@ -2013,7 +2013,7 @@ ;; 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) === modified file 'lisp/allout.el' --- lisp/allout.el 2011-02-17 22:57:38 +0000 +++ lisp/allout.el 2011-02-23 07:27:09 +0000 @@ -255,7 +255,7 @@ 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', '?.' === modified file 'lisp/progmodes/sql.el' --- lisp/progmodes/sql.el 2011-01-25 04:08:28 +0000 +++ lisp/progmodes/sql.el 2011-02-23 07:27:09 +0000 @@ -2801,7 +2801,7 @@ (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 @@ :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 @@ (provide 'sql) ;;; sql.el ends here - === modified file 'src/bidi.c' --- src/bidi.c 2011-01-25 04:08:28 +0000 +++ src/bidi.c 2011-02-23 07:27:09 +0000 @@ -1520,7 +1520,7 @@ 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)