Error if ps-lpr-switches is not a list.
[bpt/emacs.git] / lisp / help-at-pt.el
index 3d01ed6..f14b00c 100644 (file)
@@ -1,6 +1,6 @@
 ;;; help-at-pt.el --- local help through the keyboard
 
-;; Copyright (C) 2003 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Luc Teirlinck <teirllm@auburn.edu>
 ;; Keywords: help
@@ -9,7 +9,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -19,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
 ;; previous region with available local help and print the help found
 ;; there.
 ;;
+;; Suggested key bindings:
+;;
+;; (global-set-key [C-tab] 'scan-buf-next-region)
+;; (global-set-key [C-M-tab] 'scan-buf-previous-region)
+;;
 ;; You do not have to do anything special to use the functionality
 ;; provided by this file, because all important functions autoload.
 
@@ -48,7 +53,7 @@
 (defgroup help-at-pt nil
   "Features for displaying local help."
   :group 'help
-  :version "21.4")
+  :version "22.1")
 
 ;;;###autoload
 (defun help-at-pt-string (&optional kbd)
@@ -93,6 +98,13 @@ mainly meant for use from Lisp."
        (message "%s" help)
       (if (not arg) (message "No local help at point")))))
 
+(defvar help-at-pt-timer nil
+  "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.")
+
 (defcustom help-at-pt-timer-delay 1
   "*Delay before displaying local help.
 This is used if `help-at-pt-display-when-idle' is enabled.
@@ -101,23 +113,18 @@ The value may be an integer or floating point number.
 If a timer is already active, there are two ways to make the new
 value take effect immediately.  After setting the value, you can
 first call `help-at-pt-cancel-timer' and then set a new timer
-with `help-at-pt-set-timer' .  Alternatively, you can set this
+with `help-at-pt-set-timer'.  Alternatively, you can set this
 variable through Custom.  This will not set a timer if none is
 active, but if one is already active, Custom will make it use the
 new value."
   :group 'help-at-pt
   :type 'number
+  :initialize 'custom-initialize-default
   :set (lambda (variable value)
         (set-default variable value)
-        (when (and (boundp 'help-at-pt-timer) help-at-pt-timer)
-          (timer-set-idle-time help-at-pt-timer value t))))
-
-(defvar help-at-pt-timer nil
-  "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.")
+        (and (boundp 'help-at-pt-timer)
+             help-at-pt-timer
+             (timer-set-idle-time help-at-pt-timer value t))))
 
 ;;;###autoload
 (defun help-at-pt-cancel-timer ()
@@ -239,7 +246,7 @@ properties, to enable buffer local values."
 (defun scan-buf-move-to-region (prop &optional arg hook)
   "Go to the start of the next region with non-nil PROP property.
 Then run HOOK, which should be a quoted symbol that is a normal
-hook.variable, or an expression evaluating to such a symbol.
+hook variable, or an expression evaluating to such a symbol.
 Adjacent areas with different non-nil PROP properties are
 considered different regions.
 
@@ -343,14 +350,6 @@ different regions.  With numeric argument ARG, behaves like
   (interactive "p")
   (scan-buf-move-to-region 'help-echo (- arg) 'scan-buf-move-hook))
 
-(defvar help-at-pt-unload-hook '(help-at-pt-cancel-timer)
-  "Normal hook run when `help-at-pt' is unloaded.")
-
-;; Suggested key bindings:
-;;
-;; (global-set-key [C-tab] 'scan-buf-next-region)
-;; (global-set-key [C-M-tab] 'scan-buf-previous-region)
-
 (provide 'help-at-pt)
 
 ;;; arch-tag: d0b8b86d-d23f-45d0-a82d-208d6205a583