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 | |
| parent | 28485daaf752ff5264ed2f6a32ec15588beaa929 (diff) | |
| parent | 3266b56f817e562638f0ab7ca36fe5e01a44f831 (diff) | |
| download | emacs-1e3a41b29b5bd263cde651d9f23517c8a29155dc.tar.gz emacs-1e3a41b29b5bd263cde651d9f23517c8a29155dc.zip | |
upstream
| -rw-r--r-- | admin/FOR-RELEASE | 4 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 24 | ||||
| -rw-r--r-- | doc/lispref/markers.texi | 88 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 75 | ||||
| -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 |
10 files changed, 220 insertions, 127 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index 99b702ad30f..bfe831fa07f 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE | |||
| @@ -211,14 +211,14 @@ lists.texi cyd | |||
| 211 | loading.texi cyd | 211 | loading.texi cyd |
| 212 | macros.texi cyd | 212 | macros.texi cyd |
| 213 | maps.texi rgm | 213 | maps.texi rgm |
| 214 | markers.texi | 214 | markers.texi rgm |
| 215 | minibuf.texi | 215 | minibuf.texi |
| 216 | modes.texi cyd | 216 | modes.texi cyd |
| 217 | nonascii.texi | 217 | nonascii.texi |
| 218 | numbers.texi cyd | 218 | numbers.texi cyd |
| 219 | objects.texi cyd | 219 | objects.texi cyd |
| 220 | os.texi | 220 | os.texi |
| 221 | package.texi | 221 | package.texi rgm |
| 222 | positions.texi cyd | 222 | positions.texi cyd |
| 223 | processes.texi | 223 | processes.texi |
| 224 | searching.texi | 224 | searching.texi |
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 7f11c65f9e1..42ec24fac5f 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,27 @@ | |||
| 1 | 2012-03-07 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * markers.texi (The Region): Briefly mention use-empty-active-region | ||
| 4 | and region-active-p. | ||
| 5 | (Overview of Markers): Reword garbage collection, add cross-ref. | ||
| 6 | (The Mark): Tiny clarification re command loop and activate-mark-hook. | ||
| 7 | |||
| 8 | 2012-03-07 Chong Yidong <cyd@gnu.org> | ||
| 9 | |||
| 10 | * text.texi (Buffer Contents): Don't duplicate explanation of | ||
| 11 | region arguments from Text node. Put doc of obsolete var | ||
| 12 | buffer-substring-filters back, since it is referred to. | ||
| 13 | (Low-Level Kill Ring): Yank now uses clipboard instead of primary | ||
| 14 | selection by default. | ||
| 15 | |||
| 16 | * markers.texi (The Mark): Fix typo. | ||
| 17 | (The Region): Copyedits. | ||
| 18 | |||
| 19 | 2012-03-07 Glenn Morris <rgm@gnu.org> | ||
| 20 | |||
| 21 | * markers.texi (Overview of Markers): Copyedits. | ||
| 22 | (Creating Markers): Update approximate example buffer size. | ||
| 23 | (The Mark): Don't mention uninteresting return values. | ||
| 24 | |||
| 1 | 2012-03-05 Chong Yidong <cyd@gnu.org> | 25 | 2012-03-05 Chong Yidong <cyd@gnu.org> |
| 2 | 26 | ||
| 3 | * positions.texi (Text Lines): Document count-words. | 27 | * positions.texi (Text Lines): Document count-words. |
diff --git a/doc/lispref/markers.texi b/doc/lispref/markers.texi index e8a009de401..25a9fc88fc5 100644 --- a/doc/lispref/markers.texi +++ b/doc/lispref/markers.texi | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | @c -*-texinfo-*- | 1 | @c -*-texinfo-*- |
| 2 | @c This is part of the GNU Emacs Lisp Reference Manual. | 2 | @c This is part of the GNU Emacs Lisp Reference Manual. |
| 3 | @c Copyright (C) 1990-1995, 1998-1999, 2001-2012 Free Software Foundation, Inc. | 3 | @c Copyright (C) 1990-1995, 1998-1999, 2001-2012 Free Software Foundation, Inc. |
| 4 | @c See the file elisp.texi for copying conditions. | 4 | @c See the file elisp.texi for copying conditions. |
| 5 | @setfilename ../../info/markers | 5 | @setfilename ../../info/markers |
| 6 | @node Markers, Text, Positions, Top | 6 | @node Markers, Text, Positions, Top |
| @@ -27,8 +27,8 @@ deleted, so that it stays with the two characters on either side of it. | |||
| 27 | @node Overview of Markers | 27 | @node Overview of Markers |
| 28 | @section Overview of Markers | 28 | @section Overview of Markers |
| 29 | 29 | ||
| 30 | A marker specifies a buffer and a position in that buffer. The | 30 | A marker specifies a buffer and a position in that buffer. A |
| 31 | marker can be used to represent a position in the functions that | 31 | marker can be used to represent a position in functions that |
| 32 | require one, just as an integer could be used. In that case, the | 32 | require one, just as an integer could be used. In that case, the |
| 33 | marker's buffer is normally ignored. Of course, a marker used in this | 33 | marker's buffer is normally ignored. Of course, a marker used in this |
| 34 | way usually points to a position in the buffer that the function | 34 | way usually points to a position in the buffer that the function |
| @@ -38,12 +38,12 @@ operates on, but that is entirely the programmer's responsibility. | |||
| 38 | A marker has three attributes: the marker position, the marker | 38 | A marker has three attributes: the marker position, the marker |
| 39 | buffer, and the insertion type. The marker position is an integer | 39 | buffer, and the insertion type. The marker position is an integer |
| 40 | that is equivalent (at a given time) to the marker as a position in | 40 | that is equivalent (at a given time) to the marker as a position in |
| 41 | that buffer. But the marker's position value can change often during | 41 | that buffer. But the marker's position value can change during |
| 42 | the life of the marker. Insertion and deletion of text in the buffer | 42 | the life of the marker, and often does. Insertion and deletion of |
| 43 | relocate the marker. The idea is that a marker positioned between two | 43 | text in the buffer relocate the marker. The idea is that a marker |
| 44 | characters remains between those two characters despite insertion and | 44 | positioned between two characters remains between those two characters |
| 45 | deletion elsewhere in the buffer. Relocation changes the integer | 45 | despite insertion and deletion elsewhere in the buffer. Relocation |
| 46 | equivalent of the marker. | 46 | changes the integer equivalent of the marker. |
| 47 | 47 | ||
| 48 | @cindex marker relocation | 48 | @cindex marker relocation |
| 49 | Deleting text around a marker's position leaves the marker between the | 49 | Deleting text around a marker's position leaves the marker between the |
| @@ -58,12 +58,12 @@ with @code{insert-before-markers} (@pxref{Insertion}). | |||
| 58 | relocate them if necessary. This slows processing in a buffer with a | 58 | relocate them if necessary. This slows processing in a buffer with a |
| 59 | large number of markers. For this reason, it is a good idea to make a | 59 | large number of markers. For this reason, it is a good idea to make a |
| 60 | marker point nowhere if you are sure you don't need it any more. | 60 | marker point nowhere if you are sure you don't need it any more. |
| 61 | Unreferenced markers are garbage collected eventually, but until then | 61 | Markers that can no longer be accessed are eventually removed |
| 62 | will continue to use time if they do point somewhere. | 62 | (@pxref{Garbage Collection}). |
| 63 | 63 | ||
| 64 | @cindex markers as numbers | 64 | @cindex markers as numbers |
| 65 | Because it is common to perform arithmetic operations on a marker | 65 | Because it is common to perform arithmetic operations on a marker |
| 66 | position, most of the arithmetic operations (including @code{+} and | 66 | position, most of these operations (including @code{+} and |
| 67 | @code{-}) accept markers as arguments. In such cases, the marker | 67 | @code{-}) accept markers as arguments. In such cases, the marker |
| 68 | stands for its current position. | 68 | stands for its current position. |
| 69 | 69 | ||
| @@ -188,7 +188,7 @@ chapter. | |||
| 188 | (point-min-marker) | 188 | (point-min-marker) |
| 189 | @result{} #<marker at 1 in markers.texi> | 189 | @result{} #<marker at 1 in markers.texi> |
| 190 | (point-max-marker) | 190 | (point-max-marker) |
| 191 | @result{} #<marker at 15573 in markers.texi> | 191 | @result{} #<marker at 24080 in markers.texi> |
| 192 | @end group | 192 | @end group |
| 193 | 193 | ||
| 194 | @group | 194 | @group |
| @@ -229,8 +229,8 @@ buffer. | |||
| 229 | @end group | 229 | @end group |
| 230 | 230 | ||
| 231 | @group | 231 | @group |
| 232 | (copy-marker 20000) | 232 | (copy-marker 90000) |
| 233 | @result{} #<marker at 7572 in markers.texi> | 233 | @result{} #<marker at 24080 in markers.texi> |
| 234 | @end group | 234 | @end group |
| 235 | @end example | 235 | @end example |
| 236 | 236 | ||
| @@ -422,11 +422,11 @@ can request deactivation of the mark upon return to the editor command | |||
| 422 | loop by setting the variable @code{deactivate-mark} to a | 422 | loop by setting the variable @code{deactivate-mark} to a |
| 423 | non-@code{nil} value. | 423 | non-@code{nil} value. |
| 424 | 424 | ||
| 425 | If Transient Mode is enabled, certain editing commands that normally | 425 | If Transient Mark mode is enabled, certain editing commands that |
| 426 | apply to text near point, apply instead to the region when the mark is | 426 | normally apply to text near point, apply instead to the region when |
| 427 | active. This is the main motivation for using Transient Mark mode. | 427 | the mark is active. This is the main motivation for using Transient |
| 428 | (Another is that this enables highlighting of the region when the mark | 428 | Mark mode. (Another is that this enables highlighting of the region |
| 429 | is active. @xref{Display}.) | 429 | when the mark is active. @xref{Display}.) |
| 430 | 430 | ||
| 431 | In addition to the mark, each buffer has a @dfn{mark ring} which is a | 431 | In addition to the mark, each buffer has a @dfn{mark ring} which is a |
| 432 | list of markers containing previous values of the mark. When editing | 432 | list of markers containing previous values of the mark. When editing |
| @@ -509,7 +509,8 @@ example: | |||
| 509 | This function sets the current buffer's mark to @var{position}, and | 509 | This function sets the current buffer's mark to @var{position}, and |
| 510 | pushes a copy of the previous mark onto @code{mark-ring}. If | 510 | pushes a copy of the previous mark onto @code{mark-ring}. If |
| 511 | @var{position} is @code{nil}, then the value of point is used. | 511 | @var{position} is @code{nil}, then the value of point is used. |
| 512 | @code{push-mark} returns @code{nil}. | 512 | @c Doesn't seem relevant. |
| 513 | @c @code{push-mark} returns @code{nil}. | ||
| 513 | 514 | ||
| 514 | The function @code{push-mark} normally @emph{does not} activate the | 515 | The function @code{push-mark} normally @emph{does not} activate the |
| 515 | mark. To do that, specify @code{t} for the argument @var{activate}. | 516 | mark. To do that, specify @code{t} for the argument @var{activate}. |
| @@ -523,8 +524,9 @@ This function pops off the top element of @code{mark-ring} and makes | |||
| 523 | that mark become the buffer's actual mark. This does not move point in | 524 | that mark become the buffer's actual mark. This does not move point in |
| 524 | the buffer, and it does nothing if @code{mark-ring} is empty. It | 525 | the buffer, and it does nothing if @code{mark-ring} is empty. It |
| 525 | deactivates the mark. | 526 | deactivates the mark. |
| 526 | 527 | @c | |
| 527 | The return value is not meaningful. | 528 | @c Seems even less relevant. |
| 529 | @c The return value is not meaningful. | ||
| 528 | @end defun | 530 | @end defun |
| 529 | 531 | ||
| 530 | @defopt transient-mark-mode | 532 | @defopt transient-mark-mode |
| @@ -593,8 +595,16 @@ the function @code{use-region-p} for that (@pxref{The Region}). | |||
| 593 | @defvarx deactivate-mark-hook | 595 | @defvarx deactivate-mark-hook |
| 594 | These normal hooks are run, respectively, when the mark becomes active | 596 | These normal hooks are run, respectively, when the mark becomes active |
| 595 | and when it becomes inactive. The hook @code{activate-mark-hook} is | 597 | and when it becomes inactive. The hook @code{activate-mark-hook} is |
| 596 | also run at the end of a command if the mark is active and it is | 598 | also run at the end of the command loop if the mark is active and it |
| 597 | possible that the region may have changed. | 599 | is possible that the region may have changed. |
| 600 | @ignore | ||
| 601 | This piece of command_loop_1, run unless deactivating the mark: | ||
| 602 | if (current_buffer != prev_buffer || MODIFF != prev_modiff) | ||
| 603 | { | ||
| 604 | Lisp_Object hook = intern ("activate-mark-hook"); | ||
| 605 | Frun_hooks (1, &hook); | ||
| 606 | } | ||
| 607 | @end ignore | ||
| 598 | @end defvar | 608 | @end defvar |
| 599 | 609 | ||
| 600 | @defun handle-shift-selection | 610 | @defun handle-shift-selection |
| @@ -634,6 +644,9 @@ more marks than this are pushed onto the @code{mark-ring}, | |||
| 634 | @code{push-mark} discards an old mark when it adds a new one. | 644 | @code{push-mark} discards an old mark when it adds a new one. |
| 635 | @end defopt | 645 | @end defopt |
| 636 | 646 | ||
| 647 | @c There is also global-mark-ring-max, but this chapter explicitly | ||
| 648 | @c does not talk about the global mark. | ||
| 649 | |||
| 637 | @node The Region | 650 | @node The Region |
| 638 | @section The Region | 651 | @section The Region |
| 639 | @cindex region (between point and mark) | 652 | @cindex region (between point and mark) |
| @@ -660,16 +673,23 @@ integer). This is the position of either point or the mark, whichever is | |||
| 660 | larger. | 673 | larger. |
| 661 | @end defun | 674 | @end defun |
| 662 | 675 | ||
| 663 | Few programs need to use the @code{region-beginning} and | 676 | Instead of using @code{region-beginning} and @code{region-end}, a |
| 664 | @code{region-end} functions. A command designed to operate on a region | 677 | command designed to operate on a region should normally use |
| 665 | should normally use @code{interactive} with the @samp{r} specification | 678 | @code{interactive} with the @samp{r} specification to find the |
| 666 | to find the beginning and end of the region. This lets other Lisp | 679 | beginning and end of the region. This lets other Lisp programs |
| 667 | programs specify the bounds explicitly as arguments. (@xref{Interactive | 680 | specify the bounds explicitly as arguments. @xref{Interactive Codes}. |
| 668 | Codes}.) | ||
| 669 | 681 | ||
| 670 | @defun use-region-p | 682 | @defun use-region-p |
| 671 | This function returns @code{t} if Transient Mark mode is enabled, the | 683 | This function returns @code{t} if Transient Mark mode is enabled, the |
| 672 | mark is active, and there's a valid region in the buffer. Commands | 684 | mark is active, and there is a valid region in the buffer. This |
| 673 | that operate on the region (instead of on text near point) when | 685 | function is intended to be used by commands that operate on the |
| 674 | there's an active mark should use this to test whether to do that. | 686 | region, instead of on text near point, when the mark is active. |
| 687 | |||
| 688 | A region is valid if it has a non-zero size, or if the user option | ||
| 689 | @code{use-empty-active-region} is non-@code{nil} (by default, it is | ||
| 690 | @code{nil}). The function @code{region-active-p} is similar to | ||
| 691 | @code{use-region-p}, but considers all regions as valid. In most | ||
| 692 | cases, you should not use @code{region-active-p}, since if the region | ||
| 693 | is empty it is often more appropriate to operate on point. | ||
| 675 | @end defun | 694 | @end defun |
| 695 | |||
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 416bfef4a60..88cb6a157f8 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -169,13 +169,9 @@ convert any portion of the text in the buffer into a string. | |||
| 169 | @defun buffer-substring start end | 169 | @defun buffer-substring start end |
| 170 | This function returns a string containing a copy of the text of the | 170 | This function returns a string containing a copy of the text of the |
| 171 | region defined by positions @var{start} and @var{end} in the current | 171 | region defined by positions @var{start} and @var{end} in the current |
| 172 | buffer. If the arguments are not positions in the accessible portion of | 172 | buffer. If the arguments are not positions in the accessible portion |
| 173 | the buffer, @code{buffer-substring} signals an @code{args-out-of-range} | 173 | of the buffer, @code{buffer-substring} signals an |
| 174 | error. | 174 | @code{args-out-of-range} error. |
| 175 | |||
| 176 | It is not necessary for @var{start} to be less than @var{end}; the | ||
| 177 | arguments can be given in either order. But most often the smaller | ||
| 178 | argument is written first. | ||
| 179 | 175 | ||
| 180 | Here's an example which assumes Font-Lock mode is not enabled: | 176 | Here's an example which assumes Font-Lock mode is not enabled: |
| 181 | 177 | ||
| @@ -218,14 +214,20 @@ This is like @code{buffer-substring}, except that it does not copy text | |||
| 218 | properties, just the characters themselves. @xref{Text Properties}. | 214 | properties, just the characters themselves. @xref{Text Properties}. |
| 219 | @end defun | 215 | @end defun |
| 220 | 216 | ||
| 217 | @defun buffer-string | ||
| 218 | This function returns the contents of the entire accessible portion of | ||
| 219 | the current buffer as a string. It is equivalent to | ||
| 220 | @w{@code{(buffer-substring (point-min) (point-max))}}. | ||
| 221 | @end defun | ||
| 222 | |||
| 221 | @defun filter-buffer-substring start end &optional delete | 223 | @defun filter-buffer-substring start end &optional delete |
| 222 | This function passes the buffer text between @var{start} and @var{end} | 224 | This function passes the buffer text between @var{start} and @var{end} |
| 223 | through the filter functions specified by the wrapper hook | 225 | through the filter functions specified by the wrapper hook |
| 224 | @code{filter-buffer-substring-functions}, and returns the final | 226 | @code{filter-buffer-substring-functions}, and returns the result. The |
| 225 | result of applying all filters. The obsolete variable | 227 | obsolete variable @code{buffer-substring-filters} is also consulted. |
| 226 | @code{buffer-substring-filters} is also consulted. If both of these | 228 | If both of these variables are @code{nil}, the value is the unaltered |
| 227 | variables are @code{nil}, the value is the unaltered text from the | 229 | text from the buffer, i.e.@: what @code{buffer-substring} would |
| 228 | buffer, as @code{buffer-substring} would return. | 230 | return. |
| 229 | 231 | ||
| 230 | If @var{delete} is non-@code{nil}, this function deletes the text | 232 | If @var{delete} is non-@code{nil}, this function deletes the text |
| 231 | between @var{start} and @var{end} after copying it, like | 233 | between @var{start} and @var{end} after copying it, like |
| @@ -260,30 +262,20 @@ this, and so on. The actual return value is the result of all the | |||
| 260 | hook functions acting in sequence. | 262 | hook functions acting in sequence. |
| 261 | @end defvar | 263 | @end defvar |
| 262 | 264 | ||
| 263 | @defun buffer-string | 265 | @defvar buffer-substring-filters |
| 264 | This function returns the contents of the entire accessible portion of | 266 | This variable is obsoleted by |
| 265 | the current buffer as a string. It is equivalent to | 267 | @code{filter-buffer-substring-functions}, but is still supported for |
| 266 | 268 | backward compatibility. Its value should should be a list of | |
| 267 | @example | 269 | functions which accept a single string argument and return another |
| 268 | (buffer-substring (point-min) (point-max)) | 270 | string. @code{filter-buffer-substring} passes the buffer substring to |
| 269 | @end example | 271 | the first function in this list, and the return value of each function |
| 270 | 272 | is passed to the next function. The return value of the last function | |
| 271 | @example | 273 | is passed to @code{filter-buffer-substring-functions}. |
| 272 | @group | 274 | @end defvar |
| 273 | ---------- Buffer: foo ---------- | ||
| 274 | This is the contents of buffer foo | ||
| 275 | |||
| 276 | ---------- Buffer: foo ---------- | ||
| 277 | |||
| 278 | (buffer-string) | ||
| 279 | @result{} "This is the contents of buffer foo\n" | ||
| 280 | @end group | ||
| 281 | @end example | ||
| 282 | @end defun | ||
| 283 | 275 | ||
| 284 | @defun current-word &optional strict really-word | 276 | @defun current-word &optional strict really-word |
| 285 | This function returns the symbol (or word) at or near point, as a string. | 277 | This function returns the symbol (or word) at or near point, as a |
| 286 | The return value includes no text properties. | 278 | string. The return value includes no text properties. |
| 287 | 279 | ||
| 288 | If the optional argument @var{really-word} is non-@code{nil}, it finds a | 280 | If the optional argument @var{really-word} is non-@code{nil}, it finds a |
| 289 | word; otherwise, it finds a symbol (which includes both word | 281 | word; otherwise, it finds a symbol (which includes both word |
| @@ -1112,13 +1104,11 @@ case, the first string is used as the ``most recent kill'', and all | |||
| 1112 | the other strings are pushed onto the kill ring, for easy access by | 1104 | the other strings are pushed onto the kill ring, for easy access by |
| 1113 | @code{yank-pop}. | 1105 | @code{yank-pop}. |
| 1114 | 1106 | ||
| 1115 | The normal use of this function is to get the window system's primary | 1107 | The normal use of this function is to get the window system's |
| 1116 | selection as the most recent kill, even if the selection belongs to | 1108 | clipboard as the most recent kill, even if the selection belongs to |
| 1117 | another application. @xref{Window System Selections}. However, if | 1109 | another application. @xref{Window System Selections}. However, if |
| 1118 | the selection was provided by the current Emacs session, this function | 1110 | the clipboard contents come from the current Emacs session, this |
| 1119 | should return @code{nil}. (If it is hard to tell whether Emacs or | 1111 | function should return @code{nil}. |
| 1120 | some other program provided the selection, it should be good enough to | ||
| 1121 | use @code{string=} to compare it with the last text Emacs provided.) | ||
| 1122 | @end defvar | 1112 | @end defvar |
| 1123 | 1113 | ||
| 1124 | @defvar interprogram-cut-function | 1114 | @defvar interprogram-cut-function |
| @@ -1129,9 +1119,8 @@ programs, when you are using a window system. Its value should be | |||
| 1129 | If the value is a function, @code{kill-new} and @code{kill-append} call | 1119 | If the value is a function, @code{kill-new} and @code{kill-append} call |
| 1130 | it with the new first element of the kill ring as the argument. | 1120 | it with the new first element of the kill ring as the argument. |
| 1131 | 1121 | ||
| 1132 | The normal use of this function is to set the window system's primary | 1122 | The normal use of this function is to put newly killed text in the |
| 1133 | selection from the newly killed text. | 1123 | window system's clipboard. @xref{Window System Selections}. |
| 1134 | @xref{Window System Selections}. | ||
| 1135 | @end defvar | 1124 | @end defvar |
| 1136 | 1125 | ||
| 1137 | @node Internals of Kill Ring | 1126 | @node Internals of Kill Ring |
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: |