emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/button.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/button.el [lexbind]
Date: Mon, 25 Oct 2004 00:43:23 -0400

Index: emacs/lisp/button.el
diff -c emacs/lisp/button.el:1.11.4.2 emacs/lisp/button.el:1.11.4.3
*** emacs/lisp/button.el:1.11.4.2       Tue Oct 14 23:50:49 2003
--- emacs/lisp/button.el        Mon Oct 25 04:19:40 2004
***************
*** 78,83 ****
--- 78,84 ----
  (put 'default-button 'mouse-face 'highlight)
  (put 'default-button 'keymap button-map)
  (put 'default-button 'type 'button)
+ ;; action may be either a function to call, or a marker to go to
  (put 'default-button 'action 'ignore)
  (put 'default-button 'help-echo "mouse-2, RET: Push this button")
  ;; Make overlay buttons go away if their underlying text is deleted.
***************
*** 217,225 ****
  If USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action
  instead of its normal action; if the button has no mouse-action,
  the normal action is used instead."
!   (funcall (or (and use-mouse-action (button-get button 'mouse-action))
!              (button-get button 'action))
!          button))
  
  (defun button-label (button)
    "Return BUTTON's text label."
--- 218,231 ----
  If USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action
  instead of its normal action; if the button has no mouse-action,
  the normal action is used instead."
!   (let ((action (or (and use-mouse-action (button-get button 'mouse-action))
!                   (button-get button 'action))))
!     (if (markerp action)
!       (save-selected-window
!         (select-window (display-buffer (marker-buffer action)))
!         (goto-char action)
!         (recenter 0))
!       (funcall action button))))
  
  (defun button-label (button)
    "Return BUTTON's text label."
***************
*** 373,382 ****
  
  (defun push-button (&optional pos use-mouse-action)
    "Perform the action specified by a button at location POS.
! POS may be either a buffer position or a mouse-event.
! If USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action
  instead of its normal action; if the button has no mouse-action,
! the normal action is used instead.
  POS defaults to point, except when `push-button' is invoked
  interactively as the result of a mouse-event, in which case, the
  mouse event is used.
--- 379,389 ----
  
  (defun push-button (&optional pos use-mouse-action)
    "Perform the action specified by a button at location POS.
! POS may be either a buffer position or a mouse-event.  If
! USE-MOUSE-ACTION is non-nil, invoke the button's mouse-action
  instead of its normal action; if the button has no mouse-action,
! the normal action is used instead.  The action may be either a
! function to call or a marker to display.
  POS defaults to point, except when `push-button' is invoked
  interactively as the result of a mouse-event, in which case, the
  mouse event is used.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]