/[emacs]/emacs/lisp/button.el
ViewVC logotype

Diff of /emacs/lisp/button.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12.6.1 by handa, Fri Apr 16 12:49:48 2004 UTC revision 1.12.6.2 by miles, Thu Oct 14 08:50:01 2004 UTC
# Line 78  Mode-specific keymaps may want to use th Line 78  Mode-specific keymaps may want to use th
78  (put 'default-button 'mouse-face 'highlight)  (put 'default-button 'mouse-face 'highlight)
79  (put 'default-button 'keymap button-map)  (put 'default-button 'keymap button-map)
80  (put 'default-button 'type 'button)  (put 'default-button 'type 'button)
81    ;; action may be either a function to call, or a marker to go to
82  (put 'default-button 'action 'ignore)  (put 'default-button 'action 'ignore)
83  (put 'default-button 'help-echo "mouse-2, RET: Push this button")  (put 'default-button 'help-echo "mouse-2, RET: Push this button")
84  ;; Make overlay buttons go away if their underlying text is deleted.  ;; Make overlay buttons go away if their underlying text is deleted.
# Line 217  changes to a supertype are not reflected Line 218  changes to a supertype are not reflected
218  If USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action  If USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action
219  instead of its normal action; if the button has no mouse-action,  instead of its normal action; if the button has no mouse-action,
220  the normal action is used instead."  the normal action is used instead."
221    (funcall (or (and use-mouse-action (button-get button 'mouse-action))    (let ((action (or (and use-mouse-action (button-get button 'mouse-action))
222                 (button-get button 'action))                      (button-get button 'action))))
223             button))      (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))))
229    
230  (defun button-label (button)  (defun button-label (button)
231    "Return BUTTON's text label."    "Return BUTTON's text label."
# Line 373  instead of starting at the next button." Line 379  instead of starting at the next button."
379    
380  (defun push-button (&optional pos use-mouse-action)  (defun push-button (&optional pos use-mouse-action)
381    "Perform the action specified by a button at location POS.    "Perform the action specified by a button at location POS.
382  POS may be either a buffer position or a mouse-event.  POS may be either a buffer position or a mouse-event.  If
383  If USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action  USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action
384  instead of its normal action; if the button has no mouse-action,  instead of its normal action; if the button has no mouse-action,
385  the normal action is used instead.  the normal action is used instead.  The action may be either a
386    function to call or a marker to display.
387  POS defaults to point, except when `push-button' is invoked  POS defaults to point, except when `push-button' is invoked
388  interactively as the result of a mouse-event, in which case, the  interactively as the result of a mouse-event, in which case, the
389  mouse event is used.  mouse event is used.

Legend:
Removed from v.1.12.6.1  
changed lines
  Added in v.1.12.6.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26