diff options
| author | Joakim Verona | 2012-03-07 09:41:43 +0100 |
|---|---|---|
| committer | Joakim Verona | 2012-03-07 09:41:43 +0100 |
| commit | 1e3a41b29b5bd263cde651d9f23517c8a29155dc (patch) | |
| tree | 521dbc7d21eff3acefe3e74e2585f49923924534 /lisp | |
| parent | 28485daaf752ff5264ed2f6a32ec15588beaa929 (diff) | |
| parent | 3266b56f817e562638f0ab7ca36fe5e01a44f831 (diff) | |
| download | emacs-1e3a41b29b5bd263cde651d9f23517c8a29155dc.tar.gz emacs-1e3a41b29b5bd263cde651d9f23517c8a29155dc.zip | |
upstream
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 33 | ||||
| -rw-r--r-- | lisp/cus-start.el | 2 | ||||
| -rw-r--r-- | lisp/files.el | 32 | ||||
| -rw-r--r-- | lisp/notifications.el | 59 | ||||
| -rw-r--r-- | lisp/progmodes/gdb-mi.el | 8 | ||||
| -rw-r--r-- | lisp/term/pc-win.el | 22 |
6 files changed, 108 insertions, 48 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6a9b1808cdf..d8342df4da5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,36 @@ | |||
| 1 | 2012-03-07 Michael Albinus <Michael.Albinus@alcatel-lucent.com> | ||
| 2 | |||
| 3 | Avoid superfluous registering of signals. (Bug#10807) | ||
| 4 | |||
| 5 | * notifications.el (notifications-on-action-object) | ||
| 6 | (notifications-on-close-object): New defvars. | ||
| 7 | (notifications-on-action-signal, notifications-on-closed-signal): | ||
| 8 | Unregister the signal if not needed any longer. | ||
| 9 | (notifications-notify): Register `notifications-action-signal' or | ||
| 10 | `notifications-closed-signal', if :on-action or :on-close has been | ||
| 11 | passed as argument. | ||
| 12 | |||
| 13 | 2012-03-07 Chong Yidong <cyd@gnu.org> | ||
| 14 | |||
| 15 | * cus-start.el: Avoid x-select-enable-clipboard-manager warning on | ||
| 16 | non-X platforms. | ||
| 17 | |||
| 18 | 2012-03-06 Glenn Morris <rgm@gnu.org> | ||
| 19 | |||
| 20 | * term/pc-win.el (x-selection-owner-p, x-own-selection-internal) | ||
| 21 | (x-disown-selection-internal, x-get-selection-internal): | ||
| 22 | Doc fix (add arglist signatures). (Bug#10783) | ||
| 23 | |||
| 24 | 2012-03-06 Kaushik Srenevasan <ksrenevasan@gmail.com> (tiny change) | ||
| 25 | |||
| 26 | * progmodes/gdb-mi.el (gdb-breakpoints-list-handler-custom): | ||
| 27 | Handle breakpoints with no "type". | ||
| 28 | |||
| 29 | 2012-03-06 Glenn Morris <rgm@gnu.org> | ||
| 30 | |||
| 31 | * files.el (locate-dominating-file): Add optional predicate argument. | ||
| 32 | (dir-locals-find-file): Make use of above change. | ||
| 33 | |||
| 1 | 2012-03-06 Thien-Thi Nguyen <ttn@gnuvola.org> | 34 | 2012-03-06 Thien-Thi Nguyen <ttn@gnuvola.org> |
| 2 | 35 | ||
| 3 | * info.el (Info-insert-dir): Also try "dir.gz". | 36 | * info.el (Info-insert-dir): Also try "dir.gz". |
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index a2ac7aa91e6..fbba49951d1 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el | |||
| @@ -502,6 +502,8 @@ since it could result in memory overflow and make Emacs crash." | |||
| 502 | (featurep 'ns)) | 502 | (featurep 'ns)) |
| 503 | ((string-match "\\`x-.*gtk" (symbol-name symbol)) | 503 | ((string-match "\\`x-.*gtk" (symbol-name symbol)) |
| 504 | (featurep 'gtk)) | 504 | (featurep 'gtk)) |
| 505 | ((string-match "clipboard-manager" (symbol-name symbol)) | ||
| 506 | (boundp 'x-select-enable-clipboard-manager)) | ||
| 505 | ((string-match "\\`x-" (symbol-name symbol)) | 507 | ((string-match "\\`x-" (symbol-name symbol)) |
| 506 | (fboundp 'x-create-frame)) | 508 | (fboundp 'x-create-frame)) |
| 507 | ((string-match "selection" (symbol-name symbol)) | 509 | ((string-match "selection" (symbol-name symbol)) |
diff --git a/lisp/files.el b/lisp/files.el index fae834daefe..1d54ef81869 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -877,13 +877,14 @@ or mount points potentially requiring authentication as a different user.") | |||
| 877 | ;; (setq dir nil)))) | 877 | ;; (setq dir nil)))) |
| 878 | ;; nil))) | 878 | ;; nil))) |
| 879 | 879 | ||
| 880 | (defun locate-dominating-file (file name) | 880 | (defun locate-dominating-file (file name &optional predicate) |
| 881 | "Look up the directory hierarchy from FILE for a file named NAME. | 881 | "Look up the directory hierarchy from FILE for a file named NAME. |
| 882 | Stop at the first parent directory containing a file NAME, | 882 | Stop at the first parent directory containing a file NAME, |
| 883 | and return the directory. Return nil if not found. | 883 | and return the directory. Return nil if not found. |
| 884 | 884 | ||
| 885 | This function only tests if FILE exists. If you care about whether | 885 | Optional argument PREDICATE is a function of one argument, a file. |
| 886 | it is readable, regular, etc., you should test the result." | 886 | It should return non-nil if the file is acceptable. The default is |
| 887 | `file-exists-p'; you might, e.g., want to use `file-readable-p' instead." | ||
| 887 | ;; We used to use the above locate-dominating-files code, but the | 888 | ;; We used to use the above locate-dominating-files code, but the |
| 888 | ;; directory-files call is very costly, so we're much better off doing | 889 | ;; directory-files call is very costly, so we're much better off doing |
| 889 | ;; multiple calls using the code in here. | 890 | ;; multiple calls using the code in here. |
| @@ -910,11 +911,8 @@ it is readable, regular, etc., you should test the result." | |||
| 910 | ;; (setq user (nth 2 (file-attributes file))) | 911 | ;; (setq user (nth 2 (file-attributes file))) |
| 911 | ;; (and prev-user (not (equal user prev-user)))) | 912 | ;; (and prev-user (not (equal user prev-user)))) |
| 912 | (string-match locate-dominating-stop-dir-regexp file))) | 913 | (string-match locate-dominating-stop-dir-regexp file))) |
| 913 | ;; FIXME? maybe this function should (optionally?) | 914 | (setq try (funcall (or predicate 'file-exists-p) |
| 914 | ;; use file-readable-p instead. In many cases, an unreadable | 915 | (expand-file-name name file))) |
| 915 | ;; FILE is no better than a non-existent one. | ||
| 916 | ;; See eg dir-locals-find-file. | ||
| 917 | (setq try (file-exists-p (expand-file-name name file))) | ||
| 918 | (cond (try (setq root file)) | 916 | (cond (try (setq root file)) |
| 919 | ((equal file (setq file (file-name-directory | 917 | ((equal file (setq file (file-name-directory |
| 920 | (directory-file-name file)))) | 918 | (directory-file-name file)))) |
| @@ -3552,7 +3550,7 @@ across different environments and users.") | |||
| 3552 | "Find the directory-local variables for FILE. | 3550 | "Find the directory-local variables for FILE. |
| 3553 | This searches upward in the directory tree from FILE. | 3551 | This searches upward in the directory tree from FILE. |
| 3554 | It stops at the first directory that has been registered in | 3552 | It stops at the first directory that has been registered in |
| 3555 | `dir-locals-directory-cache' or contains a `dir-locals-file'. | 3553 | `dir-locals-directory-cache' or contains a readable `dir-locals-file'. |
| 3556 | If it finds an entry in the cache, it checks that it is valid. | 3554 | If it finds an entry in the cache, it checks that it is valid. |
| 3557 | A cache entry with no modification time element (normally, one that | 3555 | A cache entry with no modification time element (normally, one that |
| 3558 | has been assigned directly using `dir-locals-set-directory-class', not | 3556 | has been assigned directly using `dir-locals-set-directory-class', not |
| @@ -3570,17 +3568,15 @@ of no valid cache entry." | |||
| 3570 | (if (eq system-type 'ms-dos) | 3568 | (if (eq system-type 'ms-dos) |
| 3571 | (dosified-file-name dir-locals-file) | 3569 | (dosified-file-name dir-locals-file) |
| 3572 | dir-locals-file)) | 3570 | dir-locals-file)) |
| 3573 | (locals-file (locate-dominating-file file dir-locals-file-name)) | 3571 | ;; FIXME? Is it right to silently ignore unreadable files? |
| 3572 | (locals-file (locate-dominating-file file dir-locals-file-name | ||
| 3573 | (lambda (file) | ||
| 3574 | (and (file-readable-p file) | ||
| 3575 | (file-regular-p file))))) | ||
| 3574 | (dir-elt nil)) | 3576 | (dir-elt nil)) |
| 3575 | ;; `locate-dominating-file' may have abbreviated the name. | 3577 | ;; `locate-dominating-file' may have abbreviated the name. |
| 3576 | (and locals-file | 3578 | (if locals-file |
| 3577 | (setq locals-file (expand-file-name dir-locals-file-name locals-file)) | 3579 | (setq locals-file (expand-file-name dir-locals-file-name locals-file))) |
| 3578 | ;; FIXME? is it right to silently ignore an unreadable file? | ||
| 3579 | ;; Maybe we'd want to keep searching in that case. | ||
| 3580 | ;; That is a locate-dominating-file issue. | ||
| 3581 | (or (not (file-readable-p locals-file)) | ||
| 3582 | (not (file-regular-p locals-file))) | ||
| 3583 | (setq locals-file nil)) | ||
| 3584 | ;; Find the best cached value in `dir-locals-directory-cache'. | 3580 | ;; Find the best cached value in `dir-locals-directory-cache'. |
| 3585 | (dolist (elt dir-locals-directory-cache) | 3581 | (dolist (elt dir-locals-directory-cache) |
| 3586 | (when (and (eq t (compare-strings file nil (length (car elt)) | 3582 | (when (and (eq t (compare-strings file nil (length (car elt)) |
diff --git a/lisp/notifications.el b/lisp/notifications.el index 1b75c2c5702..908cbcaabab 100644 --- a/lisp/notifications.el +++ b/lisp/notifications.el | |||
| @@ -88,25 +88,26 @@ | |||
| 88 | (defvar notifications-on-action-map nil | 88 | (defvar notifications-on-action-map nil |
| 89 | "Mapping between notification and action callback functions.") | 89 | "Mapping between notification and action callback functions.") |
| 90 | 90 | ||
| 91 | (defvar notifications-on-action-object nil | ||
| 92 | "Object for registered on-action signal.") | ||
| 93 | |||
| 91 | (defvar notifications-on-close-map nil | 94 | (defvar notifications-on-close-map nil |
| 92 | "Mapping between notification and close callback functions.") | 95 | "Mapping between notification and close callback functions.") |
| 93 | 96 | ||
| 97 | (defvar notifications-on-close-object nil | ||
| 98 | "Object for registered on-close signal.") | ||
| 99 | |||
| 94 | (defun notifications-on-action-signal (id action) | 100 | (defun notifications-on-action-signal (id action) |
| 95 | "Dispatch signals to callback functions from `notifications-on-action-map'." | 101 | "Dispatch signals to callback functions from `notifications-on-action-map'." |
| 96 | (let* ((unique-name (dbus-event-service-name last-input-event)) | 102 | (let* ((unique-name (dbus-event-service-name last-input-event)) |
| 97 | (entry (assoc (cons unique-name id) notifications-on-action-map))) | 103 | (entry (assoc (cons unique-name id) notifications-on-action-map))) |
| 98 | (when entry | 104 | (when entry |
| 99 | (funcall (cadr entry) id action) | 105 | (funcall (cadr entry) id action) |
| 100 | (remove entry notifications-on-action-map)))) | 106 | (when (and (not (setq notifications-on-action-map |
| 101 | 107 | (remove entry notifications-on-action-map))) | |
| 102 | (when (fboundp 'dbus-register-signal) | 108 | notifications-on-action-object) |
| 103 | (dbus-register-signal | 109 | (dbus-unregister-object notifications-on-action-object) |
| 104 | :session | 110 | (setq notifications-on-action-object nil))))) |
| 105 | nil | ||
| 106 | notifications-path | ||
| 107 | notifications-interface | ||
| 108 | notifications-action-signal | ||
| 109 | 'notifications-on-action-signal)) | ||
| 110 | 111 | ||
| 111 | (defun notifications-on-closed-signal (id &optional reason) | 112 | (defun notifications-on-closed-signal (id &optional reason) |
| 112 | "Dispatch signals to callback functions from `notifications-on-closed-map'." | 113 | "Dispatch signals to callback functions from `notifications-on-closed-map'." |
| @@ -118,16 +119,11 @@ | |||
| 118 | (when entry | 119 | (when entry |
| 119 | (funcall (cadr entry) | 120 | (funcall (cadr entry) |
| 120 | id (cadr (assoc reason notifications-closed-reason))) | 121 | id (cadr (assoc reason notifications-closed-reason))) |
| 121 | (remove entry notifications-on-close-map)))) | 122 | (when (and (not (setq notifications-on-close-map |
| 122 | 123 | (remove entry notifications-on-close-map))) | |
| 123 | (when (fboundp 'dbus-register-signal) | 124 | notifications-on-close-object) |
| 124 | (dbus-register-signal | 125 | (dbus-unregister-object notifications-on-close-object) |
| 125 | :session | 126 | (setq notifications-on-close-object nil))))) |
| 126 | nil | ||
| 127 | notifications-path | ||
| 128 | notifications-interface | ||
| 129 | notifications-closed-signal | ||
| 130 | 'notifications-on-closed-signal)) | ||
| 131 | 127 | ||
| 132 | (defun notifications-notify (&rest params) | 128 | (defun notifications-notify (&rest params) |
| 133 | "Send notification via D-Bus using the Freedesktop notification protocol. | 129 | "Send notification via D-Bus using the Freedesktop notification protocol. |
| @@ -287,10 +283,29 @@ used to manipulate the notification item with | |||
| 287 | (unique-name (dbus-get-name-owner :session notifications-service))) | 283 | (unique-name (dbus-get-name-owner :session notifications-service))) |
| 288 | (when on-action | 284 | (when on-action |
| 289 | (add-to-list 'notifications-on-action-map | 285 | (add-to-list 'notifications-on-action-map |
| 290 | (list (cons unique-name id) on-action))) | 286 | (list (cons unique-name id) on-action)) |
| 287 | (unless notifications-on-action-object | ||
| 288 | (setq notifications-on-action-object | ||
| 289 | (dbus-register-signal | ||
| 290 | :session | ||
| 291 | nil | ||
| 292 | notifications-path | ||
| 293 | notifications-interface | ||
| 294 | notifications-action-signal | ||
| 295 | 'notifications-on-action-signal)))) | ||
| 296 | |||
| 291 | (when on-close | 297 | (when on-close |
| 292 | (add-to-list 'notifications-on-close-map | 298 | (add-to-list 'notifications-on-close-map |
| 293 | (list (cons unique-name id) on-close)))) | 299 | (list (cons unique-name id) on-close)) |
| 300 | (unless notifications-on-close-object | ||
| 301 | (setq notifications-on-close-object | ||
| 302 | (dbus-register-signal | ||
| 303 | :session | ||
| 304 | nil | ||
| 305 | notifications-path | ||
| 306 | notifications-interface | ||
| 307 | notifications-closed-signal | ||
| 308 | 'notifications-on-closed-signal))))) | ||
| 294 | 309 | ||
| 295 | ;; Return notification id | 310 | ;; Return notification id |
| 296 | id)) | 311 | id)) |
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 0c45c3f5e5d..8ea255e49dd 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -2397,15 +2397,15 @@ HANDLER-NAME handler uses customization of CUSTOM-DEFUN. See | |||
| 2397 | (gdb-table-add-row table | 2397 | (gdb-table-add-row table |
| 2398 | (list | 2398 | (list |
| 2399 | (bindat-get-field breakpoint 'number) | 2399 | (bindat-get-field breakpoint 'number) |
| 2400 | type | 2400 | (or type "") |
| 2401 | (bindat-get-field breakpoint 'disp) | 2401 | (or (bindat-get-field breakpoint 'disp) "") |
| 2402 | (let ((flag (bindat-get-field breakpoint 'enabled))) | 2402 | (let ((flag (bindat-get-field breakpoint 'enabled))) |
| 2403 | (if (string-equal flag "y") | 2403 | (if (string-equal flag "y") |
| 2404 | (propertize "y" 'font-lock-face font-lock-warning-face) | 2404 | (propertize "y" 'font-lock-face font-lock-warning-face) |
| 2405 | (propertize "n" 'font-lock-face font-lock-comment-face))) | 2405 | (propertize "n" 'font-lock-face font-lock-comment-face))) |
| 2406 | (bindat-get-field breakpoint 'addr) | 2406 | (bindat-get-field breakpoint 'addr) |
| 2407 | (bindat-get-field breakpoint 'times) | 2407 | (or (bindat-get-field breakpoint 'times) "") |
| 2408 | (if (string-match ".*watchpoint" type) | 2408 | (if (and type (string-match ".*watchpoint" type)) |
| 2409 | (bindat-get-field breakpoint 'what) | 2409 | (bindat-get-field breakpoint 'what) |
| 2410 | (or pending at | 2410 | (or pending at |
| 2411 | (concat "in " | 2411 | (concat "in " |
diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el index fc86d4179b6..b460e3b8a14 100644 --- a/lisp/term/pc-win.el +++ b/lisp/term/pc-win.el | |||
| @@ -159,6 +159,12 @@ created." | |||
| 159 | ;; returned value matters. Also, by the way, recall that `ignore' is | 159 | ;; returned value matters. Also, by the way, recall that `ignore' is |
| 160 | ;; a useful function for returning 'nil regardless of argument. | 160 | ;; a useful function for returning 'nil regardless of argument. |
| 161 | 161 | ||
| 162 | ;; Note: Any re-definition in this file of a function that is defined | ||
| 163 | ;; in C on other platforms, should either have no doc-string, or one | ||
| 164 | ;; that is identical to the C version, but with the arglist signature | ||
| 165 | ;; at the end. Otherwise help-split-fundoc gets confused on other | ||
| 166 | ;; platforms. (Bug#10783) | ||
| 167 | |||
| 162 | ;; From src/xfns.c | 168 | ;; From src/xfns.c |
| 163 | (defun x-list-fonts (pattern &optional face frame maximum width) | 169 | (defun x-list-fonts (pattern &optional face frame maximum width) |
| 164 | (if (or (null width) (and (numberp width) (= width 1))) | 170 | (if (or (null width) (and (numberp width) (= width 1))) |
| @@ -261,7 +267,9 @@ TERMINAL should be a terminal object or a frame specifying the X | |||
| 261 | server to query. If omitted or nil, that stands for the selected | 267 | server to query. If omitted or nil, that stands for the selected |
| 262 | frame's display, or the first available X display. | 268 | frame's display, or the first available X display. |
| 263 | 269 | ||
| 264 | On Nextstep, TERMINAL is unused." | 270 | On Nextstep, TERMINAL is unused. |
| 271 | |||
| 272 | \(fn &optional SELECTION TERMINAL)" | ||
| 265 | (if x-select-enable-clipboard | 273 | (if x-select-enable-clipboard |
| 266 | (let (text) | 274 | (let (text) |
| 267 | ;; Don't die if w16-get-clipboard-data signals an error. | 275 | ;; Don't die if w16-get-clipboard-data signals an error. |
| @@ -289,7 +297,9 @@ anything that the functions on `selection-converter-alist' know about. | |||
| 289 | FRAME should be a frame that should own the selection. If omitted or | 297 | FRAME should be a frame that should own the selection. If omitted or |
| 290 | nil, it defaults to the selected frame. | 298 | nil, it defaults to the selected frame. |
| 291 | 299 | ||
| 292 | On Nextstep, FRAME is unused." | 300 | On Nextstep, FRAME is unused. |
| 301 | |||
| 302 | \(fn SELECTION VALUE &optional FRAME)" | ||
| 293 | (ignore-errors | 303 | (ignore-errors |
| 294 | (x-select-text value)) | 304 | (x-select-text value)) |
| 295 | value) | 305 | value) |
| @@ -306,7 +316,9 @@ server to query. If omitted or nil, that stands for the selected | |||
| 306 | frame's display, or the first available X display. | 316 | frame's display, or the first available X display. |
| 307 | 317 | ||
| 308 | On Nextstep, the TIME-OBJECT and TERMINAL arguments are unused. | 318 | On Nextstep, the TIME-OBJECT and TERMINAL arguments are unused. |
| 309 | On MS-DOS, all this does is return non-nil if we own the selection." | 319 | On MS-DOS, all this does is return non-nil if we own the selection. |
| 320 | |||
| 321 | \(fn SELECTION &optional TIME-OBJECT TERMINAL)" | ||
| 310 | (if (x-selection-owner-p selection) | 322 | (if (x-selection-owner-p selection) |
| 311 | t)) | 323 | t)) |
| 312 | 324 | ||
| @@ -324,7 +336,9 @@ TERMINAL should be a terminal object or a frame specifying the X | |||
| 324 | server to query. If omitted or nil, that stands for the selected | 336 | server to query. If omitted or nil, that stands for the selected |
| 325 | frame's display, or the first available X display. | 337 | frame's display, or the first available X display. |
| 326 | 338 | ||
| 327 | On Nextstep, TIME-STAMP and TERMINAL are unused." | 339 | On Nextstep, TIME-STAMP and TERMINAL are unused. |
| 340 | |||
| 341 | \(fn SELECTION-SYMBOL TARGET-TYPE &optional TIME-STAMP TERMINAL)" | ||
| 328 | (x-get-selection-value)) | 342 | (x-get-selection-value)) |
| 329 | 343 | ||
| 330 | ;; From src/fontset.c: | 344 | ;; From src/fontset.c: |