diff options
| author | Miles Bader | 2004-10-14 08:50:09 +0000 |
|---|---|---|
| committer | Miles Bader | 2004-10-14 08:50:09 +0000 |
| commit | 91900dd736dc0ab57a38da1fa9daa5ddde487bfb (patch) | |
| tree | f592b350cad8a3a6bd196722bb553469c5781c1a /lisp/button.el | |
| parent | 2beba76dd5f6e3f1fcf9cba8b66e465ae9e20519 (diff) | |
| parent | ebbeed623cb9902e520fc67d6d271e222e16867f (diff) | |
| download | emacs-91900dd736dc0ab57a38da1fa9daa5ddde487bfb.tar.gz emacs-91900dd736dc0ab57a38da1fa9daa5ddde487bfb.zip | |
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-57
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-594
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-598
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-599
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-600
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-602
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-603
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-604
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-609
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-610
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-611
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-614
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-615
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-42
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-43
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-44
- miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-46
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-47
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-48
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-49
Add {arch}/=commit-merge-make-log
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-50
{arch}/=commit-merge-make-log: Don't die if there are no ChangeLog changes
Diffstat (limited to 'lisp/button.el')
| -rw-r--r-- | lisp/button.el | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/button.el b/lisp/button.el index 35905b9e1e4..dcd26846d10 100644 --- a/lisp/button.el +++ b/lisp/button.el | |||
| @@ -78,6 +78,7 @@ Mode-specific keymaps may want to use this as their parent keymap.") | |||
| 78 | (put 'default-button 'mouse-face 'highlight) | 78 | (put 'default-button 'mouse-face 'highlight) |
| 79 | (put 'default-button 'keymap button-map) | 79 | (put 'default-button 'keymap button-map) |
| 80 | (put 'default-button 'type 'button) | 80 | (put 'default-button 'type 'button) |
| 81 | ;; action may be either a function to call, or a marker to go to | ||
| 81 | (put 'default-button 'action 'ignore) | 82 | (put 'default-button 'action 'ignore) |
| 82 | (put 'default-button 'help-echo "mouse-2, RET: Push this button") | 83 | (put 'default-button 'help-echo "mouse-2, RET: Push this button") |
| 83 | ;; Make overlay buttons go away if their underlying text is deleted. | 84 | ;; Make overlay buttons go away if their underlying text is deleted. |
| @@ -217,9 +218,14 @@ changes to a supertype are not reflected in its subtypes)." | |||
| 217 | If USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action | 218 | If USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action |
| 218 | instead of its normal action; if the button has no mouse-action, | 219 | instead of its normal action; if the button has no mouse-action, |
| 219 | the normal action is used instead." | 220 | the normal action is used instead." |
| 220 | (funcall (or (and use-mouse-action (button-get button 'mouse-action)) | 221 | (let ((action (or (and use-mouse-action (button-get button 'mouse-action)) |
| 221 | (button-get button 'action)) | 222 | (button-get button 'action)))) |
| 222 | button)) | 223 | (if (markerp action) |
| 224 | (save-selected-window | ||
| 225 | (select-window (display-buffer (marker-buffer action))) | ||
| 226 | (goto-char action) | ||
| 227 | (recenter 0)) | ||
| 228 | (funcall action button)))) | ||
| 223 | 229 | ||
| 224 | (defun button-label (button) | 230 | (defun button-label (button) |
| 225 | "Return BUTTON's text label." | 231 | "Return BUTTON's text label." |
| @@ -373,10 +379,11 @@ instead of starting at the next button." | |||
| 373 | 379 | ||
| 374 | (defun push-button (&optional pos use-mouse-action) | 380 | (defun push-button (&optional pos use-mouse-action) |
| 375 | "Perform the action specified by a button at location POS. | 381 | "Perform the action specified by a button at location POS. |
| 376 | POS may be either a buffer position or a mouse-event. | 382 | POS may be either a buffer position or a mouse-event. If |
| 377 | If USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action | 383 | USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action |
| 378 | instead of its normal action; if the button has no mouse-action, | 384 | instead of its normal action; if the button has no mouse-action, |
| 379 | the normal action is used instead. | 385 | the normal action is used instead. The action may be either a |
| 386 | function to call or a marker to display. | ||
| 380 | POS defaults to point, except when `push-button' is invoked | 387 | POS defaults to point, except when `push-button' is invoked |
| 381 | interactively as the result of a mouse-event, in which case, the | 388 | interactively as the result of a mouse-event, in which case, the |
| 382 | mouse event is used. | 389 | mouse event is used. |