Now on revision 107508. ------------------------------------------------------------ revno: 107508 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-03-05 14:12:17 +0800 message: * doc/lispref/positions.texi (Text Lines): Document count-words. diff: === modified file 'admin/FOR-RELEASE' --- admin/FOR-RELEASE 2012-03-04 06:50:18 +0000 +++ admin/FOR-RELEASE 2012-03-05 06:12:17 +0000 @@ -219,7 +219,7 @@ objects.texi cyd os.texi package.texi -positions.texi +positions.texi cyd processes.texi searching.texi sequences.texi cyd === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-04 06:50:18 +0000 +++ doc/lispref/ChangeLog 2012-03-05 06:12:17 +0000 @@ -1,3 +1,7 @@ +2012-03-05 Chong Yidong + + * positions.texi (Text Lines): Document count-words. + 2012-03-04 Chong Yidong * frames.texi (Frames): Remove little-used "terminal frame" and === modified file 'doc/lispref/positions.texi' --- doc/lispref/positions.texi 2012-01-19 07:21:25 +0000 +++ doc/lispref/positions.texi 2012-03-05 06:12:17 +0000 @@ -372,19 +372,18 @@ 1, even if @var{start} and @var{end} are on the same line. This is because the text between them, considered in isolation, must contain at least one line unless it is empty. - -Here is an example of using @code{count-lines}: - -@example -@group -(defun current-line () - "Return the vertical position of point@dots{}" - (+ (count-lines (window-start) (point)) - (if (= (current-column) 0) 1 0))) -@end group -@end example @end defun +@deffn Command count-words start end +@cindex words in region +This function returns the number of words between the positions +@var{start} and @var{end} in the current buffer. + +This function can also be called interactively. In that case, it +prints a message reporting the number of lines, words, and characters +in the buffer, or in the region if the region is active. +@end deffn + @defun line-number-at-pos &optional pos @cindex line number This function returns the line number in the current buffer ------------------------------------------------------------ revno: 107507 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-03-05 14:10:11 +0800 message: Tweaks to count-words and count-words-region behavior. In particular, make count-words more analogous to the existing count-lines function. * lisp/simple.el (count-words): If called from Lisp, return the word count, for symmetry with `count-lines'. Arglist changed. (count-words--message): Args changed. Consolidate counting code from count-words and count-words-region. (count-words-region): Caller changed. (count-lines-region): Make it an obsolete alias. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-03-05 03:13:46 +0000 +++ etc/NEWS 2012-03-05 06:10:11 +0000 @@ -483,9 +483,12 @@ +++ ** New commands `count-words-region' and `count-words'. - -*** `count-lines-region' is now an alias for `count-words-region', -bound to M-=, which shows the number of lines, words, and characters. ++++ +*** M-= is bound to `count-words-region', not `count-lines-region'. +The `count-words-region' command, when called interactively, reports +the number of lines, words, and characters in the region. It is a +superset of the old `count-lines-region', which is now an obsolete +alias for it. +++ ** The default value of `backup-by-copying-when-mismatch' is now t. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-04 16:56:21 +0000 +++ lisp/ChangeLog 2012-03-05 06:10:11 +0000 @@ -1,3 +1,12 @@ +2012-03-05 Chong Yidong + + * simple.el (count-words): If called from Lisp, return the word + count, for symmetry with `count-lines'. Arglist changed. + (count-words--message): Args changed. Consolidate counting code + from count-words and count-words-region. + (count-words-region): Caller changed. + (count-lines-region): Make it an obsolete alias. + 2012-03-04 Tassilo Horn * saveplace.el (save-place-to-alist) === modified file 'lisp/simple.el' --- lisp/simple.el 2012-02-13 19:42:58 +0000 +++ lisp/simple.el 2012-03-05 06:10:11 +0000 @@ -949,46 +949,51 @@ (forward-line (1- line))))) (defun count-words-region (start end) - "Return the number of words between START and END. + "Count the number of words in the region. If called interactively, print a message reporting the number of -lines, words, and characters in the region." +lines, words, and chars in the region. +If called from Lisp, return the number of words between positions +START and END." (interactive "r") - (let ((words 0)) - (save-excursion - (save-restriction - (narrow-to-region start end) - (goto-char (point-min)) - (while (forward-word 1) - (setq words (1+ words))))) - (when (called-interactively-p 'interactive) - (count-words--message "Region" - (count-lines start end) - words - (- end start))) - words)) - -(defun count-words () - "Display the number of lines, words, and characters in the buffer. -In Transient Mark mode when the mark is active, display the -number of lines, words, and characters in the region." - (interactive) - (if (use-region-p) - (call-interactively 'count-words-region) - (let* ((beg (point-min)) - (end (point-max)) - (lines (count-lines beg end)) - (words (count-words-region beg end)) - (chars (- end beg))) - (count-words--message "Buffer" lines words chars)))) - -(defun count-words--message (str lines words chars) - (message "%s has %d line%s, %d word%s, and %d character%s." - str - lines (if (= lines 1) "" "s") - words (if (= words 1) "" "s") - chars (if (= chars 1) "" "s"))) - -(defalias 'count-lines-region 'count-words-region) + (if (called-interactively-p 'any) + (count-words--message "Region" start end) + (count-words start end))) + +(defun count-words (start end) + "Count words between START and END. +If called interactively, START and END are normally the start and +end of the buffer; but if the region is active, START and END are +the start and end of the region. Print a message reporting the +number of lines, words, and chars. + +If called from Lisp, return the number of words between START and +END, without printing any message." + (interactive (list nil nil)) + (cond ((not (called-interactively-p 'any)) + (let ((words 0)) + (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char (point-min)) + (while (forward-word 1) + (setq words (1+ words))))) + words)) + ((use-region-p) + (call-interactively 'count-words-region)) + (t + (count-words--message "Buffer" (point-min) (point-max))))) + +(defun count-words--message (str start end) + (let ((lines (count-lines start end)) + (words (count-words start end)) + (chars (- end start))) + (message "%s has %d line%s, %d word%s, and %d character%s." + str + lines (if (= lines 1) "" "s") + words (if (= words 1) "" "s") + chars (if (= chars 1) "" "s")))) + +(define-obsolete-function-alias 'count-lines-region 'count-words-region "24.1") (defun what-line () "Print the current buffer line number and narrowed line number of point." ------------------------------------------------------------ revno: 107506 committer: Chong Yidong branch nick: trunk timestamp: Mon 2012-03-05 11:13:46 +0800 message: etc/NEWS: Mention impact of old-style backquotes on key sequences. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-03-04 06:50:18 +0000 +++ etc/NEWS 2012-03-05 03:13:46 +0000 @@ -1049,12 +1049,16 @@ ** Support for "old-style" backquotes, which have been obsolete for more than 10 years, has been further reduced. Now a backquote not followed by a space is always treated as a "new-style" backquote. -Please consider completely removing all "old-style" backquotes from -your code as a matter of some urgency. If your code uses backquotes -as documented in the Elisp manual, and compiles without warning, then -you have nothing to do in this regard. Code not following the -appropriate conventions may fail to compile. The most common cause of -trouble seems to be an old-style backquote followed by a newline. +Please remove all "old-style" backquotes from your code. If your code +uses backquotes as documented in the Elisp manual, and compiles +without warning, then you have nothing to do in this regard. Code not +following the appropriate conventions may fail to compile. + +The most common cause of trouble seems to be an old-style backquote +followed by a newline. Another cause of trouble is vector notation +for key sequence notation: instead of [(control ,)] and [(control ')], +you should write [(control ?,)] and [(control ?')], which will work in +older Emacs too. +++ ** The macro `eval-at-startup' was removed in Emacs 23.2, but this ------------------------------------------------------------ revno: 107505 author: Thierry Volpiatto committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2012-03-04 22:19:10 +0000 message: gnus-msg.el (gnus-msg-mail): Call `message-mail' correctly when Gnus isn't running (bug#10897). diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-02-25 13:20:57 +0000 +++ lisp/gnus/ChangeLog 2012-03-04 22:19:10 +0000 @@ -1,3 +1,8 @@ +2012-03-04 Thierry Volpiatto + + * gnus-msg.el (gnus-msg-mail): Call `message-mail' correctly when Gnus + isn't running (bug#10897). + 2012-02-25 Lars Magne Ingebrigtsen * shr.el (shr-column-specs): Protect against TDs with "width: 0%". === modified file 'lisp/gnus/gnus-msg.el' --- lisp/gnus/gnus-msg.el 2012-02-20 09:07:54 +0000 +++ lisp/gnus/gnus-msg.el 2012-03-04 22:19:10 +0000 @@ -478,7 +478,8 @@ ;;;###autoload (defun gnus-msg-mail (&optional to subject other-headers continue - switch-action yank-action send-actions return-action) + switch-action yank-action send-actions + return-action) "Start editing a mail message to be sent. Like `message-mail', but with Gnus paraphernalia, particularly the Gcc: header for archiving purposes. @@ -486,7 +487,8 @@ instead." (interactive) (if (not (gnus-alive-p)) - (message-mail) + (message-mail to subject other-headers continue + nil yank-action send-actions return-action) (let ((buf (current-buffer)) mail-buf) (gnus-setup-message 'message ------------------------------------------------------------ revno: 107504 fixes bug(s): http://debbugs.gnu.org/10677 committer: Paul Eggert branch nick: trunk timestamp: Sun 2012-03-04 10:07:33 -0800 message: configure: fix ncurses 'configure' issue on Solaris 10 (Bug#10677) * configure.in (LIBS_TERMCAP): Default this to the result of the tputs library search. Do a run-time test for the linkability of tputs unless cross-compiling, as that's more reliable if the link flags and libraries are messed up. Don't change LIBS as a result of the test, as that may mess up later tests. diff: === modified file 'ChangeLog' --- ChangeLog 2012-03-01 07:33:29 +0000 +++ ChangeLog 2012-03-04 18:07:33 +0000 @@ -1,3 +1,12 @@ +2012-03-04 Paul Eggert + + configure: fix ncurses 'configure' issue on Solaris 10 (Bug#10677) + * configure.in (LIBS_TERMCAP): Default this to the result of + the tputs library search. Do a run-time test for the linkability + of tputs unless cross-compiling, as that's more reliable if the + link flags and libraries are messed up. Don't change LIBS as + a result of the test, as that may mess up later tests. + 2012-02-05 Christoph Scholtes * make-dist (README.W32): Include file in source tarball. (Bug#9750) === modified file 'configure.in' --- configure.in 2012-02-27 03:20:00 +0000 +++ configure.in 2012-03-04 18:07:33 +0000 @@ -2784,11 +2784,43 @@ # It's better to believe a function is not available # than to expect to find it in ncurses. # Also we need tputs and friends to be able to build at all. -have_tputs_et_al=true +AC_MSG_CHECKING([for library containing tputs]) +# Run a test program that contains a call to tputs, a call that is +# never executed. This tests whether a pre-'main' dynamic linker +# works with the library. It's too much trouble to actually call +# tputs in the test program, due to portability hassles. When +# cross-compiling, assume the test program will run if it links. +AC_DEFUN([tputs_link_source], [ + AC_LANG_SOURCE( + [[extern void tputs (const char *, int, int (*)(int)); + int main (int argc, char **argv) + { + if (argc == 10000) + tputs (argv[0], 0, 0); + return 0; + }]]) +]) # Maybe curses should be tried earlier? # See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9736#35 -AC_SEARCH_LIBS(tputs, [ncurses terminfo termcap curses], , have_tputs_et_al=false) -if test "$have_tputs_et_al" != true; then +for tputs_library in '' ncurses terminfo termcap curses; do + OLIBS=$LIBS + if test -z "$tputs_library"; then + LIBS_TERMCAP= + msg='none required' + else + LIBS_TERMCAP=-l$tputs_library + msg=$LIBS_TERMCAP + LIBS="$LIBS_TERMCAP $LIBS" + fi + AC_RUN_IFELSE([tputs_link_source], [], [msg=no], + [AC_LINK_IFELSE([tputs_link_source], [], [msg=no])]) + LIBS=$OLIBS + if test "X$msg" != Xno; then + break + fi +done +AC_MSG_RESULT([$msg]) +if test "X$msg" = Xno; then AC_MSG_ERROR([The required function `tputs' was not found in any library. These libraries were tried: libncurses, libterminfo, libtermcap, libcurses. Please try installing whichever of these libraries is most appropriate @@ -2807,7 +2839,6 @@ ## freebsd < 40000, ms-w32, msdos, netbsd < 599002500, and ## darwin|gnu without ncurses. TERMINFO=no -LIBS_TERMCAP= case "$opsys" in ## cygwin: Fewer environment variables to go wrong, more terminal types. ## hpux10-20: Use the system provided termcap(3) library. @@ -2872,10 +2903,6 @@ TERMCAP_OBJ=tparam.o if test $TERMINFO = yes; then AC_DEFINE(TERMINFO, 1, [Define to 1 if you use terminfo instead of termcap.]) - - ## Default used to be -ltermcap. Add a case above if need something else. - test "x$LIBS_TERMCAP" = "x" && LIBS_TERMCAP="-lcurses" - TERMCAP_OBJ=terminfo.o fi AC_SUBST(LIBS_TERMCAP) ------------------------------------------------------------ revno: 107503 committer: Tassilo Horn branch nick: trunk timestamp: Sun 2012-03-04 17:56:21 +0100 message: * saveplace.el (save-place-to-alist) (save-place-ignore-files-regexp): Allow value nil to disable this feature. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-04 15:03:51 +0000 +++ lisp/ChangeLog 2012-03-04 16:56:21 +0000 @@ -1,3 +1,9 @@ +2012-03-04 Tassilo Horn + + * saveplace.el (save-place-to-alist) + (save-place-ignore-files-regexp): Allow value nil to disable this + feature. + 2012-03-04 Chong Yidong * faces.el (face-spec-reset-face): For the default face, reset the === modified file 'lisp/saveplace.el' --- lisp/saveplace.el 2012-02-18 19:04:28 +0000 +++ lisp/saveplace.el 2012-03-04 16:56:21 +0000 @@ -132,9 +132,10 @@ (defcustom save-place-ignore-files-regexp "\\(?:COMMIT_EDITMSG\\|hg-editor-[[:alnum:]]+\\.txt\\|svn-commit\\.tmp\\|bzr_log\\.[[:alnum:]]+\\)$" - "Regexp matching files for which no location should be recorded. + "Regexp matching files for which no position should be recorded. Useful for temporary file such as commit message files that are -automatically created by the VCS." +automatically created by the VCS. If set to nil, this feature is +disabled, i.e., the position is recorded for all files." :version "24.1" :type 'regexp :group 'save-place) @@ -169,8 +170,9 @@ ;; will be saved again when Emacs is killed. (or save-place-loaded (load-save-place-alist-from-file)) (when (and buffer-file-name - (not (string-match save-place-ignore-files-regexp - buffer-file-name))) + (or (not save-place-ignore-files-regexp) + (not (string-match save-place-ignore-files-regexp + buffer-file-name)))) (let ((cell (assoc buffer-file-name save-place-alist)) (position (if (not (eq major-mode 'hexl-mode)) (point) ------------------------------------------------------------ revno: 107502 fixes bug(s): http://debbugs.gnu.org/10748 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-03-04 23:03:51 +0800 message: Another tweak to default face handling in face-spec-reset-face. * lisp/faces.el (face-spec-reset-face): For the default face, reset the attributes to default values. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-04 13:43:13 +0000 +++ lisp/ChangeLog 2012-03-04 15:03:51 +0000 @@ -1,3 +1,8 @@ +2012-03-04 Chong Yidong + + * faces.el (face-spec-reset-face): For the default face, reset the + attributes to default values (Bug#10748). + 2012-03-04 Lars Magne Ingebrigtsen * mail/emacsbug.el (report-emacs-bug-hook): Fix up thinko in === modified file 'lisp/faces.el' --- lisp/faces.el 2012-01-31 08:38:58 +0000 +++ lisp/faces.el 2012-03-04 15:03:51 +0000 @@ -1513,12 +1513,23 @@ (defun face-spec-reset-face (face &optional frame) "Reset all attributes of FACE on FRAME to unspecified." - (unless (eq face 'default) - (let (reset-args) - (dolist (attr-and-name face-attribute-name-alist) - (push 'unspecified reset-args) - (push (car attr-and-name) reset-args)) - (apply 'set-face-attribute face frame reset-args)))) + (apply 'set-face-attribute face frame + (if (eq face 'default) + ;; For the default face, avoid making any attribute + ;; unspecifed. Instead, set attributes to default values + ;; (see also realize_default_face in xfaces.c). + (append + '(:underline nil :overline nil :strike-through nil + :box nil :inverse-video nil :stipple nil :inherit nil) + (unless (display-graphic-p frame) + '(:family "default" :foundry "default" :width normal + :height 1 :weight normal :slant normal + :foreground "unspecified-fg" + :background "unspecified-bg"))) + ;; For all other faces, unspecify all attributes. + (apply 'append + (mapcar (lambda (x) (list (car x) 'unspecified)) + face-attribute-name-alist))))) (defun face-spec-set (face spec &optional for-defface) "Set FACE's face spec, which controls its appearance, to SPEC. ------------------------------------------------------------ revno: 107501 committer: Michael Albinus branch nick: trunk timestamp: Sun 2012-03-04 15:12:18 +0100 message: Fix typo. diff: === modified file 'lisp/notifications.el' --- lisp/notifications.el 2012-03-04 13:43:13 +0000 +++ lisp/notifications.el 2012-03-04 14:12:18 +0000 @@ -279,9 +279,9 @@ (or hints '(:array :signature "{sv}")) :int32 (or timeout -1))) - ;; Register close/action callback function. We must also - ;; remmember the daemon's unique name, because the daemon could - ;; have restarted. + ;; Register close/action callback function. We must also remember + ;; the daemon's unique name, because the daemon could have + ;; restarted. (let ((on-action (plist-get params :on-action)) (on-close (plist-get params :on-close)) (unique-name (dbus-get-name-owner :session notifications-service))) ------------------------------------------------------------ revno: 107500 committer: Michael Albinus branch nick: trunk timestamp: Sun 2012-03-04 14:43:13 +0100 message: * notifications.el: Fix previous patch. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-04 13:34:33 +0000 +++ lisp/ChangeLog 2012-03-04 13:43:13 +0000 @@ -6,11 +6,11 @@ 2012-03-04 Michael Albinus - * notifications.el (notifications-unique-name): New defvar. - (notifications-on-action-signal, notifications-on-closed-signal): - Check for unique service name of incoming event. + * notifications.el (notifications-on-action-signal) + (notifications-on-closed-signal): Check for unique service name of + incoming event. Fix error in removing entry. (top): Register for signals with wildcard service name. - (notifications-notify): Remember daemon unique service name. + (notifications-notify): Use daemon unique service name for map entries. 2012-03-04 Chong Yidong === modified file 'lisp/notifications.el' --- lisp/notifications.el 2012-03-04 11:21:31 +0000 +++ lisp/notifications.el 2012-03-04 13:43:13 +0000 @@ -91,19 +91,13 @@ (defvar notifications-on-close-map nil "Mapping between notification and close callback functions.") -(defvar notifications-unique-name "" - "Unique service name of notification daemon. -This must be kept, because the notification daemon could be -restarted, and the registered signals cannot be identified anymore.") - (defun notifications-on-action-signal (id action) "Dispatch signals to callback functions from `notifications-on-action-map'." - (let ((entry (assoc id notifications-on-action-map))) - (when (and entry - (string-equal notifications-unique-name - (dbus-event-service-name last-input-event))) + (let* ((unique-name (dbus-event-service-name last-input-event)) + (entry (assoc (cons unique-name id) notifications-on-action-map))) + (when entry (funcall (cadr entry) id action) - (remove entry 'notifications-on-action-map)))) + (remove entry notifications-on-action-map)))) (when (fboundp 'dbus-register-signal) (dbus-register-signal @@ -118,14 +112,13 @@ "Dispatch signals to callback functions from `notifications-on-closed-map'." ;; notification-daemon prior 0.4.0 does not send a reason. So we ;; make it optional, and assume `undefined' as default. - (let ((entry (assoc id notifications-on-close-map)) - (reason (or reason 4))) - (when (and entry - (string-equal notifications-unique-name - (dbus-event-service-name last-input-event))) + (let* ((unique-name (dbus-event-service-name last-input-event)) + (entry (assoc (cons unique-name id) notifications-on-close-map)) + (reason (or reason 4))) + (when entry (funcall (cadr entry) id (cadr (assoc reason notifications-closed-reason))) - (remove entry 'notifications-on-close-map)))) + (remove entry notifications-on-close-map)))) (when (fboundp 'dbus-register-signal) (dbus-register-signal @@ -286,17 +279,18 @@ (or hints '(:array :signature "{sv}")) :int32 (or timeout -1))) - ;; Remember daemon unique service name. - (setq notifications-unique-name - (dbus-get-name-owner :session notifications-service)) - - ;; Register close/action callback function + ;; Register close/action callback function. We must also + ;; remmember the daemon's unique name, because the daemon could + ;; have restarted. (let ((on-action (plist-get params :on-action)) - (on-close (plist-get params :on-close))) + (on-close (plist-get params :on-close)) + (unique-name (dbus-get-name-owner :session notifications-service))) (when on-action - (add-to-list 'notifications-on-action-map (list id on-action))) + (add-to-list 'notifications-on-action-map + (list (cons unique-name id) on-action))) (when on-close - (add-to-list 'notifications-on-close-map (list id on-close)))) + (add-to-list 'notifications-on-close-map + (list (cons unique-name id) on-close)))) ;; Return notification id id)) ------------------------------------------------------------ revno: 107499 fixes bug(s): http://debbugs.gnu.org/10897 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Sun 2012-03-04 14:34:33 +0100 message: Fix up the emacsbug query-once logic from the previous patch * mail/emacsbug.el (report-emacs-bug-hook): Fix up thinko in previous patch: Check `message-send-mail-function', and not the default function. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-04 11:21:31 +0000 +++ lisp/ChangeLog 2012-03-04 13:34:33 +0000 @@ -1,3 +1,9 @@ +2012-03-04 Lars Magne Ingebrigtsen + + * mail/emacsbug.el (report-emacs-bug-hook): Fix up thinko in + previous patch: Check `message-send-mail-function', and not the + default function (bug#10897). + 2012-03-04 Michael Albinus * notifications.el (notifications-unique-name): New defvar. === modified file 'lisp/mail/emacsbug.el' --- lisp/mail/emacsbug.el 2012-03-03 14:43:03 +0000 +++ lisp/mail/emacsbug.el 2012-03-04 13:34:33 +0000 @@ -395,8 +395,7 @@ ;; questions about From header validity if the user is going to ;; use mailclient, anyway. (when (or (and (derived-mode-p 'message-mode) - (eq (message-default-send-mail-function) - 'sendmail-query-once)) + (eq message-send-mail-function 'sendmail-query-once)) (and (not (derived-mode-p 'message-mode)) (eq send-mail-function 'sendmail-query-once))) (sendmail-query-user-about-smtp) ------------------------------------------------------------ revno: 107498 committer: Michael Albinus branch nick: trunk timestamp: Sun 2012-03-04 12:21:31 +0100 message: * notifications.el (notifications-unique-name): New defvar. (notifications-on-action-signal, notifications-on-closed-signal): Check for unique service name of incoming event. (top): Register for signals with wildcard service name. (notifications-notify): Remember daemon unique service name. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-04 06:55:06 +0000 +++ lisp/ChangeLog 2012-03-04 11:21:31 +0000 @@ -1,3 +1,11 @@ +2012-03-04 Michael Albinus + + * notifications.el (notifications-unique-name): New defvar. + (notifications-on-action-signal, notifications-on-closed-signal): + Check for unique service name of incoming event. + (top): Register for signals with wildcard service name. + (notifications-notify): Remember daemon unique service name. + 2012-03-04 Chong Yidong * cus-start.el: Make x-select-enable-clipboard-manager === modified file 'lisp/notifications.el' --- lisp/notifications.el 2012-02-07 09:06:19 +0000 +++ lisp/notifications.el 2012-03-04 11:21:31 +0000 @@ -91,17 +91,24 @@ (defvar notifications-on-close-map nil "Mapping between notification and close callback functions.") +(defvar notifications-unique-name "" + "Unique service name of notification daemon. +This must be kept, because the notification daemon could be +restarted, and the registered signals cannot be identified anymore.") + (defun notifications-on-action-signal (id action) "Dispatch signals to callback functions from `notifications-on-action-map'." (let ((entry (assoc id notifications-on-action-map))) - (when entry + (when (and entry + (string-equal notifications-unique-name + (dbus-event-service-name last-input-event))) (funcall (cadr entry) id action) (remove entry 'notifications-on-action-map)))) (when (fboundp 'dbus-register-signal) (dbus-register-signal :session - notifications-service + nil notifications-path notifications-interface notifications-action-signal @@ -113,7 +120,9 @@ ;; make it optional, and assume `undefined' as default. (let ((entry (assoc id notifications-on-close-map)) (reason (or reason 4))) - (when entry + (when (and entry + (string-equal notifications-unique-name + (dbus-event-service-name last-input-event))) (funcall (cadr entry) id (cadr (assoc reason notifications-closed-reason))) (remove entry 'notifications-on-close-map)))) @@ -121,7 +130,7 @@ (when (fboundp 'dbus-register-signal) (dbus-register-signal :session - notifications-service + nil notifications-path notifications-interface notifications-closed-signal @@ -277,6 +286,10 @@ (or hints '(:array :signature "{sv}")) :int32 (or timeout -1))) + ;; Remember daemon unique service name. + (setq notifications-unique-name + (dbus-get-name-owner :session notifications-service)) + ;; Register close/action callback function (let ((on-action (plist-get params :on-action)) (on-close (plist-get params :on-close))) ------------------------------------------------------------ revno: 107497 fixes bug(s): http://debbugs.gnu.org/10838 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-03-04 17:45:01 +0800 message: * lisp/emacs-lisp/package.el: Bump package version to 1.0. diff: === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2012-02-27 01:57:50 +0000 +++ lisp/emacs-lisp/package.el 2012-03-04 09:45:01 +0000 @@ -4,7 +4,7 @@ ;; Author: Tom Tromey ;; Created: 10 Mar 2007 -;; Version: 0.9 +;; Version: 1.0 ;; Keywords: tools ;; This file is part of GNU Emacs. ------------------------------------------------------------ revno: 107496 committer: Chong Yidong branch nick: trunk timestamp: Sun 2012-03-04 14:55:06 +0800 message: * cus-start.el: Make x-select-enable-clipboard-manager customizable. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-04 02:45:04 +0000 +++ lisp/ChangeLog 2012-03-04 06:55:06 +0000 @@ -1,3 +1,8 @@ +2012-03-04 Chong Yidong + + * cus-start.el: Make x-select-enable-clipboard-manager + customizable. + 2012-03-04 Glenn Morris * abbrev.el (copy-abbrev-table, abbrev-table-p) === modified file 'lisp/cus-start.el' --- lisp/cus-start.el 2012-02-07 03:31:29 +0000 +++ lisp/cus-start.el 2012-03-04 06:55:06 +0000 @@ -460,6 +460,8 @@ (x-use-underline-position-properties display boolean "22.1") (x-underline-at-descent-line display boolean "22.1") (x-stretch-cursor display boolean "21.1") + ;; xselect.c + (x-select-enable-clipboard-manager killing boolean "24.1") ;; xsettings.c (font-use-system-font font-selection boolean "23.2"))) this symbol group type standard version native-p rest prop propval