1 |
;;; help-at-pt.el --- local help through the keyboard |
;;; help-at-pt.el --- local help through the keyboard |
2 |
|
|
3 |
;; Copyright (C) 2003 Free Software Foundation, Inc. |
;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. |
4 |
|
|
5 |
;; Author: Luc Teirlinck <teirllm@auburn.edu> |
;; Author: Luc Teirlinck <teirllm@auburn.edu> |
6 |
;; Keywords: help |
;; Keywords: help |
98 |
(message "%s" help) |
(message "%s" help) |
99 |
(if (not arg) (message "No local help at point"))))) |
(if (not arg) (message "No local help at point"))))) |
100 |
|
|
101 |
|
(defvar help-at-pt-timer nil |
102 |
|
"Non-nil means that a timer is set that checks for local help. |
103 |
|
If non-nil, this is the value returned by the call of |
104 |
|
`run-with-idle-timer' that set that timer. This variable is used |
105 |
|
internally to enable `help-at-pt-display-when-idle'. Do not set it |
106 |
|
yourself.") |
107 |
|
|
108 |
(defcustom help-at-pt-timer-delay 1 |
(defcustom help-at-pt-timer-delay 1 |
109 |
"*Delay before displaying local help. |
"*Delay before displaying local help. |
110 |
This is used if `help-at-pt-display-when-idle' is enabled. |
This is used if `help-at-pt-display-when-idle' is enabled. |
119 |
new value." |
new value." |
120 |
:group 'help-at-pt |
:group 'help-at-pt |
121 |
:type 'number |
:type 'number |
122 |
|
:initialize 'custom-initialize-default |
123 |
:set (lambda (variable value) |
:set (lambda (variable value) |
124 |
(set-default variable value) |
(set-default variable value) |
125 |
(when (and (boundp 'help-at-pt-timer) help-at-pt-timer) |
(and (boundp 'help-at-pt-timer) |
126 |
(timer-set-idle-time help-at-pt-timer value t)))) |
help-at-pt-timer |
127 |
|
(timer-set-idle-time help-at-pt-timer value t))) |
128 |
(defvar help-at-pt-timer nil |
:version "21.4") |
|
"Non-nil means that a timer is set that checks for local help. |
|
|
If non-nil, this is the value returned by the call of |
|
|
`run-with-idle-timer' that set that timer. This variable is used |
|
|
internally to enable `help-at-pt-display-when-idle'. Do not set it |
|
|
yourself.") |
|
129 |
|
|
130 |
;;;###autoload |
;;;###autoload |
131 |
(defun help-at-pt-cancel-timer () |
(defun help-at-pt-cancel-timer () |
147 |
(run-with-idle-timer |
(run-with-idle-timer |
148 |
help-at-pt-timer-delay t #'help-at-pt-maybe-display)))) |
help-at-pt-timer-delay t #'help-at-pt-maybe-display)))) |
149 |
|
|
|
;;;###autoload |
|
150 |
(defcustom help-at-pt-display-when-idle 'never |
(defcustom help-at-pt-display-when-idle 'never |
151 |
"*Automatically show local help on point-over. |
"*Automatically show local help on point-over. |
152 |
If the value is t, the string obtained from any `kbd-help' or |
If the value is t, the string obtained from any `kbd-help' or |
228 |
(help-at-pt-cancel-timer) |
(help-at-pt-cancel-timer) |
229 |
(help-at-pt-set-timer))) |
(help-at-pt-set-timer))) |
230 |
:set-after '(help-at-pt-timer-delay) |
:set-after '(help-at-pt-timer-delay) |
231 |
:require 'help-at-pt) |
:require 'help-at-pt |
232 |
|
:version "21.4") |
233 |
|
|
234 |
;; Function for use in `help-at-pt-set-timer'. |
;; Function for use in `help-at-pt-set-timer'. |
235 |
(defun help-at-pt-maybe-display () |
(defun help-at-pt-maybe-display () |