Now on revision 107526. ------------------------------------------------------------ revno: 107526 committer: Michael Albinus branch nick: trunk timestamp: Wed 2012-03-07 08:48:16 +0100 message: Avoid superfluous registering of signals. (Bug#10807) * notifications.el (notifications-on-action-object) (notifications-on-close-object): New defvars. (notifications-on-action-signal, notifications-on-closed-signal): Unregister the signal if not needed any longer. (notifications-notify): Register `notifications-action-signal' or `notifications-closed-signal', if :on-action or :on-close has been passed as argument. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-07 05:53:51 +0000 +++ lisp/ChangeLog 2012-03-07 07:48:16 +0000 @@ -1,3 +1,15 @@ +2012-03-07 Michael Albinus + + Avoid superfluous registering of signals. (Bug#10807) + + * notifications.el (notifications-on-action-object) + (notifications-on-close-object): New defvars. + (notifications-on-action-signal, notifications-on-closed-signal): + Unregister the signal if not needed any longer. + (notifications-notify): Register `notifications-action-signal' or + `notifications-closed-signal', if :on-action or :on-close has been + passed as argument. + 2012-03-07 Chong Yidong * cus-start.el: Avoid x-select-enable-clipboard-manager warning on === modified file 'lisp/notifications.el' --- lisp/notifications.el 2012-03-04 14:12:18 +0000 +++ lisp/notifications.el 2012-03-07 07:48:16 +0000 @@ -88,25 +88,26 @@ (defvar notifications-on-action-map nil "Mapping between notification and action callback functions.") +(defvar notifications-on-action-object nil + "Object for registered on-action signal.") + (defvar notifications-on-close-map nil "Mapping between notification and close callback functions.") +(defvar notifications-on-close-object nil + "Object for registered on-close signal.") + (defun notifications-on-action-signal (id action) "Dispatch signals to callback functions from `notifications-on-action-map'." (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)))) - -(when (fboundp 'dbus-register-signal) - (dbus-register-signal - :session - nil - notifications-path - notifications-interface - notifications-action-signal - 'notifications-on-action-signal)) + (when (and (not (setq notifications-on-action-map + (remove entry notifications-on-action-map))) + notifications-on-action-object) + (dbus-unregister-object notifications-on-action-object) + (setq notifications-on-action-object nil))))) (defun notifications-on-closed-signal (id &optional reason) "Dispatch signals to callback functions from `notifications-on-closed-map'." @@ -118,16 +119,11 @@ (when entry (funcall (cadr entry) id (cadr (assoc reason notifications-closed-reason))) - (remove entry notifications-on-close-map)))) - -(when (fboundp 'dbus-register-signal) - (dbus-register-signal - :session - nil - notifications-path - notifications-interface - notifications-closed-signal - 'notifications-on-closed-signal)) + (when (and (not (setq notifications-on-close-map + (remove entry notifications-on-close-map))) + notifications-on-close-object) + (dbus-unregister-object notifications-on-close-object) + (setq notifications-on-close-object nil))))) (defun notifications-notify (&rest params) "Send notification via D-Bus using the Freedesktop notification protocol. @@ -287,10 +283,29 @@ (unique-name (dbus-get-name-owner :session notifications-service))) (when on-action (add-to-list 'notifications-on-action-map - (list (cons unique-name id) on-action))) + (list (cons unique-name id) on-action)) + (unless notifications-on-action-object + (setq notifications-on-action-object + (dbus-register-signal + :session + nil + notifications-path + notifications-interface + notifications-action-signal + 'notifications-on-action-signal)))) + (when on-close (add-to-list 'notifications-on-close-map - (list (cons unique-name id) on-close)))) + (list (cons unique-name id) on-close)) + (unless notifications-on-close-object + (setq notifications-on-close-object + (dbus-register-signal + :session + nil + notifications-path + notifications-interface + notifications-closed-signal + 'notifications-on-closed-signal))))) ;; Return notification id id)) ------------------------------------------------------------ revno: 107525 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-03-06 23:43:14 -0800 message: lispref/markers.texi small change * doc/lispref/markers.texi (Overview of Markers): Reword garbage collection, add cross-ref. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-07 07:37:36 +0000 +++ doc/lispref/ChangeLog 2012-03-07 07:43:14 +0000 @@ -2,6 +2,7 @@ * markers.texi (The Region): Briefly mention use-empty-active-region and region-active-p. + (Overview of Markers): Reword garbage collection, add cross-ref. 2012-03-07 Chong Yidong === modified file 'doc/lispref/markers.texi' --- doc/lispref/markers.texi 2012-03-07 07:37:36 +0000 +++ doc/lispref/markers.texi 2012-03-07 07:43:14 +0000 @@ -58,6 +58,8 @@ relocate them if necessary. This slows processing in a buffer with a large number of markers. For this reason, it is a good idea to make a marker point nowhere if you are sure you don't need it any more. +Markers that can no longer be accessed are eventually removed +(@pxref{Garbage Collection}). @cindex markers as numbers Because it is common to perform arithmetic operations on a marker ------------------------------------------------------------ revno: 107524 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-03-06 23:37:36 -0800 message: lispref/markers.texi small addition * doc/lispref/markers.texi (The Region): Briefly mention use-empty-active-region and region-active-p. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-07 05:36:33 +0000 +++ doc/lispref/ChangeLog 2012-03-07 07:37:36 +0000 @@ -1,3 +1,8 @@ +2012-03-07 Glenn Morris + + * markers.texi (The Region): + Briefly mention use-empty-active-region and region-active-p. + 2012-03-07 Chong Yidong * text.texi (Buffer Contents): Don't duplicate explanation of === modified file 'doc/lispref/markers.texi' --- doc/lispref/markers.texi 2012-03-07 05:36:33 +0000 +++ doc/lispref/markers.texi 2012-03-07 07:37:36 +0000 @@ -58,8 +58,6 @@ relocate them if necessary. This slows processing in a buffer with a large number of markers. For this reason, it is a good idea to make a marker point nowhere if you are sure you don't need it any more. -Unreferenced markers are garbage collected eventually, but until then -will continue to use time if they do point somewhere. @cindex markers as numbers Because it is common to perform arithmetic operations on a marker @@ -636,6 +634,9 @@ @code{push-mark} discards an old mark when it adds a new one. @end defopt +@c There is also global-mark-ring-max, but this chapter explicitly +@c does not talk about the global mark. + @node The Region @section The Region @cindex region (between point and mark) @@ -673,4 +674,12 @@ mark is active, and there is a valid region in the buffer. This function is intended to be used by commands that operate on the region, instead of on text near point, when the mark is active. + +A region is valid if it has a non-zero size, or if the user option +@code{use-empty-active-region} is non-@code{nil} (by default, it is +@code{nil}). The function @code{region-active-p} is similar to +@code{use-region-p}, but considers all regions as valid. In most +cases, you should not use @code{region-active-p}, since if the region +is empty it is often more appropriate to operate on point. @end defun + ------------------------------------------------------------ revno: 107523 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-03-07 13:53:51 +0800 message: * cus-start.el: Avoid x-select-enable-clipboard-manager warning on non-X platforms. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-06 19:48:46 +0000 +++ lisp/ChangeLog 2012-03-07 05:53:51 +0000 @@ -1,3 +1,8 @@ +2012-03-07 Chong Yidong + + * cus-start.el: Avoid x-select-enable-clipboard-manager warning on + non-X platforms. + 2012-03-06 Glenn Morris * term/pc-win.el (x-selection-owner-p, x-own-selection-internal) === modified file 'lisp/cus-start.el' --- lisp/cus-start.el 2012-03-04 06:55:06 +0000 +++ lisp/cus-start.el 2012-03-07 05:53:51 +0000 @@ -502,6 +502,8 @@ (featurep 'ns)) ((string-match "\\`x-.*gtk" (symbol-name symbol)) (featurep 'gtk)) + ((string-match "clipboard-manager" (symbol-name symbol)) + (boundp 'x-select-enable-clipboard-manager)) ((string-match "\\`x-" (symbol-name symbol)) (fboundp 'x-create-frame)) ((string-match "selection" (symbol-name symbol)) ------------------------------------------------------------ revno: 107522 committer: Chong Yidong branch nick: trunk timestamp: Wed 2012-03-07 13:36:33 +0800 message: Minor updates to Markers and Text chapters of Lisp manual. * doc/lispref/markers.texi (The Mark): Fix typo. (The Region): Copyedits. * doc/lispref/text.texi (Buffer Contents): Don't duplicate explanation of region arguments from Text node. Put doc of obsolete var buffer-substring-filters back, since it is referred to. (Low-Level Kill Ring): Yank now uses clipboard instead of primary selection by default. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-07 02:51:40 +0000 +++ doc/lispref/ChangeLog 2012-03-07 05:36:33 +0000 @@ -1,3 +1,14 @@ +2012-03-07 Chong Yidong + + * text.texi (Buffer Contents): Don't duplicate explanation of + region arguments from Text node. Put doc of obsolete var + buffer-substring-filters back, since it is referred to. + (Low-Level Kill Ring): Yank now uses clipboard instead of primary + selection by default. + + * markers.texi (The Mark): Fix typo. + (The Region): Copyedits. + 2012-03-07 Glenn Morris * markers.texi (Overview of Markers): Copyedits. === modified file 'doc/lispref/markers.texi' --- doc/lispref/markers.texi 2012-03-07 02:51:40 +0000 +++ doc/lispref/markers.texi 2012-03-07 05:36:33 +0000 @@ -422,11 +422,11 @@ loop by setting the variable @code{deactivate-mark} to a non-@code{nil} value. - If Transient Mode is enabled, certain editing commands that normally -apply to text near point, apply instead to the region when the mark is -active. This is the main motivation for using Transient Mark mode. -(Another is that this enables highlighting of the region when the mark -is active. @xref{Display}.) + If Transient Mark mode is enabled, certain editing commands that +normally apply to text near point, apply instead to the region when +the mark is active. This is the main motivation for using Transient +Mark mode. (Another is that this enables highlighting of the region +when the mark is active. @xref{Display}.) In addition to the mark, each buffer has a @dfn{mark ring} which is a list of markers containing previous values of the mark. When editing @@ -662,16 +662,15 @@ larger. @end defun - Few programs need to use the @code{region-beginning} and -@code{region-end} functions. A command designed to operate on a region -should normally use @code{interactive} with the @samp{r} specification -to find the beginning and end of the region. This lets other Lisp -programs specify the bounds explicitly as arguments. (@xref{Interactive -Codes}.) + Instead of using @code{region-beginning} and @code{region-end}, a +command designed to operate on a region should normally use +@code{interactive} with the @samp{r} specification to find the +beginning and end of the region. This lets other Lisp programs +specify the bounds explicitly as arguments. @xref{Interactive Codes}. @defun use-region-p This function returns @code{t} if Transient Mark mode is enabled, the -mark is active, and there's a valid region in the buffer. Commands -that operate on the region (instead of on text near point) when -there's an active mark should use this to test whether to do that. +mark is active, and there is a valid region in the buffer. This +function is intended to be used by commands that operate on the +region, instead of on text near point, when the mark is active. @end defun === modified file 'doc/lispref/text.texi' --- doc/lispref/text.texi 2012-02-10 08:51:37 +0000 +++ doc/lispref/text.texi 2012-03-07 05:36:33 +0000 @@ -169,13 +169,9 @@ @defun buffer-substring start end This function returns a string containing a copy of the text of the region defined by positions @var{start} and @var{end} in the current -buffer. If the arguments are not positions in the accessible portion of -the buffer, @code{buffer-substring} signals an @code{args-out-of-range} -error. - -It is not necessary for @var{start} to be less than @var{end}; the -arguments can be given in either order. But most often the smaller -argument is written first. +buffer. If the arguments are not positions in the accessible portion +of the buffer, @code{buffer-substring} signals an +@code{args-out-of-range} error. Here's an example which assumes Font-Lock mode is not enabled: @@ -218,14 +214,20 @@ properties, just the characters themselves. @xref{Text Properties}. @end defun +@defun buffer-string +This function returns the contents of the entire accessible portion of +the current buffer as a string. It is equivalent to +@w{@code{(buffer-substring (point-min) (point-max))}}. +@end defun + @defun filter-buffer-substring start end &optional delete This function passes the buffer text between @var{start} and @var{end} through the filter functions specified by the wrapper hook -@code{filter-buffer-substring-functions}, and returns the final -result of applying all filters. The obsolete variable -@code{buffer-substring-filters} is also consulted. If both of these -variables are @code{nil}, the value is the unaltered text from the -buffer, as @code{buffer-substring} would return. +@code{filter-buffer-substring-functions}, and returns the result. The +obsolete variable @code{buffer-substring-filters} is also consulted. +If both of these variables are @code{nil}, the value is the unaltered +text from the buffer, i.e.@: what @code{buffer-substring} would +return. If @var{delete} is non-@code{nil}, this function deletes the text between @var{start} and @var{end} after copying it, like @@ -260,30 +262,20 @@ hook functions acting in sequence. @end defvar -@defun buffer-string -This function returns the contents of the entire accessible portion of -the current buffer as a string. It is equivalent to - -@example -(buffer-substring (point-min) (point-max)) -@end example - -@example -@group ----------- Buffer: foo ---------- -This is the contents of buffer foo - ----------- Buffer: foo ---------- - -(buffer-string) - @result{} "This is the contents of buffer foo\n" -@end group -@end example -@end defun +@defvar buffer-substring-filters +This variable is obsoleted by +@code{filter-buffer-substring-functions}, but is still supported for +backward compatibility. Its value should should be a list of +functions which accept a single string argument and return another +string. @code{filter-buffer-substring} passes the buffer substring to +the first function in this list, and the return value of each function +is passed to the next function. The return value of the last function +is passed to @code{filter-buffer-substring-functions}. +@end defvar @defun current-word &optional strict really-word -This function returns the symbol (or word) at or near point, as a string. -The return value includes no text properties. +This function returns the symbol (or word) at or near point, as a +string. The return value includes no text properties. If the optional argument @var{really-word} is non-@code{nil}, it finds a word; otherwise, it finds a symbol (which includes both word @@ -1112,13 +1104,11 @@ the other strings are pushed onto the kill ring, for easy access by @code{yank-pop}. -The normal use of this function is to get the window system's primary -selection as the most recent kill, even if the selection belongs to +The normal use of this function is to get the window system's +clipboard as the most recent kill, even if the selection belongs to another application. @xref{Window System Selections}. However, if -the selection was provided by the current Emacs session, this function -should return @code{nil}. (If it is hard to tell whether Emacs or -some other program provided the selection, it should be good enough to -use @code{string=} to compare it with the last text Emacs provided.) +the clipboard contents come from the current Emacs session, this +function should return @code{nil}. @end defvar @defvar interprogram-cut-function @@ -1129,9 +1119,8 @@ If the value is a function, @code{kill-new} and @code{kill-append} call it with the new first element of the kill ring as the argument. -The normal use of this function is to set the window system's primary -selection from the newly killed text. -@xref{Window System Selections}. +The normal use of this function is to put newly killed text in the +window system's clipboard. @xref{Window System Selections}. @end defvar @node Internals of Kill Ring ------------------------------------------------------------ revno: 107521 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-03-06 21:51:40 -0500 message: Small lispref/markers.texi edits * doc/lispref/markers.texi (Overview of Markers): Copyedits. (Creating Markers): Update approximate example buffer size. (The Mark): Don't mention uninteresting return values. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-05 06:12:17 +0000 +++ doc/lispref/ChangeLog 2012-03-07 02:51:40 +0000 @@ -1,3 +1,9 @@ +2012-03-07 Glenn Morris + + * markers.texi (Overview of Markers): Copyedits. + (Creating Markers): Update approximate example buffer size. + (The Mark): Don't mention uninteresting return values. + 2012-03-05 Chong Yidong * positions.texi (Text Lines): Document count-words. === modified file 'doc/lispref/markers.texi' --- doc/lispref/markers.texi 2012-01-19 07:21:25 +0000 +++ doc/lispref/markers.texi 2012-03-07 02:51:40 +0000 @@ -1,6 +1,6 @@ @c -*-texinfo-*- @c This is part of the GNU Emacs Lisp Reference Manual. -@c Copyright (C) 1990-1995, 1998-1999, 2001-2012 Free Software Foundation, Inc. +@c Copyright (C) 1990-1995, 1998-1999, 2001-2012 Free Software Foundation, Inc. @c See the file elisp.texi for copying conditions. @setfilename ../../info/markers @node Markers, Text, Positions, Top @@ -27,8 +27,8 @@ @node Overview of Markers @section Overview of Markers - A marker specifies a buffer and a position in that buffer. The -marker can be used to represent a position in the functions that + A marker specifies a buffer and a position in that buffer. A +marker can be used to represent a position in functions that require one, just as an integer could be used. In that case, the marker's buffer is normally ignored. Of course, a marker used in this way usually points to a position in the buffer that the function @@ -38,12 +38,12 @@ A marker has three attributes: the marker position, the marker buffer, and the insertion type. The marker position is an integer that is equivalent (at a given time) to the marker as a position in -that buffer. But the marker's position value can change often during -the life of the marker. Insertion and deletion of text in the buffer -relocate the marker. The idea is that a marker positioned between two -characters remains between those two characters despite insertion and -deletion elsewhere in the buffer. Relocation changes the integer -equivalent of the marker. +that buffer. But the marker's position value can change during +the life of the marker, and often does. Insertion and deletion of +text in the buffer relocate the marker. The idea is that a marker +positioned between two characters remains between those two characters +despite insertion and deletion elsewhere in the buffer. Relocation +changes the integer equivalent of the marker. @cindex marker relocation Deleting text around a marker's position leaves the marker between the @@ -63,7 +63,7 @@ @cindex markers as numbers Because it is common to perform arithmetic operations on a marker -position, most of the arithmetic operations (including @code{+} and +position, most of these operations (including @code{+} and @code{-}) accept markers as arguments. In such cases, the marker stands for its current position. @@ -188,7 +188,7 @@ (point-min-marker) @result{} # (point-max-marker) - @result{} # + @result{} # @end group @group @@ -229,8 +229,8 @@ @end group @group -(copy-marker 20000) - @result{} # +(copy-marker 90000) + @result{} # @end group @end example @@ -509,7 +509,8 @@ This function sets the current buffer's mark to @var{position}, and pushes a copy of the previous mark onto @code{mark-ring}. If @var{position} is @code{nil}, then the value of point is used. -@code{push-mark} returns @code{nil}. +@c Doesn't seem relevant. +@c @code{push-mark} returns @code{nil}. The function @code{push-mark} normally @emph{does not} activate the mark. To do that, specify @code{t} for the argument @var{activate}. @@ -523,8 +524,9 @@ that mark become the buffer's actual mark. This does not move point in the buffer, and it does nothing if @code{mark-ring} is empty. It deactivates the mark. - -The return value is not meaningful. +@c +@c Seems even less relevant. +@c The return value is not meaningful. @end defun @defopt transient-mark-mode ------------------------------------------------------------ revno: 107520 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-03-06 20:58:30 -0500 message: FOR-RELEASE markup diff: === modified file 'admin/FOR-RELEASE' --- admin/FOR-RELEASE 2012-03-05 06:12:17 +0000 +++ admin/FOR-RELEASE 2012-03-07 01:58:30 +0000 @@ -218,7 +218,7 @@ numbers.texi cyd objects.texi cyd os.texi -package.texi +package.texi rgm positions.texi cyd processes.texi searching.texi ------------------------------------------------------------ revno: 107519 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-03-06 14:48:46 -0500 message: pc-win.el doc fix for bug#10783 * lisp/term/pc-win.el (x-selection-owner-p, x-own-selection-internal) (x-disown-selection-internal, x-get-selection-internal): Doc fix (add arglist signatures). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-06 08:37:38 +0000 +++ lisp/ChangeLog 2012-03-06 19:48:46 +0000 @@ -1,3 +1,9 @@ +2012-03-06 Glenn Morris + + * term/pc-win.el (x-selection-owner-p, x-own-selection-internal) + (x-disown-selection-internal, x-get-selection-internal): + Doc fix (add arglist signatures). (Bug#10783) + 2012-03-06 Kaushik Srenevasan (tiny change) * progmodes/gdb-mi.el (gdb-breakpoints-list-handler-custom): === modified file 'lisp/term/pc-win.el' --- lisp/term/pc-win.el 2012-02-12 03:13:13 +0000 +++ lisp/term/pc-win.el 2012-03-06 19:48:46 +0000 @@ -159,6 +159,12 @@ ;; returned value matters. Also, by the way, recall that `ignore' is ;; a useful function for returning 'nil regardless of argument. +;; Note: Any re-definition in this file of a function that is defined +;; in C on other platforms, should either have no doc-string, or one +;; that is identical to the C version, but with the arglist signature +;; at the end. Otherwise help-split-fundoc gets confused on other +;; platforms. (Bug#10783) + ;; From src/xfns.c (defun x-list-fonts (pattern &optional face frame maximum width) (if (or (null width) (and (numberp width) (= width 1))) @@ -261,7 +267,9 @@ server to query. If omitted or nil, that stands for the selected frame's display, or the first available X display. -On Nextstep, TERMINAL is unused." +On Nextstep, TERMINAL is unused. + +\(fn &optional SELECTION TERMINAL)" (if x-select-enable-clipboard (let (text) ;; Don't die if w16-get-clipboard-data signals an error. @@ -289,7 +297,9 @@ FRAME should be a frame that should own the selection. If omitted or nil, it defaults to the selected frame. -On Nextstep, FRAME is unused." +On Nextstep, FRAME is unused. + +\(fn SELECTION VALUE &optional FRAME)" (ignore-errors (x-select-text value)) value) @@ -306,7 +316,9 @@ frame's display, or the first available X display. On Nextstep, the TIME-OBJECT and TERMINAL arguments are unused. -On MS-DOS, all this does is return non-nil if we own the selection." +On MS-DOS, all this does is return non-nil if we own the selection. + +\(fn SELECTION &optional TIME-OBJECT TERMINAL)" (if (x-selection-owner-p selection) t)) @@ -324,7 +336,9 @@ server to query. If omitted or nil, that stands for the selected frame's display, or the first available X display. -On Nextstep, TIME-STAMP and TERMINAL are unused." +On Nextstep, TIME-STAMP and TERMINAL are unused. + +\(fn SELECTION-SYMBOL TARGET-TYPE &optional TIME-STAMP TERMINAL)" (x-get-selection-value)) ;; From src/fontset.c: ------------------------------------------------------------ revno: 107518 author: Kaushik Srenevasan committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-03-06 00:37:38 -0800 message: Small gdb-breakpoints fix (tiny change) Ref: http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00753.html * lisp/progmodes/gdb-mi.el (gdb-breakpoints-list-handler-custom): Handle breakpoints with no "type". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-06 08:22:42 +0000 +++ lisp/ChangeLog 2012-03-06 08:37:38 +0000 @@ -1,3 +1,8 @@ +2012-03-06 Kaushik Srenevasan (tiny change) + + * progmodes/gdb-mi.el (gdb-breakpoints-list-handler-custom): + Handle breakpoints with no "type". + 2012-03-06 Glenn Morris * files.el (locate-dominating-file): Add optional predicate argument. === modified file 'lisp/progmodes/gdb-mi.el' --- lisp/progmodes/gdb-mi.el 2012-02-26 09:38:45 +0000 +++ lisp/progmodes/gdb-mi.el 2012-03-06 08:37:38 +0000 @@ -2397,15 +2397,15 @@ (gdb-table-add-row table (list (bindat-get-field breakpoint 'number) - type - (bindat-get-field breakpoint 'disp) + (or type "") + (or (bindat-get-field breakpoint 'disp) "") (let ((flag (bindat-get-field breakpoint 'enabled))) (if (string-equal flag "y") (propertize "y" 'font-lock-face font-lock-warning-face) (propertize "n" 'font-lock-face font-lock-comment-face))) (bindat-get-field breakpoint 'addr) - (bindat-get-field breakpoint 'times) - (if (string-match ".*watchpoint" type) + (or (bindat-get-field breakpoint 'times) "") + (if (and type (string-match ".*watchpoint" type)) (bindat-get-field breakpoint 'what) (or pending at (concat "in " ------------------------------------------------------------ revno: 107517 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-03-06 00:22:42 -0800 message: Tweak previous dir-locals-find-file change * lisp/files.el (locate-dominating-file): Add optional predicate argument. (dir-locals-find-file): Make use of above change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-06 03:00:52 +0000 +++ lisp/ChangeLog 2012-03-06 08:22:42 +0000 @@ -1,3 +1,8 @@ +2012-03-06 Glenn Morris + + * files.el (locate-dominating-file): Add optional predicate argument. + (dir-locals-find-file): Make use of above change. + 2012-03-06 Thien-Thi Nguyen * info.el (Info-insert-dir): Also try "dir.gz". === modified file 'lisp/files.el' --- lisp/files.el 2012-03-06 02:50:28 +0000 +++ lisp/files.el 2012-03-06 08:22:42 +0000 @@ -877,13 +877,14 @@ ;; (setq dir nil)))) ;; nil))) -(defun locate-dominating-file (file name) +(defun locate-dominating-file (file name &optional predicate) "Look up the directory hierarchy from FILE for a file named NAME. Stop at the first parent directory containing a file NAME, and return the directory. Return nil if not found. -This function only tests if FILE exists. If you care about whether -it is readable, regular, etc., you should test the result." +Optional argument PREDICATE is a function of one argument, a file. +It should return non-nil if the file is acceptable. The default is +`file-exists-p'; you might, e.g., want to use `file-readable-p' instead." ;; We used to use the above locate-dominating-files code, but the ;; directory-files call is very costly, so we're much better off doing ;; multiple calls using the code in here. @@ -910,11 +911,8 @@ ;; (setq user (nth 2 (file-attributes file))) ;; (and prev-user (not (equal user prev-user)))) (string-match locate-dominating-stop-dir-regexp file))) - ;; FIXME? maybe this function should (optionally?) - ;; use file-readable-p instead. In many cases, an unreadable - ;; FILE is no better than a non-existent one. - ;; See eg dir-locals-find-file. - (setq try (file-exists-p (expand-file-name name file))) + (setq try (funcall (or predicate 'file-exists-p) + (expand-file-name name file))) (cond (try (setq root file)) ((equal file (setq file (file-name-directory (directory-file-name file)))) @@ -3552,7 +3550,7 @@ "Find the directory-local variables for FILE. This searches upward in the directory tree from FILE. It stops at the first directory that has been registered in -`dir-locals-directory-cache' or contains a `dir-locals-file'. +`dir-locals-directory-cache' or contains a readable `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 @@ -3570,17 +3568,15 @@ (if (eq system-type 'ms-dos) (dosified-file-name dir-locals-file) dir-locals-file)) - (locals-file (locate-dominating-file file dir-locals-file-name)) + ;; FIXME? Is it right to silently ignore unreadable files? + (locals-file (locate-dominating-file file dir-locals-file-name + (lambda (file) + (and (file-readable-p file) + (file-regular-p file))))) (dir-elt nil)) ;; `locate-dominating-file' may have abbreviated the name. - (and locals-file - (setq locals-file (expand-file-name dir-locals-file-name locals-file)) - ;; FIXME? is it right to silently ignore an unreadable file? - ;; Maybe we'd want to keep searching in that case. - ;; That is a locate-dominating-file issue. - (or (not (file-readable-p locals-file)) - (not (file-regular-p locals-file))) - (setq locals-file nil)) + (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)) ------------------------------------------------------------ revno: 107516 committer: Glenn Morris branch nick: trunk timestamp: Mon 2012-03-05 22:02:44 -0500 message: Comment. diff: === modified file 'lisp/info.el' --- lisp/info.el 2012-03-06 03:00:52 +0000 +++ lisp/info.el 2012-03-06 03:02:44 +0000 @@ -1166,6 +1166,10 @@ (file-attributes file)) (progn (setq file (expand-file-name "DIR.INFO" truename)) (file-attributes file)) + ;; Shouldn't really happen, but sometimes does, + ;; eg on Debian systems with buggy packages; + ;; so may as well try it. + ;; http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00005.html (progn (setq file (expand-file-name "dir.gz" truename)) (file-attributes file))))) (setq dirs-done