[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/tooltip.el
From: |
Nick Roberts |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/tooltip.el |
Date: |
Wed, 09 Mar 2005 18:19:00 -0500 |
Index: emacs/lisp/tooltip.el
diff -c emacs/lisp/tooltip.el:1.40 emacs/lisp/tooltip.el:1.41
*** emacs/lisp/tooltip.el:1.40 Tue Feb 22 09:42:23 2005
--- emacs/lisp/tooltip.el Wed Mar 9 23:19:00 2005
***************
*** 1,6 ****
;;; tooltip.el --- show tooltip windows
! ;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004
;; Free Software Foundation, Inc.
;; Author: Gerd Moellmann <address@hidden>
--- 1,6 ----
;;; tooltip.el --- show tooltip windows
! ;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005
;; Free Software Foundation, Inc.
;; Author: Gerd Moellmann <address@hidden>
***************
*** 41,48 ****
:version "21.1"
:tag "Tool Tips")
- (defvar tooltip-mode)
-
(defcustom tooltip-delay 0.7
"Seconds to wait before displaying a tooltip the first time."
:tag "Delay"
--- 41,46 ----
***************
*** 122,132 ****
"*Non-nil means show tooltips in GUD sessions."
:type 'boolean
:tag "GUD"
- :set #'(lambda (symbol on)
- (setq tooltip-gud-tips-p on))
:group 'tooltip)
! (defcustom tooltip-gud-modes '(gud-mode c-mode c++-mode)
"List of modes for which to enable GUD tips."
:type 'sexp
:tag "GUD modes"
--- 120,128 ----
"*Non-nil means show tooltips in GUD sessions."
:type 'boolean
:tag "GUD"
:group 'tooltip)
! (defcustom tooltip-gud-modes '(gud-mode c-mode c++-mode fortran-mode)
"List of modes for which to enable GUD tips."
:type 'sexp
:tag "GUD modes"
***************
*** 187,212 ****
;; would be accompanied by a full redisplay.
;;;###autoload
! (defun tooltip-mode (&optional arg)
! "Mode for tooltip display.
With ARG, turn tooltip mode on if and only if ARG is positive."
! (interactive "P")
(unless (fboundp 'x-show-tip)
(error "Sorry, tooltips are not yet available on this system"))
! (let* ((on (if arg
! (> (prefix-numeric-value arg) 0)
! (not tooltip-mode)))
! (hook-fn (if on 'add-hook 'remove-hook)))
! (setq tooltip-mode on)
(funcall hook-fn 'change-major-mode-hook 'tooltip-change-major-mode)
(tooltip-activate-mouse-motions-if-enabled)
(funcall hook-fn 'pre-command-hook 'tooltip-hide)
(funcall hook-fn 'tooltip-hook 'tooltip-gud-tips)
(funcall hook-fn 'tooltip-hook 'tooltip-help-tips)
! (setq show-help-function (if on 'tooltip-show-help-function nil))
;; `ignore' is the default binding for mouse movements.
(define-key global-map [mouse-movement]
! (if on 'tooltip-mouse-motion 'ignore))))
;;; Timeout for tooltip display
--- 183,205 ----
;; would be accompanied by a full redisplay.
;;;###autoload
! (define-minor-mode tooltip-mode
! "Toggle Tooltip display.
With ARG, turn tooltip mode on if and only if ARG is positive."
! :global t
! :group 'tooltip
(unless (fboundp 'x-show-tip)
(error "Sorry, tooltips are not yet available on this system"))
! (let ((hook-fn (if tooltip-mode 'add-hook 'remove-hook)))
(funcall hook-fn 'change-major-mode-hook 'tooltip-change-major-mode)
(tooltip-activate-mouse-motions-if-enabled)
(funcall hook-fn 'pre-command-hook 'tooltip-hide)
(funcall hook-fn 'tooltip-hook 'tooltip-gud-tips)
(funcall hook-fn 'tooltip-hook 'tooltip-help-tips)
! (setq show-help-function (if tooltip-mode 'tooltip-show-help-function
nil))
;; `ignore' is the default binding for mouse movements.
(define-key global-map [mouse-movement]
! (if tooltip-mode 'tooltip-mouse-motion 'ignore))))
;;; Timeout for tooltip display
***************
*** 246,261 ****
(defun tooltip-activate-mouse-motions-if-enabled ()
"Reconsider for all buffers whether mouse motion events are desired."
(remove-hook 'post-command-hook 'tooltip-activate-mouse-motions-if-enabled)
! (let ((buffers (buffer-list)))
(save-excursion
! (while buffers
! (set-buffer (car buffers))
! (if (and tooltip-mode
! tooltip-gud-tips-p
! (memq major-mode tooltip-gud-modes))
! (tooltip-activate-mouse-motions t)
! (tooltip-activate-mouse-motions nil))
! (setq buffers (cdr buffers))))))
(defvar tooltip-mouse-motions-active nil
"Locally t in a buffer if tooltip processing of mouse motion is enabled.")
--- 239,252 ----
(defun tooltip-activate-mouse-motions-if-enabled ()
"Reconsider for all buffers whether mouse motion events are desired."
(remove-hook 'post-command-hook 'tooltip-activate-mouse-motions-if-enabled)
! (dolist (buffer (buffer-list))
(save-excursion
! (set-buffer buffer)
! (if (and tooltip-mode
! tooltip-gud-tips-p
! (memq major-mode tooltip-gud-modes))
! (tooltip-activate-mouse-motions t)
! (tooltip-activate-mouse-motions nil)))))
(defvar tooltip-mouse-motions-active nil
"Locally t in a buffer if tooltip processing of mouse motion is enabled.")
***************
*** 441,452 ****
add a `*' in front of the printed expression.
This function must return nil if it doesn't handle EVENT."
! (let (gud-buffer process)
(when (and (eventp event)
tooltip-gud-tips-p
(boundp 'gud-comint-buffer)
! (setq gud-buffer gud-comint-buffer)
! (setq process (get-buffer-process gud-buffer))
(posn-point (event-end event))
(progn (setq tooltip-gud-event event)
(eval (cons 'and tooltip-gud-display))))
--- 432,442 ----
add a `*' in front of the printed expression.
This function must return nil if it doesn't handle EVENT."
! (let (process)
(when (and (eventp event)
tooltip-gud-tips-p
(boundp 'gud-comint-buffer)
! (setq process (get-buffer-process gud-comint-buffer))
(posn-point (event-end event))
(progn (setq tooltip-gud-event event)
(eval (cons 'and tooltip-gud-display))))
***************
*** 464,472 ****
expr)))))))
(defun gdb-tooltip-print ()
! (tooltip-show
(with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
! (buffer-string))))
;;; Tooltip help.
--- 454,464 ----
expr)))))))
(defun gdb-tooltip-print ()
! (tooltip-show
(with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
! (let ((string (buffer-string)))
! ;; remove newline for tooltip-use-echo-area
! (substring string 0 (- (length string) 1))))))
;;; Tooltip help.
***************
*** 520,542 ****
(tooltip-show tooltip-help-message)
t))
-
- ;;; Do this after all functions have been defined that are called from
- ;;; `tooltip-mode'. The actual default value of `tooltip-mode' is set
- ;;; in startup.el.
-
- ;;;###autoload
- (defcustom tooltip-mode nil
- "Non-nil if Tooltip mode is enabled.
- Setting this variable directly does not take effect;
- use either \\[customize] or the function `tooltip-mode'."
- :set (lambda (symbol value)
- (tooltip-mode (or value 0)))
- :initialize 'custom-initialize-default
- :type 'boolean
- :require 'tooltip
- :group 'tooltip)
-
(provide 'tooltip)
;; arch-tag: 3d61135e-4618-4a78-af28-183f6df5636f
--- 512,517 ----
- [Emacs-diffs] Changes to emacs/lisp/tooltip.el,
Nick Roberts <=
- [Emacs-diffs] Changes to emacs/lisp/tooltip.el, Stefan Monnier, 2005/03/10
- [Emacs-diffs] Changes to emacs/lisp/tooltip.el, Kim F . Storm, 2005/03/21
- [Emacs-diffs] Changes to emacs/lisp/tooltip.el, Kim F . Storm, 2005/03/22
- [Emacs-diffs] Changes to emacs/lisp/tooltip.el, Nick Roberts, 2005/03/30
- [Emacs-diffs] Changes to emacs/lisp/tooltip.el, Kim F . Storm, 2005/03/31