From 777013f2bf9f548902c03ffbca0e98507d12ee64 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 3 Jan 2010 20:27:17 +0100 Subject: [PATCH 01/10] * dbusbind.c (xd_add_watch): Improve debug message. (xd_remove_watch): Improve debug message. If DATA is the session bus, unset D-Bus session environment. (Fdbus_init_bus): Pass the bus as argument to dbus_connection_set_watch_functions. (Bug#5283) --- src/ChangeLog | 12 ++++++++++-- src/dbusbind.c | 23 ++++++++++++++++------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d6e7f2c9791..2d1441964f2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2010-01-03 Michael Albinus + + * dbusbind.c (xd_add_watch): Improve debug message. + (xd_remove_watch): Improve debug message. If DATA is the session + bus, unset D-Bus session environment. + (Fdbus_init_bus): Pass the bus as argument to + dbus_connection_set_watch_functions. (Bug#5283) + 2010-01-01 Chong Yidong * nsterm.m (ns_get_color): Fix buffer overflow (Bug#4763). @@ -144,7 +152,7 @@ 2009-12-15 Michael Albinus * dbusbind.c (xd_retrieve_arg): Reorder declarations in order to - avoid compiler warnings. (Bug #5217). + avoid compiler warnings. (Bug #5217) 2009-12-14 Kenichi Handa @@ -5319,7 +5327,7 @@ (XD_SIGNAL1, XD_SIGNAL2, XD_SIGNAL3): New macros. Throw Qdbus_error. (xd_read_queued_messages): Catch Qdbus_error from the macros. (all): Replace xsignal1, xsignal2, xsignal3 by the respective - macro. (Bug#1186). + macro. (Bug#1186) 2008-10-23 Ali Bahrami (tiny change) diff --git a/src/dbusbind.c b/src/dbusbind.c index 7c0be49ab77..59702ed93c4 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -761,14 +761,14 @@ xd_add_watch (watch, data) if (dbus_watch_get_flags (watch) & DBUS_WATCH_READABLE) { #if HAVE_DBUS_WATCH_GET_UNIX_FD - /* TODO: Reverse these on Win32, which prefers the opposite. */ + /* TODO: Reverse these on Win32, which prefers the opposite. */ int fd = dbus_watch_get_unix_fd(watch); if (fd == -1) fd = dbus_watch_get_socket(watch); #else int fd = dbus_watch_get_fd(watch); #endif - XD_DEBUG_MESSAGE ("%d", fd); + XD_DEBUG_MESSAGE ("fd %d", fd); if (fd == -1) return FALSE; @@ -781,7 +781,8 @@ xd_add_watch (watch, data) return TRUE; } -/* Remove connection file descriptor from input_wait_mask. */ +/* Remove connection file descriptor from input_wait_mask. DATA is + the used bus, either QCdbus_system_bus or QCdbus_session_bus. */ void xd_remove_watch (watch, data) DBusWatch *watch; @@ -791,18 +792,25 @@ xd_remove_watch (watch, data) if (dbus_watch_get_flags (watch) & DBUS_WATCH_READABLE) { #if HAVE_DBUS_WATCH_GET_UNIX_FD - /* TODO: Reverse these on Win32, which prefers the opposite. */ + /* TODO: Reverse these on Win32, which prefers the opposite. */ int fd = dbus_watch_get_unix_fd(watch); if (fd == -1) fd = dbus_watch_get_socket(watch); #else int fd = dbus_watch_get_fd(watch); #endif - XD_DEBUG_MESSAGE ("%d", fd); + XD_DEBUG_MESSAGE ("fd %d", fd); if (fd == -1) return; + /* Unset session environment. */ + if ((data != NULL) && (EQ ((Lisp_Object) data, QCdbus_session_bus))) + { + XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS"); + unsetenv ("DBUS_SESSION_BUS_ADDRESS"); + } + /* Remove the file descriptor from input_wait_mask. */ delete_keyboard_wait_descriptor (fd); } @@ -825,11 +833,12 @@ This is an internal function, it shall not be used outside dbus.el. */) /* Open a connection to the bus. */ connection = xd_initialize (bus); - /* Add the watch functions. */ + /* Add the watch functions. We pass also the bus as data, in order + to distinguish between the busses in xd_remove_watch. */ if (!dbus_connection_set_watch_functions (connection, xd_add_watch, xd_remove_watch, - NULL, NULL, NULL)) + NULL, (void *) bus, NULL)) XD_SIGNAL1 (build_string ("Cannot add watch functions")); /* Return. */ From 137d88ca4b508421c511875801dcbff81588979c Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sun, 3 Jan 2010 20:35:21 -0800 Subject: [PATCH 02/10] (vc-bzr-state-heuristic): Make it work for lightweight checkouts. (Bug#618) --- lisp/ChangeLog | 5 +++++ lisp/vc-bzr.el | 21 +++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cfde9093e75..82061b6bb65 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-01-04 Dan Nicolaescu + + * vc-bzr.el (vc-bzr-state-heuristic): Make it work for lightweight + checkouts. (Bug#618) + 2010-01-02 Chong Yidong * net/browse-url.el (browse-url-encode-url): Don't escape commas. diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index fff4eca57fa..80aa420aa9e 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el @@ -176,13 +176,13 @@ Invoke the bzr command adding `BZR_PROGRESS_BAR=none' and "\0" "[^\0]*\0" ;id? "\\([^\0]*\\)\0" ;"a/f/d", a=removed? - "[^\0]*\0" ;sha1 (empty if conflicted)? - "\\([^\0]*\\)\0" ;size? + "\\([^\0]*\\)\0" ;sha1 (empty if conflicted)? + "\\([^\0]*\\)\0" ;size?p "[^\0]*\0" ;"y/n", executable? "[^\0]*\0" ;? "\\([^\0]*\\)\0" ;"a/f/d" a=added? "\\([^\0]*\\)\0" ;sha1 again? - "[^\0]*\0" ;size again? + "\\([^\0]*\\)\0" ;size again? "[^\0]*\0" ;"y/n", executable again? "[^\0]*\0" ;last revid? ;; There are more fields when merges are pending. @@ -194,11 +194,20 @@ Invoke the bzr command adding `BZR_PROGRESS_BAR=none' and ;; conflict markers). (cond ((eq (char-after (match-beginning 1)) ?a) 'removed) - ((eq (char-after (match-beginning 3)) ?a) 'added) - ((and (eq (string-to-number (match-string 2)) + ((eq (char-after (match-beginning 4)) ?a) 'added) + ((or (and (eq (string-to-number (match-string 3)) (nth 7 (file-attributes file))) - (equal (match-string 4) + (equal (match-string 5) (vc-bzr-sha1 file))) + (and + ;; It looks like for lightweight + ;; checkouts \2 is empty and we need to + ;; look for size in \6. + (eq (match-beginning 2) (match-end 2)) + (eq (string-to-number (match-string 6)) + (nth 7 (file-attributes file))) + (equal (match-string 5) + (vc-bzr-sha1 file)))) 'up-to-date) (t 'edited)) 'unregistered)))) From 3d5d0aa92fcc051e46badde9742870a0aa3f66b6 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sun, 3 Jan 2010 20:43:23 -0800 Subject: [PATCH 03/10] (vc-bzr-log-view-mode): Also highlight the author. --- lisp/ChangeLog | 1 + lisp/vc-bzr.el | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 82061b6bb65..7a56bd064c2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,7 @@ * vc-bzr.el (vc-bzr-state-heuristic): Make it work for lightweight checkouts. (Bug#618) + (vc-bzr-log-view-mode): Also highlight the author. 2010-01-02 Chong Yidong diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index 80aa420aa9e..c5b82e38a78 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el @@ -484,7 +484,7 @@ REV non-nil gets an error." (4 'change-log-list nil lax)))) (append `((,log-view-message-re . 'log-view-message-face)) ;; log-view-font-lock-keywords - '(("^ *committer: \ + '(("^ *\\(?:committer\\|author\\): \ \\([^<(]+?\\)[ ]*[(<]\\([[:alnum:]_.+-]+@[[:alnum:]_.-]+\\)[>)]" (1 'change-log-name) (2 'change-log-email)) From 8e7e22861ed0543f9934dcba83f04aec5d92e6a3 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Sun, 3 Jan 2010 22:40:30 -0800 Subject: [PATCH 04/10] (vc-bzr-shelve-map): Change binding for vc-bzr-shelve-apply-at-point. (vc-bzr-shelve-menu-map): (vc-bzr-dir-extra-headers): Improve menu and tooltip text. (vc-bzr-shelve-apply): Make prompt more explicit. --- lisp/ChangeLog | 4 ++++ lisp/vc-bzr.el | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7a56bd064c2..bf32b86899b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -3,6 +3,10 @@ * vc-bzr.el (vc-bzr-state-heuristic): Make it work for lightweight checkouts. (Bug#618) (vc-bzr-log-view-mode): Also highlight the author. + (vc-bzr-shelve-map): Change binding for vc-bzr-shelve-apply-at-point. + (vc-bzr-shelve-menu-map): + (vc-bzr-dir-extra-headers): Improve menu and tooltip text. + (vc-bzr-shelve-apply): Make prompt more explicit. 2010-01-02 Chong Yidong diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index c5b82e38a78..e2560e4c013 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el @@ -741,7 +741,7 @@ stream. Standard error output is discarded." (define-key map "\C-k" 'vc-bzr-shelve-delete-at-point) ;; (define-key map "=" 'vc-bzr-shelve-show-at-point) ;; (define-key map "\C-m" 'vc-bzr-shelve-show-at-point) - (define-key map "A" 'vc-bzr-shelve-apply-at-point) + (define-key map "P" 'vc-bzr-shelve-apply-at-point) map)) (defvar vc-bzr-shelve-menu-map @@ -749,9 +749,9 @@ stream. Standard error output is discarded." (define-key map [de] '(menu-item "Delete shelf" vc-bzr-shelve-delete-at-point :help "Delete the current shelf")) - (define-key map [ap] - '(menu-item "Apply shelf" vc-bzr-shelve-apply-at-point - :help "Apply the current shelf")) + (define-key map [po] + '(menu-item "Apply and remove shelf (pop)" vc-bzr-shelve-apply-at-point + :help "Apply the current shelf and remove it")) ;; (define-key map [sh] ;; '(menu-item "Show shelve" vc-bzr-shelve-show-at-point ;; :help "Show the contents of the current shelve")) @@ -809,7 +809,7 @@ stream. Standard error output is discarded." (propertize x 'face 'font-lock-variable-name-face 'mouse-face 'highlight - 'help-echo "mouse-3: Show shelve menu\nA: Apply shelf\nC-k: Delete shelf" + 'help-echo "mouse-3: Show shelve menu\nP: Apply and remove shelf (pop)\nC-k: Delete shelf" 'keymap vc-bzr-shelve-map)) shelve "\n")) (concat @@ -839,8 +839,8 @@ stream. Standard error output is discarded." ;; (pop-to-buffer (current-buffer))) (defun vc-bzr-shelve-apply (name) - "Apply shelve NAME." - (interactive "sApply shelf: ") + "Apply shelve NAME and remove it afterwards." + (interactive "sApply (and remove) shelf: ") (vc-bzr-command "unshelve" "*vc-bzr-shelve*" 0 nil "--apply" name) (vc-resynch-buffer (vc-bzr-root default-directory) t t)) From e3eb1dae0dbedaa4623e248be0e3db8c9495df02 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 4 Jan 2010 12:38:20 -0500 Subject: [PATCH 05/10] (xd_remove_watch): Avoid trying to convert a void* to Lisp_Object, preferring to convert a lisp_Object to a void* instead. (Fdbus_init_bus): Use XHASH to get a scalar value from a Lisp_Object. --- src/ChangeLog | 8 +++++++- src/dbusbind.c | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 2d1441964f2..6818ec395a4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-01-04 Stefan Monnier + + * dbusbind.c (xd_remove_watch): Avoid trying to convert a void* to + Lisp_Object, preferring to convert a lisp_Object to a void* instead. + (Fdbus_init_bus): Use XHASH to get a scalar value from a Lisp_Object. + 2010-01-03 Michael Albinus * dbusbind.c (xd_add_watch): Improve debug message. @@ -21221,7 +21227,7 @@ See ChangeLog.10 for earlier changes. ;; add-log-time-zone-rule: t ;; End: - Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/dbusbind.c b/src/dbusbind.c index 59702ed93c4..974a01e8ead 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -805,7 +805,7 @@ xd_remove_watch (watch, data) return; /* Unset session environment. */ - if ((data != NULL) && (EQ ((Lisp_Object) data, QCdbus_session_bus))) + if ((data != NULL) && (data == (void*) XHASH (QCdbus_session_bus))) { XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS"); unsetenv ("DBUS_SESSION_BUS_ADDRESS"); @@ -838,7 +838,7 @@ This is an internal function, it shall not be used outside dbus.el. */) if (!dbus_connection_set_watch_functions (connection, xd_add_watch, xd_remove_watch, - NULL, (void *) bus, NULL)) + NULL, (void*) XHASH (bus), NULL)) XD_SIGNAL1 (build_string ("Cannot add watch functions")); /* Return. */ From c57008f6ef0b368e7beb820d83ab8be09c48736b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 4 Jan 2010 13:18:38 -0500 Subject: [PATCH 06/10] Avoid dubious uses of save-excursions. * doc/lispref/positions.texi (Excursions): Recommend the use of save-current-buffer if applicable. * doc/lispref/text.texi (Clickable Text): Fix the example code which used save-excursion in a naive way which sometimes preserves point and sometimes not. * doc/lispref/variables.texi (Creating Buffer-Local): * doc/lispref/os.texi (Session Management): * doc/lispref/display.texi (GIF Images): * doc/lispref/control.texi (Cleanups): Use (save|with)-current-buffer. * doc/misc/gnus.texi (Posting Styles): Use with-current-buffer. * doc/misc/calc.texi (Defining Simple Commands): Prefer save-current-buffer. --- doc/lispref/ChangeLog | 15 ++++++++++++++- doc/lispref/control.texi | 7 +++---- doc/lispref/display.texi | 3 +-- doc/lispref/os.texi | 2 +- doc/lispref/positions.texi | 12 +++++++----- doc/lispref/text.texi | 13 ++++++------- doc/lispref/variables.texi | 3 +-- doc/misc/ChangeLog | 7 ++++++- doc/misc/calc.texi | 2 +- doc/misc/gnus.texi | 5 ++--- 10 files changed, 42 insertions(+), 27 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index e7467c20d25..6dfc203f638 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,16 @@ +2010-01-04 Stefan Monnier + + Avoid dubious uses of save-excursions. + * positions.texi (Excursions): Recommend the use of + save-current-buffer if applicable. + * text.texi (Clickable Text): Fix the example code which used + save-excursion in a naive way which sometimes preserves point and + sometimes not. + * variables.texi (Creating Buffer-Local): + * os.texi (Session Management): + * display.texi (GIF Images): + * control.texi (Cleanups): Use (save|with)-current-buffer. + 2010-01-02 Eli Zaretskii * modes.texi (Example Major Modes): Fix indentation. (Bug#5195) @@ -8375,7 +8388,7 @@ ;; End: Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009 Free Software Foundation, Inc. + 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi index 41f844b4e21..6d7c01d354b 100644 --- a/doc/lispref/control.texi +++ b/doc/lispref/control.texi @@ -1255,9 +1255,8 @@ make sure to kill it before finishing: @smallexample @group -(save-excursion - (let ((buffer (get-buffer-create " *temp*"))) - (set-buffer buffer) +(let ((buffer (get-buffer-create " *temp*"))) + (with-current-buffer buffer (unwind-protect @var{body-form} (kill-buffer buffer)))) @@ -1269,7 +1268,7 @@ You might think that we could just as well write @code{(kill-buffer (current-buffer))} and dispense with the variable @code{buffer}. However, the way shown above is safer, if @var{body-form} happens to get an error after switching to a different buffer! (Alternatively, -you could write another @code{save-excursion} around @var{body-form}, +you could write a @code{save-current-buffer} around @var{body-form}, to ensure that the temporary buffer becomes current again in time to kill it.) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 8feb8ea8c81..512d7d53019 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -4394,8 +4394,7 @@ every 0.1 seconds. (when (= idx max) (setq idx 0)) (let ((img (create-image file nil :image idx))) - (save-excursion - (set-buffer buffer) + (with-current-buffer buffer (goto-char (point-min)) (unless first-time (delete-char 1)) (insert-image img)) diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index ded70f4927b..8d62ab87499 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -2182,7 +2182,7 @@ Emacs is restarted by the session manager. @group (defun save-yourself-test () - (insert "(save-excursion + (insert "(save-current-buffer (switch-to-buffer \"*scratch*\") (insert \"I am restored\"))") nil) diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index deded596f81..3897efc6f2b 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -806,7 +806,9 @@ after the completion of the excursion. The forms for saving and restoring the configuration of windows are described elsewhere (see @ref{Window Configurations}, and @pxref{Frame -Configurations}). +Configurations}). When only the identity of the current buffer needs +to be saved and restored, it is preferable to use +@code{save-current-buffer} instead. @defspec save-excursion body@dots{} @cindex mark excursion @@ -817,10 +819,10 @@ buffer and the values of point and the mark in it, evaluates point and the mark. All three saved values are restored even in case of an abnormal exit via @code{throw} or error (@pxref{Nonlocal Exits}). -The @code{save-excursion} special form is the standard way to switch -buffers or move point within one part of a program and avoid affecting -the rest of the program. It is used more than 4000 times in the Lisp -sources of Emacs. +The @code{save-excursion} special form is the standard way to move +point within one part of a program and avoid affecting the rest of the +program. It is used more than 4000 times in the Lisp sources +of Emacs. @code{save-excursion} does not save the values of point and the mark for other buffers, so changes in other buffers remain in effect after diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 91b65017754..7c3f91c3fa8 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -3524,13 +3524,12 @@ following command: (defun dired-mouse-find-file-other-window (event) "In Dired, visit the file or directory name you click on." (interactive "e") - (let (window pos file) - (save-excursion - (setq window (posn-window (event-end event)) - pos (posn-point (event-end event))) - (if (not (windowp window)) - (error "No file chosen")) - (set-buffer (window-buffer window)) + (let ((window (posn-window (event-end event))) + (pos (posn-point (event-end event))) + file) + (if (not (windowp window)) + (error "No file chosen")) + (with-current-buffer (window-buffer window) (goto-char pos) (setq file (dired-get-file-for-visit))) (if (file-directory-p file) diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 4f9f9c17369..d8ab347eebf 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -1240,8 +1240,7 @@ foo @group ;; @r{In buffer @samp{b2}, the value hasn't changed.} -(save-excursion - (set-buffer "b2") +(with-current-buffer "b2" foo) @result{} 5 @end group diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 27c376f764c..cabec8f7fb1 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,8 @@ +2010-01-04 Stefan Monnier + + * gnus.texi (Posting Styles): Use with-current-buffer. + * calc.texi (Defining Simple Commands): Prefer save-current-buffer. + 2010-01-02 Kevin Ryde * eieio.texi (Naming Conventions): Correction to xref on elisp @@ -6512,7 +6517,7 @@ ;; End: Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, - 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index c88bb3e9ab8..e7c03197704 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -31968,7 +31968,7 @@ the function with code that looks roughly like this: @smallexample (let ((calc-command-flags nil)) (unwind-protect - (save-excursion + (save-current-buffer (calc-select-buffer) @emph{body of function} @emph{renumber stack} diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index e90789d2494..a33a91ba6f1 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -10,7 +10,7 @@ @copying Copyright @copyright{} 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document @@ -13449,8 +13449,7 @@ So here's a new example: (body "You are fired.\n\nSincerely, your boss.") (organization "Important Work, Inc")) ("nnml:.*" - (From (save-excursion - (set-buffer gnus-article-buffer) + (From (with-current-buffer gnus-article-buffer (message-fetch-field "to")))) ("^nn.+:" (signature-file "~/.mail-signature")))) From b25d6a02fdbde0f9f9491c0f7d4abe1400d9170e Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Mon, 4 Jan 2010 23:46:35 -0800 Subject: [PATCH 07/10] (vc-bzr-diff): Obey vc-disable-async-diff. --- lisp/ChangeLog | 4 ++++ lisp/vc-bzr.el | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bf32b86899b..52f24391186 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2010-01-05 Dan Nicolaescu + + * vc-bzr.el (vc-bzr-diff): Obey vc-disable-async-diff. + 2010-01-04 Dan Nicolaescu * vc-bzr.el (vc-bzr-state-heuristic): Make it work for lightweight diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index e2560e4c013..fc62696af1d 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el @@ -532,7 +532,8 @@ REV non-nil gets an error." (defun vc-bzr-diff (files &optional rev1 rev2 buffer) "VC bzr backend for diff." ;; `bzr diff' exits with code 1 if diff is non-empty. - (apply #'vc-bzr-command "diff" (or buffer "*vc-diff*") 'async files + (apply #'vc-bzr-command "diff" (or buffer "*vc-diff*") + (if vc-disable-async-diff 1 'async) files "--diff-options" (mapconcat 'identity (vc-switches 'bzr 'diff) " ") From 2a1ef5be4980dee796a0f7552370e70a298c0b3b Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 5 Jan 2010 20:49:19 +0900 Subject: [PATCH 08/10] fontset.c (fontset_find_font): Fix getting the frame pointer. --- src/ChangeLog | 4 ++++ src/fontset.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 6818ec395a4..147ac60fce4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2010-01-05 Kenichi Handa + + * fontset.c (fontset_find_font): Fix getting the frame pointer. + 2010-01-04 Stefan Monnier * dbusbind.c (xd_remove_watch): Avoid trying to convert a void* to diff --git a/src/fontset.c b/src/fontset.c index 30620e511c8..b62c779be70 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -533,8 +533,8 @@ fontset_find_font (fontset, c, face, id, fallback) { Lisp_Object vec, font_group; int i, charset_matched = 0, found_index; - FRAME_PTR f = (FRAMEP (FONTSET_FRAME (fontset))) - ? XFRAME (selected_frame) : XFRAME (FONTSET_FRAME (fontset)); + FRAME_PTR f = (FRAMEP (FONTSET_FRAME (fontset)) + ? XFRAME (FONTSET_FRAME (fontset)) : XFRAME (selected_frame)); Lisp_Object rfont_def; font_group = fontset_get_font_group (fontset, fallback ? -1 : c); From 69db641dfe32c50abb8319e6d1fb095bb143a5af Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 5 Jan 2010 20:59:03 +0900 Subject: [PATCH 09/10] language/indian.el (malayalam-composable-pattern): Fix ZWNJ and ZWJ. --- lisp/ChangeLog | 5 +++++ lisp/language/indian.el | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 52f24391186..1b493440367 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-01-05 Kenichi Handa + + * language/indian.el (malayalam-composable-pattern): Fix ZWNJ and + ZWJ. + 2010-01-05 Dan Nicolaescu * vc-bzr.el (vc-bzr-diff): Obey vc-disable-async-diff. diff --git a/lisp/language/indian.el b/lisp/language/indian.el index 82f24a0272f..b9ea94ab2d1 100644 --- a/lisp/language/indian.el +++ b/lisp/language/indian.el @@ -153,8 +153,8 @@ South Indian language Malayalam is supported in this language environment.")) ("a" . "\u0903") ; vowel modifier (post) ("S" . "\u0951") ; stress sign (above) ("s" . "\u0952") ; stress sign (below) - ("J" . "\u200D") ; ZWJ ("N" . "\u200C") ; ZWNJ + ("J" . "\u200D") ; ZWJ ("X" . "[\u0900-\u097F]")))) ; all coverage (indian-compose-regexp (concat @@ -195,8 +195,8 @@ South Indian language Malayalam is supported in this language environment.")) ("b" . "[\u0D62-\u0D63]") ; belowbase matra ("a" . "[\u0D02-\u0D03]") ; abovebase sign ("H" . "\u0D4D") ; virama sign - ("N" . "\u200D") ; ZWJ - ("J" . "\u200C") ; ZWNJ + ("N" . "\u200C") ; ZWNJ + ("J" . "\u200D") ; ZWJ ("X" . "[\u0D00-\u0D7F]")))) ; all coverage (indian-compose-regexp (concat From 03f77f0a4470c967d6f4351d347ebedd8fb882bb Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 5 Jan 2010 07:04:04 -0700 Subject: [PATCH 10/10] * keyboard.c (read_key_sequence): Catch keyboard switch after making a new tty frame (Bug#5095). --- src/ChangeLog | 5 +++++ src/keyboard.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 147ac60fce4..77e80ed0536 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-01-05 Chong Yidong + + * keyboard.c (read_key_sequence): Catch keyboard switch after + making a new tty frame (Bug#5095). + 2010-01-05 Kenichi Handa * fontset.c (fontset_find_font): Fix getting the frame pointer. diff --git a/src/keyboard.c b/src/keyboard.c index 7a137ea0dca..13d13cd3276 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -9502,7 +9502,13 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, key = read_char (NILP (prompt), nmaps, (Lisp_Object *) submaps, last_nonmenu_event, &used_mouse_menu, NULL); - if (INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */ + if ((INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */ + /* When switching to a new tty (with a new keyboard), + read_char returns the new buffer, rather than -2 + (Bug#5095). This is because `terminal-init-xterm' + calls read-char, which eats the wrong_kboard_jmpbuf + return. Any better way to fix this? -- cyd */ + || (interrupted_kboard != current_kboard)) { int found = 0; struct kboard *k;